epic-modals 0.0.10 → 1.0.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.
Files changed (126) hide show
  1. package/LICENSE +21 -93
  2. package/dist/core/animation/controller.d.ts +58 -0
  3. package/dist/core/animation/flip.d.ts +8 -0
  4. package/dist/core/animation/genie.d.ts +14 -0
  5. package/dist/core/animation/index.d.ts +6 -0
  6. package/dist/core/animation/timing.d.ts +34 -0
  7. package/dist/core/behaviors/drag.d.ts +34 -0
  8. package/dist/core/behaviors/focusTrap.d.ts +23 -0
  9. package/dist/core/behaviors/index.d.ts +6 -0
  10. package/dist/core/behaviors/parentChild.d.ts +27 -0
  11. package/dist/core/behaviors/resize.d.ts +49 -0
  12. package/dist/core/config/defaults.d.ts +90 -0
  13. package/dist/core/config/index.d.ts +4 -0
  14. package/dist/core/config/resolution.d.ts +25 -0
  15. package/dist/core/index.d.ts +7 -5
  16. package/dist/core/modal/Controller.d.ts +70 -0
  17. package/dist/core/modal/Controller.types.d.ts +77 -0
  18. package/dist/core/modal/Interactions.d.ts +67 -0
  19. package/dist/core/modal/Lifecycle.d.ts +20 -0
  20. package/dist/core/modal/Positioning.d.ts +40 -0
  21. package/dist/core/modal/StateManager.d.ts +91 -0
  22. package/dist/core/modal/Styling.d.ts +42 -0
  23. package/dist/core/modal/index.d.ts +8 -0
  24. package/dist/core/state/effects.d.ts +16 -0
  25. package/dist/core/state/events.d.ts +15 -0
  26. package/dist/core/state/getters.d.ts +37 -0
  27. package/dist/core/state/index.d.ts +17 -0
  28. package/dist/core/state/internal.d.ts +105 -0
  29. package/dist/core/state/layout.d.ts +17 -0
  30. package/dist/core/state/minimize.d.ts +18 -0
  31. package/dist/core/state/open-close.d.ts +21 -0
  32. package/dist/core/state/parent-child.d.ts +17 -0
  33. package/dist/core/state/pending.d.ts +55 -0
  34. package/dist/core/state/position.d.ts +15 -0
  35. package/dist/core/state/registration.d.ts +15 -0
  36. package/dist/core/state/stacking.d.ts +10 -0
  37. package/dist/core/state/zindex.d.ts +8 -0
  38. package/dist/core/types.d.ts +107 -14
  39. package/dist/core/utils/backdrop.d.ts +8 -0
  40. package/dist/core/utils/constants.d.ts +193 -0
  41. package/dist/core/utils/dock.d.ts +12 -0
  42. package/dist/core/utils/dom.d.ts +31 -0
  43. package/dist/core/utils/helpers.d.ts +8 -0
  44. package/dist/core/utils/index.d.ts +8 -0
  45. package/dist/core/utils/viewport/constraints.d.ts +7 -0
  46. package/dist/core/utils/viewport/index.d.ts +7 -0
  47. package/dist/core/utils/viewport/overlap.d.ts +30 -0
  48. package/dist/core/utils/viewport/smart-layout.d.ts +3 -0
  49. package/dist/core/utils/viewport/smart-position.d.ts +36 -0
  50. package/dist/core/utils/viewport/types.d.ts +56 -0
  51. package/dist/core/utils/viewport.d.ts +3 -0
  52. package/dist/core.js +1 -1
  53. package/dist/epic-modals.css +45 -7
  54. package/dist/index.js +1 -1
  55. package/dist/react/components/Backdrop.d.ts +7 -0
  56. package/dist/react/{ModalProvider.d.ts → components/ModalProvider.d.ts} +4 -5
  57. package/dist/react/components/Portal.d.ts +10 -0
  58. package/dist/react/components/dock/Dock.d.ts +7 -0
  59. package/dist/react/components/dock/DockItem.d.ts +16 -0
  60. package/dist/react/{Modal.d.ts → components/modal/Modal.d.ts} +4 -3
  61. package/dist/react/components/modal/ModalHeader.d.ts +13 -0
  62. package/dist/react/components/modal/ModalInner.d.ts +17 -0
  63. package/dist/react/components/modal/ResizeHandles.d.ts +9 -0
  64. package/dist/react/components/wizard/WizardModal.d.ts +33 -0
  65. package/dist/react/components/wizard/WizardStep.d.ts +15 -0
  66. package/dist/react/context.d.ts +10 -3
  67. package/dist/react/hooks/useConfig.d.ts +25 -0
  68. package/dist/react/useModal.d.ts +3 -7
  69. package/dist/react.d.ts +10 -6
  70. package/dist/react.js +1 -1
  71. package/dist/runtime.js +1 -1
  72. package/dist/styles/animations.css +1 -1
  73. package/dist/styles/backdrop.css +1 -0
  74. package/dist/styles/dock.css +1 -1
  75. package/dist/styles/index.css +1 -1
  76. package/dist/styles/modal.css +1 -1
  77. package/dist/styles/themes/dark.css +1 -1
  78. package/dist/styles/themes/light.css +1 -1
  79. package/dist/styles/variables.css +1 -1
  80. package/dist/styles/wizard.css +1 -0
  81. package/dist/svelte/actions/appendElement.d.ts +1 -4
  82. package/dist/svelte/components/wizard/WizardModal.svelte.d.ts +1 -0
  83. package/dist/svelte/components/wizard/WizardStep.svelte.d.ts +1 -0
  84. package/dist/svelte/context.d.ts +5 -5
  85. package/dist/svelte/hooks/index.d.ts +5 -8
  86. package/dist/svelte/hooks/useFocusTrap.svelte.d.ts +4 -13
  87. package/dist/svelte/hooks/useModal.svelte.d.ts +24 -28
  88. package/dist/svelte/hooks/useModalConfig.svelte.d.ts +27 -0
  89. package/dist/svelte/hooks/useModalZIndex.svelte.d.ts +3 -23
  90. package/dist/svelte/hooks/usePortal.svelte.d.ts +2 -7
  91. package/dist/svelte/hooks/useWindowEvent.svelte.d.ts +2 -7
  92. package/dist/svelte/stores.svelte.d.ts +6 -0
  93. package/dist/svelte/wizardContext.svelte.d.ts +36 -0
  94. package/dist/svelte.d.ts +17 -7
  95. package/dist/svelte.js +1 -1
  96. package/dist/ui.js +1 -1
  97. package/dist/vanilla/VanillaBackdrop.d.ts +14 -0
  98. package/dist/vanilla/VanillaDock.d.ts +24 -0
  99. package/dist/vanilla/VanillaModal.d.ts +76 -0
  100. package/dist/vanilla/index.d.ts +21 -25
  101. package/dist/vanilla.d.ts +1 -8
  102. package/dist/vanilla.js +1 -1
  103. package/package.json +36 -5
  104. package/dist/core/config.svelte.d.ts +0 -85
  105. package/dist/core/stacking.svelte.d.ts +0 -19
  106. package/dist/core/state.svelte.d.ts +0 -324
  107. package/dist/core/utils.d.ts +0 -7
  108. package/dist/core/viewport.d.ts +0 -92
  109. package/dist/core/viewport.test.d.ts +0 -2
  110. package/dist/react/Dock.d.ts +0 -10
  111. package/dist/react/index.d.ts +0 -15
  112. package/dist/react/reactiveProps.svelte.d.ts +0 -17
  113. package/dist/react/svelte-bridge.d.ts +0 -18
  114. package/dist/react/useModalZIndex.d.ts +0 -35
  115. package/dist/svelte/hooks/useModalAnimation.svelte.d.ts +0 -16
  116. package/dist/svelte/hooks/useModalDrag.svelte.d.ts +0 -16
  117. package/dist/svelte/hooks/useModalResize.svelte.d.ts +0 -18
  118. package/dist/svelte/index.d.ts +0 -14
  119. /package/dist/svelte/{Backdrop.svelte.d.ts → components/Backdrop.svelte.d.ts} +0 -0
  120. /package/dist/svelte/{ModalProvider.svelte.d.ts → components/ModalProvider.svelte.d.ts} +0 -0
  121. /package/dist/svelte/{Portal.svelte.d.ts → components/Portal.svelte.d.ts} +0 -0
  122. /package/dist/svelte/{Dock.svelte.d.ts → components/dock/Dock.svelte.d.ts} +0 -0
  123. /package/dist/svelte/{Modal.svelte.d.ts → components/modal/Modal.svelte.d.ts} +0 -0
  124. /package/dist/svelte/{ModalHeader.svelte.d.ts → components/modal/ModalHeader.svelte.d.ts} +0 -0
  125. /package/dist/svelte/{ModalInner.svelte.d.ts → components/modal/ModalInner.svelte.d.ts} +0 -0
  126. /package/dist/svelte/{ResizeHandles.svelte.d.ts → components/modal/ResizeHandles.svelte.d.ts} +0 -0
@@ -0,0 +1,67 @@
1
+ import { ResizeDirection } from '../behaviors/resize';
2
+ import { ModalFeatures } from '../types';
3
+
4
+ export interface InteractionConfigHelper {
5
+ isFeatureEnabled: (feature: keyof ModalFeatures) => boolean;
6
+ }
7
+
8
+ export interface InteractionDragBehavior {
9
+ onPointerDown: (e: PointerEvent, element: HTMLElement) => void;
10
+ onPointerMove: (e: PointerEvent, modalSize: {
11
+ width: number;
12
+ height: number;
13
+ }) => void;
14
+ onPointerUp: (e: PointerEvent, element: HTMLElement) => void;
15
+ isDragging: () => boolean;
16
+ getPosition: () => {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ hasBeenDragged: () => boolean;
21
+ }
22
+
23
+ export interface InteractionResizeBehavior {
24
+ startResize: (e: PointerEvent, direction: ResizeDirection) => void;
25
+ hasBeenResized: () => boolean;
26
+ getSize: () => {
27
+ width: number;
28
+ height: number;
29
+ };
30
+ justFinishedResizing: () => boolean;
31
+ }
32
+
33
+ export interface InteractionState {
34
+ hasChild: boolean;
35
+ }
36
+ export interface ModalInteractionsOptions {
37
+ id: string;
38
+ configHelper: InteractionConfigHelper;
39
+ getDragBehavior: () => InteractionDragBehavior;
40
+ getResizeBehavior: () => InteractionResizeBehavior;
41
+ getElement: () => HTMLElement | null;
42
+ getState: () => InteractionState;
43
+ onDragMove: () => void;
44
+ onDragEnd: () => void;
45
+ onClose?: () => void;
46
+ closeOnEscape?: boolean;
47
+ isTopModal: () => boolean;
48
+ }
49
+ export declare class ModalInteractions {
50
+ private options;
51
+ constructor(options: ModalInteractionsOptions);
52
+
53
+ startDrag(e: PointerEvent): void;
54
+
55
+ startResize(e: PointerEvent, direction: ResizeDirection): void;
56
+
57
+ handlePointerMove(e: PointerEvent): void;
58
+
59
+ handlePointerUp(e: PointerEvent): void;
60
+
61
+ handleKeyDown(e: KeyboardEvent): void;
62
+
63
+ handleTabKey(e: KeyboardEvent): void;
64
+
65
+ focusFirst(): void;
66
+ }
67
+ //# sourceMappingURL=Interactions.d.ts.map
@@ -0,0 +1,20 @@
1
+ export interface ModalLifecycleOptions {
2
+ onMount?: () => void;
3
+ onDestroy?: () => void;
4
+ onWindowResize?: () => void;
5
+ }
6
+ export declare class ModalLifecycle {
7
+ private element;
8
+ private resizeHandler;
9
+ private options;
10
+ constructor(options?: ModalLifecycleOptions);
11
+
12
+ mount(element: HTMLElement): void;
13
+
14
+ destroy(): void;
15
+
16
+ getElement(): HTMLElement | null;
17
+
18
+ isMounted(): boolean;
19
+ }
20
+ //# sourceMappingURL=Lifecycle.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { ModalId, Dimensions } from '../types';
2
+ import { DragBehavior } from '../behaviors/drag';
3
+ import { PositioningConfig } from '../config';
4
+
5
+ export interface PositioningConfigHelper {
6
+ getPositioning: <K extends keyof PositioningConfig>(key: K) => PositioningConfig[K];
7
+ }
8
+ export interface ModalPositioningOptions {
9
+
10
+ id: ModalId;
11
+
12
+ dataId: string;
13
+
14
+ configHelper: PositioningConfigHelper;
15
+
16
+ getDragBehavior: () => DragBehavior;
17
+
18
+ getElement: () => HTMLElement | null;
19
+ }
20
+ export declare class ModalPositioning {
21
+ private id;
22
+ private dataId;
23
+ private configHelper;
24
+ private getDragBehavior;
25
+ private getElement;
26
+ constructor(options: ModalPositioningOptions);
27
+
28
+ constrainToViewport(size: Dimensions): void;
29
+
30
+ shouldApplySmartPositioning(): boolean;
31
+
32
+ applySmartPositioning(): boolean;
33
+
34
+ scheduleSmartPositioning(): void;
35
+
36
+ centerChildOnParent(parentId: ModalId): boolean;
37
+
38
+ scheduleCenterChildOnParent(parentId: ModalId): void;
39
+ }
40
+ //# sourceMappingURL=Positioning.d.ts.map
@@ -0,0 +1,91 @@
1
+ import { ModalId, Position } from '../types';
2
+ import { DragBehavior } from '../behaviors/drag';
3
+ import { ResizeBehavior } from '../behaviors/resize';
4
+ import { AnimationController } from '../animation/controller';
5
+
6
+ export interface StateManagerPositioning {
7
+ centerChildOnParent: (parentId: ModalId) => boolean;
8
+ scheduleCenterChildOnParent: (parentId: ModalId) => void;
9
+ applySmartPositioning: () => void;
10
+ scheduleSmartPositioning: () => void;
11
+ }
12
+ export interface ModalStateManagerOptions {
13
+
14
+ id: ModalId;
15
+
16
+ options: {
17
+ glow?: unknown;
18
+ openSourcePosition?: Position | null;
19
+ onClose?: () => void;
20
+ };
21
+
22
+ getDragBehavior: () => DragBehavior;
23
+
24
+ getResizeBehavior: () => ResizeBehavior;
25
+
26
+ getAnimationController: () => AnimationController;
27
+
28
+ getElement: () => HTMLElement | null;
29
+
30
+ getPositioning: () => StateManagerPositioning;
31
+
32
+ onStateChange: () => void;
33
+
34
+ focusFirst: () => void;
35
+ }
36
+ export declare class ModalStateManager {
37
+ private id;
38
+ private options;
39
+ private _isHandlingMinimize;
40
+ private _isAttentionAnimating;
41
+ private _wasRestored;
42
+ private _glowStabilizing;
43
+ private _restoreHold;
44
+ private _isAnimatingToCenter;
45
+ private _cancelParentAnimationCleanup;
46
+ private _parentFlipInFlight;
47
+ private _deferredParentTarget;
48
+ private _parentFlipStartTime;
49
+ constructor(options: ModalStateManagerOptions);
50
+
51
+ handlePendingStates(): void;
52
+
53
+ private handlePendingForceClose;
54
+
55
+ private handlePendingMinimize;
56
+
57
+ private handlePendingMinimizeWithParent;
58
+
59
+ private handlePendingRestore;
60
+
61
+ private handlePendingChildRestore;
62
+
63
+ private handlePendingClose;
64
+
65
+ private handlePendingParentLink;
66
+
67
+ private handlePendingOpen;
68
+
69
+ private openChildModalWithAnimation;
70
+
71
+ private openStandaloneModalWithAnimation;
72
+
73
+ private handlePendingAttention;
74
+
75
+ private handlePendingParentAnimation;
76
+
77
+ private startParentFlip;
78
+
79
+ private handleChildCentering;
80
+ get wasRestored(): boolean;
81
+ set wasRestored(value: boolean);
82
+ get isAttentionAnimating(): boolean;
83
+ get glowStabilizing(): boolean;
84
+ set glowStabilizing(value: boolean);
85
+ get restoreHold(): boolean;
86
+ set restoreHold(value: boolean);
87
+ get isAnimatingToCenter(): boolean;
88
+ set isAnimatingToCenter(value: boolean);
89
+ get isHandlingMinimize(): boolean;
90
+ }
91
+ //# sourceMappingURL=StateManager.d.ts.map
@@ -0,0 +1,42 @@
1
+ import { Position, Dimensions, ModalGlow, AnimationTransform } from '../types';
2
+ export interface ComputeStyleInput {
3
+ position: Position;
4
+ hasBeenDragged: boolean;
5
+ hasBeenResized: boolean;
6
+ size: Dimensions;
7
+ animationTransform: AnimationTransform | null;
8
+ zIndex: number;
9
+ glowEnabled: boolean;
10
+ glow: ModalGlow | null;
11
+ maxWidth: string | undefined;
12
+ preferredHeight: string | undefined;
13
+
14
+ isAnimatingPosition?: boolean;
15
+ }
16
+ export interface ComputeCssClassesInput {
17
+ isDragging: boolean;
18
+ isResizing: boolean;
19
+ hasBeenDragged: boolean;
20
+ isMinimizing: boolean;
21
+ isRestoring: boolean;
22
+ isOpening: boolean;
23
+ isClosing: boolean;
24
+ showCentered: boolean;
25
+ isTransparent: boolean;
26
+ glowEnabled: boolean;
27
+ hasChild: boolean;
28
+ isChildModal: boolean;
29
+ wasRestored: boolean;
30
+ isVisibleByAnimation: boolean;
31
+ isAwaitingRestore: boolean;
32
+ isAwaitingChildOpen: boolean;
33
+ isAnimatingToCenter: boolean;
34
+ isAnimatingPosition: boolean;
35
+ isAttentionAnimating: boolean;
36
+ glowStabilizing: boolean;
37
+ }
38
+
39
+ export declare function computeStyle(input: ComputeStyleInput): Record<string, string | number>;
40
+
41
+ export declare function computeCssClasses(input: ComputeCssClassesInput): string[];
42
+ //# sourceMappingURL=Styling.d.ts.map
@@ -0,0 +1,8 @@
1
+
2
+ export * from './Controller';
3
+ export * from './Lifecycle';
4
+ export * from './Styling';
5
+ export * from './Positioning';
6
+ export * from './Interactions';
7
+ export * from './StateManager';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { ModalId } from '../types';
2
+
3
+ export declare function toggleModalTransparency(id: ModalId): void;
4
+
5
+ export declare function triggerAttention(id: ModalId): void;
6
+
7
+ export declare function shakeElement(element: HTMLElement): void;
8
+
9
+ export declare function triggerRejection(id: ModalId): void;
10
+
11
+ export declare function resetModalTransparency(id: ModalId): void;
12
+
13
+ export declare function startAttentionAnimation(_id: ModalId): void;
14
+
15
+ export declare function endAttentionAnimation(_id: ModalId): void;
16
+ //# sourceMappingURL=effects.d.ts.map
@@ -0,0 +1,15 @@
1
+
2
+ export type EventCallback<T = void> = (data: T) => void;
3
+
4
+ export declare function createEventEmitter<T>(): {
5
+
6
+ on<K extends keyof T>(event: K, callback: EventCallback<T[K]>): () => void;
7
+
8
+ emit<K extends keyof T>(event: K, data: T[K]): void;
9
+
10
+ off<K extends keyof T>(event?: K): void;
11
+
12
+ listenerCount<K extends keyof T>(event: K): number;
13
+ };
14
+ export type EventEmitter<T> = ReturnType<typeof createEventEmitter<T>>;
15
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { ModalState, ModalId, Position } from '../types';
2
+ import { ModalLayoutInfo, ModalBounds } from '../utils/viewport';
3
+ import { getStateVersion, subscribe } from './internal';
4
+ export { getStateVersion, subscribe };
5
+
6
+ export declare function getModalState(id: ModalId): ModalState | undefined;
7
+
8
+ export declare function isModalOpen(id: ModalId): boolean;
9
+
10
+ export declare function isModalRegistered(id: ModalId): boolean;
11
+
12
+ export declare function isModalAnimating(id: ModalId): boolean;
13
+
14
+ export declare function setModalAnimating(id: ModalId, animating: boolean): void;
15
+
16
+ export declare function getModalsStore(): Map<ModalId, ModalState>;
17
+
18
+ export declare function getDockOrder(): ModalId[];
19
+
20
+ export declare function getDockItemElement(id: ModalId): HTMLElement | null;
21
+
22
+ export declare function getModalLayoutInfos(): ModalLayoutInfo[];
23
+
24
+ export declare function getOpenModalBounds(excludeId?: ModalId): ModalBounds[];
25
+
26
+ export declare function getMinimizedModals(): ModalState[];
27
+
28
+ export declare function getOpenSourcePositionFromState(id: ModalId): Position | null;
29
+
30
+ export declare function getOpenModalBoundsWithIds(excludeId?: ModalId): Array<{
31
+ id: string;
32
+ x: number;
33
+ y: number;
34
+ width: number;
35
+ height: number;
36
+ }>;
37
+ //# sourceMappingURL=getters.d.ts.map
@@ -0,0 +1,17 @@
1
+
2
+ export { batchUpdates, getStateVersion, subscribe, setDockPositionGetterInternal, setRegistryCallbacksInternal, setURLCallbacks, _resetInternalState, _getInternalState, type URLStateCallbacks, type RegistryCallbacks, type DockPositionGetter, } from './internal';
3
+ export { registerModal, unregisterModal, createModalRegistration, type CreateModalRegistrationProps, } from './registration';
4
+ export { minimizeModal, restoreModal, restoreAllMinimizedModals, restoreChildModal, unhideChildModal, finalizeChildMinimize, hideChildWithParent, clearPendingParentAnimation, } from './minimize';
5
+ export { bringToFront, isTopModal, reorderDock, } from './zindex';
6
+ export { updateModalPosition, clearPositionAnimation, updateModalSize, updateModal, } from './position';
7
+ export { openModal, openChildModal, createModal, closeModal, closeAllModals, finalizeModalClose, getModalsToClose, type OpenModalOptions, } from './open-close';
8
+ export { hasPendingMinimize, consumePendingMinimize, hasPendingMinimizeWithParent, consumePendingMinimizeWithParent, hasPendingOpen, consumePendingOpen, hasPendingClose, consumePendingClose, hasPendingForceClose, consumePendingForceClose, hasPendingRestore, consumePendingRestore, hasPendingChildRestore, consumePendingChildRestore, hasPendingAttention, consumePendingAttention, clearActiveAttention, hasPendingParentLinkFor, hasPendingParentAnimation, consumePendingParentAnimation, storeOpenSourcePosition, getOpenSourcePosition, consumeOpenSourcePosition, consumePendingMinimizeTarget, consumePendingParentLink, } from './pending';
9
+ export { getModalState, isModalOpen, isModalRegistered, isModalAnimating, setModalAnimating, getModalsStore, getDockOrder, getDockItemElement, getModalLayoutInfos, getOpenModalBounds, getOpenModalBoundsWithIds, getMinimizedModals, } from './getters';
10
+ export { toggleModalTransparency, triggerAttention, shakeElement, triggerRejection, resetModalTransparency, startAttentionAnimation, endAttentionAnimation, } from './effects';
11
+ export { triggerRearrangement, applyLayoutPositions, animateModalsToPositions, handleWindowResize, initializeResizeListener, cleanupResizeListener, } from './layout';
12
+ export { linkModals, getPendingParentLink, triggerCascadingParentAnimations, getPendingParentAnimation, calculateChildCenterPosition, } from './parent-child';
13
+ export * from './stacking';
14
+ export * from './events';
15
+ export { setURLCallbacks as setURLStateCallbacks } from './internal';
16
+ export { setRegistryCallbacksInternal as setRegistryFunctions } from './internal';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,105 @@
1
+ import { ModalState, ModalId, Position, Dimensions, AnimationTransform } from '../types';
2
+
3
+ export interface URLStateCallbacks {
4
+ push: (id: ModalId) => void;
5
+ replace: (id: ModalId) => void;
6
+ pop: () => void;
7
+ }
8
+
9
+ export type DockPositionGetter = () => {
10
+ x: number;
11
+ y: number;
12
+ width: number;
13
+ height: number;
14
+ };
15
+
16
+ export interface RegistryCallbacks {
17
+ mountModal: (id: ModalId) => void;
18
+ isRegisteredInRegistry: (id: ModalId) => boolean;
19
+ unmountModal: (id: ModalId) => void;
20
+ }
21
+
22
+ export declare const modals: Map<ModalId, ModalState>;
23
+
24
+ export declare let rearrangementTimeout: ReturnType<typeof setTimeout> | null;
25
+ export declare function setRearrangementTimeout(timeout: ReturnType<typeof setTimeout> | null): void;
26
+
27
+ export declare let resizeTimeout: ReturnType<typeof setTimeout> | null;
28
+ export declare function setResizeTimeout(timeout: ReturnType<typeof setTimeout> | null): void;
29
+ export declare let pendingMinimize: ModalId[];
30
+ export declare let pendingOpen: ModalId[];
31
+ export declare let pendingClose: ModalId[];
32
+ export declare let pendingForceClose: ModalId[];
33
+ export declare let pendingRestore: ModalId[];
34
+ export declare let pendingChildRestore: ModalId[];
35
+ export declare let pendingMinimizeWithParent: ModalId[];
36
+ export declare let pendingAttention: ModalId[];
37
+ export declare let activeAttention: ModalId[];
38
+
39
+ export declare let pendingMinimizeTarget: AnimationTransform | null;
40
+ export declare function setPendingMinimizeTarget(target: AnimationTransform | null): void;
41
+
42
+ export declare const openSourcePositions: Map<ModalId, Position>;
43
+
44
+ export declare let pendingParentLink: {
45
+ parentId: ModalId;
46
+ childId: ModalId;
47
+ } | null;
48
+ export declare function setPendingParentLink(link: {
49
+ parentId: ModalId;
50
+ childId: ModalId;
51
+ } | null): void;
52
+
53
+ export declare const pendingParentAnimations: Map<ModalId, Position>;
54
+
55
+ export declare const animatingModals: Set<ModalId>;
56
+
57
+ export declare const closingModals: Set<ModalId>;
58
+
59
+ export declare const transparentModals: Set<ModalId>;
60
+
61
+ export declare let dockOrder: ModalId[];
62
+ export declare function setDockOrder(order: ModalId[]): void;
63
+ export declare let urlCallbacks: URLStateCallbacks | null;
64
+ export declare function setURLCallbacks(callbacks: URLStateCallbacks | null): void;
65
+ export declare let dockPositionGetter: DockPositionGetter | null;
66
+ export declare function setDockPositionGetterInternal(getter: DockPositionGetter | null): void;
67
+ export declare let registryCallbacks: RegistryCallbacks | null;
68
+ export declare function setRegistryCallbacksInternal(callbacks: RegistryCallbacks | null): void;
69
+ export declare function setPendingMinimize(arr: ModalId[]): void;
70
+ export declare function setPendingOpen(arr: ModalId[]): void;
71
+ export declare function setPendingClose(arr: ModalId[]): void;
72
+ export declare function setPendingForceClose(arr: ModalId[]): void;
73
+ export declare function setPendingRestore(arr: ModalId[]): void;
74
+ export declare function setPendingChildRestore(arr: ModalId[]): void;
75
+ export declare function setPendingMinimizeWithParent(arr: ModalId[]): void;
76
+ export declare function setPendingAttention(arr: ModalId[]): void;
77
+ export declare function setActiveAttention(arr: ModalId[]): void;
78
+
79
+ export declare function incrementVersion(): void;
80
+
81
+ export declare function getStateVersion(): number;
82
+
83
+ export declare function subscribe(callback: () => void): () => void;
84
+
85
+ export declare function batchUpdates(callback: () => void): void;
86
+
87
+ export declare function validatePosition(position: Position, context: string): void;
88
+
89
+ export declare function validateDimensions(size: Dimensions, context: string): void;
90
+
91
+ export declare function warnIfUnregistered(id: ModalId, method: string): boolean;
92
+
93
+ export declare function _resetInternalState(): void;
94
+
95
+ export declare function _getInternalState(): {
96
+ modals: Map<string, ModalState>;
97
+ pendingMinimize: string[];
98
+ pendingOpen: string[];
99
+ pendingClose: string[];
100
+ pendingRestore: string[];
101
+ dockOrder: string[];
102
+ animatingModals: Set<string>;
103
+ transparentModals: Set<string>;
104
+ };
105
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { Position } from '../types';
2
+
3
+ export declare function triggerRearrangement(newModal: {
4
+ id: string;
5
+ width: number;
6
+ height: number;
7
+ } | null): void;
8
+
9
+ export declare function applyLayoutPositions(positions: Map<string, Position>): void;
10
+
11
+ export declare function handleWindowResize(): void;
12
+ export declare function initializeResizeListener(): void;
13
+
14
+ export declare function cleanupResizeListener(): void;
15
+
16
+ export declare function animateModalsToPositions(moves: Map<string, Position>): void;
17
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { ModalId } from '../types';
2
+
3
+ export declare function clearPendingParentAnimation(parentId: ModalId): void;
4
+
5
+ export declare function minimizeModal(id: ModalId): void;
6
+
7
+ export declare function restoreModal(id: ModalId): void;
8
+
9
+ export declare function restoreAllMinimizedModals(): void;
10
+
11
+ export declare function restoreChildModal(id: ModalId): void;
12
+
13
+ export declare function unhideChildModal(id: ModalId): void;
14
+
15
+ export declare function finalizeChildMinimize(id: ModalId): void;
16
+
17
+ export declare function hideChildWithParent(parentId: ModalId): void;
18
+ //# sourceMappingURL=minimize.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { ModalId, ModalState, Position } from '../types';
2
+
3
+ export interface OpenModalOptions {
4
+
5
+ parentId?: ModalId;
6
+ }
7
+
8
+ export declare function openChildModal(childId: ModalId, parentId: ModalId, source: HTMLElement | Position): void;
9
+
10
+ export declare function openModal(id: ModalId, source: HTMLElement | Position, options?: OpenModalOptions): void;
11
+
12
+ export declare function createModal(modal: Omit<ModalState, 'zIndex' | 'isAnimating'>): void;
13
+
14
+ export declare function closeModal(id: ModalId, force?: boolean): void;
15
+
16
+ export declare function closeAllModals(exclude?: ModalId[]): void;
17
+
18
+ export declare function finalizeModalClose(id: ModalId): void;
19
+
20
+ export declare function getModalsToClose(fromIdOrExclude: ModalId | ModalId[]): ModalId[];
21
+ //# sourceMappingURL=open-close.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { ModalId, Position } from '../types';
2
+
3
+ export declare function linkModals(parentId: ModalId, childId: ModalId, offset: Position): void;
4
+
5
+ export declare function getPendingParentLink(): {
6
+ parentId: ModalId;
7
+ childId: ModalId;
8
+ } | null;
9
+
10
+ export declare function triggerCascadingParentAnimations(childId: ModalId): void;
11
+
12
+ export declare function getPendingParentAnimation(id: ModalId): Position | null;
13
+
14
+ export declare function clearPendingParentAnimation(id: ModalId): void;
15
+
16
+ export declare function calculateChildCenterPosition(parentId: ModalId, childWidth: number, childHeight: number): Position | null;
17
+ //# sourceMappingURL=parent-child.d.ts.map
@@ -0,0 +1,55 @@
1
+ import { ModalId, AnimationTransform, Position } from '../types';
2
+
3
+ export declare function hasPendingMinimize(id: ModalId): boolean;
4
+
5
+ export declare function consumePendingMinimize(id: ModalId): AnimationTransform | null;
6
+
7
+ export declare function hasPendingMinimizeWithParent(id: ModalId): boolean;
8
+
9
+ export declare function consumePendingMinimizeWithParent(id: ModalId): void;
10
+
11
+ export declare function hasPendingOpen(id: ModalId): boolean;
12
+
13
+ export declare function consumePendingOpen(id: ModalId): void;
14
+
15
+ export declare function hasPendingClose(id: ModalId): boolean;
16
+
17
+ export declare function consumePendingClose(id: ModalId): void;
18
+
19
+ export declare function hasPendingForceClose(id: ModalId): boolean;
20
+
21
+ export declare function consumePendingForceClose(id: ModalId): void;
22
+
23
+ export declare function hasPendingRestore(id: ModalId): boolean;
24
+
25
+ export declare function consumePendingRestore(id: ModalId): void;
26
+
27
+ export declare function hasPendingChildRestore(id: ModalId): boolean;
28
+
29
+ export declare function consumePendingChildRestore(id: ModalId): void;
30
+
31
+ export declare function hasPendingAttention(id: ModalId): boolean;
32
+
33
+ export declare function consumePendingAttention(id: ModalId): void;
34
+
35
+ export declare function clearActiveAttention(id: ModalId): void;
36
+
37
+ export declare function hasPendingParentLinkFor(id: ModalId): boolean;
38
+
39
+ export declare function hasPendingParentAnimation(id: ModalId): boolean;
40
+
41
+ export declare function consumePendingParentAnimation(id: ModalId): Position | null;
42
+
43
+ export declare function storeOpenSourcePosition(id: ModalId, position: Position): void;
44
+
45
+ export declare function getOpenSourcePosition(id: ModalId): Position | null;
46
+
47
+ export declare function consumeOpenSourcePosition(id: ModalId): Position | null;
48
+
49
+ export declare function consumePendingMinimizeTarget(): AnimationTransform | null;
50
+
51
+ export declare function consumePendingParentLink(modalId?: ModalId): {
52
+ parentId: ModalId;
53
+ childId: ModalId;
54
+ } | null;
55
+ //# sourceMappingURL=pending.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { ModalId, ModalState, Position, Dimensions } from '../types';
2
+
3
+ export declare function updateModalPosition(id: ModalId, position: Position, options?: {
4
+ constrain?: boolean;
5
+ drag?: boolean;
6
+ size?: Dimensions;
7
+ realtime?: boolean;
8
+ }): void;
9
+
10
+ export declare function clearPositionAnimation(id: ModalId): void;
11
+
12
+ export declare function updateModalSize(id: ModalId, size: Dimensions): void;
13
+
14
+ export declare function updateModal(id: ModalId, updates: Partial<ModalState>): void;
15
+ //# sourceMappingURL=position.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { ModalState, ModalId, ModalGlow } from '../types';
2
+
3
+ export interface CreateModalRegistrationProps {
4
+ id: ModalId;
5
+ title: string;
6
+ icon?: string;
7
+ autoOpen?: boolean;
8
+ glow?: ModalGlow | null;
9
+ }
10
+ export declare function createModalRegistration(props: CreateModalRegistrationProps): Omit<ModalState, 'zIndex' | 'isAnimating'>;
11
+
12
+ export declare function registerModal(modal: Omit<ModalState, 'zIndex' | 'isAnimating'>): void;
13
+
14
+ export declare function unregisterModal(id: ModalId): void;
15
+ //# sourceMappingURL=registration.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { StackingLayerName } from '../types';
2
+
3
+ export declare function initializeStacking(): void;
4
+
5
+ export declare function acquireModalZIndex(): number;
6
+
7
+ export declare function getLayerZIndex(layer: StackingLayerName): number;
8
+
9
+ export declare function resetStacking(): void;
10
+ //# sourceMappingURL=stacking.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { ModalId } from '../types';
2
+
3
+ export declare function bringToFront(id: ModalId): void;
4
+
5
+ export declare function isTopModal(id: ModalId): boolean;
6
+
7
+ export declare function reorderDock(newOrderOrFromIndex: ModalId[] | number, toIndex?: number): void;
8
+ //# sourceMappingURL=zindex.d.ts.map