epic-modals 0.0.10 → 1.0.1

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 → hooks/useModal.d.ts} +4 -8
  69. package/dist/react.d.ts +11 -7
  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 +43 -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
@@ -1,41 +1,40 @@
1
- import { BaseModalProps } from '../core/types';
2
- import { ModalLibraryConfig } from '../core/config.svelte.js';
3
- export { openModal, closeModal, minimizeModal, restoreModal, bringToFront, isModalOpen, isModalRegistered, openChildModal, closeAllModals, toggleModalTransparency, } from '../core/state.svelte.js';
4
- export { setConfig, getConfig } from '../core/config.svelte.js';
5
- export interface ModalOptions extends Omit<BaseModalProps, 'icon'> {
1
+ import { VanillaModalOptions } from './VanillaModal';
2
+ import { ModalLibraryConfig } from '../core/config';
3
+ export { openModal, closeModal, minimizeModal, restoreModal, restoreAllMinimizedModals, bringToFront, isModalOpen, isModalRegistered, openChildModal, closeAllModals, toggleModalTransparency, getModalState, reorderDock, getModalsStore, getDockOrder, } from '../core/state';
4
+ export { setConfig, getConfig } from '../core/config';
5
+ export type { VanillaModalOptions } from './VanillaModal';
6
+ export type { VanillaDockOptions } from './VanillaDock';
7
+ export type { VanillaBackdropOptions } from './VanillaBackdrop';
8
+ export interface ModalOptions extends Omit<VanillaModalOptions, 'container' | 'content' | 'footer'> {
9
+
6
10
  content?: string | HTMLElement;
11
+
7
12
  footer?: string | HTMLElement;
8
- /** Icon identifier string (used by renderIcon in modal header and dock) */
9
- icon?: string;
10
- /** Custom icon element (overrides icon string if provided) */
13
+
11
14
  customIcon?: string | HTMLElement;
12
15
  }
13
16
  export interface ModalControl {
14
17
  destroy: () => void;
18
+
19
+ update: (options: Partial<ModalOptions>) => void;
15
20
  }
16
21
  export interface DockControl {
17
22
  destroy: () => void;
18
23
  }
19
- /**
20
- * Create a modal
21
- */
22
- export declare function createModal(options: ModalOptions): ModalControl;
23
- /**
24
- * Create a dock for minimized modals
25
- */
26
- export declare function createDock(): DockControl;
27
24
  export interface BackdropControl {
28
25
  destroy: () => void;
29
26
  }
30
- /**
31
- * Create a backdrop overlay (shown when modals are open)
32
- */
27
+
28
+ export declare function createModal(options: ModalOptions): ModalControl;
29
+
30
+ export declare function createDock(): DockControl;
31
+
33
32
  export declare function createBackdrop(): BackdropControl;
34
33
  export interface InitOptions {
35
34
  config?: Partial<ModalLibraryConfig>;
36
- /** Whether to create the backdrop automatically (default: true if features.backdrop is enabled) */
35
+
37
36
  backdrop?: boolean;
38
- /** Whether to create the dock automatically (default: true if features.dock is enabled) */
37
+
39
38
  dock?: boolean;
40
39
  }
41
40
  export interface InitControl {
@@ -43,9 +42,6 @@ export interface InitControl {
43
42
  backdrop: BackdropControl | null;
44
43
  dock: DockControl | null;
45
44
  }
46
- /**
47
- * Initialize the modals library (similar to ModalProvider in Svelte)
48
- * Call this once before creating any modals
49
- */
45
+
50
46
  export declare function init(options?: InitOptions): InitControl;
51
47
  //# sourceMappingURL=index.d.ts.map
package/dist/vanilla.d.ts CHANGED
@@ -1,10 +1,3 @@
1
- /**
2
- * Vanilla JavaScript API for the Modals Library
3
- *
4
- * This entry point exports the vanilla API for creating and managing modals
5
- * without requiring a framework like Svelte or React.
6
- *
7
- * @module vanilla
8
- */
1
+
9
2
  export * from './vanilla/index';
10
3
  //# sourceMappingURL=vanilla.d.ts.map
package/dist/vanilla.js CHANGED
@@ -1 +1 @@
1
- import{m as o,v as t,a as n,s as e,i as r,g as s,D as a,B as d}from"./runtime.js";import{l as c,x as i,e as l,w as u,q as p,f,j as m,o as y,h as g,y as M}from"./runtime.js";function b(e){const{content:r,footer:s,icon:a,...d}=e,c=o(t,{target:document.body,props:{...d,children:r?()=>v(r):void 0,footer:s?()=>v(s):void 0,icon:a?()=>v(a):void 0}});return{destroy:()=>n(c)}}function k(){const t=o(a,{target:document.body,props:{}});return{destroy:()=>n(t)}}function v(o){if("string"==typeof o){const t=document.createElement("div");return t.innerHTML=o,t}return o}function T(){const t=o(d,{target:document.body,props:{}});return{destroy:()=>n(t)}}function h(o={}){const{config:t}=o;t&&e(t),r();const n=s(),a=o.backdrop??n.features.backdrop?T():null,d=o.dock??n.features.dock?k():null;return{backdrop:a,dock:d,destroy:()=>{null==a||a.destroy(),null==d||d.destroy()}}}export{c as bringToFront,i as closeAllModals,l as closeModal,T as createBackdrop,k as createDock,b as createModal,s as getConfig,h as init,u as isModalOpen,p as isModalRegistered,f as minimizeModal,m as openChildModal,y as openModal,g as restoreModal,e as setConfig,M as toggleModalTransparency};
1
+ var e=Object.defineProperty,t=(t,n,i)=>((t,n,i)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i)(t,"symbol"!=typeof n?n+"":n,i);import{J as n,r as i,d as o,b as s,M as a,u as r,K as l,L as d,R as c,v as h,w as p,x as m,j as u,A as b,t as E,p as g,s as C,q as f,k as y,B as k,f as A,N as v,h as H,O as w,l as I,m as N,o as z}from"./runtime.js";import{E as L,P as M,Q as $,S as D,I as O,F as S,G as T,D as x,T as P,U as B,V as W}from"./runtime.js";class F{constructor(e){t(this,"controller"),t(this,"dialogEl"),t(this,"headerEl"),t(this,"bodyEl"),t(this,"footerEl",null),t(this,"resizeHandlesContainer",null),t(this,"container"),t(this,"options"),t(this,"configHelper"),t(this,"unsubscribe",null),t(this,"abortController",new AbortController),this.options=e,this.container=e.container,this.configHelper=n(e.config),i(o({id:e.id,title:e.title,icon:e.icon,autoOpen:e.autoOpen??!0,glow:e.glow})),(e.autoOpen??1)&&s(e.id),this.dialogEl=this.createDialogElement(),this.headerEl=this.createHeaderElement(),this.bodyEl=this.createBodyElement(),e.footer&&(this.footerEl=this.createFooterElement(),this.footerEl.appendChild(e.footer)),this.configHelper.isFeatureEnabled("resize")&&(this.resizeHandlesContainer=this.createResizeHandles()),this.dialogEl.appendChild(this.headerEl),this.dialogEl.appendChild(this.bodyEl),this.footerEl&&this.dialogEl.appendChild(this.footerEl),this.resizeHandlesContainer&&this.dialogEl.appendChild(this.resizeHandlesContainer),e.content&&this.bodyEl.appendChild(e.content);const r={id:e.id,title:e.title,icon:e.icon,config:e.config,maxWidth:e.maxWidth,preferredHeight:e.preferredHeight,glow:e.glow,closeOnEscape:e.closeOnEscape??!0,autoOpen:e.autoOpen??!0,openSourcePosition:e.openSourcePosition,onClose:e.onClose,skipRegistration:!0,configHelper:this.configHelper};this.controller=new a(r),this.container.appendChild(this.dialogEl),this.controller.mount(this.dialogEl),this.unsubscribe=this.controller.subscribe(e=>{this.updateFromState(e)}),this.updateFromState(this.controller.getState()),this.setupEventHandlers()}destroy(){var e;this.abortController.abort(),null==(e=this.unsubscribe)||e.call(this),this.controller.destroy(),r(this.options.id),this.dialogEl.remove()}createDialogElement(){const e=document.createElement("div");return e.className=l.dialog,e.setAttribute(d.modalId,String(this.options.id)),e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-labelledby",`${this.options.id}-title`),e.setAttribute("tabindex","-1"),e}createHeaderElement(){const e=document.createElement("header"),t=this.configHelper.isFeatureEnabled("drag"),n=this.configHelper.getAppearance("headerLayout"),i=this.configHelper.isFeatureEnabled("minimize"),o=!this.configHelper.isFeatureEnabled("dock"),s=this.configHelper.isFeatureEnabled("transparency");e.className=t?`${l.header} ${l.headerDraggable}`:l.header;const a=this.getIconElement();return"macos"===n?this.createMacOSHeader(e,a,i,o,s):this.createWindowsHeader(e,a,i,o,s),e}getIconElement(){return this.options.iconElement?this.options.iconElement:this.options.icon&&this.options.renderIcon?this.options.renderIcon(this.options.icon):null}createMacOSHeader(e,t,n,i,o){const s=document.createElement("div");s.className=l.headerTrafficLights;const a=document.createElement("button");if(a.type="button",a.className=`${l.headerLight} ${l.headerLightClose}`,a.setAttribute("aria-label","Close"),a.setAttribute("data-control","close"),s.appendChild(a),n){const e=document.createElement("button");e.type="button",e.className=`${l.headerLight} ${l.headerLightMinimize}${i?` ${l.headerLightDisabled}`:""}`,e.setAttribute("aria-label","Minimize"),e.setAttribute("data-control","minimize"),i&&(e.disabled=!0,e.title="Enable dock to minimize"),s.appendChild(e)}if(o){const e=document.createElement("button");e.type="button",e.className=`${l.headerLight} ${l.headerLightStyle}`,e.setAttribute("aria-label","Toggle style"),e.setAttribute("data-control","style"),s.appendChild(e)}e.appendChild(s);const r=document.createElement("div");if(r.className=l.headerMacCenter,t){const e=document.createElement("div");e.className=l.headerIcon,e.appendChild(t),r.appendChild(e)}const d=document.createElement("div");d.className=l.headerTitleGroup;const c=document.createElement("h2");c.className=l.headerTitle,c.id=`${this.options.id}-title`,c.textContent=this.options.title,d.appendChild(c),r.appendChild(d),e.appendChild(r);const h=document.createElement("div");h.className=l.headerMacSpacer,e.appendChild(h)}createWindowsHeader(e,t,n,i,o){const s=document.createElement("div");if(s.className=l.headerTitleGroup,t){const e=document.createElement("div");e.className=l.headerIcon,e.appendChild(t),s.appendChild(e)}const a=document.createElement("h2");a.className=l.headerTitle,a.id=`${this.options.id}-title`,a.textContent=this.options.title,s.appendChild(a),e.appendChild(s);const r=document.createElement("div");if(r.className=l.headerActions,o){const e=document.createElement("button");e.type="button",e.className=`${l.headerBtnWindows} ${l.headerBtnWindowsStyle}`,e.setAttribute("aria-label","Toggle style"),e.setAttribute("data-control","style"),e.innerHTML="&#9671;",r.appendChild(e)}if(n){const e=document.createElement("button");e.type="button",e.className=`${l.headerBtnWindows}${i?` ${l.headerBtnWindowsDisabled}`:""}`,e.setAttribute("aria-label","Minimize"),e.setAttribute("data-control","minimize"),e.innerHTML="&#8211;",i&&(e.disabled=!0,e.title="Enable dock to minimize"),r.appendChild(e)}const d=document.createElement("button");d.type="button",d.className=`${l.headerBtnWindows} ${l.headerBtnWindowsClose}`,d.setAttribute("aria-label","Close"),d.setAttribute("data-control","close"),d.innerHTML="&times;",r.appendChild(d),e.appendChild(r)}createBodyElement(){const e=document.createElement("div");return e.className=l.body,e}createFooterElement(){const e=document.createElement("div");return e.className=l.footer,e}createResizeHandles(){const e=document.createElement("div");e.className=l.resizeHandles,e.setAttribute("role","group"),e.setAttribute("aria-label","Resize handles");for(const t of c){const n=document.createElement("div");n.className=`${l.resizeHandle} ${l.resizePrefix}${t}`,n.setAttribute("role","separator"),n.setAttribute("tabindex","0"),n.setAttribute("aria-label",`Resize ${t}`),n.setAttribute("aria-orientation","n"===t||"s"===t?"horizontal":"vertical"),n.setAttribute(d.resizeDirection,t),e.appendChild(n)}return e}updateFromState(e){this.dialogEl.className=e.cssClasses.join(" "),this.updateStyles(e.style),this.dialogEl.setAttribute("data-state",e.dataState),this.dialogEl.setAttribute("data-animation-phase",e.dataAnimationPhase)}updateStyles(e){for(const[t,n]of Object.entries(e))t.startsWith("--")?this.dialogEl.style.setProperty(t,String(n)):this.dialogEl.style.setProperty(t,"number"==typeof n?String(n):n)}setupEventHandlers(){const e=this.abortController.signal,t="macos"===this.configHelper.getAppearance("headerLayout")?`.${l.headerLight}`:`.${l.headerBtnWindows}`;this.headerEl.addEventListener("pointerdown",e=>{e.target.closest(t)||this.controller.startDrag(e)},{signal:e}),this.dialogEl.addEventListener("pointermove",e=>{this.controller.handlePointerMove(e)},{signal:e}),this.dialogEl.addEventListener("pointerup",e=>{this.controller.handlePointerUp(e)},{signal:e}),this.headerEl.addEventListener("click",e=>{const t=e.target.closest("button");if(!t)return;const n=t.getAttribute("data-control");"close"===n?this.controller.close():"minimize"===n?this.controller.minimize():"style"===n&&this.controller.toggleTransparency()},{signal:e}),this.resizeHandlesContainer&&this.resizeHandlesContainer.addEventListener("pointerdown",e=>{const t=e.target.closest(`.${l.resizeHandle}`);if(!t)return;const n=t.getAttribute(d.resizeDirection);n&&this.controller.startResize(e,n)},{signal:e}),this.dialogEl.addEventListener("keydown",e=>{this.controller.handleKeyDown(e)},{signal:e}),this.dialogEl.addEventListener("pointerdown",()=>{this.controller.bringToFront()},{signal:e})}}class R{constructor(e){t(this,"containerEl"),t(this,"dockEl"),t(this,"parentContainer"),t(this,"unsubscribe"),t(this,"abortController",new AbortController),t(this,"isAttached",!1),t(this,"options"),this.options=e,this.parentContainer=e.container,this.containerEl=this.createContainerDOM(),this.dockEl=this.createDockDOM(),this.containerEl.appendChild(this.dockEl),this.unsubscribe=h(()=>{this.render()}),this.render()}createContainerDOM(){const e=document.createElement("div");return e.setAttribute("data-dock-container","true"),e}createDockDOM(){const e=document.createElement("div");return e.className=l.dock,e}render(){const e=y();if(!e.features.dock)return void(this.isAttached&&(this.containerEl.remove(),this.isAttached=!1));const t=p();if(0===t.length)return void(this.isAttached&&(this.containerEl.remove(),this.isAttached=!1));this.isAttached||(this.parentContainer.appendChild(this.containerEl),this.isAttached=!0);const n=e.dock.position;if(this.containerEl.className=m(n,0===t.length),this.containerEl.style.zIndex=String(u("DOCK")),this.dockEl.className=b(n,"horizontal"),this.dockEl.innerHTML="","free"===n){const e=this.createDockHandle();this.dockEl.appendChild(e)}const i=k(),o=e.dock.labelMode;for(const e of t){const t=e.lastChildId?i.get(e.lastChildId):null,n=this.createDockItem(e,t??null,o);this.dockEl.appendChild(n)}}createDockHandle(){const e=document.createElement("button");return e.type="button",e.className=l.dockHandle,e.setAttribute("aria-label","Drag dock"),e}createDockItem(e,t,n){const i=document.createElement("button"),o=[l.dockItem,e.glow&&l.dockItemHasGlow,e.lastChildId&&l.dockItemHasChild,"beside"===n&&l.dockItemLabelBeside,"below"===n&&l.dockItemLabelBelow].filter(Boolean).join(" ");i.className=o,i.setAttribute(d.modalId,E(e.id)),i.setAttribute("aria-label",`Restore ${e.title}`),e.glow&&i.style.setProperty("--modal-dock-glow-color",e.glow.color);const s=document.createElement("span");if(s.className=l.dockItemIcon,e.icon&&this.options.renderIcon){const t=this.options.renderIcon(e.icon);t?s.appendChild(t):s.appendChild(this.createIconPlaceholder(e.title))}else s.appendChild(this.createIconPlaceholder(e.title));if(i.appendChild(s),"hidden"!==n){const t=document.createElement("span");t.className=l.dockItemLabel,t.textContent=e.title,i.appendChild(t)}const a=document.createElement("span");if(a.className=l.dockItemGlow,i.appendChild(a),e.lastChildId&&t){const e=document.createElement("span");if(e.className=l.dockChildIndicator,t.icon&&this.options.renderIcon){const n=this.options.renderIcon(t.icon);n?e.appendChild(n):e.textContent="+"}else e.textContent="+";i.appendChild(e)}return i.addEventListener("click",t=>{g(e.id)?C(t.currentTarget):f(e.id)},{signal:this.abortController.signal}),i}createIconPlaceholder(e){const t=document.createElement("span");return t.className=l.dockItemIconPlaceholder,t.textContent=e.charAt(0),t}destroy(){this.abortController.abort(),this.unsubscribe(),this.isAttached&&(this.containerEl.remove(),this.isAttached=!1)}}class j{constructor(e){t(this,"element"),t(this,"unsubscribe"),t(this,"abortController",new AbortController),this.element=this.createDOM(),e.container.appendChild(this.element),this.unsubscribe=h(()=>{this.render()}),this.render()}createDOM(){const e=document.createElement("div");return e.className=l.backdrop,e.addEventListener("click",()=>{A().blockClicks&&v()},{signal:this.abortController.signal}),e}render(){A().visible?H()?(this.element.classList.add(l.backdropVisible),this.element.style.display=""):(this.element.classList.remove(l.backdropVisible),this.element.style.display="none"):this.element.style.display="none"}destroy(){this.abortController.abort(),this.unsubscribe(),this.element.remove()}}function G(e){if("string"==typeof e){const t=document.createElement("div");return t.innerHTML=e,t}return e}function K(e){const{content:t,footer:n,customIcon:i,...o}=e,s=t?G(t):void 0,a=n?G(n):void 0,r=new F({...o,container:document.body,content:s,footer:a});return{destroy:()=>r.destroy(),update:e=>{}}}function V(){const e=new R({container:document.body});return{destroy:()=>e.destroy()}}function q(){const e=new j({container:document.body});return{destroy:()=>e.destroy()}}function J(e={}){const{config:t}=e;t&&w(t),I(),N();const n=y(),i=e.backdrop??n.features.backdrop?q():null,o=e.dock??n.features.dock?V():null;return{backdrop:i,dock:o,destroy:()=>{null==i||i.destroy(),null==o||o.destroy(),z()}}}export{s as bringToFront,v as closeAllModals,L as closeModal,q as createBackdrop,V as createDock,K as createModal,y as getConfig,M as getDockOrder,$ as getModalState,k as getModalsStore,J as init,D as isModalOpen,O as isModalRegistered,S as minimizeModal,T as openChildModal,x as openModal,P as reorderDock,B as restoreAllMinimizedModals,f as restoreModal,w as setConfig,W as toggleModalTransparency};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epic-modals",
3
- "version": "0.0.10",
3
+ "version": "1.0.1",
4
4
  "description": "A stunning modal library with macOS-style animations, drag, resize, and dock. Supports Svelte 5, React, and vanilla JS.",
5
5
  "keywords": [
6
6
  "modal",
@@ -15,8 +15,15 @@
15
15
  "animations"
16
16
  ],
17
17
  "author": "Damian Lesiuk",
18
- "license": "Elastic-2.0",
18
+ "license": "MIT",
19
19
  "homepage": "https://epicmodals.eu",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/Lesiuk/epic-modals.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/Lesiuk/epic-modals/issues"
26
+ },
20
27
  "type": "module",
21
28
  "main": "./dist/index.js",
22
29
  "module": "./dist/index.js",
@@ -44,20 +51,29 @@
44
51
  "./styles/themes/dark": "./dist/styles/themes/dark.css"
45
52
  },
46
53
  "files": [
47
- "dist",
54
+ "dist/**/*.js",
55
+ "dist/**/*.css",
56
+ "dist/**/*.d.ts",
57
+ "!dist/**/*.test.d.ts",
48
58
  "!dist/**/*.map",
49
59
  "LICENSE"
50
60
  ],
51
61
  "scripts": {
52
62
  "dev": "vite dev",
63
+ "dev:fixtures": "vite --config e2e/fixtures/vite.config.ts",
53
64
  "build": "vite build && BUILD_TYPE=standalone vite build && node scripts/build-css.js",
54
65
  "build:dev": "vite build --mode development && BUILD_TYPE=standalone vite build --mode development && node scripts/build-css.js",
55
66
  "check": "svelte-check --tsconfig ./tsconfig.json",
67
+ "lint": "eslint src --ext .ts,.tsx,.svelte",
56
68
  "test": "vitest run",
57
69
  "test:watch": "vitest",
70
+ "test:all": "vitest run && playwright test",
58
71
  "test:e2e": "playwright test",
59
72
  "test:e2e:ui": "playwright test --ui",
60
- "test:e2e:headed": "playwright test --headed"
73
+ "test:e2e:headed": "playwright test --headed",
74
+ "test:e2e:vanilla": "playwright test --project=vanilla",
75
+ "test:e2e:react": "playwright test --project=react",
76
+ "test:e2e:svelte": "playwright test --project=svelte"
61
77
  },
62
78
  "peerDependencies": {
63
79
  "react": "^18.0.0 || ^19.0.0",
@@ -76,17 +92,39 @@
76
92
  }
77
93
  },
78
94
  "devDependencies": {
95
+ "@eslint/js": "^9.39.2",
96
+ "@istanbuljs/nyc-config-typescript": "^1.0.2",
79
97
  "@rollup/plugin-terser": "^0.4.4",
80
- "lightningcss": "^1.30.0",
81
98
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
99
+ "@testing-library/dom": "^10.4.1",
100
+ "@testing-library/jest-dom": "^6.9.1",
101
+ "@testing-library/react": "^16.3.2",
102
+ "@testing-library/svelte": "^5.3.1",
103
+ "@testing-library/user-event": "^14.6.1",
82
104
  "@types/react": "^19.2.8",
83
105
  "@types/react-dom": "^19.2.3",
106
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
107
+ "@typescript-eslint/parser": "^8.53.1",
108
+ "@vitest/coverage-istanbul": "^4.0.17",
109
+ "@vitest/coverage-v8": "^4.0.17",
110
+ "eslint": "^9.39.2",
111
+ "eslint-plugin-svelte": "^3.14.0",
112
+ "globals": "^17.1.0",
113
+ "happy-dom": "^20.3.7",
114
+ "jsdom": "^27.4.0",
115
+ "lightningcss": "^1.30.0",
116
+ "nyc": "^17.1.0",
117
+ "react": "^19.0.0",
118
+ "react-dom": "^19.0.0",
84
119
  "svelte": "^5.0.0",
85
120
  "svelte-check": "^4.0.0",
121
+ "svelte-eslint-parser": "^1.4.1",
86
122
  "terser": "^5.46.0",
87
123
  "typescript": "^5.6.0",
124
+ "typescript-eslint": "^8.53.1",
88
125
  "vite": "^6.0.0",
89
126
  "vite-plugin-dts": "^4.5.4",
127
+ "vite-plugin-istanbul": "^7.2.1",
90
128
  "vitest": "^4.0.17"
91
129
  }
92
130
  }
@@ -1,85 +0,0 @@
1
- import { DockPosition, DockLabelMode, ModalFeatures, AppearanceConfig } from './types';
2
- export type { ModalFeatures, AppearanceConfig } from './types';
3
- export interface DockConfig {
4
- /** Dock position: left, right, bottom, or free-floating */
5
- position: DockPosition;
6
- /** Label display mode */
7
- labelMode: DockLabelMode;
8
- /** Enable reordering items in dock */
9
- enableReorder: boolean;
10
- /** Allow dock to be dragged freely (when position is 'free') */
11
- enableFreeDrag: boolean;
12
- }
13
- export interface AnimationDurations {
14
- /** Open animation duration */
15
- open: number;
16
- /** Close animation duration */
17
- close: number;
18
- /** Minimize animation duration */
19
- minimize: number;
20
- /** Restore animation duration */
21
- restore: number;
22
- }
23
- export interface ZIndexConfig {
24
- /** Base z-index for modals */
25
- base: number;
26
- /** Z-index for dock */
27
- dock: number;
28
- /** Z-index for toasts */
29
- toast: number;
30
- }
31
- export interface ParentChildConfig {
32
- /** Movement mode: 'realtime' (parent moves instantly) or 'animated' (parent animates after drag) */
33
- movementMode: 'realtime' | 'animated';
34
- /** Animation duration in milliseconds for animated movement mode */
35
- animationDuration: number;
36
- }
37
- export interface PositioningConfig {
38
- /**
39
- * Strategy for placing new modals:
40
- * - 'centered': Always center new modals (default, current behavior)
41
- * - 'smart': Find position with least overlap with existing modals
42
- */
43
- strategy: 'centered' | 'smart';
44
- /** Minimum gap between modals when using smart positioning (default: 16) */
45
- modalGap: number;
46
- /** CSS selectors for elements that modals should avoid overlapping (e.g., navigation bars, toolbars) */
47
- avoidElements: string[];
48
- }
49
- export interface ModalLibraryConfig {
50
- features: ModalFeatures;
51
- dock: DockConfig;
52
- animations: AnimationDurations;
53
- appearance: AppearanceConfig;
54
- zIndex: ZIndexConfig;
55
- parentChild: ParentChildConfig;
56
- positioning: PositioningConfig;
57
- /** Portal target selector or element */
58
- portalTarget: string | HTMLElement;
59
- }
60
- export declare const defaultConfig: ModalLibraryConfig;
61
- /**
62
- * Get the config version for tracking changes in $derived
63
- */
64
- export declare function getConfigVersion(): number;
65
- /**
66
- * Get the current library configuration
67
- */
68
- export declare function getConfig(): ModalLibraryConfig;
69
- /**
70
- * Set the library configuration (called by ModalProvider)
71
- */
72
- export declare function setConfig(config: Partial<ModalLibraryConfig>): void;
73
- /**
74
- * Reset to default configuration
75
- */
76
- export declare function resetConfig(): void;
77
- /**
78
- * Deep merge configuration objects
79
- */
80
- export declare function mergeConfig(base: ModalLibraryConfig, override: Partial<ModalLibraryConfig>): ModalLibraryConfig;
81
- /**
82
- * Check if a feature is enabled
83
- */
84
- export declare function isFeatureEnabled(feature: keyof ModalFeatures): boolean;
85
- //# sourceMappingURL=config.svelte.d.ts.map
@@ -1,19 +0,0 @@
1
- import { StackingLayerName } from './types';
2
- /**
3
- * Initialize the z-index counter from config
4
- */
5
- export declare function initializeStacking(): void;
6
- /**
7
- * Get the next available z-index for a new modal
8
- * Increments by 2 to leave room for floating elements (dropdowns, tooltips) at +1
9
- */
10
- export declare function acquireModalZIndex(): number;
11
- /**
12
- * Get a specific z-index for a layer
13
- */
14
- export declare function getLayerZIndex(layer: StackingLayerName): number;
15
- /**
16
- * Reset the z-index counter (useful for testing)
17
- */
18
- export declare function resetStacking(): void;
19
- //# sourceMappingURL=stacking.svelte.d.ts.map
@@ -1,324 +0,0 @@
1
- import { ModalState, ModalId, Position, Dimensions, AnimationTransform } from './types';
2
- /** URL state callbacks for browser integration */
3
- interface URLStateCallbacks {
4
- push: (id: ModalId) => void;
5
- replace: (id: ModalId) => void;
6
- pop: () => void;
7
- }
8
- /** Dock position getter function */
9
- type DockPositionGetter = () => {
10
- x: number;
11
- y: number;
12
- width: number;
13
- height: number;
14
- };
15
- /** Modal registry interface for static modal lookup (kept for API compatibility) */
16
- interface ModalRegistry {
17
- has(id: ModalId): boolean;
18
- get(id: ModalId): {
19
- title: string;
20
- icon: string;
21
- closeOnOutsideClick?: boolean;
22
- } | undefined;
23
- }
24
- /** Store type for modals collection */
25
- export type ModalsStore = ReturnType<typeof createModalsStore>;
26
- /**
27
- * Subscribe to state changes (for React integration)
28
- * @returns Unsubscribe function
29
- */
30
- export declare function subscribe(callback: () => void): () => void;
31
- declare function createModalsStore(): {
32
- readonly modals: Map<ModalId, ModalState>;
33
- readonly pendingMinimize: ModalId[];
34
- readonly pendingOpen: ModalId[];
35
- readonly pendingClose: ModalId[];
36
- readonly pendingRestore: ModalId[];
37
- readonly dockOrder: ModalId[];
38
- };
39
- /**
40
- * Register a new modal in the system
41
- * If modal already exists, merges new props with existing state to preserve
42
- * saved position, size, and other runtime state
43
- */
44
- export declare function registerModal(modal: Omit<ModalState, 'zIndex' | 'isAnimating'>): void;
45
- /**
46
- * Unregister a modal from the system
47
- */
48
- export declare function unregisterModal(id: ModalId): void;
49
- /**
50
- * Minimize a modal with genie animation to dock
51
- * If this is a child modal, redirects to minimize parent (they act as unit)
52
- * Both parent and child minimize together
53
- */
54
- export declare function minimizeModal(id: ModalId): void;
55
- /**
56
- * Restore a minimized modal from dock
57
- * Also restores child modal if one was hidden with parent
58
- */
59
- export declare function restoreModal(id: ModalId): void;
60
- /**
61
- * Restore all minimized modals (called when dock feature is disabled)
62
- */
63
- export declare function restoreAllMinimizedModals(): void;
64
- /**
65
- * Restore a child modal that was hidden with parent
66
- * Recursively restores all descendants (grandchildren, etc.)
67
- */
68
- export declare function restoreChildModal(id: ModalId): void;
69
- /**
70
- * Update modal position (called during drag)
71
- * Also syncs linked modal positions:
72
- * - If this modal has a child, the child moves with it
73
- * - If this modal is a child, the parent moves with it
74
- */
75
- export declare function updateModalPosition(id: ModalId, position: Position, options?: {
76
- constrain?: boolean;
77
- drag?: boolean;
78
- size?: Dimensions;
79
- }): void;
80
- /**
81
- * Update modal size
82
- */
83
- export declare function updateModalSize(id: ModalId, size: Dimensions): void;
84
- /**
85
- * Update multiple modal properties at once
86
- */
87
- export declare function updateModal(id: ModalId, updates: Partial<ModalState>): void;
88
- /**
89
- * Bring a modal to the front (highest z-index)
90
- * Maintains parent-child z-index relationship: child always above parent
91
- * When clicking on any modal in a chain, the ENTIRE chain is brought to front
92
- */
93
- export declare function bringToFront(id: ModalId): void;
94
- /**
95
- * Check if a modal is the top-most modal
96
- */
97
- export declare function isTopModal(id: ModalId): boolean;
98
- /**
99
- * Reorder dock items (drag and drop)
100
- */
101
- export declare function reorderDock(newOrder: ModalId[]): void;
102
- /**
103
- * Open a modal by ID (for already-registered modals)
104
- *
105
- * @param id - Modal ID to open
106
- * @param sourceElement - Source element for genie animation. REQUIRED - the animation
107
- * needs a source position to animate from. For modals that open without user interaction,
108
- * use the `autoOpen` prop on the Modal component instead.
109
- * @param options - Optional settings like parentId for child modals
110
- */
111
- export interface OpenModalOptions {
112
- /** Parent modal ID to link this modal as a child */
113
- parentId?: ModalId;
114
- }
115
- export declare function openModal(id: ModalId, sourceElement: HTMLElement, options?: OpenModalOptions): void;
116
- /**
117
- * Create and open a new modal (registers and opens in one call)
118
- * @param modal - Full modal state to register and open
119
- */
120
- export declare function createModal(modal: Omit<ModalState, 'zIndex' | 'isAnimating'>): void;
121
- /**
122
- * Close a modal
123
- */
124
- export declare function closeModal(id: ModalId, force?: boolean): void;
125
- /**
126
- * Close all modals
127
- */
128
- export declare function closeAllModals(): void;
129
- /**
130
- * Finalize modal close after animation completes
131
- * Resets modal to minimal closed state to free memory (position, size, etc.)
132
- * but keeps registration so the modal can be reopened
133
- */
134
- export declare function finalizeModalClose(id: ModalId): void;
135
- /**
136
- * Get list of modals to close (for cascade)
137
- */
138
- export declare function getModalsToClose(fromId: ModalId): ModalId[];
139
- /**
140
- * Open a child modal linked to a parent
141
- */
142
- export declare function openChildModal(child: {
143
- id: ModalId;
144
- } & Partial<Omit<ModalState, 'zIndex' | 'isAnimating' | 'parentId'>>, parentId: ModalId, sourceElement?: HTMLElement): void;
145
- /**
146
- * Link two modals as parent-child
147
- * Calculates and stores the offset from parent position for linked movement
148
- */
149
- export declare function linkModals(parentId: ModalId, childId: ModalId): void;
150
- /**
151
- * Hide a child modal when its parent is minimized
152
- * Recursively hides all descendants (grandchildren, etc.)
153
- */
154
- export declare function hideChildWithParent(parentId: ModalId): void;
155
- /**
156
- * Update child modal position when parent moves
157
- * Maintains the offsetFromParent relationship
158
- */
159
- export declare function updateChildPosition(parentId: ModalId, parentPosition: Position): void;
160
- /**
161
- * Calculate and set child's offset from parent
162
- * Called when child modal is first opened centered on parent
163
- */
164
- export declare function setChildOffsetFromParent(childId: ModalId, parentId: ModalId): void;
165
- /** Check if modal has pending minimize */
166
- export declare function hasPendingMinimize(id: ModalId): boolean;
167
- /** Consume pending minimize flag */
168
- export declare function consumePendingMinimize(id: ModalId): boolean;
169
- /** Check if any modal has pending minimize */
170
- export declare function hasAnyPendingMinimize(): boolean;
171
- /** Get all registered modal IDs */
172
- export declare function getRegisteredModalIds(): ModalId[];
173
- /** Get modal state */
174
- export declare function getModalState(id: ModalId): ModalState | undefined;
175
- /**
176
- * Get bounds of all open, visible modals with their IDs (for rearrangement).
177
- * Excludes minimized modals and the modal being positioned.
178
- * Returns bounds from DOM if position/size not tracked in state.
179
- */
180
- export declare function getOpenModalBoundsWithIds(excludeId?: ModalId): Array<{
181
- id: string;
182
- x: number;
183
- y: number;
184
- width: number;
185
- height: number;
186
- }>;
187
- /**
188
- * Get bounds of all open, visible modals (for smart positioning).
189
- * Excludes minimized modals and the modal being positioned.
190
- * Returns bounds from DOM if position/size not tracked in state.
191
- */
192
- export declare function getOpenModalBounds(excludeId?: ModalId): Array<{
193
- x: number;
194
- y: number;
195
- width: number;
196
- height: number;
197
- }>;
198
- /** Get state version for reactive tracking in components */
199
- export declare function getStateVersion(): number;
200
- /** Consume pending minimize target */
201
- export declare function consumePendingMinimizeTarget(): AnimationTransform | null;
202
- /** Check if modal has pending open */
203
- export declare function hasPendingOpen(id: ModalId): boolean;
204
- /** Consume pending open flag */
205
- export declare function consumePendingOpen(id: ModalId): boolean;
206
- /** Check if modal has pending close */
207
- export declare function hasPendingClose(id: ModalId): boolean;
208
- /** Consume pending close flag */
209
- export declare function consumePendingClose(id: ModalId): boolean;
210
- /** Check if modal has pending force close */
211
- export declare function hasPendingForceClose(id: ModalId): boolean;
212
- /** Consume pending force close flag */
213
- export declare function consumePendingForceClose(id: ModalId): boolean;
214
- /** Check if modal has pending restore */
215
- export declare function hasPendingRestore(id: ModalId): boolean;
216
- /** Consume pending restore flag */
217
- export declare function consumePendingRestore(id: ModalId): boolean;
218
- /** Check if modal has pending child restore */
219
- export declare function hasPendingChildRestore(id: ModalId): boolean;
220
- /** Consume pending child restore flag */
221
- export declare function consumePendingChildRestore(id: ModalId): boolean;
222
- /** Check if modal has pending attention (shake/glow effect) */
223
- export declare function hasPendingAttention(id: ModalId): boolean;
224
- /** Consume pending attention flag */
225
- export declare function consumePendingAttention(id: ModalId): boolean;
226
- /** Trigger attention effect on a modal (shake + glow) */
227
- export declare function triggerAttention(id: ModalId): void;
228
- /** Start attention animation (called when animation begins) */
229
- export declare function startAttentionAnimation(id: ModalId): void;
230
- /** End attention animation (called when animation completes) */
231
- export declare function endAttentionAnimation(id: ModalId): void;
232
- /** Get pending parent link (without consuming) */
233
- export declare function getPendingParentLink(): {
234
- parentId: ModalId;
235
- childId: ModalId;
236
- } | null;
237
- /** Consume pending parent link for a specific child */
238
- export declare function consumePendingParentLink(childId: ModalId): {
239
- parentId: ModalId;
240
- childId: ModalId;
241
- } | null;
242
- /** Store source position for open animation */
243
- export declare function storeOpenSourcePosition(id: ModalId, pos: Position): void;
244
- /** Consume open source position for a specific modal */
245
- export declare function consumeOpenSourcePosition(id: ModalId): Position | null;
246
- /** Set modal animating state */
247
- export declare function setModalAnimating(id: ModalId, animating: boolean): void;
248
- /** Check if modal is animating */
249
- export declare function isModalAnimating(id: ModalId): boolean;
250
- /** Check if modal is open (not minimized and not hidden) */
251
- export declare function isModalOpen(id: ModalId): boolean;
252
- /** Check if modal is registered */
253
- export declare function isModalRegistered(id: ModalId): boolean;
254
- /** Get store reference */
255
- export declare function getModalsStore(): ModalsStore;
256
- /** Toggle modal transparency */
257
- export declare function toggleModalTransparency(id: ModalId): void;
258
- /** Reset modal transparency */
259
- export declare function resetModalTransparency(id: ModalId): void;
260
- /**
261
- * Shake element (visual feedback for invalid actions)
262
- */
263
- export declare function shakeElement(element: HTMLElement): void;
264
- /**
265
- * Animate parent modal to its target position (for animated movement mode)
266
- */
267
- export declare function animateParentToPosition(parentId: ModalId): void;
268
- /**
269
- * Clear the animation flag after animation completes
270
- */
271
- export declare function clearParentAnimationFlag(parentId: ModalId): void;
272
- /**
273
- * Check if parent has a pending animation
274
- */
275
- export declare function hasPendingParentAnimation(parentId: ModalId): boolean;
276
- /**
277
- * Clear pending parent animation
278
- */
279
- export declare function clearPendingParentAnimation(parentId: ModalId): void;
280
- /**
281
- * Move multiple modals to new positions with animation.
282
- * Uses the same animation mechanism as parent-child movement.
283
- * @param moves - Map of modal IDs to their target positions
284
- */
285
- export declare function animateModalsToPositions(moves: Map<ModalId, Position>): void;
286
- /**
287
- * Trigger cascading parent animations up the chain.
288
- * Each parent animates after the previous one finishes, creating a waterfall effect.
289
- * Positions are recalculated dynamically at animation time based on the child's current position.
290
- * @param childId - The ID of the modal that was dragged
291
- */
292
- export declare function triggerCascadingParentAnimations(childId: ModalId): void;
293
- /**
294
- * Set registry functions for static modal lookup
295
- * NOTE: Currently unused but kept for API compatibility
296
- */
297
- export declare function setRegistryFunctions(_registry: ModalRegistry): void;
298
- /**
299
- * Set URL state callbacks for browser integration
300
- */
301
- export declare function setURLStateCallbacks(callbacks: URLStateCallbacks): void;
302
- /**
303
- * Set dock position getter for animations
304
- */
305
- export declare function setDockPositionGetter(getter: DockPositionGetter): void;
306
- /**
307
- * Get internal state (for testing only)
308
- */
309
- export declare function _getInternalState(): {
310
- modals: Map<ModalId, ModalState>;
311
- pendingMinimize: ModalId[];
312
- pendingOpen: ModalId[];
313
- pendingClose: ModalId[];
314
- pendingRestore: ModalId[];
315
- dockOrder: ModalId[];
316
- animatingModals: Set<ModalId>;
317
- transparentModals: Set<ModalId>;
318
- };
319
- /**
320
- * Reset internal state (for testing only)
321
- */
322
- export declare function _resetInternalState(): void;
323
- export {};
324
- //# sourceMappingURL=state.svelte.d.ts.map
@@ -1,7 +0,0 @@
1
- import { ModalId } from './types';
2
- /**
3
- * Convert a modal ID (string or Symbol) to a string suitable for DOM attributes
4
- * Symbols are converted using their description property
5
- */
6
- export declare function toDataId(id: ModalId): string;
7
- //# sourceMappingURL=utils.d.ts.map