@forgeax/app-shell 0.56.0 → 0.58.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
@@ -261,6 +261,20 @@ interface CoalescedFrameTaskLifecycle {
261
261
  */
262
262
  declare function createCoalescedFrameTaskLifecycle(options: CoalescedFrameTaskLifecycleOptions): CoalescedFrameTaskLifecycle;
263
263
 
264
+ interface DragPresenceEventTarget {
265
+ addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
266
+ removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
267
+ }
268
+ interface DragPresenceLifecycleOptions {
269
+ readonly target?: DragPresenceEventTarget;
270
+ readonly isStartTarget: (target: EventTarget | null) => boolean;
271
+ readonly onActiveChange: (active: boolean) => void;
272
+ /** Observes every dragover, including drags that were not admitted as active. */
273
+ readonly onDragOver?: (target: EventTarget | null) => void;
274
+ }
275
+ /** Own one HTML5 drag-presence lease without owning target or presentation policy. */
276
+ declare function installDragPresenceLifecycle(options: DragPresenceLifecycleOptions): () => void;
277
+
264
278
  type PanelContentPadding = 'none' | 'sm' | 'md';
265
279
  type PanelContentScroll = 'none' | 'auto';
266
280
  type PanelContentTone = 'default' | 'surface' | 'tool';
@@ -402,4 +416,4 @@ interface ShellSlotProps extends HTMLAttributes<HTMLElement> {
402
416
  /** Structural shell marker that preserves the caller's semantic element. */
403
417
  declare function ShellSlot({ as, name, ...props }: ShellSlotProps): ReactElement;
404
418
 
405
- export { type AnchoredResizeDirection, AnchoredResizeHandle, type AnchoredResizeHandleProps, type AnchoredResizeSession, type BoundedFrameRetryLifecycleOptions, type CoalescedFrameTaskLifecycle, type CoalescedFrameTaskLifecycleOptions, 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, 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, applyAnchoredResizeDelta, beginAnchoredResize, createCoalescedFrameTaskLifecycle, createPersistentSizeStore, hashSlotHue, installBoundedFrameRetryLifecycle, installOutsideDismissLifecycle, installPointerDragSession, installPointerReorderSession, installThresholdPointerDragSession, isDismissExemptInteractionTarget, isSlotDebugEnabled, useDockLayoutControlBinding, useLiveTabPlacement, useLiveTabTitle, useLocalSize, usePersistentSizeStore, useTabCloseInteractions, useTabPinnedState };
419
+ export { type AnchoredResizeDirection, AnchoredResizeHandle, type AnchoredResizeHandleProps, type AnchoredResizeSession, type BoundedFrameRetryLifecycleOptions, type CoalescedFrameTaskLifecycle, type CoalescedFrameTaskLifecycleOptions, 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, applyAnchoredResizeDelta, beginAnchoredResize, createCoalescedFrameTaskLifecycle, createPersistentSizeStore, hashSlotHue, installBoundedFrameRetryLifecycle, installDragPresenceLifecycle, installOutsideDismissLifecycle, installPointerDragSession, installPointerReorderSession, installThresholdPointerDragSession, isDismissExemptInteractionTarget, isSlotDebugEnabled, useDockLayoutControlBinding, useLiveTabPlacement, useLiveTabTitle, useLocalSize, usePersistentSizeStore, useTabCloseInteractions, useTabPinnedState };
package/dist/react.js CHANGED
@@ -1856,6 +1856,82 @@ function createCoalescedFrameTaskLifecycle(options) {
1856
1856
  };
1857
1857
  }
1858
1858
 
1859
+ // src/drag-presence.ts
1860
+ function installDragPresenceLifecycle(options) {
1861
+ const target = options.target ?? (typeof window === "undefined" ? void 0 : window);
1862
+ if (!target) return () => {
1863
+ };
1864
+ let disposed = false;
1865
+ let active = false;
1866
+ let startRegistered = false;
1867
+ let overRegistered = false;
1868
+ let endRegistered = false;
1869
+ let dropRegistered = false;
1870
+ const publish = (next) => {
1871
+ if (active === next) return;
1872
+ active = next;
1873
+ try {
1874
+ options.onActiveChange(next);
1875
+ } catch {
1876
+ }
1877
+ };
1878
+ const onStart = (event) => {
1879
+ if (disposed || active) return;
1880
+ let accepted = false;
1881
+ try {
1882
+ accepted = options.isStartTarget(event.target);
1883
+ } catch {
1884
+ return;
1885
+ }
1886
+ if (disposed || !accepted) return;
1887
+ publish(true);
1888
+ };
1889
+ const onEnd = () => {
1890
+ if (disposed) return;
1891
+ publish(false);
1892
+ };
1893
+ const onOver = (event) => {
1894
+ if (disposed) return;
1895
+ try {
1896
+ options.onDragOver?.(event.target);
1897
+ } catch {
1898
+ }
1899
+ };
1900
+ const remove = (type, listener, registered) => {
1901
+ if (!registered) return;
1902
+ try {
1903
+ target.removeEventListener(type, listener, true);
1904
+ } catch {
1905
+ }
1906
+ };
1907
+ try {
1908
+ startRegistered = true;
1909
+ target.addEventListener("dragstart", onStart, true);
1910
+ overRegistered = true;
1911
+ target.addEventListener("dragover", onOver, true);
1912
+ endRegistered = true;
1913
+ target.addEventListener("dragend", onEnd, true);
1914
+ dropRegistered = true;
1915
+ target.addEventListener("drop", onEnd, true);
1916
+ } catch {
1917
+ disposed = true;
1918
+ remove("drop", onEnd, dropRegistered);
1919
+ remove("dragend", onEnd, endRegistered);
1920
+ remove("dragover", onOver, overRegistered);
1921
+ remove("dragstart", onStart, startRegistered);
1922
+ publish(false);
1923
+ }
1924
+ return () => {
1925
+ if (disposed) return;
1926
+ disposed = true;
1927
+ remove("drop", onEnd, dropRegistered);
1928
+ remove("dragend", onEnd, endRegistered);
1929
+ remove("dragover", onOver, overRegistered);
1930
+ remove("dragstart", onStart, startRegistered);
1931
+ publish(false);
1932
+ };
1933
+ }
1934
+
1859
1935
  // src/panel.tsx
1860
1936
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
1861
1937
  function PanelEmptyState({
@@ -2231,6 +2307,7 @@ export {
2231
2307
  createPersistentSizeStore,
2232
2308
  hashSlotHue,
2233
2309
  installBoundedFrameRetryLifecycle,
2310
+ installDragPresenceLifecycle,
2234
2311
  installOutsideDismissLifecycle,
2235
2312
  installPointerDragSession,
2236
2313
  installPointerReorderSession,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/app-shell",
3
- "version": "0.56.0",
3
+ "version": "0.58.0",
4
4
  "description": "Generic Dock, Panel, Window, and Slot composition primitives",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",