v1.0.2: share brand icons with sibling plugins (window.__dshModelBrands)
This commit is contained in:
1 parent
81630ed477
commit
6e8f93cab3
3 files changed
+11
-1
No files matched your search
@@ -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',
|
||||||
|
|||||||
@@ -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
@@ -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" },
|
||||||
|
|||||||
Reference in new issue
Block a user