v1.0.2: share brand icons with sibling plugins (window.__dshModelBrands)

This commit is contained in:
Agent committed 2026-10-11 00:54:36 +00:00
1 parent 81630ed477
commit 6e8f93cab3
3 files changed
+11 -1

No files matched your search

+5
View File
@@ -750,6 +750,11 @@ window.__ModuleLoader__.load({
inject: ['slots', 'locale', 'sessions', 'remote', 'remote.session', 'modelDirectories'], inject: ['slots', 'locale', 'sessions', 'remote', 'remote.session', 'modelDirectories'],
apply(ctx) { apply(ctx) {
ctx.effect(() => ctx.locale.register(NS, { en, zh }), 'model-selector-plus: dictionaries'); ctx.effect(() => ctx.locale.register(NS, { en, zh }), 'model-selector-plus: dictionaries');
// Share brand icons with sibling plugins (e.g. omp-advisor's picker) without duplicating SVGs.
ctx.effect(() => {
window.__dshModelBrands = { brandOf, BrandIcon };
return () => { if (window.__dshModelBrands?.brandOf === brandOf) delete window.__dshModelBrands; };
}, 'model-selector-plus: brand icons');
// Priority -1 shadows the stock occupant (lowest priority renders). // Priority -1 shadows the stock occupant (lowest priority renders).
ctx.slots.inject('conversation.input.model', () => ctx.slots.register({ ctx.slots.inject('conversation.input.model', () => ctx.slots.register({
name: 'conversation.input.model', name: 'conversation.input.model',
+5
View File
@@ -750,6 +750,11 @@ window.__ModuleLoader__.load({
inject: ['slots', 'locale', 'sessions', 'remote', 'remote.session', 'modelDirectories'], inject: ['slots', 'locale', 'sessions', 'remote', 'remote.session', 'modelDirectories'],
apply(ctx) { apply(ctx) {
ctx.effect(() => ctx.locale.register(NS, { en, zh }), 'model-selector-plus: dictionaries'); ctx.effect(() => ctx.locale.register(NS, { en, zh }), 'model-selector-plus: dictionaries');
// Share brand icons with sibling plugins (e.g. omp-advisor's picker) without duplicating SVGs.
ctx.effect(() => {
window.__dshModelBrands = { brandOf, BrandIcon };
return () => { if (window.__dshModelBrands?.brandOf === brandOf) delete window.__dshModelBrands; };
}, 'model-selector-plus: brand icons');
// Priority -1 shadows the stock occupant (lowest priority renders). // Priority -1 shadows the stock occupant (lowest priority renders).
ctx.slots.inject('conversation.input.model', () => ctx.slots.register({ ctx.slots.inject('conversation.input.model', () => ctx.slots.register({
name: 'conversation.input.model', name: 'conversation.input.model',
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@local/model-selector-plus", "name": "@local/model-selector-plus",
"version": "1.0.1", "version": "1.0.2",
"private": true, "private": true,
"type": "module", "type": "module",
"exports": { ".": "./index.js", "./client": "./client.js" }, "exports": { ".": "./index.js", "./client": "./client.js" },