@forgeax/app-shell 0.61.0 → 0.62.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 CHANGED
@@ -310,6 +310,20 @@ 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
+
313
327
  type PanelContentPadding = 'none' | 'sm' | 'md';
314
328
  type PanelContentScroll = 'none' | 'auto';
315
329
  type PanelContentTone = 'default' | 'surface' | 'tool';
@@ -451,4 +465,4 @@ interface ShellSlotProps extends HTMLAttributes<HTMLElement> {
451
465
  /** Structural shell marker that preserves the caller's semantic element. */
452
466
  declare function ShellSlot({ as, name, ...props }: ShellSlotProps): ReactElement;
453
467
 
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 };
468
+ 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, 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, installPointerDragSession, installPointerReorderSession, installThresholdPointerDragSession, installViewportResizeObservation, isDismissExemptInteractionTarget, isSlotDebugEnabled, useDockLayoutControlBinding, useLiveTabPlacement, useLiveTabTitle, useLocalSize, usePersistentSizeStore, useTabCloseInteractions, useTabPinnedState };
package/dist/react.js CHANGED
@@ -2055,6 +2055,78 @@ 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
+
2058
2130
  // src/panel.tsx
2059
2131
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
2060
2132
  function PanelEmptyState({
@@ -2428,6 +2500,7 @@ export {
2428
2500
  beginAnchoredResize,
2429
2501
  createCoalescedFrameTaskLifecycle,
2430
2502
  createPersistentSizeStore,
2503
+ createReplaceableObservationSetLifecycle,
2431
2504
  hashSlotHue,
2432
2505
  installBoundedFrameRetryLifecycle,
2433
2506
  installCaptureInteractionObservation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/app-shell",
3
- "version": "0.61.0",
3
+ "version": "0.62.0",
4
4
  "description": "Generic Dock, Panel, Window, and Slot composition primitives",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",