@forgeax/app-shell 0.61.0 → 0.63.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 +27 -1
- package/dist/react.js +116 -0
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -310,6 +310,32 @@ interface CaptureInteractionObservationOptions {
|
|
|
310
310
|
/** Observe pointerdown and click in capture order without owning interaction policy. */
|
|
311
311
|
declare function installCaptureInteractionObservation(options: CaptureInteractionObservationOptions): () => void;
|
|
312
312
|
|
|
313
|
+
interface ReplaceableObservationSubscription {
|
|
314
|
+
dispose(): void;
|
|
315
|
+
}
|
|
316
|
+
interface ReplaceableObservationSetOptions<Item, Observation> {
|
|
317
|
+
readonly subscribe: (item: Item, listener: (observation: Observation) => void) => ReplaceableObservationSubscription;
|
|
318
|
+
readonly onObservation: (item: Item, observation: Observation) => void;
|
|
319
|
+
}
|
|
320
|
+
interface ReplaceableObservationSetLifecycle<Item> {
|
|
321
|
+
replace(items: readonly Item[]): void;
|
|
322
|
+
dispose(): void;
|
|
323
|
+
}
|
|
324
|
+
/** Own a replaceable set of subscriptions without owning item or event policy. */
|
|
325
|
+
declare function createReplaceableObservationSetLifecycle<Item, Observation>(options: ReplaceableObservationSetOptions<Item, Observation>): ReplaceableObservationSetLifecycle<Item>;
|
|
326
|
+
|
|
327
|
+
interface PanelMembershipObservationSubscription {
|
|
328
|
+
dispose(): void;
|
|
329
|
+
}
|
|
330
|
+
interface PanelMembershipObservationOptions<AddEvent = unknown, RemoveEvent = unknown> {
|
|
331
|
+
readonly subscribeAdd: (listener: (event: AddEvent) => void) => PanelMembershipObservationSubscription;
|
|
332
|
+
readonly subscribeRemove: (listener: (event: RemoveEvent) => void) => PanelMembershipObservationSubscription;
|
|
333
|
+
readonly onAdd: (event: AddEvent) => void;
|
|
334
|
+
readonly onRemove: (event: RemoveEvent) => void;
|
|
335
|
+
}
|
|
336
|
+
/** Observe panel membership changes without owning panel or layout policy. */
|
|
337
|
+
declare function installPanelMembershipObservation<AddEvent, RemoveEvent>(options: PanelMembershipObservationOptions<AddEvent, RemoveEvent>): () => void;
|
|
338
|
+
|
|
313
339
|
type PanelContentPadding = 'none' | 'sm' | 'md';
|
|
314
340
|
type PanelContentScroll = 'none' | 'auto';
|
|
315
341
|
type PanelContentTone = 'default' | 'surface' | 'tool';
|
|
@@ -451,4 +477,4 @@ interface ShellSlotProps extends HTMLAttributes<HTMLElement> {
|
|
|
451
477
|
/** Structural shell marker that preserves the caller's semantic element. */
|
|
452
478
|
declare function ShellSlot({ as, name, ...props }: ShellSlotProps): ReactElement;
|
|
453
479
|
|
|
454
|
-
export { type AnchoredResizeDirection, AnchoredResizeHandle, type AnchoredResizeHandleProps, type AnchoredResizeSession, type BoundedFrameRetryLifecycleOptions, type CaptureInteractionEventTarget, type CaptureInteractionObservationOptions, type CoalescedFrameTaskLifecycle, type CoalescedFrameTaskLifecycleOptions, type CustomEventObservationOptions, type CustomEventObservationTarget, DetachedPanelBoundary, type DetachedPanelBoundaryProps, DetachedSurfaceFrame, type DetachedSurfaceFrameProps, DetachedSurfaceStatus, type DetachedSurfaceStatusProps, type DetachedSurfaceStatusTone, type DockLayoutControlBinding, type DockLayoutControlBindingOptions, DockLayoutMenu, type DockLayoutMenuPanel, type DockLayoutMenuProps, DockTabAction, type DockTabActionProps, DockTabFrame, type DockTabFrameProps, DockTabIcon, type DockTabIconProps, DockTabStatusSummary, type DockTabStatusSummaryItem, type DockTabStatusSummaryProps, type DockTabStatusTone, DockTabTitle, type DockTabTitleProps, type DragPresenceEventTarget, type DragPresenceLifecycleOptions, FloatingMenu, type FloatingMenuAnchor, type FloatingMenuPoint, type FloatingMenuProps, type LiveTabPlacement, type LiveTabPlacementSource, type LiveTabTitleSource, OWNED_INTERACTION_SURFACE_SELECTOR, type OutsideDismissEventTarget, type OutsideDismissLifecycleOptions, type OutsideDismissReason, 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, type ViewportResizeEventTarget, type ViewportResizeObservationOptions, applyAnchoredResizeDelta, beginAnchoredResize, createCoalescedFrameTaskLifecycle, createPersistentSizeStore, hashSlotHue, installBoundedFrameRetryLifecycle, installCaptureInteractionObservation, installCustomEventObservation, installDragPresenceLifecycle, installOutsideDismissLifecycle, installPointerDragSession, installPointerReorderSession, installThresholdPointerDragSession, installViewportResizeObservation, isDismissExemptInteractionTarget, isSlotDebugEnabled, useDockLayoutControlBinding, useLiveTabPlacement, useLiveTabTitle, useLocalSize, usePersistentSizeStore, useTabCloseInteractions, useTabPinnedState };
|
|
480
|
+
export { type AnchoredResizeDirection, AnchoredResizeHandle, type AnchoredResizeHandleProps, type AnchoredResizeSession, type BoundedFrameRetryLifecycleOptions, type CaptureInteractionEventTarget, type CaptureInteractionObservationOptions, type CoalescedFrameTaskLifecycle, type CoalescedFrameTaskLifecycleOptions, type CustomEventObservationOptions, type CustomEventObservationTarget, DetachedPanelBoundary, type DetachedPanelBoundaryProps, DetachedSurfaceFrame, type DetachedSurfaceFrameProps, DetachedSurfaceStatus, type DetachedSurfaceStatusProps, type DetachedSurfaceStatusTone, type DockLayoutControlBinding, type DockLayoutControlBindingOptions, DockLayoutMenu, type DockLayoutMenuPanel, type DockLayoutMenuProps, DockTabAction, type DockTabActionProps, DockTabFrame, type DockTabFrameProps, DockTabIcon, type DockTabIconProps, DockTabStatusSummary, type DockTabStatusSummaryItem, type DockTabStatusSummaryProps, type DockTabStatusTone, DockTabTitle, type DockTabTitleProps, type DragPresenceEventTarget, type DragPresenceLifecycleOptions, FloatingMenu, type FloatingMenuAnchor, type FloatingMenuPoint, type FloatingMenuProps, type LiveTabPlacement, type LiveTabPlacementSource, type LiveTabTitleSource, OWNED_INTERACTION_SURFACE_SELECTOR, type OutsideDismissEventTarget, type OutsideDismissLifecycleOptions, type OutsideDismissReason, type PanelContentPadding, type PanelContentPolicy, type PanelContentScroll, type PanelContentTone, PanelEmptyState, type PanelEmptyStateProps, type PanelMembershipObservationOptions, type PanelMembershipObservationSubscription, PanelSurface, type PanelSurfaceProps, type PersistentSizeStorage, type PersistentSizeStore, type PersistentSizeStoreOptions, type PersistentSizeUpdate, type PointerDragFinishReason, type PointerDragSessionOptions, type PointerReorderFinishReason, type PointerReorderSession, type PointerReorderSessionOptions, type ReplaceableObservationSetLifecycle, type ReplaceableObservationSetOptions, type ReplaceableObservationSubscription, 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, type ViewportResizeEventTarget, type ViewportResizeObservationOptions, applyAnchoredResizeDelta, beginAnchoredResize, createCoalescedFrameTaskLifecycle, createPersistentSizeStore, createReplaceableObservationSetLifecycle, hashSlotHue, installBoundedFrameRetryLifecycle, installCaptureInteractionObservation, installCustomEventObservation, installDragPresenceLifecycle, installOutsideDismissLifecycle, installPanelMembershipObservation, installPointerDragSession, installPointerReorderSession, installThresholdPointerDragSession, installViewportResizeObservation, isDismissExemptInteractionTarget, isSlotDebugEnabled, useDockLayoutControlBinding, useLiveTabPlacement, useLiveTabTitle, useLocalSize, usePersistentSizeStore, useTabCloseInteractions, useTabPinnedState };
|
package/dist/react.js
CHANGED
|
@@ -2055,6 +2055,120 @@ function installCaptureInteractionObservation(options) {
|
|
|
2055
2055
|
};
|
|
2056
2056
|
}
|
|
2057
2057
|
|
|
2058
|
+
// src/replaceable-observation-set.ts
|
|
2059
|
+
function createReplaceableObservationSetLifecycle(options) {
|
|
2060
|
+
let disposed = false;
|
|
2061
|
+
let generation = 0;
|
|
2062
|
+
let subscriptions = [];
|
|
2063
|
+
const cleanup = (owned) => {
|
|
2064
|
+
for (let index = owned.length - 1; index >= 0; index--) {
|
|
2065
|
+
try {
|
|
2066
|
+
owned[index]?.dispose();
|
|
2067
|
+
} catch {
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
};
|
|
2071
|
+
const replace = (items) => {
|
|
2072
|
+
if (disposed) return;
|
|
2073
|
+
const nextGeneration = ++generation;
|
|
2074
|
+
const previous = subscriptions;
|
|
2075
|
+
subscriptions = [];
|
|
2076
|
+
cleanup(previous);
|
|
2077
|
+
if (disposed || generation !== nextGeneration) return;
|
|
2078
|
+
const next = [];
|
|
2079
|
+
for (const item of items) {
|
|
2080
|
+
if (disposed || generation !== nextGeneration) break;
|
|
2081
|
+
let listenerCurrent = true;
|
|
2082
|
+
const listener = (observation) => {
|
|
2083
|
+
if (!listenerCurrent || disposed || generation !== nextGeneration) return;
|
|
2084
|
+
try {
|
|
2085
|
+
options.onObservation(item, observation);
|
|
2086
|
+
} catch {
|
|
2087
|
+
}
|
|
2088
|
+
};
|
|
2089
|
+
try {
|
|
2090
|
+
const subscription = options.subscribe(item, listener);
|
|
2091
|
+
if (!subscription || typeof subscription.dispose !== "function") {
|
|
2092
|
+
throw new TypeError("observation subscription must provide dispose()");
|
|
2093
|
+
}
|
|
2094
|
+
if (disposed || generation !== nextGeneration) {
|
|
2095
|
+
listenerCurrent = false;
|
|
2096
|
+
try {
|
|
2097
|
+
subscription.dispose();
|
|
2098
|
+
} catch {
|
|
2099
|
+
}
|
|
2100
|
+
cleanup(next);
|
|
2101
|
+
return;
|
|
2102
|
+
}
|
|
2103
|
+
next.push(subscription);
|
|
2104
|
+
} catch {
|
|
2105
|
+
listenerCurrent = false;
|
|
2106
|
+
if (generation === nextGeneration) generation++;
|
|
2107
|
+
cleanup(next);
|
|
2108
|
+
return;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
if (disposed || generation !== nextGeneration) {
|
|
2112
|
+
cleanup(next);
|
|
2113
|
+
return;
|
|
2114
|
+
}
|
|
2115
|
+
subscriptions = next;
|
|
2116
|
+
};
|
|
2117
|
+
return {
|
|
2118
|
+
replace,
|
|
2119
|
+
dispose: () => {
|
|
2120
|
+
if (disposed) return;
|
|
2121
|
+
disposed = true;
|
|
2122
|
+
generation++;
|
|
2123
|
+
const owned = subscriptions;
|
|
2124
|
+
subscriptions = [];
|
|
2125
|
+
cleanup(owned);
|
|
2126
|
+
}
|
|
2127
|
+
};
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
// src/panel-membership-observation.ts
|
|
2131
|
+
function installPanelMembershipObservation(options) {
|
|
2132
|
+
let live = true;
|
|
2133
|
+
let addSubscription;
|
|
2134
|
+
let removeSubscription;
|
|
2135
|
+
const onAdd = (event) => {
|
|
2136
|
+
if (!live) return;
|
|
2137
|
+
try {
|
|
2138
|
+
options.onAdd(event);
|
|
2139
|
+
} catch {
|
|
2140
|
+
}
|
|
2141
|
+
};
|
|
2142
|
+
const onRemove = (event) => {
|
|
2143
|
+
if (!live) return;
|
|
2144
|
+
try {
|
|
2145
|
+
options.onRemove(event);
|
|
2146
|
+
} catch {
|
|
2147
|
+
}
|
|
2148
|
+
};
|
|
2149
|
+
const disposeOne = (subscription) => {
|
|
2150
|
+
if (!subscription) return;
|
|
2151
|
+
try {
|
|
2152
|
+
subscription.dispose();
|
|
2153
|
+
} catch {
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
try {
|
|
2157
|
+
addSubscription = options.subscribeAdd(onAdd);
|
|
2158
|
+
removeSubscription = options.subscribeRemove(onRemove);
|
|
2159
|
+
} catch {
|
|
2160
|
+
live = false;
|
|
2161
|
+
disposeOne(removeSubscription);
|
|
2162
|
+
disposeOne(addSubscription);
|
|
2163
|
+
}
|
|
2164
|
+
return () => {
|
|
2165
|
+
if (!live) return;
|
|
2166
|
+
live = false;
|
|
2167
|
+
disposeOne(removeSubscription);
|
|
2168
|
+
disposeOne(addSubscription);
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2058
2172
|
// src/panel.tsx
|
|
2059
2173
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2060
2174
|
function PanelEmptyState({
|
|
@@ -2428,12 +2542,14 @@ export {
|
|
|
2428
2542
|
beginAnchoredResize,
|
|
2429
2543
|
createCoalescedFrameTaskLifecycle,
|
|
2430
2544
|
createPersistentSizeStore,
|
|
2545
|
+
createReplaceableObservationSetLifecycle,
|
|
2431
2546
|
hashSlotHue,
|
|
2432
2547
|
installBoundedFrameRetryLifecycle,
|
|
2433
2548
|
installCaptureInteractionObservation,
|
|
2434
2549
|
installCustomEventObservation,
|
|
2435
2550
|
installDragPresenceLifecycle,
|
|
2436
2551
|
installOutsideDismissLifecycle,
|
|
2552
|
+
installPanelMembershipObservation,
|
|
2437
2553
|
installPointerDragSession,
|
|
2438
2554
|
installPointerReorderSession,
|
|
2439
2555
|
installThresholdPointerDragSession,
|