@forgeax/app-shell 0.34.0 → 0.35.0
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/dist/dock.d.ts +2 -0
- package/dist/dock.js +3 -2
- package/package.json +1 -1
package/dist/dock.d.ts
CHANGED
|
@@ -243,6 +243,8 @@ interface DockLayoutControlSnapshot<Anchor> {
|
|
|
243
243
|
interface DockLayoutControlState<Anchor> {
|
|
244
244
|
getSnapshot(): DockLayoutControlSnapshot<Anchor>;
|
|
245
245
|
subscribe(listener: () => void): () => void;
|
|
246
|
+
/** Publish a fresh snapshot after the live Dock projection changes. */
|
|
247
|
+
refresh(): void;
|
|
246
248
|
/** Toggle visibility and preserve the previous anchor when none is supplied. */
|
|
247
249
|
toggle(anchor?: Anchor): void;
|
|
248
250
|
/** Close without publishing a duplicate snapshot when already closed. */
|
package/dist/dock.js
CHANGED
|
@@ -551,8 +551,8 @@ function installDockPanelCommandSubscriptions(source, commands) {
|
|
|
551
551
|
function createDockLayoutControlState(initialAnchor = null) {
|
|
552
552
|
let snapshot = { open: false, anchor: initialAnchor };
|
|
553
553
|
const listeners = /* @__PURE__ */ new Set();
|
|
554
|
-
const commit = (open, anchor) => {
|
|
555
|
-
if (snapshot.open === open && snapshot.anchor === anchor) return;
|
|
554
|
+
const commit = (open, anchor, force = false) => {
|
|
555
|
+
if (!force && snapshot.open === open && snapshot.anchor === anchor) return;
|
|
556
556
|
snapshot = { open, anchor };
|
|
557
557
|
for (const listener of [...listeners]) {
|
|
558
558
|
try {
|
|
@@ -572,6 +572,7 @@ function createDockLayoutControlState(initialAnchor = null) {
|
|
|
572
572
|
listeners.delete(listener);
|
|
573
573
|
};
|
|
574
574
|
},
|
|
575
|
+
refresh: () => commit(snapshot.open, snapshot.anchor, true),
|
|
575
576
|
toggle: (anchor) => commit(
|
|
576
577
|
!snapshot.open,
|
|
577
578
|
anchor === void 0 ? snapshot.anchor : anchor
|