@sunshaobei/dsh-session-manager 3.0.7 → 3.0.8
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 +9 -11
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -2139,8 +2139,9 @@ window.__ModuleLoader__.load({
|
|
|
2139
2139
|
// 约等于视口 < 800px)就整项消失,这正是「设置里没有会话回收站」的真正原因。
|
|
2140
2140
|
// 25 落在 20(mnemon「Memory System」)与 30(cost-meter「Cost」)之间,
|
|
2141
2141
|
// 属于最上面几项,任何能看见设置导航的窗口都能看见它。
|
|
2142
|
-
// 插件管理二级页(plugins.bundle.config,同 dsh-context
|
|
2143
|
-
|
|
2142
|
+
// 插件管理二级页(plugins.bundle.config,同 dsh-context):
|
|
2143
|
+
// key 必须等于插件包名(页面用 configured = bundles.has(pkg.name) 决定是否渲染配置区)。
|
|
2144
|
+
const CFG_KEY = '@sunshaobei/dsh-session-manager';
|
|
2144
2145
|
const settingsStore = (() => {
|
|
2145
2146
|
let form; let state = {}; const listeners = new Set();
|
|
2146
2147
|
const notify = () => listeners.forEach((fn) => fn());
|
|
@@ -2153,16 +2154,13 @@ window.__ModuleLoader__.load({
|
|
|
2153
2154
|
})();
|
|
2154
2155
|
const registerPluginsPageCard = (env) => {
|
|
2155
2156
|
const cf = env && env.configForms;
|
|
2156
|
-
if (
|
|
2157
|
-
ctx.
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
ctx
|
|
2161
|
-
{ name: 'plugins.bundle.config', key: CFG_NS, inject: () => ({ hooks: { sessionTrash: settingsStore }, set: (k, v) => settingsStore.set(k, v) }) },
|
|
2162
|
-
(props) => TrashTab({ ...props, ctx })
|
|
2163
|
-
)
|
|
2157
|
+
if (cf && typeof cf.get === 'function') { try { settingsStore.attach(cf.get(CFG_KEY)); } catch {} }
|
|
2158
|
+
ctx.slots.inject('plugins.bundle.config', () =>
|
|
2159
|
+
ctx.slots.register(
|
|
2160
|
+
{ name: 'plugins.bundle.config', key: CFG_KEY, inject: () => ({ hooks: { sessionTrash: settingsStore }, set: (k, v) => settingsStore.set(k, v) }) },
|
|
2161
|
+
(props) => TrashTab({ ...props, ctx })
|
|
2164
2162
|
)
|
|
2165
|
-
)
|
|
2163
|
+
);
|
|
2166
2164
|
};
|
|
2167
2165
|
if (typeof ctx.inject === 'function') ctx.inject(['configForms'], registerPluginsPageCard);
|
|
2168
2166
|
else registerPluginsPageCard(ctx);
|
package/package.json
CHANGED