@redvars/peacock 4.0.0 → 4.1.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 (408) hide show
  1. package/dist/{BaseField-CAog9TIc.js → BaseField-BMumJpkW.js} +6 -3
  2. package/dist/BaseField-BMumJpkW.js.map +1 -0
  3. package/dist/{BaseInput-CcMfg1Y2.js → BaseInput-mWdyYv27.js} +6 -3
  4. package/dist/BaseInput-mWdyYv27.js.map +1 -0
  5. package/dist/accordion.js.map +1 -1
  6. package/dist/ai-badge.js +2 -2
  7. package/dist/ai-summary.js +2 -2
  8. package/dist/alert.js +2 -2
  9. package/dist/anchor-nav.js +2 -2
  10. package/dist/app-shell.js +2 -2
  11. package/dist/assistant-panel.js +2 -2
  12. package/dist/assistant-step.js +2 -2
  13. package/dist/assistant-steps.js +2 -2
  14. package/dist/avatar-group.js +2 -2
  15. package/dist/banner.js +2 -2
  16. package/dist/{base-button-Do2TUy8M.js → base-button-BJMGMcMv.js} +3 -1
  17. package/dist/base-button-BJMGMcMv.js.map +1 -0
  18. package/dist/{base-progress-BiLlZVHJ.js → base-progress-CvLVSjuy.js} +4 -2
  19. package/dist/base-progress-CvLVSjuy.js.map +1 -0
  20. package/dist/bottom-sheet.js +2 -2
  21. package/dist/breadcrumb.js +2 -2
  22. package/dist/button-group.js +4 -4
  23. package/dist/button.js +3 -3
  24. package/dist/calendar.js +2 -2
  25. package/dist/canvas-base-BTQMEVn_.js +788 -0
  26. package/dist/canvas-base-BTQMEVn_.js.map +1 -0
  27. package/dist/canvas-link-CtgsALq4.js +54 -0
  28. package/dist/canvas-link-CtgsALq4.js.map +1 -0
  29. package/dist/{cartesian-chart-C-f1frt0.js → cartesian-chart-DM1FC_XT.js} +3 -2
  30. package/dist/cartesian-chart-DM1FC_XT.js.map +1 -0
  31. package/dist/{cb-group-base-DeuCVx3a.js → cb-group-base-B6fa4Lll.js} +2 -2
  32. package/dist/{cb-group-base-DeuCVx3a.js.map → cb-group-base-B6fa4Lll.js.map} +1 -1
  33. package/dist/cb-group.js +3 -3
  34. package/dist/cb-rule.js +3 -3
  35. package/dist/chart-area.js +5 -4
  36. package/dist/chart-area.js.map +1 -1
  37. package/dist/chart-bar.js +5 -4
  38. package/dist/chart-bar.js.map +1 -1
  39. package/dist/chart-base-Dhxuw_Mw.js +833 -0
  40. package/dist/chart-base-Dhxuw_Mw.js.map +1 -0
  41. package/dist/chart-doughnut.js +4 -3
  42. package/dist/chart-doughnut.js.map +1 -1
  43. package/dist/chart-line.js +5 -4
  44. package/dist/chart-line.js.map +1 -1
  45. package/dist/chart-pie.js +4 -3
  46. package/dist/chart-pie.js.map +1 -1
  47. package/dist/chat-message.js +2 -2
  48. package/dist/chat-thread.js +2 -2
  49. package/dist/checkbox-group.js +4 -4
  50. package/dist/checkbox.js +4 -4
  51. package/dist/chip-set.js +3 -3
  52. package/dist/chip.js +4 -4
  53. package/dist/circular-progress.js +3 -3
  54. package/dist/citation.js +2 -2
  55. package/dist/code-editor.js +5 -4
  56. package/dist/code-editor.js.map +1 -1
  57. package/dist/code-highlighter.js +2 -2
  58. package/dist/color-field.js +5 -5
  59. package/dist/color-picker.js +2 -2
  60. package/dist/command-palette.js +2 -2
  61. package/dist/comment-composer.js +5 -5
  62. package/dist/condition-builder.js +3 -3
  63. package/dist/confirm-dialog.js +2 -2
  64. package/dist/copy-button.js +2 -2
  65. package/dist/currency-field.js +5 -5
  66. package/dist/custom-elements-jsdocs.json +2115 -336
  67. package/dist/custom-elements.json +19483 -615
  68. package/dist/date-field.js +6 -6
  69. package/dist/date-picker.js +4 -2
  70. package/dist/date-picker.js.map +1 -1
  71. package/dist/date-range-field.js +6 -6
  72. package/dist/datetime-field.js +6 -6
  73. package/dist/dependency-map-layout-5KUueabk.js +1390 -0
  74. package/dist/dependency-map-layout-5KUueabk.js.map +1 -0
  75. package/dist/dependency-map.js +1605 -0
  76. package/dist/dependency-map.js.map +1 -0
  77. package/dist/description-item.js +2 -2
  78. package/dist/description-list.js +2 -2
  79. package/dist/diagram-2r11KySs.js +2029 -0
  80. package/dist/diagram-2r11KySs.js.map +1 -0
  81. package/dist/diagram-controls.js +345 -0
  82. package/dist/diagram-controls.js.map +1 -0
  83. package/dist/diagram-minimap.js +216 -0
  84. package/dist/diagram-minimap.js.map +1 -0
  85. package/dist/diagram.js +20 -0
  86. package/dist/diagram.js.map +1 -0
  87. package/dist/diff-viewer.js +2 -2
  88. package/dist/discussion-activity.js +2 -2
  89. package/dist/discussion-comment.js +2 -2
  90. package/dist/discussion.js +5 -5
  91. package/dist/{document-editor-BO7QPbO5.js → document-editor-BnEugM3E.js} +2 -2
  92. package/dist/{document-editor-BO7QPbO5.js.map → document-editor-BnEugM3E.js.map} +1 -1
  93. package/dist/document-editor.js +3 -3
  94. package/dist/draft-card.js +2 -2
  95. package/dist/erd.js +2021 -0
  96. package/dist/erd.js.map +1 -0
  97. package/dist/fab.js +4 -4
  98. package/dist/field.js +257 -43
  99. package/dist/field.js.map +1 -1
  100. package/dist/file-upload.js +37 -15
  101. package/dist/file-upload.js.map +1 -1
  102. package/dist/filter-bar.js +2 -2
  103. package/dist/flow.js +27 -970
  104. package/dist/flow.js.map +1 -1
  105. package/dist/focus-ring.js +2 -0
  106. package/dist/focus-ring.js.map +1 -1
  107. package/dist/{form-associated-D3Tn33s_.js → form-associated-BHbg72PG.js} +3 -1
  108. package/dist/{form-associated-D3Tn33s_.js.map → form-associated-BHbg72PG.js.map} +1 -1
  109. package/dist/{form-submitter-DWwv6K9-.js → form-submitter-beG1CXAn.js} +7 -1
  110. package/dist/{form-submitter-DWwv6K9-.js.map → form-submitter-beG1CXAn.js.map} +1 -1
  111. package/dist/form.js +2 -2
  112. package/dist/{generative-view-DmtpDobn.js → generative-view-BgOcLRXr.js} +13 -13
  113. package/dist/generative-view-BgOcLRXr.js.map +1 -0
  114. package/dist/generative-view.js +3 -3
  115. package/dist/geometry-INg82Lxq.js +305 -0
  116. package/dist/geometry-INg82Lxq.js.map +1 -0
  117. package/dist/history-YbTSQZHj.js +45 -0
  118. package/dist/history-YbTSQZHj.js.map +1 -0
  119. package/dist/host-CZK7xhzh.js +40 -0
  120. package/dist/host-CZK7xhzh.js.map +1 -0
  121. package/dist/html-editor.js +5 -5
  122. package/dist/{hyperlink-DhE9RlVS.js → hyperlink-DycWPKwU.js} +10 -1
  123. package/dist/hyperlink-DycWPKwU.js.map +1 -0
  124. package/dist/{i18n-controller-urcQKYGe.js → i18n-controller-Cp43HjJl.js} +2 -2
  125. package/dist/{i18n-controller-urcQKYGe.js.map → i18n-controller-Cp43HjJl.js.map} +1 -1
  126. package/dist/icon-button.js +4 -4
  127. package/dist/image.js +2 -2
  128. package/dist/index.js +37 -18
  129. package/dist/index.js.map +1 -1
  130. package/dist/inline-edit.js +2 -2
  131. package/dist/input.js +4 -4
  132. package/dist/json-viewer.js +2 -2
  133. package/dist/kanban.js +2 -2
  134. package/dist/kbd.js +2 -2
  135. package/dist/linear-progress.js +3 -3
  136. package/dist/link-button.js +2 -2
  137. package/dist/list-item.js +2 -2
  138. package/dist/list.js +2 -2
  139. package/dist/listbox.js +3 -3
  140. package/dist/loader-full.js +13 -13
  141. package/dist/loader.js +44 -15
  142. package/dist/loader.js.map +1 -1
  143. package/dist/markdown-editor.js +5 -5
  144. package/dist/markers-BFmh1OCz.js +46 -0
  145. package/dist/markers-BFmh1OCz.js.map +1 -0
  146. package/dist/measure-controller-Dmc5hZKg.js +89 -0
  147. package/dist/measure-controller-Dmc5hZKg.js.map +1 -0
  148. package/dist/mention-input.js +6 -5
  149. package/dist/mention-input.js.map +1 -1
  150. package/dist/menu-item.js +3 -2
  151. package/dist/menu-item.js.map +1 -1
  152. package/dist/menu.js +2 -2
  153. package/dist/modal.js +2 -2
  154. package/dist/navigation-bar.js +2 -2
  155. package/dist/navigation-drawer.js +2 -2
  156. package/dist/navigation-rail.js +2 -2
  157. package/dist/notification-center.js +2 -2
  158. package/dist/number-field.js +6 -5
  159. package/dist/number-field.js.map +1 -1
  160. package/dist/option.js +2 -2
  161. package/dist/page-header.js +2 -2
  162. package/dist/pagination.js +2 -2
  163. package/dist/password-field.js +5 -5
  164. package/dist/password-rules.js +2 -2
  165. package/dist/phone-field.js +5 -5
  166. package/dist/{picker-field-B4DtcJfL.js → picker-field-dTlIMAQn.js} +3 -3
  167. package/dist/{picker-field-B4DtcJfL.js.map → picker-field-dTlIMAQn.js.map} +1 -1
  168. package/dist/pin-input.js +5 -5
  169. package/dist/presence-indicator.js +2 -2
  170. package/dist/prompt-input.js +5 -5
  171. package/dist/radio-group.js +1 -0
  172. package/dist/radio-group.js.map +1 -1
  173. package/dist/radio.js +5 -5
  174. package/dist/radio.js.map +1 -1
  175. package/dist/rating.js +5 -4
  176. package/dist/rating.js.map +1 -1
  177. package/dist/redvars-loader.js +2 -2
  178. package/dist/relative-time.js +2 -2
  179. package/dist/resizable-panels.js +2 -2
  180. package/dist/{rich-text-input-DLICqof1.js → rich-text-input-DM_BOzgk.js} +3 -3
  181. package/dist/{rich-text-input-DLICqof1.js.map → rich-text-input-DM_BOzgk.js.map} +1 -1
  182. package/dist/ripple.js +2 -0
  183. package/dist/ripple.js.map +1 -1
  184. package/dist/{schema-hMt-NRLk.js → schema-B8g30A_n.js} +2 -2
  185. package/dist/{schema-hMt-NRLk.js.map → schema-B8g30A_n.js.map} +1 -1
  186. package/dist/search.js +4 -4
  187. package/dist/segmented-button-group.js +1 -1
  188. package/dist/select.js +7 -7
  189. package/dist/side-sheet.js +2 -2
  190. package/dist/signature-pad.js +5 -4
  191. package/dist/signature-pad.js.map +1 -1
  192. package/dist/slider.js +5 -4
  193. package/dist/slider.js.map +1 -1
  194. package/dist/snackbar.js +2 -2
  195. package/dist/sparkline.js +2 -2
  196. package/dist/split-button.js +2 -2
  197. package/dist/src/__internal/diagram/canvas-base.d.ts +105 -0
  198. package/dist/src/__internal/diagram/canvas-link.d.ts +21 -0
  199. package/dist/src/__internal/diagram/geometry.d.ts +49 -0
  200. package/dist/src/__internal/diagram/history.d.ts +17 -0
  201. package/dist/src/__internal/diagram/host.d.ts +45 -0
  202. package/dist/src/__internal/diagram/markers.d.ts +16 -0
  203. package/dist/src/__internal/diagram/measure-controller.d.ts +32 -0
  204. package/dist/src/__internal/diagram/motion.d.ts +22 -0
  205. package/dist/src/__internal/diagram/selection.d.ts +20 -0
  206. package/dist/src/__internal/diagram/types.d.ts +39 -0
  207. package/dist/src/__internal/diagram/viewport-controller.d.ts +89 -0
  208. package/dist/src/__internal/i18n/strings.d.ts +149 -0
  209. package/dist/src/__internal/toggle-base.d.ts +8 -0
  210. package/dist/src/__internal/utils/deprecate.d.ts +3 -3
  211. package/dist/src/accordion/accordion.d.ts +1 -0
  212. package/dist/src/code-editor/code-editor.d.ts +1 -0
  213. package/dist/src/date-picker/date-picker.d.ts +2 -0
  214. package/dist/src/dependency-map/dependency-map-layout.d.ts +48 -0
  215. package/dist/src/dependency-map/dependency-map.d.ts +241 -0
  216. package/dist/src/dependency-map/index.d.ts +2 -0
  217. package/dist/src/diagram/diagram.d.ts +300 -0
  218. package/dist/src/diagram/flow.d.ts +53 -0
  219. package/dist/src/diagram/index.d.ts +4 -0
  220. package/dist/src/diagram-controls/diagram-controls.d.ts +46 -0
  221. package/dist/src/diagram-controls/index.d.ts +1 -0
  222. package/dist/src/diagram-minimap/diagram-minimap.d.ts +39 -0
  223. package/dist/src/diagram-minimap/index.d.ts +1 -0
  224. package/dist/src/erd/erd-layout.d.ts +27 -0
  225. package/dist/src/erd/erd.d.ts +266 -0
  226. package/dist/src/erd/index.d.ts +2 -0
  227. package/dist/src/field/field.d.ts +38 -1
  228. package/dist/src/file-upload/file-upload.d.ts +3 -1
  229. package/dist/src/focus-ring/focus-ring.d.ts +2 -0
  230. package/dist/src/index.d.ts +15 -2
  231. package/dist/src/input/BaseField.d.ts +3 -0
  232. package/dist/src/input/BaseInput.d.ts +3 -0
  233. package/dist/src/menu/menu-item/menu-item.d.ts +1 -0
  234. package/dist/src/number-field/number-field.d.ts +4 -0
  235. package/dist/src/progress/base-progress.d.ts +3 -0
  236. package/dist/src/radio/radio-group.d.ts +1 -0
  237. package/dist/src/rating/rating.d.ts +1 -0
  238. package/dist/src/ripple/ripple.d.ts +2 -0
  239. package/dist/src/signature-pad/signature-pad.d.ts +1 -0
  240. package/dist/src/slider/slider.d.ts +1 -0
  241. package/dist/src/switch/switch.d.ts +1 -0
  242. package/dist/src/tabs/tab.d.ts +2 -0
  243. package/dist/src/tabs/tabs.d.ts +1 -0
  244. package/dist/src/textarea/textarea.d.ts +1 -0
  245. package/dist/src/time-picker/time-picker.d.ts +2 -0
  246. package/dist/src/transfer-list/transfer-list.d.ts +1 -0
  247. package/dist/src/tree-chart/index.d.ts +2 -0
  248. package/dist/src/tree-chart/tree-chart-layout.d.ts +49 -0
  249. package/dist/src/tree-chart/tree-chart.d.ts +221 -0
  250. package/dist/src/workflow/index.d.ts +2 -0
  251. package/dist/src/workflow/workflow-format.d.ts +5 -0
  252. package/dist/src/workflow/workflow-model.d.ts +194 -0
  253. package/dist/src/workflow/workflow.d.ts +313 -0
  254. package/dist/src/workflow-timeline/index.d.ts +1 -0
  255. package/dist/src/workflow-timeline/workflow-timeline.d.ts +41 -0
  256. package/dist/stat.js +2 -2
  257. package/dist/status-indicator.js +2 -2
  258. package/dist/step.js +2 -2
  259. package/dist/stepper.js +2 -2
  260. package/dist/{strings-DmbqMTfs.js → strings-BJPuhKJk.js} +163 -1
  261. package/dist/{strings-DmbqMTfs.js.map → strings-BJPuhKJk.js.map} +1 -1
  262. package/dist/sub-menu.js +2 -2
  263. package/dist/svg.js +2 -2
  264. package/dist/switch.js +5 -4
  265. package/dist/switch.js.map +1 -1
  266. package/dist/tab.js +1 -0
  267. package/dist/tab.js.map +1 -1
  268. package/dist/table.js +2 -2
  269. package/dist/tabs.js +1 -0
  270. package/dist/tabs.js.map +1 -1
  271. package/dist/test/diagram-controls.test.d.ts +1 -0
  272. package/dist/test/diagram-geometry.test.d.ts +1 -0
  273. package/dist/test/diagram.test.d.ts +1 -0
  274. package/dist/test/erd.test.d.ts +1 -0
  275. package/dist/test/toggle-label.test.d.ts +1 -0
  276. package/dist/test/tree-chart.test.d.ts +1 -0
  277. package/dist/test/workflow-debug.test.d.ts +1 -0
  278. package/dist/test/workflow.test.d.ts +1 -0
  279. package/dist/textarea.js +7 -5
  280. package/dist/textarea.js.map +1 -1
  281. package/dist/time-field.js +6 -6
  282. package/dist/time-picker.js +4 -2
  283. package/dist/time-picker.js.map +1 -1
  284. package/dist/timeline-item.js +2 -2
  285. package/dist/timeline.js +2 -2
  286. package/dist/{toggle-base-BQO5pjrU.js → toggle-base-BlaHalfS.js} +19 -3
  287. package/dist/toggle-base-BlaHalfS.js.map +1 -0
  288. package/dist/tour.js +2 -2
  289. package/dist/transfer-list.js +5 -4
  290. package/dist/transfer-list.js.map +1 -1
  291. package/dist/{chart-base-B-gOg2Di.js → transform-CxeQFXXB.js} +9 -839
  292. package/dist/transform-CxeQFXXB.js.map +1 -0
  293. package/dist/tree-chart.js +1986 -0
  294. package/dist/tree-chart.js.map +1 -0
  295. package/dist/tree-item.js +2 -2
  296. package/dist/tree.js +2 -2
  297. package/dist/tsconfig.tsbuildinfo +1 -1
  298. package/dist/typing-indicator.js +2 -2
  299. package/dist/url-field.js +5 -5
  300. package/dist/user-menu.js +2 -2
  301. package/dist/virtual-list.js +2 -2
  302. package/dist/workflow-format-BsyveyeC.js +34 -0
  303. package/dist/workflow-format-BsyveyeC.js.map +1 -0
  304. package/dist/workflow-model-CauduOG2.js +330 -0
  305. package/dist/workflow-model-CauduOG2.js.map +1 -0
  306. package/dist/workflow-timeline.js +354 -0
  307. package/dist/workflow-timeline.js.map +1 -0
  308. package/dist/workflow.js +3337 -0
  309. package/dist/workflow.js.map +1 -0
  310. package/dist/workspace-switcher.js +2 -2
  311. package/package.json +1 -1
  312. package/readme.md +44 -2
  313. package/src/LoaderUtils.ts +9 -2
  314. package/src/__internal/diagram/canvas-base.ts +410 -0
  315. package/src/__internal/diagram/canvas-link.ts +66 -0
  316. package/src/__internal/diagram/geometry.ts +372 -0
  317. package/src/__internal/diagram/history.ts +49 -0
  318. package/src/__internal/diagram/host.ts +76 -0
  319. package/src/__internal/diagram/markers.ts +56 -0
  320. package/src/__internal/diagram/measure-controller.ts +104 -0
  321. package/src/__internal/diagram/motion.ts +89 -0
  322. package/src/__internal/diagram/selection.ts +69 -0
  323. package/src/__internal/diagram/types.ts +56 -0
  324. package/src/__internal/diagram/viewport-controller.ts +494 -0
  325. package/src/__internal/i18n/strings.ts +201 -0
  326. package/src/__internal/mixins/field.ts +3 -0
  327. package/src/__internal/mixins/form-associated.ts +2 -0
  328. package/src/__internal/mixins/form-submitter.ts +6 -0
  329. package/src/__internal/mixins/hyperlink.ts +10 -0
  330. package/src/__internal/toggle-base.ts +16 -0
  331. package/src/__internal/utils/deprecate.ts +5 -4
  332. package/src/accordion/accordion.ts +1 -0
  333. package/src/button/base-button/base-button.ts +2 -0
  334. package/src/code-editor/code-editor.ts +1 -0
  335. package/src/date-picker/date-picker.ts +2 -0
  336. package/src/dependency-map/dependency-map-layout.ts +505 -0
  337. package/src/dependency-map/dependency-map.scss +626 -0
  338. package/src/dependency-map/dependency-map.ts +1280 -0
  339. package/src/dependency-map/index.ts +16 -0
  340. package/src/diagram/diagram.scss +513 -0
  341. package/src/diagram/diagram.ts +1852 -0
  342. package/src/diagram/flow.ts +81 -0
  343. package/src/diagram/index.ts +44 -0
  344. package/src/diagram-controls/diagram-controls.scss +68 -0
  345. package/src/diagram-controls/diagram-controls.ts +255 -0
  346. package/src/diagram-controls/index.ts +1 -0
  347. package/src/diagram-minimap/diagram-minimap.scss +41 -0
  348. package/src/diagram-minimap/diagram-minimap.ts +149 -0
  349. package/src/diagram-minimap/index.ts +1 -0
  350. package/src/erd/erd-layout.ts +92 -0
  351. package/src/erd/erd.scss +636 -0
  352. package/src/erd/erd.ts +1728 -0
  353. package/src/erd/index.ts +17 -0
  354. package/src/field/field.scss +197 -23
  355. package/src/field/field.ts +109 -16
  356. package/src/file-upload/file-upload.scss +37 -10
  357. package/src/file-upload/file-upload.ts +3 -1
  358. package/src/focus-ring/focus-ring.ts +2 -0
  359. package/src/generative-view/catalog.generated.ts +12 -11
  360. package/src/index.ts +121 -2
  361. package/src/input/BaseField.ts +3 -0
  362. package/src/input/BaseInput.ts +3 -0
  363. package/src/loader.ts +25 -0
  364. package/src/mention-input/mention-input.scss +2 -0
  365. package/src/menu/menu-item/menu-item.ts +1 -0
  366. package/src/number-field/number-field.ts +4 -0
  367. package/src/progress/base-progress.ts +3 -0
  368. package/src/radio/radio-group.ts +1 -0
  369. package/src/radio/radio.ts +1 -1
  370. package/src/rating/rating.ts +1 -0
  371. package/src/ripple/ripple.ts +2 -0
  372. package/src/signature-pad/signature-pad.ts +1 -0
  373. package/src/slider/slider.ts +1 -0
  374. package/src/switch/switch.ts +1 -0
  375. package/src/tabs/tab.ts +2 -0
  376. package/src/tabs/tabs.ts +1 -0
  377. package/src/textarea/textarea.scss +2 -0
  378. package/src/textarea/textarea.ts +1 -0
  379. package/src/time-picker/time-picker.ts +2 -0
  380. package/src/transfer-list/transfer-list.ts +1 -0
  381. package/src/tree-chart/index.ts +13 -0
  382. package/src/tree-chart/tree-chart-layout.ts +185 -0
  383. package/src/tree-chart/tree-chart.scss +377 -0
  384. package/src/tree-chart/tree-chart.ts +1170 -0
  385. package/src/workflow/index.ts +35 -0
  386. package/src/workflow/workflow-format.ts +29 -0
  387. package/src/workflow/workflow-model.ts +583 -0
  388. package/src/workflow/workflow.scss +1164 -0
  389. package/src/workflow/workflow.ts +2674 -0
  390. package/src/workflow-timeline/index.ts +1 -0
  391. package/src/workflow-timeline/workflow-timeline.scss +128 -0
  392. package/src/workflow-timeline/workflow-timeline.ts +238 -0
  393. package/dist/BaseField-CAog9TIc.js.map +0 -1
  394. package/dist/BaseInput-CcMfg1Y2.js.map +0 -1
  395. package/dist/base-button-Do2TUy8M.js.map +0 -1
  396. package/dist/base-progress-BiLlZVHJ.js.map +0 -1
  397. package/dist/cartesian-chart-C-f1frt0.js.map +0 -1
  398. package/dist/chart-base-B-gOg2Di.js.map +0 -1
  399. package/dist/generative-view-DmtpDobn.js.map +0 -1
  400. package/dist/hyperlink-DhE9RlVS.js.map +0 -1
  401. package/dist/src/flow/flow.d.ts +0 -178
  402. package/dist/src/flow/index.d.ts +0 -2
  403. package/dist/toggle-base-BQO5pjrU.js.map +0 -1
  404. package/src/button/button-group/readme.md +0 -23
  405. package/src/flow/flow.scss +0 -215
  406. package/src/flow/flow.ts +0 -958
  407. package/src/flow/index.ts +0 -10
  408. /package/dist/test/{flow.test.d.ts → dependency-map.test.d.ts} +0 -0
package/dist/rating.js CHANGED
@@ -4,13 +4,13 @@ import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './query-CHb9Ft_d.js';
5
5
  import { e as e$1 } from './class-map-NDIkZErE.js';
6
6
  import { o } from './style-map-CHOg6N_R.js';
7
- import { I as I18nController } from './i18n-controller-urcQKYGe.js';
7
+ import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
8
8
  import { i as isRtl } from './locale-DEsJZCQG.js';
9
- import { g as getFormValue } from './form-associated-D3Tn33s_.js';
10
- import { B as BaseInput } from './BaseInput-CcMfg1Y2.js';
9
+ import { g as getFormValue } from './form-associated-BHbg72PG.js';
10
+ import { B as BaseInput } from './BaseInput-mWdyYv27.js';
11
11
  import './base-Cl6v8-BZ.js';
12
12
  import './directive-ZPhl09Yt.js';
13
- import './strings-DmbqMTfs.js';
13
+ import './strings-BJPuhKJk.js';
14
14
  import './element-internals-QME0yEz4.js';
15
15
  import './suggestion-controller-CW17adxd.js';
16
16
  import './ai-controller-DR_Tg0sN.js';
@@ -233,6 +233,7 @@ let Rating = class Rating extends BaseInput {
233
233
  this.helperText = '';
234
234
  /** Shows the rating in its error state with `error-text`. */
235
235
  this.error = false;
236
+ /** Error message shown below the rating while `error` is set; replaces the help text. */
236
237
  this.errorText = '';
237
238
  /** Size of the stars: `sm` (default), `md` or `lg`. */
238
239
  this.size = 'sm';
@@ -1 +1 @@
1
- {"version":3,"file":"rating.js","sources":["../../src/rating/rating.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { isRtl } from '@/__internal/i18n/locale.js';\nimport {\n type FormRestoreState,\n type FormValue,\n getFormValue,\n} from '@/__internal/mixins/form-associated.js';\nimport type { Size } from '@/__internal/utils/size.js';\nimport IndividualComponent from '@/IndividualComponent.js';\n\nimport BaseInput, { type ControlValidity } from '../input/BaseInput.js';\nimport styles from './rating.scss';\n\n/** `detail` of `input` and `change`. */\nexport interface RatingChangeDetail {\n value: number;\n}\n\nlet ratingCount = 0;\n\n/**\n * @label Rating\n * @tag wc-rating\n * @rawTag rating\n *\n * @summary A star rating: pick how many stars, or show an average such as 4.3 out of 5.\n * @overview\n * <p>Rating lets the person pick a score from 1 to <code>max</code> (5 by default) by clicking a\n * star or with the keyboard. Pointing at the stars previews the score; nothing changes until the\n * click. With <code>precision=\"0.5\"</code> the left half of a star (the right half in right-to-left\n * layouts) picks a half star. With <code>clearable</code>, choosing the current score again clears\n * it.</p>\n * <p>It is one keyboard stop that follows the WAI-ARIA slider pattern: the arrow keys change the\n * score by one step (mirrored in right-to-left layouts), Home and End go to the lowest and highest\n * score, and the digit keys pick that many stars. Screen readers hear \"3 out of 5\".</p>\n * <p><code>readonly</code> turns it into a display, for example a product's average review: any\n * value is drawn with a partly filled star, and it is a single image named \"Rated 4.3 out of 5\".\n * Inside a <code>&lt;form&gt;</code> the score is submitted under <code>name</code>; no score submits\n * nothing, and <code>required</code> blocks submission until one is picked.</p>\n * <p>The stars are Material Symbols: <code>icon</code> names the empty shape and\n * <code>&lt;icon&gt;-fill</code> the filled one, so any symbol with a fill variant works\n * (<code>favorite</code>, <code>thumb_up</code>).</p>\n *\n * @fires {CustomEvent<{value: number}>} input - Dispatched when the person picks a score (not while previewing).\n * @fires {CustomEvent<{value: number}>} change - Dispatched with `input`, when the person picks a score. `0` means cleared.\n *\n * @cssprop --rating-filled-color - Color of filled stars.\n * @cssprop --rating-empty-color - Color of empty stars.\n * @cssprop --rating-icon-size - Size of one star; overrides `size`.\n *\n * @example\n * ```html\n * <wc-rating label=\"Your rating\" name=\"rating\"></wc-rating>\n * ```\n * @example\n * ```html\n * <wc-rating label=\"Average\" readonly value=\"4.3\"></wc-rating>\n * ```\n * @tags input, form\n */\n@IndividualComponent\nexport class Rating extends BaseInput {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n // `name` and `disabled` come from mixinFormAssociated; `readonly` and `required` from BaseInput.\n\n /** The score; `0` for none. Read-only ratings show any value, others snap to `precision`. */\n @property({ type: Number })\n value = 0;\n\n /** Number of stars, the highest score. */\n @property({ type: Number })\n max = 5;\n\n /** Step of the score: `1` for whole stars, `0.5` for half stars. */\n @property({ type: Number })\n precision: 1 | 0.5 = 1;\n\n /** Choosing the current score again, or going below the lowest, clears it to `0`. */\n @property({ type: Boolean })\n clearable = false;\n\n /** Label shown above the stars; also their accessible name. */\n @property({ type: String })\n label = '';\n\n /** Help text shown below the stars. */\n @property({ type: String, attribute: 'helper-text' })\n helperText = '';\n\n /** Shows the rating in its error state with `error-text`. */\n @property({ type: Boolean, reflect: true })\n error = false;\n\n @property({ type: String, attribute: 'error-text' })\n errorText = '';\n\n /** Size of the stars: `sm` (default), `md` or `lg`. */\n @property({ type: String, reflect: true })\n size: Size = 'sm';\n\n /** Material Symbols name of the empty star; `<icon>-fill` is the filled one. */\n @property({ type: String })\n icon = 'star';\n\n /** Locale for the spoken numbers; defaults to the nearest `lang`. */\n @property({ type: String })\n locale?: string;\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** The score under the pointer, previewed until it leaves or clicks. */\n @state() private hoverValue?: number;\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('.stars') private starsElement?: HTMLElement;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n private readonly idPrefix = `wc-rating-${(ratingCount += 1)}`;\n\n /** Peacock's strings for the value text. */\n private readonly i18n = new I18nController(this);\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.starsElement?.focus();\n }\n\n override blur() {\n this.starsElement?.blur();\n }\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected override computeValidity(): ControlValidity {\n if (this.required && !(this.value > 0) && !this.disabled) {\n return {\n flags: { valueMissing: true },\n message: this.valueMissingText(),\n };\n }\n return { flags: {}, message: '' };\n }\n\n protected override valueMissingText(): string {\n return this.i18n.t('valueMissingRating');\n }\n\n protected override validityAnchor() {\n return this.starsElement ?? undefined;\n }\n\n override [getFormValue](): FormValue | null {\n return this.value > 0 ? String(this.value) : null;\n }\n\n protected override parseRestoreState(restored: FormRestoreState): unknown {\n const value = typeof restored === 'string' ? Number(restored) : 0;\n return Number.isFinite(value) ? value : 0;\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private get step(): number {\n return Number(this.precision) === 0.5 ? 0.5 : 1;\n }\n\n private get starCount(): number {\n const max = Math.floor(Number(this.max));\n return Number.isFinite(max) && max > 0 ? max : 5;\n }\n\n private get isInteractive(): boolean {\n return !this.disabled && !this.readonly;\n }\n\n /** The value clamped to the stars, and in interactive mode snapped to the step. */\n private get shownValue(): number {\n const value = Math.min(\n this.starCount,\n Math.max(0, Number(this.value) || 0),\n );\n if (this.readonly) return value;\n return Math.round(value / this.step) * this.step;\n }\n\n private format(value: number): string {\n return new Intl.NumberFormat(this.i18n.locale, {\n maximumFractionDigits: 1,\n }).format(value);\n }\n\n private valueText(value: number): string {\n if (!(value > 0)) return this.i18n.t('ratingNoValue');\n return this.i18n.t('ratingValueText')(\n this.format(value),\n this.format(this.starCount),\n );\n }\n\n /** Sets the score from the person's action and fires `input` and `change`. */\n private commit(value: number) {\n if (!this.isInteractive || value === this.shownValue) return;\n this.value = value;\n for (const type of ['input', 'change']) {\n this.dispatchEvent(\n new CustomEvent<RatingChangeDetail>(type, {\n detail: { value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n }\n\n /** The score a pointer at `event` over star `index` would pick. */\n private pointerValue(event: PointerEvent | MouseEvent, index: number) {\n if (this.step === 1) return index + 1;\n const star = event.currentTarget as HTMLElement;\n const rect = star.getBoundingClientRect();\n const offset = isRtl(this)\n ? rect.right - event.clientX\n : event.clientX - rect.left;\n return offset < rect.width / 2 ? index + 0.5 : index + 1;\n }\n\n private handleStarPointerMove(event: PointerEvent, index: number) {\n if (!this.isInteractive) return;\n this.hoverValue = this.pointerValue(event, index);\n }\n\n private handlePointerLeave() {\n this.hoverValue = undefined;\n }\n\n private handleStarClick(event: MouseEvent, index: number) {\n if (!this.isInteractive) return;\n const value = this.pointerValue(event, index);\n this.hoverValue = undefined;\n this.commit(this.clearable && value === this.shownValue ? 0 : value);\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (!this.isInteractive) return;\n const { step } = this;\n const current = this.shownValue;\n // Without `clearable`, the keys cannot go back to no score once there is one.\n const lowest = this.clearable || current === 0 ? 0 : step;\n const rtl = isRtl(this);\n let next: number | undefined;\n switch (event.key) {\n case 'ArrowUp':\n next = current + step;\n break;\n case 'ArrowDown':\n next = current - step;\n break;\n case 'ArrowRight':\n next = rtl ? current - step : current + step;\n break;\n case 'ArrowLeft':\n next = rtl ? current + step : current - step;\n break;\n case 'Home':\n next = lowest;\n break;\n case 'End':\n next = this.starCount;\n break;\n default:\n if (/^[0-9]$/.test(event.key) && !event.ctrlKey && !event.metaKey) {\n const digit = Number(event.key);\n if (digit <= this.starCount) next = digit;\n }\n }\n if (next === undefined) return;\n event.preventDefault();\n this.commit(Math.min(this.starCount, Math.max(lowest, next)));\n }\n\n /** A suggestion for a rating is a score. */\n protected override writeSuggestionValue(value: unknown): void {\n this.value = Number(value) || 0;\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderStar(index: number, shown: number) {\n const fill = Math.min(1, Math.max(0, shown - index));\n // The keyboard is handled by the slider around the stars; a star is only a pointer target.\n // eslint-disable-next-line lit-a11y/click-events-have-key-events\n return html`<span\n class=${classMap({ star: true, filled: fill === 1 })}\n style=${styleMap({ '--_fill': `${fill * 100}%` })}\n @pointermove=${(event: PointerEvent) =>\n this.handleStarPointerMove(event, index)}\n @click=${(event: MouseEvent) => this.handleStarClick(event, index)}\n >\n <wc-icon class=\"empty-icon\" name=${this.icon}></wc-icon>\n <span class=\"fill\"\n ><wc-icon class=\"filled-icon\" name=${`${this.icon}-fill`}></wc-icon\n ></span>\n </span>`;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n const labelId = `${this.idPrefix}-label`;\n const descriptionId = `${this.idPrefix}-description`;\n const errorText = this.error ? this.errorText : this.validationText;\n const description = errorText || this.suggestionReason || this.helperText;\n const shown = this.hoverValue ?? this.shownValue;\n const name = this.label || this.i18n.t('ratingLabel');\n const stars = Array.from({ length: this.starCount }, (_, index) =>\n this.renderStar(index, shown),\n );\n\n const display = this.readonly\n ? html`<div\n class=\"stars\"\n role=\"img\"\n aria-label=${this.i18n.t('ratingReadonly')(\n this.format(this.shownValue),\n this.format(this.starCount),\n )}\n aria-describedby=${description ? descriptionId : nothing}\n >\n ${stars}\n </div>`\n : html`<div\n class=\"stars\"\n role=\"slider\"\n tabindex=${this.disabled ? '-1' : '0'}\n aria-label=${this.label ? nothing : name}\n aria-labelledby=${this.label ? labelId : nothing}\n aria-describedby=${description ? descriptionId : nothing}\n aria-valuemin=\"0\"\n aria-valuemax=${this.starCount}\n aria-valuenow=${this.shownValue}\n aria-valuetext=${this.valueText(this.shownValue)}\n aria-invalid=${errorText || this.error ? 'true' : nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n @keydown=${this.handleKeyDown}\n @pointerleave=${this.handlePointerLeave}\n >\n ${stars}\n </div>`;\n\n return html`\n <div\n class=${classMap({\n rating: true,\n disabled: this.disabled,\n readonly: this.readonly,\n previewing: this.hoverValue !== undefined,\n 'has-error': this.error || !!errorText,\n })}\n >\n ${this.label\n ? this.labelWithSuggestion(\n html`<div class=\"label\" id=${labelId}>\n ${this.label}${this.required && !this.readonly\n ? html`<span class=\"required\" aria-hidden=\"true\">*</span>`\n : nothing}\n </div>`,\n )\n : this.suggestionBadge()}\n ${display}\n ${description\n ? html`<div class=\"helper\" id=${descriptionId}>${description}</div>`\n : nothing}\n </div>\n `;\n }\n}\n"],"names":["html","classMap","styleMap","nothing","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAI,WAAW,GAAG,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,SAAS,CAAA;AAA9B,IAAA,WAAA,GAAA;;;;;;QAUL,IAAA,CAAA,KAAK,GAAG,CAAC;;QAIT,IAAA,CAAA,GAAG,GAAG,CAAC;;QAIP,IAAA,CAAA,SAAS,GAAY,CAAC;;QAItB,IAAA,CAAA,SAAS,GAAG,KAAK;;QAIjB,IAAA,CAAA,KAAK,GAAG,EAAE;;QAIV,IAAA,CAAA,UAAU,GAAG,EAAE;;QAIf,IAAA,CAAA,KAAK,GAAG,KAAK;QAGb,IAAA,CAAA,SAAS,GAAG,EAAE;;QAId,IAAA,CAAA,IAAI,GAAS,IAAI;;QAIjB,IAAA,CAAA,IAAI,GAAG,MAAM;;QAiBI,IAAA,CAAA,QAAQ,GAAG,cAAc,WAAW,IAAI,CAAC,GAAG;;AAG5C,QAAA,IAAA,CAAA,IAAI,G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EAAA,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAId,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACV,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAKC,UAAA,CAAA;AAAhB,IAAAC,CAAK;AAA+B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAIZ,UAAA,CAAA;IAAxBC,CAAK,CAAC,QAAQ;AAAqC,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AA1DzC,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAgUlB;;;;"}
1
+ {"version":3,"file":"rating.js","sources":["../../src/rating/rating.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { isRtl } from '@/__internal/i18n/locale.js';\nimport {\n type FormRestoreState,\n type FormValue,\n getFormValue,\n} from '@/__internal/mixins/form-associated.js';\nimport type { Size } from '@/__internal/utils/size.js';\nimport IndividualComponent from '@/IndividualComponent.js';\n\nimport BaseInput, { type ControlValidity } from '../input/BaseInput.js';\nimport styles from './rating.scss';\n\n/** `detail` of `input` and `change`. */\nexport interface RatingChangeDetail {\n value: number;\n}\n\nlet ratingCount = 0;\n\n/**\n * @label Rating\n * @tag wc-rating\n * @rawTag rating\n *\n * @summary A star rating: pick how many stars, or show an average such as 4.3 out of 5.\n * @overview\n * <p>Rating lets the person pick a score from 1 to <code>max</code> (5 by default) by clicking a\n * star or with the keyboard. Pointing at the stars previews the score; nothing changes until the\n * click. With <code>precision=\"0.5\"</code> the left half of a star (the right half in right-to-left\n * layouts) picks a half star. With <code>clearable</code>, choosing the current score again clears\n * it.</p>\n * <p>It is one keyboard stop that follows the WAI-ARIA slider pattern: the arrow keys change the\n * score by one step (mirrored in right-to-left layouts), Home and End go to the lowest and highest\n * score, and the digit keys pick that many stars. Screen readers hear \"3 out of 5\".</p>\n * <p><code>readonly</code> turns it into a display, for example a product's average review: any\n * value is drawn with a partly filled star, and it is a single image named \"Rated 4.3 out of 5\".\n * Inside a <code>&lt;form&gt;</code> the score is submitted under <code>name</code>; no score submits\n * nothing, and <code>required</code> blocks submission until one is picked.</p>\n * <p>The stars are Material Symbols: <code>icon</code> names the empty shape and\n * <code>&lt;icon&gt;-fill</code> the filled one, so any symbol with a fill variant works\n * (<code>favorite</code>, <code>thumb_up</code>).</p>\n *\n * @fires {CustomEvent<{value: number}>} input - Dispatched when the person picks a score (not while previewing).\n * @fires {CustomEvent<{value: number}>} change - Dispatched with `input`, when the person picks a score. `0` means cleared.\n *\n * @cssprop --rating-filled-color - Color of filled stars.\n * @cssprop --rating-empty-color - Color of empty stars.\n * @cssprop --rating-icon-size - Size of one star; overrides `size`.\n *\n * @example\n * ```html\n * <wc-rating label=\"Your rating\" name=\"rating\"></wc-rating>\n * ```\n * @example\n * ```html\n * <wc-rating label=\"Average\" readonly value=\"4.3\"></wc-rating>\n * ```\n * @tags input, form\n */\n@IndividualComponent\nexport class Rating extends BaseInput {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n // `name` and `disabled` come from mixinFormAssociated; `readonly` and `required` from BaseInput.\n\n /** The score; `0` for none. Read-only ratings show any value, others snap to `precision`. */\n @property({ type: Number })\n value = 0;\n\n /** Number of stars, the highest score. */\n @property({ type: Number })\n max = 5;\n\n /** Step of the score: `1` for whole stars, `0.5` for half stars. */\n @property({ type: Number })\n precision: 1 | 0.5 = 1;\n\n /** Choosing the current score again, or going below the lowest, clears it to `0`. */\n @property({ type: Boolean })\n clearable = false;\n\n /** Label shown above the stars; also their accessible name. */\n @property({ type: String })\n label = '';\n\n /** Help text shown below the stars. */\n @property({ type: String, attribute: 'helper-text' })\n helperText = '';\n\n /** Shows the rating in its error state with `error-text`. */\n @property({ type: Boolean, reflect: true })\n error = false;\n\n /** Error message shown below the rating while `error` is set; replaces the help text. */\n @property({ type: String, attribute: 'error-text' })\n errorText = '';\n\n /** Size of the stars: `sm` (default), `md` or `lg`. */\n @property({ type: String, reflect: true })\n size: Size = 'sm';\n\n /** Material Symbols name of the empty star; `<icon>-fill` is the filled one. */\n @property({ type: String })\n icon = 'star';\n\n /** Locale for the spoken numbers; defaults to the nearest `lang`. */\n @property({ type: String })\n locale?: string;\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** The score under the pointer, previewed until it leaves or clicks. */\n @state() private hoverValue?: number;\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('.stars') private starsElement?: HTMLElement;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n private readonly idPrefix = `wc-rating-${(ratingCount += 1)}`;\n\n /** Peacock's strings for the value text. */\n private readonly i18n = new I18nController(this);\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.starsElement?.focus();\n }\n\n override blur() {\n this.starsElement?.blur();\n }\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected override computeValidity(): ControlValidity {\n if (this.required && !(this.value > 0) && !this.disabled) {\n return {\n flags: { valueMissing: true },\n message: this.valueMissingText(),\n };\n }\n return { flags: {}, message: '' };\n }\n\n protected override valueMissingText(): string {\n return this.i18n.t('valueMissingRating');\n }\n\n protected override validityAnchor() {\n return this.starsElement ?? undefined;\n }\n\n override [getFormValue](): FormValue | null {\n return this.value > 0 ? String(this.value) : null;\n }\n\n protected override parseRestoreState(restored: FormRestoreState): unknown {\n const value = typeof restored === 'string' ? Number(restored) : 0;\n return Number.isFinite(value) ? value : 0;\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private get step(): number {\n return Number(this.precision) === 0.5 ? 0.5 : 1;\n }\n\n private get starCount(): number {\n const max = Math.floor(Number(this.max));\n return Number.isFinite(max) && max > 0 ? max : 5;\n }\n\n private get isInteractive(): boolean {\n return !this.disabled && !this.readonly;\n }\n\n /** The value clamped to the stars, and in interactive mode snapped to the step. */\n private get shownValue(): number {\n const value = Math.min(\n this.starCount,\n Math.max(0, Number(this.value) || 0),\n );\n if (this.readonly) return value;\n return Math.round(value / this.step) * this.step;\n }\n\n private format(value: number): string {\n return new Intl.NumberFormat(this.i18n.locale, {\n maximumFractionDigits: 1,\n }).format(value);\n }\n\n private valueText(value: number): string {\n if (!(value > 0)) return this.i18n.t('ratingNoValue');\n return this.i18n.t('ratingValueText')(\n this.format(value),\n this.format(this.starCount),\n );\n }\n\n /** Sets the score from the person's action and fires `input` and `change`. */\n private commit(value: number) {\n if (!this.isInteractive || value === this.shownValue) return;\n this.value = value;\n for (const type of ['input', 'change']) {\n this.dispatchEvent(\n new CustomEvent<RatingChangeDetail>(type, {\n detail: { value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n }\n\n /** The score a pointer at `event` over star `index` would pick. */\n private pointerValue(event: PointerEvent | MouseEvent, index: number) {\n if (this.step === 1) return index + 1;\n const star = event.currentTarget as HTMLElement;\n const rect = star.getBoundingClientRect();\n const offset = isRtl(this)\n ? rect.right - event.clientX\n : event.clientX - rect.left;\n return offset < rect.width / 2 ? index + 0.5 : index + 1;\n }\n\n private handleStarPointerMove(event: PointerEvent, index: number) {\n if (!this.isInteractive) return;\n this.hoverValue = this.pointerValue(event, index);\n }\n\n private handlePointerLeave() {\n this.hoverValue = undefined;\n }\n\n private handleStarClick(event: MouseEvent, index: number) {\n if (!this.isInteractive) return;\n const value = this.pointerValue(event, index);\n this.hoverValue = undefined;\n this.commit(this.clearable && value === this.shownValue ? 0 : value);\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (!this.isInteractive) return;\n const { step } = this;\n const current = this.shownValue;\n // Without `clearable`, the keys cannot go back to no score once there is one.\n const lowest = this.clearable || current === 0 ? 0 : step;\n const rtl = isRtl(this);\n let next: number | undefined;\n switch (event.key) {\n case 'ArrowUp':\n next = current + step;\n break;\n case 'ArrowDown':\n next = current - step;\n break;\n case 'ArrowRight':\n next = rtl ? current - step : current + step;\n break;\n case 'ArrowLeft':\n next = rtl ? current + step : current - step;\n break;\n case 'Home':\n next = lowest;\n break;\n case 'End':\n next = this.starCount;\n break;\n default:\n if (/^[0-9]$/.test(event.key) && !event.ctrlKey && !event.metaKey) {\n const digit = Number(event.key);\n if (digit <= this.starCount) next = digit;\n }\n }\n if (next === undefined) return;\n event.preventDefault();\n this.commit(Math.min(this.starCount, Math.max(lowest, next)));\n }\n\n /** A suggestion for a rating is a score. */\n protected override writeSuggestionValue(value: unknown): void {\n this.value = Number(value) || 0;\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderStar(index: number, shown: number) {\n const fill = Math.min(1, Math.max(0, shown - index));\n // The keyboard is handled by the slider around the stars; a star is only a pointer target.\n // eslint-disable-next-line lit-a11y/click-events-have-key-events\n return html`<span\n class=${classMap({ star: true, filled: fill === 1 })}\n style=${styleMap({ '--_fill': `${fill * 100}%` })}\n @pointermove=${(event: PointerEvent) =>\n this.handleStarPointerMove(event, index)}\n @click=${(event: MouseEvent) => this.handleStarClick(event, index)}\n >\n <wc-icon class=\"empty-icon\" name=${this.icon}></wc-icon>\n <span class=\"fill\"\n ><wc-icon class=\"filled-icon\" name=${`${this.icon}-fill`}></wc-icon\n ></span>\n </span>`;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n const labelId = `${this.idPrefix}-label`;\n const descriptionId = `${this.idPrefix}-description`;\n const errorText = this.error ? this.errorText : this.validationText;\n const description = errorText || this.suggestionReason || this.helperText;\n const shown = this.hoverValue ?? this.shownValue;\n const name = this.label || this.i18n.t('ratingLabel');\n const stars = Array.from({ length: this.starCount }, (_, index) =>\n this.renderStar(index, shown),\n );\n\n const display = this.readonly\n ? html`<div\n class=\"stars\"\n role=\"img\"\n aria-label=${this.i18n.t('ratingReadonly')(\n this.format(this.shownValue),\n this.format(this.starCount),\n )}\n aria-describedby=${description ? descriptionId : nothing}\n >\n ${stars}\n </div>`\n : html`<div\n class=\"stars\"\n role=\"slider\"\n tabindex=${this.disabled ? '-1' : '0'}\n aria-label=${this.label ? nothing : name}\n aria-labelledby=${this.label ? labelId : nothing}\n aria-describedby=${description ? descriptionId : nothing}\n aria-valuemin=\"0\"\n aria-valuemax=${this.starCount}\n aria-valuenow=${this.shownValue}\n aria-valuetext=${this.valueText(this.shownValue)}\n aria-invalid=${errorText || this.error ? 'true' : nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n @keydown=${this.handleKeyDown}\n @pointerleave=${this.handlePointerLeave}\n >\n ${stars}\n </div>`;\n\n return html`\n <div\n class=${classMap({\n rating: true,\n disabled: this.disabled,\n readonly: this.readonly,\n previewing: this.hoverValue !== undefined,\n 'has-error': this.error || !!errorText,\n })}\n >\n ${this.label\n ? this.labelWithSuggestion(\n html`<div class=\"label\" id=${labelId}>\n ${this.label}${this.required && !this.readonly\n ? html`<span class=\"required\" aria-hidden=\"true\">*</span>`\n : nothing}\n </div>`,\n )\n : this.suggestionBadge()}\n ${display}\n ${description\n ? html`<div class=\"helper\" id=${descriptionId}>${description}</div>`\n : nothing}\n </div>\n `;\n }\n}\n"],"names":["html","classMap","styleMap","nothing","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAI,WAAW,GAAG,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,SAAS,CAAA;AAA9B,IAAA,WAAA,GAA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AI,EAAE;AAC5B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAId,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE;AACpC,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAIf,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACvB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAIlB,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACZ,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAId,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACV,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAKC,UAAA,CAAA;AAAhB,IAAAC,CAAK;AAA+B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAIZ,UAAA,CAAA;IAAxBC,CAAK,CAAC,QAAQ;AAAqC,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AA3DzC,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAiUlB;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { i, _ as __decorate, I as IndividualComponent, a as i$1, w, A, b } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { o } from './style-map-CHOg6N_R.js';
4
- import { I as I18nController } from './i18n-controller-urcQKYGe.js';
4
+ import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
5
5
  import './directive-ZPhl09Yt.js';
6
- import './strings-DmbqMTfs.js';
6
+ import './strings-BJPuhKJk.js';
7
7
  import './locale-DEsJZCQG.js';
8
8
 
9
9
  var css_248z = i`* {
@@ -1,8 +1,8 @@
1
1
  import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
- import { I as I18nController } from './i18n-controller-urcQKYGe.js';
3
+ import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
4
4
  import { p as parseDatetime, w as watchRelativeTime, c as parseDuration, f as formatAbsoluteTime, b as formatTime } from './relative-time-BVQXLuHm.js';
5
- import './strings-DmbqMTfs.js';
5
+ import './strings-BJPuhKJk.js';
6
6
  import './locale-DEsJZCQG.js';
7
7
 
8
8
  var css_248z = i`* {
@@ -3,12 +3,12 @@ import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { r as r$1 } from './query-all-ThKhg-Lp.js';
5
5
  import { e } from './class-map-NDIkZErE.js';
6
- import { I as I18nController } from './i18n-controller-urcQKYGe.js';
6
+ import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
7
7
  import { i as isRtl } from './locale-DEsJZCQG.js';
8
8
  import { Panel } from './panel.js';
9
9
  import './base-Cl6v8-BZ.js';
10
10
  import './directive-ZPhl09Yt.js';
11
- import './strings-DmbqMTfs.js';
11
+ import './strings-BJPuhKJk.js';
12
12
 
13
13
  var css_248z = i`* {
14
14
  box-sizing: border-box;
@@ -5,8 +5,8 @@ import { e } from './query-CHb9Ft_d.js';
5
5
  import { e as e$1 } from './class-map-NDIkZErE.js';
6
6
  import { o } from './style-map-CHOg6N_R.js';
7
7
  import { b as blocksFor, R as RichTextMentionController, a as RichTextAiController, c as RichTextSlashController, d as RichTextLinkController, e as RichTextBubbleController, f as RichTextBlockHandleController, B as BLOCKS, S as SET_VALUE_META, E as Editor, g as buildExtensions, h as activeTextStyle, m as marksFor } from './slash-controller-DAsDquPA.js';
8
- import { B as BaseInput } from './BaseInput-CcMfg1Y2.js';
9
- import { I as I18nController } from './i18n-controller-urcQKYGe.js';
8
+ import { B as BaseInput } from './BaseInput-mWdyYv27.js';
9
+ import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
10
10
 
11
11
  /** The table commands offered while the caret is in a table. */
12
12
  const TABLE_ACTIONS = [
@@ -656,4 +656,4 @@ __decorate([
656
656
  ], RichTextInput.prototype, "editorRoot", void 0);
657
657
 
658
658
  export { RichTextInput as R };
659
- //# sourceMappingURL=rich-text-input-DLICqof1.js.map
659
+ //# sourceMappingURL=rich-text-input-DM_BOzgk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-input-DLICqof1.js","sources":["../../src/__internal/rich-text/rich-text-input.ts"],"sourcesContent":["import { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { Editor, type Content, type Extensions } from '@tiptap/core';\n\nimport BaseInput, { type ControlValidity } from '../../input/BaseInput.js';\nimport { I18nController } from '../i18n/i18n-controller.js';\nimport type { PeacockStrings } from '../i18n/strings.js';\nimport type { MentionSuggestion } from '../../mention-input/mention-model.js';\nimport { RichTextAiController } from './ai-controller.js';\nimport { RichTextBlockHandleController } from './block-handle-controller.js';\nimport { RichTextBubbleController } from './bubble-controller.js';\nimport {\n activeTextStyle,\n BLOCKS,\n blocksFor,\n marksFor,\n type BlockCommand,\n} from './commands.js';\nimport {\n buildExtensions,\n SET_VALUE_META,\n type RichTextProfile,\n} from './extensions.js';\nimport { RichTextLinkController } from './link-controller.js';\nimport {\n RichTextMentionController,\n type RichTextMentionHost,\n} from './mention-controller.js';\nimport { RichTextSlashController } from './slash-controller.js';\n\n/** What the editor's constructor takes as its first content. */\nexport interface RichTextContent {\n content: Content;\n contentType?: 'markdown' | 'html' | 'json';\n}\n\n/** The table commands offered while the caret is in a table. */\nconst TABLE_ACTIONS = [\n 'addRowBelow',\n 'addColumnAfter',\n 'deleteRow',\n 'deleteColumn',\n 'deleteTable',\n] as const;\n\ntype TableAction = (typeof TABLE_ACTIONS)[number];\n\n/**\n * The shared base of Peacock's rich-text fields (`wc-markdown-editor`, `wc-html-editor`,\n * `wc-comment-composer`): a form-associated Tiptap editor inside `wc-field`, with a fixed toolbar,\n * a selection bubble, a slash menu, a link editor, a block handle, mentions and a source view.\n *\n * Subclasses say what the value is: the editor `profile`, how to read the value from the editor and\n * write it back, and the source language. Everything else, including the events, is here:\n * - `input` with `{ value }`, `debounce` milliseconds after the content stops changing;\n * - `change` with `{ value }` when focus leaves after an edit;\n * - `search` and `mention`, as on `wc-mention-input`.\n *\n * With a provider that offers them (ADR-030002), the editors also get AI actions on the selection\n * (from the bubble and the toolbar), Continue writing and Summarize above in the slash menu, and,\n * with `ai-completion`, ghost text. Results show in a preview until the person accepts them.\n */\nexport default abstract class RichTextInput\n extends BaseInput\n implements RichTextMentionHost\n{\n // ── Properties ────────────────────────────────────────────────────────────\n\n /** The value: Markdown or HTML, depending on the editor. */\n @property({ type: String })\n value = '';\n\n /** Label shown above the editor. */\n @property({ type: String })\n label = '';\n\n /** Text shown while the editor is empty. Each editor has its own default. */\n @property({ type: String })\n placeholder = '';\n\n /** Visual style of the field. */\n @property({ type: String })\n variant: 'filled' | 'outlined' | 'default' = 'default';\n\n /** Size of the text: `sm` or `md`. */\n @property({ type: String, reflect: true })\n size: 'sm' | 'md' = 'md';\n\n /** Help shown below the editor. */\n @property({ type: String, attribute: 'helper-text' })\n helperText = '';\n\n /** Shows the error state. */\n @property({ type: Boolean })\n error = false;\n\n /** The error message shown with `error`. */\n @property({ type: String, attribute: 'error-text' })\n errorText = '';\n\n /** Milliseconds without typing before `input` fires. */\n @property({ type: Number })\n debounce = 250;\n\n /** Hides the fixed toolbar; formatting stays available from the selection bubble, `/` and shortcuts. */\n @property({ type: Boolean, attribute: 'hide-toolbar' })\n hideToolbar = false;\n\n /** Maximum number of characters of text. Typing stops there, and a count shows below. */\n @property({ type: Number, attribute: 'maxlength' })\n maxlength?: number;\n\n /** Height of the empty editor, in lines. */\n @property({ type: Number })\n rows = 4;\n\n /** Lines the editor grows to before it scrolls. Without it, it keeps growing. */\n @property({ type: Number, attribute: 'max-rows' })\n maxRows?: number;\n\n /** Characters that start a mention, such as `\"@\"` or `\"@#\"`. Empty turns mentions off. */\n @property({ type: String })\n triggers = '@';\n\n /** Suggestions for the mention being typed; set them in answer to `search`. */\n @property({ attribute: false })\n suggestions: MentionSuggestion[] = [];\n\n /** Shows a loading row in the mention list while the app looks for suggestions. */\n @property({ type: Boolean, attribute: 'suggestions-loading' })\n suggestionsLoading = false;\n\n /** Overrides Peacock's strings for this instance only. */\n @property({ attribute: false })\n strings?: Partial<PeacockStrings>;\n\n /**\n * Suggests how to go on after a pause in typing, as ghost text at the end of the paragraph: Tab\n * takes it, Mod+→ takes a word, Escape dismisses it. Needs a provider with `complete`.\n */\n @property({ type: Boolean, reflect: true, attribute: 'ai-completion' })\n aiCompletion = false;\n\n /** Turns the AI actions and ghost text off for this editor, even when the page offers them. */\n @property({ type: Boolean, reflect: true, attribute: 'no-ai' })\n noAi = false;\n\n // ── State ─────────────────────────────────────────────────────────────────\n\n /** Whether the editor has focus. */\n @state() protected editorFocused = false;\n\n /** Whether the source view is showing. */\n @state() protected sourceView = false;\n\n // ── Queries ───────────────────────────────────────────────────────────────\n\n @query('.editor-root')\n private editorRoot?: HTMLElement;\n\n // ── Protected fields ──────────────────────────────────────────────────────\n\n /** The Tiptap editor, once created. */\n protected editor?: Editor;\n\n protected readonly i18n = new I18nController(this);\n\n protected readonly mentions = new RichTextMentionController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n });\n\n protected readonly ai = new RichTextAiController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n });\n\n protected readonly slash = new RichTextSlashController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n actions: () => this.ai.slashActions(),\n });\n\n protected readonly link = new RichTextLinkController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n });\n\n protected readonly bubble = new RichTextBubbleController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n allowed: () =>\n this.selectionBubble &&\n !this.sourceView &&\n !this.link.open &&\n !this.slash.visible &&\n !this.mentions.visible &&\n !this.ai.open,\n editLink: () => this.link.show(),\n extra: () => this.bubbleExtra(),\n });\n\n protected readonly blockHandle = new RichTextBlockHandleController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n allowed: () => !this.sourceView && this.showBlockHandle,\n insertAfter: position => this.slash.openAfterBlock(position),\n });\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n private inputTimer?: number;\n\n private focusWithin = false;\n\n private valueAtFocus = '';\n\n // ── Abstract ──────────────────────────────────────────────────────────────\n\n /** Which nodes and marks the editor allows. */\n protected abstract readonly profile: RichTextProfile;\n\n /** The language of the source view. */\n protected abstract readonly sourceLanguage: 'markdown' | 'html';\n\n /** The icon of the source toggle. */\n protected abstract readonly sourceIcon: string;\n\n /** The value as the editor holds it now. */\n protected abstract readFromEditor(editor: Editor): string;\n\n /** The editor's content for a value. */\n protected abstract contentFor(value: string): RichTextContent;\n\n /** The placeholder when `placeholder` is empty. */\n protected abstract defaultPlaceholder(): string;\n\n /** Whether the block handle shows; the comment composer turns it off. */\n protected get showBlockHandle(): boolean {\n return true;\n }\n\n /** Whether `/` opens the block menu; the prompt input, which holds no blocks, turns it off. */\n protected get slashMenu(): boolean {\n return true;\n }\n\n /** Whether selecting text shows the selection bubble; the prompt input turns it off. */\n protected get selectionBubble(): boolean {\n return true;\n }\n\n /** Extensions a subclass adds, such as keyboard shortcuts. */\n protected extraExtensions(): Extensions {\n return [];\n }\n\n /** Buttons added to the selection bubble after the marks and link; Ask AI by default. */\n protected bubbleExtra(): TemplateResult | typeof nothing {\n return this.ai.bubbleButton();\n }\n\n /** The block tools in the toolbar: every block the schema allows except text styles. */\n protected toolbarBlocks(editor: Editor): BlockCommand[] {\n return blocksFor(editor).filter(block => !block.textStyle);\n }\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.addEventListener('focusin', this.onFocusIn);\n this.addEventListener('focusout', this.onFocusOut);\n }\n\n override connectedCallback() {\n super.connectedCallback();\n // Reconnected after a move: the editor was destroyed on disconnect.\n if (this.hasUpdated && !this.editor) this.createEditor();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.flushInput();\n this.destroyEditor();\n }\n\n protected override firstUpdated() {\n this.createEditor();\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n super.willUpdate(changed);\n // Load a new value before validity is computed in updated().\n const { editor } = this;\n if (!editor || !changed.has('value')) return;\n const current = this.normalizeValue(this.readFromEditor(editor));\n if (current === this.normalizeValue(this.value)) return;\n const { content, contentType } = this.contentFor(this.value);\n editor\n .chain()\n .setMeta(SET_VALUE_META, true)\n .setContent(content, { emitUpdate: false, contentType })\n .run();\n }\n\n protected override updated(changed: PropertyValues<this>) {\n super.updated(changed);\n const { editor } = this;\n if (!editor) return;\n\n if (changed.has('triggers') || changed.has('maxlength')) {\n this.destroyEditor();\n this.createEditor();\n return;\n }\n\n if (changed.has('disabled') || changed.has('readonly')) {\n editor.setEditable(!(this.disabled || this.readonly));\n }\n\n if (changed.has('placeholder') || changed.has('strings')) {\n // The placeholder is a decoration; an empty transaction redraws it.\n editor.view.dispatch(editor.state.tr.setMeta('placeholder', true));\n }\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n override focus(options?: Parameters<HTMLElement['focus']>[0]) {\n if (this.editor && !this.sourceView) this.editor.commands.focus();\n else super.focus(options);\n }\n\n // ── Protected methods ─────────────────────────────────────────────────────\n\n /** Line endings and trailing whitespace do not count as changes. */\n protected normalizeValue(value: string): string {\n return (value ?? '').replace(/\\r\\n/g, '\\n').replace(/\\s+$/, '');\n }\n\n protected override computeValidity(): ControlValidity {\n const base = super.computeValidity();\n if (Object.values(base.flags).some(Boolean)) return base;\n const max = this.maxlength;\n if (typeof max === 'number' && max >= 0 && this.characters() > max) {\n return {\n flags: { tooLong: true },\n message: this.i18n.t('richTextTooLong')(max),\n };\n }\n return base;\n }\n\n /** The number of characters of text, as `maxlength` counts them. */\n protected characters(): number {\n return this.editor?.state.doc.textContent.length ?? 0;\n }\n\n /** Whether the editor holds nothing: a single empty paragraph. */\n protected isEditorEmpty(editor: Editor): boolean {\n const { doc } = editor.state;\n const first = doc.firstChild;\n return (\n doc.childCount <= 1 &&\n (!first || (first.type.name === 'paragraph' && first.content.size === 0))\n );\n }\n\n /** Runs an editor command, unless the editor is disabled or read-only. */\n protected run(command: (editor: Editor) => void) {\n const { editor } = this;\n if (!editor || this.disabled || this.readonly) return;\n command(editor);\n }\n\n // ── Private methods: editor ───────────────────────────────────────────────\n\n private createEditor() {\n const root = this.editorRoot;\n if (!root || this.editor) return;\n const { content, contentType } = this.contentFor(this.value);\n this.editor = new Editor({\n element: root,\n extensions: buildExtensions(this.profile, {\n placeholder: () => this.placeholder || this.defaultPlaceholder(),\n maxlength: this.maxlength,\n mentions: this.triggers ? this.mentions.suggestionOptions() : [],\n extra: [\n this.ai.extension(),\n ...(this.slashMenu ? [this.slash.extension()] : []),\n this.link.extension(),\n this.blockHandle.extension(),\n ...this.extraExtensions(),\n ],\n }),\n content,\n contentType,\n editable: !(this.disabled || this.readonly),\n editorProps: {\n attributes: {\n role: 'textbox',\n 'aria-multiline': 'true',\n 'aria-label':\n this.label || this.placeholder || this.defaultPlaceholder(),\n },\n },\n onFocus: () => {\n this.editorFocused = true;\n },\n onBlur: () => {\n this.editorFocused = false;\n },\n onUpdate: () => this.onEditorUpdate(),\n onTransaction: () => this.requestUpdate(),\n });\n this.requestUpdate();\n }\n\n private destroyEditor() {\n this.editor?.destroy();\n this.editor = undefined;\n }\n\n private onEditorUpdate() {\n const { editor } = this;\n if (!editor) return;\n const next = this.normalizeValue(this.readFromEditor(editor));\n if (next === this.normalizeValue(this.value)) return;\n this.value = next;\n this.queueInput();\n }\n\n // ── Private methods: events ───────────────────────────────────────────────\n\n private emit(type: 'input' | 'change') {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private queueInput() {\n window.clearTimeout(this.inputTimer);\n this.inputTimer = window.setTimeout(() => {\n this.inputTimer = undefined;\n this.emit('input');\n }, this.debounce);\n }\n\n /** Fires a pending `input` now. */\n private flushInput() {\n if (this.inputTimer === undefined) return;\n window.clearTimeout(this.inputTimer);\n this.inputTimer = undefined;\n this.emit('input');\n }\n\n private onFocusIn = () => {\n if (this.focusWithin) return;\n this.focusWithin = true;\n this.valueAtFocus = this.value;\n };\n\n private onFocusOut = (event: FocusEvent) => {\n // Focus moving between parts of the editor arrives retargeted to the host.\n const next = event.relatedTarget as Node | null;\n if (next && (next === this || this.contains(next))) return;\n this.focusWithin = false;\n this.flushInput();\n if (this.value === this.valueAtFocus) return;\n this.valueAtFocus = this.value;\n this.emit('change');\n };\n\n private onSourceInput = (event: CustomEvent<{ value: string }>) => {\n event.stopPropagation();\n const next = event.detail?.value ?? '';\n if (next === this.value) return;\n this.value = next;\n this.queueInput();\n };\n\n private toggleSource = () => {\n const { editor } = this;\n if (editor && !this.sourceView) {\n // Take the editor's latest value before showing it as source.\n this.value = this.normalizeValue(this.readFromEditor(editor));\n }\n this.sourceView = !this.sourceView;\n if (!this.sourceView) {\n this.updateComplete.then(() => this.editor?.commands.focus());\n }\n };\n\n private onTextStyle = (event: CustomEvent<{ item: HTMLElement }>) => {\n event.stopPropagation();\n const id = event.detail.item.getAttribute('value');\n const block: BlockCommand | undefined = BLOCKS.find(b => b.id === id);\n if (block) this.run(editor => block.run(editor.chain().focus()).run());\n };\n\n private onTableAction = (event: CustomEvent<{ item: HTMLElement }>) => {\n event.stopPropagation();\n const action = event.detail.item.getAttribute('value') as TableAction;\n this.run(editor => {\n const chain = editor.chain().focus();\n const commands: Record<TableAction, () => boolean> = {\n addRowBelow: () => chain.addRowAfter().run(),\n addColumnAfter: () => chain.addColumnAfter().run(),\n deleteRow: () => chain.deleteRow().run(),\n deleteColumn: () => chain.deleteColumn().run(),\n deleteTable: () => chain.deleteTable().run(),\n };\n commands[action]?.();\n });\n };\n\n // ── Render helpers ────────────────────────────────────────────────────────\n\n protected toolButton(\n icon: string,\n label: string,\n action: () => void,\n selected?: boolean,\n ): TemplateResult {\n return html`<wc-icon-button\n class=\"tool\"\n variant=\"text\"\n color=\"surface\"\n shape=\"round\"\n size=\"xs\"\n ?toggle=${selected !== undefined}\n ?selected=${!!selected}\n ?disabled=${this.disabled || this.readonly}\n aria-label=${label}\n tooltip=${label}\n @click=${action}\n ><wc-icon name=${icon}></wc-icon\n ></wc-icon-button>`;\n }\n\n private renderTextStyle(editor: Editor) {\n const styles = blocksFor(editor).filter(block => block.textStyle);\n if (styles.length < 2) return nothing;\n const active = activeTextStyle(editor);\n return html`<wc-dropdown-button\n class=\"text-style\"\n size=\"xs\"\n variant=\"text\"\n color=\"surface\"\n aria-label=${this.i18n.t('textStyle')}\n ?disabled=${this.disabled || this.readonly}\n @menu-item-activate=${this.onTextStyle}\n >\n ${this.i18n.t(active?.id ?? 'paragraph')}\n ${styles.map(\n block =>\n html`<wc-menu-item\n slot=\"menu\"\n type=\"radio\"\n value=${block.id}\n ?selected=${block === active}\n >${this.i18n.t(block.id)}</wc-menu-item\n >`,\n )}\n </wc-dropdown-button>\n <wc-divider orientation=\"vertical\"></wc-divider>`;\n }\n\n private renderTableTools(editor: Editor) {\n if (!editor.isActive('table')) return nothing;\n return html`<wc-divider orientation=\"vertical\"></wc-divider>\n <wc-dropdown-button\n class=\"table-tools\"\n size=\"xs\"\n variant=\"text\"\n color=\"surface\"\n ?disabled=${this.disabled || this.readonly}\n @menu-item-activate=${this.onTableAction}\n >\n ${this.i18n.t('table')}\n ${TABLE_ACTIONS.map(\n action =>\n html`<wc-menu-item slot=\"menu\" value=${action}\n >${this.i18n.t(action)}</wc-menu-item\n >`,\n )}\n </wc-dropdown-button>`;\n }\n\n /** The formatting tools: text style, marks, link, blocks, mention and table actions. */\n protected renderTools(editor: Editor): TemplateResult {\n const { i18n } = this;\n return html`${this.renderTextStyle(editor)}\n ${marksFor(editor).map(mark =>\n this.toolButton(\n mark.icon,\n i18n.t(mark.id),\n () => this.run(e => mark.run(e.chain().focus()).run()),\n editor.isActive(mark.mark),\n ),\n )}\n ${editor.schema.marks.link\n ? this.toolButton(\n 'link',\n i18n.t('link'),\n () => this.link.show(),\n editor.isActive('link'),\n )\n : nothing}\n <wc-divider orientation=\"vertical\"></wc-divider>\n ${this.toolbarBlocks(editor).map(block =>\n this.toolButton(\n block.icon,\n i18n.t(block.id),\n () => this.run(e => block.run(e.chain().focus()).run()),\n block.id === 'divider' || block.id === 'table'\n ? undefined\n : block.active(editor),\n ),\n )}\n ${this.triggers\n ? this.toolButton('alternate_email', i18n.t('mentionSomeone'), () =>\n this.mentions.insertTrigger(),\n )\n : nothing}\n ${this.renderTableTools(editor)} ${this.ai.toolbarButton()}`;\n }\n\n /** Keeps the editor's selection when a tool is pressed. */\n protected keepSelection = (event: MouseEvent) => {\n if (!this.sourceView) event.preventDefault();\n };\n\n private renderToolbar() {\n if (this.hideToolbar) return nothing;\n const { editor, i18n } = this;\n return html`<wc-toolbar\n class=\"toolbar\"\n variant=\"flat\"\n aria-label=${i18n.t('formattingToolbar')}\n @mousedown=${this.keepSelection}\n >\n ${editor && !this.sourceView ? this.renderTools(editor) : nothing}\n <span class=\"toolbar-spacer\" aria-hidden=\"true\"></span>\n <wc-icon-button\n class=\"tool source-toggle\"\n variant=\"text\"\n color=\"surface\"\n shape=\"round\"\n size=\"xs\"\n toggle\n ?selected=${this.sourceView}\n ?disabled=${this.disabled}\n aria-label=${i18n.t('viewSource')}\n tooltip=${i18n.t('viewSource')}\n @click=${this.toggleSource}\n ><wc-icon name=${this.sourceIcon}></wc-icon\n ></wc-icon-button>\n </wc-toolbar>`;\n }\n\n protected renderStateTag() {\n if (this.disabled) {\n return html`<wc-tag class=\"state-tag\" intent=\"danger\"\n >${this.i18n.t('disabled')}</wc-tag\n >`;\n }\n if (this.readonly) {\n return html`<wc-tag class=\"state-tag\" intent=\"danger\"\n >${this.i18n.t('readOnlyTag')}</wc-tag\n >`;\n }\n return nothing;\n }\n\n /** The count below the field, with `maxlength`. */\n private textCount(): string {\n const max = this.maxlength;\n if (typeof max !== 'number' || max < 0) return '';\n return this.i18n.t('characterCount')(this.characters(), max);\n }\n\n /**\n * A block dragged with the handle drops anywhere in the area, padding included, by height. The\n * listeners capture, so ProseMirror's own drop handling never sees these drags. `dragenter` is\n * cancelled too: outside editable content the browser only drops where it was.\n */\n private readonly areaDragOver = {\n handleEvent: (event: DragEvent) => this.blockHandle.dragOver(event),\n capture: true,\n };\n\n private readonly areaDrop = {\n handleEvent: (event: DragEvent) => this.blockHandle.drop(event),\n capture: true,\n };\n\n /** The editable area: Tiptap mounts into `.editor-root`. */\n protected renderEditorArea(): TemplateResult {\n const lines: Record<string, string> = { '--_rows': String(this.rows) };\n if (this.maxRows) lines['--_max-rows'] = String(this.maxRows);\n return html`<div\n class=${classMap({\n 'editor-area': true,\n hidden: this.sourceView,\n 'with-handle': this.showBlockHandle && !this.disabled && !this.readonly,\n })}\n style=${styleMap(lines)}\n @input=${(event: Event) => event.stopPropagation()}\n @beforeinput=${(event: Event) => event.stopPropagation()}\n @dragenter=${this.areaDragOver}\n @dragover=${this.areaDragOver}\n @drop=${this.areaDrop}\n >\n <div class=\"editor-root\"></div>\n </div>`;\n }\n\n /** The mention list, slash menu, selection bubble, link editor and block handle. */\n protected renderPopups(): TemplateResult {\n return html`${this.mentions.render()}\n <span class=\"slash-anchor\" aria-hidden=\"true\"></span>\n ${this.slash.render()} ${this.bubble.render()} ${this.link.render()}\n ${this.blockHandle.render()} ${this.blockHandle.renderDropLine()}\n ${this.ai.render()}`;\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n render() {\n const empty = !this.value || !this.value.trim();\n const { validationText } = this;\n return html`\n <wc-field\n class=${classMap({\n 'rich-text-field': true,\n 'max-rows': !!this.maxRows,\n })}\n label=${this.label}\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?skeleton=${this.skeleton}\n ?focused=${this.editorFocused}\n ?error=${this.error || !!validationText}\n error-text=${this.error ? this.errorText : validationText}\n helper-text=${this.helperText}\n text-count=${this.textCount()}\n variant=${this.variant}\n ?populated=${!empty}\n .host=${this}\n >\n <div class=\"shell\">\n ${this.renderToolbar()} ${this.renderEditorArea()}\n ${this.sourceView\n ? html`<div class=\"source\">\n <wc-code-editor\n language=${this.sourceLanguage}\n size=${this.size}\n wrap\n .value=${this.value}\n ?readonly=${this.readonly}\n ?disabled=${this.disabled}\n @input=${this.onSourceInput}\n @change=${(event: Event) => event.stopPropagation()}\n ></wc-code-editor>\n </div>`\n : nothing}\n ${this.renderStateTag()}\n </div>\n </wc-field>\n ${this.renderPopups()}\n `;\n }\n}\n"],"names":["html","nothing","classMap","styleMap","property","state","query"],"mappings":";;;;;;;;;;AAsCA;AACA,MAAM,aAAa,GAAG;IACpB,aAAa;IACb,gBAAgB;IAChB,WAAW;IACX,cAAc;IACd,aAAa;CACL;AAIV;;;;;;;;;;;;;;AAcG;AACW,MAAgB,aAC5B,SAAQ,SAAS,CAAA;;AA+KjB,IAAA,IAAc,eAAe,GAAA;AAC3B,QAAA,OAAO,IAAI;IACb;;AAGA,IAAA,IAAc,SAAS,GAAA;AACrB,QAAA,OAAO,IAAI;IACb;;AAGA,IAAA,IAAc,eAAe,GAAA;AAC3B,QAAA,OAAO,IAAI;IACb;;IAGU,eAAe,GAAA;AACvB,QAAA,OAAO,EAAE;IACX;;IAGU,WAAW,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE;IAC/B;;AAGU,IAAA,aAAa,CAAC,MAAc,EAAA;AACpC,QAAA,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,KAAK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AA,CAAK;AAAgC,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAK9B,UAAA,CAAA;IADPC,CAAK,CAAC,cAAc;AACY,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"rich-text-input-DM_BOzgk.js","sources":["../../src/__internal/rich-text/rich-text-input.ts"],"sourcesContent":["import { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { Editor, type Content, type Extensions } from '@tiptap/core';\n\nimport BaseInput, { type ControlValidity } from '../../input/BaseInput.js';\nimport { I18nController } from '../i18n/i18n-controller.js';\nimport type { PeacockStrings } from '../i18n/strings.js';\nimport type { MentionSuggestion } from '../../mention-input/mention-model.js';\nimport { RichTextAiController } from './ai-controller.js';\nimport { RichTextBlockHandleController } from './block-handle-controller.js';\nimport { RichTextBubbleController } from './bubble-controller.js';\nimport {\n activeTextStyle,\n BLOCKS,\n blocksFor,\n marksFor,\n type BlockCommand,\n} from './commands.js';\nimport {\n buildExtensions,\n SET_VALUE_META,\n type RichTextProfile,\n} from './extensions.js';\nimport { RichTextLinkController } from './link-controller.js';\nimport {\n RichTextMentionController,\n type RichTextMentionHost,\n} from './mention-controller.js';\nimport { RichTextSlashController } from './slash-controller.js';\n\n/** What the editor's constructor takes as its first content. */\nexport interface RichTextContent {\n content: Content;\n contentType?: 'markdown' | 'html' | 'json';\n}\n\n/** The table commands offered while the caret is in a table. */\nconst TABLE_ACTIONS = [\n 'addRowBelow',\n 'addColumnAfter',\n 'deleteRow',\n 'deleteColumn',\n 'deleteTable',\n] as const;\n\ntype TableAction = (typeof TABLE_ACTIONS)[number];\n\n/**\n * The shared base of Peacock's rich-text fields (`wc-markdown-editor`, `wc-html-editor`,\n * `wc-comment-composer`): a form-associated Tiptap editor inside `wc-field`, with a fixed toolbar,\n * a selection bubble, a slash menu, a link editor, a block handle, mentions and a source view.\n *\n * Subclasses say what the value is: the editor `profile`, how to read the value from the editor and\n * write it back, and the source language. Everything else, including the events, is here:\n * - `input` with `{ value }`, `debounce` milliseconds after the content stops changing;\n * - `change` with `{ value }` when focus leaves after an edit;\n * - `search` and `mention`, as on `wc-mention-input`.\n *\n * With a provider that offers them (ADR-030002), the editors also get AI actions on the selection\n * (from the bubble and the toolbar), Continue writing and Summarize above in the slash menu, and,\n * with `ai-completion`, ghost text. Results show in a preview until the person accepts them.\n */\nexport default abstract class RichTextInput\n extends BaseInput\n implements RichTextMentionHost\n{\n // ── Properties ────────────────────────────────────────────────────────────\n\n /** The value: Markdown or HTML, depending on the editor. */\n @property({ type: String })\n value = '';\n\n /** Label shown above the editor. */\n @property({ type: String })\n label = '';\n\n /** Text shown while the editor is empty. Each editor has its own default. */\n @property({ type: String })\n placeholder = '';\n\n /** Visual style of the field. */\n @property({ type: String })\n variant: 'filled' | 'outlined' | 'default' = 'default';\n\n /** Size of the text: `sm` or `md`. */\n @property({ type: String, reflect: true })\n size: 'sm' | 'md' = 'md';\n\n /** Help shown below the editor. */\n @property({ type: String, attribute: 'helper-text' })\n helperText = '';\n\n /** Shows the error state. */\n @property({ type: Boolean })\n error = false;\n\n /** The error message shown with `error`. */\n @property({ type: String, attribute: 'error-text' })\n errorText = '';\n\n /** Milliseconds without typing before `input` fires. */\n @property({ type: Number })\n debounce = 250;\n\n /** Hides the fixed toolbar; formatting stays available from the selection bubble, `/` and shortcuts. */\n @property({ type: Boolean, attribute: 'hide-toolbar' })\n hideToolbar = false;\n\n /** Maximum number of characters of text. Typing stops there, and a count shows below. */\n @property({ type: Number, attribute: 'maxlength' })\n maxlength?: number;\n\n /** Height of the empty editor, in lines. */\n @property({ type: Number })\n rows = 4;\n\n /** Lines the editor grows to before it scrolls. Without it, it keeps growing. */\n @property({ type: Number, attribute: 'max-rows' })\n maxRows?: number;\n\n /** Characters that start a mention, such as `\"@\"` or `\"@#\"`. Empty turns mentions off. */\n @property({ type: String })\n triggers = '@';\n\n /** Suggestions for the mention being typed; set them in answer to `search`. */\n @property({ attribute: false })\n suggestions: MentionSuggestion[] = [];\n\n /** Shows a loading row in the mention list while the app looks for suggestions. */\n @property({ type: Boolean, attribute: 'suggestions-loading' })\n suggestionsLoading = false;\n\n /** Overrides Peacock's strings for this instance only. */\n @property({ attribute: false })\n strings?: Partial<PeacockStrings>;\n\n /**\n * Suggests how to go on after a pause in typing, as ghost text at the end of the paragraph: Tab\n * takes it, Mod+→ takes a word, Escape dismisses it. Needs a provider with `complete`.\n */\n @property({ type: Boolean, reflect: true, attribute: 'ai-completion' })\n aiCompletion = false;\n\n /** Turns the AI actions and ghost text off for this editor, even when the page offers them. */\n @property({ type: Boolean, reflect: true, attribute: 'no-ai' })\n noAi = false;\n\n // ── State ─────────────────────────────────────────────────────────────────\n\n /** Whether the editor has focus. */\n @state() protected editorFocused = false;\n\n /** Whether the source view is showing. */\n @state() protected sourceView = false;\n\n // ── Queries ───────────────────────────────────────────────────────────────\n\n @query('.editor-root')\n private editorRoot?: HTMLElement;\n\n // ── Protected fields ──────────────────────────────────────────────────────\n\n /** The Tiptap editor, once created. */\n protected editor?: Editor;\n\n protected readonly i18n = new I18nController(this);\n\n protected readonly mentions = new RichTextMentionController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n });\n\n protected readonly ai = new RichTextAiController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n });\n\n protected readonly slash = new RichTextSlashController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n actions: () => this.ai.slashActions(),\n });\n\n protected readonly link = new RichTextLinkController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n });\n\n protected readonly bubble = new RichTextBubbleController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n allowed: () =>\n this.selectionBubble &&\n !this.sourceView &&\n !this.link.open &&\n !this.slash.visible &&\n !this.mentions.visible &&\n !this.ai.open,\n editLink: () => this.link.show(),\n extra: () => this.bubbleExtra(),\n });\n\n protected readonly blockHandle = new RichTextBlockHandleController(this, {\n editor: () => this.editor,\n i18n: this.i18n,\n allowed: () => !this.sourceView && this.showBlockHandle,\n insertAfter: position => this.slash.openAfterBlock(position),\n });\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n private inputTimer?: number;\n\n private focusWithin = false;\n\n private valueAtFocus = '';\n\n // ── Abstract ──────────────────────────────────────────────────────────────\n\n /** Which nodes and marks the editor allows. */\n protected abstract readonly profile: RichTextProfile;\n\n /** The language of the source view. */\n protected abstract readonly sourceLanguage: 'markdown' | 'html';\n\n /** The icon of the source toggle. */\n protected abstract readonly sourceIcon: string;\n\n /** The value as the editor holds it now. */\n protected abstract readFromEditor(editor: Editor): string;\n\n /** The editor's content for a value. */\n protected abstract contentFor(value: string): RichTextContent;\n\n /** The placeholder when `placeholder` is empty. */\n protected abstract defaultPlaceholder(): string;\n\n /** Whether the block handle shows; the comment composer turns it off. */\n protected get showBlockHandle(): boolean {\n return true;\n }\n\n /** Whether `/` opens the block menu; the prompt input, which holds no blocks, turns it off. */\n protected get slashMenu(): boolean {\n return true;\n }\n\n /** Whether selecting text shows the selection bubble; the prompt input turns it off. */\n protected get selectionBubble(): boolean {\n return true;\n }\n\n /** Extensions a subclass adds, such as keyboard shortcuts. */\n protected extraExtensions(): Extensions {\n return [];\n }\n\n /** Buttons added to the selection bubble after the marks and link; Ask AI by default. */\n protected bubbleExtra(): TemplateResult | typeof nothing {\n return this.ai.bubbleButton();\n }\n\n /** The block tools in the toolbar: every block the schema allows except text styles. */\n protected toolbarBlocks(editor: Editor): BlockCommand[] {\n return blocksFor(editor).filter(block => !block.textStyle);\n }\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.addEventListener('focusin', this.onFocusIn);\n this.addEventListener('focusout', this.onFocusOut);\n }\n\n override connectedCallback() {\n super.connectedCallback();\n // Reconnected after a move: the editor was destroyed on disconnect.\n if (this.hasUpdated && !this.editor) this.createEditor();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.flushInput();\n this.destroyEditor();\n }\n\n protected override firstUpdated() {\n this.createEditor();\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n super.willUpdate(changed);\n // Load a new value before validity is computed in updated().\n const { editor } = this;\n if (!editor || !changed.has('value')) return;\n const current = this.normalizeValue(this.readFromEditor(editor));\n if (current === this.normalizeValue(this.value)) return;\n const { content, contentType } = this.contentFor(this.value);\n editor\n .chain()\n .setMeta(SET_VALUE_META, true)\n .setContent(content, { emitUpdate: false, contentType })\n .run();\n }\n\n protected override updated(changed: PropertyValues<this>) {\n super.updated(changed);\n const { editor } = this;\n if (!editor) return;\n\n if (changed.has('triggers') || changed.has('maxlength')) {\n this.destroyEditor();\n this.createEditor();\n return;\n }\n\n if (changed.has('disabled') || changed.has('readonly')) {\n editor.setEditable(!(this.disabled || this.readonly));\n }\n\n if (changed.has('placeholder') || changed.has('strings')) {\n // The placeholder is a decoration; an empty transaction redraws it.\n editor.view.dispatch(editor.state.tr.setMeta('placeholder', true));\n }\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n override focus(options?: Parameters<HTMLElement['focus']>[0]) {\n if (this.editor && !this.sourceView) this.editor.commands.focus();\n else super.focus(options);\n }\n\n // ── Protected methods ─────────────────────────────────────────────────────\n\n /** Line endings and trailing whitespace do not count as changes. */\n protected normalizeValue(value: string): string {\n return (value ?? '').replace(/\\r\\n/g, '\\n').replace(/\\s+$/, '');\n }\n\n protected override computeValidity(): ControlValidity {\n const base = super.computeValidity();\n if (Object.values(base.flags).some(Boolean)) return base;\n const max = this.maxlength;\n if (typeof max === 'number' && max >= 0 && this.characters() > max) {\n return {\n flags: { tooLong: true },\n message: this.i18n.t('richTextTooLong')(max),\n };\n }\n return base;\n }\n\n /** The number of characters of text, as `maxlength` counts them. */\n protected characters(): number {\n return this.editor?.state.doc.textContent.length ?? 0;\n }\n\n /** Whether the editor holds nothing: a single empty paragraph. */\n protected isEditorEmpty(editor: Editor): boolean {\n const { doc } = editor.state;\n const first = doc.firstChild;\n return (\n doc.childCount <= 1 &&\n (!first || (first.type.name === 'paragraph' && first.content.size === 0))\n );\n }\n\n /** Runs an editor command, unless the editor is disabled or read-only. */\n protected run(command: (editor: Editor) => void) {\n const { editor } = this;\n if (!editor || this.disabled || this.readonly) return;\n command(editor);\n }\n\n // ── Private methods: editor ───────────────────────────────────────────────\n\n private createEditor() {\n const root = this.editorRoot;\n if (!root || this.editor) return;\n const { content, contentType } = this.contentFor(this.value);\n this.editor = new Editor({\n element: root,\n extensions: buildExtensions(this.profile, {\n placeholder: () => this.placeholder || this.defaultPlaceholder(),\n maxlength: this.maxlength,\n mentions: this.triggers ? this.mentions.suggestionOptions() : [],\n extra: [\n this.ai.extension(),\n ...(this.slashMenu ? [this.slash.extension()] : []),\n this.link.extension(),\n this.blockHandle.extension(),\n ...this.extraExtensions(),\n ],\n }),\n content,\n contentType,\n editable: !(this.disabled || this.readonly),\n editorProps: {\n attributes: {\n role: 'textbox',\n 'aria-multiline': 'true',\n 'aria-label':\n this.label || this.placeholder || this.defaultPlaceholder(),\n },\n },\n onFocus: () => {\n this.editorFocused = true;\n },\n onBlur: () => {\n this.editorFocused = false;\n },\n onUpdate: () => this.onEditorUpdate(),\n onTransaction: () => this.requestUpdate(),\n });\n this.requestUpdate();\n }\n\n private destroyEditor() {\n this.editor?.destroy();\n this.editor = undefined;\n }\n\n private onEditorUpdate() {\n const { editor } = this;\n if (!editor) return;\n const next = this.normalizeValue(this.readFromEditor(editor));\n if (next === this.normalizeValue(this.value)) return;\n this.value = next;\n this.queueInput();\n }\n\n // ── Private methods: events ───────────────────────────────────────────────\n\n private emit(type: 'input' | 'change') {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private queueInput() {\n window.clearTimeout(this.inputTimer);\n this.inputTimer = window.setTimeout(() => {\n this.inputTimer = undefined;\n this.emit('input');\n }, this.debounce);\n }\n\n /** Fires a pending `input` now. */\n private flushInput() {\n if (this.inputTimer === undefined) return;\n window.clearTimeout(this.inputTimer);\n this.inputTimer = undefined;\n this.emit('input');\n }\n\n private onFocusIn = () => {\n if (this.focusWithin) return;\n this.focusWithin = true;\n this.valueAtFocus = this.value;\n };\n\n private onFocusOut = (event: FocusEvent) => {\n // Focus moving between parts of the editor arrives retargeted to the host.\n const next = event.relatedTarget as Node | null;\n if (next && (next === this || this.contains(next))) return;\n this.focusWithin = false;\n this.flushInput();\n if (this.value === this.valueAtFocus) return;\n this.valueAtFocus = this.value;\n this.emit('change');\n };\n\n private onSourceInput = (event: CustomEvent<{ value: string }>) => {\n event.stopPropagation();\n const next = event.detail?.value ?? '';\n if (next === this.value) return;\n this.value = next;\n this.queueInput();\n };\n\n private toggleSource = () => {\n const { editor } = this;\n if (editor && !this.sourceView) {\n // Take the editor's latest value before showing it as source.\n this.value = this.normalizeValue(this.readFromEditor(editor));\n }\n this.sourceView = !this.sourceView;\n if (!this.sourceView) {\n this.updateComplete.then(() => this.editor?.commands.focus());\n }\n };\n\n private onTextStyle = (event: CustomEvent<{ item: HTMLElement }>) => {\n event.stopPropagation();\n const id = event.detail.item.getAttribute('value');\n const block: BlockCommand | undefined = BLOCKS.find(b => b.id === id);\n if (block) this.run(editor => block.run(editor.chain().focus()).run());\n };\n\n private onTableAction = (event: CustomEvent<{ item: HTMLElement }>) => {\n event.stopPropagation();\n const action = event.detail.item.getAttribute('value') as TableAction;\n this.run(editor => {\n const chain = editor.chain().focus();\n const commands: Record<TableAction, () => boolean> = {\n addRowBelow: () => chain.addRowAfter().run(),\n addColumnAfter: () => chain.addColumnAfter().run(),\n deleteRow: () => chain.deleteRow().run(),\n deleteColumn: () => chain.deleteColumn().run(),\n deleteTable: () => chain.deleteTable().run(),\n };\n commands[action]?.();\n });\n };\n\n // ── Render helpers ────────────────────────────────────────────────────────\n\n protected toolButton(\n icon: string,\n label: string,\n action: () => void,\n selected?: boolean,\n ): TemplateResult {\n return html`<wc-icon-button\n class=\"tool\"\n variant=\"text\"\n color=\"surface\"\n shape=\"round\"\n size=\"xs\"\n ?toggle=${selected !== undefined}\n ?selected=${!!selected}\n ?disabled=${this.disabled || this.readonly}\n aria-label=${label}\n tooltip=${label}\n @click=${action}\n ><wc-icon name=${icon}></wc-icon\n ></wc-icon-button>`;\n }\n\n private renderTextStyle(editor: Editor) {\n const styles = blocksFor(editor).filter(block => block.textStyle);\n if (styles.length < 2) return nothing;\n const active = activeTextStyle(editor);\n return html`<wc-dropdown-button\n class=\"text-style\"\n size=\"xs\"\n variant=\"text\"\n color=\"surface\"\n aria-label=${this.i18n.t('textStyle')}\n ?disabled=${this.disabled || this.readonly}\n @menu-item-activate=${this.onTextStyle}\n >\n ${this.i18n.t(active?.id ?? 'paragraph')}\n ${styles.map(\n block =>\n html`<wc-menu-item\n slot=\"menu\"\n type=\"radio\"\n value=${block.id}\n ?selected=${block === active}\n >${this.i18n.t(block.id)}</wc-menu-item\n >`,\n )}\n </wc-dropdown-button>\n <wc-divider orientation=\"vertical\"></wc-divider>`;\n }\n\n private renderTableTools(editor: Editor) {\n if (!editor.isActive('table')) return nothing;\n return html`<wc-divider orientation=\"vertical\"></wc-divider>\n <wc-dropdown-button\n class=\"table-tools\"\n size=\"xs\"\n variant=\"text\"\n color=\"surface\"\n ?disabled=${this.disabled || this.readonly}\n @menu-item-activate=${this.onTableAction}\n >\n ${this.i18n.t('table')}\n ${TABLE_ACTIONS.map(\n action =>\n html`<wc-menu-item slot=\"menu\" value=${action}\n >${this.i18n.t(action)}</wc-menu-item\n >`,\n )}\n </wc-dropdown-button>`;\n }\n\n /** The formatting tools: text style, marks, link, blocks, mention and table actions. */\n protected renderTools(editor: Editor): TemplateResult {\n const { i18n } = this;\n return html`${this.renderTextStyle(editor)}\n ${marksFor(editor).map(mark =>\n this.toolButton(\n mark.icon,\n i18n.t(mark.id),\n () => this.run(e => mark.run(e.chain().focus()).run()),\n editor.isActive(mark.mark),\n ),\n )}\n ${editor.schema.marks.link\n ? this.toolButton(\n 'link',\n i18n.t('link'),\n () => this.link.show(),\n editor.isActive('link'),\n )\n : nothing}\n <wc-divider orientation=\"vertical\"></wc-divider>\n ${this.toolbarBlocks(editor).map(block =>\n this.toolButton(\n block.icon,\n i18n.t(block.id),\n () => this.run(e => block.run(e.chain().focus()).run()),\n block.id === 'divider' || block.id === 'table'\n ? undefined\n : block.active(editor),\n ),\n )}\n ${this.triggers\n ? this.toolButton('alternate_email', i18n.t('mentionSomeone'), () =>\n this.mentions.insertTrigger(),\n )\n : nothing}\n ${this.renderTableTools(editor)} ${this.ai.toolbarButton()}`;\n }\n\n /** Keeps the editor's selection when a tool is pressed. */\n protected keepSelection = (event: MouseEvent) => {\n if (!this.sourceView) event.preventDefault();\n };\n\n private renderToolbar() {\n if (this.hideToolbar) return nothing;\n const { editor, i18n } = this;\n return html`<wc-toolbar\n class=\"toolbar\"\n variant=\"flat\"\n aria-label=${i18n.t('formattingToolbar')}\n @mousedown=${this.keepSelection}\n >\n ${editor && !this.sourceView ? this.renderTools(editor) : nothing}\n <span class=\"toolbar-spacer\" aria-hidden=\"true\"></span>\n <wc-icon-button\n class=\"tool source-toggle\"\n variant=\"text\"\n color=\"surface\"\n shape=\"round\"\n size=\"xs\"\n toggle\n ?selected=${this.sourceView}\n ?disabled=${this.disabled}\n aria-label=${i18n.t('viewSource')}\n tooltip=${i18n.t('viewSource')}\n @click=${this.toggleSource}\n ><wc-icon name=${this.sourceIcon}></wc-icon\n ></wc-icon-button>\n </wc-toolbar>`;\n }\n\n protected renderStateTag() {\n if (this.disabled) {\n return html`<wc-tag class=\"state-tag\" intent=\"danger\"\n >${this.i18n.t('disabled')}</wc-tag\n >`;\n }\n if (this.readonly) {\n return html`<wc-tag class=\"state-tag\" intent=\"danger\"\n >${this.i18n.t('readOnlyTag')}</wc-tag\n >`;\n }\n return nothing;\n }\n\n /** The count below the field, with `maxlength`. */\n private textCount(): string {\n const max = this.maxlength;\n if (typeof max !== 'number' || max < 0) return '';\n return this.i18n.t('characterCount')(this.characters(), max);\n }\n\n /**\n * A block dragged with the handle drops anywhere in the area, padding included, by height. The\n * listeners capture, so ProseMirror's own drop handling never sees these drags. `dragenter` is\n * cancelled too: outside editable content the browser only drops where it was.\n */\n private readonly areaDragOver = {\n handleEvent: (event: DragEvent) => this.blockHandle.dragOver(event),\n capture: true,\n };\n\n private readonly areaDrop = {\n handleEvent: (event: DragEvent) => this.blockHandle.drop(event),\n capture: true,\n };\n\n /** The editable area: Tiptap mounts into `.editor-root`. */\n protected renderEditorArea(): TemplateResult {\n const lines: Record<string, string> = { '--_rows': String(this.rows) };\n if (this.maxRows) lines['--_max-rows'] = String(this.maxRows);\n return html`<div\n class=${classMap({\n 'editor-area': true,\n hidden: this.sourceView,\n 'with-handle': this.showBlockHandle && !this.disabled && !this.readonly,\n })}\n style=${styleMap(lines)}\n @input=${(event: Event) => event.stopPropagation()}\n @beforeinput=${(event: Event) => event.stopPropagation()}\n @dragenter=${this.areaDragOver}\n @dragover=${this.areaDragOver}\n @drop=${this.areaDrop}\n >\n <div class=\"editor-root\"></div>\n </div>`;\n }\n\n /** The mention list, slash menu, selection bubble, link editor and block handle. */\n protected renderPopups(): TemplateResult {\n return html`${this.mentions.render()}\n <span class=\"slash-anchor\" aria-hidden=\"true\"></span>\n ${this.slash.render()} ${this.bubble.render()} ${this.link.render()}\n ${this.blockHandle.render()} ${this.blockHandle.renderDropLine()}\n ${this.ai.render()}`;\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n render() {\n const empty = !this.value || !this.value.trim();\n const { validationText } = this;\n return html`\n <wc-field\n class=${classMap({\n 'rich-text-field': true,\n 'max-rows': !!this.maxRows,\n })}\n label=${this.label}\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?skeleton=${this.skeleton}\n ?focused=${this.editorFocused}\n ?error=${this.error || !!validationText}\n error-text=${this.error ? this.errorText : validationText}\n helper-text=${this.helperText}\n text-count=${this.textCount()}\n variant=${this.variant}\n ?populated=${!empty}\n .host=${this}\n >\n <div class=\"shell\">\n ${this.renderToolbar()} ${this.renderEditorArea()}\n ${this.sourceView\n ? html`<div class=\"source\">\n <wc-code-editor\n language=${this.sourceLanguage}\n size=${this.size}\n wrap\n .value=${this.value}\n ?readonly=${this.readonly}\n ?disabled=${this.disabled}\n @input=${this.onSourceInput}\n @change=${(event: Event) => event.stopPropagation()}\n ></wc-code-editor>\n </div>`\n : nothing}\n ${this.renderStateTag()}\n </div>\n </wc-field>\n ${this.renderPopups()}\n `;\n }\n}\n"],"names":["html","nothing","classMap","styleMap","property","state","query"],"mappings":";;;;;;;;;;AAsCA;AACA,MAAM,aAAa,GAAG;IACpB,aAAa;IACb,gBAAgB;IAChB,WAAW;IACX,cAAc;IACd,aAAa;CACL;AAIV;;;;;;;;;;;;;;AAcG;AACW,MAAgB,aAC5B,SAAQ,SAAS,CAAA;;AA+KjB,IAAA,IAAc,eAAe,GAAA;AAC3B,QAAA,OAAO,IAAI;IACb;;AAGA,IAAA,IAAc,SAAS,GAAA;AACrB,QAAA,OAAO,IAAI;IACb;;AAGA,IAAA,IAAc,eAAe,GAAA;AAC3B,QAAA,OAAO,IAAI;IACb;;IAGU,eAAe,GAAA;AACvB,QAAA,OAAO,EAAE;IACX;;IAGU,WAAW,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE;IAC/B;;AAGU,IAAA,aAAa,CAAC,MAAc,EAAA;AACpC,QAAA,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;IAC5D;;AAIA,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;;QAxMT,IAAA,CAAA,KAAK,GAAG,EAAE;;QAIV,IAAA,CAAA,KAAK,GAAG,EAAE;;QAIV,IAAA,CAAA,WAAW,GAAG,EAAE;;QAIhB,IAA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ple.js CHANGED
@@ -145,12 +145,14 @@ let Ripple = class Ripple extends i$1 {
145
145
  // required by the controller.
146
146
  this, this.onControlChange.bind(this));
147
147
  }
148
+ /** The id of the control the ripple attaches to, as the `for` attribute. */
148
149
  get htmlFor() {
149
150
  return this.attachableController.htmlFor;
150
151
  }
151
152
  set htmlFor(htmlFor) {
152
153
  this.attachableController.htmlFor = htmlFor;
153
154
  }
155
+ /** The control whose presses show the ripple; without `for` or this, it follows its parent. */
154
156
  get control() {
155
157
  return this.attachableController.control;
156
158
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ripple.js","sources":["../../src/ripple/ripple.ts"],"sourcesContent":["import { LitElement, html, css, PropertyValues, isServer } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport {\n Attachable,\n AttachableController,\n} from '@/__internal/controllers/attachable-controller.js';\n\nconst PRESS_GROW_MS = 450;\nconst MINIMUM_PRESS_MS = 225;\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst PADDING = 10;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\nconst PRESS_PSEUDO = '::after';\nconst ANIMATION_FILL = 'forwards';\n\n/**\n * Interaction states for the ripple.\n *\n * On Touch:\n * - `INACTIVE -> TOUCH_DELAY -> WAITING_FOR_CLICK -> INACTIVE`\n *\n * On Mouse or Pen:\n * - `INACTIVE -> WAITING_FOR_CLICK -> INACTIVE`\n */\nenum State {\n /**\n * Initial state of the control, no touch in progress.\n *\n * Transitions:\n * - on touch down: transition to `TOUCH_DELAY`.\n * - on mouse down: transition to `WAITING_FOR_CLICK`.\n */\n INACTIVE,\n /**\n * Touch down has been received, waiting to determine if it's a swipe or\n * scroll.\n *\n * Transitions:\n * - on touch up: begin press; transition to `WAITING_FOR_CLICK`.\n * - on cancel: transition to `INACTIVE`.\n * - after `TOUCH_DELAY_MS`: begin press; transition to `HOLDING`.\n */\n TOUCH_DELAY,\n /**\n * A touch has been deemed to be a press\n *\n * Transitions:\n * - on up: transition to `WAITING_FOR_CLICK`.\n */\n HOLDING,\n /**\n * The user touch has finished, transition into rest state.\n *\n * Transitions:\n * - on click end press; transition to `INACTIVE`.\n */\n WAITING_FOR_CLICK,\n}\n\n/**\n * Events that the ripple listens to.\n */\nconst EVENTS = [\n 'click',\n 'contextmenu',\n 'pointercancel',\n 'pointerdown',\n 'pointerenter',\n 'pointerleave',\n 'pointerup',\n];\n\n/**\n * Delay reacting to touch so that we do not show the ripple for a swipe or\n * scroll interaction.\n */\nconst TOUCH_DELAY_MS = 150;\n\n/**\n * Used to detect if HCM is active. Events do not process during HCM when the\n * ripple is not displayed.\n */\nconst FORCED_COLORS = window.matchMedia('(forced-colors: active)');\n\n/**\n * @label Ripple\n * @tag wc-ripple\n * @rawTag ripple\n *\n * @summary The hover tint and press ripple of a button or another control it is attached to.\n * @overview\n * <p>The ripple attaches to its parent element, or to the element whose id is in <code>for</code>, or to a\n * control passed to <code>attach()</code>,\n * and is hidden from assistive technology. Give the control <code>position: relative</code> and\n * <code>overflow: hidden</code> so the ripple stays inside it.</p>\n *\n * @example\n * ```html\n * <style>\n * .ripple-surface {\n * position: relative;\n * display: inline-flex;\n * align-items: center;\n * justify-content: center;\n * width: 220px;\n * height: 64px;\n * border-radius: 12px;\n * background: var(--color-surface-container-high);\n * color: var(--color-on-surface);\n * overflow: hidden;\n * cursor: pointer;\n * user-select: none;\n * }\n * </style>\n * <div class=\"ripple-surface\">\n * <wc-ripple></wc-ripple>\n * Ripple Effect\n * </div>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class Ripple extends LitElement implements Attachable {\n static styles = css`\n :host {\n display: flex;\n margin: auto;\n pointer-events: none;\n }\n\n :host([disabled]) {\n display: none;\n }\n\n @media (forced-colors: active) {\n :host {\n display: none;\n }\n }\n\n :host,\n .surface {\n border-radius: inherit;\n corner-shape: inherit;\n position: absolute;\n inset: 0;\n overflow: hidden;\n }\n\n .surface {\n -webkit-tap-highlight-color: transparent;\n\n &::before,\n &::after {\n content: '';\n opacity: 0;\n position: absolute;\n }\n\n &::before {\n background-color: var(--ripple-pressed-color, var(--color-on-surface));\n inset: 0;\n transition:\n opacity 15ms linear,\n background-color 15ms linear;\n }\n\n &::after {\n background: radial-gradient(\n closest-side,\n var(--ripple-pressed-color, var(--color-on-surface))\n max(calc(100% - 70px), 65%),\n transparent 100%\n );\n transform-origin: center center;\n transition: opacity 375ms linear;\n }\n }\n\n .hovered::before {\n opacity: 0.08;\n }\n\n .pressed::after {\n opacity: 0.12;\n transition-duration: 105ms;\n }\n `;\n\n /**\n * Disables the ripple.\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** True while the pointer is hovering over the host element. */\n @state() private hovered = false;\n\n /** True while a press animation is playing. */\n @state() private pressed = false;\n\n @query('.surface') private readonly mdRoot!: HTMLElement | null;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** CSS size string (e.g. `\"48px\"`) for the growing ripple circle. */\n private rippleSize = '';\n\n /** CSS scale factor applied to the ripple at the end of its animation. */\n private rippleScale = '';\n\n /** Pixel size of the ripple at its initial (pre-grow) state. */\n private initialSize = 0;\n\n /** Reference to the currently running grow animation, if any. */\n private growAnimation?: Animation;\n\n /** Current interaction state of the ripple state machine. */\n private state = State.INACTIVE;\n\n /** Pointer event that initiated the current press, used to calculate start coordinates. */\n private rippleStartEvent?: PointerEvent;\n\n /** Bound reference to `handleEvent` passed to `addEventListener` / `removeEventListener`. */\n private readonly _boundHandleEvent = this.handleEvent.bind(this);\n\n get htmlFor() {\n return this.attachableController.htmlFor;\n }\n\n set htmlFor(htmlFor: string | null) {\n this.attachableController.htmlFor = htmlFor;\n }\n\n get control() {\n return this.attachableController.control;\n }\n\n set control(control: HTMLElement | null) {\n this.attachableController.control = control;\n }\n\n private readonly attachableController = new AttachableController(\n // `LitElement` satisfies the ReactiveControllerHost & HTMLElement shape\n // required by the controller.\n this,\n this.onControlChange.bind(this),\n );\n\n override connectedCallback() {\n super.connectedCallback();\n // Needed for VoiceOver, which will create a \"group\" if the element is a\n // sibling to other content.\n this.setAttribute('aria-hidden', 'true');\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.detach();\n }\n\n attach(control: HTMLElement) {\n this.attachableController.attach(control);\n }\n\n detach() {\n this.attachableController.detach();\n }\n\n private onControlChange(prev: HTMLElement | null, next: HTMLElement | null) {\n if (isServer) return;\n\n for (const event of EVENTS) {\n prev?.removeEventListener(event, this._boundHandleEvent);\n next?.addEventListener(event, this._boundHandleEvent);\n }\n }\n\n protected override render() {\n const classes = {\n hovered: this.hovered,\n pressed: this.pressed,\n };\n\n return html`<div class=\"surface ${classMap(classes)}\"></div>`;\n }\n\n protected override update(changedProps: PropertyValues<Ripple>) {\n if (changedProps.has('disabled') && this.disabled) {\n this.hovered = false;\n this.pressed = false;\n }\n super.update(changedProps);\n }\n\n handlePointerenter(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n this.hovered = true;\n }\n\n handlePointerleave(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n this.hovered = false;\n\n // release a held mouse or pen press that moves outside the element\n if (this.state !== State.INACTIVE) {\n this.endPressAnimation();\n }\n }\n\n private handlePointerup(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n if (this.state === State.HOLDING) {\n this.state = State.WAITING_FOR_CLICK;\n return;\n }\n\n if (this.state === State.TOUCH_DELAY) {\n this.state = State.WAITING_FOR_CLICK;\n this.startPressAnimation(this.rippleStartEvent);\n return;\n }\n }\n\n private async handlePointerdown(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n this.rippleStartEvent = event;\n if (!this.isTouch(event)) {\n this.state = State.WAITING_FOR_CLICK;\n this.startPressAnimation(event);\n return;\n }\n\n // Wait for a hold after touch delay\n this.state = State.TOUCH_DELAY;\n await new Promise(resolve => {\n setTimeout(resolve, TOUCH_DELAY_MS);\n });\n\n if (this.state !== State.TOUCH_DELAY) {\n return;\n }\n\n this.state = State.HOLDING;\n this.startPressAnimation(event);\n }\n\n private handleClick() {\n if (this.disabled) {\n return;\n }\n\n if (this.state === State.WAITING_FOR_CLICK) {\n this.endPressAnimation();\n return;\n }\n\n if (this.state === State.INACTIVE) {\n // keyboard synthesized click event\n this.startPressAnimation();\n this.endPressAnimation();\n }\n }\n\n private handlePointercancel(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n this.endPressAnimation();\n }\n\n private handleContextmenu() {\n if (this.disabled) {\n return;\n }\n\n this.endPressAnimation();\n }\n\n private determineRippleSize() {\n const { height, width } = this.getBoundingClientRect();\n const maxDim = Math.max(height, width);\n const softEdgeSize = Math.max(\n SOFT_EDGE_CONTAINER_RATIO * maxDim,\n SOFT_EDGE_MINIMUM_SIZE,\n );\n\n const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.sqrt(width ** 2 + height ** 2);\n const maxRadius = hypotenuse + PADDING;\n\n this.initialSize = initialSize;\n const maybeZoomedScale = (maxRadius + softEdgeSize) / initialSize;\n this.rippleScale = `${maybeZoomedScale}`;\n this.rippleSize = `${initialSize}px`;\n }\n\n private getTranslationCoordinates(positionEvent?: Event) {\n const { height, width } = this.getBoundingClientRect();\n // end in the center\n const endPoint = {\n x: (width - this.initialSize) / 2,\n y: (height - this.initialSize) / 2,\n };\n\n let startPoint;\n if (positionEvent instanceof PointerEvent) {\n startPoint = this.getNormalizedPointerEventCoords(positionEvent);\n } else {\n startPoint = {\n x: width / 2,\n y: height / 2,\n };\n }\n\n // center around start point\n startPoint = {\n x: startPoint.x - this.initialSize / 2,\n y: startPoint.y - this.initialSize / 2,\n };\n\n return { startPoint, endPoint };\n }\n\n private startPressAnimation(positionEvent?: Event) {\n if (!this.mdRoot) {\n return;\n }\n\n this.pressed = true;\n this.growAnimation?.cancel();\n this.determineRippleSize();\n const { startPoint, endPoint } =\n this.getTranslationCoordinates(positionEvent);\n const translateStart = `${startPoint.x}px, ${startPoint.y}px`;\n const translateEnd = `${endPoint.x}px, ${endPoint.y}px`;\n\n this.growAnimation = this.mdRoot.animate(\n {\n top: [0, 0],\n left: [0, 0],\n height: [this.rippleSize, this.rippleSize],\n width: [this.rippleSize, this.rippleSize],\n transform: [\n `translate(${translateStart}) scale(1)`,\n `translate(${translateEnd}) scale(${this.rippleScale})`,\n ],\n },\n {\n pseudoElement: PRESS_PSEUDO,\n duration: PRESS_GROW_MS,\n easing: 'cubic-bezier(0.2, 0, 0, 1)',\n fill: ANIMATION_FILL,\n },\n );\n }\n\n private async endPressAnimation() {\n this.rippleStartEvent = undefined;\n this.state = State.INACTIVE;\n const animation = this.growAnimation;\n let pressAnimationPlayState = Infinity;\n if (typeof animation?.currentTime === 'number') {\n pressAnimationPlayState = animation.currentTime;\n } else if (animation?.currentTime) {\n pressAnimationPlayState = animation.currentTime.to('ms').value;\n }\n\n if (pressAnimationPlayState >= MINIMUM_PRESS_MS) {\n this.pressed = false;\n return;\n }\n\n await new Promise(resolve => {\n setTimeout(resolve, MINIMUM_PRESS_MS - pressAnimationPlayState);\n });\n\n if (this.growAnimation !== animation) {\n // A new press animation was started. The old animation was canceled and\n // should not finish the pressed state.\n return;\n }\n\n this.pressed = false;\n }\n\n /**\n * Returns `true` if\n * - the ripple element is enabled\n * - the pointer is primary for the input type\n * - the pointer is the pointer that started the interaction, or will start\n * the interaction\n * - the pointer is a touch, or the pointer state has the primary button\n * held, or the pointer is hovering\n */\n private shouldReactToEvent(event: PointerEvent) {\n if (this.disabled || !event.isPrimary) {\n return false;\n }\n\n if (\n this.rippleStartEvent &&\n this.rippleStartEvent.pointerId !== event.pointerId\n ) {\n return false;\n }\n\n if (event.type === 'pointerenter' || event.type === 'pointerleave') {\n return !this.isTouch(event);\n }\n\n const isPrimaryButton = event.buttons === 1;\n return this.isTouch(event) || isPrimaryButton;\n }\n\n private isTouch({ pointerType }: PointerEvent) {\n return pointerType === 'touch';\n }\n\n async handleEvent(event: Event) {\n if (FORCED_COLORS?.matches) {\n // Skip event logic since the ripple is `display: none`.\n return;\n }\n\n switch (event.type) {\n case 'click':\n this.handleClick();\n break;\n case 'contextmenu':\n this.handleContextmenu();\n break;\n case 'pointercancel':\n this.handlePointercancel(event as PointerEvent);\n break;\n case 'pointerdown':\n await this.handlePointerdown(event as PointerEvent);\n break;\n case 'pointerenter':\n this.handlePointerenter(event as PointerEvent);\n break;\n case 'pointerleave':\n this.handlePointerleave(event as PointerEvent);\n break;\n case 'pointerup':\n this.handlePointerup(event as PointerEvent);\n break;\n default:\n break;\n }\n }\n\n private getNormalizedPointerEventCoords(pointerEvent: PointerEvent): {\n x: number;\n y: number;\n } {\n const { scrollX, scrollY } = window;\n const { left, top } = this.getBoundingClientRect();\n const documentX = scrollX + left;\n const documentY = scrollY + top;\n const { pageX, pageY } = pointerEvent;\n return {\n x: pageX - documentX,\n y: pageY - documentY,\n };\n }\n}\n"],"names":["LitElement","html","classMap","css","property","state","query"],"mappings":";;;;;;;;;AASA,MAAM,aAAa,GAAG,GAAG;AACzB,MAAM,gBAAgB,GAAG,GAAG;AAC5B,MAAM,oBAAoB,GAAG,GAAG;AAChC,MAAM,OAAO,GAAG,EAAE;AAClB,MAAM,sBAAsB,GAAG,EAAE;AACjC,MAAM,yBAAyB,GAAG,IAAI;AACtC,MAAM,YAAY,GAAG,SAAS;AAC9B,MAAM,cAAc,GAAG,UAAU;AAEjC;;;;;;;;AAQG;AACH,IAAK,KAiCJ;AAjCD,CAAA,UAAK,KAAK,EAAA;AACR;;;;;;AAMG;AACH,IAAA,KAAA,CAAA,KAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ;AACR;;;;;;;;AAQG;AACH,IAAA,KAAA,CAAA,KAAA,CAAA,aAAA,CAAA,GAAA,CAAA,CAAA,GAAA,aAAW;AACX;;;;;AAKG;AACH,IAAA,KAAA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AAG,GAAG;AAC/B,QAAA,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,YAAY;QACrC,OAAO;YACL,CAAC,EAAE,KAAK,GAAG,SAAS;YACpB,CAAC,EAAE,KAAK,GAAG,SAAS;SACrB;IACH;;AAtcO,MAAA,CAAA,MAAM,GAAGC,CAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgElB,EAAA,CAhEY;AAqE+B,UAAA,CAAA;IAA3CC,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAAmB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAG5C,UAAA,CAAA;AAAhB,IAAAC,CAAK;AAA2B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAGhB,UAAA,CAAA;AAAhB,IAAAA,CAAK;AAA2B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAEG,UAAA,CAAA;IAAnCC,CAAK,CAAC,UAAU;AAA+C,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AA9ErD,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAwclB;;;;"}
1
+ {"version":3,"file":"ripple.js","sources":["../../src/ripple/ripple.ts"],"sourcesContent":["import { LitElement, html, css, PropertyValues, isServer } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport {\n Attachable,\n AttachableController,\n} from '@/__internal/controllers/attachable-controller.js';\n\nconst PRESS_GROW_MS = 450;\nconst MINIMUM_PRESS_MS = 225;\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst PADDING = 10;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\nconst PRESS_PSEUDO = '::after';\nconst ANIMATION_FILL = 'forwards';\n\n/**\n * Interaction states for the ripple.\n *\n * On Touch:\n * - `INACTIVE -> TOUCH_DELAY -> WAITING_FOR_CLICK -> INACTIVE`\n *\n * On Mouse or Pen:\n * - `INACTIVE -> WAITING_FOR_CLICK -> INACTIVE`\n */\nenum State {\n /**\n * Initial state of the control, no touch in progress.\n *\n * Transitions:\n * - on touch down: transition to `TOUCH_DELAY`.\n * - on mouse down: transition to `WAITING_FOR_CLICK`.\n */\n INACTIVE,\n /**\n * Touch down has been received, waiting to determine if it's a swipe or\n * scroll.\n *\n * Transitions:\n * - on touch up: begin press; transition to `WAITING_FOR_CLICK`.\n * - on cancel: transition to `INACTIVE`.\n * - after `TOUCH_DELAY_MS`: begin press; transition to `HOLDING`.\n */\n TOUCH_DELAY,\n /**\n * A touch has been deemed to be a press\n *\n * Transitions:\n * - on up: transition to `WAITING_FOR_CLICK`.\n */\n HOLDING,\n /**\n * The user touch has finished, transition into rest state.\n *\n * Transitions:\n * - on click end press; transition to `INACTIVE`.\n */\n WAITING_FOR_CLICK,\n}\n\n/**\n * Events that the ripple listens to.\n */\nconst EVENTS = [\n 'click',\n 'contextmenu',\n 'pointercancel',\n 'pointerdown',\n 'pointerenter',\n 'pointerleave',\n 'pointerup',\n];\n\n/**\n * Delay reacting to touch so that we do not show the ripple for a swipe or\n * scroll interaction.\n */\nconst TOUCH_DELAY_MS = 150;\n\n/**\n * Used to detect if HCM is active. Events do not process during HCM when the\n * ripple is not displayed.\n */\nconst FORCED_COLORS = window.matchMedia('(forced-colors: active)');\n\n/**\n * @label Ripple\n * @tag wc-ripple\n * @rawTag ripple\n *\n * @summary The hover tint and press ripple of a button or another control it is attached to.\n * @overview\n * <p>The ripple attaches to its parent element, or to the element whose id is in <code>for</code>, or to a\n * control passed to <code>attach()</code>,\n * and is hidden from assistive technology. Give the control <code>position: relative</code> and\n * <code>overflow: hidden</code> so the ripple stays inside it.</p>\n *\n * @example\n * ```html\n * <style>\n * .ripple-surface {\n * position: relative;\n * display: inline-flex;\n * align-items: center;\n * justify-content: center;\n * width: 220px;\n * height: 64px;\n * border-radius: 12px;\n * background: var(--color-surface-container-high);\n * color: var(--color-on-surface);\n * overflow: hidden;\n * cursor: pointer;\n * user-select: none;\n * }\n * </style>\n * <div class=\"ripple-surface\">\n * <wc-ripple></wc-ripple>\n * Ripple Effect\n * </div>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class Ripple extends LitElement implements Attachable {\n static styles = css`\n :host {\n display: flex;\n margin: auto;\n pointer-events: none;\n }\n\n :host([disabled]) {\n display: none;\n }\n\n @media (forced-colors: active) {\n :host {\n display: none;\n }\n }\n\n :host,\n .surface {\n border-radius: inherit;\n corner-shape: inherit;\n position: absolute;\n inset: 0;\n overflow: hidden;\n }\n\n .surface {\n -webkit-tap-highlight-color: transparent;\n\n &::before,\n &::after {\n content: '';\n opacity: 0;\n position: absolute;\n }\n\n &::before {\n background-color: var(--ripple-pressed-color, var(--color-on-surface));\n inset: 0;\n transition:\n opacity 15ms linear,\n background-color 15ms linear;\n }\n\n &::after {\n background: radial-gradient(\n closest-side,\n var(--ripple-pressed-color, var(--color-on-surface))\n max(calc(100% - 70px), 65%),\n transparent 100%\n );\n transform-origin: center center;\n transition: opacity 375ms linear;\n }\n }\n\n .hovered::before {\n opacity: 0.08;\n }\n\n .pressed::after {\n opacity: 0.12;\n transition-duration: 105ms;\n }\n `;\n\n /**\n * Disables the ripple.\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** True while the pointer is hovering over the host element. */\n @state() private hovered = false;\n\n /** True while a press animation is playing. */\n @state() private pressed = false;\n\n @query('.surface') private readonly mdRoot!: HTMLElement | null;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** CSS size string (e.g. `\"48px\"`) for the growing ripple circle. */\n private rippleSize = '';\n\n /** CSS scale factor applied to the ripple at the end of its animation. */\n private rippleScale = '';\n\n /** Pixel size of the ripple at its initial (pre-grow) state. */\n private initialSize = 0;\n\n /** Reference to the currently running grow animation, if any. */\n private growAnimation?: Animation;\n\n /** Current interaction state of the ripple state machine. */\n private state = State.INACTIVE;\n\n /** Pointer event that initiated the current press, used to calculate start coordinates. */\n private rippleStartEvent?: PointerEvent;\n\n /** Bound reference to `handleEvent` passed to `addEventListener` / `removeEventListener`. */\n private readonly _boundHandleEvent = this.handleEvent.bind(this);\n\n /** The id of the control the ripple attaches to, as the `for` attribute. */\n get htmlFor() {\n return this.attachableController.htmlFor;\n }\n\n set htmlFor(htmlFor: string | null) {\n this.attachableController.htmlFor = htmlFor;\n }\n\n /** The control whose presses show the ripple; without `for` or this, it follows its parent. */\n get control() {\n return this.attachableController.control;\n }\n\n set control(control: HTMLElement | null) {\n this.attachableController.control = control;\n }\n\n private readonly attachableController = new AttachableController(\n // `LitElement` satisfies the ReactiveControllerHost & HTMLElement shape\n // required by the controller.\n this,\n this.onControlChange.bind(this),\n );\n\n override connectedCallback() {\n super.connectedCallback();\n // Needed for VoiceOver, which will create a \"group\" if the element is a\n // sibling to other content.\n this.setAttribute('aria-hidden', 'true');\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.detach();\n }\n\n attach(control: HTMLElement) {\n this.attachableController.attach(control);\n }\n\n detach() {\n this.attachableController.detach();\n }\n\n private onControlChange(prev: HTMLElement | null, next: HTMLElement | null) {\n if (isServer) return;\n\n for (const event of EVENTS) {\n prev?.removeEventListener(event, this._boundHandleEvent);\n next?.addEventListener(event, this._boundHandleEvent);\n }\n }\n\n protected override render() {\n const classes = {\n hovered: this.hovered,\n pressed: this.pressed,\n };\n\n return html`<div class=\"surface ${classMap(classes)}\"></div>`;\n }\n\n protected override update(changedProps: PropertyValues<Ripple>) {\n if (changedProps.has('disabled') && this.disabled) {\n this.hovered = false;\n this.pressed = false;\n }\n super.update(changedProps);\n }\n\n handlePointerenter(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n this.hovered = true;\n }\n\n handlePointerleave(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n this.hovered = false;\n\n // release a held mouse or pen press that moves outside the element\n if (this.state !== State.INACTIVE) {\n this.endPressAnimation();\n }\n }\n\n private handlePointerup(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n if (this.state === State.HOLDING) {\n this.state = State.WAITING_FOR_CLICK;\n return;\n }\n\n if (this.state === State.TOUCH_DELAY) {\n this.state = State.WAITING_FOR_CLICK;\n this.startPressAnimation(this.rippleStartEvent);\n return;\n }\n }\n\n private async handlePointerdown(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n this.rippleStartEvent = event;\n if (!this.isTouch(event)) {\n this.state = State.WAITING_FOR_CLICK;\n this.startPressAnimation(event);\n return;\n }\n\n // Wait for a hold after touch delay\n this.state = State.TOUCH_DELAY;\n await new Promise(resolve => {\n setTimeout(resolve, TOUCH_DELAY_MS);\n });\n\n if (this.state !== State.TOUCH_DELAY) {\n return;\n }\n\n this.state = State.HOLDING;\n this.startPressAnimation(event);\n }\n\n private handleClick() {\n if (this.disabled) {\n return;\n }\n\n if (this.state === State.WAITING_FOR_CLICK) {\n this.endPressAnimation();\n return;\n }\n\n if (this.state === State.INACTIVE) {\n // keyboard synthesized click event\n this.startPressAnimation();\n this.endPressAnimation();\n }\n }\n\n private handlePointercancel(event: PointerEvent) {\n if (!this.shouldReactToEvent(event)) {\n return;\n }\n\n this.endPressAnimation();\n }\n\n private handleContextmenu() {\n if (this.disabled) {\n return;\n }\n\n this.endPressAnimation();\n }\n\n private determineRippleSize() {\n const { height, width } = this.getBoundingClientRect();\n const maxDim = Math.max(height, width);\n const softEdgeSize = Math.max(\n SOFT_EDGE_CONTAINER_RATIO * maxDim,\n SOFT_EDGE_MINIMUM_SIZE,\n );\n\n const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.sqrt(width ** 2 + height ** 2);\n const maxRadius = hypotenuse + PADDING;\n\n this.initialSize = initialSize;\n const maybeZoomedScale = (maxRadius + softEdgeSize) / initialSize;\n this.rippleScale = `${maybeZoomedScale}`;\n this.rippleSize = `${initialSize}px`;\n }\n\n private getTranslationCoordinates(positionEvent?: Event) {\n const { height, width } = this.getBoundingClientRect();\n // end in the center\n const endPoint = {\n x: (width - this.initialSize) / 2,\n y: (height - this.initialSize) / 2,\n };\n\n let startPoint;\n if (positionEvent instanceof PointerEvent) {\n startPoint = this.getNormalizedPointerEventCoords(positionEvent);\n } else {\n startPoint = {\n x: width / 2,\n y: height / 2,\n };\n }\n\n // center around start point\n startPoint = {\n x: startPoint.x - this.initialSize / 2,\n y: startPoint.y - this.initialSize / 2,\n };\n\n return { startPoint, endPoint };\n }\n\n private startPressAnimation(positionEvent?: Event) {\n if (!this.mdRoot) {\n return;\n }\n\n this.pressed = true;\n this.growAnimation?.cancel();\n this.determineRippleSize();\n const { startPoint, endPoint } =\n this.getTranslationCoordinates(positionEvent);\n const translateStart = `${startPoint.x}px, ${startPoint.y}px`;\n const translateEnd = `${endPoint.x}px, ${endPoint.y}px`;\n\n this.growAnimation = this.mdRoot.animate(\n {\n top: [0, 0],\n left: [0, 0],\n height: [this.rippleSize, this.rippleSize],\n width: [this.rippleSize, this.rippleSize],\n transform: [\n `translate(${translateStart}) scale(1)`,\n `translate(${translateEnd}) scale(${this.rippleScale})`,\n ],\n },\n {\n pseudoElement: PRESS_PSEUDO,\n duration: PRESS_GROW_MS,\n easing: 'cubic-bezier(0.2, 0, 0, 1)',\n fill: ANIMATION_FILL,\n },\n );\n }\n\n private async endPressAnimation() {\n this.rippleStartEvent = undefined;\n this.state = State.INACTIVE;\n const animation = this.growAnimation;\n let pressAnimationPlayState = Infinity;\n if (typeof animation?.currentTime === 'number') {\n pressAnimationPlayState = animation.currentTime;\n } else if (animation?.currentTime) {\n pressAnimationPlayState = animation.currentTime.to('ms').value;\n }\n\n if (pressAnimationPlayState >= MINIMUM_PRESS_MS) {\n this.pressed = false;\n return;\n }\n\n await new Promise(resolve => {\n setTimeout(resolve, MINIMUM_PRESS_MS - pressAnimationPlayState);\n });\n\n if (this.growAnimation !== animation) {\n // A new press animation was started. The old animation was canceled and\n // should not finish the pressed state.\n return;\n }\n\n this.pressed = false;\n }\n\n /**\n * Returns `true` if\n * - the ripple element is enabled\n * - the pointer is primary for the input type\n * - the pointer is the pointer that started the interaction, or will start\n * the interaction\n * - the pointer is a touch, or the pointer state has the primary button\n * held, or the pointer is hovering\n */\n private shouldReactToEvent(event: PointerEvent) {\n if (this.disabled || !event.isPrimary) {\n return false;\n }\n\n if (\n this.rippleStartEvent &&\n this.rippleStartEvent.pointerId !== event.pointerId\n ) {\n return false;\n }\n\n if (event.type === 'pointerenter' || event.type === 'pointerleave') {\n return !this.isTouch(event);\n }\n\n const isPrimaryButton = event.buttons === 1;\n return this.isTouch(event) || isPrimaryButton;\n }\n\n private isTouch({ pointerType }: PointerEvent) {\n return pointerType === 'touch';\n }\n\n async handleEvent(event: Event) {\n if (FORCED_COLORS?.matches) {\n // Skip event logic since the ripple is `display: none`.\n return;\n }\n\n switch (event.type) {\n case 'click':\n this.handleClick();\n break;\n case 'contextmenu':\n this.handleContextmenu();\n break;\n case 'pointercancel':\n this.handlePointercancel(event as PointerEvent);\n break;\n case 'pointerdown':\n await this.handlePointerdown(event as PointerEvent);\n break;\n case 'pointerenter':\n this.handlePointerenter(event as PointerEvent);\n break;\n case 'pointerleave':\n this.handlePointerleave(event as PointerEvent);\n break;\n case 'pointerup':\n this.handlePointerup(event as PointerEvent);\n break;\n default:\n break;\n }\n }\n\n private getNormalizedPointerEventCoords(pointerEvent: PointerEvent): {\n x: number;\n y: number;\n } {\n const { scrollX, scrollY } = window;\n const { left, top } = this.getBoundingClientRect();\n const documentX = scrollX + left;\n const documentY = scrollY + top;\n const { pageX, pageY } = pointerEvent;\n return {\n x: pageX - documentX,\n y: pageY - documentY,\n };\n }\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,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAEG,UAAA,CAAA;IAAnCC,CAAK,CAAC,UAAU;AAA+C,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AA9ErD,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CA0clB;;;;"}
@@ -1,4 +1,4 @@
1
- import { c as catalog, T as TEXT_VARIANTS, a as TEXT_TYPE } from './generative-view-DmtpDobn.js';
1
+ import { c as catalog, T as TEXT_VARIANTS, a as TEXT_TYPE } from './generative-view-BgOcLRXr.js';
2
2
 
3
3
  function propSchema(spec) {
4
4
  const description = spec.description ? { description: spec.description } : {};
@@ -100,4 +100,4 @@ function generativeViewSchema(catalog$1 = catalog) {
100
100
  }
101
101
 
102
102
  export { generativeViewSchema as g };
103
- //# sourceMappingURL=schema-hMt-NRLk.js.map
103
+ //# sourceMappingURL=schema-B8g30A_n.js.map