@redvars/peacock 4.1.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/{BaseField-BMumJpkW.js → BaseField-D8ByB0l3.js} +40 -4
  2. package/dist/BaseField-D8ByB0l3.js.map +1 -0
  3. package/dist/{BaseInput-mWdyYv27.js → BaseInput-xCHvT4AN.js} +3 -3
  4. package/dist/BaseInput-xCHvT4AN.js.map +1 -0
  5. package/dist/ai-badge.js +32 -6
  6. package/dist/ai-badge.js.map +1 -1
  7. package/dist/ai-summary.js +2 -2
  8. package/dist/alert.js +2 -2
  9. package/dist/anchor-nav.js +2 -2
  10. package/dist/app-shell.js +2 -2
  11. package/dist/assistant-panel.js +2 -2
  12. package/dist/assistant-step.js +2 -2
  13. package/dist/assistant-steps.js +2 -2
  14. package/dist/avatar-group.js +2 -2
  15. package/dist/banner.js +2 -2
  16. package/dist/{base-progress-CvLVSjuy.js → base-progress-DxNgAQtw.js} +2 -2
  17. package/dist/{base-progress-CvLVSjuy.js.map → base-progress-DxNgAQtw.js.map} +1 -1
  18. package/dist/bottom-sheet.js +2 -2
  19. package/dist/breadcrumb.js +2 -2
  20. package/dist/button.js +11 -5
  21. package/dist/button.js.map +1 -1
  22. package/dist/calendar.js +2 -2
  23. package/dist/{canvas-base-BTQMEVn_.js → canvas-base-DHKf2CmA.js} +2 -2
  24. package/dist/{canvas-base-BTQMEVn_.js.map → canvas-base-DHKf2CmA.js.map} +1 -1
  25. package/dist/{cartesian-chart-DM1FC_XT.js → cartesian-chart-G6VX1aKk.js} +2 -2
  26. package/dist/{cartesian-chart-DM1FC_XT.js.map → cartesian-chart-G6VX1aKk.js.map} +1 -1
  27. package/dist/{cb-group-base-B6fa4Lll.js → cb-group-base-CZLzCnXK.js} +2 -2
  28. package/dist/{cb-group-base-B6fa4Lll.js.map → cb-group-base-CZLzCnXK.js.map} +1 -1
  29. package/dist/cb-group.js +3 -3
  30. package/dist/cb-rule.js +3 -3
  31. package/dist/chart-area.js +4 -4
  32. package/dist/chart-bar.js +4 -4
  33. package/dist/{chart-base-Dhxuw_Mw.js → chart-base-DREru2P0.js} +2 -2
  34. package/dist/{chart-base-Dhxuw_Mw.js.map → chart-base-DREru2P0.js.map} +1 -1
  35. package/dist/chart-doughnut.js +3 -3
  36. package/dist/chart-line.js +4 -4
  37. package/dist/chart-pie.js +3 -3
  38. package/dist/chat-event.js +152 -0
  39. package/dist/chat-event.js.map +1 -0
  40. package/dist/chat-message.js +195 -19
  41. package/dist/chat-message.js.map +1 -1
  42. package/dist/chat-thread.js +26 -9
  43. package/dist/chat-thread.js.map +1 -1
  44. package/dist/checkbox-group.js +4 -4
  45. package/dist/checkbox.js +4 -4
  46. package/dist/chip-set.js +3 -3
  47. package/dist/chip.js +2 -2
  48. package/dist/circular-progress.js +3 -3
  49. package/dist/citation.js +2 -2
  50. package/dist/code-editor.js +4 -4
  51. package/dist/code-highlighter.js +2 -2
  52. package/dist/color-field.js +5 -5
  53. package/dist/color-picker.js +2 -2
  54. package/dist/command-palette.js +2 -2
  55. package/dist/comment-composer.js +25 -13
  56. package/dist/comment-composer.js.map +1 -1
  57. package/dist/condition-builder.js +3 -3
  58. package/dist/confirm-dialog.js +2 -2
  59. package/dist/copy-button.js +2 -2
  60. package/dist/currency-field.js +5 -5
  61. package/dist/custom-elements-jsdocs.json +228 -22
  62. package/dist/custom-elements.json +1255 -110
  63. package/dist/date-field.js +6 -6
  64. package/dist/date-picker.js +2 -2
  65. package/dist/date-range-field.js +6 -6
  66. package/dist/datetime-field.js +6 -6
  67. package/dist/dependency-map.js +3 -3
  68. package/dist/description-item.js +2 -2
  69. package/dist/description-list.js +2 -2
  70. package/dist/{diagram-2r11KySs.js → diagram-CHF70xTL.js} +2 -2
  71. package/dist/{diagram-2r11KySs.js.map → diagram-CHF70xTL.js.map} +1 -1
  72. package/dist/diagram-controls.js +2 -2
  73. package/dist/diagram-minimap.js +2 -2
  74. package/dist/diagram.js +4 -4
  75. package/dist/diff-viewer.js +2 -2
  76. package/dist/discussion-activity.js +4 -4
  77. package/dist/discussion-comment.js +4 -4
  78. package/dist/{discussion-time-BegaYfhf.js → discussion-time-DqykqvNy.js} +2 -2
  79. package/dist/{discussion-time-BegaYfhf.js.map → discussion-time-DqykqvNy.js.map} +1 -1
  80. package/dist/discussion.js +7 -7
  81. package/dist/{document-editor-BnEugM3E.js → document-editor-Cb9fCxvA.js} +22 -10
  82. package/dist/{document-editor-BnEugM3E.js.map → document-editor-Cb9fCxvA.js.map} +1 -1
  83. package/dist/document-editor.js +3 -3
  84. package/dist/draft-card.js +14 -4
  85. package/dist/draft-card.js.map +1 -1
  86. package/dist/dropdown-button.js +3 -2
  87. package/dist/dropdown-button.js.map +1 -1
  88. package/dist/erd.js +3 -3
  89. package/dist/file-upload.js +4 -4
  90. package/dist/filter-bar.js +2 -2
  91. package/dist/flow.js +4 -4
  92. package/dist/form.js +3 -3
  93. package/dist/{generative-view-BgOcLRXr.js → generative-view-C4fJ2zI7.js} +2 -2
  94. package/dist/{generative-view-BgOcLRXr.js.map → generative-view-C4fJ2zI7.js.map} +1 -1
  95. package/dist/generative-view.js +3 -3
  96. package/dist/html-editor.js +30 -13
  97. package/dist/html-editor.js.map +1 -1
  98. package/dist/{i18n-controller-Cp43HjJl.js → i18n-controller-CH4e9sju.js} +2 -2
  99. package/dist/{i18n-controller-Cp43HjJl.js.map → i18n-controller-CH4e9sju.js.map} +1 -1
  100. package/dist/icon-button.js +7 -5
  101. package/dist/icon-button.js.map +1 -1
  102. package/dist/image.js +2 -2
  103. package/dist/index.js +21 -20
  104. package/dist/index.js.map +1 -1
  105. package/dist/inline-edit.js +2 -2
  106. package/dist/input.js +4 -4
  107. package/dist/json-viewer.js +2 -2
  108. package/dist/kanban.js +2 -2
  109. package/dist/kbd.js +2 -2
  110. package/dist/linear-progress.js +3 -3
  111. package/dist/link-button.js +7 -5
  112. package/dist/link-button.js.map +1 -1
  113. package/dist/listbox.js +3 -3
  114. package/dist/loader-full.js +13 -12
  115. package/dist/loader-full.js.map +1 -1
  116. package/dist/loader.js +16 -12
  117. package/dist/loader.js.map +1 -1
  118. package/dist/markdown-editor.js +30 -13
  119. package/dist/markdown-editor.js.map +1 -1
  120. package/dist/mention-input.js +5 -5
  121. package/dist/{menu-trigger-controller-DyLpTxM7.js → menu-trigger-controller-CEJq1ugC.js} +11 -14
  122. package/dist/menu-trigger-controller-CEJq1ugC.js.map +1 -0
  123. package/dist/modal.js +2 -2
  124. package/dist/navigation-bar.js +2 -2
  125. package/dist/navigation-drawer.js +2 -2
  126. package/dist/navigation-rail.js +2 -2
  127. package/dist/notification-center.js +3 -3
  128. package/dist/number-field.js +5 -5
  129. package/dist/page-header.js +2 -2
  130. package/dist/pagination.js +2 -2
  131. package/dist/password-field.js +5 -5
  132. package/dist/password-rules.js +2 -2
  133. package/dist/phone-field.js +5 -5
  134. package/dist/{picker-field-dTlIMAQn.js → picker-field-loXW-xrW.js} +3 -3
  135. package/dist/{picker-field-dTlIMAQn.js.map → picker-field-loXW-xrW.js.map} +1 -1
  136. package/dist/pin-input.js +5 -5
  137. package/dist/presence-indicator.js +2 -2
  138. package/dist/prompt-input.js +25 -13
  139. package/dist/prompt-input.js.map +1 -1
  140. package/dist/radio-group.js +1 -1
  141. package/dist/radio.js +4 -4
  142. package/dist/rating.js +4 -4
  143. package/dist/redvars-loader.js +2 -2
  144. package/dist/{relative-time-BVQXLuHm.js → relative-time-BNxqvEbg.js} +13 -2
  145. package/dist/relative-time-BNxqvEbg.js.map +1 -0
  146. package/dist/relative-time.js +3 -3
  147. package/dist/resizable-panels.js +2 -2
  148. package/dist/{rich-text-input-DM_BOzgk.js → rich-text-input-B5j0eqCJ.js} +21 -18
  149. package/dist/rich-text-input-B5j0eqCJ.js.map +1 -0
  150. package/dist/{schema-B8g30A_n.js → schema-BJzlGRP1.js} +2 -2
  151. package/dist/{schema-B8g30A_n.js.map → schema-BJzlGRP1.js.map} +1 -1
  152. package/dist/search.js +4 -4
  153. package/dist/select.js +5 -5
  154. package/dist/side-sheet.js +2 -2
  155. package/dist/signature-pad.js +4 -4
  156. package/dist/slider.js +4 -4
  157. package/dist/snackbar.js +2 -2
  158. package/dist/sparkline.js +2 -2
  159. package/dist/split-button.js +109 -21
  160. package/dist/split-button.js.map +1 -1
  161. package/dist/src/__internal/ai/suggestion-controller.d.ts +2 -0
  162. package/dist/src/__internal/i18n/strings.d.ts +6 -1
  163. package/dist/src/__internal/menu-trigger-controller.d.ts +11 -8
  164. package/dist/src/__internal/rich-text/rich-text-input.d.ts +6 -1
  165. package/dist/src/__internal/utils/relative-time.d.ts +5 -0
  166. package/dist/src/ai-badge/ai-badge.d.ts +8 -0
  167. package/dist/src/button/button/button.d.ts +4 -0
  168. package/dist/src/chat-message/chat-message.d.ts +51 -10
  169. package/dist/src/chat-message/index.d.ts +1 -1
  170. package/dist/src/chat-thread/chat-event.d.ts +37 -0
  171. package/dist/src/chat-thread/chat-thread.d.ts +7 -4
  172. package/dist/src/chat-thread/index.d.ts +1 -0
  173. package/dist/src/html-editor/html-editor.d.ts +5 -0
  174. package/dist/src/index.d.ts +2 -2
  175. package/dist/src/input/BaseField.d.ts +12 -1
  176. package/dist/src/input/BaseInput.d.ts +1 -0
  177. package/dist/src/markdown-editor/markdown-editor.d.ts +5 -0
  178. package/dist/src/split-button/split-button.d.ts +7 -2
  179. package/dist/src/textarea/textarea.d.ts +2 -0
  180. package/dist/stat.js +2 -2
  181. package/dist/status-indicator.js +2 -2
  182. package/dist/step.js +2 -2
  183. package/dist/stepper.js +2 -2
  184. package/dist/{strings-BJPuhKJk.js → strings-o6v6Hrmn.js} +7 -2
  185. package/dist/strings-o6v6Hrmn.js.map +1 -0
  186. package/dist/{suggestion-controller-CW17adxd.js → suggestion-controller-7YRQqkaI.js} +3 -1
  187. package/dist/{suggestion-controller-CW17adxd.js.map → suggestion-controller-7YRQqkaI.js.map} +1 -1
  188. package/dist/svg.js +2 -2
  189. package/dist/switch.js +4 -4
  190. package/dist/table.js +50 -11
  191. package/dist/table.js.map +1 -1
  192. package/dist/textarea.js +10 -5
  193. package/dist/textarea.js.map +1 -1
  194. package/dist/time-field.js +6 -6
  195. package/dist/time-picker.js +2 -2
  196. package/dist/timeline-item.js +2 -2
  197. package/dist/timeline.js +2 -2
  198. package/dist/{toggle-base-BlaHalfS.js → toggle-base-BSzBnLZN.js} +2 -2
  199. package/dist/{toggle-base-BlaHalfS.js.map → toggle-base-BSzBnLZN.js.map} +1 -1
  200. package/dist/tour.js +2 -2
  201. package/dist/transfer-list.js +4 -4
  202. package/dist/tree-chart.js +3 -3
  203. package/dist/tree-item.js +2 -2
  204. package/dist/tree.js +2 -2
  205. package/dist/tsconfig.tsbuildinfo +1 -1
  206. package/dist/typing-indicator.js +2 -2
  207. package/dist/url-field.js +5 -5
  208. package/dist/user-menu.js +3 -3
  209. package/dist/virtual-list.js +2 -2
  210. package/dist/workflow-timeline.js +2 -2
  211. package/dist/workflow.js +3 -3
  212. package/dist/workspace-switcher.js +3 -3
  213. package/package.json +1 -1
  214. package/src/__internal/ai/suggestion-controller.ts +3 -1
  215. package/src/__internal/i18n/strings.ts +6 -1
  216. package/src/__internal/menu-trigger-controller.ts +11 -15
  217. package/src/__internal/rich-text/editor-chrome.scss +27 -10
  218. package/src/__internal/rich-text/rich-text-input.ts +17 -16
  219. package/src/__internal/utils/relative-time.ts +20 -0
  220. package/src/ai-badge/ai-badge.scss +8 -0
  221. package/src/ai-badge/ai-badge.ts +21 -4
  222. package/src/button/button/button-base.scss +9 -2
  223. package/src/button/button/button-layers.scss +3 -1
  224. package/src/button/button/button.ts +4 -0
  225. package/src/chat-message/chat-message.scss +72 -0
  226. package/src/chat-message/chat-message.ts +137 -18
  227. package/src/chat-message/index.ts +1 -0
  228. package/src/chat-thread/chat-event.scss +36 -0
  229. package/src/chat-thread/chat-event.ts +79 -0
  230. package/src/chat-thread/chat-thread.scss +4 -1
  231. package/src/chat-thread/chat-thread.ts +22 -6
  232. package/src/chat-thread/index.ts +1 -0
  233. package/src/draft-card/draft-card.scss +16 -2
  234. package/src/dropdown-button/dropdown-button.ts +2 -1
  235. package/src/html-editor/html-editor.ts +5 -0
  236. package/src/index.ts +2 -1
  237. package/src/input/BaseField.ts +42 -2
  238. package/src/input/BaseInput.ts +1 -1
  239. package/src/loader.ts +4 -0
  240. package/src/markdown-editor/markdown-editor.ts +5 -0
  241. package/src/split-button/split-button-colors.scss +9 -0
  242. package/src/split-button/split-button-sizes.scss +32 -5
  243. package/src/split-button/split-button.scss +61 -8
  244. package/src/split-button/split-button.ts +15 -8
  245. package/src/table/table.scss +57 -9
  246. package/src/table/table.ts +3 -1
  247. package/src/textarea/textarea.ts +7 -0
  248. package/dist/BaseField-BMumJpkW.js.map +0 -1
  249. package/dist/BaseInput-mWdyYv27.js.map +0 -1
  250. package/dist/menu-trigger-controller-DyLpTxM7.js.map +0 -1
  251. package/dist/relative-time-BVQXLuHm.js.map +0 -1
  252. package/dist/rich-text-input-DM_BOzgk.js.map +0 -1
  253. package/dist/strings-BJPuhKJk.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-trigger-controller-CEJq1ugC.js","sources":["../../src/__internal/menu-trigger-controller.ts"],"sourcesContent":["import type { ReactiveControllerHost } from 'lit';\nimport type { CloseReason } from './controllers/overlay-controller.js';\nimport type {\n Menu,\n MenuCloseDetail,\n MenuFocusTarget,\n} from '../menu/menu/menu.js';\n\nexport interface MenuTriggerOptions {\n /** The menu the trigger opens, usually a `@query('wc-menu')` of the host. */\n menu: () => Menu | null | undefined;\n /** Whether the trigger is disabled; a disabled trigger never opens the menu. */\n disabled: () => boolean;\n /** Prefix of the generated menu id, such as `dropdown-menu`. */\n idPrefix: string;\n}\n\n/**\n * The menu wiring shared by buttons that open a `wc-menu` (dropdown button, split button):\n * show / close / toggle, Arrow Up / Down on the trigger, the open state behind the trigger's\n * `aria-expanded`, and the host's `open` / `close` events (ADR-030001).\n *\n * The menu's own `open` / `close` events are stopped inside the host, which fires its own `open`\n * and `close` instead; `close` carries `detail.reason` from the menu's close event. The host\n * renders the menu with `id=${trigger.menuId}`, `@open=${trigger.handleMenuOpen}` and\n * `@close=${trigger.handleMenuClose}`, and the trigger button with `aria-haspopup=\"menu\"`,\n * `aria-expanded=${String(trigger.open)}`, `@click=${trigger.handleTriggerClick}` and\n * `@keydown=${trigger.handleTriggerKeyDown}`.\n *\n * Add `aria-controls=${trigger.menuId}` only when the trigger is a native `<button>` in the same\n * shadow root as the menu. A `wc-button` or `wc-icon-button` renders its `<button>` in its own\n * shadow root, where an ID reference to the menu cannot resolve, so leave `aria-controls` off it.\n */\nexport class MenuTriggerController {\n /** Id for the menu, for the `aria-controls` of a native trigger in the same shadow root. */\n readonly menuId: string;\n\n private readonly host: ReactiveControllerHost & HTMLElement;\n\n private readonly options: MenuTriggerOptions;\n\n private _open = false;\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n options: MenuTriggerOptions,\n ) {\n this.host = host;\n this.options = options;\n this.menuId = `${options.idPrefix}-${Math.random().toString(36).slice(2, 9)}`;\n }\n\n /** Whether the menu is open, as last reported by its `open` / `close` events. */\n get open() {\n return this._open;\n }\n\n /** Opens the menu, anchored to the host, and focuses its first (or last) item. */\n show(focusTarget: MenuFocusTarget = 'first') {\n const menu = this.options.menu();\n if (this.options.disabled() || !menu) return;\n menu.anchorElement = this.host;\n menu.show(focusTarget);\n }\n\n /** Closes the menu. */\n close() {\n this.options.menu()?.close();\n }\n\n /** Opens the menu when it is closed and closes it when it is open. */\n toggle() {\n // Read the menu itself, not cached state, so a toggle never acts on a stale value.\n if (this.options.menu()?.open) {\n this.close();\n } else {\n this.show();\n }\n }\n\n handleTriggerClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (this.options.disabled()) return;\n this.toggle();\n };\n\n /** Arrow keys on the trigger open the menu on the first or last item. */\n handleTriggerKeyDown = (event: KeyboardEvent) => {\n if (this.options.disabled()) return;\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n this.show(event.key === 'ArrowDown' ? 'first' : 'last');\n }\n };\n\n handleMenuOpen = (event: Event) => {\n if (!this._onMenuToggle(event, true)) return;\n this.host.dispatchEvent(\n new CustomEvent('open', { bubbles: true, composed: true }),\n );\n };\n\n handleMenuClose = (event: CustomEvent<MenuCloseDetail>) => {\n if (!this._onMenuToggle(event, false)) return;\n this.host.dispatchEvent(\n new CustomEvent<{ reason: CloseReason }>('close', {\n detail: { reason: event.detail.reason },\n bubbles: true,\n composed: true,\n }),\n );\n };\n\n /**\n * Stops the menu's event inside the host (the host fires its own `open` / `close`) and records\n * the new state. Returns whether the event was the menu's own rather than a submenu's.\n */\n private _onMenuToggle(event: Event, open: boolean) {\n event.stopPropagation();\n // A submenu's `open` / `close` bubble through the menu; only the menu's own count.\n if (event.target !== event.currentTarget) return false;\n this._open = open;\n this.host.requestUpdate();\n return true;\n }\n}\n"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;AAeG;MACU,qBAAqB,CAAA;IAUhC,WAAA,CACE,IAA0C,EAC1C,OAA2B,EAAA;QAJrB,IAAA,CAAA,KAAK,GAAG,KAAK;AAuCrB,QAAA,IAAA,CAAA,kBAAkB,GAAG,CAAC,KAAiB,KAAI;YACzC,KAAK,CAAC,eAAe,EAAE;AACvB,YAAA,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAAE;YAC7B,IAAI,CAAC,MAAM,EAAE;AACf,QAAA,CAAC;;AAGD,QAAA,IAAA,CAAA,oBAAoB,GAAG,CAAC,KAAoB,KAAI;AAC9C,YAAA,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAAE;AAE7B,YAAA,IAAI,KAAK,CAAC,GAAG,KAAK,WAAW,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE;gBACxD,KAAK,CAAC,cAAc,EAAE;AACtB,gBAAA,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,G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AAC,IAAI;YAAE;AACtC,QAAA,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,IAAI;AAC9B,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;IACxB;;IAGA,KAAK,GAAA;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE;IAC9B;;IAGA,MAAM,GAAA;;QAEJ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;YAC7B,IAAI,CAAC,KAAK,EAAE;QACd;aAAO;YACL,IAAI,CAAC,IAAI,EAAE;QACb;IACF;AAoCA;;;AAGG;IACK,aAAa,CAAC,KAAY,EAAE,IAAa,EAAA;QAC/C,KAAK,CAAC,eAAe,EAAE;;AAEvB,QAAA,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,aAAa;AAAE,YAAA,OAAO,KAAK;AACtD,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI;AACjB,QAAA,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;AACzB,QAAA,OAAO,IAAI;IACb;AACD;;;;"}
package/dist/modal.js CHANGED
@@ -2,12 +2,12 @@ import { _ as __decorate, I as IndividualComponent, a as i, A, b } from './Indiv
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { e } from './query-CHb9Ft_d.js';
4
4
  import { e as e$1 } from './class-map-NDIkZErE.js';
5
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
5
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
6
6
  import { O as OverlayController } from './overlay-controller-BOk-kfil.js';
7
7
  import { c as css_248z } from './modal-B78gUfEO.js';
8
8
  import './base-Cl6v8-BZ.js';
9
9
  import './directive-ZPhl09Yt.js';
10
- import './strings-BJPuhKJk.js';
10
+ import './strings-o6v6Hrmn.js';
11
11
  import './locale-DEsJZCQG.js';
12
12
 
13
13
  /**
@@ -1,8 +1,8 @@
1
1
  import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './IndividualComponent-BK7XZjE2.js';
2
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
2
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
3
3
  import { s as selectNavigationItem } from './navigation-item-base-kUrvJgCx.js';
4
4
  import { NavigationBarItem } from './navigation-bar-item.js';
5
- import './strings-BJPuhKJk.js';
5
+ import './strings-o6v6Hrmn.js';
6
6
  import './locale-DEsJZCQG.js';
7
7
  import './property-B2TG3KEE.js';
8
8
  import './state-BCeDVCI9.js';
@@ -1,12 +1,12 @@
1
1
  import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { e } from './query-CHb9Ft_d.js';
4
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
4
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
5
5
  import { s as selectNavigationItem } from './navigation-item-base-kUrvJgCx.js';
6
6
  import { NavigationDrawerItem } from './navigation-drawer-item.js';
7
7
  import { NavigationDrawerGroup } from './navigation-drawer-group.js';
8
8
  import './base-Cl6v8-BZ.js';
9
- import './strings-BJPuhKJk.js';
9
+ import './strings-o6v6Hrmn.js';
10
10
  import './locale-DEsJZCQG.js';
11
11
  import './state-BCeDVCI9.js';
12
12
  import './class-map-NDIkZErE.js';
@@ -2,7 +2,7 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './Ind
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { e } from './class-map-NDIkZErE.js';
4
4
  import { NavigationRailItem } from './navigation-rail-item.js';
5
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
5
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
6
6
  import { s as selectNavigationItem } from './navigation-item-base-kUrvJgCx.js';
7
7
  import './directive-ZPhl09Yt.js';
8
8
  import './indicator-navigation-item-CmyhsOmy.js';
@@ -11,7 +11,7 @@ import './observe-slot-change-DPxaZrZF.js';
11
11
  import './query-CHb9Ft_d.js';
12
12
  import './base-Cl6v8-BZ.js';
13
13
  import './throttle-SQ9t-HL7.js';
14
- import './strings-BJPuhKJk.js';
14
+ import './strings-o6v6Hrmn.js';
15
15
  import './locale-DEsJZCQG.js';
16
16
 
17
17
  var css_248z = i`* {
@@ -6,13 +6,13 @@ import { e as e$1 } from './class-map-NDIkZErE.js';
6
6
  import { c } from './repeat-D_ERDRYT.js';
7
7
  import { F as FloatingController } from './floating-controller-CABF4tBT.js';
8
8
  import { O as OverlayController } from './overlay-controller-BOk-kfil.js';
9
- import { o as onTick, D as DAY, b as formatTime, W as WEEK, M as MINUTE } from './relative-time-BVQXLuHm.js';
10
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
9
+ import { o as onTick, D as DAY, b as formatTime, W as WEEK, M as MINUTE } from './relative-time-BNxqvEbg.js';
10
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
11
11
  import { t as toPhysicalPlacement } from './placement-C4GO0JP9.js';
12
12
  import './base-Cl6v8-BZ.js';
13
13
  import './directive-ZPhl09Yt.js';
14
14
  import './directive-helpers-Bx3mu42O.js';
15
- import './strings-BJPuhKJk.js';
15
+ import './strings-o6v6Hrmn.js';
16
16
  import './locale-DEsJZCQG.js';
17
17
 
18
18
  var css_248z = i`* {
@@ -4,17 +4,17 @@ import { e } from './query-CHb9Ft_d.js';
4
4
  import { e as e$1 } from './class-map-NDIkZErE.js';
5
5
  import { o } from './if-defined-D9DEJR_6.js';
6
6
  import { s as spread } from './spread-B5cgadZl.js';
7
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
8
- import { B as BaseField } from './BaseField-BMumJpkW.js';
9
- import { n as nativeValidity } from './BaseInput-mWdyYv27.js';
7
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
8
+ import { B as BaseField } from './BaseField-D8ByB0l3.js';
9
+ import { n as nativeValidity } from './BaseInput-xCHvT4AN.js';
10
10
  import './base-Cl6v8-BZ.js';
11
11
  import './directive-ZPhl09Yt.js';
12
- import './strings-BJPuhKJk.js';
12
+ import './strings-o6v6Hrmn.js';
13
13
  import './locale-DEsJZCQG.js';
14
14
  import './state-BCeDVCI9.js';
15
15
  import './element-internals-QME0yEz4.js';
16
16
  import './form-associated-BHbg72PG.js';
17
- import './suggestion-controller-CW17adxd.js';
17
+ import './suggestion-controller-7YRQqkaI.js';
18
18
  import './ai-controller-DR_Tg0sN.js';
19
19
 
20
20
  var css_248z = i`* {
@@ -2,9 +2,9 @@ import { b, i, _ as __decorate, I as IndividualComponent, a as i$1, A } from './
2
2
  import { n as n$1 } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './class-map-NDIkZErE.js';
5
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
5
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
6
6
  import './directive-ZPhl09Yt.js';
7
- import './strings-BJPuhKJk.js';
7
+ import './strings-o6v6Hrmn.js';
8
8
  import './locale-DEsJZCQG.js';
9
9
 
10
10
  /**
@@ -1,9 +1,9 @@
1
1
  import { i, _ as __decorate, I as IndividualComponent, a as i$1, b, A } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { e } from './class-map-NDIkZErE.js';
4
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
4
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
5
5
  import './directive-ZPhl09Yt.js';
6
- import './strings-BJPuhKJk.js';
6
+ import './strings-o6v6Hrmn.js';
7
7
  import './locale-DEsJZCQG.js';
8
8
 
9
9
  var css_248z = i`* {
@@ -4,16 +4,16 @@ import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './query-CHb9Ft_d.js';
5
5
  import { a as ALWAYS_SENSITIVE } from './ai-controller-DR_Tg0sN.js';
6
6
  import { s as spread } from './spread-B5cgadZl.js';
7
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
8
- import { B as BaseField } from './BaseField-BMumJpkW.js';
9
- import { n as nativeValidity } from './BaseInput-mWdyYv27.js';
7
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
8
+ import { B as BaseField } from './BaseField-D8ByB0l3.js';
9
+ import { n as nativeValidity } from './BaseInput-xCHvT4AN.js';
10
10
  import './base-Cl6v8-BZ.js';
11
11
  import './locale-DEsJZCQG.js';
12
12
  import './directive-ZPhl09Yt.js';
13
- import './strings-BJPuhKJk.js';
13
+ import './strings-o6v6Hrmn.js';
14
14
  import './element-internals-QME0yEz4.js';
15
15
  import './form-associated-BHbg72PG.js';
16
- import './suggestion-controller-CW17adxd.js';
16
+ import './suggestion-controller-7YRQqkaI.js';
17
17
 
18
18
  var css_248z = i`* {
19
19
  box-sizing: border-box;
@@ -2,9 +2,9 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './Ind
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './class-map-NDIkZErE.js';
5
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
5
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
6
6
  import './directive-ZPhl09Yt.js';
7
- import './strings-BJPuhKJk.js';
7
+ import './strings-o6v6Hrmn.js';
8
8
  import './locale-DEsJZCQG.js';
9
9
 
10
10
  var css_248z = i`* {
@@ -3,16 +3,16 @@ import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './query-CHb9Ft_d.js';
5
5
  import { s as spread } from './spread-B5cgadZl.js';
6
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
7
- import { B as BaseField } from './BaseField-BMumJpkW.js';
6
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
7
+ import { B as BaseField } from './BaseField-D8ByB0l3.js';
8
8
  import './base-Cl6v8-BZ.js';
9
9
  import './directive-ZPhl09Yt.js';
10
- import './strings-BJPuhKJk.js';
10
+ import './strings-o6v6Hrmn.js';
11
11
  import './locale-DEsJZCQG.js';
12
- import './BaseInput-mWdyYv27.js';
12
+ import './BaseInput-xCHvT4AN.js';
13
13
  import './element-internals-QME0yEz4.js';
14
14
  import './form-associated-BHbg72PG.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
  /**
@@ -3,8 +3,8 @@ import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './query-CHb9Ft_d.js';
5
5
  import { s as spread } from './spread-B5cgadZl.js';
6
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
7
- import { B as BaseField } from './BaseField-BMumJpkW.js';
6
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
7
+ import { B as BaseField } from './BaseField-D8ByB0l3.js';
8
8
 
9
9
  /**
10
10
  * Base for text fields that open a picker in a popover: `wc-date-field`, `wc-time-field` and
@@ -294,4 +294,4 @@ __decorate([
294
294
  ], PickerField.prototype, "pickerElement", void 0);
295
295
 
296
296
  export { PickerField as P };
297
- //# sourceMappingURL=picker-field-dTlIMAQn.js.map
297
+ //# sourceMappingURL=picker-field-loXW-xrW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"picker-field-dTlIMAQn.js","sources":["../../src/__internal/picker-field.ts"],"sourcesContent":["import { html, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\n\nimport { spread } from '@/__internal/directive/spread.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport BaseField from '../input/BaseField.js';\nimport type { ControlValidity } from '../input/BaseInput.js';\nimport type { Popover } from '../popover/popover.js';\n\n/** A picker hosted in a field's popover: it takes focus when the popover opens. */\ninterface FocusablePicker extends HTMLElement {\n focus(): void;\n}\n\n/** Why a parsed value is not allowed: the validity flag it sets and the message to show. */\nexport interface ValueProblem {\n flag: 'rangeUnderflow' | 'rangeOverflow' | 'badInput';\n message: string;\n}\n\n/**\n * Base for text fields that open a picker in a popover: `wc-date-field`, `wc-time-field` and\n * `wc-datetime-field`.\n *\n * The field keeps the typed text in `draft` and parses it on blur or Enter. Valid text becomes\n * `value` (always ISO, so forms submit a locale-independent value) and fires `change`; text that\n * does not parse, or falls outside `min`/`max`, keeps the draft, shows an error and makes the\n * field invalid (`badInput`, `rangeUnderflow` or `rangeOverflow`). Values picked in the popover\n * fire `input` while they change and `change` once committed.\n *\n * Subclasses supply the parsing, formatting, validation and the picker itself.\n */\nexport default abstract class PickerField extends BaseField {\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** The value as an ISO string; empty when there is none. */\n @property({ type: String }) value = '';\n\n /** BCP 47 locale for display and typed input; defaults to the page language. */\n @property({ type: String }) locale = '';\n\n /** Where the picker opens, relative to the field. */\n @property({ type: String }) placement: Popover['placement'] = 'bottom-start';\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** Text in the input; differs from the formatted `value` while the person is typing. */\n @state() protected draft = '';\n\n @state() protected pickerOpen = false;\n\n /** Message for typed text that could not be used; empty when the text is fine. */\n @state() protected invalidText = '';\n\n /** The validity flag `invalidText` stands for. */\n @state() protected invalidFlag: ValueProblem['flag'] = 'badInput';\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('wc-popover') protected popoverElement?: Popover;\n\n @query('.input') protected inputElement?: HTMLInputElement;\n\n @query('.picker') protected pickerElement?: FocusablePicker;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** The last value announced with `change`; closing the popover commits anything newer. */\n private lastCommitted = '';\n\n /** Whether to move focus back to the input when the popover closes. */\n private restoreFocus = false;\n\n /** Peacock's strings and the locale values are shown in. */\n protected readonly i18n = new I18nController(this);\n\n // ── Abstract members ─────────────────────────────────────────────────────\n\n /** Material icon name for the button that opens the picker. */\n protected abstract readonly pickerIcon: string;\n\n /** Accessible name for the button that opens the picker. */\n protected abstract get pickerLabel(): string;\n\n /** Whether a value committed in the picker closes the popover. */\n protected abstract closeOnCommit(value: string): boolean;\n\n /** Parses typed text to an ISO value, or returns null when it cannot be read. */\n protected abstract parseText(text: string): string | null;\n\n /** Formats an ISO value as display text. */\n protected abstract formatValue(value: string): string;\n\n /** The format hint used for the placeholder and the error message. */\n protected abstract formatHint(): string;\n\n /** Returns the problem when a parsed value is not allowed (outside min/max), else null. */\n protected abstract validateValue(value: string): ValueProblem | null;\n\n /** Renders the picker inside the popover. It must carry the `picker` class. */\n protected abstract renderPicker(): TemplateResult;\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n override connectedCallback() {\n super.connectedCallback();\n this.lastCommitted = this.value;\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n super.willUpdate(changed);\n if (changed.has('value') || changed.has('locale')) {\n this.draft = this.formatValue(this.value);\n this.invalidText = '';\n }\n }\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.inputElement?.focus();\n }\n\n override blur() {\n this.inputElement?.blur();\n }\n\n /** Opens the picker and moves focus into it. */\n showPicker() {\n if (this.disabled || this.readonly) return;\n this.popoverElement?.show();\n this.updateComplete.then(() => {\n requestAnimationFrame(() => this.pickerElement?.focus());\n });\n }\n\n /** Closes the picker. */\n hidePicker() {\n this.popoverElement?.hide();\n }\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected get resolvedLocale(): string {\n return this.i18n.locale;\n }\n\n protected override computeValidity(): ControlValidity {\n if (this.invalidText && !this.disabled) {\n return {\n flags: { [this.invalidFlag]: true },\n message: this.invalidText,\n };\n }\n return super.computeValidity();\n }\n\n protected override validityAnchor() {\n return this.inputElement;\n }\n\n /** Sets the value and fires `change`. */\n protected commit(value: string) {\n this.value = value;\n this.lastCommitted = value;\n this.emitValue('change');\n }\n\n /** Sets the value and fires `input`, for a change that is not committed yet. */\n protected preview(value: string) {\n this.value = value;\n this.emitValue('input');\n }\n\n protected override clearValue() {\n this.preview('');\n this.commit('');\n }\n\n protected handlePickerInput(event: CustomEvent<{ value: string }>) {\n event.stopPropagation();\n this.preview(event.detail.value);\n }\n\n protected handlePickerChange(event: CustomEvent<{ value: string }>) {\n event.stopPropagation();\n this.commit(event.detail.value);\n if (this.closeOnCommit(event.detail.value)) {\n this.restoreFocus = true;\n this.hidePicker();\n }\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private handleTextInput(event: InputEvent) {\n // The native event escapes the shadow root; the field fires its own `input` from the picker.\n event.stopPropagation();\n this.draft = (event.target as HTMLInputElement).value;\n this.invalidText = '';\n }\n\n private handleTextChange(event?: Event) {\n event?.stopPropagation();\n const text = this.draft.trim();\n if (!text) {\n this.invalidText = '';\n if (this.value) this.commit('');\n return;\n }\n const parsed = this.parseText(text);\n if (parsed === null) {\n this.invalidFlag = 'badInput';\n this.invalidText = this.i18n.t('enterFormat')(this.formatHint());\n return;\n }\n const problem = this.validateValue(parsed);\n if (problem) {\n this.invalidFlag = problem.flag;\n this.invalidText = problem.message;\n return;\n }\n if (parsed !== this.value) this.commit(parsed);\n // The value may be unchanged while the text differs (`6/11/26` for `06/11/2026`).\n this.draft = this.formatValue(parsed);\n }\n\n private handleTextKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter') this.handleTextChange();\n if (event.key === 'ArrowDown' && event.altKey) {\n event.preventDefault();\n this.showPicker();\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.pickerOpen) {\n event.stopPropagation();\n this.restoreFocus = true;\n this.hidePicker();\n }\n }\n\n private handleButtonClick(event: MouseEvent) {\n // Keep the field from moving focus to the text input.\n event.stopPropagation();\n if (this.pickerOpen) this.hidePicker();\n else this.showPicker();\n }\n\n /**\n * The popover's `open`/`close` (and those of anything inside it) are internal: they bubble and\n * are composed, so stop them here, or consumers listening on the field would hear them.\n */\n private handleOverlayEvent = (event: Event) => {\n event.stopPropagation();\n if (event.target !== this.popoverElement) return;\n if (event.type === 'open') this.handlePopoverOpen();\n else this.handlePopoverClose();\n };\n\n private handlePopoverOpen() {\n this.pickerOpen = true;\n }\n\n private handlePopoverClose() {\n this.pickerOpen = false;\n if (this.value !== this.lastCommitted) this.commit(this.value);\n if (this.restoreFocus) {\n this.restoreFocus = false;\n this.focus();\n }\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderPickerButton() {\n return html`<wc-icon-button\n slot=\"field-end\"\n class=\"picker-button\"\n shape=\"round\"\n variant=\"text\"\n color=\"secondary\"\n size=\"sm\"\n aria-label=${this.pickerLabel}\n aria-haspopup=\"dialog\"\n aria-expanded=${String(this.pickerOpen)}\n ?disabled=${this.disabled || this.readonly}\n @click=${this.handleButtonClick}\n >\n <wc-icon name=${this.pickerIcon}></wc-icon>\n </wc-icon-button>`;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n return html`\n <wc-popover\n class=\"popover\"\n trigger=\"manual\"\n placement=${this.placement}\n offset=\"4\"\n @keydown=${this.handleKeyDown}\n @open=${this.handleOverlayEvent}\n @close=${this.handleOverlayEvent}\n >\n ${this.renderField(\n html`<input\n class=\"input\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n placeholder=${this.placeholder || this.formatHint()}\n .value=${this.draft}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n @input=${this.handleTextInput}\n @change=${this.handleTextChange}\n @keydown=${this.handleTextKeyDown}\n @focus=${this.handleFieldFocus}\n @blur=${this.handleFieldFocus}\n ${spread(this.fieldAria(this.invalidText))}\n />`,\n {\n populated: !!this.draft,\n focused: this.focused || this.pickerOpen,\n controlError: this.invalidText,\n end: this.renderPickerButton(),\n },\n )}\n <wc-popover-content\n class=\"picker-panel\"\n role=\"dialog\"\n aria-label=${this.pickerLabel}\n >\n ${this.renderPicker()}\n </wc-popover-content>\n </wc-popover>\n `;\n }\n}\n"],"names":["html","property","state","query"],"mappings":";;;;;;;;AAoBA;;;;;;;;;;;AAWG;AACW,MAAgB,WAAY,SAAQ,SAAS,CAAA;AAA3D,IAAA,WAAA,GAAA;;;;QAI8B,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A,CAAA;IAA9BC,CAAK,CAAC,YAAY;AAAqC,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAE7B,UAAA,CAAA;IAA1BA,CAAK,CAAC,QAAQ;AAA4C,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAE/B,UAAA,CAAA;IAA3BA,CAAK,CAAC,SAAS;AAA4C,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"picker-field-loXW-xrW.js","sources":["../../src/__internal/picker-field.ts"],"sourcesContent":["import { html, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\n\nimport { spread } from '@/__internal/directive/spread.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport BaseField from '../input/BaseField.js';\nimport type { ControlValidity } from '../input/BaseInput.js';\nimport type { Popover } from '../popover/popover.js';\n\n/** A picker hosted in a field's popover: it takes focus when the popover opens. */\ninterface FocusablePicker extends HTMLElement {\n focus(): void;\n}\n\n/** Why a parsed value is not allowed: the validity flag it sets and the message to show. */\nexport interface ValueProblem {\n flag: 'rangeUnderflow' | 'rangeOverflow' | 'badInput';\n message: string;\n}\n\n/**\n * Base for text fields that open a picker in a popover: `wc-date-field`, `wc-time-field` and\n * `wc-datetime-field`.\n *\n * The field keeps the typed text in `draft` and parses it on blur or Enter. Valid text becomes\n * `value` (always ISO, so forms submit a locale-independent value) and fires `change`; text that\n * does not parse, or falls outside `min`/`max`, keeps the draft, shows an error and makes the\n * field invalid (`badInput`, `rangeUnderflow` or `rangeOverflow`). Values picked in the popover\n * fire `input` while they change and `change` once committed.\n *\n * Subclasses supply the parsing, formatting, validation and the picker itself.\n */\nexport default abstract class PickerField extends BaseField {\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** The value as an ISO string; empty when there is none. */\n @property({ type: String }) value = '';\n\n /** BCP 47 locale for display and typed input; defaults to the page language. */\n @property({ type: String }) locale = '';\n\n /** Where the picker opens, relative to the field. */\n @property({ type: String }) placement: Popover['placement'] = 'bottom-start';\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** Text in the input; differs from the formatted `value` while the person is typing. */\n @state() protected draft = '';\n\n @state() protected pickerOpen = false;\n\n /** Message for typed text that could not be used; empty when the text is fine. */\n @state() protected invalidText = '';\n\n /** The validity flag `invalidText` stands for. */\n @state() protected invalidFlag: ValueProblem['flag'] = 'badInput';\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('wc-popover') protected popoverElement?: Popover;\n\n @query('.input') protected inputElement?: HTMLInputElement;\n\n @query('.picker') protected pickerElement?: FocusablePicker;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** The last value announced with `change`; closing the popover commits anything newer. */\n private lastCommitted = '';\n\n /** Whether to move focus back to the input when the popover closes. */\n private restoreFocus = false;\n\n /** Peacock's strings and the locale values are shown in. */\n protected readonly i18n = new I18nController(this);\n\n // ── Abstract members ─────────────────────────────────────────────────────\n\n /** Material icon name for the button that opens the picker. */\n protected abstract readonly pickerIcon: string;\n\n /** Accessible name for the button that opens the picker. */\n protected abstract get pickerLabel(): string;\n\n /** Whether a value committed in the picker closes the popover. */\n protected abstract closeOnCommit(value: string): boolean;\n\n /** Parses typed text to an ISO value, or returns null when it cannot be read. */\n protected abstract parseText(text: string): string | null;\n\n /** Formats an ISO value as display text. */\n protected abstract formatValue(value: string): string;\n\n /** The format hint used for the placeholder and the error message. */\n protected abstract formatHint(): string;\n\n /** Returns the problem when a parsed value is not allowed (outside min/max), else null. */\n protected abstract validateValue(value: string): ValueProblem | null;\n\n /** Renders the picker inside the popover. It must carry the `picker` class. */\n protected abstract renderPicker(): TemplateResult;\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n override connectedCallback() {\n super.connectedCallback();\n this.lastCommitted = this.value;\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n super.willUpdate(changed);\n if (changed.has('value') || changed.has('locale')) {\n this.draft = this.formatValue(this.value);\n this.invalidText = '';\n }\n }\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.inputElement?.focus();\n }\n\n override blur() {\n this.inputElement?.blur();\n }\n\n /** Opens the picker and moves focus into it. */\n showPicker() {\n if (this.disabled || this.readonly) return;\n this.popoverElement?.show();\n this.updateComplete.then(() => {\n requestAnimationFrame(() => this.pickerElement?.focus());\n });\n }\n\n /** Closes the picker. */\n hidePicker() {\n this.popoverElement?.hide();\n }\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected get resolvedLocale(): string {\n return this.i18n.locale;\n }\n\n protected override computeValidity(): ControlValidity {\n if (this.invalidText && !this.disabled) {\n return {\n flags: { [this.invalidFlag]: true },\n message: this.invalidText,\n };\n }\n return super.computeValidity();\n }\n\n protected override validityAnchor() {\n return this.inputElement;\n }\n\n /** Sets the value and fires `change`. */\n protected commit(value: string) {\n this.value = value;\n this.lastCommitted = value;\n this.emitValue('change');\n }\n\n /** Sets the value and fires `input`, for a change that is not committed yet. */\n protected preview(value: string) {\n this.value = value;\n this.emitValue('input');\n }\n\n protected override clearValue() {\n this.preview('');\n this.commit('');\n }\n\n protected handlePickerInput(event: CustomEvent<{ value: string }>) {\n event.stopPropagation();\n this.preview(event.detail.value);\n }\n\n protected handlePickerChange(event: CustomEvent<{ value: string }>) {\n event.stopPropagation();\n this.commit(event.detail.value);\n if (this.closeOnCommit(event.detail.value)) {\n this.restoreFocus = true;\n this.hidePicker();\n }\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private handleTextInput(event: InputEvent) {\n // The native event escapes the shadow root; the field fires its own `input` from the picker.\n event.stopPropagation();\n this.draft = (event.target as HTMLInputElement).value;\n this.invalidText = '';\n }\n\n private handleTextChange(event?: Event) {\n event?.stopPropagation();\n const text = this.draft.trim();\n if (!text) {\n this.invalidText = '';\n if (this.value) this.commit('');\n return;\n }\n const parsed = this.parseText(text);\n if (parsed === null) {\n this.invalidFlag = 'badInput';\n this.invalidText = this.i18n.t('enterFormat')(this.formatHint());\n return;\n }\n const problem = this.validateValue(parsed);\n if (problem) {\n this.invalidFlag = problem.flag;\n this.invalidText = problem.message;\n return;\n }\n if (parsed !== this.value) this.commit(parsed);\n // The value may be unchanged while the text differs (`6/11/26` for `06/11/2026`).\n this.draft = this.formatValue(parsed);\n }\n\n private handleTextKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter') this.handleTextChange();\n if (event.key === 'ArrowDown' && event.altKey) {\n event.preventDefault();\n this.showPicker();\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.pickerOpen) {\n event.stopPropagation();\n this.restoreFocus = true;\n this.hidePicker();\n }\n }\n\n private handleButtonClick(event: MouseEvent) {\n // Keep the field from moving focus to the text input.\n event.stopPropagation();\n if (this.pickerOpen) this.hidePicker();\n else this.showPicker();\n }\n\n /**\n * The popover's `open`/`close` (and those of anything inside it) are internal: they bubble and\n * are composed, so stop them here, or consumers listening on the field would hear them.\n */\n private handleOverlayEvent = (event: Event) => {\n event.stopPropagation();\n if (event.target !== this.popoverElement) return;\n if (event.type === 'open') this.handlePopoverOpen();\n else this.handlePopoverClose();\n };\n\n private handlePopoverOpen() {\n this.pickerOpen = true;\n }\n\n private handlePopoverClose() {\n this.pickerOpen = false;\n if (this.value !== this.lastCommitted) this.commit(this.value);\n if (this.restoreFocus) {\n this.restoreFocus = false;\n this.focus();\n }\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderPickerButton() {\n return html`<wc-icon-button\n slot=\"field-end\"\n class=\"picker-button\"\n shape=\"round\"\n variant=\"text\"\n color=\"secondary\"\n size=\"sm\"\n aria-label=${this.pickerLabel}\n aria-haspopup=\"dialog\"\n aria-expanded=${String(this.pickerOpen)}\n ?disabled=${this.disabled || this.readonly}\n @click=${this.handleButtonClick}\n >\n <wc-icon name=${this.pickerIcon}></wc-icon>\n </wc-icon-button>`;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n return html`\n <wc-popover\n class=\"popover\"\n trigger=\"manual\"\n placement=${this.placement}\n offset=\"4\"\n @keydown=${this.handleKeyDown}\n @open=${this.handleOverlayEvent}\n @close=${this.handleOverlayEvent}\n >\n ${this.renderField(\n html`<input\n class=\"input\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n placeholder=${this.placeholder || this.formatHint()}\n .value=${this.draft}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n @input=${this.handleTextInput}\n @change=${this.handleTextChange}\n @keydown=${this.handleTextKeyDown}\n @focus=${this.handleFieldFocus}\n @blur=${this.handleFieldFocus}\n ${spread(this.fieldAria(this.invalidText))}\n />`,\n {\n populated: !!this.draft,\n focused: this.focused || this.pickerOpen,\n controlError: this.invalidText,\n end: this.renderPickerButton(),\n },\n )}\n <wc-popover-content\n class=\"picker-panel\"\n role=\"dialog\"\n aria-label=${this.pickerLabel}\n >\n ${this.renderPicker()}\n </wc-popover-content>\n </wc-popover>\n `;\n }\n}\n"],"names":["html","property","state","query"],"mappings":";;;;;;;;AAoBA;;;;;;;;;;;AAWG;AACW,MAAgB,WAAY,SAAQ,SAAS,CAAA;AAA3D,IAAA,WAAA,GAAA;;;;QAI8B,IAAA,CAAA,KAAK,GAAG,EAAE;;QAGV,IAAA,CAAA,MAAM,GAAG,EAAE;;QAGX,IAAA,CAAA,SAAS,GAAyB,cAAc;;;QAKzD,IAAA,CAAA,KAAK,GAAG,EAAE;QAEV,IAAA,CAAA,UAAU,GAAG,KAAK;;QAGlB,IAAA,CAAA,WAAW,GAAG,EAAE;;QAGhB,IAAA,CAAA,WAAW,GAAyB,UAAU;;;QAazD,IAAA,CAAA,aAAa,GAAG,EAAE;;QAGlB,IAAA,CAAA,YAAY,GAAG,KAAK;;AAGT,QAAA,IAAA,CAAA,IAAI,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC;AAgLlD;;;AAGG;AACK,QAAA,IAAA,CA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  import { a as ALWAYS_SENSITIVE } from './ai-controller-DR_Tg0sN.js';
6
6
  import { s as spread } from './spread-B5cgadZl.js';
7
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
8
- import { B as BaseField } from './BaseField-BMumJpkW.js';
7
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
8
+ import { B as BaseField } from './BaseField-D8ByB0l3.js';
9
9
  import './base-Cl6v8-BZ.js';
10
10
  import './directive-ZPhl09Yt.js';
11
11
  import './directive-helpers-Bx3mu42O.js';
12
12
  import './locale-DEsJZCQG.js';
13
- import './strings-BJPuhKJk.js';
13
+ import './strings-o6v6Hrmn.js';
14
14
  import './state-BCeDVCI9.js';
15
- import './BaseInput-mWdyYv27.js';
15
+ import './BaseInput-xCHvT4AN.js';
16
16
  import './element-internals-QME0yEz4.js';
17
17
  import './form-associated-BHbg72PG.js';
18
- import './suggestion-controller-CW17adxd.js';
18
+ import './suggestion-controller-7YRQqkaI.js';
19
19
 
20
20
  var css_248z = i`* {
21
21
  box-sizing: border-box;
@@ -2,9 +2,9 @@ import { i, w, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './class-map-NDIkZErE.js';
5
- import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
5
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
6
6
  import './directive-ZPhl09Yt.js';
7
- import './strings-BJPuhKJk.js';
7
+ import './strings-o6v6Hrmn.js';
8
8
  import './locale-DEsJZCQG.js';
9
9
 
10
10
  var css_248z = i`* {
@@ -2,7 +2,7 @@ import { i, _ as __decorate, I as IndividualComponent, b, A } from './Individual
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { e } from './class-map-NDIkZErE.js';
4
4
  import { i as Extension } from './slash-controller-DAsDquPA.js';
5
- import { R as RichTextInput } from './rich-text-input-DM_BOzgk.js';
5
+ import { R as RichTextInput } from './rich-text-input-B5j0eqCJ.js';
6
6
  import { e as extractMentions } from './markdown-lexer-Bx4Vkpu6.js';
7
7
  import './directive-ZPhl09Yt.js';
8
8
  import './diff-CT416thw.js';
@@ -18,12 +18,12 @@ import './state-BCeDVCI9.js';
18
18
  import './query-CHb9Ft_d.js';
19
19
  import './base-Cl6v8-BZ.js';
20
20
  import './style-map-CHOg6N_R.js';
21
- import './BaseInput-mWdyYv27.js';
21
+ import './BaseInput-xCHvT4AN.js';
22
22
  import './element-internals-QME0yEz4.js';
23
23
  import './form-associated-BHbg72PG.js';
24
- import './strings-BJPuhKJk.js';
25
- import './suggestion-controller-CW17adxd.js';
26
- import './i18n-controller-Cp43HjJl.js';
24
+ import './strings-o6v6Hrmn.js';
25
+ import './suggestion-controller-7YRQqkaI.js';
26
+ import './i18n-controller-CH4e9sju.js';
27
27
 
28
28
  var css_248z = i`* {
29
29
  box-sizing: border-box;
@@ -252,6 +252,22 @@ img.ProseMirror-separator {
252
252
  flex: 1;
253
253
  }
254
254
 
255
+ .read-only-badge {
256
+ display: inline-flex;
257
+ align-items: center;
258
+ gap: var(--spacing-050, 0.25rem);
259
+ padding: 0 var(--spacing-100, 0.5rem);
260
+ color: var(--color-on-surface-variant);
261
+ font-family: var(--typography-label-small-font-family) !important;
262
+ font-size: var(--typography-label-small-font-size) !important;
263
+ font-weight: var(--typography-label-small-font-weight) !important;
264
+ line-height: var(--typography-label-small-line-height) !important;
265
+ letter-spacing: var(--typography-label-small-letter-spacing) !important;
266
+ }
267
+ .read-only-badge wc-icon {
268
+ --icon-size: 0.875rem;
269
+ }
270
+
255
271
  .editor-area {
256
272
  --_pad: var(--spacing-150, 0.75rem);
257
273
  position: relative;
@@ -501,9 +517,12 @@ img.ProseMirror-separator {
501
517
  border-radius: 0;
502
518
  }
503
519
 
520
+ :host([disabled]) .toolbar,
521
+ :host([disabled]) .editor-area {
522
+ opacity: var(--state-disabled-content-opacity, 0.38);
523
+ }
504
524
  :host([disabled]) .editor-area {
505
525
  cursor: not-allowed;
506
- opacity: 0.6;
507
526
  }
508
527
 
509
528
  :host([readonly]) .editor-area {
@@ -517,13 +536,6 @@ img.ProseMirror-separator {
517
536
  padding-block: var(--spacing-100, 0.5rem);
518
537
  }
519
538
 
520
- .state-tag {
521
- position: absolute;
522
- inset-block-start: var(--spacing-050, 0.25rem);
523
- inset-inline-end: var(--spacing-050, 0.25rem);
524
- z-index: 1;
525
- }
526
-
527
539
  .slash-anchor,
528
540
  .bubble-anchor,
529
541
  .link-anchor {
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-input.js","sources":["../../src/prompt-input/prompt-input.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { Extension, type Editor, type Extensions } from '@tiptap/core';\n\nimport IndividualComponent from '@/IndividualComponent.js';\nimport RichTextInput, {\n type RichTextContent,\n} from '@/__internal/rich-text/rich-text-input.js';\nimport { extractMentions } from '@/__internal/rich-text/markdown-lexer.js';\nimport type { RichTextMention } from '@/__internal/rich-text/mention.js';\n\nimport styles from './prompt-input.scss';\n\n/** `detail` of `submit`: the text and the records or people it mentions. */\nexport interface PromptInputSubmitDetail {\n value: string;\n mentions: RichTextMention[];\n}\n\n/**\n * @label Prompt Input\n * @tag wc-prompt-input\n * @rawTag prompt-input\n *\n * @summary The box for writing to the assistant: plain text with mentions, sent with Enter, with a Stop button while the answer arrives.\n * @overview\n * <p>Where people ask the assistant for something, at the bottom of <code>wc-assistant-panel</code>\n * (ADR-030002). It is plain text, no formatting: Enter sends, Shift+Enter starts a new line, and the\n * box grows up to <code>max-rows</code> lines.</p>\n * <p>Sending fires a cancelable <code>submit</code> with the text in <code>detail.value</code> and\n * its mentions in <code>detail.mentions</code>, then empties the box unless the event is cancelled.\n * While <code>loading</code> (the answer is arriving), the send button becomes <strong>Stop</strong>,\n * which fires <code>stop</code>, and Enter does not send.</p>\n * <p>Mentions point the assistant at records: with <code>triggers=\"@\"</code> (the default), typing\n * <code>@</code> fires <code>search</code>; answer by setting <code>suggestions</code>, as on\n * <code>wc-mention-input</code>. Add <code>/</code> to <code>triggers</code> for commands. A mention\n * is stored as <code>[@INC-2318](mention:inc_2318)</code>.</p>\n * <p>Put an attach button in the <code>start</code> slot and the attached files, as chips, in the\n * <code>attachments</code> slot above the text.</p>\n *\n * @slot start - Before the text, such as an attach button.\n * @slot attachments - Above the text, such as chips for attached files.\n *\n * @cssprop --prompt-input-background - Background of the box.\n *\n * @fires {CustomEvent<PromptInputSubmitDetail>} submit - Cancelable. The person sent the text; cancel it to keep the text in the box.\n * @fires {CustomEvent<void>} stop - The person pressed Stop while `loading`.\n * @fires {CustomEvent<{value: string}>} input - Dispatched as the text changes, after `debounce` milliseconds without typing.\n * @fires {CustomEvent<{value: string}>} change - Dispatched when focus leaves after an edit.\n * @fires {CustomEvent<{trigger: string, query: string}>} search - Dispatched as a mention is typed; answer with `suggestions`.\n * @fires {CustomEvent<{mention: {id: string, label: string, trigger: string}, suggestion: MentionSuggestion}>} mention - Dispatched when a suggestion is inserted as a mention.\n *\n * @example\n * ```html\n * <wc-prompt-input placeholder=\"Ask for something\"></wc-prompt-input>\n * ```\n * @tags input, ai\n */\n@IndividualComponent\nexport class PromptInput extends RichTextInput {\n // ── Static ────────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ────────────────────────────────────────────────────────────\n\n /** The answer is arriving: the send button becomes Stop and Enter does not send. */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n // ── Protected fields ──────────────────────────────────────────────────────\n\n protected readonly profile = 'prompt' as const;\n\n protected readonly sourceLanguage = 'markdown' as const;\n\n protected readonly sourceIcon = 'markdown';\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.rows = 1;\n this.maxRows = 6;\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n /** Sends the text, as Enter does. */\n submit() {\n const value = this.currentValue();\n if (!value.trim() || this.loading || this.disabled || this.readonly) {\n return;\n }\n const accepted = this.dispatchEvent(\n new CustomEvent<PromptInputSubmitDetail>('submit', {\n detail: { value, mentions: extractMentions(value) },\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n if (accepted) this.clear();\n }\n\n /** Empties the box. */\n clear() {\n this.value = '';\n }\n\n // ── Protected methods ─────────────────────────────────────────────────────\n\n protected get showBlockHandle(): boolean {\n return false;\n }\n\n protected get slashMenu(): boolean {\n return false;\n }\n\n protected get selectionBubble(): boolean {\n return false;\n }\n\n protected readFromEditor(editor: Editor): string {\n return this.isEditorEmpty(editor) ? '' : editor.getMarkdown();\n }\n\n protected contentFor(value: string): RichTextContent {\n return { content: value ?? '', contentType: 'markdown' };\n }\n\n protected defaultPlaceholder(): string {\n return this.i18n.t('promptPlaceholder');\n }\n\n protected extraExtensions(): Extensions {\n return [\n Extension.create({\n name: 'peacockPromptKeys',\n addKeyboardShortcuts: () => ({\n Enter: () => {\n // A mention being picked takes Enter first.\n if (this.mentions.visible) return false;\n this.submit();\n return true;\n },\n 'Shift-Enter': ({ editor }) => editor.commands.splitBlock(),\n }),\n }),\n ];\n }\n\n // ── Private methods ───────────────────────────────────────────────────────\n\n /** The value, including typing the editor has not reported yet. */\n private currentValue(): string {\n const { editor } = this;\n return editor\n ? this.normalizeValue(this.readFromEditor(editor))\n : this.value;\n }\n\n private onStop = () => {\n this.dispatchEvent(\n new CustomEvent('stop', { bubbles: true, composed: true }),\n );\n };\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n private renderAction() {\n const { i18n } = this;\n if (this.loading) {\n return html`<wc-icon-button\n class=\"action stop\"\n variant=\"filled\"\n shape=\"round\"\n size=\"sm\"\n aria-label=${i18n.t('promptStop')}\n tooltip=${i18n.t('promptStop')}\n @click=${this.onStop}\n ><wc-icon name=\"stop\"></wc-icon\n ></wc-icon-button>`;\n }\n const empty = !this.value.trim();\n return html`<wc-icon-button\n class=\"action send\"\n variant=\"filled\"\n shape=\"round\"\n size=\"sm\"\n aria-label=${i18n.t('promptSend')}\n tooltip=${i18n.t('promptSend')}\n ?disabled=${empty || this.disabled || this.readonly}\n @mousedown=${this.keepSelection}\n @click=${() => this.submit()}\n ><wc-icon name=\"arrow_upward\"></wc-icon\n ></wc-icon-button>`;\n }\n\n render() {\n const { validationText } = this;\n return html`<div\n class=${classMap({\n prompt: true,\n focused: this.editorFocused,\n invalid: this.error || !!validationText,\n disabled: this.disabled,\n })}\n >\n <slot name=\"attachments\"></slot>\n <div class=\"row\">\n <slot name=\"start\"></slot>\n <div class=\"text max-rows\">${this.renderEditorArea()}</div>\n ${this.renderAction()}\n </div>\n </div>\n ${validationText || (this.error && this.errorText)\n ? html`<div class=\"error-text\" role=\"alert\">\n ${this.error ? this.errorText : validationText}\n </div>`\n : nothing}\n ${this.helperText\n ? html`<div class=\"helper-text\">${this.helperText}</div>`\n : nothing}\n ${this.renderPopups()}`;\n }\n}\n"],"names":["html","classMap","nothing","styles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,cAAc,EAAE,GAAG,IAAI;AAC/B,QAAA,OAAOA,CAAI,CAAA,CAAA;AACC,cAAA,EAAAC,CAAQ,CAAC;AACf,YAAA,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,IAAI,CAAC,aAAa;AAC3B,YAAA,OAAO,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,cAAc;YACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;;;;;uCAK6B,IAAI,CAAC,gBAAgB,EAAE,CAAA;YAClD,IAAI,CAAC,YAAY,EAAE;;;QAGvB,cAAc,KAAK,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS;cAC7CD,CAAI,CAAA,CAAA;cACA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,cAAc;AACzC,gBAAA;AACT,cAAEE,CAAO;AACT,MAAA,EAAA,IAAI,CAAC;AACL,cAAEF,CAAI,CAAA,4BAA4B,IAAI,CAAC,UAAU,CAAA,MAAA;AACjD,cAAEE,CAAO;AACT,MAAA,EAAA,IAAI,CAAC,YAAY,EAAE,CAAA,CAAE;IAC3B;;AAtKA;AAEO,WAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AAMxB,UAAA,CAAA;IADCC,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC1B,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AATL,WAAW,GAAA,UAAA,CAAA;IADvB;AACY,CAAA,EAAA,WAAW,CAwKvB;;;;"}
1
+ {"version":3,"file":"prompt-input.js","sources":["../../src/prompt-input/prompt-input.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { Extension, type Editor, type Extensions } from '@tiptap/core';\n\nimport IndividualComponent from '@/IndividualComponent.js';\nimport RichTextInput, {\n type RichTextContent,\n} from '@/__internal/rich-text/rich-text-input.js';\nimport { extractMentions } from '@/__internal/rich-text/markdown-lexer.js';\nimport type { RichTextMention } from '@/__internal/rich-text/mention.js';\n\nimport styles from './prompt-input.scss';\n\n/** `detail` of `submit`: the text and the records or people it mentions. */\nexport interface PromptInputSubmitDetail {\n value: string;\n mentions: RichTextMention[];\n}\n\n/**\n * @label Prompt Input\n * @tag wc-prompt-input\n * @rawTag prompt-input\n *\n * @summary The box for writing to the assistant: plain text with mentions, sent with Enter, with a Stop button while the answer arrives.\n * @overview\n * <p>Where people ask the assistant for something, at the bottom of <code>wc-assistant-panel</code>\n * (ADR-030002). It is plain text, no formatting: Enter sends, Shift+Enter starts a new line, and the\n * box grows up to <code>max-rows</code> lines.</p>\n * <p>Sending fires a cancelable <code>submit</code> with the text in <code>detail.value</code> and\n * its mentions in <code>detail.mentions</code>, then empties the box unless the event is cancelled.\n * While <code>loading</code> (the answer is arriving), the send button becomes <strong>Stop</strong>,\n * which fires <code>stop</code>, and Enter does not send.</p>\n * <p>Mentions point the assistant at records: with <code>triggers=\"@\"</code> (the default), typing\n * <code>@</code> fires <code>search</code>; answer by setting <code>suggestions</code>, as on\n * <code>wc-mention-input</code>. Add <code>/</code> to <code>triggers</code> for commands. A mention\n * is stored as <code>[@INC-2318](mention:inc_2318)</code>.</p>\n * <p>Put an attach button in the <code>start</code> slot and the attached files, as chips, in the\n * <code>attachments</code> slot above the text.</p>\n *\n * @slot start - Before the text, such as an attach button.\n * @slot attachments - Above the text, such as chips for attached files.\n *\n * @cssprop --prompt-input-background - Background of the box.\n *\n * @fires {CustomEvent<PromptInputSubmitDetail>} submit - Cancelable. The person sent the text; cancel it to keep the text in the box.\n * @fires {CustomEvent<void>} stop - The person pressed Stop while `loading`.\n * @fires {CustomEvent<{value: string}>} input - Dispatched as the text changes, after `debounce` milliseconds without typing.\n * @fires {CustomEvent<{value: string}>} change - Dispatched when focus leaves after an edit.\n * @fires {CustomEvent<{trigger: string, query: string}>} search - Dispatched as a mention is typed; answer with `suggestions`.\n * @fires {CustomEvent<{mention: {id: string, label: string, trigger: string}, suggestion: MentionSuggestion}>} mention - Dispatched when a suggestion is inserted as a mention.\n *\n * @example\n * ```html\n * <wc-prompt-input placeholder=\"Ask for something\"></wc-prompt-input>\n * ```\n * @tags input, ai\n */\n@IndividualComponent\nexport class PromptInput extends RichTextInput {\n // ── Static ────────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ────────────────────────────────────────────────────────────\n\n /** The answer is arriving: the send button becomes Stop and Enter does not send. */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n // ── Protected fields ──────────────────────────────────────────────────────\n\n protected readonly profile = 'prompt' as const;\n\n protected readonly sourceLanguage = 'markdown' as const;\n\n protected readonly sourceIcon = 'markdown';\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.rows = 1;\n this.maxRows = 6;\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n /** Sends the text, as Enter does. */\n submit() {\n const value = this.currentValue();\n if (!value.trim() || this.loading || this.disabled || this.readonly) {\n return;\n }\n const accepted = this.dispatchEvent(\n new CustomEvent<PromptInputSubmitDetail>('submit', {\n detail: { value, mentions: extractMentions(value) },\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n if (accepted) this.clear();\n }\n\n /** Empties the box. */\n clear() {\n this.value = '';\n }\n\n // ── Protected methods ─────────────────────────────────────────────────────\n\n protected get showBlockHandle(): boolean {\n return false;\n }\n\n protected get slashMenu(): boolean {\n return false;\n }\n\n protected get selectionBubble(): boolean {\n return false;\n }\n\n protected readFromEditor(editor: Editor): string {\n return this.isEditorEmpty(editor) ? '' : editor.getMarkdown();\n }\n\n protected contentFor(value: string): RichTextContent {\n return { content: value ?? '', contentType: 'markdown' };\n }\n\n protected defaultPlaceholder(): string {\n return this.i18n.t('promptPlaceholder');\n }\n\n protected extraExtensions(): Extensions {\n return [\n Extension.create({\n name: 'peacockPromptKeys',\n addKeyboardShortcuts: () => ({\n Enter: () => {\n // A mention being picked takes Enter first.\n if (this.mentions.visible) return false;\n this.submit();\n return true;\n },\n 'Shift-Enter': ({ editor }) => editor.commands.splitBlock(),\n }),\n }),\n ];\n }\n\n // ── Private methods ───────────────────────────────────────────────────────\n\n /** The value, including typing the editor has not reported yet. */\n private currentValue(): string {\n const { editor } = this;\n return editor\n ? this.normalizeValue(this.readFromEditor(editor))\n : this.value;\n }\n\n private onStop = () => {\n this.dispatchEvent(\n new CustomEvent('stop', { bubbles: true, composed: true }),\n );\n };\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n private renderAction() {\n const { i18n } = this;\n if (this.loading) {\n return html`<wc-icon-button\n class=\"action stop\"\n variant=\"filled\"\n shape=\"round\"\n size=\"sm\"\n aria-label=${i18n.t('promptStop')}\n tooltip=${i18n.t('promptStop')}\n @click=${this.onStop}\n ><wc-icon name=\"stop\"></wc-icon\n ></wc-icon-button>`;\n }\n const empty = !this.value.trim();\n return html`<wc-icon-button\n class=\"action send\"\n variant=\"filled\"\n shape=\"round\"\n size=\"sm\"\n aria-label=${i18n.t('promptSend')}\n tooltip=${i18n.t('promptSend')}\n ?disabled=${empty || this.disabled || this.readonly}\n @mousedown=${this.keepSelection}\n @click=${() => this.submit()}\n ><wc-icon name=\"arrow_upward\"></wc-icon\n ></wc-icon-button>`;\n }\n\n render() {\n const { validationText } = this;\n return html`<div\n class=${classMap({\n prompt: true,\n focused: this.editorFocused,\n invalid: this.error || !!validationText,\n disabled: this.disabled,\n })}\n >\n <slot name=\"attachments\"></slot>\n <div class=\"row\">\n <slot name=\"start\"></slot>\n <div class=\"text max-rows\">${this.renderEditorArea()}</div>\n ${this.renderAction()}\n </div>\n </div>\n ${validationText || (this.error && this.errorText)\n ? html`<div class=\"error-text\" role=\"alert\">\n ${this.error ? this.errorText : validationText}\n </div>`\n : nothing}\n ${this.helperText\n ? html`<div class=\"helper-text\">${this.helperText}</div>`\n : nothing}\n ${this.renderPopups()}`;\n }\n}\n"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AA,EAAA,IAAI,CAAC;AACL,cAAEF,CAAI,CAAA,4BAA4B,IAAI,CAAC,UAAU,CAAA,MAAA;AACjD,cAAEE,CAAO;AACT,MAAA,EAAA,IAAI,CAAC,YAAY,EAAE,CAAA,CAAE;IAC3B;;AAtKA;AAEO,WAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AAMxB,UAAA,CAAA;IADCC,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC1B,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AATL,WAAW,GAAA,UAAA,CAAA;IADvB;AACY,CAAA,EAAA,WAAW,CAwKvB;;;;"}
@@ -2,7 +2,7 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './class-map-NDIkZErE.js';
5
- import { S as SuggestionController } from './suggestion-controller-CW17adxd.js';
5
+ import { S as SuggestionController } from './suggestion-controller-7YRQqkaI.js';
6
6
  import './directive-ZPhl09Yt.js';
7
7
  import './ai-controller-DR_Tg0sN.js';
8
8
  import './locale-DEsJZCQG.js';
package/dist/radio.js CHANGED
@@ -2,16 +2,16 @@ import { i, _ as __decorate, I as IndividualComponent, b } from './IndividualCom
2
2
  import { r } from './state-BCeDVCI9.js';
3
3
  import { e } from './class-map-NDIkZErE.js';
4
4
  import { s as spread } from './spread-B5cgadZl.js';
5
- import { p as peacockString } from './strings-BJPuhKJk.js';
6
- import { T as ToggleBase } from './toggle-base-BlaHalfS.js';
5
+ import { p as peacockString } from './strings-o6v6Hrmn.js';
6
+ import { T as ToggleBase } from './toggle-base-BSzBnLZN.js';
7
7
  import './property-B2TG3KEE.js';
8
8
  import './directive-ZPhl09Yt.js';
9
9
  import './query-CHb9Ft_d.js';
10
10
  import './base-Cl6v8-BZ.js';
11
11
  import './form-associated-BHbg72PG.js';
12
12
  import './element-internals-QME0yEz4.js';
13
- import './BaseInput-mWdyYv27.js';
14
- import './suggestion-controller-CW17adxd.js';
13
+ import './BaseInput-xCHvT4AN.js';
14
+ import './suggestion-controller-7YRQqkaI.js';
15
15
  import './ai-controller-DR_Tg0sN.js';
16
16
  import './locale-DEsJZCQG.js';
17
17
 
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-Cp43HjJl.js';
7
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
8
8
  import { i as isRtl } from './locale-DEsJZCQG.js';
9
9
  import { g as getFormValue } from './form-associated-BHbg72PG.js';
10
- import { B as BaseInput } from './BaseInput-mWdyYv27.js';
10
+ import { B as BaseInput } from './BaseInput-xCHvT4AN.js';
11
11
  import './base-Cl6v8-BZ.js';
12
12
  import './directive-ZPhl09Yt.js';
13
- import './strings-BJPuhKJk.js';
13
+ import './strings-o6v6Hrmn.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`* {
@@ -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-Cp43HjJl.js';
4
+ import { I as I18nController } from './i18n-controller-CH4e9sju.js';
5
5
  import './directive-ZPhl09Yt.js';
6
- import './strings-BJPuhKJk.js';
6
+ import './strings-o6v6Hrmn.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