@forgeax/app-shell 0.56.0 → 0.57.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 +13 -1
- package/dist/react.js +65 -0
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -261,6 +261,18 @@ 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
|
+
}
|
|
273
|
+
/** Own one HTML5 drag-presence lease without owning target or presentation policy. */
|
|
274
|
+
declare function installDragPresenceLifecycle(options: DragPresenceLifecycleOptions): () => void;
|
|
275
|
+
|
|
264
276
|
type PanelContentPadding = 'none' | 'sm' | 'md';
|
|
265
277
|
type PanelContentScroll = 'none' | 'auto';
|
|
266
278
|
type PanelContentTone = 'default' | 'surface' | 'tool';
|
|
@@ -402,4 +414,4 @@ interface ShellSlotProps extends HTMLAttributes<HTMLElement> {
|
|
|
402
414
|
/** Structural shell marker that preserves the caller's semantic element. */
|
|
403
415
|
declare function ShellSlot({ as, name, ...props }: ShellSlotProps): ReactElement;
|
|
404
416
|
|
|
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 };
|
|
417
|
+
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,70 @@ 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 endRegistered = false;
|
|
1868
|
+
let dropRegistered = false;
|
|
1869
|
+
const publish = (next) => {
|
|
1870
|
+
if (active === next) return;
|
|
1871
|
+
active = next;
|
|
1872
|
+
try {
|
|
1873
|
+
options.onActiveChange(next);
|
|
1874
|
+
} catch {
|
|
1875
|
+
}
|
|
1876
|
+
};
|
|
1877
|
+
const onStart = (event) => {
|
|
1878
|
+
if (disposed || active) return;
|
|
1879
|
+
let accepted = false;
|
|
1880
|
+
try {
|
|
1881
|
+
accepted = options.isStartTarget(event.target);
|
|
1882
|
+
} catch {
|
|
1883
|
+
return;
|
|
1884
|
+
}
|
|
1885
|
+
if (disposed || !accepted) return;
|
|
1886
|
+
publish(true);
|
|
1887
|
+
};
|
|
1888
|
+
const onEnd = () => {
|
|
1889
|
+
if (disposed) return;
|
|
1890
|
+
publish(false);
|
|
1891
|
+
};
|
|
1892
|
+
const remove = (type, listener, registered) => {
|
|
1893
|
+
if (!registered) return;
|
|
1894
|
+
try {
|
|
1895
|
+
target.removeEventListener(type, listener, true);
|
|
1896
|
+
} catch {
|
|
1897
|
+
}
|
|
1898
|
+
};
|
|
1899
|
+
try {
|
|
1900
|
+
startRegistered = true;
|
|
1901
|
+
target.addEventListener("dragstart", onStart, true);
|
|
1902
|
+
endRegistered = true;
|
|
1903
|
+
target.addEventListener("dragend", onEnd, true);
|
|
1904
|
+
dropRegistered = true;
|
|
1905
|
+
target.addEventListener("drop", onEnd, true);
|
|
1906
|
+
} catch {
|
|
1907
|
+
disposed = true;
|
|
1908
|
+
remove("drop", onEnd, dropRegistered);
|
|
1909
|
+
remove("dragend", onEnd, endRegistered);
|
|
1910
|
+
remove("dragstart", onStart, startRegistered);
|
|
1911
|
+
publish(false);
|
|
1912
|
+
}
|
|
1913
|
+
return () => {
|
|
1914
|
+
if (disposed) return;
|
|
1915
|
+
disposed = true;
|
|
1916
|
+
remove("drop", onEnd, dropRegistered);
|
|
1917
|
+
remove("dragend", onEnd, endRegistered);
|
|
1918
|
+
remove("dragstart", onStart, startRegistered);
|
|
1919
|
+
publish(false);
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1859
1923
|
// src/panel.tsx
|
|
1860
1924
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1861
1925
|
function PanelEmptyState({
|
|
@@ -2231,6 +2295,7 @@ export {
|
|
|
2231
2295
|
createPersistentSizeStore,
|
|
2232
2296
|
hashSlotHue,
|
|
2233
2297
|
installBoundedFrameRetryLifecycle,
|
|
2298
|
+
installDragPresenceLifecycle,
|
|
2234
2299
|
installOutsideDismissLifecycle,
|
|
2235
2300
|
installPointerDragSession,
|
|
2236
2301
|
installPointerReorderSession,
|