epic-modals 1.0.1 → 1.0.3

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 (113) hide show
  1. package/dist/core.d.ts +1562 -0
  2. package/dist/core.js +1 -1
  3. package/dist/react.d.ts +101 -12
  4. package/dist/react.js +1 -1
  5. package/dist/styles/all.css +1 -0
  6. package/dist/styles/basic.css +1 -0
  7. package/dist/styles/showcase.css +1 -0
  8. package/dist/svelte.d.ts +227 -19
  9. package/dist/svelte.js +1 -1
  10. package/dist/vanilla.d.ts +148 -3
  11. package/dist/vanilla.js +1 -1
  12. package/package.json +11 -20
  13. package/dist/core/animation/controller.d.ts +0 -58
  14. package/dist/core/animation/flip.d.ts +0 -8
  15. package/dist/core/animation/genie.d.ts +0 -14
  16. package/dist/core/animation/index.d.ts +0 -6
  17. package/dist/core/animation/timing.d.ts +0 -34
  18. package/dist/core/behaviors/drag.d.ts +0 -34
  19. package/dist/core/behaviors/focusTrap.d.ts +0 -23
  20. package/dist/core/behaviors/index.d.ts +0 -6
  21. package/dist/core/behaviors/parentChild.d.ts +0 -27
  22. package/dist/core/behaviors/resize.d.ts +0 -49
  23. package/dist/core/config/defaults.d.ts +0 -90
  24. package/dist/core/config/index.d.ts +0 -4
  25. package/dist/core/config/resolution.d.ts +0 -25
  26. package/dist/core/index.d.ts +0 -9
  27. package/dist/core/modal/Controller.d.ts +0 -70
  28. package/dist/core/modal/Controller.types.d.ts +0 -77
  29. package/dist/core/modal/Interactions.d.ts +0 -67
  30. package/dist/core/modal/Lifecycle.d.ts +0 -20
  31. package/dist/core/modal/Positioning.d.ts +0 -40
  32. package/dist/core/modal/StateManager.d.ts +0 -91
  33. package/dist/core/modal/Styling.d.ts +0 -42
  34. package/dist/core/modal/index.d.ts +0 -8
  35. package/dist/core/state/effects.d.ts +0 -16
  36. package/dist/core/state/events.d.ts +0 -15
  37. package/dist/core/state/getters.d.ts +0 -37
  38. package/dist/core/state/index.d.ts +0 -17
  39. package/dist/core/state/internal.d.ts +0 -105
  40. package/dist/core/state/layout.d.ts +0 -17
  41. package/dist/core/state/minimize.d.ts +0 -18
  42. package/dist/core/state/open-close.d.ts +0 -21
  43. package/dist/core/state/parent-child.d.ts +0 -17
  44. package/dist/core/state/pending.d.ts +0 -55
  45. package/dist/core/state/position.d.ts +0 -15
  46. package/dist/core/state/registration.d.ts +0 -15
  47. package/dist/core/state/stacking.d.ts +0 -10
  48. package/dist/core/state/zindex.d.ts +0 -8
  49. package/dist/core/types.d.ts +0 -191
  50. package/dist/core/utils/backdrop.d.ts +0 -8
  51. package/dist/core/utils/constants.d.ts +0 -193
  52. package/dist/core/utils/dock.d.ts +0 -12
  53. package/dist/core/utils/dom.d.ts +0 -31
  54. package/dist/core/utils/helpers.d.ts +0 -8
  55. package/dist/core/utils/index.d.ts +0 -8
  56. package/dist/core/utils/viewport/constraints.d.ts +0 -7
  57. package/dist/core/utils/viewport/index.d.ts +0 -7
  58. package/dist/core/utils/viewport/overlap.d.ts +0 -30
  59. package/dist/core/utils/viewport/smart-layout.d.ts +0 -3
  60. package/dist/core/utils/viewport/smart-position.d.ts +0 -36
  61. package/dist/core/utils/viewport/types.d.ts +0 -56
  62. package/dist/core/utils/viewport.d.ts +0 -3
  63. package/dist/epic-modals.css +0 -47
  64. package/dist/index.d.ts +0 -2
  65. package/dist/index.js +0 -1
  66. package/dist/react/components/Backdrop.d.ts +0 -7
  67. package/dist/react/components/ModalProvider.d.ts +0 -10
  68. package/dist/react/components/Portal.d.ts +0 -10
  69. package/dist/react/components/dock/Dock.d.ts +0 -7
  70. package/dist/react/components/dock/DockItem.d.ts +0 -16
  71. package/dist/react/components/modal/Modal.d.ts +0 -10
  72. package/dist/react/components/modal/ModalHeader.d.ts +0 -13
  73. package/dist/react/components/modal/ModalInner.d.ts +0 -17
  74. package/dist/react/components/modal/ResizeHandles.d.ts +0 -9
  75. package/dist/react/components/wizard/WizardModal.d.ts +0 -33
  76. package/dist/react/components/wizard/WizardStep.d.ts +0 -15
  77. package/dist/react/context.d.ts +0 -11
  78. package/dist/react/hooks/useConfig.d.ts +0 -25
  79. package/dist/react/hooks/useModal.d.ts +0 -23
  80. package/dist/runtime.js +0 -1
  81. package/dist/styles/animations.css +0 -1
  82. package/dist/styles/backdrop.css +0 -1
  83. package/dist/styles/index.css +0 -1
  84. package/dist/styles/modal.css +0 -1
  85. package/dist/styles/themes/dark.css +0 -1
  86. package/dist/styles/themes/light.css +0 -1
  87. package/dist/styles/variables.css +0 -1
  88. package/dist/svelte/actions/appendElement.d.ts +0 -6
  89. package/dist/svelte/components/Backdrop.svelte.d.ts +0 -1
  90. package/dist/svelte/components/ModalProvider.svelte.d.ts +0 -1
  91. package/dist/svelte/components/Portal.svelte.d.ts +0 -1
  92. package/dist/svelte/components/dock/Dock.svelte.d.ts +0 -1
  93. package/dist/svelte/components/modal/Modal.svelte.d.ts +0 -1
  94. package/dist/svelte/components/modal/ModalHeader.svelte.d.ts +0 -1
  95. package/dist/svelte/components/modal/ModalInner.svelte.d.ts +0 -1
  96. package/dist/svelte/components/modal/ResizeHandles.svelte.d.ts +0 -1
  97. package/dist/svelte/components/wizard/WizardModal.svelte.d.ts +0 -1
  98. package/dist/svelte/components/wizard/WizardStep.svelte.d.ts +0 -1
  99. package/dist/svelte/context.d.ts +0 -8
  100. package/dist/svelte/hooks/index.d.ts +0 -10
  101. package/dist/svelte/hooks/useFocusTrap.svelte.d.ts +0 -11
  102. package/dist/svelte/hooks/useModal.svelte.d.ts +0 -37
  103. package/dist/svelte/hooks/useModalConfig.svelte.d.ts +0 -27
  104. package/dist/svelte/hooks/useModalZIndex.svelte.d.ts +0 -10
  105. package/dist/svelte/hooks/usePortal.svelte.d.ts +0 -8
  106. package/dist/svelte/hooks/useWindowEvent.svelte.d.ts +0 -7
  107. package/dist/svelte/stores.svelte.d.ts +0 -6
  108. package/dist/svelte/wizardContext.svelte.d.ts +0 -36
  109. package/dist/ui.js +0 -1
  110. package/dist/vanilla/VanillaBackdrop.d.ts +0 -14
  111. package/dist/vanilla/VanillaDock.d.ts +0 -24
  112. package/dist/vanilla/VanillaModal.d.ts +0 -76
  113. package/dist/vanilla/index.d.ts +0 -47
@@ -1,25 +0,0 @@
1
- import { ModalLibraryConfig, ModalFeatures, AppearanceConfig, AnimationDurations, PositioningConfig, ParentChildConfig, PartialModalLibraryConfig } from './defaults';
2
- import { ModalConfigOverrides } from '../types';
3
- export interface ConfigResolverOptions {
4
-
5
- getModalConfig: () => ModalConfigOverrides | undefined;
6
-
7
- getProviderConfig: () => PartialModalLibraryConfig | undefined;
8
- }
9
- export interface ConfigResolver {
10
-
11
- getEffectiveConfig: () => ModalLibraryConfig;
12
-
13
- isFeatureEnabled: (feature: keyof ModalFeatures) => boolean;
14
-
15
- getAppearance: <K extends keyof AppearanceConfig>(key: K) => AppearanceConfig[K];
16
-
17
- getAnimation: <K extends keyof AnimationDurations>(key: K) => AnimationDurations[K];
18
-
19
- getPositioning: <K extends keyof PositioningConfig>(key: K) => PositioningConfig[K];
20
-
21
- getParentChild: <K extends keyof ParentChildConfig>(key: K) => ParentChildConfig[K];
22
- }
23
-
24
- export declare function createConfigResolver(options: ConfigResolverOptions): ConfigResolver;
25
- //# sourceMappingURL=resolution.d.ts.map
@@ -1,9 +0,0 @@
1
-
2
- export * from './types';
3
- export * from './config';
4
- export * from './state';
5
- export { CSS, CSS_CLASSES, DATA_ATTRS, DATA_ATTRIBUTES, RESIZE_DIRECTIONS, RESIZE_DIRECTION_LABELS, ANIMATION_DURATIONS, DEFAULTS, FOCUSABLE_SELECTORS, onAnimationEnd, setupAnimationEndListener, whenHasDimensions, ANIMATION_NAMES, constrainToViewport, constrainSizeToViewport, calculateOverlap, calculateTotalOverlap, calculateMinDistance, getElementBounds, calculateEqualSpaceLayout, calculateSmartLayout, computeAvailableArea, type ModalBounds, type ViewportConstraintOptions, type SmartPositionOptions, type ModalBoundsWithId, type ModalLayoutInfo, type SmartLayoutOptions, type SmartLayoutResult, toDataId, getMinimizedModals, calculateDockDragPosition, constrainDockPosition, getDockContainerClasses, getDockClasses, isBackdropEnabled, hasOpenModals, getBackdropConfig, } from './utils';
6
- export * from './behaviors';
7
- export * from './animation';
8
- export * from './modal';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1,70 +0,0 @@
1
- import { Position, ModalId } from '../types';
2
- import { ResizeDirection } from '../behaviors/resize';
3
- import { ModalControllerOptions, ComputedModalState } from './Controller.types';
4
- export type { ModalControllerOptions, ComputedModalState, ModalControllerEvents, ModalConfigHelper, } from './Controller.types';
5
- export declare class ModalController {
6
- private id;
7
- private dataId;
8
- private options;
9
- private drag;
10
- private resize;
11
- private animation;
12
- private positioning;
13
- private lifecycle;
14
- private interactions;
15
- private stateManager;
16
- private overlayClosing;
17
- private emitter;
18
- private unsubscribeState;
19
- private cachedState;
20
- constructor(options: ModalControllerOptions);
21
-
22
- mount(element: HTMLElement): void;
23
-
24
- destroy(): void;
25
-
26
- private get element();
27
-
28
- private handleWindowResize;
29
-
30
- private register;
31
-
32
- getState(): ComputedModalState;
33
-
34
- subscribe(callback: (state: ComputedModalState) => void): () => void;
35
- private notifyStateChange;
36
-
37
- startDrag(e: PointerEvent): void;
38
-
39
- startResize(e: PointerEvent, direction: ResizeDirection): void;
40
-
41
- handlePointerMove(e: PointerEvent): void;
42
-
43
- handlePointerUp(e: PointerEvent): void;
44
-
45
- handleKeyDown(e: KeyboardEvent): void;
46
-
47
- handleTabKey(e: KeyboardEvent): void;
48
-
49
- minimize(): void;
50
-
51
- close(): void;
52
-
53
- toggleTransparency(): void;
54
-
55
- bringToFront(): void;
56
-
57
- setOpenSourcePosition(position: Position | null): void;
58
-
59
- updateGlow(glow: ModalControllerOptions['glow']): void;
60
-
61
- focusFirst(): void;
62
- private handleResizeEnd;
63
- private handleStateChange;
64
- private handlePendingStates;
65
- getId(): ModalId;
66
- getDataId(): string;
67
- getElement(): HTMLElement | null;
68
- }
69
- export declare function createModalController(options: ModalControllerOptions): ModalController;
70
- //# sourceMappingURL=Controller.d.ts.map
@@ -1,77 +0,0 @@
1
- import { Position, Dimensions, ModalId, ModalGlow, ModalConfigOverrides, AnimationTransform } from '../types';
2
- import { ModalLibraryConfig, ModalConfigHelper } from '../config';
3
- export interface ModalControllerOptions {
4
-
5
- id: ModalId;
6
-
7
- title: string;
8
-
9
- icon?: string;
10
-
11
- config?: ModalConfigOverrides;
12
-
13
- providerConfig?: Partial<ModalLibraryConfig>;
14
-
15
- maxWidth?: string;
16
-
17
- preferredHeight?: string;
18
-
19
- glow?: ModalGlow;
20
-
21
- closeOnEscape?: boolean;
22
-
23
- autoOpen?: boolean;
24
-
25
- openSourcePosition?: Position | null;
26
-
27
- onClose?: () => void;
28
-
29
- skipRegistration?: boolean;
30
-
31
- configHelper: ModalConfigHelper;
32
- }
33
- export type { ModalConfigHelper };
34
-
35
- export interface ComputedModalState {
36
- position: Position;
37
- size: Dimensions;
38
- zIndex: number;
39
- isDragging: boolean;
40
- isResizing: boolean;
41
- hasBeenDragged: boolean;
42
- hasBeenResized: boolean;
43
- isMinimizing: boolean;
44
- isRestoring: boolean;
45
- isOpening: boolean;
46
- isClosing: boolean;
47
- isAnyAnimating: boolean;
48
- animationTransform: AnimationTransform | null;
49
- isVisible: boolean;
50
- showCentered: boolean;
51
- isAwaitingRestore: boolean;
52
- isAwaitingChildOpen: boolean;
53
- isVisibleByAnimation: boolean;
54
- hasChild: boolean;
55
- isChildModal: boolean;
56
- showOverlay: boolean;
57
- isTransparent: boolean;
58
- isAttentionAnimating: boolean;
59
- glowStabilizing: boolean;
60
- isAnimatingPosition: boolean;
61
- isAnimatingToCenter: boolean;
62
- wasRestored: boolean;
63
- overlayClosing: boolean;
64
- glowEnabled: boolean;
65
- draggable: boolean;
66
- resizable: boolean;
67
- minimizable: boolean;
68
- dataState: string;
69
- dataAnimationPhase: string;
70
- style: Record<string, string | number>;
71
- cssClasses: string[];
72
- }
73
- export interface ModalControllerEvents {
74
- stateChange: ComputedModalState;
75
- close: void;
76
- }
77
- //# sourceMappingURL=Controller.types.d.ts.map
@@ -1,67 +0,0 @@
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
@@ -1,20 +0,0 @@
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
@@ -1,40 +0,0 @@
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
@@ -1,91 +0,0 @@
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
@@ -1,42 +0,0 @@
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
@@ -1,8 +0,0 @@
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
@@ -1,16 +0,0 @@
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
@@ -1,15 +0,0 @@
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
@@ -1,37 +0,0 @@
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
@@ -1,17 +0,0 @@
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
@@ -1,105 +0,0 @@
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
@@ -1,17 +0,0 @@
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