@omerdlw/base-framework 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +75 -0
- package/README.md +33 -25
- package/dist/ambient/index.d.ts +1 -0
- package/dist/ambient/index.js +14 -0
- package/dist/ambient/server/index.d.ts +1 -0
- package/dist/ambient/server/index.js +238 -0
- package/dist/ambient/server/index.js.map +1 -0
- package/dist/ambient/worker/index.d.ts +1 -0
- package/dist/ambient/worker/index.js +143 -0
- package/dist/ambient/worker/index.js.map +1 -0
- package/dist/background/index.d.ts +1 -0
- package/dist/background/index.js +13 -0
- package/dist/chunk-2223J34C.js +850 -0
- package/dist/chunk-2223J34C.js.map +1 -0
- package/dist/chunk-2LGI33JP.js +832 -0
- package/dist/chunk-2LGI33JP.js.map +1 -0
- package/dist/chunk-37OBXNEO.js +116 -0
- package/dist/chunk-37OBXNEO.js.map +1 -0
- package/dist/chunk-4OQGXZIH.js +1435 -0
- package/dist/chunk-4OQGXZIH.js.map +1 -0
- package/dist/chunk-5H6FZW3N.js +535 -0
- package/dist/chunk-5H6FZW3N.js.map +1 -0
- package/dist/chunk-7RSRDKYE.js +22 -0
- package/dist/chunk-7RSRDKYE.js.map +1 -0
- package/dist/chunk-AYUEZPAN.js +15762 -0
- package/dist/chunk-AYUEZPAN.js.map +1 -0
- package/dist/chunk-BCFJSPTI.js +261 -0
- package/dist/chunk-BCFJSPTI.js.map +1 -0
- package/dist/chunk-BMFHS3GV.js +118 -0
- package/dist/chunk-BMFHS3GV.js.map +1 -0
- package/dist/chunk-CRKJAACG.js +81 -0
- package/dist/chunk-CRKJAACG.js.map +1 -0
- package/dist/chunk-CT4UILO2.js +537 -0
- package/dist/chunk-CT4UILO2.js.map +1 -0
- package/dist/chunk-ESD5EQ5H.js +178 -0
- package/dist/chunk-ESD5EQ5H.js.map +1 -0
- package/dist/chunk-GCHQ5OC4.js +460 -0
- package/dist/chunk-GCHQ5OC4.js.map +1 -0
- package/dist/chunk-GT4COZI7.js +110 -0
- package/dist/chunk-GT4COZI7.js.map +1 -0
- package/dist/chunk-H6HRU3XN.js +567 -0
- package/dist/chunk-H6HRU3XN.js.map +1 -0
- package/dist/chunk-J3VTDBC6.js +14 -0
- package/dist/chunk-J3VTDBC6.js.map +1 -0
- package/dist/chunk-LTO77WSO.js +140 -0
- package/dist/chunk-LTO77WSO.js.map +1 -0
- package/dist/chunk-MCYHKFZL.js +17 -0
- package/dist/chunk-MCYHKFZL.js.map +1 -0
- package/dist/chunk-NHOJWICA.js +2367 -0
- package/dist/chunk-NHOJWICA.js.map +1 -0
- package/dist/chunk-QMFV53PP.js +1766 -0
- package/dist/chunk-QMFV53PP.js.map +1 -0
- package/dist/chunk-RDYYP36I.js +27 -0
- package/dist/chunk-RDYYP36I.js.map +1 -0
- package/dist/chunk-RF2YGILF.js +656 -0
- package/dist/chunk-RF2YGILF.js.map +1 -0
- package/dist/chunk-RTCJ35UC.js +825 -0
- package/dist/chunk-RTCJ35UC.js.map +1 -0
- package/dist/chunk-TUUGWQY5.js +3488 -0
- package/dist/chunk-TUUGWQY5.js.map +1 -0
- package/dist/chunk-WXEOP6Z4.js +577 -0
- package/dist/chunk-WXEOP6Z4.js.map +1 -0
- package/dist/chunk-WYVA6AN5.js +590 -0
- package/dist/chunk-WYVA6AN5.js.map +1 -0
- package/dist/chunk-Y2Q74PJP.js +537 -0
- package/dist/chunk-Y2Q74PJP.js.map +1 -0
- package/dist/chunk-ZFTQY7OF.js +139 -0
- package/dist/chunk-ZFTQY7OF.js.map +1 -0
- package/dist/chunk-ZSNP26VU.js +493 -0
- package/dist/chunk-ZSNP26VU.js.map +1 -0
- package/dist/context-menu/index.d.ts +1 -0
- package/dist/context-menu/index.js +19 -0
- package/dist/controls/index.d.ts +1 -0
- package/dist/controls/index.js +10 -0
- package/dist/core/error/boundary.d.ts +27 -0
- package/dist/core/error/boundary.d.ts.map +1 -0
- package/dist/core/error/constants.d.ts +33 -0
- package/dist/core/error/constants.d.ts.map +1 -0
- package/dist/core/error/index.d.ts +9 -0
- package/dist/core/error/index.d.ts.map +1 -0
- package/dist/core/error/listener.d.ts +6 -0
- package/dist/core/error/listener.d.ts.map +1 -0
- package/dist/core/error/reporter.d.ts +49 -0
- package/dist/core/error/reporter.d.ts.map +1 -0
- package/dist/core/error/theme.d.ts +10 -0
- package/dist/core/error/theme.d.ts.map +1 -0
- package/dist/core/error/types.d.ts +128 -0
- package/dist/core/error/types.d.ts.map +1 -0
- package/dist/core/error/utils.d.ts +55 -0
- package/dist/core/error/utils.d.ts.map +1 -0
- package/dist/core/kernel/adapters.d.ts +9 -0
- package/dist/core/kernel/adapters.d.ts.map +1 -0
- package/dist/core/kernel/compose.d.ts +21 -0
- package/dist/core/kernel/compose.d.ts.map +1 -0
- package/dist/core/kernel/constants.d.ts +42 -0
- package/dist/core/kernel/constants.d.ts.map +1 -0
- package/dist/core/kernel/handlers.d.ts +7 -0
- package/dist/core/kernel/handlers.d.ts.map +1 -0
- package/dist/core/kernel/hooks.d.ts +13 -0
- package/dist/core/kernel/hooks.d.ts.map +1 -0
- package/dist/core/kernel/index.d.ts +15 -0
- package/dist/core/kernel/index.d.ts.map +1 -0
- package/dist/core/kernel/installed.d.ts +28 -0
- package/dist/core/kernel/installed.d.ts.map +1 -0
- package/dist/core/kernel/module.d.ts +57 -0
- package/dist/core/kernel/module.d.ts.map +1 -0
- package/dist/core/kernel/operations-records.d.ts +25 -0
- package/dist/core/kernel/operations-records.d.ts.map +1 -0
- package/dist/core/kernel/operations-resolve.d.ts +5 -0
- package/dist/core/kernel/operations-resolve.d.ts.map +1 -0
- package/dist/core/kernel/operations.d.ts +23 -0
- package/dist/core/kernel/operations.d.ts.map +1 -0
- package/dist/core/kernel/page-controller.d.ts +20 -0
- package/dist/core/kernel/page-controller.d.ts.map +1 -0
- package/dist/core/kernel/provider.d.ts +29 -0
- package/dist/core/kernel/provider.d.ts.map +1 -0
- package/dist/core/kernel/runtime.d.ts.map +1 -0
- package/dist/core/kernel/schema.d.ts +13 -0
- package/dist/core/kernel/schema.d.ts.map +1 -0
- package/dist/core/kernel/stabilize.d.ts +13 -0
- package/dist/core/kernel/stabilize.d.ts.map +1 -0
- package/dist/core/kernel/store-batch.d.ts +17 -0
- package/dist/core/kernel/store-batch.d.ts.map +1 -0
- package/dist/core/kernel/store-entries.d.ts +6 -0
- package/dist/core/kernel/store-entries.d.ts.map +1 -0
- package/dist/core/kernel/store-handles.d.ts +4 -0
- package/dist/core/kernel/store-handles.d.ts.map +1 -0
- package/dist/core/kernel/store-registration.d.ts +14 -0
- package/dist/core/kernel/store-registration.d.ts.map +1 -0
- package/dist/core/kernel/store-snapshots.d.ts +14 -0
- package/dist/core/kernel/store-snapshots.d.ts.map +1 -0
- package/dist/core/kernel/store-subscriptions.d.ts +16 -0
- package/dist/core/kernel/store-subscriptions.d.ts.map +1 -0
- package/dist/core/kernel/store.d.ts +8 -0
- package/dist/core/kernel/store.d.ts.map +1 -0
- package/dist/core/kernel/types-modules.d.ts +82 -0
- package/dist/core/kernel/types-modules.d.ts.map +1 -0
- package/dist/core/kernel/types-page.d.ts +67 -0
- package/dist/core/kernel/types-page.d.ts.map +1 -0
- package/dist/core/kernel/types-store.d.ts +71 -0
- package/dist/core/kernel/types-store.d.ts.map +1 -0
- package/dist/core/kernel/types.d.ts +169 -0
- package/dist/core/kernel/types.d.ts.map +1 -0
- package/dist/core/kernel/utils.d.ts +21 -0
- package/dist/core/kernel/utils.d.ts.map +1 -0
- package/dist/core/navigation/constants.d.ts +48 -0
- package/dist/core/navigation/constants.d.ts.map +1 -0
- package/dist/core/navigation/navigator-defaults.d.ts +4 -0
- package/dist/core/navigation/navigator-defaults.d.ts.map +1 -0
- package/dist/core/navigation/navigator-holds.d.ts +8 -0
- package/dist/core/navigation/navigator-holds.d.ts.map +1 -0
- package/dist/core/navigation/navigator-patience.d.ts +15 -0
- package/dist/core/navigation/navigator-patience.d.ts.map +1 -0
- package/dist/core/navigation/navigator-payload.d.ts +6 -0
- package/dist/core/navigation/navigator-payload.d.ts.map +1 -0
- package/dist/core/navigation/navigator-prefetch.d.ts +13 -0
- package/dist/core/navigation/navigator-prefetch.d.ts.map +1 -0
- package/dist/core/navigation/navigator.d.ts +7 -0
- package/dist/core/navigation/navigator.d.ts.map +1 -0
- package/dist/core/navigation/settings.d.ts +12 -0
- package/dist/core/navigation/settings.d.ts.map +1 -0
- package/dist/core/navigation/state.d.ts +26 -0
- package/dist/core/navigation/state.d.ts.map +1 -0
- package/dist/core/navigation/types.d.ts +194 -0
- package/dist/core/navigation/types.d.ts.map +1 -0
- package/dist/core/navigation/utils.d.ts +18 -0
- package/dist/core/navigation/utils.d.ts.map +1 -0
- package/dist/core/provider/index.d.ts +31 -0
- package/dist/core/provider/index.d.ts.map +1 -0
- package/dist/dock/index.d.ts +1 -0
- package/dist/dock/index.js +18 -0
- package/dist/error/index.d.ts +1 -9
- package/dist/error/index.js +8 -5
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +83 -0
- package/dist/events/index.js.map +1 -0
- package/dist/foundation/events/index.d.ts +67 -0
- package/dist/foundation/events/index.d.ts.map +1 -0
- package/dist/foundation/recipes/anatomy.d.ts +139 -0
- package/dist/foundation/recipes/anatomy.d.ts.map +1 -0
- package/dist/foundation/recipes/cn.d.ts +17 -0
- package/dist/foundation/recipes/cn.d.ts.map +1 -0
- package/dist/foundation/recipes/define.d.ts +134 -0
- package/dist/foundation/recipes/define.d.ts.map +1 -0
- package/dist/foundation/recipes/index.d.ts +11 -0
- package/dist/foundation/recipes/index.d.ts.map +1 -0
- package/dist/foundation/recipes/recipe.d.ts +97 -0
- package/dist/foundation/recipes/recipe.d.ts.map +1 -0
- package/dist/foundation/recipes/split.d.ts +10 -0
- package/dist/foundation/recipes/split.d.ts.map +1 -0
- package/dist/foundation/result/index.d.ts +98 -0
- package/dist/foundation/result/index.d.ts.map +1 -0
- package/dist/foundation/utils/dom.d.ts +19 -0
- package/dist/foundation/utils/dom.d.ts.map +1 -0
- package/dist/foundation/utils/index.d.ts +17 -0
- package/dist/foundation/utils/index.d.ts.map +1 -0
- package/dist/foundation/utils/number.d.ts +9 -0
- package/dist/foundation/utils/number.d.ts.map +1 -0
- package/dist/foundation/utils/object.d.ts +17 -0
- package/dist/foundation/utils/object.d.ts.map +1 -0
- package/dist/foundation/utils/report.d.ts +18 -0
- package/dist/foundation/utils/report.d.ts.map +1 -0
- package/dist/foundation/utils/scheduler.d.ts +52 -0
- package/dist/foundation/utils/scheduler.d.ts.map +1 -0
- package/dist/foundation/utils/store.d.ts +21 -0
- package/dist/foundation/utils/store.d.ts.map +1 -0
- package/dist/foundation/utils/string.d.ts +18 -0
- package/dist/foundation/utils/string.d.ts.map +1 -0
- package/dist/foundation/utils/tempo.d.ts +61 -0
- package/dist/foundation/utils/tempo.d.ts.map +1 -0
- package/dist/foundation/utils/timing.d.ts +13 -0
- package/dist/foundation/utils/timing.d.ts.map +1 -0
- package/dist/foundation/utils/transform.d.ts +17 -0
- package/dist/foundation/utils/transform.d.ts.map +1 -0
- package/dist/foundation/utils/user-message.d.ts +32 -0
- package/dist/foundation/utils/user-message.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -11
- package/dist/hooks/index.js +3 -1
- package/dist/index.d.ts +8 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -20
- package/dist/kernel/index.d.ts +1 -15
- package/dist/kernel/index.js +5 -2
- package/dist/loading/index.d.ts +1 -0
- package/dist/loading/index.js +12 -0
- package/dist/media/index.d.ts +1 -0
- package/dist/media/index.js +9 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/index.js +310 -0
- package/dist/modal/index.js.map +1 -0
- package/dist/modules/ambient/analyze-bounds.d.ts +12 -0
- package/dist/modules/ambient/analyze-bounds.d.ts.map +1 -0
- package/dist/modules/ambient/analyze-clusters.d.ts +14 -0
- package/dist/modules/ambient/analyze-clusters.d.ts.map +1 -0
- package/dist/modules/ambient/analyze-measures.d.ts +22 -0
- package/dist/modules/ambient/analyze-measures.d.ts.map +1 -0
- package/dist/modules/ambient/analyze-swatches.d.ts +16 -0
- package/dist/modules/ambient/analyze-swatches.d.ts.map +1 -0
- package/dist/modules/ambient/analyze.d.ts +14 -22
- package/dist/modules/ambient/analyze.d.ts.map +1 -1
- package/dist/modules/ambient/constants.d.ts +4 -1
- package/dist/modules/ambient/constants.d.ts.map +1 -1
- package/dist/modules/ambient/context.d.ts +6 -0
- package/dist/modules/ambient/context.d.ts.map +1 -1
- package/dist/modules/ambient/dom.d.ts +25 -2
- package/dist/modules/ambient/dom.d.ts.map +1 -1
- package/dist/modules/ambient/extractor.d.ts +10 -0
- package/dist/modules/ambient/extractor.d.ts.map +1 -1
- package/dist/modules/ambient/hooks.d.ts +12 -0
- package/dist/modules/ambient/hooks.d.ts.map +1 -1
- package/dist/modules/ambient/module.d.ts +12 -1
- package/dist/modules/ambient/module.d.ts.map +1 -1
- package/dist/modules/ambient/oklab.d.ts +24 -0
- package/dist/modules/ambient/oklab.d.ts.map +1 -1
- package/dist/modules/ambient/quantize.d.ts +4 -0
- package/dist/modules/ambient/quantize.d.ts.map +1 -1
- package/dist/modules/ambient/server/address.d.ts +8 -0
- package/dist/modules/ambient/server/address.d.ts.map +1 -1
- package/dist/modules/ambient/server/index.d.ts +24 -0
- package/dist/modules/ambient/server/index.d.ts.map +1 -1
- package/dist/modules/ambient/settings.d.ts +26 -0
- package/dist/modules/ambient/settings.d.ts.map +1 -1
- package/dist/modules/ambient/types.d.ts +100 -1
- package/dist/modules/ambient/types.d.ts.map +1 -1
- package/dist/modules/ambient/worker/index.d.ts +16 -0
- package/dist/modules/ambient/worker/index.d.ts.map +1 -1
- package/dist/modules/background/components/background-gradients.d.ts +8 -0
- package/dist/modules/background/components/background-gradients.d.ts.map +1 -0
- package/dist/modules/background/components/edge-gradient.d.ts +9 -0
- package/dist/modules/background/components/edge-gradient.d.ts.map +1 -0
- package/dist/modules/background/components/native-video.d.ts +4 -0
- package/dist/modules/background/components/native-video.d.ts.map +1 -0
- package/dist/modules/background/components/noise-overlay.d.ts +11 -0
- package/dist/modules/background/components/noise-overlay.d.ts.map +1 -0
- package/dist/modules/background/components/overlay.d.ts +6 -0
- package/dist/modules/background/components/overlay.d.ts.map +1 -0
- package/dist/modules/background/components/solid-overlay.d.ts +10 -0
- package/dist/modules/background/components/solid-overlay.d.ts.map +1 -0
- package/dist/modules/background/constants.d.ts +14 -1
- package/dist/modules/background/constants.d.ts.map +1 -1
- package/dist/modules/background/context.d.ts +7 -0
- package/dist/modules/background/context.d.ts.map +1 -1
- package/dist/modules/background/hooks/use-background-media-source.d.ts +4 -0
- package/dist/modules/background/hooks/use-background-media-source.d.ts.map +1 -0
- package/dist/modules/background/hooks/use-background-motion-model.d.ts +15 -0
- package/dist/modules/background/hooks/use-background-motion-model.d.ts.map +1 -0
- package/dist/modules/background/hooks/use-background-overlay-model.d.ts +929 -0
- package/dist/modules/background/hooks/use-background-overlay-model.d.ts.map +1 -0
- package/dist/modules/background/hooks/use-native-video-model.d.ts +22 -0
- package/dist/modules/background/hooks/use-native-video-model.d.ts.map +1 -0
- package/dist/modules/background/hooks.d.ts +20 -1
- package/dist/modules/background/hooks.d.ts.map +1 -1
- package/dist/modules/background/index.d.ts +6 -6
- package/dist/modules/background/index.d.ts.map +1 -1
- package/dist/modules/background/lib/theme.d.ts +4 -0
- package/dist/modules/background/lib/theme.d.ts.map +1 -0
- package/dist/modules/background/model/override.d.ts +14 -0
- package/dist/modules/background/model/override.d.ts.map +1 -0
- package/dist/modules/background/model/playback.d.ts +25 -0
- package/dist/modules/background/model/playback.d.ts.map +1 -0
- package/dist/modules/background/model/state.d.ts +31 -0
- package/dist/modules/background/model/state.d.ts.map +1 -0
- package/dist/modules/background/model/video-frame.d.ts +31 -0
- package/dist/modules/background/model/video-frame.d.ts.map +1 -0
- package/dist/modules/background/model/visual.d.ts +932 -0
- package/dist/modules/background/model/visual.d.ts.map +1 -0
- package/dist/modules/background/module.d.ts +11 -0
- package/dist/modules/background/module.d.ts.map +1 -1
- package/dist/modules/background/motion.d.ts.map +1 -1
- package/dist/modules/background/types.d.ts +66 -3
- package/dist/modules/background/types.d.ts.map +1 -1
- package/dist/modules/background/youtube/components/player.d.ts +7 -0
- package/dist/modules/background/youtube/components/player.d.ts.map +1 -0
- package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts +27 -0
- package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts.map +1 -0
- package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts +20 -0
- package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts.map +1 -0
- package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts +8 -0
- package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts.map +1 -0
- package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts +16 -0
- package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts.map +1 -0
- package/dist/modules/background/youtube/lib/audio.d.ts +17 -0
- package/dist/modules/background/youtube/lib/audio.d.ts.map +1 -0
- package/dist/modules/background/youtube/lib/iframe-engine.d.ts +29 -0
- package/dist/modules/background/youtube/lib/iframe-engine.d.ts.map +1 -0
- package/dist/modules/background/youtube/lib/iframe-proxy.d.ts +47 -0
- package/dist/modules/background/youtube/lib/iframe-proxy.d.ts.map +1 -0
- package/dist/modules/background/youtube/lib/iframe.d.ts +47 -0
- package/dist/modules/background/youtube/lib/iframe.d.ts.map +1 -0
- package/dist/modules/background/youtube/lib/parse.d.ts +36 -0
- package/dist/modules/background/youtube/lib/parse.d.ts.map +1 -0
- package/dist/modules/background/youtube/lib/timing.d.ts +11 -0
- package/dist/modules/background/youtube/lib/timing.d.ts.map +1 -0
- package/dist/modules/background/youtube/lib/video-events.d.ts +53 -0
- package/dist/modules/background/youtube/lib/video-events.d.ts.map +1 -0
- package/dist/modules/context-menu/constants.d.ts +30 -1
- package/dist/modules/context-menu/constants.d.ts.map +1 -1
- package/dist/modules/context-menu/context.d.ts +10 -2
- package/dist/modules/context-menu/context.d.ts.map +1 -1
- package/dist/modules/context-menu/dom.d.ts +13 -0
- package/dist/modules/context-menu/dom.d.ts.map +1 -1
- package/dist/modules/context-menu/hooks.d.ts +32 -5
- package/dist/modules/context-menu/hooks.d.ts.map +1 -1
- package/dist/modules/context-menu/items.d.ts +25 -0
- package/dist/modules/context-menu/items.d.ts.map +1 -1
- package/dist/modules/context-menu/module.d.ts +6 -0
- package/dist/modules/context-menu/module.d.ts.map +1 -1
- package/dist/modules/context-menu/motion.d.ts.map +1 -1
- package/dist/modules/context-menu/overlay.d.ts +30 -8
- package/dist/modules/context-menu/overlay.d.ts.map +1 -1
- package/dist/modules/context-menu/resolver.d.ts +8 -0
- package/dist/modules/context-menu/resolver.d.ts.map +1 -1
- package/dist/modules/context-menu/state.d.ts +9 -0
- package/dist/modules/context-menu/state.d.ts.map +1 -1
- package/dist/modules/context-menu/types.d.ts +85 -3
- package/dist/modules/context-menu/types.d.ts.map +1 -1
- package/dist/modules/controls/constants.d.ts +18 -1
- package/dist/modules/controls/constants.d.ts.map +1 -1
- package/dist/modules/controls/entries.d.ts +23 -1
- package/dist/modules/controls/entries.d.ts.map +1 -1
- package/dist/modules/controls/hooks.d.ts +11 -1
- package/dist/modules/controls/hooks.d.ts.map +1 -1
- package/dist/modules/controls/layout.d.ts +17 -0
- package/dist/modules/controls/layout.d.ts.map +1 -1
- package/dist/modules/controls/module.d.ts +7 -1
- package/dist/modules/controls/module.d.ts.map +1 -1
- package/dist/modules/controls/overlay.d.ts +11 -1
- package/dist/modules/controls/overlay.d.ts.map +1 -1
- package/dist/modules/controls/types.d.ts +51 -2
- package/dist/modules/controls/types.d.ts.map +1 -1
- package/dist/modules/dock/components/badge.d.ts +5 -0
- package/dist/modules/dock/components/badge.d.ts.map +1 -0
- package/dist/modules/dock/components/breadcrumbs-card.d.ts +6 -0
- package/dist/modules/dock/components/breadcrumbs-card.d.ts.map +1 -0
- package/dist/modules/dock/components/card-banner.d.ts +4 -0
- package/dist/modules/dock/components/card-banner.d.ts.map +1 -0
- package/dist/modules/dock/components/card-header.d.ts +4 -0
- package/dist/modules/dock/components/card-header.d.ts.map +1 -0
- package/dist/modules/dock/components/card-item.d.ts +3 -0
- package/dist/modules/dock/components/card-item.d.ts.map +1 -0
- package/dist/modules/dock/components/command-bar.d.ts +7 -0
- package/dist/modules/dock/components/command-bar.d.ts.map +1 -0
- package/dist/modules/dock/components/description.d.ts +4 -0
- package/dist/modules/dock/components/description.d.ts.map +1 -0
- package/dist/modules/dock/components/dock.d.ts +4 -0
- package/dist/modules/dock/components/dock.d.ts.map +1 -0
- package/dist/modules/dock/components/hud-view.d.ts +7 -0
- package/dist/modules/dock/components/hud-view.d.ts.map +1 -0
- package/dist/modules/dock/components/icon.d.ts +6 -0
- package/dist/modules/dock/components/icon.d.ts.map +1 -0
- package/dist/modules/dock/components/item-content.d.ts +4 -0
- package/dist/modules/dock/components/item-content.d.ts.map +1 -0
- package/dist/modules/dock/components/media-action.d.ts +4 -0
- package/dist/modules/dock/components/media-action.d.ts.map +1 -0
- package/dist/modules/dock/components/media-controls.d.ts +4 -0
- package/dist/modules/dock/components/media-controls.d.ts.map +1 -0
- package/dist/modules/dock/components/media-scrubber.d.ts +5 -0
- package/dist/modules/dock/components/media-scrubber.d.ts.map +1 -0
- package/dist/modules/dock/components/status-actions.d.ts +10 -0
- package/dist/modules/dock/components/status-actions.d.ts.map +1 -0
- package/dist/modules/dock/components/surface/action.d.ts +17 -0
- package/dist/modules/dock/components/surface/action.d.ts.map +1 -0
- package/dist/modules/dock/components/surface/controls.d.ts +12 -0
- package/dist/modules/dock/components/surface/controls.d.ts.map +1 -0
- package/dist/modules/dock/components/surface/extensions-bar.d.ts +5 -0
- package/dist/modules/dock/components/surface/extensions-bar.d.ts.map +1 -0
- package/dist/modules/dock/components/surface/header-button.d.ts +14 -0
- package/dist/modules/dock/components/surface/header-button.d.ts.map +1 -0
- package/dist/modules/dock/components/surface/item-content.d.ts +6 -0
- package/dist/modules/dock/components/surface/item-content.d.ts.map +1 -0
- package/dist/modules/dock/components/surface/shell.d.ts +3 -0
- package/dist/modules/dock/components/surface/shell.d.ts.map +1 -0
- package/dist/modules/dock/components/title.d.ts +4 -0
- package/dist/modules/dock/components/title.d.ts.map +1 -0
- package/dist/modules/dock/constants.d.ts +11 -2
- package/dist/modules/dock/constants.d.ts.map +1 -1
- package/dist/modules/dock/context.d.ts +8 -2
- package/dist/modules/dock/context.d.ts.map +1 -1
- package/dist/modules/dock/hooks/use-action-slot.d.ts +6 -0
- package/dist/modules/dock/hooks/use-action-slot.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-badge.d.ts +4 -0
- package/dist/modules/dock/hooks/use-badge.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-card-banner-model.d.ts +18 -0
- package/dist/modules/dock/hooks/use-card-banner-model.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-card-header-model.d.ts +7 -0
- package/dist/modules/dock/hooks/use-card-header-model.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-card-item-model.d.ts +1612 -0
- package/dist/modules/dock/hooks/use-card-item-model.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-command-bar-model.d.ts +12 -0
- package/dist/modules/dock/hooks/use-command-bar-model.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-banner.d.ts +11 -0
- package/dist/modules/dock/hooks/use-dock-banner.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-config.d.ts +19 -0
- package/dist/modules/dock/hooks/use-dock-config.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-dimensions.d.ts +7 -0
- package/dist/modules/dock/hooks/use-dock-dimensions.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts +7 -0
- package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +6 -0
- package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-keyboard.d.ts +11 -0
- package/dist/modules/dock/hooks/use-dock-keyboard.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-registration.d.ts +8 -0
- package/dist/modules/dock/hooks/use-dock-registration.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-route-reset.d.ts +2 -0
- package/dist/modules/dock/hooks/use-dock-route-reset.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-theme.d.ts +6 -0
- package/dist/modules/dock/hooks/use-dock-theme.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-dock-viewport.d.ts +6 -0
- package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-element-height.d.ts +3 -0
- package/dist/modules/dock/hooks/use-element-height.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-hud-registry.d.ts +16 -0
- package/dist/modules/dock/hooks/use-hud-registry.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-hud-view-model.d.ts +9 -0
- package/dist/modules/dock/hooks/use-hud-view-model.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-media-controls-model.d.ts +27 -0
- package/dist/modules/dock/hooks/use-media-controls-model.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts +27 -0
- package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts +12 -0
- package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts.map +1 -0
- package/dist/modules/dock/hooks/use-surface-return.d.ts +8 -0
- package/dist/modules/dock/hooks/use-surface-return.d.ts.map +1 -0
- package/dist/modules/dock/hud.d.ts +8 -34
- package/dist/modules/dock/hud.d.ts.map +1 -1
- package/dist/modules/dock/index.d.ts +18 -12
- package/dist/modules/dock/index.d.ts.map +1 -1
- package/dist/modules/dock/lib/banner.d.ts +43 -0
- package/dist/modules/dock/lib/banner.d.ts.map +1 -0
- package/dist/modules/dock/lib/card-item.d.ts +46 -0
- package/dist/modules/dock/lib/card-item.d.ts.map +1 -0
- package/dist/modules/dock/lib/card.d.ts +20 -0
- package/dist/modules/dock/lib/card.d.ts.map +1 -0
- package/dist/modules/dock/lib/command-bar.d.ts +8 -0
- package/dist/modules/dock/lib/command-bar.d.ts.map +1 -0
- package/dist/modules/dock/lib/dom.d.ts +7 -0
- package/dist/modules/dock/lib/dom.d.ts.map +1 -0
- package/dist/modules/dock/lib/element-helpers.d.ts +8 -0
- package/dist/modules/dock/lib/element-helpers.d.ts.map +1 -0
- package/dist/modules/dock/lib/helpers.d.ts +19 -0
- package/dist/modules/dock/lib/helpers.d.ts.map +1 -0
- package/dist/modules/dock/lib/media.d.ts +35 -0
- package/dist/modules/dock/lib/media.d.ts.map +1 -0
- package/dist/modules/dock/lib/styles.d.ts +902 -0
- package/dist/modules/dock/lib/styles.d.ts.map +1 -0
- package/dist/modules/dock/model/hud-definition.d.ts +13 -0
- package/dist/modules/dock/model/hud-definition.d.ts.map +1 -0
- package/dist/modules/dock/model/hud.d.ts +10 -0
- package/dist/modules/dock/model/hud.d.ts.map +1 -0
- package/dist/modules/dock/model/layout.d.ts +28 -0
- package/dist/modules/dock/model/layout.d.ts.map +1 -0
- package/dist/modules/dock/model/page-entry.d.ts +11 -0
- package/dist/modules/dock/model/page-entry.d.ts.map +1 -0
- package/dist/modules/dock/model/page-surface.d.ts +4 -0
- package/dist/modules/dock/model/page-surface.d.ts.map +1 -0
- package/dist/modules/dock/model/paths.d.ts +15 -0
- package/dist/modules/dock/model/paths.d.ts.map +1 -0
- package/dist/modules/dock/model/state.d.ts +28 -0
- package/dist/modules/dock/model/state.d.ts.map +1 -0
- package/dist/modules/dock/model/surface-return.d.ts +14 -0
- package/dist/modules/dock/model/surface-return.d.ts.map +1 -0
- package/dist/modules/dock/module.d.ts +5 -7
- package/dist/modules/dock/module.d.ts.map +1 -1
- package/dist/modules/dock/motion.d.ts +716 -5
- package/dist/modules/dock/motion.d.ts.map +1 -1
- package/dist/modules/dock/provider.d.ts +2 -1
- package/dist/modules/dock/provider.d.ts.map +1 -1
- package/dist/modules/dock/routing/breadcrumbs.d.ts +6 -2
- package/dist/modules/dock/routing/breadcrumbs.d.ts.map +1 -1
- package/dist/modules/dock/routing/continuity.d.ts +46 -14
- package/dist/modules/dock/routing/continuity.d.ts.map +1 -1
- package/dist/modules/dock/routing/guards.d.ts +10 -1
- package/dist/modules/dock/routing/guards.d.ts.map +1 -1
- package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts +12 -0
- package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts.map +1 -0
- package/dist/modules/dock/routing/lib/restore.d.ts +7 -0
- package/dist/modules/dock/routing/lib/restore.d.ts.map +1 -0
- package/dist/modules/dock/routing/model/continuity.d.ts +21 -0
- package/dist/modules/dock/routing/model/continuity.d.ts.map +1 -0
- package/dist/modules/dock/routing/model/policy.d.ts +7 -0
- package/dist/modules/dock/routing/model/policy.d.ts.map +1 -0
- package/dist/modules/dock/routing/model/topology.d.ts +5 -0
- package/dist/modules/dock/routing/model/topology.d.ts.map +1 -0
- package/dist/modules/dock/routing/navigation.d.ts +10 -22
- package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
- package/dist/modules/dock/runtime/commands.d.ts +10 -1
- package/dist/modules/dock/runtime/commands.d.ts.map +1 -1
- package/dist/modules/dock/runtime/display.d.ts +9 -42
- package/dist/modules/dock/runtime/display.d.ts.map +1 -1
- package/dist/modules/dock/runtime/dock.d.ts +11 -70
- package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
- package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts +10 -0
- package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts.map +1 -0
- package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts +10 -0
- package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts.map +1 -0
- package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts +14 -0
- package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts.map +1 -0
- package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts +7 -0
- package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts.map +1 -0
- package/dist/modules/dock/runtime/hooks/use-dock.d.ts +30 -0
- package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +1 -0
- package/dist/modules/dock/runtime/model/attention.d.ts +25 -0
- package/dist/modules/dock/runtime/model/attention.d.ts.map +1 -0
- package/dist/modules/dock/runtime/model/cards.d.ts +64 -0
- package/dist/modules/dock/runtime/model/cards.d.ts.map +1 -0
- package/dist/modules/dock/runtime/model/items.d.ts +31 -0
- package/dist/modules/dock/runtime/model/items.d.ts.map +1 -0
- package/dist/modules/dock/runtime/model/layout.d.ts +10 -0
- package/dist/modules/dock/runtime/model/layout.d.ts.map +1 -0
- package/dist/modules/dock/runtime/pipeline.d.ts +1 -1
- package/dist/modules/dock/runtime/pipeline.d.ts.map +1 -1
- package/dist/modules/dock/runtime/provider-actions.d.ts +38 -0
- package/dist/modules/dock/runtime/provider-actions.d.ts.map +1 -0
- package/dist/modules/dock/status/action-options.d.ts +35 -0
- package/dist/modules/dock/status/action-options.d.ts.map +1 -0
- package/dist/modules/dock/status/events.d.ts +2 -2
- package/dist/modules/dock/status/events.d.ts.map +1 -1
- package/dist/modules/dock/status/hooks.d.ts +1 -1
- package/dist/modules/dock/status/hooks.d.ts.map +1 -1
- package/dist/modules/dock/status/model.d.ts +12 -32
- package/dist/modules/dock/status/model.d.ts.map +1 -1
- package/dist/modules/dock/status/state.d.ts +12 -0
- package/dist/modules/dock/status/state.d.ts.map +1 -0
- package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts +5 -0
- package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts.map +1 -0
- package/dist/modules/dock/surface/components/surface-flow-provider.d.ts +7 -0
- package/dist/modules/dock/surface/components/surface-flow-provider.d.ts.map +1 -0
- package/dist/modules/dock/surface/constants.d.ts +5 -0
- package/dist/modules/dock/surface/constants.d.ts.map +1 -0
- package/dist/modules/dock/surface/context.d.ts +14 -1
- package/dist/modules/dock/surface/context.d.ts.map +1 -1
- package/dist/modules/dock/surface/definition.d.ts +28 -2
- package/dist/modules/dock/surface/definition.d.ts.map +1 -1
- package/dist/modules/dock/surface/helpers.d.ts +2 -1
- package/dist/modules/dock/surface/helpers.d.ts.map +1 -1
- package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts +15 -0
- package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts.map +1 -0
- package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts +7 -0
- package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts.map +1 -0
- package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts +14 -0
- package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts.map +1 -0
- package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts +20 -0
- package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts.map +1 -0
- package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts +13 -0
- package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts.map +1 -0
- package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts +28 -0
- package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts.map +1 -0
- package/dist/modules/dock/surface/lib/drag.d.ts +9 -0
- package/dist/modules/dock/surface/lib/drag.d.ts.map +1 -0
- package/dist/modules/dock/surface/lib/target.d.ts +8 -0
- package/dist/modules/dock/surface/lib/target.d.ts.map +1 -0
- package/dist/modules/dock/surface/machine.d.ts +17 -62
- package/dist/modules/dock/surface/machine.d.ts.map +1 -1
- package/dist/modules/dock/surface/model/builder.d.ts +39 -0
- package/dist/modules/dock/surface/model/builder.d.ts.map +1 -0
- package/dist/modules/dock/surface/model/normalize.d.ts +13 -0
- package/dist/modules/dock/surface/model/normalize.d.ts.map +1 -0
- package/dist/modules/dock/surface/model/open.d.ts +26 -0
- package/dist/modules/dock/surface/model/open.d.ts.map +1 -0
- package/dist/modules/dock/surface/model/records.d.ts +45 -0
- package/dist/modules/dock/surface/model/records.d.ts.map +1 -0
- package/dist/modules/dock/surface/model/steps.d.ts +9 -0
- package/dist/modules/dock/surface/model/steps.d.ts.map +1 -0
- package/dist/modules/dock/surface/model/transition-state.d.ts +23 -0
- package/dist/modules/dock/surface/model/transition-state.d.ts.map +1 -0
- package/dist/modules/dock/surface/model/url.d.ts +14 -0
- package/dist/modules/dock/surface/model/url.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/choreography.d.ts +22 -0
- package/dist/modules/dock/surface/runtime/choreography.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/context.d.ts +29 -0
- package/dist/modules/dock/surface/runtime/context.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/flows.d.ts +21 -0
- package/dist/modules/dock/surface/runtime/flows.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/open.d.ts +6 -0
- package/dist/modules/dock/surface/runtime/open.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/release.d.ts +9 -0
- package/dist/modules/dock/surface/runtime/release.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/steps.d.ts +10 -0
- package/dist/modules/dock/surface/runtime/steps.d.ts.map +1 -0
- package/dist/modules/dock/surface/stack.d.ts +20 -11
- package/dist/modules/dock/surface/stack.d.ts.map +1 -1
- package/dist/modules/dock/surface/view-model.d.ts +5 -1
- package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
- package/dist/modules/dock/types/card.d.ts +297 -0
- package/dist/modules/dock/types/card.d.ts.map +1 -0
- package/dist/modules/dock/types/hud.d.ts +142 -0
- package/dist/modules/dock/types/hud.d.ts.map +1 -0
- package/dist/modules/dock/types/index.d.ts +8 -0
- package/dist/modules/dock/types/index.d.ts.map +1 -0
- package/dist/modules/dock/types/media.d.ts +66 -0
- package/dist/modules/dock/types/media.d.ts.map +1 -0
- package/dist/modules/dock/types/routing.d.ts +336 -0
- package/dist/modules/dock/types/routing.d.ts.map +1 -0
- package/dist/modules/dock/types/surface-flow.d.ts +231 -0
- package/dist/modules/dock/types/surface-flow.d.ts.map +1 -0
- package/dist/modules/dock/types/surface.d.ts +194 -0
- package/dist/modules/dock/types/surface.d.ts.map +1 -0
- package/dist/modules/dock/types/theme.d.ts +201 -0
- package/dist/modules/dock/types/theme.d.ts.map +1 -0
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +23 -18
- package/dist/modules/loading/constants.d.ts +18 -1
- package/dist/modules/loading/constants.d.ts.map +1 -1
- package/dist/modules/loading/context.d.ts +11 -1
- package/dist/modules/loading/context.d.ts.map +1 -1
- package/dist/modules/loading/hooks.d.ts +24 -1
- package/dist/modules/loading/hooks.d.ts.map +1 -1
- package/dist/modules/loading/module.d.ts +6 -0
- package/dist/modules/loading/module.d.ts.map +1 -1
- package/dist/modules/loading/overlay.d.ts +3 -0
- package/dist/modules/loading/overlay.d.ts.map +1 -1
- package/dist/modules/loading/state.d.ts +13 -0
- package/dist/modules/loading/state.d.ts.map +1 -1
- package/dist/modules/loading/types.d.ts +42 -2
- package/dist/modules/loading/types.d.ts.map +1 -1
- package/dist/modules/media/constants.d.ts +19 -0
- package/dist/modules/media/constants.d.ts.map +1 -1
- package/dist/modules/media/context.d.ts +11 -1
- package/dist/modules/media/context.d.ts.map +1 -1
- package/dist/modules/media/hooks.d.ts +17 -0
- package/dist/modules/media/hooks.d.ts.map +1 -1
- package/dist/modules/media/module.d.ts +4 -0
- package/dist/modules/media/module.d.ts.map +1 -1
- package/dist/modules/media/overlay.d.ts +7 -0
- package/dist/modules/media/overlay.d.ts.map +1 -1
- package/dist/modules/media/playback.d.ts +13 -0
- package/dist/modules/media/playback.d.ts.map +1 -1
- package/dist/modules/media/session.d.ts +20 -0
- package/dist/modules/media/session.d.ts.map +1 -1
- package/dist/modules/media/types.d.ts +49 -2
- package/dist/modules/media/types.d.ts.map +1 -1
- package/dist/modules/modal/components/close-button.d.ts +6 -0
- package/dist/modules/modal/components/close-button.d.ts.map +1 -0
- package/dist/modules/modal/components/modal-container.d.ts +7 -0
- package/dist/modules/modal/components/modal-container.d.ts.map +1 -0
- package/dist/modules/modal/components/modal-layer-switcher.d.ts +9 -0
- package/dist/modules/modal/components/modal-layer-switcher.d.ts.map +1 -0
- package/dist/modules/modal/components/modal-layer.d.ts +17 -0
- package/dist/modules/modal/components/modal-layer.d.ts.map +1 -0
- package/dist/modules/modal/components/overlay.d.ts +6 -0
- package/dist/modules/modal/components/overlay.d.ts.map +1 -0
- package/dist/modules/modal/components/resolve-header.d.ts +10 -0
- package/dist/modules/modal/components/resolve-header.d.ts.map +1 -0
- package/dist/modules/modal/components/slot-row.d.ts +12 -0
- package/dist/modules/modal/components/slot-row.d.ts.map +1 -0
- package/dist/modules/modal/constants.d.ts +16 -1
- package/dist/modules/modal/constants.d.ts.map +1 -1
- package/dist/modules/modal/context.d.ts +7 -1
- package/dist/modules/modal/context.d.ts.map +1 -1
- package/dist/modules/modal/hooks/use-mobile-viewport.d.ts +3 -0
- package/dist/modules/modal/hooks/use-mobile-viewport.d.ts.map +1 -0
- package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts +12 -0
- package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts.map +1 -0
- package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts +3 -0
- package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts.map +1 -0
- package/dist/modules/modal/hooks.d.ts +30 -4
- package/dist/modules/modal/hooks.d.ts.map +1 -1
- package/dist/modules/modal/index.d.ts +7 -6
- package/dist/modules/modal/index.d.ts.map +1 -1
- package/dist/modules/modal/lib/dom.d.ts +13 -0
- package/dist/modules/modal/lib/dom.d.ts.map +1 -0
- package/dist/modules/modal/lib/theme.d.ts +4 -0
- package/dist/modules/modal/lib/theme.d.ts.map +1 -0
- package/dist/modules/modal/model/entry.d.ts +18 -0
- package/dist/modules/modal/model/entry.d.ts.map +1 -0
- package/dist/modules/modal/model/header.d.ts +16 -0
- package/dist/modules/modal/model/header.d.ts.map +1 -0
- package/dist/modules/modal/model/identity.d.ts +13 -0
- package/dist/modules/modal/model/identity.d.ts.map +1 -0
- package/dist/modules/modal/model/layout.d.ts +37 -0
- package/dist/modules/modal/model/layout.d.ts.map +1 -0
- package/dist/modules/modal/model/state.d.ts +10 -0
- package/dist/modules/modal/model/state.d.ts.map +1 -0
- package/dist/modules/modal/module.d.ts +7 -0
- package/dist/modules/modal/module.d.ts.map +1 -1
- package/dist/modules/modal/motion.d.ts.map +1 -1
- package/dist/modules/modal/types.d.ts +73 -1
- package/dist/modules/modal/types.d.ts.map +1 -1
- package/dist/modules/navigation/context.d.ts +16 -4
- package/dist/modules/navigation/context.d.ts.map +1 -1
- package/dist/modules/navigation/hooks.d.ts +28 -1
- package/dist/modules/navigation/hooks.d.ts.map +1 -1
- package/dist/modules/navigation/index.d.ts +5 -5
- package/dist/modules/navigation/index.d.ts.map +1 -1
- package/dist/modules/navigation/listeners.d.ts +10 -1
- package/dist/modules/navigation/listeners.d.ts.map +1 -1
- package/dist/modules/navigation/module.d.ts +5 -2
- package/dist/modules/navigation/module.d.ts.map +1 -1
- package/dist/modules/notification/constants.d.ts +22 -2
- package/dist/modules/notification/constants.d.ts.map +1 -1
- package/dist/modules/notification/context.d.ts +12 -2
- package/dist/modules/notification/context.d.ts.map +1 -1
- package/dist/modules/notification/hooks.d.ts +32 -1
- package/dist/modules/notification/hooks.d.ts.map +1 -1
- package/dist/modules/notification/module.d.ts +3 -0
- package/dist/modules/notification/module.d.ts.map +1 -1
- package/dist/modules/notification/motion.d.ts.map +1 -1
- package/dist/modules/notification/overlay.d.ts.map +1 -1
- package/dist/modules/notification/state.d.ts +28 -0
- package/dist/modules/notification/state.d.ts.map +1 -1
- package/dist/modules/notification/types.d.ts +48 -2
- package/dist/modules/notification/types.d.ts.map +1 -1
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.js +189 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/notification/index.d.ts +1 -0
- package/dist/notification/index.js +11 -0
- package/dist/overlay-QHSJBV3O.js +13 -0
- package/dist/overlay-QHSJBV3O.js.map +1 -0
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.js +14 -0
- package/dist/react/context/index.d.ts +4 -0
- package/dist/react/context/index.d.ts.map +1 -0
- package/dist/react/hooks/index.d.ts +10 -0
- package/dist/react/hooks/index.d.ts.map +1 -0
- package/dist/react/hooks/types.d.ts +25 -0
- package/dist/react/hooks/types.d.ts.map +1 -0
- package/dist/react/hooks/use-click-outside.d.ts +6 -0
- package/dist/react/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/react/hooks/use-controllable-state.d.ts +7 -0
- package/dist/react/hooks/use-controllable-state.d.ts.map +1 -0
- package/dist/react/hooks/use-fullscreen-state.d.ts +7 -0
- package/dist/react/hooks/use-fullscreen-state.d.ts.map +1 -0
- package/dist/react/hooks/use-global-event.d.ts +9 -0
- package/dist/react/hooks/use-global-event.d.ts.map +1 -0
- package/dist/react/hooks/use-hotkey.d.ts +10 -0
- package/dist/react/hooks/use-hotkey.d.ts.map +1 -0
- package/dist/react/hooks/use-required-context.d.ts +6 -0
- package/dist/react/hooks/use-required-context.d.ts.map +1 -0
- package/dist/react/hooks/use-scroll-lock.d.ts +9 -0
- package/dist/react/hooks/use-scroll-lock.d.ts.map +1 -0
- package/dist/react/hooks/use-store.d.ts +3 -0
- package/dist/react/hooks/use-store.d.ts.map +1 -0
- package/dist/react/theme/index.d.ts +82 -0
- package/dist/react/theme/index.d.ts.map +1 -0
- package/dist/react/ui/components/avatar.d.ts +6 -0
- package/dist/react/ui/components/avatar.d.ts.map +1 -0
- package/dist/react/ui/components/button.d.ts +6 -0
- package/dist/react/ui/components/button.d.ts.map +1 -0
- package/dist/react/ui/components/carousel.d.ts +6 -0
- package/dist/react/ui/components/carousel.d.ts.map +1 -0
- package/dist/react/ui/components/checkbox.d.ts +10 -0
- package/dist/react/ui/components/checkbox.d.ts.map +1 -0
- package/dist/react/ui/components/icon.d.ts +6 -0
- package/dist/react/ui/components/icon.d.ts.map +1 -0
- package/dist/react/ui/components/image.d.ts +6 -0
- package/dist/react/ui/components/image.d.ts.map +1 -0
- package/dist/react/ui/components/indicator.d.ts +45 -0
- package/dist/react/ui/components/indicator.d.ts.map +1 -0
- package/dist/react/ui/components/input.d.ts +10 -0
- package/dist/react/ui/components/input.d.ts.map +1 -0
- package/dist/react/ui/components/loader.d.ts +10 -0
- package/dist/react/ui/components/loader.d.ts.map +1 -0
- package/dist/react/ui/components/segmented.d.ts +6 -0
- package/dist/react/ui/components/segmented.d.ts.map +1 -0
- package/dist/react/ui/components/select-parts.d.ts +22 -0
- package/dist/react/ui/components/select-parts.d.ts.map +1 -0
- package/dist/react/ui/components/select.d.ts +6 -0
- package/dist/react/ui/components/select.d.ts.map +1 -0
- package/dist/react/ui/components/skeleton.d.ts +10 -0
- package/dist/react/ui/components/skeleton.d.ts.map +1 -0
- package/dist/react/ui/components/switch.d.ts +6 -0
- package/dist/react/ui/components/switch.d.ts.map +1 -0
- package/dist/react/ui/components/tooltip.d.ts +11 -0
- package/dist/react/ui/components/tooltip.d.ts.map +1 -0
- package/dist/react/ui/index.d.ts +19 -0
- package/dist/react/ui/index.d.ts.map +1 -0
- package/dist/react/ui/provider.d.ts +22 -0
- package/dist/react/ui/provider.d.ts.map +1 -0
- package/dist/react/ui/types-controls.d.ts +133 -0
- package/dist/react/ui/types-controls.d.ts.map +1 -0
- package/dist/react/ui/types.d.ts +192 -0
- package/dist/react/ui/types.d.ts.map +1 -0
- package/dist/react/ui/utils.d.ts +65 -0
- package/dist/react/ui/utils.d.ts.map +1 -0
- package/dist/recipes/index.d.ts +1 -0
- package/dist/recipes/index.js +233 -0
- package/dist/recipes/index.js.map +1 -0
- package/dist/result/index.d.ts +1 -0
- package/dist/result/index.js +98 -0
- package/dist/result/index.js.map +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +6 -0
- package/dist/ui/index.d.ts +1 -19
- package/dist/ui/index.js +2158 -1860
- package/dist/ui/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -15
- package/dist/utils/index.js +194 -71
- package/dist/utils/index.js.map +1 -1
- package/docs/README.md +58 -61
- package/docs/architecture-and-rules.md +133 -58
- package/docs/core-engine.md +36 -52
- package/docs/custom-modules.md +43 -32
- package/docs/design.md +185 -0
- package/docs/getting-started.md +49 -57
- package/docs/modules/README.md +50 -61
- package/docs/modules/ambient.md +95 -87
- package/docs/modules/background.md +39 -36
- package/docs/modules/context-menu.md +19 -18
- package/docs/modules/controls.md +13 -13
- package/docs/modules/dock.md +74 -93
- package/docs/modules/error-boundary.md +2 -2
- package/docs/modules/kernel.md +38 -26
- package/docs/modules/loading.md +14 -14
- package/docs/modules/media.md +13 -13
- package/docs/modules/modal.md +14 -14
- package/docs/modules/navigation.md +87 -84
- package/docs/modules/notification.md +13 -13
- package/docs/modules/result.md +22 -22
- package/docs/proposals/navigation.md +32 -31
- package/docs/testing.md +34 -28
- package/docs/theming.md +67 -44
- package/package.json +100 -97
- package/templates/AGENTS.md +35 -25
- package/dist/atoms/button.d.ts +0 -11
- package/dist/atoms/button.d.ts.map +0 -1
- package/dist/atoms/icon.d.ts +0 -15
- package/dist/atoms/icon.d.ts.map +0 -1
- package/dist/atoms/index.d.ts +0 -5
- package/dist/atoms/index.d.ts.map +0 -1
- package/dist/atoms/index.js +0 -4
- package/dist/atoms/spinner.d.ts +0 -9
- package/dist/atoms/spinner.d.ts.map +0 -1
- package/dist/atoms/tooltip.d.ts +0 -18
- package/dist/atoms/tooltip.d.ts.map +0 -1
- package/dist/chunk-6UFMD6TK.js +0 -419
- package/dist/chunk-6UFMD6TK.js.map +0 -1
- package/dist/chunk-AA2TWJQI.js +0 -2186
- package/dist/chunk-AA2TWJQI.js.map +0 -1
- package/dist/chunk-ACLLDU3J.js +0 -888
- package/dist/chunk-ACLLDU3J.js.map +0 -1
- package/dist/chunk-DGCQWQLZ.js +0 -61
- package/dist/chunk-DGCQWQLZ.js.map +0 -1
- package/dist/chunk-E6ANX5YP.js +0 -1273
- package/dist/chunk-E6ANX5YP.js.map +0 -1
- package/dist/chunk-GDCVEINL.js +0 -408
- package/dist/chunk-GDCVEINL.js.map +0 -1
- package/dist/chunk-GN666KV5.js +0 -28
- package/dist/chunk-GN666KV5.js.map +0 -1
- package/dist/chunk-HCSDQEFB.js +0 -845
- package/dist/chunk-HCSDQEFB.js.map +0 -1
- package/dist/chunk-HMEWYAWU.js +0 -1889
- package/dist/chunk-HMEWYAWU.js.map +0 -1
- package/dist/chunk-I3IZUBBU.js +0 -97
- package/dist/chunk-I3IZUBBU.js.map +0 -1
- package/dist/chunk-JCZUCKI3.js +0 -27
- package/dist/chunk-JCZUCKI3.js.map +0 -1
- package/dist/chunk-MAGYFVKH.js +0 -67
- package/dist/chunk-MAGYFVKH.js.map +0 -1
- package/dist/chunk-NEBGCFE3.js +0 -521
- package/dist/chunk-NEBGCFE3.js.map +0 -1
- package/dist/chunk-NK2DQB3G.js +0 -306
- package/dist/chunk-NK2DQB3G.js.map +0 -1
- package/dist/chunk-QI3ALLIB.js +0 -38
- package/dist/chunk-QI3ALLIB.js.map +0 -1
- package/dist/chunk-QM2P6TIU.js +0 -353
- package/dist/chunk-QM2P6TIU.js.map +0 -1
- package/dist/chunk-RFP2DJAB.js +0 -658
- package/dist/chunk-RFP2DJAB.js.map +0 -1
- package/dist/chunk-SQ7XZMCN.js +0 -481
- package/dist/chunk-SQ7XZMCN.js.map +0 -1
- package/dist/chunk-TMTMQNEQ.js +0 -372
- package/dist/chunk-TMTMQNEQ.js.map +0 -1
- package/dist/chunk-VDNE3A7X.js +0 -9724
- package/dist/chunk-VDNE3A7X.js.map +0 -1
- package/dist/chunk-XATRMFGU.js +0 -139
- package/dist/chunk-XATRMFGU.js.map +0 -1
- package/dist/chunk-ZAP2YHZG.js +0 -454
- package/dist/chunk-ZAP2YHZG.js.map +0 -1
- package/dist/chunk-ZH5FUYPG.js +0 -349
- package/dist/chunk-ZH5FUYPG.js.map +0 -1
- package/dist/chunk-ZKM4RETZ.js +0 -51
- package/dist/chunk-ZKM4RETZ.js.map +0 -1
- package/dist/error/boundary.d.ts +0 -14
- package/dist/error/boundary.d.ts.map +0 -1
- package/dist/error/constants.d.ts +0 -18
- package/dist/error/constants.d.ts.map +0 -1
- package/dist/error/index.d.ts.map +0 -1
- package/dist/error/listener.d.ts +0 -2
- package/dist/error/listener.d.ts.map +0 -1
- package/dist/error/reporter.d.ts +0 -32
- package/dist/error/reporter.d.ts.map +0 -1
- package/dist/error/theme.d.ts +0 -3
- package/dist/error/theme.d.ts.map +0 -1
- package/dist/error/types.d.ts +0 -91
- package/dist/error/types.d.ts.map +0 -1
- package/dist/error/utils.d.ts +0 -21
- package/dist/error/utils.d.ts.map +0 -1
- package/dist/events.d.ts +0 -51
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -82
- package/dist/events.js.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/types.d.ts +0 -16
- package/dist/hooks/types.d.ts.map +0 -1
- package/dist/hooks/use-click-outside.d.ts +0 -3
- package/dist/hooks/use-click-outside.d.ts.map +0 -1
- package/dist/hooks/use-controllable-state.d.ts +0 -3
- package/dist/hooks/use-controllable-state.d.ts.map +0 -1
- package/dist/hooks/use-fullscreen-state.d.ts +0 -4
- package/dist/hooks/use-fullscreen-state.d.ts.map +0 -1
- package/dist/hooks/use-global-event.d.ts +0 -5
- package/dist/hooks/use-global-event.d.ts.map +0 -1
- package/dist/hooks/use-hotkey.d.ts +0 -4
- package/dist/hooks/use-hotkey.d.ts.map +0 -1
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +0 -3
- package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +0 -1
- package/dist/hooks/use-required-context.d.ts +0 -3
- package/dist/hooks/use-required-context.d.ts.map +0 -1
- package/dist/hooks/use-scroll-lock.d.ts +0 -3
- package/dist/hooks/use-scroll-lock.d.ts.map +0 -1
- package/dist/hooks/use-store.d.ts +0 -3
- package/dist/hooks/use-store.d.ts.map +0 -1
- package/dist/kernel/adapters.d.ts +0 -5
- package/dist/kernel/adapters.d.ts.map +0 -1
- package/dist/kernel/compose.d.ts +0 -15
- package/dist/kernel/compose.d.ts.map +0 -1
- package/dist/kernel/constants.d.ts +0 -12
- package/dist/kernel/constants.d.ts.map +0 -1
- package/dist/kernel/context-registry.d.ts +0 -3
- package/dist/kernel/context-registry.d.ts.map +0 -1
- package/dist/kernel/handlers.d.ts +0 -3
- package/dist/kernel/handlers.d.ts.map +0 -1
- package/dist/kernel/hooks.d.ts +0 -7
- package/dist/kernel/hooks.d.ts.map +0 -1
- package/dist/kernel/index.d.ts.map +0 -1
- package/dist/kernel/installed.d.ts +0 -21
- package/dist/kernel/installed.d.ts.map +0 -1
- package/dist/kernel/module.d.ts +0 -32
- package/dist/kernel/module.d.ts.map +0 -1
- package/dist/kernel/operations.d.ts +0 -21
- package/dist/kernel/operations.d.ts.map +0 -1
- package/dist/kernel/page-controller.d.ts +0 -8
- package/dist/kernel/page-controller.d.ts.map +0 -1
- package/dist/kernel/provider.d.ts +0 -18
- package/dist/kernel/provider.d.ts.map +0 -1
- package/dist/kernel/runtime.d.ts.map +0 -1
- package/dist/kernel/schema.d.ts +0 -11
- package/dist/kernel/schema.d.ts.map +0 -1
- package/dist/kernel/store.d.ts +0 -4
- package/dist/kernel/store.d.ts.map +0 -1
- package/dist/kernel/types.d.ts +0 -233
- package/dist/kernel/types.d.ts.map +0 -1
- package/dist/kernel/utils.d.ts +0 -18
- package/dist/kernel/utils.d.ts.map +0 -1
- package/dist/modules/ambient/index.js +0 -10
- package/dist/modules/ambient/server/index.js +0 -225
- package/dist/modules/ambient/server/index.js.map +0 -1
- package/dist/modules/ambient/worker/index.js +0 -122
- package/dist/modules/ambient/worker/index.js.map +0 -1
- package/dist/modules/background/index.js +0 -9
- package/dist/modules/background/overlay.d.ts +0 -135
- package/dist/modules/background/overlay.d.ts.map +0 -1
- package/dist/modules/background/playback.d.ts +0 -10
- package/dist/modules/background/playback.d.ts.map +0 -1
- package/dist/modules/background/state.d.ts +0 -9
- package/dist/modules/background/state.d.ts.map +0 -1
- package/dist/modules/background/visual.d.ts +0 -48
- package/dist/modules/background/visual.d.ts.map +0 -1
- package/dist/modules/background/youtube/iframe.d.ts +0 -52
- package/dist/modules/background/youtube/iframe.d.ts.map +0 -1
- package/dist/modules/background/youtube/parse.d.ts +0 -17
- package/dist/modules/background/youtube/parse.d.ts.map +0 -1
- package/dist/modules/background/youtube/player.d.ts +0 -28
- package/dist/modules/background/youtube/player.d.ts.map +0 -1
- package/dist/modules/context-menu/index.js +0 -14
- package/dist/modules/controls/index.js +0 -7
- package/dist/modules/dock/cards.d.ts +0 -1722
- package/dist/modules/dock/cards.d.ts.map +0 -1
- package/dist/modules/dock/dom.d.ts +0 -24
- package/dist/modules/dock/dom.d.ts.map +0 -1
- package/dist/modules/dock/helpers.d.ts +0 -25
- package/dist/modules/dock/helpers.d.ts.map +0 -1
- package/dist/modules/dock/hooks.d.ts +0 -42
- package/dist/modules/dock/hooks.d.ts.map +0 -1
- package/dist/modules/dock/index.js +0 -13
- package/dist/modules/dock/layout.d.ts +0 -26
- package/dist/modules/dock/layout.d.ts.map +0 -1
- package/dist/modules/dock/overlay.d.ts +0 -79
- package/dist/modules/dock/overlay.d.ts.map +0 -1
- package/dist/modules/dock/paths.d.ts +0 -10
- package/dist/modules/dock/paths.d.ts.map +0 -1
- package/dist/modules/dock/state.d.ts +0 -22
- package/dist/modules/dock/state.d.ts.map +0 -1
- package/dist/modules/dock/styles.d.ts +0 -900
- package/dist/modules/dock/styles.d.ts.map +0 -1
- package/dist/modules/dock/surface/hooks.d.ts +0 -110
- package/dist/modules/dock/surface/hooks.d.ts.map +0 -1
- package/dist/modules/dock/types.d.ts +0 -1274
- package/dist/modules/dock/types.d.ts.map +0 -1
- package/dist/modules/loading/index.js +0 -8
- package/dist/modules/media/index.js +0 -6
- package/dist/modules/modal/dom.d.ts +0 -4
- package/dist/modules/modal/dom.d.ts.map +0 -1
- package/dist/modules/modal/header.d.ts +0 -7
- package/dist/modules/modal/header.d.ts.map +0 -1
- package/dist/modules/modal/identity.d.ts +0 -7
- package/dist/modules/modal/identity.d.ts.map +0 -1
- package/dist/modules/modal/index.js +0 -11
- package/dist/modules/modal/layout.d.ts +0 -13
- package/dist/modules/modal/layout.d.ts.map +0 -1
- package/dist/modules/modal/overlay.d.ts +0 -4
- package/dist/modules/modal/overlay.d.ts.map +0 -1
- package/dist/modules/modal/state.d.ts +0 -4
- package/dist/modules/modal/state.d.ts.map +0 -1
- package/dist/modules/navigation/constants.d.ts +0 -33
- package/dist/modules/navigation/constants.d.ts.map +0 -1
- package/dist/modules/navigation/index.js +0 -80
- package/dist/modules/navigation/index.js.map +0 -1
- package/dist/modules/navigation/navigator.d.ts +0 -3
- package/dist/modules/navigation/navigator.d.ts.map +0 -1
- package/dist/modules/navigation/settings.d.ts +0 -5
- package/dist/modules/navigation/settings.d.ts.map +0 -1
- package/dist/modules/navigation/state.d.ts +0 -19
- package/dist/modules/navigation/state.d.ts.map +0 -1
- package/dist/modules/navigation/types.d.ts +0 -118
- package/dist/modules/navigation/types.d.ts.map +0 -1
- package/dist/modules/navigation/utils.d.ts +0 -8
- package/dist/modules/navigation/utils.d.ts.map +0 -1
- package/dist/modules/notification/index.js +0 -7
- package/dist/overlay-LTRZUZQD.js +0 -9
- package/dist/overlay-LTRZUZQD.js.map +0 -1
- package/dist/provider.d.ts +0 -23
- package/dist/provider.d.ts.map +0 -1
- package/dist/provider.js +0 -9
- package/dist/provider.js.map +0 -1
- package/dist/result.d.ts +0 -50
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -102
- package/dist/result.js.map +0 -1
- package/dist/theme.d.ts +0 -46
- package/dist/theme.d.ts.map +0 -1
- package/dist/theme.js +0 -6
- package/dist/theme.js.map +0 -1
- package/dist/tokens/index.d.ts +0 -4
- package/dist/tokens/index.d.ts.map +0 -1
- package/dist/tokens/index.js +0 -297
- package/dist/tokens/index.js.map +0 -1
- package/dist/tokens/motion-config.d.ts +0 -35
- package/dist/tokens/motion-config.d.ts.map +0 -1
- package/dist/tokens/motion.d.ts +0 -164
- package/dist/tokens/motion.d.ts.map +0 -1
- package/dist/tokens/tokens.d.ts +0 -34
- package/dist/tokens/tokens.d.ts.map +0 -1
- package/dist/ui/carousel/carousel.d.ts +0 -24
- package/dist/ui/carousel/carousel.d.ts.map +0 -1
- package/dist/ui/carousel/track.d.ts +0 -11
- package/dist/ui/carousel/track.d.ts.map +0 -1
- package/dist/ui/carousel/use-drag-scroll.d.ts +0 -3
- package/dist/ui/carousel/use-drag-scroll.d.ts.map +0 -1
- package/dist/ui/cn.d.ts +0 -19
- package/dist/ui/cn.d.ts.map +0 -1
- package/dist/ui/components/avatar.d.ts +0 -14
- package/dist/ui/components/avatar.d.ts.map +0 -1
- package/dist/ui/components/button.d.ts +0 -9
- package/dist/ui/components/button.d.ts.map +0 -1
- package/dist/ui/components/checkbox.d.ts +0 -18
- package/dist/ui/components/checkbox.d.ts.map +0 -1
- package/dist/ui/components/icon.d.ts +0 -4
- package/dist/ui/components/icon.d.ts.map +0 -1
- package/dist/ui/components/image.d.ts +0 -13
- package/dist/ui/components/image.d.ts.map +0 -1
- package/dist/ui/components/indicator.d.ts +0 -37
- package/dist/ui/components/indicator.d.ts.map +0 -1
- package/dist/ui/components/input.d.ts +0 -15
- package/dist/ui/components/input.d.ts.map +0 -1
- package/dist/ui/components/loader.d.ts +0 -17
- package/dist/ui/components/loader.d.ts.map +0 -1
- package/dist/ui/components/segmented.d.ts +0 -21
- package/dist/ui/components/segmented.d.ts.map +0 -1
- package/dist/ui/components/select.d.ts +0 -34
- package/dist/ui/components/select.d.ts.map +0 -1
- package/dist/ui/components/skeleton.d.ts +0 -16
- package/dist/ui/components/skeleton.d.ts.map +0 -1
- package/dist/ui/components/switch.d.ts +0 -11
- package/dist/ui/components/switch.d.ts.map +0 -1
- package/dist/ui/components/tooltip.d.ts +0 -25
- package/dist/ui/components/tooltip.d.ts.map +0 -1
- package/dist/ui/defaults.d.ts +0 -250
- package/dist/ui/defaults.d.ts.map +0 -1
- package/dist/ui/define.d.ts +0 -112
- package/dist/ui/define.d.ts.map +0 -1
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/provider.d.ts +0 -11
- package/dist/ui/provider.d.ts.map +0 -1
- package/dist/ui/recipe.d.ts +0 -70
- package/dist/ui/recipe.d.ts.map +0 -1
- package/dist/ui/recipes.d.ts +0 -9
- package/dist/ui/recipes.d.ts.map +0 -1
- package/dist/ui/recipes.js +0 -648
- package/dist/ui/recipes.js.map +0 -1
- package/dist/ui/split.d.ts +0 -4
- package/dist/ui/split.d.ts.map +0 -1
- package/dist/ui/tones.d.ts +0 -23
- package/dist/ui/tones.d.ts.map +0 -1
- package/dist/utils/cn.d.ts +0 -3
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/dom.d.ts +0 -5
- package/dist/utils/dom.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/number.d.ts +0 -3
- package/dist/utils/number.d.ts.map +0 -1
- package/dist/utils/object.d.ts +0 -5
- package/dist/utils/object.d.ts.map +0 -1
- package/dist/utils/report.d.ts +0 -5
- package/dist/utils/report.d.ts.map +0 -1
- package/dist/utils/scheduler.d.ts +0 -34
- package/dist/utils/scheduler.d.ts.map +0 -1
- package/dist/utils/store.d.ts +0 -11
- package/dist/utils/store.d.ts.map +0 -1
- package/dist/utils/string.d.ts +0 -5
- package/dist/utils/string.d.ts.map +0 -1
- package/dist/utils/timing.d.ts +0 -7
- package/dist/utils/timing.d.ts.map +0 -1
- package/dist/utils/user-message.d.ts +0 -20
- package/dist/utils/user-message.d.ts.map +0 -1
- package/docs/ui.md +0 -183
- package/styles/effects.css +0 -219
- package/styles/index.css +0 -8
- package/styles/interaction.css +0 -273
- package/styles/palette.css +0 -81
- package/styles/time.css +0 -26
- package/styles/tokens.css +0 -114
- package/styles/utilities.css +0 -110
- package/templates/motion/background.ts +0 -15
- package/templates/motion/context-menu.ts +0 -65
- package/templates/motion/dock.ts +0 -421
- package/templates/motion/modal.ts +0 -82
- package/templates/motion/notification.ts +0 -26
- package/templates/motion/tokens.ts +0 -36
- /package/dist/{atoms → ambient}/index.js.map +0 -0
- /package/dist/{modules/ambient → background}/index.js.map +0 -0
- /package/dist/{modules/background → context-menu}/index.js.map +0 -0
- /package/dist/{modules/context-menu → controls}/index.js.map +0 -0
- /package/dist/{kernel → core/kernel}/runtime.d.ts +0 -0
- /package/dist/{modules/controls → dock}/index.js.map +0 -0
- /package/dist/{modules/dock → loading}/index.js.map +0 -0
- /package/dist/{modules/loading → media}/index.js.map +0 -0
- /package/dist/{modules/media → notification}/index.js.map +0 -0
- /package/dist/{modules/modal → provider}/index.js.map +0 -0
- /package/dist/{modules/notification → theme}/index.js.map +0 -0
package/dist/chunk-6UFMD6TK.js
DELETED
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
import { Z_INDEX } from './chunk-QI3ALLIB.js';
|
|
2
|
-
import { defineThemeSpec, useTheme } from './chunk-TMTMQNEQ.js';
|
|
3
|
-
import { getOrCreateGlobalContext, useModuleRegistration, useRegistryEntries } from './chunk-HMEWYAWU.js';
|
|
4
|
-
import { isPlainObject, createStore, report, useRequiredContext, useStore, acquireGlobalScrollLock } from './chunk-HCSDQEFB.js';
|
|
5
|
-
import { useState, useRef, useCallback, useMemo, useEffect, useSyncExternalStore, useLayoutEffect } from 'react';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
// src/modules/modal/constants.ts
|
|
9
|
-
var MODAL_POSITIONS = Object.freeze({
|
|
10
|
-
BOTTOM: "bottom",
|
|
11
|
-
CENTER: "center",
|
|
12
|
-
LEFT: "left",
|
|
13
|
-
RIGHT: "right",
|
|
14
|
-
TOP: "top"
|
|
15
|
-
});
|
|
16
|
-
var MODAL_CHROME = Object.freeze({
|
|
17
|
-
BARE: "bare",
|
|
18
|
-
PANEL: "panel"
|
|
19
|
-
});
|
|
20
|
-
var MODAL_BREAKPOINTS = Object.freeze({
|
|
21
|
-
MOBILE_MAX_WIDTH: 639
|
|
22
|
-
});
|
|
23
|
-
var SMOOTH_SCROLL_LOCK_EVENT = "modal:smooth-scroll-lock";
|
|
24
|
-
var FOCUSABLE_SELECTOR = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
25
|
-
var HEIGHT_CONSTRAINT_PATTERN = /(\s|^)(?:[\w-]+:)*(?:h|max-h)-/;
|
|
26
|
-
var modalTheme = defineThemeSpec("modal");
|
|
27
|
-
|
|
28
|
-
// src/modules/modal/state.ts
|
|
29
|
-
function createModalState(modalStack = []) {
|
|
30
|
-
const activeModal = modalStack[modalStack.length - 1] || null;
|
|
31
|
-
return {
|
|
32
|
-
activeModalId: activeModal?.id || null,
|
|
33
|
-
chrome: activeModal?.chrome || MODAL_CHROME.PANEL,
|
|
34
|
-
headerActions: activeModal?.headerActions || null,
|
|
35
|
-
isOpen: modalStack.length > 0,
|
|
36
|
-
modalStack,
|
|
37
|
-
modalType: activeModal?.modalType || null,
|
|
38
|
-
position: activeModal?.position || MODAL_POSITIONS.CENTER,
|
|
39
|
-
props: activeModal?.props || {},
|
|
40
|
-
responsivePosition: activeModal?.responsivePosition || null,
|
|
41
|
-
showClose: activeModal?.showClose ?? true,
|
|
42
|
-
title: activeModal?.title || null
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
var INITIAL_MODAL_STATE = createModalState([]);
|
|
46
|
-
|
|
47
|
-
// src/modules/modal/identity.ts
|
|
48
|
-
function getModalIdentity(input) {
|
|
49
|
-
if (typeof input === "string") return { component: null, type: input };
|
|
50
|
-
const options = typeof input === "function" ? { component: input } : input;
|
|
51
|
-
const component = options.component ?? null;
|
|
52
|
-
return {
|
|
53
|
-
component,
|
|
54
|
-
type: "type" in options && options.type || "id" in options && options.id || component?.displayName || component?.name || "modal"
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function getModalLabel(modalType) {
|
|
58
|
-
if (typeof modalType !== "string" || !modalType.trim()) return "Modal";
|
|
59
|
-
return modalType.trim().toLowerCase().split(/[_-]+/).map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`).join(" ");
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// src/modules/modal/layout.ts
|
|
63
|
-
function hasHeightConstraint(className) {
|
|
64
|
-
return typeof className === "string" && HEIGHT_CONSTRAINT_PATTERN.test(className);
|
|
65
|
-
}
|
|
66
|
-
function isSidePosition(position) {
|
|
67
|
-
return position === MODAL_POSITIONS.LEFT || position === MODAL_POSITIONS.RIGHT;
|
|
68
|
-
}
|
|
69
|
-
function isVerticalEdgePosition(position) {
|
|
70
|
-
return position === MODAL_POSITIONS.TOP || position === MODAL_POSITIONS.BOTTOM;
|
|
71
|
-
}
|
|
72
|
-
function getModalPosition(position) {
|
|
73
|
-
return position === MODAL_POSITIONS.TOP || position === MODAL_POSITIONS.BOTTOM || position === MODAL_POSITIONS.LEFT || position === MODAL_POSITIONS.RIGHT ? position : MODAL_POSITIONS.CENTER;
|
|
74
|
-
}
|
|
75
|
-
function getModalLayout(position, isMobile) {
|
|
76
|
-
const resolved = getModalPosition(position);
|
|
77
|
-
if (!isMobile) return resolved;
|
|
78
|
-
if (resolved === MODAL_POSITIONS.TOP || resolved === MODAL_POSITIONS.BOTTOM)
|
|
79
|
-
return `${resolved}-mobile`;
|
|
80
|
-
if (resolved === MODAL_POSITIONS.LEFT || resolved === MODAL_POSITIONS.RIGHT)
|
|
81
|
-
return "side-mobile";
|
|
82
|
-
return resolved;
|
|
83
|
-
}
|
|
84
|
-
function getViewportIsMobile() {
|
|
85
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
return window.matchMedia(
|
|
89
|
-
`(max-width: ${MODAL_BREAKPOINTS.MOBILE_MAX_WIDTH}px)`
|
|
90
|
-
).matches;
|
|
91
|
-
}
|
|
92
|
-
function resolveActivePosition(position, responsivePosition, isMobileViewport) {
|
|
93
|
-
if (!isPlainObject(responsivePosition)) return position;
|
|
94
|
-
const responsive = isMobileViewport ? responsivePosition.mobile : responsivePosition.desktop;
|
|
95
|
-
return responsive || position;
|
|
96
|
-
}
|
|
97
|
-
function normalizePosition(input) {
|
|
98
|
-
if (typeof input === "string") {
|
|
99
|
-
return { position: input, responsivePosition: null };
|
|
100
|
-
}
|
|
101
|
-
if (!isPlainObject(input)) {
|
|
102
|
-
return { position: MODAL_POSITIONS.CENTER, responsivePosition: null };
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
position: resolveActivePosition(
|
|
106
|
-
MODAL_POSITIONS.CENTER,
|
|
107
|
-
input,
|
|
108
|
-
getViewportIsMobile()
|
|
109
|
-
),
|
|
110
|
-
responsivePosition: input
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
var ModalContext = getOrCreateGlobalContext(
|
|
114
|
-
"ModalContext",
|
|
115
|
-
null
|
|
116
|
-
);
|
|
117
|
-
function ModalProvider({
|
|
118
|
-
children,
|
|
119
|
-
modalRenderer: ModalRenderer = null
|
|
120
|
-
}) {
|
|
121
|
-
const [store] = useState(
|
|
122
|
-
() => createStore(INITIAL_MODAL_STATE, { freezeSnapshots: false })
|
|
123
|
-
);
|
|
124
|
-
const modalStackRef = useRef([]);
|
|
125
|
-
const pendingRef = useRef(/* @__PURE__ */ new Map());
|
|
126
|
-
const modalIdRef = useRef(0);
|
|
127
|
-
const syncModalStack = useCallback(
|
|
128
|
-
(nextStack) => {
|
|
129
|
-
modalStackRef.current = nextStack;
|
|
130
|
-
store.publish(createModalState(nextStack));
|
|
131
|
-
},
|
|
132
|
-
[store]
|
|
133
|
-
);
|
|
134
|
-
const settleModal = useCallback((modalId, result) => {
|
|
135
|
-
const pending = pendingRef.current.get(modalId);
|
|
136
|
-
if (!pending) return;
|
|
137
|
-
pendingRef.current.delete(modalId);
|
|
138
|
-
try {
|
|
139
|
-
const outcome = pending.onClose?.(result);
|
|
140
|
-
if (outcome instanceof Promise) {
|
|
141
|
-
outcome.catch((error) => report("Modal onClose", error));
|
|
142
|
-
}
|
|
143
|
-
} catch (error) {
|
|
144
|
-
report("Modal onClose", error);
|
|
145
|
-
}
|
|
146
|
-
pending.resolve(result);
|
|
147
|
-
}, []);
|
|
148
|
-
const openModal = useCallback(
|
|
149
|
-
(modalInput, options = {}) => {
|
|
150
|
-
if (!modalInput) return Promise.resolve(null);
|
|
151
|
-
const stack = modalStackRef.current;
|
|
152
|
-
const { component, type } = getModalIdentity(modalInput);
|
|
153
|
-
const topEntry = stack[stack.length - 1];
|
|
154
|
-
if (topEntry && (topEntry.modalType === type || component && topEntry.component === component)) {
|
|
155
|
-
return Promise.resolve(null);
|
|
156
|
-
}
|
|
157
|
-
const definition = typeof modalInput === "object" ? modalInput : void 0;
|
|
158
|
-
const merged = {
|
|
159
|
-
...definition,
|
|
160
|
-
...options
|
|
161
|
-
};
|
|
162
|
-
const data = { ...definition?.defaultData, ...options.data };
|
|
163
|
-
const modalId = ++modalIdRef.current;
|
|
164
|
-
const entry = {
|
|
165
|
-
chrome: merged.chrome || MODAL_CHROME.PANEL,
|
|
166
|
-
component,
|
|
167
|
-
headerActions: merged.actions || null,
|
|
168
|
-
id: modalId,
|
|
169
|
-
modalType: type,
|
|
170
|
-
props: data,
|
|
171
|
-
showClose: merged.showClose ?? true,
|
|
172
|
-
title: typeof merged.title === "function" ? merged.title(data) : merged.title ?? null,
|
|
173
|
-
...normalizePosition(merged.position)
|
|
174
|
-
};
|
|
175
|
-
return new Promise((resolve) => {
|
|
176
|
-
pendingRef.current.set(modalId, { onClose: merged.onClose, resolve });
|
|
177
|
-
syncModalStack([...stack, entry]);
|
|
178
|
-
});
|
|
179
|
-
},
|
|
180
|
-
[syncModalStack]
|
|
181
|
-
);
|
|
182
|
-
const closeModal = useCallback(
|
|
183
|
-
(result = null, targetModalId = null) => {
|
|
184
|
-
const stack = modalStackRef.current;
|
|
185
|
-
const modalId = targetModalId || stack[stack.length - 1]?.id;
|
|
186
|
-
if (!modalId || !stack.some((entry) => entry.id === modalId)) return;
|
|
187
|
-
syncModalStack(stack.filter((entry) => entry.id !== modalId));
|
|
188
|
-
settleModal(modalId, result);
|
|
189
|
-
},
|
|
190
|
-
[settleModal, syncModalStack]
|
|
191
|
-
);
|
|
192
|
-
const closeAllModals = useCallback(
|
|
193
|
-
(result = null) => {
|
|
194
|
-
const stack = modalStackRef.current;
|
|
195
|
-
if (stack.length === 0) return;
|
|
196
|
-
syncModalStack([]);
|
|
197
|
-
stack.forEach((entry) => settleModal(entry.id, result));
|
|
198
|
-
},
|
|
199
|
-
[settleModal, syncModalStack]
|
|
200
|
-
);
|
|
201
|
-
const actionsValue = useMemo(
|
|
202
|
-
() => ({ closeAllModals, closeModal, openModal }),
|
|
203
|
-
[openModal, closeModal, closeAllModals]
|
|
204
|
-
);
|
|
205
|
-
const contextValue = useMemo(
|
|
206
|
-
() => ({ actions: actionsValue, store }),
|
|
207
|
-
[actionsValue, store]
|
|
208
|
-
);
|
|
209
|
-
return /* @__PURE__ */ jsxs(ModalContext, { value: contextValue, children: [
|
|
210
|
-
ModalRenderer && /* @__PURE__ */ jsx(ModalRenderer, {}),
|
|
211
|
-
children
|
|
212
|
-
] });
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// src/modules/modal/dom.ts
|
|
216
|
-
function dispatchSmoothScrollLock(locked) {
|
|
217
|
-
if (typeof window === "undefined") return;
|
|
218
|
-
window.dispatchEvent(
|
|
219
|
-
new CustomEvent(SMOOTH_SCROLL_LOCK_EVENT, {
|
|
220
|
-
detail: { locked, source: "modal" }
|
|
221
|
-
})
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
function getFocusableElements(container) {
|
|
225
|
-
if (!container || typeof container.querySelectorAll !== "function") return [];
|
|
226
|
-
return Array.from(
|
|
227
|
-
container.querySelectorAll(FOCUSABLE_SELECTOR)
|
|
228
|
-
).filter(
|
|
229
|
-
(element) => !element.hasAttribute("disabled") && element.getAttribute("aria-hidden") !== "true"
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
function trapFocus(event, container) {
|
|
233
|
-
if (event.key !== "Tab" || !container) return;
|
|
234
|
-
const elements = getFocusableElements(container);
|
|
235
|
-
if (elements.length === 0) return;
|
|
236
|
-
const firstElement = elements[0];
|
|
237
|
-
const lastElement = elements[elements.length - 1];
|
|
238
|
-
if (event.shiftKey) {
|
|
239
|
-
if (document.activeElement === firstElement) {
|
|
240
|
-
event.preventDefault();
|
|
241
|
-
lastElement?.focus();
|
|
242
|
-
}
|
|
243
|
-
} else {
|
|
244
|
-
if (document.activeElement === lastElement) {
|
|
245
|
-
event.preventDefault();
|
|
246
|
-
firstElement?.focus();
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
function useModalRegistration(config, options) {
|
|
251
|
-
useModuleRegistration("modal", config, options);
|
|
252
|
-
}
|
|
253
|
-
function useModalRegistryEntries() {
|
|
254
|
-
const entries = useRegistryEntries("modal");
|
|
255
|
-
return useMemo(() => ({ get: (type) => entries[type] }), [entries]);
|
|
256
|
-
}
|
|
257
|
-
function useModalActions() {
|
|
258
|
-
return useRequiredContext(ModalContext, "useModalActions", "ModalProvider").actions;
|
|
259
|
-
}
|
|
260
|
-
function useModalState() {
|
|
261
|
-
const { store } = useRequiredContext(
|
|
262
|
-
ModalContext,
|
|
263
|
-
"useModalState",
|
|
264
|
-
"ModalProvider"
|
|
265
|
-
);
|
|
266
|
-
return useStore(store);
|
|
267
|
-
}
|
|
268
|
-
function useModal(modalInput) {
|
|
269
|
-
const actions = useModalActions();
|
|
270
|
-
const state = useModalState();
|
|
271
|
-
return useMemo(() => {
|
|
272
|
-
if (!modalInput) return { ...actions, ...state };
|
|
273
|
-
const { component, type } = getModalIdentity(modalInput);
|
|
274
|
-
const isOpen = state.modalStack.some(
|
|
275
|
-
(entry) => entry.modalType === type || component && entry.component === component
|
|
276
|
-
);
|
|
277
|
-
const open = (data, overrides) => actions.openModal(modalInput, { ...overrides, data });
|
|
278
|
-
const controls = {
|
|
279
|
-
close: actions.closeModal,
|
|
280
|
-
closeAll: actions.closeAllModals,
|
|
281
|
-
isOpen,
|
|
282
|
-
state
|
|
283
|
-
};
|
|
284
|
-
return Object.assign([open, controls], controls, { open });
|
|
285
|
-
}, [actions, modalInput, state]);
|
|
286
|
-
}
|
|
287
|
-
var emptySubscribe = () => () => {
|
|
288
|
-
};
|
|
289
|
-
function useModalLayerModel({
|
|
290
|
-
closeModal,
|
|
291
|
-
entry,
|
|
292
|
-
isMobileViewport,
|
|
293
|
-
isTopModal,
|
|
294
|
-
modalStack,
|
|
295
|
-
registry,
|
|
296
|
-
stackIndex
|
|
297
|
-
}) {
|
|
298
|
-
const modalRef = useRef(null);
|
|
299
|
-
const activePosition = useMemo(
|
|
300
|
-
() => resolveActivePosition(
|
|
301
|
-
entry.position,
|
|
302
|
-
entry.responsivePosition,
|
|
303
|
-
isMobileViewport
|
|
304
|
-
),
|
|
305
|
-
[entry.position, entry.responsivePosition, isMobileViewport]
|
|
306
|
-
);
|
|
307
|
-
const ActiveModalComponent = entry.component || registry.get(entry.modalType);
|
|
308
|
-
const isPanelChrome = entry.chrome !== MODAL_CHROME.BARE;
|
|
309
|
-
const isLeftModal = activePosition === MODAL_POSITIONS.LEFT;
|
|
310
|
-
const isSide = isSidePosition(activePosition);
|
|
311
|
-
const isVerticalEdge = isVerticalEdgePosition(activePosition);
|
|
312
|
-
const previousEntry = modalStack[stackIndex - 1] || null;
|
|
313
|
-
const baseZIndex = Z_INDEX.MODAL;
|
|
314
|
-
useEffect(() => {
|
|
315
|
-
if (!isTopModal || !modalRef.current) return;
|
|
316
|
-
const previouslyFocusedElement = document.activeElement;
|
|
317
|
-
const initialElements = getFocusableElements(modalRef.current);
|
|
318
|
-
if (initialElements.length > 0) initialElements[0].focus();
|
|
319
|
-
const handleKeyDown = (event) => {
|
|
320
|
-
if (event.key === "Escape") closeModal(null, entry.id);
|
|
321
|
-
else trapFocus(event, modalRef.current);
|
|
322
|
-
};
|
|
323
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
324
|
-
return () => {
|
|
325
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
326
|
-
if (previouslyFocusedElement?.isConnected)
|
|
327
|
-
previouslyFocusedElement.focus();
|
|
328
|
-
};
|
|
329
|
-
}, [closeModal, entry.id, isTopModal]);
|
|
330
|
-
return {
|
|
331
|
-
modalRef,
|
|
332
|
-
activePosition,
|
|
333
|
-
ActiveModalComponent,
|
|
334
|
-
isPanelChrome,
|
|
335
|
-
isLeftModal,
|
|
336
|
-
isSide,
|
|
337
|
-
isVerticalEdge,
|
|
338
|
-
previousEntry,
|
|
339
|
-
baseZIndex
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
function useModalContainerModel() {
|
|
343
|
-
return { theme: useTheme(modalTheme) };
|
|
344
|
-
}
|
|
345
|
-
function useModalModel() {
|
|
346
|
-
const { modalStack = [], isOpen, closeModal } = useModal();
|
|
347
|
-
const registry = useModalRegistryEntries();
|
|
348
|
-
const visibleModalStack = useMemo(
|
|
349
|
-
() => modalStack.filter(
|
|
350
|
-
(entry) => Boolean(entry.component || registry.get(entry.modalType))
|
|
351
|
-
),
|
|
352
|
-
[modalStack, registry]
|
|
353
|
-
);
|
|
354
|
-
const topModalEntry = visibleModalStack[visibleModalStack.length - 1] || null;
|
|
355
|
-
const isModalVisible = Boolean(isOpen && topModalEntry);
|
|
356
|
-
const mounted = useSyncExternalStore(
|
|
357
|
-
emptySubscribe,
|
|
358
|
-
() => true,
|
|
359
|
-
() => false
|
|
360
|
-
);
|
|
361
|
-
const [isMobileViewport, setIsMobileViewport] = useState(getViewportIsMobile);
|
|
362
|
-
const [isTopExitSettling, setIsTopExitSettling] = useState(false);
|
|
363
|
-
const previousTopModalIdRef = useRef(null);
|
|
364
|
-
const releaseScrollLockRef = useRef(null);
|
|
365
|
-
useLayoutEffect(() => {
|
|
366
|
-
const currentTopModalId = topModalEntry?.id || null;
|
|
367
|
-
const previousTopModalId = previousTopModalIdRef.current;
|
|
368
|
-
const previousTopStillMounted = visibleModalStack.some(
|
|
369
|
-
(entry) => entry.id === previousTopModalId
|
|
370
|
-
);
|
|
371
|
-
if (previousTopModalId && previousTopModalId !== currentTopModalId && !previousTopStillMounted) {
|
|
372
|
-
setIsTopExitSettling(true);
|
|
373
|
-
}
|
|
374
|
-
previousTopModalIdRef.current = currentTopModalId;
|
|
375
|
-
}, [topModalEntry?.id, visibleModalStack]);
|
|
376
|
-
useEffect(() => {
|
|
377
|
-
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
378
|
-
const mediaQuery = window.matchMedia(
|
|
379
|
-
`(max-width: ${MODAL_BREAKPOINTS.MOBILE_MAX_WIDTH}px)`
|
|
380
|
-
);
|
|
381
|
-
const handleViewportChange = (e) => setIsMobileViewport(e.matches);
|
|
382
|
-
mediaQuery.addEventListener("change", handleViewportChange);
|
|
383
|
-
return () => mediaQuery.removeEventListener("change", handleViewportChange);
|
|
384
|
-
}, []);
|
|
385
|
-
useEffect(() => {
|
|
386
|
-
if (typeof document === "undefined") return;
|
|
387
|
-
if (isModalVisible) {
|
|
388
|
-
releaseScrollLockRef.current ??= acquireGlobalScrollLock();
|
|
389
|
-
} else if (releaseScrollLockRef.current) {
|
|
390
|
-
releaseScrollLockRef.current();
|
|
391
|
-
releaseScrollLockRef.current = null;
|
|
392
|
-
}
|
|
393
|
-
dispatchSmoothScrollLock(isModalVisible);
|
|
394
|
-
}, [isModalVisible]);
|
|
395
|
-
useEffect(() => {
|
|
396
|
-
return () => {
|
|
397
|
-
releaseScrollLockRef.current?.();
|
|
398
|
-
releaseScrollLockRef.current = null;
|
|
399
|
-
dispatchSmoothScrollLock(false);
|
|
400
|
-
};
|
|
401
|
-
}, []);
|
|
402
|
-
return {
|
|
403
|
-
modalStack,
|
|
404
|
-
closeModal,
|
|
405
|
-
registry,
|
|
406
|
-
visibleModalStack,
|
|
407
|
-
topModalEntry,
|
|
408
|
-
isModalVisible,
|
|
409
|
-
mounted,
|
|
410
|
-
isMobileViewport,
|
|
411
|
-
isTopExitSettling,
|
|
412
|
-
setIsTopExitSettling,
|
|
413
|
-
theme: useTheme(modalTheme)
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
export { INITIAL_MODAL_STATE, MODAL_BREAKPOINTS, MODAL_CHROME, MODAL_POSITIONS, ModalContext, ModalProvider, SMOOTH_SCROLL_LOCK_EVENT, createModalState, dispatchSmoothScrollLock, getFocusableElements, getModalIdentity, getModalLabel, getModalLayout, getModalPosition, getViewportIsMobile, hasHeightConstraint, isSidePosition, isVerticalEdgePosition, modalTheme, normalizePosition, resolveActivePosition, trapFocus, useModal, useModalActions, useModalContainerModel, useModalLayerModel, useModalModel, useModalRegistration, useModalRegistryEntries, useModalState };
|
|
418
|
-
//# sourceMappingURL=chunk-6UFMD6TK.js.map
|
|
419
|
-
//# sourceMappingURL=chunk-6UFMD6TK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/modules/modal/constants.ts","../src/modules/modal/state.ts","../src/modules/modal/identity.ts","../src/modules/modal/layout.ts","../src/modules/modal/context.tsx","../src/modules/modal/dom.ts","../src/modules/modal/hooks.ts"],"names":["useMemo","useRef","useState"],"mappings":";;;;;;;;AAGO,IAAM,eAAA,GAAkB,OAAO,MAAA,CAAO;AAAA,EAC3C,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,QAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,GAAA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unk-6UFMD6TK.js","sourcesContent":["import { defineThemeSpec } from \"@/theme\";\nimport { type ModalMotion, type ModalThemeSlot } from \"./types\";\n\nexport const MODAL_POSITIONS = Object.freeze({\n BOTTOM: \"bottom\",\n CENTER: \"center\",\n LEFT: \"left\",\n RIGHT: \"right\",\n TOP: \"top\",\n} as const);\n\nexport const MODAL_CHROME = Object.freeze({\n BARE: \"bare\",\n PANEL: \"panel\",\n} as const);\n\nexport const MODAL_BREAKPOINTS = Object.freeze({\n MOBILE_MAX_WIDTH: 639,\n} as const);\n\nexport const SMOOTH_SCROLL_LOCK_EVENT = \"modal:smooth-scroll-lock\";\n\nexport const FOCUSABLE_SELECTOR =\n 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable=\"true\"], [tabindex]:not([tabindex=\"-1\"])';\n\nexport const HEIGHT_CONSTRAINT_PATTERN = /(\\s|^)(?:[\\w-]+:)*(?:h|max-h)-/;\n\nexport const modalTheme = defineThemeSpec<ModalThemeSlot, ModalMotion>(\"modal\");\n","import { MODAL_CHROME, MODAL_POSITIONS } from \"./constants\";\nimport { type ModalEntry, type ModalState } from \"./types\";\n\nexport function createModalState(modalStack: ModalEntry[] = []): ModalState {\n const activeModal = modalStack[modalStack.length - 1] || null;\n return {\n activeModalId: activeModal?.id || null,\n chrome: activeModal?.chrome || MODAL_CHROME.PANEL,\n headerActions: activeModal?.headerActions || null,\n isOpen: modalStack.length > 0,\n modalStack,\n modalType: activeModal?.modalType || null,\n position: activeModal?.position || MODAL_POSITIONS.CENTER,\n props: activeModal?.props || {},\n responsivePosition: activeModal?.responsivePosition || null,\n showClose: activeModal?.showClose ?? true,\n title: activeModal?.title || null,\n };\n}\n\nexport const INITIAL_MODAL_STATE = createModalState([]);\n","import {\n type DefineModalOptions,\n type ModalComponent,\n type ModalInput,\n} from \"./types\";\n\nexport function getModalIdentity(input: ModalInput | DefineModalOptions): {\n component: ModalComponent | null;\n type: string;\n} {\n if (typeof input === \"string\") return { component: null, type: input };\n const options = typeof input === \"function\" ? { component: input } : input;\n const component = options.component ?? null;\n return {\n component,\n type:\n (\"type\" in options && options.type) ||\n (\"id\" in options && options.id) ||\n component?.displayName ||\n component?.name ||\n \"modal\",\n };\n}\n\nexport function getModalLabel(modalType?: string | null): string {\n if (typeof modalType !== \"string\" || !modalType.trim()) return \"Modal\";\n return modalType\n .trim()\n .toLowerCase()\n .split(/[_-]+/)\n .map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)\n .join(\" \");\n}\n","import { isPlainObject } from \"@/utils\";\nimport {\n HEIGHT_CONSTRAINT_PATTERN,\n MODAL_BREAKPOINTS,\n MODAL_POSITIONS,\n} from \"./constants\";\nimport {\n type ModalLayout,\n type ModalPosition,\n type ResponsiveModalPosition,\n} from \"./types\";\n\nexport function hasHeightConstraint(className?: string): boolean {\n return (\n typeof className === \"string\" && HEIGHT_CONSTRAINT_PATTERN.test(className)\n );\n}\n\nexport function isSidePosition(\n position: ModalPosition | null | undefined,\n): boolean {\n return (\n position === MODAL_POSITIONS.LEFT || position === MODAL_POSITIONS.RIGHT\n );\n}\n\nexport function isVerticalEdgePosition(\n position: ModalPosition | null | undefined,\n): boolean {\n return (\n position === MODAL_POSITIONS.TOP || position === MODAL_POSITIONS.BOTTOM\n );\n}\n\nexport function getModalPosition(position: ModalPosition): ModalPosition {\n return position === MODAL_POSITIONS.TOP ||\n position === MODAL_POSITIONS.BOTTOM ||\n position === MODAL_POSITIONS.LEFT ||\n position === MODAL_POSITIONS.RIGHT\n ? position\n : MODAL_POSITIONS.CENTER;\n}\nexport function getModalLayout(\n position: ModalPosition,\n isMobile: boolean,\n): ModalLayout {\n const resolved = getModalPosition(position);\n if (!isMobile) return resolved;\n if (resolved === MODAL_POSITIONS.TOP || resolved === MODAL_POSITIONS.BOTTOM)\n return `${resolved}-mobile`;\n if (resolved === MODAL_POSITIONS.LEFT || resolved === MODAL_POSITIONS.RIGHT)\n return \"side-mobile\";\n return resolved;\n}\n\nexport function getViewportIsMobile(): boolean {\n if (\n typeof window === \"undefined\" ||\n typeof window.matchMedia !== \"function\"\n ) {\n return false;\n }\n return window.matchMedia(\n `(max-width: ${MODAL_BREAKPOINTS.MOBILE_MAX_WIDTH}px)`,\n ).matches;\n}\n\nexport function resolveActivePosition(\n position: ModalPosition,\n responsivePosition: ResponsiveModalPosition | null | undefined,\n isMobileViewport: boolean,\n): ModalPosition {\n if (!isPlainObject(responsivePosition)) return position;\n const responsive = isMobileViewport\n ? responsivePosition.mobile\n : responsivePosition.desktop;\n return (responsive || position) as ModalPosition;\n}\n\nexport function normalizePosition(\n input: ModalPosition | ResponsiveModalPosition | undefined,\n): {\n position: ModalPosition;\n responsivePosition: ResponsiveModalPosition | null;\n} {\n if (typeof input === \"string\") {\n return { position: input, responsivePosition: null };\n }\n if (!isPlainObject(input)) {\n return { position: MODAL_POSITIONS.CENTER, responsivePosition: null };\n }\n return {\n position: resolveActivePosition(\n MODAL_POSITIONS.CENTER,\n input,\n getViewportIsMobile(),\n ),\n responsivePosition: input,\n };\n}\n","\"use client\";\n\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { getOrCreateGlobalContext } from \"@/kernel\";\nimport { createStore, report, type ExternalStore } from \"@/utils\";\nimport { MODAL_CHROME } from \"./constants\";\nimport {\n type ModalActions,\n type ModalEntry,\n type ModalOptions,\n type ModalProviderProps,\n type ModalState,\n} from \"./types\";\nimport { INITIAL_MODAL_STATE, createModalState } from \"./state\";\nimport { getModalIdentity } from \"./identity\";\nimport { normalizePosition } from \"./layout\";\n\nexport interface ModalContextValue {\n actions: ModalActions;\n store: ExternalStore<ModalState>;\n}\n\nexport const ModalContext = getOrCreateGlobalContext<ModalContextValue | null>(\n \"ModalContext\",\n null,\n);\n\ninterface PendingModal {\n onClose?: ModalOptions[\"onClose\"];\n resolve: (result?: unknown) => void;\n}\n\nexport function ModalProvider({\n children,\n modalRenderer: ModalRenderer = null,\n}: ModalProviderProps) {\n const [store] = useState(() =>\n createStore<ModalState>(INITIAL_MODAL_STATE, { freezeSnapshots: false }),\n );\n\n const modalStackRef = useRef<ModalEntry[]>([]);\n const pendingRef = useRef<Map<number, PendingModal>>(new Map());\n const modalIdRef = useRef(0);\n\n const syncModalStack = useCallback(\n (nextStack: ModalEntry[]) => {\n modalStackRef.current = nextStack;\n store.publish(createModalState(nextStack));\n },\n [store],\n );\n\n const settleModal = useCallback((modalId: number, result: unknown) => {\n const pending = pendingRef.current.get(modalId);\n if (!pending) return;\n pendingRef.current.delete(modalId);\n\n try {\n const outcome = pending.onClose?.(result);\n if (outcome instanceof Promise) {\n outcome.catch((error) => report(\"Modal onClose\", error));\n }\n } catch (error) {\n report(\"Modal onClose\", error);\n }\n pending.resolve(result);\n }, []);\n\n const openModal = useCallback<ModalActions[\"openModal\"]>(\n (modalInput, options = {}) => {\n if (!modalInput) return Promise.resolve(null);\n\n const stack = modalStackRef.current;\n const { component, type } = getModalIdentity(modalInput);\n const topEntry = stack[stack.length - 1];\n if (\n topEntry &&\n (topEntry.modalType === type ||\n (component && topEntry.component === component))\n ) {\n return Promise.resolve(null);\n }\n\n const definition =\n typeof modalInput === \"object\" ? modalInput : undefined;\n const merged: ModalOptions & { defaultData?: Record<string, unknown> } = {\n ...definition,\n ...options,\n };\n const data = { ...definition?.defaultData, ...options.data };\n const modalId = ++modalIdRef.current;\n\n const entry: ModalEntry = {\n chrome: merged.chrome || MODAL_CHROME.PANEL,\n component,\n headerActions: merged.actions || null,\n id: modalId,\n modalType: type,\n props: data,\n showClose: merged.showClose ?? true,\n title:\n typeof merged.title === \"function\"\n ? merged.title(data)\n : (merged.title ?? null),\n ...normalizePosition(merged.position),\n };\n\n return new Promise((resolve) => {\n pendingRef.current.set(modalId, { onClose: merged.onClose, resolve });\n syncModalStack([...stack, entry]);\n });\n },\n [syncModalStack],\n );\n\n const closeModal = useCallback<ModalActions[\"closeModal\"]>(\n (result = null, targetModalId = null) => {\n const stack = modalStackRef.current;\n const modalId = targetModalId || stack[stack.length - 1]?.id;\n if (!modalId || !stack.some((entry) => entry.id === modalId)) return;\n\n syncModalStack(stack.filter((entry) => entry.id !== modalId));\n settleModal(modalId, result);\n },\n [settleModal, syncModalStack],\n );\n\n const closeAllModals = useCallback<ModalActions[\"closeAllModals\"]>(\n (result = null) => {\n const stack = modalStackRef.current;\n if (stack.length === 0) return;\n\n syncModalStack([]);\n stack.forEach((entry) => settleModal(entry.id, result));\n },\n [settleModal, syncModalStack],\n );\n\n const actionsValue = useMemo<ModalActions>(\n () => ({ closeAllModals, closeModal, openModal }),\n [openModal, closeModal, closeAllModals],\n );\n\n const contextValue = useMemo<ModalContextValue>(\n () => ({ actions: actionsValue, store }),\n [actionsValue, store],\n );\n\n return (\n <ModalContext value={contextValue}>\n {ModalRenderer && <ModalRenderer />}\n {children}\n </ModalContext>\n );\n}\n","import { FOCUSABLE_SELECTOR, SMOOTH_SCROLL_LOCK_EVENT } from \"./constants\";\n\nexport function dispatchSmoothScrollLock(locked: boolean): void {\n if (typeof window === \"undefined\") return;\n window.dispatchEvent(\n new CustomEvent(SMOOTH_SCROLL_LOCK_EVENT, {\n detail: { locked, source: \"modal\" },\n }),\n );\n}\n\nexport function getFocusableElements(\n container: HTMLElement | null,\n): HTMLElement[] {\n if (!container || typeof container.querySelectorAll !== \"function\") return [];\n return Array.from(\n container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter(\n (element) =>\n !element.hasAttribute(\"disabled\") &&\n element.getAttribute(\"aria-hidden\") !== \"true\",\n );\n}\n\nexport function trapFocus(\n event: KeyboardEvent,\n container: HTMLElement | null,\n): void {\n if (event.key !== \"Tab\" || !container) return;\n const elements = getFocusableElements(container);\n if (elements.length === 0) return;\n\n const firstElement = elements[0];\n const lastElement = elements[elements.length - 1];\n\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement?.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement?.focus();\n }\n }\n}\n","\"use client\";\n\nimport {\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { useRequiredContext, useStore } from \"@/hooks\";\nimport {\n useModuleRegistration,\n useRegistryEntries,\n type RegistryMetadata,\n} from \"@/kernel\";\nimport { Z_INDEX } from \"@/tokens\";\nimport { acquireGlobalScrollLock } from \"@/utils\";\nimport { useModuleTheme } from \"@/theme\";\nimport {\n MODAL_BREAKPOINTS,\n MODAL_CHROME,\n MODAL_POSITIONS,\n modalTheme,\n} from \"./constants\";\nimport { ModalContext } from \"./context\";\nimport { getModalIdentity } from \"./identity\";\nimport {\n type ModalActions,\n type ModalComponent,\n type ModalEntry,\n type ModalHookBinding,\n type ModalHookControls,\n type ModalInput,\n type ModalOpenFn,\n type ModalPageConfig,\n type ModalState,\n} from \"./types\";\nimport {\n dispatchSmoothScrollLock,\n getFocusableElements,\n trapFocus,\n} from \"./dom\";\nimport {\n getViewportIsMobile,\n isSidePosition,\n isVerticalEdgePosition,\n resolveActivePosition,\n} from \"./layout\";\n\nexport function useModalRegistration(\n config: ModalPageConfig | null | undefined,\n options?: RegistryMetadata & { enabled?: boolean },\n): void {\n useModuleRegistration(\"modal\", config, options);\n}\n\nexport function useModalRegistryEntries(): {\n get: (type: string) => ModalComponent | undefined;\n} {\n const entries = useRegistryEntries<\"modal\", ModalComponent>(\"modal\");\n return useMemo(() => ({ get: (type: string) => entries[type] }), [entries]);\n}\n\nexport function useModalActions(): ModalActions {\n return useRequiredContext(ModalContext, \"useModalActions\", \"ModalProvider\")\n .actions;\n}\n\nexport function useModalState(): ModalState {\n const { store } = useRequiredContext(\n ModalContext,\n \"useModalState\",\n \"ModalProvider\",\n );\n return useStore(store);\n}\n\nexport function useModal(): ModalState & ModalActions;\nexport function useModal(modalInput: ModalInput): ModalHookBinding;\nexport function useModal(\n modalInput?: ModalInput | null,\n): (ModalState & ModalActions) | ModalHookBinding {\n const actions = useModalActions();\n const state = useModalState();\n\n return useMemo(() => {\n if (!modalInput) return { ...actions, ...state };\n\n const { component, type } = getModalIdentity(modalInput);\n const isOpen = state.modalStack.some(\n (entry) =>\n entry.modalType === type ||\n (component && entry.component === component),\n );\n const open: ModalOpenFn = (data, overrides) =>\n actions.openModal(modalInput, { ...overrides, data });\n const controls: ModalHookControls = {\n close: actions.closeModal,\n closeAll: actions.closeAllModals,\n isOpen,\n state,\n };\n\n return Object.assign([open, controls], controls, { open });\n }, [actions, modalInput, state]) as\n (ModalState & ModalActions) | ModalHookBinding;\n}\n\nconst emptySubscribe = () => () => {};\n\nexport function useModalLayerModel({\n closeModal,\n entry,\n isMobileViewport,\n isTopModal,\n modalStack,\n registry,\n stackIndex,\n}: {\n closeModal: (result?: unknown, targetModalId?: number | null) => void;\n entry: ModalEntry;\n isMobileViewport: boolean;\n isTopModal: boolean;\n modalStack: ModalEntry[];\n registry: { get: (key: string) => ModalComponent | undefined };\n stackIndex: number;\n}) {\n const modalRef = useRef<HTMLDivElement | null>(null);\n const activePosition = useMemo(\n () =>\n resolveActivePosition(\n entry.position,\n entry.responsivePosition,\n isMobileViewport,\n ),\n [entry.position, entry.responsivePosition, isMobileViewport],\n );\n const ActiveModalComponent = entry.component || registry.get(entry.modalType);\n const isPanelChrome = entry.chrome !== MODAL_CHROME.BARE;\n const isLeftModal = activePosition === MODAL_POSITIONS.LEFT;\n const isSide = isSidePosition(activePosition);\n const isVerticalEdge = isVerticalEdgePosition(activePosition);\n const previousEntry = modalStack[stackIndex - 1] || null;\n const baseZIndex = Z_INDEX.MODAL;\n useEffect(() => {\n if (!isTopModal || !modalRef.current) return;\n const previouslyFocusedElement =\n document.activeElement as HTMLElement | null;\n const initialElements = getFocusableElements(modalRef.current);\n if (initialElements.length > 0) initialElements[0].focus();\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") closeModal(null, entry.id);\n else trapFocus(event, modalRef.current);\n };\n\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n if (previouslyFocusedElement?.isConnected)\n previouslyFocusedElement.focus();\n };\n }, [closeModal, entry.id, isTopModal]);\n\n return {\n modalRef,\n activePosition,\n ActiveModalComponent,\n isPanelChrome,\n isLeftModal,\n isSide,\n isVerticalEdge,\n previousEntry,\n baseZIndex,\n };\n}\n\nexport function useModalContainerModel() {\n return { theme: useModuleTheme(modalTheme) };\n}\n\nexport function useModalModel() {\n const { modalStack = [], isOpen, closeModal } = useModal();\n const registry = useModalRegistryEntries();\n const visibleModalStack = useMemo(\n () =>\n modalStack.filter((entry: ModalEntry) =>\n Boolean(entry.component || registry.get(entry.modalType)),\n ),\n [modalStack, registry],\n );\n const topModalEntry = visibleModalStack[visibleModalStack.length - 1] || null;\n const isModalVisible = Boolean(isOpen && topModalEntry);\n const mounted = useSyncExternalStore(\n emptySubscribe,\n () => true,\n () => false,\n );\n const [isMobileViewport, setIsMobileViewport] = useState(getViewportIsMobile);\n const [isTopExitSettling, setIsTopExitSettling] = useState(false);\n const previousTopModalIdRef = useRef<number | null>(null);\n const releaseScrollLockRef = useRef<(() => void) | null>(null);\n useLayoutEffect(() => {\n const currentTopModalId = topModalEntry?.id || null;\n const previousTopModalId = previousTopModalIdRef.current;\n const previousTopStillMounted = visibleModalStack.some(\n (entry: ModalEntry) => entry.id === previousTopModalId,\n );\n\n if (\n previousTopModalId &&\n previousTopModalId !== currentTopModalId &&\n !previousTopStillMounted\n ) {\n setIsTopExitSettling(true);\n }\n previousTopModalIdRef.current = currentTopModalId;\n }, [topModalEntry?.id, visibleModalStack]);\n useEffect(() => {\n if (typeof window === \"undefined\" || !window.matchMedia) return;\n\n const mediaQuery = window.matchMedia(\n `(max-width: ${MODAL_BREAKPOINTS.MOBILE_MAX_WIDTH}px)`,\n );\n const handleViewportChange = (e: MediaQueryListEvent) =>\n setIsMobileViewport(e.matches);\n\n mediaQuery.addEventListener(\"change\", handleViewportChange);\n return () => mediaQuery.removeEventListener(\"change\", handleViewportChange);\n }, []);\n useEffect(() => {\n if (typeof document === \"undefined\") return;\n\n if (isModalVisible) {\n releaseScrollLockRef.current ??= acquireGlobalScrollLock();\n } else if (releaseScrollLockRef.current) {\n releaseScrollLockRef.current();\n releaseScrollLockRef.current = null;\n }\n dispatchSmoothScrollLock(isModalVisible);\n }, [isModalVisible]);\n useEffect(() => {\n return () => {\n releaseScrollLockRef.current?.();\n releaseScrollLockRef.current = null;\n dispatchSmoothScrollLock(false);\n };\n }, []);\n\n return {\n modalStack,\n closeModal,\n registry,\n visibleModalStack,\n topModalEntry,\n isModalVisible,\n mounted,\n isMobileViewport,\n isTopExitSettling,\n setIsTopExitSettling,\n theme: useModuleTheme(modalTheme),\n };\n}\n"]}
|