@omerdlw/base-framework 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1183) hide show
  1. package/MIGRATION.md +75 -0
  2. package/README.md +33 -25
  3. package/dist/ambient/index.d.ts +1 -0
  4. package/dist/ambient/index.js +14 -0
  5. package/dist/ambient/server/index.d.ts +1 -0
  6. package/dist/ambient/server/index.js +238 -0
  7. package/dist/ambient/server/index.js.map +1 -0
  8. package/dist/ambient/worker/index.d.ts +1 -0
  9. package/dist/ambient/worker/index.js +143 -0
  10. package/dist/ambient/worker/index.js.map +1 -0
  11. package/dist/background/index.d.ts +1 -0
  12. package/dist/background/index.js +13 -0
  13. package/dist/chunk-26K6W4OQ.js +1435 -0
  14. package/dist/chunk-26K6W4OQ.js.map +1 -0
  15. package/dist/chunk-2BLGNT5I.js +850 -0
  16. package/dist/chunk-2BLGNT5I.js.map +1 -0
  17. package/dist/chunk-2LGI33JP.js +832 -0
  18. package/dist/chunk-2LGI33JP.js.map +1 -0
  19. package/dist/chunk-37OBXNEO.js +116 -0
  20. package/dist/chunk-37OBXNEO.js.map +1 -0
  21. package/dist/chunk-5GVH4BQV.js +577 -0
  22. package/dist/chunk-5GVH4BQV.js.map +1 -0
  23. package/dist/chunk-5H6FZW3N.js +535 -0
  24. package/dist/chunk-5H6FZW3N.js.map +1 -0
  25. package/dist/chunk-66MHDFNF.js +3488 -0
  26. package/dist/chunk-66MHDFNF.js.map +1 -0
  27. package/dist/chunk-7RSRDKYE.js +22 -0
  28. package/dist/chunk-7RSRDKYE.js.map +1 -0
  29. package/dist/chunk-AAT3QWHN.js +567 -0
  30. package/dist/chunk-AAT3QWHN.js.map +1 -0
  31. package/dist/chunk-BMFHS3GV.js +118 -0
  32. package/dist/chunk-BMFHS3GV.js.map +1 -0
  33. package/dist/chunk-CRKJAACG.js +81 -0
  34. package/dist/chunk-CRKJAACG.js.map +1 -0
  35. package/dist/chunk-CT4UILO2.js +537 -0
  36. package/dist/chunk-CT4UILO2.js.map +1 -0
  37. package/dist/chunk-ESD5EQ5H.js +178 -0
  38. package/dist/chunk-ESD5EQ5H.js.map +1 -0
  39. package/dist/chunk-GQKGOLHJ.js +1766 -0
  40. package/dist/chunk-GQKGOLHJ.js.map +1 -0
  41. package/dist/chunk-IR3DCLBM.js +17 -0
  42. package/dist/chunk-IR3DCLBM.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-J4WUCHNR.js +825 -0
  46. package/dist/chunk-J4WUCHNR.js.map +1 -0
  47. package/dist/chunk-KMN6J5SL.js +493 -0
  48. package/dist/chunk-KMN6J5SL.js.map +1 -0
  49. package/dist/chunk-LA3CQ6NY.js +261 -0
  50. package/dist/chunk-LA3CQ6NY.js.map +1 -0
  51. package/dist/chunk-LTO77WSO.js +140 -0
  52. package/dist/chunk-LTO77WSO.js.map +1 -0
  53. package/dist/chunk-NTUQYA73.js +110 -0
  54. package/dist/chunk-NTUQYA73.js.map +1 -0
  55. package/dist/chunk-OEXWOZPS.js +139 -0
  56. package/dist/chunk-OEXWOZPS.js.map +1 -0
  57. package/dist/chunk-PUD4IB3L.js +15762 -0
  58. package/dist/chunk-PUD4IB3L.js.map +1 -0
  59. package/dist/chunk-RDYYP36I.js +27 -0
  60. package/dist/chunk-RDYYP36I.js.map +1 -0
  61. package/dist/chunk-RF2YGILF.js +656 -0
  62. package/dist/chunk-RF2YGILF.js.map +1 -0
  63. package/dist/chunk-WBBM67WL.js +460 -0
  64. package/dist/chunk-WBBM67WL.js.map +1 -0
  65. package/dist/chunk-WYVA6AN5.js +590 -0
  66. package/dist/chunk-WYVA6AN5.js.map +1 -0
  67. package/dist/chunk-Y2Q74PJP.js +537 -0
  68. package/dist/chunk-Y2Q74PJP.js.map +1 -0
  69. package/dist/chunk-ZE6OGGA7.js +2341 -0
  70. package/dist/chunk-ZE6OGGA7.js.map +1 -0
  71. package/dist/context-menu/index.d.ts +1 -0
  72. package/dist/context-menu/index.js +19 -0
  73. package/dist/controls/index.d.ts +1 -0
  74. package/dist/controls/index.js +10 -0
  75. package/dist/core/error/boundary.d.ts +27 -0
  76. package/dist/core/error/boundary.d.ts.map +1 -0
  77. package/dist/core/error/constants.d.ts +33 -0
  78. package/dist/core/error/constants.d.ts.map +1 -0
  79. package/dist/core/error/index.d.ts +9 -0
  80. package/dist/core/error/index.d.ts.map +1 -0
  81. package/dist/core/error/listener.d.ts +6 -0
  82. package/dist/core/error/listener.d.ts.map +1 -0
  83. package/dist/core/error/reporter.d.ts +49 -0
  84. package/dist/core/error/reporter.d.ts.map +1 -0
  85. package/dist/core/error/theme.d.ts +10 -0
  86. package/dist/core/error/theme.d.ts.map +1 -0
  87. package/dist/core/error/types.d.ts +128 -0
  88. package/dist/core/error/types.d.ts.map +1 -0
  89. package/dist/core/error/utils.d.ts +55 -0
  90. package/dist/core/error/utils.d.ts.map +1 -0
  91. package/dist/core/kernel/adapters.d.ts +9 -0
  92. package/dist/core/kernel/adapters.d.ts.map +1 -0
  93. package/dist/core/kernel/compose.d.ts +21 -0
  94. package/dist/core/kernel/compose.d.ts.map +1 -0
  95. package/dist/core/kernel/constants.d.ts +42 -0
  96. package/dist/core/kernel/constants.d.ts.map +1 -0
  97. package/dist/core/kernel/handlers.d.ts +7 -0
  98. package/dist/core/kernel/handlers.d.ts.map +1 -0
  99. package/dist/core/kernel/hooks.d.ts +13 -0
  100. package/dist/core/kernel/hooks.d.ts.map +1 -0
  101. package/dist/core/kernel/index.d.ts +15 -0
  102. package/dist/core/kernel/index.d.ts.map +1 -0
  103. package/dist/core/kernel/installed.d.ts +28 -0
  104. package/dist/core/kernel/installed.d.ts.map +1 -0
  105. package/dist/core/kernel/module.d.ts +57 -0
  106. package/dist/core/kernel/module.d.ts.map +1 -0
  107. package/dist/core/kernel/operations-records.d.ts +25 -0
  108. package/dist/core/kernel/operations-records.d.ts.map +1 -0
  109. package/dist/core/kernel/operations-resolve.d.ts +5 -0
  110. package/dist/core/kernel/operations-resolve.d.ts.map +1 -0
  111. package/dist/core/kernel/operations.d.ts +23 -0
  112. package/dist/core/kernel/operations.d.ts.map +1 -0
  113. package/dist/core/kernel/page-controller.d.ts +20 -0
  114. package/dist/core/kernel/page-controller.d.ts.map +1 -0
  115. package/dist/core/kernel/provider.d.ts +29 -0
  116. package/dist/core/kernel/provider.d.ts.map +1 -0
  117. package/dist/core/kernel/runtime.d.ts.map +1 -0
  118. package/dist/core/kernel/schema.d.ts +13 -0
  119. package/dist/core/kernel/schema.d.ts.map +1 -0
  120. package/dist/core/kernel/stabilize.d.ts +13 -0
  121. package/dist/core/kernel/stabilize.d.ts.map +1 -0
  122. package/dist/core/kernel/store-batch.d.ts +17 -0
  123. package/dist/core/kernel/store-batch.d.ts.map +1 -0
  124. package/dist/core/kernel/store-entries.d.ts +6 -0
  125. package/dist/core/kernel/store-entries.d.ts.map +1 -0
  126. package/dist/core/kernel/store-handles.d.ts +4 -0
  127. package/dist/core/kernel/store-handles.d.ts.map +1 -0
  128. package/dist/core/kernel/store-registration.d.ts +14 -0
  129. package/dist/core/kernel/store-registration.d.ts.map +1 -0
  130. package/dist/core/kernel/store-snapshots.d.ts +14 -0
  131. package/dist/core/kernel/store-snapshots.d.ts.map +1 -0
  132. package/dist/core/kernel/store-subscriptions.d.ts +16 -0
  133. package/dist/core/kernel/store-subscriptions.d.ts.map +1 -0
  134. package/dist/core/kernel/store.d.ts +8 -0
  135. package/dist/core/kernel/store.d.ts.map +1 -0
  136. package/dist/core/kernel/types-modules.d.ts +82 -0
  137. package/dist/core/kernel/types-modules.d.ts.map +1 -0
  138. package/dist/core/kernel/types-page.d.ts +67 -0
  139. package/dist/core/kernel/types-page.d.ts.map +1 -0
  140. package/dist/core/kernel/types-store.d.ts +71 -0
  141. package/dist/core/kernel/types-store.d.ts.map +1 -0
  142. package/dist/core/kernel/types.d.ts +169 -0
  143. package/dist/core/kernel/types.d.ts.map +1 -0
  144. package/dist/core/kernel/utils.d.ts +21 -0
  145. package/dist/core/kernel/utils.d.ts.map +1 -0
  146. package/dist/core/navigation/constants.d.ts +48 -0
  147. package/dist/core/navigation/constants.d.ts.map +1 -0
  148. package/dist/core/navigation/navigator-defaults.d.ts +4 -0
  149. package/dist/core/navigation/navigator-defaults.d.ts.map +1 -0
  150. package/dist/core/navigation/navigator-holds.d.ts +8 -0
  151. package/dist/core/navigation/navigator-holds.d.ts.map +1 -0
  152. package/dist/core/navigation/navigator-patience.d.ts +15 -0
  153. package/dist/core/navigation/navigator-patience.d.ts.map +1 -0
  154. package/dist/core/navigation/navigator-payload.d.ts +6 -0
  155. package/dist/core/navigation/navigator-payload.d.ts.map +1 -0
  156. package/dist/core/navigation/navigator-prefetch.d.ts +13 -0
  157. package/dist/core/navigation/navigator-prefetch.d.ts.map +1 -0
  158. package/dist/core/navigation/navigator.d.ts +7 -0
  159. package/dist/core/navigation/navigator.d.ts.map +1 -0
  160. package/dist/core/navigation/settings.d.ts +12 -0
  161. package/dist/core/navigation/settings.d.ts.map +1 -0
  162. package/dist/core/navigation/state.d.ts +26 -0
  163. package/dist/core/navigation/state.d.ts.map +1 -0
  164. package/dist/core/navigation/types.d.ts +194 -0
  165. package/dist/core/navigation/types.d.ts.map +1 -0
  166. package/dist/core/navigation/utils.d.ts +18 -0
  167. package/dist/core/navigation/utils.d.ts.map +1 -0
  168. package/dist/core/provider/index.d.ts +31 -0
  169. package/dist/core/provider/index.d.ts.map +1 -0
  170. package/dist/dock/index.d.ts +1 -0
  171. package/dist/dock/index.js +18 -0
  172. package/dist/error/index.d.ts +1 -9
  173. package/dist/error/index.js +8 -5
  174. package/dist/events/index.d.ts +1 -0
  175. package/dist/events/index.js +83 -0
  176. package/dist/events/index.js.map +1 -0
  177. package/dist/foundation/events/index.d.ts +67 -0
  178. package/dist/foundation/events/index.d.ts.map +1 -0
  179. package/dist/foundation/recipes/anatomy.d.ts +139 -0
  180. package/dist/foundation/recipes/anatomy.d.ts.map +1 -0
  181. package/dist/foundation/recipes/cn.d.ts +17 -0
  182. package/dist/foundation/recipes/cn.d.ts.map +1 -0
  183. package/dist/foundation/recipes/define.d.ts +134 -0
  184. package/dist/foundation/recipes/define.d.ts.map +1 -0
  185. package/dist/foundation/recipes/index.d.ts +11 -0
  186. package/dist/foundation/recipes/index.d.ts.map +1 -0
  187. package/dist/foundation/recipes/recipe.d.ts +97 -0
  188. package/dist/foundation/recipes/recipe.d.ts.map +1 -0
  189. package/dist/foundation/recipes/split.d.ts +10 -0
  190. package/dist/foundation/recipes/split.d.ts.map +1 -0
  191. package/dist/foundation/result/index.d.ts +98 -0
  192. package/dist/foundation/result/index.d.ts.map +1 -0
  193. package/dist/foundation/utils/dom.d.ts +19 -0
  194. package/dist/foundation/utils/dom.d.ts.map +1 -0
  195. package/dist/foundation/utils/index.d.ts +17 -0
  196. package/dist/foundation/utils/index.d.ts.map +1 -0
  197. package/dist/foundation/utils/number.d.ts +9 -0
  198. package/dist/foundation/utils/number.d.ts.map +1 -0
  199. package/dist/foundation/utils/object.d.ts +17 -0
  200. package/dist/foundation/utils/object.d.ts.map +1 -0
  201. package/dist/foundation/utils/report.d.ts +18 -0
  202. package/dist/foundation/utils/report.d.ts.map +1 -0
  203. package/dist/foundation/utils/scheduler.d.ts +52 -0
  204. package/dist/foundation/utils/scheduler.d.ts.map +1 -0
  205. package/dist/foundation/utils/store.d.ts +21 -0
  206. package/dist/foundation/utils/store.d.ts.map +1 -0
  207. package/dist/foundation/utils/string.d.ts +18 -0
  208. package/dist/foundation/utils/string.d.ts.map +1 -0
  209. package/dist/foundation/utils/tempo.d.ts +61 -0
  210. package/dist/foundation/utils/tempo.d.ts.map +1 -0
  211. package/dist/foundation/utils/timing.d.ts +13 -0
  212. package/dist/foundation/utils/timing.d.ts.map +1 -0
  213. package/dist/foundation/utils/transform.d.ts +17 -0
  214. package/dist/foundation/utils/transform.d.ts.map +1 -0
  215. package/dist/foundation/utils/user-message.d.ts +32 -0
  216. package/dist/foundation/utils/user-message.d.ts.map +1 -0
  217. package/dist/hooks/index.d.ts +1 -11
  218. package/dist/hooks/index.js +3 -1
  219. package/dist/index.d.ts +8 -10
  220. package/dist/index.d.ts.map +1 -1
  221. package/dist/index.js +25 -20
  222. package/dist/kernel/index.d.ts +1 -15
  223. package/dist/kernel/index.js +5 -2
  224. package/dist/loading/index.d.ts +1 -0
  225. package/dist/loading/index.js +12 -0
  226. package/dist/media/index.d.ts +1 -0
  227. package/dist/media/index.js +9 -0
  228. package/dist/modal/index.d.ts +1 -0
  229. package/dist/modal/index.js +310 -0
  230. package/dist/modal/index.js.map +1 -0
  231. package/dist/modules/ambient/analyze-bounds.d.ts +12 -0
  232. package/dist/modules/ambient/analyze-bounds.d.ts.map +1 -0
  233. package/dist/modules/ambient/analyze-clusters.d.ts +14 -0
  234. package/dist/modules/ambient/analyze-clusters.d.ts.map +1 -0
  235. package/dist/modules/ambient/analyze-measures.d.ts +22 -0
  236. package/dist/modules/ambient/analyze-measures.d.ts.map +1 -0
  237. package/dist/modules/ambient/analyze-swatches.d.ts +16 -0
  238. package/dist/modules/ambient/analyze-swatches.d.ts.map +1 -0
  239. package/dist/modules/ambient/analyze.d.ts +14 -22
  240. package/dist/modules/ambient/analyze.d.ts.map +1 -1
  241. package/dist/modules/ambient/constants.d.ts +4 -1
  242. package/dist/modules/ambient/constants.d.ts.map +1 -1
  243. package/dist/modules/ambient/context.d.ts +6 -0
  244. package/dist/modules/ambient/context.d.ts.map +1 -1
  245. package/dist/modules/ambient/dom.d.ts +25 -2
  246. package/dist/modules/ambient/dom.d.ts.map +1 -1
  247. package/dist/modules/ambient/extractor.d.ts +10 -0
  248. package/dist/modules/ambient/extractor.d.ts.map +1 -1
  249. package/dist/modules/ambient/hooks.d.ts +12 -0
  250. package/dist/modules/ambient/hooks.d.ts.map +1 -1
  251. package/dist/modules/ambient/module.d.ts +12 -1
  252. package/dist/modules/ambient/module.d.ts.map +1 -1
  253. package/dist/modules/ambient/oklab.d.ts +24 -0
  254. package/dist/modules/ambient/oklab.d.ts.map +1 -1
  255. package/dist/modules/ambient/quantize.d.ts +4 -0
  256. package/dist/modules/ambient/quantize.d.ts.map +1 -1
  257. package/dist/modules/ambient/server/address.d.ts +8 -0
  258. package/dist/modules/ambient/server/address.d.ts.map +1 -1
  259. package/dist/modules/ambient/server/index.d.ts +24 -0
  260. package/dist/modules/ambient/server/index.d.ts.map +1 -1
  261. package/dist/modules/ambient/settings.d.ts +26 -0
  262. package/dist/modules/ambient/settings.d.ts.map +1 -1
  263. package/dist/modules/ambient/types.d.ts +100 -1
  264. package/dist/modules/ambient/types.d.ts.map +1 -1
  265. package/dist/modules/ambient/worker/index.d.ts +16 -0
  266. package/dist/modules/ambient/worker/index.d.ts.map +1 -1
  267. package/dist/modules/background/components/background-gradients.d.ts +8 -0
  268. package/dist/modules/background/components/background-gradients.d.ts.map +1 -0
  269. package/dist/modules/background/components/edge-gradient.d.ts +9 -0
  270. package/dist/modules/background/components/edge-gradient.d.ts.map +1 -0
  271. package/dist/modules/background/components/native-video.d.ts +4 -0
  272. package/dist/modules/background/components/native-video.d.ts.map +1 -0
  273. package/dist/modules/background/components/noise-overlay.d.ts +11 -0
  274. package/dist/modules/background/components/noise-overlay.d.ts.map +1 -0
  275. package/dist/modules/background/components/overlay.d.ts +6 -0
  276. package/dist/modules/background/components/overlay.d.ts.map +1 -0
  277. package/dist/modules/background/components/solid-overlay.d.ts +10 -0
  278. package/dist/modules/background/components/solid-overlay.d.ts.map +1 -0
  279. package/dist/modules/background/constants.d.ts +14 -1
  280. package/dist/modules/background/constants.d.ts.map +1 -1
  281. package/dist/modules/background/context.d.ts +7 -0
  282. package/dist/modules/background/context.d.ts.map +1 -1
  283. package/dist/modules/background/hooks/use-background-media-source.d.ts +4 -0
  284. package/dist/modules/background/hooks/use-background-media-source.d.ts.map +1 -0
  285. package/dist/modules/background/hooks/use-background-motion-model.d.ts +15 -0
  286. package/dist/modules/background/hooks/use-background-motion-model.d.ts.map +1 -0
  287. package/dist/modules/background/hooks/use-background-overlay-model.d.ts +929 -0
  288. package/dist/modules/background/hooks/use-background-overlay-model.d.ts.map +1 -0
  289. package/dist/modules/background/hooks/use-native-video-model.d.ts +22 -0
  290. package/dist/modules/background/hooks/use-native-video-model.d.ts.map +1 -0
  291. package/dist/modules/background/hooks.d.ts +20 -1
  292. package/dist/modules/background/hooks.d.ts.map +1 -1
  293. package/dist/modules/background/index.d.ts +6 -6
  294. package/dist/modules/background/index.d.ts.map +1 -1
  295. package/dist/modules/background/lib/theme.d.ts +4 -0
  296. package/dist/modules/background/lib/theme.d.ts.map +1 -0
  297. package/dist/modules/background/model/override.d.ts +14 -0
  298. package/dist/modules/background/model/override.d.ts.map +1 -0
  299. package/dist/modules/background/model/playback.d.ts +25 -0
  300. package/dist/modules/background/model/playback.d.ts.map +1 -0
  301. package/dist/modules/background/model/state.d.ts +31 -0
  302. package/dist/modules/background/model/state.d.ts.map +1 -0
  303. package/dist/modules/background/model/video-frame.d.ts +31 -0
  304. package/dist/modules/background/model/video-frame.d.ts.map +1 -0
  305. package/dist/modules/background/model/visual.d.ts +932 -0
  306. package/dist/modules/background/model/visual.d.ts.map +1 -0
  307. package/dist/modules/background/module.d.ts +11 -0
  308. package/dist/modules/background/module.d.ts.map +1 -1
  309. package/dist/modules/background/motion.d.ts.map +1 -1
  310. package/dist/modules/background/types.d.ts +66 -3
  311. package/dist/modules/background/types.d.ts.map +1 -1
  312. package/dist/modules/background/youtube/components/player.d.ts +7 -0
  313. package/dist/modules/background/youtube/components/player.d.ts.map +1 -0
  314. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts +27 -0
  315. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts.map +1 -0
  316. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts +20 -0
  317. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts.map +1 -0
  318. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts +8 -0
  319. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts.map +1 -0
  320. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts +16 -0
  321. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts.map +1 -0
  322. package/dist/modules/background/youtube/lib/audio.d.ts +17 -0
  323. package/dist/modules/background/youtube/lib/audio.d.ts.map +1 -0
  324. package/dist/modules/background/youtube/lib/iframe-engine.d.ts +29 -0
  325. package/dist/modules/background/youtube/lib/iframe-engine.d.ts.map +1 -0
  326. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts +47 -0
  327. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts.map +1 -0
  328. package/dist/modules/background/youtube/lib/iframe.d.ts +47 -0
  329. package/dist/modules/background/youtube/lib/iframe.d.ts.map +1 -0
  330. package/dist/modules/background/youtube/lib/parse.d.ts +36 -0
  331. package/dist/modules/background/youtube/lib/parse.d.ts.map +1 -0
  332. package/dist/modules/background/youtube/lib/timing.d.ts +11 -0
  333. package/dist/modules/background/youtube/lib/timing.d.ts.map +1 -0
  334. package/dist/modules/background/youtube/lib/video-events.d.ts +53 -0
  335. package/dist/modules/background/youtube/lib/video-events.d.ts.map +1 -0
  336. package/dist/modules/context-menu/constants.d.ts +30 -1
  337. package/dist/modules/context-menu/constants.d.ts.map +1 -1
  338. package/dist/modules/context-menu/context.d.ts +10 -2
  339. package/dist/modules/context-menu/context.d.ts.map +1 -1
  340. package/dist/modules/context-menu/dom.d.ts +13 -0
  341. package/dist/modules/context-menu/dom.d.ts.map +1 -1
  342. package/dist/modules/context-menu/hooks.d.ts +32 -5
  343. package/dist/modules/context-menu/hooks.d.ts.map +1 -1
  344. package/dist/modules/context-menu/items.d.ts +25 -0
  345. package/dist/modules/context-menu/items.d.ts.map +1 -1
  346. package/dist/modules/context-menu/module.d.ts +6 -0
  347. package/dist/modules/context-menu/module.d.ts.map +1 -1
  348. package/dist/modules/context-menu/motion.d.ts.map +1 -1
  349. package/dist/modules/context-menu/overlay.d.ts +30 -8
  350. package/dist/modules/context-menu/overlay.d.ts.map +1 -1
  351. package/dist/modules/context-menu/resolver.d.ts +8 -0
  352. package/dist/modules/context-menu/resolver.d.ts.map +1 -1
  353. package/dist/modules/context-menu/state.d.ts +9 -0
  354. package/dist/modules/context-menu/state.d.ts.map +1 -1
  355. package/dist/modules/context-menu/types.d.ts +85 -3
  356. package/dist/modules/context-menu/types.d.ts.map +1 -1
  357. package/dist/modules/controls/constants.d.ts +18 -1
  358. package/dist/modules/controls/constants.d.ts.map +1 -1
  359. package/dist/modules/controls/entries.d.ts +23 -1
  360. package/dist/modules/controls/entries.d.ts.map +1 -1
  361. package/dist/modules/controls/hooks.d.ts +11 -1
  362. package/dist/modules/controls/hooks.d.ts.map +1 -1
  363. package/dist/modules/controls/layout.d.ts +17 -0
  364. package/dist/modules/controls/layout.d.ts.map +1 -1
  365. package/dist/modules/controls/module.d.ts +7 -1
  366. package/dist/modules/controls/module.d.ts.map +1 -1
  367. package/dist/modules/controls/overlay.d.ts +11 -1
  368. package/dist/modules/controls/overlay.d.ts.map +1 -1
  369. package/dist/modules/controls/types.d.ts +51 -2
  370. package/dist/modules/controls/types.d.ts.map +1 -1
  371. package/dist/modules/dock/components/badge.d.ts +5 -0
  372. package/dist/modules/dock/components/badge.d.ts.map +1 -0
  373. package/dist/modules/dock/components/breadcrumbs-card.d.ts +6 -0
  374. package/dist/modules/dock/components/breadcrumbs-card.d.ts.map +1 -0
  375. package/dist/modules/dock/components/card-banner.d.ts +4 -0
  376. package/dist/modules/dock/components/card-banner.d.ts.map +1 -0
  377. package/dist/modules/dock/components/card-header.d.ts +4 -0
  378. package/dist/modules/dock/components/card-header.d.ts.map +1 -0
  379. package/dist/modules/dock/components/card-item.d.ts +3 -0
  380. package/dist/modules/dock/components/card-item.d.ts.map +1 -0
  381. package/dist/modules/dock/components/command-bar.d.ts +7 -0
  382. package/dist/modules/dock/components/command-bar.d.ts.map +1 -0
  383. package/dist/modules/dock/components/description.d.ts +4 -0
  384. package/dist/modules/dock/components/description.d.ts.map +1 -0
  385. package/dist/modules/dock/components/dock.d.ts +4 -0
  386. package/dist/modules/dock/components/dock.d.ts.map +1 -0
  387. package/dist/modules/dock/components/hud-view.d.ts +7 -0
  388. package/dist/modules/dock/components/hud-view.d.ts.map +1 -0
  389. package/dist/modules/dock/components/icon.d.ts +6 -0
  390. package/dist/modules/dock/components/icon.d.ts.map +1 -0
  391. package/dist/modules/dock/components/item-content.d.ts +4 -0
  392. package/dist/modules/dock/components/item-content.d.ts.map +1 -0
  393. package/dist/modules/dock/components/media-action.d.ts +4 -0
  394. package/dist/modules/dock/components/media-action.d.ts.map +1 -0
  395. package/dist/modules/dock/components/media-controls.d.ts +4 -0
  396. package/dist/modules/dock/components/media-controls.d.ts.map +1 -0
  397. package/dist/modules/dock/components/media-scrubber.d.ts +5 -0
  398. package/dist/modules/dock/components/media-scrubber.d.ts.map +1 -0
  399. package/dist/modules/dock/components/status-actions.d.ts +10 -0
  400. package/dist/modules/dock/components/status-actions.d.ts.map +1 -0
  401. package/dist/modules/dock/components/surface/action.d.ts +17 -0
  402. package/dist/modules/dock/components/surface/action.d.ts.map +1 -0
  403. package/dist/modules/dock/components/surface/controls.d.ts +12 -0
  404. package/dist/modules/dock/components/surface/controls.d.ts.map +1 -0
  405. package/dist/modules/dock/components/surface/extensions-bar.d.ts +5 -0
  406. package/dist/modules/dock/components/surface/extensions-bar.d.ts.map +1 -0
  407. package/dist/modules/dock/components/surface/header-button.d.ts +14 -0
  408. package/dist/modules/dock/components/surface/header-button.d.ts.map +1 -0
  409. package/dist/modules/dock/components/surface/item-content.d.ts +6 -0
  410. package/dist/modules/dock/components/surface/item-content.d.ts.map +1 -0
  411. package/dist/modules/dock/components/surface/shell.d.ts +3 -0
  412. package/dist/modules/dock/components/surface/shell.d.ts.map +1 -0
  413. package/dist/modules/dock/components/title.d.ts +4 -0
  414. package/dist/modules/dock/components/title.d.ts.map +1 -0
  415. package/dist/modules/dock/constants.d.ts +11 -2
  416. package/dist/modules/dock/constants.d.ts.map +1 -1
  417. package/dist/modules/dock/context.d.ts +8 -2
  418. package/dist/modules/dock/context.d.ts.map +1 -1
  419. package/dist/modules/dock/hooks/use-action-slot.d.ts +6 -0
  420. package/dist/modules/dock/hooks/use-action-slot.d.ts.map +1 -0
  421. package/dist/modules/dock/hooks/use-badge.d.ts +4 -0
  422. package/dist/modules/dock/hooks/use-badge.d.ts.map +1 -0
  423. package/dist/modules/dock/hooks/use-card-banner-model.d.ts +18 -0
  424. package/dist/modules/dock/hooks/use-card-banner-model.d.ts.map +1 -0
  425. package/dist/modules/dock/hooks/use-card-header-model.d.ts +7 -0
  426. package/dist/modules/dock/hooks/use-card-header-model.d.ts.map +1 -0
  427. package/dist/modules/dock/hooks/use-card-item-model.d.ts +1612 -0
  428. package/dist/modules/dock/hooks/use-card-item-model.d.ts.map +1 -0
  429. package/dist/modules/dock/hooks/use-command-bar-model.d.ts +12 -0
  430. package/dist/modules/dock/hooks/use-command-bar-model.d.ts.map +1 -0
  431. package/dist/modules/dock/hooks/use-dock-banner.d.ts +11 -0
  432. package/dist/modules/dock/hooks/use-dock-banner.d.ts.map +1 -0
  433. package/dist/modules/dock/hooks/use-dock-config.d.ts +19 -0
  434. package/dist/modules/dock/hooks/use-dock-config.d.ts.map +1 -0
  435. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts +7 -0
  436. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts.map +1 -0
  437. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts +7 -0
  438. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts.map +1 -0
  439. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +6 -0
  440. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +1 -0
  441. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts +11 -0
  442. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts.map +1 -0
  443. package/dist/modules/dock/hooks/use-dock-registration.d.ts +8 -0
  444. package/dist/modules/dock/hooks/use-dock-registration.d.ts.map +1 -0
  445. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts +2 -0
  446. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts.map +1 -0
  447. package/dist/modules/dock/hooks/use-dock-theme.d.ts +6 -0
  448. package/dist/modules/dock/hooks/use-dock-theme.d.ts.map +1 -0
  449. package/dist/modules/dock/hooks/use-dock-viewport.d.ts +6 -0
  450. package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +1 -0
  451. package/dist/modules/dock/hooks/use-element-height.d.ts +3 -0
  452. package/dist/modules/dock/hooks/use-element-height.d.ts.map +1 -0
  453. package/dist/modules/dock/hooks/use-hud-registry.d.ts +16 -0
  454. package/dist/modules/dock/hooks/use-hud-registry.d.ts.map +1 -0
  455. package/dist/modules/dock/hooks/use-hud-view-model.d.ts +9 -0
  456. package/dist/modules/dock/hooks/use-hud-view-model.d.ts.map +1 -0
  457. package/dist/modules/dock/hooks/use-media-controls-model.d.ts +27 -0
  458. package/dist/modules/dock/hooks/use-media-controls-model.d.ts.map +1 -0
  459. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts +27 -0
  460. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts.map +1 -0
  461. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts +12 -0
  462. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts.map +1 -0
  463. package/dist/modules/dock/hooks/use-surface-return.d.ts +8 -0
  464. package/dist/modules/dock/hooks/use-surface-return.d.ts.map +1 -0
  465. package/dist/modules/dock/hud.d.ts +8 -34
  466. package/dist/modules/dock/hud.d.ts.map +1 -1
  467. package/dist/modules/dock/index.d.ts +18 -12
  468. package/dist/modules/dock/index.d.ts.map +1 -1
  469. package/dist/modules/dock/lib/banner.d.ts +43 -0
  470. package/dist/modules/dock/lib/banner.d.ts.map +1 -0
  471. package/dist/modules/dock/lib/card-item.d.ts +46 -0
  472. package/dist/modules/dock/lib/card-item.d.ts.map +1 -0
  473. package/dist/modules/dock/lib/card.d.ts +20 -0
  474. package/dist/modules/dock/lib/card.d.ts.map +1 -0
  475. package/dist/modules/dock/lib/command-bar.d.ts +8 -0
  476. package/dist/modules/dock/lib/command-bar.d.ts.map +1 -0
  477. package/dist/modules/dock/lib/dom.d.ts +7 -0
  478. package/dist/modules/dock/lib/dom.d.ts.map +1 -0
  479. package/dist/modules/dock/lib/element-helpers.d.ts +8 -0
  480. package/dist/modules/dock/lib/element-helpers.d.ts.map +1 -0
  481. package/dist/modules/dock/lib/helpers.d.ts +19 -0
  482. package/dist/modules/dock/lib/helpers.d.ts.map +1 -0
  483. package/dist/modules/dock/lib/media.d.ts +35 -0
  484. package/dist/modules/dock/lib/media.d.ts.map +1 -0
  485. package/dist/modules/dock/lib/styles.d.ts +902 -0
  486. package/dist/modules/dock/lib/styles.d.ts.map +1 -0
  487. package/dist/modules/dock/model/hud-definition.d.ts +13 -0
  488. package/dist/modules/dock/model/hud-definition.d.ts.map +1 -0
  489. package/dist/modules/dock/model/hud.d.ts +10 -0
  490. package/dist/modules/dock/model/hud.d.ts.map +1 -0
  491. package/dist/modules/dock/model/layout.d.ts +28 -0
  492. package/dist/modules/dock/model/layout.d.ts.map +1 -0
  493. package/dist/modules/dock/model/page-entry.d.ts +11 -0
  494. package/dist/modules/dock/model/page-entry.d.ts.map +1 -0
  495. package/dist/modules/dock/model/page-surface.d.ts +4 -0
  496. package/dist/modules/dock/model/page-surface.d.ts.map +1 -0
  497. package/dist/modules/dock/model/paths.d.ts +15 -0
  498. package/dist/modules/dock/model/paths.d.ts.map +1 -0
  499. package/dist/modules/dock/model/state.d.ts +28 -0
  500. package/dist/modules/dock/model/state.d.ts.map +1 -0
  501. package/dist/modules/dock/model/surface-return.d.ts +14 -0
  502. package/dist/modules/dock/model/surface-return.d.ts.map +1 -0
  503. package/dist/modules/dock/module.d.ts +5 -7
  504. package/dist/modules/dock/module.d.ts.map +1 -1
  505. package/dist/modules/dock/motion.d.ts +716 -5
  506. package/dist/modules/dock/motion.d.ts.map +1 -1
  507. package/dist/modules/dock/provider.d.ts +2 -1
  508. package/dist/modules/dock/provider.d.ts.map +1 -1
  509. package/dist/modules/dock/routing/breadcrumbs.d.ts +6 -2
  510. package/dist/modules/dock/routing/breadcrumbs.d.ts.map +1 -1
  511. package/dist/modules/dock/routing/continuity.d.ts +46 -14
  512. package/dist/modules/dock/routing/continuity.d.ts.map +1 -1
  513. package/dist/modules/dock/routing/guards.d.ts +10 -1
  514. package/dist/modules/dock/routing/guards.d.ts.map +1 -1
  515. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts +12 -0
  516. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts.map +1 -0
  517. package/dist/modules/dock/routing/lib/restore.d.ts +7 -0
  518. package/dist/modules/dock/routing/lib/restore.d.ts.map +1 -0
  519. package/dist/modules/dock/routing/model/continuity.d.ts +21 -0
  520. package/dist/modules/dock/routing/model/continuity.d.ts.map +1 -0
  521. package/dist/modules/dock/routing/model/policy.d.ts +7 -0
  522. package/dist/modules/dock/routing/model/policy.d.ts.map +1 -0
  523. package/dist/modules/dock/routing/model/topology.d.ts +5 -0
  524. package/dist/modules/dock/routing/model/topology.d.ts.map +1 -0
  525. package/dist/modules/dock/routing/navigation.d.ts +10 -22
  526. package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
  527. package/dist/modules/dock/runtime/commands.d.ts +10 -1
  528. package/dist/modules/dock/runtime/commands.d.ts.map +1 -1
  529. package/dist/modules/dock/runtime/display.d.ts +9 -42
  530. package/dist/modules/dock/runtime/display.d.ts.map +1 -1
  531. package/dist/modules/dock/runtime/dock.d.ts +11 -70
  532. package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
  533. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts +10 -0
  534. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts.map +1 -0
  535. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts +10 -0
  536. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts.map +1 -0
  537. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts +14 -0
  538. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts.map +1 -0
  539. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts +7 -0
  540. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts.map +1 -0
  541. package/dist/modules/dock/runtime/hooks/use-dock.d.ts +30 -0
  542. package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +1 -0
  543. package/dist/modules/dock/runtime/model/attention.d.ts +25 -0
  544. package/dist/modules/dock/runtime/model/attention.d.ts.map +1 -0
  545. package/dist/modules/dock/runtime/model/cards.d.ts +64 -0
  546. package/dist/modules/dock/runtime/model/cards.d.ts.map +1 -0
  547. package/dist/modules/dock/runtime/model/items.d.ts +31 -0
  548. package/dist/modules/dock/runtime/model/items.d.ts.map +1 -0
  549. package/dist/modules/dock/runtime/model/layout.d.ts +10 -0
  550. package/dist/modules/dock/runtime/model/layout.d.ts.map +1 -0
  551. package/dist/modules/dock/runtime/pipeline.d.ts +1 -1
  552. package/dist/modules/dock/runtime/pipeline.d.ts.map +1 -1
  553. package/dist/modules/dock/runtime/provider-actions.d.ts +38 -0
  554. package/dist/modules/dock/runtime/provider-actions.d.ts.map +1 -0
  555. package/dist/modules/dock/status/action-options.d.ts +35 -0
  556. package/dist/modules/dock/status/action-options.d.ts.map +1 -0
  557. package/dist/modules/dock/status/events.d.ts +2 -2
  558. package/dist/modules/dock/status/events.d.ts.map +1 -1
  559. package/dist/modules/dock/status/hooks.d.ts +1 -1
  560. package/dist/modules/dock/status/hooks.d.ts.map +1 -1
  561. package/dist/modules/dock/status/model.d.ts +12 -32
  562. package/dist/modules/dock/status/model.d.ts.map +1 -1
  563. package/dist/modules/dock/status/state.d.ts +12 -0
  564. package/dist/modules/dock/status/state.d.ts.map +1 -0
  565. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts +5 -0
  566. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts.map +1 -0
  567. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts +7 -0
  568. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts.map +1 -0
  569. package/dist/modules/dock/surface/constants.d.ts +5 -0
  570. package/dist/modules/dock/surface/constants.d.ts.map +1 -0
  571. package/dist/modules/dock/surface/context.d.ts +14 -1
  572. package/dist/modules/dock/surface/context.d.ts.map +1 -1
  573. package/dist/modules/dock/surface/definition.d.ts +28 -2
  574. package/dist/modules/dock/surface/definition.d.ts.map +1 -1
  575. package/dist/modules/dock/surface/helpers.d.ts +2 -1
  576. package/dist/modules/dock/surface/helpers.d.ts.map +1 -1
  577. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts +15 -0
  578. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts.map +1 -0
  579. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts +7 -0
  580. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts.map +1 -0
  581. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts +14 -0
  582. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts.map +1 -0
  583. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts +20 -0
  584. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts.map +1 -0
  585. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts +13 -0
  586. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts.map +1 -0
  587. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts +28 -0
  588. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts.map +1 -0
  589. package/dist/modules/dock/surface/lib/drag.d.ts +9 -0
  590. package/dist/modules/dock/surface/lib/drag.d.ts.map +1 -0
  591. package/dist/modules/dock/surface/lib/target.d.ts +8 -0
  592. package/dist/modules/dock/surface/lib/target.d.ts.map +1 -0
  593. package/dist/modules/dock/surface/machine.d.ts +17 -62
  594. package/dist/modules/dock/surface/machine.d.ts.map +1 -1
  595. package/dist/modules/dock/surface/model/builder.d.ts +39 -0
  596. package/dist/modules/dock/surface/model/builder.d.ts.map +1 -0
  597. package/dist/modules/dock/surface/model/normalize.d.ts +13 -0
  598. package/dist/modules/dock/surface/model/normalize.d.ts.map +1 -0
  599. package/dist/modules/dock/surface/model/open.d.ts +26 -0
  600. package/dist/modules/dock/surface/model/open.d.ts.map +1 -0
  601. package/dist/modules/dock/surface/model/records.d.ts +45 -0
  602. package/dist/modules/dock/surface/model/records.d.ts.map +1 -0
  603. package/dist/modules/dock/surface/model/steps.d.ts +9 -0
  604. package/dist/modules/dock/surface/model/steps.d.ts.map +1 -0
  605. package/dist/modules/dock/surface/model/transition-state.d.ts +23 -0
  606. package/dist/modules/dock/surface/model/transition-state.d.ts.map +1 -0
  607. package/dist/modules/dock/surface/model/url.d.ts +14 -0
  608. package/dist/modules/dock/surface/model/url.d.ts.map +1 -0
  609. package/dist/modules/dock/surface/runtime/choreography.d.ts +22 -0
  610. package/dist/modules/dock/surface/runtime/choreography.d.ts.map +1 -0
  611. package/dist/modules/dock/surface/runtime/context.d.ts +29 -0
  612. package/dist/modules/dock/surface/runtime/context.d.ts.map +1 -0
  613. package/dist/modules/dock/surface/runtime/flows.d.ts +21 -0
  614. package/dist/modules/dock/surface/runtime/flows.d.ts.map +1 -0
  615. package/dist/modules/dock/surface/runtime/open.d.ts +6 -0
  616. package/dist/modules/dock/surface/runtime/open.d.ts.map +1 -0
  617. package/dist/modules/dock/surface/runtime/release.d.ts +9 -0
  618. package/dist/modules/dock/surface/runtime/release.d.ts.map +1 -0
  619. package/dist/modules/dock/surface/runtime/steps.d.ts +10 -0
  620. package/dist/modules/dock/surface/runtime/steps.d.ts.map +1 -0
  621. package/dist/modules/dock/surface/stack.d.ts +20 -11
  622. package/dist/modules/dock/surface/stack.d.ts.map +1 -1
  623. package/dist/modules/dock/surface/view-model.d.ts +5 -1
  624. package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
  625. package/dist/modules/dock/types/card.d.ts +297 -0
  626. package/dist/modules/dock/types/card.d.ts.map +1 -0
  627. package/dist/modules/dock/types/hud.d.ts +142 -0
  628. package/dist/modules/dock/types/hud.d.ts.map +1 -0
  629. package/dist/modules/dock/types/index.d.ts +8 -0
  630. package/dist/modules/dock/types/index.d.ts.map +1 -0
  631. package/dist/modules/dock/types/media.d.ts +66 -0
  632. package/dist/modules/dock/types/media.d.ts.map +1 -0
  633. package/dist/modules/dock/types/routing.d.ts +336 -0
  634. package/dist/modules/dock/types/routing.d.ts.map +1 -0
  635. package/dist/modules/dock/types/surface-flow.d.ts +231 -0
  636. package/dist/modules/dock/types/surface-flow.d.ts.map +1 -0
  637. package/dist/modules/dock/types/surface.d.ts +194 -0
  638. package/dist/modules/dock/types/surface.d.ts.map +1 -0
  639. package/dist/modules/dock/types/theme.d.ts +201 -0
  640. package/dist/modules/dock/types/theme.d.ts.map +1 -0
  641. package/dist/modules/index.d.ts +4 -0
  642. package/dist/modules/index.d.ts.map +1 -1
  643. package/dist/modules/index.js +23 -18
  644. package/dist/modules/loading/constants.d.ts +18 -1
  645. package/dist/modules/loading/constants.d.ts.map +1 -1
  646. package/dist/modules/loading/context.d.ts +11 -1
  647. package/dist/modules/loading/context.d.ts.map +1 -1
  648. package/dist/modules/loading/hooks.d.ts +24 -1
  649. package/dist/modules/loading/hooks.d.ts.map +1 -1
  650. package/dist/modules/loading/module.d.ts +6 -0
  651. package/dist/modules/loading/module.d.ts.map +1 -1
  652. package/dist/modules/loading/overlay.d.ts +3 -0
  653. package/dist/modules/loading/overlay.d.ts.map +1 -1
  654. package/dist/modules/loading/state.d.ts +13 -0
  655. package/dist/modules/loading/state.d.ts.map +1 -1
  656. package/dist/modules/loading/types.d.ts +42 -2
  657. package/dist/modules/loading/types.d.ts.map +1 -1
  658. package/dist/modules/media/constants.d.ts +19 -0
  659. package/dist/modules/media/constants.d.ts.map +1 -1
  660. package/dist/modules/media/context.d.ts +11 -1
  661. package/dist/modules/media/context.d.ts.map +1 -1
  662. package/dist/modules/media/hooks.d.ts +17 -0
  663. package/dist/modules/media/hooks.d.ts.map +1 -1
  664. package/dist/modules/media/module.d.ts +4 -0
  665. package/dist/modules/media/module.d.ts.map +1 -1
  666. package/dist/modules/media/overlay.d.ts +7 -0
  667. package/dist/modules/media/overlay.d.ts.map +1 -1
  668. package/dist/modules/media/playback.d.ts +13 -0
  669. package/dist/modules/media/playback.d.ts.map +1 -1
  670. package/dist/modules/media/session.d.ts +20 -0
  671. package/dist/modules/media/session.d.ts.map +1 -1
  672. package/dist/modules/media/types.d.ts +49 -2
  673. package/dist/modules/media/types.d.ts.map +1 -1
  674. package/dist/modules/modal/components/close-button.d.ts +6 -0
  675. package/dist/modules/modal/components/close-button.d.ts.map +1 -0
  676. package/dist/modules/modal/components/modal-container.d.ts +7 -0
  677. package/dist/modules/modal/components/modal-container.d.ts.map +1 -0
  678. package/dist/modules/modal/components/modal-layer-switcher.d.ts +9 -0
  679. package/dist/modules/modal/components/modal-layer-switcher.d.ts.map +1 -0
  680. package/dist/modules/modal/components/modal-layer.d.ts +17 -0
  681. package/dist/modules/modal/components/modal-layer.d.ts.map +1 -0
  682. package/dist/modules/modal/components/overlay.d.ts +6 -0
  683. package/dist/modules/modal/components/overlay.d.ts.map +1 -0
  684. package/dist/modules/modal/components/resolve-header.d.ts +10 -0
  685. package/dist/modules/modal/components/resolve-header.d.ts.map +1 -0
  686. package/dist/modules/modal/components/slot-row.d.ts +12 -0
  687. package/dist/modules/modal/components/slot-row.d.ts.map +1 -0
  688. package/dist/modules/modal/constants.d.ts +16 -1
  689. package/dist/modules/modal/constants.d.ts.map +1 -1
  690. package/dist/modules/modal/context.d.ts +7 -1
  691. package/dist/modules/modal/context.d.ts.map +1 -1
  692. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts +3 -0
  693. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts.map +1 -0
  694. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts +12 -0
  695. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts.map +1 -0
  696. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts +3 -0
  697. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts.map +1 -0
  698. package/dist/modules/modal/hooks.d.ts +30 -4
  699. package/dist/modules/modal/hooks.d.ts.map +1 -1
  700. package/dist/modules/modal/index.d.ts +7 -6
  701. package/dist/modules/modal/index.d.ts.map +1 -1
  702. package/dist/modules/modal/lib/dom.d.ts +13 -0
  703. package/dist/modules/modal/lib/dom.d.ts.map +1 -0
  704. package/dist/modules/modal/lib/theme.d.ts +4 -0
  705. package/dist/modules/modal/lib/theme.d.ts.map +1 -0
  706. package/dist/modules/modal/model/entry.d.ts +18 -0
  707. package/dist/modules/modal/model/entry.d.ts.map +1 -0
  708. package/dist/modules/modal/model/header.d.ts +16 -0
  709. package/dist/modules/modal/model/header.d.ts.map +1 -0
  710. package/dist/modules/modal/model/identity.d.ts +13 -0
  711. package/dist/modules/modal/model/identity.d.ts.map +1 -0
  712. package/dist/modules/modal/model/layout.d.ts +37 -0
  713. package/dist/modules/modal/model/layout.d.ts.map +1 -0
  714. package/dist/modules/modal/model/state.d.ts +10 -0
  715. package/dist/modules/modal/model/state.d.ts.map +1 -0
  716. package/dist/modules/modal/module.d.ts +7 -0
  717. package/dist/modules/modal/module.d.ts.map +1 -1
  718. package/dist/modules/modal/motion.d.ts.map +1 -1
  719. package/dist/modules/modal/types.d.ts +73 -1
  720. package/dist/modules/modal/types.d.ts.map +1 -1
  721. package/dist/modules/navigation/context.d.ts +16 -4
  722. package/dist/modules/navigation/context.d.ts.map +1 -1
  723. package/dist/modules/navigation/hooks.d.ts +28 -1
  724. package/dist/modules/navigation/hooks.d.ts.map +1 -1
  725. package/dist/modules/navigation/index.d.ts +5 -5
  726. package/dist/modules/navigation/index.d.ts.map +1 -1
  727. package/dist/modules/navigation/listeners.d.ts +10 -1
  728. package/dist/modules/navigation/listeners.d.ts.map +1 -1
  729. package/dist/modules/navigation/module.d.ts +5 -2
  730. package/dist/modules/navigation/module.d.ts.map +1 -1
  731. package/dist/modules/notification/constants.d.ts +22 -2
  732. package/dist/modules/notification/constants.d.ts.map +1 -1
  733. package/dist/modules/notification/context.d.ts +12 -2
  734. package/dist/modules/notification/context.d.ts.map +1 -1
  735. package/dist/modules/notification/hooks.d.ts +32 -1
  736. package/dist/modules/notification/hooks.d.ts.map +1 -1
  737. package/dist/modules/notification/module.d.ts +3 -0
  738. package/dist/modules/notification/module.d.ts.map +1 -1
  739. package/dist/modules/notification/motion.d.ts.map +1 -1
  740. package/dist/modules/notification/overlay.d.ts.map +1 -1
  741. package/dist/modules/notification/state.d.ts +28 -0
  742. package/dist/modules/notification/state.d.ts.map +1 -1
  743. package/dist/modules/notification/types.d.ts +48 -2
  744. package/dist/modules/notification/types.d.ts.map +1 -1
  745. package/dist/navigation/index.d.ts +1 -0
  746. package/dist/navigation/index.js +189 -0
  747. package/dist/navigation/index.js.map +1 -0
  748. package/dist/notification/index.d.ts +1 -0
  749. package/dist/notification/index.js +11 -0
  750. package/dist/overlay-YC336DAS.js +13 -0
  751. package/dist/overlay-YC336DAS.js.map +1 -0
  752. package/dist/provider/index.d.ts +1 -0
  753. package/dist/provider/index.js +14 -0
  754. package/dist/react/context/index.d.ts +4 -0
  755. package/dist/react/context/index.d.ts.map +1 -0
  756. package/dist/react/hooks/index.d.ts +10 -0
  757. package/dist/react/hooks/index.d.ts.map +1 -0
  758. package/dist/react/hooks/types.d.ts +25 -0
  759. package/dist/react/hooks/types.d.ts.map +1 -0
  760. package/dist/react/hooks/use-click-outside.d.ts +6 -0
  761. package/dist/react/hooks/use-click-outside.d.ts.map +1 -0
  762. package/dist/react/hooks/use-controllable-state.d.ts +7 -0
  763. package/dist/react/hooks/use-controllable-state.d.ts.map +1 -0
  764. package/dist/react/hooks/use-fullscreen-state.d.ts +7 -0
  765. package/dist/react/hooks/use-fullscreen-state.d.ts.map +1 -0
  766. package/dist/react/hooks/use-global-event.d.ts +9 -0
  767. package/dist/react/hooks/use-global-event.d.ts.map +1 -0
  768. package/dist/react/hooks/use-hotkey.d.ts +10 -0
  769. package/dist/react/hooks/use-hotkey.d.ts.map +1 -0
  770. package/dist/react/hooks/use-required-context.d.ts +6 -0
  771. package/dist/react/hooks/use-required-context.d.ts.map +1 -0
  772. package/dist/react/hooks/use-scroll-lock.d.ts +9 -0
  773. package/dist/react/hooks/use-scroll-lock.d.ts.map +1 -0
  774. package/dist/react/hooks/use-store.d.ts +3 -0
  775. package/dist/react/hooks/use-store.d.ts.map +1 -0
  776. package/dist/react/theme/index.d.ts +82 -0
  777. package/dist/react/theme/index.d.ts.map +1 -0
  778. package/dist/react/ui/components/avatar.d.ts +6 -0
  779. package/dist/react/ui/components/avatar.d.ts.map +1 -0
  780. package/dist/react/ui/components/button.d.ts +6 -0
  781. package/dist/react/ui/components/button.d.ts.map +1 -0
  782. package/dist/react/ui/components/carousel.d.ts +6 -0
  783. package/dist/react/ui/components/carousel.d.ts.map +1 -0
  784. package/dist/react/ui/components/checkbox.d.ts +10 -0
  785. package/dist/react/ui/components/checkbox.d.ts.map +1 -0
  786. package/dist/react/ui/components/icon.d.ts +6 -0
  787. package/dist/react/ui/components/icon.d.ts.map +1 -0
  788. package/dist/react/ui/components/image.d.ts +6 -0
  789. package/dist/react/ui/components/image.d.ts.map +1 -0
  790. package/dist/react/ui/components/indicator.d.ts +45 -0
  791. package/dist/react/ui/components/indicator.d.ts.map +1 -0
  792. package/dist/react/ui/components/input.d.ts +10 -0
  793. package/dist/react/ui/components/input.d.ts.map +1 -0
  794. package/dist/react/ui/components/loader.d.ts +10 -0
  795. package/dist/react/ui/components/loader.d.ts.map +1 -0
  796. package/dist/react/ui/components/segmented.d.ts +6 -0
  797. package/dist/react/ui/components/segmented.d.ts.map +1 -0
  798. package/dist/react/ui/components/select-parts.d.ts +22 -0
  799. package/dist/react/ui/components/select-parts.d.ts.map +1 -0
  800. package/dist/react/ui/components/select.d.ts +6 -0
  801. package/dist/react/ui/components/select.d.ts.map +1 -0
  802. package/dist/react/ui/components/skeleton.d.ts +10 -0
  803. package/dist/react/ui/components/skeleton.d.ts.map +1 -0
  804. package/dist/react/ui/components/switch.d.ts +6 -0
  805. package/dist/react/ui/components/switch.d.ts.map +1 -0
  806. package/dist/react/ui/components/tooltip.d.ts +11 -0
  807. package/dist/react/ui/components/tooltip.d.ts.map +1 -0
  808. package/dist/react/ui/index.d.ts +19 -0
  809. package/dist/react/ui/index.d.ts.map +1 -0
  810. package/dist/react/ui/provider.d.ts +22 -0
  811. package/dist/react/ui/provider.d.ts.map +1 -0
  812. package/dist/react/ui/types-controls.d.ts +133 -0
  813. package/dist/react/ui/types-controls.d.ts.map +1 -0
  814. package/dist/react/ui/types.d.ts +192 -0
  815. package/dist/react/ui/types.d.ts.map +1 -0
  816. package/dist/react/ui/utils.d.ts +65 -0
  817. package/dist/react/ui/utils.d.ts.map +1 -0
  818. package/dist/recipes/index.d.ts +1 -0
  819. package/dist/recipes/index.js +233 -0
  820. package/dist/recipes/index.js.map +1 -0
  821. package/dist/result/index.d.ts +1 -0
  822. package/dist/result/index.js +98 -0
  823. package/dist/result/index.js.map +1 -0
  824. package/dist/theme/index.d.ts +1 -0
  825. package/dist/theme/index.js +6 -0
  826. package/dist/ui/index.d.ts +1 -19
  827. package/dist/ui/index.js +2158 -1860
  828. package/dist/ui/index.js.map +1 -1
  829. package/dist/utils/index.d.ts +1 -15
  830. package/dist/utils/index.js +194 -71
  831. package/dist/utils/index.js.map +1 -1
  832. package/docs/README.md +58 -61
  833. package/docs/architecture-and-rules.md +134 -58
  834. package/docs/core-engine.md +36 -52
  835. package/docs/custom-modules.md +43 -32
  836. package/docs/design.md +185 -0
  837. package/docs/getting-started.md +49 -57
  838. package/docs/modules/README.md +50 -61
  839. package/docs/modules/ambient.md +95 -87
  840. package/docs/modules/background.md +39 -36
  841. package/docs/modules/context-menu.md +19 -18
  842. package/docs/modules/controls.md +13 -13
  843. package/docs/modules/dock.md +74 -93
  844. package/docs/modules/error-boundary.md +2 -2
  845. package/docs/modules/kernel.md +38 -26
  846. package/docs/modules/loading.md +14 -14
  847. package/docs/modules/media.md +13 -13
  848. package/docs/modules/modal.md +14 -14
  849. package/docs/modules/navigation.md +87 -84
  850. package/docs/modules/notification.md +13 -13
  851. package/docs/modules/result.md +22 -22
  852. package/docs/proposals/navigation.md +32 -31
  853. package/docs/testing.md +34 -28
  854. package/docs/theming.md +67 -44
  855. package/package.json +100 -97
  856. package/templates/AGENTS.md +35 -25
  857. package/dist/atoms/button.d.ts +0 -11
  858. package/dist/atoms/button.d.ts.map +0 -1
  859. package/dist/atoms/icon.d.ts +0 -15
  860. package/dist/atoms/icon.d.ts.map +0 -1
  861. package/dist/atoms/index.d.ts +0 -5
  862. package/dist/atoms/index.d.ts.map +0 -1
  863. package/dist/atoms/index.js +0 -4
  864. package/dist/atoms/spinner.d.ts +0 -9
  865. package/dist/atoms/spinner.d.ts.map +0 -1
  866. package/dist/atoms/tooltip.d.ts +0 -18
  867. package/dist/atoms/tooltip.d.ts.map +0 -1
  868. package/dist/chunk-6UFMD6TK.js +0 -419
  869. package/dist/chunk-6UFMD6TK.js.map +0 -1
  870. package/dist/chunk-AA2TWJQI.js +0 -2186
  871. package/dist/chunk-AA2TWJQI.js.map +0 -1
  872. package/dist/chunk-ACLLDU3J.js +0 -888
  873. package/dist/chunk-ACLLDU3J.js.map +0 -1
  874. package/dist/chunk-DGCQWQLZ.js +0 -61
  875. package/dist/chunk-DGCQWQLZ.js.map +0 -1
  876. package/dist/chunk-E6ANX5YP.js +0 -1273
  877. package/dist/chunk-E6ANX5YP.js.map +0 -1
  878. package/dist/chunk-GDCVEINL.js +0 -408
  879. package/dist/chunk-GDCVEINL.js.map +0 -1
  880. package/dist/chunk-GN666KV5.js +0 -28
  881. package/dist/chunk-GN666KV5.js.map +0 -1
  882. package/dist/chunk-HCSDQEFB.js +0 -845
  883. package/dist/chunk-HCSDQEFB.js.map +0 -1
  884. package/dist/chunk-HMEWYAWU.js +0 -1889
  885. package/dist/chunk-HMEWYAWU.js.map +0 -1
  886. package/dist/chunk-I3IZUBBU.js +0 -97
  887. package/dist/chunk-I3IZUBBU.js.map +0 -1
  888. package/dist/chunk-JCZUCKI3.js +0 -27
  889. package/dist/chunk-JCZUCKI3.js.map +0 -1
  890. package/dist/chunk-MAGYFVKH.js +0 -67
  891. package/dist/chunk-MAGYFVKH.js.map +0 -1
  892. package/dist/chunk-NEBGCFE3.js +0 -521
  893. package/dist/chunk-NEBGCFE3.js.map +0 -1
  894. package/dist/chunk-NK2DQB3G.js +0 -306
  895. package/dist/chunk-NK2DQB3G.js.map +0 -1
  896. package/dist/chunk-QI3ALLIB.js +0 -38
  897. package/dist/chunk-QI3ALLIB.js.map +0 -1
  898. package/dist/chunk-QM2P6TIU.js +0 -353
  899. package/dist/chunk-QM2P6TIU.js.map +0 -1
  900. package/dist/chunk-RFP2DJAB.js +0 -658
  901. package/dist/chunk-RFP2DJAB.js.map +0 -1
  902. package/dist/chunk-SQ7XZMCN.js +0 -481
  903. package/dist/chunk-SQ7XZMCN.js.map +0 -1
  904. package/dist/chunk-TMTMQNEQ.js +0 -372
  905. package/dist/chunk-TMTMQNEQ.js.map +0 -1
  906. package/dist/chunk-VDNE3A7X.js +0 -9724
  907. package/dist/chunk-VDNE3A7X.js.map +0 -1
  908. package/dist/chunk-XATRMFGU.js +0 -139
  909. package/dist/chunk-XATRMFGU.js.map +0 -1
  910. package/dist/chunk-ZAP2YHZG.js +0 -454
  911. package/dist/chunk-ZAP2YHZG.js.map +0 -1
  912. package/dist/chunk-ZH5FUYPG.js +0 -349
  913. package/dist/chunk-ZH5FUYPG.js.map +0 -1
  914. package/dist/chunk-ZKM4RETZ.js +0 -51
  915. package/dist/chunk-ZKM4RETZ.js.map +0 -1
  916. package/dist/error/boundary.d.ts +0 -14
  917. package/dist/error/boundary.d.ts.map +0 -1
  918. package/dist/error/constants.d.ts +0 -18
  919. package/dist/error/constants.d.ts.map +0 -1
  920. package/dist/error/index.d.ts.map +0 -1
  921. package/dist/error/listener.d.ts +0 -2
  922. package/dist/error/listener.d.ts.map +0 -1
  923. package/dist/error/reporter.d.ts +0 -32
  924. package/dist/error/reporter.d.ts.map +0 -1
  925. package/dist/error/theme.d.ts +0 -3
  926. package/dist/error/theme.d.ts.map +0 -1
  927. package/dist/error/types.d.ts +0 -91
  928. package/dist/error/types.d.ts.map +0 -1
  929. package/dist/error/utils.d.ts +0 -21
  930. package/dist/error/utils.d.ts.map +0 -1
  931. package/dist/events.d.ts +0 -51
  932. package/dist/events.d.ts.map +0 -1
  933. package/dist/events.js +0 -82
  934. package/dist/events.js.map +0 -1
  935. package/dist/hooks/index.d.ts.map +0 -1
  936. package/dist/hooks/types.d.ts +0 -16
  937. package/dist/hooks/types.d.ts.map +0 -1
  938. package/dist/hooks/use-click-outside.d.ts +0 -3
  939. package/dist/hooks/use-click-outside.d.ts.map +0 -1
  940. package/dist/hooks/use-controllable-state.d.ts +0 -3
  941. package/dist/hooks/use-controllable-state.d.ts.map +0 -1
  942. package/dist/hooks/use-fullscreen-state.d.ts +0 -4
  943. package/dist/hooks/use-fullscreen-state.d.ts.map +0 -1
  944. package/dist/hooks/use-global-event.d.ts +0 -5
  945. package/dist/hooks/use-global-event.d.ts.map +0 -1
  946. package/dist/hooks/use-hotkey.d.ts +0 -4
  947. package/dist/hooks/use-hotkey.d.ts.map +0 -1
  948. package/dist/hooks/use-isomorphic-layout-effect.d.ts +0 -3
  949. package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +0 -1
  950. package/dist/hooks/use-required-context.d.ts +0 -3
  951. package/dist/hooks/use-required-context.d.ts.map +0 -1
  952. package/dist/hooks/use-scroll-lock.d.ts +0 -3
  953. package/dist/hooks/use-scroll-lock.d.ts.map +0 -1
  954. package/dist/hooks/use-store.d.ts +0 -3
  955. package/dist/hooks/use-store.d.ts.map +0 -1
  956. package/dist/kernel/adapters.d.ts +0 -5
  957. package/dist/kernel/adapters.d.ts.map +0 -1
  958. package/dist/kernel/compose.d.ts +0 -15
  959. package/dist/kernel/compose.d.ts.map +0 -1
  960. package/dist/kernel/constants.d.ts +0 -12
  961. package/dist/kernel/constants.d.ts.map +0 -1
  962. package/dist/kernel/context-registry.d.ts +0 -3
  963. package/dist/kernel/context-registry.d.ts.map +0 -1
  964. package/dist/kernel/handlers.d.ts +0 -3
  965. package/dist/kernel/handlers.d.ts.map +0 -1
  966. package/dist/kernel/hooks.d.ts +0 -7
  967. package/dist/kernel/hooks.d.ts.map +0 -1
  968. package/dist/kernel/index.d.ts.map +0 -1
  969. package/dist/kernel/installed.d.ts +0 -21
  970. package/dist/kernel/installed.d.ts.map +0 -1
  971. package/dist/kernel/module.d.ts +0 -32
  972. package/dist/kernel/module.d.ts.map +0 -1
  973. package/dist/kernel/operations.d.ts +0 -21
  974. package/dist/kernel/operations.d.ts.map +0 -1
  975. package/dist/kernel/page-controller.d.ts +0 -8
  976. package/dist/kernel/page-controller.d.ts.map +0 -1
  977. package/dist/kernel/provider.d.ts +0 -18
  978. package/dist/kernel/provider.d.ts.map +0 -1
  979. package/dist/kernel/runtime.d.ts.map +0 -1
  980. package/dist/kernel/schema.d.ts +0 -11
  981. package/dist/kernel/schema.d.ts.map +0 -1
  982. package/dist/kernel/store.d.ts +0 -4
  983. package/dist/kernel/store.d.ts.map +0 -1
  984. package/dist/kernel/types.d.ts +0 -233
  985. package/dist/kernel/types.d.ts.map +0 -1
  986. package/dist/kernel/utils.d.ts +0 -18
  987. package/dist/kernel/utils.d.ts.map +0 -1
  988. package/dist/modules/ambient/index.js +0 -10
  989. package/dist/modules/ambient/server/index.js +0 -225
  990. package/dist/modules/ambient/server/index.js.map +0 -1
  991. package/dist/modules/ambient/worker/index.js +0 -122
  992. package/dist/modules/ambient/worker/index.js.map +0 -1
  993. package/dist/modules/background/index.js +0 -9
  994. package/dist/modules/background/overlay.d.ts +0 -135
  995. package/dist/modules/background/overlay.d.ts.map +0 -1
  996. package/dist/modules/background/playback.d.ts +0 -10
  997. package/dist/modules/background/playback.d.ts.map +0 -1
  998. package/dist/modules/background/state.d.ts +0 -9
  999. package/dist/modules/background/state.d.ts.map +0 -1
  1000. package/dist/modules/background/visual.d.ts +0 -48
  1001. package/dist/modules/background/visual.d.ts.map +0 -1
  1002. package/dist/modules/background/youtube/iframe.d.ts +0 -52
  1003. package/dist/modules/background/youtube/iframe.d.ts.map +0 -1
  1004. package/dist/modules/background/youtube/parse.d.ts +0 -17
  1005. package/dist/modules/background/youtube/parse.d.ts.map +0 -1
  1006. package/dist/modules/background/youtube/player.d.ts +0 -28
  1007. package/dist/modules/background/youtube/player.d.ts.map +0 -1
  1008. package/dist/modules/context-menu/index.js +0 -14
  1009. package/dist/modules/controls/index.js +0 -7
  1010. package/dist/modules/dock/cards.d.ts +0 -1722
  1011. package/dist/modules/dock/cards.d.ts.map +0 -1
  1012. package/dist/modules/dock/dom.d.ts +0 -24
  1013. package/dist/modules/dock/dom.d.ts.map +0 -1
  1014. package/dist/modules/dock/helpers.d.ts +0 -25
  1015. package/dist/modules/dock/helpers.d.ts.map +0 -1
  1016. package/dist/modules/dock/hooks.d.ts +0 -42
  1017. package/dist/modules/dock/hooks.d.ts.map +0 -1
  1018. package/dist/modules/dock/index.js +0 -13
  1019. package/dist/modules/dock/layout.d.ts +0 -26
  1020. package/dist/modules/dock/layout.d.ts.map +0 -1
  1021. package/dist/modules/dock/overlay.d.ts +0 -79
  1022. package/dist/modules/dock/overlay.d.ts.map +0 -1
  1023. package/dist/modules/dock/paths.d.ts +0 -10
  1024. package/dist/modules/dock/paths.d.ts.map +0 -1
  1025. package/dist/modules/dock/state.d.ts +0 -22
  1026. package/dist/modules/dock/state.d.ts.map +0 -1
  1027. package/dist/modules/dock/styles.d.ts +0 -900
  1028. package/dist/modules/dock/styles.d.ts.map +0 -1
  1029. package/dist/modules/dock/surface/hooks.d.ts +0 -110
  1030. package/dist/modules/dock/surface/hooks.d.ts.map +0 -1
  1031. package/dist/modules/dock/types.d.ts +0 -1274
  1032. package/dist/modules/dock/types.d.ts.map +0 -1
  1033. package/dist/modules/loading/index.js +0 -8
  1034. package/dist/modules/media/index.js +0 -6
  1035. package/dist/modules/modal/dom.d.ts +0 -4
  1036. package/dist/modules/modal/dom.d.ts.map +0 -1
  1037. package/dist/modules/modal/header.d.ts +0 -7
  1038. package/dist/modules/modal/header.d.ts.map +0 -1
  1039. package/dist/modules/modal/identity.d.ts +0 -7
  1040. package/dist/modules/modal/identity.d.ts.map +0 -1
  1041. package/dist/modules/modal/index.js +0 -11
  1042. package/dist/modules/modal/layout.d.ts +0 -13
  1043. package/dist/modules/modal/layout.d.ts.map +0 -1
  1044. package/dist/modules/modal/overlay.d.ts +0 -4
  1045. package/dist/modules/modal/overlay.d.ts.map +0 -1
  1046. package/dist/modules/modal/state.d.ts +0 -4
  1047. package/dist/modules/modal/state.d.ts.map +0 -1
  1048. package/dist/modules/navigation/constants.d.ts +0 -33
  1049. package/dist/modules/navigation/constants.d.ts.map +0 -1
  1050. package/dist/modules/navigation/index.js +0 -80
  1051. package/dist/modules/navigation/index.js.map +0 -1
  1052. package/dist/modules/navigation/navigator.d.ts +0 -3
  1053. package/dist/modules/navigation/navigator.d.ts.map +0 -1
  1054. package/dist/modules/navigation/settings.d.ts +0 -5
  1055. package/dist/modules/navigation/settings.d.ts.map +0 -1
  1056. package/dist/modules/navigation/state.d.ts +0 -19
  1057. package/dist/modules/navigation/state.d.ts.map +0 -1
  1058. package/dist/modules/navigation/types.d.ts +0 -118
  1059. package/dist/modules/navigation/types.d.ts.map +0 -1
  1060. package/dist/modules/navigation/utils.d.ts +0 -8
  1061. package/dist/modules/navigation/utils.d.ts.map +0 -1
  1062. package/dist/modules/notification/index.js +0 -7
  1063. package/dist/overlay-LTRZUZQD.js +0 -9
  1064. package/dist/overlay-LTRZUZQD.js.map +0 -1
  1065. package/dist/provider.d.ts +0 -23
  1066. package/dist/provider.d.ts.map +0 -1
  1067. package/dist/provider.js +0 -9
  1068. package/dist/provider.js.map +0 -1
  1069. package/dist/result.d.ts +0 -50
  1070. package/dist/result.d.ts.map +0 -1
  1071. package/dist/result.js +0 -102
  1072. package/dist/result.js.map +0 -1
  1073. package/dist/theme.d.ts +0 -46
  1074. package/dist/theme.d.ts.map +0 -1
  1075. package/dist/theme.js +0 -6
  1076. package/dist/theme.js.map +0 -1
  1077. package/dist/tokens/index.d.ts +0 -4
  1078. package/dist/tokens/index.d.ts.map +0 -1
  1079. package/dist/tokens/index.js +0 -297
  1080. package/dist/tokens/index.js.map +0 -1
  1081. package/dist/tokens/motion-config.d.ts +0 -35
  1082. package/dist/tokens/motion-config.d.ts.map +0 -1
  1083. package/dist/tokens/motion.d.ts +0 -164
  1084. package/dist/tokens/motion.d.ts.map +0 -1
  1085. package/dist/tokens/tokens.d.ts +0 -34
  1086. package/dist/tokens/tokens.d.ts.map +0 -1
  1087. package/dist/ui/carousel/carousel.d.ts +0 -24
  1088. package/dist/ui/carousel/carousel.d.ts.map +0 -1
  1089. package/dist/ui/carousel/track.d.ts +0 -11
  1090. package/dist/ui/carousel/track.d.ts.map +0 -1
  1091. package/dist/ui/carousel/use-drag-scroll.d.ts +0 -3
  1092. package/dist/ui/carousel/use-drag-scroll.d.ts.map +0 -1
  1093. package/dist/ui/cn.d.ts +0 -19
  1094. package/dist/ui/cn.d.ts.map +0 -1
  1095. package/dist/ui/components/avatar.d.ts +0 -14
  1096. package/dist/ui/components/avatar.d.ts.map +0 -1
  1097. package/dist/ui/components/button.d.ts +0 -9
  1098. package/dist/ui/components/button.d.ts.map +0 -1
  1099. package/dist/ui/components/checkbox.d.ts +0 -18
  1100. package/dist/ui/components/checkbox.d.ts.map +0 -1
  1101. package/dist/ui/components/icon.d.ts +0 -4
  1102. package/dist/ui/components/icon.d.ts.map +0 -1
  1103. package/dist/ui/components/image.d.ts +0 -13
  1104. package/dist/ui/components/image.d.ts.map +0 -1
  1105. package/dist/ui/components/indicator.d.ts +0 -37
  1106. package/dist/ui/components/indicator.d.ts.map +0 -1
  1107. package/dist/ui/components/input.d.ts +0 -15
  1108. package/dist/ui/components/input.d.ts.map +0 -1
  1109. package/dist/ui/components/loader.d.ts +0 -17
  1110. package/dist/ui/components/loader.d.ts.map +0 -1
  1111. package/dist/ui/components/segmented.d.ts +0 -21
  1112. package/dist/ui/components/segmented.d.ts.map +0 -1
  1113. package/dist/ui/components/select.d.ts +0 -34
  1114. package/dist/ui/components/select.d.ts.map +0 -1
  1115. package/dist/ui/components/skeleton.d.ts +0 -16
  1116. package/dist/ui/components/skeleton.d.ts.map +0 -1
  1117. package/dist/ui/components/switch.d.ts +0 -11
  1118. package/dist/ui/components/switch.d.ts.map +0 -1
  1119. package/dist/ui/components/tooltip.d.ts +0 -25
  1120. package/dist/ui/components/tooltip.d.ts.map +0 -1
  1121. package/dist/ui/defaults.d.ts +0 -250
  1122. package/dist/ui/defaults.d.ts.map +0 -1
  1123. package/dist/ui/define.d.ts +0 -112
  1124. package/dist/ui/define.d.ts.map +0 -1
  1125. package/dist/ui/index.d.ts.map +0 -1
  1126. package/dist/ui/provider.d.ts +0 -11
  1127. package/dist/ui/provider.d.ts.map +0 -1
  1128. package/dist/ui/recipe.d.ts +0 -70
  1129. package/dist/ui/recipe.d.ts.map +0 -1
  1130. package/dist/ui/recipes.d.ts +0 -9
  1131. package/dist/ui/recipes.d.ts.map +0 -1
  1132. package/dist/ui/recipes.js +0 -648
  1133. package/dist/ui/recipes.js.map +0 -1
  1134. package/dist/ui/split.d.ts +0 -4
  1135. package/dist/ui/split.d.ts.map +0 -1
  1136. package/dist/ui/tones.d.ts +0 -23
  1137. package/dist/ui/tones.d.ts.map +0 -1
  1138. package/dist/utils/cn.d.ts +0 -3
  1139. package/dist/utils/cn.d.ts.map +0 -1
  1140. package/dist/utils/dom.d.ts +0 -5
  1141. package/dist/utils/dom.d.ts.map +0 -1
  1142. package/dist/utils/index.d.ts.map +0 -1
  1143. package/dist/utils/number.d.ts +0 -3
  1144. package/dist/utils/number.d.ts.map +0 -1
  1145. package/dist/utils/object.d.ts +0 -5
  1146. package/dist/utils/object.d.ts.map +0 -1
  1147. package/dist/utils/report.d.ts +0 -5
  1148. package/dist/utils/report.d.ts.map +0 -1
  1149. package/dist/utils/scheduler.d.ts +0 -34
  1150. package/dist/utils/scheduler.d.ts.map +0 -1
  1151. package/dist/utils/store.d.ts +0 -11
  1152. package/dist/utils/store.d.ts.map +0 -1
  1153. package/dist/utils/string.d.ts +0 -5
  1154. package/dist/utils/string.d.ts.map +0 -1
  1155. package/dist/utils/timing.d.ts +0 -7
  1156. package/dist/utils/timing.d.ts.map +0 -1
  1157. package/dist/utils/user-message.d.ts +0 -20
  1158. package/dist/utils/user-message.d.ts.map +0 -1
  1159. package/docs/ui.md +0 -183
  1160. package/styles/effects.css +0 -219
  1161. package/styles/index.css +0 -8
  1162. package/styles/interaction.css +0 -273
  1163. package/styles/palette.css +0 -81
  1164. package/styles/time.css +0 -26
  1165. package/styles/tokens.css +0 -114
  1166. package/styles/utilities.css +0 -110
  1167. package/templates/motion/background.ts +0 -15
  1168. package/templates/motion/context-menu.ts +0 -65
  1169. package/templates/motion/dock.ts +0 -421
  1170. package/templates/motion/modal.ts +0 -82
  1171. package/templates/motion/notification.ts +0 -26
  1172. package/templates/motion/tokens.ts +0 -36
  1173. /package/dist/{atoms → ambient}/index.js.map +0 -0
  1174. /package/dist/{modules/ambient → background}/index.js.map +0 -0
  1175. /package/dist/{modules/background → context-menu}/index.js.map +0 -0
  1176. /package/dist/{modules/context-menu → controls}/index.js.map +0 -0
  1177. /package/dist/{kernel → core/kernel}/runtime.d.ts +0 -0
  1178. /package/dist/{modules/controls → dock}/index.js.map +0 -0
  1179. /package/dist/{modules/dock → loading}/index.js.map +0 -0
  1180. /package/dist/{modules/loading → media}/index.js.map +0 -0
  1181. /package/dist/{modules/media → notification}/index.js.map +0 -0
  1182. /package/dist/{modules/modal → provider}/index.js.map +0 -0
  1183. /package/dist/{modules/notification → theme}/index.js.map +0 -0
@@ -1,2186 +0,0 @@
1
- import { useOptionalMediaActions } from './chunk-GDCVEINL.js';
2
- import { defineThemeSpec, useMotionTokens, retime, useTheme, useModuleMotion, cssEasing } from './chunk-TMTMQNEQ.js';
3
- import { getOrCreateGlobalContext, defineModule, useRegistryValue, useModuleRegistration } from './chunk-HMEWYAWU.js';
4
- import { createStore, cn, useStore, useIsomorphicLayoutEffect, useRequiredContext, report } from './chunk-HCSDQEFB.js';
5
- import { Spinner } from './chunk-I3IZUBBU.js';
6
- import { memo, useState, useRef, useEffect, useMemo, useCallback, useContext } from 'react';
7
- import { AnimatePresence, motion } from 'motion/react';
8
- import { usePathname } from 'next/navigation';
9
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
-
11
- // src/modules/background/constants.ts
12
- var backgroundTheme = defineThemeSpec("background");
13
- var BACKGROUND_REGISTRY_KEY = "page-background";
14
- var BACKGROUND_MEDIA_ID = "background";
15
-
16
- // src/modules/background/visual.ts
17
- var objectFit = (value) => ({
18
- objectFit: value
19
- });
20
- var objectPosition = (value) => ({
21
- objectPosition: value
22
- });
23
- var BG_TOKEN_TO_OBJECT_STYLE = Object.freeze({
24
- "bg-bottom": objectPosition("bottom"),
25
- "bg-center": objectPosition("center"),
26
- "bg-contain": objectFit("contain"),
27
- "bg-cover": objectFit("cover"),
28
- "bg-fill": objectFit("fill"),
29
- "bg-left": objectPosition("left"),
30
- "bg-left-bottom": objectPosition("left bottom"),
31
- "bg-left-top": objectPosition("left top"),
32
- "bg-none": objectFit("none"),
33
- "bg-right": objectPosition("right"),
34
- "bg-right-bottom": objectPosition("right bottom"),
35
- "bg-right-top": objectPosition("right top"),
36
- "bg-scale-down": objectFit("scale-down"),
37
- "bg-top": objectPosition("top")
38
- });
39
- var OBJECT_FITS = Object.freeze([
40
- "contain",
41
- "cover",
42
- "fill",
43
- "none",
44
- "scale-down"
45
- ]);
46
- var DEFAULT_COLOR = "var(--black, #000)";
47
- var WIDTH_CLASS = /^(w-|max-w-|min-w-)/;
48
- function resolveVideoClassNames(...inputs) {
49
- const tokens = inputs.flatMap(
50
- (input) => typeof input === "string" ? input.replace(/,/g, " ").split(/\s+/) : []
51
- ).filter(Boolean);
52
- return {
53
- objectStyle: Object.assign(
54
- {},
55
- ...tokens.map((token) => BG_TOKEN_TO_OBJECT_STYLE[token])
56
- ),
57
- other: tokens.filter((token) => !WIDTH_CLASS.test(token)).join(" "),
58
- width: tokens.filter((token) => WIDTH_CLASS.test(token)).join(" ")
59
- };
60
- }
61
- function resolveVideoOptions(options = {}) {
62
- return {
63
- codec: options.codec || "auto",
64
- corp: options.corp ?? 0,
65
- forceIframe: Boolean(options.forceIframe),
66
- isLoop: options.loop ?? false,
67
- isMuted: options.muted ?? true,
68
- playbackRate: options.playbackRate ?? 1,
69
- quality: options.quality || "1080p",
70
- shouldAutoPlay: options.autoplay ?? true,
71
- showPoster: Boolean(options.showPoster),
72
- showSpinner: options.showSpinner !== false
73
- };
74
- }
75
- var generateBaseGradient = (direction, color) => {
76
- const to = direction === "left" ? "to right" : "to left";
77
- return `linear-gradient(${to}, ${color} 0%, color-mix(in srgb, ${color} 85%, transparent) 15%, color-mix(in srgb, ${color} 50%, transparent) 45%, color-mix(in srgb, ${color} 18%, transparent) 75%, transparent 100%)`;
78
- };
79
- var generateEdgeGradient = (direction, color) => {
80
- const to = direction === "left" ? "to right" : "to left";
81
- return `linear-gradient(${to}, color-mix(in srgb, ${color} 95%, transparent) 0%, color-mix(in srgb, ${color} 70%, transparent) 25%, color-mix(in srgb, ${color} 35%, transparent) 55%, color-mix(in srgb, ${color} 10%, transparent) 80%, transparent 100%)`;
82
- };
83
- function getVisualStyle(currentStyle = {}) {
84
- const {
85
- className: _className,
86
- leftGradient = 0,
87
- rightGradient = 0,
88
- ...baseStyle
89
- } = currentStyle;
90
- return {
91
- baseStyle,
92
- leftGradient: Number(leftGradient) || 0,
93
- rightGradient: Number(rightGradient) || 0
94
- };
95
- }
96
- function resolveGradientSettings({
97
- fadeEdges = null,
98
- hasWidth = false,
99
- leftGradient = 0,
100
- rightGradient = 0
101
- }) {
102
- let leftPercent = 0;
103
- let rightPercent = 0;
104
- if (leftGradient > 0)
105
- leftPercent = Math.min(48, Math.max(12, leftGradient * 7.5));
106
- else if (hasWidth && fadeEdges !== false) leftPercent = 20;
107
- if (rightGradient > 0)
108
- rightPercent = Math.min(48, Math.max(12, rightGradient * 7.5));
109
- else if (hasWidth && fadeEdges !== false) rightPercent = 20;
110
- if (typeof fadeEdges === "number") {
111
- leftPercent = fadeEdges;
112
- rightPercent = fadeEdges;
113
- } else if (typeof fadeEdges === "string") {
114
- const parsed = parseFloat(fadeEdges);
115
- if (!Number.isNaN(parsed)) {
116
- leftPercent = parsed;
117
- rightPercent = parsed;
118
- }
119
- } else if (typeof fadeEdges === "object" && fadeEdges !== null) {
120
- const edgeObj = fadeEdges;
121
- if (edgeObj.left !== void 0)
122
- leftPercent = parseFloat(String(edgeObj.left)) || 0;
123
- if (edgeObj.right !== void 0)
124
- rightPercent = parseFloat(String(edgeObj.right)) || 0;
125
- } else if (fadeEdges === false) {
126
- leftPercent = 0;
127
- rightPercent = 0;
128
- }
129
- const leftOpacity = leftGradient > 0 ? Math.min(1, leftGradient * 0.22) : 0;
130
- const rightOpacity = rightGradient > 0 ? Math.min(1, rightGradient * 0.22) : 0;
131
- return {
132
- enabled: leftPercent > 0 || rightPercent > 0,
133
- leftOpacity,
134
- leftPercent,
135
- rightOpacity,
136
- rightPercent
137
- };
138
- }
139
- function generateSmoothstepStops(percent, direction = "in", color = "var(--black, #000)") {
140
- const steps = [
141
- { s: 0, t: 0 },
142
- { s: 0.06, t: 0.15 },
143
- { s: 0.22, t: 0.35 },
144
- { s: 0.47, t: 0.55 },
145
- { s: 0.76, t: 0.75 },
146
- { s: 0.93, t: 0.9 },
147
- { s: 1, t: 1 }
148
- ];
149
- if (direction === "in") {
150
- return steps.map(
151
- ({ s, t }) => s === 0 ? `transparent ${(t * percent).toFixed(1)}%` : s === 1 ? `${color} ${(t * percent).toFixed(1)}%` : `color-mix(in srgb, ${color} ${Math.round(s * 100)}%, transparent) ${(t * percent).toFixed(1)}%`
152
- );
153
- }
154
- return steps.map(({ s, t }) => {
155
- const alpha = 1 - s;
156
- return alpha === 0 ? `transparent ${(100 - percent + t * percent).toFixed(1)}%` : alpha === 1 ? `${color} ${(100 - percent + t * percent).toFixed(1)}%` : `color-mix(in srgb, ${color} ${Math.round(alpha * 100)}%, transparent) ${(100 - percent + t * percent).toFixed(1)}%`;
157
- });
158
- }
159
- function getEdgeFadeMask({
160
- color = "var(--black, #000)",
161
- leftPercent = 0,
162
- rightPercent = 0
163
- }) {
164
- if (leftPercent <= 0 && rightPercent <= 0) return void 0;
165
- const leftStops = leftPercent > 0 ? generateSmoothstepStops(leftPercent, "in", color) : [`${color} 0%`];
166
- const rightStops = rightPercent > 0 ? generateSmoothstepStops(rightPercent, "out", color) : [`${color} 100%`];
167
- return `linear-gradient(to right, ${leftStops.join(", ")}, ${rightStops.join(", ")})`;
168
- }
169
-
170
- // src/modules/background/playback.ts
171
- function applyVideoPlaybackState({
172
- isPlaying,
173
- playbackRate,
174
- setVideoPlaying,
175
- videoElement
176
- }) {
177
- if (!videoElement) return;
178
- const numericPlaybackRate = Number(playbackRate);
179
- const resolvedPlaybackRate = Number.isFinite(numericPlaybackRate) && numericPlaybackRate > 0 ? numericPlaybackRate : 1;
180
- try {
181
- if (videoElement.playbackRate !== resolvedPlaybackRate) {
182
- videoElement.playbackRate = resolvedPlaybackRate;
183
- }
184
- } catch {
185
- return;
186
- }
187
- if (!isPlaying) {
188
- if (!videoElement.paused) videoElement.pause();
189
- return;
190
- }
191
- if (videoElement.readyState === 0) {
192
- return;
193
- }
194
- const playPromise = videoElement.play();
195
- if (!playPromise || typeof playPromise.then !== "function") return;
196
- playPromise.then(() => setVideoPlaying(true)).catch((error) => {
197
- if (error?.name === "AbortError" || videoElement.readyState < 2) {
198
- return;
199
- }
200
- if (error?.name === "NotAllowedError") {
201
- videoElement.muted = true;
202
- videoElement.play().then(() => setVideoPlaying(true)).catch(() => {
203
- });
204
- return;
205
- }
206
- setVideoPlaying(false);
207
- });
208
- }
209
- function triggerVideoPlaybackDirect(videoElement, nextPlaying, configuredMuted) {
210
- if (!videoElement) return;
211
- if (nextPlaying) {
212
- videoElement.muted = configuredMuted;
213
- if (!configuredMuted && videoElement.volume === 0) {
214
- videoElement.volume = 0.8;
215
- }
216
- videoElement.play().catch((err) => {
217
- if (err?.name === "NotAllowedError") {
218
- videoElement.muted = true;
219
- videoElement.play().catch(() => {
220
- });
221
- }
222
- });
223
- } else {
224
- videoElement.pause();
225
- }
226
- }
227
- function syncVideoMutedDirect(videoElement, nextMuted) {
228
- if (!videoElement) return;
229
- videoElement.muted = nextMuted;
230
- if (!nextMuted && videoElement.volume === 0) {
231
- videoElement.volume = 0.8;
232
- }
233
- }
234
- function syncVideoLoopDirect(videoElement, nextLoop) {
235
- if (!videoElement) return;
236
- videoElement.loop = nextLoop;
237
- }
238
-
239
- // src/modules/background/motion.ts
240
- function useBackgroundMotion() {
241
- return useModuleMotion(backgroundTheme);
242
- }
243
- function getBackgroundMotionConfig(motion2, animation) {
244
- return {
245
- animate: animation?.animate ?? motion2.animate,
246
- exit: animation?.exit ?? motion2.exit,
247
- exitDurationFactor: Number(animation?.exitDurationFactor),
248
- initial: animation?.initial ?? motion2.initial,
249
- transition: animation?.transition ?? motion2.transition
250
- };
251
- }
252
- function getBackgroundExitTransition(motion2, config) {
253
- const own = config.exit.transition;
254
- const fallback = motion2.exit.transition;
255
- const factor = Number.isFinite(config.exitDurationFactor) ? Math.max(0, config.exitDurationFactor) : motion2.exitDurationFactor;
256
- return {
257
- ...config.transition,
258
- delay: 0,
259
- duration: own?.duration ?? (config.transition.duration ?? motion2.transition.duration ?? 0) * factor,
260
- ease: own?.ease ?? fallback?.ease
261
- };
262
- }
263
- function toCssDuration(seconds, fallback = 0) {
264
- const value = Number(seconds);
265
- return `${Math.max(0, Number.isFinite(value) ? value : fallback) * 1e3}ms`;
266
- }
267
- function toCssDelay(seconds) {
268
- const value = Number(seconds);
269
- return `${Math.max(0, Number.isFinite(value) ? value : 0) * 1e3}ms`;
270
- }
271
- function toCssEasing(easing) {
272
- return cssEasing(easing);
273
- }
274
-
275
- // src/modules/background/youtube/parse.ts
276
- var YOUTUBE_ID_PATTERN = /^[a-zA-Z0-9_-]{11}$/;
277
- function parseYouTubeTimeParam(value) {
278
- if (value === void 0 || value === null || value === "") return 0;
279
- if (typeof value === "number") {
280
- return Number.isFinite(value) && value >= 0 ? value : 0;
281
- }
282
- const trimmed = String(value).trim().toLowerCase();
283
- if (!trimmed) return 0;
284
- if (/^\d+(\.\d+)?$/.test(trimmed)) {
285
- return Math.max(0, parseFloat(trimmed));
286
- }
287
- const hmsMatch = trimmed.match(
288
- /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+(?:\.\d+)?)s?)?$/
289
- );
290
- if (hmsMatch && (hmsMatch[1] || hmsMatch[2] || hmsMatch[3])) {
291
- const hours = parseInt(hmsMatch[1] || "0", 10);
292
- const minutes = parseInt(hmsMatch[2] || "0", 10);
293
- const seconds = parseFloat(hmsMatch[3] || "0");
294
- return Math.max(0, hours * 3600 + minutes * 60 + seconds);
295
- }
296
- return 0;
297
- }
298
- var YOUTUBE_HOST_PATH = /^(?:www\.|m\.|music\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com)\//i;
299
- function toUrl(input, { youtubeOnly = false } = {}) {
300
- let candidate = null;
301
- if (/^https?:\/\//.test(input)) candidate = input;
302
- else if (input.startsWith("//")) candidate = `https:${input}`;
303
- else if (!youtubeOnly || YOUTUBE_HOST_PATH.test(input)) {
304
- candidate = `https://${input}`;
305
- }
306
- try {
307
- return candidate ? new URL(candidate) : null;
308
- } catch {
309
- return null;
310
- }
311
- }
312
- function getIdFromUrl(url) {
313
- const host = url.hostname.replace(/^(www\.|m\.|music\.)/i, "").toLowerCase();
314
- const segments = url.pathname.split("/").filter(Boolean);
315
- if (host === "youtu.be") {
316
- return YOUTUBE_ID_PATTERN.test(segments[0] ?? "") ? segments[0] : null;
317
- }
318
- if (host !== "youtube.com" && host !== "youtube-nocookie.com" && !host.endsWith(".youtube.com")) {
319
- return null;
320
- }
321
- const fromQuery = url.searchParams.get("v") || url.searchParams.get("vi");
322
- if (fromQuery && YOUTUBE_ID_PATTERN.test(fromQuery)) return fromQuery;
323
- const isVideoPath = segments.length >= 2 && ["embed", "shorts", "live", "v", "e", "watch"].includes(
324
- segments[0].toLowerCase()
325
- );
326
- return isVideoPath && YOUTUBE_ID_PATTERN.test(segments[1]) ? segments[1] : null;
327
- }
328
- function extractYouTubeVideoId(input, options = {}) {
329
- const trimmed = typeof input === "string" ? input.trim() : "";
330
- if (!trimmed) return null;
331
- if (options.allowBareId && YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
332
- const prefixed = trimmed.match(/^(?:youtube|yt):([a-zA-Z0-9_-]{11})$/i);
333
- if (prefixed) return prefixed[1];
334
- const url = toUrl(trimmed, { youtubeOnly: true });
335
- return url ? getIdFromUrl(url) : null;
336
- }
337
- function isYouTubeUrl(input) {
338
- return Boolean(extractYouTubeVideoId(input));
339
- }
340
- function isDirectVideoUrl(input) {
341
- if (!input || typeof input !== "string") return false;
342
- const trimmed = input.trim();
343
- if (!trimmed) return false;
344
- if (isYouTubeUrl(trimmed)) return true;
345
- if (trimmed.startsWith("/api/background/youtube") || trimmed.startsWith("blob:")) {
346
- return true;
347
- }
348
- const cleanPath = trimmed.split("?")[0].split("#")[0].toLowerCase();
349
- return /\.(mp4|webm|mov|m4v|ogg|ogv|m3u8)$/i.test(cleanPath);
350
- }
351
- function parseYouTubeUrlConfig(input, options = {}) {
352
- const videoId = extractYouTubeVideoId(input, options);
353
- if (!videoId || !input) return null;
354
- const params = toUrl(input.trim())?.searchParams;
355
- return {
356
- endTime: parseYouTubeTimeParam(params?.get("end")),
357
- listId: params?.get("list") || null,
358
- rawUrl: input,
359
- startTime: parseYouTubeTimeParam(params?.get("t") || params?.get("start")),
360
- videoId
361
- };
362
- }
363
- function getYouTubeStreamUrl(videoId, options = {}) {
364
- const params = new URLSearchParams();
365
- params.set("id", videoId);
366
- params.set("stream", options.stream || "video");
367
- if (options.quality) params.set("quality", options.quality);
368
- if (options.codec) params.set("codec", options.codec);
369
- return `/api/background/youtube?${params.toString()}`;
370
- }
371
- function getYouTubeThumbnailUrl(videoId, proxied = true) {
372
- if (proxied) {
373
- return `/api/background/youtube?id=${encodeURIComponent(videoId)}&stream=thumbnail`;
374
- }
375
- return `https://i.ytimg.com/vi/${encodeURIComponent(videoId)}/maxresdefault.jpg`;
376
- }
377
- function createYouTubeVideoElementProxy(controller) {
378
- const proxyVideo = document.createElement("video");
379
- Object.defineProperties(proxyVideo, {
380
- currentTime: {
381
- configurable: true,
382
- get: () => controller.getCurrentTime(),
383
- set: (value) => {
384
- controller.seekTo(Number(value) || 0);
385
- proxyVideo.dispatchEvent(new Event("timeupdate"));
386
- }
387
- },
388
- duration: {
389
- configurable: true,
390
- get: () => controller.getDuration()
391
- },
392
- loop: {
393
- configurable: true,
394
- get: () => controller.getLoop(),
395
- set: (value) => {
396
- controller.setLoop(Boolean(value));
397
- }
398
- },
399
- muted: {
400
- configurable: true,
401
- get: () => controller.getMuted(),
402
- set: (value) => {
403
- controller.setMuted(Boolean(value));
404
- proxyVideo.dispatchEvent(new Event("volumechange"));
405
- }
406
- },
407
- pause: {
408
- configurable: true,
409
- value: () => {
410
- controller.pause();
411
- proxyVideo.dispatchEvent(new Event("pause"));
412
- }
413
- },
414
- paused: {
415
- configurable: true,
416
- get: () => controller.getPaused()
417
- },
418
- play: {
419
- configurable: true,
420
- value: () => controller.play().then(() => {
421
- proxyVideo.dispatchEvent(new Event("play"));
422
- proxyVideo.dispatchEvent(new Event("playing"));
423
- })
424
- },
425
- playbackRate: {
426
- configurable: true,
427
- get: () => controller.getPlaybackRate(),
428
- set: (value) => {
429
- controller.setPlaybackRate(Number(value) || 1);
430
- proxyVideo.dispatchEvent(new Event("ratechange"));
431
- }
432
- },
433
- volume: {
434
- configurable: true,
435
- get: () => controller.getVolume(),
436
- set: (value) => {
437
- const clamped = Math.max(0, Math.min(1, Number(value) || 0));
438
- controller.setVolume(clamped);
439
- proxyVideo.dispatchEvent(new Event("volumechange"));
440
- }
441
- }
442
- });
443
- return proxyVideo;
444
- }
445
-
446
- // src/modules/background/state.ts
447
- var DEFAULT_BACKGROUND = Object.freeze({
448
- animation: null,
449
- className: "",
450
- fadeEdges: null,
451
- fit: null,
452
- image: null,
453
- imageStyle: {},
454
- isPlaying: false,
455
- noiseStyle: {},
456
- overlay: false,
457
- overlayColor: "var(--black)",
458
- overlayOpacity: 0,
459
- position: "center",
460
- video: null,
461
- videoClassName: "",
462
- videoElement: null,
463
- videoOptions: {
464
- autoplay: true,
465
- className: "",
466
- corp: 0,
467
- loop: false,
468
- muted: true,
469
- playbackRate: 1,
470
- width: null
471
- },
472
- videoStyle: {},
473
- width: null
474
- });
475
- var DEFAULT_BACKGROUND_COMPUTED = Object.freeze({
476
- ...DEFAULT_BACKGROUND,
477
- hasBackground: false,
478
- isVideo: false,
479
- isYouTube: false,
480
- posterUrl: null,
481
- youtubeVideoId: null
482
- });
483
- var INERT_BACKGROUND_ACTIONS = Object.freeze({
484
- resetBackground: () => {
485
- },
486
- setBackground: () => {
487
- },
488
- setVideoElement: () => {
489
- },
490
- setVideoMuted: () => {
491
- },
492
- setVideoPlaying: () => {
493
- },
494
- toggleLoop: () => {
495
- },
496
- toggleMute: () => {
497
- },
498
- toggleVideo: () => {
499
- }
500
- });
501
- function normalizeBackgroundInput(patch = {}) {
502
- if (!patch) return {};
503
- if (typeof patch === "string") {
504
- const trimmed = patch.trim();
505
- if (isYouTubeUrl(trimmed) || isDirectVideoUrl(trimmed)) {
506
- return { image: null, video: trimmed };
507
- }
508
- return { image: trimmed };
509
- }
510
- const nextPatch = { ...patch };
511
- if (typeof nextPatch.image === "string" && isYouTubeUrl(nextPatch.image) && !nextPatch.video) {
512
- nextPatch.video = nextPatch.image;
513
- nextPatch.image = null;
514
- }
515
- return nextPatch;
516
- }
517
- function mergeBackgroundState(baseState, patch = {}) {
518
- const resolvedPatch = normalizeBackgroundInput(patch);
519
- const nextVideoOptions = {
520
- ...baseState.videoOptions,
521
- ...resolvedPatch.videoOptions || {}
522
- };
523
- const nextVideo = resolvedPatch.video !== void 0 ? resolvedPatch.video : baseState.video;
524
- const shouldAutoPlay = nextVideoOptions.autoplay !== false;
525
- const resolvedIsPlaying = resolvedPatch.isPlaying !== void 0 ? resolvedPatch.isPlaying : resolvedPatch.video !== void 0 && Boolean(nextVideo) ? shouldAutoPlay : baseState.isPlaying;
526
- return {
527
- ...baseState,
528
- ...resolvedPatch,
529
- isPlaying: resolvedIsPlaying,
530
- animation: resolvedPatch.animation !== void 0 ? resolvedPatch.animation ? {
531
- ...baseState.animation || {},
532
- ...resolvedPatch.animation
533
- } : resolvedPatch.animation : baseState.animation,
534
- imageStyle: {
535
- ...baseState.imageStyle,
536
- ...resolvedPatch.imageStyle || {}
537
- },
538
- noiseStyle: {
539
- ...baseState.noiseStyle,
540
- ...resolvedPatch.noiseStyle || {}
541
- },
542
- videoOptions: nextVideoOptions,
543
- videoStyle: {
544
- ...baseState.videoStyle,
545
- ...resolvedPatch.videoStyle || {}
546
- }
547
- };
548
- }
549
- function resolveBackgroundState(registryBackground, override, pathname) {
550
- const base = registryBackground ? mergeBackgroundState(DEFAULT_BACKGROUND, registryBackground) : DEFAULT_BACKGROUND;
551
- const patch = override.pathname === pathname ? override.patch : null;
552
- return patch ? mergeBackgroundState(base, patch) : base;
553
- }
554
- function computeBackgroundState(background) {
555
- const youtubeVideoId = extractYouTubeVideoId(background.video);
556
- const isYouTube = Boolean(youtubeVideoId);
557
- const isVideo = Boolean(background.video || isYouTube);
558
- return {
559
- ...background,
560
- hasBackground: Boolean(
561
- background.image || isVideo || background.color || background.overlay || background.noiseStyle && (background.noiseStyle.opacity === void 0 || (background.noiseStyle.opacity ?? 0) > 0)
562
- ),
563
- isVideo,
564
- isYouTube,
565
- posterUrl: youtubeVideoId ? getYouTubeThumbnailUrl(youtubeVideoId) : null,
566
- youtubeVideoId
567
- };
568
- }
569
- var BackgroundContext = getOrCreateGlobalContext(
570
- "BackgroundContext",
571
- null
572
- );
573
- function useSafePathname() {
574
- try {
575
- return usePathname();
576
- } catch {
577
- return null;
578
- }
579
- }
580
- function BackgroundProvider({ children }) {
581
- const pathname = useSafePathname();
582
- const registryBackground = useRegistryValue(
583
- "background",
584
- BACKGROUND_REGISTRY_KEY
585
- ) ?? null;
586
- const [overrideStore] = useState(
587
- () => createStore(
588
- { patch: null, pathname },
589
- { freezeSnapshots: false }
590
- )
591
- );
592
- const scopedOverride = useStore(overrideStore);
593
- const inputsRef = useRef({ pathname, registryBackground });
594
- useIsomorphicLayoutEffect(() => {
595
- inputsRef.current = { pathname, registryBackground };
596
- }, [pathname, registryBackground]);
597
- const videoElementRef = useRef(null);
598
- const state = useMemo(
599
- () => computeBackgroundState(
600
- resolveBackgroundState(registryBackground, scopedOverride, pathname)
601
- ),
602
- [pathname, registryBackground, scopedOverride]
603
- );
604
- const [stateStore] = useState(
605
- () => createStore(state, { freezeSnapshots: false })
606
- );
607
- useIsomorphicLayoutEffect(() => {
608
- stateStore.publish(state);
609
- }, [state, stateStore]);
610
- const actions = useMemo(() => {
611
- const readCurrent = () => {
612
- const { pathname: currentPath, registryBackground: registry } = inputsRef.current;
613
- return resolveBackgroundState(
614
- registry,
615
- overrideStore.getSnapshot(),
616
- currentPath
617
- );
618
- };
619
- const updatePatch = (updater) => {
620
- overrideStore.publish((prev) => {
621
- const { pathname: currentPath, registryBackground: registry } = inputsRef.current;
622
- const currentPatch = prev.pathname === currentPath ? prev.patch : null;
623
- const rawNext = updater(
624
- resolveBackgroundState(registry, prev, currentPath)
625
- );
626
- if (!rawNext || Object.keys(rawNext).length === 0) {
627
- return prev;
628
- }
629
- const normalizedNext = normalizeBackgroundInput(rawNext);
630
- const mergedPatch = {
631
- ...currentPatch || {},
632
- ...normalizedNext,
633
- ...currentPatch?.videoOptions || normalizedNext.videoOptions ? {
634
- videoOptions: {
635
- ...currentPatch?.videoOptions || {},
636
- ...normalizedNext.videoOptions || {}
637
- }
638
- } : {}
639
- };
640
- return {
641
- patch: mergedPatch,
642
- pathname: currentPath
643
- };
644
- });
645
- };
646
- const currentVideoElement = (current) => videoElementRef.current || current.videoElement;
647
- return {
648
- resetBackground: () => {
649
- overrideStore.publish({
650
- patch: null,
651
- pathname: inputsRef.current.pathname
652
- });
653
- },
654
- setBackground: (nextBackground) => {
655
- updatePatch(() => normalizeBackgroundInput(nextBackground));
656
- },
657
- setVideoElement: (videoElement2) => {
658
- videoElementRef.current = videoElement2;
659
- updatePatch(
660
- (cur) => cur.videoElement === videoElement2 ? {} : { videoElement: videoElement2 }
661
- );
662
- },
663
- setVideoMuted: (muted) => {
664
- const nextMuted = Boolean(muted);
665
- syncVideoMutedDirect(currentVideoElement(readCurrent()), nextMuted);
666
- updatePatch((cur) => {
667
- if (cur.videoOptions?.muted === nextMuted) return {};
668
- return {
669
- videoOptions: { ...cur.videoOptions, muted: nextMuted }
670
- };
671
- });
672
- },
673
- setVideoPlaying: (isPlaying2) => {
674
- updatePatch(
675
- (cur) => cur.isPlaying === isPlaying2 ? {} : { isPlaying: isPlaying2 }
676
- );
677
- },
678
- toggleLoop: () => {
679
- const current = readCurrent();
680
- const nextLoop = !current.videoOptions?.loop;
681
- syncVideoLoopDirect(currentVideoElement(current), nextLoop);
682
- updatePatch((cur) => ({
683
- videoOptions: { ...cur.videoOptions, loop: nextLoop }
684
- }));
685
- },
686
- toggleMute: () => {
687
- const current = readCurrent();
688
- const nextMuted = !current.videoOptions?.muted;
689
- syncVideoMutedDirect(currentVideoElement(current), nextMuted);
690
- updatePatch((cur) => ({
691
- isPlaying: nextMuted ? cur.isPlaying : true,
692
- videoOptions: { ...cur.videoOptions, muted: nextMuted }
693
- }));
694
- },
695
- toggleVideo: () => {
696
- const current = readCurrent();
697
- const videoEl = currentVideoElement(current);
698
- const domIsActuallyPlaying = videoEl ? !videoEl.paused && !videoEl.ended : Boolean(current.isPlaying);
699
- const nextPlaying = !domIsActuallyPlaying;
700
- const configuredMuted = Boolean(current.videoOptions?.muted);
701
- triggerVideoPlaybackDirect(videoEl, nextPlaying, configuredMuted);
702
- updatePatch(() => ({ isPlaying: nextPlaying }));
703
- }
704
- };
705
- }, [overrideStore]);
706
- const media = useOptionalMediaActions();
707
- const { isPlaying, isVideo, videoElement } = state;
708
- const isLoop = Boolean(state.videoOptions?.loop);
709
- useEffect(() => {
710
- if (!isVideo) {
711
- media.removeSource(BACKGROUND_MEDIA_ID);
712
- return;
713
- }
714
- media.upsertSource({
715
- controls: {
716
- setMuted: actions.setVideoMuted,
717
- toggle: actions.toggleVideo,
718
- toggleLoop: actions.toggleLoop
719
- },
720
- element: videoElement ?? null,
721
- id: BACKGROUND_MEDIA_ID,
722
- isPlaying,
723
- kind: "video",
724
- loop: isLoop
725
- });
726
- }, [actions, isLoop, isPlaying, isVideo, media, videoElement]);
727
- useEffect(() => () => media.removeSource(BACKGROUND_MEDIA_ID), [media]);
728
- const value = useMemo(
729
- () => ({ actions, store: stateStore }),
730
- [actions, stateStore]
731
- );
732
- return /* @__PURE__ */ jsx(BackgroundContext, { value, children });
733
- }
734
-
735
- // src/modules/background/hooks.ts
736
- var NOOP_BACKGROUND_STORE = createStore(
737
- DEFAULT_BACKGROUND_COMPUTED
738
- );
739
- function useBackgroundRegistration(config, options) {
740
- useModuleRegistration("background", config, options);
741
- }
742
- function useBackgroundState() {
743
- const { store } = useRequiredContext(
744
- BackgroundContext,
745
- "useBackgroundState",
746
- "BackgroundProvider"
747
- );
748
- return useStore(store);
749
- }
750
- function useBackgroundActions() {
751
- return useRequiredContext(
752
- BackgroundContext,
753
- "useBackgroundActions",
754
- "BackgroundProvider"
755
- ).actions;
756
- }
757
- function useBackground(config, options) {
758
- useBackgroundRegistration(config, options);
759
- const actions = useBackgroundActions();
760
- const state = useBackgroundState();
761
- return useMemo(() => ({ ...state, ...actions }), [actions, state]);
762
- }
763
- function useOptionalBackgroundState(selector, isEqual) {
764
- const ctx = useContext(BackgroundContext);
765
- return useStore(
766
- ctx?.store ?? NOOP_BACKGROUND_STORE,
767
- selector,
768
- isEqual
769
- );
770
- }
771
- function useOptionalBackgroundActions() {
772
- const ctx = useContext(BackgroundContext);
773
- return ctx?.actions ?? INERT_BACKGROUND_ACTIONS;
774
- }
775
- var PLAYER_STATE = { ENDED: 0, PLAYING: 1, PAUSED: 2, BUFFERING: 3 };
776
- var apiPromise = null;
777
- function loadYouTubeIframeApi() {
778
- if (typeof window === "undefined") return Promise.resolve(null);
779
- if (window.YT?.Player) return Promise.resolve(window.YT);
780
- if (apiPromise) return apiPromise;
781
- apiPromise = new Promise((resolve) => {
782
- const previousCallback = window.onYouTubeIframeAPIReady;
783
- window.onYouTubeIframeAPIReady = () => {
784
- previousCallback?.();
785
- resolve(window.YT);
786
- };
787
- if (!document.querySelector(
788
- 'script[src="https://www.youtube.com/iframe_api"]'
789
- )) {
790
- const script = document.createElement("script");
791
- script.src = "https://www.youtube.com/iframe_api";
792
- script.async = true;
793
- document.head.appendChild(script);
794
- }
795
- });
796
- return apiPromise;
797
- }
798
- function setHighQuality(player) {
799
- player?.setPlaybackQualityRange?.("hd1080", "hd1080");
800
- player?.setPlaybackQuality?.("hd1080");
801
- }
802
- function useYouTubeIframePlayer({
803
- enabled,
804
- hostRef,
805
- isLoop,
806
- isMuted,
807
- isPlaying,
808
- live,
809
- playbackRate,
810
- setIsBuffering,
811
- setIsFrameReady,
812
- setVideoElement,
813
- setVideoPlaying,
814
- shouldAutoPlay,
815
- startTime,
816
- videoId
817
- }) {
818
- const playerRef = useRef(null);
819
- useEffect(() => {
820
- if (!enabled) return void 0;
821
- let isDisposed = false;
822
- let progressInterval = null;
823
- let proxyElement = null;
824
- const state = {
825
- currentTime: startTime || 0,
826
- duration: 0,
827
- loop: Boolean(isLoop),
828
- muted: Boolean(isMuted),
829
- paused: !shouldAutoPlay,
830
- playbackRate: Number(playbackRate) || 1,
831
- volume: isMuted ? 0 : 0.8
832
- };
833
- const player = () => playerRef.current;
834
- const restart = (target) => {
835
- const restartAt = Math.max(0, live.current.startTime || 0);
836
- target?.seekTo?.(restartAt, true);
837
- target?.playVideo?.();
838
- return restartAt;
839
- };
840
- const emit = (type) => proxyElement?.dispatchEvent(new Event(type));
841
- const trackProgress = () => {
842
- const current = player();
843
- if (!current || typeof current.getCurrentTime !== "function") return;
844
- const time = Number(current.getCurrentTime()) || 0;
845
- const duration = Number(current.getDuration?.()) || state.duration;
846
- state.currentTime = time;
847
- if (duration > 0 && duration !== state.duration) {
848
- state.duration = duration;
849
- emit("durationchange");
850
- }
851
- const { corp, endTime, isLoop: loops } = live.current;
852
- const safetyEnd = endTime > 0 ? endTime : duration > 0 ? duration - Math.max(corp, 0.4) : 0;
853
- if (safetyEnd > 0 && time >= safetyEnd) {
854
- if (state.loop || loops) {
855
- state.currentTime = restart(current);
856
- } else {
857
- current.pauseVideo?.();
858
- state.paused = true;
859
- setVideoPlaying(false);
860
- }
861
- }
862
- emit("timeupdate");
863
- };
864
- const handleReady = (event) => {
865
- if (isDisposed) return;
866
- const target = event.target;
867
- playerRef.current = target ?? null;
868
- state.duration = Number(target?.getDuration?.()) || 0;
869
- const { isMuted: muted, isPlaying: isPlaying2, playbackRate: rate } = live.current;
870
- if (rate !== 1) target?.setPlaybackRate?.(rate);
871
- if (muted) {
872
- target?.mute?.();
873
- } else {
874
- target?.unMute?.();
875
- target?.setVolume?.(80);
876
- }
877
- if (live.current.shouldAutoPlay && isPlaying2) {
878
- setHighQuality(target);
879
- target?.playVideo?.();
880
- state.paused = false;
881
- setVideoPlaying(true);
882
- }
883
- if (proxyElement) {
884
- setVideoElement(proxyElement);
885
- emit("loadedmetadata");
886
- emit("durationchange");
887
- }
888
- progressInterval = window.setInterval(trackProgress, 200);
889
- };
890
- const handleStateChange = (event) => {
891
- if (isDisposed) return;
892
- switch (event.data) {
893
- case PLAYER_STATE.PLAYING:
894
- setHighQuality(event.target);
895
- state.paused = false;
896
- setIsFrameReady(true);
897
- setIsBuffering(false);
898
- setVideoPlaying(true);
899
- emit("play");
900
- emit("playing");
901
- break;
902
- case PLAYER_STATE.BUFFERING:
903
- setIsBuffering(true);
904
- break;
905
- case PLAYER_STATE.PAUSED:
906
- state.paused = true;
907
- setIsBuffering(false);
908
- setVideoPlaying(false);
909
- emit("pause");
910
- break;
911
- case PLAYER_STATE.ENDED:
912
- if (state.loop || live.current.isLoop) {
913
- restart(player());
914
- } else {
915
- state.paused = true;
916
- setVideoPlaying(false);
917
- emit("ended");
918
- }
919
- break;
920
- }
921
- };
922
- loadYouTubeIframeApi().then((YT) => {
923
- const host = hostRef.current;
924
- if (isDisposed || !YT?.Player || !host) return;
925
- host.innerHTML = "";
926
- const mountTarget = document.createElement("div");
927
- host.appendChild(mountTarget);
928
- proxyElement = createYouTubeVideoElementProxy({
929
- getCurrentTime: () => state.currentTime,
930
- getDuration: () => state.duration,
931
- getLoop: () => state.loop,
932
- getMuted: () => state.muted,
933
- getPaused: () => state.paused,
934
- getPlaybackRate: () => state.playbackRate,
935
- getVolume: () => state.volume,
936
- pause: () => {
937
- state.paused = true;
938
- player()?.pauseVideo?.();
939
- setVideoPlaying(false);
940
- },
941
- play: async () => {
942
- state.paused = false;
943
- player()?.playVideo?.();
944
- setVideoPlaying(true);
945
- },
946
- seekTo: (seconds) => {
947
- state.currentTime = seconds;
948
- player()?.seekTo?.(seconds, true);
949
- if (!state.paused) player()?.playVideo?.();
950
- },
951
- setLoop: (loop) => {
952
- state.loop = loop;
953
- },
954
- setMuted: (muted) => {
955
- state.muted = muted;
956
- if (muted) {
957
- player()?.mute?.();
958
- return;
959
- }
960
- player()?.unMute?.();
961
- if (state.volume === 0) {
962
- state.volume = 0.7;
963
- player()?.setVolume?.(70);
964
- }
965
- },
966
- setPlaybackRate: (rate) => {
967
- state.playbackRate = rate;
968
- player()?.setPlaybackRate?.(rate);
969
- },
970
- setVolume: (volume) => {
971
- state.volume = volume;
972
- player()?.setVolume?.(Math.round(volume * 100));
973
- if (volume > 0 && state.muted) {
974
- state.muted = false;
975
- player()?.unMute?.();
976
- } else if (volume === 0 && !state.muted) {
977
- state.muted = true;
978
- player()?.mute?.();
979
- }
980
- }
981
- });
982
- const initial = live.current;
983
- playerRef.current = new YT.Player(mountTarget, {
984
- events: { onReady: handleReady, onStateChange: handleStateChange },
985
- host: "https://www.youtube-nocookie.com",
986
- playerVars: {
987
- autoplay: initial.shouldAutoPlay ? 1 : 0,
988
- controls: 0,
989
- disablekb: 1,
990
- enablejsapi: 1,
991
- fs: 0,
992
- iv_load_policy: 3,
993
- loop: initial.isLoop ? 1 : 0,
994
- modestbranding: 1,
995
- mute: initial.isMuted ? 1 : 0,
996
- origin: window.location.origin,
997
- playlist: videoId,
998
- playsinline: 1,
999
- rel: 0,
1000
- start: Math.floor(initial.startTime || 0)
1001
- },
1002
- videoId
1003
- });
1004
- });
1005
- return () => {
1006
- isDisposed = true;
1007
- if (progressInterval !== null) window.clearInterval(progressInterval);
1008
- try {
1009
- playerRef.current?.destroy?.();
1010
- } catch {
1011
- }
1012
- playerRef.current = null;
1013
- setVideoElement(null);
1014
- };
1015
- }, [
1016
- enabled,
1017
- hostRef,
1018
- isLoop,
1019
- isMuted,
1020
- live,
1021
- playbackRate,
1022
- setIsBuffering,
1023
- setIsFrameReady,
1024
- setVideoElement,
1025
- setVideoPlaying,
1026
- shouldAutoPlay,
1027
- startTime,
1028
- videoId
1029
- ]);
1030
- useEffect(() => {
1031
- const current = playerRef.current;
1032
- if (!enabled || !current) return;
1033
- try {
1034
- if (isPlaying) current.playVideo?.();
1035
- else current.pauseVideo?.();
1036
- if (isMuted) current.mute?.();
1037
- else current.unMute?.();
1038
- if (playbackRate) current.setPlaybackRate?.(playbackRate);
1039
- } catch {
1040
- }
1041
- }, [enabled, isMuted, isPlaying, playbackRate]);
1042
- }
1043
- var AUDIO_SYNC_EVENTS = [
1044
- "play",
1045
- "playing",
1046
- "pause",
1047
- "waiting",
1048
- "volumechange",
1049
- "ratechange"
1050
- ];
1051
- function setElementMuted(video, muted) {
1052
- video.muted = muted;
1053
- if (!muted && video.volume === 0) video.volume = 0.8;
1054
- }
1055
- function unlockAudioOnGesture(unlock) {
1056
- const handler = () => {
1057
- unlock();
1058
- window.removeEventListener("pointerdown", handler);
1059
- window.removeEventListener("keydown", handler);
1060
- };
1061
- window.addEventListener("pointerdown", handler, { once: true });
1062
- window.addEventListener("keydown", handler, { once: true });
1063
- }
1064
- function useYouTubeBackgroundPlayerModel({
1065
- codec = "auto",
1066
- corp = 0,
1067
- endTime = 0,
1068
- forceIframe = false,
1069
- isLoop = false,
1070
- isMuted = true,
1071
- isPlaying = true,
1072
- playbackRate = 1,
1073
- posterUrl = null,
1074
- quality = "1080p",
1075
- setVideoElement,
1076
- setVideoPlaying,
1077
- shouldAutoPlay = true,
1078
- showPoster = false,
1079
- showSpinner = true,
1080
- startTime = 0,
1081
- videoClasses: _videoClasses,
1082
- videoId,
1083
- videoStyle: _videoStyle
1084
- }) {
1085
- const [useIframeFallback, setUseIframeFallback] = useState(
1086
- Boolean(forceIframe)
1087
- );
1088
- const [isFrameReady, setIsFrameReady] = useState(false);
1089
- const [isBuffering, setIsBuffering] = useState(true);
1090
- const videoRef = useRef(null);
1091
- const audioRef = useRef(null);
1092
- const iframeHostRef = useRef(null);
1093
- const hasLoadedVideoRef = useRef(false);
1094
- const errorRetryCountRef = useRef(0);
1095
- const audioErrorRetryCountRef = useRef(0);
1096
- const retryTimerIdsRef = useRef(/* @__PURE__ */ new Set());
1097
- const lastAudioSeekAtRef = useRef(0);
1098
- const live = useRef({
1099
- corp,
1100
- endTime,
1101
- isLoop,
1102
- isMuted,
1103
- isPlaying,
1104
- playbackRate,
1105
- shouldAutoPlay,
1106
- startTime
1107
- });
1108
- live.current = {
1109
- corp,
1110
- endTime,
1111
- isLoop,
1112
- isMuted,
1113
- isPlaying,
1114
- playbackRate,
1115
- shouldAutoPlay,
1116
- startTime
1117
- };
1118
- useEffect(() => {
1119
- setUseIframeFallback(Boolean(forceIframe));
1120
- setIsFrameReady(false);
1121
- setIsBuffering(true);
1122
- hasLoadedVideoRef.current = false;
1123
- errorRetryCountRef.current = 0;
1124
- audioErrorRetryCountRef.current = 0;
1125
- }, [forceIframe, videoId]);
1126
- const videoStreamUrl = useMemo(
1127
- () => getYouTubeStreamUrl(videoId, { codec, quality, stream: "video" }),
1128
- [codec, quality, videoId]
1129
- );
1130
- const audioStreamUrl = useMemo(
1131
- () => getYouTubeStreamUrl(videoId, { stream: "audio" }),
1132
- [videoId]
1133
- );
1134
- const resolvedPoster = showPoster ? posterUrl || getYouTubeThumbnailUrl(videoId, true) : null;
1135
- const syncCompanionAudio = useCallback((forceSeek = false) => {
1136
- const video = videoRef.current;
1137
- const audio = audioRef.current;
1138
- if (!video || !audio) return;
1139
- try {
1140
- const targetRate = Number(video.playbackRate) || 1;
1141
- if (audio.playbackRate !== targetRate) audio.playbackRate = targetRate;
1142
- if (audio.readyState < 2 || !Number.isFinite(audio.duration) || audio.duration <= 0) {
1143
- return;
1144
- }
1145
- const volume = Math.max(0, Math.min(1, Number(video.volume) ?? 1));
1146
- if (Math.abs(audio.volume - volume) > 5e-3) audio.volume = volume;
1147
- const isSilent = Boolean(video.muted) || volume === 0;
1148
- if (audio.muted !== isSilent) audio.muted = isSilent;
1149
- if (video.paused || video.ended || video.seeking) {
1150
- if (!audio.paused) audio.pause();
1151
- return;
1152
- }
1153
- const now = performance.now();
1154
- const drift = Math.abs(audio.currentTime - video.currentTime);
1155
- const maxDrift = isSilent ? 0.5 : 0.35;
1156
- if (forceSeek || drift > maxDrift && now - lastAudioSeekAtRef.current > 1500) {
1157
- lastAudioSeekAtRef.current = now;
1158
- audio.currentTime = video.currentTime;
1159
- }
1160
- if (audio.paused) audio.play().catch(() => {
1161
- });
1162
- } catch {
1163
- }
1164
- }, []);
1165
- const playWithFallback = useCallback(
1166
- (video, forceSeek, unlockAudio) => {
1167
- const onPlayed = () => {
1168
- setVideoPlaying(true);
1169
- syncCompanionAudio(forceSeek);
1170
- };
1171
- video.play().then(onPlayed).catch((error) => {
1172
- if (error?.name !== "NotAllowedError") return;
1173
- video.muted = true;
1174
- video.play().then(() => {
1175
- onPlayed();
1176
- if (!unlockAudio) return;
1177
- unlockAudioOnGesture(() => {
1178
- const current = videoRef.current;
1179
- if (!live.current.isMuted && current) {
1180
- setElementMuted(current, false);
1181
- }
1182
- });
1183
- }).catch(() => {
1184
- });
1185
- });
1186
- },
1187
- [setVideoPlaying, syncCompanionAudio]
1188
- );
1189
- const scheduleRetry = (callback, delay) => {
1190
- const timerId = window.setTimeout(() => {
1191
- retryTimerIdsRef.current.delete(timerId);
1192
- try {
1193
- callback();
1194
- } catch {
1195
- }
1196
- }, delay);
1197
- retryTimerIdsRef.current.add(timerId);
1198
- };
1199
- const handleEnded = useCallback(() => {
1200
- const video = videoRef.current;
1201
- const audio = audioRef.current;
1202
- if (!video) return;
1203
- if (video.loop || live.current.isLoop) {
1204
- const resetTime = Math.max(0, live.current.startTime || 0);
1205
- video.currentTime = resetTime;
1206
- if (audio && audio.readyState >= 2) audio.currentTime = resetTime;
1207
- video.play().then(() => {
1208
- setVideoPlaying(true);
1209
- syncCompanionAudio(true);
1210
- }).catch(() => {
1211
- });
1212
- return;
1213
- }
1214
- video.pause();
1215
- if (audio && !audio.paused) audio.pause();
1216
- setVideoPlaying(false);
1217
- }, [setVideoPlaying, syncCompanionAudio]);
1218
- const handleTimeUpdate = () => {
1219
- const video = videoRef.current;
1220
- if (!video) return;
1221
- if (video.currentTime > 0 && video.readyState >= 2) {
1222
- setIsFrameReady(true);
1223
- setIsBuffering(false);
1224
- }
1225
- const duration = Number(video.duration) || 0;
1226
- const { corp: activeCorp, endTime: activeEndTime } = live.current;
1227
- const effectiveEnd = activeEndTime > 0 ? activeEndTime : activeCorp > 0 && duration > 0 ? duration - activeCorp : 0;
1228
- if (effectiveEnd > 0 && video.currentTime >= effectiveEnd) handleEnded();
1229
- };
1230
- const handlePlay = () => {
1231
- const video = videoRef.current;
1232
- hasLoadedVideoRef.current = true;
1233
- if (video && !live.current.isMuted && video.muted) {
1234
- setElementMuted(video, false);
1235
- }
1236
- if (!video || video.readyState < 2) setIsBuffering(true);
1237
- setVideoPlaying(true);
1238
- syncCompanionAudio(false);
1239
- };
1240
- const handlePlaying = () => {
1241
- hasLoadedVideoRef.current = true;
1242
- setIsFrameReady(true);
1243
- setIsBuffering(false);
1244
- setVideoPlaying(true);
1245
- syncCompanionAudio(false);
1246
- };
1247
- const handlePause = () => {
1248
- const video = videoRef.current;
1249
- syncCompanionAudio(false);
1250
- setIsBuffering(false);
1251
- if (video && !video.seeking && !video.ended && !live.current.isPlaying) {
1252
- setVideoPlaying(false);
1253
- }
1254
- };
1255
- const handleSeeked = () => {
1256
- const video = videoRef.current;
1257
- if (!video) return;
1258
- setIsFrameReady(true);
1259
- if (video.readyState >= 2 && (!live.current.isPlaying || !video.paused)) {
1260
- setIsBuffering(false);
1261
- }
1262
- syncCompanionAudio(true);
1263
- if (live.current.isPlaying && video.paused) {
1264
- video.play().then(() => {
1265
- setVideoPlaying(true);
1266
- syncCompanionAudio(true);
1267
- }).catch(() => {
1268
- });
1269
- }
1270
- };
1271
- const handleCanPlay = () => {
1272
- const video = videoRef.current;
1273
- if (!video) return;
1274
- hasLoadedVideoRef.current = true;
1275
- if (!live.current.isPlaying) {
1276
- setIsFrameReady(true);
1277
- setIsBuffering(false);
1278
- } else if (video.paused) {
1279
- setElementMuted(video, Boolean(live.current.isMuted));
1280
- playWithFallback(video, false, true);
1281
- }
1282
- };
1283
- const handleLoadedMetadata = () => {
1284
- const video = videoRef.current;
1285
- if (!video) return;
1286
- hasLoadedVideoRef.current = true;
1287
- if (startTime > 0 && video.currentTime < startTime) {
1288
- video.currentTime = startTime;
1289
- if (audioRef.current) audioRef.current.currentTime = startTime;
1290
- }
1291
- };
1292
- const handleLoadedData = () => {
1293
- const video = videoRef.current;
1294
- if (!video) return;
1295
- hasLoadedVideoRef.current = true;
1296
- video.playbackRate = playbackRate;
1297
- setElementMuted(video, Boolean(live.current.isMuted));
1298
- if (startTime > 0 && video.currentTime < startTime) {
1299
- video.currentTime = startTime;
1300
- }
1301
- if (!live.current.isPlaying) {
1302
- setIsFrameReady(true);
1303
- setIsBuffering(false);
1304
- } else if (video.paused) {
1305
- playWithFallback(video, true, false);
1306
- }
1307
- };
1308
- const handleError = () => {
1309
- const video = videoRef.current;
1310
- if (video && hasLoadedVideoRef.current) {
1311
- const resumeTime = video.currentTime || 0;
1312
- scheduleRetry(() => {
1313
- video.load();
1314
- video.currentTime = resumeTime;
1315
- if (live.current.isPlaying) video.play().catch(() => {
1316
- });
1317
- }, 150);
1318
- return;
1319
- }
1320
- errorRetryCountRef.current += 1;
1321
- if (video && errorRetryCountRef.current <= 1) {
1322
- scheduleRetry(() => video.load(), 200);
1323
- return;
1324
- }
1325
- setUseIframeFallback(true);
1326
- };
1327
- const handleAudioError = useCallback(() => {
1328
- const audio = audioRef.current;
1329
- if (!audio) return;
1330
- audioErrorRetryCountRef.current += 1;
1331
- if (audioErrorRetryCountRef.current <= 1) {
1332
- scheduleRetry(() => {
1333
- audio.load();
1334
- if (videoRef.current) {
1335
- audio.currentTime = videoRef.current.currentTime || 0;
1336
- }
1337
- }, 200);
1338
- return;
1339
- }
1340
- if (!live.current.isMuted) {
1341
- setUseIframeFallback(true);
1342
- }
1343
- }, []);
1344
- useEffect(() => {
1345
- if (useIframeFallback) return void 0;
1346
- const video = videoRef.current;
1347
- const audio = audioRef.current;
1348
- const retryTimerIds = retryTimerIdsRef.current;
1349
- if (!video) {
1350
- setVideoElement(null);
1351
- return void 0;
1352
- }
1353
- setVideoElement(video);
1354
- const onSync = () => syncCompanionAudio(false);
1355
- const onSeeked = () => syncCompanionAudio(true);
1356
- for (const event of AUDIO_SYNC_EVENTS) {
1357
- video.addEventListener(event, onSync);
1358
- }
1359
- video.addEventListener("seeked", onSeeked);
1360
- const syncTimer = window.setInterval(onSync, 1e3);
1361
- return () => {
1362
- window.clearInterval(syncTimer);
1363
- retryTimerIds.forEach((timerId) => window.clearTimeout(timerId));
1364
- retryTimerIds.clear();
1365
- for (const event of AUDIO_SYNC_EVENTS) {
1366
- video.removeEventListener(event, onSync);
1367
- }
1368
- video.removeEventListener("seeked", onSeeked);
1369
- try {
1370
- video.pause();
1371
- audio?.pause();
1372
- } catch {
1373
- }
1374
- };
1375
- }, [setVideoElement, syncCompanionAudio, useIframeFallback, videoStreamUrl]);
1376
- useEffect(() => {
1377
- const video = videoRef.current;
1378
- if (useIframeFallback || !video) return;
1379
- applyVideoPlaybackState({
1380
- isPlaying,
1381
- playbackRate,
1382
- setVideoPlaying,
1383
- videoElement: video
1384
- });
1385
- syncCompanionAudio();
1386
- }, [
1387
- isPlaying,
1388
- playbackRate,
1389
- setVideoPlaying,
1390
- syncCompanionAudio,
1391
- useIframeFallback
1392
- ]);
1393
- useEffect(() => {
1394
- const video = videoRef.current;
1395
- if (useIframeFallback || !video) return;
1396
- if (video.muted !== isMuted) setElementMuted(video, isMuted);
1397
- syncCompanionAudio(true);
1398
- }, [isMuted, syncCompanionAudio, useIframeFallback]);
1399
- useYouTubeIframePlayer({
1400
- enabled: useIframeFallback,
1401
- hostRef: iframeHostRef,
1402
- isLoop,
1403
- isMuted,
1404
- isPlaying,
1405
- live,
1406
- playbackRate,
1407
- setIsBuffering,
1408
- setIsFrameReady,
1409
- setVideoElement,
1410
- setVideoPlaying,
1411
- shouldAutoPlay,
1412
- startTime,
1413
- videoId
1414
- });
1415
- const isCovered = !isFrameReady || useIframeFallback && !isPlaying;
1416
- const showSpinnerOverlay = showSpinner && (!isFrameReady || isBuffering);
1417
- return {
1418
- useIframeFallback,
1419
- isFrameReady,
1420
- setIsBuffering,
1421
- videoRef,
1422
- audioRef,
1423
- iframeHostRef,
1424
- videoStreamUrl,
1425
- audioStreamUrl,
1426
- resolvedPoster,
1427
- syncCompanionAudio,
1428
- handleEnded,
1429
- handleTimeUpdate,
1430
- handlePlay,
1431
- handlePlaying,
1432
- handlePause,
1433
- handleSeeked,
1434
- handleCanPlay,
1435
- handleLoadedMetadata,
1436
- handleLoadedData,
1437
- handleError,
1438
- handleAudioError,
1439
- isCovered,
1440
- showSpinnerOverlay
1441
- };
1442
- }
1443
- var YouTubeBackgroundPlayer = memo(function YouTubeBackgroundPlayer2({
1444
- codec = "auto",
1445
- corp = 0,
1446
- endTime = 0,
1447
- forceIframe = false,
1448
- isLoop = false,
1449
- isMuted = true,
1450
- isPlaying = true,
1451
- playbackRate = 1,
1452
- posterUrl = null,
1453
- quality = "1080p",
1454
- setVideoElement,
1455
- setVideoPlaying,
1456
- shouldAutoPlay = true,
1457
- showPoster = false,
1458
- showSpinner = true,
1459
- startTime = 0,
1460
- theme,
1461
- videoClasses,
1462
- videoId,
1463
- videoStyle
1464
- }) {
1465
- const {
1466
- useIframeFallback,
1467
- isFrameReady,
1468
- setIsBuffering: _setIsBuffering,
1469
- videoRef,
1470
- audioRef,
1471
- iframeHostRef,
1472
- videoStreamUrl,
1473
- audioStreamUrl,
1474
- resolvedPoster,
1475
- syncCompanionAudio: _syncCompanionAudio,
1476
- handleEnded,
1477
- handleTimeUpdate,
1478
- handlePlay,
1479
- handlePlaying,
1480
- handlePause,
1481
- handleSeeked,
1482
- handleCanPlay,
1483
- handleLoadedMetadata,
1484
- handleLoadedData,
1485
- handleError,
1486
- handleAudioError,
1487
- isCovered,
1488
- showSpinnerOverlay
1489
- } = useYouTubeBackgroundPlayerModel({
1490
- codec,
1491
- corp,
1492
- endTime,
1493
- forceIframe,
1494
- isLoop,
1495
- isMuted,
1496
- isPlaying,
1497
- playbackRate,
1498
- posterUrl,
1499
- quality,
1500
- setVideoElement,
1501
- setVideoPlaying,
1502
- shouldAutoPlay,
1503
- showPoster,
1504
- showSpinner,
1505
- startTime,
1506
- videoClasses,
1507
- videoId,
1508
- videoStyle
1509
- });
1510
- return /* @__PURE__ */ jsxs("div", { className: theme.slots.youtube, children: [
1511
- /* @__PURE__ */ jsx("div", { "data-visible": isCovered, className: theme.slots.youtubeCover }),
1512
- /* @__PURE__ */ jsx(
1513
- "div",
1514
- {
1515
- "data-visible": showSpinnerOverlay,
1516
- className: theme.slots.youtubeSpinner,
1517
- children: showSpinner ? /* @__PURE__ */ jsx(Spinner, { size: 30, className: theme.slots.youtubeSpinnerIcon }) : null
1518
- }
1519
- ),
1520
- resolvedPoster ? /* @__PURE__ */ jsx(
1521
- "div",
1522
- {
1523
- "data-visible": isCovered,
1524
- className: theme.slots.youtubePoster,
1525
- style: {
1526
- backgroundImage: `url(${resolvedPoster})`,
1527
- ...videoStyle
1528
- }
1529
- }
1530
- ) : null,
1531
- useIframeFallback && !isPlaying ? /* @__PURE__ */ jsx("div", { className: theme.slots.youtubeBlackout }) : null,
1532
- useIframeFallback ? /* @__PURE__ */ jsx(
1533
- "div",
1534
- {
1535
- "data-visible": isFrameReady,
1536
- className: theme.slots.youtubeFrame,
1537
- style: videoStyle,
1538
- children: /* @__PURE__ */ jsx("div", { ref: iframeHostRef, className: theme.slots.youtubeHost })
1539
- }
1540
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
1541
- /* @__PURE__ */ jsx(
1542
- "video",
1543
- {
1544
- ref: videoRef,
1545
- src: videoStreamUrl,
1546
- "data-visible": isFrameReady,
1547
- className: cn(videoClasses, theme.slots.youtubeVideo),
1548
- preload: "auto",
1549
- muted: isMuted,
1550
- loop: isLoop,
1551
- playsInline: true,
1552
- style: videoStyle,
1553
- onTimeUpdate: handleTimeUpdate,
1554
- onEnded: handleEnded,
1555
- onPlay: handlePlay,
1556
- onWaiting: () => {
1557
- _setIsBuffering(true);
1558
- _syncCompanionAudio(false);
1559
- },
1560
- onPlaying: handlePlaying,
1561
- onPause: handlePause,
1562
- onSeeking: () => _setIsBuffering(true),
1563
- onSeeked: handleSeeked,
1564
- onCanPlay: handleCanPlay,
1565
- onLoadedMetadata: handleLoadedMetadata,
1566
- onLoadedData: handleLoadedData,
1567
- onError: handleError
1568
- }
1569
- ),
1570
- /* @__PURE__ */ jsx(
1571
- "audio",
1572
- {
1573
- ref: audioRef,
1574
- src: audioStreamUrl,
1575
- preload: "auto",
1576
- onCanPlay: () => _syncCompanionAudio(true),
1577
- onError: handleAudioError
1578
- }
1579
- )
1580
- ] })
1581
- ] });
1582
- });
1583
- function useNativeVideoModel({
1584
- corp,
1585
- isLoop,
1586
- isMuted,
1587
- isPlaying,
1588
- playbackRate,
1589
- setVideoElement,
1590
- setVideoPlaying,
1591
- shouldAutoPlay,
1592
- src,
1593
- style: _style,
1594
- className: _className
1595
- }) {
1596
- const videoRef = useRef(null);
1597
- const handleEnded = useCallback(() => {
1598
- const video = videoRef.current;
1599
- if (!video) return;
1600
- if (video.loop) {
1601
- video.currentTime = 0;
1602
- video.play().catch((error) => report("Background loop play", error, "warn"));
1603
- return;
1604
- }
1605
- video.pause();
1606
- setVideoPlaying(false);
1607
- }, [setVideoPlaying]);
1608
- const handleTimeUpdate = useCallback(() => {
1609
- const video = videoRef.current;
1610
- if (video?.duration && corp > 0 && video.currentTime >= video.duration - corp) {
1611
- handleEnded();
1612
- }
1613
- }, [corp, handleEnded]);
1614
- const handleLoadedData = () => {
1615
- const video = videoRef.current;
1616
- if (!video) return;
1617
- video.playbackRate = playbackRate;
1618
- if (!shouldAutoPlay) return;
1619
- if (isMuted) video.muted = true;
1620
- video.play().then(() => setVideoPlaying(true)).catch((error) => {
1621
- report("Background autoplay", error, "warn");
1622
- setVideoPlaying(false);
1623
- });
1624
- };
1625
- useEffect(() => {
1626
- const video = videoRef.current;
1627
- setVideoElement(video);
1628
- return () => {
1629
- try {
1630
- video?.pause();
1631
- } catch {
1632
- }
1633
- };
1634
- }, [src, setVideoElement]);
1635
- useEffect(() => () => setVideoElement(null), [setVideoElement]);
1636
- useEffect(() => {
1637
- applyVideoPlaybackState({
1638
- isPlaying,
1639
- playbackRate,
1640
- setVideoPlaying,
1641
- videoElement: videoRef.current
1642
- });
1643
- }, [isPlaying, playbackRate, setVideoPlaying]);
1644
- return { videoRef, handleEnded, handleTimeUpdate, handleLoadedData };
1645
- }
1646
- function NativeVideo({
1647
- corp,
1648
- isLoop,
1649
- isMuted,
1650
- isPlaying,
1651
- playbackRate,
1652
- setVideoElement,
1653
- setVideoPlaying,
1654
- shouldAutoPlay,
1655
- src,
1656
- style,
1657
- className
1658
- }) {
1659
- const { videoRef, handleEnded, handleTimeUpdate, handleLoadedData } = useNativeVideoModel({
1660
- corp,
1661
- isLoop,
1662
- isMuted,
1663
- isPlaying,
1664
- playbackRate,
1665
- setVideoElement,
1666
- setVideoPlaying,
1667
- shouldAutoPlay,
1668
- src,
1669
- style,
1670
- className
1671
- });
1672
- return /* @__PURE__ */ jsx(
1673
- "video",
1674
- {
1675
- ref: videoRef,
1676
- src,
1677
- className,
1678
- preload: "auto",
1679
- muted: isMuted,
1680
- loop: isLoop,
1681
- playsInline: true,
1682
- style,
1683
- onTimeUpdate: handleTimeUpdate,
1684
- onEnded: handleEnded,
1685
- onLoadedData: handleLoadedData
1686
- }
1687
- );
1688
- }
1689
- var BackgroundGradients = memo(function BackgroundGradients2({
1690
- count = 0,
1691
- direction,
1692
- color = DEFAULT_COLOR,
1693
- theme
1694
- }) {
1695
- if (!count || count <= 0) return null;
1696
- const opacity = Math.min(1, Math.max(0.2, count * 0.25));
1697
- return /* @__PURE__ */ jsx(
1698
- "div",
1699
- {
1700
- "data-side": direction,
1701
- className: theme.slots.gradient,
1702
- style: {
1703
- ...theme.styles.gradient,
1704
- opacity,
1705
- background: generateBaseGradient(direction, color)
1706
- }
1707
- }
1708
- );
1709
- });
1710
- var EdgeGradient = memo(function EdgeGradient2({
1711
- direction,
1712
- percent = 0,
1713
- opacity = 0,
1714
- color,
1715
- theme
1716
- }) {
1717
- if (opacity <= 0) return null;
1718
- return /* @__PURE__ */ jsx(
1719
- "div",
1720
- {
1721
- "data-side": direction,
1722
- className: theme.slots.edge,
1723
- style: {
1724
- width: `${Math.max(30, percent * 1.15)}%`,
1725
- opacity,
1726
- background: generateEdgeGradient(direction, color || DEFAULT_COLOR)
1727
- }
1728
- }
1729
- );
1730
- });
1731
- var NoiseOverlay = memo(function NoiseOverlay2({
1732
- opacity,
1733
- blendMode,
1734
- inlineStyle,
1735
- maskImage,
1736
- isFixed,
1737
- theme
1738
- }) {
1739
- return /* @__PURE__ */ jsx(
1740
- "div",
1741
- {
1742
- "data-position": isFixed ? "fixed" : "absolute",
1743
- className: theme.slots.noise,
1744
- style: {
1745
- ...theme.styles.noise,
1746
- ...typeof opacity === "number" ? { opacity } : {},
1747
- ...typeof blendMode === "string" && blendMode.trim() ? { mixBlendMode: blendMode } : {},
1748
- ...maskImage ? { maskImage, WebkitMaskImage: maskImage } : {},
1749
- ...inlineStyle
1750
- }
1751
- }
1752
- );
1753
- });
1754
- var SolidOverlay = memo(function SolidOverlay2({
1755
- opacity = 0,
1756
- color,
1757
- transitionStyle,
1758
- maskImage,
1759
- theme
1760
- }) {
1761
- return /* @__PURE__ */ jsx(
1762
- "div",
1763
- {
1764
- className: theme.slots.solid,
1765
- style: {
1766
- opacity,
1767
- backgroundColor: color,
1768
- ...maskImage ? { maskImage, WebkitMaskImage: maskImage } : {},
1769
- ...transitionStyle
1770
- }
1771
- }
1772
- );
1773
- });
1774
- function useBackgroundOverlayModel() {
1775
- const {
1776
- animation,
1777
- className,
1778
- fadeEdges,
1779
- fit,
1780
- hasBackground,
1781
- image,
1782
- imageStyle,
1783
- isPlaying,
1784
- isVideo,
1785
- isYouTube,
1786
- leftGradient: configuredLeftGradient,
1787
- noiseStyle,
1788
- overlay,
1789
- overlayColor,
1790
- overlayOpacity,
1791
- position,
1792
- rightGradient: configuredRightGradient,
1793
- video,
1794
- videoClassName,
1795
- videoOptions,
1796
- videoStyle,
1797
- width
1798
- } = useBackgroundState();
1799
- const { setVideoElement, setVideoPlaying } = useBackgroundActions();
1800
- const options = resolveVideoOptions(videoOptions);
1801
- const { corp, isMuted, playbackRate } = options;
1802
- const youtubeConfig = useMemo(
1803
- () => isYouTube ? parseYouTubeUrlConfig(video) : null,
1804
- [isYouTube, video]
1805
- );
1806
- const startTime = videoOptions?.startTime ?? youtubeConfig?.startTime ?? 0;
1807
- const endTime = videoOptions?.endTime ?? youtubeConfig?.endTime ?? 0;
1808
- const backgroundKey = isVideo ? youtubeConfig ? `youtube:${youtubeConfig.videoId}` : video : image;
1809
- const backgroundMotion = useBackgroundMotion();
1810
- const { reduced, tempo } = useMotionTokens();
1811
- const motionConfig = useMemo(
1812
- () => getBackgroundMotionConfig(
1813
- backgroundMotion,
1814
- retime(animation, { reduced, tempo })
1815
- ),
1816
- [animation, backgroundMotion, reduced, tempo]
1817
- );
1818
- const {
1819
- baseStyle,
1820
- leftGradient: styleLeft,
1821
- rightGradient: styleRight
1822
- } = useMemo(
1823
- () => getVisualStyle((isVideo ? videoStyle : imageStyle) || {}),
1824
- [imageStyle, isVideo, videoStyle]
1825
- );
1826
- const leftGradient = configuredLeftGradient ?? styleLeft;
1827
- const rightGradient = configuredRightGradient ?? styleRight;
1828
- const {
1829
- opacity: noiseOpacity,
1830
- mixBlendMode: noiseBlendMode,
1831
- ...noiseInlineStyle
1832
- } = noiseStyle || {};
1833
- const overlayTransitionStyle = useMemo(
1834
- () => ({
1835
- transitionDelay: toCssDelay(motionConfig.transition.delay),
1836
- transitionDuration: toCssDuration(
1837
- motionConfig.transition.duration,
1838
- backgroundMotion.transition.duration
1839
- ),
1840
- transitionProperty: "opacity",
1841
- transitionTimingFunction: toCssEasing(motionConfig.transition.ease)
1842
- }),
1843
- [backgroundMotion.transition.duration, motionConfig.transition]
1844
- );
1845
- const rawWidth = width ?? videoOptions?.width ?? videoStyle?.width;
1846
- const resolvedWidth = rawWidth === void 0 || rawWidth === null || rawWidth === "" ? void 0 : typeof rawWidth === "number" ? `${rawWidth}px` : String(rawWidth);
1847
- const rawFit = fit ?? videoOptions?.fit ?? videoOptions?.objectFit;
1848
- const theme = useTheme(backgroundTheme);
1849
- const fitStyle = useMemo(
1850
- () => rawFit && OBJECT_FITS.includes(rawFit) ? { objectFit: rawFit } : {},
1851
- [rawFit]
1852
- );
1853
- const classNames = resolveVideoClassNames(
1854
- videoClassName,
1855
- className,
1856
- videoOptions?.videoClassName,
1857
- videoOptions?.className,
1858
- videoStyle?.className
1859
- );
1860
- const hasCustomWidth = Boolean(resolvedWidth || classNames.width);
1861
- const gradientSettings = useMemo(
1862
- () => resolveGradientSettings({
1863
- fadeEdges,
1864
- hasWidth: hasCustomWidth,
1865
- leftGradient,
1866
- rightGradient
1867
- }),
1868
- [fadeEdges, hasCustomWidth, leftGradient, rightGradient]
1869
- );
1870
- const maskImage = useMemo(
1871
- () => gradientSettings.enabled ? getEdgeFadeMask({
1872
- color: overlayColor || DEFAULT_COLOR,
1873
- leftPercent: gradientSettings.leftPercent,
1874
- rightPercent: gradientSettings.rightPercent
1875
- }) : void 0,
1876
- [gradientSettings, overlayColor]
1877
- );
1878
- const framePosition = position === "left" || position === "right" ? position : "center";
1879
- const videoClasses = cn(theme.slots.video, classNames.other);
1880
- const objectPosition2 = baseStyle.objectPosition || position || void 0;
1881
- const sharedVideoStyle = useMemo(
1882
- () => ({
1883
- ...classNames.objectStyle,
1884
- ...fitStyle,
1885
- ...objectPosition2 ? { objectPosition: objectPosition2 } : {},
1886
- ...maskImage ? { WebkitMaskImage: maskImage, maskImage } : {},
1887
- ...baseStyle
1888
- }),
1889
- [baseStyle, classNames.objectStyle, fitStyle, maskImage, objectPosition2]
1890
- );
1891
- const exitTransition = useMemo(
1892
- () => getBackgroundExitTransition(backgroundMotion, motionConfig),
1893
- [backgroundMotion, motionConfig]
1894
- );
1895
- return {
1896
- className,
1897
- hasBackground,
1898
- image,
1899
- isPlaying,
1900
- isVideo,
1901
- overlay,
1902
- overlayColor,
1903
- overlayOpacity,
1904
- position,
1905
- video,
1906
- videoStyle,
1907
- width,
1908
- setVideoElement,
1909
- setVideoPlaying,
1910
- options,
1911
- corp,
1912
- isMuted,
1913
- playbackRate,
1914
- youtubeConfig,
1915
- startTime,
1916
- endTime,
1917
- backgroundKey,
1918
- motionConfig,
1919
- baseStyle,
1920
- leftGradient,
1921
- rightGradient,
1922
- noiseOpacity,
1923
- noiseBlendMode,
1924
- noiseInlineStyle,
1925
- overlayTransitionStyle,
1926
- resolvedWidth,
1927
- classNames,
1928
- hasCustomWidth,
1929
- gradientSettings,
1930
- maskImage,
1931
- framePosition,
1932
- videoClasses,
1933
- sharedVideoStyle,
1934
- exitTransition,
1935
- theme
1936
- };
1937
- }
1938
- function BackgroundOverlay() {
1939
- const {
1940
- hasBackground,
1941
- image,
1942
- isPlaying,
1943
- isVideo,
1944
- overlay,
1945
- overlayColor,
1946
- overlayOpacity,
1947
- position,
1948
- video,
1949
- setVideoElement,
1950
- setVideoPlaying,
1951
- options,
1952
- corp,
1953
- isMuted,
1954
- playbackRate,
1955
- youtubeConfig,
1956
- startTime,
1957
- endTime,
1958
- backgroundKey,
1959
- motionConfig,
1960
- baseStyle,
1961
- leftGradient,
1962
- rightGradient,
1963
- noiseOpacity,
1964
- noiseBlendMode,
1965
- noiseInlineStyle,
1966
- overlayTransitionStyle,
1967
- resolvedWidth,
1968
- classNames,
1969
- hasCustomWidth,
1970
- gradientSettings,
1971
- maskImage,
1972
- framePosition,
1973
- videoClasses,
1974
- sharedVideoStyle,
1975
- exitTransition,
1976
- theme
1977
- } = useBackgroundOverlayModel();
1978
- return /* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: hasBackground && /* @__PURE__ */ jsxs(
1979
- motion.div,
1980
- {
1981
- initial: motionConfig.initial,
1982
- animate: motionConfig.animate,
1983
- transition: motionConfig.transition,
1984
- exit: { ...motionConfig.exit, transition: exitTransition },
1985
- className: theme.slots.root,
1986
- style: {
1987
- willChange: "transform, opacity, filter",
1988
- ...theme.styles.root
1989
- },
1990
- children: [
1991
- isVideo ? /* @__PURE__ */ jsxs(
1992
- "div",
1993
- {
1994
- "data-position": framePosition,
1995
- "data-width": classNames.width || resolvedWidth ? void 0 : "full",
1996
- className: cn(theme.slots.videoFrame, classNames.width),
1997
- style: {
1998
- ...theme.styles.videoFrame,
1999
- ...resolvedWidth ? { width: resolvedWidth } : {}
2000
- },
2001
- children: [
2002
- youtubeConfig ? /* @__PURE__ */ jsx(
2003
- YouTubeBackgroundPlayer,
2004
- {
2005
- videoId: youtubeConfig.videoId,
2006
- startTime,
2007
- endTime,
2008
- corp,
2009
- isPlaying,
2010
- isMuted,
2011
- isLoop: options.isLoop,
2012
- shouldAutoPlay: options.shouldAutoPlay,
2013
- showPoster: options.showPoster,
2014
- showSpinner: options.showSpinner,
2015
- playbackRate,
2016
- quality: options.quality,
2017
- codec: options.codec,
2018
- forceIframe: options.forceIframe,
2019
- posterUrl: options.showPoster ? image || null : null,
2020
- theme,
2021
- videoClasses,
2022
- videoStyle: sharedVideoStyle,
2023
- setVideoElement,
2024
- setVideoPlaying
2025
- }
2026
- ) : /* @__PURE__ */ jsx(
2027
- NativeVideo,
2028
- {
2029
- src: video || void 0,
2030
- className: videoClasses,
2031
- style: sharedVideoStyle,
2032
- corp,
2033
- isLoop: options.isLoop,
2034
- isMuted,
2035
- isPlaying,
2036
- playbackRate,
2037
- shouldAutoPlay: options.shouldAutoPlay,
2038
- setVideoElement,
2039
- setVideoPlaying
2040
- }
2041
- ),
2042
- /* @__PURE__ */ jsx(
2043
- EdgeGradient,
2044
- {
2045
- theme,
2046
- direction: "left",
2047
- percent: gradientSettings.leftPercent,
2048
- opacity: gradientSettings.leftOpacity,
2049
- color: overlayColor
2050
- }
2051
- ),
2052
- /* @__PURE__ */ jsx(
2053
- EdgeGradient,
2054
- {
2055
- theme,
2056
- direction: "right",
2057
- percent: gradientSettings.rightPercent,
2058
- opacity: gradientSettings.rightOpacity,
2059
- color: overlayColor
2060
- }
2061
- ),
2062
- hasCustomWidth && /* @__PURE__ */ jsx(
2063
- NoiseOverlay,
2064
- {
2065
- theme,
2066
- opacity: noiseOpacity,
2067
- blendMode: noiseBlendMode,
2068
- inlineStyle: noiseInlineStyle,
2069
- maskImage
2070
- }
2071
- ),
2072
- hasCustomWidth && overlay && /* @__PURE__ */ jsx(
2073
- SolidOverlay,
2074
- {
2075
- theme,
2076
- opacity: overlayOpacity,
2077
- color: overlayColor,
2078
- transitionStyle: overlayTransitionStyle,
2079
- maskImage
2080
- }
2081
- )
2082
- ]
2083
- }
2084
- ) : /* @__PURE__ */ jsx(
2085
- "div",
2086
- {
2087
- className: theme.slots.image,
2088
- style: {
2089
- backgroundImage: image ? `url(${image})` : void 0,
2090
- backgroundPosition: position,
2091
- ...baseStyle
2092
- }
2093
- }
2094
- ),
2095
- (!isVideo || !hasCustomWidth) && /* @__PURE__ */ jsxs(Fragment, { children: [
2096
- /* @__PURE__ */ jsx(
2097
- BackgroundGradients,
2098
- {
2099
- theme,
2100
- count: leftGradient,
2101
- direction: "left",
2102
- color: overlayColor
2103
- }
2104
- ),
2105
- /* @__PURE__ */ jsx(
2106
- BackgroundGradients,
2107
- {
2108
- theme,
2109
- count: rightGradient,
2110
- direction: "right",
2111
- color: overlayColor
2112
- }
2113
- ),
2114
- /* @__PURE__ */ jsx(
2115
- NoiseOverlay,
2116
- {
2117
- theme,
2118
- isFixed: true,
2119
- opacity: noiseOpacity,
2120
- blendMode: noiseBlendMode,
2121
- inlineStyle: noiseInlineStyle
2122
- }
2123
- ),
2124
- overlay && /* @__PURE__ */ jsx(
2125
- SolidOverlay,
2126
- {
2127
- theme,
2128
- opacity: overlayOpacity,
2129
- color: overlayColor,
2130
- transitionStyle: overlayTransitionStyle
2131
- }
2132
- )
2133
- ] })
2134
- ]
2135
- },
2136
- backgroundKey
2137
- ) });
2138
- }
2139
- function selectPageBackground(background) {
2140
- return background ? normalizeBackgroundInput(background) : null;
2141
- }
2142
- function useBackgroundPage(_slice, page) {
2143
- const actions = useBackgroundActions();
2144
- return useMemo(
2145
- () => ({
2146
- ...actions,
2147
- set: (background) => page.set({ background })
2148
- }),
2149
- [actions, page]
2150
- );
2151
- }
2152
- var backgroundModule = defineModule({
2153
- id: "background",
2154
- context: BackgroundContext,
2155
- Provider: BackgroundProvider,
2156
- Backdrop: BackgroundOverlay,
2157
- uses: ["media"],
2158
- registry: {
2159
- cleanupDelayMs: 600,
2160
- keyPolicy: "singleton",
2161
- lifecycle: "immediate",
2162
- singletonKey: BACKGROUND_REGISTRY_KEY
2163
- },
2164
- page: {
2165
- select: (config) => selectPageBackground(config.background),
2166
- entries: (slice) => [
2167
- { key: BACKGROUND_REGISTRY_KEY, value: slice }
2168
- ],
2169
- use: useBackgroundPage
2170
- }
2171
- });
2172
- function defineBackground(definition = {}) {
2173
- const { id = "background", ...config } = typeof definition === "string" ? { image: definition } : definition;
2174
- return Object.freeze({
2175
- config,
2176
- id,
2177
- use: function useDefinedBackground(overrides = {}, options = {}) {
2178
- const patch = typeof overrides === "string" ? { image: overrides } : overrides;
2179
- return useBackground({ ...config, ...patch }, options);
2180
- }
2181
- });
2182
- }
2183
-
2184
- export { BACKGROUND_MEDIA_ID, BACKGROUND_REGISTRY_KEY, BG_TOKEN_TO_OBJECT_STYLE, BackgroundContext, BackgroundOverlay, BackgroundProvider, DEFAULT_BACKGROUND, DEFAULT_BACKGROUND_COMPUTED, DEFAULT_COLOR, INERT_BACKGROUND_ACTIONS, OBJECT_FITS, YouTubeBackgroundPlayer, applyVideoPlaybackState, backgroundModule, backgroundTheme, computeBackgroundState, defineBackground, extractYouTubeVideoId, generateBaseGradient, generateEdgeGradient, getEdgeFadeMask, getYouTubeStreamUrl, getYouTubeThumbnailUrl, isDirectVideoUrl, isYouTubeUrl, mergeBackgroundState, normalizeBackgroundInput, parseYouTubeUrlConfig, resolveBackgroundState, resolveVideoClassNames, resolveVideoOptions, selectPageBackground, syncVideoLoopDirect, syncVideoMutedDirect, triggerVideoPlaybackDirect, useBackground, useBackgroundActions, useBackgroundRegistration, useBackgroundState, useOptionalBackgroundActions, useOptionalBackgroundState };
2185
- //# sourceMappingURL=chunk-AA2TWJQI.js.map
2186
- //# sourceMappingURL=chunk-AA2TWJQI.js.map