@sunshaobei/dsh-session-manager 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +16 -12
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -251,7 +251,8 @@ window.__ModuleLoader__.load({
|
|
|
251
251
|
try {
|
|
252
252
|
active = hostLocale?.getLocale?.()?.active ?? hostLocale?.getSnapshot?.()?.active;
|
|
253
253
|
} catch { /* service teardown — fall back to the browser */ }
|
|
254
|
-
return /^zh(?:-|$)/i.test(String(active
|
|
254
|
+
if (String(active || '').trim() !== '') return /^zh(?:-|$)/i.test(String(active)) ? 'zh' : 'en';
|
|
255
|
+
return 'zh'; // no host locale service — the desktop app is zh-CN, default to Chinese
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
function t(key, params = {}) {
|
|
@@ -2138,17 +2139,20 @@ window.__ModuleLoader__.load({
|
|
|
2138
2139
|
// 约等于视口 < 800px)就整项消失,这正是「设置里没有会话回收站」的真正原因。
|
|
2139
2140
|
// 25 落在 20(mnemon「Memory System」)与 30(cost-meter「Cost」)之间,
|
|
2140
2141
|
// 属于最上面几项,任何能看见设置导航的窗口都能看见它。
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2142
|
+
// 插件管理二级页(plugins.bundle.config):回收站管理面板,不再占用设置页。
|
|
2143
|
+
// 参考 dsh-context:配置命名空间由 configForms 服务托管;没有该服务时直接注册。
|
|
2144
|
+
const registerPluginsPageCard = (env) => {
|
|
2145
|
+
const cf = env && env.configForms;
|
|
2146
|
+
const serve = cf && typeof cf.whileServed === 'function' ? (fn) => cf.whileServed(['session-trash'], fn) : (fn) => fn();
|
|
2147
|
+
serve(() => ctx.slots.inject('plugins.bundle.config', () =>
|
|
2148
|
+
ctx.slots.register(
|
|
2149
|
+
{ name: 'plugins.bundle.config', key: 'session-trash' },
|
|
2150
|
+
(props) => TrashTab({ ...props, ctx })
|
|
2151
|
+
)
|
|
2152
|
+
));
|
|
2153
|
+
};
|
|
2154
|
+
if (typeof ctx.inject === 'function') ctx.inject(['configForms'], registerPluginsPageCard);
|
|
2155
|
+
else registerPluginsPageCard(ctx);
|
|
2152
2156
|
|
|
2153
2157
|
ctx.slots.inject('conversation.session.header.actions', () =>
|
|
2154
2158
|
ctx.slots.register(
|
package/package.json
CHANGED