@forgeax/app-shell 0.47.0 → 0.48.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/react.d.ts +8 -1
- package/dist/react.js +74 -5
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -154,6 +154,13 @@ interface LiveTabPlacementSource {
|
|
|
154
154
|
/** Observe one tab's live edge/group placement without owning host identities. */
|
|
155
155
|
declare function useLiveTabPlacement(source: LiveTabPlacementSource): LiveTabPlacement | undefined;
|
|
156
156
|
|
|
157
|
+
interface TabPinnedStateSource {
|
|
158
|
+
pinnedIn(groupId: string): string | undefined;
|
|
159
|
+
subscribe(listener: () => void): () => void;
|
|
160
|
+
}
|
|
161
|
+
/** Observe whether one product-supplied panel identity is pinned in a group. */
|
|
162
|
+
declare function useTabPinnedState(source: TabPinnedStateSource, groupId: string, panelId: string): boolean;
|
|
163
|
+
|
|
157
164
|
type PanelContentPadding = 'none' | 'sm' | 'md';
|
|
158
165
|
type PanelContentScroll = 'none' | 'auto';
|
|
159
166
|
type PanelContentTone = 'default' | 'surface' | 'tool';
|
|
@@ -295,4 +302,4 @@ interface ShellSlotProps extends HTMLAttributes<HTMLElement> {
|
|
|
295
302
|
/** Structural shell marker that preserves the caller's semantic element. */
|
|
296
303
|
declare function ShellSlot({ as, name, ...props }: ShellSlotProps): ReactElement;
|
|
297
304
|
|
|
298
|
-
export { type AnchoredResizeDirection, AnchoredResizeHandle, type AnchoredResizeHandleProps, type AnchoredResizeSession, DetachedPanelBoundary, type DetachedPanelBoundaryProps, DetachedSurfaceFrame, type DetachedSurfaceFrameProps, DetachedSurfaceStatus, type DetachedSurfaceStatusProps, type DetachedSurfaceStatusTone, type DockLayoutControlBinding, type DockLayoutControlBindingOptions, DockLayoutMenu, type DockLayoutMenuPanel, type DockLayoutMenuProps, FloatingMenu, type FloatingMenuAnchor, type FloatingMenuPoint, type FloatingMenuProps, type LiveTabPlacement, type LiveTabPlacementSource, type LiveTabTitleSource, type PanelContentPadding, type PanelContentPolicy, type PanelContentScroll, type PanelContentTone, PanelEmptyState, type PanelEmptyStateProps, PanelSurface, type PanelSurfaceProps, type PersistentSizeStorage, type PersistentSizeStore, type PersistentSizeStoreOptions, type PersistentSizeUpdate, type PointerDragFinishReason, type PointerDragSessionOptions, type PointerReorderFinishReason, type PointerReorderSession, type PointerReorderSessionOptions, ResizeHandle, type ResizeHandleProps, ShellSlot, type ShellSlotElement, type ShellSlotProps, SlotDebugOverlay, SurfacePlaceholder, type SurfacePlaceholderProps, SurfaceRegion, type SurfaceRegionProps, type TabCloseInteractions, type TabCloseInteractionsOptions, type ThresholdPointerDragFinishReason, type ThresholdPointerDragSession, type ThresholdPointerDragSessionOptions, applyAnchoredResizeDelta, beginAnchoredResize, createPersistentSizeStore, hashSlotHue, installPointerDragSession, installPointerReorderSession, installThresholdPointerDragSession, isSlotDebugEnabled, useDockLayoutControlBinding, useLiveTabPlacement, useLiveTabTitle, useLocalSize, usePersistentSizeStore, useTabCloseInteractions };
|
|
305
|
+
export { type AnchoredResizeDirection, AnchoredResizeHandle, type AnchoredResizeHandleProps, type AnchoredResizeSession, DetachedPanelBoundary, type DetachedPanelBoundaryProps, DetachedSurfaceFrame, type DetachedSurfaceFrameProps, DetachedSurfaceStatus, type DetachedSurfaceStatusProps, type DetachedSurfaceStatusTone, type DockLayoutControlBinding, type DockLayoutControlBindingOptions, DockLayoutMenu, type DockLayoutMenuPanel, type DockLayoutMenuProps, FloatingMenu, type FloatingMenuAnchor, type FloatingMenuPoint, type FloatingMenuProps, type LiveTabPlacement, type LiveTabPlacementSource, type LiveTabTitleSource, type PanelContentPadding, type PanelContentPolicy, type PanelContentScroll, type PanelContentTone, PanelEmptyState, type PanelEmptyStateProps, PanelSurface, type PanelSurfaceProps, type PersistentSizeStorage, type PersistentSizeStore, type PersistentSizeStoreOptions, type PersistentSizeUpdate, type PointerDragFinishReason, type PointerDragSessionOptions, type PointerReorderFinishReason, type PointerReorderSession, type PointerReorderSessionOptions, ResizeHandle, type ResizeHandleProps, ShellSlot, type ShellSlotElement, type ShellSlotProps, SlotDebugOverlay, SurfacePlaceholder, type SurfacePlaceholderProps, SurfaceRegion, type SurfaceRegionProps, type TabCloseInteractions, type TabCloseInteractionsOptions, type TabPinnedStateSource, type ThresholdPointerDragFinishReason, type ThresholdPointerDragSession, type ThresholdPointerDragSessionOptions, applyAnchoredResizeDelta, beginAnchoredResize, createPersistentSizeStore, hashSlotHue, installPointerDragSession, installPointerReorderSession, installThresholdPointerDragSession, isSlotDebugEnabled, useDockLayoutControlBinding, useLiveTabPlacement, useLiveTabTitle, useLocalSize, usePersistentSizeStore, useTabCloseInteractions, useTabPinnedState };
|
package/dist/react.js
CHANGED
|
@@ -1372,6 +1372,74 @@ function useLiveTabPlacement(source) {
|
|
|
1372
1372
|
);
|
|
1373
1373
|
}
|
|
1374
1374
|
|
|
1375
|
+
// src/tab-pinned-state.tsx
|
|
1376
|
+
import { useMemo as useMemo3, useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
1377
|
+
function stabilizeTabPinnedStateSource(source, groupId, panelId) {
|
|
1378
|
+
let snapshot = false;
|
|
1379
|
+
try {
|
|
1380
|
+
snapshot = source.pinnedIn(groupId) === panelId;
|
|
1381
|
+
} catch {
|
|
1382
|
+
}
|
|
1383
|
+
const synchronize = () => {
|
|
1384
|
+
let next;
|
|
1385
|
+
try {
|
|
1386
|
+
next = source.pinnedIn(groupId) === panelId;
|
|
1387
|
+
} catch {
|
|
1388
|
+
return false;
|
|
1389
|
+
}
|
|
1390
|
+
if (next === snapshot) return false;
|
|
1391
|
+
snapshot = next;
|
|
1392
|
+
return true;
|
|
1393
|
+
};
|
|
1394
|
+
return {
|
|
1395
|
+
getSnapshot: () => {
|
|
1396
|
+
synchronize();
|
|
1397
|
+
return snapshot;
|
|
1398
|
+
},
|
|
1399
|
+
subscribe: (listener) => {
|
|
1400
|
+
let active = true;
|
|
1401
|
+
const notify = () => {
|
|
1402
|
+
if (!active || !synchronize()) return;
|
|
1403
|
+
try {
|
|
1404
|
+
listener();
|
|
1405
|
+
} catch {
|
|
1406
|
+
}
|
|
1407
|
+
};
|
|
1408
|
+
let dispose = () => {
|
|
1409
|
+
};
|
|
1410
|
+
try {
|
|
1411
|
+
dispose = source.subscribe(notify);
|
|
1412
|
+
} catch {
|
|
1413
|
+
notify();
|
|
1414
|
+
return () => {
|
|
1415
|
+
if (!active) return;
|
|
1416
|
+
active = false;
|
|
1417
|
+
};
|
|
1418
|
+
}
|
|
1419
|
+
notify();
|
|
1420
|
+
return () => {
|
|
1421
|
+
if (!active) return;
|
|
1422
|
+
active = false;
|
|
1423
|
+
try {
|
|
1424
|
+
dispose();
|
|
1425
|
+
} catch {
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
function useTabPinnedState(source, groupId, panelId) {
|
|
1432
|
+
const stable = useMemo3(
|
|
1433
|
+
() => stabilizeTabPinnedStateSource(source, groupId, panelId),
|
|
1434
|
+
[source, groupId, panelId]
|
|
1435
|
+
);
|
|
1436
|
+
return useSyncExternalStore4(
|
|
1437
|
+
stable.subscribe,
|
|
1438
|
+
stable.getSnapshot,
|
|
1439
|
+
stable.getSnapshot
|
|
1440
|
+
);
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1375
1443
|
// src/panel.tsx
|
|
1376
1444
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1377
1445
|
function PanelEmptyState({
|
|
@@ -1514,7 +1582,7 @@ var SurfaceRegion = forwardRef(
|
|
|
1514
1582
|
);
|
|
1515
1583
|
|
|
1516
1584
|
// src/dock-layout-control.ts
|
|
1517
|
-
import { useEffect as useEffect4, useMemo as
|
|
1585
|
+
import { useEffect as useEffect4, useMemo as useMemo4, useSyncExternalStore as useSyncExternalStore5 } from "react";
|
|
1518
1586
|
function useDockLayoutControlBinding({
|
|
1519
1587
|
state,
|
|
1520
1588
|
onToggle,
|
|
@@ -1522,18 +1590,18 @@ function useDockLayoutControlBinding({
|
|
|
1522
1590
|
closePanel,
|
|
1523
1591
|
reopenPanel
|
|
1524
1592
|
}) {
|
|
1525
|
-
const snapshot =
|
|
1593
|
+
const snapshot = useSyncExternalStore5(
|
|
1526
1594
|
state.subscribe,
|
|
1527
1595
|
state.getSnapshot,
|
|
1528
1596
|
state.getSnapshot
|
|
1529
1597
|
);
|
|
1530
1598
|
useEffect4(() => installDockLayoutControlToggle({ onToggle }, state), [onToggle, state]);
|
|
1531
|
-
const panelControl =
|
|
1599
|
+
const panelControl = useMemo4(() => createDockLayoutPanelControl({
|
|
1532
1600
|
isOpen: isPanelOpen,
|
|
1533
1601
|
close: closePanel,
|
|
1534
1602
|
reopen: reopenPanel
|
|
1535
1603
|
}), [closePanel, isPanelOpen, reopenPanel]);
|
|
1536
|
-
return
|
|
1604
|
+
return useMemo4(() => ({ snapshot, panelControl }), [panelControl, snapshot]);
|
|
1537
1605
|
}
|
|
1538
1606
|
|
|
1539
1607
|
// src/floating-menu.tsx
|
|
@@ -1748,7 +1816,8 @@ export {
|
|
|
1748
1816
|
useLiveTabTitle,
|
|
1749
1817
|
useLocalSize,
|
|
1750
1818
|
usePersistentSizeStore,
|
|
1751
|
-
useTabCloseInteractions
|
|
1819
|
+
useTabCloseInteractions,
|
|
1820
|
+
useTabPinnedState
|
|
1752
1821
|
};
|
|
1753
1822
|
/*! Bundled license information:
|
|
1754
1823
|
|