@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
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { createNavigationState, createNavigator, readWindowLocation, NAVIGATION_REASON, NAVIGATION_SOURCE, NAVIGATION_PHASE, isSameLocation, isSamePathname, internalLinkOf, NAVIGATION_PREFETCH_ATTRIBUTE, getNavigationSettings } from './chunk-RF2YGILF.js';
|
|
2
|
+
import { defineModule } from './chunk-NHOJWICA.js';
|
|
3
|
+
import { createStore } from './chunk-5H6FZW3N.js';
|
|
4
|
+
import { getOrCreateGlobalContext } from './chunk-J3VTDBC6.js';
|
|
5
|
+
import { c } from 'react/compiler-runtime';
|
|
6
|
+
import { useRouter, usePathname } from 'next/navigation';
|
|
7
|
+
import { useState, useLayoutEffect, useEffect } from 'react';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
// src/modules/navigation/listeners.ts
|
|
11
|
+
function wantedHref(target, settings) {
|
|
12
|
+
const {
|
|
13
|
+
intent
|
|
14
|
+
} = settings();
|
|
15
|
+
if (!intent) return null;
|
|
16
|
+
const link = internalLinkOf(target);
|
|
17
|
+
if (!link || link.getAttribute(NAVIGATION_PREFETCH_ATTRIBUTE) === "false") return null;
|
|
18
|
+
const href = link.getAttribute("href");
|
|
19
|
+
return intent.match(href) ? href : null;
|
|
20
|
+
}
|
|
21
|
+
function watchIntent(navigator, settings, doc = document) {
|
|
22
|
+
let resting = null;
|
|
23
|
+
const stop = () => {
|
|
24
|
+
if (resting) clearTimeout(resting.timer);
|
|
25
|
+
resting = null;
|
|
26
|
+
};
|
|
27
|
+
const onOver = (event) => {
|
|
28
|
+
const {
|
|
29
|
+
pointerType
|
|
30
|
+
} = event;
|
|
31
|
+
if (pointerType && pointerType !== "mouse") return;
|
|
32
|
+
const href = wantedHref(event.target, settings);
|
|
33
|
+
if (!href) return stop();
|
|
34
|
+
if (resting?.href === href) return;
|
|
35
|
+
stop();
|
|
36
|
+
const {
|
|
37
|
+
intent
|
|
38
|
+
} = settings();
|
|
39
|
+
const delay = intent ? Math.max(0, intent.delayMs) : 0;
|
|
40
|
+
resting = {
|
|
41
|
+
href,
|
|
42
|
+
timer: setTimeout(() => {
|
|
43
|
+
resting = null;
|
|
44
|
+
navigator.prefetch(href);
|
|
45
|
+
}, delay)
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
const onNow = (event) => {
|
|
49
|
+
const href = wantedHref(event.target, settings);
|
|
50
|
+
if (href) navigator.prefetch(href);
|
|
51
|
+
};
|
|
52
|
+
doc.addEventListener("pointerover", onOver, {
|
|
53
|
+
passive: true
|
|
54
|
+
});
|
|
55
|
+
doc.addEventListener("pointerdown", onNow, {
|
|
56
|
+
passive: true
|
|
57
|
+
});
|
|
58
|
+
doc.addEventListener("focusin", onNow, {
|
|
59
|
+
passive: true
|
|
60
|
+
});
|
|
61
|
+
return () => {
|
|
62
|
+
stop();
|
|
63
|
+
doc.removeEventListener("pointerover", onOver);
|
|
64
|
+
doc.removeEventListener("pointerdown", onNow);
|
|
65
|
+
doc.removeEventListener("focusin", onNow);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function classifyPop(to, {
|
|
69
|
+
active,
|
|
70
|
+
location
|
|
71
|
+
}) {
|
|
72
|
+
const isLeavingByHistory = active?.source === NAVIGATION_SOURCE.HISTORY && active.phase === NAVIGATION_PHASE.LEAVING;
|
|
73
|
+
if (isLeavingByHistory) {
|
|
74
|
+
return isSameLocation(to, active.from) ? "cancel" : "depart";
|
|
75
|
+
}
|
|
76
|
+
return isSamePathname(to, location) ? "ignore" : "depart";
|
|
77
|
+
}
|
|
78
|
+
function watchHistory(navigator, win = window) {
|
|
79
|
+
let replaying = false;
|
|
80
|
+
const onPopState = (event) => {
|
|
81
|
+
if (replaying) return;
|
|
82
|
+
const to = readWindowLocation();
|
|
83
|
+
if (!to) return;
|
|
84
|
+
const action = classifyPop(to, navigator.store.getSnapshot());
|
|
85
|
+
if (action === "cancel") {
|
|
86
|
+
navigator.cancel(NAVIGATION_REASON.RETURNED);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (action === "ignore") return;
|
|
90
|
+
if (!navigator.holdsHistory()) {
|
|
91
|
+
navigator.depart(to);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
event.stopImmediatePropagation();
|
|
95
|
+
const state = event.state;
|
|
96
|
+
navigator.depart(to, {
|
|
97
|
+
replay: () => {
|
|
98
|
+
replaying = true;
|
|
99
|
+
try {
|
|
100
|
+
win.dispatchEvent(new PopStateEvent("popstate", {
|
|
101
|
+
state
|
|
102
|
+
}));
|
|
103
|
+
} finally {
|
|
104
|
+
replaying = false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
win.addEventListener("popstate", onPopState, {
|
|
110
|
+
capture: true
|
|
111
|
+
});
|
|
112
|
+
return () => win.removeEventListener("popstate", onPopState, {
|
|
113
|
+
capture: true
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
var NavigationContext = getOrCreateGlobalContext("NavigationContext", null);
|
|
117
|
+
var noop = () => {
|
|
118
|
+
};
|
|
119
|
+
var NOT_HANDLED = Object.freeze({
|
|
120
|
+
ok: false,
|
|
121
|
+
trip: null
|
|
122
|
+
});
|
|
123
|
+
var INERT_NAVIGATION_ACTIONS = Object.freeze({
|
|
124
|
+
arrival: () => null,
|
|
125
|
+
arrive: noop,
|
|
126
|
+
cancel: () => false,
|
|
127
|
+
depart: () => null,
|
|
128
|
+
hold: () => noop,
|
|
129
|
+
holdsHistory: () => false,
|
|
130
|
+
navigate: () => Promise.resolve(NOT_HANDLED),
|
|
131
|
+
onIntent: () => noop,
|
|
132
|
+
prefetch: () => false,
|
|
133
|
+
provide: () => noop,
|
|
134
|
+
setRouter: noop
|
|
135
|
+
});
|
|
136
|
+
var NOOP_NAVIGATION_STORE = createStore(createNavigationState());
|
|
137
|
+
function NavigationProvider(t0) {
|
|
138
|
+
const $ = c(22);
|
|
139
|
+
const {
|
|
140
|
+
children
|
|
141
|
+
} = t0;
|
|
142
|
+
const router = useRouter();
|
|
143
|
+
const pathname = usePathname();
|
|
144
|
+
let t1;
|
|
145
|
+
if ($[0] !== router) {
|
|
146
|
+
t1 = () => {
|
|
147
|
+
const created = createNavigator({
|
|
148
|
+
router
|
|
149
|
+
});
|
|
150
|
+
const value = {
|
|
151
|
+
actions: created,
|
|
152
|
+
store: created.store
|
|
153
|
+
};
|
|
154
|
+
return {
|
|
155
|
+
navigator: created,
|
|
156
|
+
runtime: value
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
$[0] = router;
|
|
160
|
+
$[1] = t1;
|
|
161
|
+
} else {
|
|
162
|
+
t1 = $[1];
|
|
163
|
+
}
|
|
164
|
+
const [t2] = useState(t1);
|
|
165
|
+
const {
|
|
166
|
+
navigator,
|
|
167
|
+
runtime
|
|
168
|
+
} = t2;
|
|
169
|
+
let t3;
|
|
170
|
+
let t4;
|
|
171
|
+
if ($[2] !== navigator || $[3] !== router) {
|
|
172
|
+
t3 = () => {
|
|
173
|
+
navigator.setRouter(router);
|
|
174
|
+
};
|
|
175
|
+
t4 = [navigator, router];
|
|
176
|
+
$[2] = navigator;
|
|
177
|
+
$[3] = router;
|
|
178
|
+
$[4] = t3;
|
|
179
|
+
$[5] = t4;
|
|
180
|
+
} else {
|
|
181
|
+
t3 = $[4];
|
|
182
|
+
t4 = $[5];
|
|
183
|
+
}
|
|
184
|
+
useLayoutEffect(t3, t4);
|
|
185
|
+
let t5;
|
|
186
|
+
let t6;
|
|
187
|
+
if ($[6] !== navigator || $[7] !== pathname) {
|
|
188
|
+
t5 = () => {
|
|
189
|
+
navigator.arrive(readWindowLocation() ?? pathname);
|
|
190
|
+
};
|
|
191
|
+
t6 = [navigator, pathname];
|
|
192
|
+
$[6] = navigator;
|
|
193
|
+
$[7] = pathname;
|
|
194
|
+
$[8] = t5;
|
|
195
|
+
$[9] = t6;
|
|
196
|
+
} else {
|
|
197
|
+
t5 = $[8];
|
|
198
|
+
t6 = $[9];
|
|
199
|
+
}
|
|
200
|
+
useEffect(t5, t6);
|
|
201
|
+
let t7;
|
|
202
|
+
let t8;
|
|
203
|
+
if ($[10] !== navigator) {
|
|
204
|
+
t7 = () => watchHistory(navigator);
|
|
205
|
+
t8 = [navigator];
|
|
206
|
+
$[10] = navigator;
|
|
207
|
+
$[11] = t7;
|
|
208
|
+
$[12] = t8;
|
|
209
|
+
} else {
|
|
210
|
+
t7 = $[11];
|
|
211
|
+
t8 = $[12];
|
|
212
|
+
}
|
|
213
|
+
useEffect(t7, t8);
|
|
214
|
+
let t10;
|
|
215
|
+
let t9;
|
|
216
|
+
if ($[13] !== navigator) {
|
|
217
|
+
t9 = () => watchIntent(navigator, getNavigationSettings);
|
|
218
|
+
t10 = [navigator];
|
|
219
|
+
$[13] = navigator;
|
|
220
|
+
$[14] = t10;
|
|
221
|
+
$[15] = t9;
|
|
222
|
+
} else {
|
|
223
|
+
t10 = $[14];
|
|
224
|
+
t9 = $[15];
|
|
225
|
+
}
|
|
226
|
+
useEffect(t9, t10);
|
|
227
|
+
let t11;
|
|
228
|
+
let t12;
|
|
229
|
+
if ($[16] !== navigator) {
|
|
230
|
+
t11 = () => () => navigator.dispose();
|
|
231
|
+
t12 = [navigator];
|
|
232
|
+
$[16] = navigator;
|
|
233
|
+
$[17] = t11;
|
|
234
|
+
$[18] = t12;
|
|
235
|
+
} else {
|
|
236
|
+
t11 = $[17];
|
|
237
|
+
t12 = $[18];
|
|
238
|
+
}
|
|
239
|
+
useEffect(t11, t12);
|
|
240
|
+
let t13;
|
|
241
|
+
if ($[19] !== children || $[20] !== runtime) {
|
|
242
|
+
t13 = /* @__PURE__ */ jsx(NavigationContext, { value: runtime, children });
|
|
243
|
+
$[19] = children;
|
|
244
|
+
$[20] = runtime;
|
|
245
|
+
$[21] = t13;
|
|
246
|
+
} else {
|
|
247
|
+
t13 = $[21];
|
|
248
|
+
}
|
|
249
|
+
return t13;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// src/modules/navigation/module.tsx
|
|
253
|
+
var navigationModule = defineModule({
|
|
254
|
+
id: "navigation",
|
|
255
|
+
context: NavigationContext,
|
|
256
|
+
Provider: NavigationProvider
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
export { INERT_NAVIGATION_ACTIONS, NOOP_NAVIGATION_STORE, NavigationContext, NavigationProvider, navigationModule, watchHistory, watchIntent };
|
|
260
|
+
//# sourceMappingURL=chunk-BCFJSPTI.js.map
|
|
261
|
+
//# sourceMappingURL=chunk-BCFJSPTI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/modules/navigation/listeners.ts","../src/modules/navigation/context.tsx","../src/modules/navigation/module.tsx"],"names":["wantedHref","target","settings","intent","link","internalLinkOf","getAttribute","NAVIGATION_PREFETCH_ATTRIBUTE","href","match","watchIntent","navigator","doc","document","resting","stop","clearTimeout","timer","onOver","event","pointerType","delay","Math","max","delayMs","setTimeout","prefetch","onNow","addEventListener","passive","removeEventListener","classifyPop","to","active","location","isLeavingByHistory","source","NAVIGATION_SOURCE","HISTORY","phase","NAVIGATION_PHASE","LEAVING","isSameLocation","from","isSamePathname","watchHistory","win","window","replaying","onPopState","readWindowLocation","action","store","getSnapshot","cancel","NAVIGATION_REASON","RETURNED","holdsHistory","depart","stopImmediatePropagation","state","replay","dispatchEvent","PopStateEvent","capture","NavigationContext","getOrCreateGlobalContext","noop","NOT_HANDLED","Object","freeze","ok","trip","INERT_NAVIGATION_ACTIONS","arrival","arrive","hold","navigate","Promise","resolve","onIntent","provide","setRouter","NOOP_NAVIGATION_STORE","createStore","createNavigationState","NavigationProvider","t0","$","_c","children","router","useRouter","pathname","usePathname","t1","created","createNavigator","value","actions","runtime","t2","useState","t3","t4","useLayoutEffect","t5","t6","useEffect","t7","t8","t10","t9","getNavigationSettings","t11","t12","dispose","t13","navigationModule","defineModule","id","context","Provider"],"mappings":";;;;;;;;;;AAwBA,SAASA,UAAAA,CACPC,QACAC,QAAAA,EACe;AACf,EAAA,MAAM;AAAEC,IAAAA;AAAO,GAAA,GAAID,QAAAA,EAAS;AAC5B,EAAA,IAAI,CAACC,QAAQ,OAAO,IAAA;AACpB,EAAA,MAAMC,IAAAA,GAAOC,eAAeJ,MAAM,CAAA;AAClC,EAAA,IAAI,CAACG,IAAAA,IAAQA,IAAAA,CAAKE,aAAaC,6BAA6B,CAAA,KAAM,SAChE,OAAO,IAAA;AACT,EAAA,MAAMC,IAAAA,GAAOJ,IAAAA,CAAKE,YAAAA,CAAa,MAAM,CAAA;AACrC,EAAA,OAAOH,MAAAA,CAAOM,KAAAA,CAAMD,IAAI,CAAA,GAAIA,IAAAA,GAAO,IAAA;AACrC;AAOO,SAASE,WAAAA,CACdC,SAAAA,EACAT,QAAAA,EACAU,GAAAA,GAAgBC,QAAAA,EACJ;AACZ,EAAA,IAAIC,OAAAA,GAA8B,IAAA;AAElC,EAAA,MAA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AA,EAAA;AAEhDiB,IAAAA,GAAAA,mBAAA,GAAA,CAAC,iBAAA,EAAA,EAAyBjB,KAAAA,EAAAA,OAAAA,EAAUV,QAAAA,EAAS,CAAA;AAAoBF,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAE,QAAAA;AAAAF,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAAY,OAAAA;AAAAZ,IAAAA,CAAAA,CAAA,EAAA,CAAA,GAAA6B,GAAAA;EAAA,CAAA,MAAA;AAAAA,IAAAA,GAAAA,GAAA7B,EAAA,EAAA,CAAA;AAAA,EAAA;AAAA,EAAA,OAAjE6B,GAAAA;AAAiE;;;ACzEnE,IAAMC,mBAAmBC,YAAAA,CAAa;EAC3CC,EAAAA,EAAI,YAAA;EACJC,OAAAA,EAASxD,iBAAAA;EACTyD,QAAAA,EAAUpC;AACZ,CAAC","file":"chunk-BCFJSPTI.js","sourcesContent":["import {\n NAVIGATION_PHASE,\n NAVIGATION_PREFETCH_ATTRIBUTE,\n NAVIGATION_REASON,\n NAVIGATION_SOURCE,\n} from \"@/core/navigation/constants\";\nimport type {\n NavigationSettings,\n NavigationState,\n Navigator,\n} from \"@/core/navigation/types\";\nimport {\n internalLinkOf,\n isSameLocation,\n isSamePathname,\n readWindowLocation,\n} from \"@/core/navigation/utils\";\n\ninterface RestingLink {\n href: string;\n timer: ReturnType<typeof setTimeout>;\n}\n\n/** The href to prefetch for an event target, or null when it is not wanted. */\nfunction wantedHref(\n target: EventTarget | null,\n settings: () => NavigationSettings,\n): string | null {\n const { intent } = settings();\n if (!intent) return null;\n const link = internalLinkOf(target);\n if (!link || link.getAttribute(NAVIGATION_PREFETCH_ATTRIBUTE) === \"false\")\n return null;\n const href = link.getAttribute(\"href\")!;\n return intent.match(href) ? href : null;\n}\n\n/**\n * Prefetches links the user shows intent for: after the pointer rests on one,\n * or immediately on pointer down and focus. Returns a function that stops\n * watching.\n */\nexport function watchIntent(\n navigator: Pick<Navigator, \"prefetch\">,\n settings: () => NavigationSettings,\n doc: Document = document,\n): () => void {\n let resting: RestingLink | null = null;\n\n const stop = () => {\n if (resting) clearTimeout(resting.timer);\n resting = null;\n };\n\n const onOver = (event: Event) => {\n const { pointerType } = event as PointerEvent;\n if (pointerType && pointerType !== \"mouse\") return;\n const href = wantedHref(event.target, settings);\n if (!href) return stop();\n if (resting?.href === href) return;\n stop();\n const { intent } = settings();\n const delay = intent ? Math.max(0, intent.delayMs) : 0;\n resting = {\n href,\n timer: setTimeout(() => {\n resting = null;\n navigator.prefetch(href);\n }, delay),\n };\n };\n\n const onNow = (event: Event) => {\n const href = wantedHref(event.target, settings);\n if (href) navigator.prefetch(href);\n };\n\n doc.addEventListener(\"pointerover\", onOver, { passive: true });\n doc.addEventListener(\"pointerdown\", onNow, { passive: true });\n doc.addEventListener(\"focusin\", onNow, { passive: true });\n return () => {\n stop();\n doc.removeEventListener(\"pointerover\", onOver);\n doc.removeEventListener(\"pointerdown\", onNow);\n doc.removeEventListener(\"focusin\", onNow);\n };\n}\n\ntype PopAction = \"cancel\" | \"ignore\" | \"depart\";\n\n/**\n * Decides what a browser back/forward move means: returning to where an\n * in-flight history trip started cancels it, a move within the current\n * pathname is ignored, and anything else is a departure.\n */\nfunction classifyPop(\n to: string,\n { active, location }: NavigationState,\n): PopAction {\n const isLeavingByHistory =\n active?.source === NAVIGATION_SOURCE.HISTORY &&\n active.phase === NAVIGATION_PHASE.LEAVING;\n if (isLeavingByHistory) {\n return isSameLocation(to, active.from) ? \"cancel\" : \"depart\";\n }\n return isSamePathname(to, location) ? \"ignore\" : \"depart\";\n}\n\n/**\n * Routes browser back/forward moves through the navigator so holds can block\n * or delay them. Returns a function that stops watching.\n */\nexport function watchHistory(\n navigator: Pick<Navigator, \"cancel\" | \"depart\" | \"holdsHistory\" | \"store\">,\n win: Window = window,\n): () => void {\n let replaying = false;\n\n const onPopState = (event: PopStateEvent) => {\n if (replaying) return;\n const to = readWindowLocation();\n if (!to) return;\n\n const action = classifyPop(to, navigator.store.getSnapshot());\n if (action === \"cancel\") {\n navigator.cancel(NAVIGATION_REASON.RETURNED);\n return;\n }\n if (action === \"ignore\") return;\n\n if (!navigator.holdsHistory()) {\n navigator.depart(to);\n return;\n }\n\n event.stopImmediatePropagation();\n const state = event.state as unknown;\n navigator.depart(to, {\n replay: () => {\n replaying = true;\n try {\n win.dispatchEvent(new PopStateEvent(\"popstate\", { state }));\n } finally {\n replaying = false;\n }\n },\n });\n };\n\n win.addEventListener(\"popstate\", onPopState, { capture: true });\n return () =>\n win.removeEventListener(\"popstate\", onPopState, { capture: true });\n}\n","\"use client\";\n\nimport { usePathname, useRouter } from \"next/navigation\";\nimport { type ReactNode, useEffect, useLayoutEffect, useState } from \"react\";\n\nimport { getOrCreateGlobalContext } from \"@/core/kernel\";\nimport { createNavigator } from \"@/core/navigation/navigator\";\nimport { getNavigationSettings } from \"@/core/navigation/settings\";\nimport { createNavigationState } from \"@/core/navigation/state\";\nimport type {\n NavigationActions,\n NavigationResult,\n NavigationRouter,\n NavigationRuntime,\n NavigationState,\n} from \"@/core/navigation/types\";\nimport { readWindowLocation } from \"@/core/navigation/utils\";\nimport { createStore } from \"@/foundation/utils\";\n\nimport { watchHistory, watchIntent } from \"./listeners\";\n\n/**\n * React context holding the navigator and its store.\n */\nexport const NavigationContext =\n getOrCreateGlobalContext<NavigationRuntime | null>(\"NavigationContext\", null);\n\nconst noop = () => {};\nconst NOT_HANDLED: NavigationResult = Object.freeze({ ok: false, trip: null });\n\n/**\n * Navigation actions that do nothing; used outside a NavigationProvider.\n */\nexport const INERT_NAVIGATION_ACTIONS: NavigationActions = Object.freeze({\n arrival: () => null,\n arrive: noop,\n cancel: () => false,\n depart: () => null,\n hold: () => noop,\n holdsHistory: () => false,\n navigate: () => Promise.resolve(NOT_HANDLED),\n onIntent: () => noop,\n prefetch: () => false,\n provide: () => noop,\n setRouter: noop,\n});\n\nexport const NOOP_NAVIGATION_STORE = createStore<NavigationState>(\n createNavigationState(),\n);\n\ninterface NavigationProviderProps {\n children?: ReactNode;\n}\n\n/**\n * Creates the navigator, wires it to the router and browser history, and\n * provides it to its children.\n */\nexport function NavigationProvider({ children }: NavigationProviderProps) {\n const router: NavigationRouter = useRouter();\n const pathname = usePathname();\n const [{ navigator, runtime }] = useState(() => {\n const created = createNavigator({ router });\n const value: NavigationRuntime = {\n actions: created,\n store: created.store,\n };\n return { navigator: created, runtime: value };\n });\n\n useLayoutEffect(() => {\n navigator.setRouter(router);\n }, [navigator, router]);\n\n useEffect(() => {\n navigator.arrive(readWindowLocation() ?? pathname);\n }, [navigator, pathname]);\n\n useEffect(() => watchHistory(navigator), [navigator]);\n useEffect(() => watchIntent(navigator, getNavigationSettings), [navigator]);\n useEffect(() => () => navigator.dispose(), [navigator]);\n\n return <NavigationContext value={runtime}>{children}</NavigationContext>;\n}\n","\"use client\";\n\nimport { defineModule } from \"@/core/kernel\";\nimport type { NavigationTrip } from \"@/core/navigation/types\";\n\nimport { NavigationContext, NavigationProvider } from \"./context\";\n\n/**\n * Module definition that provides navigation tracking, holds and prefetching.\n */\nexport const navigationModule = defineModule({\n id: \"navigation\",\n context: NavigationContext,\n Provider: NavigationProvider,\n});\n\ninterface NavigationEventPayload {\n from: string;\n source: string;\n timestamp: number;\n to: string;\n trip: NavigationTrip;\n type: string;\n [key: string]: unknown;\n}\n\ndeclare module \"@omerdlw/base-framework/events\" {\n interface FrameworkEventMap {\n NAVIGATION_START: NavigationEventPayload;\n NAVIGATION_COMMIT: NavigationEventPayload;\n NAVIGATION_END: NavigationEventPayload;\n }\n}\n\ndeclare module \"@omerdlw/base-framework/kernel\" {\n interface CoreModules {\n navigation: typeof navigationModule;\n }\n}\n"]}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// src/foundation/utils/object.ts
|
|
2
|
+
function isObject(value) {
|
|
3
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
if (!isObject(value)) return false;
|
|
7
|
+
const proto = Object.getPrototypeOf(value);
|
|
8
|
+
return proto === Object.prototype || proto === null;
|
|
9
|
+
}
|
|
10
|
+
function shallowEqual(a, b) {
|
|
11
|
+
if (Object.is(a, b)) return true;
|
|
12
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const keysA = Object.keys(a);
|
|
16
|
+
const keysB = Object.keys(b);
|
|
17
|
+
if (keysA.length !== keysB.length) return false;
|
|
18
|
+
for (const key of keysA) {
|
|
19
|
+
if (!Object.prototype.hasOwnProperty.call(b, key) || !Object.is(
|
|
20
|
+
a[key],
|
|
21
|
+
b[key]
|
|
22
|
+
)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
function toArray(value) {
|
|
29
|
+
if (value === null || value === void 0) return [];
|
|
30
|
+
return Array.isArray(value) ? value : [value];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// src/foundation/utils/tempo.ts
|
|
34
|
+
var NEUTRAL_TEMPO = 1;
|
|
35
|
+
function defineMotion(tokens) {
|
|
36
|
+
const tempo = tokens.tempo ?? NEUTRAL_TEMPO;
|
|
37
|
+
if (!Number.isFinite(tempo) || tempo <= 0) {
|
|
38
|
+
throw new Error(`Motion tempo must be a positive number, got ${tempo}.`);
|
|
39
|
+
}
|
|
40
|
+
return Object.freeze({
|
|
41
|
+
...tokens,
|
|
42
|
+
tempo,
|
|
43
|
+
reducedMotion: tokens.reducedMotion ?? "user"
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
var TIME_KEYS = [
|
|
47
|
+
"duration",
|
|
48
|
+
"delay",
|
|
49
|
+
"delayChildren",
|
|
50
|
+
"staggerChildren",
|
|
51
|
+
"repeatDelay",
|
|
52
|
+
"visualDuration"
|
|
53
|
+
];
|
|
54
|
+
var INSTANT = Object.freeze({ type: "tween", duration: 0 });
|
|
55
|
+
var stillOf = (clock) => clock.still ?? INSTANT;
|
|
56
|
+
function isSpring(value) {
|
|
57
|
+
return value.type === "spring" || typeof value.stiffness === "number" || typeof value.damping === "number";
|
|
58
|
+
}
|
|
59
|
+
function isTransition(value) {
|
|
60
|
+
return isSpring(value) || TIME_KEYS.some((key) => typeof value[key] === "number");
|
|
61
|
+
}
|
|
62
|
+
function retimeTransition(value, clock) {
|
|
63
|
+
if (clock.reduced) return { ...stillOf(clock) };
|
|
64
|
+
const { tempo } = clock;
|
|
65
|
+
const next = {};
|
|
66
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
67
|
+
next[key] = isPlainObject(entry) ? retimeNode(entry, clock) : entry;
|
|
68
|
+
}
|
|
69
|
+
for (const key of TIME_KEYS) {
|
|
70
|
+
if (typeof value[key] === "number") next[key] = value[key] * tempo;
|
|
71
|
+
}
|
|
72
|
+
if (typeof value.stiffness === "number") {
|
|
73
|
+
next.stiffness = value.stiffness / (tempo * tempo);
|
|
74
|
+
}
|
|
75
|
+
if (typeof value.damping === "number") next.damping = value.damping / tempo;
|
|
76
|
+
return next;
|
|
77
|
+
}
|
|
78
|
+
function retimeNode(value, clock) {
|
|
79
|
+
if (typeof value === "function") {
|
|
80
|
+
const fn = value;
|
|
81
|
+
return (...args) => retimeNode(fn(...args), clock);
|
|
82
|
+
}
|
|
83
|
+
if (!isPlainObject(value)) return value;
|
|
84
|
+
if (isTransition(value)) return retimeTransition(value, clock);
|
|
85
|
+
const next = {};
|
|
86
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
87
|
+
next[key] = retimeNode(entry, clock);
|
|
88
|
+
}
|
|
89
|
+
return next;
|
|
90
|
+
}
|
|
91
|
+
function retime(value, clock) {
|
|
92
|
+
if (clock.tempo === NEUTRAL_TEMPO && !clock.reduced) return value;
|
|
93
|
+
return retimeNode(value, clock);
|
|
94
|
+
}
|
|
95
|
+
function retimeSeconds(value, clock) {
|
|
96
|
+
if (typeof value === "number") {
|
|
97
|
+
return clock.reduced ? Math.min(value, Number(stillOf(clock).duration) || 0) : value * clock.tempo;
|
|
98
|
+
}
|
|
99
|
+
if (!isPlainObject(value)) return value;
|
|
100
|
+
const next = {};
|
|
101
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
102
|
+
next[key] = retimeSeconds(entry, clock);
|
|
103
|
+
}
|
|
104
|
+
return next;
|
|
105
|
+
}
|
|
106
|
+
function retimeModuleMotion(motion, clock) {
|
|
107
|
+
if (clock.tempo === NEUTRAL_TEMPO && !clock.reduced) return motion;
|
|
108
|
+
if (!isPlainObject(motion)) return retime(motion, clock);
|
|
109
|
+
const next = {};
|
|
110
|
+
for (const [key, entry] of Object.entries(motion)) {
|
|
111
|
+
next[key] = key === "timings" ? retimeSeconds(entry, clock) : retimeNode(entry, clock);
|
|
112
|
+
}
|
|
113
|
+
return next;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export { NEUTRAL_TEMPO, defineMotion, isObject, isPlainObject, retime, retimeModuleMotion, shallowEqual, toArray };
|
|
117
|
+
//# sourceMappingURL=chunk-BMFHS3GV.js.map
|
|
118
|
+
//# sourceMappingURL=chunk-BMFHS3GV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/foundation/utils/object.ts","../src/foundation/utils/tempo.ts"],"names":[],"mappings":";AAGO,SAAS,SAAS,KAAA,EAAkD;AACzE,EAAA,OAAO,OAAA,CAAQ,KAAK,CAAA,IAAK,OAAO,UAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA;AAC5E;AAKO,SAAS,cACd,KAAA,EACkC;AAClC,EAAA,IAAI,CAAC,QAAA,CAAS,KAAK,CAAA,EAAG,OAAO,KAAA;AAC7B,EAAA,MAAM,KAAA,GAAiB,MAAA,CAAO,cAAA,CAAe,KAAK,CAAA;AAClD,EAAA,OAAO,KAAA,KAAU,MAAA,CAAO,SAAA,IAAa,KAAA,KAAU,IAAA;AACjD;AAKO,SAA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UAAA,CAAW,OAAO,KAAK,CAAA;AAChC;AAEA,SAAS,aAAA,CAAc,OAAgB,KAAA,EAA6B;AAClE,EAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,IAAA,OAAO,KAAA,CAAM,OAAA,GACT,IAAA,CAAK,GAAA,CAAI,OAAO,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,CAAE,QAAQ,CAAA,IAAK,CAAC,CAAA,GACpD,QAAQ,KAAA,CAAM,KAAA;AAAA,EACpB;AACA,EAAA,IAAI,CAAC,aAAA,CAAc,KAAK,CAAA,EAAG,OAAO,KAAA;AAClC,EAAA,MAAM,OAAc,EAAC;AACrB,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,IAAA,IAAA,CAAK,GAAG,CAAA,GAAI,aAAA,CAAc,KAAA,EAAO,KAAK,CAAA;AAAA,EACxC;AACA,EAAA,OAAO,IAAA;AACT;AAMO,SAAS,kBAAA,CAAsB,QAAW,KAAA,EAAuB;AACtE,EAAA,IAAI,MAAM,KAAA,KAAU,aAAA,IAAiB,CAAC,KAAA,CAAM,SAAS,OAAO,MAAA;AAC5D,EAAA,IAAI,CAAC,aAAA,CAAc,MAAM,GAAG,OAAO,MAAA,CAAO,QAAQ,KAAK,CAAA;AACvD,EAAA,MAAM,OAAc,EAAC;AACrB,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,EAAG;AACjD,IAAA,IAAA,CAAK,GAAG,CAAA,GACN,GAAA,KAAQ,SAAA,GACJ,aAAA,CAAc,OAAO,KAAK,CAAA,GAC1B,UAAA,CAAW,KAAA,EAAO,KAAK,CAAA;AAAA,EAC/B;AACA,EAAA,OAAO,IAAA;AACT","file":"chunk-BMFHS3GV.js","sourcesContent":["/**\n * True for non-null, non-array objects.\n */\nexport function isObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\n/**\n * True for objects created by `{}` or `Object.create(null)`.\n */\nexport function isPlainObject(\n value: unknown,\n): value is Record<string, unknown> {\n if (!isObject(value)) return false;\n const proto: unknown = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Compares two values by identity, then by their own enumerable keys.\n */\nexport function shallowEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n if (\n typeof a !== \"object\" ||\n a === null ||\n typeof b !== \"object\" ||\n b === null\n ) {\n return false;\n }\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (\n !Object.prototype.hasOwnProperty.call(b, key) ||\n !Object.is(\n (a as Record<string, unknown>)[key],\n (b as Record<string, unknown>)[key],\n )\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Wraps a single value in an array; nullish input gives an empty array.\n */\nexport function toArray<T>(value: T | T[] | null | undefined): T[] {\n if (value === null || value === undefined) return [];\n return Array.isArray(value) ? value : [value];\n}\n","import { isPlainObject } from \"./object\";\n\n/**\n * A cubic-bezier easing as four control values.\n */\nexport type MotionEase = readonly [number, number, number, number];\n\n/**\n * How reduced-motion preference is applied: follow the user, always, or never.\n */\nexport type ReducedMotionPolicy = \"user\" | \"always\" | \"never\";\n\n/**\n * Spring transition settings.\n */\nexport interface MotionSpring {\n readonly type?: \"spring\";\n readonly stiffness?: number;\n readonly damping?: number;\n readonly mass?: number;\n readonly bounce?: number;\n readonly visualDuration?: number;\n}\n\n/**\n * Motion tokens as written by the app: tempo, policy, durations, easings and springs.\n */\nexport interface MotionTokensInput {\n readonly tempo?: number;\n readonly reducedMotion?: ReducedMotionPolicy;\n readonly durations?: Readonly<Record<string, number>>;\n readonly easings?: Readonly<Record<string, MotionEase>>;\n readonly springs?: Readonly<Record<string, MotionSpring>>;\n readonly still?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * Motion tokens with `tempo` and `reducedMotion` resolved to concrete values.\n */\nexport type MotionTokens<T extends MotionTokensInput = MotionTokensInput> =\n Readonly<\n Omit<T, \"tempo\" | \"reducedMotion\"> & {\n tempo: number;\n reducedMotion: ReducedMotionPolicy;\n }\n >;\n\nexport const NEUTRAL_TEMPO = 1;\n\n/**\n * Validates and freezes motion tokens, applying defaults for tempo and policy.\n */\nexport function defineMotion<T extends MotionTokensInput>(\n tokens: T,\n): MotionTokens<T> {\n const tempo = tokens.tempo ?? NEUTRAL_TEMPO;\n if (!Number.isFinite(tempo) || tempo <= 0) {\n throw new Error(`Motion tempo must be a positive number, got ${tempo}.`);\n }\n return Object.freeze({\n ...tokens,\n tempo,\n reducedMotion: tokens.reducedMotion ?? \"user\",\n });\n}\n\n/**\n * The tempo and reduced-motion state used to retime transitions.\n */\nexport interface MotionClock {\n readonly tempo: number;\n readonly reduced: boolean;\n readonly still?: Readonly<Record<string, unknown>>;\n}\n\nconst TIME_KEYS = [\n \"duration\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"repeatDelay\",\n \"visualDuration\",\n] as const;\n\nconst INSTANT = Object.freeze({ type: \"tween\" as const, duration: 0 });\n\nconst stillOf = (clock: MotionClock): Record<string, unknown> =>\n clock.still ?? INSTANT;\n\ntype Plain = Record<string, unknown>;\n\nfunction isSpring(value: Plain): boolean {\n return (\n value.type === \"spring\" ||\n typeof value.stiffness === \"number\" ||\n typeof value.damping === \"number\"\n );\n}\n\nfunction isTransition(value: Plain): boolean {\n return (\n isSpring(value) || TIME_KEYS.some((key) => typeof value[key] === \"number\")\n );\n}\n\nfunction retimeTransition(value: Plain, clock: MotionClock): Plain {\n if (clock.reduced) return { ...stillOf(clock) };\n const { tempo } = clock;\n const next: Plain = {};\n for (const [key, entry] of Object.entries(value)) {\n next[key] = isPlainObject(entry) ? retimeNode(entry, clock) : entry;\n }\n // Durations scale with tempo. Spring stiffness and damping are scaled so the\n // spring's timing follows tempo while its damping ratio stays the same.\n for (const key of TIME_KEYS) {\n if (typeof value[key] === \"number\") next[key] = value[key] * tempo;\n }\n if (typeof value.stiffness === \"number\") {\n next.stiffness = value.stiffness / (tempo * tempo);\n }\n if (typeof value.damping === \"number\") next.damping = value.damping / tempo;\n return next;\n}\n\nfunction retimeNode(value: unknown, clock: MotionClock): unknown {\n if (typeof value === \"function\") {\n const fn = value as (...args: unknown[]) => unknown;\n return (...args: unknown[]) => retimeNode(fn(...args), clock);\n }\n if (!isPlainObject(value)) return value;\n if (isTransition(value)) return retimeTransition(value, clock);\n const next: Plain = {};\n for (const [key, entry] of Object.entries(value)) {\n next[key] = retimeNode(entry, clock);\n }\n return next;\n}\n\n/**\n * Scales every transition inside a value by the clock's tempo, or replaces\n * them with the still transition when motion is reduced.\n */\nexport function retime<T>(value: T, clock: MotionClock): T {\n if (clock.tempo === NEUTRAL_TEMPO && !clock.reduced) return value;\n return retimeNode(value, clock) as T;\n}\n\nfunction retimeSeconds(value: unknown, clock: MotionClock): unknown {\n if (typeof value === \"number\") {\n return clock.reduced\n ? Math.min(value, Number(stillOf(clock).duration) || 0)\n : value * clock.tempo;\n }\n if (!isPlainObject(value)) return value;\n const next: Plain = {};\n for (const [key, entry] of Object.entries(value)) {\n next[key] = retimeSeconds(entry, clock);\n }\n return next;\n}\n\n/**\n * Like `retime`, for a module motion object whose `timings` entry is in\n * plain seconds.\n */\nexport function retimeModuleMotion<M>(motion: M, clock: MotionClock): M {\n if (clock.tempo === NEUTRAL_TEMPO && !clock.reduced) return motion;\n if (!isPlainObject(motion)) return retime(motion, clock);\n const next: Plain = {};\n for (const [key, entry] of Object.entries(motion)) {\n next[key] =\n key === \"timings\"\n ? retimeSeconds(entry, clock)\n : retimeNode(entry, clock);\n }\n return next as M;\n}\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// src/foundation/utils/user-message.ts
|
|
2
|
+
var USER_MESSAGES = Object.freeze({
|
|
3
|
+
generic: "Something went wrong. Please try again",
|
|
4
|
+
network: "You appear to be offline. Check your connection and try again",
|
|
5
|
+
timeout: "That took too long. Please try again",
|
|
6
|
+
unauthorized: "Your session has expired. Please sign in again",
|
|
7
|
+
forbidden: "You don't have permission to do that",
|
|
8
|
+
notFound: "We couldn't find what you were looking for",
|
|
9
|
+
rateLimited: "Too many attempts. Please wait a moment and try again",
|
|
10
|
+
server: "We're having trouble on our end. Please try again in a moment"
|
|
11
|
+
});
|
|
12
|
+
var UserError = class extends Error {
|
|
13
|
+
status;
|
|
14
|
+
constructor(message, status) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = "UserError";
|
|
17
|
+
this.status = status;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var NETWORK_FAILURE = /failed to fetch|network|load failed|fetch failed/i;
|
|
21
|
+
var STATUS_UNAUTHORIZED = 401;
|
|
22
|
+
var STATUS_FORBIDDEN = 403;
|
|
23
|
+
var STATUS_NOT_FOUND = 404;
|
|
24
|
+
var STATUS_REQUEST_TIMEOUT = 408;
|
|
25
|
+
var STATUS_RATE_LIMITED = 429;
|
|
26
|
+
var STATUS_GATEWAY_TIMEOUT = 504;
|
|
27
|
+
var STATUS_CLIENT_ERROR_MIN = 400;
|
|
28
|
+
var STATUS_SERVER_ERROR_MIN = 500;
|
|
29
|
+
function readField(source, field, type) {
|
|
30
|
+
const value = source?.[field];
|
|
31
|
+
return typeof value === type ? value : void 0;
|
|
32
|
+
}
|
|
33
|
+
function readPayloadMessage(error) {
|
|
34
|
+
const payload = error?.payload;
|
|
35
|
+
const message = readField(payload, "error", "string")?.trim();
|
|
36
|
+
return message || void 0;
|
|
37
|
+
}
|
|
38
|
+
function messageForStatus(status, error, fallback) {
|
|
39
|
+
if (status === void 0) return void 0;
|
|
40
|
+
if (status === STATUS_UNAUTHORIZED) return USER_MESSAGES.unauthorized;
|
|
41
|
+
if (status === STATUS_RATE_LIMITED) return USER_MESSAGES.rateLimited;
|
|
42
|
+
if (status === STATUS_REQUEST_TIMEOUT || status === STATUS_GATEWAY_TIMEOUT) {
|
|
43
|
+
return USER_MESSAGES.timeout;
|
|
44
|
+
}
|
|
45
|
+
if (status >= STATUS_SERVER_ERROR_MIN) return USER_MESSAGES.server;
|
|
46
|
+
if (!(status >= STATUS_CLIENT_ERROR_MIN)) return void 0;
|
|
47
|
+
const authored = readPayloadMessage(error);
|
|
48
|
+
if (authored) return authored;
|
|
49
|
+
if (status === STATUS_FORBIDDEN) return USER_MESSAGES.forbidden;
|
|
50
|
+
if (status === STATUS_NOT_FOUND) return USER_MESSAGES.notFound;
|
|
51
|
+
return fallback;
|
|
52
|
+
}
|
|
53
|
+
function isNetworkFailure(error) {
|
|
54
|
+
const isOffline = typeof navigator !== "undefined" && navigator.onLine === false;
|
|
55
|
+
if (isOffline) return true;
|
|
56
|
+
return NETWORK_FAILURE.test(error.message ?? "") && (error instanceof TypeError || /fetch/i.test(error.name));
|
|
57
|
+
}
|
|
58
|
+
function toUserMessage(error, { codes, fallback = USER_MESSAGES.generic } = {}) {
|
|
59
|
+
if (typeof error === "string") return error.trim() || fallback;
|
|
60
|
+
if (!error || typeof error !== "object") return fallback;
|
|
61
|
+
if (error instanceof UserError) {
|
|
62
|
+
if (error.status === STATUS_UNAUTHORIZED) {
|
|
63
|
+
return USER_MESSAGES.unauthorized;
|
|
64
|
+
}
|
|
65
|
+
return error.message || fallback;
|
|
66
|
+
}
|
|
67
|
+
if (error.name === "AbortError") return fallback;
|
|
68
|
+
const code = readField(error, "code", "string");
|
|
69
|
+
if (code && codes?.[code]) return codes[code];
|
|
70
|
+
const fromStatus = messageForStatus(
|
|
71
|
+
readField(error, "status", "number"),
|
|
72
|
+
error,
|
|
73
|
+
fallback
|
|
74
|
+
);
|
|
75
|
+
if (fromStatus !== void 0) return fromStatus;
|
|
76
|
+
return isNetworkFailure(error) ? USER_MESSAGES.network : fallback;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { USER_MESSAGES, UserError, toUserMessage };
|
|
80
|
+
//# source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,aAAA,CACd,OACA,EAAE,KAAA,EAAO,WAAW,aAAA,CAAc,OAAA,EAAQ,GAAwB,EAAC,EAC3D;AACR,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,EAAU,OAAO,KAAA,CAAM,MAAK,IAAK,QAAA;AACtD,EAAA,IAAI,CAAC,KAAA,IAAS,OAAO,KAAA,KAAU,UAAU,OAAO,QAAA;AAEhD,EAAA,IAAI,iBAAiB,SAAA,EAAW;AAC9B,IAAA,IAAI,KAAA,CAAM,WAAW,mBAAA,EAAqB;AACxC,MAAA,OAAO,aAAA,CAAc,YAAA;AAAA,IACvB;AACA,IAAA,OAAO,MAAM,OAAA,IAAW,QAAA;AAAA,EAC1B;AACA,EAAA,IAAK,KAAA,CAA4B,IAAA,KAAS,YAAA,EAAc,OAAO,QAAA;AAE/D,EAAA,MAAM,IAAA,GAAO,SAAA,CAAkB,KAAA,EAAO,MAAA,EAAQ,QAAQ,CAAA;AACtD,EAAA,IAAI,QAAQ,KAAA,GAAQ,IAAI,CAAA,EAAG,OAAO,MAAM,IAAI,CAAA;AAE5C,EAAA,MAAM,UAAA,GAAa,gBAAA;AAAA,IACjB,SAAA,CAAkB,KAAA,EAAO,QAAA,EAAU,QAAQ,CAAA;AAAA,IAC3C,KAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,IAAI,UAAA,KAAe,QAAW,OAAO,UAAA;AAErC,EAAA,OAAO,gBAAA,CAAiB,KAAK,CAAA,GAAI,aAAA,CAAc,OAAA,GAAU,QAAA;AAC3D","file":"chunk-CRKJAACG.js","sourcesContent":["/**\n * Default user-facing messages for common failure kinds.\n */\nexport const USER_MESSAGES = Object.freeze({\n generic: \"Something went wrong. Please try again\",\n network: \"You appear to be offline. Check your connection and try again\",\n timeout: \"That took too long. Please try again\",\n unauthorized: \"Your session has expired. Please sign in again\",\n forbidden: \"You don't have permission to do that\",\n notFound: \"We couldn't find what you were looking for\",\n rateLimited: \"Too many attempts. Please wait a moment and try again\",\n server: \"We're having trouble on our end. Please try again in a moment\",\n} as const);\n\n/**\n * An error whose message is safe to show to the user as-is.\n */\nexport class UserError extends Error {\n readonly status?: number;\n\n constructor(message: string, status?: number) {\n super(message);\n this.name = \"UserError\";\n this.status = status;\n }\n}\n\n/**\n * Options for `toUserMessage`: a fallback text and per-code messages.\n */\nexport interface UserMessageOptions {\n fallback?: string;\n codes?: Readonly<Record<string, string>>;\n}\n\nconst NETWORK_FAILURE = /failed to fetch|network|load failed|fetch failed/i;\n\nconst STATUS_UNAUTHORIZED = 401;\nconst STATUS_FORBIDDEN = 403;\nconst STATUS_NOT_FOUND = 404;\nconst STATUS_REQUEST_TIMEOUT = 408;\nconst STATUS_RATE_LIMITED = 429;\nconst STATUS_GATEWAY_TIMEOUT = 504;\nconst STATUS_CLIENT_ERROR_MIN = 400;\nconst STATUS_SERVER_ERROR_MIN = 500;\n\nfunction readField<T>(\n source: unknown,\n field: string,\n type: \"string\" | \"number\",\n): T | undefined {\n const value = (source as Record<string, unknown> | null)?.[field];\n return typeof value === type ? (value as T) : undefined;\n}\n\nfunction readPayloadMessage(error: unknown): string | undefined {\n const payload = (error as { payload?: unknown } | null)?.payload;\n const message = readField<string>(payload, \"error\", \"string\")?.trim();\n return message || undefined;\n}\n\nfunction messageForStatus(\n status: number | undefined,\n error: unknown,\n fallback: string,\n): string | undefined {\n if (status === undefined) return undefined;\n if (status === STATUS_UNAUTHORIZED) return USER_MESSAGES.unauthorized;\n if (status === STATUS_RATE_LIMITED) return USER_MESSAGES.rateLimited;\n if (status === STATUS_REQUEST_TIMEOUT || status === STATUS_GATEWAY_TIMEOUT) {\n return USER_MESSAGES.timeout;\n }\n if (status >= STATUS_SERVER_ERROR_MIN) return USER_MESSAGES.server;\n // Written as a negation so a NaN status is not treated as an HTTP error.\n if (!(status >= STATUS_CLIENT_ERROR_MIN)) return undefined;\n\n const authored = readPayloadMessage(error);\n if (authored) return authored;\n if (status === STATUS_FORBIDDEN) return USER_MESSAGES.forbidden;\n if (status === STATUS_NOT_FOUND) return USER_MESSAGES.notFound;\n return fallback;\n}\n\nfunction isNetworkFailure(error: unknown): boolean {\n const isOffline =\n typeof navigator !== \"undefined\" && navigator.onLine === false;\n if (isOffline) return true;\n return (\n NETWORK_FAILURE.test((error as Error).message ?? \"\") &&\n (error instanceof TypeError || /fetch/i.test((error as Error).name))\n );\n}\n\n/**\n * Turns any thrown value into a message that is safe to show to a user.\n */\nexport function toUserMessage(\n error: unknown,\n { codes, fallback = USER_MESSAGES.generic }: UserMessageOptions = {},\n): string {\n if (typeof error === \"string\") return error.trim() || fallback;\n if (!error || typeof error !== \"object\") return fallback;\n\n if (error instanceof UserError) {\n if (error.status === STATUS_UNAUTHORIZED) {\n return USER_MESSAGES.unauthorized;\n }\n return error.message || fallback;\n }\n if ((error as { name?: string }).name === \"AbortError\") return fallback;\n\n const code = readField<string>(error, \"code\", \"string\");\n if (code && codes?.[code]) return codes[code];\n\n const fromStatus = messageForStatus(\n readField<number>(error, \"status\", \"number\"),\n error,\n fallback,\n );\n if (fromStatus !== undefined) return fromStatus;\n\n return isNetworkFailure(error) ? USER_MESSAGES.network : fallback;\n}\n"]}
|