fancy-ui-vue 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/PORTING.md +123 -2
  2. package/README.md +20 -15
  3. package/dist/components/accordion/Accordion.vue.d.ts +44 -0
  4. package/dist/components/accordion/Accordion.vue.js +88 -0
  5. package/dist/components/accordion/Accordion.vue2.js +4 -0
  6. package/dist/components/accordion/AccordionContent.vue.d.ts +25 -0
  7. package/dist/components/accordion/AccordionContent.vue.js +42 -0
  8. package/dist/components/accordion/AccordionContent.vue2.js +4 -0
  9. package/dist/components/accordion/AccordionItem.vue.d.ts +21 -0
  10. package/dist/components/accordion/AccordionItem.vue.js +66 -0
  11. package/dist/components/accordion/AccordionItem.vue2.js +4 -0
  12. package/dist/components/accordion/AccordionTrigger.vue.d.ts +24 -0
  13. package/dist/components/accordion/AccordionTrigger.vue.js +83 -0
  14. package/dist/components/accordion/AccordionTrigger.vue2.js +4 -0
  15. package/dist/components/accordion/accordion-core.d.ts +35 -0
  16. package/dist/components/accordion/accordion-core.js +44 -0
  17. package/dist/components/accordion/index.d.ts +11 -0
  18. package/dist/components/accordion/types.d.ts +45 -0
  19. package/dist/components/accordion/types.js +7 -0
  20. package/dist/components/alert-dialog/AlertDialog.vue.js +22 -3
  21. package/dist/components/animated-testimonials/AnimatedTestimonials.vue.js +3 -3
  22. package/dist/components/apple-card-carousel/AppleCard.vue.js +1 -1
  23. package/dist/components/autocomplete/Autocomplete.vue.js +1 -1
  24. package/dist/components/autocomplete/Autocomplete.vue2.js +22 -15
  25. package/dist/components/avatar/Avatar.vue.d.ts +27 -0
  26. package/dist/components/avatar/Avatar.vue.js +119 -0
  27. package/dist/components/avatar/Avatar.vue2.js +4 -0
  28. package/dist/components/avatar/avatar-core.d.ts +40 -0
  29. package/dist/components/avatar/avatar-core.js +57 -0
  30. package/dist/components/avatar/index.d.ts +2 -0
  31. package/dist/components/badge/Badge.vue.d.ts +21 -0
  32. package/dist/components/badge/Badge.vue.js +46 -0
  33. package/dist/components/badge/Badge.vue2.js +4 -0
  34. package/dist/components/badge/index.d.ts +2 -0
  35. package/dist/components/bento-grid/BentoFrame.vue.js +1 -1
  36. package/dist/components/bento-grid/BentoFrame.vue2.js +6 -5
  37. package/dist/components/bento-grid/BentoGrid.vue.js +1 -1
  38. package/dist/components/bento-grid/BentoGrid.vue2.js +12 -12
  39. package/dist/components/bento-grid/BentoGridCard.vue.js +6 -5
  40. package/dist/components/bento-grid/BentoGridItem.vue.js +6 -5
  41. package/dist/components/bg-falling-stars/FallingStarsBg.vue.d.ts +1 -1
  42. package/dist/components/bg-falling-stars/FallingStarsBg.vue.js +1 -1
  43. package/dist/components/bg-falling-stars/bg-falling-stars-core.d.ts +1 -1
  44. package/dist/components/bg-falling-stars/bg-falling-stars-core.js +47 -12
  45. package/dist/components/book/Book.vue.js +8 -9
  46. package/dist/components/book/BookDescription.vue.js +6 -5
  47. package/dist/components/book/BookHeader.vue.js +6 -5
  48. package/dist/components/book/BookTitle.vue.js +6 -5
  49. package/dist/components/box-reveal/BoxReveal.vue.js +6 -5
  50. package/dist/components/button/Button.vue.d.ts +6 -4
  51. package/dist/components/button/Button.vue.js +1 -1
  52. package/dist/components/button/Button.vue2.js +50 -22
  53. package/dist/components/card-3d/CardContainer.vue.js +1 -1
  54. package/dist/components/card-3d/CardItem.vue.js +1 -1
  55. package/dist/components/card-spotlight/CardSpotlight.vue.js +1 -1
  56. package/dist/components/chat-message/ChatMessageAction.vue.d.ts +4 -2
  57. package/dist/components/chat-message/ChatMessageAction.vue.js +4 -2
  58. package/dist/components/checkbox/Checkbox.vue.d.ts +2 -0
  59. package/dist/components/checkbox/Checkbox.vue.js +1 -1
  60. package/dist/components/checkbox/Checkbox.vue2.js +17 -7
  61. package/dist/components/collapsible/Collapsible.vue.d.ts +31 -0
  62. package/dist/components/collapsible/Collapsible.vue.js +60 -0
  63. package/dist/components/collapsible/Collapsible.vue2.js +4 -0
  64. package/dist/components/collapsible/CollapsibleContent.vue.d.ts +26 -0
  65. package/dist/components/collapsible/CollapsibleContent.vue.js +81 -0
  66. package/dist/components/collapsible/CollapsibleContent.vue2.js +4 -0
  67. package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +21 -0
  68. package/dist/components/collapsible/CollapsibleTrigger.vue.js +57 -0
  69. package/dist/components/collapsible/CollapsibleTrigger.vue2.js +4 -0
  70. package/dist/components/collapsible/collapsible-core.d.ts +47 -0
  71. package/dist/components/collapsible/collapsible-core.js +40 -0
  72. package/dist/components/collapsible/index.d.ts +8 -0
  73. package/dist/components/collapsible/types.d.ts +24 -0
  74. package/dist/components/collapsible/types.js +5 -0
  75. package/dist/components/combobox/Combobox.vue.js +1 -1
  76. package/dist/components/combobox/Combobox.vue2.js +24 -16
  77. package/dist/components/command-menu/CommandMenu.vue.d.ts +5 -0
  78. package/dist/components/command-menu/CommandMenu.vue.js +1 -1
  79. package/dist/components/command-menu/CommandMenu.vue2.js +5 -2
  80. package/dist/components/compare/Compare.vue.d.ts +15 -5
  81. package/dist/components/compare/Compare.vue.js +1 -1
  82. package/dist/components/compare/Compare.vue2.js +28 -13
  83. package/dist/components/composer/ComposerInput.vue.js +1 -1
  84. package/dist/components/composer/ComposerInput.vue2.js +11 -11
  85. package/dist/components/composer/ComposerModelPicker.vue.d.ts +4 -0
  86. package/dist/components/composer/ComposerModelPicker.vue.js +1 -1
  87. package/dist/components/composer/ComposerModelPicker.vue2.js +29 -15
  88. package/dist/components/composer/ComposerSubmit.vue.d.ts +2 -0
  89. package/dist/components/composer/ComposerSubmit.vue.js +16 -15
  90. package/dist/components/confetti/ConfettiButton.vue.d.ts +9 -2
  91. package/dist/components/confetti/ConfettiButton.vue.js +24 -6
  92. package/dist/components/container-text-flip/ContainerTextFlip.vue.js +1 -1
  93. package/dist/components/container-text-flip/ContainerTextFlip.vue2.js +12 -13
  94. package/dist/components/copy-button/CopyButton.vue.d.ts +5 -0
  95. package/dist/components/copy-button/CopyButton.vue.js +1 -1
  96. package/dist/components/copy-button/CopyButton.vue2.js +72 -11
  97. package/dist/components/datamosh-transition/DatamoshTransition.vue.d.ts +6 -2
  98. package/dist/components/datamosh-transition/DatamoshTransition.vue.js +7 -4
  99. package/dist/components/date-picker/DatePicker.vue.js +1 -1
  100. package/dist/components/date-picker/DatePicker.vue2.js +27 -21
  101. package/dist/components/dialog/Dialog.vue.js +20 -1
  102. package/dist/components/dialog/DialogSurface.vue.js +1 -1
  103. package/dist/components/dialog/DialogSurface.vue2.js +5 -2
  104. package/dist/components/dialog/types.d.ts +2 -0
  105. package/dist/components/direction-aware-hover/DirectionAwareHover.vue.js +1 -1
  106. package/dist/components/direction-aware-hover/DirectionAwareHover.vue2.js +9 -7
  107. package/dist/components/displacement-text/DisplacementText.vue.d.ts +4 -1
  108. package/dist/components/displacement-text/DisplacementText.vue.js +38 -11
  109. package/dist/components/displacement-text/displacement-text-core.d.ts +94 -4
  110. package/dist/components/displacement-text/displacement-text-core.js +287 -97
  111. package/dist/components/drawer/Drawer.vue.d.ts +5 -0
  112. package/dist/components/drawer/Drawer.vue.js +1 -1
  113. package/dist/components/drawer/Drawer.vue2.js +5 -2
  114. package/dist/components/dropdown-menu/DropdownMenuContent.vue.js +2 -1
  115. package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +4 -0
  116. package/dist/components/dropdown-menu/DropdownMenuItem.vue.js +17 -10
  117. package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +8 -0
  118. package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.js +28 -13
  119. package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +4 -0
  120. package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.js +1 -1
  121. package/dist/components/dropdown-menu/DropdownMenuTrigger.vue2.js +20 -10
  122. package/dist/components/editorial-engine/EditorialEngine.vue.js +1 -1
  123. package/dist/components/editorial-engine/engine.js +13 -0
  124. package/dist/components/file-upload/FileUpload.vue.d.ts +2 -0
  125. package/dist/components/file-upload/FileUpload.vue.js +1 -1
  126. package/dist/components/file-upload/FileUpload.vue2.js +20 -10
  127. package/dist/components/fireworks-hdr/FireworksHdr.vue.js +2 -2
  128. package/dist/components/flickering-grid/FlickeringGrid.vue.d.ts +1 -1
  129. package/dist/components/flickering-grid/FlickeringGrid.vue.js +1 -1
  130. package/dist/components/flickering-grid/flickering-grid-core.d.ts +1 -1
  131. package/dist/components/flickering-grid/flickering-grid-core.js +51 -9
  132. package/dist/components/flip-card/FlipCard.vue.d.ts +3 -1
  133. package/dist/components/flip-card/FlipCard.vue.js +1 -1
  134. package/dist/components/flip-card/FlipCard.vue2.js +5 -3
  135. package/dist/components/fluid-cursor/FluidCursor.vue.js +37 -9
  136. package/dist/components/fluid-cursor/fluid-cursor-core.js +3 -3
  137. package/dist/components/fluid-cursor/webgpu-engine.js +3 -3
  138. package/dist/components/focus/Focus.vue.js +1 -1
  139. package/dist/components/focus/Focus.vue2.js +2 -2
  140. package/dist/components/follow-button/FollowButton.vue.d.ts +69 -0
  141. package/dist/components/follow-button/FollowButton.vue.js +7 -0
  142. package/dist/components/follow-button/FollowButton.vue2.js +239 -0
  143. package/dist/components/follow-button/follow-core.d.ts +83 -0
  144. package/dist/components/follow-button/follow-core.js +92 -0
  145. package/dist/components/follow-button/index.d.ts +2 -0
  146. package/dist/components/frosted-glass/FrostedGlass.vue.js +1 -1
  147. package/dist/components/glare-card/GlareCard.vue.js +1 -1
  148. package/dist/components/glare-card/GlareCard.vue2.js +4 -4
  149. package/dist/components/glowing-effect/GlowingEffect.vue.js +3 -3
  150. package/dist/components/glowing-effect/glowing-effect-core.js +4 -1
  151. package/dist/components/gradient-button/GradientButton.vue.d.ts +6 -4
  152. package/dist/components/gradient-button/GradientButton.vue.js +1 -1
  153. package/dist/components/gradient-button/GradientButton.vue2.js +13 -3
  154. package/dist/components/icon-button/IconButton.vue.d.ts +6 -4
  155. package/dist/components/icon-button/IconButton.vue.js +11 -8
  156. package/dist/components/image-trail-cursor/ImageTrailCursor.vue.js +17 -7
  157. package/dist/components/image-trail-cursor/trail-variants.js +3 -6
  158. package/dist/components/inline-citation/InlineCitation.vue.js +1 -1
  159. package/dist/components/inline-citation/InlineCitation.vue2.js +20 -14
  160. package/dist/components/input/Input.vue.js +1 -1
  161. package/dist/components/input/Input.vue2.js +18 -8
  162. package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue.js +1 -1
  163. package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue2.js +1 -1
  164. package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.d.ts +6 -3
  165. package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.js +1 -1
  166. package/dist/components/interactive-hover-button/InteractiveHoverButton.vue2.js +12 -2
  167. package/dist/components/letter-pullup/LetterPullup.vue.js +4 -4
  168. package/dist/components/line-hover-link/LineHoverLink.vue.js +1 -1
  169. package/dist/components/line-hover-link/LineHoverLink.vue2.js +5 -6
  170. package/dist/components/link/Link.vue.d.ts +4 -2
  171. package/dist/components/link/Link.vue.js +1 -1
  172. package/dist/components/link/Link.vue2.js +11 -8
  173. package/dist/components/magnetic-field/MagnetPuck.vue.d.ts +51 -0
  174. package/dist/components/magnetic-field/MagnetPuck.vue.js +7 -0
  175. package/dist/components/magnetic-field/MagnetPuck.vue2.js +191 -0
  176. package/dist/components/magnetic-field/MagneticField.vue.d.ts +39 -0
  177. package/dist/components/magnetic-field/MagneticField.vue.js +7 -0
  178. package/dist/components/magnetic-field/MagneticField.vue2.js +157 -0
  179. package/dist/components/magnetic-field/MagneticItem.vue.d.ts +28 -0
  180. package/dist/components/magnetic-field/MagneticItem.vue.js +7 -0
  181. package/dist/components/magnetic-field/MagneticItem.vue2.js +72 -0
  182. package/dist/components/magnetic-field/index.d.ts +10 -0
  183. package/dist/components/magnetic-field/magnetic-field-core.d.ts +163 -0
  184. package/dist/components/magnetic-field/magnetic-field-core.js +534 -0
  185. package/dist/components/magnetic-field/magnetic-field-source.d.ts +58 -0
  186. package/dist/components/magnetic-field/magnetic-field-source.js +58 -0
  187. package/dist/components/magnetic-field/types.d.ts +14 -0
  188. package/dist/components/magnetic-field/types.js +5 -0
  189. package/dist/components/mosaic-glow/MosaicGlow.vue.d.ts +6 -0
  190. package/dist/components/mosaic-glow/MosaicGlow.vue.js +53 -9
  191. package/dist/components/mosaic-glow/mosaic-glow-core.d.ts +30 -0
  192. package/dist/components/mosaic-glow/mosaic-glow-core.js +27 -0
  193. package/dist/components/mosaic-glow/mosaic-glow-hdr.d.ts +24 -0
  194. package/dist/components/mosaic-glow/mosaic-glow-hdr.js +200 -0
  195. package/dist/components/navbar/NavbarLink.vue.d.ts +4 -2
  196. package/dist/components/navbar/NavbarLink.vue.js +1 -1
  197. package/dist/components/navbar/NavbarLink.vue2.js +16 -13
  198. package/dist/components/navigation-menu/NavigationMenu.vue.js +6 -3
  199. package/dist/components/navigation-menu/NavigationMenuLink.vue.js +1 -1
  200. package/dist/components/navigation-menu/NavigationMenuLink.vue2.js +8 -8
  201. package/dist/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +15 -0
  202. package/dist/components/navigation-menu/NavigationMenuTrigger.vue.js +1 -1
  203. package/dist/components/navigation-menu/NavigationMenuTrigger.vue2.js +36 -15
  204. package/dist/components/neon-border/NeonBorder.vue.js +1 -1
  205. package/dist/components/neon-border/NeonBorder.vue2.js +10 -11
  206. package/dist/components/number-input/NumberInput.vue.js +1 -1
  207. package/dist/components/number-input/NumberInput.vue2.js +22 -12
  208. package/dist/components/password-input/PasswordInput.vue.js +1 -1
  209. package/dist/components/password-input/PasswordInput.vue2.js +18 -11
  210. package/dist/components/pixel-loader/PixelLoader.vue.js +1 -1
  211. package/dist/components/pixel-loader/PixelLoader.vue2.js +6 -6
  212. package/dist/components/pixel-scene/PixelScene.vue.d.ts +60 -0
  213. package/dist/components/pixel-scene/PixelScene.vue.js +184 -0
  214. package/dist/components/pixel-scene/PixelScene.vue2.js +4 -0
  215. package/dist/components/pixel-scene/index.d.ts +4 -0
  216. package/dist/components/pixel-scene/pixel-scene-core.d.ts +256 -0
  217. package/dist/components/pixel-scene/pixel-scene-core.js +878 -0
  218. package/dist/components/pixel-scene/pixel-scene-hdr.d.ts +68 -0
  219. package/dist/components/pixel-scene/pixel-scene-hdr.js +312 -0
  220. package/dist/components/pixel-scene/pixel-scene-scenes.d.ts +31 -0
  221. package/dist/components/pixel-scene/pixel-scene-scenes.js +1074 -0
  222. package/dist/components/popover/Popover.vue.d.ts +4 -0
  223. package/dist/components/popover/Popover.vue.js +1 -1
  224. package/dist/components/popover/Popover.vue2.js +8 -6
  225. package/dist/components/popover/PopoverContent.vue.js +6 -2
  226. package/dist/components/pulse-beam/PulseBeam.vue.d.ts +6 -2
  227. package/dist/components/pulse-beam/PulseBeam.vue.js +1 -1
  228. package/dist/components/pulse-beam/PulseBeam.vue2.js +7 -4
  229. package/dist/components/radio-group/RadioGroup.vue.js +12 -11
  230. package/dist/components/radio-group/RadioGroupItem.vue.d.ts +2 -0
  231. package/dist/components/radio-group/RadioGroupItem.vue.js +1 -1
  232. package/dist/components/radio-group/RadioGroupItem.vue2.js +20 -7
  233. package/dist/components/rainbow-button/RainbowButton.vue.d.ts +11 -2
  234. package/dist/components/rainbow-button/RainbowButton.vue.js +1 -1
  235. package/dist/components/rainbow-button/RainbowButton.vue2.js +35 -18
  236. package/dist/components/ripple-button/RippleButton.vue.d.ts +6 -4
  237. package/dist/components/ripple-button/RippleButton.vue.js +1 -1
  238. package/dist/components/ripple-button/RippleButton.vue2.js +10 -5
  239. package/dist/components/search-input/SearchInput.vue.js +1 -1
  240. package/dist/components/search-input/SearchInput.vue2.js +19 -9
  241. package/dist/components/select/Select.vue.d.ts +1 -1
  242. package/dist/components/select/Select.vue.js +1 -1
  243. package/dist/components/select/Select.vue2.js +25 -17
  244. package/dist/components/sheet/Sheet.vue.d.ts +5 -0
  245. package/dist/components/sheet/Sheet.vue.js +5 -2
  246. package/dist/components/shimmer-button/ShimmerButton.vue.d.ts +2 -2
  247. package/dist/components/shimmer-button/ShimmerButton.vue.js +1 -1
  248. package/dist/components/shimmer-button/ShimmerButton.vue2.js +14 -6
  249. package/dist/components/sidebar/SidebarItem.vue.d.ts +4 -2
  250. package/dist/components/sidebar/SidebarItem.vue.js +1 -1
  251. package/dist/components/sidebar/SidebarItem.vue2.js +4 -2
  252. package/dist/components/slider/Slider.vue.d.ts +4 -0
  253. package/dist/components/slider/Slider.vue.js +1 -1
  254. package/dist/components/slider/Slider.vue2.js +20 -8
  255. package/dist/components/sources/SourcesTrigger.vue.js +1 -1
  256. package/dist/components/sources/SourcesTrigger.vue2.js +11 -11
  257. package/dist/components/sparkles/sparkles-core.d.ts +1 -1
  258. package/dist/components/sparkles/sparkles-core.js +36 -2
  259. package/dist/components/story-thread/StoryNode.vue.d.ts +11 -0
  260. package/dist/components/story-thread/StoryNode.vue.js +7 -0
  261. package/dist/components/story-thread/StoryNode.vue2.js +23 -0
  262. package/dist/components/story-thread/StoryThread.vue.d.ts +56 -0
  263. package/dist/components/story-thread/StoryThread.vue.js +7 -0
  264. package/dist/components/story-thread/StoryThread.vue2.js +103 -0
  265. package/dist/components/story-thread/index.d.ts +5 -0
  266. package/dist/components/story-thread/story-thread-core.d.ts +119 -0
  267. package/dist/components/story-thread/story-thread-core.js +491 -0
  268. package/dist/components/story-thread/types.d.ts +1 -0
  269. package/dist/components/sun-switch/SunSwitch.vue.d.ts +61 -0
  270. package/dist/components/sun-switch/SunSwitch.vue.js +7 -0
  271. package/dist/components/sun-switch/SunSwitch.vue2.js +559 -0
  272. package/dist/components/sun-switch/index.d.ts +4 -0
  273. package/dist/components/sun-switch/pixel-wave-core.d.ts +82 -0
  274. package/dist/components/sun-switch/pixel-wave-core.js +508 -0
  275. package/dist/components/sun-switch/sun-switch-core.d.ts +251 -0
  276. package/dist/components/sun-switch/sun-switch-core.js +546 -0
  277. package/dist/components/sun-switch/sun-switch-hdr.d.ts +70 -0
  278. package/dist/components/sun-switch/sun-switch-hdr.js +311 -0
  279. package/dist/components/switch/Switch.vue.d.ts +2 -0
  280. package/dist/components/switch/Switch.vue.js +1 -1
  281. package/dist/components/switch/Switch.vue2.js +16 -6
  282. package/dist/components/tabs/TabsTrigger.vue.d.ts +6 -0
  283. package/dist/components/tabs/TabsTrigger.vue.js +1 -1
  284. package/dist/components/tabs/TabsTrigger.vue2.js +28 -15
  285. package/dist/components/terminal-block/TerminalBlock.vue.js +1 -1
  286. package/dist/components/terminal-block/TerminalBlock.vue2.js +10 -9
  287. package/dist/components/text-reveal-card/TextRevealCard.vue.js +1 -2
  288. package/dist/components/textarea/Textarea.vue.js +1 -1
  289. package/dist/components/textarea/Textarea.vue2.js +19 -12
  290. package/dist/components/tick-nav/TickNav.vue.d.ts +71 -0
  291. package/dist/components/tick-nav/TickNav.vue.js +7 -0
  292. package/dist/components/tick-nav/TickNav.vue2.js +285 -0
  293. package/dist/components/tick-nav/index.d.ts +3 -0
  294. package/dist/components/tick-nav/tick-nav-core.d.ts +102 -0
  295. package/dist/components/tick-nav/tick-nav-core.js +398 -0
  296. package/dist/components/tick-nav/tick-nav-hdr.d.ts +60 -0
  297. package/dist/components/tick-nav/tick-nav-hdr.js +284 -0
  298. package/dist/components/tick-nav/types.d.ts +13 -0
  299. package/dist/components/time-picker/TimePicker.vue.js +1 -1
  300. package/dist/components/time-picker/TimePicker.vue2.js +25 -17
  301. package/dist/components/toast/Toast.vue.js +1 -1
  302. package/dist/components/toast/Toast.vue2.js +16 -4
  303. package/dist/components/toast/index.d.ts +1 -1
  304. package/dist/components/toast/store.d.ts +23 -0
  305. package/dist/components/toast/store.js +35 -7
  306. package/dist/components/toggle/Toggle.vue.d.ts +12 -0
  307. package/dist/components/toggle/Toggle.vue.js +1 -1
  308. package/dist/components/toggle/Toggle.vue2.js +27 -11
  309. package/dist/components/toggle-group/ToggleGroup.vue.d.ts +11 -0
  310. package/dist/components/toggle-group/ToggleGroup.vue.js +1 -1
  311. package/dist/components/toggle-group/ToggleGroup.vue2.js +16 -3
  312. package/dist/components/toggle-group/ToggleGroupItem.vue.d.ts +6 -0
  313. package/dist/components/toggle-group/ToggleGroupItem.vue.js +1 -1
  314. package/dist/components/toggle-group/ToggleGroupItem.vue2.js +27 -14
  315. package/dist/components/tooltip/Tooltip.vue.js +13 -0
  316. package/dist/components/tracing-beam/TracingBeam.vue.d.ts +20 -1
  317. package/dist/components/tracing-beam/TracingBeam.vue.js +5 -164
  318. package/dist/components/tracing-beam/TracingBeam.vue2.js +168 -1
  319. package/dist/components/typing-indicator/TypingIndicator.vue.js +1 -1
  320. package/dist/components/typing-indicator/TypingIndicator.vue2.js +7 -6
  321. package/dist/index.d.ts +10 -0
  322. package/dist/index.js +466 -413
  323. package/dist/internals/anchor-position.js +3 -0
  324. package/dist/internals/call-listener.d.ts +11 -0
  325. package/dist/internals/call-listener.js +31 -0
  326. package/dist/internals/dismissable.d.ts +17 -0
  327. package/dist/internals/dismissable.js +44 -1
  328. package/dist/internals/env.d.ts +1 -0
  329. package/dist/internals/env.js +11 -0
  330. package/dist/internals/focus-trap.js +29 -4
  331. package/dist/internals/merge-ids.d.ts +6 -0
  332. package/dist/internals/merge-ids.js +11 -0
  333. package/dist/internals/motion/presence-core.d.ts +1 -1
  334. package/dist/sound/engine.js +23 -9
  335. package/dist/sound/themes.d.ts +4 -3
  336. package/dist/sound/themes.js +49 -211
  337. package/dist/sound/types.d.ts +9 -1
  338. package/dist/sound/types.js +2 -2
  339. package/dist/styles.css +1473 -571
  340. package/package.json +2 -2
  341. package/tailwind.css +9 -9
@@ -0,0 +1,878 @@
1
+ const BAYER = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5].map(
2
+ (v) => (v + 0.5) / 16
3
+ );
4
+ function bayer(x, y) {
5
+ return BAYER[(y % 4 + 4) % 4 * 4 + (x % 4 + 4) % 4];
6
+ }
7
+ function hash(x, y, s = 0) {
8
+ let h = x * 374761393 + y * 668265263 + s * 2246822519 >>> 0;
9
+ h = Math.imul(h ^ h >>> 13, 1274126177) >>> 0;
10
+ return ((h ^ h >>> 16) >>> 0) / 4294967296;
11
+ }
12
+ function clamp(v, a, b) {
13
+ return Math.max(a, Math.min(b, v));
14
+ }
15
+ function smooth(t) {
16
+ t = clamp(t, 0, 1);
17
+ return t * t * (3 - 2 * t);
18
+ }
19
+ function noise1(x, seed) {
20
+ const i = Math.floor(x);
21
+ const f = x - i;
22
+ const a = hash(i, 0, seed);
23
+ const b = hash(i + 1, 0, seed);
24
+ return a + (b - a) * smooth(f);
25
+ }
26
+ function ridge(x, seed, scale, amp) {
27
+ return noise1(x / scale, seed) * amp + noise1(x / (scale * 0.37), seed + 1) * amp * 0.35;
28
+ }
29
+ const PARSED = /* @__PURE__ */ new Map();
30
+ const RGB_RE = /^rgba?\(\s*(\d+(?:\.\d+)?)[\s,]+(\d+(?:\.\d+)?)[\s,]+(\d+(?:\.\d+)?)/i;
31
+ function parseColour(c) {
32
+ if (typeof c === "number") return c;
33
+ const hit = PARSED.get(c);
34
+ if (hit !== void 0) return hit;
35
+ let v = -1;
36
+ const s = c.trim();
37
+ if (/^#[0-9a-f]{6}$/i.test(s)) v = parseInt(s.slice(1), 16);
38
+ else if (/^#[0-9a-f]{3}$/i.test(s)) {
39
+ const r = parseInt(s[1], 16);
40
+ const g = parseInt(s[2], 16);
41
+ const b = parseInt(s[3], 16);
42
+ v = r * 17 << 16 | g * 17 << 8 | b * 17;
43
+ } else {
44
+ const m = RGB_RE.exec(s);
45
+ if (m) {
46
+ const r = clamp(Math.round(Number(m[1])), 0, 255);
47
+ const g = clamp(Math.round(Number(m[2])), 0, 255);
48
+ const b = clamp(Math.round(Number(m[3])), 0, 255);
49
+ v = r << 16 | g << 8 | b;
50
+ }
51
+ }
52
+ if (PARSED.size < 4096) PARSED.set(c, v);
53
+ return v;
54
+ }
55
+ function mixHex(a, b, t) {
56
+ const A = parseColour(a);
57
+ const B = parseColour(b);
58
+ const ar = A >> 16 & 255;
59
+ const ag = A >> 8 & 255;
60
+ const ab = A & 255;
61
+ const r = clamp(ar + ((B >> 16 & 255) - ar) * t | 0, 0, 255);
62
+ const g = clamp(ag + ((B >> 8 & 255) - ag) * t | 0, 0, 255);
63
+ const bl = clamp(ab + ((B & 255) - ab) * t | 0, 0, 255);
64
+ return r << 16 | g << 8 | bl;
65
+ }
66
+ function grad(stops, t) {
67
+ t = clamp(t, 0, 1);
68
+ for (let i = 1; i < stops.length; i++) {
69
+ const s1 = stops[i];
70
+ if (t <= s1[0]) {
71
+ const s0 = stops[i - 1];
72
+ return mixHex(s0[1], s1[1], (t - s0[0]) / (s1[0] - s0[0] || 1));
73
+ }
74
+ }
75
+ const last = stops[stops.length - 1];
76
+ return last ? parseColour(last[1]) : 0;
77
+ }
78
+ const CSS_CACHE = /* @__PURE__ */ new Map();
79
+ function cssOf(c) {
80
+ let s = CSS_CACHE.get(c);
81
+ if (s === void 0) {
82
+ s = "#" + (c & 16777215).toString(16).padStart(6, "0");
83
+ if (CSS_CACHE.size < 4096) CSS_CACHE.set(c, s);
84
+ }
85
+ return s;
86
+ }
87
+ const LINEAR = new Float32Array(256);
88
+ for (let i = 0; i < 256; i++) {
89
+ const s = i / 255;
90
+ LINEAR[i] = s <= 0.04045 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
91
+ }
92
+ function srgbToLinear(c8) {
93
+ return LINEAR[clamp(Math.round(c8), 0, 255)];
94
+ }
95
+ function encodeExt(v) {
96
+ return v <= 31308e-7 ? 12.92 * v : 1.055 * Math.pow(v, 1 / 2.4) - 0.055;
97
+ }
98
+ const INK_ALPHA_NIGHT = 0.6;
99
+ const INK_ALPHA_DAY = 0.85;
100
+ const LENS_BOOST = 1.6;
101
+ const LIT_GLOW = 1.5;
102
+ const GLOW_PEAK = 4.9;
103
+ const MAX_CELLS = 72e3;
104
+ const MAX_DPR = 2;
105
+ const MAX_BACKING_PX = 42e5;
106
+ const MIN_CELL = 4;
107
+ const MAX_CELL = 32;
108
+ function createGrid(cols, rows) {
109
+ const n = Math.max(0, cols * rows);
110
+ const g = {
111
+ cols,
112
+ rows,
113
+ color: new Int32Array(n),
114
+ inkA: new Float32Array(n),
115
+ lit: new Uint8Array(n),
116
+ glow: new Float32Array(n),
117
+ halo: new Float32Array(n),
118
+ hcol: new Int32Array(n),
119
+ soft: new Float32Array(n),
120
+ emitters: [],
121
+ copyW: 0,
122
+ copyH: 0,
123
+ sunX: -1,
124
+ sunY: -1
125
+ };
126
+ clearGrid(g);
127
+ return g;
128
+ }
129
+ function clearGrid(g) {
130
+ g.color.fill(-1);
131
+ g.inkA.fill(0);
132
+ g.lit.fill(0);
133
+ g.glow.fill(0);
134
+ g.halo.fill(0);
135
+ g.hcol.fill(-1);
136
+ g.soft.fill(0);
137
+ g.emitters.length = 0;
138
+ g.copyW = 0;
139
+ g.copyH = 0;
140
+ g.sunX = -1;
141
+ g.sunY = -1;
142
+ }
143
+ function writeCell(g, x, y, c, a = 0, l = false, hl = 0) {
144
+ x = Math.round(x);
145
+ y = Math.round(y);
146
+ if (!(x >= 0 && y >= 0 && x < g.cols && y < g.rows)) return;
147
+ const i = y * g.cols + x;
148
+ const col = typeof c === "number" ? c : parseColour(c);
149
+ g.color[i] = col;
150
+ g.inkA[i] = a;
151
+ g.lit[i] = l ? 1 : 0;
152
+ const glow = typeof l === "number" ? Math.min(GLOW_PEAK, l) : l ? LIT_GLOW : 0;
153
+ g.glow[i] = glow;
154
+ g.halo[i] = hl;
155
+ g.hcol[i] = -1;
156
+ g.soft[i] = 0;
157
+ if (hl > 0 && typeof l === "number" && glow > 0) g.emitters.push(x, y, col, glow, hl);
158
+ }
159
+ function pixelHalos(g) {
160
+ const { cols, rows, emitters, glow, halo, color, hcol } = g;
161
+ for (let e = 0; e + 4 < emitters.length; e += 5) {
162
+ const ex = emitters[e];
163
+ const ey = emitters[e + 1];
164
+ const c = emitters[e + 2];
165
+ const l = emitters[e + 3];
166
+ const r = emitters[e + 4] * 2.2;
167
+ const y0 = Math.max(0, Math.floor(ey - r));
168
+ const y1 = Math.min(rows - 1, Math.ceil(ey + r));
169
+ const x0 = Math.max(0, Math.floor(ex - r));
170
+ const x1 = Math.min(cols - 1, Math.ceil(ex + r));
171
+ for (let y = y0; y <= y1; y++) {
172
+ for (let x = x0; x <= x1; x++) {
173
+ const i = y * cols + x;
174
+ if (halo[i] > 0) continue;
175
+ const d = Math.hypot(x - ex, y - ey) / r;
176
+ if (d >= 1) continue;
177
+ const dens = Math.pow(1 - d, 1.7);
178
+ if (bayer(x, y) >= dens) continue;
179
+ const gl = l * (0.3 + 0.55 * dens);
180
+ if (gl <= glow[i]) continue;
181
+ glow[i] = gl;
182
+ hcol[i] = c;
183
+ if (color[i] < 0) color[i] = c;
184
+ }
185
+ }
186
+ }
187
+ }
188
+ const WAVE_MS = 1300;
189
+ const WAVE_HALO_CELLS = 9;
190
+ const WAVE_GLOW_CELLS = 7;
191
+ const WAVE_PALETTE = [16240458, 16163406, 15694430, 15367580];
192
+ function easeInOutCubic(t) {
193
+ if (!(t > 0)) return 0;
194
+ if (t >= 1) return 1;
195
+ return t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
196
+ }
197
+ function waveGlow(D) {
198
+ return 1.5 + 3.4 * clamp(D, 0, 1);
199
+ }
200
+ function waveBandGlow(x, y, d, inner) {
201
+ if (!(d >= 0 && d < 1)) return 0;
202
+ const dens = Math.pow(1 - d, 1.7);
203
+ if (bayer(x, y) >= dens) return 0;
204
+ return inner ? 1.2 + 2.2 * dens : 1.1 + 1.6 * dens;
205
+ }
206
+ function waveCover(ox, oy, cols, rows) {
207
+ return Math.max(
208
+ Math.hypot(ox, oy),
209
+ Math.hypot(cols - ox, oy),
210
+ Math.hypot(ox, rows - oy),
211
+ Math.hypot(cols - ox, rows - oy)
212
+ ) + WAVE_HALO_CELLS + WAVE_GLOW_CELLS + 1;
213
+ }
214
+ function composeWave(cur, next, side, ox, oy, R) {
215
+ const { cols, rows } = cur;
216
+ const Rin = R - WAVE_HALO_CELLS;
217
+ const em = [];
218
+ for (let k = 0; k + 4 < cur.emitters.length; k += 5)
219
+ if (Math.hypot(cur.emitters[k] + 0.5 - ox, cur.emitters[k + 1] + 0.5 - oy) >= Rin)
220
+ em.push(...cur.emitters.slice(k, k + 5));
221
+ for (let k = 0; k + 4 < next.emitters.length; k += 5)
222
+ if (Math.hypot(next.emitters[k] + 0.5 - ox, next.emitters[k + 1] + 0.5 - oy) < Rin)
223
+ em.push(...next.emitters.slice(k, k + 5));
224
+ const copyW = next.copyW || cur.copyW || 0;
225
+ const copyH = next.copyH || cur.copyH || 0;
226
+ for (let y = 0; y < rows; y++) {
227
+ for (let x = 0; x < cols; x++) {
228
+ const i = y * cols + x;
229
+ const dist = Math.hypot(x + 0.5 - ox, y + 0.5 - oy);
230
+ const inCopy = x < copyW && y < copyH;
231
+ if (dist < Rin) {
232
+ side[i] = 1;
233
+ cur.color[i] = next.color[i];
234
+ cur.inkA[i] = next.inkA[i];
235
+ cur.lit[i] = next.lit[i];
236
+ cur.glow[i] = next.glow[i];
237
+ cur.halo[i] = next.halo[i];
238
+ cur.hcol[i] = next.hcol[i];
239
+ cur.soft[i] = next.soft[i];
240
+ const g = inCopy ? 0 : waveBandGlow(x, y, (Rin - dist) / WAVE_GLOW_CELLS, true);
241
+ if (g > cur.glow[i]) {
242
+ cur.glow[i] = g;
243
+ cur.hcol[i] = WAVE_PALETTE[3];
244
+ if (cur.color[i] < 0) cur.color[i] = WAVE_PALETTE[3];
245
+ }
246
+ continue;
247
+ }
248
+ side[i] = 0;
249
+ if (dist >= R) {
250
+ const g = inCopy ? 0 : waveBandGlow(x, y, (dist - R) / WAVE_GLOW_CELLS, false);
251
+ if (g > cur.glow[i]) {
252
+ cur.glow[i] = g;
253
+ cur.hcol[i] = WAVE_PALETTE[0];
254
+ if (cur.color[i] < 0) cur.color[i] = WAVE_PALETTE[0];
255
+ }
256
+ continue;
257
+ }
258
+ const D = (R - dist) / WAVE_HALO_CELLS;
259
+ if (bayer(x, y) > Math.pow(D, 0.7)) continue;
260
+ cur.color[i] = WAVE_PALETTE[clamp(Math.floor(D * 4), 0, 3)];
261
+ cur.inkA[i] = 0.9;
262
+ cur.lit[i] = 1;
263
+ cur.glow[i] = inCopy ? 1 : waveGlow(D);
264
+ cur.halo[i] = 0;
265
+ cur.hcol[i] = -1;
266
+ }
267
+ }
268
+ cur.emitters.length = 0;
269
+ cur.emitters.push(...em);
270
+ }
271
+ function createLens() {
272
+ return { x: -999, y: -999, tx: -999, ty: -999, r: 0, tr: 0 };
273
+ }
274
+ function stepLens(l, dt, snap) {
275
+ if (snap) {
276
+ l.x = l.tx;
277
+ l.y = l.ty;
278
+ l.r = l.tr;
279
+ return false;
280
+ }
281
+ const f = Math.max(0, dt) / 16.667;
282
+ const k = 1 - Math.pow(0.6, f);
283
+ l.x += (l.tx - l.x) * k;
284
+ l.y += (l.ty - l.y) * k;
285
+ const kr = 1 - Math.pow(0.6, f * (l.tr > l.r ? 1.3 : 0.7));
286
+ l.r += (l.tr - l.r) * kr;
287
+ let moving = false;
288
+ if (Math.abs(l.tx - l.x) > 0.01) moving = true;
289
+ else l.x = l.tx;
290
+ if (Math.abs(l.ty - l.y) > 0.01) moving = true;
291
+ else l.y = l.ty;
292
+ if (Math.abs(l.tr - l.r) > 0.01) moving = true;
293
+ else l.r = l.tr;
294
+ return moving;
295
+ }
296
+ function inLens(l, x, y) {
297
+ return l.r > 0.5 && Math.hypot(x + 0.5 - l.x, y + 0.5 - l.y) < l.r - 2 + bayer(x, y) * 4;
298
+ }
299
+ function cellOrigin(x, cell, dpr) {
300
+ return Math.round(x * cell * dpr);
301
+ }
302
+ function paintGrid(ctx, g, lens, p) {
303
+ const { cols, rows, color, inkA, lit, glow } = g;
304
+ const copyW = g.copyW || 0;
305
+ const copyH = g.copyH || 0;
306
+ const w = p.width ?? ctx.canvas?.width ?? 0;
307
+ const h = p.height ?? ctx.canvas?.height ?? 0;
308
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
309
+ ctx.clearRect(0, 0, w, h);
310
+ const size = Math.max(1, Math.round(p.dot * p.dpr));
311
+ const inkScale = p.night ? INK_ALPHA_NIGHT : INK_ALPHA_DAY;
312
+ const side = p.side ?? null;
313
+ const sideInk = p.sideInk ?? p.ink;
314
+ ctx.globalAlpha = 1;
315
+ if (p.surface) {
316
+ ctx.fillStyle = p.surface;
317
+ ctx.fillRect(0, 0, w, h);
318
+ }
319
+ if (side && p.sideSurface) {
320
+ ctx.fillStyle = p.sideSurface;
321
+ for (let y = 0; y < rows; y++) {
322
+ const y0 = cellOrigin(y, p.cell, p.dpr);
323
+ const y1 = cellOrigin(y + 1, p.cell, p.dpr);
324
+ let x0 = -1;
325
+ for (let x = 0; x <= cols; x++) {
326
+ const on = x < cols && side[y * cols + x] === 1;
327
+ if (on && x0 < 0) x0 = x;
328
+ else if (!on && x0 >= 0) {
329
+ const a = cellOrigin(x0, p.cell, p.dpr);
330
+ ctx.fillRect(a, y0, cellOrigin(x, p.cell, p.dpr) - a, y1 - y0);
331
+ x0 = -1;
332
+ }
333
+ }
334
+ }
335
+ }
336
+ const sideScale = p.sideNight ? INK_ALPHA_NIGHT : INK_ALPHA_DAY;
337
+ const open = lens.r > 0.5;
338
+ const lx0 = open ? Math.floor(lens.x - lens.r - 3) : 1;
339
+ const lx1 = open ? Math.ceil(lens.x + lens.r + 3) : 0;
340
+ const ly0 = open ? Math.floor(lens.y - lens.r - 3) : 1;
341
+ const ly1 = open ? Math.ceil(lens.y + lens.r + 3) : 0;
342
+ let curStyle = -2;
343
+ let curAlpha = -1;
344
+ ctx.globalAlpha = 1;
345
+ for (let y = 0; y < rows; y++) {
346
+ const oy = cellOrigin(y, p.cell, p.dpr);
347
+ const rowLens = y >= ly0 && y <= ly1;
348
+ for (let x = 0; x < cols; x++) {
349
+ const i = y * cols + x;
350
+ const c = color[i];
351
+ if (c < 0) continue;
352
+ let style;
353
+ let alpha;
354
+ if (rowLens && x >= lx0 && x <= lx1 && inLens(lens, x, y)) {
355
+ style = c;
356
+ alpha = 1;
357
+ if (glow[i] < LENS_BOOST && !(x < copyW && y < copyH)) glow[i] = LENS_BOOST;
358
+ } else if (lit[i]) {
359
+ style = c;
360
+ alpha = 1;
361
+ } else {
362
+ const a = inkA[i];
363
+ if (!(a > 0)) continue;
364
+ const onSide = !!side && side[i] === 1;
365
+ style = onSide ? -3 : -1;
366
+ alpha = Math.min(1, a * (onSide ? sideScale : inkScale));
367
+ }
368
+ if (style !== curStyle) {
369
+ ctx.fillStyle = style === -1 ? p.ink : style === -3 ? sideInk : cssOf(style);
370
+ curStyle = style;
371
+ }
372
+ if (alpha !== curAlpha) {
373
+ ctx.globalAlpha = alpha;
374
+ curAlpha = alpha;
375
+ }
376
+ ctx.fillRect(cellOrigin(x, p.cell, p.dpr), oy, size, size);
377
+ }
378
+ }
379
+ ctx.globalAlpha = 1;
380
+ }
381
+ function effectiveCell(cssW, cssH, cell, dot) {
382
+ let c = Number.isFinite(cell) ? clamp(cell, MIN_CELL, MAX_CELL) : 5;
383
+ let d = Number.isFinite(dot) ? clamp(dot, 1, c) : Math.min(4, c);
384
+ const W = Math.max(0, cssW);
385
+ const H = Math.max(0, cssH);
386
+ if (Math.ceil(W / c) * Math.ceil(H / c) > MAX_CELLS) {
387
+ const base = c;
388
+ c = Math.max(c, Math.ceil(Math.sqrt(W * H / MAX_CELLS)));
389
+ while (Math.ceil(W / c) * Math.ceil(H / c) > MAX_CELLS) c++;
390
+ d = Math.max(1, Math.min(c, Math.round(d * c / base)));
391
+ }
392
+ return { cell: c, dot: d };
393
+ }
394
+ function backingDpr(cssW, cssH, deviceDpr) {
395
+ const d = Number.isFinite(deviceDpr) && deviceDpr > 0 ? deviceDpr : 1;
396
+ return d > 1 && Math.max(0, cssW) * Math.max(0, cssH) * d * d > MAX_BACKING_PX ? 1 : d;
397
+ }
398
+ function normalizeLensRadius(r) {
399
+ return typeof r === "number" && Number.isFinite(r) ? clamp(r, 2, 200) : 21;
400
+ }
401
+ const HEX_RE = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
402
+ const INK_FALLBACK = "#808080";
403
+ function createPixelScene(el, options) {
404
+ const { host, canvas } = el;
405
+ let ctx = null;
406
+ try {
407
+ ctx = canvas.getContext("2d");
408
+ } catch {
409
+ ctx = null;
410
+ }
411
+ if (!ctx) return null;
412
+ const c2d = ctx;
413
+ let painter = options.painter;
414
+ let night = !!options.night;
415
+ let cellOpt = options.cell ?? 5;
416
+ let dotOpt = options.dot ?? 4;
417
+ let lensOn = options.lens ?? true;
418
+ let lensRadius = normalizeLensRadius(options.lensRadius);
419
+ let inkOpt = options.ink ?? "currentColor";
420
+ let paused = !!options.paused;
421
+ let waveOn = options.wave ?? true;
422
+ let surfaces = options.surfaces ?? null;
423
+ let inks = options.inks ?? null;
424
+ let rmOverride = options.reducedMotion;
425
+ let onFrame = options.onFrame ?? null;
426
+ let mq = null;
427
+ let mqReduced = false;
428
+ if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
429
+ try {
430
+ mq = window.matchMedia("(prefers-reduced-motion: reduce)");
431
+ mqReduced = mq.matches;
432
+ } catch {
433
+ mq = null;
434
+ }
435
+ }
436
+ const reduced = () => rmOverride !== void 0 ? rmOverride : mqReduced;
437
+ let grid = createGrid(0, 0);
438
+ let nextGrid = createGrid(0, 0);
439
+ let side = new Uint8Array(0);
440
+ const wave = { on: false, from: false, ox: 0, oy: 0, start: -1, cover: 0, oldInk: "" };
441
+ let cssW = 0;
442
+ let cssH = 0;
443
+ let dpr = 1;
444
+ let deviceDpr = 1;
445
+ let cell = 5;
446
+ let dot = 4;
447
+ let t = 0;
448
+ let last = 0;
449
+ let raf = 0;
450
+ let dirty = true;
451
+ let lensMoving = false;
452
+ let inView = true;
453
+ let destroyed = false;
454
+ let ink = INK_FALLBACK;
455
+ let inkAt = -Infinity;
456
+ let inkTimer = 0;
457
+ const lens = createLens();
458
+ const frame = {
459
+ cols: 0,
460
+ rows: 0,
461
+ width: 0,
462
+ height: 0,
463
+ pitch: 0,
464
+ size: 0,
465
+ cellCss: 0,
466
+ dpr: 1,
467
+ pixelated: false,
468
+ color: grid.color,
469
+ glow: grid.glow,
470
+ hcol: grid.hcol,
471
+ soft: grid.soft
472
+ };
473
+ const readDpr = () => typeof window !== "undefined" && window.devicePixelRatio > 0 ? Math.min(MAX_DPR, window.devicePixelRatio) : 1;
474
+ function resolveInk(now, force) {
475
+ if (inks) {
476
+ ink = inks[night ? 1 : 0];
477
+ return;
478
+ }
479
+ if (HEX_RE.test(inkOpt.trim())) {
480
+ ink = inkOpt.trim();
481
+ return;
482
+ }
483
+ if (!force && now - inkAt < 250) return;
484
+ inkAt = now;
485
+ try {
486
+ if (inkOpt.trim().toLowerCase() !== "currentcolor") {
487
+ ink = inkOpt;
488
+ return;
489
+ }
490
+ const col = typeof getComputedStyle === "function" ? getComputedStyle(host).color : "";
491
+ ink = col || INK_FALLBACK;
492
+ } catch {
493
+ ink = INK_FALLBACK;
494
+ }
495
+ }
496
+ const inkFollowsHost = () => inkOpt.trim().toLowerCase() === "currentcolor";
497
+ function refreshInk() {
498
+ if (destroyed || !inkFollowsHost()) return;
499
+ const before = ink;
500
+ resolveInk(typeof performance !== "undefined" ? performance.now() : 0, true);
501
+ if (ink !== before) wake();
502
+ }
503
+ function armInkPoll() {
504
+ if (inkTimer || destroyed || !inkFollowsHost() || typeof setTimeout !== "function") return;
505
+ inkTimer = setTimeout(() => {
506
+ inkTimer = 0;
507
+ if (destroyed || raf || !awake()) return;
508
+ refreshInk();
509
+ if (!raf) armInkPoll();
510
+ }, 500);
511
+ }
512
+ function clearInkPoll() {
513
+ if (inkTimer && typeof clearTimeout === "function") clearTimeout(inkTimer);
514
+ inkTimer = 0;
515
+ }
516
+ function layout() {
517
+ cssW = host.clientWidth || 0;
518
+ cssH = host.clientHeight || 0;
519
+ deviceDpr = readDpr();
520
+ dpr = backingDpr(cssW, cssH, deviceDpr);
521
+ const pixelated = dpr < deviceDpr;
522
+ frame.pixelated = pixelated;
523
+ const rendering = pixelated ? "pixelated" : "";
524
+ if (canvas.style && canvas.style.imageRendering !== rendering)
525
+ canvas.style.imageRendering = rendering;
526
+ const eff = effectiveCell(cssW, cssH, cellOpt, dotOpt);
527
+ cell = eff.cell;
528
+ dot = eff.dot;
529
+ const cols = cssW > 0 ? Math.ceil(cssW / cell) : 0;
530
+ const rows = cssH > 0 ? Math.ceil(cssH / cell) : 0;
531
+ if (cols !== grid.cols || rows !== grid.rows) {
532
+ grid = createGrid(cols, rows);
533
+ nextGrid = createGrid(cols, rows);
534
+ side = new Uint8Array(cols * rows);
535
+ frame.color = grid.color;
536
+ frame.glow = grid.glow;
537
+ frame.hcol = grid.hcol;
538
+ frame.soft = grid.soft;
539
+ }
540
+ const bw = Math.round(cssW * dpr);
541
+ const bh = Math.round(cssH * dpr);
542
+ if (canvas.width !== bw) canvas.width = bw;
543
+ if (canvas.height !== bh) canvas.height = bh;
544
+ dirty = true;
545
+ }
546
+ const docHidden = () => typeof document !== "undefined" && document.hidden === true;
547
+ const awake = () => inView && !docHidden() && grid.cols * grid.rows > 0 && !destroyed;
548
+ const animating = () => !paused && !reduced();
549
+ function schedule() {
550
+ if (raf || destroyed) return;
551
+ if (!awake() || !(animating() || lensMoving || dirty || wave.on)) {
552
+ last = 0;
553
+ if (awake()) armInkPoll();
554
+ else clearInkPoll();
555
+ return;
556
+ }
557
+ if (typeof requestAnimationFrame !== "function") return;
558
+ clearInkPoll();
559
+ raf = requestAnimationFrame(tick);
560
+ }
561
+ function startWave(from, to) {
562
+ clearGrid(nextGrid);
563
+ painter(t, nextGrid, to);
564
+ let ox = grid.sunX >= 0 ? grid.sunX : nextGrid.sunX;
565
+ let oy = grid.sunX >= 0 ? grid.sunY : nextGrid.sunY;
566
+ if (!(ox >= 0)) {
567
+ const lensed = lens.r > 0.5 || lens.tr > 0;
568
+ ox = lensed ? lens.tx : grid.cols * 0.85;
569
+ oy = lensed ? lens.ty : grid.rows * 0.2;
570
+ }
571
+ wave.on = true;
572
+ wave.oldInk = inks ? inks[from ? 1 : 0] : ink;
573
+ wave.from = from;
574
+ wave.ox = ox;
575
+ wave.oy = oy;
576
+ wave.start = -1;
577
+ wave.cover = waveCover(ox, oy, grid.cols, grid.rows);
578
+ }
579
+ function render(now) {
580
+ resolveInk(now, false);
581
+ clearGrid(grid);
582
+ let waving = false;
583
+ if (wave.on) {
584
+ if (wave.start < 0) wave.start = now;
585
+ const p = Math.min(1, Math.max(0, (now - wave.start) / WAVE_MS));
586
+ if (p >= 1) wave.on = false;
587
+ else {
588
+ waving = true;
589
+ painter(t, grid, wave.from);
590
+ clearGrid(nextGrid);
591
+ painter(t, nextGrid, night);
592
+ composeWave(grid, nextGrid, side, wave.ox, wave.oy, easeInOutCubic(p) * wave.cover);
593
+ }
594
+ }
595
+ if (!waving) painter(t, grid, night);
596
+ pixelHalos(grid);
597
+ paintGrid(c2d, grid, lens, {
598
+ cell,
599
+ dot,
600
+ dpr,
601
+ ink: waving ? wave.oldInk : ink,
602
+ night: waving ? wave.from : night,
603
+ side: waving ? side : null,
604
+ sideNight: night,
605
+ sideInk: ink,
606
+ surface: surfaces ? surfaces[(waving ? wave.from : night) ? 1 : 0] : null,
607
+ sideSurface: surfaces && waving ? surfaces[night ? 1 : 0] : null,
608
+ width: canvas.width,
609
+ height: canvas.height
610
+ });
611
+ if (onFrame) {
612
+ frame.cols = grid.cols;
613
+ frame.rows = grid.rows;
614
+ frame.width = canvas.width;
615
+ frame.height = canvas.height;
616
+ frame.pitch = cell * dpr;
617
+ frame.size = Math.max(1, Math.round(dot * dpr));
618
+ frame.cellCss = cell;
619
+ frame.dpr = dpr;
620
+ try {
621
+ onFrame(frame);
622
+ } catch {
623
+ onFrame = null;
624
+ }
625
+ }
626
+ }
627
+ function tick(now) {
628
+ raf = 0;
629
+ if (destroyed) return;
630
+ if (!awake()) {
631
+ last = 0;
632
+ return;
633
+ }
634
+ const dt = last ? Math.min(64, Math.max(0, now - last)) : 16.667;
635
+ last = now;
636
+ if (readDpr() !== deviceDpr) layout();
637
+ if (animating()) t += dt;
638
+ lensMoving = stepLens(lens, dt, reduced());
639
+ render(now);
640
+ dirty = false;
641
+ schedule();
642
+ }
643
+ function wake() {
644
+ dirty = true;
645
+ schedule();
646
+ }
647
+ function aim(e) {
648
+ if (!lensOn) return;
649
+ const b = canvas.getBoundingClientRect();
650
+ if (!(b.width > 0 && b.height > 0)) return;
651
+ const sx = cssW > 0 ? cssW / b.width : 1;
652
+ const sy = cssH > 0 ? cssH / b.height : 1;
653
+ lens.tx = (e.clientX - b.left) * sx / cell;
654
+ lens.ty = (e.clientY - b.top) * sy / cell;
655
+ if (lens.r < 0.5) {
656
+ lens.x = lens.tx;
657
+ lens.y = lens.ty;
658
+ }
659
+ lens.tr = lensRadius;
660
+ lensMoving = true;
661
+ wake();
662
+ }
663
+ function close() {
664
+ lens.tr = 0;
665
+ lensMoving = true;
666
+ wake();
667
+ }
668
+ const onMove = (e) => aim(e);
669
+ const onUp = (e) => {
670
+ if (e.pointerType === "touch") close();
671
+ };
672
+ const onLeave = () => close();
673
+ host.addEventListener("pointermove", onMove);
674
+ host.addEventListener("pointerdown", onMove);
675
+ host.addEventListener("pointerup", onUp);
676
+ host.addEventListener("pointerleave", onLeave);
677
+ host.addEventListener("pointercancel", onLeave);
678
+ let ro = null;
679
+ if (typeof ResizeObserver !== "undefined") {
680
+ ro = new ResizeObserver(() => {
681
+ const w = host.clientWidth || 0;
682
+ const h = host.clientHeight || 0;
683
+ if (w === cssW && h === cssH && readDpr() === deviceDpr) return;
684
+ layout();
685
+ schedule();
686
+ });
687
+ ro.observe(host);
688
+ }
689
+ let io = null;
690
+ if (typeof IntersectionObserver !== "undefined") {
691
+ io = new IntersectionObserver(
692
+ (entries) => {
693
+ const entry = entries[entries.length - 1];
694
+ if (!entry) return;
695
+ inView = entry.isIntersecting;
696
+ if (inView) schedule();
697
+ else clearInkPoll();
698
+ },
699
+ { rootMargin: "128px" }
700
+ );
701
+ io.observe(host);
702
+ }
703
+ const onVisibility = () => {
704
+ if (!docHidden()) schedule();
705
+ else clearInkPoll();
706
+ };
707
+ if (typeof document !== "undefined") document.addEventListener("visibilitychange", onVisibility);
708
+ const onMq = (e) => {
709
+ mqReduced = e.matches;
710
+ wake();
711
+ };
712
+ mq?.addEventListener?.("change", onMq);
713
+ let themeMo = null;
714
+ if (typeof MutationObserver !== "undefined" && typeof document !== "undefined") {
715
+ try {
716
+ themeMo = new MutationObserver(() => refreshInk());
717
+ themeMo.observe(document.documentElement, {
718
+ attributes: true,
719
+ attributeFilter: ["class", "style", "data-theme"]
720
+ });
721
+ } catch {
722
+ themeMo = null;
723
+ }
724
+ }
725
+ let schemeMq = null;
726
+ const onScheme = () => refreshInk();
727
+ if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
728
+ try {
729
+ schemeMq = window.matchMedia("(prefers-color-scheme: dark)");
730
+ schemeMq.addEventListener?.("change", onScheme);
731
+ } catch {
732
+ schemeMq = null;
733
+ }
734
+ }
735
+ let dprMq = null;
736
+ const onDpr = () => {
737
+ if (destroyed) return;
738
+ layout();
739
+ watchDpr();
740
+ wake();
741
+ };
742
+ function watchDpr() {
743
+ dprMq?.removeEventListener?.("change", onDpr);
744
+ dprMq = null;
745
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
746
+ const raw = window.devicePixelRatio > 0 ? window.devicePixelRatio : 1;
747
+ try {
748
+ dprMq = window.matchMedia(`(resolution: ${raw}dppx)`);
749
+ dprMq.addEventListener?.("change", onDpr);
750
+ } catch {
751
+ dprMq = null;
752
+ }
753
+ }
754
+ watchDpr();
755
+ resolveInk(0, true);
756
+ layout();
757
+ schedule();
758
+ return {
759
+ setOptions(next) {
760
+ if (destroyed) return;
761
+ let relayout = false;
762
+ if (next.painter !== void 0 && next.painter !== painter) painter = next.painter;
763
+ if (next.wave !== void 0) waveOn = !!next.wave;
764
+ if (next.night !== void 0 && !!next.night !== night) {
765
+ const to = !!next.night;
766
+ wave.on = false;
767
+ if (waveOn && !reduced() && grid.cols * grid.rows > 0) startWave(night, to);
768
+ night = to;
769
+ if (inks) ink = inks[to ? 1 : 0];
770
+ }
771
+ if (next.surfaces !== void 0) surfaces = next.surfaces;
772
+ if (next.inks !== void 0) {
773
+ inks = next.inks;
774
+ resolveInk(0, true);
775
+ }
776
+ if (next.cell !== void 0 && next.cell !== cellOpt) {
777
+ cellOpt = next.cell;
778
+ relayout = true;
779
+ }
780
+ if (next.dot !== void 0 && next.dot !== dotOpt) {
781
+ dotOpt = next.dot;
782
+ relayout = true;
783
+ }
784
+ if (next.lens !== void 0) {
785
+ lensOn = !!next.lens;
786
+ if (!lensOn) lens.tr = 0;
787
+ }
788
+ if (next.lensRadius !== void 0) {
789
+ lensRadius = normalizeLensRadius(next.lensRadius);
790
+ if (lens.tr > 0) lens.tr = lensRadius;
791
+ }
792
+ if (next.ink !== void 0) {
793
+ inkOpt = next.ink;
794
+ resolveInk(0, true);
795
+ if (!inkFollowsHost()) clearInkPoll();
796
+ }
797
+ if (next.paused !== void 0) paused = !!next.paused;
798
+ if (next.reducedMotion !== void 0) rmOverride = next.reducedMotion;
799
+ if ("onFrame" in next && next.onFrame !== void 0) onFrame = next.onFrame;
800
+ if (relayout) layout();
801
+ wake();
802
+ },
803
+ resize() {
804
+ if (destroyed) return;
805
+ layout();
806
+ schedule();
807
+ },
808
+ destroy() {
809
+ if (destroyed) return;
810
+ destroyed = true;
811
+ if (raf && typeof cancelAnimationFrame === "function") cancelAnimationFrame(raf);
812
+ raf = 0;
813
+ host.removeEventListener("pointermove", onMove);
814
+ host.removeEventListener("pointerdown", onMove);
815
+ host.removeEventListener("pointerup", onUp);
816
+ host.removeEventListener("pointerleave", onLeave);
817
+ host.removeEventListener("pointercancel", onLeave);
818
+ ro?.disconnect();
819
+ io?.disconnect();
820
+ if (typeof document !== "undefined")
821
+ document.removeEventListener("visibilitychange", onVisibility);
822
+ mq?.removeEventListener?.("change", onMq);
823
+ themeMo?.disconnect();
824
+ schemeMq?.removeEventListener?.("change", onScheme);
825
+ dprMq?.removeEventListener?.("change", onDpr);
826
+ dprMq = null;
827
+ clearInkPoll();
828
+ onFrame = null;
829
+ }
830
+ };
831
+ }
832
+ export {
833
+ BAYER,
834
+ GLOW_PEAK,
835
+ INK_ALPHA_DAY,
836
+ INK_ALPHA_NIGHT,
837
+ LENS_BOOST,
838
+ LIT_GLOW,
839
+ MAX_BACKING_PX,
840
+ MAX_CELL,
841
+ MAX_CELLS,
842
+ MAX_DPR,
843
+ MIN_CELL,
844
+ WAVE_GLOW_CELLS,
845
+ WAVE_HALO_CELLS,
846
+ WAVE_MS,
847
+ WAVE_PALETTE,
848
+ backingDpr,
849
+ bayer,
850
+ cellOrigin,
851
+ clamp,
852
+ clearGrid,
853
+ composeWave,
854
+ createGrid,
855
+ createLens,
856
+ createPixelScene,
857
+ cssOf,
858
+ easeInOutCubic,
859
+ effectiveCell,
860
+ encodeExt,
861
+ grad,
862
+ hash,
863
+ inLens,
864
+ mixHex,
865
+ noise1,
866
+ normalizeLensRadius,
867
+ paintGrid,
868
+ parseColour,
869
+ pixelHalos,
870
+ ridge,
871
+ smooth,
872
+ srgbToLinear,
873
+ stepLens,
874
+ waveBandGlow,
875
+ waveCover,
876
+ waveGlow,
877
+ writeCell
878
+ };