@omerdlw/base-framework 3.1.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-26K6W4OQ.js +1435 -0
- package/dist/chunk-26K6W4OQ.js.map +1 -0
- package/dist/chunk-2BLGNT5I.js +850 -0
- package/dist/chunk-2BLGNT5I.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-5GVH4BQV.js +577 -0
- package/dist/chunk-5GVH4BQV.js.map +1 -0
- package/dist/chunk-5H6FZW3N.js +535 -0
- package/dist/chunk-5H6FZW3N.js.map +1 -0
- package/dist/chunk-66MHDFNF.js +3488 -0
- package/dist/chunk-66MHDFNF.js.map +1 -0
- package/dist/chunk-7RSRDKYE.js +22 -0
- package/dist/chunk-7RSRDKYE.js.map +1 -0
- package/dist/chunk-AAT3QWHN.js +567 -0
- package/dist/chunk-AAT3QWHN.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-GQKGOLHJ.js +1766 -0
- package/dist/chunk-GQKGOLHJ.js.map +1 -0
- package/dist/chunk-IR3DCLBM.js +17 -0
- package/dist/chunk-IR3DCLBM.js.map +1 -0
- package/dist/chunk-J3VTDBC6.js +14 -0
- package/dist/chunk-J3VTDBC6.js.map +1 -0
- package/dist/chunk-J4WUCHNR.js +825 -0
- package/dist/chunk-J4WUCHNR.js.map +1 -0
- package/dist/chunk-KMN6J5SL.js +493 -0
- package/dist/chunk-KMN6J5SL.js.map +1 -0
- package/dist/chunk-LA3CQ6NY.js +261 -0
- package/dist/chunk-LA3CQ6NY.js.map +1 -0
- package/dist/chunk-LTO77WSO.js +140 -0
- package/dist/chunk-LTO77WSO.js.map +1 -0
- package/dist/chunk-NTUQYA73.js +110 -0
- package/dist/chunk-NTUQYA73.js.map +1 -0
- package/dist/chunk-OEXWOZPS.js +139 -0
- package/dist/chunk-OEXWOZPS.js.map +1 -0
- package/dist/chunk-PUD4IB3L.js +15762 -0
- package/dist/chunk-PUD4IB3L.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-WBBM67WL.js +460 -0
- package/dist/chunk-WBBM67WL.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-ZE6OGGA7.js +2341 -0
- package/dist/chunk-ZE6OGGA7.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-YC336DAS.js +13 -0
- package/dist/overlay-YC336DAS.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 +134 -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,2341 @@
|
|
|
1
|
+
import { useStore, useRequiredContext } from './chunk-Y2Q74PJP.js';
|
|
2
|
+
import { createStore, report, trimToNull } from './chunk-5H6FZW3N.js';
|
|
3
|
+
import { getOrCreateGlobalContext } from './chunk-J3VTDBC6.js';
|
|
4
|
+
import { isObject, shallowEqual, isPlainObject } from './chunk-BMFHS3GV.js';
|
|
5
|
+
import { c } from 'react/compiler-runtime';
|
|
6
|
+
import { useState, useSyncExternalStore, use, useId, useRef, useLayoutEffect, useEffect, createElement, Fragment, useMemo, isValidElement, cloneElement, Children } from 'react';
|
|
7
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
8
|
+
import { usePathname } from 'next/navigation';
|
|
9
|
+
|
|
10
|
+
// src/core/kernel/constants.ts
|
|
11
|
+
var DEFAULT_SOURCE = "dynamic";
|
|
12
|
+
var REGISTRY_SOURCES = Object.freeze({
|
|
13
|
+
STATIC: "static",
|
|
14
|
+
DYNAMIC: "dynamic",
|
|
15
|
+
USER: "user"
|
|
16
|
+
});
|
|
17
|
+
var REGISTRY_LIFECYCLES = Object.freeze({
|
|
18
|
+
IMMEDIATE: "immediate",
|
|
19
|
+
GRACEFUL: "graceful",
|
|
20
|
+
PERSISTENT: "persistent",
|
|
21
|
+
ROUTE: "route"
|
|
22
|
+
});
|
|
23
|
+
var REGISTRY_VALIDATION_MODES = Object.freeze({
|
|
24
|
+
WARN: "warn",
|
|
25
|
+
STRICT: "strict"
|
|
26
|
+
});
|
|
27
|
+
var REGISTRY_METADATA_KEYS = Object.freeze(["cleanup", "cleanupDelayMs", "instanceId", "lifecycle", "priority", "source", "scope", "validation"]);
|
|
28
|
+
var REGISTRY_SOURCE_PRIORITY = Object.freeze({
|
|
29
|
+
[REGISTRY_SOURCES.STATIC]: 100,
|
|
30
|
+
[REGISTRY_SOURCES.DYNAMIC]: 200,
|
|
31
|
+
[REGISTRY_SOURCES.USER]: 300
|
|
32
|
+
});
|
|
33
|
+
var REGISTRY_SOURCE_RANK = Object.freeze({
|
|
34
|
+
[REGISTRY_SOURCES.STATIC]: 10,
|
|
35
|
+
[REGISTRY_SOURCES.DYNAMIC]: 20,
|
|
36
|
+
[REGISTRY_SOURCES.USER]: 30
|
|
37
|
+
});
|
|
38
|
+
var REGISTRY_LIFECYCLE_VALUES = new Set(Object.values(REGISTRY_LIFECYCLES));
|
|
39
|
+
var REGISTRY_METADATA_KEY_SET = new Set(REGISTRY_METADATA_KEYS);
|
|
40
|
+
var REGISTRY_SCOPE_KINDS = Object.freeze({
|
|
41
|
+
APP: "app",
|
|
42
|
+
SESSION: "session",
|
|
43
|
+
ROUTE: "route",
|
|
44
|
+
INSTANCE: "instance",
|
|
45
|
+
WORKSPACE: "workspace"
|
|
46
|
+
});
|
|
47
|
+
var DEFAULT_REGISTRY_SCOPE = REGISTRY_SCOPE_KINDS.APP;
|
|
48
|
+
|
|
49
|
+
// src/core/kernel/utils.ts
|
|
50
|
+
function hasOwnProperty(target, key) {
|
|
51
|
+
return Object.prototype.hasOwnProperty.call(target, key);
|
|
52
|
+
}
|
|
53
|
+
function parseFiniteNumber(value) {
|
|
54
|
+
const parsed = Number(value);
|
|
55
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
56
|
+
}
|
|
57
|
+
function getValidString(value, fallback = null) {
|
|
58
|
+
return trimToNull(value) ?? fallback;
|
|
59
|
+
}
|
|
60
|
+
function resolveInstanceId(value) {
|
|
61
|
+
return isObject(value) && typeof value.instanceId === "string" ? value.instanceId : null;
|
|
62
|
+
}
|
|
63
|
+
function getSourceRank(source) {
|
|
64
|
+
return REGISTRY_SOURCE_RANK[source] ?? 0;
|
|
65
|
+
}
|
|
66
|
+
function resolveRegisterInput(sourceOrOptions, optionsArg) {
|
|
67
|
+
if (typeof sourceOrOptions === "string") {
|
|
68
|
+
return {
|
|
69
|
+
source: sourceOrOptions,
|
|
70
|
+
options: isObject(optionsArg) ? optionsArg : {}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (isObject(sourceOrOptions)) {
|
|
74
|
+
return {
|
|
75
|
+
source: typeof sourceOrOptions.source === "string" ? sourceOrOptions.source : DEFAULT_SOURCE,
|
|
76
|
+
options: sourceOrOptions
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
source: DEFAULT_SOURCE,
|
|
81
|
+
options: isObject(optionsArg) ? optionsArg : {}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function resolveScope(options) {
|
|
85
|
+
return typeof options?.scope === "string" && options.scope.trim() ? options.scope.trim() : DEFAULT_REGISTRY_SCOPE;
|
|
86
|
+
}
|
|
87
|
+
function resolveUnregisterInput(sourceOrOptions) {
|
|
88
|
+
if (typeof sourceOrOptions === "string") {
|
|
89
|
+
return {
|
|
90
|
+
instanceId: null,
|
|
91
|
+
scope: null,
|
|
92
|
+
source: sourceOrOptions
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (isObject(sourceOrOptions)) {
|
|
96
|
+
return {
|
|
97
|
+
instanceId: resolveInstanceId(sourceOrOptions),
|
|
98
|
+
scope: typeof sourceOrOptions.scope === "string" && sourceOrOptions.scope.trim() ? sourceOrOptions.scope.trim() : null,
|
|
99
|
+
source: typeof sourceOrOptions.source === "string" ? sourceOrOptions.source : DEFAULT_SOURCE
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
instanceId: null,
|
|
104
|
+
scope: null,
|
|
105
|
+
source: DEFAULT_SOURCE
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function mergeModuleConfigs(base, patch) {
|
|
109
|
+
const source = base;
|
|
110
|
+
const changes = patch;
|
|
111
|
+
const result = {
|
|
112
|
+
...source
|
|
113
|
+
};
|
|
114
|
+
Object.keys(changes).forEach((key) => {
|
|
115
|
+
const baseVal = source[key];
|
|
116
|
+
const patchVal = changes[key];
|
|
117
|
+
if (baseVal && typeof baseVal === "object" && !Array.isArray(baseVal) && patchVal && typeof patchVal === "object" && !Array.isArray(patchVal)) {
|
|
118
|
+
result[key] = {
|
|
119
|
+
...baseVal,
|
|
120
|
+
...patchVal
|
|
121
|
+
};
|
|
122
|
+
} else {
|
|
123
|
+
result[key] = patchVal;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// src/core/kernel/operations-records.ts
|
|
130
|
+
function createInitialRegistriesFor(definitions) {
|
|
131
|
+
return Object.fromEntries(Array.from(definitions.keys(), (type) => [type, {}]));
|
|
132
|
+
}
|
|
133
|
+
function buildSourceRecord({
|
|
134
|
+
source,
|
|
135
|
+
value,
|
|
136
|
+
instanceId = null,
|
|
137
|
+
priority,
|
|
138
|
+
timestamp,
|
|
139
|
+
sequence,
|
|
140
|
+
scope = DEFAULT_REGISTRY_SCOPE
|
|
141
|
+
}) {
|
|
142
|
+
return {
|
|
143
|
+
updatedAt: timestamp,
|
|
144
|
+
sequence: Number.isFinite(sequence) ? sequence : timestamp,
|
|
145
|
+
instanceId: typeof instanceId === "string" ? instanceId : null,
|
|
146
|
+
priority,
|
|
147
|
+
value,
|
|
148
|
+
source,
|
|
149
|
+
scope
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function createRecordKey(source, instanceId = null, scope = DEFAULT_REGISTRY_SCOPE) {
|
|
153
|
+
if (scope === DEFAULT_REGISTRY_SCOPE) {
|
|
154
|
+
if (typeof instanceId === "string" && instanceId.length > 0) {
|
|
155
|
+
return `instance:${JSON.stringify([source, instanceId])}`;
|
|
156
|
+
}
|
|
157
|
+
return `source:${JSON.stringify(source)}`;
|
|
158
|
+
}
|
|
159
|
+
if (typeof instanceId === "string" && instanceId.length > 0) {
|
|
160
|
+
return `instance:${JSON.stringify([scope, source, instanceId])}`;
|
|
161
|
+
}
|
|
162
|
+
return `source:${JSON.stringify([scope, source])}`;
|
|
163
|
+
}
|
|
164
|
+
function getSourceRecords(entry, source, scope = null) {
|
|
165
|
+
if (!entry) return [];
|
|
166
|
+
return Object.entries(entry).map(([recordKey, rawRecord]) => ({
|
|
167
|
+
recordKey,
|
|
168
|
+
record: toSourceRecord(rawRecord, recordKey)
|
|
169
|
+
})).filter(({
|
|
170
|
+
record
|
|
171
|
+
}) => record?.source === source && (scope === null || record.scope === scope));
|
|
172
|
+
}
|
|
173
|
+
function getSourceRecord(entry, source, instanceId = null, scope = DEFAULT_REGISTRY_SCOPE) {
|
|
174
|
+
const recordKey = createRecordKey(source, instanceId, scope);
|
|
175
|
+
return toSourceRecord(entry?.[recordKey], source);
|
|
176
|
+
}
|
|
177
|
+
function resolveRecordPriority(options, source) {
|
|
178
|
+
if (isObject(options) && hasOwnProperty(options, "priority")) {
|
|
179
|
+
const parsedPriority = Number(options.priority);
|
|
180
|
+
if (Number.isFinite(parsedPriority)) return parsedPriority;
|
|
181
|
+
}
|
|
182
|
+
return REGISTRY_SOURCE_PRIORITY[source] ?? 0;
|
|
183
|
+
}
|
|
184
|
+
function toSourceRecord(rawValue, source = DEFAULT_SOURCE) {
|
|
185
|
+
if (rawValue === void 0) return null;
|
|
186
|
+
const rawRecord = rawValue;
|
|
187
|
+
const isWrappedRecord = isObject(rawValue) && hasOwnProperty(rawRecord, "value") && hasOwnProperty(rawRecord, "updatedAt") && hasOwnProperty(rawRecord, "priority") && hasOwnProperty(rawRecord, "source");
|
|
188
|
+
if (isWrappedRecord) {
|
|
189
|
+
const parsedPriority = Number(rawRecord.priority);
|
|
190
|
+
return {
|
|
191
|
+
updatedAt: Number(rawRecord.updatedAt) || 0,
|
|
192
|
+
sequence: Number(rawRecord.sequence) || Number(rawRecord.updatedAt) || 0,
|
|
193
|
+
instanceId: typeof rawRecord.instanceId === "string" ? rawRecord.instanceId : null,
|
|
194
|
+
priority: Number.isFinite(parsedPriority) ? parsedPriority : REGISTRY_SOURCE_PRIORITY[source] ?? 0,
|
|
195
|
+
source: typeof rawRecord.source === "string" ? rawRecord.source : source,
|
|
196
|
+
scope: typeof rawRecord.scope === "string" ? rawRecord.scope : DEFAULT_REGISTRY_SCOPE,
|
|
197
|
+
value: rawRecord.value
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
updatedAt: 0,
|
|
202
|
+
sequence: 0,
|
|
203
|
+
instanceId: null,
|
|
204
|
+
priority: REGISTRY_SOURCE_PRIORITY[source] ?? 0,
|
|
205
|
+
source,
|
|
206
|
+
scope: DEFAULT_REGISTRY_SCOPE,
|
|
207
|
+
value: rawValue
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function compareRecords(a, b) {
|
|
211
|
+
if (a.priority !== b.priority) return a.priority - b.priority;
|
|
212
|
+
const rankDiff = getSourceRank(a.source) - getSourceRank(b.source);
|
|
213
|
+
if (rankDiff !== 0) return rankDiff;
|
|
214
|
+
return (a.sequence ?? a.updatedAt) - (b.sequence ?? b.updatedAt);
|
|
215
|
+
}
|
|
216
|
+
function recordsHaveSameValue(prevRecord, nextRecord) {
|
|
217
|
+
if (Object.is(prevRecord?.value, nextRecord?.value)) return true;
|
|
218
|
+
if (isObject(prevRecord?.value) && isObject(nextRecord?.value)) {
|
|
219
|
+
return shallowEqual(prevRecord.value, nextRecord.value);
|
|
220
|
+
}
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
function hasRecordChanged(prevRecord, nextRecord) {
|
|
224
|
+
if (!prevRecord) return true;
|
|
225
|
+
return prevRecord.priority !== nextRecord.priority || prevRecord.source !== nextRecord.source || prevRecord.instanceId !== nextRecord.instanceId || prevRecord.scope !== nextRecord.scope || !recordsHaveSameValue(prevRecord, nextRecord);
|
|
226
|
+
}
|
|
227
|
+
function hasAnySourceRecord(entry) {
|
|
228
|
+
return Object.values(entry || {}).some((rawRecord) => rawRecord !== void 0);
|
|
229
|
+
}
|
|
230
|
+
function setSourceRecord(state, type, key, source, record) {
|
|
231
|
+
const typeRegistry = state[type] || {};
|
|
232
|
+
const currentEntry = typeRegistry[key] || {};
|
|
233
|
+
const recordKey = createRecordKey(source, record.instanceId, record.scope);
|
|
234
|
+
const prevRecord = toSourceRecord(currentEntry[recordKey], source);
|
|
235
|
+
if (!hasRecordChanged(prevRecord, record)) {
|
|
236
|
+
return state;
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
...state,
|
|
240
|
+
[type]: {
|
|
241
|
+
...typeRegistry,
|
|
242
|
+
[key]: {
|
|
243
|
+
...currentEntry,
|
|
244
|
+
[recordKey]: record
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function findRecordsToRemove(entry, source, instanceId, scope) {
|
|
250
|
+
if (typeof instanceId === "string" && instanceId.length > 0 && scope !== null) {
|
|
251
|
+
const safeScope = scope || DEFAULT_REGISTRY_SCOPE;
|
|
252
|
+
const record = getSourceRecord(entry, source, instanceId, safeScope);
|
|
253
|
+
if (!record) return [];
|
|
254
|
+
return [{
|
|
255
|
+
recordKey: createRecordKey(source, instanceId, safeScope),
|
|
256
|
+
record
|
|
257
|
+
}];
|
|
258
|
+
}
|
|
259
|
+
return getSourceRecords(entry, source, scope).filter(({
|
|
260
|
+
record
|
|
261
|
+
}) => !instanceId || record?.instanceId === instanceId).filter((candidate) => Boolean(candidate.record));
|
|
262
|
+
}
|
|
263
|
+
function removeSourceRecord(state, type, key, source, instanceId = null, scope = null) {
|
|
264
|
+
const typeRegistry = state[type];
|
|
265
|
+
const currentEntry = typeRegistry?.[key];
|
|
266
|
+
if (!typeRegistry || !currentEntry) return state;
|
|
267
|
+
const activeRecords = findRecordsToRemove(currentEntry, source, instanceId, scope);
|
|
268
|
+
if (activeRecords.length === 0) return state;
|
|
269
|
+
const nextEntry = {
|
|
270
|
+
...currentEntry
|
|
271
|
+
};
|
|
272
|
+
activeRecords.forEach(({
|
|
273
|
+
recordKey
|
|
274
|
+
}) => {
|
|
275
|
+
delete nextEntry[recordKey];
|
|
276
|
+
});
|
|
277
|
+
if (!hasAnySourceRecord(nextEntry)) {
|
|
278
|
+
const nextTypeRegistry = {
|
|
279
|
+
...typeRegistry
|
|
280
|
+
};
|
|
281
|
+
delete nextTypeRegistry[key];
|
|
282
|
+
return {
|
|
283
|
+
...state,
|
|
284
|
+
[type]: nextTypeRegistry
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
return {
|
|
288
|
+
...state,
|
|
289
|
+
[type]: {
|
|
290
|
+
...typeRegistry,
|
|
291
|
+
[key]: nextEntry
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// src/core/kernel/operations-resolve.ts
|
|
297
|
+
function resolveEntryValueFor(definitions, type, entry, scope = null) {
|
|
298
|
+
if (!entry) return void 0;
|
|
299
|
+
const activeRecords = Object.entries(entry).map(([source, rawRecord]) => toSourceRecord(rawRecord, source)).filter((record) => record !== null && (scope === null || record.scope === scope));
|
|
300
|
+
if (activeRecords.length === 0) return void 0;
|
|
301
|
+
const merge = definitions.get(type)?.merge;
|
|
302
|
+
if (merge) {
|
|
303
|
+
const sortedRecords = [...activeRecords].sort(compareRecords);
|
|
304
|
+
const mergeCandidate = sortedRecords.every((record) => isObject(record.value));
|
|
305
|
+
if (mergeCandidate) {
|
|
306
|
+
const values = sortedRecords.map((record) => record.value);
|
|
307
|
+
return merge(values);
|
|
308
|
+
}
|
|
309
|
+
return sortedRecords[sortedRecords.length - 1].value;
|
|
310
|
+
}
|
|
311
|
+
return activeRecords.reduce((winner, current) => compareRecords(current, winner) > 0 ? current : winner).value;
|
|
312
|
+
}
|
|
313
|
+
function createResolverCacheFor(definitions) {
|
|
314
|
+
const entryCache = /* @__PURE__ */ new WeakMap();
|
|
315
|
+
return (type, entry, scope = null) => {
|
|
316
|
+
if (!entry || typeof entry !== "object") {
|
|
317
|
+
return resolveEntryValueFor(definitions, type, entry, scope);
|
|
318
|
+
}
|
|
319
|
+
let typeCache = entryCache.get(entry);
|
|
320
|
+
if (!typeCache) {
|
|
321
|
+
typeCache = /* @__PURE__ */ new Map();
|
|
322
|
+
entryCache.set(entry, typeCache);
|
|
323
|
+
}
|
|
324
|
+
const cacheKey = scope || "default";
|
|
325
|
+
if (typeCache.has(cacheKey)) return typeCache.get(cacheKey);
|
|
326
|
+
const value = resolveEntryValueFor(definitions, type, entry, scope);
|
|
327
|
+
typeCache.set(cacheKey, value);
|
|
328
|
+
return value;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// src/core/kernel/schema.ts
|
|
333
|
+
function resolveLifecycle(metadata, fallback) {
|
|
334
|
+
const lifecycle = metadata?.lifecycle ?? metadata?.cleanup;
|
|
335
|
+
return lifecycle && REGISTRY_LIFECYCLE_VALUES.has(lifecycle) ? lifecycle : fallback;
|
|
336
|
+
}
|
|
337
|
+
function checkNonEmptyStrings(metadata, issues) {
|
|
338
|
+
for (const field of ["source", "instanceId", "scope"]) {
|
|
339
|
+
if (metadata[field] !== void 0 && !getValidString(metadata[field])) issues.push(`${field} must be a non-empty string`);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function checkNumbers(metadata, issues) {
|
|
343
|
+
if (metadata.priority !== void 0 && parseFiniteNumber(metadata.priority) === null) issues.push("priority must be a finite number");
|
|
344
|
+
if (metadata.cleanupDelayMs !== void 0) {
|
|
345
|
+
const delay = parseFiniteNumber(metadata.cleanupDelayMs);
|
|
346
|
+
if (delay === null || delay < 0) issues.push("cleanupDelayMs must be a non-negative finite number");
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
function checkEnums(metadata, issues) {
|
|
350
|
+
const lifecycle = metadata.lifecycle ?? metadata.cleanup;
|
|
351
|
+
if (lifecycle !== void 0 && // eslint-disable-next-line @typescript-eslint/no-base-to-string -- lifecycle comes from unvalidated metadata; an object stringifies to "[object Object]" and fails the membership check, which is the intended rejection
|
|
352
|
+
!REGISTRY_LIFECYCLE_VALUES.has(String(lifecycle))) {
|
|
353
|
+
issues.push(`lifecycle must be one of: ${[...REGISTRY_LIFECYCLE_VALUES].join(", ")}`);
|
|
354
|
+
}
|
|
355
|
+
if (metadata.validation !== void 0 && !Object.values(REGISTRY_VALIDATION_MODES).includes(metadata.validation)) {
|
|
356
|
+
issues.push(`validation must be one of: ${Object.values(REGISTRY_VALIDATION_MODES).join(", ")}`);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function validateRegistryMetadata(metadata) {
|
|
360
|
+
if (metadata === void 0 || metadata === null) return {
|
|
361
|
+
issues: [],
|
|
362
|
+
valid: true
|
|
363
|
+
};
|
|
364
|
+
if (!isObject(metadata)) return {
|
|
365
|
+
issues: ["registry metadata must be an object"],
|
|
366
|
+
valid: false
|
|
367
|
+
};
|
|
368
|
+
const issues = [];
|
|
369
|
+
Object.keys(metadata).forEach((key) => {
|
|
370
|
+
if (!REGISTRY_METADATA_KEY_SET.has(key)) issues.push(`unknown registry metadata field: ${key}`);
|
|
371
|
+
});
|
|
372
|
+
checkNonEmptyStrings(metadata, issues);
|
|
373
|
+
checkNumbers(metadata, issues);
|
|
374
|
+
checkEnums(metadata, issues);
|
|
375
|
+
return {
|
|
376
|
+
issues,
|
|
377
|
+
valid: issues.length === 0
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
function validateRegistryKey(type, key, definitions) {
|
|
381
|
+
const definition = definitions.get(type);
|
|
382
|
+
const issues = [];
|
|
383
|
+
if (!definition) issues.push(`unknown registry type: ${String(type)}`);
|
|
384
|
+
if (!getValidString(key)) return {
|
|
385
|
+
issues: [...issues, "key must be a non-empty string"],
|
|
386
|
+
valid: false
|
|
387
|
+
};
|
|
388
|
+
const normalizedKey = String(key).trim();
|
|
389
|
+
if (definition?.keyPolicy === "singleton") {
|
|
390
|
+
const expectedKey = definition.singletonKey;
|
|
391
|
+
if (expectedKey && normalizedKey !== expectedKey) issues.push(`${type} key must be ${expectedKey}`);
|
|
392
|
+
} else if (definition?.keyPolicy === "path") {
|
|
393
|
+
if (!normalizedKey.startsWith("/")) issues.push(`${type} key must be an absolute path`);
|
|
394
|
+
} else if (definition?.keyPolicy === "route") {
|
|
395
|
+
if (!normalizedKey.startsWith("/") && !definition.reservedKeys?.includes(normalizedKey)) {
|
|
396
|
+
issues.push(`${type} key must be a route path or a reserved route key`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return {
|
|
400
|
+
issues,
|
|
401
|
+
valid: issues.length === 0
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function validateRegistryValue(type, key, value, definitions) {
|
|
405
|
+
const definition = definitions.get(type);
|
|
406
|
+
const issues = [...validateRegistryKey(type, key, definitions).issues];
|
|
407
|
+
const valueKind = definition?.valueKind ?? "object";
|
|
408
|
+
if (definition && valueKind === "object" && !isPlainObject(value)) {
|
|
409
|
+
issues.push(`${type} values must be plain objects`);
|
|
410
|
+
}
|
|
411
|
+
if (definition && valueKind === "component" && typeof value !== "function" && !isPlainObject(value)) {
|
|
412
|
+
issues.push(`${type} values must be component functions or component objects`);
|
|
413
|
+
}
|
|
414
|
+
const validation = definition?.validate?.(value);
|
|
415
|
+
if (validation && !validation.valid && Array.isArray(validation.issues)) {
|
|
416
|
+
issues.push(...validation.issues);
|
|
417
|
+
}
|
|
418
|
+
return {
|
|
419
|
+
issues,
|
|
420
|
+
valid: issues.length === 0
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function resolveCleanupDelay(lifecycle, candidate, fallback) {
|
|
424
|
+
if (lifecycle === REGISTRY_LIFECYCLES.IMMEDIATE) return 0;
|
|
425
|
+
return candidate !== null && candidate >= 0 ? candidate : fallback;
|
|
426
|
+
}
|
|
427
|
+
function normalizeRegistryMetadata(metadata, {
|
|
428
|
+
defaultCleanupDelayMs = null,
|
|
429
|
+
defaultLifecycle = null,
|
|
430
|
+
defaultSource = DEFAULT_SOURCE
|
|
431
|
+
} = {}) {
|
|
432
|
+
const registryMeta = isObject(metadata) ? metadata : {};
|
|
433
|
+
const normalizedDefaultDelay = parseFiniteNumber(defaultCleanupDelayMs);
|
|
434
|
+
const fallbackCleanupDelayMs = normalizedDefaultDelay !== null && normalizedDefaultDelay >= 0 ? normalizedDefaultDelay : null;
|
|
435
|
+
const fallbackLifecycle = defaultLifecycle && REGISTRY_LIFECYCLE_VALUES.has(defaultLifecycle) ? defaultLifecycle : null;
|
|
436
|
+
const source = getValidString(registryMeta.source) || getValidString(defaultSource, DEFAULT_SOURCE) || DEFAULT_SOURCE;
|
|
437
|
+
const scope = getValidString(registryMeta.scope);
|
|
438
|
+
const priority = parseFiniteNumber(registryMeta.priority);
|
|
439
|
+
const lifecycle = resolveLifecycle(registryMeta, fallbackLifecycle);
|
|
440
|
+
const validation = isValidationMode(registryMeta.validation) ? registryMeta.validation : null;
|
|
441
|
+
const cleanupDelayMs = resolveCleanupDelay(lifecycle, parseFiniteNumber(registryMeta.cleanupDelayMs), fallbackCleanupDelayMs);
|
|
442
|
+
return {
|
|
443
|
+
cleanupDelayMs,
|
|
444
|
+
lifecycle,
|
|
445
|
+
priority,
|
|
446
|
+
registerOptions: {
|
|
447
|
+
...priority !== null && {
|
|
448
|
+
priority
|
|
449
|
+
},
|
|
450
|
+
...validation === REGISTRY_VALIDATION_MODES.STRICT && {
|
|
451
|
+
validation
|
|
452
|
+
},
|
|
453
|
+
...scope && {
|
|
454
|
+
scope
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
source,
|
|
458
|
+
...scope && {
|
|
459
|
+
scope
|
|
460
|
+
},
|
|
461
|
+
...validation && {
|
|
462
|
+
validation
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
function isValidationMode(value) {
|
|
467
|
+
return Object.values(REGISTRY_VALIDATION_MODES).includes(value);
|
|
468
|
+
}
|
|
469
|
+
function pickRegistryMetadata(options) {
|
|
470
|
+
if (!isObject(options)) return {};
|
|
471
|
+
return Object.fromEntries(REGISTRY_METADATA_KEYS.filter((key) => options[key] !== void 0).map((key) => [key, options[key]]));
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// src/core/kernel/operations.ts
|
|
475
|
+
function createRegisterOperation(type, key, item, sourceOrOptions, optionsArg, timestamp, sequence = timestamp) {
|
|
476
|
+
const {
|
|
477
|
+
source,
|
|
478
|
+
options
|
|
479
|
+
} = resolveRegisterInput(sourceOrOptions, optionsArg);
|
|
480
|
+
const instanceId = resolveInstanceId(options);
|
|
481
|
+
const scope = resolveScope(options);
|
|
482
|
+
return {
|
|
483
|
+
kind: "register",
|
|
484
|
+
validation: options.validation,
|
|
485
|
+
source,
|
|
486
|
+
scope,
|
|
487
|
+
record: buildSourceRecord({
|
|
488
|
+
source,
|
|
489
|
+
value: item,
|
|
490
|
+
instanceId,
|
|
491
|
+
priority: resolveRecordPriority(options, source),
|
|
492
|
+
scope,
|
|
493
|
+
timestamp,
|
|
494
|
+
sequence
|
|
495
|
+
}),
|
|
496
|
+
instanceId,
|
|
497
|
+
type,
|
|
498
|
+
key: typeof key === "string" ? key.trim() : key
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
function createUnregisterOperation(type, key, sourceOrOptions) {
|
|
502
|
+
const {
|
|
503
|
+
scope,
|
|
504
|
+
source,
|
|
505
|
+
instanceId
|
|
506
|
+
} = resolveUnregisterInput(sourceOrOptions);
|
|
507
|
+
return {
|
|
508
|
+
kind: "unregister",
|
|
509
|
+
instanceId,
|
|
510
|
+
scope,
|
|
511
|
+
source,
|
|
512
|
+
type,
|
|
513
|
+
key: typeof key === "string" ? key.trim() : key
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
function isValidRegistryTargetFor(definitions, type, key) {
|
|
517
|
+
return validateRegistryKey(type, key, definitions).valid;
|
|
518
|
+
}
|
|
519
|
+
function applyOperationFor(definitions, state, operation) {
|
|
520
|
+
if (!isValidRegistryTargetFor(definitions, operation?.type, operation?.key)) return state;
|
|
521
|
+
if (operation.kind === "register") {
|
|
522
|
+
return setSourceRecord(state, operation.type, operation.key, operation.source, operation.record);
|
|
523
|
+
}
|
|
524
|
+
if (operation.kind === "unregister") {
|
|
525
|
+
return removeSourceRecord(state, operation.type, operation.key, operation.source, operation.instanceId, operation.scope);
|
|
526
|
+
}
|
|
527
|
+
return state;
|
|
528
|
+
}
|
|
529
|
+
function unregisterHasEffect(entry, operation) {
|
|
530
|
+
const {
|
|
531
|
+
instanceId,
|
|
532
|
+
scope,
|
|
533
|
+
source
|
|
534
|
+
} = operation;
|
|
535
|
+
if (typeof instanceId !== "string" || instanceId.length === 0) {
|
|
536
|
+
return getSourceRecords(entry, source, scope).length > 0;
|
|
537
|
+
}
|
|
538
|
+
if (scope === null) {
|
|
539
|
+
return getSourceRecords(entry, source).some(({
|
|
540
|
+
record
|
|
541
|
+
}) => record?.instanceId === instanceId);
|
|
542
|
+
}
|
|
543
|
+
return Boolean(getSourceRecord(entry, source, instanceId, scope));
|
|
544
|
+
}
|
|
545
|
+
function hasOperationEffectFor(definitions, state, operation) {
|
|
546
|
+
if (!isValidRegistryTargetFor(definitions, operation?.type, operation?.key)) return false;
|
|
547
|
+
if (operation.kind === "register") {
|
|
548
|
+
const currentRecord = getSourceRecord(state[operation.type]?.[operation.key], operation.source, operation.instanceId, operation.scope);
|
|
549
|
+
return hasRecordChanged(currentRecord, operation.record);
|
|
550
|
+
}
|
|
551
|
+
if (operation.kind === "unregister") {
|
|
552
|
+
return unregisterHasEffect(state[operation.type]?.[operation.key], operation);
|
|
553
|
+
}
|
|
554
|
+
return false;
|
|
555
|
+
}
|
|
556
|
+
function resolveEffectiveOperationsFor(definitions, state, operations) {
|
|
557
|
+
const effectiveOperations = [];
|
|
558
|
+
let nextState = state;
|
|
559
|
+
operations.forEach((operation) => {
|
|
560
|
+
if (!hasOperationEffectFor(definitions, nextState, operation)) return;
|
|
561
|
+
effectiveOperations.push(operation);
|
|
562
|
+
nextState = applyOperationFor(definitions, nextState, operation);
|
|
563
|
+
});
|
|
564
|
+
return {
|
|
565
|
+
effectiveOperations,
|
|
566
|
+
nextState
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
function createRegistryOperations(definitions) {
|
|
570
|
+
return Object.freeze({
|
|
571
|
+
applyOperation: (state, operation) => applyOperationFor(definitions, state, operation),
|
|
572
|
+
createInitialRegistries: () => createInitialRegistriesFor(definitions),
|
|
573
|
+
createResolverCache: () => createResolverCacheFor(definitions),
|
|
574
|
+
hasOperationEffect: (state, operation) => hasOperationEffectFor(definitions, state, operation),
|
|
575
|
+
isRegistryType: (type) => definitions.get(type) !== void 0,
|
|
576
|
+
isValidRegistryTarget: (type, key) => isValidRegistryTargetFor(definitions, type, key),
|
|
577
|
+
resolveEffectiveOperations: (state, operations) => resolveEffectiveOperationsFor(definitions, state, operations),
|
|
578
|
+
resolveEntryValue: (type, entry, scope = null) => resolveEntryValueFor(definitions, type, entry, scope)
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// src/core/kernel/runtime.ts
|
|
583
|
+
var TRACE_RADIX = 36;
|
|
584
|
+
var TRACE_SUFFIX_LENGTH = 6;
|
|
585
|
+
function createTraceId() {
|
|
586
|
+
const time = Date.now().toString(TRACE_RADIX);
|
|
587
|
+
const suffix = Math.random().toString(TRACE_RADIX).slice(2, 2 + TRACE_SUFFIX_LENGTH);
|
|
588
|
+
return `tx-${time}-${suffix}`;
|
|
589
|
+
}
|
|
590
|
+
function withTransactionDefaults(metadata, options) {
|
|
591
|
+
const baseOpts = options && typeof options === "object" ? options : {};
|
|
592
|
+
const needsSource = metadata.source && !baseOpts.source;
|
|
593
|
+
const needsScope = metadata.scope && !baseOpts.scope;
|
|
594
|
+
if (!needsSource && !needsScope) return baseOpts;
|
|
595
|
+
return {
|
|
596
|
+
...baseOpts,
|
|
597
|
+
...needsSource ? {
|
|
598
|
+
source: metadata.source
|
|
599
|
+
} : {},
|
|
600
|
+
...needsScope ? {
|
|
601
|
+
scope: metadata.scope
|
|
602
|
+
} : {}
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
function createRegistryTransaction(store, metadata = {}) {
|
|
606
|
+
const operations = [];
|
|
607
|
+
let status = "open";
|
|
608
|
+
const traceId = metadata.traceId || createTraceId();
|
|
609
|
+
const ensureOpen = () => status === "open";
|
|
610
|
+
const mergeOptions = (options) => withTransactionDefaults(metadata, options);
|
|
611
|
+
const register = (type, key, value, sourceOrOptions, optionsArg) => {
|
|
612
|
+
if (!ensureOpen()) return {
|
|
613
|
+
index: -1,
|
|
614
|
+
status,
|
|
615
|
+
traceId
|
|
616
|
+
};
|
|
617
|
+
const options = typeof sourceOrOptions === "string" ? mergeOptions({
|
|
618
|
+
...optionsArg || {},
|
|
619
|
+
source: sourceOrOptions
|
|
620
|
+
}) : mergeOptions(sourceOrOptions);
|
|
621
|
+
operations.push({
|
|
622
|
+
key,
|
|
623
|
+
item: value,
|
|
624
|
+
options,
|
|
625
|
+
type
|
|
626
|
+
});
|
|
627
|
+
return {
|
|
628
|
+
index: operations.length - 1,
|
|
629
|
+
status: "queued",
|
|
630
|
+
traceId
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
const unregister = (type, key, sourceOrOptions) => {
|
|
634
|
+
if (!ensureOpen()) return {
|
|
635
|
+
index: -1,
|
|
636
|
+
status,
|
|
637
|
+
traceId
|
|
638
|
+
};
|
|
639
|
+
const options = mergeOptions(typeof sourceOrOptions === "string" ? {
|
|
640
|
+
source: sourceOrOptions
|
|
641
|
+
} : sourceOrOptions);
|
|
642
|
+
operations.push({
|
|
643
|
+
key,
|
|
644
|
+
options,
|
|
645
|
+
type,
|
|
646
|
+
unregister: true
|
|
647
|
+
});
|
|
648
|
+
return {
|
|
649
|
+
index: operations.length - 1,
|
|
650
|
+
status: "queued",
|
|
651
|
+
traceId
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
const rollback = (_reason = "manual") => {
|
|
655
|
+
if (!ensureOpen()) return {
|
|
656
|
+
index: -1,
|
|
657
|
+
status,
|
|
658
|
+
traceId
|
|
659
|
+
};
|
|
660
|
+
status = "rolled-back";
|
|
661
|
+
operations.length = 0;
|
|
662
|
+
return {
|
|
663
|
+
index: -1,
|
|
664
|
+
status,
|
|
665
|
+
traceId
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
const commit = () => {
|
|
669
|
+
if (!ensureOpen()) return {
|
|
670
|
+
status,
|
|
671
|
+
traceId
|
|
672
|
+
};
|
|
673
|
+
status = "committed";
|
|
674
|
+
const result = store.batch((queue) => {
|
|
675
|
+
operations.forEach((op) => {
|
|
676
|
+
if (op.unregister) queue.unregister(op.type, op.key, op.options);
|
|
677
|
+
else queue.register(op.type, op.key, op.item, op.options);
|
|
678
|
+
});
|
|
679
|
+
});
|
|
680
|
+
const applied = typeof result === "number" && Number.isFinite(result) ? result : 0;
|
|
681
|
+
return {
|
|
682
|
+
applied,
|
|
683
|
+
queued: operations.length,
|
|
684
|
+
status,
|
|
685
|
+
traceId
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
const run = (executor) => {
|
|
689
|
+
if (typeof executor !== "function") {
|
|
690
|
+
rollback("invalid-executor");
|
|
691
|
+
return {
|
|
692
|
+
status,
|
|
693
|
+
traceId
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
try {
|
|
697
|
+
executor({
|
|
698
|
+
register,
|
|
699
|
+
unregister
|
|
700
|
+
});
|
|
701
|
+
return commit();
|
|
702
|
+
} catch (error) {
|
|
703
|
+
rollback(error instanceof Error ? error.message : String(error));
|
|
704
|
+
throw error;
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
return {
|
|
708
|
+
commit,
|
|
709
|
+
get operations() {
|
|
710
|
+
return operations.slice();
|
|
711
|
+
},
|
|
712
|
+
register,
|
|
713
|
+
rollback,
|
|
714
|
+
run,
|
|
715
|
+
get status() {
|
|
716
|
+
return status;
|
|
717
|
+
},
|
|
718
|
+
traceId,
|
|
719
|
+
unregister
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// src/core/kernel/store-handles.ts
|
|
724
|
+
var DEFAULT_VALIDATION = REGISTRY_VALIDATION_MODES.WARN;
|
|
725
|
+
function createNoopHandle(status = "rejected", reason = "unknown") {
|
|
726
|
+
const handle = Object.assign(() => false, {
|
|
727
|
+
active: false,
|
|
728
|
+
dispose: () => false,
|
|
729
|
+
instanceId: null,
|
|
730
|
+
key: "",
|
|
731
|
+
priority: 0,
|
|
732
|
+
reason,
|
|
733
|
+
source: "",
|
|
734
|
+
status,
|
|
735
|
+
type: "",
|
|
736
|
+
update: () => handle,
|
|
737
|
+
updatedAt: 0,
|
|
738
|
+
validation: DEFAULT_VALIDATION
|
|
739
|
+
});
|
|
740
|
+
return handle;
|
|
741
|
+
}
|
|
742
|
+
var NOOP_HANDLE = createNoopHandle();
|
|
743
|
+
function isNoopHandle(handle) {
|
|
744
|
+
return handle === NOOP_HANDLE || handle?.status === "rejected" || handle?.status === "ignored";
|
|
745
|
+
}
|
|
746
|
+
function createRegistrationHandle(store, operation) {
|
|
747
|
+
let disposed = false;
|
|
748
|
+
const dispose = (reason = "manual") => {
|
|
749
|
+
if (disposed) return false;
|
|
750
|
+
disposed = true;
|
|
751
|
+
return store.dispose(operation, reason);
|
|
752
|
+
};
|
|
753
|
+
const handle = (reason) => dispose(reason);
|
|
754
|
+
handle.dispose = dispose;
|
|
755
|
+
handle.update = (value, options = {}) => {
|
|
756
|
+
if (disposed || !store.isCurrent(operation)) return NOOP_HANDLE;
|
|
757
|
+
const nextHandle = store.register(operation.type, operation.key, value, operation.source, {
|
|
758
|
+
...typeof options === "object" ? options : {},
|
|
759
|
+
instanceId: operation.instanceId,
|
|
760
|
+
priority: operation.record.priority,
|
|
761
|
+
...operation.scope ? {
|
|
762
|
+
scope: operation.scope
|
|
763
|
+
} : {},
|
|
764
|
+
...operation.validation ? {
|
|
765
|
+
validation: operation.validation
|
|
766
|
+
} : {}
|
|
767
|
+
});
|
|
768
|
+
if (isNoopHandle(nextHandle)) return handle;
|
|
769
|
+
disposed = true;
|
|
770
|
+
return nextHandle;
|
|
771
|
+
};
|
|
772
|
+
Object.defineProperties(handle, {
|
|
773
|
+
active: {
|
|
774
|
+
enumerable: true,
|
|
775
|
+
get: () => !disposed && store.isCurrent(operation)
|
|
776
|
+
},
|
|
777
|
+
instanceId: {
|
|
778
|
+
enumerable: true,
|
|
779
|
+
value: operation.instanceId
|
|
780
|
+
},
|
|
781
|
+
key: {
|
|
782
|
+
enumerable: true,
|
|
783
|
+
value: operation.key
|
|
784
|
+
},
|
|
785
|
+
priority: {
|
|
786
|
+
enumerable: true,
|
|
787
|
+
value: operation.record.priority
|
|
788
|
+
},
|
|
789
|
+
source: {
|
|
790
|
+
enumerable: true,
|
|
791
|
+
value: operation.source
|
|
792
|
+
},
|
|
793
|
+
status: {
|
|
794
|
+
enumerable: true,
|
|
795
|
+
get: () => {
|
|
796
|
+
if (disposed) return "disposed";
|
|
797
|
+
return store.isCurrent(operation) ? "active" : "superseded";
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
type: {
|
|
801
|
+
enumerable: true,
|
|
802
|
+
value: operation.type
|
|
803
|
+
},
|
|
804
|
+
updatedAt: {
|
|
805
|
+
enumerable: true,
|
|
806
|
+
value: operation.record.updatedAt
|
|
807
|
+
},
|
|
808
|
+
validation: {
|
|
809
|
+
enumerable: true,
|
|
810
|
+
value: operation.validation || DEFAULT_VALIDATION
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
return handle;
|
|
814
|
+
}
|
|
815
|
+
function cloneRegistryValue(value, seen = /* @__PURE__ */ new WeakMap()) {
|
|
816
|
+
if (value === null || typeof value !== "object" || isValidElement(value)) {
|
|
817
|
+
return value;
|
|
818
|
+
}
|
|
819
|
+
const prototype = Object.getPrototypeOf(value);
|
|
820
|
+
const isPlainObject2 = !Array.isArray(value) && (prototype === Object.prototype || prototype === null);
|
|
821
|
+
if (!Array.isArray(value) && !isPlainObject2) return value;
|
|
822
|
+
if (seen.has(value)) return seen.get(value);
|
|
823
|
+
const source = value;
|
|
824
|
+
const clone = Array.isArray(value) ? [] : {};
|
|
825
|
+
seen.set(value, clone);
|
|
826
|
+
for (const key in source) {
|
|
827
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
828
|
+
clone[key] = cloneRegistryValue(source[key], seen);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
return clone;
|
|
832
|
+
}
|
|
833
|
+
function resolveRegistrationOptions(sourceOrOptions, optionsArg) {
|
|
834
|
+
if (sourceOrOptions && typeof sourceOrOptions === "object") return sourceOrOptions;
|
|
835
|
+
return optionsArg && typeof optionsArg === "object" ? optionsArg : {};
|
|
836
|
+
}
|
|
837
|
+
function validateRegistration(definitions, type, key, value, sourceOrOptions, optionsArg) {
|
|
838
|
+
const options = resolveRegistrationOptions(sourceOrOptions, optionsArg);
|
|
839
|
+
const metadataValidation = validateRegistryMetadata(options);
|
|
840
|
+
const isStrict = options.validation === REGISTRY_VALIDATION_MODES.STRICT;
|
|
841
|
+
if (!metadataValidation.valid && isStrict) {
|
|
842
|
+
return {
|
|
843
|
+
issues: metadataValidation.issues,
|
|
844
|
+
reason: "invalid-metadata",
|
|
845
|
+
valid: false
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
const validation = validateRegistryValue(type, key, value, definitions);
|
|
849
|
+
if (validation.valid) return {
|
|
850
|
+
valid: true
|
|
851
|
+
};
|
|
852
|
+
if (!isStrict) {
|
|
853
|
+
report(`Registry ${type} "${key}" is invalid`, validation.issues, "warn");
|
|
854
|
+
}
|
|
855
|
+
return {
|
|
856
|
+
issues: validation.issues,
|
|
857
|
+
reason: "invalid-value",
|
|
858
|
+
valid: !isStrict
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
function prepareRegisterOperation(ops, definitions, type, key, item, sourceOrOptions, optionsArg, timestamp, sequence) {
|
|
862
|
+
if (!ops.isValidRegistryTarget(type, key)) {
|
|
863
|
+
return {
|
|
864
|
+
rejected: createNoopHandle("rejected", "invalid-target")
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
const validation = validateRegistration(definitions, type, key, item, sourceOrOptions, optionsArg);
|
|
868
|
+
if (!validation.valid) {
|
|
869
|
+
return {
|
|
870
|
+
rejected: createNoopHandle("rejected", validation.reason)
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
return {
|
|
874
|
+
operation: createRegisterOperation(type, key, cloneRegistryValue(item), sourceOrOptions, optionsArg, timestamp, sequence)
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
// src/core/kernel/store-batch.ts
|
|
879
|
+
function createBatchQueue({
|
|
880
|
+
definitions,
|
|
881
|
+
getStore,
|
|
882
|
+
nextSequence,
|
|
883
|
+
operations,
|
|
884
|
+
ops,
|
|
885
|
+
timestamp
|
|
886
|
+
}) {
|
|
887
|
+
return {
|
|
888
|
+
register: (type, key, item, sourceOrOptions = DEFAULT_SOURCE, optionsArg = {}) => {
|
|
889
|
+
const prepared = prepareRegisterOperation(ops, definitions, type, key, item, sourceOrOptions, optionsArg, timestamp, nextSequence());
|
|
890
|
+
if ("rejected" in prepared) return prepared.rejected;
|
|
891
|
+
operations.push(prepared.operation);
|
|
892
|
+
return createRegistrationHandle(getStore(), prepared.operation);
|
|
893
|
+
},
|
|
894
|
+
unregister: (type, key, sourceOrOptions = DEFAULT_SOURCE) => {
|
|
895
|
+
if (!ops.isValidRegistryTarget(type, key)) return;
|
|
896
|
+
operations.push(createUnregisterOperation(type, key, sourceOrOptions));
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// src/core/kernel/store-entries.ts
|
|
902
|
+
function normalizeInitialEntries(entries) {
|
|
903
|
+
return (Array.isArray(entries) ? entries : []).filter((entry) => Boolean(entry?.type && entry?.items && typeof entry.items === "object"));
|
|
904
|
+
}
|
|
905
|
+
function createInitialState(ops, definitions, entries) {
|
|
906
|
+
const normalizedEntries = normalizeInitialEntries(entries);
|
|
907
|
+
if (normalizedEntries.length === 0) return ops.createInitialRegistries();
|
|
908
|
+
const timestamp = Date.now();
|
|
909
|
+
let sequence = 0;
|
|
910
|
+
let state = ops.createInitialRegistries();
|
|
911
|
+
normalizedEntries.forEach((entry) => {
|
|
912
|
+
const source = entry.source || REGISTRY_SOURCES.STATIC;
|
|
913
|
+
const options = {
|
|
914
|
+
...entry.options || {},
|
|
915
|
+
instanceId: entry.instanceId || entry.options?.instanceId || "registry-initial"
|
|
916
|
+
};
|
|
917
|
+
Object.entries(entry.items).forEach(([key, value]) => {
|
|
918
|
+
const validation = validateRegistration(definitions, entry.type, key, value, source, options);
|
|
919
|
+
if (!validation.valid) return;
|
|
920
|
+
const operation = createRegisterOperation(entry.type, key, cloneRegistryValue(value), source, options, timestamp, ++sequence);
|
|
921
|
+
if (ops.hasOperationEffect(state, operation)) {
|
|
922
|
+
state = ops.applyOperation(state, operation);
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
});
|
|
926
|
+
return state;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
// src/core/kernel/store-snapshots.ts
|
|
930
|
+
var SCOPE_KEY_SEPARATOR = "\0";
|
|
931
|
+
function createSnapshotReaders(getState, resolveValue) {
|
|
932
|
+
const entrySnapshots = /* @__PURE__ */ new Map();
|
|
933
|
+
const valueSnapshots = /* @__PURE__ */ new Map();
|
|
934
|
+
const getSnapshot = (type, key, scope = null) => {
|
|
935
|
+
const entry = getState()[type]?.[key];
|
|
936
|
+
let snapshots = valueSnapshots.get(type);
|
|
937
|
+
if (!snapshots) {
|
|
938
|
+
snapshots = /* @__PURE__ */ new Map();
|
|
939
|
+
valueSnapshots.set(type, snapshots);
|
|
940
|
+
}
|
|
941
|
+
const cacheKey = scope === null ? key : `${scope}${SCOPE_KEY_SEPARATOR}${key}`;
|
|
942
|
+
if (entry === void 0) {
|
|
943
|
+
snapshots.delete(cacheKey);
|
|
944
|
+
return void 0;
|
|
945
|
+
}
|
|
946
|
+
const cached = snapshots.get(cacheKey);
|
|
947
|
+
if (cached && cached.entry === entry) return cached.value;
|
|
948
|
+
const value = resolveValue(type, entry, scope);
|
|
949
|
+
snapshots.set(cacheKey, {
|
|
950
|
+
entry,
|
|
951
|
+
value
|
|
952
|
+
});
|
|
953
|
+
return value;
|
|
954
|
+
};
|
|
955
|
+
const getEntriesSnapshot = (type, scope = null) => {
|
|
956
|
+
const typeRegistry = getState()[type] || {};
|
|
957
|
+
const cacheKey = `${type}::${scope ?? "null"}`;
|
|
958
|
+
const cached = entrySnapshots.get(cacheKey);
|
|
959
|
+
if (cached?.typeRegistry === typeRegistry) return cached.value;
|
|
960
|
+
const resolved = {};
|
|
961
|
+
for (const key in typeRegistry) {
|
|
962
|
+
if (Object.prototype.hasOwnProperty.call(typeRegistry, key)) {
|
|
963
|
+
const value = resolveValue(type, typeRegistry[key], scope);
|
|
964
|
+
if (value !== void 0) resolved[key] = value;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
const finalValue = Object.freeze(resolved);
|
|
968
|
+
entrySnapshots.set(cacheKey, {
|
|
969
|
+
typeRegistry,
|
|
970
|
+
value: finalValue
|
|
971
|
+
});
|
|
972
|
+
return finalValue;
|
|
973
|
+
};
|
|
974
|
+
return {
|
|
975
|
+
getEntriesSnapshot,
|
|
976
|
+
getSnapshot
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// src/core/kernel/store-subscriptions.ts
|
|
981
|
+
function notifyListeners(listeners) {
|
|
982
|
+
if (!listeners) return;
|
|
983
|
+
for (const listener of listeners) {
|
|
984
|
+
try {
|
|
985
|
+
listener();
|
|
986
|
+
} catch (error) {
|
|
987
|
+
report("Registry listener", error);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
function getOrCreateKeyListeners(listenersByType, type, key) {
|
|
992
|
+
let listeners = listenersByType.get(type);
|
|
993
|
+
if (!listeners) {
|
|
994
|
+
listeners = /* @__PURE__ */ new Map();
|
|
995
|
+
listenersByType.set(type, listeners);
|
|
996
|
+
}
|
|
997
|
+
let keyListeners = listeners.get(key);
|
|
998
|
+
if (!keyListeners) {
|
|
999
|
+
keyListeners = /* @__PURE__ */ new Set();
|
|
1000
|
+
listeners.set(key, keyListeners);
|
|
1001
|
+
}
|
|
1002
|
+
return keyListeners;
|
|
1003
|
+
}
|
|
1004
|
+
function collectChangedKeys(operations, isValidTarget) {
|
|
1005
|
+
const changedKeysByType = /* @__PURE__ */ new Map();
|
|
1006
|
+
for (const operation of operations) {
|
|
1007
|
+
if (!isValidTarget(operation?.type, operation?.key)) continue;
|
|
1008
|
+
let keys = changedKeysByType.get(operation.type);
|
|
1009
|
+
if (!keys) {
|
|
1010
|
+
keys = /* @__PURE__ */ new Set();
|
|
1011
|
+
changedKeysByType.set(operation.type, keys);
|
|
1012
|
+
}
|
|
1013
|
+
keys.add(operation.key);
|
|
1014
|
+
}
|
|
1015
|
+
return changedKeysByType;
|
|
1016
|
+
}
|
|
1017
|
+
function createListenerRegistry() {
|
|
1018
|
+
const listenersByType = /* @__PURE__ */ new Map();
|
|
1019
|
+
function subscribe(type, key, listener) {
|
|
1020
|
+
const keyListeners = getOrCreateKeyListeners(listenersByType, type, key ?? null);
|
|
1021
|
+
keyListeners.add(listener);
|
|
1022
|
+
return () => {
|
|
1023
|
+
keyListeners.delete(listener);
|
|
1024
|
+
if (keyListeners.size > 0) return;
|
|
1025
|
+
const listeners = listenersByType.get(type);
|
|
1026
|
+
if (listeners) {
|
|
1027
|
+
listeners.delete(key ?? null);
|
|
1028
|
+
if (listeners.size === 0) listenersByType.delete(type);
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
function notifyChanged(previousState, nextState, changedKeysByType) {
|
|
1033
|
+
for (const [type, changedKeys] of changedKeysByType) {
|
|
1034
|
+
const previousRegistry = previousState[type] || {};
|
|
1035
|
+
const nextRegistry = nextState[type] || {};
|
|
1036
|
+
const typeListeners = listenersByType.get(type);
|
|
1037
|
+
let typeChanged = false;
|
|
1038
|
+
if (!typeListeners) continue;
|
|
1039
|
+
for (const key of changedKeys) {
|
|
1040
|
+
if (previousRegistry[key] === nextRegistry[key]) continue;
|
|
1041
|
+
typeChanged = true;
|
|
1042
|
+
notifyListeners(typeListeners.get(key));
|
|
1043
|
+
}
|
|
1044
|
+
if (typeChanged) {
|
|
1045
|
+
notifyListeners(typeListeners.get(null));
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
return {
|
|
1050
|
+
notifyChanged,
|
|
1051
|
+
subscribe
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// src/core/kernel/store.ts
|
|
1056
|
+
var NO_DEFINITIONS = /* @__PURE__ */ new Map();
|
|
1057
|
+
function createRegistryStore(initialEntries = [], definitions = NO_DEFINITIONS) {
|
|
1058
|
+
const ops = createRegistryOperations(definitions);
|
|
1059
|
+
let registries = createInitialState(ops, definitions, initialEntries);
|
|
1060
|
+
let sequence = normalizeInitialEntries(initialEntries).reduce((count, entry) => count + Object.keys(entry.items).length, 0);
|
|
1061
|
+
const listeners = createListenerRegistry();
|
|
1062
|
+
const resolveCachedValue = ops.createResolverCache();
|
|
1063
|
+
const {
|
|
1064
|
+
getEntriesSnapshot,
|
|
1065
|
+
getSnapshot
|
|
1066
|
+
} = createSnapshotReaders(() => registries, resolveCachedValue);
|
|
1067
|
+
const commit = (nextState, operations = []) => {
|
|
1068
|
+
if (registries === nextState) return;
|
|
1069
|
+
const previousState = registries;
|
|
1070
|
+
registries = nextState;
|
|
1071
|
+
listeners.notifyChanged(previousState, nextState, collectChangedKeys(operations, ops.isValidRegistryTarget));
|
|
1072
|
+
};
|
|
1073
|
+
const isCurrent = (operation) => {
|
|
1074
|
+
const entry = registries[operation.type]?.[operation.key];
|
|
1075
|
+
const recordKey = createRecordKey(operation.source, operation.instanceId, operation.scope);
|
|
1076
|
+
return entry?.[recordKey] === operation.record;
|
|
1077
|
+
};
|
|
1078
|
+
const dispose = (operation, _reason = "manual") => {
|
|
1079
|
+
if (!isCurrent(operation)) return false;
|
|
1080
|
+
const unregisterOperation = createUnregisterOperation(operation.type, operation.key, {
|
|
1081
|
+
source: operation.source,
|
|
1082
|
+
instanceId: operation.instanceId,
|
|
1083
|
+
scope: operation.scope
|
|
1084
|
+
});
|
|
1085
|
+
if (!ops.hasOperationEffect(registries, unregisterOperation)) return false;
|
|
1086
|
+
commit(ops.applyOperation(registries, unregisterOperation), [unregisterOperation]);
|
|
1087
|
+
return true;
|
|
1088
|
+
};
|
|
1089
|
+
const register = (type, key, item, sourceOrOptions = DEFAULT_SOURCE, optionsArg = {}) => {
|
|
1090
|
+
const prepared = prepareRegisterOperation(ops, definitions, type, key, item, sourceOrOptions, optionsArg, Date.now(), ++sequence);
|
|
1091
|
+
if ("rejected" in prepared) return prepared.rejected;
|
|
1092
|
+
const {
|
|
1093
|
+
operation
|
|
1094
|
+
} = prepared;
|
|
1095
|
+
if (!ops.hasOperationEffect(registries, operation)) {
|
|
1096
|
+
return createNoopHandle("ignored", "unchanged");
|
|
1097
|
+
}
|
|
1098
|
+
commit(ops.applyOperation(registries, operation), [operation]);
|
|
1099
|
+
return createRegistrationHandle(store, operation);
|
|
1100
|
+
};
|
|
1101
|
+
const unregister = (type, key, sourceOrOptions = DEFAULT_SOURCE) => {
|
|
1102
|
+
if (!ops.isValidRegistryTarget(type, key)) return;
|
|
1103
|
+
const operation = createUnregisterOperation(type, key, sourceOrOptions);
|
|
1104
|
+
if (!ops.hasOperationEffect(registries, operation)) return;
|
|
1105
|
+
commit(ops.applyOperation(registries, operation), [operation]);
|
|
1106
|
+
};
|
|
1107
|
+
const batch = (executor) => {
|
|
1108
|
+
if (typeof executor !== "function") return 0;
|
|
1109
|
+
const operations = [];
|
|
1110
|
+
executor(createBatchQueue({
|
|
1111
|
+
definitions,
|
|
1112
|
+
getStore: () => store,
|
|
1113
|
+
nextSequence: () => ++sequence,
|
|
1114
|
+
operations,
|
|
1115
|
+
ops,
|
|
1116
|
+
timestamp: Date.now()
|
|
1117
|
+
}));
|
|
1118
|
+
if (operations.length === 0) return 0;
|
|
1119
|
+
const {
|
|
1120
|
+
effectiveOperations,
|
|
1121
|
+
nextState
|
|
1122
|
+
} = ops.resolveEffectiveOperations(registries, operations);
|
|
1123
|
+
if (effectiveOperations.length === 0) return 0;
|
|
1124
|
+
commit(nextState, effectiveOperations);
|
|
1125
|
+
return effectiveOperations.length;
|
|
1126
|
+
};
|
|
1127
|
+
const store = {
|
|
1128
|
+
batch,
|
|
1129
|
+
dispose,
|
|
1130
|
+
getEntriesSnapshot,
|
|
1131
|
+
getSnapshot,
|
|
1132
|
+
isCurrent,
|
|
1133
|
+
register,
|
|
1134
|
+
subscribe: listeners.subscribe,
|
|
1135
|
+
transaction: (executor, metadata = {}) => createRegistryTransaction(store, metadata).run(executor),
|
|
1136
|
+
unregister
|
|
1137
|
+
};
|
|
1138
|
+
return store;
|
|
1139
|
+
}
|
|
1140
|
+
var keyedSubscriptions = /* @__PURE__ */ new WeakMap();
|
|
1141
|
+
function keyedSubscription(subscription, id, create) {
|
|
1142
|
+
let byId = keyedSubscriptions.get(subscription);
|
|
1143
|
+
if (!byId) {
|
|
1144
|
+
byId = /* @__PURE__ */ new Map();
|
|
1145
|
+
keyedSubscriptions.set(subscription, byId);
|
|
1146
|
+
}
|
|
1147
|
+
let entry = byId.get(id);
|
|
1148
|
+
if (!entry) {
|
|
1149
|
+
entry = create();
|
|
1150
|
+
byId.set(id, entry);
|
|
1151
|
+
}
|
|
1152
|
+
return entry;
|
|
1153
|
+
}
|
|
1154
|
+
function createRegistryContextValue(store) {
|
|
1155
|
+
return {
|
|
1156
|
+
actions: {
|
|
1157
|
+
batch: store.batch,
|
|
1158
|
+
register: store.register,
|
|
1159
|
+
transaction: store.transaction,
|
|
1160
|
+
unregister: store.unregister
|
|
1161
|
+
},
|
|
1162
|
+
subscription: {
|
|
1163
|
+
getEntriesSnapshot: store.getEntriesSnapshot,
|
|
1164
|
+
getSnapshot: store.getSnapshot,
|
|
1165
|
+
subscribe: store.subscribe
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
var RegistryContext = getOrCreateGlobalContext("RegistryContext", null);
|
|
1170
|
+
function RegistryProvider(t0) {
|
|
1171
|
+
const $ = c(8);
|
|
1172
|
+
const {
|
|
1173
|
+
children,
|
|
1174
|
+
definitions,
|
|
1175
|
+
initialEntries: t1
|
|
1176
|
+
} = t0;
|
|
1177
|
+
let t2;
|
|
1178
|
+
if ($[0] !== t1) {
|
|
1179
|
+
t2 = t1 === void 0 ? [] : t1;
|
|
1180
|
+
$[0] = t1;
|
|
1181
|
+
$[1] = t2;
|
|
1182
|
+
} else {
|
|
1183
|
+
t2 = $[1];
|
|
1184
|
+
}
|
|
1185
|
+
const initialEntries = t2;
|
|
1186
|
+
let t3;
|
|
1187
|
+
if ($[2] !== definitions || $[3] !== initialEntries) {
|
|
1188
|
+
t3 = () => createRegistryContextValue(createRegistryStore(initialEntries, definitions));
|
|
1189
|
+
$[2] = definitions;
|
|
1190
|
+
$[3] = initialEntries;
|
|
1191
|
+
$[4] = t3;
|
|
1192
|
+
} else {
|
|
1193
|
+
t3 = $[4];
|
|
1194
|
+
}
|
|
1195
|
+
const [contextValue] = useState(t3);
|
|
1196
|
+
let t4;
|
|
1197
|
+
if ($[5] !== children || $[6] !== contextValue) {
|
|
1198
|
+
t4 = /* @__PURE__ */ jsx(RegistryContext, { value: contextValue, children });
|
|
1199
|
+
$[5] = children;
|
|
1200
|
+
$[6] = contextValue;
|
|
1201
|
+
$[7] = t4;
|
|
1202
|
+
} else {
|
|
1203
|
+
t4 = $[7];
|
|
1204
|
+
}
|
|
1205
|
+
return t4;
|
|
1206
|
+
}
|
|
1207
|
+
function useRegistryActions() {
|
|
1208
|
+
return useRequiredContext(RegistryContext, "useRegistryActions", "RegistryProvider").actions;
|
|
1209
|
+
}
|
|
1210
|
+
function useRegistrySubscription() {
|
|
1211
|
+
return useRequiredContext(RegistryContext, "useRegistrySubscription", "RegistryProvider").subscription;
|
|
1212
|
+
}
|
|
1213
|
+
function useRegistryValue(type, key) {
|
|
1214
|
+
const $ = c(8);
|
|
1215
|
+
const subscription = useRegistrySubscription();
|
|
1216
|
+
const t0 = `value\0${type}\0${key}`;
|
|
1217
|
+
let t1;
|
|
1218
|
+
if ($[0] !== key || $[1] !== subscription || $[2] !== type) {
|
|
1219
|
+
t1 = () => ({
|
|
1220
|
+
getSnapshot: () => subscription.getSnapshot(type, key),
|
|
1221
|
+
subscribe: (listener) => subscription.subscribe(type, key, listener)
|
|
1222
|
+
});
|
|
1223
|
+
$[0] = key;
|
|
1224
|
+
$[1] = subscription;
|
|
1225
|
+
$[2] = type;
|
|
1226
|
+
$[3] = t1;
|
|
1227
|
+
} else {
|
|
1228
|
+
t1 = $[3];
|
|
1229
|
+
}
|
|
1230
|
+
let t2;
|
|
1231
|
+
if ($[4] !== subscription || $[5] !== t0 || $[6] !== t1) {
|
|
1232
|
+
t2 = keyedSubscription(subscription, t0, t1);
|
|
1233
|
+
$[4] = subscription;
|
|
1234
|
+
$[5] = t0;
|
|
1235
|
+
$[6] = t1;
|
|
1236
|
+
$[7] = t2;
|
|
1237
|
+
} else {
|
|
1238
|
+
t2 = $[7];
|
|
1239
|
+
}
|
|
1240
|
+
const {
|
|
1241
|
+
getSnapshot,
|
|
1242
|
+
subscribe
|
|
1243
|
+
} = t2;
|
|
1244
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
1245
|
+
}
|
|
1246
|
+
function useRegistryEntries(type) {
|
|
1247
|
+
const $ = c(7);
|
|
1248
|
+
const subscription = useRegistrySubscription();
|
|
1249
|
+
const t0 = `entries\0${type}`;
|
|
1250
|
+
let t1;
|
|
1251
|
+
if ($[0] !== subscription || $[1] !== type) {
|
|
1252
|
+
t1 = () => ({
|
|
1253
|
+
getSnapshot: () => subscription.getEntriesSnapshot(type),
|
|
1254
|
+
subscribe: (listener) => subscription.subscribe(type, null, listener)
|
|
1255
|
+
});
|
|
1256
|
+
$[0] = subscription;
|
|
1257
|
+
$[1] = type;
|
|
1258
|
+
$[2] = t1;
|
|
1259
|
+
} else {
|
|
1260
|
+
t1 = $[2];
|
|
1261
|
+
}
|
|
1262
|
+
let t2;
|
|
1263
|
+
if ($[3] !== subscription || $[4] !== t0 || $[5] !== t1) {
|
|
1264
|
+
t2 = keyedSubscription(subscription, t0, t1);
|
|
1265
|
+
$[3] = subscription;
|
|
1266
|
+
$[4] = t0;
|
|
1267
|
+
$[5] = t1;
|
|
1268
|
+
$[6] = t2;
|
|
1269
|
+
} else {
|
|
1270
|
+
t2 = $[6];
|
|
1271
|
+
}
|
|
1272
|
+
const {
|
|
1273
|
+
getSnapshot,
|
|
1274
|
+
subscribe
|
|
1275
|
+
} = t2;
|
|
1276
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
1277
|
+
}
|
|
1278
|
+
var EMPTY_MODULES = Object.freeze([]);
|
|
1279
|
+
var PassthroughBoundary = ({
|
|
1280
|
+
children
|
|
1281
|
+
}) => children;
|
|
1282
|
+
var ModuleHostContext = getOrCreateGlobalContext("ModuleHostContext", null);
|
|
1283
|
+
function selectModuleSlice(coreModule, config) {
|
|
1284
|
+
const slice = coreModule.page?.select ? coreModule.page.select(config) : config[coreModule.id];
|
|
1285
|
+
return slice ?? null;
|
|
1286
|
+
}
|
|
1287
|
+
function createModulePayload(modules, config, metadata = {}) {
|
|
1288
|
+
const payload = {};
|
|
1289
|
+
let hasSlices = false;
|
|
1290
|
+
for (const coreModule of modules) {
|
|
1291
|
+
if (!coreModule.page?.entries) continue;
|
|
1292
|
+
const slice = selectModuleSlice(coreModule, config);
|
|
1293
|
+
if (slice === null) continue;
|
|
1294
|
+
payload[coreModule.id] = slice;
|
|
1295
|
+
hasSlices = true;
|
|
1296
|
+
}
|
|
1297
|
+
if (!hasSlices) return null;
|
|
1298
|
+
return {
|
|
1299
|
+
...payload,
|
|
1300
|
+
registry: {
|
|
1301
|
+
...metadata,
|
|
1302
|
+
...isObject(config.registry) ? config.registry : {}
|
|
1303
|
+
}
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
var MODULE_ID_PATTERN = /^[a-z][a-zA-Z0-9]*$/;
|
|
1307
|
+
function sortModules(modules) {
|
|
1308
|
+
const byId = /* @__PURE__ */ new Map();
|
|
1309
|
+
for (const coreModule of modules) {
|
|
1310
|
+
if (!MODULE_ID_PATTERN.test(coreModule.id)) {
|
|
1311
|
+
throw new Error(`[Core] Invalid module id "${coreModule.id}": use a camelCase name such as "contextMenu".`);
|
|
1312
|
+
}
|
|
1313
|
+
if (byId.has(coreModule.id)) {
|
|
1314
|
+
throw new Error(`[Core] Module "${coreModule.id}" is installed twice.`);
|
|
1315
|
+
}
|
|
1316
|
+
byId.set(coreModule.id, coreModule);
|
|
1317
|
+
}
|
|
1318
|
+
const sorted = [];
|
|
1319
|
+
const state = /* @__PURE__ */ new Map();
|
|
1320
|
+
const visit = (coreModule, path) => {
|
|
1321
|
+
const current = state.get(coreModule.id);
|
|
1322
|
+
if (current === "done") return;
|
|
1323
|
+
if (current === "visiting") {
|
|
1324
|
+
throw new Error(`[Core] Module dependency cycle: ${[...path, coreModule.id].join(" -> ")}`);
|
|
1325
|
+
}
|
|
1326
|
+
state.set(coreModule.id, "visiting");
|
|
1327
|
+
for (const id of coreModule.uses ?? []) {
|
|
1328
|
+
const dependency = byId.get(id);
|
|
1329
|
+
if (dependency) visit(dependency, [...path, coreModule.id]);
|
|
1330
|
+
}
|
|
1331
|
+
state.set(coreModule.id, "done");
|
|
1332
|
+
sorted.push(coreModule);
|
|
1333
|
+
};
|
|
1334
|
+
modules.forEach((coreModule) => visit(coreModule, []));
|
|
1335
|
+
return sorted;
|
|
1336
|
+
}
|
|
1337
|
+
function createModuleRegistryDefinitions(modules) {
|
|
1338
|
+
const definitions = /* @__PURE__ */ new Map();
|
|
1339
|
+
for (const coreModule of modules) {
|
|
1340
|
+
if (coreModule.registry) definitions.set(coreModule.id, coreModule.registry);
|
|
1341
|
+
}
|
|
1342
|
+
return definitions;
|
|
1343
|
+
}
|
|
1344
|
+
function useInstalledModules() {
|
|
1345
|
+
return use(ModuleHostContext)?.modules ?? EMPTY_MODULES;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
// src/core/kernel/handlers.ts
|
|
1349
|
+
function isPersistentLifecycle(lifecycle) {
|
|
1350
|
+
return lifecycle === REGISTRY_LIFECYCLES.PERSISTENT;
|
|
1351
|
+
}
|
|
1352
|
+
function runRegistrationBatch(context, executor) {
|
|
1353
|
+
return typeof context.batch === "function" ? context.batch(executor) : executor(context);
|
|
1354
|
+
}
|
|
1355
|
+
function createEntryCleanupKey(type, key, source, instanceId, scope) {
|
|
1356
|
+
return JSON.stringify(["entry", type, key, scope ?? null, source, instanceId]);
|
|
1357
|
+
}
|
|
1358
|
+
function getCleanupScope(context) {
|
|
1359
|
+
return context?.cleanupScope || /* @__PURE__ */ new Map();
|
|
1360
|
+
}
|
|
1361
|
+
function clearCleanupTimer(scope, cleanupKey) {
|
|
1362
|
+
const lifecycle = scope.get(cleanupKey);
|
|
1363
|
+
if (!lifecycle) return;
|
|
1364
|
+
lifecycle.cancelled = true;
|
|
1365
|
+
if (lifecycle.timerId !== null) clearTimeout(lifecycle.timerId);
|
|
1366
|
+
scope.delete(cleanupKey);
|
|
1367
|
+
}
|
|
1368
|
+
function scheduleCleanup(scope, cleanupKey, callback, delayMs) {
|
|
1369
|
+
clearCleanupTimer(scope, cleanupKey);
|
|
1370
|
+
const lifecycle = {
|
|
1371
|
+
cancelled: false,
|
|
1372
|
+
timerId: null
|
|
1373
|
+
};
|
|
1374
|
+
lifecycle.timerId = setTimeout(() => {
|
|
1375
|
+
if (lifecycle.cancelled || scope.get(cleanupKey) !== lifecycle) return;
|
|
1376
|
+
scope.delete(cleanupKey);
|
|
1377
|
+
callback();
|
|
1378
|
+
}, delayMs);
|
|
1379
|
+
scope.set(cleanupKey, lifecycle);
|
|
1380
|
+
}
|
|
1381
|
+
function resolveItemMetadata(item, pageMetadata) {
|
|
1382
|
+
const itemMetadata = isObject(item) && isObject(item.registry) ? item.registry : {};
|
|
1383
|
+
return {
|
|
1384
|
+
...pageMetadata,
|
|
1385
|
+
...itemMetadata
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1388
|
+
function stripRegistryKey(item) {
|
|
1389
|
+
if (!isObject(item)) return item;
|
|
1390
|
+
return Object.fromEntries(Object.entries(item).filter(([key]) => key !== "registry"));
|
|
1391
|
+
}
|
|
1392
|
+
function collectModuleRegistrations(coreModule, slice, pageMetadata, context) {
|
|
1393
|
+
const definition = coreModule.registry;
|
|
1394
|
+
const toEntries = coreModule.page?.entries;
|
|
1395
|
+
if (!definition || !toEntries || slice == null || slice === false) return [];
|
|
1396
|
+
const type = coreModule.id;
|
|
1397
|
+
const items = Array.isArray(slice) ? slice : [slice];
|
|
1398
|
+
const registrations = [];
|
|
1399
|
+
for (const item of items) {
|
|
1400
|
+
if (item == null || item === false) continue;
|
|
1401
|
+
const metadata = resolveItemMetadata(item, pageMetadata);
|
|
1402
|
+
if (metadata.validation === REGISTRY_VALIDATION_MODES.STRICT && !validateRegistryMetadata(metadata).valid) {
|
|
1403
|
+
continue;
|
|
1404
|
+
}
|
|
1405
|
+
const payload = stripRegistryKey(item);
|
|
1406
|
+
const {
|
|
1407
|
+
cleanupDelayMs,
|
|
1408
|
+
lifecycle,
|
|
1409
|
+
registerOptions,
|
|
1410
|
+
scope,
|
|
1411
|
+
source
|
|
1412
|
+
} = normalizeRegistryMetadata(metadata, {
|
|
1413
|
+
defaultCleanupDelayMs: definition.cleanupDelayMs ?? null,
|
|
1414
|
+
defaultLifecycle: definition.lifecycle,
|
|
1415
|
+
defaultSource: DEFAULT_SOURCE
|
|
1416
|
+
});
|
|
1417
|
+
for (const {
|
|
1418
|
+
key,
|
|
1419
|
+
value
|
|
1420
|
+
} of toEntries(payload, context) ?? []) {
|
|
1421
|
+
const validation = definition.validate?.(value);
|
|
1422
|
+
if (validation && !validation.valid) {
|
|
1423
|
+
report(`Registry ${type} config is invalid`, validation.issues, "warn");
|
|
1424
|
+
continue;
|
|
1425
|
+
}
|
|
1426
|
+
registrations.push({
|
|
1427
|
+
cleanupDelayMs,
|
|
1428
|
+
cleanupKey: createEntryCleanupKey(type, key, source, context.instanceId, scope),
|
|
1429
|
+
key,
|
|
1430
|
+
lifecycle,
|
|
1431
|
+
registerOptions,
|
|
1432
|
+
scope,
|
|
1433
|
+
source,
|
|
1434
|
+
type,
|
|
1435
|
+
value
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
return registrations;
|
|
1440
|
+
}
|
|
1441
|
+
function collectRegistrations(modules, config, context) {
|
|
1442
|
+
const pageMetadata = isObject(config.registry) ? config.registry : {};
|
|
1443
|
+
const slices = config;
|
|
1444
|
+
return modules.flatMap((coreModule) => {
|
|
1445
|
+
try {
|
|
1446
|
+
return collectModuleRegistrations(coreModule, slices[coreModule.id], pageMetadata, context);
|
|
1447
|
+
} catch (error) {
|
|
1448
|
+
report(`Registry apply (${coreModule.id})`, error);
|
|
1449
|
+
return [];
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
function hasCleanupDelay(delayMs) {
|
|
1454
|
+
return typeof delayMs === "number" && delayMs > 0;
|
|
1455
|
+
}
|
|
1456
|
+
function createTeardown(registrations, context, cleanupScope) {
|
|
1457
|
+
const owner = (registration) => ({
|
|
1458
|
+
instanceId: context.instanceId,
|
|
1459
|
+
scope: registration.scope,
|
|
1460
|
+
source: registration.source
|
|
1461
|
+
});
|
|
1462
|
+
return () => {
|
|
1463
|
+
const immediate = [];
|
|
1464
|
+
registrations.forEach((registration) => {
|
|
1465
|
+
if (isPersistentLifecycle(registration.lifecycle)) return;
|
|
1466
|
+
const {
|
|
1467
|
+
cleanupDelayMs,
|
|
1468
|
+
cleanupKey,
|
|
1469
|
+
key,
|
|
1470
|
+
type
|
|
1471
|
+
} = registration;
|
|
1472
|
+
if (hasCleanupDelay(cleanupDelayMs)) {
|
|
1473
|
+
scheduleCleanup(cleanupScope, cleanupKey, () => context.unregister(type, key, owner(registration)), cleanupDelayMs);
|
|
1474
|
+
} else {
|
|
1475
|
+
immediate.push(registration);
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
if (immediate.length === 0) return;
|
|
1479
|
+
runRegistrationBatch(context, (queue) => {
|
|
1480
|
+
immediate.forEach((registration) => queue.unregister(registration.type, registration.key, owner(registration)));
|
|
1481
|
+
});
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
var NO_CLEANUP = () => {
|
|
1485
|
+
};
|
|
1486
|
+
function applyRegistryConfig(config, context) {
|
|
1487
|
+
const modules = context.modules ?? [];
|
|
1488
|
+
if (!config || modules.length === 0) return NO_CLEANUP;
|
|
1489
|
+
const registrations = collectRegistrations(modules, config, context);
|
|
1490
|
+
if (registrations.length === 0) return NO_CLEANUP;
|
|
1491
|
+
const cleanupScope = getCleanupScope(context);
|
|
1492
|
+
runRegistrationBatch(context, (queue) => {
|
|
1493
|
+
registrations.forEach(({
|
|
1494
|
+
cleanupKey,
|
|
1495
|
+
key,
|
|
1496
|
+
registerOptions,
|
|
1497
|
+
source,
|
|
1498
|
+
type,
|
|
1499
|
+
value
|
|
1500
|
+
}) => {
|
|
1501
|
+
clearCleanupTimer(cleanupScope, cleanupKey);
|
|
1502
|
+
queue.register(type, key, value, source, registerOptions);
|
|
1503
|
+
});
|
|
1504
|
+
});
|
|
1505
|
+
return createTeardown(registrations, context, cleanupScope);
|
|
1506
|
+
}
|
|
1507
|
+
var MAX_STABILIZATION_DEPTH = 64;
|
|
1508
|
+
function createStableFunctionEntry(fn) {
|
|
1509
|
+
const entry = {
|
|
1510
|
+
current: fn,
|
|
1511
|
+
stable(...args) {
|
|
1512
|
+
return entry.current?.apply(this, args);
|
|
1513
|
+
}
|
|
1514
|
+
};
|
|
1515
|
+
return entry;
|
|
1516
|
+
}
|
|
1517
|
+
function isDirectRegistryComponentPath(path, componentSlices) {
|
|
1518
|
+
const match = /^config\.([^.[]+)\.[^.[]+$/.exec(path);
|
|
1519
|
+
return Boolean(match && componentSlices.has(match[1]));
|
|
1520
|
+
}
|
|
1521
|
+
function isReactNodeLike(value) {
|
|
1522
|
+
return value === null || value === void 0 || typeof value === "boolean" || typeof value === "string" || typeof value === "number" || isValidElement(value);
|
|
1523
|
+
}
|
|
1524
|
+
function isStabilizableObject(value) {
|
|
1525
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && !isValidElement(value);
|
|
1526
|
+
}
|
|
1527
|
+
function hasSameObjectKeys(previousValue, nextValue) {
|
|
1528
|
+
if (!isStabilizableObject(previousValue) || !isStabilizableObject(nextValue)) {
|
|
1529
|
+
return false;
|
|
1530
|
+
}
|
|
1531
|
+
const previousKeys = Object.keys(previousValue);
|
|
1532
|
+
const nextKeys = Object.keys(nextValue);
|
|
1533
|
+
if (previousKeys.length !== nextKeys.length) return false;
|
|
1534
|
+
return nextKeys.every((key) => Object.prototype.hasOwnProperty.call(previousValue, key));
|
|
1535
|
+
}
|
|
1536
|
+
function stabilizeFunction(fn, path, scope) {
|
|
1537
|
+
const isComponent = fn.name && /^[A-Z]/.test(fn.name);
|
|
1538
|
+
if (isComponent || isDirectRegistryComponentPath(path, scope.componentSlices)) {
|
|
1539
|
+
return fn;
|
|
1540
|
+
}
|
|
1541
|
+
scope.usedPaths.add(path);
|
|
1542
|
+
let entry = scope.functionEntries.get(path);
|
|
1543
|
+
if (!entry) {
|
|
1544
|
+
entry = createStableFunctionEntry(fn);
|
|
1545
|
+
scope.functionEntries.set(path, entry);
|
|
1546
|
+
} else {
|
|
1547
|
+
entry.current = fn;
|
|
1548
|
+
}
|
|
1549
|
+
return entry.stable;
|
|
1550
|
+
}
|
|
1551
|
+
function stabilizeElement(element, path, previousValue, state) {
|
|
1552
|
+
const nextProps = stabilizeNested(element.props, `${path}.props`, isValidElement(previousValue) ? previousValue.props : void 0, state);
|
|
1553
|
+
if (isValidElement(previousValue) && previousValue.type === element.type && previousValue.key === element.key && previousValue.props === nextProps) {
|
|
1554
|
+
return previousValue;
|
|
1555
|
+
}
|
|
1556
|
+
return cloneElement(element, nextProps);
|
|
1557
|
+
}
|
|
1558
|
+
function stabilizeArray(array, path, previousValue, state) {
|
|
1559
|
+
const nextValue = array.every(isReactNodeLike) ? Children.toArray(array) : array;
|
|
1560
|
+
const previousArray = Array.isArray(previousValue) ? previousValue : null;
|
|
1561
|
+
let hasChanged = !previousArray || previousArray.length !== nextValue.length;
|
|
1562
|
+
const stabilizedValue = nextValue.map((item, index) => {
|
|
1563
|
+
const nextItem = stabilizeNested(item, `${path}[${index}]`, previousArray?.[index], state);
|
|
1564
|
+
if (!previousArray || nextItem !== previousArray[index]) {
|
|
1565
|
+
hasChanged = true;
|
|
1566
|
+
}
|
|
1567
|
+
return nextItem;
|
|
1568
|
+
});
|
|
1569
|
+
return !hasChanged ? previousArray : stabilizedValue;
|
|
1570
|
+
}
|
|
1571
|
+
function stabilizeObject(source, path, previousValue, state) {
|
|
1572
|
+
const previousRecord = previousValue;
|
|
1573
|
+
const stabilizedValue = {};
|
|
1574
|
+
const canReusePrevious = hasSameObjectKeys(previousValue, source);
|
|
1575
|
+
let hasChanged = !canReusePrevious;
|
|
1576
|
+
Object.keys(source).forEach((key) => {
|
|
1577
|
+
const nextValue = stabilizeNested(source[key], `${path}.${key}`, previousRecord?.[key], state);
|
|
1578
|
+
stabilizedValue[key] = nextValue;
|
|
1579
|
+
if (!canReusePrevious || nextValue !== previousRecord?.[key]) {
|
|
1580
|
+
hasChanged = true;
|
|
1581
|
+
}
|
|
1582
|
+
});
|
|
1583
|
+
return !hasChanged ? previousValue : stabilizedValue;
|
|
1584
|
+
}
|
|
1585
|
+
function stabilizeNested(value, path, previousValue, state) {
|
|
1586
|
+
return stabilize(value, path, previousValue, {
|
|
1587
|
+
...state,
|
|
1588
|
+
depth: state.depth + 1
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
function stabilize(value, path, previousValue, state) {
|
|
1592
|
+
if (state.depth > MAX_STABILIZATION_DEPTH) return value;
|
|
1593
|
+
if (typeof value === "function") {
|
|
1594
|
+
return stabilizeFunction(value, path, state.scope);
|
|
1595
|
+
}
|
|
1596
|
+
if (value && typeof value === "object") {
|
|
1597
|
+
if (state.seen.has(value)) return value;
|
|
1598
|
+
state.seen.add(value);
|
|
1599
|
+
}
|
|
1600
|
+
if (isValidElement(value)) {
|
|
1601
|
+
return stabilizeElement(value, path, previousValue, state);
|
|
1602
|
+
}
|
|
1603
|
+
if (Array.isArray(value)) {
|
|
1604
|
+
return stabilizeArray(value, path, previousValue, state);
|
|
1605
|
+
}
|
|
1606
|
+
if (typeof value !== "object" || value === null) return value;
|
|
1607
|
+
return stabilizeObject(value, path, previousValue, state);
|
|
1608
|
+
}
|
|
1609
|
+
function stabilizeRegistryValue(value, path, scope, previousValue, seen = /* @__PURE__ */ new WeakSet(), depth = 0) {
|
|
1610
|
+
return stabilize(value, path, previousValue, {
|
|
1611
|
+
depth,
|
|
1612
|
+
scope,
|
|
1613
|
+
seen
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
// src/core/kernel/hooks.ts
|
|
1618
|
+
function withInstanceId(instanceId, sourceOrOptions, optionsArg) {
|
|
1619
|
+
if (typeof sourceOrOptions === "string") {
|
|
1620
|
+
return {
|
|
1621
|
+
optionsArg: {
|
|
1622
|
+
...isObject(optionsArg) ? optionsArg : {},
|
|
1623
|
+
instanceId
|
|
1624
|
+
},
|
|
1625
|
+
sourceOrOptions
|
|
1626
|
+
};
|
|
1627
|
+
}
|
|
1628
|
+
if (isObject(sourceOrOptions)) {
|
|
1629
|
+
return {
|
|
1630
|
+
optionsArg,
|
|
1631
|
+
sourceOrOptions: {
|
|
1632
|
+
...sourceOrOptions,
|
|
1633
|
+
instanceId
|
|
1634
|
+
}
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1637
|
+
return {
|
|
1638
|
+
optionsArg: void 0,
|
|
1639
|
+
sourceOrOptions: {
|
|
1640
|
+
...isObject(optionsArg) ? optionsArg : {},
|
|
1641
|
+
instanceId
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
function withInstanceIdForUnregister(instanceId, sourceOrOptions) {
|
|
1646
|
+
if (typeof sourceOrOptions === "string") {
|
|
1647
|
+
return {
|
|
1648
|
+
instanceId,
|
|
1649
|
+
source: sourceOrOptions
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
if (isObject(sourceOrOptions)) {
|
|
1653
|
+
return {
|
|
1654
|
+
...sourceOrOptions,
|
|
1655
|
+
instanceId
|
|
1656
|
+
};
|
|
1657
|
+
}
|
|
1658
|
+
return {
|
|
1659
|
+
instanceId
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
function resolveRegisterArgsWithInstance(instanceId, sourceOrOptions, optionsArg) {
|
|
1663
|
+
const input = withInstanceId(instanceId, sourceOrOptions, optionsArg);
|
|
1664
|
+
return [input.sourceOrOptions, input.optionsArg];
|
|
1665
|
+
}
|
|
1666
|
+
function useShallowStable(value) {
|
|
1667
|
+
const ref = useRef(value);
|
|
1668
|
+
if (ref.current !== value && !shallowEqual(ref.current, value)) {
|
|
1669
|
+
ref.current = value;
|
|
1670
|
+
}
|
|
1671
|
+
return ref.current;
|
|
1672
|
+
}
|
|
1673
|
+
var NO_METADATA = Object.freeze({});
|
|
1674
|
+
function sameContextInputs(a, b) {
|
|
1675
|
+
return a.actions.batch === b.actions.batch && a.actions.register === b.actions.register && a.actions.unregister === b.actions.unregister && a.cleanupScope === b.cleanupScope && a.instanceId === b.instanceId && a.modules === b.modules && a.pathname === b.pathname;
|
|
1676
|
+
}
|
|
1677
|
+
function samePayloadInputs(a, b) {
|
|
1678
|
+
return a.config === b.config && a.modules === b.modules && shallowEqual(a.metadata ?? NO_METADATA, b.metadata ?? NO_METADATA);
|
|
1679
|
+
}
|
|
1680
|
+
function componentSliceIds(modules) {
|
|
1681
|
+
return new Set(modules.filter((coreModule) => coreModule.registry?.valueKind === "component").map((coreModule) => coreModule.id));
|
|
1682
|
+
}
|
|
1683
|
+
function useAppliedRegistryConfig(inputs) {
|
|
1684
|
+
const $ = c(5);
|
|
1685
|
+
let t0;
|
|
1686
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1687
|
+
t0 = /* @__PURE__ */ new Map();
|
|
1688
|
+
$[0] = t0;
|
|
1689
|
+
} else {
|
|
1690
|
+
t0 = $[0];
|
|
1691
|
+
}
|
|
1692
|
+
const functionEntriesRef = useRef(t0);
|
|
1693
|
+
const appliedRef = useRef(null);
|
|
1694
|
+
let t1;
|
|
1695
|
+
if ($[1] !== inputs) {
|
|
1696
|
+
t1 = () => {
|
|
1697
|
+
const previous = appliedRef.current;
|
|
1698
|
+
const sameContext = previous !== null && sameContextInputs(previous.inputs, inputs);
|
|
1699
|
+
if (previous && sameContext && samePayloadInputs(previous.inputs, inputs)) {
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
const context = previous && sameContext ? previous.context : createRegistryApplyContext(inputs.actions, inputs);
|
|
1703
|
+
const payload = inputs.config ? createModulePayload(inputs.modules, inputs.config, inputs.metadata) : null;
|
|
1704
|
+
const componentSlices = componentSliceIds(inputs.modules);
|
|
1705
|
+
const functionEntries = functionEntriesRef.current;
|
|
1706
|
+
const usedPaths = /* @__PURE__ */ new Set();
|
|
1707
|
+
const config = stabilizeRegistryValue(payload, "config", {
|
|
1708
|
+
componentSlices,
|
|
1709
|
+
functionEntries,
|
|
1710
|
+
usedPaths
|
|
1711
|
+
}, previous?.config);
|
|
1712
|
+
functionEntries.forEach((_entry, path) => {
|
|
1713
|
+
if (!usedPaths.has(path)) {
|
|
1714
|
+
functionEntries.delete(path);
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
if (previous && previous.config === config && sameContext) {
|
|
1718
|
+
previous.inputs = inputs;
|
|
1719
|
+
return;
|
|
1720
|
+
}
|
|
1721
|
+
previous?.cleanup();
|
|
1722
|
+
appliedRef.current = {
|
|
1723
|
+
cleanup: applyRegistryConfig(config, context),
|
|
1724
|
+
config,
|
|
1725
|
+
context,
|
|
1726
|
+
inputs
|
|
1727
|
+
};
|
|
1728
|
+
};
|
|
1729
|
+
$[1] = inputs;
|
|
1730
|
+
$[2] = t1;
|
|
1731
|
+
} else {
|
|
1732
|
+
t1 = $[2];
|
|
1733
|
+
}
|
|
1734
|
+
useLayoutEffect(t1);
|
|
1735
|
+
let t2;
|
|
1736
|
+
let t3;
|
|
1737
|
+
if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1738
|
+
t2 = () => () => {
|
|
1739
|
+
appliedRef.current?.cleanup();
|
|
1740
|
+
appliedRef.current = null;
|
|
1741
|
+
};
|
|
1742
|
+
t3 = [];
|
|
1743
|
+
$[3] = t2;
|
|
1744
|
+
$[4] = t3;
|
|
1745
|
+
} else {
|
|
1746
|
+
t2 = $[3];
|
|
1747
|
+
t3 = $[4];
|
|
1748
|
+
}
|
|
1749
|
+
useLayoutEffect(t2, t3);
|
|
1750
|
+
}
|
|
1751
|
+
function stampQueue(queue, instanceId) {
|
|
1752
|
+
return {
|
|
1753
|
+
register: (type, key, item, sourceOrOptions, optionsArg) => queue.register(type, key, item, ...resolveRegisterArgsWithInstance(instanceId, sourceOrOptions, optionsArg)),
|
|
1754
|
+
unregister: (type, key, sourceOrOptions) => queue.unregister(type, key, withInstanceIdForUnregister(instanceId, sourceOrOptions))
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
function createRegistryApplyContext(actions, {
|
|
1758
|
+
cleanupScope = /* @__PURE__ */ new Map(),
|
|
1759
|
+
instanceId,
|
|
1760
|
+
modules = [],
|
|
1761
|
+
pathname
|
|
1762
|
+
}) {
|
|
1763
|
+
return {
|
|
1764
|
+
...stampQueue(actions, instanceId),
|
|
1765
|
+
batch: (executor) => typeof executor === "function" ? actions.batch((queue) => executor(stampQueue(queue, instanceId))) : 0,
|
|
1766
|
+
cleanupScope,
|
|
1767
|
+
instanceId,
|
|
1768
|
+
modules,
|
|
1769
|
+
pathname
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
function useRegistry(config, metadata) {
|
|
1773
|
+
const $ = c(12);
|
|
1774
|
+
const {
|
|
1775
|
+
batch,
|
|
1776
|
+
register,
|
|
1777
|
+
unregister
|
|
1778
|
+
} = useRegistryActions();
|
|
1779
|
+
const pathname = usePathname();
|
|
1780
|
+
const modules = useInstalledModules();
|
|
1781
|
+
const instanceId = `registry-instance-${useId()}`;
|
|
1782
|
+
const [cleanupScope] = useState(_temp);
|
|
1783
|
+
let t0;
|
|
1784
|
+
if ($[0] !== batch || $[1] !== register || $[2] !== unregister) {
|
|
1785
|
+
t0 = {
|
|
1786
|
+
batch,
|
|
1787
|
+
register,
|
|
1788
|
+
unregister
|
|
1789
|
+
};
|
|
1790
|
+
$[0] = batch;
|
|
1791
|
+
$[1] = register;
|
|
1792
|
+
$[2] = unregister;
|
|
1793
|
+
$[3] = t0;
|
|
1794
|
+
} else {
|
|
1795
|
+
t0 = $[3];
|
|
1796
|
+
}
|
|
1797
|
+
let t1;
|
|
1798
|
+
if ($[4] !== cleanupScope || $[5] !== config || $[6] !== instanceId || $[7] !== metadata || $[8] !== modules || $[9] !== pathname || $[10] !== t0) {
|
|
1799
|
+
t1 = {
|
|
1800
|
+
actions: t0,
|
|
1801
|
+
cleanupScope,
|
|
1802
|
+
config,
|
|
1803
|
+
instanceId,
|
|
1804
|
+
metadata,
|
|
1805
|
+
modules,
|
|
1806
|
+
pathname
|
|
1807
|
+
};
|
|
1808
|
+
$[4] = cleanupScope;
|
|
1809
|
+
$[5] = config;
|
|
1810
|
+
$[6] = instanceId;
|
|
1811
|
+
$[7] = metadata;
|
|
1812
|
+
$[8] = modules;
|
|
1813
|
+
$[9] = pathname;
|
|
1814
|
+
$[10] = t0;
|
|
1815
|
+
$[11] = t1;
|
|
1816
|
+
} else {
|
|
1817
|
+
t1 = $[11];
|
|
1818
|
+
}
|
|
1819
|
+
useAppliedRegistryConfig(t1);
|
|
1820
|
+
}
|
|
1821
|
+
function _temp() {
|
|
1822
|
+
return /* @__PURE__ */ new Map();
|
|
1823
|
+
}
|
|
1824
|
+
var EMPTY_OBJECT = Object.freeze({});
|
|
1825
|
+
function createPageControllerStore() {
|
|
1826
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
1827
|
+
let stack = [];
|
|
1828
|
+
const notify = () => {
|
|
1829
|
+
listeners.forEach((listener) => {
|
|
1830
|
+
try {
|
|
1831
|
+
listener();
|
|
1832
|
+
} catch (error) {
|
|
1833
|
+
report("Page controller listener", error);
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
};
|
|
1837
|
+
return {
|
|
1838
|
+
getSnapshot() {
|
|
1839
|
+
const top = stack[stack.length - 1];
|
|
1840
|
+
return top?.controllerRef?.current || null;
|
|
1841
|
+
},
|
|
1842
|
+
notify,
|
|
1843
|
+
register(id, controllerRef) {
|
|
1844
|
+
stack = stack.filter((item) => item.id !== id);
|
|
1845
|
+
stack.push({
|
|
1846
|
+
controllerRef,
|
|
1847
|
+
id
|
|
1848
|
+
});
|
|
1849
|
+
notify();
|
|
1850
|
+
},
|
|
1851
|
+
subscribe(listener) {
|
|
1852
|
+
listeners.add(listener);
|
|
1853
|
+
return () => {
|
|
1854
|
+
listeners.delete(listener);
|
|
1855
|
+
};
|
|
1856
|
+
},
|
|
1857
|
+
unregister(id) {
|
|
1858
|
+
stack = stack.filter((item) => item.id !== id);
|
|
1859
|
+
notify();
|
|
1860
|
+
}
|
|
1861
|
+
};
|
|
1862
|
+
}
|
|
1863
|
+
function createControllerScope() {
|
|
1864
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
1865
|
+
let current = null;
|
|
1866
|
+
const subscribe = (listener) => {
|
|
1867
|
+
listeners.add(listener);
|
|
1868
|
+
return () => {
|
|
1869
|
+
listeners.delete(listener);
|
|
1870
|
+
};
|
|
1871
|
+
};
|
|
1872
|
+
const getSnapshot = () => current;
|
|
1873
|
+
function PageProvider(t0) {
|
|
1874
|
+
const $ = c(3);
|
|
1875
|
+
const {
|
|
1876
|
+
children
|
|
1877
|
+
} = t0;
|
|
1878
|
+
const controller = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
1879
|
+
let t1;
|
|
1880
|
+
if ($[0] !== children || $[1] !== controller) {
|
|
1881
|
+
t1 = /* @__PURE__ */ jsx(PageControllerContext, { value: controller, children });
|
|
1882
|
+
$[0] = children;
|
|
1883
|
+
$[1] = controller;
|
|
1884
|
+
$[2] = t1;
|
|
1885
|
+
} else {
|
|
1886
|
+
t1 = $[2];
|
|
1887
|
+
}
|
|
1888
|
+
return t1;
|
|
1889
|
+
}
|
|
1890
|
+
return {
|
|
1891
|
+
Provider: PageProvider,
|
|
1892
|
+
publish(controller) {
|
|
1893
|
+
if (current === controller) return;
|
|
1894
|
+
current = controller;
|
|
1895
|
+
listeners.forEach((listener) => listener());
|
|
1896
|
+
}
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
var fallbackStandaloneStore = createPageControllerStore();
|
|
1900
|
+
var noopHook = () => {
|
|
1901
|
+
};
|
|
1902
|
+
var PassthroughProvider = ({
|
|
1903
|
+
children
|
|
1904
|
+
}) => children;
|
|
1905
|
+
var PageControllerContext = getOrCreateGlobalContext("PageControllerContext", null);
|
|
1906
|
+
var PageControllerStoreContext = getOrCreateGlobalContext("PageControllerStoreContext", fallbackStandaloneStore);
|
|
1907
|
+
function PageControllerProvider(t0) {
|
|
1908
|
+
const $ = c(3);
|
|
1909
|
+
const {
|
|
1910
|
+
children
|
|
1911
|
+
} = t0;
|
|
1912
|
+
const [store] = useState(_temp2);
|
|
1913
|
+
let t1;
|
|
1914
|
+
if ($[0] !== children || $[1] !== store) {
|
|
1915
|
+
t1 = /* @__PURE__ */ jsx(PageControllerStoreContext, { value: store, children });
|
|
1916
|
+
$[0] = children;
|
|
1917
|
+
$[1] = store;
|
|
1918
|
+
$[2] = t1;
|
|
1919
|
+
} else {
|
|
1920
|
+
t1 = $[2];
|
|
1921
|
+
}
|
|
1922
|
+
return t1;
|
|
1923
|
+
}
|
|
1924
|
+
function _temp2() {
|
|
1925
|
+
return createPageControllerStore();
|
|
1926
|
+
}
|
|
1927
|
+
var emptySubscribe = () => () => {
|
|
1928
|
+
};
|
|
1929
|
+
var getNullSnapshot = () => null;
|
|
1930
|
+
var FALLBACK_PAGE_CONTROLLER = Object.freeze({
|
|
1931
|
+
Provider: PassthroughProvider,
|
|
1932
|
+
config: EMPTY_OBJECT,
|
|
1933
|
+
modules: Object.freeze({}),
|
|
1934
|
+
reset: noopHook,
|
|
1935
|
+
set: noopHook
|
|
1936
|
+
});
|
|
1937
|
+
function usePageController() {
|
|
1938
|
+
const scopedContext = use(PageControllerContext);
|
|
1939
|
+
const controllerStore = use(PageControllerStoreContext);
|
|
1940
|
+
const storeSubscribe = scopedContext ? emptySubscribe : controllerStore.subscribe;
|
|
1941
|
+
const storeSnapshot = scopedContext ? getNullSnapshot : controllerStore.getSnapshot;
|
|
1942
|
+
const storeController = useSyncExternalStore(storeSubscribe, storeSnapshot, getNullSnapshot);
|
|
1943
|
+
return scopedContext ?? storeController ?? FALLBACK_PAGE_CONTROLLER;
|
|
1944
|
+
}
|
|
1945
|
+
function createOverrideApi(setOverrides) {
|
|
1946
|
+
const set = (partial) => {
|
|
1947
|
+
if (!partial || typeof partial !== "object") return;
|
|
1948
|
+
setOverrides((prev) => mergeModuleConfigs(prev, partial));
|
|
1949
|
+
};
|
|
1950
|
+
const reset = () => setOverrides(EMPTY_OBJECT);
|
|
1951
|
+
return {
|
|
1952
|
+
page: {
|
|
1953
|
+
set
|
|
1954
|
+
},
|
|
1955
|
+
reset,
|
|
1956
|
+
set
|
|
1957
|
+
};
|
|
1958
|
+
}
|
|
1959
|
+
function usePageOverrides(pageConfig) {
|
|
1960
|
+
const $ = c(7);
|
|
1961
|
+
const [overrides, setOverrides] = useState(EMPTY_OBJECT);
|
|
1962
|
+
let t0;
|
|
1963
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1964
|
+
t0 = () => createOverrideApi(setOverrides);
|
|
1965
|
+
$[0] = t0;
|
|
1966
|
+
} else {
|
|
1967
|
+
t0 = $[0];
|
|
1968
|
+
}
|
|
1969
|
+
const [api] = useState(t0);
|
|
1970
|
+
let t1;
|
|
1971
|
+
bb0: {
|
|
1972
|
+
const base = pageConfig || EMPTY_OBJECT;
|
|
1973
|
+
if (Object.keys(overrides).length === 0) {
|
|
1974
|
+
t1 = base;
|
|
1975
|
+
break bb0;
|
|
1976
|
+
}
|
|
1977
|
+
let t22;
|
|
1978
|
+
if ($[1] !== base || $[2] !== overrides) {
|
|
1979
|
+
t22 = mergeModuleConfigs(base, overrides);
|
|
1980
|
+
$[1] = base;
|
|
1981
|
+
$[2] = overrides;
|
|
1982
|
+
$[3] = t22;
|
|
1983
|
+
} else {
|
|
1984
|
+
t22 = $[3];
|
|
1985
|
+
}
|
|
1986
|
+
t1 = t22;
|
|
1987
|
+
}
|
|
1988
|
+
const effectiveConfig = t1;
|
|
1989
|
+
let t2;
|
|
1990
|
+
if ($[4] !== api || $[5] !== effectiveConfig) {
|
|
1991
|
+
t2 = {
|
|
1992
|
+
api,
|
|
1993
|
+
effectiveConfig
|
|
1994
|
+
};
|
|
1995
|
+
$[4] = api;
|
|
1996
|
+
$[5] = effectiveConfig;
|
|
1997
|
+
$[6] = t2;
|
|
1998
|
+
} else {
|
|
1999
|
+
t2 = $[6];
|
|
2000
|
+
}
|
|
2001
|
+
return t2;
|
|
2002
|
+
}
|
|
2003
|
+
function useModuleControllers(modules, effectiveConfig, pageApi) {
|
|
2004
|
+
"use no memo";
|
|
2005
|
+
const moduleSlices = useMemo(() => modules.map((coreModule) => selectModuleSlice(coreModule, effectiveConfig)), [effectiveConfig, modules]);
|
|
2006
|
+
const moduleControllers = {};
|
|
2007
|
+
for (let index = 0; index < modules.length; index += 1) {
|
|
2008
|
+
const coreModule_0 = modules[index];
|
|
2009
|
+
if (coreModule_0.page?.use) {
|
|
2010
|
+
moduleControllers[coreModule_0.id] = coreModule_0.page.use(moduleSlices[index], pageApi);
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
return useShallowStable(moduleControllers);
|
|
2014
|
+
}
|
|
2015
|
+
function usePage(t0, options) {
|
|
2016
|
+
const $ = c(17);
|
|
2017
|
+
const pageConfig = t0 === void 0 ? EMPTY_OBJECT : t0;
|
|
2018
|
+
const instanceId = useId();
|
|
2019
|
+
const controllerStore = use(PageControllerStoreContext);
|
|
2020
|
+
const modules = useInstalledModules();
|
|
2021
|
+
const {
|
|
2022
|
+
api,
|
|
2023
|
+
effectiveConfig
|
|
2024
|
+
} = usePageOverrides(pageConfig);
|
|
2025
|
+
const {
|
|
2026
|
+
reset,
|
|
2027
|
+
set
|
|
2028
|
+
} = api;
|
|
2029
|
+
let t1;
|
|
2030
|
+
if ($[0] !== options) {
|
|
2031
|
+
t1 = pickRegistryMetadata(options);
|
|
2032
|
+
$[0] = options;
|
|
2033
|
+
$[1] = t1;
|
|
2034
|
+
} else {
|
|
2035
|
+
t1 = $[1];
|
|
2036
|
+
}
|
|
2037
|
+
useRegistry(effectiveConfig, t1);
|
|
2038
|
+
const pageModules = useModuleControllers(modules, effectiveConfig, api.page);
|
|
2039
|
+
const [scope] = useState(createControllerScope);
|
|
2040
|
+
let t2;
|
|
2041
|
+
if ($[2] !== effectiveConfig || $[3] !== pageModules || $[4] !== reset || $[5] !== scope.Provider || $[6] !== set) {
|
|
2042
|
+
t2 = {
|
|
2043
|
+
Provider: scope.Provider,
|
|
2044
|
+
config: effectiveConfig,
|
|
2045
|
+
modules: pageModules,
|
|
2046
|
+
reset,
|
|
2047
|
+
set
|
|
2048
|
+
};
|
|
2049
|
+
$[2] = effectiveConfig;
|
|
2050
|
+
$[3] = pageModules;
|
|
2051
|
+
$[4] = reset;
|
|
2052
|
+
$[5] = scope.Provider;
|
|
2053
|
+
$[6] = set;
|
|
2054
|
+
$[7] = t2;
|
|
2055
|
+
} else {
|
|
2056
|
+
t2 = $[7];
|
|
2057
|
+
}
|
|
2058
|
+
const controller = t2;
|
|
2059
|
+
const controllerRef = useRef(controller);
|
|
2060
|
+
let t3;
|
|
2061
|
+
let t4;
|
|
2062
|
+
if ($[8] !== controller || $[9] !== controllerStore || $[10] !== scope) {
|
|
2063
|
+
t3 = () => {
|
|
2064
|
+
controllerRef.current = controller;
|
|
2065
|
+
scope.publish(controller);
|
|
2066
|
+
controllerStore.notify();
|
|
2067
|
+
};
|
|
2068
|
+
t4 = [controller, controllerStore, scope];
|
|
2069
|
+
$[8] = controller;
|
|
2070
|
+
$[9] = controllerStore;
|
|
2071
|
+
$[10] = scope;
|
|
2072
|
+
$[11] = t3;
|
|
2073
|
+
$[12] = t4;
|
|
2074
|
+
} else {
|
|
2075
|
+
t3 = $[11];
|
|
2076
|
+
t4 = $[12];
|
|
2077
|
+
}
|
|
2078
|
+
useLayoutEffect(t3, t4);
|
|
2079
|
+
let t5;
|
|
2080
|
+
let t6;
|
|
2081
|
+
if ($[13] !== controllerStore || $[14] !== instanceId) {
|
|
2082
|
+
t5 = () => {
|
|
2083
|
+
controllerStore.register(instanceId, controllerRef);
|
|
2084
|
+
return () => {
|
|
2085
|
+
controllerStore.unregister(instanceId);
|
|
2086
|
+
};
|
|
2087
|
+
};
|
|
2088
|
+
t6 = [controllerStore, instanceId];
|
|
2089
|
+
$[13] = controllerStore;
|
|
2090
|
+
$[14] = instanceId;
|
|
2091
|
+
$[15] = t5;
|
|
2092
|
+
$[16] = t6;
|
|
2093
|
+
} else {
|
|
2094
|
+
t5 = $[15];
|
|
2095
|
+
t6 = $[16];
|
|
2096
|
+
}
|
|
2097
|
+
useEffect(t5, t6);
|
|
2098
|
+
return controller;
|
|
2099
|
+
}
|
|
2100
|
+
function defineModule(coreModule) {
|
|
2101
|
+
return Object.freeze({
|
|
2102
|
+
...coreModule
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
function warnMissingPeers(modules) {
|
|
2106
|
+
const installed = new Set(modules.map((coreModule) => coreModule.id));
|
|
2107
|
+
for (const {
|
|
2108
|
+
id,
|
|
2109
|
+
uses
|
|
2110
|
+
} of modules) {
|
|
2111
|
+
const missing = (uses ?? []).filter((peer) => !installed.has(peer));
|
|
2112
|
+
if (missing.length > 0) {
|
|
2113
|
+
report(`Module "${id}" runs without its optional peers`, missing.join(", "), "warn");
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
function createModuleHost(modules, Boundary) {
|
|
2118
|
+
const sorted = sortModules(modules);
|
|
2119
|
+
if (process.env.NODE_ENV !== "production") warnMissingPeers(sorted);
|
|
2120
|
+
return {
|
|
2121
|
+
Boundary,
|
|
2122
|
+
byId: new Map(sorted.map((coreModule) => [coreModule.id, coreModule])),
|
|
2123
|
+
definitions: createModuleRegistryDefinitions(sorted),
|
|
2124
|
+
modules: Object.freeze(sorted)
|
|
2125
|
+
};
|
|
2126
|
+
}
|
|
2127
|
+
function renderModuleSlots(modules, slot, Boundary) {
|
|
2128
|
+
return modules.map((coreModule) => {
|
|
2129
|
+
const Slot = coreModule[slot];
|
|
2130
|
+
if (!Slot) return null;
|
|
2131
|
+
return /* @__PURE__ */ jsx(Boundary, { name: coreModule.id, children: /* @__PURE__ */ jsx(Slot, {}) }, coreModule.id);
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
function ModuleHost(t0) {
|
|
2135
|
+
const $ = c(25);
|
|
2136
|
+
const {
|
|
2137
|
+
boundary: t1,
|
|
2138
|
+
children,
|
|
2139
|
+
modules: t2,
|
|
2140
|
+
registryEntries
|
|
2141
|
+
} = t0;
|
|
2142
|
+
const boundary = t1 === void 0 ? PassthroughBoundary : t1;
|
|
2143
|
+
const modules = t2 === void 0 ? EMPTY_MODULES : t2;
|
|
2144
|
+
let t3;
|
|
2145
|
+
if ($[0] !== boundary || $[1] !== modules) {
|
|
2146
|
+
t3 = () => createModuleHost(modules, boundary);
|
|
2147
|
+
$[0] = boundary;
|
|
2148
|
+
$[1] = modules;
|
|
2149
|
+
$[2] = t3;
|
|
2150
|
+
} else {
|
|
2151
|
+
t3 = $[2];
|
|
2152
|
+
}
|
|
2153
|
+
const [host] = useState(t3);
|
|
2154
|
+
const {
|
|
2155
|
+
Boundary
|
|
2156
|
+
} = host;
|
|
2157
|
+
let t4;
|
|
2158
|
+
if ($[3] !== Boundary || $[4] !== host.modules) {
|
|
2159
|
+
t4 = renderModuleSlots(host.modules, "Backdrop", Boundary);
|
|
2160
|
+
$[3] = Boundary;
|
|
2161
|
+
$[4] = host.modules;
|
|
2162
|
+
$[5] = t4;
|
|
2163
|
+
} else {
|
|
2164
|
+
t4 = $[5];
|
|
2165
|
+
}
|
|
2166
|
+
const backdrops = t4;
|
|
2167
|
+
let t5;
|
|
2168
|
+
if ($[6] !== Boundary || $[7] !== host.modules) {
|
|
2169
|
+
t5 = renderModuleSlots(host.modules, "Overlay", Boundary);
|
|
2170
|
+
$[6] = Boundary;
|
|
2171
|
+
$[7] = host.modules;
|
|
2172
|
+
$[8] = t5;
|
|
2173
|
+
} else {
|
|
2174
|
+
t5 = $[8];
|
|
2175
|
+
}
|
|
2176
|
+
const overlays = t5;
|
|
2177
|
+
let t6;
|
|
2178
|
+
if ($[9] !== backdrops || $[10] !== children || $[11] !== overlays) {
|
|
2179
|
+
t6 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2180
|
+
backdrops,
|
|
2181
|
+
children,
|
|
2182
|
+
overlays
|
|
2183
|
+
] });
|
|
2184
|
+
$[9] = backdrops;
|
|
2185
|
+
$[10] = children;
|
|
2186
|
+
$[11] = overlays;
|
|
2187
|
+
$[12] = t6;
|
|
2188
|
+
} else {
|
|
2189
|
+
t6 = $[12];
|
|
2190
|
+
}
|
|
2191
|
+
const content = t6;
|
|
2192
|
+
let t7;
|
|
2193
|
+
if ($[13] !== content || $[14] !== host.modules) {
|
|
2194
|
+
t7 = host.modules.reduceRight(_temp3, content);
|
|
2195
|
+
$[13] = content;
|
|
2196
|
+
$[14] = host.modules;
|
|
2197
|
+
$[15] = t7;
|
|
2198
|
+
} else {
|
|
2199
|
+
t7 = $[15];
|
|
2200
|
+
}
|
|
2201
|
+
const tree = t7;
|
|
2202
|
+
let t8;
|
|
2203
|
+
if ($[16] !== tree) {
|
|
2204
|
+
t8 = /* @__PURE__ */ jsx(PageControllerProvider, { children: tree });
|
|
2205
|
+
$[16] = tree;
|
|
2206
|
+
$[17] = t8;
|
|
2207
|
+
} else {
|
|
2208
|
+
t8 = $[17];
|
|
2209
|
+
}
|
|
2210
|
+
let t9;
|
|
2211
|
+
if ($[18] !== host || $[19] !== t8) {
|
|
2212
|
+
t9 = /* @__PURE__ */ jsx(ModuleHostContext, { value: host, children: t8 });
|
|
2213
|
+
$[18] = host;
|
|
2214
|
+
$[19] = t8;
|
|
2215
|
+
$[20] = t9;
|
|
2216
|
+
} else {
|
|
2217
|
+
t9 = $[20];
|
|
2218
|
+
}
|
|
2219
|
+
let t10;
|
|
2220
|
+
if ($[21] !== host.definitions || $[22] !== registryEntries || $[23] !== t9) {
|
|
2221
|
+
t10 = /* @__PURE__ */ jsx(RegistryProvider, { definitions: host.definitions, initialEntries: registryEntries, children: t9 });
|
|
2222
|
+
$[21] = host.definitions;
|
|
2223
|
+
$[22] = registryEntries;
|
|
2224
|
+
$[23] = t9;
|
|
2225
|
+
$[24] = t10;
|
|
2226
|
+
} else {
|
|
2227
|
+
t10 = $[24];
|
|
2228
|
+
}
|
|
2229
|
+
return t10;
|
|
2230
|
+
}
|
|
2231
|
+
function _temp3(inner, t0) {
|
|
2232
|
+
const {
|
|
2233
|
+
Provider
|
|
2234
|
+
} = t0;
|
|
2235
|
+
return Provider ? /* @__PURE__ */ jsx(Provider, { children: inner }) : inner;
|
|
2236
|
+
}
|
|
2237
|
+
function useModule(id) {
|
|
2238
|
+
const coreModule = use(ModuleHostContext)?.byId.get(id);
|
|
2239
|
+
return coreModule?.context ? use(coreModule.context) ?? null : null;
|
|
2240
|
+
}
|
|
2241
|
+
function definePeer(id, inert) {
|
|
2242
|
+
const useRuntime = () => {
|
|
2243
|
+
return useModule(id) ?? inert;
|
|
2244
|
+
};
|
|
2245
|
+
return {
|
|
2246
|
+
useRuntime,
|
|
2247
|
+
useActions: () => useRuntime().actions,
|
|
2248
|
+
useState: (selector, isEqual) => useStore(useRuntime().store, selector, isEqual)
|
|
2249
|
+
};
|
|
2250
|
+
}
|
|
2251
|
+
var NO_MODULE_STORE = createStore(void 0);
|
|
2252
|
+
function useModuleState(id, selector, fallback, t0) {
|
|
2253
|
+
const $ = c(4);
|
|
2254
|
+
const isEqual = t0 === void 0 ? Object.is : t0;
|
|
2255
|
+
const runtime = useModule(id);
|
|
2256
|
+
let t1;
|
|
2257
|
+
if ($[0] !== fallback || $[1] !== runtime || $[2] !== selector) {
|
|
2258
|
+
t1 = (state) => runtime ? selector(state) : fallback;
|
|
2259
|
+
$[0] = fallback;
|
|
2260
|
+
$[1] = runtime;
|
|
2261
|
+
$[2] = selector;
|
|
2262
|
+
$[3] = t1;
|
|
2263
|
+
} else {
|
|
2264
|
+
t1 = $[3];
|
|
2265
|
+
}
|
|
2266
|
+
return useStore(runtime?.store ?? NO_MODULE_STORE, t1, isEqual);
|
|
2267
|
+
}
|
|
2268
|
+
function ModuleBoundary({
|
|
2269
|
+
children,
|
|
2270
|
+
name
|
|
2271
|
+
}) {
|
|
2272
|
+
const Boundary = use(ModuleHostContext)?.Boundary ?? PassthroughBoundary;
|
|
2273
|
+
return createElement(Boundary, {
|
|
2274
|
+
name
|
|
2275
|
+
}, children);
|
|
2276
|
+
}
|
|
2277
|
+
function useIsModuleInstalled(id) {
|
|
2278
|
+
return use(ModuleHostContext)?.byId.has(id) ?? false;
|
|
2279
|
+
}
|
|
2280
|
+
function useModuleRegistration(id, value, options) {
|
|
2281
|
+
const $ = c(12);
|
|
2282
|
+
const t0 = useInstalledModules();
|
|
2283
|
+
let t1;
|
|
2284
|
+
if ($[0] !== id || $[1] !== t0) {
|
|
2285
|
+
let t22;
|
|
2286
|
+
if ($[3] !== id) {
|
|
2287
|
+
t22 = (candidate) => candidate.id === id;
|
|
2288
|
+
$[3] = id;
|
|
2289
|
+
$[4] = t22;
|
|
2290
|
+
} else {
|
|
2291
|
+
t22 = $[4];
|
|
2292
|
+
}
|
|
2293
|
+
t1 = t0.find(t22);
|
|
2294
|
+
$[0] = id;
|
|
2295
|
+
$[1] = t0;
|
|
2296
|
+
$[2] = t1;
|
|
2297
|
+
} else {
|
|
2298
|
+
t1 = $[2];
|
|
2299
|
+
}
|
|
2300
|
+
const coreModule = t1;
|
|
2301
|
+
let t2;
|
|
2302
|
+
if ($[5] !== coreModule || $[6] !== id || $[7] !== options?.enabled || $[8] !== value) {
|
|
2303
|
+
t2 = coreModule && options?.enabled !== false && value != null ? {
|
|
2304
|
+
[id]: value
|
|
2305
|
+
} : null;
|
|
2306
|
+
$[5] = coreModule;
|
|
2307
|
+
$[6] = id;
|
|
2308
|
+
$[7] = options?.enabled;
|
|
2309
|
+
$[8] = value;
|
|
2310
|
+
$[9] = t2;
|
|
2311
|
+
} else {
|
|
2312
|
+
t2 = $[9];
|
|
2313
|
+
}
|
|
2314
|
+
const config = t2;
|
|
2315
|
+
let t3;
|
|
2316
|
+
if ($[10] !== options) {
|
|
2317
|
+
t3 = pickRegistryMetadata(options);
|
|
2318
|
+
$[10] = options;
|
|
2319
|
+
$[11] = t3;
|
|
2320
|
+
} else {
|
|
2321
|
+
t3 = $[11];
|
|
2322
|
+
}
|
|
2323
|
+
useRegistry(config, t3);
|
|
2324
|
+
}
|
|
2325
|
+
function Compose({
|
|
2326
|
+
providers,
|
|
2327
|
+
children
|
|
2328
|
+
}) {
|
|
2329
|
+
return providers.reduceRight((acc, entry) => {
|
|
2330
|
+
if (Array.isArray(entry)) {
|
|
2331
|
+
const [Component2, props] = entry;
|
|
2332
|
+
return createElement(Component2, props, acc);
|
|
2333
|
+
}
|
|
2334
|
+
const Component = entry;
|
|
2335
|
+
return createElement(Component, null, acc);
|
|
2336
|
+
}, createElement(Fragment, null, children));
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
export { Compose, ModuleBoundary, ModuleHost, PageControllerProvider, REGISTRY_SOURCES, RegistryProvider, applyRegistryConfig, createModuleRegistryDefinitions, createRegistryApplyContext, createRegistryOperations, createRegistryStore, defineModule, definePeer, hasOwnProperty, sortModules, useIsModuleInstalled, useModule, useModuleRegistration, useModuleState, usePage, usePageController, useRegistryEntries, useRegistryValue };
|
|
2340
|
+
//# sourceMappingURL=chunk-ZE6OGGA7.js.map
|
|
2341
|
+
//# sourceMappingURL=chunk-ZE6OGGA7.js.map
|