@redvars/peacock 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (467) hide show
  1. package/dist/{BaseField-CAog9TIc.js → BaseField-_unSNU5x.js} +43 -4
  2. package/dist/BaseField-_unSNU5x.js.map +1 -0
  3. package/dist/{BaseInput-CcMfg1Y2.js → BaseInput-DtZH0fPJ.js} +7 -4
  4. package/dist/BaseInput-DtZH0fPJ.js.map +1 -0
  5. package/dist/accordion.js.map +1 -1
  6. package/dist/ai-badge.js +32 -6
  7. package/dist/ai-badge.js.map +1 -1
  8. package/dist/ai-summary.js +2 -2
  9. package/dist/alert.js +2 -2
  10. package/dist/anchor-nav.js +2 -2
  11. package/dist/app-shell.js +2 -2
  12. package/dist/assistant-panel.js +2 -2
  13. package/dist/assistant-step.js +2 -2
  14. package/dist/assistant-steps.js +2 -2
  15. package/dist/avatar-group.js +2 -2
  16. package/dist/banner.js +2 -2
  17. package/dist/{base-button-Do2TUy8M.js → base-button-BJMGMcMv.js} +3 -1
  18. package/dist/base-button-BJMGMcMv.js.map +1 -0
  19. package/dist/{base-progress-BiLlZVHJ.js → base-progress-D7Nmfh1s.js} +4 -2
  20. package/dist/base-progress-D7Nmfh1s.js.map +1 -0
  21. package/dist/bottom-sheet.js +2 -2
  22. package/dist/breadcrumb.js +2 -2
  23. package/dist/button-group.js +4 -4
  24. package/dist/button.js +14 -8
  25. package/dist/button.js.map +1 -1
  26. package/dist/calendar.js +2 -2
  27. package/dist/canvas-base-CWQ4rQ2s.js +788 -0
  28. package/dist/canvas-base-CWQ4rQ2s.js.map +1 -0
  29. package/dist/canvas-link-CtgsALq4.js +54 -0
  30. package/dist/canvas-link-CtgsALq4.js.map +1 -0
  31. package/dist/{cartesian-chart-C-f1frt0.js → cartesian-chart-CS5yRLfE.js} +3 -2
  32. package/dist/cartesian-chart-CS5yRLfE.js.map +1 -0
  33. package/dist/{cb-group-base-DeuCVx3a.js → cb-group-base-CO30uFQZ.js} +2 -2
  34. package/dist/{cb-group-base-DeuCVx3a.js.map → cb-group-base-CO30uFQZ.js.map} +1 -1
  35. package/dist/cb-group.js +3 -3
  36. package/dist/cb-rule.js +3 -3
  37. package/dist/chart-area.js +5 -4
  38. package/dist/chart-area.js.map +1 -1
  39. package/dist/chart-bar.js +5 -4
  40. package/dist/chart-bar.js.map +1 -1
  41. package/dist/chart-base-C_XKVyhf.js +833 -0
  42. package/dist/chart-base-C_XKVyhf.js.map +1 -0
  43. package/dist/chart-doughnut.js +4 -3
  44. package/dist/chart-doughnut.js.map +1 -1
  45. package/dist/chart-line.js +5 -4
  46. package/dist/chart-line.js.map +1 -1
  47. package/dist/chart-pie.js +4 -3
  48. package/dist/chart-pie.js.map +1 -1
  49. package/dist/chat-event.js +152 -0
  50. package/dist/chat-event.js.map +1 -0
  51. package/dist/chat-message.js +195 -19
  52. package/dist/chat-message.js.map +1 -1
  53. package/dist/chat-thread.js +26 -9
  54. package/dist/chat-thread.js.map +1 -1
  55. package/dist/checkbox-group.js +5 -5
  56. package/dist/checkbox.js +5 -5
  57. package/dist/chip-set.js +4 -4
  58. package/dist/chip.js +4 -4
  59. package/dist/circular-progress.js +3 -3
  60. package/dist/citation.js +2 -2
  61. package/dist/code-editor.js +6 -5
  62. package/dist/code-editor.js.map +1 -1
  63. package/dist/code-highlighter.js +2 -2
  64. package/dist/color-field.js +6 -6
  65. package/dist/color-picker.js +2 -2
  66. package/dist/command-palette.js +2 -2
  67. package/dist/comment-composer.js +6 -6
  68. package/dist/condition-builder.js +3 -3
  69. package/dist/confirm-dialog.js +2 -2
  70. package/dist/copy-button.js +2 -2
  71. package/dist/currency-field.js +6 -6
  72. package/dist/custom-elements-jsdocs.json +2330 -397
  73. package/dist/custom-elements.json +20464 -542
  74. package/dist/date-field.js +7 -7
  75. package/dist/date-picker.js +4 -2
  76. package/dist/date-picker.js.map +1 -1
  77. package/dist/date-range-field.js +7 -7
  78. package/dist/datetime-field.js +7 -7
  79. package/dist/dependency-map-layout-5KUueabk.js +1390 -0
  80. package/dist/dependency-map-layout-5KUueabk.js.map +1 -0
  81. package/dist/dependency-map.js +1605 -0
  82. package/dist/dependency-map.js.map +1 -0
  83. package/dist/description-item.js +2 -2
  84. package/dist/description-list.js +2 -2
  85. package/dist/diagram-Va096vj9.js +2029 -0
  86. package/dist/diagram-Va096vj9.js.map +1 -0
  87. package/dist/diagram-controls.js +345 -0
  88. package/dist/diagram-controls.js.map +1 -0
  89. package/dist/diagram-minimap.js +216 -0
  90. package/dist/diagram-minimap.js.map +1 -0
  91. package/dist/diagram.js +20 -0
  92. package/dist/diagram.js.map +1 -0
  93. package/dist/diff-viewer.js +2 -2
  94. package/dist/discussion-activity.js +4 -4
  95. package/dist/discussion-comment.js +4 -4
  96. package/dist/{discussion-time-BegaYfhf.js → discussion-time-DqykqvNy.js} +2 -2
  97. package/dist/{discussion-time-BegaYfhf.js.map → discussion-time-DqykqvNy.js.map} +1 -1
  98. package/dist/discussion.js +8 -8
  99. package/dist/{document-editor-BO7QPbO5.js → document-editor-Dc8JeFVB.js} +2 -2
  100. package/dist/{document-editor-BO7QPbO5.js.map → document-editor-Dc8JeFVB.js.map} +1 -1
  101. package/dist/document-editor.js +3 -3
  102. package/dist/draft-card.js +14 -4
  103. package/dist/draft-card.js.map +1 -1
  104. package/dist/dropdown-button.js +3 -2
  105. package/dist/dropdown-button.js.map +1 -1
  106. package/dist/erd.js +2021 -0
  107. package/dist/erd.js.map +1 -0
  108. package/dist/fab.js +4 -4
  109. package/dist/field.js +257 -43
  110. package/dist/field.js.map +1 -1
  111. package/dist/file-upload.js +38 -16
  112. package/dist/file-upload.js.map +1 -1
  113. package/dist/filter-bar.js +2 -2
  114. package/dist/flow.js +27 -970
  115. package/dist/flow.js.map +1 -1
  116. package/dist/focus-ring.js +2 -0
  117. package/dist/focus-ring.js.map +1 -1
  118. package/dist/{form-associated-D3Tn33s_.js → form-associated-BHbg72PG.js} +3 -1
  119. package/dist/{form-associated-D3Tn33s_.js.map → form-associated-BHbg72PG.js.map} +1 -1
  120. package/dist/{form-submitter-DWwv6K9-.js → form-submitter-beG1CXAn.js} +7 -1
  121. package/dist/{form-submitter-DWwv6K9-.js.map → form-submitter-beG1CXAn.js.map} +1 -1
  122. package/dist/form.js +3 -3
  123. package/dist/{generative-view-DmtpDobn.js → generative-view-BKlcuujw.js} +13 -13
  124. package/dist/generative-view-BKlcuujw.js.map +1 -0
  125. package/dist/generative-view.js +3 -3
  126. package/dist/geometry-INg82Lxq.js +305 -0
  127. package/dist/geometry-INg82Lxq.js.map +1 -0
  128. package/dist/history-YbTSQZHj.js +45 -0
  129. package/dist/history-YbTSQZHj.js.map +1 -0
  130. package/dist/host-CZK7xhzh.js +40 -0
  131. package/dist/host-CZK7xhzh.js.map +1 -0
  132. package/dist/html-editor.js +6 -6
  133. package/dist/{hyperlink-DhE9RlVS.js → hyperlink-DycWPKwU.js} +10 -1
  134. package/dist/hyperlink-DycWPKwU.js.map +1 -0
  135. package/dist/{i18n-controller-urcQKYGe.js → i18n-controller-DJHsE1YH.js} +2 -2
  136. package/dist/{i18n-controller-urcQKYGe.js.map → i18n-controller-DJHsE1YH.js.map} +1 -1
  137. package/dist/icon-button.js +11 -9
  138. package/dist/icon-button.js.map +1 -1
  139. package/dist/image.js +2 -2
  140. package/dist/index.js +42 -22
  141. package/dist/index.js.map +1 -1
  142. package/dist/inline-edit.js +2 -2
  143. package/dist/input.js +5 -5
  144. package/dist/json-viewer.js +2 -2
  145. package/dist/kanban.js +2 -2
  146. package/dist/kbd.js +2 -2
  147. package/dist/linear-progress.js +3 -3
  148. package/dist/link-button.js +9 -7
  149. package/dist/link-button.js.map +1 -1
  150. package/dist/list-item.js +2 -2
  151. package/dist/list.js +2 -2
  152. package/dist/listbox.js +4 -4
  153. package/dist/loader-full.js +17 -16
  154. package/dist/loader-full.js.map +1 -1
  155. package/dist/loader.js +51 -18
  156. package/dist/loader.js.map +1 -1
  157. package/dist/markdown-editor.js +6 -6
  158. package/dist/markers-BFmh1OCz.js +46 -0
  159. package/dist/markers-BFmh1OCz.js.map +1 -0
  160. package/dist/measure-controller-Dmc5hZKg.js +89 -0
  161. package/dist/measure-controller-Dmc5hZKg.js.map +1 -0
  162. package/dist/mention-input.js +7 -6
  163. package/dist/mention-input.js.map +1 -1
  164. package/dist/menu-item.js +3 -2
  165. package/dist/menu-item.js.map +1 -1
  166. package/dist/{menu-trigger-controller-DyLpTxM7.js → menu-trigger-controller-CEJq1ugC.js} +11 -14
  167. package/dist/menu-trigger-controller-CEJq1ugC.js.map +1 -0
  168. package/dist/menu.js +2 -2
  169. package/dist/modal.js +2 -2
  170. package/dist/navigation-bar.js +2 -2
  171. package/dist/navigation-drawer.js +2 -2
  172. package/dist/navigation-rail.js +2 -2
  173. package/dist/notification-center.js +3 -3
  174. package/dist/number-field.js +7 -6
  175. package/dist/number-field.js.map +1 -1
  176. package/dist/option.js +2 -2
  177. package/dist/page-header.js +2 -2
  178. package/dist/pagination.js +2 -2
  179. package/dist/password-field.js +6 -6
  180. package/dist/password-rules.js +2 -2
  181. package/dist/phone-field.js +6 -6
  182. package/dist/{picker-field-B4DtcJfL.js → picker-field-CUI05sWc.js} +3 -3
  183. package/dist/{picker-field-B4DtcJfL.js.map → picker-field-CUI05sWc.js.map} +1 -1
  184. package/dist/pin-input.js +6 -6
  185. package/dist/presence-indicator.js +2 -2
  186. package/dist/prompt-input.js +6 -6
  187. package/dist/radio-group.js +2 -1
  188. package/dist/radio-group.js.map +1 -1
  189. package/dist/radio.js +6 -6
  190. package/dist/radio.js.map +1 -1
  191. package/dist/rating.js +6 -5
  192. package/dist/rating.js.map +1 -1
  193. package/dist/redvars-loader.js +2 -2
  194. package/dist/{relative-time-BVQXLuHm.js → relative-time-BNxqvEbg.js} +13 -2
  195. package/dist/relative-time-BNxqvEbg.js.map +1 -0
  196. package/dist/relative-time.js +3 -3
  197. package/dist/resizable-panels.js +2 -2
  198. package/dist/{rich-text-input-DLICqof1.js → rich-text-input-N_hqnXej.js} +3 -3
  199. package/dist/{rich-text-input-DLICqof1.js.map → rich-text-input-N_hqnXej.js.map} +1 -1
  200. package/dist/ripple.js +2 -0
  201. package/dist/ripple.js.map +1 -1
  202. package/dist/{schema-hMt-NRLk.js → schema-Dy0z-80u.js} +2 -2
  203. package/dist/{schema-hMt-NRLk.js.map → schema-Dy0z-80u.js.map} +1 -1
  204. package/dist/search.js +5 -5
  205. package/dist/segmented-button-group.js +1 -1
  206. package/dist/select.js +8 -8
  207. package/dist/side-sheet.js +2 -2
  208. package/dist/signature-pad.js +6 -5
  209. package/dist/signature-pad.js.map +1 -1
  210. package/dist/slider.js +6 -5
  211. package/dist/slider.js.map +1 -1
  212. package/dist/snackbar.js +2 -2
  213. package/dist/sparkline.js +2 -2
  214. package/dist/split-button.js +109 -21
  215. package/dist/split-button.js.map +1 -1
  216. package/dist/src/__internal/ai/suggestion-controller.d.ts +2 -0
  217. package/dist/src/__internal/diagram/canvas-base.d.ts +105 -0
  218. package/dist/src/__internal/diagram/canvas-link.d.ts +21 -0
  219. package/dist/src/__internal/diagram/geometry.d.ts +49 -0
  220. package/dist/src/__internal/diagram/history.d.ts +17 -0
  221. package/dist/src/__internal/diagram/host.d.ts +45 -0
  222. package/dist/src/__internal/diagram/markers.d.ts +16 -0
  223. package/dist/src/__internal/diagram/measure-controller.d.ts +32 -0
  224. package/dist/src/__internal/diagram/motion.d.ts +22 -0
  225. package/dist/src/__internal/diagram/selection.d.ts +20 -0
  226. package/dist/src/__internal/diagram/types.d.ts +39 -0
  227. package/dist/src/__internal/diagram/viewport-controller.d.ts +89 -0
  228. package/dist/src/__internal/i18n/strings.d.ts +155 -0
  229. package/dist/src/__internal/menu-trigger-controller.d.ts +11 -8
  230. package/dist/src/__internal/toggle-base.d.ts +8 -0
  231. package/dist/src/__internal/utils/deprecate.d.ts +3 -3
  232. package/dist/src/__internal/utils/relative-time.d.ts +5 -0
  233. package/dist/src/accordion/accordion.d.ts +1 -0
  234. package/dist/src/ai-badge/ai-badge.d.ts +8 -0
  235. package/dist/src/button/button/button.d.ts +4 -0
  236. package/dist/src/chat-message/chat-message.d.ts +51 -10
  237. package/dist/src/chat-message/index.d.ts +1 -1
  238. package/dist/src/chat-thread/chat-event.d.ts +37 -0
  239. package/dist/src/chat-thread/chat-thread.d.ts +7 -4
  240. package/dist/src/chat-thread/index.d.ts +1 -0
  241. package/dist/src/code-editor/code-editor.d.ts +1 -0
  242. package/dist/src/date-picker/date-picker.d.ts +2 -0
  243. package/dist/src/dependency-map/dependency-map-layout.d.ts +48 -0
  244. package/dist/src/dependency-map/dependency-map.d.ts +241 -0
  245. package/dist/src/dependency-map/index.d.ts +2 -0
  246. package/dist/src/diagram/diagram.d.ts +300 -0
  247. package/dist/src/diagram/flow.d.ts +53 -0
  248. package/dist/src/diagram/index.d.ts +4 -0
  249. package/dist/src/diagram-controls/diagram-controls.d.ts +46 -0
  250. package/dist/src/diagram-controls/index.d.ts +1 -0
  251. package/dist/src/diagram-minimap/diagram-minimap.d.ts +39 -0
  252. package/dist/src/diagram-minimap/index.d.ts +1 -0
  253. package/dist/src/erd/erd-layout.d.ts +27 -0
  254. package/dist/src/erd/erd.d.ts +266 -0
  255. package/dist/src/erd/index.d.ts +2 -0
  256. package/dist/src/field/field.d.ts +38 -1
  257. package/dist/src/file-upload/file-upload.d.ts +3 -1
  258. package/dist/src/focus-ring/focus-ring.d.ts +2 -0
  259. package/dist/src/index.d.ts +17 -4
  260. package/dist/src/input/BaseField.d.ts +15 -1
  261. package/dist/src/input/BaseInput.d.ts +4 -0
  262. package/dist/src/menu/menu-item/menu-item.d.ts +1 -0
  263. package/dist/src/number-field/number-field.d.ts +4 -0
  264. package/dist/src/progress/base-progress.d.ts +3 -0
  265. package/dist/src/radio/radio-group.d.ts +1 -0
  266. package/dist/src/rating/rating.d.ts +1 -0
  267. package/dist/src/ripple/ripple.d.ts +2 -0
  268. package/dist/src/signature-pad/signature-pad.d.ts +1 -0
  269. package/dist/src/slider/slider.d.ts +1 -0
  270. package/dist/src/split-button/split-button.d.ts +7 -2
  271. package/dist/src/switch/switch.d.ts +1 -0
  272. package/dist/src/tabs/tab.d.ts +2 -0
  273. package/dist/src/tabs/tabs.d.ts +1 -0
  274. package/dist/src/textarea/textarea.d.ts +3 -0
  275. package/dist/src/time-picker/time-picker.d.ts +2 -0
  276. package/dist/src/transfer-list/transfer-list.d.ts +1 -0
  277. package/dist/src/tree-chart/index.d.ts +2 -0
  278. package/dist/src/tree-chart/tree-chart-layout.d.ts +49 -0
  279. package/dist/src/tree-chart/tree-chart.d.ts +221 -0
  280. package/dist/src/workflow/index.d.ts +2 -0
  281. package/dist/src/workflow/workflow-format.d.ts +5 -0
  282. package/dist/src/workflow/workflow-model.d.ts +194 -0
  283. package/dist/src/workflow/workflow.d.ts +313 -0
  284. package/dist/src/workflow-timeline/index.d.ts +1 -0
  285. package/dist/src/workflow-timeline/workflow-timeline.d.ts +41 -0
  286. package/dist/stat.js +2 -2
  287. package/dist/status-indicator.js +2 -2
  288. package/dist/step.js +2 -2
  289. package/dist/stepper.js +2 -2
  290. package/dist/{strings-DmbqMTfs.js → strings-DnYjGbbc.js} +169 -1
  291. package/dist/{strings-DmbqMTfs.js.map → strings-DnYjGbbc.js.map} +1 -1
  292. package/dist/sub-menu.js +2 -2
  293. package/dist/{suggestion-controller-CW17adxd.js → suggestion-controller-7YRQqkaI.js} +3 -1
  294. package/dist/{suggestion-controller-CW17adxd.js.map → suggestion-controller-7YRQqkaI.js.map} +1 -1
  295. package/dist/svg.js +2 -2
  296. package/dist/switch.js +6 -5
  297. package/dist/switch.js.map +1 -1
  298. package/dist/tab.js +1 -0
  299. package/dist/tab.js.map +1 -1
  300. package/dist/table.js +50 -11
  301. package/dist/table.js.map +1 -1
  302. package/dist/tabs.js +1 -0
  303. package/dist/tabs.js.map +1 -1
  304. package/dist/test/diagram-controls.test.d.ts +1 -0
  305. package/dist/test/diagram-geometry.test.d.ts +1 -0
  306. package/dist/test/diagram.test.d.ts +1 -0
  307. package/dist/test/erd.test.d.ts +1 -0
  308. package/dist/test/toggle-label.test.d.ts +1 -0
  309. package/dist/test/tree-chart.test.d.ts +1 -0
  310. package/dist/test/workflow-debug.test.d.ts +1 -0
  311. package/dist/test/workflow.test.d.ts +1 -0
  312. package/dist/textarea.js +13 -6
  313. package/dist/textarea.js.map +1 -1
  314. package/dist/time-field.js +7 -7
  315. package/dist/time-picker.js +4 -2
  316. package/dist/time-picker.js.map +1 -1
  317. package/dist/timeline-item.js +2 -2
  318. package/dist/timeline.js +2 -2
  319. package/dist/{toggle-base-BQO5pjrU.js → toggle-base-CXmFSp3b.js} +19 -3
  320. package/dist/toggle-base-CXmFSp3b.js.map +1 -0
  321. package/dist/tour.js +2 -2
  322. package/dist/transfer-list.js +6 -5
  323. package/dist/transfer-list.js.map +1 -1
  324. package/dist/{chart-base-B-gOg2Di.js → transform-CxeQFXXB.js} +9 -839
  325. package/dist/transform-CxeQFXXB.js.map +1 -0
  326. package/dist/tree-chart.js +1986 -0
  327. package/dist/tree-chart.js.map +1 -0
  328. package/dist/tree-item.js +2 -2
  329. package/dist/tree.js +2 -2
  330. package/dist/tsconfig.tsbuildinfo +1 -1
  331. package/dist/typing-indicator.js +2 -2
  332. package/dist/url-field.js +6 -6
  333. package/dist/user-menu.js +3 -3
  334. package/dist/virtual-list.js +2 -2
  335. package/dist/workflow-format-BsyveyeC.js +34 -0
  336. package/dist/workflow-format-BsyveyeC.js.map +1 -0
  337. package/dist/workflow-model-CauduOG2.js +330 -0
  338. package/dist/workflow-model-CauduOG2.js.map +1 -0
  339. package/dist/workflow-timeline.js +354 -0
  340. package/dist/workflow-timeline.js.map +1 -0
  341. package/dist/workflow.js +3337 -0
  342. package/dist/workflow.js.map +1 -0
  343. package/dist/workspace-switcher.js +3 -3
  344. package/package.json +1 -1
  345. package/readme.md +44 -2
  346. package/src/LoaderUtils.ts +9 -2
  347. package/src/__internal/ai/suggestion-controller.ts +3 -1
  348. package/src/__internal/diagram/canvas-base.ts +410 -0
  349. package/src/__internal/diagram/canvas-link.ts +66 -0
  350. package/src/__internal/diagram/geometry.ts +372 -0
  351. package/src/__internal/diagram/history.ts +49 -0
  352. package/src/__internal/diagram/host.ts +76 -0
  353. package/src/__internal/diagram/markers.ts +56 -0
  354. package/src/__internal/diagram/measure-controller.ts +104 -0
  355. package/src/__internal/diagram/motion.ts +89 -0
  356. package/src/__internal/diagram/selection.ts +69 -0
  357. package/src/__internal/diagram/types.ts +56 -0
  358. package/src/__internal/diagram/viewport-controller.ts +494 -0
  359. package/src/__internal/i18n/strings.ts +207 -0
  360. package/src/__internal/menu-trigger-controller.ts +11 -15
  361. package/src/__internal/mixins/field.ts +3 -0
  362. package/src/__internal/mixins/form-associated.ts +2 -0
  363. package/src/__internal/mixins/form-submitter.ts +6 -0
  364. package/src/__internal/mixins/hyperlink.ts +10 -0
  365. package/src/__internal/toggle-base.ts +16 -0
  366. package/src/__internal/utils/deprecate.ts +5 -4
  367. package/src/__internal/utils/relative-time.ts +20 -0
  368. package/src/accordion/accordion.ts +1 -0
  369. package/src/ai-badge/ai-badge.scss +8 -0
  370. package/src/ai-badge/ai-badge.ts +21 -4
  371. package/src/button/base-button/base-button.ts +2 -0
  372. package/src/button/button/button-base.scss +9 -2
  373. package/src/button/button/button-layers.scss +3 -1
  374. package/src/button/button/button.ts +4 -0
  375. package/src/chat-message/chat-message.scss +72 -0
  376. package/src/chat-message/chat-message.ts +137 -18
  377. package/src/chat-message/index.ts +1 -0
  378. package/src/chat-thread/chat-event.scss +36 -0
  379. package/src/chat-thread/chat-event.ts +79 -0
  380. package/src/chat-thread/chat-thread.scss +4 -1
  381. package/src/chat-thread/chat-thread.ts +22 -6
  382. package/src/chat-thread/index.ts +1 -0
  383. package/src/code-editor/code-editor.ts +1 -0
  384. package/src/date-picker/date-picker.ts +2 -0
  385. package/src/dependency-map/dependency-map-layout.ts +505 -0
  386. package/src/dependency-map/dependency-map.scss +626 -0
  387. package/src/dependency-map/dependency-map.ts +1280 -0
  388. package/src/dependency-map/index.ts +16 -0
  389. package/src/diagram/diagram.scss +513 -0
  390. package/src/diagram/diagram.ts +1852 -0
  391. package/src/diagram/flow.ts +81 -0
  392. package/src/diagram/index.ts +44 -0
  393. package/src/diagram-controls/diagram-controls.scss +68 -0
  394. package/src/diagram-controls/diagram-controls.ts +255 -0
  395. package/src/diagram-controls/index.ts +1 -0
  396. package/src/diagram-minimap/diagram-minimap.scss +41 -0
  397. package/src/diagram-minimap/diagram-minimap.ts +149 -0
  398. package/src/diagram-minimap/index.ts +1 -0
  399. package/src/draft-card/draft-card.scss +16 -2
  400. package/src/dropdown-button/dropdown-button.ts +2 -1
  401. package/src/erd/erd-layout.ts +92 -0
  402. package/src/erd/erd.scss +636 -0
  403. package/src/erd/erd.ts +1728 -0
  404. package/src/erd/index.ts +17 -0
  405. package/src/field/field.scss +197 -23
  406. package/src/field/field.ts +109 -16
  407. package/src/file-upload/file-upload.scss +37 -10
  408. package/src/file-upload/file-upload.ts +3 -1
  409. package/src/focus-ring/focus-ring.ts +2 -0
  410. package/src/generative-view/catalog.generated.ts +12 -11
  411. package/src/index.ts +123 -3
  412. package/src/input/BaseField.ts +45 -2
  413. package/src/input/BaseInput.ts +4 -1
  414. package/src/loader.ts +29 -0
  415. package/src/mention-input/mention-input.scss +2 -0
  416. package/src/menu/menu-item/menu-item.ts +1 -0
  417. package/src/number-field/number-field.ts +4 -0
  418. package/src/progress/base-progress.ts +3 -0
  419. package/src/radio/radio-group.ts +1 -0
  420. package/src/radio/radio.ts +1 -1
  421. package/src/rating/rating.ts +1 -0
  422. package/src/ripple/ripple.ts +2 -0
  423. package/src/signature-pad/signature-pad.ts +1 -0
  424. package/src/slider/slider.ts +1 -0
  425. package/src/split-button/split-button-colors.scss +9 -0
  426. package/src/split-button/split-button-sizes.scss +32 -5
  427. package/src/split-button/split-button.scss +61 -8
  428. package/src/split-button/split-button.ts +15 -8
  429. package/src/switch/switch.ts +1 -0
  430. package/src/table/table.scss +57 -9
  431. package/src/table/table.ts +3 -1
  432. package/src/tabs/tab.ts +2 -0
  433. package/src/tabs/tabs.ts +1 -0
  434. package/src/textarea/textarea.scss +2 -0
  435. package/src/textarea/textarea.ts +8 -0
  436. package/src/time-picker/time-picker.ts +2 -0
  437. package/src/transfer-list/transfer-list.ts +1 -0
  438. package/src/tree-chart/index.ts +13 -0
  439. package/src/tree-chart/tree-chart-layout.ts +185 -0
  440. package/src/tree-chart/tree-chart.scss +377 -0
  441. package/src/tree-chart/tree-chart.ts +1170 -0
  442. package/src/workflow/index.ts +35 -0
  443. package/src/workflow/workflow-format.ts +29 -0
  444. package/src/workflow/workflow-model.ts +583 -0
  445. package/src/workflow/workflow.scss +1164 -0
  446. package/src/workflow/workflow.ts +2674 -0
  447. package/src/workflow-timeline/index.ts +1 -0
  448. package/src/workflow-timeline/workflow-timeline.scss +128 -0
  449. package/src/workflow-timeline/workflow-timeline.ts +238 -0
  450. package/dist/BaseField-CAog9TIc.js.map +0 -1
  451. package/dist/BaseInput-CcMfg1Y2.js.map +0 -1
  452. package/dist/base-button-Do2TUy8M.js.map +0 -1
  453. package/dist/base-progress-BiLlZVHJ.js.map +0 -1
  454. package/dist/cartesian-chart-C-f1frt0.js.map +0 -1
  455. package/dist/chart-base-B-gOg2Di.js.map +0 -1
  456. package/dist/generative-view-DmtpDobn.js.map +0 -1
  457. package/dist/hyperlink-DhE9RlVS.js.map +0 -1
  458. package/dist/menu-trigger-controller-DyLpTxM7.js.map +0 -1
  459. package/dist/relative-time-BVQXLuHm.js.map +0 -1
  460. package/dist/src/flow/flow.d.ts +0 -178
  461. package/dist/src/flow/index.d.ts +0 -2
  462. package/dist/toggle-base-BQO5pjrU.js.map +0 -1
  463. package/src/button/button-group/readme.md +0 -23
  464. package/src/flow/flow.scss +0 -215
  465. package/src/flow/flow.ts +0 -958
  466. package/src/flow/index.ts +0 -10
  467. /package/dist/test/{flow.test.d.ts → dependency-map.test.d.ts} +0 -0
package/dist/rating.js CHANGED
@@ -4,15 +4,15 @@ 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-DJHsE1YH.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-DtZH0fPJ.js';
11
11
  import './base-Cl6v8-BZ.js';
12
12
  import './directive-ZPhl09Yt.js';
13
- import './strings-DmbqMTfs.js';
13
+ import './strings-DnYjGbbc.js';
14
14
  import './element-internals-QME0yEz4.js';
15
- import './suggestion-controller-CW17adxd.js';
15
+ import './suggestion-controller-7YRQqkaI.js';
16
16
  import './ai-controller-DR_Tg0sN.js';
17
17
 
18
18
  var css_248z = i`* {
@@ -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":";;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AAA,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,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;;QAIb,IAAA,CAAA,SAAS,GAAG,EAAE;;QAId,IAAA,CAAA,IAAI,GAAS,IAAI;;QAIjB,IAAA,CAAA,IAAI,GAAG,M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A,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-DJHsE1YH.js';
5
5
  import './directive-ZPhl09Yt.js';
6
- import './strings-DmbqMTfs.js';
6
+ import './strings-DnYjGbbc.js';
7
7
  import './locale-DEsJZCQG.js';
8
8
 
9
9
  var css_248z = i`* {
@@ -91,6 +91,17 @@ function formatAbsoluteDate(date, locale, now = Date.now()) {
91
91
  const sameYear = new Date(time).getFullYear() === new Date(now).getFullYear();
92
92
  return dateFormat(locale, sameYear ? { month: 'short', day: 'numeric' } : { dateStyle: 'medium' }).format(time);
93
93
  }
94
+ /**
95
+ * `date` as a clock time in `locale` ("9:41 AM"), with the date before it when it is not today
96
+ * ("Nov 2, 9:41 AM"), for timestamps in a conversation.
97
+ */
98
+ function formatClockTime(date, locale, now = Date.now()) {
99
+ const time = toTime(date);
100
+ const sameDay = new Date(time).toDateString() === new Date(now).toDateString();
101
+ return dateFormat(locale, sameDay
102
+ ? { hour: 'numeric', minute: '2-digit' }
103
+ : { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }).format(time);
104
+ }
94
105
  /**
95
106
  * `date` relative to now ("5 minutes ago"), or, when `absoluteAfter` is set and the date is
96
107
  * farther from now than that, an absolute date ("Nov 2").
@@ -209,5 +220,5 @@ function watchRelativeTime(date, listener) {
209
220
  });
210
221
  }
211
222
 
212
- export { DAY as D, MINUTE as M, WEEK as W, formatRelativeTime as a, formatTime as b, parseDuration as c, formatAbsoluteTime as f, onTick as o, parseDatetime as p, watchRelativeTime as w };
213
- //# sourceMappingURL=relative-time-BVQXLuHm.js.map
223
+ export { DAY as D, MINUTE as M, WEEK as W, formatRelativeTime as a, formatTime as b, formatClockTime as c, parseDuration as d, formatAbsoluteTime as f, onTick as o, parseDatetime as p, watchRelativeTime as w };
224
+ //# sourceMappingURL=relative-time-BNxqvEbg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relative-time-BNxqvEbg.js","sources":["../../src/__internal/utils/relative-time.ts"],"sourcesContent":["/**\n * Relative and absolute times (\"5 minutes ago\", \"in 3 days\", \"Nov 2\"), and one shared ticker that\n * keeps every relative time on the page current. Used by `wc-relative-time`, the discussion entries and\n * `wc-notification-center`.\n */\n\nexport const SECOND = 1000;\nexport const MINUTE = 60 * SECOND;\nexport const HOUR = 60 * MINUTE;\nexport const DAY = 24 * HOUR;\nexport const WEEK = 7 * DAY;\nexport const MONTH = 30.44 * DAY;\nexport const YEAR = 365.25 * DAY;\n\n/** `numeric` of `Intl.RelativeTimeFormat`: \"yesterday\" (`auto`) or \"1 day ago\" (`always`). */\nexport type RelativeTimeNumeric = 'auto' | 'always';\n\n/** `style` of `Intl.RelativeTimeFormat`: \"5 minutes ago\", \"5 min. ago\" or \"5m ago\". */\nexport type RelativeTimeStyle = 'long' | 'short' | 'narrow';\n\nexport interface RelativeTimeOptions {\n /** \"yesterday\" (`auto`, the default) or \"1 day ago\" (`always`). */\n numeric?: RelativeTimeNumeric;\n /** `long` (the default), `short` or `narrow`. */\n style?: RelativeTimeStyle;\n /** The time to measure from, in milliseconds; defaults to `Date.now()`. */\n now?: number;\n}\n\nexport interface TimeOptions extends RelativeTimeOptions {\n /**\n * Beyond this distance from now, in milliseconds, the time is an absolute date (\"Nov 2\")\n * instead of a relative one. Unset, it is always relative.\n */\n absoluteAfter?: number;\n}\n\nconst relativeFormats = new Map<string, Intl.RelativeTimeFormat>();\nconst dateFormats = new Map<string, Intl.DateTimeFormat>();\n\nfunction relativeFormat(\n locale: string,\n numeric: RelativeTimeNumeric,\n style: RelativeTimeStyle,\n): Intl.RelativeTimeFormat {\n const key = `${locale}|${numeric}|${style}`;\n let format = relativeFormats.get(key);\n if (!format) {\n format = new Intl.RelativeTimeFormat(locale, { numeric, style });\n relativeFormats.set(key, format);\n }\n return format;\n}\n\nfunction dateFormat(\n locale: string,\n options: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat {\n const key = `${locale}|${JSON.stringify(options)}`;\n let format = dateFormats.get(key);\n if (!format) {\n format = new Intl.DateTimeFormat(locale, options);\n dateFormats.set(key, format);\n }\n return format;\n}\n\nfunction toTime(date: Date | number): number {\n return typeof date === 'number' ? date : date.getTime();\n}\n\n/** Parses an ISO 8601 date-time (or anything `Date` reads); `null` when it is not a date. */\nexport function parseDatetime(value: string | null | undefined): Date | null {\n if (!value) return null;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\n/**\n * Parses an ISO 8601 duration such as `P7D`, `PT12H` or `P1W` into milliseconds (months are 30.44\n * days, years 365.25); `null` when it is not a duration.\n */\nexport function parseDuration(value: string | null | undefined): number | null {\n if (!value) return null;\n const match =\n /^P(?:(\\d+(?:\\.\\d+)?)Y)?(?:(\\d+(?:\\.\\d+)?)M)?(?:(\\d+(?:\\.\\d+)?)W)?(?:(\\d+(?:\\.\\d+)?)D)?(?:T(?:(\\d+(?:\\.\\d+)?)H)?(?:(\\d+(?:\\.\\d+)?)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$/i.exec(\n value.trim(),\n );\n if (!match || match.slice(1).every(part => part === undefined)) return null;\n const units = [YEAR, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND];\n return units.reduce(\n (total, unit, index) => total + Number(match[index + 1] ?? 0) * unit,\n 0,\n );\n}\n\n/**\n * The value and unit that describe a distance of `diff` milliseconds (negative is past): seconds\n * under 45 s, minutes under 45 min, hours under 22 h, days under 6.5 days, weeks under 26 days,\n * months under 320 days, then years. Under 45 s it is 0 seconds, which formats as \"now\".\n */\nexport function relativeTimeUnit(diff: number): {\n value: number;\n unit: Intl.RelativeTimeFormatUnit;\n} {\n const abs = Math.abs(diff);\n const round = (unit: number) => Math.round(diff / unit) || 0;\n if (abs < 45 * SECOND) return { value: 0, unit: 'second' };\n if (abs < 45 * MINUTE) return { value: round(MINUTE), unit: 'minute' };\n if (abs < 22 * HOUR) return { value: round(HOUR), unit: 'hour' };\n if (abs < 6.5 * DAY) return { value: round(DAY), unit: 'day' };\n if (abs < 26 * DAY) return { value: round(WEEK), unit: 'week' };\n if (abs < 320 * DAY) return { value: round(MONTH), unit: 'month' };\n return { value: round(YEAR), unit: 'year' };\n}\n\n/** `date` relative to now in `locale`, such as \"5 minutes ago\", \"in 3 days\", \"yesterday\" or \"now\". */\nexport function formatRelativeTime(\n date: Date | number,\n locale: string,\n options: RelativeTimeOptions = {},\n): string {\n const { numeric = 'auto', style = 'long', now = Date.now() } = options;\n const { value, unit } = relativeTimeUnit(toTime(date) - now);\n return relativeFormat(locale, numeric, style).format(value, unit);\n}\n\n/** `date` as an absolute date and time in `locale`, such as \"Nov 7, 2026, 3:04 PM\". */\nexport function formatAbsoluteTime(\n date: Date | number,\n locale: string,\n): string {\n return dateFormat(locale, { dateStyle: 'medium', timeStyle: 'short' }).format(\n toTime(date),\n );\n}\n\n/** `date` as a short date in `locale`: \"Nov 2\" in the current year, else \"Nov 2, 2025\". */\nexport function formatAbsoluteDate(\n date: Date | number,\n locale: string,\n now: number = Date.now(),\n): string {\n const time = toTime(date);\n const sameYear = new Date(time).getFullYear() === new Date(now).getFullYear();\n return dateFormat(\n locale,\n sameYear ? { month: 'short', day: 'numeric' } : { dateStyle: 'medium' },\n ).format(time);\n}\n\n/**\n * `date` as a clock time in `locale` (\"9:41 AM\"), with the date before it when it is not today\n * (\"Nov 2, 9:41 AM\"), for timestamps in a conversation.\n */\nexport function formatClockTime(\n date: Date | number,\n locale: string,\n now: number = Date.now(),\n): string {\n const time = toTime(date);\n const sameDay =\n new Date(time).toDateString() === new Date(now).toDateString();\n return dateFormat(\n locale,\n sameDay\n ? { hour: 'numeric', minute: '2-digit' }\n : { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' },\n ).format(time);\n}\n\n/**\n * `date` relative to now (\"5 minutes ago\"), or, when `absoluteAfter` is set and the date is\n * farther from now than that, an absolute date (\"Nov 2\").\n */\nexport function formatTime(\n date: Date | number,\n locale: string,\n options: TimeOptions = {},\n): string {\n const now = options.now ?? Date.now();\n const time = toTime(date);\n if (\n options.absoluteAfter !== undefined &&\n Math.abs(time - now) >= options.absoluteAfter\n ) {\n return formatAbsoluteDate(time, locale, now);\n }\n return formatRelativeTime(time, locale, { ...options, now });\n}\n\n/**\n * How soon a relative time `diff` milliseconds from now may read differently: every 10 seconds\n * under a minute, every minute under an hour, every 5 minutes under a day, then every hour.\n */\nexport function refreshInterval(diff: number): number {\n const abs = Math.abs(diff);\n if (abs < MINUTE) return 10 * SECOND;\n if (abs < HOUR) return MINUTE;\n if (abs < DAY) return 5 * MINUTE;\n return HOUR;\n}\n\n// ── Shared ticker ───────────────────────────────────────────────────────────\n\ninterface Subscription {\n listener: () => void;\n delay: () => number;\n due: number;\n}\n\nconst subscriptions = new Set<Subscription>();\n\nlet timer: ReturnType<typeof setTimeout> | undefined;\n\nlet timerDue = Infinity;\n\nfunction pageHidden(): boolean {\n return (\n typeof document !== 'undefined' && document.visibilityState === 'hidden'\n );\n}\n\nfunction schedule() {\n if (timer !== undefined) clearTimeout(timer);\n timer = undefined;\n timerDue = Infinity;\n if (subscriptions.size === 0 || pageHidden()) return;\n let due = Infinity;\n for (const each of subscriptions) due = Math.min(due, each.due);\n timerDue = due;\n // `tick` reschedules through `schedule`, so one of the two comes first.\n // eslint-disable-next-line no-use-before-define\n timer = setTimeout(tick, Math.max(0, due - Date.now()));\n}\n\nfunction run(subscription: Subscription, now: number) {\n // eslint-disable-next-line no-param-reassign\n subscription.due = now + Math.max(SECOND, subscription.delay());\n subscription.listener();\n}\n\nfunction tick() {\n timer = undefined;\n const now = Date.now();\n for (const each of [...subscriptions]) {\n if (each.due <= now && subscriptions.has(each)) run(each, now);\n }\n schedule();\n}\n\n/** Back on the page: everything may be stale, so refresh all and start again. */\nfunction handleVisibilityChange() {\n if (pageHidden()) {\n schedule();\n return;\n }\n const now = Date.now();\n for (const each of [...subscriptions]) {\n if (subscriptions.has(each)) run(each, now);\n }\n schedule();\n}\n\n/** Whether the shared ticker has a timer running. For tests. */\nexport function tickerRunning(): boolean {\n return timer !== undefined;\n}\n\n/**\n * Calls `listener` again after `delay()` milliseconds (asked anew after each call), on one timer\n * shared by every subscriber on the page. The timer waits for the earliest subscriber, pauses\n * while the page is hidden, refreshes everyone when it is shown again, and stops when the last\n * subscriber leaves. Returns the unsubscribe function.\n */\nexport function onTick(listener: () => void, delay: () => number): () => void {\n const subscription: Subscription = {\n listener,\n delay,\n due: Date.now() + Math.max(SECOND, delay()),\n };\n if (subscriptions.size === 0 && typeof document !== 'undefined') {\n document.addEventListener('visibilitychange', handleVisibilityChange);\n }\n subscriptions.add(subscription);\n if (subscription.due < timerDue) schedule();\n return () => {\n if (!subscriptions.delete(subscription)) return;\n if (subscriptions.size === 0) {\n if (typeof document !== 'undefined') {\n document.removeEventListener(\n 'visibilitychange',\n handleVisibilityChange,\n );\n }\n schedule();\n }\n };\n}\n\n/**\n * Calls `listener` whenever the relative time of `date()` may have changed: often for a time close\n * to now, rarely for one far away (see `refreshInterval`). A `null` date refreshes once a minute.\n * Returns the unsubscribe function.\n */\nexport function watchRelativeTime(\n date: () => Date | number | null,\n listener: () => void,\n): () => void {\n return onTick(listener, () => {\n const value = date();\n return value === null\n ? MINUTE\n : refreshInterval(toTime(value) - Date.now());\n });\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AAEI,MAAM,MAAM,GAAG,IAAI;AACnB,MAAM,MAAM,GAAG,EAAE,GAAG;AACpB,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM;AACxB,MAAM,GAAG,GAAG,EAAE,GAAG;AACjB,MAAM,IAAI,GAAG,CAAC,GAAG;AACjB,MAAM,KAAK,GAAG,KAAK,GAAG,GAAG;AACzB,MAAM,IAAI,GAAG,MAAM,GAAG,GAAG;AAyBhC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAmC;AAClE,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+B;AAE1D,SAAS,cAAc,CACrB,MAAc,EACd,OAA4B,EAC5B,KAAwB,EAAA;IAExB,MAAM,GAAG,GAAG,CAAA,EAAG,MAAM,IAAI,OAAO,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE;IAC3C,IAAI,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC;IACrC,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,MAAM,GAAG,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAChE,QAAA,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC;IAClC;AACA,IAAA,OAAO,MAAM;AACf;AAEA,SAAS,UAAU,CACjB,MAAc,EACd,OAAmC,EAAA;AAEnC,IAAA,MAAM,GAAG,GAAG,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,IAAI,CAA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AAC;AACH;AAEA;;;;AAIG;AACG,SAAU,iBAAiB,CAC/B,IAAgC,EAChC,QAAoB,EAAA;AAEpB,IAAA,OAAO,MAAM,CAAC,QAAQ,EAAE,MAAK;AAC3B,QAAA,MAAM,KAAK,GAAG,IAAI,EAAE;QACpB,OAAO,KAAK,KAAK;AACf,cAAE;AACF,cAAE,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACjD,IAAA,CAAC,CAAC;AACJ;;;;"}
@@ -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';
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';
3
+ import { I as I18nController } from './i18n-controller-DJHsE1YH.js';
4
+ import { p as parseDatetime, w as watchRelativeTime, d as parseDuration, f as formatAbsoluteTime, b as formatTime } from './relative-time-BNxqvEbg.js';
5
+ import './strings-DnYjGbbc.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-DJHsE1YH.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-DnYjGbbc.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-DtZH0fPJ.js';
9
+ import { I as I18nController } from './i18n-controller-DJHsE1YH.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-N_hqnXej.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;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AA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE;AACjD,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAKM,UAAA,CAAA;AAAlB,IAAAC,CAAK;AAAmC,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAGtB,UAAA,CAAA;AAAlB,IAAAA,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-N_hqnXej.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,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B,IAAAC,CAAK;AAAmC,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAGtB,UAAA,CAAA;AAAlB,IAAAA,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;;;;"}
package/dist/ripple.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
  }