@omerdlw/base-framework 3.0.1 → 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 (1132) 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 -10
  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 +9 -49
  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 +23 -12
  246. package/dist/modules/ambient/dom.d.ts.map +1 -1
  247. package/dist/modules/ambient/extractor.d.ts +6 -4
  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/index.d.ts +2 -2
  252. package/dist/modules/ambient/index.d.ts.map +1 -1
  253. package/dist/modules/ambient/module.d.ts +12 -1
  254. package/dist/modules/ambient/module.d.ts.map +1 -1
  255. package/dist/modules/ambient/oklab.d.ts +18 -13
  256. package/dist/modules/ambient/oklab.d.ts.map +1 -1
  257. package/dist/modules/ambient/pipeline.d.ts +0 -7
  258. package/dist/modules/ambient/pipeline.d.ts.map +1 -1
  259. package/dist/modules/ambient/quantize.d.ts +2 -9
  260. package/dist/modules/ambient/quantize.d.ts.map +1 -1
  261. package/dist/modules/ambient/server/address.d.ts +8 -3
  262. package/dist/modules/ambient/server/address.d.ts.map +1 -1
  263. package/dist/modules/ambient/server/index.d.ts +20 -23
  264. package/dist/modules/ambient/server/index.d.ts.map +1 -1
  265. package/dist/modules/ambient/settings.d.ts +23 -3
  266. package/dist/modules/ambient/settings.d.ts.map +1 -1
  267. package/dist/modules/ambient/types.d.ts +98 -36
  268. package/dist/modules/ambient/types.d.ts.map +1 -1
  269. package/dist/modules/ambient/worker/index.d.ts +16 -1
  270. package/dist/modules/ambient/worker/index.d.ts.map +1 -1
  271. package/dist/modules/background/components/background-gradients.d.ts +8 -0
  272. package/dist/modules/background/components/background-gradients.d.ts.map +1 -0
  273. package/dist/modules/background/components/edge-gradient.d.ts +9 -0
  274. package/dist/modules/background/components/edge-gradient.d.ts.map +1 -0
  275. package/dist/modules/background/components/native-video.d.ts +4 -0
  276. package/dist/modules/background/components/native-video.d.ts.map +1 -0
  277. package/dist/modules/background/components/noise-overlay.d.ts +11 -0
  278. package/dist/modules/background/components/noise-overlay.d.ts.map +1 -0
  279. package/dist/modules/background/components/overlay.d.ts +6 -0
  280. package/dist/modules/background/components/overlay.d.ts.map +1 -0
  281. package/dist/modules/background/components/solid-overlay.d.ts +10 -0
  282. package/dist/modules/background/components/solid-overlay.d.ts.map +1 -0
  283. package/dist/modules/background/constants.d.ts +14 -1
  284. package/dist/modules/background/constants.d.ts.map +1 -1
  285. package/dist/modules/background/context.d.ts +7 -0
  286. package/dist/modules/background/context.d.ts.map +1 -1
  287. package/dist/modules/background/hooks/use-background-media-source.d.ts +4 -0
  288. package/dist/modules/background/hooks/use-background-media-source.d.ts.map +1 -0
  289. package/dist/modules/background/hooks/use-background-motion-model.d.ts +15 -0
  290. package/dist/modules/background/hooks/use-background-motion-model.d.ts.map +1 -0
  291. package/dist/modules/background/hooks/use-background-overlay-model.d.ts +929 -0
  292. package/dist/modules/background/hooks/use-background-overlay-model.d.ts.map +1 -0
  293. package/dist/modules/background/hooks/use-native-video-model.d.ts +22 -0
  294. package/dist/modules/background/hooks/use-native-video-model.d.ts.map +1 -0
  295. package/dist/modules/background/hooks.d.ts +20 -1
  296. package/dist/modules/background/hooks.d.ts.map +1 -1
  297. package/dist/modules/background/index.d.ts +7 -7
  298. package/dist/modules/background/index.d.ts.map +1 -1
  299. package/dist/modules/background/lib/theme.d.ts +4 -0
  300. package/dist/modules/background/lib/theme.d.ts.map +1 -0
  301. package/dist/modules/background/model/override.d.ts +14 -0
  302. package/dist/modules/background/model/override.d.ts.map +1 -0
  303. package/dist/modules/background/model/playback.d.ts +25 -0
  304. package/dist/modules/background/model/playback.d.ts.map +1 -0
  305. package/dist/modules/background/model/state.d.ts +31 -0
  306. package/dist/modules/background/model/state.d.ts.map +1 -0
  307. package/dist/modules/background/model/video-frame.d.ts +31 -0
  308. package/dist/modules/background/model/video-frame.d.ts.map +1 -0
  309. package/dist/modules/background/model/visual.d.ts +932 -0
  310. package/dist/modules/background/model/visual.d.ts.map +1 -0
  311. package/dist/modules/background/module.d.ts +11 -0
  312. package/dist/modules/background/module.d.ts.map +1 -1
  313. package/dist/modules/background/motion.d.ts.map +1 -1
  314. package/dist/modules/background/types.d.ts +66 -10
  315. package/dist/modules/background/types.d.ts.map +1 -1
  316. package/dist/modules/background/youtube/components/player.d.ts +7 -0
  317. package/dist/modules/background/youtube/components/player.d.ts.map +1 -0
  318. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts +27 -0
  319. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts.map +1 -0
  320. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts +20 -0
  321. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts.map +1 -0
  322. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts +8 -0
  323. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts.map +1 -0
  324. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts +16 -0
  325. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts.map +1 -0
  326. package/dist/modules/background/youtube/lib/audio.d.ts +17 -0
  327. package/dist/modules/background/youtube/lib/audio.d.ts.map +1 -0
  328. package/dist/modules/background/youtube/lib/iframe-engine.d.ts +29 -0
  329. package/dist/modules/background/youtube/lib/iframe-engine.d.ts.map +1 -0
  330. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts +47 -0
  331. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts.map +1 -0
  332. package/dist/modules/background/youtube/lib/iframe.d.ts +47 -0
  333. package/dist/modules/background/youtube/lib/iframe.d.ts.map +1 -0
  334. package/dist/modules/background/youtube/lib/parse.d.ts +36 -0
  335. package/dist/modules/background/youtube/lib/parse.d.ts.map +1 -0
  336. package/dist/modules/background/youtube/lib/timing.d.ts +11 -0
  337. package/dist/modules/background/youtube/lib/timing.d.ts.map +1 -0
  338. package/dist/modules/background/youtube/lib/video-events.d.ts +53 -0
  339. package/dist/modules/background/youtube/lib/video-events.d.ts.map +1 -0
  340. package/dist/modules/context-menu/constants.d.ts +30 -1
  341. package/dist/modules/context-menu/constants.d.ts.map +1 -1
  342. package/dist/modules/context-menu/context.d.ts +10 -2
  343. package/dist/modules/context-menu/context.d.ts.map +1 -1
  344. package/dist/modules/context-menu/dom.d.ts +13 -0
  345. package/dist/modules/context-menu/dom.d.ts.map +1 -1
  346. package/dist/modules/context-menu/hooks.d.ts +32 -5
  347. package/dist/modules/context-menu/hooks.d.ts.map +1 -1
  348. package/dist/modules/context-menu/index.d.ts +1 -1
  349. package/dist/modules/context-menu/index.d.ts.map +1 -1
  350. package/dist/modules/context-menu/items.d.ts +25 -0
  351. package/dist/modules/context-menu/items.d.ts.map +1 -1
  352. package/dist/modules/context-menu/module.d.ts +6 -0
  353. package/dist/modules/context-menu/module.d.ts.map +1 -1
  354. package/dist/modules/context-menu/motion.d.ts.map +1 -1
  355. package/dist/modules/context-menu/overlay.d.ts +30 -8
  356. package/dist/modules/context-menu/overlay.d.ts.map +1 -1
  357. package/dist/modules/context-menu/resolver.d.ts +8 -0
  358. package/dist/modules/context-menu/resolver.d.ts.map +1 -1
  359. package/dist/modules/context-menu/state.d.ts +9 -0
  360. package/dist/modules/context-menu/state.d.ts.map +1 -1
  361. package/dist/modules/context-menu/types.d.ts +85 -9
  362. package/dist/modules/context-menu/types.d.ts.map +1 -1
  363. package/dist/modules/controls/constants.d.ts +18 -1
  364. package/dist/modules/controls/constants.d.ts.map +1 -1
  365. package/dist/modules/controls/entries.d.ts +23 -1
  366. package/dist/modules/controls/entries.d.ts.map +1 -1
  367. package/dist/modules/controls/hooks.d.ts +11 -1
  368. package/dist/modules/controls/hooks.d.ts.map +1 -1
  369. package/dist/modules/controls/layout.d.ts +17 -0
  370. package/dist/modules/controls/layout.d.ts.map +1 -1
  371. package/dist/modules/controls/module.d.ts +7 -1
  372. package/dist/modules/controls/module.d.ts.map +1 -1
  373. package/dist/modules/controls/overlay.d.ts +11 -1
  374. package/dist/modules/controls/overlay.d.ts.map +1 -1
  375. package/dist/modules/controls/types.d.ts +51 -2
  376. package/dist/modules/controls/types.d.ts.map +1 -1
  377. package/dist/modules/dock/components/badge.d.ts +5 -0
  378. package/dist/modules/dock/components/badge.d.ts.map +1 -0
  379. package/dist/modules/dock/components/breadcrumbs-card.d.ts +6 -0
  380. package/dist/modules/dock/components/breadcrumbs-card.d.ts.map +1 -0
  381. package/dist/modules/dock/components/card-banner.d.ts +4 -0
  382. package/dist/modules/dock/components/card-banner.d.ts.map +1 -0
  383. package/dist/modules/dock/components/card-header.d.ts +4 -0
  384. package/dist/modules/dock/components/card-header.d.ts.map +1 -0
  385. package/dist/modules/dock/components/card-item.d.ts +3 -0
  386. package/dist/modules/dock/components/card-item.d.ts.map +1 -0
  387. package/dist/modules/dock/components/command-bar.d.ts +7 -0
  388. package/dist/modules/dock/components/command-bar.d.ts.map +1 -0
  389. package/dist/modules/dock/components/description.d.ts +4 -0
  390. package/dist/modules/dock/components/description.d.ts.map +1 -0
  391. package/dist/modules/dock/components/dock.d.ts +4 -0
  392. package/dist/modules/dock/components/dock.d.ts.map +1 -0
  393. package/dist/modules/dock/components/hud-view.d.ts +7 -0
  394. package/dist/modules/dock/components/hud-view.d.ts.map +1 -0
  395. package/dist/modules/dock/components/icon.d.ts +6 -0
  396. package/dist/modules/dock/components/icon.d.ts.map +1 -0
  397. package/dist/modules/dock/components/item-content.d.ts +4 -0
  398. package/dist/modules/dock/components/item-content.d.ts.map +1 -0
  399. package/dist/modules/dock/components/media-action.d.ts +4 -0
  400. package/dist/modules/dock/components/media-action.d.ts.map +1 -0
  401. package/dist/modules/dock/components/media-controls.d.ts +4 -0
  402. package/dist/modules/dock/components/media-controls.d.ts.map +1 -0
  403. package/dist/modules/dock/components/media-scrubber.d.ts +5 -0
  404. package/dist/modules/dock/components/media-scrubber.d.ts.map +1 -0
  405. package/dist/modules/dock/components/status-actions.d.ts +10 -0
  406. package/dist/modules/dock/components/status-actions.d.ts.map +1 -0
  407. package/dist/modules/dock/components/surface/action.d.ts +17 -0
  408. package/dist/modules/dock/components/surface/action.d.ts.map +1 -0
  409. package/dist/modules/dock/components/surface/controls.d.ts +12 -0
  410. package/dist/modules/dock/components/surface/controls.d.ts.map +1 -0
  411. package/dist/modules/dock/components/surface/extensions-bar.d.ts +5 -0
  412. package/dist/modules/dock/components/surface/extensions-bar.d.ts.map +1 -0
  413. package/dist/modules/dock/components/surface/header-button.d.ts +14 -0
  414. package/dist/modules/dock/components/surface/header-button.d.ts.map +1 -0
  415. package/dist/modules/dock/components/surface/item-content.d.ts +6 -0
  416. package/dist/modules/dock/components/surface/item-content.d.ts.map +1 -0
  417. package/dist/modules/dock/components/surface/shell.d.ts +3 -0
  418. package/dist/modules/dock/components/surface/shell.d.ts.map +1 -0
  419. package/dist/modules/dock/components/title.d.ts +4 -0
  420. package/dist/modules/dock/components/title.d.ts.map +1 -0
  421. package/dist/modules/dock/constants.d.ts +11 -2
  422. package/dist/modules/dock/constants.d.ts.map +1 -1
  423. package/dist/modules/dock/context.d.ts +8 -2
  424. package/dist/modules/dock/context.d.ts.map +1 -1
  425. package/dist/modules/dock/hooks/use-action-slot.d.ts +6 -0
  426. package/dist/modules/dock/hooks/use-action-slot.d.ts.map +1 -0
  427. package/dist/modules/dock/hooks/use-badge.d.ts +4 -0
  428. package/dist/modules/dock/hooks/use-badge.d.ts.map +1 -0
  429. package/dist/modules/dock/hooks/use-card-banner-model.d.ts +18 -0
  430. package/dist/modules/dock/hooks/use-card-banner-model.d.ts.map +1 -0
  431. package/dist/modules/dock/hooks/use-card-header-model.d.ts +7 -0
  432. package/dist/modules/dock/hooks/use-card-header-model.d.ts.map +1 -0
  433. package/dist/modules/dock/hooks/use-card-item-model.d.ts +1612 -0
  434. package/dist/modules/dock/hooks/use-card-item-model.d.ts.map +1 -0
  435. package/dist/modules/dock/hooks/use-command-bar-model.d.ts +12 -0
  436. package/dist/modules/dock/hooks/use-command-bar-model.d.ts.map +1 -0
  437. package/dist/modules/dock/hooks/use-dock-banner.d.ts +11 -0
  438. package/dist/modules/dock/hooks/use-dock-banner.d.ts.map +1 -0
  439. package/dist/modules/dock/hooks/use-dock-config.d.ts +19 -0
  440. package/dist/modules/dock/hooks/use-dock-config.d.ts.map +1 -0
  441. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts +7 -0
  442. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts.map +1 -0
  443. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts +7 -0
  444. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts.map +1 -0
  445. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +6 -0
  446. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +1 -0
  447. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts +11 -0
  448. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts.map +1 -0
  449. package/dist/modules/dock/hooks/use-dock-registration.d.ts +8 -0
  450. package/dist/modules/dock/hooks/use-dock-registration.d.ts.map +1 -0
  451. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts +2 -0
  452. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts.map +1 -0
  453. package/dist/modules/dock/hooks/use-dock-theme.d.ts +6 -0
  454. package/dist/modules/dock/hooks/use-dock-theme.d.ts.map +1 -0
  455. package/dist/modules/dock/hooks/use-dock-viewport.d.ts +6 -0
  456. package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +1 -0
  457. package/dist/modules/dock/hooks/use-element-height.d.ts +3 -0
  458. package/dist/modules/dock/hooks/use-element-height.d.ts.map +1 -0
  459. package/dist/modules/dock/hooks/use-hud-registry.d.ts +16 -0
  460. package/dist/modules/dock/hooks/use-hud-registry.d.ts.map +1 -0
  461. package/dist/modules/dock/hooks/use-hud-view-model.d.ts +9 -0
  462. package/dist/modules/dock/hooks/use-hud-view-model.d.ts.map +1 -0
  463. package/dist/modules/dock/hooks/use-media-controls-model.d.ts +27 -0
  464. package/dist/modules/dock/hooks/use-media-controls-model.d.ts.map +1 -0
  465. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts +27 -0
  466. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts.map +1 -0
  467. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts +12 -0
  468. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts.map +1 -0
  469. package/dist/modules/dock/hooks/use-surface-return.d.ts +8 -0
  470. package/dist/modules/dock/hooks/use-surface-return.d.ts.map +1 -0
  471. package/dist/modules/dock/hud.d.ts +8 -34
  472. package/dist/modules/dock/hud.d.ts.map +1 -1
  473. package/dist/modules/dock/index.d.ts +18 -12
  474. package/dist/modules/dock/index.d.ts.map +1 -1
  475. package/dist/modules/dock/lib/banner.d.ts +43 -0
  476. package/dist/modules/dock/lib/banner.d.ts.map +1 -0
  477. package/dist/modules/dock/lib/card-item.d.ts +46 -0
  478. package/dist/modules/dock/lib/card-item.d.ts.map +1 -0
  479. package/dist/modules/dock/lib/card.d.ts +20 -0
  480. package/dist/modules/dock/lib/card.d.ts.map +1 -0
  481. package/dist/modules/dock/lib/command-bar.d.ts +8 -0
  482. package/dist/modules/dock/lib/command-bar.d.ts.map +1 -0
  483. package/dist/modules/dock/lib/dom.d.ts +7 -0
  484. package/dist/modules/dock/lib/dom.d.ts.map +1 -0
  485. package/dist/modules/dock/lib/element-helpers.d.ts +8 -0
  486. package/dist/modules/dock/lib/element-helpers.d.ts.map +1 -0
  487. package/dist/modules/dock/lib/helpers.d.ts +19 -0
  488. package/dist/modules/dock/lib/helpers.d.ts.map +1 -0
  489. package/dist/modules/dock/lib/media.d.ts +35 -0
  490. package/dist/modules/dock/lib/media.d.ts.map +1 -0
  491. package/dist/modules/dock/lib/styles.d.ts +902 -0
  492. package/dist/modules/dock/lib/styles.d.ts.map +1 -0
  493. package/dist/modules/dock/model/hud-definition.d.ts +13 -0
  494. package/dist/modules/dock/model/hud-definition.d.ts.map +1 -0
  495. package/dist/modules/dock/model/hud.d.ts +10 -0
  496. package/dist/modules/dock/model/hud.d.ts.map +1 -0
  497. package/dist/modules/dock/model/layout.d.ts +28 -0
  498. package/dist/modules/dock/model/layout.d.ts.map +1 -0
  499. package/dist/modules/dock/model/page-entry.d.ts +11 -0
  500. package/dist/modules/dock/model/page-entry.d.ts.map +1 -0
  501. package/dist/modules/dock/model/page-surface.d.ts +4 -0
  502. package/dist/modules/dock/model/page-surface.d.ts.map +1 -0
  503. package/dist/modules/dock/model/paths.d.ts +15 -0
  504. package/dist/modules/dock/model/paths.d.ts.map +1 -0
  505. package/dist/modules/dock/model/state.d.ts +28 -0
  506. package/dist/modules/dock/model/state.d.ts.map +1 -0
  507. package/dist/modules/dock/model/surface-return.d.ts +14 -0
  508. package/dist/modules/dock/model/surface-return.d.ts.map +1 -0
  509. package/dist/modules/dock/module.d.ts +5 -7
  510. package/dist/modules/dock/module.d.ts.map +1 -1
  511. package/dist/modules/dock/motion.d.ts +716 -11
  512. package/dist/modules/dock/motion.d.ts.map +1 -1
  513. package/dist/modules/dock/provider.d.ts +2 -1
  514. package/dist/modules/dock/provider.d.ts.map +1 -1
  515. package/dist/modules/dock/routing/breadcrumbs.d.ts +6 -2
  516. package/dist/modules/dock/routing/breadcrumbs.d.ts.map +1 -1
  517. package/dist/modules/dock/routing/continuity.d.ts +46 -14
  518. package/dist/modules/dock/routing/continuity.d.ts.map +1 -1
  519. package/dist/modules/dock/routing/guards.d.ts +10 -1
  520. package/dist/modules/dock/routing/guards.d.ts.map +1 -1
  521. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts +12 -0
  522. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts.map +1 -0
  523. package/dist/modules/dock/routing/lib/restore.d.ts +7 -0
  524. package/dist/modules/dock/routing/lib/restore.d.ts.map +1 -0
  525. package/dist/modules/dock/routing/model/continuity.d.ts +21 -0
  526. package/dist/modules/dock/routing/model/continuity.d.ts.map +1 -0
  527. package/dist/modules/dock/routing/model/policy.d.ts +7 -0
  528. package/dist/modules/dock/routing/model/policy.d.ts.map +1 -0
  529. package/dist/modules/dock/routing/model/topology.d.ts +5 -0
  530. package/dist/modules/dock/routing/model/topology.d.ts.map +1 -0
  531. package/dist/modules/dock/routing/navigation.d.ts +10 -23
  532. package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
  533. package/dist/modules/dock/runtime/commands.d.ts +10 -1
  534. package/dist/modules/dock/runtime/commands.d.ts.map +1 -1
  535. package/dist/modules/dock/runtime/display.d.ts +9 -48
  536. package/dist/modules/dock/runtime/display.d.ts.map +1 -1
  537. package/dist/modules/dock/runtime/dock.d.ts +11 -70
  538. package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
  539. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts +10 -0
  540. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts.map +1 -0
  541. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts +10 -0
  542. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts.map +1 -0
  543. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts +14 -0
  544. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts.map +1 -0
  545. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts +7 -0
  546. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts.map +1 -0
  547. package/dist/modules/dock/runtime/hooks/use-dock.d.ts +30 -0
  548. package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +1 -0
  549. package/dist/modules/dock/runtime/model/attention.d.ts +25 -0
  550. package/dist/modules/dock/runtime/model/attention.d.ts.map +1 -0
  551. package/dist/modules/dock/runtime/model/cards.d.ts +64 -0
  552. package/dist/modules/dock/runtime/model/cards.d.ts.map +1 -0
  553. package/dist/modules/dock/runtime/model/items.d.ts +31 -0
  554. package/dist/modules/dock/runtime/model/items.d.ts.map +1 -0
  555. package/dist/modules/dock/runtime/model/layout.d.ts +10 -0
  556. package/dist/modules/dock/runtime/model/layout.d.ts.map +1 -0
  557. package/dist/modules/dock/runtime/pipeline.d.ts +1 -1
  558. package/dist/modules/dock/runtime/pipeline.d.ts.map +1 -1
  559. package/dist/modules/dock/runtime/provider-actions.d.ts +38 -0
  560. package/dist/modules/dock/runtime/provider-actions.d.ts.map +1 -0
  561. package/dist/modules/dock/status/action-options.d.ts +35 -0
  562. package/dist/modules/dock/status/action-options.d.ts.map +1 -0
  563. package/dist/modules/dock/status/events.d.ts +2 -2
  564. package/dist/modules/dock/status/events.d.ts.map +1 -1
  565. package/dist/modules/dock/status/hooks.d.ts +1 -1
  566. package/dist/modules/dock/status/hooks.d.ts.map +1 -1
  567. package/dist/modules/dock/status/model.d.ts +12 -32
  568. package/dist/modules/dock/status/model.d.ts.map +1 -1
  569. package/dist/modules/dock/status/state.d.ts +12 -0
  570. package/dist/modules/dock/status/state.d.ts.map +1 -0
  571. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts +5 -0
  572. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts.map +1 -0
  573. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts +7 -0
  574. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts.map +1 -0
  575. package/dist/modules/dock/surface/constants.d.ts +5 -0
  576. package/dist/modules/dock/surface/constants.d.ts.map +1 -0
  577. package/dist/modules/dock/surface/context.d.ts +14 -1
  578. package/dist/modules/dock/surface/context.d.ts.map +1 -1
  579. package/dist/modules/dock/surface/definition.d.ts +28 -2
  580. package/dist/modules/dock/surface/definition.d.ts.map +1 -1
  581. package/dist/modules/dock/surface/helpers.d.ts +2 -1
  582. package/dist/modules/dock/surface/helpers.d.ts.map +1 -1
  583. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts +15 -0
  584. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts.map +1 -0
  585. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts +7 -0
  586. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts.map +1 -0
  587. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts +14 -0
  588. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts.map +1 -0
  589. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts +20 -0
  590. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts.map +1 -0
  591. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts +13 -0
  592. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts.map +1 -0
  593. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts +28 -0
  594. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts.map +1 -0
  595. package/dist/modules/dock/surface/lib/drag.d.ts +9 -0
  596. package/dist/modules/dock/surface/lib/drag.d.ts.map +1 -0
  597. package/dist/modules/dock/surface/lib/target.d.ts +8 -0
  598. package/dist/modules/dock/surface/lib/target.d.ts.map +1 -0
  599. package/dist/modules/dock/surface/machine.d.ts +17 -62
  600. package/dist/modules/dock/surface/machine.d.ts.map +1 -1
  601. package/dist/modules/dock/surface/model/builder.d.ts +39 -0
  602. package/dist/modules/dock/surface/model/builder.d.ts.map +1 -0
  603. package/dist/modules/dock/surface/model/normalize.d.ts +13 -0
  604. package/dist/modules/dock/surface/model/normalize.d.ts.map +1 -0
  605. package/dist/modules/dock/surface/model/open.d.ts +26 -0
  606. package/dist/modules/dock/surface/model/open.d.ts.map +1 -0
  607. package/dist/modules/dock/surface/model/records.d.ts +45 -0
  608. package/dist/modules/dock/surface/model/records.d.ts.map +1 -0
  609. package/dist/modules/dock/surface/model/steps.d.ts +9 -0
  610. package/dist/modules/dock/surface/model/steps.d.ts.map +1 -0
  611. package/dist/modules/dock/surface/model/transition-state.d.ts +23 -0
  612. package/dist/modules/dock/surface/model/transition-state.d.ts.map +1 -0
  613. package/dist/modules/dock/surface/model/url.d.ts +14 -0
  614. package/dist/modules/dock/surface/model/url.d.ts.map +1 -0
  615. package/dist/modules/dock/surface/runtime/choreography.d.ts +22 -0
  616. package/dist/modules/dock/surface/runtime/choreography.d.ts.map +1 -0
  617. package/dist/modules/dock/surface/runtime/context.d.ts +29 -0
  618. package/dist/modules/dock/surface/runtime/context.d.ts.map +1 -0
  619. package/dist/modules/dock/surface/runtime/flows.d.ts +21 -0
  620. package/dist/modules/dock/surface/runtime/flows.d.ts.map +1 -0
  621. package/dist/modules/dock/surface/runtime/open.d.ts +6 -0
  622. package/dist/modules/dock/surface/runtime/open.d.ts.map +1 -0
  623. package/dist/modules/dock/surface/runtime/release.d.ts +9 -0
  624. package/dist/modules/dock/surface/runtime/release.d.ts.map +1 -0
  625. package/dist/modules/dock/surface/runtime/steps.d.ts +10 -0
  626. package/dist/modules/dock/surface/runtime/steps.d.ts.map +1 -0
  627. package/dist/modules/dock/surface/stack.d.ts +20 -11
  628. package/dist/modules/dock/surface/stack.d.ts.map +1 -1
  629. package/dist/modules/dock/surface/view-model.d.ts +5 -1
  630. package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
  631. package/dist/modules/dock/types/card.d.ts +297 -0
  632. package/dist/modules/dock/types/card.d.ts.map +1 -0
  633. package/dist/modules/dock/types/hud.d.ts +142 -0
  634. package/dist/modules/dock/types/hud.d.ts.map +1 -0
  635. package/dist/modules/dock/types/index.d.ts +8 -0
  636. package/dist/modules/dock/types/index.d.ts.map +1 -0
  637. package/dist/modules/dock/types/media.d.ts +66 -0
  638. package/dist/modules/dock/types/media.d.ts.map +1 -0
  639. package/dist/modules/dock/types/routing.d.ts +336 -0
  640. package/dist/modules/dock/types/routing.d.ts.map +1 -0
  641. package/dist/modules/dock/types/surface-flow.d.ts +231 -0
  642. package/dist/modules/dock/types/surface-flow.d.ts.map +1 -0
  643. package/dist/modules/dock/types/surface.d.ts +194 -0
  644. package/dist/modules/dock/types/surface.d.ts.map +1 -0
  645. package/dist/modules/dock/types/theme.d.ts +201 -0
  646. package/dist/modules/dock/types/theme.d.ts.map +1 -0
  647. package/dist/modules/index.d.ts +4 -0
  648. package/dist/modules/index.d.ts.map +1 -1
  649. package/dist/modules/index.js +23 -18
  650. package/dist/modules/loading/constants.d.ts +18 -1
  651. package/dist/modules/loading/constants.d.ts.map +1 -1
  652. package/dist/modules/loading/context.d.ts +11 -1
  653. package/dist/modules/loading/context.d.ts.map +1 -1
  654. package/dist/modules/loading/hooks.d.ts +24 -1
  655. package/dist/modules/loading/hooks.d.ts.map +1 -1
  656. package/dist/modules/loading/index.d.ts +1 -1
  657. package/dist/modules/loading/index.d.ts.map +1 -1
  658. package/dist/modules/loading/module.d.ts +6 -0
  659. package/dist/modules/loading/module.d.ts.map +1 -1
  660. package/dist/modules/loading/overlay.d.ts +3 -0
  661. package/dist/modules/loading/overlay.d.ts.map +1 -1
  662. package/dist/modules/loading/state.d.ts +13 -0
  663. package/dist/modules/loading/state.d.ts.map +1 -1
  664. package/dist/modules/loading/types.d.ts +42 -2
  665. package/dist/modules/loading/types.d.ts.map +1 -1
  666. package/dist/modules/media/constants.d.ts +19 -0
  667. package/dist/modules/media/constants.d.ts.map +1 -1
  668. package/dist/modules/media/context.d.ts +11 -1
  669. package/dist/modules/media/context.d.ts.map +1 -1
  670. package/dist/modules/media/hooks.d.ts +17 -0
  671. package/dist/modules/media/hooks.d.ts.map +1 -1
  672. package/dist/modules/media/index.d.ts +1 -1
  673. package/dist/modules/media/index.d.ts.map +1 -1
  674. package/dist/modules/media/module.d.ts +4 -0
  675. package/dist/modules/media/module.d.ts.map +1 -1
  676. package/dist/modules/media/overlay.d.ts +7 -0
  677. package/dist/modules/media/overlay.d.ts.map +1 -1
  678. package/dist/modules/media/playback.d.ts +13 -0
  679. package/dist/modules/media/playback.d.ts.map +1 -1
  680. package/dist/modules/media/session.d.ts +20 -0
  681. package/dist/modules/media/session.d.ts.map +1 -1
  682. package/dist/modules/media/types.d.ts +49 -2
  683. package/dist/modules/media/types.d.ts.map +1 -1
  684. package/dist/modules/modal/components/close-button.d.ts +6 -0
  685. package/dist/modules/modal/components/close-button.d.ts.map +1 -0
  686. package/dist/modules/modal/components/modal-container.d.ts +7 -0
  687. package/dist/modules/modal/components/modal-container.d.ts.map +1 -0
  688. package/dist/modules/modal/components/modal-layer-switcher.d.ts +9 -0
  689. package/dist/modules/modal/components/modal-layer-switcher.d.ts.map +1 -0
  690. package/dist/modules/modal/components/modal-layer.d.ts +17 -0
  691. package/dist/modules/modal/components/modal-layer.d.ts.map +1 -0
  692. package/dist/modules/modal/components/overlay.d.ts +6 -0
  693. package/dist/modules/modal/components/overlay.d.ts.map +1 -0
  694. package/dist/modules/modal/components/resolve-header.d.ts +10 -0
  695. package/dist/modules/modal/components/resolve-header.d.ts.map +1 -0
  696. package/dist/modules/modal/components/slot-row.d.ts +12 -0
  697. package/dist/modules/modal/components/slot-row.d.ts.map +1 -0
  698. package/dist/modules/modal/constants.d.ts +16 -1
  699. package/dist/modules/modal/constants.d.ts.map +1 -1
  700. package/dist/modules/modal/context.d.ts +7 -1
  701. package/dist/modules/modal/context.d.ts.map +1 -1
  702. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts +3 -0
  703. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts.map +1 -0
  704. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts +12 -0
  705. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts.map +1 -0
  706. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts +3 -0
  707. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts.map +1 -0
  708. package/dist/modules/modal/hooks.d.ts +30 -4
  709. package/dist/modules/modal/hooks.d.ts.map +1 -1
  710. package/dist/modules/modal/index.d.ts +8 -7
  711. package/dist/modules/modal/index.d.ts.map +1 -1
  712. package/dist/modules/modal/lib/dom.d.ts +13 -0
  713. package/dist/modules/modal/lib/dom.d.ts.map +1 -0
  714. package/dist/modules/modal/lib/theme.d.ts +4 -0
  715. package/dist/modules/modal/lib/theme.d.ts.map +1 -0
  716. package/dist/modules/modal/model/entry.d.ts +18 -0
  717. package/dist/modules/modal/model/entry.d.ts.map +1 -0
  718. package/dist/modules/modal/model/header.d.ts +16 -0
  719. package/dist/modules/modal/model/header.d.ts.map +1 -0
  720. package/dist/modules/modal/model/identity.d.ts +13 -0
  721. package/dist/modules/modal/model/identity.d.ts.map +1 -0
  722. package/dist/modules/modal/model/layout.d.ts +37 -0
  723. package/dist/modules/modal/model/layout.d.ts.map +1 -0
  724. package/dist/modules/modal/model/state.d.ts +10 -0
  725. package/dist/modules/modal/model/state.d.ts.map +1 -0
  726. package/dist/modules/modal/module.d.ts +7 -0
  727. package/dist/modules/modal/module.d.ts.map +1 -1
  728. package/dist/modules/modal/motion.d.ts.map +1 -1
  729. package/dist/modules/modal/types.d.ts +73 -10
  730. package/dist/modules/modal/types.d.ts.map +1 -1
  731. package/dist/modules/navigation/context.d.ts +16 -5
  732. package/dist/modules/navigation/context.d.ts.map +1 -1
  733. package/dist/modules/navigation/hooks.d.ts +22 -13
  734. package/dist/modules/navigation/hooks.d.ts.map +1 -1
  735. package/dist/modules/navigation/index.d.ts +5 -5
  736. package/dist/modules/navigation/index.d.ts.map +1 -1
  737. package/dist/modules/navigation/listeners.d.ts +6 -8
  738. package/dist/modules/navigation/listeners.d.ts.map +1 -1
  739. package/dist/modules/navigation/module.d.ts +5 -2
  740. package/dist/modules/navigation/module.d.ts.map +1 -1
  741. package/dist/modules/notification/constants.d.ts +22 -2
  742. package/dist/modules/notification/constants.d.ts.map +1 -1
  743. package/dist/modules/notification/context.d.ts +12 -2
  744. package/dist/modules/notification/context.d.ts.map +1 -1
  745. package/dist/modules/notification/hooks.d.ts +32 -1
  746. package/dist/modules/notification/hooks.d.ts.map +1 -1
  747. package/dist/modules/notification/module.d.ts +3 -0
  748. package/dist/modules/notification/module.d.ts.map +1 -1
  749. package/dist/modules/notification/motion.d.ts.map +1 -1
  750. package/dist/modules/notification/overlay.d.ts.map +1 -1
  751. package/dist/modules/notification/state.d.ts +28 -0
  752. package/dist/modules/notification/state.d.ts.map +1 -1
  753. package/dist/modules/notification/types.d.ts +48 -5
  754. package/dist/modules/notification/types.d.ts.map +1 -1
  755. package/dist/navigation/index.d.ts +1 -0
  756. package/dist/navigation/index.js +189 -0
  757. package/dist/navigation/index.js.map +1 -0
  758. package/dist/notification/index.d.ts +1 -0
  759. package/dist/notification/index.js +11 -0
  760. package/dist/overlay-QHSJBV3O.js +13 -0
  761. package/dist/overlay-QHSJBV3O.js.map +1 -0
  762. package/dist/provider/index.d.ts +1 -0
  763. package/dist/provider/index.js +14 -0
  764. package/dist/react/context/index.d.ts +4 -0
  765. package/dist/react/context/index.d.ts.map +1 -0
  766. package/dist/react/hooks/index.d.ts +10 -0
  767. package/dist/react/hooks/index.d.ts.map +1 -0
  768. package/dist/react/hooks/types.d.ts +25 -0
  769. package/dist/react/hooks/types.d.ts.map +1 -0
  770. package/dist/react/hooks/use-click-outside.d.ts +6 -0
  771. package/dist/react/hooks/use-click-outside.d.ts.map +1 -0
  772. package/dist/react/hooks/use-controllable-state.d.ts +7 -0
  773. package/dist/react/hooks/use-controllable-state.d.ts.map +1 -0
  774. package/dist/react/hooks/use-fullscreen-state.d.ts +7 -0
  775. package/dist/react/hooks/use-fullscreen-state.d.ts.map +1 -0
  776. package/dist/react/hooks/use-global-event.d.ts +9 -0
  777. package/dist/react/hooks/use-global-event.d.ts.map +1 -0
  778. package/dist/react/hooks/use-hotkey.d.ts +10 -0
  779. package/dist/react/hooks/use-hotkey.d.ts.map +1 -0
  780. package/dist/react/hooks/use-required-context.d.ts +6 -0
  781. package/dist/react/hooks/use-required-context.d.ts.map +1 -0
  782. package/dist/react/hooks/use-scroll-lock.d.ts +9 -0
  783. package/dist/react/hooks/use-scroll-lock.d.ts.map +1 -0
  784. package/dist/react/hooks/use-store.d.ts +3 -0
  785. package/dist/react/hooks/use-store.d.ts.map +1 -0
  786. package/dist/react/theme/index.d.ts +82 -0
  787. package/dist/react/theme/index.d.ts.map +1 -0
  788. package/dist/react/ui/components/avatar.d.ts +6 -0
  789. package/dist/react/ui/components/avatar.d.ts.map +1 -0
  790. package/dist/react/ui/components/button.d.ts +6 -0
  791. package/dist/react/ui/components/button.d.ts.map +1 -0
  792. package/dist/react/ui/components/carousel.d.ts +6 -0
  793. package/dist/react/ui/components/carousel.d.ts.map +1 -0
  794. package/dist/react/ui/components/checkbox.d.ts +10 -0
  795. package/dist/react/ui/components/checkbox.d.ts.map +1 -0
  796. package/dist/react/ui/components/icon.d.ts +6 -0
  797. package/dist/react/ui/components/icon.d.ts.map +1 -0
  798. package/dist/react/ui/components/image.d.ts +6 -0
  799. package/dist/react/ui/components/image.d.ts.map +1 -0
  800. package/dist/react/ui/components/indicator.d.ts +45 -0
  801. package/dist/react/ui/components/indicator.d.ts.map +1 -0
  802. package/dist/react/ui/components/input.d.ts +10 -0
  803. package/dist/react/ui/components/input.d.ts.map +1 -0
  804. package/dist/react/ui/components/loader.d.ts +10 -0
  805. package/dist/react/ui/components/loader.d.ts.map +1 -0
  806. package/dist/react/ui/components/segmented.d.ts +6 -0
  807. package/dist/react/ui/components/segmented.d.ts.map +1 -0
  808. package/dist/react/ui/components/select-parts.d.ts +22 -0
  809. package/dist/react/ui/components/select-parts.d.ts.map +1 -0
  810. package/dist/react/ui/components/select.d.ts +6 -0
  811. package/dist/react/ui/components/select.d.ts.map +1 -0
  812. package/dist/react/ui/components/skeleton.d.ts +10 -0
  813. package/dist/react/ui/components/skeleton.d.ts.map +1 -0
  814. package/dist/react/ui/components/switch.d.ts +6 -0
  815. package/dist/react/ui/components/switch.d.ts.map +1 -0
  816. package/dist/react/ui/components/tooltip.d.ts +11 -0
  817. package/dist/react/ui/components/tooltip.d.ts.map +1 -0
  818. package/dist/react/ui/index.d.ts +19 -0
  819. package/dist/react/ui/index.d.ts.map +1 -0
  820. package/dist/react/ui/provider.d.ts +22 -0
  821. package/dist/react/ui/provider.d.ts.map +1 -0
  822. package/dist/react/ui/types-controls.d.ts +133 -0
  823. package/dist/react/ui/types-controls.d.ts.map +1 -0
  824. package/dist/react/ui/types.d.ts +192 -0
  825. package/dist/react/ui/types.d.ts.map +1 -0
  826. package/dist/react/ui/utils.d.ts +65 -0
  827. package/dist/react/ui/utils.d.ts.map +1 -0
  828. package/dist/recipes/index.d.ts +1 -0
  829. package/dist/recipes/index.js +233 -0
  830. package/dist/recipes/index.js.map +1 -0
  831. package/dist/result/index.d.ts +1 -0
  832. package/dist/result/index.js +98 -0
  833. package/dist/result/index.js.map +1 -0
  834. package/dist/theme/index.d.ts +1 -0
  835. package/dist/theme/index.js +6 -0
  836. package/dist/ui/index.d.ts +1 -0
  837. package/dist/ui/index.js +2268 -0
  838. package/dist/ui/index.js.map +1 -0
  839. package/dist/utils/index.d.ts +1 -15
  840. package/dist/utils/index.js +194 -71
  841. package/dist/utils/index.js.map +1 -1
  842. package/docs/README.md +58 -57
  843. package/docs/architecture-and-rules.md +133 -58
  844. package/docs/core-engine.md +36 -52
  845. package/docs/custom-modules.md +43 -32
  846. package/docs/design.md +185 -0
  847. package/docs/getting-started.md +49 -57
  848. package/docs/modules/README.md +50 -61
  849. package/docs/modules/ambient.md +95 -87
  850. package/docs/modules/background.md +39 -36
  851. package/docs/modules/context-menu.md +19 -18
  852. package/docs/modules/controls.md +13 -13
  853. package/docs/modules/dock.md +74 -93
  854. package/docs/modules/error-boundary.md +2 -2
  855. package/docs/modules/kernel.md +38 -26
  856. package/docs/modules/loading.md +14 -14
  857. package/docs/modules/media.md +13 -13
  858. package/docs/modules/modal.md +14 -14
  859. package/docs/modules/navigation.md +87 -84
  860. package/docs/modules/notification.md +13 -13
  861. package/docs/modules/result.md +22 -22
  862. package/docs/proposals/navigation.md +32 -31
  863. package/docs/testing.md +34 -28
  864. package/docs/theming.md +67 -44
  865. package/package.json +106 -88
  866. package/templates/AGENTS.md +35 -25
  867. package/dist/atoms/button.d.ts +0 -11
  868. package/dist/atoms/button.d.ts.map +0 -1
  869. package/dist/atoms/icon.d.ts +0 -15
  870. package/dist/atoms/icon.d.ts.map +0 -1
  871. package/dist/atoms/index.d.ts +0 -5
  872. package/dist/atoms/index.d.ts.map +0 -1
  873. package/dist/atoms/index.js +0 -4
  874. package/dist/atoms/spinner.d.ts +0 -9
  875. package/dist/atoms/spinner.d.ts.map +0 -1
  876. package/dist/atoms/tooltip.d.ts +0 -18
  877. package/dist/atoms/tooltip.d.ts.map +0 -1
  878. package/dist/chunk-3BUP64Q6.js +0 -105
  879. package/dist/chunk-3BUP64Q6.js.map +0 -1
  880. package/dist/chunk-4GMQKD6F.js +0 -353
  881. package/dist/chunk-4GMQKD6F.js.map +0 -1
  882. package/dist/chunk-66EYJBIP.js +0 -300
  883. package/dist/chunk-66EYJBIP.js.map +0 -1
  884. package/dist/chunk-7HQMXTNP.js +0 -419
  885. package/dist/chunk-7HQMXTNP.js.map +0 -1
  886. package/dist/chunk-7TAVYJ3A.js +0 -371
  887. package/dist/chunk-7TAVYJ3A.js.map +0 -1
  888. package/dist/chunk-AQ4BNXA2.js +0 -349
  889. package/dist/chunk-AQ4BNXA2.js.map +0 -1
  890. package/dist/chunk-CGHZSSFR.js +0 -2166
  891. package/dist/chunk-CGHZSSFR.js.map +0 -1
  892. package/dist/chunk-DGCQWQLZ.js +0 -61
  893. package/dist/chunk-DGCQWQLZ.js.map +0 -1
  894. package/dist/chunk-FIMPHODX.js +0 -67
  895. package/dist/chunk-FIMPHODX.js.map +0 -1
  896. package/dist/chunk-GF7TUX5I.js +0 -1889
  897. package/dist/chunk-GF7TUX5I.js.map +0 -1
  898. package/dist/chunk-HHWRTQKQ.js +0 -610
  899. package/dist/chunk-HHWRTQKQ.js.map +0 -1
  900. package/dist/chunk-HLL5EHXC.js +0 -485
  901. package/dist/chunk-HLL5EHXC.js.map +0 -1
  902. package/dist/chunk-I5GK7VOV.js +0 -28
  903. package/dist/chunk-I5GK7VOV.js.map +0 -1
  904. package/dist/chunk-JELG4JLT.js +0 -454
  905. package/dist/chunk-JELG4JLT.js.map +0 -1
  906. package/dist/chunk-K676GL7Z.js +0 -51
  907. package/dist/chunk-K676GL7Z.js.map +0 -1
  908. package/dist/chunk-QI3ALLIB.js +0 -38
  909. package/dist/chunk-QI3ALLIB.js.map +0 -1
  910. package/dist/chunk-R2YGFJDJ.js +0 -408
  911. package/dist/chunk-R2YGFJDJ.js.map +0 -1
  912. package/dist/chunk-RFZQWLC5.js +0 -27
  913. package/dist/chunk-RFZQWLC5.js.map +0 -1
  914. package/dist/chunk-RIOKLMYM.js +0 -145
  915. package/dist/chunk-RIOKLMYM.js.map +0 -1
  916. package/dist/chunk-RRAZKP3J.js +0 -888
  917. package/dist/chunk-RRAZKP3J.js.map +0 -1
  918. package/dist/chunk-SYAVGTOX.js +0 -521
  919. package/dist/chunk-SYAVGTOX.js.map +0 -1
  920. package/dist/chunk-TG6NMHXI.js +0 -1218
  921. package/dist/chunk-TG6NMHXI.js.map +0 -1
  922. package/dist/chunk-TV3WEF5G.js +0 -784
  923. package/dist/chunk-TV3WEF5G.js.map +0 -1
  924. package/dist/chunk-WVRMABDN.js +0 -9727
  925. package/dist/chunk-WVRMABDN.js.map +0 -1
  926. package/dist/error/boundary.d.ts +0 -14
  927. package/dist/error/boundary.d.ts.map +0 -1
  928. package/dist/error/constants.d.ts +0 -18
  929. package/dist/error/constants.d.ts.map +0 -1
  930. package/dist/error/index.d.ts.map +0 -1
  931. package/dist/error/listener.d.ts +0 -2
  932. package/dist/error/listener.d.ts.map +0 -1
  933. package/dist/error/reporter.d.ts +0 -32
  934. package/dist/error/reporter.d.ts.map +0 -1
  935. package/dist/error/theme.d.ts +0 -3
  936. package/dist/error/theme.d.ts.map +0 -1
  937. package/dist/error/types.d.ts +0 -91
  938. package/dist/error/types.d.ts.map +0 -1
  939. package/dist/error/utils.d.ts +0 -21
  940. package/dist/error/utils.d.ts.map +0 -1
  941. package/dist/events.d.ts +0 -51
  942. package/dist/events.d.ts.map +0 -1
  943. package/dist/events.js +0 -82
  944. package/dist/events.js.map +0 -1
  945. package/dist/hooks/index.d.ts.map +0 -1
  946. package/dist/hooks/types.d.ts +0 -16
  947. package/dist/hooks/types.d.ts.map +0 -1
  948. package/dist/hooks/use-click-outside.d.ts +0 -3
  949. package/dist/hooks/use-click-outside.d.ts.map +0 -1
  950. package/dist/hooks/use-controllable-state.d.ts +0 -3
  951. package/dist/hooks/use-controllable-state.d.ts.map +0 -1
  952. package/dist/hooks/use-fullscreen-state.d.ts +0 -4
  953. package/dist/hooks/use-fullscreen-state.d.ts.map +0 -1
  954. package/dist/hooks/use-global-event.d.ts +0 -5
  955. package/dist/hooks/use-global-event.d.ts.map +0 -1
  956. package/dist/hooks/use-hotkey.d.ts +0 -4
  957. package/dist/hooks/use-hotkey.d.ts.map +0 -1
  958. package/dist/hooks/use-isomorphic-layout-effect.d.ts +0 -3
  959. package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +0 -1
  960. package/dist/hooks/use-required-context.d.ts +0 -3
  961. package/dist/hooks/use-required-context.d.ts.map +0 -1
  962. package/dist/hooks/use-store.d.ts +0 -3
  963. package/dist/hooks/use-store.d.ts.map +0 -1
  964. package/dist/kernel/adapters.d.ts +0 -5
  965. package/dist/kernel/adapters.d.ts.map +0 -1
  966. package/dist/kernel/compose.d.ts +0 -15
  967. package/dist/kernel/compose.d.ts.map +0 -1
  968. package/dist/kernel/constants.d.ts +0 -12
  969. package/dist/kernel/constants.d.ts.map +0 -1
  970. package/dist/kernel/context-registry.d.ts +0 -3
  971. package/dist/kernel/context-registry.d.ts.map +0 -1
  972. package/dist/kernel/handlers.d.ts +0 -3
  973. package/dist/kernel/handlers.d.ts.map +0 -1
  974. package/dist/kernel/hooks.d.ts +0 -7
  975. package/dist/kernel/hooks.d.ts.map +0 -1
  976. package/dist/kernel/index.d.ts.map +0 -1
  977. package/dist/kernel/installed.d.ts +0 -21
  978. package/dist/kernel/installed.d.ts.map +0 -1
  979. package/dist/kernel/module.d.ts +0 -32
  980. package/dist/kernel/module.d.ts.map +0 -1
  981. package/dist/kernel/operations.d.ts +0 -21
  982. package/dist/kernel/operations.d.ts.map +0 -1
  983. package/dist/kernel/page-controller.d.ts +0 -8
  984. package/dist/kernel/page-controller.d.ts.map +0 -1
  985. package/dist/kernel/provider.d.ts +0 -18
  986. package/dist/kernel/provider.d.ts.map +0 -1
  987. package/dist/kernel/runtime.d.ts.map +0 -1
  988. package/dist/kernel/schema.d.ts +0 -11
  989. package/dist/kernel/schema.d.ts.map +0 -1
  990. package/dist/kernel/store.d.ts +0 -4
  991. package/dist/kernel/store.d.ts.map +0 -1
  992. package/dist/kernel/types.d.ts +0 -233
  993. package/dist/kernel/types.d.ts.map +0 -1
  994. package/dist/kernel/utils.d.ts +0 -18
  995. package/dist/kernel/utils.d.ts.map +0 -1
  996. package/dist/modules/ambient/index.js +0 -10
  997. package/dist/modules/ambient/server/index.js +0 -221
  998. package/dist/modules/ambient/server/index.js.map +0 -1
  999. package/dist/modules/ambient/worker/index.js +0 -114
  1000. package/dist/modules/ambient/worker/index.js.map +0 -1
  1001. package/dist/modules/background/index.js +0 -9
  1002. package/dist/modules/background/overlay.d.ts +0 -135
  1003. package/dist/modules/background/overlay.d.ts.map +0 -1
  1004. package/dist/modules/background/playback.d.ts +0 -10
  1005. package/dist/modules/background/playback.d.ts.map +0 -1
  1006. package/dist/modules/background/state.d.ts +0 -9
  1007. package/dist/modules/background/state.d.ts.map +0 -1
  1008. package/dist/modules/background/visual.d.ts +0 -48
  1009. package/dist/modules/background/visual.d.ts.map +0 -1
  1010. package/dist/modules/background/youtube/iframe.d.ts +0 -52
  1011. package/dist/modules/background/youtube/iframe.d.ts.map +0 -1
  1012. package/dist/modules/background/youtube/parse.d.ts +0 -17
  1013. package/dist/modules/background/youtube/parse.d.ts.map +0 -1
  1014. package/dist/modules/background/youtube/player.d.ts +0 -28
  1015. package/dist/modules/background/youtube/player.d.ts.map +0 -1
  1016. package/dist/modules/context-menu/index.js +0 -14
  1017. package/dist/modules/controls/index.js +0 -7
  1018. package/dist/modules/dock/cards.d.ts +0 -1722
  1019. package/dist/modules/dock/cards.d.ts.map +0 -1
  1020. package/dist/modules/dock/dom.d.ts +0 -24
  1021. package/dist/modules/dock/dom.d.ts.map +0 -1
  1022. package/dist/modules/dock/helpers.d.ts +0 -25
  1023. package/dist/modules/dock/helpers.d.ts.map +0 -1
  1024. package/dist/modules/dock/hooks.d.ts +0 -42
  1025. package/dist/modules/dock/hooks.d.ts.map +0 -1
  1026. package/dist/modules/dock/index.js +0 -13
  1027. package/dist/modules/dock/layout.d.ts +0 -26
  1028. package/dist/modules/dock/layout.d.ts.map +0 -1
  1029. package/dist/modules/dock/overlay.d.ts +0 -79
  1030. package/dist/modules/dock/overlay.d.ts.map +0 -1
  1031. package/dist/modules/dock/paths.d.ts +0 -10
  1032. package/dist/modules/dock/paths.d.ts.map +0 -1
  1033. package/dist/modules/dock/state.d.ts +0 -22
  1034. package/dist/modules/dock/state.d.ts.map +0 -1
  1035. package/dist/modules/dock/styles.d.ts +0 -900
  1036. package/dist/modules/dock/styles.d.ts.map +0 -1
  1037. package/dist/modules/dock/surface/hooks.d.ts +0 -110
  1038. package/dist/modules/dock/surface/hooks.d.ts.map +0 -1
  1039. package/dist/modules/dock/types.d.ts +0 -1362
  1040. package/dist/modules/dock/types.d.ts.map +0 -1
  1041. package/dist/modules/loading/index.js +0 -8
  1042. package/dist/modules/media/index.js +0 -6
  1043. package/dist/modules/modal/dom.d.ts +0 -4
  1044. package/dist/modules/modal/dom.d.ts.map +0 -1
  1045. package/dist/modules/modal/header.d.ts +0 -7
  1046. package/dist/modules/modal/header.d.ts.map +0 -1
  1047. package/dist/modules/modal/identity.d.ts +0 -7
  1048. package/dist/modules/modal/identity.d.ts.map +0 -1
  1049. package/dist/modules/modal/index.js +0 -11
  1050. package/dist/modules/modal/layout.d.ts +0 -13
  1051. package/dist/modules/modal/layout.d.ts.map +0 -1
  1052. package/dist/modules/modal/overlay.d.ts +0 -4
  1053. package/dist/modules/modal/overlay.d.ts.map +0 -1
  1054. package/dist/modules/modal/state.d.ts +0 -4
  1055. package/dist/modules/modal/state.d.ts.map +0 -1
  1056. package/dist/modules/navigation/constants.d.ts +0 -37
  1057. package/dist/modules/navigation/constants.d.ts.map +0 -1
  1058. package/dist/modules/navigation/index.js +0 -81
  1059. package/dist/modules/navigation/index.js.map +0 -1
  1060. package/dist/modules/navigation/navigator.d.ts +0 -8
  1061. package/dist/modules/navigation/navigator.d.ts.map +0 -1
  1062. package/dist/modules/navigation/settings.d.ts +0 -10
  1063. package/dist/modules/navigation/settings.d.ts.map +0 -1
  1064. package/dist/modules/navigation/state.d.ts +0 -20
  1065. package/dist/modules/navigation/state.d.ts.map +0 -1
  1066. package/dist/modules/navigation/types.d.ts +0 -168
  1067. package/dist/modules/navigation/types.d.ts.map +0 -1
  1068. package/dist/modules/navigation/utils.d.ts +0 -11
  1069. package/dist/modules/navigation/utils.d.ts.map +0 -1
  1070. package/dist/modules/notification/index.js +0 -7
  1071. package/dist/overlay-TZ6L52A5.js +0 -9
  1072. package/dist/overlay-TZ6L52A5.js.map +0 -1
  1073. package/dist/provider.d.ts +0 -23
  1074. package/dist/provider.d.ts.map +0 -1
  1075. package/dist/provider.js +0 -9
  1076. package/dist/provider.js.map +0 -1
  1077. package/dist/result.d.ts +0 -50
  1078. package/dist/result.d.ts.map +0 -1
  1079. package/dist/result.js +0 -102
  1080. package/dist/result.js.map +0 -1
  1081. package/dist/theme.d.ts +0 -63
  1082. package/dist/theme.d.ts.map +0 -1
  1083. package/dist/theme.js +0 -6
  1084. package/dist/theme.js.map +0 -1
  1085. package/dist/tokens/index.d.ts +0 -4
  1086. package/dist/tokens/index.d.ts.map +0 -1
  1087. package/dist/tokens/index.js +0 -296
  1088. package/dist/tokens/index.js.map +0 -1
  1089. package/dist/tokens/motion-config.d.ts +0 -44
  1090. package/dist/tokens/motion-config.d.ts.map +0 -1
  1091. package/dist/tokens/motion.d.ts +0 -164
  1092. package/dist/tokens/motion.d.ts.map +0 -1
  1093. package/dist/tokens/tokens.d.ts +0 -34
  1094. package/dist/tokens/tokens.d.ts.map +0 -1
  1095. package/dist/utils/cn.d.ts +0 -3
  1096. package/dist/utils/cn.d.ts.map +0 -1
  1097. package/dist/utils/dom.d.ts +0 -5
  1098. package/dist/utils/dom.d.ts.map +0 -1
  1099. package/dist/utils/index.d.ts.map +0 -1
  1100. package/dist/utils/number.d.ts +0 -3
  1101. package/dist/utils/number.d.ts.map +0 -1
  1102. package/dist/utils/object.d.ts +0 -5
  1103. package/dist/utils/object.d.ts.map +0 -1
  1104. package/dist/utils/report.d.ts +0 -5
  1105. package/dist/utils/report.d.ts.map +0 -1
  1106. package/dist/utils/scheduler.d.ts +0 -34
  1107. package/dist/utils/scheduler.d.ts.map +0 -1
  1108. package/dist/utils/store.d.ts +0 -11
  1109. package/dist/utils/store.d.ts.map +0 -1
  1110. package/dist/utils/string.d.ts +0 -5
  1111. package/dist/utils/string.d.ts.map +0 -1
  1112. package/dist/utils/timing.d.ts +0 -7
  1113. package/dist/utils/timing.d.ts.map +0 -1
  1114. package/dist/utils/user-message.d.ts +0 -20
  1115. package/dist/utils/user-message.d.ts.map +0 -1
  1116. package/templates/motion/background.ts +0 -17
  1117. package/templates/motion/context-menu.ts +0 -63
  1118. package/templates/motion/dock.ts +0 -395
  1119. package/templates/motion/modal.ts +0 -79
  1120. package/templates/motion/notification.ts +0 -27
  1121. package/templates/motion/tokens.ts +0 -47
  1122. /package/dist/{atoms → ambient}/index.js.map +0 -0
  1123. /package/dist/{modules/ambient → background}/index.js.map +0 -0
  1124. /package/dist/{modules/background → context-menu}/index.js.map +0 -0
  1125. /package/dist/{modules/context-menu → controls}/index.js.map +0 -0
  1126. /package/dist/{kernel → core/kernel}/runtime.d.ts +0 -0
  1127. /package/dist/{modules/controls → dock}/index.js.map +0 -0
  1128. /package/dist/{modules/dock → loading}/index.js.map +0 -0
  1129. /package/dist/{modules/loading → media}/index.js.map +0 -0
  1130. /package/dist/{modules/media → notification}/index.js.map +0 -0
  1131. /package/dist/{modules/modal → provider}/index.js.map +0 -0
  1132. /package/dist/{modules/notification → theme}/index.js.map +0 -0
@@ -1,1218 +0,0 @@
1
- import { useOptionalBackgroundState } from './chunk-CGHZSSFR.js';
2
- import { defineThemeSpec, useTheme } from './chunk-7TAVYJ3A.js';
3
- import { getOrCreateGlobalContext, defineModule } from './chunk-GF7TUX5I.js';
4
- import { createStore, shallowEqual, useRequiredContext, useStore } from './chunk-TV3WEF5G.js';
5
- import { useMemo, useState, use, useEffect, useRef } from 'react';
6
- import { jsx } from 'react/jsx-runtime';
7
-
8
- var AmbientContext = getOrCreateGlobalContext("AmbientContext", null);
9
- function AmbientProvider({
10
- children,
11
- initialPalette = null
12
- }) {
13
- const [store] = useState(
14
- () => createStore(
15
- { isExtracting: false, palette: initialPalette },
16
- { freezeSnapshots: false }
17
- )
18
- );
19
- const value = useMemo(
20
- () => ({
21
- actions: {
22
- setIsExtracting: (next) => store.publish((state) => {
23
- const isExtracting = typeof next === "function" ? next(state.isExtracting) : next;
24
- return isExtracting === state.isExtracting ? state : { ...state, isExtracting };
25
- }),
26
- setPalette: (next) => store.publish((state) => {
27
- const palette = typeof next === "function" ? next(state.palette) : next;
28
- return palette === state.palette ? state : { ...state, palette };
29
- })
30
- },
31
- store
32
- }),
33
- [store]
34
- );
35
- return /* @__PURE__ */ jsx(AmbientContext, { value, children });
36
- }
37
-
38
- // src/modules/ambient/constants.ts
39
- var ambientTheme = defineThemeSpec("ambient");
40
-
41
- // src/modules/ambient/settings.ts
42
- var AMBIENT_TONES = Object.freeze([
43
- 10,
44
- 15,
45
- 20,
46
- 30,
47
- 40,
48
- 50,
49
- 60,
50
- 70,
51
- 80,
52
- 90,
53
- 95
54
- ]);
55
- var AMBIENT_ROLES = Object.freeze([
56
- "dominant",
57
- "vibrant",
58
- "muted",
59
- "accent"
60
- ]);
61
- var AMBIENT_REGIONS = Object.freeze([
62
- "top",
63
- "bottom",
64
- "left",
65
- "right",
66
- "center"
67
- ]);
68
- var DEFAULT_ANALYSIS = Object.freeze({
69
- centerWeight: 0.5,
70
- clusters: 7,
71
- letterbox: true,
72
- minContrast: 4.5,
73
- minHueDistance: 40,
74
- sampleSize: 128,
75
- shadowLightness: 0.16
76
- });
77
- var DEFAULT_CSS_VAR_NAMES = Object.freeze({
78
- on: "--ambient-on-{role}",
79
- region: "--ambient-{region}",
80
- role: "--ambient-{role}",
81
- shadow: "--ambient-shadow",
82
- tone: "--ambient-{role}-{tone}"
83
- });
84
- var DEFAULT_PROXY = "/api/ambient/proxy?url=";
85
- var DEFAULT_LINGER_MS = 3e3;
86
- var createDefaults = () => ({
87
- analysis: { ...DEFAULT_ANALYSIS },
88
- cacheLimit: 100,
89
- cssVars: { ...DEFAULT_CSS_VAR_NAMES, tones: AMBIENT_TONES },
90
- linger: DEFAULT_LINGER_MS,
91
- proxy: DEFAULT_PROXY,
92
- strategy: "auto",
93
- worker: null
94
- });
95
- var SETTINGS_KEY = /* @__PURE__ */ Symbol.for("@omerdlw/base-framework/ambient/settings");
96
- var scope = globalThis;
97
- function getAmbientSettings() {
98
- return scope[SETTINGS_KEY] ??= createDefaults();
99
- }
100
- function mergeAmbientSettings(base, input) {
101
- return {
102
- analysis: { ...base.analysis, ...input.analysis },
103
- cacheLimit: input.cacheLimit ?? base.cacheLimit,
104
- cssVars: { ...base.cssVars, ...input.cssVars },
105
- linger: input.linger ?? base.linger,
106
- proxy: input.proxy === void 0 ? base.proxy : input.proxy,
107
- strategy: input.strategy ?? base.strategy,
108
- worker: input.worker === void 0 ? base.worker : input.worker
109
- };
110
- }
111
- function configureAmbient(input) {
112
- const previous = getAmbientSettings();
113
- const next = mergeAmbientSettings(previous, input);
114
- scope[SETTINGS_KEY] = next;
115
- return () => {
116
- if (scope[SETTINGS_KEY] === next) scope[SETTINGS_KEY] = previous;
117
- };
118
- }
119
- function resolveAnalysis(overrides) {
120
- return { ...getAmbientSettings().analysis, ...overrides };
121
- }
122
- function resolveProxyUrl(proxy, src) {
123
- if (!proxy || !/^https?:\/\//i.test(src)) return null;
124
- if (typeof proxy === "function") return proxy(src);
125
- const encoded = encodeURIComponent(src);
126
- return proxy.includes("{url}") ? proxy.replace("{url}", encoded) : `${proxy}${encoded}`;
127
- }
128
-
129
- // src/modules/ambient/oklab.ts
130
- var DEG = Math.PI / 180;
131
- var LINEAR_LUT = new Float32Array(256);
132
- for (let i = 0; i < 256; i++) {
133
- const v = i / 255;
134
- LINEAR_LUT[i] = v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
135
- }
136
- function clamp(value, min, max) {
137
- return Math.max(min, Math.min(max, value));
138
- }
139
- function smoothstep(edge0, edge1, value) {
140
- const t = clamp((value - edge0) / (edge1 - edge0), 0, 1);
141
- return t * t * (3 - 2 * t);
142
- }
143
- function srgbToOklab(r, g, b) {
144
- const lr = LINEAR_LUT[r & 255];
145
- const lg = LINEAR_LUT[g & 255];
146
- const lb = LINEAR_LUT[b & 255];
147
- const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
148
- const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
149
- const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
150
- return [
151
- 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
152
- 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
153
- 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s
154
- ];
155
- }
156
- function oklchToLinearSrgb(l, c, h) {
157
- const a = c * Math.cos(h * DEG);
158
- const b = c * Math.sin(h * DEG);
159
- const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
160
- const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
161
- const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
162
- return [
163
- 4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_,
164
- -1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_,
165
- -0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_
166
- ];
167
- }
168
- function labToLch([l, a, b]) {
169
- const c = Math.sqrt(a * a + b * b);
170
- const h = c < 1e-6 ? 0 : (Math.atan2(b, a) / DEG + 360) % 360;
171
- return { c, h, l };
172
- }
173
- var inGamut = (rgb) => rgb.every((v) => v >= -1e-5 && v <= 1 + 1e-5);
174
- function maxChroma(l, h) {
175
- if (l <= 0 || l >= 1) return 0;
176
- let low = 0;
177
- let high = 0.4;
178
- for (let step = 0; step < 18; step++) {
179
- const middle = (low + high) / 2;
180
- if (inGamut(oklchToLinearSrgb(l, middle, h))) low = middle;
181
- else high = middle;
182
- }
183
- return low;
184
- }
185
- function hueDistance(a, b) {
186
- const d = Math.abs(a - b) % 360;
187
- return d > 180 ? 360 - d : d;
188
- }
189
- function luminance({ c, h, l }) {
190
- const [r, g, b] = oklchToLinearSrgb(l, c, h).map((v) => clamp(v, 0, 1));
191
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
192
- }
193
- function contrastRatio(a, b) {
194
- const la = luminance(a);
195
- const lb = luminance(b);
196
- return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
197
- }
198
- var round = (value, digits) => {
199
- const factor = 10 ** digits;
200
- return Math.round(value * factor) / factor;
201
- };
202
- function formatOklch({ c, h, l }) {
203
- const chroma = c < 5e-4 ? 0 : c;
204
- return `oklch(${round(clamp(l, 0, 1), 3).toFixed(3)} ${round(chroma, 3).toFixed(3)} ${round(chroma === 0 ? 0 : h, 1).toFixed(1)})`;
205
- }
206
- function toneOf(h, l, rel, cap = 0.3) {
207
- const room = maxChroma(l, h) * 0.96;
208
- return { c: Math.min(cap, clamp(rel, 0, 1) * room), h, l };
209
- }
210
- function onColorFor(background, minContrast = 4.5) {
211
- const light = (l) => toneOf(background.h, l, 0.12, 0.012);
212
- const dark = (l) => toneOf(background.h, l, 0.35, 0.03);
213
- const towardLight = contrastRatio(light(0.985), background);
214
- const towardDark = contrastRatio(dark(0.18), background);
215
- const useLight = towardLight >= minContrast || towardLight >= towardDark;
216
- for (let step = 0; step <= 12; step++) {
217
- const candidate = useLight ? light(Math.min(1, 0.985 + step * 25e-4)) : dark(Math.max(0, 0.18 - step * 0.015));
218
- if (contrastRatio(candidate, background) >= minContrast) return candidate;
219
- }
220
- return useLight ? { c: 0, h: 0, l: 1 } : { c: 0, h: 0, l: 0 };
221
- }
222
-
223
- // src/modules/ambient/quantize.ts
224
- function kmeans(points, weights, requested, { iterations = 16, lightnessWeight = 0.45 } = {}) {
225
- const n = weights.length;
226
- const assignment = new Int32Array(n);
227
- const k = Math.max(0, Math.min(requested, n));
228
- const centroids = new Float64Array(k * 3);
229
- if (k === 0) return { assignment, centroids, k };
230
- const distance = (i, j) => {
231
- const dl = points[i * 3] - centroids[j * 3];
232
- const da = points[i * 3 + 1] - centroids[j * 3 + 1];
233
- const db = points[i * 3 + 2] - centroids[j * 3 + 2];
234
- return lightnessWeight * dl * dl + da * da + db * db;
235
- };
236
- let first = 0;
237
- for (let i = 1; i < n; i++) if (weights[i] > weights[first]) first = i;
238
- centroids.set(points.subarray(first * 3, first * 3 + 3), 0);
239
- const nearest = new Float64Array(n).fill(Infinity);
240
- let found = 1;
241
- for (; found < k; found++) {
242
- let best = -1;
243
- let bestScore = 0;
244
- for (let i = 0; i < n; i++) {
245
- const d = distance(i, found - 1);
246
- if (d < nearest[i]) nearest[i] = d;
247
- const score = weights[i] * nearest[i];
248
- if (score > bestScore) {
249
- bestScore = score;
250
- best = i;
251
- }
252
- }
253
- if (best < 0) break;
254
- centroids.set(points.subarray(best * 3, best * 3 + 3), found * 3);
255
- }
256
- const sums = new Float64Array(found * 4);
257
- for (let round2 = 0; round2 < iterations; round2++) {
258
- let moved = round2 === 0;
259
- for (let i = 0; i < n; i++) {
260
- let best = 0;
261
- let bestDistance = Infinity;
262
- for (let j = 0; j < found; j++) {
263
- const d = distance(i, j);
264
- if (d < bestDistance) {
265
- bestDistance = d;
266
- best = j;
267
- }
268
- }
269
- if (assignment[i] !== best) {
270
- assignment[i] = best;
271
- moved = true;
272
- }
273
- }
274
- if (!moved) break;
275
- sums.fill(0);
276
- for (let i = 0; i < n; i++) {
277
- const j = assignment[i] * 4;
278
- const w = weights[i];
279
- sums[j] += points[i * 3] * w;
280
- sums[j + 1] += points[i * 3 + 1] * w;
281
- sums[j + 2] += points[i * 3 + 2] * w;
282
- sums[j + 3] += w;
283
- }
284
- for (let j = 0; j < found; j++) {
285
- const w = sums[j * 4 + 3];
286
- if (w <= 0) continue;
287
- centroids[j * 3] = sums[j * 4] / w;
288
- centroids[j * 3 + 1] = sums[j * 4 + 1] / w;
289
- centroids[j * 3 + 2] = sums[j * 4 + 2] / w;
290
- }
291
- }
292
- return { assignment, centroids: centroids.slice(0, found * 3), k: found };
293
- }
294
-
295
- // src/modules/ambient/analyze.ts
296
- var AMBIENT_ANALYSIS_VERSION = 2;
297
- var MIN_CHROMA = 0.022;
298
- var MIN_PRESENCE = 0.03;
299
- var MIN_POPULATION = 4e-3;
300
- var REGION_BITS = {
301
- top: 1,
302
- bottom: 2,
303
- left: 4,
304
- right: 8,
305
- center: 16
306
- };
307
- var lightnessAt = (data, index) => srgbToOklab(data[index], data[index + 1], data[index + 2])[0];
308
- function findContentBounds({ data, height, width }) {
309
- const isBar = (count, at) => {
310
- let sum = 0;
311
- let max = 0;
312
- let seen = 0;
313
- for (let step = 0; step < count; step++) {
314
- const index = at(step);
315
- if (data[index + 3] < 128) continue;
316
- const l = lightnessAt(data, index);
317
- sum += l;
318
- if (l > max) max = l;
319
- seen++;
320
- }
321
- return seen > 0 && sum / seen < 0.12 && max < 0.2;
322
- };
323
- const row = (y) => isBar(width, (x) => (y * width + x) * 4);
324
- const maxRows = Math.floor(height * 0.22);
325
- const maxColumns = Math.floor(width * 0.22);
326
- let top = 0;
327
- while (top < maxRows && row(top)) top++;
328
- let bottom = height;
329
- while (height - bottom < maxRows && bottom - 1 > top && row(bottom - 1)) bottom--;
330
- const column = (x) => isBar(bottom - top, (step) => ((top + step) * width + x) * 4);
331
- let left = 0;
332
- while (left < maxColumns && column(left)) left++;
333
- let right = width;
334
- while (width - right < maxColumns && right - 1 > left && column(right - 1)) right--;
335
- return { bottom, left, right, top };
336
- }
337
- var reliability = (l) => smoothstep(0.1, 0.28, l) * (1 - smoothstep(0.9, 0.98, l));
338
- var colorfulness = (c) => smoothstep(MIN_CHROMA, 0.06, c);
339
- var isChromatic = (cluster) => cluster.c >= MIN_CHROMA && cluster.rely > 0;
340
- function pickBest(items, score) {
341
- let best = null;
342
- let bestScore = 0;
343
- for (const item of items) {
344
- const value = score(item);
345
- if (value > bestScore) {
346
- bestScore = value;
347
- best = item;
348
- }
349
- }
350
- return best;
351
- }
352
- var round3 = (value) => Math.round(value * 1e3) / 1e3;
353
- function skinLikeness({ c, h, l }) {
354
- return (1 - smoothstep(12, 26, hueDistance(h, 54))) * smoothstep(0.02, 0.035, c) * (1 - smoothstep(0.11, 0.15, c)) * smoothstep(0.26, 0.38, l) * (1 - smoothstep(0.88, 0.95, l));
355
- }
356
- var warmth = (h) => 1 - smoothstep(22, 50, hueDistance(h, 42));
357
- var salience = (color) => 1 - 0.65 * skinLikeness(color);
358
- var roleChroma = (source, { cap, gain }) => Math.min(
359
- cap * (1 - 0.3 * warmth(source.h)),
360
- // A faint tint is raised further, so it still reads as a colour.
361
- Math.max(source.c * gain, Math.min(0.05, source.c * 1.6)) * (1 - 0.3 * skinLikeness(source))
362
- );
363
- var fitTone = (h, l, c) => ({
364
- c: Math.max(0, Math.min(c, maxChroma(l, h) * 0.96)),
365
- h,
366
- l
367
- });
368
- function buildSwatch(tone, population, fromImage, minContrast) {
369
- const room = maxChroma(tone.l, tone.h) * 0.96;
370
- const rel = room > 0 ? tone.c / room : 0;
371
- const ramp = {};
372
- for (const step of AMBIENT_TONES) {
373
- ramp[step] = formatOklch(toneOf(tone.h, step / 100, rel, Math.max(tone.c, 0.04)));
374
- }
375
- return {
376
- c: round3(tone.c),
377
- color: formatOklch(tone),
378
- fromImage,
379
- h: Math.round(tone.h * 10) / 10,
380
- l: round3(tone.l),
381
- on: formatOklch(onColorFor(tone, minContrast)),
382
- population: round3(population),
383
- ramp
384
- };
385
- }
386
- function roleTone(source, spec, fallback, dilution = 1) {
387
- if (!source) return fitTone(fallback.h, clamp(fallback.l, spec.min, spec.max), fallback.c);
388
- return fitTone(
389
- source.h,
390
- clamp(source.l, spec.min, spec.max),
391
- roleChroma(source, spec) * dilution
392
- );
393
- }
394
- function clusterAmbientPixels(pixels, options) {
395
- const { data, width, height } = pixels;
396
- const bounds = options.letterbox ? findContentBounds(pixels) : { bottom: height, left: 0, right: width, top: 0 };
397
- const boxWidth = Math.max(1, bounds.right - bounds.left);
398
- const boxHeight = Math.max(1, bounds.bottom - bounds.top);
399
- const binOf = new Int32Array(32768).fill(-1);
400
- const binSums = [];
401
- const pixelBins = new Int32Array(boxWidth * boxHeight).fill(-1);
402
- const pixelRegions = new Uint8Array(boxWidth * boxHeight);
403
- const sigma2 = 2 * 0.35 * 0.35;
404
- let total = 0;
405
- let sumL = 0;
406
- for (let y = bounds.top; y < bounds.bottom; y++) {
407
- const v = (y - bounds.top + 0.5) / boxHeight;
408
- for (let x = bounds.left; x < bounds.right; x++) {
409
- const index = (y * width + x) * 4;
410
- if (data[index + 3] < 128) continue;
411
- const r = data[index];
412
- const g = data[index + 1];
413
- const b = data[index + 2];
414
- const [l, a, bb] = srgbToOklab(r, g, b);
415
- const u = (x - bounds.left + 0.5) / boxWidth;
416
- const du = (u - 0.5) * 2;
417
- const dv = (v - 0.5) * 2;
418
- const weight = 1 - options.centerWeight + 2 * options.centerWeight * Math.exp(-(du * du + dv * dv) / sigma2);
419
- const key = r >> 3 << 10 | g >> 3 << 5 | b >> 3;
420
- let bin = binOf[key];
421
- if (bin < 0) {
422
- bin = binSums.length / 4;
423
- binOf[key] = bin;
424
- binSums.push(0, 0, 0, 0);
425
- }
426
- binSums[bin * 4] += l * weight;
427
- binSums[bin * 4 + 1] += a * weight;
428
- binSums[bin * 4 + 2] += bb * weight;
429
- binSums[bin * 4 + 3] += weight;
430
- total += weight;
431
- sumL += l * weight;
432
- const local = (y - bounds.top) * boxWidth + (x - bounds.left);
433
- pixelBins[local] = bin;
434
- pixelRegions[local] = (v < 1 / 3 ? REGION_BITS.top : 0) | (v > 2 / 3 ? REGION_BITS.bottom : 0) | (u < 1 / 3 ? REGION_BITS.left : 0) | (u > 2 / 3 ? REGION_BITS.right : 0) | (Math.abs(u - 0.5) < 0.25 && Math.abs(v - 0.5) < 0.25 ? REGION_BITS.center : 0);
435
- }
436
- }
437
- const meanL = total > 0 ? sumL / total : 0.5;
438
- const bins = binSums.length / 4;
439
- const groups = [[], []];
440
- for (let i = 0; i < bins; i++) {
441
- const w = binSums[i * 4 + 3];
442
- const a = binSums[i * 4 + 1] / w;
443
- const b = binSums[i * 4 + 2] / w;
444
- const coloured = Math.sqrt(a * a + b * b) >= MIN_CHROMA && binSums[i * 4] / w >= 0.06;
445
- groups[coloured ? 0 : 1].push(i);
446
- }
447
- const requested = clamp(Math.round(options.clusters), 2, 16);
448
- const greyClusters = groups[0].length === 0 ? requested : groups[1].length === 0 ? 0 : requested >= 8 ? 3 : 2;
449
- const budgets = [requested - greyClusters, greyClusters];
450
- const clusters = [];
451
- const clusterOfBin = new Int32Array(bins).fill(-1);
452
- groups.forEach((members, group) => {
453
- if (members.length === 0 || budgets[group] <= 0) return;
454
- const points = new Float64Array(members.length * 3);
455
- const weights = new Float64Array(members.length);
456
- members.forEach((bin, i) => {
457
- const w = binSums[bin * 4 + 3];
458
- const a = binSums[bin * 4 + 1] / w;
459
- const b = binSums[bin * 4 + 2] / w;
460
- points[i * 3] = binSums[bin * 4] / w;
461
- points[i * 3 + 1] = a;
462
- points[i * 3 + 2] = b;
463
- weights[i] = w * (1 + 5 * Math.sqrt(a * a + b * b));
464
- });
465
- const { assignment, k } = kmeans(points, weights, budgets[group]);
466
- const sums = new Float64Array(k * 4);
467
- members.forEach((bin, i) => {
468
- for (let channel = 0; channel < 4; channel++) {
469
- sums[assignment[i] * 4 + channel] += binSums[bin * 4 + channel];
470
- }
471
- });
472
- const index = new Int32Array(k).fill(-1);
473
- for (let j = 0; j < k; j++) {
474
- const pop = sums[j * 4 + 3];
475
- if (pop <= 0) continue;
476
- const lch = labToLch([sums[j * 4] / pop, sums[j * 4 + 1] / pop, sums[j * 4 + 2] / pop]);
477
- const room = maxChroma(lch.l, lch.h);
478
- index[j] = clusters.length;
479
- clusters.push({
480
- ...lch,
481
- pop: pop / total,
482
- rel: room > 0 ? clamp(lch.c / room, 0, 1) : 0,
483
- rely: reliability(lch.l)
484
- });
485
- }
486
- members.forEach((bin, i) => clusterOfBin[bin] = index[assignment[i]]);
487
- });
488
- const regionWeights = AMBIENT_REGIONS.map(() => new Float64Array(clusters.length));
489
- const regionLab = AMBIENT_REGIONS.map(() => new Float64Array(clusters.length * 3));
490
- for (let i = 0; i < pixelBins.length; i++) {
491
- const bin = pixelBins[i];
492
- if (bin < 0) continue;
493
- const cluster = clusterOfBin[bin];
494
- const bits = pixelRegions[i];
495
- const w = binSums[bin * 4 + 3];
496
- AMBIENT_REGIONS.forEach((region, r) => {
497
- if (!(bits & REGION_BITS[region])) return;
498
- regionWeights[r][cluster] += 1;
499
- for (let channel = 0; channel < 3; channel++) {
500
- regionLab[r][cluster * 3 + channel] += binSums[bin * 4 + channel] / w;
501
- }
502
- });
503
- }
504
- return { clusters, meanL, regionLab, regionWeights };
505
- }
506
- function analyzeAmbientPixels(pixels, overrides = {}) {
507
- const options = { ...DEFAULT_ANALYSIS, ...overrides };
508
- const { clusters, meanL, regionLab, regionWeights } = clusterAmbientPixels(pixels, options);
509
- const chromatic = clusters.filter(isChromatic);
510
- const presence = chromatic.reduce(
511
- (sum, cluster) => sum + cluster.pop * colorfulness(cluster.c) * cluster.rely,
512
- 0
513
- );
514
- const neutral = presence < MIN_PRESENCE;
515
- const dilution = 0.55 + 0.45 * Math.min(1, presence / 0.25);
516
- const { minContrast, minHueDistance } = options;
517
- const grey = { c: 0, h: 0, l: clamp(meanL, 0.3, 0.8) };
518
- const family = /* @__PURE__ */ new Map();
519
- for (const cluster of chromatic) {
520
- let share2 = 0;
521
- for (const other of chromatic) {
522
- if (hueDistance(cluster.h, other.h) <= 20) share2 += other.pop;
523
- }
524
- family.set(cluster, share2);
525
- }
526
- const share = (cluster) => family.get(cluster) ?? cluster.pop;
527
- const dominantPick = neutral ? null : pickBest(
528
- chromatic,
529
- (cluster) => share(cluster) * cluster.c * cluster.rely * salience(cluster)
530
- );
531
- const vividPick = neutral ? null : pickBest(
532
- chromatic.filter((cluster) => share(cluster) >= MIN_POPULATION),
533
- (cluster) => cluster.c * cluster.c * Math.pow(share(cluster), 0.3) * cluster.rely * salience(cluster)
534
- );
535
- const accentPick = pickBest(
536
- chromatic.filter(
537
- (cluster) => neutral ? share(cluster) >= 6e-3 && cluster.c >= 0.06 : share(cluster) >= MIN_POPULATION && cluster.c >= 0.035 && (!dominantPick || hueDistance(cluster.h, dominantPick.h) >= minHueDistance)
538
- ),
539
- (cluster) => Math.pow(share(cluster), 0.6) * cluster.c * cluster.rely * salience(cluster)
540
- );
541
- const mutedPick = neutral ? null : pickBest(
542
- chromatic.filter((cluster) => cluster.c <= 0.09),
543
- (cluster) => share(cluster) * cluster.rely * (1 - cluster.c / 0.12)
544
- );
545
- const dominantHue = dominantPick?.h ?? vividPick?.h ?? 0;
546
- const accentSource = accentPick ?? vividPick;
547
- const roles = {
548
- dominant: buildSwatch(
549
- roleTone(dominantPick, { cap: 0.2, gain: 1.15, max: 0.74, min: 0.42 }, grey),
550
- dominantPick ? share(dominantPick) : 0,
551
- true,
552
- minContrast
553
- ),
554
- vibrant: buildSwatch(
555
- roleTone(
556
- vividPick,
557
- { cap: 0.22, gain: 1.35, max: 0.84, min: 0.62 },
558
- { c: 0, h: dominantHue, l: 0.78 },
559
- dilution
560
- ),
561
- vividPick ? share(vividPick) : 0,
562
- true,
563
- minContrast
564
- ),
565
- muted: buildSwatch(
566
- roleTone(
567
- mutedPick,
568
- { cap: 0.07, gain: 1, max: 0.66, min: 0.38 },
569
- { c: dominantPick ? 0.035 : 0, h: dominantHue, l: clamp(meanL, 0.38, 0.66) }
570
- ),
571
- mutedPick ? share(mutedPick) : 0,
572
- Boolean(mutedPick) || neutral,
573
- minContrast
574
- ),
575
- accent: buildSwatch(
576
- roleTone(
577
- accentSource,
578
- { cap: 0.22, gain: 1.3, max: 0.8, min: 0.55 },
579
- { c: 0, h: dominantHue, l: 0.72 },
580
- dilution
581
- ),
582
- accentSource ? share(accentSource) : 0,
583
- Boolean(accentPick),
584
- minContrast
585
- )
586
- };
587
- const shadowPick = neutral ? null : pickBest(
588
- clusters.filter(
589
- (cluster) => cluster.l <= 0.5 && cluster.c >= 0.02 && cluster.pop >= 0.02
590
- ),
591
- (cluster) => cluster.pop * cluster.rel * smoothstep(0.05, 0.14, cluster.l)
592
- );
593
- const deepSource = shadowPick ?? dominantPick;
594
- const shadowL = clamp(
595
- options.shadowLightness + (meanL - 0.45) * 0.06,
596
- options.shadowLightness - 0.02,
597
- options.shadowLightness + 0.02
598
- );
599
- const shadow = deepSource ? toneOf(deepSource.h, shadowL, clamp(0.3 + 0.7 * deepSource.rel, 0, 0.85), 0.1) : { c: 0, h: 0, l: shadowL };
600
- const regions = {};
601
- AMBIENT_REGIONS.forEach((region, r) => {
602
- const weights = regionWeights[r];
603
- const lab = regionLab[r];
604
- let regionTotal = 0;
605
- let regionL = 0;
606
- clusters.forEach((cluster, j) => {
607
- regionTotal += weights[j];
608
- regionL += cluster.l * weights[j];
609
- });
610
- let strength = 0;
611
- let pick = null;
612
- let pickScore = 0;
613
- clusters.forEach((_, j) => {
614
- const count = weights[j];
615
- if (count <= 0) return;
616
- const local = labToLch([lab[j * 3] / count, lab[j * 3 + 1] / count, lab[j * 3 + 2] / count]);
617
- const rely = reliability(local.l);
618
- if (local.c < MIN_CHROMA || rely <= 0) return;
619
- const part = count / regionTotal;
620
- strength += part * colorfulness(local.c) * rely;
621
- const score = part * local.c * rely * salience(local);
622
- if (score > pickScore) {
623
- pickScore = score;
624
- pick = local;
625
- }
626
- });
627
- const chosen = neutral || strength < MIN_PRESENCE ? null : pick;
628
- const tone = chosen ? fitTone(
629
- chosen.h,
630
- clamp(chosen.l, 0.42, 0.72),
631
- roleChroma(chosen, { cap: 0.18, gain: 1.15 })
632
- ) : {
633
- c: 0,
634
- h: 0,
635
- l: clamp(regionTotal > 0 ? regionL / regionTotal : meanL, 0.3, 0.7)
636
- };
637
- regions[region] = {
638
- c: round3(tone.c),
639
- color: formatOklch(tone),
640
- h: Math.round(tone.h * 10) / 10,
641
- l: round3(tone.l),
642
- strength: round3(chosen ? clamp(strength, 0, 1) : 0)
643
- };
644
- });
645
- return {
646
- neutral,
647
- regions,
648
- roles,
649
- shadow: formatOklch(shadow)
650
- };
651
- }
652
- function fitSample(width, height, size) {
653
- const scale = Math.min(1, size / Math.max(width, height, 1));
654
- return {
655
- height: Math.max(1, Math.round(height * scale)),
656
- width: Math.max(1, Math.round(width * scale))
657
- };
658
- }
659
-
660
- // src/modules/ambient/pipeline.ts
661
- async function fetchImageBlob(src, proxyUrl) {
662
- if (typeof fetch !== "function") return null;
663
- const read = async (url, init) => {
664
- const response = await fetch(url, { ...init, mode: "cors" });
665
- if (!response.ok) return null;
666
- const blob = await response.blob();
667
- return blob.type.startsWith("text/") ? null : blob;
668
- };
669
- try {
670
- const blob = await read(src);
671
- if (blob) return blob;
672
- } catch {
673
- if (isCrossOrigin(src)) {
674
- try {
675
- const blob = await read(src, { cache: "reload" });
676
- if (blob) return blob;
677
- } catch {
678
- }
679
- }
680
- }
681
- if (proxyUrl) {
682
- try {
683
- return await read(proxyUrl);
684
- } catch {
685
- }
686
- }
687
- return null;
688
- }
689
- function isCrossOrigin(url) {
690
- try {
691
- return new URL(url).origin !== globalThis.location?.origin;
692
- } catch {
693
- return false;
694
- }
695
- }
696
- function createContext2D(width, height) {
697
- if (typeof OffscreenCanvas === "function") {
698
- return new OffscreenCanvas(width, height).getContext("2d", {
699
- willReadFrequently: true
700
- });
701
- }
702
- if (typeof document !== "undefined") {
703
- const canvas = document.createElement("canvas");
704
- canvas.width = width;
705
- canvas.height = height;
706
- return canvas.getContext("2d", { willReadFrequently: true });
707
- }
708
- return null;
709
- }
710
- function readPixels(image, sourceWidth, sourceHeight, size) {
711
- const { height, width } = fitSample(sourceWidth, sourceHeight, size);
712
- const context = createContext2D(width, height);
713
- if (!context) return null;
714
- context.drawImage(image, 0, 0, width, height);
715
- return { data: context.getImageData(0, 0, width, height).data, height, width };
716
- }
717
- async function decodeBlob(blob, size) {
718
- if (typeof createImageBitmap !== "function") return null;
719
- let bitmap;
720
- try {
721
- bitmap = await createImageBitmap(blob, {
722
- resizeQuality: "medium",
723
- resizeWidth: size
724
- });
725
- } catch {
726
- bitmap = await createImageBitmap(blob);
727
- }
728
- try {
729
- return readPixels(bitmap, bitmap.width, bitmap.height, size);
730
- } finally {
731
- bitmap.close();
732
- }
733
- }
734
- var canDecodeHere = () => typeof createImageBitmap === "function" && (typeof OffscreenCanvas === "function" || typeof document !== "undefined");
735
- async function extractHere(request) {
736
- if (!canDecodeHere()) return { supported: false };
737
- const blob = await fetchImageBlob(request.src, request.proxyUrl);
738
- if (!blob) return { palette: null, supported: true };
739
- try {
740
- const pixels = await decodeBlob(blob, request.analysis.sampleSize);
741
- return {
742
- palette: pixels ? analyzeAmbientPixels(pixels, request.analysis) : null,
743
- supported: true
744
- };
745
- } catch {
746
- return { palette: null, supported: true };
747
- }
748
- }
749
-
750
- // src/modules/ambient/worker/index.ts
751
- var AMBIENT_WORKER_REQUEST = "ambient:extract";
752
- var AMBIENT_WORKER_RESPONSE = "ambient:palette";
753
-
754
- // src/modules/ambient/extractor.ts
755
- var WORKER_PATIENCE = 15e3;
756
- var paletteCache = /* @__PURE__ */ new Map();
757
- var inFlight = /* @__PURE__ */ new Map();
758
- function cachePalette(key, palette) {
759
- paletteCache.delete(key);
760
- const limit = Math.max(1, getAmbientSettings().cacheLimit);
761
- while (paletteCache.size >= limit) {
762
- const oldest = paletteCache.keys().next().value;
763
- if (oldest === void 0) break;
764
- paletteCache.delete(oldest);
765
- }
766
- paletteCache.set(key, palette);
767
- }
768
- function primeAmbientPalette(src, palette) {
769
- if (src && palette) cachePalette(src, { ...palette, source: src });
770
- }
771
- function getCachedAmbientPalette(src) {
772
- return paletteCache.get(src) ?? null;
773
- }
774
- var slot = null;
775
- var brokenFactories = /* @__PURE__ */ new WeakSet();
776
- function dropWorker(target) {
777
- if (slot === target) slot = null;
778
- target.worker.terminate();
779
- for (const resolve of target.pending.values()) resolve(null);
780
- target.pending.clear();
781
- }
782
- function workerSlot(factory) {
783
- if (slot?.factory === factory) return slot;
784
- if (slot) dropWorker(slot);
785
- if (brokenFactories.has(factory)) return null;
786
- let worker;
787
- try {
788
- worker = factory();
789
- } catch {
790
- brokenFactories.add(factory);
791
- return null;
792
- }
793
- const created = { factory, next: 1, pending: /* @__PURE__ */ new Map(), worker };
794
- worker.addEventListener("message", (event) => {
795
- const message = event.data;
796
- if (message?.type !== AMBIENT_WORKER_RESPONSE) return;
797
- created.pending.get(message.id)?.(message);
798
- created.pending.delete(message.id);
799
- });
800
- worker.addEventListener("error", () => {
801
- brokenFactories.add(factory);
802
- dropWorker(created);
803
- });
804
- slot = created;
805
- return created;
806
- }
807
- function extractInWorker(factory, request) {
808
- const target = workerSlot(factory);
809
- if (!target) return Promise.resolve(null);
810
- const id = target.next++;
811
- return new Promise((resolve) => {
812
- const timer = setTimeout(() => {
813
- target.pending.delete(id);
814
- resolve(null);
815
- }, WORKER_PATIENCE);
816
- target.pending.set(id, (result) => {
817
- clearTimeout(timer);
818
- resolve(result);
819
- });
820
- target.worker.postMessage({ ...request, id, type: AMBIENT_WORKER_REQUEST });
821
- });
822
- }
823
- function loadImageElement(url) {
824
- return new Promise((resolve) => {
825
- const image = new Image();
826
- image.onload = () => resolve(image);
827
- image.onerror = () => resolve(null);
828
- image.src = url;
829
- });
830
- }
831
- async function extractOnMainThread(request) {
832
- const result = await extractHere(request);
833
- if (result.supported) return result.palette;
834
- const blob = await fetchImageBlob(request.src, request.proxyUrl);
835
- if (!blob || typeof URL.createObjectURL !== "function") return null;
836
- const objectUrl = URL.createObjectURL(blob);
837
- try {
838
- const image = await loadImageElement(objectUrl);
839
- const pixels = image && readPixels(
840
- image,
841
- image.naturalWidth,
842
- image.naturalHeight,
843
- request.analysis.sampleSize
844
- );
845
- return pixels ? analyzeAmbientPixels(pixels, request.analysis) : null;
846
- } catch {
847
- return null;
848
- } finally {
849
- URL.revokeObjectURL(objectUrl);
850
- }
851
- }
852
- function absoluteUrl(src) {
853
- try {
854
- return new URL(src, globalThis.location?.href).href;
855
- } catch {
856
- return src;
857
- }
858
- }
859
- var isCrossOrigin2 = (url) => {
860
- try {
861
- return new URL(url).origin !== globalThis.location?.origin;
862
- } catch {
863
- return false;
864
- }
865
- };
866
- async function extractPalette(src, options) {
867
- const settings = getAmbientSettings();
868
- const strategy = options.strategy ?? settings.strategy;
869
- const absolute = absoluteUrl(src);
870
- const proxy = options.proxy === void 0 ? settings.proxy : options.proxy;
871
- const request = {
872
- analysis: resolveAnalysis(options.analysis),
873
- proxyUrl: isCrossOrigin2(absolute) ? (() => {
874
- const proxied = resolveProxyUrl(proxy, absolute);
875
- return proxied ? absoluteUrl(proxied) : null;
876
- })() : null,
877
- src: absolute
878
- };
879
- if (strategy !== "main" && settings.worker && typeof Worker === "function") {
880
- const result = await extractInWorker(settings.worker, request);
881
- if (result?.supported) return result.palette;
882
- }
883
- if (strategy === "worker") return null;
884
- return extractOnMainThread(request);
885
- }
886
- async function extractPaletteFromImage(imageSource, options = {}) {
887
- const src = typeof imageSource === "string" ? imageSource : imageSource?.src;
888
- if (!src || typeof window === "undefined") return null;
889
- const strategy = options.strategy ?? getAmbientSettings().strategy;
890
- if (strategy === "none") return getCachedAmbientPalette(src);
891
- const key = options.analysis ? `${src}#${JSON.stringify(options.analysis)}` : src;
892
- const cached = paletteCache.get(key);
893
- if (cached) return cached;
894
- let pending = inFlight.get(key);
895
- if (!pending) {
896
- pending = extractPalette(src, options).catch(() => null).then((palette) => {
897
- if (!palette) return null;
898
- const sourced = { ...palette, source: src };
899
- cachePalette(key, sourced);
900
- return sourced;
901
- }).finally(() => inFlight.delete(key));
902
- inFlight.set(key, pending);
903
- }
904
- return pending;
905
- }
906
-
907
- // src/modules/ambient/dom.ts
908
- function resolveCssVarNames(overrides) {
909
- const base = getAmbientSettings().cssVars;
910
- return overrides ? { ...base, ...overrides } : base;
911
- }
912
- var fill = (template, values) => template.replace(
913
- /\{(\w+)\}/g,
914
- (match, key) => key in values ? String(values[key]) : match
915
- );
916
- function resolveTargetElement(target) {
917
- if (typeof document === "undefined") return null;
918
- if (!target) return document.documentElement;
919
- if (typeof target === "string") {
920
- return document.querySelector(target);
921
- }
922
- return "current" in target ? target.current : target;
923
- }
924
- function normalizeColorMap(colors) {
925
- const result = {};
926
- for (const [key, value] of Object.entries(colors)) {
927
- if (!value) continue;
928
- result[key.startsWith("--") ? key : `--color-${key}`] = value;
929
- }
930
- return result;
931
- }
932
- var layersOf = /* @__PURE__ */ new WeakMap();
933
- function paint(element, state, names) {
934
- for (const name of names) {
935
- let value;
936
- for (let i = state.layers.length - 1; i >= 0 && value === void 0; i--) {
937
- value = state.layers[i].vars[name];
938
- }
939
- if (value !== void 0) {
940
- element.style.setProperty(name, value);
941
- continue;
942
- }
943
- const base = state.base.get(name);
944
- if (base?.value) element.style.setProperty(name, base.value, base.priority);
945
- else element.style.removeProperty(name);
946
- }
947
- }
948
- function removeLayer(element, state, layer) {
949
- const index = state.layers.indexOf(layer);
950
- if (index < 0) return;
951
- if (layer.leaving) clearTimeout(layer.leaving);
952
- state.layers.splice(index, 1);
953
- paint(element, state, Object.keys(layer.vars));
954
- if (state.layers.length === 0) layersOf.delete(element);
955
- }
956
- function applyScopedCssVariables(element, varMap, { linger = 0 } = {}) {
957
- const vars = {};
958
- for (const [name, value] of Object.entries(varMap)) {
959
- if (name && value) vars[name] = value;
960
- }
961
- let state = layersOf.get(element);
962
- if (!state) {
963
- state = { base: /* @__PURE__ */ new Map(), layers: [] };
964
- layersOf.set(element, state);
965
- }
966
- for (const layer2 of state.layers.filter((layer3) => layer3.leaving)) {
967
- removeLayer(element, state, layer2);
968
- }
969
- if (!layersOf.has(element)) layersOf.set(element, state);
970
- for (const name of Object.keys(vars)) {
971
- if (state.base.has(name)) continue;
972
- state.base.set(name, {
973
- priority: element.style.getPropertyPriority(name),
974
- value: element.style.getPropertyValue(name)
975
- });
976
- }
977
- const layer = { leaving: null, vars };
978
- state.layers.push(layer);
979
- paint(element, state, Object.keys(vars));
980
- const owner = state;
981
- let released = false;
982
- return () => {
983
- if (released) return;
984
- released = true;
985
- if (linger > 0 && element.isConnected) {
986
- layer.leaving = setTimeout(() => removeLayer(element, owner, layer), linger);
987
- } else {
988
- removeLayer(element, owner, layer);
989
- }
990
- };
991
- }
992
- function paletteVarMap(palette, names = resolveCssVarNames()) {
993
- const varMap = {};
994
- if (!palette) return varMap;
995
- if (names.shadow) varMap[names.shadow] = palette.shadow;
996
- for (const role of AMBIENT_ROLES) {
997
- const swatch = palette.roles[role];
998
- if (names.role) varMap[fill(names.role, { role })] = swatch.color;
999
- if (names.on) varMap[fill(names.on, { role })] = swatch.on;
1000
- if (names.tone && names.tones) {
1001
- for (const tone of names.tones) {
1002
- varMap[fill(names.tone, { role, tone })] = swatch.ramp[tone];
1003
- }
1004
- }
1005
- }
1006
- if (names.region) {
1007
- for (const region of AMBIENT_REGIONS) {
1008
- varMap[fill(names.region, { region })] = palette.regions[region].color;
1009
- }
1010
- }
1011
- return varMap;
1012
- }
1013
- function resolveAmbientVarMap({
1014
- colors = null,
1015
- cssVars = null,
1016
- image = null,
1017
- palette = null
1018
- }) {
1019
- const varMap = image ? paletteVarMap(palette, resolveCssVarNames(cssVars)) : {};
1020
- if (colors) Object.assign(varMap, normalizeColorMap(colors));
1021
- return varMap;
1022
- }
1023
- function useStableObject(value) {
1024
- const ref = useRef(value);
1025
- if (!shallowEqual(ref.current, value)) {
1026
- ref.current = value;
1027
- }
1028
- return ref.current;
1029
- }
1030
- function useAmbientColor(imageSource, options = null) {
1031
- const stableOptions = useStableObject(options);
1032
- const initialPalette = useStableObject(options?.initialPalette ?? null);
1033
- const srcKey = typeof imageSource === "string" ? imageSource : imageSource?.src;
1034
- const seeded = srcKey && initialPalette?.source === srcKey ? initialPalette : null;
1035
- const [result, setResult] = useState(null);
1036
- const settled = result?.source === srcKey ? result : null;
1037
- const isExtracting = Boolean(imageSource && !seeded && !settled);
1038
- useEffect(() => {
1039
- if (seeded && srcKey) primeAmbientPalette(srcKey, seeded);
1040
- }, [seeded, srcKey]);
1041
- useEffect(() => {
1042
- if (!imageSource || !srcKey || seeded) return;
1043
- let active = true;
1044
- void extractPaletteFromImage(imageSource, stableOptions ?? {}).catch(() => null).then((palette2) => {
1045
- if (active) setResult({ palette: palette2, source: srcKey });
1046
- });
1047
- return () => {
1048
- active = false;
1049
- };
1050
- }, [imageSource, seeded, srcKey, stableOptions]);
1051
- const palette = imageSource ? seeded ?? settled?.palette ?? initialPalette : initialPalette;
1052
- return { isExtracting, palette };
1053
- }
1054
- function useAmbientTheme(config = null) {
1055
- const ambientActions = use(AmbientContext)?.actions ?? null;
1056
- const normalizedConfig = typeof config === "string" ? { image: config } : config || {};
1057
- const {
1058
- colors = null,
1059
- cssVars = null,
1060
- image = null,
1061
- initialPalette = null,
1062
- linger,
1063
- options = null,
1064
- scope: scope2 = null,
1065
- transition = true
1066
- } = normalizedConfig;
1067
- const stableInitialPalette = useStableObject(initialPalette);
1068
- const stableOptions = useStableObject(options);
1069
- const stableColors = useStableObject(colors);
1070
- const stableCssVars = useStableObject(cssVars);
1071
- const resolvedOptions = useMemo(
1072
- () => ({
1073
- ...stableOptions || {},
1074
- ...stableInitialPalette ? { initialPalette: stableInitialPalette } : {}
1075
- }),
1076
- [stableInitialPalette, stableOptions]
1077
- );
1078
- const { palette: extractedPalette, isExtracting } = useAmbientColor(
1079
- image,
1080
- resolvedOptions
1081
- );
1082
- const hasActiveConfig = Boolean(image || stableColors);
1083
- useEffect(() => {
1084
- if (!hasActiveConfig || !ambientActions) return;
1085
- ambientActions.setIsExtracting(isExtracting);
1086
- ambientActions.setPalette(
1087
- (prev) => shallowEqual(prev, extractedPalette) ? prev : extractedPalette
1088
- );
1089
- }, [ambientActions, extractedPalette, hasActiveConfig, isExtracting]);
1090
- const transitionClasses = useTheme(ambientTheme).slots.transition.split(/\s+/).filter(Boolean);
1091
- const transitionKey = transitionClasses.join(" ");
1092
- const resolvedVarMap = useMemo(
1093
- () => resolveAmbientVarMap({
1094
- colors: stableColors,
1095
- cssVars: stableCssVars,
1096
- image,
1097
- palette: extractedPalette
1098
- }),
1099
- [extractedPalette, image, stableColors, stableCssVars]
1100
- );
1101
- useEffect(() => {
1102
- if (Object.keys(resolvedVarMap).length === 0) return;
1103
- const targetEl = resolveTargetElement(scope2);
1104
- if (!targetEl) return;
1105
- if (transition) {
1106
- targetEl.classList.add(...transitionKey.split(" ").filter(Boolean));
1107
- }
1108
- const restoreVariables = applyScopedCssVariables(targetEl, resolvedVarMap, {
1109
- linger: linger ?? (scope2 ? 0 : getAmbientSettings().linger)
1110
- });
1111
- return () => {
1112
- restoreVariables();
1113
- if (transition && scope2) {
1114
- targetEl.classList.remove(...transitionKey.split(" ").filter(Boolean));
1115
- }
1116
- };
1117
- }, [linger, resolvedVarMap, scope2, transition, transitionKey]);
1118
- return { isExtracting, palette: extractedPalette };
1119
- }
1120
- function useAmbient(configOrImage) {
1121
- const { actions, store } = useRequiredContext(
1122
- AmbientContext,
1123
- "useAmbient",
1124
- "AmbientProvider"
1125
- );
1126
- const shared = useStore(store);
1127
- const ctx = useMemo(
1128
- () => ({ ...shared, ...actions }),
1129
- [actions, shared]
1130
- );
1131
- const { isExtracting, palette } = useAmbientTheme(configOrImage ?? null);
1132
- const themeState = useMemo(
1133
- () => ({ isExtracting, palette }),
1134
- [isExtracting, palette]
1135
- );
1136
- return useMemo(
1137
- () => configOrImage ? { ...ctx, ...themeState } : ctx,
1138
- [configOrImage, ctx, themeState]
1139
- );
1140
- }
1141
- var firstString = (...values) => values.find((value) => typeof value === "string" && value) ?? null;
1142
- function resolvePageAmbientTheme(slice, posterUrl) {
1143
- const ambient = slice?.ambient;
1144
- const banner = slice?.banner ?? null;
1145
- const defaultImage = banner ?? posterUrl;
1146
- if (ambient === false) return null;
1147
- if (ambient === true || typeof ambient === "string") {
1148
- return { image: typeof ambient === "string" ? ambient : defaultImage };
1149
- }
1150
- if (ambient && typeof ambient === "object") {
1151
- return { image: ambient.image ?? defaultImage, ...ambient };
1152
- }
1153
- if (banner && !posterUrl) return { image: banner };
1154
- return null;
1155
- }
1156
- function selectPageAmbient(config) {
1157
- return {
1158
- ambient: config.ambient,
1159
- banner: firstString(config.dock?.banner, config.dock?.bannerUrl)
1160
- };
1161
- }
1162
- function useAmbientPage(slice, page) {
1163
- const posterUrl = useOptionalBackgroundState(
1164
- (background) => background.posterUrl
1165
- );
1166
- const theme = useMemo(
1167
- () => resolvePageAmbientTheme(slice, posterUrl),
1168
- [posterUrl, slice]
1169
- );
1170
- useAmbientTheme(theme);
1171
- return useMemo(
1172
- () => ({ set: (ambient) => page.set({ ambient }) }),
1173
- [page]
1174
- );
1175
- }
1176
- var ambientModule = defineModule({
1177
- id: "ambient",
1178
- context: AmbientContext,
1179
- Provider: AmbientProvider,
1180
- uses: ["background"],
1181
- page: {
1182
- select: selectPageAmbient,
1183
- use: useAmbientPage
1184
- }
1185
- });
1186
- function resolveValue(value, props) {
1187
- return typeof value === "function" ? value(props) : value;
1188
- }
1189
- function defineAmbient(definition = {}) {
1190
- const { defaultProps, id = "ambient-theme", ...config } = definition;
1191
- const create = (props = {}, { id: overrideId, ...overrides } = {}) => {
1192
- const mergedProps = { ...defaultProps, ...props };
1193
- const merged = { ...config, ...overrides };
1194
- return {
1195
- ...merged,
1196
- colors: resolveValue(merged.colors ?? null, mergedProps) ?? null,
1197
- id: overrideId ?? id,
1198
- image: resolveValue(merged.image ?? null, mergedProps),
1199
- initialPalette: merged.initialPalette ?? null,
1200
- options: { ...config.options, ...overrides.options },
1201
- props: mergedProps,
1202
- scope: merged.scope ?? null,
1203
- transition: merged.transition ?? true
1204
- };
1205
- };
1206
- return Object.freeze({
1207
- config: definition,
1208
- create,
1209
- id,
1210
- use: function useDefinedAmbient(props, overrides) {
1211
- return useAmbientTheme(create(props, overrides));
1212
- }
1213
- });
1214
- }
1215
-
1216
- 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 };
1217
- //# sourceMappingURL=chunk-TG6NMHXI.js.map
1218
- //# sourceMappingURL=chunk-TG6NMHXI.js.map