ngwr 14.10.0 → 14.12.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 (722) hide show
  1. package/card/styles/_rules.scss +1 -1
  2. package/event-calendar/styles/_index.scss +14 -0
  3. package/fesm2022/ngwr-action-sheet-testing.mjs +111 -310
  4. package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -1
  5. package/fesm2022/ngwr-action-sheet.mjs +209 -89
  6. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  7. package/fesm2022/ngwr-affix.mjs +122 -140
  8. package/fesm2022/ngwr-affix.mjs.map +1 -1
  9. package/fesm2022/ngwr-alert.mjs +204 -107
  10. package/fesm2022/ngwr-alert.mjs.map +1 -1
  11. package/fesm2022/ngwr-anchor.mjs +171 -113
  12. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  13. package/fesm2022/ngwr-aurora.mjs +278 -198
  14. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  15. package/fesm2022/ngwr-avatar.mjs +191 -190
  16. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  17. package/fesm2022/ngwr-back-top.mjs +140 -95
  18. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  19. package/fesm2022/ngwr-badge.mjs +339 -204
  20. package/fesm2022/ngwr-badge.mjs.map +1 -1
  21. package/fesm2022/ngwr-bar-chart-testing.mjs +56 -120
  22. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
  23. package/fesm2022/ngwr-bar-chart.mjs +204 -113
  24. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  25. package/fesm2022/ngwr-blur-text-testing.mjs +44 -198
  26. package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -1
  27. package/fesm2022/ngwr-blur-text.mjs +322 -202
  28. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  29. package/fesm2022/ngwr-border-glow-testing.mjs +134 -318
  30. package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -1
  31. package/fesm2022/ngwr-border-glow.mjs +440 -277
  32. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  33. package/fesm2022/ngwr-breadcrumbs.mjs +256 -120
  34. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  35. package/fesm2022/ngwr-burger.mjs +115 -63
  36. package/fesm2022/ngwr-burger.mjs.map +1 -1
  37. package/fesm2022/ngwr-button-testing.mjs +39 -94
  38. package/fesm2022/ngwr-button-testing.mjs.map +1 -1
  39. package/fesm2022/ngwr-button.mjs +404 -354
  40. package/fesm2022/ngwr-button.mjs.map +1 -1
  41. package/fesm2022/ngwr-calendar-heatmap-testing.mjs +50 -96
  42. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
  43. package/fesm2022/ngwr-calendar-heatmap.mjs +360 -264
  44. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  45. package/fesm2022/ngwr-calendar-testing.mjs +181 -378
  46. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  47. package/fesm2022/ngwr-calendar.mjs +612 -790
  48. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  49. package/fesm2022/ngwr-card.mjs +216 -98
  50. package/fesm2022/ngwr-card.mjs.map +1 -1
  51. package/fesm2022/ngwr-carousel-testing.mjs +131 -374
  52. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  53. package/fesm2022/ngwr-carousel.mjs +459 -332
  54. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  55. package/fesm2022/ngwr-cascader-testing.mjs +227 -600
  56. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  57. package/fesm2022/ngwr-cascader.mjs +482 -418
  58. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  59. package/fesm2022/ngwr-checkbox-testing.mjs +45 -99
  60. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-checkbox.mjs +461 -354
  62. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  63. package/fesm2022/ngwr-circular-text-testing.mjs +56 -223
  64. package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -1
  65. package/fesm2022/ngwr-circular-text.mjs +226 -186
  66. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  67. package/fesm2022/ngwr-click-spark.mjs +303 -199
  68. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  69. package/fesm2022/ngwr-clipboard.mjs +95 -163
  70. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  71. package/fesm2022/ngwr-collapse-testing.mjs +118 -365
  72. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -1
  73. package/fesm2022/ngwr-collapse.mjs +287 -227
  74. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  75. package/fesm2022/ngwr-color-picker-testing.mjs +223 -461
  76. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  77. package/fesm2022/ngwr-color-picker.mjs +952 -976
  78. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  79. package/fesm2022/ngwr-command-palette-testing.mjs +236 -585
  80. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -1
  81. package/fesm2022/ngwr-command-palette.mjs +512 -443
  82. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  83. package/fesm2022/ngwr-compare.mjs +252 -225
  84. package/fesm2022/ngwr-compare.mjs.map +1 -1
  85. package/fesm2022/ngwr-confetti.mjs +163 -181
  86. package/fesm2022/ngwr-confetti.mjs.map +1 -1
  87. package/fesm2022/ngwr-config.mjs +31 -106
  88. package/fesm2022/ngwr-config.mjs.map +1 -1
  89. package/fesm2022/ngwr-context-menu-testing.mjs +233 -642
  90. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  91. package/fesm2022/ngwr-context-menu.mjs +837 -1167
  92. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  93. package/fesm2022/ngwr-cookie.mjs +103 -140
  94. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  95. package/fesm2022/ngwr-counter.mjs +646 -460
  96. package/fesm2022/ngwr-counter.mjs.map +1 -1
  97. package/fesm2022/ngwr-date-adapters-fns.mjs +173 -266
  98. package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-adapters-luxon.mjs +164 -236
  100. package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -1
  101. package/fesm2022/ngwr-date-picker-testing.mjs +340 -700
  102. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  103. package/fesm2022/ngwr-date-picker.mjs +2581 -2416
  104. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  105. package/fesm2022/ngwr-date.mjs +606 -861
  106. package/fesm2022/ngwr-date.mjs.map +1 -1
  107. package/fesm2022/ngwr-decrypt-text-testing.mjs +57 -256
  108. package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -1
  109. package/fesm2022/ngwr-decrypt-text.mjs +489 -409
  110. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  111. package/fesm2022/ngwr-density.mjs +157 -154
  112. package/fesm2022/ngwr-density.mjs.map +1 -1
  113. package/fesm2022/ngwr-descriptions.mjs +188 -90
  114. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  115. package/fesm2022/ngwr-dialog-testing.mjs +44 -87
  116. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  117. package/fesm2022/ngwr-dialog.mjs +391 -522
  118. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  119. package/fesm2022/ngwr-directives.mjs +354 -271
  120. package/fesm2022/ngwr-directives.mjs.map +1 -1
  121. package/fesm2022/ngwr-divider.mjs +151 -133
  122. package/fesm2022/ngwr-divider.mjs.map +1 -1
  123. package/fesm2022/ngwr-donut-chart-testing.mjs +48 -111
  124. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
  125. package/fesm2022/ngwr-donut-chart.mjs +295 -190
  126. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  127. package/fesm2022/ngwr-drag-drop.mjs +411 -301
  128. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  129. package/fesm2022/ngwr-drawer-testing.mjs +97 -248
  130. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -1
  131. package/fesm2022/ngwr-drawer.mjs +862 -889
  132. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  133. package/fesm2022/ngwr-dropdown-testing.mjs +125 -288
  134. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  135. package/fesm2022/ngwr-dropdown.mjs +613 -641
  136. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  137. package/fesm2022/ngwr-editor-testing.mjs +194 -640
  138. package/fesm2022/ngwr-editor-testing.mjs.map +1 -1
  139. package/fesm2022/ngwr-editor.mjs +2062 -2541
  140. package/fesm2022/ngwr-editor.mjs.map +1 -1
  141. package/fesm2022/ngwr-empty.mjs +117 -72
  142. package/fesm2022/ngwr-empty.mjs.map +1 -1
  143. package/fesm2022/ngwr-event-calendar-testing.mjs +217 -439
  144. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
  145. package/fesm2022/ngwr-event-calendar.mjs +906 -822
  146. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  147. package/fesm2022/ngwr-falling-text-testing.mjs +52 -216
  148. package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
  149. package/fesm2022/ngwr-falling-text.mjs +375 -342
  150. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  151. package/fesm2022/ngwr-file-upload-testing.mjs +138 -320
  152. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  153. package/fesm2022/ngwr-file-upload.mjs +475 -328
  154. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  155. package/fesm2022/ngwr-form-testing.mjs +145 -452
  156. package/fesm2022/ngwr-form-testing.mjs.map +1 -1
  157. package/fesm2022/ngwr-form.mjs +512 -590
  158. package/fesm2022/ngwr-form.mjs.map +1 -1
  159. package/fesm2022/ngwr-fuzzy-text-testing.mjs +36 -132
  160. package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -1
  161. package/fesm2022/ngwr-fuzzy-text.mjs +635 -421
  162. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  163. package/fesm2022/ngwr-gauge-testing.mjs +49 -98
  164. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
  165. package/fesm2022/ngwr-gauge.mjs +297 -129
  166. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  167. package/fesm2022/ngwr-glitch-text-testing.mjs +61 -213
  168. package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
  169. package/fesm2022/ngwr-glitch-text.mjs +170 -73
  170. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  171. package/fesm2022/ngwr-gradient-text-testing.mjs +82 -251
  172. package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
  173. package/fesm2022/ngwr-gradient-text.mjs +215 -114
  174. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  175. package/fesm2022/ngwr-graph-testing.mjs +65 -233
  176. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  177. package/fesm2022/ngwr-graph.mjs +882 -1046
  178. package/fesm2022/ngwr-graph.mjs.map +1 -1
  179. package/fesm2022/ngwr-hotkey.mjs +307 -285
  180. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  181. package/fesm2022/ngwr-i18n-ar.mjs +374 -464
  182. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  183. package/fesm2022/ngwr-i18n-cs.mjs +374 -434
  184. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  185. package/fesm2022/ngwr-i18n-de.mjs +374 -453
  186. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  187. package/fesm2022/ngwr-i18n-en.mjs +374 -561
  188. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  189. package/fesm2022/ngwr-i18n-es.mjs +374 -434
  190. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  191. package/fesm2022/ngwr-i18n-fr.mjs +374 -458
  192. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  193. package/fesm2022/ngwr-i18n-he.mjs +374 -457
  194. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  195. package/fesm2022/ngwr-i18n-hi.mjs +374 -434
  196. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  197. package/fesm2022/ngwr-i18n-id.mjs +374 -434
  198. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  199. package/fesm2022/ngwr-i18n-it.mjs +374 -453
  200. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  201. package/fesm2022/ngwr-i18n-ja.mjs +374 -438
  202. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  203. package/fesm2022/ngwr-i18n-ko.mjs +374 -446
  204. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  205. package/fesm2022/ngwr-i18n-nl.mjs +374 -450
  206. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  207. package/fesm2022/ngwr-i18n-pl.mjs +374 -460
  208. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  209. package/fesm2022/ngwr-i18n-pt.mjs +374 -443
  210. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  211. package/fesm2022/ngwr-i18n-ru.mjs +374 -447
  212. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  213. package/fesm2022/ngwr-i18n-sv.mjs +374 -434
  214. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  215. package/fesm2022/ngwr-i18n-tr.mjs +374 -458
  216. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  217. package/fesm2022/ngwr-i18n-uk.mjs +374 -455
  218. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  219. package/fesm2022/ngwr-i18n-vi.mjs +374 -451
  220. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  221. package/fesm2022/ngwr-i18n-zh-TW.mjs +374 -442
  222. package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
  223. package/fesm2022/ngwr-i18n-zh.mjs +374 -433
  224. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  225. package/fesm2022/ngwr-i18n.mjs +415 -683
  226. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  227. package/fesm2022/ngwr-icon-adapters-feather.mjs +28 -77
  228. package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
  229. package/fesm2022/ngwr-icon-adapters-lucide.mjs +32 -94
  230. package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
  231. package/fesm2022/ngwr-icon.mjs +371 -690
  232. package/fesm2022/ngwr-icon.mjs.map +1 -1
  233. package/fesm2022/ngwr-image-cropper-testing.mjs +84 -227
  234. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
  235. package/fesm2022/ngwr-image-cropper.mjs +577 -639
  236. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  237. package/fesm2022/ngwr-input-number-testing.mjs +108 -305
  238. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  239. package/fesm2022/ngwr-input-number.mjs +511 -361
  240. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  241. package/fesm2022/ngwr-input-otp-testing.mjs +172 -420
  242. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
  243. package/fesm2022/ngwr-input-otp.mjs +400 -352
  244. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  245. package/fesm2022/ngwr-input-testing.mjs +52 -100
  246. package/fesm2022/ngwr-input-testing.mjs.map +1 -1
  247. package/fesm2022/ngwr-input.mjs +356 -303
  248. package/fesm2022/ngwr-input.mjs.map +1 -1
  249. package/fesm2022/ngwr-keyboard.mjs +63 -45
  250. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  251. package/fesm2022/ngwr-knob-testing.mjs +101 -223
  252. package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
  253. package/fesm2022/ngwr-knob.mjs +436 -303
  254. package/fesm2022/ngwr-knob.mjs.map +1 -1
  255. package/fesm2022/ngwr-layout.mjs +362 -207
  256. package/fesm2022/ngwr-layout.mjs.map +1 -1
  257. package/fesm2022/ngwr-lightbox-testing.mjs +100 -221
  258. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  259. package/fesm2022/ngwr-lightbox.mjs +335 -268
  260. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  261. package/fesm2022/ngwr-line-chart-testing.mjs +65 -133
  262. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
  263. package/fesm2022/ngwr-line-chart.mjs +356 -281
  264. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  265. package/fesm2022/ngwr-list.mjs +251 -134
  266. package/fesm2022/ngwr-list.mjs.map +1 -1
  267. package/fesm2022/ngwr-loading-bar-router.mjs +26 -68
  268. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
  269. package/fesm2022/ngwr-loading-bar.mjs +173 -186
  270. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  271. package/fesm2022/ngwr-markdown-testing.mjs +174 -505
  272. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -1
  273. package/fesm2022/ngwr-markdown.mjs +1578 -2219
  274. package/fesm2022/ngwr-markdown.mjs.map +1 -1
  275. package/fesm2022/ngwr-marquee-testing.mjs +118 -331
  276. package/fesm2022/ngwr-marquee-testing.mjs.map +1 -1
  277. package/fesm2022/ngwr-marquee.mjs +411 -230
  278. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  279. package/fesm2022/ngwr-media.mjs +100 -127
  280. package/fesm2022/ngwr-media.mjs.map +1 -1
  281. package/fesm2022/ngwr-mention-testing.mjs +179 -506
  282. package/fesm2022/ngwr-mention-testing.mjs.map +1 -1
  283. package/fesm2022/ngwr-mention.mjs +668 -732
  284. package/fesm2022/ngwr-mention.mjs.map +1 -1
  285. package/fesm2022/ngwr-meta.mjs +257 -329
  286. package/fesm2022/ngwr-meta.mjs.map +1 -1
  287. package/fesm2022/ngwr-meter-group-testing.mjs +56 -101
  288. package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
  289. package/fesm2022/ngwr-meter-group.mjs +206 -114
  290. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  291. package/fesm2022/ngwr-overlay.mjs +264 -576
  292. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  293. package/fesm2022/ngwr-page-header.mjs +107 -67
  294. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  295. package/fesm2022/ngwr-pagination-testing.mjs +125 -388
  296. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  297. package/fesm2022/ngwr-pagination.mjs +505 -335
  298. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  299. package/fesm2022/ngwr-pipes.mjs +343 -382
  300. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  301. package/fesm2022/ngwr-platform.mjs +182 -221
  302. package/fesm2022/ngwr-platform.mjs.map +1 -1
  303. package/fesm2022/ngwr-popconfirm-testing.mjs +112 -307
  304. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  305. package/fesm2022/ngwr-popconfirm.mjs +474 -277
  306. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  307. package/fesm2022/ngwr-popover-testing.mjs +114 -332
  308. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  309. package/fesm2022/ngwr-popover.mjs +1106 -1311
  310. package/fesm2022/ngwr-popover.mjs.map +1 -1
  311. package/fesm2022/ngwr-progress.mjs +124 -68
  312. package/fesm2022/ngwr-progress.mjs.map +1 -1
  313. package/fesm2022/ngwr-pull-to-refresh.mjs +198 -185
  314. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  315. package/fesm2022/ngwr-qr.mjs +1179 -1100
  316. package/fesm2022/ngwr-qr.mjs.map +1 -1
  317. package/fesm2022/ngwr-radio-testing.mjs +138 -389
  318. package/fesm2022/ngwr-radio-testing.mjs.map +1 -1
  319. package/fesm2022/ngwr-radio.mjs +351 -239
  320. package/fesm2022/ngwr-radio.mjs.map +1 -1
  321. package/fesm2022/ngwr-rating-testing.mjs +153 -390
  322. package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
  323. package/fesm2022/ngwr-rating.mjs +296 -247
  324. package/fesm2022/ngwr-rating.mjs.map +1 -1
  325. package/fesm2022/ngwr-result.mjs +359 -114
  326. package/fesm2022/ngwr-result.mjs.map +1 -1
  327. package/fesm2022/ngwr-rotating-text-testing.mjs +45 -215
  328. package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -1
  329. package/fesm2022/ngwr-rotating-text.mjs +402 -272
  330. package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
  331. package/fesm2022/ngwr-schema-form.mjs +384 -213
  332. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  333. package/fesm2022/ngwr-scroll.mjs +95 -105
  334. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  335. package/fesm2022/ngwr-segmented-testing.mjs +184 -593
  336. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
  337. package/fesm2022/ngwr-segmented.mjs +238 -251
  338. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  339. package/fesm2022/ngwr-select-testing.mjs +139 -284
  340. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  341. package/fesm2022/ngwr-select.mjs +1810 -2098
  342. package/fesm2022/ngwr-select.mjs.map +1 -1
  343. package/fesm2022/ngwr-shiny-text-testing.mjs +83 -228
  344. package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -1
  345. package/fesm2022/ngwr-shiny-text.mjs +304 -131
  346. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  347. package/fesm2022/ngwr-sidebar.mjs +256 -205
  348. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  349. package/fesm2022/ngwr-skeleton.mjs +101 -72
  350. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  351. package/fesm2022/ngwr-slider-testing.mjs +191 -473
  352. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  353. package/fesm2022/ngwr-slider.mjs +444 -443
  354. package/fesm2022/ngwr-slider.mjs.map +1 -1
  355. package/fesm2022/ngwr-sparkline-testing.mjs +37 -74
  356. package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -1
  357. package/fesm2022/ngwr-sparkline.mjs +311 -196
  358. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  359. package/fesm2022/ngwr-speed-dial-testing.mjs +135 -278
  360. package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
  361. package/fesm2022/ngwr-speed-dial.mjs +242 -140
  362. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  363. package/fesm2022/ngwr-spinner.mjs +97 -60
  364. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  365. package/fesm2022/ngwr-splash-cursor-testing.mjs +23 -87
  366. package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -1
  367. package/fesm2022/ngwr-splash-cursor.mjs +980 -725
  368. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  369. package/fesm2022/ngwr-split-text-testing.mjs +48 -218
  370. package/fesm2022/ngwr-split-text-testing.mjs.map +1 -1
  371. package/fesm2022/ngwr-split-text.mjs +365 -220
  372. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  373. package/fesm2022/ngwr-splitter-testing.mjs +107 -241
  374. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
  375. package/fesm2022/ngwr-splitter.mjs +222 -184
  376. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  377. package/fesm2022/ngwr-spotlight-card-testing.mjs +105 -360
  378. package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -1
  379. package/fesm2022/ngwr-spotlight-card.mjs +217 -135
  380. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  381. package/fesm2022/ngwr-squircle.mjs +410 -326
  382. package/fesm2022/ngwr-squircle.mjs.map +1 -1
  383. package/fesm2022/ngwr-star-border-testing.mjs +53 -168
  384. package/fesm2022/ngwr-star-border-testing.mjs.map +1 -1
  385. package/fesm2022/ngwr-star-border.mjs +160 -70
  386. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  387. package/fesm2022/ngwr-statistic.mjs +570 -389
  388. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  389. package/fesm2022/ngwr-stepper-testing.mjs +158 -471
  390. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
  391. package/fesm2022/ngwr-stepper.mjs +336 -215
  392. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  393. package/fesm2022/ngwr-storage.mjs +217 -330
  394. package/fesm2022/ngwr-storage.mjs.map +1 -1
  395. package/fesm2022/ngwr-switch-testing.mjs +42 -75
  396. package/fesm2022/ngwr-switch-testing.mjs.map +1 -1
  397. package/fesm2022/ngwr-switch.mjs +212 -114
  398. package/fesm2022/ngwr-switch.mjs.map +1 -1
  399. package/fesm2022/ngwr-table-testing.mjs +238 -572
  400. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  401. package/fesm2022/ngwr-table.mjs +1879 -1446
  402. package/fesm2022/ngwr-table.mjs.map +1 -1
  403. package/fesm2022/ngwr-tabs-router.mjs +84 -153
  404. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  405. package/fesm2022/ngwr-tabs-testing.mjs +217 -617
  406. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  407. package/fesm2022/ngwr-tabs.mjs +402 -425
  408. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  409. package/fesm2022/ngwr-textarea-testing.mjs +84 -236
  410. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
  411. package/fesm2022/ngwr-textarea.mjs +388 -264
  412. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  413. package/fesm2022/ngwr-theme.mjs +247 -443
  414. package/fesm2022/ngwr-theme.mjs.map +1 -1
  415. package/fesm2022/ngwr-tilt-card-testing.mjs +79 -186
  416. package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -1
  417. package/fesm2022/ngwr-tilt-card.mjs +257 -168
  418. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  419. package/fesm2022/ngwr-timeline.mjs +157 -70
  420. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  421. package/fesm2022/ngwr-toast-testing.mjs +59 -99
  422. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  423. package/fesm2022/ngwr-toast.mjs +769 -691
  424. package/fesm2022/ngwr-toast.mjs.map +1 -1
  425. package/fesm2022/ngwr-toolbar.mjs +73 -58
  426. package/fesm2022/ngwr-toolbar.mjs.map +1 -1
  427. package/fesm2022/ngwr-tour-testing.mjs +75 -171
  428. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  429. package/fesm2022/ngwr-tour.mjs +333 -347
  430. package/fesm2022/ngwr-tour.mjs.map +1 -1
  431. package/fesm2022/ngwr-transfer-testing.mjs +195 -534
  432. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
  433. package/fesm2022/ngwr-transfer.mjs +444 -322
  434. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  435. package/fesm2022/ngwr-tree-testing.mjs +277 -754
  436. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  437. package/fesm2022/ngwr-tree.mjs +884 -906
  438. package/fesm2022/ngwr-tree.mjs.map +1 -1
  439. package/fesm2022/ngwr-typewriter-testing.mjs +50 -237
  440. package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
  441. package/fesm2022/ngwr-typewriter.mjs +461 -242
  442. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  443. package/fesm2022/ngwr-typography.mjs +142 -81
  444. package/fesm2022/ngwr-typography.mjs.map +1 -1
  445. package/fesm2022/ngwr-utils.mjs +304 -613
  446. package/fesm2022/ngwr-utils.mjs.map +1 -1
  447. package/fesm2022/ngwr-validators.mjs +179 -361
  448. package/fesm2022/ngwr-validators.mjs.map +1 -1
  449. package/fesm2022/ngwr-version.mjs +17 -47
  450. package/fesm2022/ngwr-version.mjs.map +1 -1
  451. package/fesm2022/ngwr-virtual-scroll.mjs +259 -125
  452. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  453. package/fesm2022/ngwr-waves-testing.mjs +34 -125
  454. package/fesm2022/ngwr-waves-testing.mjs.map +1 -1
  455. package/fesm2022/ngwr-waves.mjs +816 -373
  456. package/fesm2022/ngwr-waves.mjs.map +1 -1
  457. package/fesm2022/ngwr-window-testing.mjs +171 -366
  458. package/fesm2022/ngwr-window-testing.mjs.map +1 -1
  459. package/fesm2022/ngwr-window.mjs +1437 -1351
  460. package/fesm2022/ngwr-window.mjs.map +1 -1
  461. package/fesm2022/ngwr.mjs +0 -4
  462. package/i18n/ar.json +0 -1
  463. package/i18n/cs.json +0 -1
  464. package/i18n/de.json +0 -1
  465. package/i18n/en.json +0 -1
  466. package/i18n/es.json +0 -1
  467. package/i18n/fr.json +0 -1
  468. package/i18n/he.json +0 -1
  469. package/i18n/hi.json +0 -1
  470. package/i18n/id.json +0 -1
  471. package/i18n/it.json +0 -1
  472. package/i18n/ja.json +0 -1
  473. package/i18n/ko.json +0 -1
  474. package/i18n/nl.json +0 -1
  475. package/i18n/pl.json +0 -1
  476. package/i18n/pt.json +0 -1
  477. package/i18n/ru.json +0 -1
  478. package/i18n/sv.json +0 -1
  479. package/i18n/tr.json +0 -1
  480. package/i18n/uk.json +0 -1
  481. package/i18n/vi.json +0 -1
  482. package/i18n/zh-TW.json +0 -1
  483. package/i18n/zh.json +0 -1
  484. package/input-number/styles/_index.scss +33 -35
  485. package/llms-full.txt +3 -3
  486. package/loading-bar/styles/_rules.scss +1 -1
  487. package/package.json +2 -2
  488. package/segmented/styles/_index.scss +10 -3
  489. package/theme/_index.scss +84 -0
  490. package/theme/styles/_contrast.scss +1 -1
  491. package/theme/styles/_dark.scss +59 -3
  492. package/types/ngwr-action-sheet-testing.d.ts +174 -200
  493. package/types/ngwr-action-sheet.d.ts +83 -45
  494. package/types/ngwr-affix.d.ts +27 -22
  495. package/types/ngwr-alert.d.ts +93 -59
  496. package/types/ngwr-anchor.d.ts +52 -35
  497. package/types/ngwr-aurora.d.ts +53 -35
  498. package/types/ngwr-avatar.d.ts +97 -81
  499. package/types/ngwr-back-top.d.ts +36 -23
  500. package/types/ngwr-badge.d.ts +160 -105
  501. package/types/ngwr-bar-chart-testing.d.ts +40 -58
  502. package/types/ngwr-bar-chart.d.ts +86 -60
  503. package/types/ngwr-blur-text-testing.d.ts +103 -121
  504. package/types/ngwr-blur-text.d.ts +99 -60
  505. package/types/ngwr-border-glow-testing.d.ts +155 -173
  506. package/types/ngwr-border-glow.d.ts +93 -45
  507. package/types/ngwr-breadcrumbs.d.ts +60 -32
  508. package/types/ngwr-burger.d.ts +38 -23
  509. package/types/ngwr-button-testing.d.ts +41 -59
  510. package/types/ngwr-button.d.ts +213 -163
  511. package/types/ngwr-calendar-heatmap-testing.d.ts +38 -56
  512. package/types/ngwr-calendar-heatmap.d.ts +151 -105
  513. package/types/ngwr-calendar-testing.d.ts +198 -224
  514. package/types/ngwr-calendar.d.ts +285 -246
  515. package/types/ngwr-card.d.ts +41 -23
  516. package/types/ngwr-carousel-testing.d.ts +196 -214
  517. package/types/ngwr-carousel.d.ts +173 -122
  518. package/types/ngwr-cascader-testing.d.ts +338 -372
  519. package/types/ngwr-cascader.d.ts +235 -161
  520. package/types/ngwr-checkbox-testing.d.ts +45 -63
  521. package/types/ngwr-checkbox.d.ts +252 -183
  522. package/types/ngwr-circular-text-testing.d.ts +108 -126
  523. package/types/ngwr-circular-text.d.ts +53 -41
  524. package/types/ngwr-click-spark.d.ts +82 -50
  525. package/types/ngwr-clipboard.d.ts +40 -44
  526. package/types/ngwr-collapse-testing.d.ts +193 -219
  527. package/types/ngwr-collapse.d.ts +82 -71
  528. package/types/ngwr-color-picker-testing.d.ts +211 -237
  529. package/types/ngwr-color-picker.d.ts +353 -300
  530. package/types/ngwr-command-palette-testing.d.ts +311 -345
  531. package/types/ngwr-command-palette.d.ts +257 -197
  532. package/types/ngwr-compare.d.ts +102 -67
  533. package/types/ngwr-confetti.d.ts +51 -55
  534. package/types/ngwr-config.d.ts +44 -71
  535. package/types/ngwr-context-menu-testing.d.ts +301 -327
  536. package/types/ngwr-context-menu.d.ts +350 -310
  537. package/types/ngwr-cookie.d.ts +37 -41
  538. package/types/ngwr-counter.d.ts +223 -128
  539. package/types/ngwr-date-adapters-fns.d.ts +40 -59
  540. package/types/ngwr-date-adapters-luxon.d.ts +61 -72
  541. package/types/ngwr-date-picker-testing.d.ts +295 -339
  542. package/types/ngwr-date-picker.d.ts +771 -583
  543. package/types/ngwr-date.d.ts +229 -258
  544. package/types/ngwr-decrypt-text-testing.d.ts +140 -158
  545. package/types/ngwr-decrypt-text.d.ts +104 -62
  546. package/types/ngwr-density.d.ts +42 -57
  547. package/types/ngwr-descriptions.d.ts +50 -27
  548. package/types/ngwr-dialog-testing.d.ts +36 -54
  549. package/types/ngwr-dialog.d.ts +166 -190
  550. package/types/ngwr-directives.d.ts +82 -60
  551. package/types/ngwr-divider.d.ts +78 -62
  552. package/types/ngwr-donut-chart-testing.d.ts +36 -54
  553. package/types/ngwr-donut-chart.d.ts +102 -66
  554. package/types/ngwr-drag-drop.d.ts +139 -106
  555. package/types/ngwr-drawer-testing.d.ts +141 -159
  556. package/types/ngwr-drawer.d.ts +374 -316
  557. package/types/ngwr-dropdown-testing.d.ts +128 -154
  558. package/types/ngwr-dropdown.d.ts +260 -166
  559. package/types/ngwr-editor-testing.d.ts +312 -330
  560. package/types/ngwr-editor.d.ts +435 -344
  561. package/types/ngwr-empty.d.ts +41 -28
  562. package/types/ngwr-event-calendar-testing.d.ts +221 -243
  563. package/types/ngwr-event-calendar.d.ts +340 -298
  564. package/types/ngwr-falling-text-testing.d.ts +108 -126
  565. package/types/ngwr-falling-text.d.ts +57 -35
  566. package/types/ngwr-file-upload-testing.d.ts +134 -151
  567. package/types/ngwr-file-upload.d.ts +210 -128
  568. package/types/ngwr-form-testing.d.ts +255 -282
  569. package/types/ngwr-form.d.ts +324 -306
  570. package/types/ngwr-fuzzy-text-testing.d.ts +63 -81
  571. package/types/ngwr-fuzzy-text.d.ts +152 -65
  572. package/types/ngwr-gauge-testing.d.ts +43 -61
  573. package/types/ngwr-gauge.d.ts +113 -61
  574. package/types/ngwr-glitch-text-testing.d.ts +125 -143
  575. package/types/ngwr-glitch-text.d.ts +47 -24
  576. package/types/ngwr-gradient-text-testing.d.ts +114 -132
  577. package/types/ngwr-gradient-text.d.ts +51 -24
  578. package/types/ngwr-graph-testing.d.ts +89 -115
  579. package/types/ngwr-graph.d.ts +137 -124
  580. package/types/ngwr-hotkey.d.ts +85 -75
  581. package/types/ngwr-i18n-ar.d.ts +2 -5
  582. package/types/ngwr-i18n-cs.d.ts +2 -5
  583. package/types/ngwr-i18n-de.d.ts +2 -5
  584. package/types/ngwr-i18n-en.d.ts +2 -5
  585. package/types/ngwr-i18n-es.d.ts +2 -5
  586. package/types/ngwr-i18n-fr.d.ts +2 -5
  587. package/types/ngwr-i18n-he.d.ts +2 -5
  588. package/types/ngwr-i18n-hi.d.ts +2 -5
  589. package/types/ngwr-i18n-id.d.ts +2 -5
  590. package/types/ngwr-i18n-it.d.ts +2 -5
  591. package/types/ngwr-i18n-ja.d.ts +2 -5
  592. package/types/ngwr-i18n-ko.d.ts +2 -5
  593. package/types/ngwr-i18n-nl.d.ts +2 -5
  594. package/types/ngwr-i18n-pl.d.ts +2 -5
  595. package/types/ngwr-i18n-pt.d.ts +2 -5
  596. package/types/ngwr-i18n-ru.d.ts +2 -5
  597. package/types/ngwr-i18n-sv.d.ts +2 -5
  598. package/types/ngwr-i18n-tr.d.ts +2 -5
  599. package/types/ngwr-i18n-uk.d.ts +2 -5
  600. package/types/ngwr-i18n-vi.d.ts +2 -5
  601. package/types/ngwr-i18n-zh-TW.d.ts +2 -5
  602. package/types/ngwr-i18n-zh.d.ts +2 -5
  603. package/types/ngwr-i18n.d.ts +202 -246
  604. package/types/ngwr-icon-adapters-feather.d.ts +2 -11
  605. package/types/ngwr-icon-adapters-lucide.d.ts +2 -12
  606. package/types/ngwr-icon.d.ts +62 -84
  607. package/types/ngwr-image-cropper-testing.d.ts +116 -134
  608. package/types/ngwr-image-cropper.d.ts +287 -252
  609. package/types/ngwr-input-number-testing.d.ts +164 -182
  610. package/types/ngwr-input-number.d.ts +238 -150
  611. package/types/ngwr-input-otp-testing.d.ts +210 -244
  612. package/types/ngwr-input-otp.d.ts +175 -123
  613. package/types/ngwr-input-testing.d.ts +42 -60
  614. package/types/ngwr-input.d.ts +118 -94
  615. package/types/ngwr-keyboard.d.ts +14 -12
  616. package/types/ngwr-knob-testing.d.ts +106 -124
  617. package/types/ngwr-knob.d.ts +203 -129
  618. package/types/ngwr-layout.d.ts +57 -40
  619. package/types/ngwr-lightbox-testing.d.ts +101 -119
  620. package/types/ngwr-lightbox.d.ts +140 -87
  621. package/types/ngwr-line-chart-testing.d.ts +51 -69
  622. package/types/ngwr-line-chart.d.ts +171 -134
  623. package/types/ngwr-list.d.ts +55 -27
  624. package/types/ngwr-loading-bar-router.d.ts +2 -12
  625. package/types/ngwr-loading-bar.d.ts +45 -39
  626. package/types/ngwr-markdown-testing.d.ts +323 -350
  627. package/types/ngwr-markdown.d.ts +432 -318
  628. package/types/ngwr-marquee-testing.d.ts +190 -216
  629. package/types/ngwr-marquee.d.ts +127 -75
  630. package/types/ngwr-media.d.ts +25 -39
  631. package/types/ngwr-mention-testing.d.ts +274 -300
  632. package/types/ngwr-mention.d.ts +249 -164
  633. package/types/ngwr-meta.d.ts +93 -108
  634. package/types/ngwr-meter-group-testing.d.ts +33 -51
  635. package/types/ngwr-meter-group.d.ts +86 -60
  636. package/types/ngwr-overlay.d.ts +57 -132
  637. package/types/ngwr-page-header.d.ts +32 -19
  638. package/types/ngwr-pagination-testing.d.ts +215 -233
  639. package/types/ngwr-pagination.d.ts +213 -141
  640. package/types/ngwr-pipes.d.ts +67 -84
  641. package/types/ngwr-platform.d.ts +52 -57
  642. package/types/ngwr-popconfirm-testing.d.ts +181 -199
  643. package/types/ngwr-popconfirm.d.ts +151 -82
  644. package/types/ngwr-popover-testing.d.ts +183 -201
  645. package/types/ngwr-popover.d.ts +291 -207
  646. package/types/ngwr-progress.d.ts +38 -25
  647. package/types/ngwr-pull-to-refresh.d.ts +55 -40
  648. package/types/ngwr-qr.d.ts +79 -37
  649. package/types/ngwr-radio-testing.d.ts +208 -234
  650. package/types/ngwr-radio.d.ts +171 -125
  651. package/types/ngwr-rating-testing.d.ts +218 -244
  652. package/types/ngwr-rating.d.ts +154 -111
  653. package/types/ngwr-result.d.ts +85 -41
  654. package/types/ngwr-rotating-text-testing.d.ts +107 -125
  655. package/types/ngwr-rotating-text.d.ts +96 -52
  656. package/types/ngwr-schema-form.d.ts +57 -49
  657. package/types/ngwr-scroll.d.ts +27 -31
  658. package/types/ngwr-segmented-testing.d.ts +333 -359
  659. package/types/ngwr-segmented.d.ts +189 -165
  660. package/types/ngwr-select-testing.d.ts +128 -154
  661. package/types/ngwr-select.d.ts +1103 -906
  662. package/types/ngwr-shiny-text-testing.d.ts +82 -100
  663. package/types/ngwr-shiny-text.d.ts +83 -36
  664. package/types/ngwr-sidebar.d.ts +108 -93
  665. package/types/ngwr-skeleton.d.ts +34 -26
  666. package/types/ngwr-slider-testing.d.ts +228 -254
  667. package/types/ngwr-slider.d.ts +244 -186
  668. package/types/ngwr-sparkline-testing.d.ts +29 -47
  669. package/types/ngwr-sparkline.d.ts +130 -88
  670. package/types/ngwr-speed-dial-testing.d.ts +129 -155
  671. package/types/ngwr-speed-dial.d.ts +92 -57
  672. package/types/ngwr-spinner.d.ts +30 -23
  673. package/types/ngwr-splash-cursor-testing.d.ts +42 -60
  674. package/types/ngwr-splash-cursor.d.ts +129 -61
  675. package/types/ngwr-split-text-testing.d.ts +119 -137
  676. package/types/ngwr-split-text.d.ts +120 -71
  677. package/types/ngwr-splitter-testing.d.ts +114 -132
  678. package/types/ngwr-splitter.d.ts +85 -55
  679. package/types/ngwr-spotlight-card-testing.d.ts +177 -203
  680. package/types/ngwr-spotlight-card.d.ts +50 -32
  681. package/types/ngwr-squircle.d.ts +112 -70
  682. package/types/ngwr-star-border-testing.d.ts +74 -92
  683. package/types/ngwr-star-border.d.ts +42 -20
  684. package/types/ngwr-statistic.d.ts +210 -130
  685. package/types/ngwr-stepper-testing.d.ts +258 -284
  686. package/types/ngwr-stepper.d.ts +112 -75
  687. package/types/ngwr-storage.d.ts +96 -118
  688. package/types/ngwr-switch-testing.d.ts +26 -44
  689. package/types/ngwr-switch.d.ts +99 -62
  690. package/types/ngwr-table-testing.d.ts +291 -333
  691. package/types/ngwr-table.d.ts +930 -707
  692. package/types/ngwr-tabs-router.d.ts +21 -24
  693. package/types/ngwr-tabs-testing.d.ts +354 -380
  694. package/types/ngwr-tabs.d.ts +169 -155
  695. package/types/ngwr-textarea-testing.d.ts +123 -141
  696. package/types/ngwr-textarea.d.ts +166 -105
  697. package/types/ngwr-theme.d.ts +81 -163
  698. package/types/ngwr-tilt-card-testing.d.ts +94 -112
  699. package/types/ngwr-tilt-card.d.ts +64 -35
  700. package/types/ngwr-timeline.d.ts +36 -19
  701. package/types/ngwr-toast-testing.d.ts +37 -55
  702. package/types/ngwr-toast.d.ts +165 -209
  703. package/types/ngwr-toolbar.d.ts +17 -14
  704. package/types/ngwr-tour-testing.d.ts +84 -102
  705. package/types/ngwr-tour.d.ts +142 -144
  706. package/types/ngwr-transfer-testing.d.ts +293 -328
  707. package/types/ngwr-transfer.d.ts +228 -159
  708. package/types/ngwr-tree-testing.d.ts +428 -454
  709. package/types/ngwr-tree.d.ts +407 -296
  710. package/types/ngwr-typewriter-testing.d.ts +125 -143
  711. package/types/ngwr-typewriter.d.ts +137 -63
  712. package/types/ngwr-typography.d.ts +49 -27
  713. package/types/ngwr-utils.d.ts +100 -107
  714. package/types/ngwr-validators.d.ts +94 -104
  715. package/types/ngwr-version.d.ts +3 -14
  716. package/types/ngwr-virtual-scroll.d.ts +86 -58
  717. package/types/ngwr-waves-testing.d.ts +61 -79
  718. package/types/ngwr-waves.d.ts +116 -63
  719. package/types/ngwr-window-testing.d.ts +178 -204
  720. package/types/ngwr-window.d.ts +299 -325
  721. package/types/ngwr.d.ts +1 -2
  722. package/fesm2022/ngwr.mjs.map +0 -1
@@ -1,120 +1,111 @@
1
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
- import { isPlatformBrowser } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { input, viewChild, inject, NgZone, PLATFORM_ID, effect, ViewEncapsulation, Component } from '@angular/core';
5
- import { WrPlatform } from 'ngwr/platform';
6
- import { numAttr } from 'ngwr/utils';
7
-
1
+ import { coerceBooleanProperty } from "@angular/cdk/coercion";
2
+ import { isPlatformBrowser } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { Component, NgZone, PLATFORM_ID, ViewEncapsulation, effect, inject, input, viewChild } from "@angular/core";
5
+ import { WrPlatform } from "ngwr/platform";
6
+ import { numAttr } from "ngwr/utils";
8
7
  /**
9
- * @license
10
- *
11
- * Use of this source code is governed by an MIT-style license that can be
12
- * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
13
- *
14
- * WebGL fluid simulation behind `<wr-splash-cursor>`. Port of the engine
15
- * used by reactbits.dev's SplashCursor (itself based on Pavel Dobryakov's
16
- * WebGL-Fluid-Simulation, MIT).
17
- *
18
- * Framework-free on purpose: `createFluidSimulation(canvas, config)` boots
19
- * the sim and returns a teardown, or `null` when WebGL isn't available.
20
- */
8
+ * @license
9
+ *
10
+ * Use of this source code is governed by an MIT-style license that can be
11
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
12
+ *
13
+ * WebGL fluid simulation behind `<wr-splash-cursor>`. Port of the engine
14
+ * used by reactbits.dev's SplashCursor (itself based on Pavel Dobryakov's
15
+ * WebGL-Fluid-Simulation, MIT).
16
+ *
17
+ * Framework-free on purpose: `createFluidSimulation(canvas, config)` boots
18
+ * the sim and returns a teardown, or `null` when WebGL isn't available.
19
+ */
21
20
  function createFluidSimulation(canvas, config) {
22
- const ctx = getWebGLContext(canvas);
23
- if (!ctx)
24
- return null;
25
- const { gl, ext } = ctx;
26
- let dyeResolution = config.dyeResolution;
27
- let shading = config.shading;
28
- if (!ext.supportLinearFiltering) {
29
- dyeResolution = 256;
30
- shading = false;
31
- }
32
- let active = true;
33
- let rafId = 0;
34
- const pointer = {
35
- texcoordX: 0,
36
- texcoordY: 0,
37
- prevTexcoordX: 0,
38
- prevTexcoordY: 0,
39
- deltaX: 0,
40
- deltaY: 0,
41
- moved: false,
42
- color: { r: 0, g: 0, b: 0 },
43
- };
44
- // Shader plumbing
45
- function compile(type, source, keywords) {
46
- const prefixed = keywords ? keywords.map(k => `#define ${k}\n`).join('') + source : source;
47
- const shader = gl.createShader(type);
48
- gl.shaderSource(shader, prefixed);
49
- gl.compileShader(shader);
50
- if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
51
- // eslint-disable-next-line no-console -- GPU shader failures are otherwise invisible
52
- console.error('wr-splash-cursor shader error:', gl.getShaderInfoLog(shader));
53
- }
54
- return shader;
55
- }
56
- function link(vertex, fragment) {
57
- const program = gl.createProgram();
58
- gl.attachShader(program, vertex);
59
- gl.attachShader(program, fragment);
60
- gl.linkProgram(program);
61
- if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
62
- // eslint-disable-next-line no-console -- GPU link failures are otherwise invisible
63
- console.error('wr-splash-cursor program error:', gl.getProgramInfoLog(program));
64
- }
65
- return program;
66
- }
67
- function uniformsOf(program) {
68
- const out = {};
69
- const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
70
- for (let i = 0; i < count; i++) {
71
- const name = gl.getActiveUniform(program, i).name;
72
- out[name] = gl.getUniformLocation(program, name);
73
- }
74
- return out;
75
- }
76
- class ShaderProgram {
77
- program;
78
- uniforms;
79
- constructor(vertex, fragment) {
80
- this.program = link(vertex, fragment);
81
- this.uniforms = uniformsOf(this.program);
82
- }
83
- bind() {
84
- gl.useProgram(this.program);
85
- }
86
- }
87
- /** Display shader with `#define`-keyword program variants. */
88
- class DisplayMaterial {
89
- vertex;
90
- fragmentSource;
91
- programs = new Map();
92
- activeProgram = null;
93
- uniforms = {};
94
- constructor(vertex, fragmentSource) {
95
- this.vertex = vertex;
96
- this.fragmentSource = fragmentSource;
97
- }
98
- setKeywords(keywords) {
99
- let hash = 0;
100
- for (const k of keywords)
101
- hash += hashCode(k);
102
- let program = this.programs.get(hash);
103
- if (!program) {
104
- program = link(this.vertex, compile(gl.FRAGMENT_SHADER, this.fragmentSource, keywords));
105
- this.programs.set(hash, program);
106
- }
107
- if (program === this.activeProgram)
108
- return;
109
- this.uniforms = uniformsOf(program);
110
- this.activeProgram = program;
111
- }
112
- bind() {
113
- gl.useProgram(this.activeProgram);
114
- }
115
- }
116
- // Shaders
117
- const baseVertexShader = compile(gl.VERTEX_SHADER, `
21
+ const ctx = getWebGLContext(canvas);
22
+ if (!ctx) return null;
23
+ const { gl, ext } = ctx;
24
+ let dyeResolution = config.dyeResolution;
25
+ let shading = config.shading;
26
+ if (!ext.supportLinearFiltering) {
27
+ dyeResolution = 256;
28
+ shading = false;
29
+ }
30
+ let active = true;
31
+ let rafId = 0;
32
+ const pointer = {
33
+ texcoordX: 0,
34
+ texcoordY: 0,
35
+ prevTexcoordX: 0,
36
+ prevTexcoordY: 0,
37
+ deltaX: 0,
38
+ deltaY: 0,
39
+ moved: false,
40
+ color: {
41
+ r: 0,
42
+ g: 0,
43
+ b: 0
44
+ }
45
+ };
46
+ function compile(type, source, keywords) {
47
+ const prefixed = keywords ? keywords.map((k) => `#define ${k}\n`).join("") + source : source;
48
+ const shader = gl.createShader(type);
49
+ gl.shaderSource(shader, prefixed);
50
+ gl.compileShader(shader);
51
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) console.error("wr-splash-cursor shader error:", gl.getShaderInfoLog(shader));
52
+ return shader;
53
+ }
54
+ function link(vertex, fragment) {
55
+ const program = gl.createProgram();
56
+ gl.attachShader(program, vertex);
57
+ gl.attachShader(program, fragment);
58
+ gl.linkProgram(program);
59
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) console.error("wr-splash-cursor program error:", gl.getProgramInfoLog(program));
60
+ return program;
61
+ }
62
+ function uniformsOf(program) {
63
+ const out = {};
64
+ const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
65
+ for (let i = 0; i < count; i++) {
66
+ const name = gl.getActiveUniform(program, i).name;
67
+ out[name] = gl.getUniformLocation(program, name);
68
+ }
69
+ return out;
70
+ }
71
+ class ShaderProgram {
72
+ program;
73
+ uniforms;
74
+ constructor(vertex, fragment) {
75
+ this.program = link(vertex, fragment);
76
+ this.uniforms = uniformsOf(this.program);
77
+ }
78
+ bind() {
79
+ gl.useProgram(this.program);
80
+ }
81
+ }
82
+ class DisplayMaterial {
83
+ vertex;
84
+ fragmentSource;
85
+ programs = /* @__PURE__ */ new Map();
86
+ activeProgram = null;
87
+ uniforms = {};
88
+ constructor(vertex, fragmentSource) {
89
+ this.vertex = vertex;
90
+ this.fragmentSource = fragmentSource;
91
+ }
92
+ setKeywords(keywords) {
93
+ let hash = 0;
94
+ for (const k of keywords) hash += hashCode(k);
95
+ let program = this.programs.get(hash);
96
+ if (!program) {
97
+ program = link(this.vertex, compile(gl.FRAGMENT_SHADER, this.fragmentSource, keywords));
98
+ this.programs.set(hash, program);
99
+ }
100
+ if (program === this.activeProgram) return;
101
+ this.uniforms = uniformsOf(program);
102
+ this.activeProgram = program;
103
+ }
104
+ bind() {
105
+ gl.useProgram(this.activeProgram);
106
+ }
107
+ }
108
+ const baseVertexShader = compile(gl.VERTEX_SHADER, `
118
109
  precision highp float;
119
110
  attribute vec2 aPosition;
120
111
  varying vec2 vUv;
@@ -133,7 +124,7 @@ function createFluidSimulation(canvas, config) {
133
124
  gl_Position = vec4(aPosition, 0.0, 1.0);
134
125
  }
135
126
  `);
136
- const copyShader = compile(gl.FRAGMENT_SHADER, `
127
+ const copyShader = compile(gl.FRAGMENT_SHADER, `
137
128
  precision mediump float;
138
129
  precision mediump sampler2D;
139
130
  varying highp vec2 vUv;
@@ -143,7 +134,7 @@ function createFluidSimulation(canvas, config) {
143
134
  gl_FragColor = texture2D(uTexture, vUv);
144
135
  }
145
136
  `);
146
- const clearShader = compile(gl.FRAGMENT_SHADER, `
137
+ const clearShader = compile(gl.FRAGMENT_SHADER, `
147
138
  precision mediump float;
148
139
  precision mediump sampler2D;
149
140
  varying highp vec2 vUv;
@@ -154,7 +145,7 @@ function createFluidSimulation(canvas, config) {
154
145
  gl_FragColor = value * texture2D(uTexture, vUv);
155
146
  }
156
147
  `);
157
- const displayShaderSource = `
148
+ const displayShaderSource = `
158
149
  precision highp float;
159
150
  precision highp sampler2D;
160
151
  varying vec2 vUv;
@@ -187,7 +178,7 @@ function createFluidSimulation(canvas, config) {
187
178
  gl_FragColor = vec4(c, a);
188
179
  }
189
180
  `;
190
- const splatShader = compile(gl.FRAGMENT_SHADER, `
181
+ const splatShader = compile(gl.FRAGMENT_SHADER, `
191
182
  precision highp float;
192
183
  precision highp sampler2D;
193
184
  varying vec2 vUv;
@@ -205,7 +196,7 @@ function createFluidSimulation(canvas, config) {
205
196
  gl_FragColor = vec4(base + splat, 1.0);
206
197
  }
207
198
  `);
208
- const advectionShader = compile(gl.FRAGMENT_SHADER, `
199
+ const advectionShader = compile(gl.FRAGMENT_SHADER, `
209
200
  precision highp float;
210
201
  precision highp sampler2D;
211
202
  varying vec2 vUv;
@@ -240,8 +231,8 @@ function createFluidSimulation(canvas, config) {
240
231
  float decay = 1.0 + dissipation * dt;
241
232
  gl_FragColor = result / decay;
242
233
  }
243
- `, ext.supportLinearFiltering ? undefined : ['MANUAL_FILTERING']);
244
- const divergenceShader = compile(gl.FRAGMENT_SHADER, `
234
+ `, ext.supportLinearFiltering ? void 0 : ["MANUAL_FILTERING"]);
235
+ const divergenceShader = compile(gl.FRAGMENT_SHADER, `
245
236
  precision mediump float;
246
237
  precision mediump sampler2D;
247
238
  varying highp vec2 vUv;
@@ -267,7 +258,7 @@ function createFluidSimulation(canvas, config) {
267
258
  gl_FragColor = vec4(div, 0.0, 0.0, 1.0);
268
259
  }
269
260
  `);
270
- const curlShader = compile(gl.FRAGMENT_SHADER, `
261
+ const curlShader = compile(gl.FRAGMENT_SHADER, `
271
262
  precision mediump float;
272
263
  precision mediump sampler2D;
273
264
  varying highp vec2 vUv;
@@ -286,7 +277,7 @@ function createFluidSimulation(canvas, config) {
286
277
  gl_FragColor = vec4(0.5 * vorticity, 0.0, 0.0, 1.0);
287
278
  }
288
279
  `);
289
- const vorticityShader = compile(gl.FRAGMENT_SHADER, `
280
+ const vorticityShader = compile(gl.FRAGMENT_SHADER, `
290
281
  precision highp float;
291
282
  precision highp sampler2D;
292
283
  varying vec2 vUv;
@@ -317,7 +308,7 @@ function createFluidSimulation(canvas, config) {
317
308
  gl_FragColor = vec4(velocity, 0.0, 1.0);
318
309
  }
319
310
  `);
320
- const pressureShader = compile(gl.FRAGMENT_SHADER, `
311
+ const pressureShader = compile(gl.FRAGMENT_SHADER, `
321
312
  precision mediump float;
322
313
  precision mediump sampler2D;
323
314
  varying highp vec2 vUv;
@@ -339,7 +330,7 @@ function createFluidSimulation(canvas, config) {
339
330
  gl_FragColor = vec4(pressure, 0.0, 0.0, 1.0);
340
331
  }
341
332
  `);
342
- const gradientSubtractShader = compile(gl.FRAGMENT_SHADER, `
333
+ const gradientSubtractShader = compile(gl.FRAGMENT_SHADER, `
343
334
  precision mediump float;
344
335
  precision mediump sampler2D;
345
336
  varying highp vec2 vUv;
@@ -360,611 +351,875 @@ function createFluidSimulation(canvas, config) {
360
351
  gl_FragColor = vec4(velocity, 0.0, 1.0);
361
352
  }
362
353
  `);
363
- // Fullscreen blit
364
- gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
365
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, -1, 1, 1, 1, 1, -1]), gl.STATIC_DRAW);
366
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer());
367
- gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 0, 2, 3]), gl.STATIC_DRAW);
368
- gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
369
- gl.enableVertexAttribArray(0);
370
- function blit(target, clear = false) {
371
- if (target === null) {
372
- gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
373
- gl.bindFramebuffer(gl.FRAMEBUFFER, null);
374
- }
375
- else {
376
- gl.viewport(0, 0, target.width, target.height);
377
- gl.bindFramebuffer(gl.FRAMEBUFFER, target.fbo);
378
- }
379
- if (clear) {
380
- gl.clearColor(0.0, 0.0, 0.0, 1.0);
381
- gl.clear(gl.COLOR_BUFFER_BIT);
382
- }
383
- gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);
384
- }
385
- // Framebuffers
386
- function createFBO(w, h, internalFormat, format, type, param) {
387
- gl.activeTexture(gl.TEXTURE0);
388
- const texture = gl.createTexture();
389
- gl.bindTexture(gl.TEXTURE_2D, texture);
390
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, param);
391
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, param);
392
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
393
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
394
- gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, w, h, 0, format, type, null);
395
- const fbo = gl.createFramebuffer();
396
- gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
397
- gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
398
- gl.viewport(0, 0, w, h);
399
- gl.clear(gl.COLOR_BUFFER_BIT);
400
- return {
401
- texture,
402
- fbo,
403
- width: w,
404
- height: h,
405
- texelSizeX: 1 / w,
406
- texelSizeY: 1 / h,
407
- attach(id) {
408
- gl.activeTexture(gl.TEXTURE0 + id);
409
- gl.bindTexture(gl.TEXTURE_2D, texture);
410
- return id;
411
- },
412
- };
413
- }
414
- function createDoubleFBO(w, h, internalFormat, format, type, param) {
415
- let fbo1 = createFBO(w, h, internalFormat, format, type, param);
416
- let fbo2 = createFBO(w, h, internalFormat, format, type, param);
417
- return {
418
- width: w,
419
- height: h,
420
- texelSizeX: fbo1.texelSizeX,
421
- texelSizeY: fbo1.texelSizeY,
422
- get read() {
423
- return fbo1;
424
- },
425
- set read(value) {
426
- fbo1 = value;
427
- },
428
- get write() {
429
- return fbo2;
430
- },
431
- set write(value) {
432
- fbo2 = value;
433
- },
434
- swap() {
435
- const temp = fbo1;
436
- fbo1 = fbo2;
437
- fbo2 = temp;
438
- },
439
- };
440
- }
441
- function resizeFBO(target, w, h, internalFormat, format, type, param) {
442
- const newFBO = createFBO(w, h, internalFormat, format, type, param);
443
- copyProgram.bind();
444
- gl.uniform1i(copyProgram.uniforms['uTexture'], target.attach(0));
445
- blit(newFBO);
446
- return newFBO;
447
- }
448
- function resizeDoubleFBO(target, w, h, internalFormat, format, type, param) {
449
- if (target.width === w && target.height === h)
450
- return target;
451
- target.read = resizeFBO(target.read, w, h, internalFormat, format, type, param);
452
- target.write = createFBO(w, h, internalFormat, format, type, param);
453
- target.width = w;
454
- target.height = h;
455
- target.texelSizeX = 1 / w;
456
- target.texelSizeY = 1 / h;
457
- return target;
458
- }
459
- // Programs + state
460
- const copyProgram = new ShaderProgram(baseVertexShader, copyShader);
461
- const clearProgram = new ShaderProgram(baseVertexShader, clearShader);
462
- const splatProgram = new ShaderProgram(baseVertexShader, splatShader);
463
- const advectionProgram = new ShaderProgram(baseVertexShader, advectionShader);
464
- const divergenceProgram = new ShaderProgram(baseVertexShader, divergenceShader);
465
- const curlProgram = new ShaderProgram(baseVertexShader, curlShader);
466
- const vorticityProgram = new ShaderProgram(baseVertexShader, vorticityShader);
467
- const pressureProgram = new ShaderProgram(baseVertexShader, pressureShader);
468
- const gradientSubtractProgram = new ShaderProgram(baseVertexShader, gradientSubtractShader);
469
- const displayMaterial = new DisplayMaterial(baseVertexShader, displayShaderSource);
470
- let dye;
471
- let velocity;
472
- let divergence;
473
- let curl;
474
- let pressure;
475
- function initFramebuffers() {
476
- const simRes = getResolution(config.simResolution);
477
- const dyeRes = getResolution(dyeResolution);
478
- const texType = ext.halfFloatTexType;
479
- const rgba = ext.formatRGBA;
480
- const rg = ext.formatRG;
481
- const r = ext.formatR;
482
- const filtering = ext.supportLinearFiltering ? gl.LINEAR : gl.NEAREST;
483
- gl.disable(gl.BLEND);
484
- dye = dye
485
- ? resizeDoubleFBO(dye, dyeRes.width, dyeRes.height, rgba.internalFormat, rgba.format, texType, filtering)
486
- : createDoubleFBO(dyeRes.width, dyeRes.height, rgba.internalFormat, rgba.format, texType, filtering);
487
- velocity = velocity
488
- ? resizeDoubleFBO(velocity, simRes.width, simRes.height, rg.internalFormat, rg.format, texType, filtering)
489
- : createDoubleFBO(simRes.width, simRes.height, rg.internalFormat, rg.format, texType, filtering);
490
- divergence = createFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
491
- curl = createFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
492
- pressure = createDoubleFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
493
- }
494
- displayMaterial.setKeywords(shading ? ['SHADING'] : []);
495
- initFramebuffers();
496
- let lastUpdateTime = Date.now();
497
- let colorUpdateTimer = 0;
498
- // Frame loop
499
- function updateFrame() {
500
- if (!active)
501
- return;
502
- const dt = calcDeltaTime();
503
- if (resizeCanvas())
504
- initFramebuffers();
505
- updateColors(dt);
506
- applyInputs();
507
- step(dt);
508
- render();
509
- rafId = requestAnimationFrame(updateFrame);
510
- }
511
- function calcDeltaTime() {
512
- const now = Date.now();
513
- const dt = Math.min((now - lastUpdateTime) / 1000, 0.016666);
514
- lastUpdateTime = now;
515
- return dt;
516
- }
517
- function resizeCanvas() {
518
- const width = scaleByPixelRatio(canvas.clientWidth);
519
- const height = scaleByPixelRatio(canvas.clientHeight);
520
- if (canvas.width !== width || canvas.height !== height) {
521
- canvas.width = width;
522
- canvas.height = height;
523
- return true;
524
- }
525
- return false;
526
- }
527
- function updateColors(dt) {
528
- colorUpdateTimer += dt * config.colorUpdateSpeed;
529
- if (colorUpdateTimer >= 1) {
530
- colorUpdateTimer = wrap(colorUpdateTimer, 0, 1);
531
- pointer.color = generateColor();
532
- }
533
- }
534
- function applyInputs() {
535
- if (pointer.moved) {
536
- pointer.moved = false;
537
- splatPointer();
538
- }
539
- }
540
- function step(dt) {
541
- gl.disable(gl.BLEND);
542
- curlProgram.bind();
543
- gl.uniform2f(curlProgram.uniforms['texelSize'], velocity.texelSizeX, velocity.texelSizeY);
544
- gl.uniform1i(curlProgram.uniforms['uVelocity'], velocity.read.attach(0));
545
- blit(curl);
546
- vorticityProgram.bind();
547
- gl.uniform2f(vorticityProgram.uniforms['texelSize'], velocity.texelSizeX, velocity.texelSizeY);
548
- gl.uniform1i(vorticityProgram.uniforms['uVelocity'], velocity.read.attach(0));
549
- gl.uniform1i(vorticityProgram.uniforms['uCurl'], curl.attach(1));
550
- gl.uniform1f(vorticityProgram.uniforms['curl'], config.curl);
551
- gl.uniform1f(vorticityProgram.uniforms['dt'], dt);
552
- blit(velocity.write);
553
- velocity.swap();
554
- divergenceProgram.bind();
555
- gl.uniform2f(divergenceProgram.uniforms['texelSize'], velocity.texelSizeX, velocity.texelSizeY);
556
- gl.uniform1i(divergenceProgram.uniforms['uVelocity'], velocity.read.attach(0));
557
- blit(divergence);
558
- clearProgram.bind();
559
- gl.uniform1i(clearProgram.uniforms['uTexture'], pressure.read.attach(0));
560
- gl.uniform1f(clearProgram.uniforms['value'], config.pressure);
561
- blit(pressure.write);
562
- pressure.swap();
563
- pressureProgram.bind();
564
- gl.uniform2f(pressureProgram.uniforms['texelSize'], velocity.texelSizeX, velocity.texelSizeY);
565
- gl.uniform1i(pressureProgram.uniforms['uDivergence'], divergence.attach(0));
566
- for (let i = 0; i < config.pressureIterations; i++) {
567
- gl.uniform1i(pressureProgram.uniforms['uPressure'], pressure.read.attach(1));
568
- blit(pressure.write);
569
- pressure.swap();
570
- }
571
- gradientSubtractProgram.bind();
572
- gl.uniform2f(gradientSubtractProgram.uniforms['texelSize'], velocity.texelSizeX, velocity.texelSizeY);
573
- gl.uniform1i(gradientSubtractProgram.uniforms['uPressure'], pressure.read.attach(0));
574
- gl.uniform1i(gradientSubtractProgram.uniforms['uVelocity'], velocity.read.attach(1));
575
- blit(velocity.write);
576
- velocity.swap();
577
- advectionProgram.bind();
578
- gl.uniform2f(advectionProgram.uniforms['texelSize'], velocity.texelSizeX, velocity.texelSizeY);
579
- if (!ext.supportLinearFiltering) {
580
- gl.uniform2f(advectionProgram.uniforms['dyeTexelSize'], velocity.texelSizeX, velocity.texelSizeY);
581
- }
582
- const velocityId = velocity.read.attach(0);
583
- gl.uniform1i(advectionProgram.uniforms['uVelocity'], velocityId);
584
- gl.uniform1i(advectionProgram.uniforms['uSource'], velocityId);
585
- gl.uniform1f(advectionProgram.uniforms['dt'], dt);
586
- gl.uniform1f(advectionProgram.uniforms['dissipation'], config.velocityDissipation);
587
- blit(velocity.write);
588
- velocity.swap();
589
- if (!ext.supportLinearFiltering) {
590
- gl.uniform2f(advectionProgram.uniforms['dyeTexelSize'], dye.texelSizeX, dye.texelSizeY);
591
- }
592
- gl.uniform1i(advectionProgram.uniforms['uVelocity'], velocity.read.attach(0));
593
- gl.uniform1i(advectionProgram.uniforms['uSource'], dye.read.attach(1));
594
- gl.uniform1f(advectionProgram.uniforms['dissipation'], config.densityDissipation);
595
- blit(dye.write);
596
- dye.swap();
597
- }
598
- function render() {
599
- gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
600
- gl.enable(gl.BLEND);
601
- displayMaterial.bind();
602
- if (shading) {
603
- gl.uniform2f(displayMaterial.uniforms['texelSize'], 1 / gl.drawingBufferWidth, 1 / gl.drawingBufferHeight);
604
- }
605
- gl.uniform1i(displayMaterial.uniforms['uTexture'], dye.read.attach(0));
606
- blit(null);
607
- }
608
- // Splats
609
- function splatPointer() {
610
- const dx = pointer.deltaX * config.splatForce;
611
- const dy = pointer.deltaY * config.splatForce;
612
- splat(pointer.texcoordX, pointer.texcoordY, dx, dy, pointer.color);
613
- }
614
- function clickSplat() {
615
- const color = generateColor();
616
- color.r *= 10;
617
- color.g *= 10;
618
- color.b *= 10;
619
- const dx = 10 * (Math.random() - 0.5);
620
- const dy = 30 * (Math.random() - 0.5);
621
- splat(pointer.texcoordX, pointer.texcoordY, dx, dy, color);
622
- }
623
- function splat(x, y, dx, dy, color) {
624
- splatProgram.bind();
625
- gl.uniform1i(splatProgram.uniforms['uTarget'], velocity.read.attach(0));
626
- gl.uniform1f(splatProgram.uniforms['aspectRatio'], canvas.width / canvas.height);
627
- gl.uniform2f(splatProgram.uniforms['point'], x, y);
628
- gl.uniform3f(splatProgram.uniforms['color'], dx, dy, 0);
629
- gl.uniform1f(splatProgram.uniforms['radius'], correctRadius(config.splatRadius / 100));
630
- blit(velocity.write);
631
- velocity.swap();
632
- gl.uniform1i(splatProgram.uniforms['uTarget'], dye.read.attach(0));
633
- gl.uniform3f(splatProgram.uniforms['color'], color.r, color.g, color.b);
634
- blit(dye.write);
635
- dye.swap();
636
- }
637
- function correctRadius(radius) {
638
- const aspectRatio = canvas.width / canvas.height;
639
- return aspectRatio > 1 ? radius * aspectRatio : radius;
640
- }
641
- // Pointer
642
- function pointerDown(posX, posY) {
643
- pointer.moved = false;
644
- pointer.texcoordX = posX / canvas.width;
645
- pointer.texcoordY = 1 - posY / canvas.height;
646
- pointer.prevTexcoordX = pointer.texcoordX;
647
- pointer.prevTexcoordY = pointer.texcoordY;
648
- pointer.deltaX = 0;
649
- pointer.deltaY = 0;
650
- pointer.color = generateColor();
651
- }
652
- function pointerMove(posX, posY, color) {
653
- pointer.prevTexcoordX = pointer.texcoordX;
654
- pointer.prevTexcoordY = pointer.texcoordY;
655
- pointer.texcoordX = posX / canvas.width;
656
- pointer.texcoordY = 1 - posY / canvas.height;
657
- pointer.deltaX = correctDeltaX(pointer.texcoordX - pointer.prevTexcoordX);
658
- pointer.deltaY = correctDeltaY(pointer.texcoordY - pointer.prevTexcoordY);
659
- pointer.moved = Math.abs(pointer.deltaX) > 0 || Math.abs(pointer.deltaY) > 0;
660
- pointer.color = color;
661
- }
662
- function correctDeltaX(delta) {
663
- const aspectRatio = canvas.width / canvas.height;
664
- return aspectRatio < 1 ? delta * aspectRatio : delta;
665
- }
666
- function correctDeltaY(delta) {
667
- const aspectRatio = canvas.width / canvas.height;
668
- return aspectRatio > 1 ? delta / aspectRatio : delta;
669
- }
670
- // Colours
671
- function hexToRGB(hex) {
672
- let val = hex.replace('#', '');
673
- if (val.length === 3)
674
- val = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];
675
- return {
676
- r: (Number.parseInt(val.slice(0, 2), 16) / 255) * 0.15,
677
- g: (Number.parseInt(val.slice(2, 4), 16) / 255) * 0.15,
678
- b: (Number.parseInt(val.slice(4, 6), 16) / 255) * 0.15,
679
- };
680
- }
681
- function generateColor() {
682
- if (!config.rainbow)
683
- return hexToRGB(config.color);
684
- const c = hsvToRgb(Math.random(), 1, 1);
685
- c.r *= 0.15;
686
- c.g *= 0.15;
687
- c.b *= 0.15;
688
- return c;
689
- }
690
- function hsvToRgb(h, s, v) {
691
- const i = Math.floor(h * 6);
692
- const f = h * 6 - i;
693
- const p = v * (1 - s);
694
- const q = v * (1 - f * s);
695
- const t = v * (1 - (1 - f) * s);
696
- switch (i % 6) {
697
- case 0:
698
- return { r: v, g: t, b: p };
699
- case 1:
700
- return { r: q, g: v, b: p };
701
- case 2:
702
- return { r: p, g: v, b: t };
703
- case 3:
704
- return { r: p, g: q, b: v };
705
- case 4:
706
- return { r: t, g: p, b: v };
707
- default:
708
- return { r: v, g: p, b: q };
709
- }
710
- }
711
- function wrap(value, min, max) {
712
- const range = max - min;
713
- if (range === 0)
714
- return min;
715
- return ((value - min) % range) + min;
716
- }
717
- function getResolution(resolution) {
718
- let aspectRatio = gl.drawingBufferWidth / gl.drawingBufferHeight;
719
- if (aspectRatio < 1)
720
- aspectRatio = 1 / aspectRatio;
721
- const min = Math.round(resolution);
722
- const max = Math.round(resolution * aspectRatio);
723
- return gl.drawingBufferWidth > gl.drawingBufferHeight ? { width: max, height: min } : { width: min, height: max };
724
- }
725
- function scaleByPixelRatio(input) {
726
- return Math.floor(input * (window.devicePixelRatio || 1));
727
- }
728
- function hashCode(s) {
729
- let hash = 0;
730
- for (let i = 0; i < s.length; i++) {
731
- hash = (hash << 5) - hash + s.charCodeAt(i);
732
- hash |= 0;
733
- }
734
- return hash;
735
- }
736
- // Events + boot
737
- let firstMoveHandled = false;
738
- // Coordinates are taken relative to the canvas box: identical to the
739
- // raw client position for the fullscreen overlay, and it makes a
740
- // contained canvas track the pointer correctly too.
741
- const toLocal = (clientX, clientY) => {
742
- const rect = canvas.getBoundingClientRect();
743
- return { x: scaleByPixelRatio(clientX - rect.left), y: scaleByPixelRatio(clientY - rect.top) };
744
- };
745
- const onMouseDown = (e) => {
746
- const pos = toLocal(e.clientX, e.clientY);
747
- pointerDown(pos.x, pos.y);
748
- clickSplat();
749
- };
750
- const onMouseMove = (e) => {
751
- const pos = toLocal(e.clientX, e.clientY);
752
- const color = firstMoveHandled ? pointer.color : generateColor();
753
- firstMoveHandled = true;
754
- pointerMove(pos.x, pos.y, color);
755
- };
756
- const onTouchStart = (e) => {
757
- const t = e.targetTouches[0];
758
- if (!t)
759
- return;
760
- const pos = toLocal(t.clientX, t.clientY);
761
- pointerDown(pos.x, pos.y);
762
- };
763
- const onTouchMove = (e) => {
764
- const t = e.targetTouches[0];
765
- if (!t)
766
- return;
767
- const pos = toLocal(t.clientX, t.clientY);
768
- pointerMove(pos.x, pos.y, pointer.color);
769
- };
770
- window.addEventListener('mousedown', onMouseDown);
771
- window.addEventListener('mousemove', onMouseMove);
772
- window.addEventListener('touchstart', onTouchStart, { passive: true });
773
- window.addEventListener('touchmove', onTouchMove, { passive: true });
774
- updateFrame();
775
- return () => {
776
- active = false;
777
- cancelAnimationFrame(rafId);
778
- window.removeEventListener('mousedown', onMouseDown);
779
- window.removeEventListener('mousemove', onMouseMove);
780
- window.removeEventListener('touchstart', onTouchStart);
781
- window.removeEventListener('touchmove', onTouchMove);
782
- // The context is NOT lost here on purpose — input changes reboot the
783
- // sim on the same canvas, and a lost context can't be re-acquired.
784
- };
354
+ gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
355
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
356
+ -1,
357
+ -1,
358
+ -1,
359
+ 1,
360
+ 1,
361
+ 1,
362
+ 1,
363
+ -1
364
+ ]), gl.STATIC_DRAW);
365
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer());
366
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([
367
+ 0,
368
+ 1,
369
+ 2,
370
+ 0,
371
+ 2,
372
+ 3
373
+ ]), gl.STATIC_DRAW);
374
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
375
+ gl.enableVertexAttribArray(0);
376
+ function blit(target, clear = false) {
377
+ if (target === null) {
378
+ gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
379
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
380
+ } else {
381
+ gl.viewport(0, 0, target.width, target.height);
382
+ gl.bindFramebuffer(gl.FRAMEBUFFER, target.fbo);
383
+ }
384
+ if (clear) {
385
+ gl.clearColor(0, 0, 0, 1);
386
+ gl.clear(gl.COLOR_BUFFER_BIT);
387
+ }
388
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);
389
+ }
390
+ function createFBO(w, h, internalFormat, format, type, param) {
391
+ gl.activeTexture(gl.TEXTURE0);
392
+ const texture = gl.createTexture();
393
+ gl.bindTexture(gl.TEXTURE_2D, texture);
394
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, param);
395
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, param);
396
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
397
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
398
+ gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, w, h, 0, format, type, null);
399
+ const fbo = gl.createFramebuffer();
400
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
401
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
402
+ gl.viewport(0, 0, w, h);
403
+ gl.clear(gl.COLOR_BUFFER_BIT);
404
+ return {
405
+ texture,
406
+ fbo,
407
+ width: w,
408
+ height: h,
409
+ texelSizeX: 1 / w,
410
+ texelSizeY: 1 / h,
411
+ attach(id) {
412
+ gl.activeTexture(gl.TEXTURE0 + id);
413
+ gl.bindTexture(gl.TEXTURE_2D, texture);
414
+ return id;
415
+ }
416
+ };
417
+ }
418
+ function createDoubleFBO(w, h, internalFormat, format, type, param) {
419
+ let fbo1 = createFBO(w, h, internalFormat, format, type, param);
420
+ let fbo2 = createFBO(w, h, internalFormat, format, type, param);
421
+ return {
422
+ width: w,
423
+ height: h,
424
+ texelSizeX: fbo1.texelSizeX,
425
+ texelSizeY: fbo1.texelSizeY,
426
+ get read() {
427
+ return fbo1;
428
+ },
429
+ set read(value) {
430
+ fbo1 = value;
431
+ },
432
+ get write() {
433
+ return fbo2;
434
+ },
435
+ set write(value) {
436
+ fbo2 = value;
437
+ },
438
+ swap() {
439
+ const temp = fbo1;
440
+ fbo1 = fbo2;
441
+ fbo2 = temp;
442
+ }
443
+ };
444
+ }
445
+ function resizeFBO(target, w, h, internalFormat, format, type, param) {
446
+ const newFBO = createFBO(w, h, internalFormat, format, type, param);
447
+ copyProgram.bind();
448
+ gl.uniform1i(copyProgram.uniforms["uTexture"], target.attach(0));
449
+ blit(newFBO);
450
+ return newFBO;
451
+ }
452
+ function resizeDoubleFBO(target, w, h, internalFormat, format, type, param) {
453
+ if (target.width === w && target.height === h) return target;
454
+ target.read = resizeFBO(target.read, w, h, internalFormat, format, type, param);
455
+ target.write = createFBO(w, h, internalFormat, format, type, param);
456
+ target.width = w;
457
+ target.height = h;
458
+ target.texelSizeX = 1 / w;
459
+ target.texelSizeY = 1 / h;
460
+ return target;
461
+ }
462
+ const copyProgram = new ShaderProgram(baseVertexShader, copyShader);
463
+ const clearProgram = new ShaderProgram(baseVertexShader, clearShader);
464
+ const splatProgram = new ShaderProgram(baseVertexShader, splatShader);
465
+ const advectionProgram = new ShaderProgram(baseVertexShader, advectionShader);
466
+ const divergenceProgram = new ShaderProgram(baseVertexShader, divergenceShader);
467
+ const curlProgram = new ShaderProgram(baseVertexShader, curlShader);
468
+ const vorticityProgram = new ShaderProgram(baseVertexShader, vorticityShader);
469
+ const pressureProgram = new ShaderProgram(baseVertexShader, pressureShader);
470
+ const gradientSubtractProgram = new ShaderProgram(baseVertexShader, gradientSubtractShader);
471
+ const displayMaterial = new DisplayMaterial(baseVertexShader, displayShaderSource);
472
+ let dye;
473
+ let velocity;
474
+ let divergence;
475
+ let curl;
476
+ let pressure;
477
+ function initFramebuffers() {
478
+ const simRes = getResolution(config.simResolution);
479
+ const dyeRes = getResolution(dyeResolution);
480
+ const texType = ext.halfFloatTexType;
481
+ const rgba = ext.formatRGBA;
482
+ const rg = ext.formatRG;
483
+ const r = ext.formatR;
484
+ const filtering = ext.supportLinearFiltering ? gl.LINEAR : gl.NEAREST;
485
+ gl.disable(gl.BLEND);
486
+ dye = dye ? resizeDoubleFBO(dye, dyeRes.width, dyeRes.height, rgba.internalFormat, rgba.format, texType, filtering) : createDoubleFBO(dyeRes.width, dyeRes.height, rgba.internalFormat, rgba.format, texType, filtering);
487
+ velocity = velocity ? resizeDoubleFBO(velocity, simRes.width, simRes.height, rg.internalFormat, rg.format, texType, filtering) : createDoubleFBO(simRes.width, simRes.height, rg.internalFormat, rg.format, texType, filtering);
488
+ divergence = createFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
489
+ curl = createFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
490
+ pressure = createDoubleFBO(simRes.width, simRes.height, r.internalFormat, r.format, texType, gl.NEAREST);
491
+ }
492
+ displayMaterial.setKeywords(shading ? ["SHADING"] : []);
493
+ initFramebuffers();
494
+ let lastUpdateTime = Date.now();
495
+ let colorUpdateTimer = 0;
496
+ function updateFrame() {
497
+ if (!active) return;
498
+ const dt = calcDeltaTime();
499
+ if (resizeCanvas()) initFramebuffers();
500
+ updateColors(dt);
501
+ applyInputs();
502
+ step(dt);
503
+ render();
504
+ rafId = requestAnimationFrame(updateFrame);
505
+ }
506
+ function calcDeltaTime() {
507
+ const now = Date.now();
508
+ const dt = Math.min((now - lastUpdateTime) / 1e3, .016666);
509
+ lastUpdateTime = now;
510
+ return dt;
511
+ }
512
+ function resizeCanvas() {
513
+ const width = scaleByPixelRatio(canvas.clientWidth);
514
+ const height = scaleByPixelRatio(canvas.clientHeight);
515
+ if (canvas.width !== width || canvas.height !== height) {
516
+ canvas.width = width;
517
+ canvas.height = height;
518
+ return true;
519
+ }
520
+ return false;
521
+ }
522
+ function updateColors(dt) {
523
+ colorUpdateTimer += dt * config.colorUpdateSpeed;
524
+ if (colorUpdateTimer >= 1) {
525
+ colorUpdateTimer = wrap(colorUpdateTimer, 0, 1);
526
+ pointer.color = generateColor();
527
+ }
528
+ }
529
+ function applyInputs() {
530
+ if (pointer.moved) {
531
+ pointer.moved = false;
532
+ splatPointer();
533
+ }
534
+ }
535
+ function step(dt) {
536
+ gl.disable(gl.BLEND);
537
+ curlProgram.bind();
538
+ gl.uniform2f(curlProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
539
+ gl.uniform1i(curlProgram.uniforms["uVelocity"], velocity.read.attach(0));
540
+ blit(curl);
541
+ vorticityProgram.bind();
542
+ gl.uniform2f(vorticityProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
543
+ gl.uniform1i(vorticityProgram.uniforms["uVelocity"], velocity.read.attach(0));
544
+ gl.uniform1i(vorticityProgram.uniforms["uCurl"], curl.attach(1));
545
+ gl.uniform1f(vorticityProgram.uniforms["curl"], config.curl);
546
+ gl.uniform1f(vorticityProgram.uniforms["dt"], dt);
547
+ blit(velocity.write);
548
+ velocity.swap();
549
+ divergenceProgram.bind();
550
+ gl.uniform2f(divergenceProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
551
+ gl.uniform1i(divergenceProgram.uniforms["uVelocity"], velocity.read.attach(0));
552
+ blit(divergence);
553
+ clearProgram.bind();
554
+ gl.uniform1i(clearProgram.uniforms["uTexture"], pressure.read.attach(0));
555
+ gl.uniform1f(clearProgram.uniforms["value"], config.pressure);
556
+ blit(pressure.write);
557
+ pressure.swap();
558
+ pressureProgram.bind();
559
+ gl.uniform2f(pressureProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
560
+ gl.uniform1i(pressureProgram.uniforms["uDivergence"], divergence.attach(0));
561
+ for (let i = 0; i < config.pressureIterations; i++) {
562
+ gl.uniform1i(pressureProgram.uniforms["uPressure"], pressure.read.attach(1));
563
+ blit(pressure.write);
564
+ pressure.swap();
565
+ }
566
+ gradientSubtractProgram.bind();
567
+ gl.uniform2f(gradientSubtractProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
568
+ gl.uniform1i(gradientSubtractProgram.uniforms["uPressure"], pressure.read.attach(0));
569
+ gl.uniform1i(gradientSubtractProgram.uniforms["uVelocity"], velocity.read.attach(1));
570
+ blit(velocity.write);
571
+ velocity.swap();
572
+ advectionProgram.bind();
573
+ gl.uniform2f(advectionProgram.uniforms["texelSize"], velocity.texelSizeX, velocity.texelSizeY);
574
+ if (!ext.supportLinearFiltering) gl.uniform2f(advectionProgram.uniforms["dyeTexelSize"], velocity.texelSizeX, velocity.texelSizeY);
575
+ const velocityId = velocity.read.attach(0);
576
+ gl.uniform1i(advectionProgram.uniforms["uVelocity"], velocityId);
577
+ gl.uniform1i(advectionProgram.uniforms["uSource"], velocityId);
578
+ gl.uniform1f(advectionProgram.uniforms["dt"], dt);
579
+ gl.uniform1f(advectionProgram.uniforms["dissipation"], config.velocityDissipation);
580
+ blit(velocity.write);
581
+ velocity.swap();
582
+ if (!ext.supportLinearFiltering) gl.uniform2f(advectionProgram.uniforms["dyeTexelSize"], dye.texelSizeX, dye.texelSizeY);
583
+ gl.uniform1i(advectionProgram.uniforms["uVelocity"], velocity.read.attach(0));
584
+ gl.uniform1i(advectionProgram.uniforms["uSource"], dye.read.attach(1));
585
+ gl.uniform1f(advectionProgram.uniforms["dissipation"], config.densityDissipation);
586
+ blit(dye.write);
587
+ dye.swap();
588
+ }
589
+ function render() {
590
+ gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
591
+ gl.enable(gl.BLEND);
592
+ displayMaterial.bind();
593
+ if (shading) gl.uniform2f(displayMaterial.uniforms["texelSize"], 1 / gl.drawingBufferWidth, 1 / gl.drawingBufferHeight);
594
+ gl.uniform1i(displayMaterial.uniforms["uTexture"], dye.read.attach(0));
595
+ blit(null);
596
+ }
597
+ function splatPointer() {
598
+ const dx = pointer.deltaX * config.splatForce;
599
+ const dy = pointer.deltaY * config.splatForce;
600
+ splat(pointer.texcoordX, pointer.texcoordY, dx, dy, pointer.color);
601
+ }
602
+ function clickSplat() {
603
+ const color = generateColor();
604
+ color.r *= 10;
605
+ color.g *= 10;
606
+ color.b *= 10;
607
+ const dx = 10 * (Math.random() - .5);
608
+ const dy = 30 * (Math.random() - .5);
609
+ splat(pointer.texcoordX, pointer.texcoordY, dx, dy, color);
610
+ }
611
+ function splat(x, y, dx, dy, color) {
612
+ splatProgram.bind();
613
+ gl.uniform1i(splatProgram.uniforms["uTarget"], velocity.read.attach(0));
614
+ gl.uniform1f(splatProgram.uniforms["aspectRatio"], canvas.width / canvas.height);
615
+ gl.uniform2f(splatProgram.uniforms["point"], x, y);
616
+ gl.uniform3f(splatProgram.uniforms["color"], dx, dy, 0);
617
+ gl.uniform1f(splatProgram.uniforms["radius"], correctRadius(config.splatRadius / 100));
618
+ blit(velocity.write);
619
+ velocity.swap();
620
+ gl.uniform1i(splatProgram.uniforms["uTarget"], dye.read.attach(0));
621
+ gl.uniform3f(splatProgram.uniforms["color"], color.r, color.g, color.b);
622
+ blit(dye.write);
623
+ dye.swap();
624
+ }
625
+ function correctRadius(radius) {
626
+ const aspectRatio = canvas.width / canvas.height;
627
+ return aspectRatio > 1 ? radius * aspectRatio : radius;
628
+ }
629
+ function pointerDown(posX, posY) {
630
+ pointer.moved = false;
631
+ pointer.texcoordX = posX / canvas.width;
632
+ pointer.texcoordY = 1 - posY / canvas.height;
633
+ pointer.prevTexcoordX = pointer.texcoordX;
634
+ pointer.prevTexcoordY = pointer.texcoordY;
635
+ pointer.deltaX = 0;
636
+ pointer.deltaY = 0;
637
+ pointer.color = generateColor();
638
+ }
639
+ function pointerMove(posX, posY, color) {
640
+ pointer.prevTexcoordX = pointer.texcoordX;
641
+ pointer.prevTexcoordY = pointer.texcoordY;
642
+ pointer.texcoordX = posX / canvas.width;
643
+ pointer.texcoordY = 1 - posY / canvas.height;
644
+ pointer.deltaX = correctDeltaX(pointer.texcoordX - pointer.prevTexcoordX);
645
+ pointer.deltaY = correctDeltaY(pointer.texcoordY - pointer.prevTexcoordY);
646
+ pointer.moved = Math.abs(pointer.deltaX) > 0 || Math.abs(pointer.deltaY) > 0;
647
+ pointer.color = color;
648
+ }
649
+ function correctDeltaX(delta) {
650
+ const aspectRatio = canvas.width / canvas.height;
651
+ return aspectRatio < 1 ? delta * aspectRatio : delta;
652
+ }
653
+ function correctDeltaY(delta) {
654
+ const aspectRatio = canvas.width / canvas.height;
655
+ return aspectRatio > 1 ? delta / aspectRatio : delta;
656
+ }
657
+ function hexToRGB(hex) {
658
+ let val = hex.replace("#", "");
659
+ if (val.length === 3) val = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];
660
+ return {
661
+ r: Number.parseInt(val.slice(0, 2), 16) / 255 * .15,
662
+ g: Number.parseInt(val.slice(2, 4), 16) / 255 * .15,
663
+ b: Number.parseInt(val.slice(4, 6), 16) / 255 * .15
664
+ };
665
+ }
666
+ function generateColor() {
667
+ if (!config.rainbow) return hexToRGB(config.color);
668
+ const c = hsvToRgb(Math.random(), 1, 1);
669
+ c.r *= .15;
670
+ c.g *= .15;
671
+ c.b *= .15;
672
+ return c;
673
+ }
674
+ function hsvToRgb(h, s, v) {
675
+ const i = Math.floor(h * 6);
676
+ const f = h * 6 - i;
677
+ const p = v * (1 - s);
678
+ const q = v * (1 - f * s);
679
+ const t = v * (1 - (1 - f) * s);
680
+ switch (i % 6) {
681
+ case 0: return {
682
+ r: v,
683
+ g: t,
684
+ b: p
685
+ };
686
+ case 1: return {
687
+ r: q,
688
+ g: v,
689
+ b: p
690
+ };
691
+ case 2: return {
692
+ r: p,
693
+ g: v,
694
+ b: t
695
+ };
696
+ case 3: return {
697
+ r: p,
698
+ g: q,
699
+ b: v
700
+ };
701
+ case 4: return {
702
+ r: t,
703
+ g: p,
704
+ b: v
705
+ };
706
+ default: return {
707
+ r: v,
708
+ g: p,
709
+ b: q
710
+ };
711
+ }
712
+ }
713
+ function wrap(value, min, max) {
714
+ const range = max - min;
715
+ if (range === 0) return min;
716
+ return (value - min) % range + min;
717
+ }
718
+ function getResolution(resolution) {
719
+ let aspectRatio = gl.drawingBufferWidth / gl.drawingBufferHeight;
720
+ if (aspectRatio < 1) aspectRatio = 1 / aspectRatio;
721
+ const min = Math.round(resolution);
722
+ const max = Math.round(resolution * aspectRatio);
723
+ return gl.drawingBufferWidth > gl.drawingBufferHeight ? {
724
+ width: max,
725
+ height: min
726
+ } : {
727
+ width: min,
728
+ height: max
729
+ };
730
+ }
731
+ function scaleByPixelRatio(input) {
732
+ return Math.floor(input * (window.devicePixelRatio || 1));
733
+ }
734
+ function hashCode(s) {
735
+ let hash = 0;
736
+ for (let i = 0; i < s.length; i++) {
737
+ hash = (hash << 5) - hash + s.charCodeAt(i);
738
+ hash |= 0;
739
+ }
740
+ return hash;
741
+ }
742
+ let firstMoveHandled = false;
743
+ const toLocal = (clientX, clientY) => {
744
+ const rect = canvas.getBoundingClientRect();
745
+ return {
746
+ x: scaleByPixelRatio(clientX - rect.left),
747
+ y: scaleByPixelRatio(clientY - rect.top)
748
+ };
749
+ };
750
+ const onMouseDown = (e) => {
751
+ const pos = toLocal(e.clientX, e.clientY);
752
+ pointerDown(pos.x, pos.y);
753
+ clickSplat();
754
+ };
755
+ const onMouseMove = (e) => {
756
+ const pos = toLocal(e.clientX, e.clientY);
757
+ const color = firstMoveHandled ? pointer.color : generateColor();
758
+ firstMoveHandled = true;
759
+ pointerMove(pos.x, pos.y, color);
760
+ };
761
+ const onTouchStart = (e) => {
762
+ const t = e.targetTouches[0];
763
+ if (!t) return;
764
+ const pos = toLocal(t.clientX, t.clientY);
765
+ pointerDown(pos.x, pos.y);
766
+ };
767
+ const onTouchMove = (e) => {
768
+ const t = e.targetTouches[0];
769
+ if (!t) return;
770
+ const pos = toLocal(t.clientX, t.clientY);
771
+ pointerMove(pos.x, pos.y, pointer.color);
772
+ };
773
+ window.addEventListener("mousedown", onMouseDown);
774
+ window.addEventListener("mousemove", onMouseMove);
775
+ window.addEventListener("touchstart", onTouchStart, { passive: true });
776
+ window.addEventListener("touchmove", onTouchMove, { passive: true });
777
+ updateFrame();
778
+ return () => {
779
+ active = false;
780
+ cancelAnimationFrame(rafId);
781
+ window.removeEventListener("mousedown", onMouseDown);
782
+ window.removeEventListener("mousemove", onMouseMove);
783
+ window.removeEventListener("touchstart", onTouchStart);
784
+ window.removeEventListener("touchmove", onTouchMove);
785
+ };
785
786
  }
786
- // WebGL context bootstrap
787
787
  function getWebGLContext(canvas) {
788
- const params = {
789
- alpha: true,
790
- depth: false,
791
- stencil: false,
792
- antialias: false,
793
- preserveDrawingBuffer: false,
794
- };
795
- const gl2 = canvas.getContext('webgl2', params);
796
- const gl = gl2 ?? canvas.getContext('webgl', params);
797
- if (!gl)
798
- return null;
799
- const isWebGL2 = !!gl2;
800
- let halfFloat = null;
801
- let supportLinearFiltering;
802
- if (isWebGL2) {
803
- gl.getExtension('EXT_color_buffer_float');
804
- supportLinearFiltering = !!gl.getExtension('OES_texture_float_linear');
805
- }
806
- else {
807
- halfFloat = gl.getExtension('OES_texture_half_float');
808
- supportLinearFiltering = !!gl.getExtension('OES_texture_half_float_linear');
809
- }
810
- gl.clearColor(0, 0, 0, 1);
811
- const halfFloatTexType = isWebGL2
812
- ? gl.HALF_FLOAT
813
- : (halfFloat?.HALF_FLOAT_OES ?? gl.UNSIGNED_BYTE);
814
- let formatRGBA;
815
- let formatRG;
816
- let formatR;
817
- if (isWebGL2) {
818
- const g2 = gl;
819
- formatRGBA = getSupportedFormat(g2, g2.RGBA16F, g2.RGBA, halfFloatTexType);
820
- formatRG = getSupportedFormat(g2, g2.RG16F, g2.RG, halfFloatTexType);
821
- formatR = getSupportedFormat(g2, g2.R16F, g2.RED, halfFloatTexType);
822
- }
823
- else {
824
- formatRGBA = getSupportedFormat(gl, gl.RGBA, gl.RGBA, halfFloatTexType);
825
- formatRG = formatRGBA;
826
- formatR = formatRGBA;
827
- }
828
- if (!formatRGBA || !formatRG || !formatR)
829
- return null;
830
- return { gl, ext: { formatRGBA, formatRG, formatR, halfFloatTexType, supportLinearFiltering } };
788
+ const params = {
789
+ alpha: true,
790
+ depth: false,
791
+ stencil: false,
792
+ antialias: false,
793
+ preserveDrawingBuffer: false
794
+ };
795
+ const gl2 = canvas.getContext("webgl2", params);
796
+ const gl = gl2 ?? canvas.getContext("webgl", params);
797
+ if (!gl) return null;
798
+ const isWebGL2 = !!gl2;
799
+ let halfFloat = null;
800
+ let supportLinearFiltering;
801
+ if (isWebGL2) {
802
+ gl.getExtension("EXT_color_buffer_float");
803
+ supportLinearFiltering = !!gl.getExtension("OES_texture_float_linear");
804
+ } else {
805
+ halfFloat = gl.getExtension("OES_texture_half_float");
806
+ supportLinearFiltering = !!gl.getExtension("OES_texture_half_float_linear");
807
+ }
808
+ gl.clearColor(0, 0, 0, 1);
809
+ const halfFloatTexType = isWebGL2 ? gl.HALF_FLOAT : halfFloat?.HALF_FLOAT_OES ?? gl.UNSIGNED_BYTE;
810
+ let formatRGBA;
811
+ let formatRG;
812
+ let formatR;
813
+ if (isWebGL2) {
814
+ const g2 = gl;
815
+ formatRGBA = getSupportedFormat(g2, g2.RGBA16F, g2.RGBA, halfFloatTexType);
816
+ formatRG = getSupportedFormat(g2, g2.RG16F, g2.RG, halfFloatTexType);
817
+ formatR = getSupportedFormat(g2, g2.R16F, g2.RED, halfFloatTexType);
818
+ } else {
819
+ formatRGBA = getSupportedFormat(gl, gl.RGBA, gl.RGBA, halfFloatTexType);
820
+ formatRG = formatRGBA;
821
+ formatR = formatRGBA;
822
+ }
823
+ if (!formatRGBA || !formatRG || !formatR) return null;
824
+ return {
825
+ gl,
826
+ ext: {
827
+ formatRGBA,
828
+ formatRG,
829
+ formatR,
830
+ halfFloatTexType,
831
+ supportLinearFiltering
832
+ }
833
+ };
831
834
  }
832
835
  function getSupportedFormat(gl, internalFormat, format, type) {
833
- if (!supportRenderTextureFormat(gl, internalFormat, format, type)) {
834
- const g2 = gl;
835
- switch (internalFormat) {
836
- case g2.R16F:
837
- return getSupportedFormat(gl, g2.RG16F, g2.RG, type);
838
- case g2.RG16F:
839
- return getSupportedFormat(gl, g2.RGBA16F, g2.RGBA, type);
840
- default:
841
- return null;
842
- }
843
- }
844
- return { internalFormat, format };
836
+ if (!supportRenderTextureFormat(gl, internalFormat, format, type)) {
837
+ const g2 = gl;
838
+ switch (internalFormat) {
839
+ case g2.R16F: return getSupportedFormat(gl, g2.RG16F, g2.RG, type);
840
+ case g2.RG16F: return getSupportedFormat(gl, g2.RGBA16F, g2.RGBA, type);
841
+ default: return null;
842
+ }
843
+ }
844
+ return {
845
+ internalFormat,
846
+ format
847
+ };
845
848
  }
846
849
  function supportRenderTextureFormat(gl, internalFormat, format, type) {
847
- const texture = gl.createTexture();
848
- gl.bindTexture(gl.TEXTURE_2D, texture);
849
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
850
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
851
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
852
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
853
- gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null);
854
- const fbo = gl.createFramebuffer();
855
- gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
856
- gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
857
- return gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;
858
- }
859
-
860
- /**
861
- * @license
862
- *
863
- * Use of this source code is governed by an MIT-style license that can be
864
- * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
865
- *
866
- * Angular adaptation of the SplashCursor effect by David Haz / reactbits.dev.
867
- * Original: https://www.reactbits.dev/animations/splash-cursor
868
- */
869
- /**
870
- * Splash cursor — a WebGL fluid simulation that splashes colourful dye
871
- * wherever the pointer moves or clicks. Renders as a fixed, full-viewport,
872
- * click-through overlay; mount it once on a page (it follows the pointer
873
- * everywhere) and it tears down with the component.
874
- *
875
- * Renders nothing under `prefers-reduced-motion` or when WebGL is
876
- * unavailable.
877
- *
878
- * @example
879
- * ```html
880
- * <wr-splash-cursor />
881
- * <wr-splash-cursor [rainbow]="false" color="#5227ff" />
882
- * ```
883
- *
884
- * @see https://ngwr.dev/animations/splash-cursor
885
- */
886
- class WrSplashCursor {
887
- /**
888
- * `true` overlays the whole viewport (reactbits behaviour); `false`
889
- * fills the nearest positioned ancestor instead — handy for demo boxes,
890
- * and the dye collides with the box walls. @default true
891
- */
892
- fullscreen = input(true, { ...(ngDevMode ? { debugName: "fullscreen" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
893
- /** Velocity / pressure grid resolution. @default 128 */
894
- simResolution = input(128, { ...(ngDevMode ? { debugName: "simResolution" } : /* istanbul ignore next */ {}), transform: numAttr(128) });
895
- /** Dye texture resolution — the visible detail. @default 1440 */
896
- dyeResolution = input(1440, { ...(ngDevMode ? { debugName: "dyeResolution" } : /* istanbul ignore next */ {}), transform: numAttr(1440) });
897
- /** How fast the dye fades, higher = shorter trails. @default 3.5 */
898
- densityDissipation = input(3.5, { ...(ngDevMode ? { debugName: "densityDissipation" } : /* istanbul ignore next */ {}), transform: numAttr(3.5) });
899
- /** How fast motion settles. @default 2 */
900
- velocityDissipation = input(2, { ...(ngDevMode ? { debugName: "velocityDissipation" } : /* istanbul ignore next */ {}), transform: numAttr(2) });
901
- /** Pressure retained between frames, 0..1. @default 0.1 */
902
- pressure = input(0.1, { ...(ngDevMode ? { debugName: "pressure" } : /* istanbul ignore next */ {}), transform: numAttr(0.1) });
903
- /** Jacobi iterations for the pressure solve. @default 20 */
904
- pressureIterations = input(20, { ...(ngDevMode ? { debugName: "pressureIterations" } : /* istanbul ignore next */ {}), transform: numAttr(20) });
905
- /** Vorticity confinement — swirliness. @default 3 */
906
- curl = input(3, { ...(ngDevMode ? { debugName: "curl" } : /* istanbul ignore next */ {}), transform: numAttr(3) });
907
- /** Splat size. @default 0.2 */
908
- splatRadius = input(0.2, { ...(ngDevMode ? { debugName: "splatRadius" } : /* istanbul ignore next */ {}), transform: numAttr(0.2) });
909
- /** Velocity a pointer move injects. @default 6000 */
910
- splatForce = input(6000, { ...(ngDevMode ? { debugName: "splatForce" } : /* istanbul ignore next */ {}), transform: numAttr(6000) });
911
- /** Pseudo-3D shading on the dye. @default true */
912
- shading = input(true, { ...(ngDevMode ? { debugName: "shading" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
913
- /** How fast the splat colour cycles. @default 10 */
914
- colorUpdateSpeed = input(10, { ...(ngDevMode ? { debugName: "colorUpdateSpeed" } : /* istanbul ignore next */ {}), transform: numAttr(10) });
915
- /** Cycle splat colours through the rainbow. @default true */
916
- rainbow = input(true, { ...(ngDevMode ? { debugName: "rainbow" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
917
- /** Fixed splat colour when `rainbow` is off. @default '#ff0000' */
918
- color = input('#ff0000', /* @ts-ignore */
919
- ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
920
- canvasRef = viewChild('canvas', /* @ts-ignore */
921
- ...(ngDevMode ? [{ debugName: "canvasRef" }] : /* istanbul ignore next */ []));
922
- zone = inject(NgZone);
923
- platform = inject(WrPlatform);
924
- isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
925
- constructor() {
926
- if (!this.isBrowser)
927
- return;
928
- // (Re)boot whenever the canvas appears, any input changes, or the OS
929
- // reduced-motion preference flips. `onCleanup` tears the old sim down.
930
- effect(onCleanup => {
931
- const canvas = this.canvasRef()?.nativeElement;
932
- const config = {
933
- simResolution: this.simResolution(),
934
- dyeResolution: this.dyeResolution(),
935
- densityDissipation: this.densityDissipation(),
936
- velocityDissipation: this.velocityDissipation(),
937
- pressure: this.pressure(),
938
- pressureIterations: this.pressureIterations(),
939
- curl: this.curl(),
940
- splatRadius: this.splatRadius(),
941
- splatForce: this.splatForce(),
942
- shading: this.shading(),
943
- colorUpdateSpeed: this.colorUpdateSpeed(),
944
- rainbow: this.rainbow(),
945
- color: this.color(),
946
- };
947
- if (!canvas || this.platform.prefersReducedMotion())
948
- return;
949
- const teardown = this.zone.runOutsideAngular(() => createFluidSimulation(canvas, config));
950
- if (teardown)
951
- onCleanup(teardown);
952
- });
953
- }
954
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSplashCursor, deps: [], target: i0.ɵɵFactoryTarget.Component });
955
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: WrSplashCursor, isStandalone: true, selector: "wr-splash-cursor", inputs: { fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, simResolution: { classPropertyName: "simResolution", publicName: "simResolution", isSignal: true, isRequired: false, transformFunction: null }, dyeResolution: { classPropertyName: "dyeResolution", publicName: "dyeResolution", isSignal: true, isRequired: false, transformFunction: null }, densityDissipation: { classPropertyName: "densityDissipation", publicName: "densityDissipation", isSignal: true, isRequired: false, transformFunction: null }, velocityDissipation: { classPropertyName: "velocityDissipation", publicName: "velocityDissipation", isSignal: true, isRequired: false, transformFunction: null }, pressure: { classPropertyName: "pressure", publicName: "pressure", isSignal: true, isRequired: false, transformFunction: null }, pressureIterations: { classPropertyName: "pressureIterations", publicName: "pressureIterations", isSignal: true, isRequired: false, transformFunction: null }, curl: { classPropertyName: "curl", publicName: "curl", isSignal: true, isRequired: false, transformFunction: null }, splatRadius: { classPropertyName: "splatRadius", publicName: "splatRadius", isSignal: true, isRequired: false, transformFunction: null }, splatForce: { classPropertyName: "splatForce", publicName: "splatForce", isSignal: true, isRequired: false, transformFunction: null }, shading: { classPropertyName: "shading", publicName: "shading", isSignal: true, isRequired: false, transformFunction: null }, colorUpdateSpeed: { classPropertyName: "colorUpdateSpeed", publicName: "colorUpdateSpeed", isSignal: true, isRequired: false, transformFunction: null }, rainbow: { classPropertyName: "rainbow", publicName: "rainbow", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-splash-cursor--contained": "!fullscreen()" }, classAttribute: "wr-splash-cursor" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: '<canvas #canvas class="wr-splash-cursor__canvas" aria-hidden="true"></canvas>', isInline: true, styles: [".wr-splash-cursor{position:fixed;inset:0;z-index:50;display:block;pointer-events:none}.wr-splash-cursor__canvas{display:block;width:100vw;height:100vh;height:100dvh}.wr-splash-cursor--contained{position:absolute;z-index:0}.wr-splash-cursor--contained .wr-splash-cursor__canvas{width:100%;height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
850
+ const texture = gl.createTexture();
851
+ gl.bindTexture(gl.TEXTURE_2D, texture);
852
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
853
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
854
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
855
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
856
+ gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null);
857
+ const fbo = gl.createFramebuffer();
858
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
859
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
860
+ return gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;
956
861
  }
957
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSplashCursor, decorators: [{
958
- type: Component,
959
- args: [{ selector: 'wr-splash-cursor', template: '<canvas #canvas class="wr-splash-cursor__canvas" aria-hidden="true"></canvas>', encapsulation: ViewEncapsulation.None, host: {
960
- class: 'wr-splash-cursor',
961
- '[class.wr-splash-cursor--contained]': '!fullscreen()',
962
- }, styles: [".wr-splash-cursor{position:fixed;inset:0;z-index:50;display:block;pointer-events:none}.wr-splash-cursor__canvas{display:block;width:100vw;height:100vh;height:100dvh}.wr-splash-cursor--contained{position:absolute;z-index:0}.wr-splash-cursor--contained .wr-splash-cursor__canvas{width:100%;height:100%}\n"] }]
963
- }], ctorParameters: () => [], propDecorators: { fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }], simResolution: [{ type: i0.Input, args: [{ isSignal: true, alias: "simResolution", required: false }] }], dyeResolution: [{ type: i0.Input, args: [{ isSignal: true, alias: "dyeResolution", required: false }] }], densityDissipation: [{ type: i0.Input, args: [{ isSignal: true, alias: "densityDissipation", required: false }] }], velocityDissipation: [{ type: i0.Input, args: [{ isSignal: true, alias: "velocityDissipation", required: false }] }], pressure: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressure", required: false }] }], pressureIterations: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressureIterations", required: false }] }], curl: [{ type: i0.Input, args: [{ isSignal: true, alias: "curl", required: false }] }], splatRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "splatRadius", required: false }] }], splatForce: [{ type: i0.Input, args: [{ isSignal: true, alias: "splatForce", required: false }] }], shading: [{ type: i0.Input, args: [{ isSignal: true, alias: "shading", required: false }] }], colorUpdateSpeed: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorUpdateSpeed", required: false }] }], rainbow: [{ type: i0.Input, args: [{ isSignal: true, alias: "rainbow", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], canvasRef: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }] } });
964
-
965
862
  /**
966
- * Generated bundle index. Do not edit.
967
- */
968
-
863
+ * @license
864
+ *
865
+ * Use of this source code is governed by an MIT-style license that can be
866
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
867
+ *
868
+ * Angular adaptation of the SplashCursor effect by David Haz / reactbits.dev.
869
+ * Original: https://www.reactbits.dev/animations/splash-cursor
870
+ */
871
+ var WrSplashCursor = class WrSplashCursor {
872
+ fullscreen = input(true, {
873
+ ...ngDevMode ? { debugName: "fullscreen" } : /* istanbul ignore next */ {},
874
+ transform: coerceBooleanProperty
875
+ });
876
+ simResolution = input(128, {
877
+ ...ngDevMode ? { debugName: "simResolution" } : /* istanbul ignore next */ {},
878
+ transform: numAttr(128)
879
+ });
880
+ dyeResolution = input(1440, {
881
+ ...ngDevMode ? { debugName: "dyeResolution" } : /* istanbul ignore next */ {},
882
+ transform: numAttr(1440)
883
+ });
884
+ densityDissipation = input(3.5, {
885
+ ...ngDevMode ? { debugName: "densityDissipation" } : /* istanbul ignore next */ {},
886
+ transform: numAttr(3.5)
887
+ });
888
+ velocityDissipation = input(2, {
889
+ ...ngDevMode ? { debugName: "velocityDissipation" } : /* istanbul ignore next */ {},
890
+ transform: numAttr(2)
891
+ });
892
+ pressure = input(.1, {
893
+ ...ngDevMode ? { debugName: "pressure" } : /* istanbul ignore next */ {},
894
+ transform: numAttr(.1)
895
+ });
896
+ pressureIterations = input(20, {
897
+ ...ngDevMode ? { debugName: "pressureIterations" } : /* istanbul ignore next */ {},
898
+ transform: numAttr(20)
899
+ });
900
+ curl = input(3, {
901
+ ...ngDevMode ? { debugName: "curl" } : /* istanbul ignore next */ {},
902
+ transform: numAttr(3)
903
+ });
904
+ splatRadius = input(.2, {
905
+ ...ngDevMode ? { debugName: "splatRadius" } : /* istanbul ignore next */ {},
906
+ transform: numAttr(.2)
907
+ });
908
+ splatForce = input(6e3, {
909
+ ...ngDevMode ? { debugName: "splatForce" } : /* istanbul ignore next */ {},
910
+ transform: numAttr(6e3)
911
+ });
912
+ shading = input(true, {
913
+ ...ngDevMode ? { debugName: "shading" } : /* istanbul ignore next */ {},
914
+ transform: coerceBooleanProperty
915
+ });
916
+ colorUpdateSpeed = input(10, {
917
+ ...ngDevMode ? { debugName: "colorUpdateSpeed" } : /* istanbul ignore next */ {},
918
+ transform: numAttr(10)
919
+ });
920
+ rainbow = input(true, {
921
+ ...ngDevMode ? { debugName: "rainbow" } : /* istanbul ignore next */ {},
922
+ transform: coerceBooleanProperty
923
+ });
924
+ color = input("#ff0000", ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
925
+ canvasRef = viewChild("canvas", ...ngDevMode ? [{ debugName: "canvasRef" }] : /* istanbul ignore next */ []);
926
+ zone = inject(NgZone);
927
+ platform = inject(WrPlatform);
928
+ isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
929
+ constructor() {
930
+ if (!this.isBrowser) return;
931
+ effect((onCleanup) => {
932
+ const canvas = this.canvasRef()?.nativeElement;
933
+ const config = {
934
+ simResolution: this.simResolution(),
935
+ dyeResolution: this.dyeResolution(),
936
+ densityDissipation: this.densityDissipation(),
937
+ velocityDissipation: this.velocityDissipation(),
938
+ pressure: this.pressure(),
939
+ pressureIterations: this.pressureIterations(),
940
+ curl: this.curl(),
941
+ splatRadius: this.splatRadius(),
942
+ splatForce: this.splatForce(),
943
+ shading: this.shading(),
944
+ colorUpdateSpeed: this.colorUpdateSpeed(),
945
+ rainbow: this.rainbow(),
946
+ color: this.color()
947
+ };
948
+ if (!canvas || this.platform.prefersReducedMotion()) return;
949
+ const teardown = this.zone.runOutsideAngular(() => createFluidSimulation(canvas, config));
950
+ if (teardown) onCleanup(teardown);
951
+ });
952
+ }
953
+ static ɵfac = i0.ɵɵngDeclareFactory({
954
+ minVersion: "12.0.0",
955
+ version: "22.2.3",
956
+ ngImport: i0,
957
+ type: WrSplashCursor,
958
+ deps: [],
959
+ target: i0.ɵɵFactoryTarget.Component
960
+ });
961
+ static ɵcmp = i0.ɵɵngDeclareComponent({
962
+ minVersion: "17.2.0",
963
+ version: "22.2.3",
964
+ type: WrSplashCursor,
965
+ isStandalone: true,
966
+ selector: "wr-splash-cursor",
967
+ inputs: {
968
+ fullscreen: {
969
+ classPropertyName: "fullscreen",
970
+ publicName: "fullscreen",
971
+ isSignal: true,
972
+ isRequired: false,
973
+ transformFunction: null
974
+ },
975
+ simResolution: {
976
+ classPropertyName: "simResolution",
977
+ publicName: "simResolution",
978
+ isSignal: true,
979
+ isRequired: false,
980
+ transformFunction: null
981
+ },
982
+ dyeResolution: {
983
+ classPropertyName: "dyeResolution",
984
+ publicName: "dyeResolution",
985
+ isSignal: true,
986
+ isRequired: false,
987
+ transformFunction: null
988
+ },
989
+ densityDissipation: {
990
+ classPropertyName: "densityDissipation",
991
+ publicName: "densityDissipation",
992
+ isSignal: true,
993
+ isRequired: false,
994
+ transformFunction: null
995
+ },
996
+ velocityDissipation: {
997
+ classPropertyName: "velocityDissipation",
998
+ publicName: "velocityDissipation",
999
+ isSignal: true,
1000
+ isRequired: false,
1001
+ transformFunction: null
1002
+ },
1003
+ pressure: {
1004
+ classPropertyName: "pressure",
1005
+ publicName: "pressure",
1006
+ isSignal: true,
1007
+ isRequired: false,
1008
+ transformFunction: null
1009
+ },
1010
+ pressureIterations: {
1011
+ classPropertyName: "pressureIterations",
1012
+ publicName: "pressureIterations",
1013
+ isSignal: true,
1014
+ isRequired: false,
1015
+ transformFunction: null
1016
+ },
1017
+ curl: {
1018
+ classPropertyName: "curl",
1019
+ publicName: "curl",
1020
+ isSignal: true,
1021
+ isRequired: false,
1022
+ transformFunction: null
1023
+ },
1024
+ splatRadius: {
1025
+ classPropertyName: "splatRadius",
1026
+ publicName: "splatRadius",
1027
+ isSignal: true,
1028
+ isRequired: false,
1029
+ transformFunction: null
1030
+ },
1031
+ splatForce: {
1032
+ classPropertyName: "splatForce",
1033
+ publicName: "splatForce",
1034
+ isSignal: true,
1035
+ isRequired: false,
1036
+ transformFunction: null
1037
+ },
1038
+ shading: {
1039
+ classPropertyName: "shading",
1040
+ publicName: "shading",
1041
+ isSignal: true,
1042
+ isRequired: false,
1043
+ transformFunction: null
1044
+ },
1045
+ colorUpdateSpeed: {
1046
+ classPropertyName: "colorUpdateSpeed",
1047
+ publicName: "colorUpdateSpeed",
1048
+ isSignal: true,
1049
+ isRequired: false,
1050
+ transformFunction: null
1051
+ },
1052
+ rainbow: {
1053
+ classPropertyName: "rainbow",
1054
+ publicName: "rainbow",
1055
+ isSignal: true,
1056
+ isRequired: false,
1057
+ transformFunction: null
1058
+ },
1059
+ color: {
1060
+ classPropertyName: "color",
1061
+ publicName: "color",
1062
+ isSignal: true,
1063
+ isRequired: false,
1064
+ transformFunction: null
1065
+ }
1066
+ },
1067
+ host: {
1068
+ properties: { "class.wr-splash-cursor--contained": "!fullscreen()" },
1069
+ classAttribute: "wr-splash-cursor"
1070
+ },
1071
+ viewQueries: [{
1072
+ propertyName: "canvasRef",
1073
+ first: true,
1074
+ predicate: ["canvas"],
1075
+ descendants: true,
1076
+ isSignal: true
1077
+ }],
1078
+ ngImport: i0,
1079
+ template: "<canvas #canvas class=\"wr-splash-cursor__canvas\" aria-hidden=\"true\"></canvas>",
1080
+ isInline: true,
1081
+ styles: [".wr-splash-cursor{position:fixed;inset:0;z-index:50;display:block;pointer-events:none}.wr-splash-cursor__canvas{display:block;width:100vw;height:100vh;height:100dvh}.wr-splash-cursor--contained{position:absolute;z-index:0}.wr-splash-cursor--contained .wr-splash-cursor__canvas{width:100%;height:100%}\n"],
1082
+ encapsulation: i0.ViewEncapsulation.None
1083
+ });
1084
+ };
1085
+ i0.ɵɵngDeclareClassMetadata({
1086
+ minVersion: "12.0.0",
1087
+ version: "22.2.3",
1088
+ ngImport: i0,
1089
+ type: WrSplashCursor,
1090
+ decorators: [{
1091
+ type: Component,
1092
+ args: [{
1093
+ selector: "wr-splash-cursor",
1094
+ template: "<canvas #canvas class=\"wr-splash-cursor__canvas\" aria-hidden=\"true\"></canvas>",
1095
+ encapsulation: ViewEncapsulation.None,
1096
+ host: {
1097
+ class: "wr-splash-cursor",
1098
+ "[class.wr-splash-cursor--contained]": "!fullscreen()"
1099
+ },
1100
+ styles: [".wr-splash-cursor{position:fixed;inset:0;z-index:50;display:block;pointer-events:none}.wr-splash-cursor__canvas{display:block;width:100vw;height:100vh;height:100dvh}.wr-splash-cursor--contained{position:absolute;z-index:0}.wr-splash-cursor--contained .wr-splash-cursor__canvas{width:100%;height:100%}\n"]
1101
+ }]
1102
+ }],
1103
+ ctorParameters: () => [],
1104
+ propDecorators: {
1105
+ fullscreen: [{
1106
+ type: i0.Input,
1107
+ args: [{
1108
+ isSignal: true,
1109
+ alias: "fullscreen",
1110
+ required: false
1111
+ }]
1112
+ }],
1113
+ simResolution: [{
1114
+ type: i0.Input,
1115
+ args: [{
1116
+ isSignal: true,
1117
+ alias: "simResolution",
1118
+ required: false
1119
+ }]
1120
+ }],
1121
+ dyeResolution: [{
1122
+ type: i0.Input,
1123
+ args: [{
1124
+ isSignal: true,
1125
+ alias: "dyeResolution",
1126
+ required: false
1127
+ }]
1128
+ }],
1129
+ densityDissipation: [{
1130
+ type: i0.Input,
1131
+ args: [{
1132
+ isSignal: true,
1133
+ alias: "densityDissipation",
1134
+ required: false
1135
+ }]
1136
+ }],
1137
+ velocityDissipation: [{
1138
+ type: i0.Input,
1139
+ args: [{
1140
+ isSignal: true,
1141
+ alias: "velocityDissipation",
1142
+ required: false
1143
+ }]
1144
+ }],
1145
+ pressure: [{
1146
+ type: i0.Input,
1147
+ args: [{
1148
+ isSignal: true,
1149
+ alias: "pressure",
1150
+ required: false
1151
+ }]
1152
+ }],
1153
+ pressureIterations: [{
1154
+ type: i0.Input,
1155
+ args: [{
1156
+ isSignal: true,
1157
+ alias: "pressureIterations",
1158
+ required: false
1159
+ }]
1160
+ }],
1161
+ curl: [{
1162
+ type: i0.Input,
1163
+ args: [{
1164
+ isSignal: true,
1165
+ alias: "curl",
1166
+ required: false
1167
+ }]
1168
+ }],
1169
+ splatRadius: [{
1170
+ type: i0.Input,
1171
+ args: [{
1172
+ isSignal: true,
1173
+ alias: "splatRadius",
1174
+ required: false
1175
+ }]
1176
+ }],
1177
+ splatForce: [{
1178
+ type: i0.Input,
1179
+ args: [{
1180
+ isSignal: true,
1181
+ alias: "splatForce",
1182
+ required: false
1183
+ }]
1184
+ }],
1185
+ shading: [{
1186
+ type: i0.Input,
1187
+ args: [{
1188
+ isSignal: true,
1189
+ alias: "shading",
1190
+ required: false
1191
+ }]
1192
+ }],
1193
+ colorUpdateSpeed: [{
1194
+ type: i0.Input,
1195
+ args: [{
1196
+ isSignal: true,
1197
+ alias: "colorUpdateSpeed",
1198
+ required: false
1199
+ }]
1200
+ }],
1201
+ rainbow: [{
1202
+ type: i0.Input,
1203
+ args: [{
1204
+ isSignal: true,
1205
+ alias: "rainbow",
1206
+ required: false
1207
+ }]
1208
+ }],
1209
+ color: [{
1210
+ type: i0.Input,
1211
+ args: [{
1212
+ isSignal: true,
1213
+ alias: "color",
1214
+ required: false
1215
+ }]
1216
+ }],
1217
+ canvasRef: [{
1218
+ type: i0.ViewChild,
1219
+ args: ["canvas", { isSignal: true }]
1220
+ }]
1221
+ }
1222
+ });
969
1223
  export { WrSplashCursor };
970
- //# sourceMappingURL=ngwr-splash-cursor.mjs.map
1224
+
1225
+ //# sourceMappingURL=ngwr-splash-cursor.mjs.map