@forgeax/app-shell 0.22.0 → 0.23.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/{chunk-EEPX63DF.js → chunk-QMT4V6XC.js} +40 -0
- package/dist/react.js +1 -1
- package/dist/window.d.ts +10 -1
- package/dist/window.js +3 -1
- package/package.json +1 -1
|
@@ -1,4 +1,43 @@
|
|
|
1
1
|
// src/window.ts
|
|
2
|
+
function createEdgePinStore() {
|
|
3
|
+
const emptySnapshot = Object.freeze({});
|
|
4
|
+
const pinnedByGroup = /* @__PURE__ */ new Map();
|
|
5
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
6
|
+
let snapshot = emptySnapshot;
|
|
7
|
+
const publish = () => {
|
|
8
|
+
snapshot = pinnedByGroup.size === 0 ? emptySnapshot : Object.freeze(Object.fromEntries([...pinnedByGroup.entries()].sort(([a], [b]) => a.localeCompare(b))));
|
|
9
|
+
for (const listener of listeners) {
|
|
10
|
+
try {
|
|
11
|
+
listener();
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
snapshot: () => snapshot,
|
|
18
|
+
onChange(listener) {
|
|
19
|
+
listeners.add(listener);
|
|
20
|
+
return () => {
|
|
21
|
+
listeners.delete(listener);
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
pinnedIn: (groupId) => pinnedByGroup.get(groupId),
|
|
25
|
+
setPinned(groupId, panelId) {
|
|
26
|
+
if (panelId === void 0) {
|
|
27
|
+
if (!pinnedByGroup.delete(groupId)) return;
|
|
28
|
+
} else {
|
|
29
|
+
if (pinnedByGroup.get(groupId) === panelId) return;
|
|
30
|
+
pinnedByGroup.set(groupId, panelId);
|
|
31
|
+
}
|
|
32
|
+
publish();
|
|
33
|
+
},
|
|
34
|
+
clear() {
|
|
35
|
+
if (pinnedByGroup.size === 0) return;
|
|
36
|
+
pinnedByGroup.clear();
|
|
37
|
+
publish();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
2
41
|
function canOpenPanelWindow(capability, carrierAvailable) {
|
|
3
42
|
return capability !== void 0 && carrierAvailable;
|
|
4
43
|
}
|
|
@@ -314,6 +353,7 @@ function decodeSurfaceFromLocation(search = typeof window !== "undefined" ? wind
|
|
|
314
353
|
}
|
|
315
354
|
|
|
316
355
|
export {
|
|
356
|
+
createEdgePinStore,
|
|
317
357
|
canOpenPanelWindow,
|
|
318
358
|
shouldShowDetachedPlaceholder,
|
|
319
359
|
createPanelWindowingController,
|
package/dist/react.js
CHANGED
package/dist/window.d.ts
CHANGED
|
@@ -93,6 +93,15 @@ interface SurfaceWindowingController {
|
|
|
93
93
|
redockSurface(surface: SurfaceDescriptor): Promise<void>;
|
|
94
94
|
markSurfaceDocked(surface: SurfaceDescriptor): void;
|
|
95
95
|
}
|
|
96
|
+
interface EdgePinStore {
|
|
97
|
+
snapshot(): Readonly<Record<string, string>>;
|
|
98
|
+
onChange(listener: () => void): () => void;
|
|
99
|
+
pinnedIn(groupId: string): string | undefined;
|
|
100
|
+
setPinned(groupId: string, panelId: string | undefined): void;
|
|
101
|
+
clear(): void;
|
|
102
|
+
}
|
|
103
|
+
/** Product-neutral state for one mutually-exclusive pinned item per edge group. */
|
|
104
|
+
declare function createEdgePinStore(): EdgePinStore;
|
|
96
105
|
declare function canOpenPanelWindow(capability: DetachedWindowCapability | undefined, carrierAvailable: boolean): capability is DetachedWindowCapability;
|
|
97
106
|
declare function shouldShowDetachedPlaceholder(floatingSurfaces: Readonly<Record<string, true>>, surface: SurfaceDescriptor): boolean;
|
|
98
107
|
/** Product-neutral transaction joining a dock placement to a detached carrier. */
|
|
@@ -112,4 +121,4 @@ declare function encodeSurfaceQuery(surface: SurfaceDescriptor): string;
|
|
|
112
121
|
/** Decode structural identity, or null for a normal shell/invalid entry. */
|
|
113
122
|
declare function decodeSurfaceFromLocation(search?: string): SurfaceDescriptor | null;
|
|
114
123
|
|
|
115
|
-
export { type BrowserPopupWindow, type BrowserWindowHost, type CreateBrowserWindowManagerOptions, type CreateExternalWindowManagerOptions, type CreateSurfaceWindowingControllerOptions, type DetachWindowOptions, type DetachedWindowCapability, type DetachedWindowTarget, type ExternalWindowHandle, type ExternalWindowHost, type ExternalWindowLifecycle, type OpenPanelWindowOptions, type PanelWindowingController, type SurfaceDescriptor, type SurfaceKind, type SurfacePane, type SurfaceWindowingController, type WindowManager, canOpenPanelWindow, createBrowserWindowManager, createExternalWindowManager, createPanelWindowingController, createSurfaceWindowingController, decodeSurfaceFromLocation, encodeSurfaceQuery, shouldShowDetachedPlaceholder, surfaceKey, surfaceWindowLabel };
|
|
124
|
+
export { type BrowserPopupWindow, type BrowserWindowHost, type CreateBrowserWindowManagerOptions, type CreateExternalWindowManagerOptions, type CreateSurfaceWindowingControllerOptions, type DetachWindowOptions, type DetachedWindowCapability, type DetachedWindowTarget, type EdgePinStore, type ExternalWindowHandle, type ExternalWindowHost, type ExternalWindowLifecycle, type OpenPanelWindowOptions, type PanelWindowingController, type SurfaceDescriptor, type SurfaceKind, type SurfacePane, type SurfaceWindowingController, type WindowManager, canOpenPanelWindow, createBrowserWindowManager, createEdgePinStore, createExternalWindowManager, createPanelWindowingController, createSurfaceWindowingController, decodeSurfaceFromLocation, encodeSurfaceQuery, shouldShowDetachedPlaceholder, surfaceKey, surfaceWindowLabel };
|
package/dist/window.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
canOpenPanelWindow,
|
|
3
3
|
createBrowserWindowManager,
|
|
4
|
+
createEdgePinStore,
|
|
4
5
|
createExternalWindowManager,
|
|
5
6
|
createPanelWindowingController,
|
|
6
7
|
createSurfaceWindowingController,
|
|
@@ -9,10 +10,11 @@ import {
|
|
|
9
10
|
shouldShowDetachedPlaceholder,
|
|
10
11
|
surfaceKey,
|
|
11
12
|
surfaceWindowLabel
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QMT4V6XC.js";
|
|
13
14
|
export {
|
|
14
15
|
canOpenPanelWindow,
|
|
15
16
|
createBrowserWindowManager,
|
|
17
|
+
createEdgePinStore,
|
|
16
18
|
createExternalWindowManager,
|
|
17
19
|
createPanelWindowingController,
|
|
18
20
|
createSurfaceWindowingController,
|