@linxin666/dsh-remote-web-ui 0.1.18 → 0.1.19
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/lib/client.js +34 -8
- package/lib/client.js.map +1 -1
- package/lib/index.js +18 -18
- package/lib/types/client/RemoteSettingsCard.d.ts +5 -0
- package/lib/types/client/RemoteSettingsCard.d.ts.map +1 -1
- package/lib/types/client/RemoteSettingsCard.js +7 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +13 -7
- package/lib/types/client/settings-form.d.ts +8 -0
- package/lib/types/client/settings-form.d.ts.map +1 -1
- package/lib/types/client/settings-form.js +15 -1
- package/lib/types/gate.d.ts +4 -9
- package/lib/types/gate.d.ts.map +1 -1
- package/lib/types/gate.js +5 -32
- package/lib/types/loopback.d.ts +25 -0
- package/lib/types/loopback.d.ts.map +1 -0
- package/lib/types/loopback.js +68 -0
- package/package.json +1 -1
- package/src/client/RemoteSettingsCard.tsx +8 -0
- package/src/client/index.ts +13 -7
- package/src/client/settings-form.ts +15 -1
- package/src/gate.ts +5 -30
- package/src/loopback.ts +63 -0
package/lib/client.js
CHANGED
|
@@ -2558,6 +2558,9 @@ window.__ModuleLoader__.load({
|
|
|
2558
2558
|
specs;
|
|
2559
2559
|
staged = /* @__PURE__ */ new Map();
|
|
2560
2560
|
listeners = /* @__PURE__ */ new Set();
|
|
2561
|
+
/** The scope subscription installed in the constructor; released by dispose(). */
|
|
2562
|
+
disposeScope;
|
|
2563
|
+
disposed = false;
|
|
2561
2564
|
saving = false;
|
|
2562
2565
|
failed = false;
|
|
2563
2566
|
failedReason;
|
|
@@ -2565,10 +2568,20 @@ window.__ModuleLoader__.load({
|
|
|
2565
2568
|
constructor(scope, specs) {
|
|
2566
2569
|
this.scope = scope;
|
|
2567
2570
|
this.specs = new Map(specs.map((spec) => [spec.field, spec]));
|
|
2568
|
-
scope.subscribe(() => {
|
|
2571
|
+
this.disposeScope = scope.subscribe(() => {
|
|
2569
2572
|
this.publish();
|
|
2570
2573
|
});
|
|
2571
2574
|
}
|
|
2575
|
+
/**
|
|
2576
|
+
* Release the scope subscription and every bound store listener. The card
|
|
2577
|
+
* must call this on teardown; later calls are no-ops.
|
|
2578
|
+
*/
|
|
2579
|
+
dispose() {
|
|
2580
|
+
if (this.disposed) return;
|
|
2581
|
+
this.disposed = true;
|
|
2582
|
+
this.disposeScope();
|
|
2583
|
+
this.listeners.clear();
|
|
2584
|
+
}
|
|
2572
2585
|
/** Publish a projection of this form, rebuilt whenever the scope or a draft changes. */
|
|
2573
2586
|
bind(project) {
|
|
2574
2587
|
const store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)(project());
|
|
@@ -2811,6 +2824,13 @@ window.__ModuleLoader__.load({
|
|
|
2811
2824
|
...this.form.actions()
|
|
2812
2825
|
};
|
|
2813
2826
|
}
|
|
2827
|
+
/**
|
|
2828
|
+
* Release the card's scope subscription and bound stores; the slot
|
|
2829
|
+
* disposer calls this on teardown.
|
|
2830
|
+
*/
|
|
2831
|
+
dispose() {
|
|
2832
|
+
this.form.dispose();
|
|
2833
|
+
}
|
|
2814
2834
|
};
|
|
2815
2835
|
/**
|
|
2816
2836
|
* Render the remote-control card.
|
|
@@ -3349,13 +3369,19 @@ window.__ModuleLoader__.load({
|
|
|
3349
3369
|
};
|
|
3350
3370
|
});
|
|
3351
3371
|
const remoteSettings = new RemoteSettingsCardController(settingsScope);
|
|
3352
|
-
ctx.slots.inject("web-ui.plugin.item", () =>
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3372
|
+
ctx.slots.inject("web-ui.plugin.item", () => {
|
|
3373
|
+
const unregister = ctx.slots.register({
|
|
3374
|
+
name: "web-ui.plugin.item",
|
|
3375
|
+
id: "remote-web-ui",
|
|
3376
|
+
order: 90,
|
|
3377
|
+
locale: NS,
|
|
3378
|
+
inject: () => remoteSettings.inject()
|
|
3379
|
+
}, RemoteSettingsCard);
|
|
3380
|
+
return () => {
|
|
3381
|
+
remoteSettings.dispose();
|
|
3382
|
+
unregister();
|
|
3383
|
+
};
|
|
3384
|
+
});
|
|
3359
3385
|
let disposeRuntime;
|
|
3360
3386
|
const syncRuntime = () => {
|
|
3361
3387
|
if (enabled() && disposeRuntime === void 0) disposeRuntime = ctx.effect(() => {
|