@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
package/MIGRATION.md ADDED
@@ -0,0 +1,75 @@
1
+ # Migrating from 3.x to 3.2
2
+
3
+ 3.2 reorganises the package into layers and tidies the public surface. Most of the change is where you import from and a few removed names. Runtime behaviour is the same apart from one bug fix (see [Fixed](#fixed)) and the components that are no longer `memo()`.
4
+
5
+ ## The framework holds no design
6
+
7
+ Coming from 3.1.0, note that 3.2 also includes an unreleased step in which every visual decision moved to the app:
8
+
9
+ - `./styles.css`, the `styles/` folder, design tokens (`Z_INDEX`, motion presets), default recipes, tones, default motion, icon names and `templates/motion` are removed. Supply them from your app's `ui`.
10
+ - Atoms and `utils/cn` are removed. Use the vocabulary-free `cn` and the `./ui` components (`Button`, `Icon`, `Loader`, `Tooltip`). `Button` takes `href` to render a link.
11
+ - Components ship an anatomy of empty parts plus the states they set (`checked`, `active`, `visible`, `loading`). Without a `ui`, they render no classes.
12
+ - Component motion comes from `motion/react` variants in your `ui`. A missing key means no animation, and reduced motion uses your `still` variant.
13
+ - Modules take stacking from theme styles (the modal reads `styles.layer`). The dock loader is now a `surfaceLoader` slot.
14
+ - `defineMotion`, `retime`, `gpuTransform` and `cssTransition` live in the server-safe `./utils` entry.
15
+
16
+ The subpath table below maps the previous build's layout. In it, the `./design` paths correspond to 3.1.0's `./ui`.
17
+
18
+ ## Requirements
19
+
20
+ - Node `>=22` (see `engines` in `package.json`).
21
+ - React and React DOM `>=19.2.0` (peer dependencies; 3.x accepted `>=19.0.0`). 3.2 uses `useEffectEvent`, which is stable only from React 19.2. If you are on React 19.0 or 19.1, upgrade `react` and `react-dom` first.
22
+
23
+ ## Subpath changes
24
+
25
+ | 3.x | 3.2 |
26
+ | ---------------------------------------- | --------------------------------------------- |
27
+ | `.` | `.` |
28
+ | `./result` | `./result` |
29
+ | `./events` | `./events` |
30
+ | `./utils` | `./utils` |
31
+ | `./design/recipes` | **`./recipes`** |
32
+ | `./hooks` | `./hooks` |
33
+ | `./theme` | `./theme` |
34
+ | `./design` | **`./ui`** |
35
+ | `./kernel` | `./kernel` |
36
+ | `./error` | `./error` |
37
+ | `./provider` | `./provider` |
38
+ | `./modules` | `./modules` |
39
+ | `./dock` ... `./navigation` (10 modules) | unchanged |
40
+ | `./ambient/server`, `./ambient/worker` | unchanged |
41
+ | `./modules/*` | **removed** (use `./<module>` or `./modules`) |
42
+
43
+ Notes:
44
+
45
+ - `./ui` exports only the UI components and `UiProvider`. For convenience it also re-exports `./recipes`, which 3.x served from `./design`.
46
+ - `getOrCreateGlobalContext` is still re-exported from `./kernel`.
47
+
48
+ ## Removed names
49
+
50
+ | Removed | Replacement |
51
+ | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
52
+ | `useModuleTheme` (from `./theme` and `.`) | `useTheme`, same signature and behaviour |
53
+ | `useIsomorphicLayoutEffect` (from `./hooks` and `.`) | `useLayoutEffect` from `react`. React 19 no longer warns about `useLayoutEffect` during server rendering. |
54
+
55
+ ## Fixed
56
+
57
+ - The YouTube background's companion audio volume now falls back to `1` when the video's volume is unset. In 3.x the fallback never applied, because `Number(video.volume) ?? 1` ignores `NaN`.
58
+
59
+ ## Components that are no longer `memo()`
60
+
61
+ These public components were wrapped in `React.memo` in 3.x and are now plain function components:
62
+
63
+ - `DockCardBanner`, `DockCardHeader`, `DockDescription`, `DockIcon`, `DockTitle` (from `./dock`)
64
+ - `YouTubeBackgroundPlayer` (from `./background`)
65
+
66
+ Rendering is the same. What changes:
67
+
68
+ - Their type is a function component, not `MemoExoticComponent`. Code that names the type (`typeof DockTitle` with `.type`, `MemoExoticComponent<…>`) needs updating.
69
+ - They re-render with their parent. The published build compiles them with the React Compiler, which skips work when props are unchanged. If you bundle the source without the compiler and relied on the memo, wrap them yourself: `const MemoTitle = memo(DockTitle)`.
70
+
71
+ ## React Compiler and bundle size
72
+
73
+ The published JavaScript is built with `babel-plugin-react-compiler`. Components and hooks memoize automatically, so the source no longer carries most hand-written `useMemo`/`useCallback`/`memo`. Behaviour does not depend on the compiler: identities that effects, subscriptions, context values and public hook returns rely on stay stable in uncompiled code too.
74
+
75
+ The compiled output is larger. Total gzipped JavaScript is about 35% above the previous build (about 273 KB vs 201 KB across all entries and chunks). The compiler accounts for most of that, about 25%. Bundlers still tree-shake per entry, so an app pays only for the entries it imports.
package/README.md CHANGED
@@ -14,16 +14,18 @@
14
14
  For in-depth architecture guides and module-by-module references, explore the [`docs/`](./docs) folder:
15
15
 
16
16
  ### General Architecture Guides
17
+
17
18
  - 🚀 **[Getting Started & Installation](./docs/getting-started.md)** — Step-by-step setup, Tailwind CSS v4, root layout wiring
18
19
  - 🏛️ **[System Architecture Map](./docs/README.md)** — Macro overview, task lookup table, conventions
19
20
  - 📐 **[Architecture & 10 Rules](./docs/architecture-and-rules.md)** — Package layer hierarchy, boundaries, decision tree
20
21
  - 🎨 **[Theming System Guide](./docs/theming.md)** — Visual customization: defineTheme, ThemeProvider, slot reference
21
22
  - 🧩 **[Custom Module Authoring](./docs/custom-modules.md)** — Build custom declarative modules with defineModule & usePage
22
23
  - ⚙️ **[Core Engine Deep Dive](./docs/core-engine.md)** — CoreProvider, theme engine, event bus, pure utils & stores
23
- - 🧪 **[Testing Guide](./docs/testing.md)** — 520+ test suite, test harness, happy-dom, downstream testing
24
+ - 🧪 **[Testing Guide](./docs/testing.md)** — 740-test suite, test harness, happy-dom, downstream testing
24
25
  - 🤖 **[AI Agent Blueprint (`AGENTS.md`)](./templates/AGENTS.md)** — Drop-in rules for AI coding assistants
25
26
 
26
27
  ### Module & Component Reference
28
+
27
29
  - ⚡ **[Microkernel Engine (`kernel`)](./docs/modules/kernel.md)** — `usePage()`, `defineModule()`, topological registry
28
30
  - ⚓ **[Dock Module (`dock`)](./docs/modules/dock.md)** — Floating app chrome, cards, surfaces, flows, HUD, guards
29
31
  - 🪟 **[Modal Module (`modal`)](./docs/modules/modal.md)** — Stackable dialogs, focus trap, smooth scroll lock
@@ -47,7 +49,7 @@ For in-depth architecture guides and module-by-module references, explore the [`
47
49
  - 🎯 **Single Route Declaration (`usePage`):** Cleanly declare titles, navigation cards, modals, loading states, and background media in a single atomic hook call.
48
50
  - 🔒 **Type-Safe Result Pattern (`Result<T, E>`):** Functional, bulletproof error handling with `ok()`, `err()`, and direct feedback bridging via `toast.fromResult()`.
49
51
  - 🛡️ **Cross-Bundle Context Deduplication:** Guarantees stable React Context singletons across Next.js split chunks and monorepo boundaries.
50
- - 🎨 **Tailwind CSS v4 & OKLCH Ready:** GPU-accelerated motion presets (`translate3d`, `scale`) and semantic color tokens.
52
+ - 🎨 **No design inside:** no CSS, tokens or motion values. Modules and components take every class, timing and icon from your app's theme and `defineUi`.
51
53
 
52
54
  ---
53
55
 
@@ -57,7 +59,9 @@ For in-depth architecture guides and module-by-module references, explore the [`
57
59
  npm install @omerdlw/base-framework motion
58
60
  ```
59
61
 
60
- Ensure peer dependencies are satisfied (`next >= 15.0.0`, `react >= 19.0.0`, `react-dom >= 19.0.0`, `motion >= 12.0.0`).
62
+ Ensure peer dependencies are satisfied (`next >= 15.0.0`, `react >= 19.2.0`, `react-dom >= 19.2.0`, `motion >= 12.0.0`).
63
+
64
+ Requires Node `>=22`. Upgrading from 3.x? See [MIGRATION.md](./MIGRATION.md).
61
65
 
62
66
  ---
63
67
 
@@ -71,13 +75,13 @@ Create your client providers component (e.g. `src/app/providers.tsx`):
71
75
  "use client";
72
76
 
73
77
  import { CoreProvider } from "@omerdlw/base-framework/provider";
74
- import { dockModule } from "@omerdlw/base-framework/modules/dock";
75
- import { modalModule } from "@omerdlw/base-framework/modules/modal";
76
- import { notificationModule } from "@omerdlw/base-framework/modules/notification";
77
- import { ambientModule } from "@omerdlw/base-framework/modules/ambient";
78
- import { backgroundModule } from "@omerdlw/base-framework/modules/background";
79
- import { loadingModule } from "@omerdlw/base-framework/modules/loading";
80
- import { navigationModule } from "@omerdlw/base-framework/modules/navigation";
78
+ import { dockModule } from "@omerdlw/base-framework/dock";
79
+ import { modalModule } from "@omerdlw/base-framework/modal";
80
+ import { notificationModule } from "@omerdlw/base-framework/notification";
81
+ import { ambientModule } from "@omerdlw/base-framework/ambient";
82
+ import { backgroundModule } from "@omerdlw/base-framework/background";
83
+ import { loadingModule } from "@omerdlw/base-framework/loading";
84
+ import { navigationModule } from "@omerdlw/base-framework/navigation";
81
85
 
82
86
  const modules = [
83
87
  dockModule,
@@ -100,7 +104,11 @@ Wrap your root `app/layout.tsx`:
100
104
  import { Providers } from "./providers";
101
105
  import "./globals.css";
102
106
 
103
- export default function RootLayout({ children }: { children: React.ReactNode }) {
107
+ export default function RootLayout({
108
+ children,
109
+ }: {
110
+ children: React.ReactNode;
111
+ }) {
104
112
  return (
105
113
  <html lang="en">
106
114
  <body>
@@ -161,20 +169,20 @@ export default function DashboardPage() {
161
169
 
162
170
  ## 📚 Subpath Export Directory
163
171
 
164
- | Subpath | Purpose & Key Exports |
165
- | :---------------------------------- | :---------------------------------------------------------------- |
166
- | `@omerdlw/base-framework` | Root exports of all sub-systems |
167
- | `@omerdlw/base-framework/kernel` | `usePage`, `defineModule`, `definePeer`, `createContextRegistry` |
168
- | `@omerdlw/base-framework/provider` | `CoreProvider` composition pipeline & `ModuleHost` |
169
- | `@omerdlw/base-framework/result` | `ok()`, `err()`, `isResult()`, `type Result<T, E>` |
170
- | `@omerdlw/base-framework/events` | Decoupled event bus (`globalEvents`, `EVENT_TYPES`) |
171
- | `@omerdlw/base-framework/theme` | `ThemeProvider`, `useTheme`, `defineThemeSpec` |
172
- | `@omerdlw/base-framework/tokens` | Motion easing, timing presets, z-index hierarchy |
173
- | `@omerdlw/base-framework/atoms` | Primitive components (`Button`, `Icon`, `Spinner`, `Tooltip`) |
174
- | `@omerdlw/base-framework/utils` | Pure utilities (`cn`, `report`, `createStore`, `createScheduler`) |
175
- | `@omerdlw/base-framework/hooks` | Essential hooks (`useClickOutside`, `useGlobalEvent`, `useStore`) |
176
- | `@omerdlw/base-framework/error` | Error boundaries and reporter sink |
177
- | `@omerdlw/base-framework/modules/*` | 9 standalone modules (`dock`, `modal`, `notification`, etc.) |
172
+ | Subpath | Purpose & Key Exports |
173
+ | :--------------------------------- | :--------------------------------------------------------------------------------------- |
174
+ | `@omerdlw/base-framework` | Root exports of all sub-systems |
175
+ | `@omerdlw/base-framework/kernel` | `usePage`, `defineModule`, `definePeer`, `ModuleHost`, `getOrCreateGlobalContext` |
176
+ | `@omerdlw/base-framework/provider` | `CoreProvider` composition pipeline |
177
+ | `@omerdlw/base-framework/result` | `ok()`, `err()`, `isResult()`, `type Result<T, E>` |
178
+ | `@omerdlw/base-framework/events` | Decoupled event bus (`globalEvents`, `EVENT_TYPES`) |
179
+ | `@omerdlw/base-framework/theme` | `ThemeProvider`, `useTheme`, `defineThemeSpec` |
180
+ | `@omerdlw/base-framework/ui` | Unstyled components the app gives a look (`Button`, `Icon`, `Select`, …) |
181
+ | `@omerdlw/base-framework/recipes` | Server-safe `defineUi`, recipes, `cn`, `createCn`, `ANATOMY` |
182
+ | `@omerdlw/base-framework/utils` | Pure utilities (`report`, `createStore`, `createScheduler`, `defineMotion`) |
183
+ | `@omerdlw/base-framework/hooks` | Essential hooks (`useClickOutside`, `useGlobalEvent`, `useStore`) |
184
+ | `@omerdlw/base-framework/error` | Error boundaries (`GlobalError`, `ModuleError`, `ComponentError`) and `getErrorReporter` |
185
+ | `@omerdlw/base-framework/<module>` | 10 standalone modules (`dock`, `modal`, `notification`, `navigation`, etc.) |
178
186
 
179
187
  ---
180
188
 
@@ -0,0 +1 @@
1
+ export * from "../modules/ambient/index.js";
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ export { AMBIENT_ANALYSIS_VERSION, AMBIENT_REGIONS, AMBIENT_ROLES, AMBIENT_TONES, AmbientContext, AmbientProvider, DEFAULT_ANALYSIS, DEFAULT_CSS_VAR_NAMES, DEFAULT_LINGER_MS, ambientModule, ambientTheme, analyzeAmbientPixels, applyScopedCssVariables, configureAmbient, contrastRatio, defineAmbient, extractPaletteFromImage, findContentBounds, formatOklch, getAmbientSettings, getCachedAmbientPalette, maxChroma, normalizeColorMap, onColorFor, paletteVarMap, primeAmbientPalette, resolveAmbientVarMap, resolveCssVarNames, resolvePageAmbientTheme, resolveTargetElement, skinLikeness, srgbToOklab, toneOf, useAmbient, useAmbientColor, useAmbientTheme } from '../chunk-QMFV53PP.js';
3
+ import '../chunk-TUUGWQY5.js';
4
+ import '../chunk-WXEOP6Z4.js';
5
+ import '../chunk-NHOJWICA.js';
6
+ import '../chunk-Y2Q74PJP.js';
7
+ import '../chunk-CT4UILO2.js';
8
+ import '../chunk-7RSRDKYE.js';
9
+ import '../chunk-ESD5EQ5H.js';
10
+ import '../chunk-5H6FZW3N.js';
11
+ import '../chunk-J3VTDBC6.js';
12
+ import '../chunk-BMFHS3GV.js';
13
+ //# sourceMappingURL=index.js.map
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export * from "../../modules/ambient/server/index.js";
@@ -0,0 +1,238 @@
1
+ import { resolveAnalysis, analyzeAmbientPixels } from '../../chunk-2LGI33JP.js';
2
+ export { AMBIENT_ANALYSIS_VERSION, analyzeAmbientPixels, configureAmbient, contrastRatio, findContentBounds, fitSample, formatOklch, getAmbientSettings, maxChroma, onColorFor, srgbToOklab, toneOf } from '../../chunk-2LGI33JP.js';
3
+
4
+ // src/modules/ambient/server/address.ts
5
+ var PRIVATE_NAMES = /(^|\.)(localhost|local|internal|intranet|lan|home\.arpa|localdomain)$/;
6
+ function normalizeHost(hostname) {
7
+ return hostname.toLowerCase().replace(/\.+$/, "").replace(/^\[|\]$/g, "");
8
+ }
9
+ function parseIPv4(value) {
10
+ const parts = value.split(".");
11
+ if (parts.length !== 4) return null;
12
+ const bytes = parts.map((part) => /^\d{1,3}$/.test(part) ? Number(part) : NaN);
13
+ return bytes.every((byte) => byte >= 0 && byte <= 255) ? bytes : null;
14
+ }
15
+ function isPrivateIPv4([a, b, c]) {
16
+ return a === 0 || a === 10 || a === 127 || a === 100 && b >= 64 && b <= 127 || a === 169 && b === 254 || a === 172 && b >= 16 && b <= 31 || a === 192 && b === 168 || a === 192 && b === 0 && c === 0 || a === 198 && (b === 18 || b === 19) || a >= 224;
17
+ }
18
+ function parseIPv6(value) {
19
+ let text = value.split("%")[0];
20
+ const tail = /^(.*:)(\d+\.\d+\.\d+\.\d+)$/.exec(text);
21
+ if (tail) {
22
+ const v4 = parseIPv4(tail[2]);
23
+ if (!v4) return null;
24
+ text = `${tail[1]}${(v4[0] << 8 | v4[1]).toString(16)}:${(v4[2] << 8 | v4[3]).toString(16)}`;
25
+ }
26
+ const halves = text.split("::");
27
+ if (halves.length > 2) return null;
28
+ const read = (part) => part ? part.split(":") : [];
29
+ const head = read(halves[0]);
30
+ const rest = halves.length === 2 ? read(halves[1]) : [];
31
+ const missing = 8 - head.length - rest.length;
32
+ if (halves.length === 1 ? missing !== 0 : missing < 1) return null;
33
+ const groups = [...head, ...Array(halves.length === 2 ? missing : 0).fill("0"), ...rest];
34
+ const words = groups.map((group) => /^[0-9a-f]{1,4}$/.test(group) ? parseInt(group, 16) : NaN);
35
+ return words.length === 8 && words.every((word) => word >= 0) ? words : null;
36
+ }
37
+ function isPrivateIPv6(words) {
38
+ const [w0, w1, w2, w3, w4, w5, w6, w7] = words;
39
+ const embedded = () => [w6 >> 8, w6 & 255, w7 >> 8, w7 & 255];
40
+ if (words.slice(0, 7).every((word) => word === 0)) return w7 <= 1;
41
+ if (w0 === 0 && w1 === 0 && w2 === 0 && w3 === 0 && w4 === 0 && (w5 === 65535 || w5 === 0)) {
42
+ return isPrivateIPv4(embedded());
43
+ }
44
+ if (w0 === 100 && w1 === 65435) return isPrivateIPv4(embedded());
45
+ if (w0 === 8194) return isPrivateIPv4([w1 >> 8, w1 & 255, w2 >> 8, w2 & 255]);
46
+ return (w0 & 65024) === 64512 || (w0 & 65472) === 65152 || (w0 & 65280) === 65280 || w0 === 8193 && w1 === 3512;
47
+ }
48
+ function isPrivateAddress(address) {
49
+ const host = normalizeHost(address);
50
+ const v4 = parseIPv4(host);
51
+ if (v4) return isPrivateIPv4(v4);
52
+ const v6 = parseIPv6(host);
53
+ return v6 ? isPrivateIPv6(v6) : false;
54
+ }
55
+ var isIpLiteral = (hostname) => {
56
+ const host = normalizeHost(hostname);
57
+ return parseIPv4(host) !== null || parseIPv6(host) !== null;
58
+ };
59
+ function isPrivateHostname(hostname) {
60
+ const host = normalizeHost(hostname);
61
+ if (!host) return true;
62
+ if (isIpLiteral(host)) return isPrivateAddress(host);
63
+ return PRIVATE_NAMES.test(host) || !host.includes(".");
64
+ }
65
+
66
+ // src/modules/ambient/server/index.ts
67
+ var MAX_BYTES = 12 * 1024 * 1024;
68
+ var TIMEOUT_MS = 8e3;
69
+ var CACHE_LIMIT = 500;
70
+ var MAX_REDIRECTS = 5;
71
+ var REDIRECT_STATUS_MIN = 300;
72
+ var REDIRECT_STATUS_MAX = 400;
73
+ function isPublicImageUrl(url) {
74
+ return (url.protocol === "https:" || url.protocol === "http:") && !url.username && !url.password && !isPrivateHostname(url.hostname);
75
+ }
76
+ async function lookupAll(hostname) {
77
+ const {
78
+ lookup
79
+ } = await import('dns/promises');
80
+ return (await lookup(hostname, {
81
+ all: true,
82
+ verbatim: true
83
+ })).map((entry) => entry.address);
84
+ }
85
+ async function reachesOnlyPublic(url, resolve) {
86
+ if (resolve === false) return true;
87
+ const host = normalizeHost(url.hostname);
88
+ try {
89
+ const addresses = isIpLiteral(host) ? [host] : await (resolve ?? lookupAll)(host);
90
+ return addresses.length > 0 && !addresses.some(isPrivateAddress);
91
+ } catch {
92
+ return false;
93
+ }
94
+ }
95
+ var AmbientDecoderMissingError = class extends Error {
96
+ name = "AmbientDecoderMissingError";
97
+ };
98
+ var sharpModule = null;
99
+ var SHARP = "sharp";
100
+ function loadSharp() {
101
+ sharpModule ??= import(
102
+ /* webpackIgnore: true */
103
+ /* turbopackIgnore: true */
104
+ SHARP
105
+ ).then((mod) => mod.default ?? mod).catch((error) => {
106
+ sharpModule = null;
107
+ throw new AmbientDecoderMissingError("ambient/server: `sharp` is not installed. Install it or pass `decode`.", {
108
+ cause: error
109
+ });
110
+ });
111
+ return sharpModule;
112
+ }
113
+ var sharpDecoder = async (bytes, size) => {
114
+ const sharp = await loadSharp();
115
+ const {
116
+ data,
117
+ info
118
+ } = await sharp(bytes, {
119
+ failOn: "none"
120
+ }).rotate().resize(size, size, {
121
+ fit: "inside",
122
+ withoutEnlargement: true
123
+ }).ensureAlpha().raw().toBuffer({
124
+ resolveWithObject: true
125
+ });
126
+ return {
127
+ data,
128
+ height: info.height,
129
+ width: info.width
130
+ };
131
+ };
132
+ async function readLimited(response, maxBytes) {
133
+ const declared = Number(response.headers.get("content-length"));
134
+ if (declared > maxBytes) throw new Error("ambient/server: image too large");
135
+ if (!response.body) return new Uint8Array(await response.arrayBuffer());
136
+ const reader = response.body.getReader();
137
+ const chunks = [];
138
+ let length = 0;
139
+ for (; ; ) {
140
+ const {
141
+ done,
142
+ value
143
+ } = await reader.read();
144
+ if (done) break;
145
+ length += value.byteLength;
146
+ if (length > maxBytes) {
147
+ await reader.cancel();
148
+ throw new Error("ambient/server: image too large");
149
+ }
150
+ chunks.push(value);
151
+ }
152
+ const bytes = new Uint8Array(length);
153
+ let offset = 0;
154
+ for (const chunk of chunks) {
155
+ bytes.set(chunk, offset);
156
+ offset += chunk.byteLength;
157
+ }
158
+ return bytes;
159
+ }
160
+ async function extractAmbientPaletteFromBytes(bytes, options = {}) {
161
+ const analysis = resolveAnalysis(options.analysis);
162
+ const pixels = await (options.decode ?? sharpDecoder)(bytes, analysis.sampleSize);
163
+ return analyzeAmbientPixels(pixels, analysis);
164
+ }
165
+ var cache = /* @__PURE__ */ new Map();
166
+ var inFlight = /* @__PURE__ */ new Map();
167
+ function remember(key, palette) {
168
+ cache.delete(key);
169
+ while (cache.size >= CACHE_LIMIT) {
170
+ const oldest = cache.keys().next().value;
171
+ if (oldest === void 0) break;
172
+ cache.delete(oldest);
173
+ }
174
+ cache.set(key, palette);
175
+ }
176
+ async function fetchAndExtract(url, options) {
177
+ const allow = options.allow ?? isPublicImageUrl;
178
+ const doFetch = options.fetch ?? fetch;
179
+ const signal = AbortSignal.timeout(options.timeoutMs ?? TIMEOUT_MS);
180
+ let current = url;
181
+ for (let hop = 0; hop <= MAX_REDIRECTS; hop++) {
182
+ if (!allow(current)) return null;
183
+ if (!await reachesOnlyPublic(current, options.resolve)) return null;
184
+ const response = await doFetch(current, {
185
+ ...options.init,
186
+ redirect: "manual",
187
+ signal
188
+ });
189
+ if (response.status >= REDIRECT_STATUS_MIN && response.status < REDIRECT_STATUS_MAX) {
190
+ const location = response.headers.get("location");
191
+ await response.body?.cancel();
192
+ if (!location) return null;
193
+ current = new URL(location, current);
194
+ continue;
195
+ }
196
+ if (!response.ok) return null;
197
+ const type = response.headers.get("content-type") ?? "";
198
+ if (type && !type.toLowerCase().startsWith("image/")) return null;
199
+ const bytes = await readLimited(response, options.maxBytes ?? MAX_BYTES);
200
+ const palette = await extractAmbientPaletteFromBytes(bytes, options);
201
+ return {
202
+ ...palette,
203
+ source: url.href
204
+ };
205
+ }
206
+ return null;
207
+ }
208
+ async function extractAmbientPalette(src, options = {}) {
209
+ let url;
210
+ try {
211
+ url = new URL(src);
212
+ } catch {
213
+ return null;
214
+ }
215
+ const useCache = options.cache !== false;
216
+ const key = options.analysis ? `${url.href}#${JSON.stringify(options.analysis)}` : url.href;
217
+ if (useCache) {
218
+ const hit = cache.get(key);
219
+ if (hit) return hit;
220
+ const pending = inFlight.get(key);
221
+ if (pending) return pending;
222
+ }
223
+ const task = fetchAndExtract(url, options).catch((error) => {
224
+ if (error instanceof AmbientDecoderMissingError) throw error;
225
+ return null;
226
+ });
227
+ if (!useCache) return task;
228
+ const shared = task.then((palette) => {
229
+ if (palette) remember(key, palette);
230
+ return palette;
231
+ }).finally(() => inFlight.delete(key));
232
+ inFlight.set(key, shared);
233
+ return shared;
234
+ }
235
+
236
+ export { AmbientDecoderMissingError, extractAmbientPalette, extractAmbientPaletteFromBytes, isPrivateAddress, isPrivateHostname, isPublicImageUrl, sharpDecoder };
237
+ //# sourceMappingURL=index.js.map
238
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/modules/ambient/server/address.ts","../../../src/modules/ambient/server/index.ts"],"names":["PRIVATE_NAMES","normalizeHost","hostname","toLowerCase","replace","parseIPv4","value","parts","split","length","bytes","map","part","test","Number","NaN","every","byte","isPrivateIPv4","a","b","c","parseIPv6","text","tail","exec","v4","toString","halves","read","head","rest","missing","groups","Array","fill","words","group","parseInt","word","isPrivateIPv6","w0","w1","w2","w3","w4","w5","w6","w7","embedded","slice","isPrivateAddress","address","host","v6","isIpLiteral","isPrivateHostname","includes","MAX_BYTES","TIMEOUT_MS","CACHE_LIMIT","MAX_REDIRECTS","REDIRECT_STATUS_MIN","REDIRECT_STATUS_MAX","isPublicImageUrl","url","protocol","username","password","lookupAll","lookup","all","verbatim","entry","reachesOnlyPublic","resolve","addresses","some","AmbientDecoderMissingError","Error","name","sharpModule","SHARP","loadSharp","then","mod","default","catch","error","cause","sharpDecoder","size","sharp","data","info","failOn","rotate","resize","fit","withoutEnlargement","ensureAlpha","raw","toBuffer","resolveWithObject","height","width","readLimited","response","maxBytes","declared","headers","get","body","Uint8Array","arrayBuffer","reader","getReader","chunks","done","byteLength","cancel","push","offset","chunk","set","extractAmbientPaletteFromBytes","options","analysis","resolveAnalysis","pixels","decode","sampleSize","analyzeAmbientPixels","cache","Map","inFlight","remember","key","palette","delete","oldest","keys","next","undefined","fetchAndExtract","allow","doFetch","fetch","signal","AbortSignal","timeout","timeoutMs","current","hop","init","redirect","status","location","URL","ok","type","startsWith","source","href","extractAmbientPalette","src","useCache","JSON","stringify","hit","pending","task","shared","finally"],"mappings":";;;;AAAA,IAAMA,aAAAA,GACJ,uEAAA;AAEK,SAASC,cAAcC,QAAAA,EAA0B;AACtD,EAAA,OAAOA,QAAAA,CACJC,aAAY,CACZC,OAAAA,CAAQ,QAAQ,EAAE,CAAA,CAClB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K,IAAAA;AAEtB,EAAA,MAAMC,MAAAA,GAASD,IAAAA,CACZvF,IAAAA,CAAMsD,CAAAA,OAAAA,KAAY;AACjB,IAAA,IAAIA,OAAAA,EAASF,QAAAA,CAASC,GAAAA,EAAKC,OAAO,CAAA;AAClC,IAAA,OAAOA,OAAAA;AACT,EAAA,CAAC,EACAmC,OAAAA,CAAQ,MAAMtC,QAAAA,CAASI,MAAAA,CAAOF,GAAG,CAAC,CAAA;AACrCF,EAAAA,QAAAA,CAASX,GAAAA,CAAIa,KAAKmC,MAAM,CAAA;AACxB,EAAA,OAAOA,MAAAA;AACT","file":"index.js","sourcesContent":["const PRIVATE_NAMES =\n /(^|\\.)(localhost|local|internal|intranet|lan|home\\.arpa|localdomain)$/;\n\nexport function normalizeHost(hostname: string): string {\n return hostname\n .toLowerCase()\n .replace(/\\.+$/, \"\")\n .replace(/^\\[|\\]$/g, \"\");\n}\n\nfunction parseIPv4(value: string): number[] | null {\n const parts = value.split(\".\");\n if (parts.length !== 4) return null;\n const bytes = parts.map((part) =>\n /^\\d{1,3}$/.test(part) ? Number(part) : NaN,\n );\n return bytes.every((byte) => byte >= 0 && byte <= 255) ? bytes : null;\n}\n\nfunction isPrivateIPv4([a, b, c]: number[]): boolean {\n return (\n a === 0 ||\n a === 10 ||\n a === 127 ||\n (a === 100 && b >= 64 && b <= 127) ||\n (a === 169 && b === 254) ||\n (a === 172 && b >= 16 && b <= 31) ||\n (a === 192 && b === 168) ||\n (a === 192 && b === 0 && c === 0) ||\n (a === 198 && (b === 18 || b === 19)) ||\n a >= 224\n );\n}\n\nfunction parseIPv6(value: string): number[] | null {\n let text = value.split(\"%\")[0];\n const tail = /^(.*:)(\\d+\\.\\d+\\.\\d+\\.\\d+)$/.exec(text);\n if (tail) {\n const v4 = parseIPv4(tail[2]);\n if (!v4) return null;\n text = `${tail[1]}${((v4[0] << 8) | v4[1]).toString(16)}:${((v4[2] << 8) | v4[3]).toString(16)}`;\n }\n const halves = text.split(\"::\");\n if (halves.length > 2) return null;\n const read = (part: string) => (part ? part.split(\":\") : []);\n const head = read(halves[0]);\n const rest = halves.length === 2 ? read(halves[1]) : [];\n const missing = 8 - head.length - rest.length;\n if (halves.length === 1 ? missing !== 0 : missing < 1) return null;\n const groups = [\n ...head,\n ...Array<string>(halves.length === 2 ? missing : 0).fill(\"0\"),\n ...rest,\n ];\n const words = groups.map((group) =>\n /^[0-9a-f]{1,4}$/.test(group) ? parseInt(group, 16) : NaN,\n );\n return words.length === 8 && words.every((word) => word >= 0) ? words : null;\n}\n\nfunction isPrivateIPv6(words: number[]): boolean {\n const [w0, w1, w2, w3, w4, w5, w6, w7] = words;\n const embedded = () => [w6 >> 8, w6 & 255, w7 >> 8, w7 & 255];\n if (words.slice(0, 7).every((word) => word === 0)) return w7 <= 1;\n if (\n w0 === 0 &&\n w1 === 0 &&\n w2 === 0 &&\n w3 === 0 &&\n w4 === 0 &&\n (w5 === 0xffff || w5 === 0)\n ) {\n return isPrivateIPv4(embedded());\n }\n if (w0 === 0x64 && w1 === 0xff9b) return isPrivateIPv4(embedded());\n if (w0 === 0x2002)\n return isPrivateIPv4([w1 >> 8, w1 & 255, w2 >> 8, w2 & 255]);\n return (\n (w0 & 0xfe00) === 0xfc00 ||\n (w0 & 0xffc0) === 0xfe80 ||\n (w0 & 0xff00) === 0xff00 ||\n (w0 === 0x2001 && w1 === 0xdb8)\n );\n}\n\n/**\n * Whether an IP address is loopback, private, link-local or otherwise not\n * publicly routable.\n */\nexport function isPrivateAddress(address: string): boolean {\n const host = normalizeHost(address);\n const v4 = parseIPv4(host);\n if (v4) return isPrivateIPv4(v4);\n const v6 = parseIPv6(host);\n return v6 ? isPrivateIPv6(v6) : false;\n}\n\nexport const isIpLiteral = (hostname: string) => {\n const host = normalizeHost(hostname);\n return parseIPv4(host) !== null || parseIPv6(host) !== null;\n};\n\n/**\n * Whether a hostname is an IP literal or local name that points at a private\n * network.\n */\nexport function isPrivateHostname(hostname: string): boolean {\n const host = normalizeHost(hostname);\n if (!host) return true;\n if (isIpLiteral(host)) return isPrivateAddress(host);\n return PRIVATE_NAMES.test(host) || !host.includes(\".\");\n}\n","import { analyzeAmbientPixels } from \"../analyze\";\nimport { resolveAnalysis } from \"../settings\";\nimport type {\n AmbientAnalysisOptions,\n AmbientPalette,\n AmbientPixels,\n} from \"../types\";\nimport {\n isIpLiteral,\n isPrivateAddress,\n isPrivateHostname,\n normalizeHost,\n} from \"./address\";\n\nexport {\n AMBIENT_ANALYSIS_VERSION,\n analyzeAmbientPixels,\n findContentBounds,\n fitSample,\n} from \"../analyze\";\nexport { isPrivateAddress, isPrivateHostname } from \"./address\";\nexport { configureAmbient, getAmbientSettings } from \"../settings\";\nexport {\n contrastRatio,\n formatOklch,\n maxChroma,\n onColorFor,\n srgbToOklab,\n toneOf,\n} from \"../oklab\";\nexport type * from \"../types\";\n\n/**\n * Turns image bytes into RGBA pixels no larger than `size`.\n */\nexport type AmbientDecoder = (\n bytes: Uint8Array,\n size: number,\n) => Promise<AmbientPixels>;\n\n/**\n * Options for server-side palette extraction: fetching, limits, SSRF checks and\n * caching.\n */\nexport interface AmbientServerOptions {\n analysis?: Partial<AmbientAnalysisOptions>;\n allow?: (url: URL) => boolean;\n cache?: boolean;\n decode?: AmbientDecoder;\n fetch?: typeof fetch;\n init?: RequestInit;\n maxBytes?: number;\n resolve?: ((hostname: string) => Promise<string[]>) | false;\n timeoutMs?: number;\n}\n\nconst MAX_BYTES = 12 * 1024 * 1024;\nconst TIMEOUT_MS = 8_000;\nconst CACHE_LIMIT = 500;\nconst MAX_REDIRECTS = 5;\nconst REDIRECT_STATUS_MIN = 300;\nconst REDIRECT_STATUS_MAX = 400;\n\n/**\n * Whether a URL is plain http(s) without credentials and not on a private\n * hostname.\n */\nexport function isPublicImageUrl(url: URL): boolean {\n return (\n (url.protocol === \"https:\" || url.protocol === \"http:\") &&\n !url.username &&\n !url.password &&\n !isPrivateHostname(url.hostname)\n );\n}\n\nasync function lookupAll(hostname: string): Promise<string[]> {\n const { lookup } = await import(\"node:dns/promises\");\n return (await lookup(hostname, { all: true, verbatim: true })).map(\n (entry) => entry.address,\n );\n}\n\nasync function reachesOnlyPublic(\n url: URL,\n resolve: AmbientServerOptions[\"resolve\"],\n): Promise<boolean> {\n if (resolve === false) return true;\n const host = normalizeHost(url.hostname);\n try {\n const addresses = isIpLiteral(host)\n ? [host]\n : await (resolve ?? lookupAll)(host);\n return addresses.length > 0 && !addresses.some(isPrivateAddress);\n } catch {\n return false;\n }\n}\n\ntype SharpLike = (\n input: Uint8Array,\n options?: Record<string, unknown>,\n) => SharpPipeline;\ninterface SharpPipeline {\n ensureAlpha(): SharpPipeline;\n raw(): SharpPipeline;\n resize(\n width: number,\n height: number,\n options: Record<string, unknown>,\n ): SharpPipeline;\n rotate(): SharpPipeline;\n toBuffer(options: { resolveWithObject: true }): Promise<{\n data: Uint8Array;\n info: { height: number; width: number };\n }>;\n}\n\n/**\n * Thrown when no decoder is passed and `sharp` is not installed.\n */\nexport class AmbientDecoderMissingError extends Error {\n override name = \"AmbientDecoderMissingError\";\n}\n\nlet sharpModule: Promise<SharpLike> | null = null;\nconst SHARP = \"sharp\";\n\nfunction loadSharp(): Promise<SharpLike> {\n sharpModule ??= import(\n /* webpackIgnore: true */ /* turbopackIgnore: true */ SHARP\n )\n .then((mod: { default?: SharpLike }) => (mod.default ?? mod) as SharpLike)\n .catch((error: unknown) => {\n sharpModule = null;\n throw new AmbientDecoderMissingError(\n \"ambient/server: `sharp` is not installed. Install it or pass `decode`.\",\n { cause: error },\n );\n });\n return sharpModule;\n}\n\n/**\n * Default decoder, backed by `sharp`.\n */\nexport const sharpDecoder: AmbientDecoder = async (bytes, size) => {\n const sharp = await loadSharp();\n const { data, info } = await sharp(bytes, { failOn: \"none\" })\n .rotate()\n .resize(size, size, { fit: \"inside\", withoutEnlargement: true })\n .ensureAlpha()\n .raw()\n .toBuffer({ resolveWithObject: true });\n return { data, height: info.height, width: info.width };\n};\n\nasync function readLimited(\n response: Response,\n maxBytes: number,\n): Promise<Uint8Array> {\n const declared = Number(response.headers.get(\"content-length\"));\n if (declared > maxBytes) throw new Error(\"ambient/server: image too large\");\n if (!response.body) return new Uint8Array(await response.arrayBuffer());\n\n const reader = response.body.getReader();\n const chunks: Uint8Array[] = [];\n let length = 0;\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n length += value.byteLength;\n if (length > maxBytes) {\n await reader.cancel();\n throw new Error(\"ambient/server: image too large\");\n }\n chunks.push(value);\n }\n const bytes = new Uint8Array(length);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return bytes;\n}\n\n/**\n * Extracts a palette from encoded image bytes.\n */\nexport async function extractAmbientPaletteFromBytes(\n bytes: Uint8Array,\n options: Pick<AmbientServerOptions, \"analysis\" | \"decode\"> = {},\n): Promise<AmbientPalette> {\n const analysis = resolveAnalysis(options.analysis);\n const pixels = await (options.decode ?? sharpDecoder)(\n bytes,\n analysis.sampleSize,\n );\n return analyzeAmbientPixels(pixels, analysis);\n}\n\nconst cache = new Map<string, AmbientPalette>();\nconst inFlight = new Map<string, Promise<AmbientPalette | null>>();\n\nfunction remember(key: string, palette: AmbientPalette): void {\n cache.delete(key);\n while (cache.size >= CACHE_LIMIT) {\n const oldest = cache.keys().next().value;\n if (oldest === undefined) break;\n cache.delete(oldest);\n }\n cache.set(key, palette);\n}\n\nasync function fetchAndExtract(\n url: URL,\n options: AmbientServerOptions,\n): Promise<AmbientPalette | null> {\n const allow = options.allow ?? isPublicImageUrl;\n const doFetch = options.fetch ?? fetch;\n const signal = AbortSignal.timeout(options.timeoutMs ?? TIMEOUT_MS);\n\n let current = url;\n for (let hop = 0; hop <= MAX_REDIRECTS; hop++) {\n if (!allow(current)) return null;\n if (!(await reachesOnlyPublic(current, options.resolve))) return null;\n const response = await doFetch(current, {\n ...options.init,\n redirect: \"manual\",\n signal,\n });\n if (\n response.status >= REDIRECT_STATUS_MIN &&\n response.status < REDIRECT_STATUS_MAX\n ) {\n const location = response.headers.get(\"location\");\n await response.body?.cancel();\n if (!location) return null;\n current = new URL(location, current);\n continue;\n }\n if (!response.ok) return null;\n const type = response.headers.get(\"content-type\") ?? \"\";\n if (type && !type.toLowerCase().startsWith(\"image/\")) return null;\n const bytes = await readLimited(response, options.maxBytes ?? MAX_BYTES);\n const palette = await extractAmbientPaletteFromBytes(bytes, options);\n return { ...palette, source: url.href };\n }\n return null;\n}\n\n/**\n * Downloads an image and extracts its palette, or returns null when the URL is\n * unsafe or the download fails. Results are cached.\n */\nexport async function extractAmbientPalette(\n src: string | URL,\n options: AmbientServerOptions = {},\n): Promise<AmbientPalette | null> {\n let url: URL;\n try {\n url = new URL(src);\n } catch {\n return null;\n }\n const useCache = options.cache !== false;\n const key = options.analysis\n ? `${url.href}#${JSON.stringify(options.analysis)}`\n : url.href;\n if (useCache) {\n const hit = cache.get(key);\n if (hit) return hit;\n const pending = inFlight.get(key);\n if (pending) return pending;\n }\n\n const task = fetchAndExtract(url, options).catch((error: unknown) => {\n if (error instanceof AmbientDecoderMissingError) throw error;\n return null;\n });\n if (!useCache) return task;\n\n const shared = task\n .then((palette) => {\n if (palette) remember(key, palette);\n return palette;\n })\n .finally(() => inFlight.delete(key));\n inFlight.set(key, shared);\n return shared;\n}\n"]}
@@ -0,0 +1 @@
1
+ export * from "../../modules/ambient/worker/index.js";
@@ -0,0 +1,143 @@
1
+ import { analyzeAmbientPixels, fitSample } from '../../chunk-2LGI33JP.js';
2
+
3
+ // src/modules/ambient/pipeline.ts
4
+ async function fetchImageBlob(src, proxyUrl) {
5
+ if (typeof fetch !== "function") return null;
6
+ const read = async (url, init) => {
7
+ const response = await fetch(url, {
8
+ ...init,
9
+ mode: "cors"
10
+ });
11
+ if (!response.ok) return null;
12
+ const blob = await response.blob();
13
+ return blob.type.startsWith("text/") ? null : blob;
14
+ };
15
+ try {
16
+ const blob = await read(src);
17
+ if (blob) return blob;
18
+ } catch {
19
+ if (isCrossOrigin(src)) {
20
+ try {
21
+ const blob = await read(src, {
22
+ cache: "reload"
23
+ });
24
+ if (blob) return blob;
25
+ } catch {
26
+ }
27
+ }
28
+ }
29
+ if (proxyUrl) {
30
+ try {
31
+ return await read(proxyUrl);
32
+ } catch {
33
+ }
34
+ }
35
+ return null;
36
+ }
37
+ function isCrossOrigin(url) {
38
+ try {
39
+ return new URL(url).origin !== globalThis.location?.origin;
40
+ } catch {
41
+ return false;
42
+ }
43
+ }
44
+ function createContext2D(width, height) {
45
+ if (typeof OffscreenCanvas === "function") {
46
+ return new OffscreenCanvas(width, height).getContext("2d", {
47
+ willReadFrequently: true
48
+ });
49
+ }
50
+ if (typeof document !== "undefined") {
51
+ const canvas = document.createElement("canvas");
52
+ canvas.width = width;
53
+ canvas.height = height;
54
+ return canvas.getContext("2d", {
55
+ willReadFrequently: true
56
+ });
57
+ }
58
+ return null;
59
+ }
60
+ function readPixels(image, sourceWidth, sourceHeight, size) {
61
+ const {
62
+ height,
63
+ width
64
+ } = fitSample(sourceWidth, sourceHeight, size);
65
+ const context = createContext2D(width, height);
66
+ if (!context) return null;
67
+ context.drawImage(image, 0, 0, width, height);
68
+ return {
69
+ data: context.getImageData(0, 0, width, height).data,
70
+ height,
71
+ width
72
+ };
73
+ }
74
+ async function decodeBlob(blob, size) {
75
+ if (typeof createImageBitmap !== "function") return null;
76
+ let bitmap;
77
+ try {
78
+ bitmap = await createImageBitmap(blob, {
79
+ resizeQuality: "medium",
80
+ resizeWidth: size
81
+ });
82
+ } catch {
83
+ bitmap = await createImageBitmap(blob);
84
+ }
85
+ try {
86
+ return readPixels(bitmap, bitmap.width, bitmap.height, size);
87
+ } finally {
88
+ bitmap.close();
89
+ }
90
+ }
91
+ var canDecodeHere = () => typeof createImageBitmap === "function" && (typeof OffscreenCanvas === "function" || typeof document !== "undefined");
92
+ async function extractHere(request) {
93
+ if (!canDecodeHere()) return {
94
+ supported: false
95
+ };
96
+ const blob = await fetchImageBlob(request.src, request.proxyUrl);
97
+ if (!blob) return {
98
+ palette: null,
99
+ supported: true
100
+ };
101
+ try {
102
+ const pixels = await decodeBlob(blob, request.analysis.sampleSize);
103
+ return {
104
+ palette: pixels ? analyzeAmbientPixels(pixels, request.analysis) : null,
105
+ supported: true
106
+ };
107
+ } catch {
108
+ return {
109
+ palette: null,
110
+ supported: true
111
+ };
112
+ }
113
+ }
114
+
115
+ // src/modules/ambient/worker/index.ts
116
+ var AMBIENT_WORKER_REQUEST = "ambient:extract";
117
+ var AMBIENT_WORKER_RESPONSE = "ambient:palette";
118
+ function serveAmbientWorker(scope = globalThis) {
119
+ const onMessage = async (event) => {
120
+ const request = event.data;
121
+ if (request?.type !== AMBIENT_WORKER_REQUEST) return;
122
+ let result;
123
+ try {
124
+ result = await extractHere(request);
125
+ } catch {
126
+ result = {
127
+ palette: null,
128
+ supported: true
129
+ };
130
+ }
131
+ scope.postMessage({
132
+ ...result,
133
+ id: request.id,
134
+ type: AMBIENT_WORKER_RESPONSE
135
+ });
136
+ };
137
+ scope.addEventListener("message", onMessage);
138
+ return () => scope.removeEventListener("message", onMessage);
139
+ }
140
+
141
+ export { AMBIENT_WORKER_REQUEST, AMBIENT_WORKER_RESPONSE, serveAmbientWorker };
142
+ //# sourceMappingURL=index.js.map
143
+ //# sourceMappingURL=index.js.map