@forgeax/app-shell 0.60.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
@@ -298,6 +298,32 @@ interface CustomEventObservationOptions {
298
298
  /** Observe a caller-owned custom event without owning its payload or command policy. */
299
299
  declare function installCustomEventObservation(options: CustomEventObservationOptions): () => void;
300
300
 
301
+ interface CaptureInteractionEventTarget {
302
+ addEventListener(type: string, listener: EventListener, capture?: boolean): void;
303
+ removeEventListener(type: string, listener: EventListener, capture?: boolean): void;
304
+ }
305
+ interface CaptureInteractionObservationOptions {
306
+ readonly target?: CaptureInteractionEventTarget;
307
+ readonly onPointerDown: (event: PointerEvent) => void;
308
+ readonly onClick: (event: MouseEvent) => void;
309
+ }
310
+ /** Observe pointerdown and click in capture order without owning interaction policy. */
311
+ declare function installCaptureInteractionObservation(options: CaptureInteractionObservationOptions): () => void;
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
+
301
327
  type PanelContentPadding = 'none' | 'sm' | 'md';
302
328
  type PanelContentScroll = 'none' | 'auto';
303
329
  type PanelContentTone = 'default' | 'surface' | 'tool';
@@ -439,4 +465,4 @@ interface ShellSlotProps extends HTMLAttributes<HTMLElement> {
439
465
  /** Structural shell marker that preserves the caller's semantic element. */
440
466
  declare function ShellSlot({ as, name, ...props }: ShellSlotProps): ReactElement;
441
467
 
442
- export { type AnchoredResizeDirection, AnchoredResizeHandle, type AnchoredResizeHandleProps, type AnchoredResizeSession, type BoundedFrameRetryLifecycleOptions, 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, 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
@@ -2008,6 +2008,125 @@ function installCustomEventObservation(options) {
2008
2008
  };
2009
2009
  }
2010
2010
 
2011
+ // src/capture-interaction-observation.ts
2012
+ function installCaptureInteractionObservation(options) {
2013
+ const target = options.target ?? (typeof document === "undefined" ? void 0 : document);
2014
+ if (!target) return () => {
2015
+ };
2016
+ let disposed = false;
2017
+ let pointerRegistered = false;
2018
+ let clickRegistered = false;
2019
+ const onPointerDown = (event) => {
2020
+ if (disposed) return;
2021
+ try {
2022
+ options.onPointerDown(event);
2023
+ } catch {
2024
+ }
2025
+ };
2026
+ const onClick = (event) => {
2027
+ if (disposed) return;
2028
+ try {
2029
+ options.onClick(event);
2030
+ } catch {
2031
+ }
2032
+ };
2033
+ const remove = (type, listener, registered) => {
2034
+ if (!registered) return;
2035
+ try {
2036
+ target.removeEventListener(type, listener, true);
2037
+ } catch {
2038
+ }
2039
+ };
2040
+ try {
2041
+ pointerRegistered = true;
2042
+ target.addEventListener("pointerdown", onPointerDown, true);
2043
+ clickRegistered = true;
2044
+ target.addEventListener("click", onClick, true);
2045
+ } catch {
2046
+ disposed = true;
2047
+ remove("click", onClick, clickRegistered);
2048
+ remove("pointerdown", onPointerDown, pointerRegistered);
2049
+ }
2050
+ return () => {
2051
+ if (disposed) return;
2052
+ disposed = true;
2053
+ remove("click", onClick, clickRegistered);
2054
+ remove("pointerdown", onPointerDown, pointerRegistered);
2055
+ };
2056
+ }
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
+
2011
2130
  // src/panel.tsx
2012
2131
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
2013
2132
  function PanelEmptyState({
@@ -2381,8 +2500,10 @@ export {
2381
2500
  beginAnchoredResize,
2382
2501
  createCoalescedFrameTaskLifecycle,
2383
2502
  createPersistentSizeStore,
2503
+ createReplaceableObservationSetLifecycle,
2384
2504
  hashSlotHue,
2385
2505
  installBoundedFrameRetryLifecycle,
2506
+ installCaptureInteractionObservation,
2386
2507
  installCustomEventObservation,
2387
2508
  installDragPresenceLifecycle,
2388
2509
  installOutsideDismissLifecycle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/app-shell",
3
- "version": "0.60.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",