@omerdlw/base-framework 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1183) hide show
  1. package/MIGRATION.md +75 -0
  2. package/README.md +33 -25
  3. package/dist/ambient/index.d.ts +1 -0
  4. package/dist/ambient/index.js +14 -0
  5. package/dist/ambient/server/index.d.ts +1 -0
  6. package/dist/ambient/server/index.js +238 -0
  7. package/dist/ambient/server/index.js.map +1 -0
  8. package/dist/ambient/worker/index.d.ts +1 -0
  9. package/dist/ambient/worker/index.js +143 -0
  10. package/dist/ambient/worker/index.js.map +1 -0
  11. package/dist/background/index.d.ts +1 -0
  12. package/dist/background/index.js +13 -0
  13. package/dist/chunk-2223J34C.js +850 -0
  14. package/dist/chunk-2223J34C.js.map +1 -0
  15. package/dist/chunk-2LGI33JP.js +832 -0
  16. package/dist/chunk-2LGI33JP.js.map +1 -0
  17. package/dist/chunk-37OBXNEO.js +116 -0
  18. package/dist/chunk-37OBXNEO.js.map +1 -0
  19. package/dist/chunk-4OQGXZIH.js +1435 -0
  20. package/dist/chunk-4OQGXZIH.js.map +1 -0
  21. package/dist/chunk-5H6FZW3N.js +535 -0
  22. package/dist/chunk-5H6FZW3N.js.map +1 -0
  23. package/dist/chunk-7RSRDKYE.js +22 -0
  24. package/dist/chunk-7RSRDKYE.js.map +1 -0
  25. package/dist/chunk-AYUEZPAN.js +15762 -0
  26. package/dist/chunk-AYUEZPAN.js.map +1 -0
  27. package/dist/chunk-BCFJSPTI.js +261 -0
  28. package/dist/chunk-BCFJSPTI.js.map +1 -0
  29. package/dist/chunk-BMFHS3GV.js +118 -0
  30. package/dist/chunk-BMFHS3GV.js.map +1 -0
  31. package/dist/chunk-CRKJAACG.js +81 -0
  32. package/dist/chunk-CRKJAACG.js.map +1 -0
  33. package/dist/chunk-CT4UILO2.js +537 -0
  34. package/dist/chunk-CT4UILO2.js.map +1 -0
  35. package/dist/chunk-ESD5EQ5H.js +178 -0
  36. package/dist/chunk-ESD5EQ5H.js.map +1 -0
  37. package/dist/chunk-GCHQ5OC4.js +460 -0
  38. package/dist/chunk-GCHQ5OC4.js.map +1 -0
  39. package/dist/chunk-GT4COZI7.js +110 -0
  40. package/dist/chunk-GT4COZI7.js.map +1 -0
  41. package/dist/chunk-H6HRU3XN.js +567 -0
  42. package/dist/chunk-H6HRU3XN.js.map +1 -0
  43. package/dist/chunk-J3VTDBC6.js +14 -0
  44. package/dist/chunk-J3VTDBC6.js.map +1 -0
  45. package/dist/chunk-LTO77WSO.js +140 -0
  46. package/dist/chunk-LTO77WSO.js.map +1 -0
  47. package/dist/chunk-MCYHKFZL.js +17 -0
  48. package/dist/chunk-MCYHKFZL.js.map +1 -0
  49. package/dist/chunk-NHOJWICA.js +2367 -0
  50. package/dist/chunk-NHOJWICA.js.map +1 -0
  51. package/dist/chunk-QMFV53PP.js +1766 -0
  52. package/dist/chunk-QMFV53PP.js.map +1 -0
  53. package/dist/chunk-RDYYP36I.js +27 -0
  54. package/dist/chunk-RDYYP36I.js.map +1 -0
  55. package/dist/chunk-RF2YGILF.js +656 -0
  56. package/dist/chunk-RF2YGILF.js.map +1 -0
  57. package/dist/chunk-RTCJ35UC.js +825 -0
  58. package/dist/chunk-RTCJ35UC.js.map +1 -0
  59. package/dist/chunk-TUUGWQY5.js +3488 -0
  60. package/dist/chunk-TUUGWQY5.js.map +1 -0
  61. package/dist/chunk-WXEOP6Z4.js +577 -0
  62. package/dist/chunk-WXEOP6Z4.js.map +1 -0
  63. package/dist/chunk-WYVA6AN5.js +590 -0
  64. package/dist/chunk-WYVA6AN5.js.map +1 -0
  65. package/dist/chunk-Y2Q74PJP.js +537 -0
  66. package/dist/chunk-Y2Q74PJP.js.map +1 -0
  67. package/dist/chunk-ZFTQY7OF.js +139 -0
  68. package/dist/chunk-ZFTQY7OF.js.map +1 -0
  69. package/dist/chunk-ZSNP26VU.js +493 -0
  70. package/dist/chunk-ZSNP26VU.js.map +1 -0
  71. package/dist/context-menu/index.d.ts +1 -0
  72. package/dist/context-menu/index.js +19 -0
  73. package/dist/controls/index.d.ts +1 -0
  74. package/dist/controls/index.js +10 -0
  75. package/dist/core/error/boundary.d.ts +27 -0
  76. package/dist/core/error/boundary.d.ts.map +1 -0
  77. package/dist/core/error/constants.d.ts +33 -0
  78. package/dist/core/error/constants.d.ts.map +1 -0
  79. package/dist/core/error/index.d.ts +9 -0
  80. package/dist/core/error/index.d.ts.map +1 -0
  81. package/dist/core/error/listener.d.ts +6 -0
  82. package/dist/core/error/listener.d.ts.map +1 -0
  83. package/dist/core/error/reporter.d.ts +49 -0
  84. package/dist/core/error/reporter.d.ts.map +1 -0
  85. package/dist/core/error/theme.d.ts +10 -0
  86. package/dist/core/error/theme.d.ts.map +1 -0
  87. package/dist/core/error/types.d.ts +128 -0
  88. package/dist/core/error/types.d.ts.map +1 -0
  89. package/dist/core/error/utils.d.ts +55 -0
  90. package/dist/core/error/utils.d.ts.map +1 -0
  91. package/dist/core/kernel/adapters.d.ts +9 -0
  92. package/dist/core/kernel/adapters.d.ts.map +1 -0
  93. package/dist/core/kernel/compose.d.ts +21 -0
  94. package/dist/core/kernel/compose.d.ts.map +1 -0
  95. package/dist/core/kernel/constants.d.ts +42 -0
  96. package/dist/core/kernel/constants.d.ts.map +1 -0
  97. package/dist/core/kernel/handlers.d.ts +7 -0
  98. package/dist/core/kernel/handlers.d.ts.map +1 -0
  99. package/dist/core/kernel/hooks.d.ts +13 -0
  100. package/dist/core/kernel/hooks.d.ts.map +1 -0
  101. package/dist/core/kernel/index.d.ts +15 -0
  102. package/dist/core/kernel/index.d.ts.map +1 -0
  103. package/dist/core/kernel/installed.d.ts +28 -0
  104. package/dist/core/kernel/installed.d.ts.map +1 -0
  105. package/dist/core/kernel/module.d.ts +57 -0
  106. package/dist/core/kernel/module.d.ts.map +1 -0
  107. package/dist/core/kernel/operations-records.d.ts +25 -0
  108. package/dist/core/kernel/operations-records.d.ts.map +1 -0
  109. package/dist/core/kernel/operations-resolve.d.ts +5 -0
  110. package/dist/core/kernel/operations-resolve.d.ts.map +1 -0
  111. package/dist/core/kernel/operations.d.ts +23 -0
  112. package/dist/core/kernel/operations.d.ts.map +1 -0
  113. package/dist/core/kernel/page-controller.d.ts +20 -0
  114. package/dist/core/kernel/page-controller.d.ts.map +1 -0
  115. package/dist/core/kernel/provider.d.ts +29 -0
  116. package/dist/core/kernel/provider.d.ts.map +1 -0
  117. package/dist/core/kernel/runtime.d.ts.map +1 -0
  118. package/dist/core/kernel/schema.d.ts +13 -0
  119. package/dist/core/kernel/schema.d.ts.map +1 -0
  120. package/dist/core/kernel/stabilize.d.ts +13 -0
  121. package/dist/core/kernel/stabilize.d.ts.map +1 -0
  122. package/dist/core/kernel/store-batch.d.ts +17 -0
  123. package/dist/core/kernel/store-batch.d.ts.map +1 -0
  124. package/dist/core/kernel/store-entries.d.ts +6 -0
  125. package/dist/core/kernel/store-entries.d.ts.map +1 -0
  126. package/dist/core/kernel/store-handles.d.ts +4 -0
  127. package/dist/core/kernel/store-handles.d.ts.map +1 -0
  128. package/dist/core/kernel/store-registration.d.ts +14 -0
  129. package/dist/core/kernel/store-registration.d.ts.map +1 -0
  130. package/dist/core/kernel/store-snapshots.d.ts +14 -0
  131. package/dist/core/kernel/store-snapshots.d.ts.map +1 -0
  132. package/dist/core/kernel/store-subscriptions.d.ts +16 -0
  133. package/dist/core/kernel/store-subscriptions.d.ts.map +1 -0
  134. package/dist/core/kernel/store.d.ts +8 -0
  135. package/dist/core/kernel/store.d.ts.map +1 -0
  136. package/dist/core/kernel/types-modules.d.ts +82 -0
  137. package/dist/core/kernel/types-modules.d.ts.map +1 -0
  138. package/dist/core/kernel/types-page.d.ts +67 -0
  139. package/dist/core/kernel/types-page.d.ts.map +1 -0
  140. package/dist/core/kernel/types-store.d.ts +71 -0
  141. package/dist/core/kernel/types-store.d.ts.map +1 -0
  142. package/dist/core/kernel/types.d.ts +169 -0
  143. package/dist/core/kernel/types.d.ts.map +1 -0
  144. package/dist/core/kernel/utils.d.ts +21 -0
  145. package/dist/core/kernel/utils.d.ts.map +1 -0
  146. package/dist/core/navigation/constants.d.ts +48 -0
  147. package/dist/core/navigation/constants.d.ts.map +1 -0
  148. package/dist/core/navigation/navigator-defaults.d.ts +4 -0
  149. package/dist/core/navigation/navigator-defaults.d.ts.map +1 -0
  150. package/dist/core/navigation/navigator-holds.d.ts +8 -0
  151. package/dist/core/navigation/navigator-holds.d.ts.map +1 -0
  152. package/dist/core/navigation/navigator-patience.d.ts +15 -0
  153. package/dist/core/navigation/navigator-patience.d.ts.map +1 -0
  154. package/dist/core/navigation/navigator-payload.d.ts +6 -0
  155. package/dist/core/navigation/navigator-payload.d.ts.map +1 -0
  156. package/dist/core/navigation/navigator-prefetch.d.ts +13 -0
  157. package/dist/core/navigation/navigator-prefetch.d.ts.map +1 -0
  158. package/dist/core/navigation/navigator.d.ts +7 -0
  159. package/dist/core/navigation/navigator.d.ts.map +1 -0
  160. package/dist/core/navigation/settings.d.ts +12 -0
  161. package/dist/core/navigation/settings.d.ts.map +1 -0
  162. package/dist/core/navigation/state.d.ts +26 -0
  163. package/dist/core/navigation/state.d.ts.map +1 -0
  164. package/dist/core/navigation/types.d.ts +194 -0
  165. package/dist/core/navigation/types.d.ts.map +1 -0
  166. package/dist/core/navigation/utils.d.ts +18 -0
  167. package/dist/core/navigation/utils.d.ts.map +1 -0
  168. package/dist/core/provider/index.d.ts +31 -0
  169. package/dist/core/provider/index.d.ts.map +1 -0
  170. package/dist/dock/index.d.ts +1 -0
  171. package/dist/dock/index.js +18 -0
  172. package/dist/error/index.d.ts +1 -9
  173. package/dist/error/index.js +8 -5
  174. package/dist/events/index.d.ts +1 -0
  175. package/dist/events/index.js +83 -0
  176. package/dist/events/index.js.map +1 -0
  177. package/dist/foundation/events/index.d.ts +67 -0
  178. package/dist/foundation/events/index.d.ts.map +1 -0
  179. package/dist/foundation/recipes/anatomy.d.ts +139 -0
  180. package/dist/foundation/recipes/anatomy.d.ts.map +1 -0
  181. package/dist/foundation/recipes/cn.d.ts +17 -0
  182. package/dist/foundation/recipes/cn.d.ts.map +1 -0
  183. package/dist/foundation/recipes/define.d.ts +134 -0
  184. package/dist/foundation/recipes/define.d.ts.map +1 -0
  185. package/dist/foundation/recipes/index.d.ts +11 -0
  186. package/dist/foundation/recipes/index.d.ts.map +1 -0
  187. package/dist/foundation/recipes/recipe.d.ts +97 -0
  188. package/dist/foundation/recipes/recipe.d.ts.map +1 -0
  189. package/dist/foundation/recipes/split.d.ts +10 -0
  190. package/dist/foundation/recipes/split.d.ts.map +1 -0
  191. package/dist/foundation/result/index.d.ts +98 -0
  192. package/dist/foundation/result/index.d.ts.map +1 -0
  193. package/dist/foundation/utils/dom.d.ts +19 -0
  194. package/dist/foundation/utils/dom.d.ts.map +1 -0
  195. package/dist/foundation/utils/index.d.ts +17 -0
  196. package/dist/foundation/utils/index.d.ts.map +1 -0
  197. package/dist/foundation/utils/number.d.ts +9 -0
  198. package/dist/foundation/utils/number.d.ts.map +1 -0
  199. package/dist/foundation/utils/object.d.ts +17 -0
  200. package/dist/foundation/utils/object.d.ts.map +1 -0
  201. package/dist/foundation/utils/report.d.ts +18 -0
  202. package/dist/foundation/utils/report.d.ts.map +1 -0
  203. package/dist/foundation/utils/scheduler.d.ts +52 -0
  204. package/dist/foundation/utils/scheduler.d.ts.map +1 -0
  205. package/dist/foundation/utils/store.d.ts +21 -0
  206. package/dist/foundation/utils/store.d.ts.map +1 -0
  207. package/dist/foundation/utils/string.d.ts +18 -0
  208. package/dist/foundation/utils/string.d.ts.map +1 -0
  209. package/dist/foundation/utils/tempo.d.ts +61 -0
  210. package/dist/foundation/utils/tempo.d.ts.map +1 -0
  211. package/dist/foundation/utils/timing.d.ts +13 -0
  212. package/dist/foundation/utils/timing.d.ts.map +1 -0
  213. package/dist/foundation/utils/transform.d.ts +17 -0
  214. package/dist/foundation/utils/transform.d.ts.map +1 -0
  215. package/dist/foundation/utils/user-message.d.ts +32 -0
  216. package/dist/foundation/utils/user-message.d.ts.map +1 -0
  217. package/dist/hooks/index.d.ts +1 -11
  218. package/dist/hooks/index.js +3 -1
  219. package/dist/index.d.ts +8 -10
  220. package/dist/index.d.ts.map +1 -1
  221. package/dist/index.js +25 -20
  222. package/dist/kernel/index.d.ts +1 -15
  223. package/dist/kernel/index.js +5 -2
  224. package/dist/loading/index.d.ts +1 -0
  225. package/dist/loading/index.js +12 -0
  226. package/dist/media/index.d.ts +1 -0
  227. package/dist/media/index.js +9 -0
  228. package/dist/modal/index.d.ts +1 -0
  229. package/dist/modal/index.js +310 -0
  230. package/dist/modal/index.js.map +1 -0
  231. package/dist/modules/ambient/analyze-bounds.d.ts +12 -0
  232. package/dist/modules/ambient/analyze-bounds.d.ts.map +1 -0
  233. package/dist/modules/ambient/analyze-clusters.d.ts +14 -0
  234. package/dist/modules/ambient/analyze-clusters.d.ts.map +1 -0
  235. package/dist/modules/ambient/analyze-measures.d.ts +22 -0
  236. package/dist/modules/ambient/analyze-measures.d.ts.map +1 -0
  237. package/dist/modules/ambient/analyze-swatches.d.ts +16 -0
  238. package/dist/modules/ambient/analyze-swatches.d.ts.map +1 -0
  239. package/dist/modules/ambient/analyze.d.ts +14 -22
  240. package/dist/modules/ambient/analyze.d.ts.map +1 -1
  241. package/dist/modules/ambient/constants.d.ts +4 -1
  242. package/dist/modules/ambient/constants.d.ts.map +1 -1
  243. package/dist/modules/ambient/context.d.ts +6 -0
  244. package/dist/modules/ambient/context.d.ts.map +1 -1
  245. package/dist/modules/ambient/dom.d.ts +25 -2
  246. package/dist/modules/ambient/dom.d.ts.map +1 -1
  247. package/dist/modules/ambient/extractor.d.ts +10 -0
  248. package/dist/modules/ambient/extractor.d.ts.map +1 -1
  249. package/dist/modules/ambient/hooks.d.ts +12 -0
  250. package/dist/modules/ambient/hooks.d.ts.map +1 -1
  251. package/dist/modules/ambient/module.d.ts +12 -1
  252. package/dist/modules/ambient/module.d.ts.map +1 -1
  253. package/dist/modules/ambient/oklab.d.ts +24 -0
  254. package/dist/modules/ambient/oklab.d.ts.map +1 -1
  255. package/dist/modules/ambient/quantize.d.ts +4 -0
  256. package/dist/modules/ambient/quantize.d.ts.map +1 -1
  257. package/dist/modules/ambient/server/address.d.ts +8 -0
  258. package/dist/modules/ambient/server/address.d.ts.map +1 -1
  259. package/dist/modules/ambient/server/index.d.ts +24 -0
  260. package/dist/modules/ambient/server/index.d.ts.map +1 -1
  261. package/dist/modules/ambient/settings.d.ts +26 -0
  262. package/dist/modules/ambient/settings.d.ts.map +1 -1
  263. package/dist/modules/ambient/types.d.ts +100 -1
  264. package/dist/modules/ambient/types.d.ts.map +1 -1
  265. package/dist/modules/ambient/worker/index.d.ts +16 -0
  266. package/dist/modules/ambient/worker/index.d.ts.map +1 -1
  267. package/dist/modules/background/components/background-gradients.d.ts +8 -0
  268. package/dist/modules/background/components/background-gradients.d.ts.map +1 -0
  269. package/dist/modules/background/components/edge-gradient.d.ts +9 -0
  270. package/dist/modules/background/components/edge-gradient.d.ts.map +1 -0
  271. package/dist/modules/background/components/native-video.d.ts +4 -0
  272. package/dist/modules/background/components/native-video.d.ts.map +1 -0
  273. package/dist/modules/background/components/noise-overlay.d.ts +11 -0
  274. package/dist/modules/background/components/noise-overlay.d.ts.map +1 -0
  275. package/dist/modules/background/components/overlay.d.ts +6 -0
  276. package/dist/modules/background/components/overlay.d.ts.map +1 -0
  277. package/dist/modules/background/components/solid-overlay.d.ts +10 -0
  278. package/dist/modules/background/components/solid-overlay.d.ts.map +1 -0
  279. package/dist/modules/background/constants.d.ts +14 -1
  280. package/dist/modules/background/constants.d.ts.map +1 -1
  281. package/dist/modules/background/context.d.ts +7 -0
  282. package/dist/modules/background/context.d.ts.map +1 -1
  283. package/dist/modules/background/hooks/use-background-media-source.d.ts +4 -0
  284. package/dist/modules/background/hooks/use-background-media-source.d.ts.map +1 -0
  285. package/dist/modules/background/hooks/use-background-motion-model.d.ts +15 -0
  286. package/dist/modules/background/hooks/use-background-motion-model.d.ts.map +1 -0
  287. package/dist/modules/background/hooks/use-background-overlay-model.d.ts +929 -0
  288. package/dist/modules/background/hooks/use-background-overlay-model.d.ts.map +1 -0
  289. package/dist/modules/background/hooks/use-native-video-model.d.ts +22 -0
  290. package/dist/modules/background/hooks/use-native-video-model.d.ts.map +1 -0
  291. package/dist/modules/background/hooks.d.ts +20 -1
  292. package/dist/modules/background/hooks.d.ts.map +1 -1
  293. package/dist/modules/background/index.d.ts +6 -6
  294. package/dist/modules/background/index.d.ts.map +1 -1
  295. package/dist/modules/background/lib/theme.d.ts +4 -0
  296. package/dist/modules/background/lib/theme.d.ts.map +1 -0
  297. package/dist/modules/background/model/override.d.ts +14 -0
  298. package/dist/modules/background/model/override.d.ts.map +1 -0
  299. package/dist/modules/background/model/playback.d.ts +25 -0
  300. package/dist/modules/background/model/playback.d.ts.map +1 -0
  301. package/dist/modules/background/model/state.d.ts +31 -0
  302. package/dist/modules/background/model/state.d.ts.map +1 -0
  303. package/dist/modules/background/model/video-frame.d.ts +31 -0
  304. package/dist/modules/background/model/video-frame.d.ts.map +1 -0
  305. package/dist/modules/background/model/visual.d.ts +932 -0
  306. package/dist/modules/background/model/visual.d.ts.map +1 -0
  307. package/dist/modules/background/module.d.ts +11 -0
  308. package/dist/modules/background/module.d.ts.map +1 -1
  309. package/dist/modules/background/motion.d.ts.map +1 -1
  310. package/dist/modules/background/types.d.ts +66 -3
  311. package/dist/modules/background/types.d.ts.map +1 -1
  312. package/dist/modules/background/youtube/components/player.d.ts +7 -0
  313. package/dist/modules/background/youtube/components/player.d.ts.map +1 -0
  314. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts +27 -0
  315. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts.map +1 -0
  316. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts +20 -0
  317. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts.map +1 -0
  318. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts +8 -0
  319. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts.map +1 -0
  320. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts +16 -0
  321. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts.map +1 -0
  322. package/dist/modules/background/youtube/lib/audio.d.ts +17 -0
  323. package/dist/modules/background/youtube/lib/audio.d.ts.map +1 -0
  324. package/dist/modules/background/youtube/lib/iframe-engine.d.ts +29 -0
  325. package/dist/modules/background/youtube/lib/iframe-engine.d.ts.map +1 -0
  326. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts +47 -0
  327. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts.map +1 -0
  328. package/dist/modules/background/youtube/lib/iframe.d.ts +47 -0
  329. package/dist/modules/background/youtube/lib/iframe.d.ts.map +1 -0
  330. package/dist/modules/background/youtube/lib/parse.d.ts +36 -0
  331. package/dist/modules/background/youtube/lib/parse.d.ts.map +1 -0
  332. package/dist/modules/background/youtube/lib/timing.d.ts +11 -0
  333. package/dist/modules/background/youtube/lib/timing.d.ts.map +1 -0
  334. package/dist/modules/background/youtube/lib/video-events.d.ts +53 -0
  335. package/dist/modules/background/youtube/lib/video-events.d.ts.map +1 -0
  336. package/dist/modules/context-menu/constants.d.ts +30 -1
  337. package/dist/modules/context-menu/constants.d.ts.map +1 -1
  338. package/dist/modules/context-menu/context.d.ts +10 -2
  339. package/dist/modules/context-menu/context.d.ts.map +1 -1
  340. package/dist/modules/context-menu/dom.d.ts +13 -0
  341. package/dist/modules/context-menu/dom.d.ts.map +1 -1
  342. package/dist/modules/context-menu/hooks.d.ts +32 -5
  343. package/dist/modules/context-menu/hooks.d.ts.map +1 -1
  344. package/dist/modules/context-menu/items.d.ts +25 -0
  345. package/dist/modules/context-menu/items.d.ts.map +1 -1
  346. package/dist/modules/context-menu/module.d.ts +6 -0
  347. package/dist/modules/context-menu/module.d.ts.map +1 -1
  348. package/dist/modules/context-menu/motion.d.ts.map +1 -1
  349. package/dist/modules/context-menu/overlay.d.ts +30 -8
  350. package/dist/modules/context-menu/overlay.d.ts.map +1 -1
  351. package/dist/modules/context-menu/resolver.d.ts +8 -0
  352. package/dist/modules/context-menu/resolver.d.ts.map +1 -1
  353. package/dist/modules/context-menu/state.d.ts +9 -0
  354. package/dist/modules/context-menu/state.d.ts.map +1 -1
  355. package/dist/modules/context-menu/types.d.ts +85 -3
  356. package/dist/modules/context-menu/types.d.ts.map +1 -1
  357. package/dist/modules/controls/constants.d.ts +18 -1
  358. package/dist/modules/controls/constants.d.ts.map +1 -1
  359. package/dist/modules/controls/entries.d.ts +23 -1
  360. package/dist/modules/controls/entries.d.ts.map +1 -1
  361. package/dist/modules/controls/hooks.d.ts +11 -1
  362. package/dist/modules/controls/hooks.d.ts.map +1 -1
  363. package/dist/modules/controls/layout.d.ts +17 -0
  364. package/dist/modules/controls/layout.d.ts.map +1 -1
  365. package/dist/modules/controls/module.d.ts +7 -1
  366. package/dist/modules/controls/module.d.ts.map +1 -1
  367. package/dist/modules/controls/overlay.d.ts +11 -1
  368. package/dist/modules/controls/overlay.d.ts.map +1 -1
  369. package/dist/modules/controls/types.d.ts +51 -2
  370. package/dist/modules/controls/types.d.ts.map +1 -1
  371. package/dist/modules/dock/components/badge.d.ts +5 -0
  372. package/dist/modules/dock/components/badge.d.ts.map +1 -0
  373. package/dist/modules/dock/components/breadcrumbs-card.d.ts +6 -0
  374. package/dist/modules/dock/components/breadcrumbs-card.d.ts.map +1 -0
  375. package/dist/modules/dock/components/card-banner.d.ts +4 -0
  376. package/dist/modules/dock/components/card-banner.d.ts.map +1 -0
  377. package/dist/modules/dock/components/card-header.d.ts +4 -0
  378. package/dist/modules/dock/components/card-header.d.ts.map +1 -0
  379. package/dist/modules/dock/components/card-item.d.ts +3 -0
  380. package/dist/modules/dock/components/card-item.d.ts.map +1 -0
  381. package/dist/modules/dock/components/command-bar.d.ts +7 -0
  382. package/dist/modules/dock/components/command-bar.d.ts.map +1 -0
  383. package/dist/modules/dock/components/description.d.ts +4 -0
  384. package/dist/modules/dock/components/description.d.ts.map +1 -0
  385. package/dist/modules/dock/components/dock.d.ts +4 -0
  386. package/dist/modules/dock/components/dock.d.ts.map +1 -0
  387. package/dist/modules/dock/components/hud-view.d.ts +7 -0
  388. package/dist/modules/dock/components/hud-view.d.ts.map +1 -0
  389. package/dist/modules/dock/components/icon.d.ts +6 -0
  390. package/dist/modules/dock/components/icon.d.ts.map +1 -0
  391. package/dist/modules/dock/components/item-content.d.ts +4 -0
  392. package/dist/modules/dock/components/item-content.d.ts.map +1 -0
  393. package/dist/modules/dock/components/media-action.d.ts +4 -0
  394. package/dist/modules/dock/components/media-action.d.ts.map +1 -0
  395. package/dist/modules/dock/components/media-controls.d.ts +4 -0
  396. package/dist/modules/dock/components/media-controls.d.ts.map +1 -0
  397. package/dist/modules/dock/components/media-scrubber.d.ts +5 -0
  398. package/dist/modules/dock/components/media-scrubber.d.ts.map +1 -0
  399. package/dist/modules/dock/components/status-actions.d.ts +10 -0
  400. package/dist/modules/dock/components/status-actions.d.ts.map +1 -0
  401. package/dist/modules/dock/components/surface/action.d.ts +17 -0
  402. package/dist/modules/dock/components/surface/action.d.ts.map +1 -0
  403. package/dist/modules/dock/components/surface/controls.d.ts +12 -0
  404. package/dist/modules/dock/components/surface/controls.d.ts.map +1 -0
  405. package/dist/modules/dock/components/surface/extensions-bar.d.ts +5 -0
  406. package/dist/modules/dock/components/surface/extensions-bar.d.ts.map +1 -0
  407. package/dist/modules/dock/components/surface/header-button.d.ts +14 -0
  408. package/dist/modules/dock/components/surface/header-button.d.ts.map +1 -0
  409. package/dist/modules/dock/components/surface/item-content.d.ts +6 -0
  410. package/dist/modules/dock/components/surface/item-content.d.ts.map +1 -0
  411. package/dist/modules/dock/components/surface/shell.d.ts +3 -0
  412. package/dist/modules/dock/components/surface/shell.d.ts.map +1 -0
  413. package/dist/modules/dock/components/title.d.ts +4 -0
  414. package/dist/modules/dock/components/title.d.ts.map +1 -0
  415. package/dist/modules/dock/constants.d.ts +11 -2
  416. package/dist/modules/dock/constants.d.ts.map +1 -1
  417. package/dist/modules/dock/context.d.ts +8 -2
  418. package/dist/modules/dock/context.d.ts.map +1 -1
  419. package/dist/modules/dock/hooks/use-action-slot.d.ts +6 -0
  420. package/dist/modules/dock/hooks/use-action-slot.d.ts.map +1 -0
  421. package/dist/modules/dock/hooks/use-badge.d.ts +4 -0
  422. package/dist/modules/dock/hooks/use-badge.d.ts.map +1 -0
  423. package/dist/modules/dock/hooks/use-card-banner-model.d.ts +18 -0
  424. package/dist/modules/dock/hooks/use-card-banner-model.d.ts.map +1 -0
  425. package/dist/modules/dock/hooks/use-card-header-model.d.ts +7 -0
  426. package/dist/modules/dock/hooks/use-card-header-model.d.ts.map +1 -0
  427. package/dist/modules/dock/hooks/use-card-item-model.d.ts +1612 -0
  428. package/dist/modules/dock/hooks/use-card-item-model.d.ts.map +1 -0
  429. package/dist/modules/dock/hooks/use-command-bar-model.d.ts +12 -0
  430. package/dist/modules/dock/hooks/use-command-bar-model.d.ts.map +1 -0
  431. package/dist/modules/dock/hooks/use-dock-banner.d.ts +11 -0
  432. package/dist/modules/dock/hooks/use-dock-banner.d.ts.map +1 -0
  433. package/dist/modules/dock/hooks/use-dock-config.d.ts +19 -0
  434. package/dist/modules/dock/hooks/use-dock-config.d.ts.map +1 -0
  435. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts +7 -0
  436. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts.map +1 -0
  437. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts +7 -0
  438. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts.map +1 -0
  439. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +6 -0
  440. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +1 -0
  441. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts +11 -0
  442. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts.map +1 -0
  443. package/dist/modules/dock/hooks/use-dock-registration.d.ts +8 -0
  444. package/dist/modules/dock/hooks/use-dock-registration.d.ts.map +1 -0
  445. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts +2 -0
  446. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts.map +1 -0
  447. package/dist/modules/dock/hooks/use-dock-theme.d.ts +6 -0
  448. package/dist/modules/dock/hooks/use-dock-theme.d.ts.map +1 -0
  449. package/dist/modules/dock/hooks/use-dock-viewport.d.ts +6 -0
  450. package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +1 -0
  451. package/dist/modules/dock/hooks/use-element-height.d.ts +3 -0
  452. package/dist/modules/dock/hooks/use-element-height.d.ts.map +1 -0
  453. package/dist/modules/dock/hooks/use-hud-registry.d.ts +16 -0
  454. package/dist/modules/dock/hooks/use-hud-registry.d.ts.map +1 -0
  455. package/dist/modules/dock/hooks/use-hud-view-model.d.ts +9 -0
  456. package/dist/modules/dock/hooks/use-hud-view-model.d.ts.map +1 -0
  457. package/dist/modules/dock/hooks/use-media-controls-model.d.ts +27 -0
  458. package/dist/modules/dock/hooks/use-media-controls-model.d.ts.map +1 -0
  459. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts +27 -0
  460. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts.map +1 -0
  461. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts +12 -0
  462. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts.map +1 -0
  463. package/dist/modules/dock/hooks/use-surface-return.d.ts +8 -0
  464. package/dist/modules/dock/hooks/use-surface-return.d.ts.map +1 -0
  465. package/dist/modules/dock/hud.d.ts +8 -34
  466. package/dist/modules/dock/hud.d.ts.map +1 -1
  467. package/dist/modules/dock/index.d.ts +18 -12
  468. package/dist/modules/dock/index.d.ts.map +1 -1
  469. package/dist/modules/dock/lib/banner.d.ts +43 -0
  470. package/dist/modules/dock/lib/banner.d.ts.map +1 -0
  471. package/dist/modules/dock/lib/card-item.d.ts +46 -0
  472. package/dist/modules/dock/lib/card-item.d.ts.map +1 -0
  473. package/dist/modules/dock/lib/card.d.ts +20 -0
  474. package/dist/modules/dock/lib/card.d.ts.map +1 -0
  475. package/dist/modules/dock/lib/command-bar.d.ts +8 -0
  476. package/dist/modules/dock/lib/command-bar.d.ts.map +1 -0
  477. package/dist/modules/dock/lib/dom.d.ts +7 -0
  478. package/dist/modules/dock/lib/dom.d.ts.map +1 -0
  479. package/dist/modules/dock/lib/element-helpers.d.ts +8 -0
  480. package/dist/modules/dock/lib/element-helpers.d.ts.map +1 -0
  481. package/dist/modules/dock/lib/helpers.d.ts +19 -0
  482. package/dist/modules/dock/lib/helpers.d.ts.map +1 -0
  483. package/dist/modules/dock/lib/media.d.ts +35 -0
  484. package/dist/modules/dock/lib/media.d.ts.map +1 -0
  485. package/dist/modules/dock/lib/styles.d.ts +902 -0
  486. package/dist/modules/dock/lib/styles.d.ts.map +1 -0
  487. package/dist/modules/dock/model/hud-definition.d.ts +13 -0
  488. package/dist/modules/dock/model/hud-definition.d.ts.map +1 -0
  489. package/dist/modules/dock/model/hud.d.ts +10 -0
  490. package/dist/modules/dock/model/hud.d.ts.map +1 -0
  491. package/dist/modules/dock/model/layout.d.ts +28 -0
  492. package/dist/modules/dock/model/layout.d.ts.map +1 -0
  493. package/dist/modules/dock/model/page-entry.d.ts +11 -0
  494. package/dist/modules/dock/model/page-entry.d.ts.map +1 -0
  495. package/dist/modules/dock/model/page-surface.d.ts +4 -0
  496. package/dist/modules/dock/model/page-surface.d.ts.map +1 -0
  497. package/dist/modules/dock/model/paths.d.ts +15 -0
  498. package/dist/modules/dock/model/paths.d.ts.map +1 -0
  499. package/dist/modules/dock/model/state.d.ts +28 -0
  500. package/dist/modules/dock/model/state.d.ts.map +1 -0
  501. package/dist/modules/dock/model/surface-return.d.ts +14 -0
  502. package/dist/modules/dock/model/surface-return.d.ts.map +1 -0
  503. package/dist/modules/dock/module.d.ts +5 -7
  504. package/dist/modules/dock/module.d.ts.map +1 -1
  505. package/dist/modules/dock/motion.d.ts +716 -5
  506. package/dist/modules/dock/motion.d.ts.map +1 -1
  507. package/dist/modules/dock/provider.d.ts +2 -1
  508. package/dist/modules/dock/provider.d.ts.map +1 -1
  509. package/dist/modules/dock/routing/breadcrumbs.d.ts +6 -2
  510. package/dist/modules/dock/routing/breadcrumbs.d.ts.map +1 -1
  511. package/dist/modules/dock/routing/continuity.d.ts +46 -14
  512. package/dist/modules/dock/routing/continuity.d.ts.map +1 -1
  513. package/dist/modules/dock/routing/guards.d.ts +10 -1
  514. package/dist/modules/dock/routing/guards.d.ts.map +1 -1
  515. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts +12 -0
  516. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts.map +1 -0
  517. package/dist/modules/dock/routing/lib/restore.d.ts +7 -0
  518. package/dist/modules/dock/routing/lib/restore.d.ts.map +1 -0
  519. package/dist/modules/dock/routing/model/continuity.d.ts +21 -0
  520. package/dist/modules/dock/routing/model/continuity.d.ts.map +1 -0
  521. package/dist/modules/dock/routing/model/policy.d.ts +7 -0
  522. package/dist/modules/dock/routing/model/policy.d.ts.map +1 -0
  523. package/dist/modules/dock/routing/model/topology.d.ts +5 -0
  524. package/dist/modules/dock/routing/model/topology.d.ts.map +1 -0
  525. package/dist/modules/dock/routing/navigation.d.ts +10 -22
  526. package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
  527. package/dist/modules/dock/runtime/commands.d.ts +10 -1
  528. package/dist/modules/dock/runtime/commands.d.ts.map +1 -1
  529. package/dist/modules/dock/runtime/display.d.ts +9 -42
  530. package/dist/modules/dock/runtime/display.d.ts.map +1 -1
  531. package/dist/modules/dock/runtime/dock.d.ts +11 -70
  532. package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
  533. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts +10 -0
  534. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts.map +1 -0
  535. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts +10 -0
  536. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts.map +1 -0
  537. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts +14 -0
  538. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts.map +1 -0
  539. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts +7 -0
  540. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts.map +1 -0
  541. package/dist/modules/dock/runtime/hooks/use-dock.d.ts +30 -0
  542. package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +1 -0
  543. package/dist/modules/dock/runtime/model/attention.d.ts +25 -0
  544. package/dist/modules/dock/runtime/model/attention.d.ts.map +1 -0
  545. package/dist/modules/dock/runtime/model/cards.d.ts +64 -0
  546. package/dist/modules/dock/runtime/model/cards.d.ts.map +1 -0
  547. package/dist/modules/dock/runtime/model/items.d.ts +31 -0
  548. package/dist/modules/dock/runtime/model/items.d.ts.map +1 -0
  549. package/dist/modules/dock/runtime/model/layout.d.ts +10 -0
  550. package/dist/modules/dock/runtime/model/layout.d.ts.map +1 -0
  551. package/dist/modules/dock/runtime/pipeline.d.ts +1 -1
  552. package/dist/modules/dock/runtime/pipeline.d.ts.map +1 -1
  553. package/dist/modules/dock/runtime/provider-actions.d.ts +38 -0
  554. package/dist/modules/dock/runtime/provider-actions.d.ts.map +1 -0
  555. package/dist/modules/dock/status/action-options.d.ts +35 -0
  556. package/dist/modules/dock/status/action-options.d.ts.map +1 -0
  557. package/dist/modules/dock/status/events.d.ts +2 -2
  558. package/dist/modules/dock/status/events.d.ts.map +1 -1
  559. package/dist/modules/dock/status/hooks.d.ts +1 -1
  560. package/dist/modules/dock/status/hooks.d.ts.map +1 -1
  561. package/dist/modules/dock/status/model.d.ts +12 -32
  562. package/dist/modules/dock/status/model.d.ts.map +1 -1
  563. package/dist/modules/dock/status/state.d.ts +12 -0
  564. package/dist/modules/dock/status/state.d.ts.map +1 -0
  565. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts +5 -0
  566. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts.map +1 -0
  567. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts +7 -0
  568. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts.map +1 -0
  569. package/dist/modules/dock/surface/constants.d.ts +5 -0
  570. package/dist/modules/dock/surface/constants.d.ts.map +1 -0
  571. package/dist/modules/dock/surface/context.d.ts +14 -1
  572. package/dist/modules/dock/surface/context.d.ts.map +1 -1
  573. package/dist/modules/dock/surface/definition.d.ts +28 -2
  574. package/dist/modules/dock/surface/definition.d.ts.map +1 -1
  575. package/dist/modules/dock/surface/helpers.d.ts +2 -1
  576. package/dist/modules/dock/surface/helpers.d.ts.map +1 -1
  577. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts +15 -0
  578. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts.map +1 -0
  579. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts +7 -0
  580. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts.map +1 -0
  581. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts +14 -0
  582. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts.map +1 -0
  583. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts +20 -0
  584. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts.map +1 -0
  585. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts +13 -0
  586. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts.map +1 -0
  587. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts +28 -0
  588. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts.map +1 -0
  589. package/dist/modules/dock/surface/lib/drag.d.ts +9 -0
  590. package/dist/modules/dock/surface/lib/drag.d.ts.map +1 -0
  591. package/dist/modules/dock/surface/lib/target.d.ts +8 -0
  592. package/dist/modules/dock/surface/lib/target.d.ts.map +1 -0
  593. package/dist/modules/dock/surface/machine.d.ts +17 -62
  594. package/dist/modules/dock/surface/machine.d.ts.map +1 -1
  595. package/dist/modules/dock/surface/model/builder.d.ts +39 -0
  596. package/dist/modules/dock/surface/model/builder.d.ts.map +1 -0
  597. package/dist/modules/dock/surface/model/normalize.d.ts +13 -0
  598. package/dist/modules/dock/surface/model/normalize.d.ts.map +1 -0
  599. package/dist/modules/dock/surface/model/open.d.ts +26 -0
  600. package/dist/modules/dock/surface/model/open.d.ts.map +1 -0
  601. package/dist/modules/dock/surface/model/records.d.ts +45 -0
  602. package/dist/modules/dock/surface/model/records.d.ts.map +1 -0
  603. package/dist/modules/dock/surface/model/steps.d.ts +9 -0
  604. package/dist/modules/dock/surface/model/steps.d.ts.map +1 -0
  605. package/dist/modules/dock/surface/model/transition-state.d.ts +23 -0
  606. package/dist/modules/dock/surface/model/transition-state.d.ts.map +1 -0
  607. package/dist/modules/dock/surface/model/url.d.ts +14 -0
  608. package/dist/modules/dock/surface/model/url.d.ts.map +1 -0
  609. package/dist/modules/dock/surface/runtime/choreography.d.ts +22 -0
  610. package/dist/modules/dock/surface/runtime/choreography.d.ts.map +1 -0
  611. package/dist/modules/dock/surface/runtime/context.d.ts +29 -0
  612. package/dist/modules/dock/surface/runtime/context.d.ts.map +1 -0
  613. package/dist/modules/dock/surface/runtime/flows.d.ts +21 -0
  614. package/dist/modules/dock/surface/runtime/flows.d.ts.map +1 -0
  615. package/dist/modules/dock/surface/runtime/open.d.ts +6 -0
  616. package/dist/modules/dock/surface/runtime/open.d.ts.map +1 -0
  617. package/dist/modules/dock/surface/runtime/release.d.ts +9 -0
  618. package/dist/modules/dock/surface/runtime/release.d.ts.map +1 -0
  619. package/dist/modules/dock/surface/runtime/steps.d.ts +10 -0
  620. package/dist/modules/dock/surface/runtime/steps.d.ts.map +1 -0
  621. package/dist/modules/dock/surface/stack.d.ts +20 -11
  622. package/dist/modules/dock/surface/stack.d.ts.map +1 -1
  623. package/dist/modules/dock/surface/view-model.d.ts +5 -1
  624. package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
  625. package/dist/modules/dock/types/card.d.ts +297 -0
  626. package/dist/modules/dock/types/card.d.ts.map +1 -0
  627. package/dist/modules/dock/types/hud.d.ts +142 -0
  628. package/dist/modules/dock/types/hud.d.ts.map +1 -0
  629. package/dist/modules/dock/types/index.d.ts +8 -0
  630. package/dist/modules/dock/types/index.d.ts.map +1 -0
  631. package/dist/modules/dock/types/media.d.ts +66 -0
  632. package/dist/modules/dock/types/media.d.ts.map +1 -0
  633. package/dist/modules/dock/types/routing.d.ts +336 -0
  634. package/dist/modules/dock/types/routing.d.ts.map +1 -0
  635. package/dist/modules/dock/types/surface-flow.d.ts +231 -0
  636. package/dist/modules/dock/types/surface-flow.d.ts.map +1 -0
  637. package/dist/modules/dock/types/surface.d.ts +194 -0
  638. package/dist/modules/dock/types/surface.d.ts.map +1 -0
  639. package/dist/modules/dock/types/theme.d.ts +201 -0
  640. package/dist/modules/dock/types/theme.d.ts.map +1 -0
  641. package/dist/modules/index.d.ts +4 -0
  642. package/dist/modules/index.d.ts.map +1 -1
  643. package/dist/modules/index.js +23 -18
  644. package/dist/modules/loading/constants.d.ts +18 -1
  645. package/dist/modules/loading/constants.d.ts.map +1 -1
  646. package/dist/modules/loading/context.d.ts +11 -1
  647. package/dist/modules/loading/context.d.ts.map +1 -1
  648. package/dist/modules/loading/hooks.d.ts +24 -1
  649. package/dist/modules/loading/hooks.d.ts.map +1 -1
  650. package/dist/modules/loading/module.d.ts +6 -0
  651. package/dist/modules/loading/module.d.ts.map +1 -1
  652. package/dist/modules/loading/overlay.d.ts +3 -0
  653. package/dist/modules/loading/overlay.d.ts.map +1 -1
  654. package/dist/modules/loading/state.d.ts +13 -0
  655. package/dist/modules/loading/state.d.ts.map +1 -1
  656. package/dist/modules/loading/types.d.ts +42 -2
  657. package/dist/modules/loading/types.d.ts.map +1 -1
  658. package/dist/modules/media/constants.d.ts +19 -0
  659. package/dist/modules/media/constants.d.ts.map +1 -1
  660. package/dist/modules/media/context.d.ts +11 -1
  661. package/dist/modules/media/context.d.ts.map +1 -1
  662. package/dist/modules/media/hooks.d.ts +17 -0
  663. package/dist/modules/media/hooks.d.ts.map +1 -1
  664. package/dist/modules/media/module.d.ts +4 -0
  665. package/dist/modules/media/module.d.ts.map +1 -1
  666. package/dist/modules/media/overlay.d.ts +7 -0
  667. package/dist/modules/media/overlay.d.ts.map +1 -1
  668. package/dist/modules/media/playback.d.ts +13 -0
  669. package/dist/modules/media/playback.d.ts.map +1 -1
  670. package/dist/modules/media/session.d.ts +20 -0
  671. package/dist/modules/media/session.d.ts.map +1 -1
  672. package/dist/modules/media/types.d.ts +49 -2
  673. package/dist/modules/media/types.d.ts.map +1 -1
  674. package/dist/modules/modal/components/close-button.d.ts +6 -0
  675. package/dist/modules/modal/components/close-button.d.ts.map +1 -0
  676. package/dist/modules/modal/components/modal-container.d.ts +7 -0
  677. package/dist/modules/modal/components/modal-container.d.ts.map +1 -0
  678. package/dist/modules/modal/components/modal-layer-switcher.d.ts +9 -0
  679. package/dist/modules/modal/components/modal-layer-switcher.d.ts.map +1 -0
  680. package/dist/modules/modal/components/modal-layer.d.ts +17 -0
  681. package/dist/modules/modal/components/modal-layer.d.ts.map +1 -0
  682. package/dist/modules/modal/components/overlay.d.ts +6 -0
  683. package/dist/modules/modal/components/overlay.d.ts.map +1 -0
  684. package/dist/modules/modal/components/resolve-header.d.ts +10 -0
  685. package/dist/modules/modal/components/resolve-header.d.ts.map +1 -0
  686. package/dist/modules/modal/components/slot-row.d.ts +12 -0
  687. package/dist/modules/modal/components/slot-row.d.ts.map +1 -0
  688. package/dist/modules/modal/constants.d.ts +16 -1
  689. package/dist/modules/modal/constants.d.ts.map +1 -1
  690. package/dist/modules/modal/context.d.ts +7 -1
  691. package/dist/modules/modal/context.d.ts.map +1 -1
  692. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts +3 -0
  693. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts.map +1 -0
  694. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts +12 -0
  695. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts.map +1 -0
  696. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts +3 -0
  697. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts.map +1 -0
  698. package/dist/modules/modal/hooks.d.ts +30 -4
  699. package/dist/modules/modal/hooks.d.ts.map +1 -1
  700. package/dist/modules/modal/index.d.ts +7 -6
  701. package/dist/modules/modal/index.d.ts.map +1 -1
  702. package/dist/modules/modal/lib/dom.d.ts +13 -0
  703. package/dist/modules/modal/lib/dom.d.ts.map +1 -0
  704. package/dist/modules/modal/lib/theme.d.ts +4 -0
  705. package/dist/modules/modal/lib/theme.d.ts.map +1 -0
  706. package/dist/modules/modal/model/entry.d.ts +18 -0
  707. package/dist/modules/modal/model/entry.d.ts.map +1 -0
  708. package/dist/modules/modal/model/header.d.ts +16 -0
  709. package/dist/modules/modal/model/header.d.ts.map +1 -0
  710. package/dist/modules/modal/model/identity.d.ts +13 -0
  711. package/dist/modules/modal/model/identity.d.ts.map +1 -0
  712. package/dist/modules/modal/model/layout.d.ts +37 -0
  713. package/dist/modules/modal/model/layout.d.ts.map +1 -0
  714. package/dist/modules/modal/model/state.d.ts +10 -0
  715. package/dist/modules/modal/model/state.d.ts.map +1 -0
  716. package/dist/modules/modal/module.d.ts +7 -0
  717. package/dist/modules/modal/module.d.ts.map +1 -1
  718. package/dist/modules/modal/motion.d.ts.map +1 -1
  719. package/dist/modules/modal/types.d.ts +73 -1
  720. package/dist/modules/modal/types.d.ts.map +1 -1
  721. package/dist/modules/navigation/context.d.ts +16 -4
  722. package/dist/modules/navigation/context.d.ts.map +1 -1
  723. package/dist/modules/navigation/hooks.d.ts +28 -1
  724. package/dist/modules/navigation/hooks.d.ts.map +1 -1
  725. package/dist/modules/navigation/index.d.ts +5 -5
  726. package/dist/modules/navigation/index.d.ts.map +1 -1
  727. package/dist/modules/navigation/listeners.d.ts +10 -1
  728. package/dist/modules/navigation/listeners.d.ts.map +1 -1
  729. package/dist/modules/navigation/module.d.ts +5 -2
  730. package/dist/modules/navigation/module.d.ts.map +1 -1
  731. package/dist/modules/notification/constants.d.ts +22 -2
  732. package/dist/modules/notification/constants.d.ts.map +1 -1
  733. package/dist/modules/notification/context.d.ts +12 -2
  734. package/dist/modules/notification/context.d.ts.map +1 -1
  735. package/dist/modules/notification/hooks.d.ts +32 -1
  736. package/dist/modules/notification/hooks.d.ts.map +1 -1
  737. package/dist/modules/notification/module.d.ts +3 -0
  738. package/dist/modules/notification/module.d.ts.map +1 -1
  739. package/dist/modules/notification/motion.d.ts.map +1 -1
  740. package/dist/modules/notification/overlay.d.ts.map +1 -1
  741. package/dist/modules/notification/state.d.ts +28 -0
  742. package/dist/modules/notification/state.d.ts.map +1 -1
  743. package/dist/modules/notification/types.d.ts +48 -2
  744. package/dist/modules/notification/types.d.ts.map +1 -1
  745. package/dist/navigation/index.d.ts +1 -0
  746. package/dist/navigation/index.js +189 -0
  747. package/dist/navigation/index.js.map +1 -0
  748. package/dist/notification/index.d.ts +1 -0
  749. package/dist/notification/index.js +11 -0
  750. package/dist/overlay-QHSJBV3O.js +13 -0
  751. package/dist/overlay-QHSJBV3O.js.map +1 -0
  752. package/dist/provider/index.d.ts +1 -0
  753. package/dist/provider/index.js +14 -0
  754. package/dist/react/context/index.d.ts +4 -0
  755. package/dist/react/context/index.d.ts.map +1 -0
  756. package/dist/react/hooks/index.d.ts +10 -0
  757. package/dist/react/hooks/index.d.ts.map +1 -0
  758. package/dist/react/hooks/types.d.ts +25 -0
  759. package/dist/react/hooks/types.d.ts.map +1 -0
  760. package/dist/react/hooks/use-click-outside.d.ts +6 -0
  761. package/dist/react/hooks/use-click-outside.d.ts.map +1 -0
  762. package/dist/react/hooks/use-controllable-state.d.ts +7 -0
  763. package/dist/react/hooks/use-controllable-state.d.ts.map +1 -0
  764. package/dist/react/hooks/use-fullscreen-state.d.ts +7 -0
  765. package/dist/react/hooks/use-fullscreen-state.d.ts.map +1 -0
  766. package/dist/react/hooks/use-global-event.d.ts +9 -0
  767. package/dist/react/hooks/use-global-event.d.ts.map +1 -0
  768. package/dist/react/hooks/use-hotkey.d.ts +10 -0
  769. package/dist/react/hooks/use-hotkey.d.ts.map +1 -0
  770. package/dist/react/hooks/use-required-context.d.ts +6 -0
  771. package/dist/react/hooks/use-required-context.d.ts.map +1 -0
  772. package/dist/react/hooks/use-scroll-lock.d.ts +9 -0
  773. package/dist/react/hooks/use-scroll-lock.d.ts.map +1 -0
  774. package/dist/react/hooks/use-store.d.ts +3 -0
  775. package/dist/react/hooks/use-store.d.ts.map +1 -0
  776. package/dist/react/theme/index.d.ts +82 -0
  777. package/dist/react/theme/index.d.ts.map +1 -0
  778. package/dist/react/ui/components/avatar.d.ts +6 -0
  779. package/dist/react/ui/components/avatar.d.ts.map +1 -0
  780. package/dist/react/ui/components/button.d.ts +6 -0
  781. package/dist/react/ui/components/button.d.ts.map +1 -0
  782. package/dist/react/ui/components/carousel.d.ts +6 -0
  783. package/dist/react/ui/components/carousel.d.ts.map +1 -0
  784. package/dist/react/ui/components/checkbox.d.ts +10 -0
  785. package/dist/react/ui/components/checkbox.d.ts.map +1 -0
  786. package/dist/react/ui/components/icon.d.ts +6 -0
  787. package/dist/react/ui/components/icon.d.ts.map +1 -0
  788. package/dist/react/ui/components/image.d.ts +6 -0
  789. package/dist/react/ui/components/image.d.ts.map +1 -0
  790. package/dist/react/ui/components/indicator.d.ts +45 -0
  791. package/dist/react/ui/components/indicator.d.ts.map +1 -0
  792. package/dist/react/ui/components/input.d.ts +10 -0
  793. package/dist/react/ui/components/input.d.ts.map +1 -0
  794. package/dist/react/ui/components/loader.d.ts +10 -0
  795. package/dist/react/ui/components/loader.d.ts.map +1 -0
  796. package/dist/react/ui/components/segmented.d.ts +6 -0
  797. package/dist/react/ui/components/segmented.d.ts.map +1 -0
  798. package/dist/react/ui/components/select-parts.d.ts +22 -0
  799. package/dist/react/ui/components/select-parts.d.ts.map +1 -0
  800. package/dist/react/ui/components/select.d.ts +6 -0
  801. package/dist/react/ui/components/select.d.ts.map +1 -0
  802. package/dist/react/ui/components/skeleton.d.ts +10 -0
  803. package/dist/react/ui/components/skeleton.d.ts.map +1 -0
  804. package/dist/react/ui/components/switch.d.ts +6 -0
  805. package/dist/react/ui/components/switch.d.ts.map +1 -0
  806. package/dist/react/ui/components/tooltip.d.ts +11 -0
  807. package/dist/react/ui/components/tooltip.d.ts.map +1 -0
  808. package/dist/react/ui/index.d.ts +19 -0
  809. package/dist/react/ui/index.d.ts.map +1 -0
  810. package/dist/react/ui/provider.d.ts +22 -0
  811. package/dist/react/ui/provider.d.ts.map +1 -0
  812. package/dist/react/ui/types-controls.d.ts +133 -0
  813. package/dist/react/ui/types-controls.d.ts.map +1 -0
  814. package/dist/react/ui/types.d.ts +192 -0
  815. package/dist/react/ui/types.d.ts.map +1 -0
  816. package/dist/react/ui/utils.d.ts +65 -0
  817. package/dist/react/ui/utils.d.ts.map +1 -0
  818. package/dist/recipes/index.d.ts +1 -0
  819. package/dist/recipes/index.js +233 -0
  820. package/dist/recipes/index.js.map +1 -0
  821. package/dist/result/index.d.ts +1 -0
  822. package/dist/result/index.js +98 -0
  823. package/dist/result/index.js.map +1 -0
  824. package/dist/theme/index.d.ts +1 -0
  825. package/dist/theme/index.js +6 -0
  826. package/dist/ui/index.d.ts +1 -19
  827. package/dist/ui/index.js +2158 -1860
  828. package/dist/ui/index.js.map +1 -1
  829. package/dist/utils/index.d.ts +1 -15
  830. package/dist/utils/index.js +194 -71
  831. package/dist/utils/index.js.map +1 -1
  832. package/docs/README.md +58 -61
  833. package/docs/architecture-and-rules.md +133 -58
  834. package/docs/core-engine.md +36 -52
  835. package/docs/custom-modules.md +43 -32
  836. package/docs/design.md +185 -0
  837. package/docs/getting-started.md +49 -57
  838. package/docs/modules/README.md +50 -61
  839. package/docs/modules/ambient.md +95 -87
  840. package/docs/modules/background.md +39 -36
  841. package/docs/modules/context-menu.md +19 -18
  842. package/docs/modules/controls.md +13 -13
  843. package/docs/modules/dock.md +74 -93
  844. package/docs/modules/error-boundary.md +2 -2
  845. package/docs/modules/kernel.md +38 -26
  846. package/docs/modules/loading.md +14 -14
  847. package/docs/modules/media.md +13 -13
  848. package/docs/modules/modal.md +14 -14
  849. package/docs/modules/navigation.md +87 -84
  850. package/docs/modules/notification.md +13 -13
  851. package/docs/modules/result.md +22 -22
  852. package/docs/proposals/navigation.md +32 -31
  853. package/docs/testing.md +34 -28
  854. package/docs/theming.md +67 -44
  855. package/package.json +100 -97
  856. package/templates/AGENTS.md +35 -25
  857. package/dist/atoms/button.d.ts +0 -11
  858. package/dist/atoms/button.d.ts.map +0 -1
  859. package/dist/atoms/icon.d.ts +0 -15
  860. package/dist/atoms/icon.d.ts.map +0 -1
  861. package/dist/atoms/index.d.ts +0 -5
  862. package/dist/atoms/index.d.ts.map +0 -1
  863. package/dist/atoms/index.js +0 -4
  864. package/dist/atoms/spinner.d.ts +0 -9
  865. package/dist/atoms/spinner.d.ts.map +0 -1
  866. package/dist/atoms/tooltip.d.ts +0 -18
  867. package/dist/atoms/tooltip.d.ts.map +0 -1
  868. package/dist/chunk-6UFMD6TK.js +0 -419
  869. package/dist/chunk-6UFMD6TK.js.map +0 -1
  870. package/dist/chunk-AA2TWJQI.js +0 -2186
  871. package/dist/chunk-AA2TWJQI.js.map +0 -1
  872. package/dist/chunk-ACLLDU3J.js +0 -888
  873. package/dist/chunk-ACLLDU3J.js.map +0 -1
  874. package/dist/chunk-DGCQWQLZ.js +0 -61
  875. package/dist/chunk-DGCQWQLZ.js.map +0 -1
  876. package/dist/chunk-E6ANX5YP.js +0 -1273
  877. package/dist/chunk-E6ANX5YP.js.map +0 -1
  878. package/dist/chunk-GDCVEINL.js +0 -408
  879. package/dist/chunk-GDCVEINL.js.map +0 -1
  880. package/dist/chunk-GN666KV5.js +0 -28
  881. package/dist/chunk-GN666KV5.js.map +0 -1
  882. package/dist/chunk-HCSDQEFB.js +0 -845
  883. package/dist/chunk-HCSDQEFB.js.map +0 -1
  884. package/dist/chunk-HMEWYAWU.js +0 -1889
  885. package/dist/chunk-HMEWYAWU.js.map +0 -1
  886. package/dist/chunk-I3IZUBBU.js +0 -97
  887. package/dist/chunk-I3IZUBBU.js.map +0 -1
  888. package/dist/chunk-JCZUCKI3.js +0 -27
  889. package/dist/chunk-JCZUCKI3.js.map +0 -1
  890. package/dist/chunk-MAGYFVKH.js +0 -67
  891. package/dist/chunk-MAGYFVKH.js.map +0 -1
  892. package/dist/chunk-NEBGCFE3.js +0 -521
  893. package/dist/chunk-NEBGCFE3.js.map +0 -1
  894. package/dist/chunk-NK2DQB3G.js +0 -306
  895. package/dist/chunk-NK2DQB3G.js.map +0 -1
  896. package/dist/chunk-QI3ALLIB.js +0 -38
  897. package/dist/chunk-QI3ALLIB.js.map +0 -1
  898. package/dist/chunk-QM2P6TIU.js +0 -353
  899. package/dist/chunk-QM2P6TIU.js.map +0 -1
  900. package/dist/chunk-RFP2DJAB.js +0 -658
  901. package/dist/chunk-RFP2DJAB.js.map +0 -1
  902. package/dist/chunk-SQ7XZMCN.js +0 -481
  903. package/dist/chunk-SQ7XZMCN.js.map +0 -1
  904. package/dist/chunk-TMTMQNEQ.js +0 -372
  905. package/dist/chunk-TMTMQNEQ.js.map +0 -1
  906. package/dist/chunk-VDNE3A7X.js +0 -9724
  907. package/dist/chunk-VDNE3A7X.js.map +0 -1
  908. package/dist/chunk-XATRMFGU.js +0 -139
  909. package/dist/chunk-XATRMFGU.js.map +0 -1
  910. package/dist/chunk-ZAP2YHZG.js +0 -454
  911. package/dist/chunk-ZAP2YHZG.js.map +0 -1
  912. package/dist/chunk-ZH5FUYPG.js +0 -349
  913. package/dist/chunk-ZH5FUYPG.js.map +0 -1
  914. package/dist/chunk-ZKM4RETZ.js +0 -51
  915. package/dist/chunk-ZKM4RETZ.js.map +0 -1
  916. package/dist/error/boundary.d.ts +0 -14
  917. package/dist/error/boundary.d.ts.map +0 -1
  918. package/dist/error/constants.d.ts +0 -18
  919. package/dist/error/constants.d.ts.map +0 -1
  920. package/dist/error/index.d.ts.map +0 -1
  921. package/dist/error/listener.d.ts +0 -2
  922. package/dist/error/listener.d.ts.map +0 -1
  923. package/dist/error/reporter.d.ts +0 -32
  924. package/dist/error/reporter.d.ts.map +0 -1
  925. package/dist/error/theme.d.ts +0 -3
  926. package/dist/error/theme.d.ts.map +0 -1
  927. package/dist/error/types.d.ts +0 -91
  928. package/dist/error/types.d.ts.map +0 -1
  929. package/dist/error/utils.d.ts +0 -21
  930. package/dist/error/utils.d.ts.map +0 -1
  931. package/dist/events.d.ts +0 -51
  932. package/dist/events.d.ts.map +0 -1
  933. package/dist/events.js +0 -82
  934. package/dist/events.js.map +0 -1
  935. package/dist/hooks/index.d.ts.map +0 -1
  936. package/dist/hooks/types.d.ts +0 -16
  937. package/dist/hooks/types.d.ts.map +0 -1
  938. package/dist/hooks/use-click-outside.d.ts +0 -3
  939. package/dist/hooks/use-click-outside.d.ts.map +0 -1
  940. package/dist/hooks/use-controllable-state.d.ts +0 -3
  941. package/dist/hooks/use-controllable-state.d.ts.map +0 -1
  942. package/dist/hooks/use-fullscreen-state.d.ts +0 -4
  943. package/dist/hooks/use-fullscreen-state.d.ts.map +0 -1
  944. package/dist/hooks/use-global-event.d.ts +0 -5
  945. package/dist/hooks/use-global-event.d.ts.map +0 -1
  946. package/dist/hooks/use-hotkey.d.ts +0 -4
  947. package/dist/hooks/use-hotkey.d.ts.map +0 -1
  948. package/dist/hooks/use-isomorphic-layout-effect.d.ts +0 -3
  949. package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +0 -1
  950. package/dist/hooks/use-required-context.d.ts +0 -3
  951. package/dist/hooks/use-required-context.d.ts.map +0 -1
  952. package/dist/hooks/use-scroll-lock.d.ts +0 -3
  953. package/dist/hooks/use-scroll-lock.d.ts.map +0 -1
  954. package/dist/hooks/use-store.d.ts +0 -3
  955. package/dist/hooks/use-store.d.ts.map +0 -1
  956. package/dist/kernel/adapters.d.ts +0 -5
  957. package/dist/kernel/adapters.d.ts.map +0 -1
  958. package/dist/kernel/compose.d.ts +0 -15
  959. package/dist/kernel/compose.d.ts.map +0 -1
  960. package/dist/kernel/constants.d.ts +0 -12
  961. package/dist/kernel/constants.d.ts.map +0 -1
  962. package/dist/kernel/context-registry.d.ts +0 -3
  963. package/dist/kernel/context-registry.d.ts.map +0 -1
  964. package/dist/kernel/handlers.d.ts +0 -3
  965. package/dist/kernel/handlers.d.ts.map +0 -1
  966. package/dist/kernel/hooks.d.ts +0 -7
  967. package/dist/kernel/hooks.d.ts.map +0 -1
  968. package/dist/kernel/index.d.ts.map +0 -1
  969. package/dist/kernel/installed.d.ts +0 -21
  970. package/dist/kernel/installed.d.ts.map +0 -1
  971. package/dist/kernel/module.d.ts +0 -32
  972. package/dist/kernel/module.d.ts.map +0 -1
  973. package/dist/kernel/operations.d.ts +0 -21
  974. package/dist/kernel/operations.d.ts.map +0 -1
  975. package/dist/kernel/page-controller.d.ts +0 -8
  976. package/dist/kernel/page-controller.d.ts.map +0 -1
  977. package/dist/kernel/provider.d.ts +0 -18
  978. package/dist/kernel/provider.d.ts.map +0 -1
  979. package/dist/kernel/runtime.d.ts.map +0 -1
  980. package/dist/kernel/schema.d.ts +0 -11
  981. package/dist/kernel/schema.d.ts.map +0 -1
  982. package/dist/kernel/store.d.ts +0 -4
  983. package/dist/kernel/store.d.ts.map +0 -1
  984. package/dist/kernel/types.d.ts +0 -233
  985. package/dist/kernel/types.d.ts.map +0 -1
  986. package/dist/kernel/utils.d.ts +0 -18
  987. package/dist/kernel/utils.d.ts.map +0 -1
  988. package/dist/modules/ambient/index.js +0 -10
  989. package/dist/modules/ambient/server/index.js +0 -225
  990. package/dist/modules/ambient/server/index.js.map +0 -1
  991. package/dist/modules/ambient/worker/index.js +0 -122
  992. package/dist/modules/ambient/worker/index.js.map +0 -1
  993. package/dist/modules/background/index.js +0 -9
  994. package/dist/modules/background/overlay.d.ts +0 -135
  995. package/dist/modules/background/overlay.d.ts.map +0 -1
  996. package/dist/modules/background/playback.d.ts +0 -10
  997. package/dist/modules/background/playback.d.ts.map +0 -1
  998. package/dist/modules/background/state.d.ts +0 -9
  999. package/dist/modules/background/state.d.ts.map +0 -1
  1000. package/dist/modules/background/visual.d.ts +0 -48
  1001. package/dist/modules/background/visual.d.ts.map +0 -1
  1002. package/dist/modules/background/youtube/iframe.d.ts +0 -52
  1003. package/dist/modules/background/youtube/iframe.d.ts.map +0 -1
  1004. package/dist/modules/background/youtube/parse.d.ts +0 -17
  1005. package/dist/modules/background/youtube/parse.d.ts.map +0 -1
  1006. package/dist/modules/background/youtube/player.d.ts +0 -28
  1007. package/dist/modules/background/youtube/player.d.ts.map +0 -1
  1008. package/dist/modules/context-menu/index.js +0 -14
  1009. package/dist/modules/controls/index.js +0 -7
  1010. package/dist/modules/dock/cards.d.ts +0 -1722
  1011. package/dist/modules/dock/cards.d.ts.map +0 -1
  1012. package/dist/modules/dock/dom.d.ts +0 -24
  1013. package/dist/modules/dock/dom.d.ts.map +0 -1
  1014. package/dist/modules/dock/helpers.d.ts +0 -25
  1015. package/dist/modules/dock/helpers.d.ts.map +0 -1
  1016. package/dist/modules/dock/hooks.d.ts +0 -42
  1017. package/dist/modules/dock/hooks.d.ts.map +0 -1
  1018. package/dist/modules/dock/index.js +0 -13
  1019. package/dist/modules/dock/layout.d.ts +0 -26
  1020. package/dist/modules/dock/layout.d.ts.map +0 -1
  1021. package/dist/modules/dock/overlay.d.ts +0 -79
  1022. package/dist/modules/dock/overlay.d.ts.map +0 -1
  1023. package/dist/modules/dock/paths.d.ts +0 -10
  1024. package/dist/modules/dock/paths.d.ts.map +0 -1
  1025. package/dist/modules/dock/state.d.ts +0 -22
  1026. package/dist/modules/dock/state.d.ts.map +0 -1
  1027. package/dist/modules/dock/styles.d.ts +0 -900
  1028. package/dist/modules/dock/styles.d.ts.map +0 -1
  1029. package/dist/modules/dock/surface/hooks.d.ts +0 -110
  1030. package/dist/modules/dock/surface/hooks.d.ts.map +0 -1
  1031. package/dist/modules/dock/types.d.ts +0 -1274
  1032. package/dist/modules/dock/types.d.ts.map +0 -1
  1033. package/dist/modules/loading/index.js +0 -8
  1034. package/dist/modules/media/index.js +0 -6
  1035. package/dist/modules/modal/dom.d.ts +0 -4
  1036. package/dist/modules/modal/dom.d.ts.map +0 -1
  1037. package/dist/modules/modal/header.d.ts +0 -7
  1038. package/dist/modules/modal/header.d.ts.map +0 -1
  1039. package/dist/modules/modal/identity.d.ts +0 -7
  1040. package/dist/modules/modal/identity.d.ts.map +0 -1
  1041. package/dist/modules/modal/index.js +0 -11
  1042. package/dist/modules/modal/layout.d.ts +0 -13
  1043. package/dist/modules/modal/layout.d.ts.map +0 -1
  1044. package/dist/modules/modal/overlay.d.ts +0 -4
  1045. package/dist/modules/modal/overlay.d.ts.map +0 -1
  1046. package/dist/modules/modal/state.d.ts +0 -4
  1047. package/dist/modules/modal/state.d.ts.map +0 -1
  1048. package/dist/modules/navigation/constants.d.ts +0 -33
  1049. package/dist/modules/navigation/constants.d.ts.map +0 -1
  1050. package/dist/modules/navigation/index.js +0 -80
  1051. package/dist/modules/navigation/index.js.map +0 -1
  1052. package/dist/modules/navigation/navigator.d.ts +0 -3
  1053. package/dist/modules/navigation/navigator.d.ts.map +0 -1
  1054. package/dist/modules/navigation/settings.d.ts +0 -5
  1055. package/dist/modules/navigation/settings.d.ts.map +0 -1
  1056. package/dist/modules/navigation/state.d.ts +0 -19
  1057. package/dist/modules/navigation/state.d.ts.map +0 -1
  1058. package/dist/modules/navigation/types.d.ts +0 -118
  1059. package/dist/modules/navigation/types.d.ts.map +0 -1
  1060. package/dist/modules/navigation/utils.d.ts +0 -8
  1061. package/dist/modules/navigation/utils.d.ts.map +0 -1
  1062. package/dist/modules/notification/index.js +0 -7
  1063. package/dist/overlay-LTRZUZQD.js +0 -9
  1064. package/dist/overlay-LTRZUZQD.js.map +0 -1
  1065. package/dist/provider.d.ts +0 -23
  1066. package/dist/provider.d.ts.map +0 -1
  1067. package/dist/provider.js +0 -9
  1068. package/dist/provider.js.map +0 -1
  1069. package/dist/result.d.ts +0 -50
  1070. package/dist/result.d.ts.map +0 -1
  1071. package/dist/result.js +0 -102
  1072. package/dist/result.js.map +0 -1
  1073. package/dist/theme.d.ts +0 -46
  1074. package/dist/theme.d.ts.map +0 -1
  1075. package/dist/theme.js +0 -6
  1076. package/dist/theme.js.map +0 -1
  1077. package/dist/tokens/index.d.ts +0 -4
  1078. package/dist/tokens/index.d.ts.map +0 -1
  1079. package/dist/tokens/index.js +0 -297
  1080. package/dist/tokens/index.js.map +0 -1
  1081. package/dist/tokens/motion-config.d.ts +0 -35
  1082. package/dist/tokens/motion-config.d.ts.map +0 -1
  1083. package/dist/tokens/motion.d.ts +0 -164
  1084. package/dist/tokens/motion.d.ts.map +0 -1
  1085. package/dist/tokens/tokens.d.ts +0 -34
  1086. package/dist/tokens/tokens.d.ts.map +0 -1
  1087. package/dist/ui/carousel/carousel.d.ts +0 -24
  1088. package/dist/ui/carousel/carousel.d.ts.map +0 -1
  1089. package/dist/ui/carousel/track.d.ts +0 -11
  1090. package/dist/ui/carousel/track.d.ts.map +0 -1
  1091. package/dist/ui/carousel/use-drag-scroll.d.ts +0 -3
  1092. package/dist/ui/carousel/use-drag-scroll.d.ts.map +0 -1
  1093. package/dist/ui/cn.d.ts +0 -19
  1094. package/dist/ui/cn.d.ts.map +0 -1
  1095. package/dist/ui/components/avatar.d.ts +0 -14
  1096. package/dist/ui/components/avatar.d.ts.map +0 -1
  1097. package/dist/ui/components/button.d.ts +0 -9
  1098. package/dist/ui/components/button.d.ts.map +0 -1
  1099. package/dist/ui/components/checkbox.d.ts +0 -18
  1100. package/dist/ui/components/checkbox.d.ts.map +0 -1
  1101. package/dist/ui/components/icon.d.ts +0 -4
  1102. package/dist/ui/components/icon.d.ts.map +0 -1
  1103. package/dist/ui/components/image.d.ts +0 -13
  1104. package/dist/ui/components/image.d.ts.map +0 -1
  1105. package/dist/ui/components/indicator.d.ts +0 -37
  1106. package/dist/ui/components/indicator.d.ts.map +0 -1
  1107. package/dist/ui/components/input.d.ts +0 -15
  1108. package/dist/ui/components/input.d.ts.map +0 -1
  1109. package/dist/ui/components/loader.d.ts +0 -17
  1110. package/dist/ui/components/loader.d.ts.map +0 -1
  1111. package/dist/ui/components/segmented.d.ts +0 -21
  1112. package/dist/ui/components/segmented.d.ts.map +0 -1
  1113. package/dist/ui/components/select.d.ts +0 -34
  1114. package/dist/ui/components/select.d.ts.map +0 -1
  1115. package/dist/ui/components/skeleton.d.ts +0 -16
  1116. package/dist/ui/components/skeleton.d.ts.map +0 -1
  1117. package/dist/ui/components/switch.d.ts +0 -11
  1118. package/dist/ui/components/switch.d.ts.map +0 -1
  1119. package/dist/ui/components/tooltip.d.ts +0 -25
  1120. package/dist/ui/components/tooltip.d.ts.map +0 -1
  1121. package/dist/ui/defaults.d.ts +0 -250
  1122. package/dist/ui/defaults.d.ts.map +0 -1
  1123. package/dist/ui/define.d.ts +0 -112
  1124. package/dist/ui/define.d.ts.map +0 -1
  1125. package/dist/ui/index.d.ts.map +0 -1
  1126. package/dist/ui/provider.d.ts +0 -11
  1127. package/dist/ui/provider.d.ts.map +0 -1
  1128. package/dist/ui/recipe.d.ts +0 -70
  1129. package/dist/ui/recipe.d.ts.map +0 -1
  1130. package/dist/ui/recipes.d.ts +0 -9
  1131. package/dist/ui/recipes.d.ts.map +0 -1
  1132. package/dist/ui/recipes.js +0 -648
  1133. package/dist/ui/recipes.js.map +0 -1
  1134. package/dist/ui/split.d.ts +0 -4
  1135. package/dist/ui/split.d.ts.map +0 -1
  1136. package/dist/ui/tones.d.ts +0 -23
  1137. package/dist/ui/tones.d.ts.map +0 -1
  1138. package/dist/utils/cn.d.ts +0 -3
  1139. package/dist/utils/cn.d.ts.map +0 -1
  1140. package/dist/utils/dom.d.ts +0 -5
  1141. package/dist/utils/dom.d.ts.map +0 -1
  1142. package/dist/utils/index.d.ts.map +0 -1
  1143. package/dist/utils/number.d.ts +0 -3
  1144. package/dist/utils/number.d.ts.map +0 -1
  1145. package/dist/utils/object.d.ts +0 -5
  1146. package/dist/utils/object.d.ts.map +0 -1
  1147. package/dist/utils/report.d.ts +0 -5
  1148. package/dist/utils/report.d.ts.map +0 -1
  1149. package/dist/utils/scheduler.d.ts +0 -34
  1150. package/dist/utils/scheduler.d.ts.map +0 -1
  1151. package/dist/utils/store.d.ts +0 -11
  1152. package/dist/utils/store.d.ts.map +0 -1
  1153. package/dist/utils/string.d.ts +0 -5
  1154. package/dist/utils/string.d.ts.map +0 -1
  1155. package/dist/utils/timing.d.ts +0 -7
  1156. package/dist/utils/timing.d.ts.map +0 -1
  1157. package/dist/utils/user-message.d.ts +0 -20
  1158. package/dist/utils/user-message.d.ts.map +0 -1
  1159. package/docs/ui.md +0 -183
  1160. package/styles/effects.css +0 -219
  1161. package/styles/index.css +0 -8
  1162. package/styles/interaction.css +0 -273
  1163. package/styles/palette.css +0 -81
  1164. package/styles/time.css +0 -26
  1165. package/styles/tokens.css +0 -114
  1166. package/styles/utilities.css +0 -110
  1167. package/templates/motion/background.ts +0 -15
  1168. package/templates/motion/context-menu.ts +0 -65
  1169. package/templates/motion/dock.ts +0 -421
  1170. package/templates/motion/modal.ts +0 -82
  1171. package/templates/motion/notification.ts +0 -26
  1172. package/templates/motion/tokens.ts +0 -36
  1173. /package/dist/{atoms → ambient}/index.js.map +0 -0
  1174. /package/dist/{modules/ambient → background}/index.js.map +0 -0
  1175. /package/dist/{modules/background → context-menu}/index.js.map +0 -0
  1176. /package/dist/{modules/context-menu → controls}/index.js.map +0 -0
  1177. /package/dist/{kernel → core/kernel}/runtime.d.ts +0 -0
  1178. /package/dist/{modules/controls → dock}/index.js.map +0 -0
  1179. /package/dist/{modules/dock → loading}/index.js.map +0 -0
  1180. /package/dist/{modules/loading → media}/index.js.map +0 -0
  1181. /package/dist/{modules/media → notification}/index.js.map +0 -0
  1182. /package/dist/{modules/modal → provider}/index.js.map +0 -0
  1183. /package/dist/{modules/notification → theme}/index.js.map +0 -0
@@ -1,1889 +0,0 @@
1
- import { createStore, isObject, report, useIsomorphicLayoutEffect, useStore, useRequiredContext, shallowEqual, trimToNull, isPlainObject } from './chunk-HCSDQEFB.js';
2
- import { createContext, useState, useMemo, useCallback, useSyncExternalStore, use, useId, useRef, useEffect, createElement, Fragment as Fragment$1, isValidElement, cloneElement, Children } from 'react';
3
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { usePathname } from 'next/navigation';
5
-
6
- // src/kernel/constants.ts
7
- var DEFAULT_SOURCE = "dynamic";
8
- var REGISTRY_SOURCES = Object.freeze({
9
- STATIC: "static",
10
- DYNAMIC: "dynamic",
11
- USER: "user"
12
- });
13
- var REGISTRY_LIFECYCLES = Object.freeze({
14
- IMMEDIATE: "immediate",
15
- GRACEFUL: "graceful",
16
- PERSISTENT: "persistent",
17
- ROUTE: "route"
18
- });
19
- var REGISTRY_VALIDATION_MODES = Object.freeze({
20
- WARN: "warn",
21
- STRICT: "strict"
22
- });
23
- var REGISTRY_METADATA_KEYS = Object.freeze([
24
- "cleanup",
25
- "cleanupDelayMs",
26
- "instanceId",
27
- "lifecycle",
28
- "priority",
29
- "source",
30
- "scope",
31
- "validation"
32
- ]);
33
- var REGISTRY_SOURCE_PRIORITY = Object.freeze({
34
- [REGISTRY_SOURCES.STATIC]: 100,
35
- [REGISTRY_SOURCES.DYNAMIC]: 200,
36
- [REGISTRY_SOURCES.USER]: 300
37
- });
38
- var REGISTRY_SOURCE_RANK = Object.freeze({
39
- [REGISTRY_SOURCES.STATIC]: 10,
40
- [REGISTRY_SOURCES.DYNAMIC]: 20,
41
- [REGISTRY_SOURCES.USER]: 30
42
- });
43
- var REGISTRY_LIFECYCLE_VALUES = new Set(
44
- Object.values(REGISTRY_LIFECYCLES)
45
- );
46
- var REGISTRY_METADATA_KEY_SET = new Set(
47
- REGISTRY_METADATA_KEYS
48
- );
49
- var REGISTRY_SCOPE_KINDS = Object.freeze({
50
- APP: "app",
51
- SESSION: "session",
52
- ROUTE: "route",
53
- INSTANCE: "instance",
54
- WORKSPACE: "workspace"
55
- });
56
- var DEFAULT_REGISTRY_SCOPE = REGISTRY_SCOPE_KINDS.APP;
57
- function getOrCreateGlobalContext(name, defaultValue) {
58
- const sym = /* @__PURE__ */ Symbol.for(`@omerdlw/base-framework/context/${name}`);
59
- const store = globalThis;
60
- if (!store[sym]) {
61
- store[sym] = createContext(defaultValue);
62
- }
63
- return store[sym];
64
- }
65
-
66
- // src/kernel/utils.ts
67
- function hasOwnProperty(target, key) {
68
- return Object.prototype.hasOwnProperty.call(target, key);
69
- }
70
- function parseFiniteNumber(value) {
71
- const parsed = Number(value);
72
- return Number.isFinite(parsed) ? parsed : null;
73
- }
74
- function getValidString(value, fallback = null) {
75
- return trimToNull(value) ?? fallback;
76
- }
77
- function resolveInstanceId(value) {
78
- return isObject(value) && typeof value.instanceId === "string" ? value.instanceId : null;
79
- }
80
- function getSourceRank(source) {
81
- return REGISTRY_SOURCE_RANK[source] ?? 0;
82
- }
83
- function resolveRegisterInput(sourceOrOptions, optionsArg) {
84
- if (typeof sourceOrOptions === "string") {
85
- return {
86
- source: sourceOrOptions,
87
- options: isObject(optionsArg) ? optionsArg : {}
88
- };
89
- }
90
- if (isObject(sourceOrOptions)) {
91
- return {
92
- source: typeof sourceOrOptions.source === "string" ? sourceOrOptions.source : DEFAULT_SOURCE,
93
- options: sourceOrOptions
94
- };
95
- }
96
- return {
97
- source: DEFAULT_SOURCE,
98
- options: isObject(optionsArg) ? optionsArg : {}
99
- };
100
- }
101
- function resolveScope(options) {
102
- return typeof options?.scope === "string" && options.scope.trim() ? options.scope.trim() : DEFAULT_REGISTRY_SCOPE;
103
- }
104
- function resolveUnregisterInput(sourceOrOptions) {
105
- if (typeof sourceOrOptions === "string") {
106
- return { instanceId: null, scope: null, source: sourceOrOptions };
107
- }
108
- if (isObject(sourceOrOptions)) {
109
- return {
110
- instanceId: resolveInstanceId(sourceOrOptions),
111
- scope: typeof sourceOrOptions.scope === "string" && sourceOrOptions.scope.trim() ? sourceOrOptions.scope.trim() : null,
112
- source: typeof sourceOrOptions.source === "string" ? sourceOrOptions.source : DEFAULT_SOURCE
113
- };
114
- }
115
- return { instanceId: null, scope: null, source: DEFAULT_SOURCE };
116
- }
117
- function mergeModuleConfigs(base, patch) {
118
- const source = base;
119
- const changes = patch;
120
- const result = { ...source };
121
- Object.keys(changes).forEach((key) => {
122
- const baseVal = source[key];
123
- const patchVal = changes[key];
124
- if (baseVal && typeof baseVal === "object" && !Array.isArray(baseVal) && patchVal && typeof patchVal === "object" && !Array.isArray(patchVal)) {
125
- result[key] = { ...baseVal, ...patchVal };
126
- } else {
127
- result[key] = patchVal;
128
- }
129
- });
130
- return result;
131
- }
132
-
133
- // src/kernel/schema.ts
134
- function resolveLifecycle(metadata, fallback) {
135
- const lifecycle = metadata?.lifecycle ?? metadata?.cleanup;
136
- return lifecycle && REGISTRY_LIFECYCLE_VALUES.has(lifecycle) ? lifecycle : fallback;
137
- }
138
- function validateRegistryMetadata(metadata) {
139
- if (metadata === void 0 || metadata === null)
140
- return { issues: [], valid: true };
141
- if (!isObject(metadata))
142
- return { issues: ["registry metadata must be an object"], valid: false };
143
- const issues = [];
144
- Object.keys(metadata).forEach((key) => {
145
- if (!REGISTRY_METADATA_KEY_SET.has(key))
146
- issues.push(`unknown registry metadata field: ${key}`);
147
- });
148
- if (metadata.source !== void 0 && !getValidString(metadata.source))
149
- issues.push("source must be a non-empty string");
150
- if (metadata.instanceId !== void 0 && !getValidString(metadata.instanceId))
151
- issues.push("instanceId must be a non-empty string");
152
- if (metadata.scope !== void 0 && !getValidString(metadata.scope))
153
- issues.push("scope must be a non-empty string");
154
- if (metadata.priority !== void 0 && parseFiniteNumber(metadata.priority) === null)
155
- issues.push("priority must be a finite number");
156
- if (metadata.cleanupDelayMs !== void 0) {
157
- const delay = parseFiniteNumber(metadata.cleanupDelayMs);
158
- if (delay === null || delay < 0)
159
- issues.push("cleanupDelayMs must be a non-negative finite number");
160
- }
161
- const lifecycle = metadata.lifecycle ?? metadata.cleanup;
162
- if (lifecycle !== void 0 && !REGISTRY_LIFECYCLE_VALUES.has(String(lifecycle))) {
163
- issues.push(
164
- `lifecycle must be one of: ${[...REGISTRY_LIFECYCLE_VALUES].join(", ")}`
165
- );
166
- }
167
- if (metadata.validation !== void 0 && !Object.values(REGISTRY_VALIDATION_MODES).includes(
168
- metadata.validation
169
- )) {
170
- issues.push(
171
- `validation must be one of: ${Object.values(REGISTRY_VALIDATION_MODES).join(", ")}`
172
- );
173
- }
174
- return { issues, valid: issues.length === 0 };
175
- }
176
- function validateRegistryKey(type, key, definitions) {
177
- const definition = definitions.get(type);
178
- const issues = [];
179
- if (!definition) issues.push(`unknown registry type: ${String(type)}`);
180
- if (!getValidString(key))
181
- return {
182
- issues: [...issues, "key must be a non-empty string"],
183
- valid: false
184
- };
185
- const normalizedKey = String(key).trim();
186
- if (definition?.keyPolicy === "singleton") {
187
- const expectedKey = definition.singletonKey;
188
- if (expectedKey && normalizedKey !== expectedKey)
189
- issues.push(`${type} key must be ${expectedKey}`);
190
- } else if (definition?.keyPolicy === "path") {
191
- if (!normalizedKey.startsWith("/"))
192
- issues.push(`${type} key must be an absolute path`);
193
- } else if (definition?.keyPolicy === "route") {
194
- if (!normalizedKey.startsWith("/") && !definition.reservedKeys?.includes(normalizedKey)) {
195
- issues.push(`${type} key must be a route path or a reserved route key`);
196
- }
197
- }
198
- return { issues, valid: issues.length === 0 };
199
- }
200
- function validateRegistryValue(type, key, value, definitions) {
201
- const definition = definitions.get(type);
202
- const issues = [...validateRegistryKey(type, key, definitions).issues];
203
- const valueKind = definition?.valueKind ?? "object";
204
- if (definition && valueKind === "object" && !isPlainObject(value)) {
205
- issues.push(`${type} values must be plain objects`);
206
- }
207
- if (definition && valueKind === "component" && typeof value !== "function" && !isPlainObject(value)) {
208
- issues.push(
209
- `${type} values must be component functions or component objects`
210
- );
211
- }
212
- const validation = definition?.validate?.(value);
213
- if (validation && !validation.valid && Array.isArray(validation.issues)) {
214
- issues.push(...validation.issues);
215
- }
216
- return { issues, valid: issues.length === 0 };
217
- }
218
- function normalizeRegistryMetadata(metadata, {
219
- defaultCleanupDelayMs = null,
220
- defaultLifecycle = null,
221
- defaultSource = DEFAULT_SOURCE
222
- } = {}) {
223
- const registryMeta = isObject(metadata) ? metadata : {};
224
- const normalizedDefaultDelay = parseFiniteNumber(defaultCleanupDelayMs);
225
- const fallbackCleanupDelayMs = normalizedDefaultDelay !== null && normalizedDefaultDelay >= 0 ? normalizedDefaultDelay : null;
226
- const fallbackLifecycle = defaultLifecycle && REGISTRY_LIFECYCLE_VALUES.has(defaultLifecycle) ? defaultLifecycle : null;
227
- const source = getValidString(registryMeta.source) || getValidString(defaultSource, DEFAULT_SOURCE) || DEFAULT_SOURCE;
228
- const scope = getValidString(registryMeta.scope);
229
- const priority = parseFiniteNumber(registryMeta.priority);
230
- const lifecycle = resolveLifecycle(registryMeta, fallbackLifecycle);
231
- const validation = isValidationMode(registryMeta.validation) ? registryMeta.validation : null;
232
- const cleanupDelayCandidate = parseFiniteNumber(registryMeta.cleanupDelayMs);
233
- let cleanupDelayMs = cleanupDelayCandidate !== null && cleanupDelayCandidate >= 0 ? cleanupDelayCandidate : fallbackCleanupDelayMs;
234
- if (lifecycle === REGISTRY_LIFECYCLES.IMMEDIATE) {
235
- cleanupDelayMs = 0;
236
- } else if ((lifecycle === REGISTRY_LIFECYCLES.GRACEFUL || lifecycle === REGISTRY_LIFECYCLES.ROUTE) && cleanupDelayMs === null) {
237
- cleanupDelayMs = fallbackCleanupDelayMs;
238
- }
239
- return {
240
- cleanupDelayMs,
241
- lifecycle,
242
- priority,
243
- registerOptions: {
244
- ...priority !== null && { priority },
245
- ...validation === REGISTRY_VALIDATION_MODES.STRICT && { validation },
246
- ...scope && { scope }
247
- },
248
- source,
249
- ...scope && { scope },
250
- ...validation && { validation }
251
- };
252
- }
253
- function isValidationMode(value) {
254
- return Object.values(REGISTRY_VALIDATION_MODES).includes(value);
255
- }
256
- function pickRegistryMetadata(options) {
257
- if (!isObject(options)) return {};
258
- return Object.fromEntries(
259
- REGISTRY_METADATA_KEYS.filter((key) => options[key] !== void 0).map(
260
- (key) => [key, options[key]]
261
- )
262
- );
263
- }
264
-
265
- // src/kernel/operations.ts
266
- function createInitialRegistriesFor(definitions) {
267
- return Object.fromEntries(
268
- Array.from(definitions.keys(), (type) => [type, {}])
269
- );
270
- }
271
- function buildSourceRecord({
272
- source,
273
- value,
274
- instanceId = null,
275
- priority,
276
- timestamp,
277
- sequence,
278
- scope = DEFAULT_REGISTRY_SCOPE
279
- }) {
280
- return {
281
- updatedAt: timestamp,
282
- sequence: Number.isFinite(sequence) ? sequence : timestamp,
283
- instanceId: typeof instanceId === "string" ? instanceId : null,
284
- priority,
285
- value,
286
- source,
287
- scope
288
- };
289
- }
290
- function createRecordKey(source, instanceId = null, scope = DEFAULT_REGISTRY_SCOPE) {
291
- if (scope === DEFAULT_REGISTRY_SCOPE) {
292
- if (typeof instanceId === "string" && instanceId.length > 0) {
293
- return `instance:${JSON.stringify([source, instanceId])}`;
294
- }
295
- return `source:${JSON.stringify(source)}`;
296
- }
297
- if (typeof instanceId === "string" && instanceId.length > 0) {
298
- return `instance:${JSON.stringify([scope, source, instanceId])}`;
299
- }
300
- return `source:${JSON.stringify([scope, source])}`;
301
- }
302
- function getSourceRecords(entry, source, scope = null) {
303
- if (!entry) return [];
304
- return Object.entries(entry).map(([recordKey, rawRecord]) => ({
305
- recordKey,
306
- record: toSourceRecord(rawRecord, recordKey)
307
- })).filter(
308
- ({ record }) => record?.source === source && (scope === null || record.scope === scope)
309
- );
310
- }
311
- function getSourceRecord(entry, source, instanceId = null, scope = DEFAULT_REGISTRY_SCOPE) {
312
- const recordKey = createRecordKey(source, instanceId, scope);
313
- return toSourceRecord(entry?.[recordKey], source);
314
- }
315
- function resolveRecordPriority(options, source) {
316
- if (isObject(options) && hasOwnProperty(options, "priority")) {
317
- const parsedPriority = Number(options.priority);
318
- if (Number.isFinite(parsedPriority)) return parsedPriority;
319
- }
320
- return REGISTRY_SOURCE_PRIORITY[source] ?? 0;
321
- }
322
- function toSourceRecord(rawValue, source = DEFAULT_SOURCE) {
323
- if (rawValue === void 0) return null;
324
- const rawRecord = rawValue;
325
- const isWrappedRecord = isObject(rawValue) && hasOwnProperty(rawRecord, "value") && hasOwnProperty(rawRecord, "updatedAt") && hasOwnProperty(rawRecord, "priority") && hasOwnProperty(rawRecord, "source");
326
- if (isWrappedRecord) {
327
- const parsedPriority = Number(rawRecord.priority);
328
- return {
329
- updatedAt: Number(rawRecord.updatedAt) || 0,
330
- sequence: Number(rawRecord.sequence) || Number(rawRecord.updatedAt) || 0,
331
- instanceId: typeof rawRecord.instanceId === "string" ? rawRecord.instanceId : null,
332
- priority: Number.isFinite(parsedPriority) ? parsedPriority : REGISTRY_SOURCE_PRIORITY[source] ?? 0,
333
- source: typeof rawRecord.source === "string" ? rawRecord.source : source,
334
- scope: typeof rawRecord.scope === "string" ? rawRecord.scope : DEFAULT_REGISTRY_SCOPE,
335
- value: rawRecord.value
336
- };
337
- }
338
- return {
339
- updatedAt: 0,
340
- sequence: 0,
341
- instanceId: null,
342
- priority: REGISTRY_SOURCE_PRIORITY[source] ?? 0,
343
- source,
344
- scope: DEFAULT_REGISTRY_SCOPE,
345
- value: rawValue
346
- };
347
- }
348
- function compareRecords(a, b) {
349
- if (a.priority !== b.priority) return a.priority - b.priority;
350
- const rankDiff = getSourceRank(a.source) - getSourceRank(b.source);
351
- if (rankDiff !== 0) return rankDiff;
352
- return (a.sequence ?? a.updatedAt) - (b.sequence ?? b.updatedAt);
353
- }
354
- function recordsHaveSameValue(prevRecord, nextRecord) {
355
- if (Object.is(prevRecord?.value, nextRecord?.value)) return true;
356
- if (isObject(prevRecord?.value) && isObject(nextRecord?.value)) {
357
- return shallowEqual(prevRecord.value, nextRecord.value);
358
- }
359
- return false;
360
- }
361
- function hasRecordChanged(prevRecord, nextRecord) {
362
- if (!prevRecord) return true;
363
- return prevRecord.priority !== nextRecord.priority || prevRecord.source !== nextRecord.source || prevRecord.instanceId !== nextRecord.instanceId || prevRecord.scope !== nextRecord.scope || !recordsHaveSameValue(prevRecord, nextRecord);
364
- }
365
- function hasAnySourceRecord(entry) {
366
- return Object.values(entry || {}).some(
367
- (rawRecord) => rawRecord !== void 0
368
- );
369
- }
370
- function setSourceRecord(state, type, key, source, record) {
371
- const typeRegistry = state[type] || {};
372
- const currentEntry = typeRegistry[key] || {};
373
- const recordKey = createRecordKey(source, record.instanceId, record.scope);
374
- const prevRecord = toSourceRecord(currentEntry[recordKey], source);
375
- if (!hasRecordChanged(prevRecord, record)) {
376
- return state;
377
- }
378
- return {
379
- ...state,
380
- [type]: {
381
- ...typeRegistry,
382
- [key]: {
383
- ...currentEntry,
384
- [recordKey]: record
385
- }
386
- }
387
- };
388
- }
389
- function removeSourceRecord(state, type, key, source, instanceId = null, scope = null) {
390
- const typeRegistry = state[type];
391
- const currentEntry = typeRegistry?.[key];
392
- if (!typeRegistry || !currentEntry) return state;
393
- let activeRecords = [];
394
- if (typeof instanceId === "string" && instanceId.length > 0 && scope !== null) {
395
- const safeScope = scope || DEFAULT_REGISTRY_SCOPE;
396
- const recordKey = createRecordKey(source, instanceId, safeScope);
397
- const record = getSourceRecord(currentEntry, source, instanceId, safeScope);
398
- if (record) activeRecords.push({ recordKey, record });
399
- } else {
400
- activeRecords = getSourceRecords(currentEntry, source, scope).filter(({ record }) => !instanceId || record?.instanceId === instanceId).filter(
401
- (entry) => Boolean(entry.record)
402
- );
403
- }
404
- if (activeRecords.length === 0) return state;
405
- const nextEntry = { ...currentEntry };
406
- activeRecords.forEach(({ recordKey }) => {
407
- delete nextEntry[recordKey];
408
- });
409
- if (!hasAnySourceRecord(nextEntry)) {
410
- const nextTypeRegistry = { ...typeRegistry };
411
- delete nextTypeRegistry[key];
412
- return { ...state, [type]: nextTypeRegistry };
413
- }
414
- return {
415
- ...state,
416
- [type]: { ...typeRegistry, [key]: nextEntry }
417
- };
418
- }
419
- function resolveEntryValueFor(definitions, type, entry, scope = null) {
420
- if (!entry) return void 0;
421
- const activeRecords = Object.entries(entry).map(([source, rawRecord]) => toSourceRecord(rawRecord, source)).filter(
422
- (record) => record !== null && (scope === null || record.scope === scope)
423
- );
424
- if (activeRecords.length === 0) return void 0;
425
- const merge = definitions.get(type)?.merge;
426
- if (merge) {
427
- const sortedRecords = [...activeRecords].sort(compareRecords);
428
- const mergeCandidate = sortedRecords.every(
429
- (record) => isObject(record.value)
430
- );
431
- if (mergeCandidate) {
432
- const values = sortedRecords.map(
433
- (record) => record.value
434
- );
435
- return merge(values);
436
- }
437
- return sortedRecords[sortedRecords.length - 1].value;
438
- }
439
- return activeRecords.reduce(
440
- (winner, current) => compareRecords(current, winner) > 0 ? current : winner
441
- ).value;
442
- }
443
- function createResolverCacheFor(definitions) {
444
- const entryCache = /* @__PURE__ */ new WeakMap();
445
- return (type, entry, scope = null) => {
446
- if (!entry || typeof entry !== "object") {
447
- return resolveEntryValueFor(definitions, type, entry, scope);
448
- }
449
- let typeCache = entryCache.get(entry);
450
- if (!typeCache) {
451
- typeCache = /* @__PURE__ */ new Map();
452
- entryCache.set(entry, typeCache);
453
- }
454
- const cacheKey = scope || "default";
455
- if (typeCache.has(cacheKey)) return typeCache.get(cacheKey);
456
- const value = resolveEntryValueFor(definitions, type, entry, scope);
457
- typeCache.set(cacheKey, value);
458
- return value;
459
- };
460
- }
461
- function createRegisterOperation(type, key, item, sourceOrOptions, optionsArg, timestamp, sequence = timestamp) {
462
- const { source, options } = resolveRegisterInput(sourceOrOptions, optionsArg);
463
- const instanceId = resolveInstanceId(options);
464
- const scope = resolveScope(options);
465
- return {
466
- kind: "register",
467
- validation: options.validation,
468
- source,
469
- scope,
470
- record: buildSourceRecord({
471
- source,
472
- value: item,
473
- instanceId,
474
- priority: resolveRecordPriority(options, source),
475
- scope,
476
- timestamp,
477
- sequence
478
- }),
479
- instanceId,
480
- type,
481
- key: typeof key === "string" ? key.trim() : key
482
- };
483
- }
484
- function createUnregisterOperation(type, key, sourceOrOptions) {
485
- const { scope, source, instanceId } = resolveUnregisterInput(sourceOrOptions);
486
- return {
487
- kind: "unregister",
488
- instanceId,
489
- scope,
490
- source,
491
- type,
492
- key: typeof key === "string" ? key.trim() : key
493
- };
494
- }
495
- function isValidRegistryTargetFor(definitions, type, key) {
496
- return validateRegistryKey(type, key, definitions).valid;
497
- }
498
- function applyOperationFor(definitions, state, operation) {
499
- if (!isValidRegistryTargetFor(definitions, operation?.type, operation?.key))
500
- return state;
501
- if (operation.kind === "register") {
502
- return setSourceRecord(
503
- state,
504
- operation.type,
505
- operation.key,
506
- operation.source,
507
- operation.record
508
- );
509
- }
510
- if (operation.kind === "unregister") {
511
- return removeSourceRecord(
512
- state,
513
- operation.type,
514
- operation.key,
515
- operation.source,
516
- operation.instanceId,
517
- operation.scope
518
- );
519
- }
520
- return state;
521
- }
522
- function hasOperationEffectFor(definitions, state, operation) {
523
- if (!isValidRegistryTargetFor(definitions, operation?.type, operation?.key))
524
- return false;
525
- if (operation.kind === "register") {
526
- const currentRecord = getSourceRecord(
527
- state[operation.type]?.[operation.key],
528
- operation.source,
529
- operation.instanceId,
530
- operation.scope
531
- );
532
- return hasRecordChanged(currentRecord, operation.record);
533
- }
534
- if (operation.kind === "unregister") {
535
- const entry = state[operation.type]?.[operation.key];
536
- if (typeof operation.instanceId === "string" && operation.instanceId.length > 0) {
537
- return operation.scope === null ? getSourceRecords(entry, operation.source).some(
538
- ({ record }) => record?.instanceId === operation.instanceId
539
- ) : Boolean(
540
- getSourceRecord(
541
- entry,
542
- operation.source,
543
- operation.instanceId,
544
- operation.scope
545
- )
546
- );
547
- }
548
- return getSourceRecords(entry, operation.source, operation.scope).length > 0;
549
- }
550
- return false;
551
- }
552
- function resolveEffectiveOperationsFor(definitions, state, operations) {
553
- const effectiveOperations = [];
554
- let nextState = state;
555
- operations.forEach((operation) => {
556
- if (!hasOperationEffectFor(definitions, nextState, operation)) return;
557
- effectiveOperations.push(operation);
558
- nextState = applyOperationFor(definitions, nextState, operation);
559
- });
560
- return { effectiveOperations, nextState };
561
- }
562
- function createRegistryOperations(definitions) {
563
- return Object.freeze({
564
- applyOperation: (state, operation) => applyOperationFor(definitions, state, operation),
565
- createInitialRegistries: () => createInitialRegistriesFor(definitions),
566
- createResolverCache: () => createResolverCacheFor(definitions),
567
- hasOperationEffect: (state, operation) => hasOperationEffectFor(definitions, state, operation),
568
- isRegistryType: (type) => definitions.get(type) !== void 0,
569
- isValidRegistryTarget: (type, key) => isValidRegistryTargetFor(definitions, type, key),
570
- resolveEffectiveOperations: (state, operations) => resolveEffectiveOperationsFor(definitions, state, operations),
571
- resolveEntryValue: (type, entry, scope = null) => resolveEntryValueFor(definitions, type, entry, scope)
572
- });
573
- }
574
-
575
- // src/kernel/runtime.ts
576
- function createRegistryTransaction(store, metadata = {}) {
577
- const operations = [];
578
- let status = "open";
579
- const traceId = metadata.traceId || `tx-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
580
- const ensureOpen = () => status === "open";
581
- const mergeOptions = (options) => {
582
- const baseOpts = options && typeof options === "object" ? options : {};
583
- const needsSource = metadata.source && !baseOpts.source;
584
- const needsScope = metadata.scope && !baseOpts.scope;
585
- if (!needsSource && !needsScope) return baseOpts;
586
- return {
587
- ...baseOpts,
588
- ...needsSource ? { source: metadata.source } : {},
589
- ...needsScope ? { scope: metadata.scope } : {}
590
- };
591
- };
592
- const register = (type, key, value, sourceOrOptions, optionsArg) => {
593
- if (!ensureOpen()) return { index: -1, status, traceId };
594
- const options = typeof sourceOrOptions === "string" ? mergeOptions({ ...optionsArg || {}, source: sourceOrOptions }) : mergeOptions(sourceOrOptions);
595
- operations.push({ key, item: value, options, type });
596
- return { index: operations.length - 1, status: "queued", traceId };
597
- };
598
- const unregister = (type, key, sourceOrOptions) => {
599
- if (!ensureOpen()) return { index: -1, status, traceId };
600
- const options = mergeOptions(
601
- typeof sourceOrOptions === "string" ? { source: sourceOrOptions } : sourceOrOptions
602
- );
603
- operations.push({ key, options, type, unregister: true });
604
- return { index: operations.length - 1, status: "queued", traceId };
605
- };
606
- const rollback = (_reason = "manual") => {
607
- if (!ensureOpen()) return { index: -1, status, traceId };
608
- status = "rolled-back";
609
- operations.length = 0;
610
- return { index: -1, status, traceId };
611
- };
612
- const commit = () => {
613
- if (!ensureOpen()) return { status, traceId };
614
- status = "committed";
615
- const result = store.batch((queue) => {
616
- operations.forEach((op) => {
617
- if (op.unregister) queue.unregister(op.type, op.key, op.options);
618
- else queue.register(op.type, op.key, op.item, op.options);
619
- });
620
- });
621
- const applied = typeof result === "number" && Number.isFinite(result) ? result : 0;
622
- return { applied, queued: operations.length, status, traceId };
623
- };
624
- const run = (executor) => {
625
- if (typeof executor !== "function") {
626
- rollback("invalid-executor");
627
- return { status, traceId };
628
- }
629
- try {
630
- executor({ register, unregister });
631
- return commit();
632
- } catch (error) {
633
- rollback(error instanceof Error ? error.message : String(error));
634
- throw error;
635
- }
636
- };
637
- return {
638
- commit,
639
- get operations() {
640
- return operations.slice();
641
- },
642
- register,
643
- rollback,
644
- run,
645
- get status() {
646
- return status;
647
- },
648
- traceId,
649
- unregister
650
- };
651
- }
652
-
653
- // src/kernel/store.ts
654
- var NO_DEFINITIONS = /* @__PURE__ */ new Map();
655
- function createNoopHandle(status = "rejected", reason = "unknown") {
656
- const handle = Object.assign(() => false, {
657
- active: false,
658
- dispose: () => false,
659
- instanceId: null,
660
- key: "",
661
- priority: 0,
662
- reason,
663
- source: "",
664
- status,
665
- type: "",
666
- update: () => handle,
667
- updatedAt: 0,
668
- validation: "warn"
669
- });
670
- return handle;
671
- }
672
- var NOOP_HANDLE = createNoopHandle();
673
- function isNoopHandle(handle) {
674
- return handle === NOOP_HANDLE || handle?.status === "rejected" || handle?.status === "ignored";
675
- }
676
- function cloneRegistryValue(value, seen = /* @__PURE__ */ new WeakMap()) {
677
- if (value === null || typeof value !== "object" || isValidElement(value)) {
678
- return value;
679
- }
680
- const prototype = Object.getPrototypeOf(value);
681
- const isPlainObject2 = !Array.isArray(value) && (prototype === Object.prototype || prototype === null);
682
- if (!Array.isArray(value) && !isPlainObject2) return value;
683
- if (seen.has(value)) return seen.get(value);
684
- const source = value;
685
- const clone = Array.isArray(value) ? [] : {};
686
- seen.set(value, clone);
687
- for (const key in source) {
688
- if (Object.prototype.hasOwnProperty.call(source, key)) {
689
- clone[key] = cloneRegistryValue(source[key], seen);
690
- }
691
- }
692
- return clone;
693
- }
694
- function normalizeInitialEntries(entries) {
695
- return (Array.isArray(entries) ? entries : []).filter(
696
- (entry) => entry?.type && entry?.items && typeof entry.items === "object"
697
- );
698
- }
699
- function createInitialState(ops, definitions, entries) {
700
- const normalizedEntries = normalizeInitialEntries(entries);
701
- if (normalizedEntries.length === 0) return ops.createInitialRegistries();
702
- const timestamp = Date.now();
703
- let sequence = 0;
704
- let state = ops.createInitialRegistries();
705
- normalizedEntries.forEach((entry) => {
706
- const source = entry.source || REGISTRY_SOURCES.STATIC;
707
- const options = {
708
- ...entry.options || {},
709
- instanceId: entry.instanceId || entry.options?.instanceId || "registry-initial"
710
- };
711
- Object.entries(entry.items).forEach(([key, value]) => {
712
- const validation = validateRegistration(
713
- definitions,
714
- entry.type,
715
- key,
716
- value,
717
- source,
718
- options
719
- );
720
- if (!validation.valid) return;
721
- const operation = createRegisterOperation(
722
- entry.type,
723
- key,
724
- cloneRegistryValue(value),
725
- source,
726
- options,
727
- timestamp,
728
- ++sequence
729
- );
730
- if (ops.hasOperationEffect(state, operation)) {
731
- state = ops.applyOperation(state, operation);
732
- }
733
- });
734
- });
735
- return state;
736
- }
737
- function notifyListeners(listeners) {
738
- if (!listeners) return;
739
- for (const listener of listeners) {
740
- try {
741
- listener();
742
- } catch (error) {
743
- report("Registry listener", error);
744
- }
745
- }
746
- }
747
- function getOrCreateKeyListeners(listenersByType, type, key) {
748
- let listeners = listenersByType.get(type);
749
- if (!listeners) {
750
- listeners = /* @__PURE__ */ new Map();
751
- listenersByType.set(type, listeners);
752
- }
753
- let keyListeners = listeners.get(key);
754
- if (!keyListeners) {
755
- keyListeners = /* @__PURE__ */ new Set();
756
- listeners.set(key, keyListeners);
757
- }
758
- return keyListeners;
759
- }
760
- function resolveRegistrationOptions(sourceOrOptions, optionsArg) {
761
- if (sourceOrOptions && typeof sourceOrOptions === "object")
762
- return sourceOrOptions;
763
- return optionsArg && typeof optionsArg === "object" ? optionsArg : {};
764
- }
765
- function validateRegistration(definitions, type, key, value, sourceOrOptions, optionsArg) {
766
- const options = resolveRegistrationOptions(sourceOrOptions, optionsArg);
767
- const metadataValidation = validateRegistryMetadata(options);
768
- const isStrict = options.validation === REGISTRY_VALIDATION_MODES.STRICT;
769
- if (!metadataValidation.valid && isStrict) {
770
- return {
771
- issues: metadataValidation.issues,
772
- reason: "invalid-metadata",
773
- valid: false
774
- };
775
- }
776
- const validation = validateRegistryValue(type, key, value, definitions);
777
- if (validation.valid) return { valid: true };
778
- if (!isStrict) {
779
- report(`Registry ${type} "${key}" is invalid`, validation.issues, "warn");
780
- }
781
- return {
782
- issues: validation.issues,
783
- reason: "invalid-value",
784
- valid: !isStrict
785
- };
786
- }
787
- function createRegistrationHandle(store, operation) {
788
- let disposed = false;
789
- const dispose = (reason = "manual") => {
790
- if (disposed) return false;
791
- disposed = true;
792
- return store.dispose(operation, reason);
793
- };
794
- const handle = ((reason) => dispose(reason));
795
- handle.dispose = dispose;
796
- handle.update = (value, options = {}) => {
797
- if (disposed || !store.isCurrent(operation)) return NOOP_HANDLE;
798
- const nextHandle = store.register(
799
- operation.type,
800
- operation.key,
801
- value,
802
- operation.source,
803
- {
804
- ...typeof options === "object" ? options : {},
805
- instanceId: operation.instanceId,
806
- priority: operation.record.priority,
807
- ...operation.scope ? { scope: operation.scope } : {},
808
- ...operation.validation ? { validation: operation.validation } : {}
809
- }
810
- );
811
- if (isNoopHandle(nextHandle)) return handle;
812
- disposed = true;
813
- return nextHandle;
814
- };
815
- Object.defineProperties(handle, {
816
- active: {
817
- enumerable: true,
818
- get: () => !disposed && store.isCurrent(operation)
819
- },
820
- instanceId: { enumerable: true, value: operation.instanceId },
821
- key: { enumerable: true, value: operation.key },
822
- priority: { enumerable: true, value: operation.record.priority },
823
- source: { enumerable: true, value: operation.source },
824
- status: {
825
- enumerable: true,
826
- get: () => disposed ? "disposed" : store.isCurrent(operation) ? "active" : "superseded"
827
- },
828
- type: { enumerable: true, value: operation.type },
829
- updatedAt: { enumerable: true, value: operation.record.updatedAt },
830
- validation: { enumerable: true, value: operation.validation || "warn" }
831
- });
832
- return handle;
833
- }
834
- function prepareRegisterOperation(ops, definitions, type, key, item, sourceOrOptions, optionsArg, timestamp, sequence) {
835
- if (!ops.isValidRegistryTarget(type, key)) {
836
- return { rejected: createNoopHandle("rejected", "invalid-target") };
837
- }
838
- const validation = validateRegistration(
839
- definitions,
840
- type,
841
- key,
842
- item,
843
- sourceOrOptions,
844
- optionsArg
845
- );
846
- if (!validation.valid) {
847
- return { rejected: createNoopHandle("rejected", validation.reason) };
848
- }
849
- return {
850
- operation: createRegisterOperation(
851
- type,
852
- key,
853
- cloneRegistryValue(item),
854
- sourceOrOptions,
855
- optionsArg,
856
- timestamp,
857
- sequence
858
- )
859
- };
860
- }
861
- function createRegistryStore(initialEntries = [], definitions = NO_DEFINITIONS) {
862
- const ops = createRegistryOperations(definitions);
863
- let registries = createInitialState(ops, definitions, initialEntries);
864
- let sequence = normalizeInitialEntries(initialEntries).reduce(
865
- (count, entry) => count + Object.keys(entry.items).length,
866
- 0
867
- );
868
- const listenersByType = /* @__PURE__ */ new Map();
869
- const entrySnapshots = /* @__PURE__ */ new Map();
870
- const valueSnapshots = /* @__PURE__ */ new Map();
871
- const resolveCachedValue = ops.createResolverCache();
872
- const subscribe = (type, key, listener) => {
873
- const keyListeners = getOrCreateKeyListeners(
874
- listenersByType,
875
- type,
876
- key ?? null
877
- );
878
- keyListeners.add(listener);
879
- return () => {
880
- keyListeners.delete(listener);
881
- if (keyListeners.size > 0) return;
882
- const listeners = listenersByType.get(type);
883
- if (listeners) {
884
- listeners.delete(key ?? null);
885
- if (listeners.size === 0) listenersByType.delete(type);
886
- }
887
- };
888
- };
889
- const commit = (nextState, operations = []) => {
890
- if (registries === nextState) return;
891
- const previousState = registries;
892
- registries = nextState;
893
- const changedKeysByType = /* @__PURE__ */ new Map();
894
- for (const operation of operations) {
895
- if (!ops.isValidRegistryTarget(operation?.type, operation?.key)) continue;
896
- let keys = changedKeysByType.get(operation.type);
897
- if (!keys) {
898
- keys = /* @__PURE__ */ new Set();
899
- changedKeysByType.set(operation.type, keys);
900
- }
901
- keys.add(operation.key);
902
- }
903
- for (const [type, changedKeys] of changedKeysByType) {
904
- const previousRegistry = previousState[type] || {};
905
- const nextRegistry = nextState[type] || {};
906
- const typeListeners = listenersByType.get(type);
907
- let typeChanged = false;
908
- if (!typeListeners) continue;
909
- for (const key of changedKeys) {
910
- if (previousRegistry[key] === nextRegistry[key]) continue;
911
- typeChanged = true;
912
- notifyListeners(typeListeners.get(key));
913
- }
914
- if (typeChanged) {
915
- notifyListeners(typeListeners.get(null));
916
- }
917
- }
918
- };
919
- const isCurrent = (operation) => {
920
- const entry = registries[operation.type]?.[operation.key];
921
- const recordKey = createRecordKey(
922
- operation.source,
923
- operation.instanceId,
924
- operation.scope
925
- );
926
- return entry?.[recordKey] === operation.record;
927
- };
928
- const dispose = (operation, _reason = "manual") => {
929
- if (!isCurrent(operation)) return false;
930
- const unregisterOperation = createUnregisterOperation(
931
- operation.type,
932
- operation.key,
933
- {
934
- source: operation.source,
935
- instanceId: operation.instanceId,
936
- scope: operation.scope
937
- }
938
- );
939
- if (!ops.hasOperationEffect(registries, unregisterOperation)) return false;
940
- commit(ops.applyOperation(registries, unregisterOperation), [
941
- unregisterOperation
942
- ]);
943
- return true;
944
- };
945
- const register = (type, key, item, sourceOrOptions = DEFAULT_SOURCE, optionsArg = {}) => {
946
- const prepared = prepareRegisterOperation(
947
- ops,
948
- definitions,
949
- type,
950
- key,
951
- item,
952
- sourceOrOptions,
953
- optionsArg,
954
- Date.now(),
955
- ++sequence
956
- );
957
- if ("rejected" in prepared) return prepared.rejected;
958
- const { operation } = prepared;
959
- if (!ops.hasOperationEffect(registries, operation)) {
960
- return createNoopHandle("ignored", "unchanged");
961
- }
962
- commit(ops.applyOperation(registries, operation), [operation]);
963
- return createRegistrationHandle(store, operation);
964
- };
965
- const unregister = (type, key, sourceOrOptions = DEFAULT_SOURCE) => {
966
- if (!ops.isValidRegistryTarget(type, key)) return;
967
- const operation = createUnregisterOperation(type, key, sourceOrOptions);
968
- if (!ops.hasOperationEffect(registries, operation)) return;
969
- commit(ops.applyOperation(registries, operation), [operation]);
970
- };
971
- const batch = (executor) => {
972
- if (typeof executor !== "function") return 0;
973
- const timestamp = Date.now();
974
- const operations = [];
975
- const queue = {
976
- register: (type, key, item, sourceOrOptions = DEFAULT_SOURCE, optionsArg = {}) => {
977
- const prepared = prepareRegisterOperation(
978
- ops,
979
- definitions,
980
- type,
981
- key,
982
- item,
983
- sourceOrOptions,
984
- optionsArg,
985
- timestamp,
986
- ++sequence
987
- );
988
- if ("rejected" in prepared) return prepared.rejected;
989
- operations.push(prepared.operation);
990
- return createRegistrationHandle(store, prepared.operation);
991
- },
992
- unregister: (type, key, sourceOrOptions = DEFAULT_SOURCE) => {
993
- if (!ops.isValidRegistryTarget(type, key)) return;
994
- operations.push(createUnregisterOperation(type, key, sourceOrOptions));
995
- }
996
- };
997
- executor(queue);
998
- if (operations.length === 0) return 0;
999
- const { effectiveOperations, nextState } = ops.resolveEffectiveOperations(
1000
- registries,
1001
- operations
1002
- );
1003
- if (effectiveOperations.length === 0) return 0;
1004
- commit(nextState, effectiveOperations);
1005
- return effectiveOperations.length;
1006
- };
1007
- const getSnapshot = (type, key, scope = null) => {
1008
- const entry = registries[type]?.[key];
1009
- let snapshots = valueSnapshots.get(type);
1010
- if (!snapshots) {
1011
- snapshots = /* @__PURE__ */ new Map();
1012
- valueSnapshots.set(type, snapshots);
1013
- }
1014
- const cacheKey = scope === null ? key : `${scope}\0${key}`;
1015
- if (entry === void 0) {
1016
- snapshots.delete(cacheKey);
1017
- return void 0;
1018
- }
1019
- const cached = snapshots.get(cacheKey);
1020
- if (cached && cached.entry === entry) return cached.value;
1021
- const value = resolveCachedValue(type, entry, scope);
1022
- snapshots.set(cacheKey, { entry, value });
1023
- return value;
1024
- };
1025
- const getEntriesSnapshot = (type, scope = null) => {
1026
- const typeRegistry = registries[type] || {};
1027
- const cacheKey = `${type}::${scope ?? "null"}`;
1028
- const cached = entrySnapshots.get(cacheKey);
1029
- if (cached?.typeRegistry === typeRegistry) return cached.value;
1030
- const resolved = {};
1031
- for (const key in typeRegistry) {
1032
- if (Object.prototype.hasOwnProperty.call(typeRegistry, key)) {
1033
- const value = resolveCachedValue(type, typeRegistry[key], scope);
1034
- if (value !== void 0) resolved[key] = value;
1035
- }
1036
- }
1037
- const finalValue = Object.freeze(resolved);
1038
- entrySnapshots.set(cacheKey, { typeRegistry, value: finalValue });
1039
- return finalValue;
1040
- };
1041
- const store = {
1042
- batch,
1043
- dispose,
1044
- getEntriesSnapshot,
1045
- getSnapshot,
1046
- isCurrent,
1047
- register,
1048
- subscribe,
1049
- transaction: (executor, metadata = {}) => createRegistryTransaction(store, metadata).run(executor),
1050
- unregister
1051
- };
1052
- return store;
1053
- }
1054
- var RegistryContext = getOrCreateGlobalContext(
1055
- "RegistryContext",
1056
- null
1057
- );
1058
- function RegistryProvider({
1059
- children,
1060
- definitions,
1061
- initialEntries = []
1062
- }) {
1063
- const [store] = useState(
1064
- () => createRegistryStore(initialEntries, definitions)
1065
- );
1066
- const contextValue = useMemo(
1067
- () => ({
1068
- actions: {
1069
- batch: store.batch,
1070
- register: store.register,
1071
- transaction: store.transaction,
1072
- unregister: store.unregister
1073
- },
1074
- subscription: {
1075
- getEntriesSnapshot: store.getEntriesSnapshot,
1076
- getSnapshot: store.getSnapshot,
1077
- subscribe: store.subscribe
1078
- }
1079
- }),
1080
- [store]
1081
- );
1082
- return /* @__PURE__ */ jsx(RegistryContext, { value: contextValue, children });
1083
- }
1084
- function useRegistryActions() {
1085
- return useRequiredContext(
1086
- RegistryContext,
1087
- "useRegistryActions",
1088
- "RegistryProvider"
1089
- ).actions;
1090
- }
1091
- function useRegistrySubscription() {
1092
- return useRequiredContext(
1093
- RegistryContext,
1094
- "useRegistrySubscription",
1095
- "RegistryProvider"
1096
- ).subscription;
1097
- }
1098
- function useRegistryValue(type, key) {
1099
- const { getSnapshot, subscribe } = useRegistrySubscription();
1100
- const subscribeToKey = useCallback(
1101
- (listener) => subscribe(type, key, listener),
1102
- [key, subscribe, type]
1103
- );
1104
- const getValue = useCallback(
1105
- () => getSnapshot(type, key),
1106
- [getSnapshot, key, type]
1107
- );
1108
- return useSyncExternalStore(subscribeToKey, getValue, getValue);
1109
- }
1110
- function useRegistryEntries(type) {
1111
- const { getEntriesSnapshot, subscribe } = useRegistrySubscription();
1112
- const subscribeToType = useCallback(
1113
- (listener) => subscribe(type, null, listener),
1114
- [subscribe, type]
1115
- );
1116
- const getEntries = useCallback(
1117
- () => getEntriesSnapshot(type),
1118
- [getEntriesSnapshot, type]
1119
- );
1120
- return useSyncExternalStore(subscribeToType, getEntries, getEntries);
1121
- }
1122
- var EMPTY_MODULES = Object.freeze([]);
1123
- var PassthroughBoundary = ({ children }) => children;
1124
- var ModuleHostContext = getOrCreateGlobalContext("ModuleHostContext", null);
1125
- function selectModuleSlice(coreModule, config) {
1126
- const slice = coreModule.page?.select ? coreModule.page.select(config) : config[coreModule.id];
1127
- return slice ?? null;
1128
- }
1129
- function createModulePayload(modules, config, metadata = {}) {
1130
- const payload = {};
1131
- let hasSlices = false;
1132
- for (const coreModule of modules) {
1133
- if (!coreModule.page?.entries) continue;
1134
- const slice = selectModuleSlice(coreModule, config);
1135
- if (slice === null) continue;
1136
- payload[coreModule.id] = slice;
1137
- hasSlices = true;
1138
- }
1139
- if (!hasSlices) return null;
1140
- return {
1141
- ...payload,
1142
- registry: {
1143
- ...metadata,
1144
- ...isObject(config.registry) ? config.registry : {}
1145
- }
1146
- };
1147
- }
1148
- var MODULE_ID_PATTERN = /^[a-z][a-zA-Z0-9]*$/;
1149
- function sortModules(modules) {
1150
- const byId = /* @__PURE__ */ new Map();
1151
- for (const coreModule of modules) {
1152
- if (!MODULE_ID_PATTERN.test(coreModule.id)) {
1153
- throw new Error(
1154
- `[Core] Invalid module id "${coreModule.id}": use a camelCase name such as "contextMenu".`
1155
- );
1156
- }
1157
- if (byId.has(coreModule.id)) {
1158
- throw new Error(`[Core] Module "${coreModule.id}" is installed twice.`);
1159
- }
1160
- byId.set(coreModule.id, coreModule);
1161
- }
1162
- const sorted = [];
1163
- const state = /* @__PURE__ */ new Map();
1164
- const visit = (coreModule, path) => {
1165
- const current = state.get(coreModule.id);
1166
- if (current === "done") return;
1167
- if (current === "visiting") {
1168
- throw new Error(
1169
- `[Core] Module dependency cycle: ${[...path, coreModule.id].join(" -> ")}`
1170
- );
1171
- }
1172
- state.set(coreModule.id, "visiting");
1173
- for (const id of coreModule.uses ?? []) {
1174
- const dependency = byId.get(id);
1175
- if (dependency) visit(dependency, [...path, coreModule.id]);
1176
- }
1177
- state.set(coreModule.id, "done");
1178
- sorted.push(coreModule);
1179
- };
1180
- modules.forEach((coreModule) => visit(coreModule, []));
1181
- return sorted;
1182
- }
1183
- function createModuleRegistryDefinitions(modules) {
1184
- const definitions = /* @__PURE__ */ new Map();
1185
- for (const coreModule of modules) {
1186
- if (coreModule.registry)
1187
- definitions.set(coreModule.id, coreModule.registry);
1188
- }
1189
- return definitions;
1190
- }
1191
- function useInstalledModules() {
1192
- return use(ModuleHostContext)?.modules ?? EMPTY_MODULES;
1193
- }
1194
-
1195
- // src/kernel/handlers.ts
1196
- function isPersistentLifecycle(lifecycle) {
1197
- return lifecycle === REGISTRY_LIFECYCLES.PERSISTENT;
1198
- }
1199
- function runRegistrationBatch(context, executor) {
1200
- return typeof context.batch === "function" ? context.batch(executor) : executor(context);
1201
- }
1202
- function createEntryCleanupKey(type, key, source, instanceId, scope) {
1203
- return JSON.stringify([
1204
- "entry",
1205
- type,
1206
- key,
1207
- scope ?? null,
1208
- source,
1209
- instanceId
1210
- ]);
1211
- }
1212
- function getCleanupScope(context) {
1213
- return context?.cleanupScope || /* @__PURE__ */ new Map();
1214
- }
1215
- function clearCleanupTimer(scope, cleanupKey) {
1216
- const lifecycle = scope.get(cleanupKey);
1217
- if (!lifecycle) return;
1218
- lifecycle.cancelled = true;
1219
- if (lifecycle.timerId !== null) clearTimeout(lifecycle.timerId);
1220
- scope.delete(cleanupKey);
1221
- }
1222
- function scheduleCleanup(scope, cleanupKey, callback, delayMs) {
1223
- clearCleanupTimer(scope, cleanupKey);
1224
- const lifecycle = {
1225
- cancelled: false,
1226
- timerId: null
1227
- };
1228
- lifecycle.timerId = setTimeout(() => {
1229
- if (lifecycle.cancelled || scope.get(cleanupKey) !== lifecycle) return;
1230
- scope.delete(cleanupKey);
1231
- callback();
1232
- }, delayMs);
1233
- scope.set(cleanupKey, lifecycle);
1234
- }
1235
- function collectModuleRegistrations(coreModule, slice, pageMetadata, context) {
1236
- const definition = coreModule.registry;
1237
- const toEntries = coreModule.page?.entries;
1238
- if (!definition || !toEntries || slice == null || slice === false) return [];
1239
- const type = coreModule.id;
1240
- const items = Array.isArray(slice) ? slice : [slice];
1241
- const registrations = [];
1242
- for (const item of items) {
1243
- if (item == null || item === false) continue;
1244
- const itemMetadata = isObject(item) && isObject(item.registry) ? item.registry : {};
1245
- const metadata = { ...pageMetadata, ...itemMetadata };
1246
- if (metadata.validation === "strict" && !validateRegistryMetadata(metadata).valid) {
1247
- continue;
1248
- }
1249
- const payload = isObject(item) ? Object.fromEntries(
1250
- Object.entries(item).filter(([key]) => key !== "registry")
1251
- ) : item;
1252
- const { cleanupDelayMs, lifecycle, registerOptions, scope, source } = normalizeRegistryMetadata(metadata, {
1253
- defaultCleanupDelayMs: definition.cleanupDelayMs ?? null,
1254
- defaultLifecycle: definition.lifecycle,
1255
- defaultSource: DEFAULT_SOURCE
1256
- });
1257
- for (const { key, value } of toEntries(payload, context) ?? []) {
1258
- const validation = definition.validate?.(value);
1259
- if (validation && !validation.valid) {
1260
- report(`Registry ${type} config is invalid`, validation.issues, "warn");
1261
- continue;
1262
- }
1263
- registrations.push({
1264
- cleanupDelayMs,
1265
- cleanupKey: createEntryCleanupKey(
1266
- type,
1267
- key,
1268
- source,
1269
- context.instanceId,
1270
- scope
1271
- ),
1272
- key,
1273
- lifecycle,
1274
- registerOptions,
1275
- scope,
1276
- source,
1277
- type,
1278
- value
1279
- });
1280
- }
1281
- }
1282
- return registrations;
1283
- }
1284
- var NO_CLEANUP = () => {
1285
- };
1286
- function applyRegistryConfig(config, context) {
1287
- const modules = context.modules ?? [];
1288
- if (!config || modules.length === 0) return NO_CLEANUP;
1289
- const pageMetadata = isObject(config.registry) ? config.registry : {};
1290
- const slices = config;
1291
- const registrations = modules.flatMap((coreModule) => {
1292
- try {
1293
- return collectModuleRegistrations(
1294
- coreModule,
1295
- slices[coreModule.id],
1296
- pageMetadata,
1297
- context
1298
- );
1299
- } catch (error) {
1300
- report(`Registry apply (${coreModule.id})`, error);
1301
- return [];
1302
- }
1303
- });
1304
- if (registrations.length === 0) return NO_CLEANUP;
1305
- const cleanupScope = getCleanupScope(context);
1306
- const owner = (registration) => ({
1307
- instanceId: context.instanceId,
1308
- scope: registration.scope,
1309
- source: registration.source
1310
- });
1311
- runRegistrationBatch(context, (queue) => {
1312
- registrations.forEach(
1313
- ({ cleanupKey, key, registerOptions, source, type, value }) => {
1314
- clearCleanupTimer(cleanupScope, cleanupKey);
1315
- queue.register(type, key, value, source, registerOptions);
1316
- }
1317
- );
1318
- });
1319
- return () => {
1320
- const immediate = [];
1321
- registrations.forEach((registration) => {
1322
- if (isPersistentLifecycle(registration.lifecycle)) return;
1323
- const { cleanupDelayMs, cleanupKey, key, type } = registration;
1324
- if (typeof cleanupDelayMs === "number" && cleanupDelayMs > 0) {
1325
- scheduleCleanup(
1326
- cleanupScope,
1327
- cleanupKey,
1328
- () => context.unregister(type, key, owner(registration)),
1329
- cleanupDelayMs
1330
- );
1331
- } else {
1332
- immediate.push(registration);
1333
- }
1334
- });
1335
- if (immediate.length === 0) return;
1336
- runRegistrationBatch(context, (queue) => {
1337
- immediate.forEach(
1338
- (registration) => queue.unregister(
1339
- registration.type,
1340
- registration.key,
1341
- owner(registration)
1342
- )
1343
- );
1344
- });
1345
- };
1346
- }
1347
-
1348
- // src/kernel/hooks.ts
1349
- function withInstanceId(instanceId, sourceOrOptions, optionsArg) {
1350
- if (typeof sourceOrOptions === "string") {
1351
- return {
1352
- optionsArg: { ...isObject(optionsArg) ? optionsArg : {}, instanceId },
1353
- sourceOrOptions
1354
- };
1355
- }
1356
- if (isObject(sourceOrOptions)) {
1357
- return {
1358
- optionsArg,
1359
- sourceOrOptions: { ...sourceOrOptions, instanceId }
1360
- };
1361
- }
1362
- return {
1363
- optionsArg: void 0,
1364
- sourceOrOptions: {
1365
- ...isObject(optionsArg) ? optionsArg : {},
1366
- instanceId
1367
- }
1368
- };
1369
- }
1370
- function withInstanceIdForUnregister(instanceId, sourceOrOptions) {
1371
- if (typeof sourceOrOptions === "string") {
1372
- return { instanceId, source: sourceOrOptions };
1373
- }
1374
- if (isObject(sourceOrOptions)) {
1375
- return { ...sourceOrOptions, instanceId };
1376
- }
1377
- return { instanceId };
1378
- }
1379
- function resolveRegisterArgsWithInstance(instanceId, sourceOrOptions, optionsArg) {
1380
- const input = withInstanceId(instanceId, sourceOrOptions, optionsArg);
1381
- return [input.sourceOrOptions, input.optionsArg];
1382
- }
1383
- function useShallowStable(value) {
1384
- const ref = useRef(value);
1385
- if (ref.current !== value && !shallowEqual(ref.current, value)) {
1386
- ref.current = value;
1387
- }
1388
- return ref.current;
1389
- }
1390
- var MAX_STABILIZATION_DEPTH = 64;
1391
- function createStableFunctionEntry(fn) {
1392
- const entry = {
1393
- current: fn,
1394
- stable(...args) {
1395
- return entry.current?.apply(this, args);
1396
- }
1397
- };
1398
- return entry;
1399
- }
1400
- function isDirectRegistryComponentPath(path, componentSlices) {
1401
- const match = /^config\.([^.[]+)\.[^.[]+$/.exec(path);
1402
- return Boolean(match && componentSlices.has(match[1]));
1403
- }
1404
- function isReactNodeLike(value) {
1405
- return value === null || value === void 0 || typeof value === "boolean" || typeof value === "string" || typeof value === "number" || isValidElement(value);
1406
- }
1407
- function isStabilizableObject(value) {
1408
- return typeof value === "object" && value !== null && !Array.isArray(value) && !isValidElement(value);
1409
- }
1410
- function hasSameObjectKeys(previousValue, nextValue) {
1411
- if (!isStabilizableObject(previousValue) || !isStabilizableObject(nextValue)) {
1412
- return false;
1413
- }
1414
- const previousKeys = Object.keys(previousValue);
1415
- const nextKeys = Object.keys(nextValue);
1416
- if (previousKeys.length !== nextKeys.length) return false;
1417
- return nextKeys.every(
1418
- (key) => Object.prototype.hasOwnProperty.call(previousValue, key)
1419
- );
1420
- }
1421
- function stabilizeRegistryValue(value, path, scope, previousValue, seen = /* @__PURE__ */ new WeakSet(), depth = 0) {
1422
- if (depth > MAX_STABILIZATION_DEPTH) return value;
1423
- if (typeof value === "function") {
1424
- const isComponent = value.name && /^[A-Z]/.test(value.name);
1425
- if (isComponent || isDirectRegistryComponentPath(path, scope.componentSlices)) {
1426
- return value;
1427
- }
1428
- scope.usedPaths.add(path);
1429
- let entry = scope.functionEntries.get(path);
1430
- if (!entry) {
1431
- entry = createStableFunctionEntry(value);
1432
- scope.functionEntries.set(path, entry);
1433
- } else {
1434
- entry.current = value;
1435
- }
1436
- return entry.stable;
1437
- }
1438
- if (value && typeof value === "object") {
1439
- if (seen.has(value)) return value;
1440
- seen.add(value);
1441
- }
1442
- if (isValidElement(value)) {
1443
- const nextProps = stabilizeRegistryValue(
1444
- value.props,
1445
- `${path}.props`,
1446
- scope,
1447
- isValidElement(previousValue) ? previousValue.props : void 0,
1448
- seen,
1449
- depth + 1
1450
- );
1451
- if (isValidElement(previousValue) && previousValue.type === value.type && previousValue.key === value.key && previousValue.props === nextProps) {
1452
- return previousValue;
1453
- }
1454
- return cloneElement(value, nextProps);
1455
- }
1456
- if (Array.isArray(value)) {
1457
- const nextValue = value.every(isReactNodeLike) ? Children.toArray(value) : value;
1458
- const previousArray = Array.isArray(previousValue) ? previousValue : null;
1459
- let hasChanged2 = !previousArray || previousArray.length !== nextValue.length;
1460
- const stabilizedValue2 = nextValue.map((item, index) => {
1461
- const nextItem = stabilizeRegistryValue(
1462
- item,
1463
- `${path}[${index}]`,
1464
- scope,
1465
- previousArray?.[index],
1466
- seen,
1467
- depth + 1
1468
- );
1469
- if (!previousArray || nextItem !== previousArray[index]) {
1470
- hasChanged2 = true;
1471
- }
1472
- return nextItem;
1473
- });
1474
- return !hasChanged2 ? previousArray : stabilizedValue2;
1475
- }
1476
- if (typeof value !== "object" || value === null) {
1477
- return value;
1478
- }
1479
- const source = value;
1480
- const previousRecord = previousValue;
1481
- const stabilizedValue = {};
1482
- const canReusePrevious = hasSameObjectKeys(previousValue, value);
1483
- let hasChanged = !canReusePrevious;
1484
- Object.keys(source).forEach((key) => {
1485
- const nextValue = stabilizeRegistryValue(
1486
- source[key],
1487
- `${path}.${key}`,
1488
- scope,
1489
- previousRecord?.[key],
1490
- seen,
1491
- depth + 1
1492
- );
1493
- stabilizedValue[key] = nextValue;
1494
- if (!canReusePrevious || nextValue !== previousRecord?.[key]) {
1495
- hasChanged = true;
1496
- }
1497
- });
1498
- return !hasChanged ? previousValue : stabilizedValue;
1499
- }
1500
- function useAppliedRegistryConfig(payload, context, componentSlices) {
1501
- const functionEntriesRef = useRef(/* @__PURE__ */ new Map());
1502
- const appliedRef = useRef(null);
1503
- useIsomorphicLayoutEffect(() => {
1504
- const previous = appliedRef.current;
1505
- if (previous && previous.payload === payload && previous.context === context) {
1506
- return;
1507
- }
1508
- const functionEntries = functionEntriesRef.current;
1509
- const usedPaths = /* @__PURE__ */ new Set();
1510
- const config = stabilizeRegistryValue(
1511
- payload,
1512
- "config",
1513
- { componentSlices, functionEntries, usedPaths },
1514
- previous?.config
1515
- );
1516
- functionEntries.forEach((_entry, path) => {
1517
- if (!usedPaths.has(path)) functionEntries.delete(path);
1518
- });
1519
- if (previous && previous.config === config && previous.context === context) {
1520
- previous.payload = payload;
1521
- return;
1522
- }
1523
- previous?.cleanup();
1524
- appliedRef.current = {
1525
- cleanup: applyRegistryConfig(config, context),
1526
- config,
1527
- context,
1528
- payload
1529
- };
1530
- });
1531
- useIsomorphicLayoutEffect(
1532
- () => () => {
1533
- appliedRef.current?.cleanup();
1534
- appliedRef.current = null;
1535
- },
1536
- []
1537
- );
1538
- }
1539
- function createRegistryApplyContext(actions, {
1540
- cleanupScope = /* @__PURE__ */ new Map(),
1541
- instanceId,
1542
- modules = [],
1543
- pathname
1544
- }) {
1545
- const stamp = (queue) => ({
1546
- register: (type, key, item, sourceOrOptions, optionsArg) => queue.register(
1547
- type,
1548
- key,
1549
- item,
1550
- ...resolveRegisterArgsWithInstance(
1551
- instanceId,
1552
- sourceOrOptions,
1553
- optionsArg
1554
- )
1555
- ),
1556
- unregister: (type, key, sourceOrOptions) => queue.unregister(
1557
- type,
1558
- key,
1559
- withInstanceIdForUnregister(instanceId, sourceOrOptions)
1560
- )
1561
- });
1562
- return {
1563
- ...stamp(actions),
1564
- batch: (executor) => typeof executor === "function" ? actions.batch((queue) => executor(stamp(queue))) : 0,
1565
- cleanupScope,
1566
- instanceId,
1567
- modules,
1568
- pathname
1569
- };
1570
- }
1571
- function useRegistry(config, metadata) {
1572
- const { batch, register, unregister } = useRegistryActions();
1573
- const pathname = usePathname();
1574
- const modules = useInstalledModules();
1575
- const instanceId = `registry-instance-${useId()}`;
1576
- const [cleanupScope] = useState(
1577
- () => /* @__PURE__ */ new Map()
1578
- );
1579
- const context = useMemo(
1580
- () => createRegistryApplyContext(
1581
- { batch, register, unregister },
1582
- {
1583
- cleanupScope,
1584
- instanceId,
1585
- modules,
1586
- pathname
1587
- }
1588
- ),
1589
- [batch, cleanupScope, instanceId, modules, pathname, register, unregister]
1590
- );
1591
- const payload = useMemo(
1592
- () => config ? createModulePayload(modules, config, metadata) : null,
1593
- [config, metadata, modules]
1594
- );
1595
- const componentSlices = useMemo(
1596
- () => new Set(
1597
- modules.filter(
1598
- (coreModule) => coreModule.registry?.valueKind === "component"
1599
- ).map((coreModule) => coreModule.id)
1600
- ),
1601
- [modules]
1602
- );
1603
- useAppliedRegistryConfig(payload, context, componentSlices);
1604
- }
1605
- var EMPTY_OBJECT = Object.freeze({});
1606
- function createPageControllerStore() {
1607
- const listeners = /* @__PURE__ */ new Set();
1608
- let stack = [];
1609
- const notify = () => {
1610
- listeners.forEach((listener) => {
1611
- try {
1612
- listener();
1613
- } catch (error) {
1614
- report("Page controller listener", error);
1615
- }
1616
- });
1617
- };
1618
- return {
1619
- getSnapshot() {
1620
- const top = stack[stack.length - 1];
1621
- return top?.controllerRef?.current || null;
1622
- },
1623
- notify,
1624
- register(id, controllerRef) {
1625
- stack = stack.filter((item) => item.id !== id);
1626
- stack.push({ controllerRef, id });
1627
- notify();
1628
- },
1629
- subscribe(listener) {
1630
- listeners.add(listener);
1631
- return () => {
1632
- listeners.delete(listener);
1633
- };
1634
- },
1635
- unregister(id) {
1636
- stack = stack.filter((item) => item.id !== id);
1637
- notify();
1638
- }
1639
- };
1640
- }
1641
- function createControllerScope() {
1642
- const listeners = /* @__PURE__ */ new Set();
1643
- let current = null;
1644
- const subscribe = (listener) => {
1645
- listeners.add(listener);
1646
- return () => {
1647
- listeners.delete(listener);
1648
- };
1649
- };
1650
- const getSnapshot = () => current;
1651
- function PageProvider({ children }) {
1652
- const controller = useSyncExternalStore(
1653
- subscribe,
1654
- getSnapshot,
1655
- getSnapshot
1656
- );
1657
- return /* @__PURE__ */ jsx(PageControllerContext, { value: controller, children });
1658
- }
1659
- return {
1660
- Provider: PageProvider,
1661
- publish(controller) {
1662
- if (current === controller) return;
1663
- current = controller;
1664
- listeners.forEach((listener) => listener());
1665
- }
1666
- };
1667
- }
1668
- var fallbackStandaloneStore = createPageControllerStore();
1669
- var noopHook = () => {
1670
- };
1671
- var PassthroughProvider = ({ children }) => children;
1672
- var PageControllerContext = getOrCreateGlobalContext(
1673
- "PageControllerContext",
1674
- null
1675
- );
1676
- var PageControllerStoreContext = getOrCreateGlobalContext(
1677
- "PageControllerStoreContext",
1678
- fallbackStandaloneStore
1679
- );
1680
- function PageControllerProvider({ children }) {
1681
- const [store] = useState(
1682
- () => createPageControllerStore()
1683
- );
1684
- return /* @__PURE__ */ jsx(PageControllerStoreContext, { value: store, children });
1685
- }
1686
- var emptySubscribe = () => () => {
1687
- };
1688
- var getNullSnapshot = () => null;
1689
- var FALLBACK_PAGE_CONTROLLER = Object.freeze({
1690
- Provider: PassthroughProvider,
1691
- config: EMPTY_OBJECT,
1692
- modules: Object.freeze({}),
1693
- reset: noopHook,
1694
- set: noopHook
1695
- });
1696
- function usePageController() {
1697
- const scopedContext = use(PageControllerContext);
1698
- const controllerStore = use(PageControllerStoreContext);
1699
- const storeSubscribe = scopedContext ? emptySubscribe : controllerStore.subscribe;
1700
- const storeSnapshot = scopedContext ? getNullSnapshot : controllerStore.getSnapshot;
1701
- const storeController = useSyncExternalStore(
1702
- storeSubscribe,
1703
- storeSnapshot,
1704
- getNullSnapshot
1705
- );
1706
- return scopedContext ?? storeController ?? FALLBACK_PAGE_CONTROLLER;
1707
- }
1708
- function usePage(pageConfig = EMPTY_OBJECT, options) {
1709
- const instanceId = useId();
1710
- const controllerStore = use(PageControllerStoreContext);
1711
- const modules = useInstalledModules();
1712
- const [overrides, setOverrides] = useState(EMPTY_OBJECT);
1713
- const set = useCallback((partial) => {
1714
- if (!partial || typeof partial !== "object") return;
1715
- setOverrides((prev) => mergeModuleConfigs(prev, partial));
1716
- }, []);
1717
- const reset = useCallback(() => {
1718
- setOverrides(EMPTY_OBJECT);
1719
- }, []);
1720
- const effectiveConfig = useMemo(() => {
1721
- const base = pageConfig || EMPTY_OBJECT;
1722
- if (Object.keys(overrides).length === 0) return base;
1723
- return mergeModuleConfigs(base, overrides);
1724
- }, [pageConfig, overrides]);
1725
- const moduleSlices = useMemo(
1726
- () => modules.map(
1727
- (coreModule) => selectModuleSlice(coreModule, effectiveConfig)
1728
- ),
1729
- [effectiveConfig, modules]
1730
- );
1731
- const registryMetadata = useMemo(
1732
- () => pickRegistryMetadata(options),
1733
- [options]
1734
- );
1735
- useRegistry(effectiveConfig, registryMetadata);
1736
- const pageApi = useMemo(() => ({ set }), [set]);
1737
- const moduleControllers = {};
1738
- for (let index = 0; index < modules.length; index += 1) {
1739
- const coreModule = modules[index];
1740
- if (coreModule.page?.use) {
1741
- moduleControllers[coreModule.id] = coreModule.page.use(
1742
- moduleSlices[index],
1743
- pageApi
1744
- );
1745
- }
1746
- }
1747
- const pageModules = useShallowStable(moduleControllers);
1748
- const [scope] = useState(createControllerScope);
1749
- const controller = useMemo(
1750
- () => ({
1751
- Provider: scope.Provider,
1752
- config: effectiveConfig,
1753
- modules: pageModules,
1754
- reset,
1755
- set
1756
- }),
1757
- [effectiveConfig, pageModules, reset, scope, set]
1758
- );
1759
- const controllerRef = useRef(controller);
1760
- useIsomorphicLayoutEffect(() => {
1761
- controllerRef.current = controller;
1762
- scope.publish(controller);
1763
- controllerStore.notify();
1764
- }, [controller, controllerStore, scope]);
1765
- useEffect(() => {
1766
- controllerStore.register(instanceId, controllerRef);
1767
- return () => {
1768
- controllerStore.unregister(instanceId);
1769
- };
1770
- }, [controllerStore, instanceId]);
1771
- return controller;
1772
- }
1773
- function defineModule(coreModule) {
1774
- return Object.freeze({ ...coreModule });
1775
- }
1776
- function warnMissingPeers(modules) {
1777
- const installed = new Set(modules.map((coreModule) => coreModule.id));
1778
- for (const { id, uses } of modules) {
1779
- const missing = (uses ?? []).filter((peer) => !installed.has(peer));
1780
- if (missing.length > 0) {
1781
- report(
1782
- `Module "${id}" runs without its optional peers`,
1783
- missing.join(", "),
1784
- "warn"
1785
- );
1786
- }
1787
- }
1788
- }
1789
- function createModuleHost(modules, Boundary) {
1790
- const sorted = sortModules(modules);
1791
- if (process.env.NODE_ENV !== "production") warnMissingPeers(sorted);
1792
- return {
1793
- Boundary,
1794
- byId: new Map(sorted.map((coreModule) => [coreModule.id, coreModule])),
1795
- definitions: createModuleRegistryDefinitions(sorted),
1796
- modules: Object.freeze(sorted)
1797
- };
1798
- }
1799
- function ModuleHost({
1800
- boundary = PassthroughBoundary,
1801
- children,
1802
- modules = EMPTY_MODULES,
1803
- registryEntries
1804
- }) {
1805
- const [host] = useState(() => createModuleHost(modules, boundary));
1806
- const { Boundary } = host;
1807
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
1808
- host.modules.map(
1809
- ({ Backdrop, id }) => Backdrop ? /* @__PURE__ */ jsx(Boundary, { name: id, children: /* @__PURE__ */ jsx(Backdrop, {}) }, id) : null
1810
- ),
1811
- children,
1812
- host.modules.map(
1813
- ({ Overlay, id }) => Overlay ? /* @__PURE__ */ jsx(Boundary, { name: id, children: /* @__PURE__ */ jsx(Overlay, {}) }, id) : null
1814
- )
1815
- ] });
1816
- const tree = host.modules.reduceRight(
1817
- (inner, { Provider }) => Provider ? /* @__PURE__ */ jsx(Provider, { children: inner }) : inner,
1818
- content
1819
- );
1820
- return /* @__PURE__ */ jsx(
1821
- RegistryProvider,
1822
- {
1823
- definitions: host.definitions,
1824
- initialEntries: registryEntries,
1825
- children: /* @__PURE__ */ jsx(ModuleHostContext, { value: host, children: /* @__PURE__ */ jsx(PageControllerProvider, { children: tree }) })
1826
- }
1827
- );
1828
- }
1829
- function useModule(id) {
1830
- const coreModule = use(ModuleHostContext)?.byId.get(id);
1831
- return coreModule?.context ? use(coreModule.context) ?? null : null;
1832
- }
1833
- function definePeer(id, inert) {
1834
- const useRuntime = () => useModule(id) ?? inert;
1835
- return {
1836
- useRuntime,
1837
- useActions: () => useRuntime().actions,
1838
- useState: (selector, isEqual) => useStore(
1839
- useRuntime().store,
1840
- selector,
1841
- isEqual
1842
- )
1843
- };
1844
- }
1845
- var NO_MODULE_STORE = createStore(void 0);
1846
- function useModuleState(id, selector, fallback, isEqual = Object.is) {
1847
- const runtime = useModule(id);
1848
- return useStore(
1849
- runtime?.store ?? NO_MODULE_STORE,
1850
- (state) => runtime ? selector(state) : fallback,
1851
- isEqual
1852
- );
1853
- }
1854
- function ModuleBoundary({
1855
- children,
1856
- name
1857
- }) {
1858
- const Boundary = use(ModuleHostContext)?.Boundary ?? PassthroughBoundary;
1859
- return createElement(Boundary, { name }, children);
1860
- }
1861
- function useIsModuleInstalled(id) {
1862
- return use(ModuleHostContext)?.byId.has(id) ?? false;
1863
- }
1864
-
1865
- // src/kernel/adapters.ts
1866
- function useModuleRegistration(id, value, options) {
1867
- const coreModule = useInstalledModules().find(
1868
- (candidate) => candidate.id === id
1869
- );
1870
- const config = coreModule && options?.enabled !== false && value != null ? { [id]: value } : null;
1871
- useRegistry(config, pickRegistryMetadata(options));
1872
- }
1873
- function Compose({ providers, children }) {
1874
- return providers.reduceRight(
1875
- (acc, entry) => {
1876
- if (Array.isArray(entry)) {
1877
- const [Component2, props] = entry;
1878
- return createElement(Component2, props, acc);
1879
- }
1880
- const Component = entry;
1881
- return createElement(Component, null, acc);
1882
- },
1883
- createElement(Fragment$1, null, children)
1884
- );
1885
- }
1886
-
1887
- export { Compose, ModuleBoundary, ModuleHost, PageControllerProvider, REGISTRY_SOURCES, RegistryProvider, applyRegistryConfig, createModuleRegistryDefinitions, createRegistryApplyContext, createRegistryOperations, createRegistryStore, defineModule, definePeer, getOrCreateGlobalContext, hasOwnProperty, sortModules, useIsModuleInstalled, useModule, useModuleRegistration, useModuleState, usePage, usePageController, useRegistryEntries, useRegistryValue };
1888
- //# sourceMappingURL=chunk-HMEWYAWU.js.map
1889
- //# sourceMappingURL=chunk-HMEWYAWU.js.map