@aceshooting/lyra-ui 13.0.1 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (723) hide show
  1. package/CHANGELOG.md +329 -0
  2. package/custom-elements.json +1 -1
  3. package/dist/cli/migration-contract.json +1 -1
  4. package/dist/components/agent-tools/activity-feed/activity-feed.class.d.ts +23 -15
  5. package/dist/components/agent-tools/activity-feed/activity-feed.class.js +9 -6
  6. package/dist/components/agent-tools/agent-trace/agent-trace.class.d.ts +12 -3
  7. package/dist/components/agent-tools/agent-trace/agent-trace.class.js +2 -1
  8. package/dist/components/agent-tools/approval-queue/approval-queue.class.d.ts +4 -2
  9. package/dist/components/agent-tools/approval-queue/approval-queue.class.js +1 -1
  10. package/dist/components/agent-tools/artifact-panel/artifact-panel.styles.js +1 -1
  11. package/dist/components/agent-tools/commit-card/commit-card.class.d.ts +3 -1
  12. package/dist/components/agent-tools/commit-card/commit-card.class.js +2 -2
  13. package/dist/components/agent-tools/compare-panel/compare-panel.class.d.ts +2 -1
  14. package/dist/components/agent-tools/compare-panel/compare-panel.styles.js +1 -1
  15. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.d.ts +6 -2
  16. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.js +8 -8
  17. package/dist/components/agent-tools/result-card/result-card.class.d.ts +1 -1
  18. package/dist/components/agent-tools/result-card/result-card.class.js +1 -1
  19. package/dist/components/agent-tools/result-card/result-field.class.d.ts +1 -1
  20. package/dist/components/agent-tools/result-card/result-field.class.js +1 -1
  21. package/dist/components/agent-tools/schema-viewer/schema-viewer.class.d.ts +5 -5
  22. package/dist/components/agent-tools/schema-viewer/schema-viewer.class.js +23 -10
  23. package/dist/components/agent-tools/span-waterfall/span-waterfall.class.d.ts +13 -6
  24. package/dist/components/agent-tools/span-waterfall/span-waterfall.class.js +3 -3
  25. package/dist/components/agent-tools/span-waterfall/span-waterfall.styles.js +1 -1
  26. package/dist/components/agent-tools/stack-trace/stack-trace-parse.js +3 -3
  27. package/dist/components/agent-tools/stack-trace/stack-trace.class.d.ts +1 -1
  28. package/dist/components/agent-tools/stack-trace/stack-trace.class.js +1 -1
  29. package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js +1 -1
  30. package/dist/components/agent-tools/subagent-panel/subagent-panel.styles.js +1 -1
  31. package/dist/components/agent-tools/task-list/task-list.class.d.ts +1 -2
  32. package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
  33. package/dist/components/agent-tools/terminal/terminal.class.d.ts +11 -2
  34. package/dist/components/agent-tools/terminal/terminal.class.js +5 -5
  35. package/dist/components/agent-tools/terminal/terminal.styles.js +1 -1
  36. package/dist/components/agent-tools/test-results/test-results.class.d.ts +4 -2
  37. package/dist/components/agent-tools/test-results/test-results.class.js +2 -2
  38. package/dist/components/agent-tools/thinking-panel/thinking-panel.class.d.ts +2 -0
  39. package/dist/components/agent-tools/thinking-panel/thinking-panel.styles.js +1 -1
  40. package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.class.js +1 -1
  41. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +2 -2
  42. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.js +1 -1
  43. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +3 -2
  44. package/dist/components/agent-tools/tool-param-form/tool-param-form.d.ts +1 -1
  45. package/dist/components/agent-tools/tool-param-form/tool-param-form.js +1 -1
  46. package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.js +2 -2
  47. package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +1 -1
  48. package/dist/components/agent-tools/tool-result-view/registry.d.ts +2 -1
  49. package/dist/components/agent-tools/tool-result-view/tool-result-view.class.d.ts +1 -1
  50. package/dist/components/agent-tools/tool-result-view/tool-result-view.class.js +1 -1
  51. package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.class.d.ts +18 -12
  52. package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.class.js +7 -7
  53. package/dist/components/agent-tools/tool-timeline/tool-timeline.class.d.ts +9 -3
  54. package/dist/components/agent-tools/tool-timeline/tool-timeline.class.js +1 -1
  55. package/dist/components/agent-tools/trace-tree/span.d.ts +3 -1
  56. package/dist/components/agent-tools/trace-tree/span.js +1 -1
  57. package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +1 -1
  58. package/dist/components/charts/chart/box-plot.class.d.ts +12 -3
  59. package/dist/components/charts/chart/box-plot.class.js +9 -9
  60. package/dist/components/charts/chart/box-plot.styles.js +1 -1
  61. package/dist/components/charts/chart/chart-core-loader.js +1 -1
  62. package/dist/components/charts/chart/chart-feature-loader.js +1 -1
  63. package/dist/components/charts/chart/chart-preload.d.ts +1 -1
  64. package/dist/components/charts/chart/chart-preload.js +1 -1
  65. package/dist/components/charts/chart/chart.class.d.ts +33 -10
  66. package/dist/components/charts/chart/chart.class.js +23 -14
  67. package/dist/components/charts/chart/chart.styles.js +1 -1
  68. package/dist/components/charts/chart/histogram-bin.js +1 -1
  69. package/dist/components/charts/chart/lite-chart.class.d.ts +20 -11
  70. package/dist/components/charts/chart/lite-chart.class.js +17 -11
  71. package/dist/components/charts/chart/lite-chart.styles.js +1 -1
  72. package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +1 -1
  73. package/dist/components/conversation/agent-workspace/agent-workspace.class.js +2 -2
  74. package/dist/components/conversation/audio-visualizer/audio-visualizer.class.d.ts +10 -5
  75. package/dist/components/conversation/audio-visualizer/audio-visualizer.class.js +1 -1
  76. package/dist/components/conversation/branch-picker/branch-picker.class.d.ts +4 -2
  77. package/dist/components/conversation/branch-picker/branch-picker.class.js +1 -1
  78. package/dist/components/conversation/branch-picker/branch-picker.styles.js +1 -1
  79. package/dist/components/conversation/chat-composer/chat-composer.class.d.ts +6 -2
  80. package/dist/components/conversation/chat-composer/chat-composer.class.js +3 -3
  81. package/dist/components/conversation/chat-composer/chat-composer.styles.js +1 -1
  82. package/dist/components/conversation/chat-message/chat-message.class.d.ts +4 -3
  83. package/dist/components/conversation/chat-message/chat-message.class.js +2 -2
  84. package/dist/components/conversation/chat-message/chat-message.styles.js +1 -1
  85. package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +1 -1
  86. package/dist/components/conversation/code-block/code-block-core.class.d.ts +4 -3
  87. package/dist/components/conversation/code-block/code-block-core.class.js +1 -1
  88. package/dist/components/conversation/code-block/code-block-shared.d.ts +3 -3
  89. package/dist/components/conversation/code-block/code-block-shared.js +2 -2
  90. package/dist/components/conversation/code-block/code-block.class.d.ts +4 -3
  91. package/dist/components/conversation/code-block/code-block.class.js +1 -1
  92. package/dist/components/conversation/code-block/code-block.styles.js +1 -1
  93. package/dist/components/conversation/code-block/code-loader.d.ts +1 -1
  94. package/dist/components/conversation/code-block/code-loader.js +1 -1
  95. package/dist/components/conversation/code-block/shiki-types.d.ts +2 -0
  96. package/dist/components/conversation/code-block/shiki-types.js +1 -1
  97. package/dist/components/conversation/conversation-item/conversation-item.class.js +1 -1
  98. package/dist/components/conversation/conversation-item/conversation-item.styles.js +1 -1
  99. package/dist/components/conversation/generation-metrics/generation-metrics.styles.js +1 -1
  100. package/dist/components/conversation/markdown/katex-loader.d.ts +4 -4
  101. package/dist/components/conversation/markdown/katex-loader.js +1 -1
  102. package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
  103. package/dist/components/conversation/markdown/markdown-core.class.d.ts +1 -1
  104. package/dist/components/conversation/markdown/markdown-loader.d.ts +1 -1
  105. package/dist/components/conversation/markdown/markdown-loader.js +1 -1
  106. package/dist/components/conversation/markdown/markdown-shared.d.ts +6 -1
  107. package/dist/components/conversation/markdown/markdown-shared.js +5 -4
  108. package/dist/components/conversation/markdown/markdown.class.d.ts +1 -1
  109. package/dist/components/conversation/message-actions/message-actions.class.d.ts +18 -3
  110. package/dist/components/conversation/message-actions/message-actions.class.js +2 -2
  111. package/dist/components/conversation/message-actions/message-actions.styles.js +1 -1
  112. package/dist/components/conversation/message-actions/toolbar-actions.d.ts +3 -1
  113. package/dist/components/conversation/message-actions/toolbar-actions.js +1 -1
  114. package/dist/components/conversation/message-feedback/message-feedback.class.d.ts +40 -15
  115. package/dist/components/conversation/message-feedback/message-feedback.class.js +7 -3
  116. package/dist/components/conversation/message-feedback/message-feedback.styles.js +1 -1
  117. package/dist/components/conversation/message-parts/message-parts.class.d.ts +10 -4
  118. package/dist/components/conversation/message-parts/message-parts.class.js +2 -2
  119. package/dist/components/conversation/message-parts/message-parts.styles.js +1 -1
  120. package/dist/components/conversation/model-select/model-select.class.d.ts +5 -2
  121. package/dist/components/conversation/model-select/model-select.class.js +8 -5
  122. package/dist/components/conversation/model-settings-panel/model-settings-panel.class.d.ts +3 -5
  123. package/dist/components/conversation/model-settings-panel/model-settings-panel.class.js +2 -1
  124. package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +9 -2
  125. package/dist/components/conversation/prompt-input/prompt-input.class.js +3 -3
  126. package/dist/components/conversation/prompt-input/prompt-input.styles.js +1 -1
  127. package/dist/components/conversation/prompt-queue/prompt-queue.class.d.ts +20 -4
  128. package/dist/components/conversation/prompt-queue/prompt-queue.class.js +1 -1
  129. package/dist/components/conversation/prompt-queue/prompt-queue.styles.js +1 -1
  130. package/dist/components/conversation/push-to-talk/push-to-talk.class.d.ts +17 -8
  131. package/dist/components/conversation/push-to-talk/push-to-talk.class.js +1 -1
  132. package/dist/components/conversation/push-to-talk/push-to-talk.styles.js +1 -1
  133. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.d.ts +6 -3
  134. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js +1 -1
  135. package/dist/components/conversation/selection-toolbar/selection-toolbar.styles.js +1 -1
  136. package/dist/components/conversation/thread-list/thread-list.class.d.ts +14 -4
  137. package/dist/components/conversation/thread-list/thread-list.class.js +11 -11
  138. package/dist/components/conversation/thread-list/thread-list.styles.js +1 -1
  139. package/dist/components/conversation/transcript-feed/transcript-feed.class.d.ts +2 -0
  140. package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
  141. package/dist/components/conversation/transcript-feed/transcript-feed.styles.js +1 -1
  142. package/dist/components/conversation/typing-indicator/typing-indicator.class.d.ts +2 -1
  143. package/dist/components/conversation/typing-indicator/typing-indicator.class.js +1 -1
  144. package/dist/components/conversation/usage-badge/usage-badge-overlay-runtime.d.ts +3 -0
  145. package/dist/components/conversation/usage-badge/usage-badge-overlay-runtime.js +1 -0
  146. package/dist/components/conversation/usage-badge/usage-badge.class.d.ts +4 -2
  147. package/dist/components/conversation/usage-badge/usage-badge.class.js +1 -1
  148. package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +12 -4
  149. package/dist/components/conversation/voice-picker/voice-picker.class.js +8 -5
  150. package/dist/components/conversation/voice-picker/voice-picker.styles.js +1 -1
  151. package/dist/components/conversation/widget-renderer/resolve.d.ts +4 -6
  152. package/dist/components/conversation/widget-renderer/resolve.js +1 -1
  153. package/dist/components/data/calendar/calendar.class.d.ts +16 -5
  154. package/dist/components/data/calendar/calendar.class.js +2 -2
  155. package/dist/components/data/calendar/calendar.styles.js +1 -1
  156. package/dist/components/data/condition-builder/condition-builder.class.d.ts +3 -1
  157. package/dist/components/data/condition-builder/condition-builder.class.js +15 -1
  158. package/dist/components/data/context-meter/context-meter.class.d.ts +3 -1
  159. package/dist/components/data/context-meter/context-meter.class.js +4 -4
  160. package/dist/components/data/data-grid/data-grid.class.d.ts +51 -6
  161. package/dist/components/data/data-grid/data-grid.class.js +25 -11
  162. package/dist/components/data/data-grid/data-grid.styles.js +1 -1
  163. package/dist/components/data/document-library/document-library.class.d.ts +5 -2
  164. package/dist/components/data/document-library/document-library.class.js +1 -1
  165. package/dist/components/data/env-list/env-list.class.js +1 -1
  166. package/dist/components/data/file-tree/file-tree.class.d.ts +2 -1
  167. package/dist/components/data/file-tree/file-tree.class.js +1 -1
  168. package/dist/components/data/flow-canvas/flow-canvas.class.d.ts +24 -14
  169. package/dist/components/data/flow-canvas/flow-canvas.class.js +1 -2
  170. package/dist/components/data/flow-canvas/flow-canvas.styles.js +1 -1
  171. package/dist/components/data/flow-canvas/flow-model.js +1 -1
  172. package/dist/components/data/flow-canvas/flow-types.d.ts +2 -1
  173. package/dist/components/data/flow-controls/flow-controls.styles.js +1 -1
  174. package/dist/components/data/flow-run-status/flow-run-status.class.js +1 -1
  175. package/dist/components/data/funnel/funnel.class.d.ts +1 -0
  176. package/dist/components/data/funnel/funnel.class.js +1 -1
  177. package/dist/components/data/gauge/gauge.class.d.ts +4 -1
  178. package/dist/components/data/gauge/gauge.class.js +6 -6
  179. package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +5 -2
  180. package/dist/components/data/graph-query-builder/graph-query-builder.class.js +15 -1
  181. package/dist/components/data/graph-query-builder/graph-query-builder.styles.js +1 -1
  182. package/dist/components/data/heatmap/heatmap.class.d.ts +7 -4
  183. package/dist/components/data/heatmap/heatmap.class.js +1 -1
  184. package/dist/components/data/sequence-strip/sequence-strip.class.js +1 -1
  185. package/dist/components/data/sparkline/sparkline.class.d.ts +2 -1
  186. package/dist/components/data/sparkline/sparkline.class.js +1 -1
  187. package/dist/components/data/stat/stat.class.d.ts +6 -2
  188. package/dist/components/data/stat/stat.class.js +1 -1
  189. package/dist/components/data/table/table.class.d.ts +15 -16
  190. package/dist/components/data/table/table.class.js +5 -4
  191. package/dist/components/data/table/table.styles.js +1 -1
  192. package/dist/components/data/timeline/timeline.class.d.ts +7 -2
  193. package/dist/components/data/timeline/timeline.class.js +1 -1
  194. package/dist/components/data/timeline/timeline.styles.js +1 -1
  195. package/dist/components/data/tree/tree-item.class.d.ts +3 -1
  196. package/dist/components/data/tree/tree-item.class.js +1 -1
  197. package/dist/components/data/tree/tree-item.styles.js +1 -1
  198. package/dist/components/data/tree/tree.class.d.ts +4 -1
  199. package/dist/components/data/tree/tree.class.js +1 -1
  200. package/dist/components/data/word-cloud/word-cloud-layout.d.ts +2 -1
  201. package/dist/components/data/word-cloud/word-cloud-layout.js +1 -1
  202. package/dist/components/data/word-cloud/word-cloud.class.d.ts +2 -1
  203. package/dist/components/data/word-cloud/word-cloud.class.js +1 -1
  204. package/dist/components/forms/button/button.class.d.ts +5 -3
  205. package/dist/components/forms/button/button.class.js +1 -1
  206. package/dist/components/forms/checkbox/checkbox.class.d.ts +3 -0
  207. package/dist/components/forms/checkbox/checkbox.class.js +1 -1
  208. package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +7 -2
  209. package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
  210. package/dist/components/forms/code-editor/code-editor.class.d.ts +16 -4
  211. package/dist/components/forms/code-editor/code-editor.class.js +19 -9
  212. package/dist/components/forms/code-editor/code-editor.styles.js +1 -1
  213. package/dist/components/forms/color-picker/color-picker.class.d.ts +6 -2
  214. package/dist/components/forms/color-picker/color-picker.class.js +4 -4
  215. package/dist/components/forms/combobox/combobox.class.d.ts +19 -8
  216. package/dist/components/forms/combobox/combobox.class.js +3 -3
  217. package/dist/components/forms/combobox/combobox.styles.js +1 -1
  218. package/dist/components/forms/combobox/option.class.d.ts +4 -0
  219. package/dist/components/forms/combobox/option.class.js +2 -2
  220. package/dist/components/forms/date-picker/calendar-core.d.ts +1 -1
  221. package/dist/components/forms/date-picker/calendar-core.js +1 -1
  222. package/dist/components/forms/date-picker/date-input.class.d.ts +20 -10
  223. package/dist/components/forms/date-picker/date-input.class.js +4 -4
  224. package/dist/components/forms/date-picker/date-picker.class.d.ts +33 -15
  225. package/dist/components/forms/date-picker/date-picker.class.js +8 -8
  226. package/dist/components/forms/date-picker/date-picker.styles.js +1 -1
  227. package/dist/components/forms/emoji-picker/emoji-data-loader.js +1 -1
  228. package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +11 -3
  229. package/dist/components/forms/emoji-picker/emoji-picker.class.js +3 -3
  230. package/dist/components/forms/emoji-picker/emoji-types.d.ts +2 -2
  231. package/dist/components/forms/icon-button/icon-button.class.d.ts +4 -2
  232. package/dist/components/forms/icon-button/icon-button.class.js +1 -1
  233. package/dist/components/forms/input/input.class.d.ts +16 -5
  234. package/dist/components/forms/input/input.class.js +7 -1
  235. package/dist/components/forms/input/native-time-input.class.d.ts +3 -0
  236. package/dist/components/forms/input/number-input.class.d.ts +3 -0
  237. package/dist/components/forms/input/time-input.class.d.ts +11 -2
  238. package/dist/components/forms/input/time-input.class.js +2 -2
  239. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +22 -4
  240. package/dist/components/forms/locale-picker/locale-picker.class.js +2 -2
  241. package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -1
  242. package/dist/components/forms/otp-input/otp-input.class.d.ts +5 -1
  243. package/dist/components/forms/otp-input/otp-input.class.js +1 -1
  244. package/dist/components/forms/phone-input/phone-input.class.d.ts +21 -8
  245. package/dist/components/forms/phone-input/phone-input.class.js +1 -1
  246. package/dist/components/forms/radio/radio-button.class.d.ts +4 -0
  247. package/dist/components/forms/radio/radio-group.class.d.ts +4 -1
  248. package/dist/components/forms/radio/radio-group.class.js +1 -1
  249. package/dist/components/forms/radio/radio.class.d.ts +6 -2
  250. package/dist/components/forms/radio/radio.class.js +1 -1
  251. package/dist/components/forms/rubric-form/rubric-form.class.d.ts +7 -1
  252. package/dist/components/forms/rubric-form/rubric-form.class.js +3 -3
  253. package/dist/components/forms/select/select.class.d.ts +8 -2
  254. package/dist/components/forms/select/select.class.js +2 -2
  255. package/dist/components/forms/select/select.styles.js +1 -1
  256. package/dist/components/forms/slider/slider.class.d.ts +12 -6
  257. package/dist/components/forms/slider/slider.class.js +2 -2
  258. package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +4 -0
  259. package/dist/components/forms/swatch-picker/swatch-picker.class.js +1 -1
  260. package/dist/components/forms/switch/switch.class.d.ts +5 -1
  261. package/dist/components/forms/switch/switch.class.js +1 -1
  262. package/dist/components/forms/textarea/textarea.class.d.ts +3 -0
  263. package/dist/components/forms/textarea/textarea.class.js +1 -1
  264. package/dist/components/forms/time-range/time-range.class.d.ts +3 -0
  265. package/dist/components/forms/time-range/time-range.class.js +1 -1
  266. package/dist/components/forms/token-input/token-input.class.d.ts +8 -2
  267. package/dist/components/forms/token-input/token-input.class.js +2 -2
  268. package/dist/components/forms/token-input/token-input.styles.js +1 -1
  269. package/dist/components/layout/app-rail/app-rail.class.d.ts +9 -5
  270. package/dist/components/layout/app-rail/app-rail.class.js +4 -3
  271. package/dist/components/layout/app-rail/app-rail.styles.js +1 -1
  272. package/dist/components/layout/carousel/carousel.class.d.ts +3 -2
  273. package/dist/components/layout/carousel/carousel.class.js +1 -1
  274. package/dist/components/layout/command-palette/command-palette.class.d.ts +2 -2
  275. package/dist/components/layout/command-palette/command-palette.class.js +1 -1
  276. package/dist/components/layout/command-palette/command-palette.styles.js +1 -1
  277. package/dist/components/layout/dashboard-grid/dashboard-grid.class.d.ts +2 -0
  278. package/dist/components/layout/dashboard-grid/dashboard-grid.class.js +1 -1
  279. package/dist/components/layout/details/details.class.d.ts +16 -15
  280. package/dist/components/layout/details/details.class.js +43 -34
  281. package/dist/components/layout/details/details.styles.js +1 -1
  282. package/dist/components/layout/dock-panel/dock-panel.class.d.ts +4 -3
  283. package/dist/components/layout/dock-panel/dock-panel.class.js +2 -1
  284. package/dist/components/layout/filter-bar/filter-bar.class.d.ts +3 -1
  285. package/dist/components/layout/filter-bar/filter-bar.class.js +2 -2
  286. package/dist/components/layout/menu/menu-item.class.js +2 -2
  287. package/dist/components/layout/menu/menu-label.class.d.ts +3 -3
  288. package/dist/components/layout/menu/menu.class.d.ts +4 -1
  289. package/dist/components/layout/menu/menu.class.js +1 -1
  290. package/dist/components/layout/multi-split/multi-split.class.d.ts +19 -8
  291. package/dist/components/layout/multi-split/multi-split.class.js +2 -1
  292. package/dist/components/layout/multi-split/multi-split.styles.js +1 -1
  293. package/dist/components/layout/reorder-list/reorder-item.class.d.ts +2 -1
  294. package/dist/components/layout/reorder-list/reorder-item.class.js +1 -1
  295. package/dist/components/layout/reorder-list/reorder-list.class.js +1 -1
  296. package/dist/components/layout/reorder-list/reorder-owner.js +1 -1
  297. package/dist/components/layout/scroller/scroller.class.d.ts +4 -4
  298. package/dist/components/layout/scroller/scroller.styles.js +1 -1
  299. package/dist/components/layout/split-panel/split-panel.class.d.ts +5 -3
  300. package/dist/components/layout/split-panel/split-panel.class.js +3 -2
  301. package/dist/components/layout/tab-group/tab-group.class.d.ts +3 -1
  302. package/dist/components/layout/tab-group/tab-group.class.js +1 -1
  303. package/dist/components/layout/tab-group/tab-group.styles.js +1 -1
  304. package/dist/components/layout/virtual-list/virtual-list.class.js +2 -2
  305. package/dist/components/layout/widget/widget.class.d.ts +6 -2
  306. package/dist/components/layout/widget/widget.class.js +1 -1
  307. package/dist/components/layout/widget/widget.styles.js +1 -1
  308. package/dist/components/media/animation/animation.class.d.ts +3 -2
  309. package/dist/components/media/animation/animation.class.js +1 -1
  310. package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +4 -3
  311. package/dist/components/media/attachment-chip/attachment-chip.class.js +1 -1
  312. package/dist/components/media/av-player/av-metadata.d.ts +3 -2
  313. package/dist/components/media/av-player/av-player.class.d.ts +4 -3
  314. package/dist/components/media/av-player/av-player.class.js +3 -3
  315. package/dist/components/media/av-player/av-player.styles.js +1 -1
  316. package/dist/components/media/avatar/avatar.class.d.ts +2 -1
  317. package/dist/components/media/avatar/avatar.class.js +1 -1
  318. package/dist/components/media/file-input/file-input.class.d.ts +4 -2
  319. package/dist/components/media/file-input/file-input.class.js +1 -1
  320. package/dist/components/media/file-input/file-input.styles.js +1 -1
  321. package/dist/components/media/flag/flag.class.js +1 -1
  322. package/dist/components/media/image-viewer/image-viewer.class.d.ts +2 -1
  323. package/dist/components/media/image-viewer/image-viewer.class.js +1 -1
  324. package/dist/components/media/image-viewer/image-viewer.styles.js +1 -1
  325. package/dist/components/media/lightbox/lightbox.styles.js +1 -1
  326. package/dist/components/media/map/map-loader.js +1 -1
  327. package/dist/components/media/map/map.class.d.ts +22 -34
  328. package/dist/components/media/map/map.class.js +1 -1
  329. package/dist/components/media/map/map.styles.js +1 -1
  330. package/dist/components/media/media-card/media-card.class.d.ts +1 -1
  331. package/dist/components/media/media-card/media-card.class.js +1 -1
  332. package/dist/components/media/pan-zoom/pan-zoom.class.js +1 -1
  333. package/dist/components/media/qr-code/qr-code-loader.js +1 -1
  334. package/dist/components/media/qr-code/qr-code.class.d.ts +5 -2
  335. package/dist/components/media/qr-code/qr-code.class.js +2 -2
  336. package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +3 -3
  337. package/dist/components/media/sequence-playback/sequence-playback.class.js +1 -1
  338. package/dist/components/media/sequence-playback/sequence-playback.styles.js +1 -1
  339. package/dist/components/media/video/video.class.d.ts +2 -1
  340. package/dist/components/media/video/video.styles.js +1 -1
  341. package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +3 -2
  342. package/dist/components/media/zoomable-frame/zoomable-frame.class.js +2 -2
  343. package/dist/components/overlays/alert/alert.styles.js +1 -1
  344. package/dist/components/overlays/callout/callout.styles.js +1 -1
  345. package/dist/components/overlays/chip/chip-group.class.d.ts +2 -0
  346. package/dist/components/overlays/chip/chip-group.class.js +1 -1
  347. package/dist/components/overlays/dialog/dialog.class.d.ts +2 -0
  348. package/dist/components/overlays/dialog/dialog.class.js +1 -1
  349. package/dist/components/overlays/dialog/dialog.styles.js +1 -1
  350. package/dist/components/overlays/empty/empty.class.d.ts +2 -0
  351. package/dist/components/overlays/empty/empty.class.js +1 -1
  352. package/dist/components/overlays/kbd/kbd.class.d.ts +2 -0
  353. package/dist/components/overlays/kbd/kbd.class.js +1 -1
  354. package/dist/components/overlays/overlay/popover.class.d.ts +3 -1
  355. package/dist/components/overlays/overlay/popover.class.js +1 -1
  356. package/dist/components/overlays/overlay/tooltip.class.d.ts +3 -1
  357. package/dist/components/overlays/overlay/tooltip.class.js +1 -1
  358. package/dist/components/overlays/rating/rating.class.d.ts +2 -0
  359. package/dist/components/overlays/rating/rating.class.js +1 -1
  360. package/dist/components/overlays/toast/toast-item.class.js +1 -1
  361. package/dist/components/retrieval/claim-evidence/claim-evidence.class.d.ts +11 -5
  362. package/dist/components/retrieval/claim-evidence/claim-evidence.class.js +3 -3
  363. package/dist/components/retrieval/embedding-explorer/embedding-explorer.class.js +2 -2
  364. package/dist/components/retrieval/entity-card/entity-card.class.d.ts +5 -2
  365. package/dist/components/retrieval/entity-card/entity-card.class.js +1 -1
  366. package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +4 -2
  367. package/dist/components/retrieval/entity-chip/entity-chip.class.js +1 -1
  368. package/dist/components/retrieval/graph/graph-canvas.js +1 -1
  369. package/dist/components/retrieval/graph/graph-loader.js +1 -1
  370. package/dist/components/retrieval/graph/graph.class.d.ts +10 -8
  371. package/dist/components/retrieval/graph/graph.class.js +10 -10
  372. package/dist/components/retrieval/graph-legend/graph-legend.class.d.ts +4 -2
  373. package/dist/components/retrieval/graph-legend/graph-legend.class.js +1 -1
  374. package/dist/components/retrieval/grounding-summary/grounding-summary.class.d.ts +15 -9
  375. package/dist/components/retrieval/grounding-summary/grounding-summary.class.js +7 -5
  376. package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.d.ts +2 -0
  377. package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.js +1 -1
  378. package/dist/components/retrieval/knowledge-base/knowledge-base.class.d.ts +3 -2
  379. package/dist/components/retrieval/knowledge-base/knowledge-base.class.js +4 -3
  380. package/dist/components/retrieval/knowledge-base/knowledge-base.styles.js +1 -1
  381. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +7 -3
  382. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +8 -3
  383. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.styles.js +1 -1
  384. package/dist/components/retrieval/memory-panel/memory-panel.class.d.ts +15 -6
  385. package/dist/components/retrieval/memory-panel/memory-panel.class.js +1 -1
  386. package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +1 -1
  387. package/dist/components/retrieval/neighbor-list/neighbor-list.styles.js +1 -1
  388. package/dist/components/retrieval/node-palette/node-palette.class.d.ts +17 -12
  389. package/dist/components/retrieval/node-palette/node-palette.class.js +2 -2
  390. package/dist/components/retrieval/node-palette/node-palette.styles.js +1 -1
  391. package/dist/components/retrieval/path-strip/path-strip.class.js +1 -1
  392. package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +2 -1
  393. package/dist/components/retrieval/provenance-panel/provenance-panel.class.js +1 -1
  394. package/dist/components/retrieval/retrieval-results/retrieval-results.class.d.ts +1 -1
  395. package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +5 -5
  396. package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.js +1 -1
  397. package/dist/components/retrieval/source-picker/source-picker.class.d.ts +2 -1
  398. package/dist/components/retrieval/source-picker/source-picker.class.js +2 -2
  399. package/dist/components/utility/copy-button/copy-button.class.d.ts +2 -1
  400. package/dist/components/utility/copy-button/copy-button.class.js +1 -1
  401. package/dist/components/utility/diff-view/diff-view.class.d.ts +4 -1
  402. package/dist/components/utility/diff-view/diff-view.class.js +1 -1
  403. package/dist/components/utility/export-button/export-button.class.d.ts +2 -2
  404. package/dist/components/utility/export-button/export-button.class.js +1 -1
  405. package/dist/components/utility/export-button/export-button.styles.js +1 -1
  406. package/dist/components/utility/format/format-date.class.js +1 -1
  407. package/dist/components/utility/format/format-number.class.d.ts +3 -1
  408. package/dist/components/utility/format/format-options.js +1 -1
  409. package/dist/components/utility/format/relative-time.class.js +1 -1
  410. package/dist/components/utility/icon/dompurify-loader.js +1 -1
  411. package/dist/components/utility/icon/icon-library.js +1 -1
  412. package/dist/components/utility/intersection-observer/intersection-observer.class.js +1 -1
  413. package/dist/components/utility/json-viewer/json-viewer.class.d.ts +6 -3
  414. package/dist/components/utility/json-viewer/json-viewer.class.js +5 -5
  415. package/dist/components/utility/known-date/known-date.class.d.ts +9 -5
  416. package/dist/components/utility/known-date/known-date.class.js +2 -2
  417. package/dist/components/utility/known-date/known-date.styles.js +1 -1
  418. package/dist/components/utility/mention-popover/mention-popover.class.d.ts +32 -45
  419. package/dist/components/utility/mention-popover/mention-popover.class.js +1 -1
  420. package/dist/components/utility/mutation-observer/mutation-observer.class.js +1 -1
  421. package/dist/components/utility/poll-status/poll-status.class.d.ts +3 -0
  422. package/dist/components/utility/poll-status/poll-status.styles.js +1 -1
  423. package/dist/components/viewers/calendar-viewer/calendar-loader.js +1 -1
  424. package/dist/components/viewers/calendar-viewer/calendar-viewer.class.d.ts +1 -0
  425. package/dist/components/viewers/calendar-viewer/calendar-viewer.class.js +1 -1
  426. package/dist/components/viewers/dataset-viewer/dataset-viewer.class.d.ts +2 -1
  427. package/dist/components/viewers/dataset-viewer/dataset-viewer.styles.js +1 -1
  428. package/dist/components/viewers/document-compare/document-compare.class.d.ts +11 -8
  429. package/dist/components/viewers/document-compare/document-compare.class.js +2 -2
  430. package/dist/components/viewers/document-preview/document-preview.class.d.ts +8 -4
  431. package/dist/components/viewers/document-preview/document-preview.class.js +4 -4
  432. package/dist/components/viewers/document-preview/document-preview.styles.js +1 -1
  433. package/dist/components/viewers/document-viewer/document-viewer.class.d.ts +5 -2
  434. package/dist/components/viewers/document-viewer/document-viewer.class.js +2 -2
  435. package/dist/components/viewers/document-viewer/document-viewer.styles.js +1 -1
  436. package/dist/components/viewers/document-viewer/registry-ownership.d.ts +1 -0
  437. package/dist/components/viewers/document-viewer/registry-ownership.js +1 -0
  438. package/dist/components/viewers/document-viewer/registry.js +1 -1
  439. package/dist/components/viewers/docx-viewer/docx-loader.js +1 -1
  440. package/dist/components/viewers/docx-viewer/docx-viewer.class.js +1 -1
  441. package/dist/components/viewers/ebook-viewer/ebook-loader.d.ts +1 -1
  442. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.d.ts +8 -2
  443. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +1 -1
  444. package/dist/components/viewers/email-viewer/email-loader.js +1 -1
  445. package/dist/components/viewers/email-viewer/email-viewer.class.d.ts +3 -2
  446. package/dist/components/viewers/email-viewer/email-viewer.class.js +2 -2
  447. package/dist/components/viewers/html-viewer/dompurify-loader.js +1 -1
  448. package/dist/components/viewers/include/include-resource.js +1 -1
  449. package/dist/components/viewers/include/include.class.d.ts +3 -1
  450. package/dist/components/viewers/notebook-viewer/dompurify-loader.js +1 -1
  451. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.d.ts +4 -2
  452. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +4 -4
  453. package/dist/components/viewers/notebook-viewer/notebook-viewer.styles.js +1 -1
  454. package/dist/components/viewers/passive-markup.js +1 -1
  455. package/dist/components/viewers/pdf-viewer/pdf-loader.js +1 -1
  456. package/dist/components/viewers/pptx-viewer/pptx-loader.js +1 -1
  457. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-loader.js +1 -1
  458. package/dist/components/viewers/svg-viewer/dompurify-loader.js +1 -1
  459. package/dist/components/viewers/svg-viewer/svg-viewer.class.d.ts +2 -1
  460. package/dist/components/viewers/svg-viewer/svg-viewer.styles.js +1 -1
  461. package/dist/components/viewers/viewer-loading.js +1 -1
  462. package/dist/components/viewers/viewer-search-limits.d.ts +2 -0
  463. package/dist/components/viewers/viewer-search-limits.js +1 -1
  464. package/dist/components/viewers/xml-viewer/xml-viewer.class.d.ts +2 -1
  465. package/dist/components/viewers/xml-viewer/xml-viewer.class.js +1 -1
  466. package/dist/components/viewers/xml-viewer/xml-viewer.js +1 -1
  467. package/dist/custom-elements-jsx.d.ts +1 -1
  468. package/dist/events.d.ts +13 -6
  469. package/dist/internal/aria-controls.d.ts +16 -13
  470. package/dist/internal/aria-controls.js +1 -1
  471. package/dist/internal/aria-reflection.js +1 -1
  472. package/dist/internal/catalog-picker.d.ts +2 -2
  473. package/dist/internal/catalog-picker.js +1 -1
  474. package/dist/internal/chart-annotation-registration.d.ts +1 -0
  475. package/dist/internal/chart-annotation-registration.js +1 -0
  476. package/dist/internal/data-descriptors.d.ts +13 -0
  477. package/dist/internal/data-descriptors.js +1 -0
  478. package/dist/internal/default-strings.generated.d.ts +1 -1
  479. package/dist/internal/default-strings.generated.js +2 -2
  480. package/dist/internal/dev-mode-attribute-warning.d.ts +3 -0
  481. package/dist/internal/dev-mode-attribute-warning.js +1 -1
  482. package/dist/internal/element-internals.d.ts +4 -3
  483. package/dist/internal/element-internals.js +1 -1
  484. package/dist/internal/form-associated.js +1 -1
  485. package/dist/internal/highlight-collection.d.ts +2 -0
  486. package/dist/internal/highlight-collection.js +1 -1
  487. package/dist/internal/localization-types.d.ts +1 -1
  488. package/dist/internal/localization.js +2 -2
  489. package/dist/internal/lyra-element.d.ts +10 -1
  490. package/dist/internal/lyra-element.js +2 -1
  491. package/dist/internal/native-control-description.d.ts +7 -0
  492. package/dist/internal/native-control-description.js +1 -0
  493. package/dist/internal/option-selection.js +1 -1
  494. package/dist/internal/overlay-order.d.ts +6 -0
  495. package/dist/internal/overlay-order.js +1 -0
  496. package/dist/internal/overlay-stack.d.ts +1 -1
  497. package/dist/internal/overlay-stack.js +1 -1
  498. package/dist/internal/package-metadata.d.ts +1 -1
  499. package/dist/internal/package-metadata.js +1 -1
  500. package/dist/internal/papaparse-loader.js +1 -1
  501. package/dist/internal/positioner.d.ts +5 -4
  502. package/dist/internal/pseudo-localization.js +1 -1
  503. package/dist/internal/reactive-property-writes.d.ts +1 -0
  504. package/dist/internal/reactive-property-writes.js +1 -0
  505. package/dist/internal/safe-css.js +1 -1
  506. package/dist/internal/step-value.d.ts +6 -0
  507. package/dist/internal/step-value.js +1 -0
  508. package/dist/internal/svg-title.d.ts +3 -0
  509. package/dist/internal/svg-title.js +1 -0
  510. package/dist/internal/text-quote.js +1 -1
  511. package/dist/lyra.d.ts +1 -1
  512. package/dist/svelte.d.ts +1 -1
  513. package/dist/translations/ar.js +2 -2
  514. package/dist/translations/de.js +2 -2
  515. package/dist/translations/es.js +2 -2
  516. package/dist/translations/fa.js +2 -2
  517. package/dist/translations/fr.js +2 -2
  518. package/dist/translations/he.js +2 -2
  519. package/dist/translations/ja.js +2 -2
  520. package/dist/translations/pseudo/ar-XB.js +1 -1
  521. package/dist/translations/pt-BR.js +2 -2
  522. package/dist/translations/ru.js +2 -2
  523. package/dist/translations/zh-CN.js +2 -2
  524. package/dist/vue.d.ts +1 -1
  525. package/llms/components/lr-accordion-item.md +10 -5
  526. package/llms/components/lr-accordion.md +10 -5
  527. package/llms/components/lr-activity-feed.md +6 -5
  528. package/llms/components/lr-agent-run.md +1 -1
  529. package/llms/components/lr-agent-trace.md +3 -0
  530. package/llms/components/lr-agent-workspace.md +3 -2
  531. package/llms/components/lr-animation.md +4 -0
  532. package/llms/components/lr-app-rail-item.md +4 -2
  533. package/llms/components/lr-app-rail.md +4 -2
  534. package/llms/components/lr-attachment-chip.md +8 -3
  535. package/llms/components/lr-audio-visualizer.md +9 -6
  536. package/llms/components/lr-av-player.md +14 -0
  537. package/llms/components/lr-avatar.md +4 -0
  538. package/llms/components/lr-bar-chart.md +2 -2
  539. package/llms/components/lr-box-plot.md +15 -6
  540. package/llms/components/lr-bubble-chart.md +2 -2
  541. package/llms/components/lr-button.md +11 -3
  542. package/llms/components/lr-calendar-viewer.md +4 -0
  543. package/llms/components/lr-calendar.md +15 -4
  544. package/llms/components/lr-carousel.md +5 -0
  545. package/llms/components/lr-chart.md +24 -9
  546. package/llms/components/lr-chat-composer.md +2 -1
  547. package/llms/components/lr-chat-message.md +4 -0
  548. package/llms/components/lr-checkbox.md +3 -0
  549. package/llms/components/lr-chip-group.md +3 -0
  550. package/llms/components/lr-chip.md +3 -0
  551. package/llms/components/lr-chunk-inspector.md +2 -2
  552. package/llms/components/lr-code-block-core.md +20 -8
  553. package/llms/components/lr-code-block.md +17 -14
  554. package/llms/components/lr-code-editor.md +20 -5
  555. package/llms/components/lr-color-picker.md +9 -0
  556. package/llms/components/lr-combobox.md +35 -4
  557. package/llms/components/lr-command-palette.md +4 -0
  558. package/llms/components/lr-commit-card.md +3 -0
  559. package/llms/components/lr-compare-panel.md +7 -0
  560. package/llms/components/lr-condition-builder.md +5 -0
  561. package/llms/components/lr-conversation-item.md +3 -0
  562. package/llms/components/lr-copy-button.md +10 -1
  563. package/llms/components/lr-dashboard-grid.md +5 -0
  564. package/llms/components/lr-data-grid.md +22 -3
  565. package/llms/components/lr-dataset-viewer.md +3 -2
  566. package/llms/components/lr-date-input.md +50 -6
  567. package/llms/components/lr-date-picker.md +51 -7
  568. package/llms/components/lr-details.md +10 -5
  569. package/llms/components/lr-dialog.md +4 -0
  570. package/llms/components/lr-diff-view.md +6 -0
  571. package/llms/components/lr-document-compare.md +6 -2
  572. package/llms/components/lr-document-library.md +4 -0
  573. package/llms/components/lr-document-preview.md +18 -4
  574. package/llms/components/lr-document-viewer.md +14 -4
  575. package/llms/components/lr-docx-viewer.md +6 -0
  576. package/llms/components/lr-doughnut-chart.md +2 -2
  577. package/llms/components/lr-dropdown-item.md +4 -0
  578. package/llms/components/lr-dropdown.md +3 -0
  579. package/llms/components/lr-ebook-viewer.md +12 -3
  580. package/llms/components/lr-email-viewer.md +10 -0
  581. package/llms/components/lr-emoji-picker.md +17 -3
  582. package/llms/components/lr-empty.md +3 -0
  583. package/llms/components/lr-entity-card.md +3 -0
  584. package/llms/components/lr-entity-chip.md +4 -0
  585. package/llms/components/lr-eval-dataset.md +2 -2
  586. package/llms/components/lr-export-button.md +9 -0
  587. package/llms/components/lr-file-input.md +12 -8
  588. package/llms/components/lr-file-tree.md +5 -1
  589. package/llms/components/lr-filter-bar.md +5 -0
  590. package/llms/components/lr-flow-canvas.md +8 -1
  591. package/llms/components/lr-flow-node.md +2 -1
  592. package/llms/components/lr-flow-run-status.md +1 -1
  593. package/llms/components/lr-format-date.md +3 -1
  594. package/llms/components/lr-format-number.md +4 -0
  595. package/llms/components/lr-funnel.md +4 -0
  596. package/llms/components/lr-gauge.md +4 -0
  597. package/llms/components/lr-generation-metrics.md +5 -0
  598. package/llms/components/lr-graph-legend.md +4 -2
  599. package/llms/components/lr-graph-query-builder.md +6 -0
  600. package/llms/components/lr-graph.md +8 -2
  601. package/llms/components/lr-grounding-summary.md +8 -8
  602. package/llms/components/lr-heatmap.md +13 -0
  603. package/llms/components/lr-histogram.md +2 -2
  604. package/llms/components/lr-icon-button.md +7 -0
  605. package/llms/components/lr-image-viewer.md +9 -0
  606. package/llms/components/lr-include.md +5 -0
  607. package/llms/components/lr-ingestion-queue.md +5 -1
  608. package/llms/components/lr-input.md +22 -8
  609. package/llms/components/lr-intersection-observer.md +9 -0
  610. package/llms/components/lr-json-viewer.md +10 -1
  611. package/llms/components/lr-kbd.md +3 -0
  612. package/llms/components/lr-knowledge-base.md +10 -1
  613. package/llms/components/lr-knowledge-graph-explorer.md +7 -0
  614. package/llms/components/lr-known-date.md +7 -0
  615. package/llms/components/lr-line-chart.md +2 -2
  616. package/llms/components/lr-lite-chart.md +29 -9
  617. package/llms/components/lr-live-region.md +3 -0
  618. package/llms/components/lr-locale-picker.md +12 -0
  619. package/llms/components/lr-map.md +23 -5
  620. package/llms/components/lr-markdown-core.md +4 -0
  621. package/llms/components/lr-markdown.md +15 -8
  622. package/llms/components/lr-media-card.md +5 -8
  623. package/llms/components/lr-mention-popover.md +17 -10
  624. package/llms/components/lr-menu-item.md +4 -0
  625. package/llms/components/lr-menu-label.md +4 -3
  626. package/llms/components/lr-menu.md +4 -0
  627. package/llms/components/lr-message-actions.md +13 -3
  628. package/llms/components/lr-message-feedback.md +24 -7
  629. package/llms/components/lr-message-parts.md +6 -3
  630. package/llms/components/lr-model-select.md +13 -2
  631. package/llms/components/lr-multi-split.md +20 -7
  632. package/llms/components/lr-mutation-observer.md +8 -0
  633. package/llms/components/lr-native-time-input.md +10 -0
  634. package/llms/components/lr-node-palette.md +8 -2
  635. package/llms/components/lr-notebook-viewer.md +4 -1
  636. package/llms/components/lr-number-input.md +12 -1
  637. package/llms/components/lr-option.md +35 -4
  638. package/llms/components/lr-otp-input.md +10 -0
  639. package/llms/components/lr-pan-zoom.md +1 -2
  640. package/llms/components/lr-phone-input.md +20 -5
  641. package/llms/components/lr-pie-chart.md +2 -2
  642. package/llms/components/lr-polar-area-chart.md +2 -2
  643. package/llms/components/lr-poll-status.md +4 -0
  644. package/llms/components/lr-popover.md +3 -0
  645. package/llms/components/lr-popup.md +3 -2
  646. package/llms/components/lr-prompt-input.md +7 -3
  647. package/llms/components/lr-prompt-queue.md +6 -0
  648. package/llms/components/lr-prompt-studio.md +7 -0
  649. package/llms/components/lr-provenance-panel.md +3 -0
  650. package/llms/components/lr-push-to-talk.md +8 -0
  651. package/llms/components/lr-qr-code.md +6 -0
  652. package/llms/components/lr-radar-chart.md +2 -2
  653. package/llms/components/lr-radio-button.md +13 -4
  654. package/llms/components/lr-radio-group.md +5 -0
  655. package/llms/components/lr-radio.md +9 -0
  656. package/llms/components/lr-rating.md +8 -0
  657. package/llms/components/lr-relative-time.md +2 -0
  658. package/llms/components/lr-reorder-item.md +6 -0
  659. package/llms/components/lr-reorder-list.md +6 -0
  660. package/llms/components/lr-result-card.md +6 -3
  661. package/llms/components/lr-result-field.md +6 -3
  662. package/llms/components/lr-retrieval-results.md +1 -1
  663. package/llms/components/lr-rubric-form.md +12 -0
  664. package/llms/components/lr-scatter-chart.md +2 -2
  665. package/llms/components/lr-scroller.md +5 -5
  666. package/llms/components/lr-select.md +9 -0
  667. package/llms/components/lr-sequence-playback.md +5 -2
  668. package/llms/components/lr-slider.md +19 -5
  669. package/llms/components/lr-source-picker.md +4 -0
  670. package/llms/components/lr-span-waterfall.md +3 -0
  671. package/llms/components/lr-sparkline.md +4 -0
  672. package/llms/components/lr-split-panel.md +4 -0
  673. package/llms/components/lr-stack-trace.md +3 -0
  674. package/llms/components/lr-stat.md +10 -0
  675. package/llms/components/lr-streaming-text.md +2 -3
  676. package/llms/components/lr-subagent-panel.md +3 -2
  677. package/llms/components/lr-svg-viewer.md +3 -0
  678. package/llms/components/lr-swatch-picker.md +4 -0
  679. package/llms/components/lr-switch.md +6 -0
  680. package/llms/components/lr-tab-group.md +4 -0
  681. package/llms/components/lr-table.md +10 -2
  682. package/llms/components/lr-terminal.md +17 -5
  683. package/llms/components/lr-textarea.md +9 -0
  684. package/llms/components/lr-thinking-panel.md +3 -1
  685. package/llms/components/lr-thread-list.md +26 -4
  686. package/llms/components/lr-time-input.md +3 -0
  687. package/llms/components/lr-time-range.md +5 -0
  688. package/llms/components/lr-timeline-item.md +6 -0
  689. package/llms/components/lr-timeline.md +6 -0
  690. package/llms/components/lr-token-input.md +14 -0
  691. package/llms/components/lr-tool-call-chip.md +7 -5
  692. package/llms/components/lr-tool-param-form.md +6 -2
  693. package/llms/components/lr-tool-result-dialog.md +4 -0
  694. package/llms/components/lr-tool-result-view.md +2 -3
  695. package/llms/components/lr-tool-select-dialog.md +6 -2
  696. package/llms/components/lr-tooltip.md +6 -0
  697. package/llms/components/lr-trace-tree.md +3 -0
  698. package/llms/components/lr-transcript-feed.md +3 -0
  699. package/llms/components/lr-tree-item.md +12 -5
  700. package/llms/components/lr-tree.md +12 -5
  701. package/llms/components/lr-typing-indicator.md +3 -0
  702. package/llms/components/lr-usage-badge.md +4 -0
  703. package/llms/components/lr-video.md +8 -2
  704. package/llms/components/lr-virtual-list.md +5 -3
  705. package/llms/components/lr-voice-picker.md +15 -2
  706. package/llms/components/lr-widget-renderer.md +21 -13
  707. package/llms/components/lr-widget.md +4 -2
  708. package/llms/components/lr-word-cloud.md +4 -0
  709. package/llms/components/lr-xml-viewer.md +9 -2
  710. package/llms/components/lr-zoomable-frame.md +6 -3
  711. package/llms/peers.md +5 -5
  712. package/llms/shared.md +74 -63
  713. package/llms-full.txt +4705 -2954
  714. package/package.json +19 -14
  715. package/vscode-css-data.json +1 -1
  716. package/vscode-html-data.json +1 -1
  717. package/web-types.json +1 -1
  718. package/dist/components/viewers/docx-viewer/fixtures/minimal-docx-fixture.d.ts +0 -1
  719. package/dist/components/viewers/docx-viewer/fixtures/minimal-docx-fixture.js +0 -1
  720. package/dist/components/viewers/ebook-viewer/fixtures/minimal-epub-fixture.d.ts +0 -1
  721. package/dist/components/viewers/ebook-viewer/fixtures/minimal-epub-fixture.js +0 -1
  722. package/dist/components/viewers/spreadsheet-viewer/fixtures/minimal-xlsx-fixture.d.ts +0 -1
  723. package/dist/components/viewers/spreadsheet-viewer/fixtures/minimal-xlsx-fixture.js +0 -1
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{LyraElement}from"../../../internal/lyra-element.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{getDateTimeFormat}from"../../../internal/intl-cache.js";import{finiteCount}from"../../../internal/numbers.js";import{styles}from"./transcript-feed.styles.js";import{presenceTrueDefaultBooleanConverter as trueDefaultBooleanConverter}from"../../../internal/converters.js";import{normalizeLyraTimestamp}from"../timestamp.js";import{LYRA_DEFAULT_jumpToLatest,LYRA_DEFAULT_transcriptFeedEmpty,LYRA_DEFAULT_transcriptFeedInterim,LYRA_DEFAULT_transcriptFeedLabel}from"../../../internal/default-strings.generated.js";const NEAR_BOTTOM_PX=48;class LyraTranscriptFeed extends LyraElement{constructor(){super(...arguments),this.entries=[],this.follow=!0,this.showTimestamps=!1,this.maxRenderedEntries=500,this.sessionId="",this.accessibleLabel=null,this._isFirstUpdate=!0,this.announcedFinalIds=new Set,this.sessionChanged=!1,this.pendingSessionBaseline=!1,this.onScroll=e=>{const base=e.currentTarget,atBottom=base.scrollHeight-base.scrollTop-base.clientHeight<=NEAR_BOTTOM_PX;atBottom!==this.follow&&(this.follow=atBottom,this.emit("lr-follow-change",{following:atBottom}))},this.onJumpClick=()=>{const changed=!this.follow;this.scrollToBottom(),changed&&this.emit("lr-follow-change",{following:!0})}}static{this.defaultStrings={...super.defaultStrings,jumpToLatest:LYRA_DEFAULT_jumpToLatest,transcriptFeedEmpty:LYRA_DEFAULT_transcriptFeedEmpty,transcriptFeedInterim:LYRA_DEFAULT_transcriptFeedInterim,transcriptFeedLabel:LYRA_DEFAULT_transcriptFeedLabel}}static{this.ownedCollectionProperties=Object.freeze(["entries"])}static{this.styles=[LyraElement.styles,styles]}get effectiveMaxRenderedEntries(){return finiteCount(this.maxRenderedEntries,500)}get normalizedEntries(){const seen=new Set;return this.entries.filter(entry=>entry===null||typeof entry!="object"||typeof entry.id!="string"||entry.id.trim().length===0||typeof entry.text!="string"||seen.has(entry.id)?!1:(seen.add(entry.id),!0))}get renderedEntries(){const entries=this.normalizedEntries,maxRenderedEntries=this.effectiveMaxRenderedEntries;return maxRenderedEntries>0&&entries.length>maxRenderedEntries?entries.slice(-maxRenderedEntries):entries}connectedCallback(){super.connectedCallback(),this.syncAnnouncementSink()}disconnectedCallback(){super.disconnectedCallback(),this.releaseAnnouncementSink()}adoptedCallback(){super.adoptedCallback(),this.syncAnnouncementSink()}releaseAnnouncementSink(){this.announcementSink?.release(),this.announcementSink=void 0}syncAnnouncementSink(){if(!this.isConnected){this.releaseAnnouncementSink();return}this.announcementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseAnnouncementSink(),this.announcementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}))}willUpdate(changed){super.willUpdate(changed),this._isFirstUpdate=!this.hasUpdated,this.sessionChanged=changed.has("sessionId")&&this.hasUpdated,this.sessionChanged&&(this.announcedFinalIds.clear(),this.pendingSessionBaseline=!0)}updated(changed){super.updated(changed),changed.has("entries")&&(this.follow&&this.scrollToBottom(),this.announceFinalizedEntries())}announceFinalizedEntries(){const alreadyAnnounced=this.announcedFinalIds,fresh=[];for(const entry of this.normalizedEntries)entry.interim||alreadyAnnounced.has(entry.id)||(alreadyAnnounced.add(entry.id),fresh.push(entry.text));const establishesBaseline=this._isFirstUpdate||this.sessionChanged||this.pendingSessionBaseline;if(this.pendingSessionBaseline=!1,establishesBaseline)return;const sink=this.announcementSink;if(sink)for(const text of fresh){const message=text.replace(/\s+/g," ").trim();message&&sink.announce(message)}}scrollToBottom(){this.follow=!0;const base=this.renderRoot.querySelector('[part="base"]');base&&(base.scrollTop=base.scrollHeight)}showSpeakerFor(list,index){const prev=list[index-1],current=list[index];return!prev||prev.speaker!==current.speaker}formatTs(value){const date=normalizeLyraTimestamp(value);return date?this.formatTimestamp?this.formatTimestamp(date):getDateTimeFormat(this.effectiveLocale,{hour:"numeric",minute:"2-digit"}).format(date):null}renderEntry(entry,showSpeaker,interim){const parts=["entry"];interim&&parts.push("interim");const timestamp=entry.timestamp==null?null:this.formatTs(entry.timestamp);return html`
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{LyraElement}from"../../../internal/lyra-element.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{getDateTimeFormat}from"../../../internal/intl-cache.js";import{finiteCount}from"../../../internal/numbers.js";import{captureComposedFocusRepair,applyComposedFocusRepair}from"../../../internal/focus-navigation.js";import{styles}from"./transcript-feed.styles.js";import{presenceTrueDefaultBooleanConverter as trueDefaultBooleanConverter}from"../../../internal/converters.js";import{normalizeLyraTimestamp}from"../timestamp.js";import{LYRA_DEFAULT_jumpToLatest,LYRA_DEFAULT_transcriptFeedEmpty,LYRA_DEFAULT_transcriptFeedInterim,LYRA_DEFAULT_transcriptFeedLabel}from"../../../internal/default-strings.generated.js";const NEAR_BOTTOM_PX=48;class LyraTranscriptFeed extends LyraElement{constructor(){super(...arguments),this.entries=[],this.follow=!0,this.showTimestamps=!1,this.maxRenderedEntries=500,this.sessionId="",this.accessibleLabel=null,this._isFirstUpdate=!0,this.announcedFinalIds=new Set,this.sessionChanged=!1,this.pendingSessionBaseline=!1,this.onScroll=e=>{const base=e.currentTarget,atBottom=base.scrollHeight-base.scrollTop-base.clientHeight<=NEAR_BOTTOM_PX;atBottom!==this.follow&&(this.follow=atBottom,this.emit("lr-follow-change",{following:atBottom}))},this.onJumpClick=()=>{const jump=this.renderRoot.querySelector('[part="jump-button"]'),base=this.renderRoot.querySelector('[part="base"]'),repair=jump?captureComposedFocusRepair(jump,base):null,changed=!this.follow;this.scrollToBottom(),changed&&this.emit("lr-follow-change",{following:!0}),repair&&this.updateComplete.then(()=>{this.isConnected&&this.follow&&applyComposedFocusRepair(repair)})}}static{this.defaultStrings={...super.defaultStrings,jumpToLatest:LYRA_DEFAULT_jumpToLatest,transcriptFeedEmpty:LYRA_DEFAULT_transcriptFeedEmpty,transcriptFeedInterim:LYRA_DEFAULT_transcriptFeedInterim,transcriptFeedLabel:LYRA_DEFAULT_transcriptFeedLabel}}static{this.ownedCollectionProperties=Object.freeze(["entries"])}static{this.styles=[LyraElement.styles,styles]}get effectiveMaxRenderedEntries(){return finiteCount(this.maxRenderedEntries,500)}get normalizedEntries(){const seen=new Set;return this.entries.filter(entry=>entry===null||typeof entry!="object"||typeof entry.id!="string"||entry.id.trim().length===0||typeof entry.text!="string"||seen.has(entry.id)?!1:(seen.add(entry.id),!0))}get renderedEntries(){const entries=this.normalizedEntries,maxRenderedEntries=this.effectiveMaxRenderedEntries;return maxRenderedEntries>0&&entries.length>maxRenderedEntries?entries.slice(-maxRenderedEntries):entries}connectedCallback(){super.connectedCallback(),this.syncAnnouncementSink()}disconnectedCallback(){super.disconnectedCallback(),this.releaseAnnouncementSink()}adoptedCallback(){super.adoptedCallback(),this.syncAnnouncementSink()}releaseAnnouncementSink(){this.announcementSink?.release(),this.announcementSink=void 0}syncAnnouncementSink(){if(!this.isConnected){this.releaseAnnouncementSink();return}this.announcementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseAnnouncementSink(),this.announcementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}))}willUpdate(changed){super.willUpdate(changed),this._isFirstUpdate=!this.hasUpdated,this.sessionChanged=changed.has("sessionId")&&this.hasUpdated,this.sessionChanged&&(this.announcedFinalIds.clear(),this.pendingSessionBaseline=!0)}updated(changed){super.updated(changed),changed.has("entries")&&(this.follow&&this.scrollToBottom(),this.announceFinalizedEntries())}announceFinalizedEntries(){const alreadyAnnounced=this.announcedFinalIds,fresh=[];for(const entry of this.normalizedEntries)entry.interim||alreadyAnnounced.has(entry.id)||(alreadyAnnounced.add(entry.id),fresh.push(entry.text));const establishesBaseline=this._isFirstUpdate||this.sessionChanged||this.pendingSessionBaseline;if(this.pendingSessionBaseline=!1,establishesBaseline)return;const sink=this.announcementSink;if(sink)for(const text of fresh){const message=text.replace(/\s+/g," ").trim();message&&sink.announce(message)}}scrollToBottom(){this.follow=!0;const base=this.renderRoot.querySelector('[part="base"]');base&&(base.scrollTop=base.scrollHeight)}showSpeakerFor(list,index){const prev=list[index-1],current=list[index];return!prev||prev.speaker!==current.speaker}formatTs(value){const date=normalizeLyraTimestamp(value);return date?this.formatTimestamp?this.formatTimestamp(date):getDateTimeFormat(this.effectiveLocale,{hour:"numeric",minute:"2-digit"}).format(date):null}renderEntry(entry,showSpeaker,interim){const parts=["entry"];interim&&parts.push("interim");const timestamp=entry.timestamp==null?null:this.formatTs(entry.timestamp);return html`
2
2
  <div part=${parts.join(" ")} ?data-interim=${interim}>
3
3
  ${showSpeaker&&entry.speaker?html`<span part="speaker">${entry.speaker}</span>`:nothing}
4
4
  <span part="text" dir="auto">${entry.text}</span>
@@ -1 +1 @@
1
- import{css}from"lit";import{srOnly}from"../../../internal/a11y.js";const styles=[css`:host{block-size:100%;inline-size:100%;display:block;position:relative}[part=base]{gap:var(--lr-space-xs);block-size:100%;inline-size:100%;padding:var(--lr-space-s);box-sizing:border-box;flex-direction:column;display:flex;overflow:hidden auto}[part=base]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:calc(-1 * var(--lr-focus-ring-offset))}[part=log],[part=interim-area]{gap:var(--lr-space-xs);flex-direction:column;min-inline-size:0;max-inline-size:100%;display:flex}[part=interim-area]{margin-block-start:var(--lr-space-xs)}[part=entry]{align-items:baseline;gap:var(--lr-space-2xs);min-inline-size:0;max-inline-size:100%;animation:lr-transcript-fade-in var(--lr-duration-fast) var(--lr-easing-standard);flex-wrap:wrap;display:flex}@keyframes lr-transcript-fade-in{0%{opacity:0;transform:translateY(var(--lr-size-4px))}to{opacity:1;transform:none}}@media (prefers-reduced-motion:reduce){[part=entry]{animation:none!important}}[part=entry][data-interim]{opacity:var(--lr-opacity-disabled);font-style:italic}[part=speaker]{overflow-wrap:anywhere;min-inline-size:0;max-inline-size:100%;font-weight:var(--lr-font-weight-semibold);color:var(--lr-color-text-quiet);flex:100%}[part=text]{overflow-wrap:anywhere;flex:auto;min-inline-size:0;max-inline-size:100%}[part=timestamp]{font-size:var(--lr-font-size-xs);color:var(--lr-color-text-quiet);flex:none}[part=empty]{padding:var(--lr-space-m);color:var(--lr-color-text-quiet);text-align:center}[part=jump-button]{padding:var(--lr-space-2xs) var(--lr-space-s);min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);border:var(--lr-border-width-thin) solid var(--lr-color-border);border-radius:var(--lr-radius-pill);background:var(--lr-color-surface);color:var(--lr-color-text);cursor:pointer;box-shadow:var(--lr-shadow-m);position:absolute;inset-block-end:var(--lr-space-s);inset-inline-end:var(--lr-space-s)}[part=jump-button]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=jump-button]:hover{background:var(--lr-color-brand-quiet)}[part=jump-button]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}`,srOnly];export{styles};
1
+ import{css}from"lit";import{srOnly}from"../../../internal/a11y.js";const styles=[css`:host{block-size:100%;inline-size:100%;display:block;position:relative}[part=base]{gap:var(--lr-space-xs);block-size:100%;inline-size:100%;padding:var(--lr-space-s);box-sizing:border-box;flex-direction:column;display:flex;overflow:hidden auto}[part=base]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:calc(-1 * var(--lr-focus-ring-offset))}[part=log],[part=interim-area]{gap:var(--lr-space-xs);flex-direction:column;min-inline-size:0;max-inline-size:100%;display:flex}[part=interim-area]{margin-block-start:var(--lr-space-xs)}[part~=entry]{align-items:baseline;gap:var(--lr-space-2xs);min-inline-size:0;max-inline-size:100%;animation:lr-transcript-fade-in var(--lr-duration-fast) var(--lr-easing-standard);flex-wrap:wrap;display:flex}@keyframes lr-transcript-fade-in{0%{opacity:0;transform:translateY(var(--lr-size-4px))}to{opacity:1;transform:none}}@media (prefers-reduced-motion:reduce){[part~=entry]{animation:none!important}}[part~=entry][data-interim]{color:var(--lr-color-text-quiet);font-style:italic}[part=speaker]{overflow-wrap:anywhere;min-inline-size:0;max-inline-size:100%;font-weight:var(--lr-font-weight-semibold);color:var(--lr-color-text-quiet);flex:100%}[part=text]{overflow-wrap:anywhere;flex:auto;min-inline-size:0;max-inline-size:100%}[part=timestamp]{font-size:var(--lr-font-size-xs);color:var(--lr-color-text-quiet);flex:none}[part=empty]{padding:var(--lr-space-m);color:var(--lr-color-text-quiet);text-align:center}[part=jump-button]{font:inherit;padding:var(--lr-space-2xs) var(--lr-space-s);min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);border:var(--lr-border-width-thin) solid var(--lr-color-border);border-radius:var(--lr-radius-pill);background:var(--lr-color-surface);color:var(--lr-color-text);cursor:pointer;box-shadow:var(--lr-shadow-m);position:absolute;inset-block-end:var(--lr-space-s);inset-inline-end:var(--lr-space-s)}[part=jump-button]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=jump-button]:hover{background:var(--lr-color-brand-quiet)}[part=jump-button]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}`,srOnly];export{styles};
@@ -74,7 +74,8 @@ export declare class LyraTypingIndicator extends LyraElement{static styles:impor
74
74
  shape:TypingIndicatorShape;
75
75
  /** Accessible name, exposed via `role="status"`. Not re-announced on every
76
76
  * animation frame — only mount (and any later change to this property)
77
- * produces a new announcement. An empty or whitespace-only value falls
77
+ * produces a new announcement. Removing the attribute restores the localized fallback; an
78
+ * explicit host aria-label keeps precedence. An empty or whitespace-only value falls
78
79
  * back to the localized "Thinking…" copy (see
79
80
  * `accessibleLabel`) so the component never loses its accessible name. */
80
81
  label:string;
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html}from"lit";import{property}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{srOnly}from"../../../internal/a11y.js";import{styles}from"./typing-indicator.styles.js";import{LYRA_DEFAULT_thinking}from"../../../internal/default-strings.generated.js";class LyraTypingIndicator extends LyraElement{constructor(){super(...arguments),this.shape="dots",this.label="",this.size="m",this.appliedAriaLabel=null,this.explicitAriaLabel=null}static{this.defaultStrings={...super.defaultStrings,thinking:LYRA_DEFAULT_thinking}}static{this.styles=[LyraElement.styles,styles,srOnly]}get accessibleLabel(){if(this.explicitAriaLabel!==null)return this.explicitAriaLabel;const trimmed=this.label.trim();return trimmed===""?this.localize("thinking"):trimmed}willUpdate(changed){super.willUpdate(changed),this.setAttribute("role","status");const currentAriaLabel=this.getAttribute("aria-label");currentAriaLabel!==this.appliedAriaLabel&&(this.explicitAriaLabel=currentAriaLabel),this.setAttribute("aria-label",this.accessibleLabel),this.appliedAriaLabel=this.accessibleLabel}render(){return html`
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html}from"lit";import{property}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{srOnly}from"../../../internal/a11y.js";import{styles}from"./typing-indicator.styles.js";import{LYRA_DEFAULT_thinking}from"../../../internal/default-strings.generated.js";class LyraTypingIndicator extends LyraElement{constructor(){super(...arguments),this.shape="dots",this.label="",this.size="m",this.appliedAriaLabel=null,this.explicitAriaLabel=null}static{this.defaultStrings={...super.defaultStrings,thinking:LYRA_DEFAULT_thinking}}static{this.styles=[LyraElement.styles,styles,srOnly]}get accessibleLabel(){if(this.explicitAriaLabel!==null)return this.explicitAriaLabel;const trimmed=(this.label??"").trim();return trimmed===""?this.localize("thinking"):trimmed}willUpdate(changed){super.willUpdate(changed),this.setAttribute("role","status");const currentAriaLabel=this.getAttribute("aria-label");currentAriaLabel!==this.appliedAriaLabel&&(this.explicitAriaLabel=currentAriaLabel),this.setAttribute("aria-label",this.accessibleLabel),this.appliedAriaLabel=this.accessibleLabel}render(){return html`
2
2
  <span part="base" aria-hidden="true">${this.renderShape()}</span>
3
3
  <span class="sr-only">${this.accessibleLabel}</span>
4
4
  `}renderShape(){switch(this.shape){case"pulse":return html`<span part="pulse"></span>`;case"cursor":return html`<span part="cursor"></span>`;default:return html`<span part="dot"></span><span part="dot"></span><span part="dot"></span>`}}}__decorate([property({reflect:!0})],LyraTypingIndicator.prototype,"shape",void 0),__decorate([property()],LyraTypingIndicator.prototype,"label",void 0),__decorate([property({reflect:!0})],LyraTypingIndicator.prototype,"size",void 0);export{LyraTypingIndicator};
@@ -0,0 +1,3 @@
1
+ import type{LyraElement}from'../../../internal/lyra-element.js';import{type OverlayHandle}from'../../../internal/nonmodal-overlay-manager.js';import type{OverlayOrderReservation}from'../../../internal/overlay-order.js';export type UsageBadgeOverlayHandle=Pick<OverlayHandle,'deactivate'|'isTopmost'>;
2
+ /** Loads only for an open badge; no modal inerting, scroll lock, or automatic focus movement. */
3
+ export declare function activateUsageBadgeOverlay(host:LyraElement,onEscape:()=>void,orderReservation?:OverlayOrderReservation):UsageBadgeOverlayHandle|undefined;
@@ -0,0 +1 @@
1
+ import{deferredPlace as place}from"../../../internal/anchored-overlay-runtime.js";import{activateNonmodalOverlay}from"../../../internal/nonmodal-overlay-manager.js";import{RenderedStateController}from"../../../internal/rendered-state.js";function activateUsageBadgeOverlay(host,onEscape,orderReservation){const anchor=host.renderRoot.querySelector('[part="base"]'),panel=()=>host.renderRoot.querySelector('[part="tooltip"]'),popup=panel();if(!anchor||!popup)return;const cleanupPositioner=place(anchor,popup,{placement:"top-start"}),handle=activateNonmodalOverlay({host,panel,onEscape,orderReservation,beforeInitialFocus:()=>!1,restoreFocusTo:null}),renderedState=new RenderedStateController(host,panel,rendered=>{handle.isActive()&&(rendered?handle.resume():handle.suspend())});return handle.isActive()&&renderedState.start(),{deactivate:options=>(cleanupPositioner?.(),renderedState.stop(),handle.deactivate(options)),isTopmost:()=>(renderedState.check(),handle.isTopmost())}}export{activateUsageBadgeOverlay};
@@ -22,6 +22,8 @@ import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from
22
22
  * visual density on every other component that spells it, so the name was moved to what it
23
23
  * actually does. A stale `compact` attribute is inert.
24
24
  *
25
+ * Removing cost-text or summary safely omits that content; explicit empty values remain empty and later values restore it. An open tooltip participates in shared Escape ordering even while only hovered, and dismissal preserves focus elsewhere.
26
+ *
25
27
  * @customElement lr-usage-badge
26
28
  * @slot summary - Visible summary shown when no built-in segment is set. The `summary` property is
27
29
  * its text fallback. A details-only badge without either form of summary remains non-focusable.
@@ -63,7 +65,7 @@ formatLatency?:(ms:number)=>string;
63
65
  * when set; the tooltip always shows full grouped figures regardless. Named for the number
64
66
  * formatting it selects, not for density: `compact` means visual density on twenty other
65
67
  * components in this library, and this one has no density mode at all. */
66
- abbreviate:boolean;private tooltipOpen;private hasDetailsSlot;private hasSummarySlot;private detailsText;private readonly tooltipId;private cleanupPositioner?;private hovering;private focused;protected willUpdate(changed:PropertyValues<this>):void;protected updated(changed:PropertyValues):void;disconnectedCallback():void;private onDetailsSlotChange;private onSummarySlotChange;private get hasTokensIn();private get hasTokensOut();private get hasCost();
68
+ abbreviate:boolean;private tooltipOpen;private hasDetailsSlot;private hasSummarySlot;private detailsText;private readonly tooltipId;private tooltipOverlay?;private tooltipRuntime?;private tooltipOrder?;private tooltipOpening?;private hovering;private focused;protected willUpdate(changed:PropertyValues<this>):void;protected updated(changed:PropertyValues):void;disconnectedCallback():void;private onDetailsSlotChange;private onSummarySlotChange;private get hasTokensIn();private get hasTokensOut();private get hasCost();
67
69
  /** `latencyMs` normalized to a finite, non-negative duration -- `undefined` while unset or
68
70
  * non-finite (the `latency` segment/tooltip row is omitted entirely). */
69
- private get validLatencyMs();private get hasLatency();private get hasVisibleContent();private get hasVisibleSummary();private get hasDisplayContent();private get hasTooltipContent();private get hasInteractiveTooltip();private formatTokenCount;private formatTokenCountFull;private localizedDuration;private showTooltip;private hideTooltip;private closeTooltipLifecycle;private onMouseEnter;private onMouseLeave;private onFocus;private onBlur;private onKeyDown;render():TemplateResult;private renderBadgeContent;}declare global{interface HTMLElementTagNameMap{'lr-usage-badge':LyraUsageBadge;}}
71
+ private get validLatencyMs();private get hasLatency();private get hasVisibleContent();private get hasVisibleSummary();private get hasDisplayContent();private get hasTooltipContent();private get hasInteractiveTooltip();private formatTokenCount;private formatTokenCountFull;private localizedDuration;private loadTooltipOverlayRuntime;protected getUpdateComplete():Promise<boolean>;private waitForTooltipOpening;private cancelTooltipOpening;private showTooltip;private hideTooltip;private closeTooltipLifecycle;private onMouseEnter;private onMouseLeave;private onFocus;private onBlur;private onKeyDown;render():TemplateResult;private renderBadgeContent;}declare global{interface HTMLElementTagNameMap{'lr-usage-badge':LyraUsageBadge;}}
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{nextId,srOnly}from"../../../internal/a11y.js";import{deferredPlace as place}from"../../../internal/anchored-overlay-runtime.js";import{finiteCount,finiteRange}from"../../../internal/numbers.js";import{styles}from"./usage-badge.styles.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{durationMessageValue}from"../../../internal/duration.js";import{LYRA_DEFAULT_collapse,LYRA_DEFAULT_details,LYRA_DEFAULT_durationMilliseconds,LYRA_DEFAULT_durationSeconds,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_open,LYRA_DEFAULT_popover,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_tokensIn,LYRA_DEFAULT_tokensOut,LYRA_DEFAULT_usageBadgeCostLabel,LYRA_DEFAULT_usageBadgeLabel,LYRA_DEFAULT_usageBadgeLatencyLabel,LYRA_DEFAULT_usageBadgeTokensIn,LYRA_DEFAULT_usageBadgeTokensInLabel,LYRA_DEFAULT_usageBadgeTokensOut,LYRA_DEFAULT_usageBadgeTokensOutLabel,LYRA_DEFAULT_usageBadgeTotalTokensLabel}from"../../../internal/default-strings.generated.js";class LyraUsageBadge extends LyraElement{constructor(){super(...arguments),this.costText="",this.summary="",this.abbreviate=!1,this.tooltipOpen=!1,this.hasDetailsSlot=!1,this.hasSummarySlot=!1,this.detailsText="",this.tooltipId=nextId("usage-badge-tooltip"),this.hovering=!1,this.focused=!1,this.onDetailsSlotChange=e=>{const assigned=e.target.assignedElements({flatten:!0});this.hasDetailsSlot=assigned.length>0,this.detailsText=assigned.slice(0,64).map(element=>{const renderedText=element.innerText;return typeof renderedText=="string"?renderedText:element.textContent??""}).join(" ").replace(/\s+/g," ").trim().slice(0,4096),this.hasInteractiveTooltip||this.closeTooltipLifecycle()},this.onSummarySlotChange=e=>{this.hasSummarySlot=e.target.assignedElements({flatten:!0}).length>0,this.hasInteractiveTooltip||this.closeTooltipLifecycle()},this.onMouseEnter=()=>{this.hovering=!0,this.showTooltip()},this.onMouseLeave=()=>{this.hovering=!1,!this.focused&&this.hideTooltip()},this.onFocus=()=>{this.focused=!0,this.showTooltip()},this.onBlur=()=>{this.focused=!1,!this.hovering&&this.hideTooltip()},this.onKeyDown=e=>{e.key==="Escape"&&this.tooltipOpen&&(e.stopPropagation(),this.hideTooltip())}}static{this.defaultStrings={...super.defaultStrings,collapse:LYRA_DEFAULT_collapse,details:LYRA_DEFAULT_details,durationMilliseconds:LYRA_DEFAULT_durationMilliseconds,durationSeconds:LYRA_DEFAULT_durationSeconds,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,open:LYRA_DEFAULT_open,popover:LYRA_DEFAULT_popover,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,tokensIn:LYRA_DEFAULT_tokensIn,tokensOut:LYRA_DEFAULT_tokensOut,usageBadgeCostLabel:LYRA_DEFAULT_usageBadgeCostLabel,usageBadgeLabel:LYRA_DEFAULT_usageBadgeLabel,usageBadgeLatencyLabel:LYRA_DEFAULT_usageBadgeLatencyLabel,usageBadgeTokensIn:LYRA_DEFAULT_usageBadgeTokensIn,usageBadgeTokensInLabel:LYRA_DEFAULT_usageBadgeTokensInLabel,usageBadgeTokensOut:LYRA_DEFAULT_usageBadgeTokensOut,usageBadgeTokensOutLabel:LYRA_DEFAULT_usageBadgeTokensOutLabel,usageBadgeTotalTokensLabel:LYRA_DEFAULT_usageBadgeTotalTokensLabel}}static{this.styles=[LyraElement.styles,styles,srOnly]}willUpdate(changed){super.willUpdate(changed),this.seedFirstRenderState(()=>{const children=Array.from(this.children);this.hasDetailsSlot=children.some(child=>child.getAttribute("slot")==="details"),this.hasSummarySlot=children.some(child=>child.getAttribute("slot")==="summary")}),this.hasUpdated&&(changed.has("tokensIn")||changed.has("tokensOut")||changed.has("costText")||changed.has("latencyMs")||changed.has("summary"))&&!this.hasInteractiveTooltip&&this.closeTooltipLifecycle()}updated(changed){if(super.updated(changed),changed.has("tooltipOpen")&&(this.cleanupPositioner?.(),this.cleanupPositioner=void 0,this.tooltipOpen)){const anchor=this.renderRoot.querySelector('[part="base"]'),tooltip=this.renderRoot.querySelector('[part="tooltip"]');anchor&&tooltip&&(this.cleanupPositioner=place(anchor,tooltip,{placement:"top-start"}))}}disconnectedCallback(){super.disconnectedCallback(),this.cleanupPositioner?.(),this.cleanupPositioner=void 0,this.tooltipOpen=!1,this.hovering=!1,this.focused=!1}get hasTokensIn(){return this.tokensIn!=null&&Number.isFinite(this.tokensIn)}get hasTokensOut(){return this.tokensOut!=null&&Number.isFinite(this.tokensOut)}get hasCost(){return this.costText.length>0}get validLatencyMs(){if(!(this.latencyMs==null||!Number.isFinite(this.latencyMs)))return finiteRange(this.latencyMs,this.latencyMs,0)}get hasLatency(){return this.validLatencyMs!==void 0}get hasVisibleContent(){return this.hasTokensIn||this.hasTokensOut||this.hasCost||this.hasLatency}get hasVisibleSummary(){return this.summary.length>0||this.hasSummarySlot}get hasDisplayContent(){return this.hasVisibleContent||this.hasVisibleSummary}get hasTooltipContent(){return this.hasVisibleContent||this.hasDetailsSlot}get hasInteractiveTooltip(){return this.hasDisplayContent&&this.hasTooltipContent}formatTokenCount(n){return getNumberFormat(this.effectiveLocale,this.abbreviate?{notation:"compact"}:{}).format(n)}formatTokenCountFull(n){return getNumberFormat(this.effectiveLocale).format(n)}localizedDuration(ms){if(this.formatLatency)return this.formatLatency(ms);const duration=durationMessageValue(ms),value=getNumberFormat(this.effectiveLocale,{maximumFractionDigits:duration.key==="durationMilliseconds"?0:1}).format(duration.value);return this.localize(duration.key,void 0,{value})}showTooltip(){!this.hasInteractiveTooltip||this.tooltipOpen||(this.tooltipOpen=!0)}hideTooltip(){this.tooltipOpen&&(this.tooltipOpen=!1)}closeTooltipLifecycle(){this.tooltipOpen=!1,this.hovering=!1,this.focused=!1,this.cleanupPositioner?.(),this.cleanupPositioner=void 0}render(){const interactive=this.hasInteractiveTooltip,tokensIn=this.hasTokensIn?finiteCount(this.tokensIn):void 0,tokensOut=this.hasTokensOut?finiteCount(this.tokensOut):void 0,hasBoth=tokensIn!==void 0&&tokensOut!==void 0;return html`
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{nextId,srOnly}from"../../../internal/a11y.js";import{reserveOverlayOrder}from"../../../internal/overlay-order.js";import{finiteCount,finiteRange}from"../../../internal/numbers.js";import{styles}from"./usage-badge.styles.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{durationMessageValue}from"../../../internal/duration.js";import{LYRA_DEFAULT_collapse,LYRA_DEFAULT_details,LYRA_DEFAULT_durationMilliseconds,LYRA_DEFAULT_durationSeconds,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_open,LYRA_DEFAULT_popover,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_tokensIn,LYRA_DEFAULT_tokensOut,LYRA_DEFAULT_usageBadgeCostLabel,LYRA_DEFAULT_usageBadgeLabel,LYRA_DEFAULT_usageBadgeLatencyLabel,LYRA_DEFAULT_usageBadgeTokensIn,LYRA_DEFAULT_usageBadgeTokensInLabel,LYRA_DEFAULT_usageBadgeTokensOut,LYRA_DEFAULT_usageBadgeTokensOutLabel,LYRA_DEFAULT_usageBadgeTotalTokensLabel}from"../../../internal/default-strings.generated.js";class LyraUsageBadge extends LyraElement{constructor(){super(...arguments),this.costText="",this.summary="",this.abbreviate=!1,this.tooltipOpen=!1,this.hasDetailsSlot=!1,this.hasSummarySlot=!1,this.detailsText="",this.tooltipId=nextId("usage-badge-tooltip"),this.hovering=!1,this.focused=!1,this.onDetailsSlotChange=e=>{const assigned=e.target.assignedElements({flatten:!0});this.hasDetailsSlot=assigned.length>0,this.detailsText=assigned.slice(0,64).map(element=>{const renderedText=element.innerText;return typeof renderedText=="string"?renderedText:element.textContent??""}).join(" ").replace(/\s+/g," ").trim().slice(0,4096),this.hasInteractiveTooltip||this.closeTooltipLifecycle()},this.onSummarySlotChange=e=>{this.hasSummarySlot=e.target.assignedElements({flatten:!0}).length>0,this.hasInteractiveTooltip||this.closeTooltipLifecycle()},this.onMouseEnter=()=>{this.hovering=!0,this.showTooltip()},this.onMouseLeave=()=>{this.hovering=!1,!this.focused&&this.hideTooltip()},this.onFocus=()=>{this.focused=!0,this.showTooltip()},this.onBlur=()=>{this.focused=!1,!this.hovering&&this.hideTooltip()},this.onKeyDown=e=>{e.key!=="Escape"||e.isComposing||e.keyCode===229||(this.tooltipOpening&&this.cancelTooltipOpening(),this.tooltipOpen&&this.tooltipOverlay?.isTopmost()&&(e.stopPropagation(),this.hideTooltip()))}}static{this.defaultStrings={...super.defaultStrings,collapse:LYRA_DEFAULT_collapse,details:LYRA_DEFAULT_details,durationMilliseconds:LYRA_DEFAULT_durationMilliseconds,durationSeconds:LYRA_DEFAULT_durationSeconds,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,open:LYRA_DEFAULT_open,popover:LYRA_DEFAULT_popover,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,tokensIn:LYRA_DEFAULT_tokensIn,tokensOut:LYRA_DEFAULT_tokensOut,usageBadgeCostLabel:LYRA_DEFAULT_usageBadgeCostLabel,usageBadgeLabel:LYRA_DEFAULT_usageBadgeLabel,usageBadgeLatencyLabel:LYRA_DEFAULT_usageBadgeLatencyLabel,usageBadgeTokensIn:LYRA_DEFAULT_usageBadgeTokensIn,usageBadgeTokensInLabel:LYRA_DEFAULT_usageBadgeTokensInLabel,usageBadgeTokensOut:LYRA_DEFAULT_usageBadgeTokensOut,usageBadgeTokensOutLabel:LYRA_DEFAULT_usageBadgeTokensOutLabel,usageBadgeTotalTokensLabel:LYRA_DEFAULT_usageBadgeTotalTokensLabel}}static{this.styles=[LyraElement.styles,styles,srOnly]}willUpdate(changed){super.willUpdate(changed),this.seedFirstRenderState(()=>{const children=Array.from(this.children);this.hasDetailsSlot=children.some(child=>child.getAttribute("slot")==="details"),this.hasSummarySlot=children.some(child=>child.getAttribute("slot")==="summary")}),this.hasUpdated&&(changed.has("tokensIn")||changed.has("tokensOut")||changed.has("costText")||changed.has("latencyMs")||changed.has("summary"))&&!this.hasInteractiveTooltip&&this.closeTooltipLifecycle()}updated(changed){super.updated(changed),changed.has("tooltipOpen")&&(this.tooltipOverlay?.deactivate({restoreFocus:!1}),this.tooltipOverlay=void 0,this.tooltipOpen&&this.isConnected&&(this.tooltipOverlay=this.tooltipRuntime?.activateUsageBadgeOverlay(this,()=>this.hideTooltip(),this.tooltipOrder),this.tooltipOrder=void 0))}disconnectedCallback(){super.disconnectedCallback(),this.closeTooltipLifecycle()}get hasTokensIn(){return this.tokensIn!=null&&Number.isFinite(this.tokensIn)}get hasTokensOut(){return this.tokensOut!=null&&Number.isFinite(this.tokensOut)}get hasCost(){return(this.costText??"").length>0}get validLatencyMs(){if(!(this.latencyMs==null||!Number.isFinite(this.latencyMs)))return finiteRange(this.latencyMs,this.latencyMs,0)}get hasLatency(){return this.validLatencyMs!==void 0}get hasVisibleContent(){return this.hasTokensIn||this.hasTokensOut||this.hasCost||this.hasLatency}get hasVisibleSummary(){return(this.summary??"").length>0||this.hasSummarySlot}get hasDisplayContent(){return this.hasVisibleContent||this.hasVisibleSummary}get hasTooltipContent(){return this.hasVisibleContent||this.hasDetailsSlot}get hasInteractiveTooltip(){return this.hasDisplayContent&&this.hasTooltipContent}formatTokenCount(n){return getNumberFormat(this.effectiveLocale,this.abbreviate?{notation:"compact"}:{}).format(n)}formatTokenCountFull(n){return getNumberFormat(this.effectiveLocale).format(n)}localizedDuration(ms){if(this.formatLatency)return this.formatLatency(ms);const duration=durationMessageValue(ms),value=getNumberFormat(this.effectiveLocale,{maximumFractionDigits:duration.key==="durationMilliseconds"?0:1}).format(duration.value);return this.localize(duration.key,void 0,{value})}loadTooltipOverlayRuntime(){return import("./usage-badge-overlay-runtime.js")}getUpdateComplete(){return this.tooltipOpening?this.waitForTooltipOpening():super.getUpdateComplete()}async waitForTooltipOpening(){let complete=await super.getUpdateComplete();for(;this.tooltipOpening;)await this.tooltipOpening.ready,complete=await super.getUpdateComplete();return complete}cancelTooltipOpening(){this.tooltipOpening?.cancel(),this.tooltipOpening=void 0,this.tooltipOrder=void 0}showTooltip(){if(!this.hasInteractiveTooltip||this.tooltipOpen||this.tooltipOpening||!this.isConnected)return;const document=this.ownerDocument,order=reserveOverlayOrder(document);if(this.tooltipRuntime){this.tooltipOrder=order,this.tooltipOpen=!0;return}let settle;const opening={ready:new Promise(resolve=>{settle=resolve}),cancel:settle};this.tooltipOpening=opening,this.loadTooltipOverlayRuntime().then(runtime=>{this.tooltipOpening!==opening||!this.isConnected||this.ownerDocument!==document||!this.hasInteractiveTooltip||!this.hovering&&!this.focused||!this.renderRoot.querySelector('[part="base"]')?.getClientRects().length||(this.tooltipRuntime=runtime,this.tooltipOrder=order,this.tooltipOpen=!0)},()=>{}).finally(()=>{this.tooltipOpening===opening&&(this.tooltipOpening=void 0),settle()})}hideTooltip(){this.cancelTooltipOpening(),this.tooltipOpen=!1,this.tooltipOverlay?.deactivate({restoreFocus:!1}),this.tooltipOverlay=void 0}closeTooltipLifecycle(){this.hideTooltip(),this.hovering=!1,this.focused=!1}render(){const interactive=this.hasInteractiveTooltip,tokensIn=this.hasTokensIn?finiteCount(this.tokensIn):void 0,tokensOut=this.hasTokensOut?finiteCount(this.tokensOut):void 0,hasBoth=tokensIn!==void 0&&tokensOut!==void 0;return html`
2
2
  <div
3
3
  part="base"
4
4
  role=${interactive?"group":nothing}
@@ -39,6 +39,9 @@ export type LyraVoicePickerSelectionDirection=LyraSelectionDirection;export inte
39
39
  * In free-text mode, `input` and the native selection/range-editing APIs expose the editable
40
40
  * combobox text. `setRangeText()` synchronizes `value`, form data, and validity without emitting
41
41
  * user-input events. These APIs are no-ops in closed-dropdown mode and before render.
42
+ * `readonly` keeps both combobox owners focusable and browseable while blocking user typing and
43
+ * catalog commits; selection/copy, voice previews, form submission/reset, and programmatic writes
44
+ * remain available.
42
45
  * Catalog assignments become bounded, clone-owned, frozen snapshots. Create and reassign a new
43
46
  * catalog array after changing its rows; mutating an assigned source does not update the picker.
44
47
  *
@@ -113,8 +116,10 @@ export type LyraVoicePickerSelectionDirection=LyraSelectionDirection;export inte
113
116
  * of a synthetic stale-value option row.
114
117
  * @cssprop [--lr-voice-picker-option-synthetic-font-style=italic] - Font style of a synthetic
115
118
  * stale-value option label.
116
- * @cssprop [--lr-voice-picker-preview-hover-bg=var(--lr-color-brand-quiet)] - Preview hover fill.
117
- * @cssprop [--lr-voice-picker-preview-hover-color=var(--lr-color-brand)] - Preview hover icon.
119
+ * @cssprop [--lr-voice-picker-preview-hover-bg=var(--lr-color-brand-quiet)] - Shared hover/press
120
+ * fill for the standalone and row preview actions.
121
+ * @cssprop [--lr-voice-picker-preview-hover-color=var(--lr-color-brand)] - Shared hover/press
122
+ * icon color for the standalone and row preview actions.
118
123
  * @cssprop [--lr-form-control-required-content=' *'] - The required marker appended to
119
124
  * `form-control-label` while `required` is set. Set it to `''` to suppress the marker, or to any
120
125
  * other quoted string (`' (required)'`, a localized word) to replace it.
@@ -137,6 +142,9 @@ provider:string;
137
142
  get catalog():LyraCatalog<LyraVoiceCatalogEntry> |undefined;set catalog(next:LyraCatalog<LyraVoiceCatalogEntry> |undefined);
138
143
  /** Let the user type/commit a value that isn't in `catalog`, even when `catalog` is non-empty. */
139
144
  allowCustom:boolean;
145
+ /** Keeps user edits and catalog commits from changing `value` while retaining focus, popup
146
+ * navigation, selection/copy, previews, form submission, reset, and programmatic writes. */
147
+ readonly:boolean;
140
148
  /** Whether to render preview affordances at all. */
141
149
  preview:boolean;
142
150
  /** Visible label text. The `label` slot appends custom label content to the same native label. */
@@ -181,8 +189,8 @@ get defaultValue():string;set defaultValue(next:string);get name():string;set na
181
189
  /** Whether the control is disabled explicitly or by an ancestor fieldset. */
182
190
  get effectiveDisabled():boolean;
183
191
  /**
184
- * Shared with every other form control: own `disabled` and a `<fieldset disabled>` ancestor bar
185
- * constraint validation (this picker has no `readonly` of its own). A barred control matches
192
+ * Shared with every other form control: own `disabled`/`readonly` and a `<fieldset disabled>`
193
+ * ancestor bar constraint validation. A barred control matches
186
194
  * neither `:valid` nor `:invalid` natively, so leaving `valueMissing` raised on a disabled
187
195
  * required picker is what painted it red under the documented `:state(user-invalid)` rule.
188
196
  */
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{installFormControlLabelSupport}from"../../../internal/form-control-labels.js";installFormControlLabelSupport();import{sizes}from"../../../internal/sizes.styles.js";import{hostAriaLabel,nextId}from"../../../internal/a11y.js";import{chevronIcon,playIcon,pauseIcon}from"../../../internal/icons.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{attachInternalsSafely,getFormOwner,installCustomErrorProperty,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{syncValidityStates}from"../../../internal/custom-states.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{styles}from"./voice-picker.styles.js";import{trueDefaultBooleanConverter,trueDefaultSpellcheckConverter as spellcheckConverter}from"../../../internal/converters.js";import{CatalogPickerController}from"../../../internal/catalog-picker.js";import{activeElementIn}from"../../../internal/active-element.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_notInCatalog,LYRA_DEFAULT_voice,LYRA_DEFAULT_voicePickerNoVoices,LYRA_DEFAULT_voicePickerPreview,LYRA_DEFAULT_voicePickerRequired,LYRA_DEFAULT_voicePickerStopPreview}from"../../../internal/default-strings.generated.js";const MAX_VOICE_CATALOG_ENTRIES=1e4;function ownString(value,key){try{const descriptor=Object.getOwnPropertyDescriptor(value,key);return descriptor&&"value"in descriptor&&typeof descriptor.value=="string"?descriptor.value:void 0}catch{return}}function snapshotVoiceCatalog(value){if(!Array.isArray(value))return;const stringSnapshot=[],entrySnapshot=[];let objectCatalog=!1,length=0;try{length=Math.min(value.length,MAX_VOICE_CATALOG_ENTRIES)}catch{return Object.freeze(stringSnapshot)}for(let index=0;index<length;index+=1){let descriptor;try{descriptor=Object.getOwnPropertyDescriptor(value,String(index))}catch{continue}if(!descriptor||!("value"in descriptor))continue;const candidate=descriptor.value;if(typeof candidate=="string"){objectCatalog?entrySnapshot.push(Object.freeze({id:candidate,label:candidate})):stringSnapshot.push(candidate);continue}if(candidate===null||typeof candidate!="object")continue;const id=ownString(candidate,"id"),label=ownString(candidate,"label");if(id===void 0||label===void 0)continue;objectCatalog||(entrySnapshot.push(...stringSnapshot.map(entry=>Object.freeze({id:entry,label:entry}))),objectCatalog=!0);const language=ownString(candidate,"language"),description=ownString(candidate,"description"),previewUrl=ownString(candidate,"previewUrl");entrySnapshot.push(Object.freeze({id,label,...language===void 0?{}:{language},...description===void 0?{}:{description},...previewUrl===void 0?{}:{previewUrl}}))}return Object.freeze(objectCatalog?entrySnapshot:stringSnapshot)}class LyraVoicePicker extends LyraElement{static{this.defaultStrings={...super.defaultStrings,fieldRequired:LYRA_DEFAULT_fieldRequired,noMatches:LYRA_DEFAULT_noMatches,notInCatalog:LYRA_DEFAULT_notInCatalog,voice:LYRA_DEFAULT_voice,voicePickerNoVoices:LYRA_DEFAULT_voicePickerNoVoices,voicePickerPreview:LYRA_DEFAULT_voicePickerPreview,voicePickerRequired:LYRA_DEFAULT_voicePickerRequired,voicePickerStopPreview:LYRA_DEFAULT_voicePickerStopPreview}}static{this.formAssociated=!0}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},required:{type:Boolean,reflect:!0,noAccessor:!0},value:{attribute:!1,noAccessor:!0},defaultValue:{attribute:"value",reflect:!1,useDefault:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0}}}get catalog(){return this._catalog}set catalog(next){const old=this._catalog;next!==old&&(this.internalPreviewTargetId!==null&&this.stopInternalPreview(),this._catalog=snapshotVoiceCatalog(next),this.requestUpdate("catalog",old))}get open(){return this.catalogPicker.open}set open(next){this.catalogPicker.setOpen(next)}get activeIndex(){return this.catalogPicker.activeIndex}get query(){return this.catalogPicker.query}constructor(){super(),this.provider="",this.allowCustom=!1,this.preview=!0,this.label="",this.hint="",this.errorText="",this.placeholder="",this.spellcheck=!0,this.autocapitalize="",this.autoCorrect="",this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.size="m",this.touched=!1,this.slotPresence=new SlotPresenceController(this),this.previewingId=null,this.listId=nextId("voice-picker-list"),this.controlId=nextId("voice-picker-control"),this.pendingPreviewId=null,this.previewGeneration=0,this._fieldsetDisabled=!1,this._name="",this._disabled=!1,this._required=!1,this.transferControlFocus=!1,this.catalogPicker=new CatalogPickerController(this,{catalog:()=>this.catalog,allowCustom:()=>this.allowCustom,locale:()=>this.effectiveLocale,searchableFields:entry=>[entry.id,entry.label,entry.language??"",entry.description??""],emitChange:detail=>this.emit("lr-change",detail),beforeValueChange:value=>{const previewTarget=this.internalPreviewTargetId;previewTarget!==null&&previewTarget!==value&&this.stopInternalPreview()},beforeActiveIndexChange:next=>this.reconcilePreviewForActiveIndex(next),afterQueryChange:()=>this.reconcilePreviewVisibility(this.open,this.catalogPicker.filteredEntries),onValueChange:(value,oldValue)=>{this.internals.setFormValue(value),this.updateValidity(),this.requestUpdate("value",oldValue)},onDefaultValueChange:(_value,oldValue)=>this.requestUpdate("defaultValue",oldValue),onStateChange:(state2,oldValue)=>{state2==="open"?(this.catalogPicker.open||this.reconcilePreviewVisibility(!1,[]),this.requestUpdate("open",oldValue)):this.requestUpdate()},onControlBlur:()=>{this.effectiveDisabled||(this.touched=!0)}}),this.onAudioEnded=event=>{event.currentTarget===this.audioEl&&this.stopInternalPreview()},this.onAudioLoadFailure=eventOrAudio=>{const direct=eventOrAudio,isDomErrorEvent=direct.localName!=="audio",audioLike=direct.localName==="audio"?eventOrAudio:eventOrAudio.currentTarget,failedAudio=audioLike?.localName==="audio"&&typeof audioLike.pause=="function"&&typeof audioLike.removeEventListener=="function"?audioLike:void 0;if(!failedAudio||(failedAudio.removeEventListener("ended",this.onAudioEnded),failedAudio.removeEventListener("error",this.onAudioLoadFailure),failedAudio.pause(),failedAudio!==this.audioEl))return;const pendingVoiceId=this.pendingPreviewId;this.previewGeneration++,this.audioEl=void 0,this.pendingPreviewId=null,isDomErrorEvent&&this.previewingId===null&&pendingVoiceId!==null&&(this.previewingId=pendingVoiceId,this.emit("lr-preview-change",{voiceId:pendingVoiceId})),this.previewingId!==null&&(this.previewingId=null,this.emit("lr-preview-change",{voiceId:null}))},this.onPreviewButtonClick=()=>{const candidate=this.previewCandidateId;candidate&&(this.internalPreviewTargetId===candidate?this.stopInternalPreview():this.requestPreview(candidate))},this.onOptionPreviewClick=(e,entry)=>{e.stopPropagation(),this.internalPreviewTargetId===entry.id?this.stopInternalPreview():this.requestPreview(entry.id)},this.onTriggerClick=()=>{this.effectiveDisabled||(this.open?this.hide():this.show())},this.onControlBlur=event=>{this.catalogPicker.handleControlBlur(event)},this.onControlFocus=event=>{this.catalogPicker.handleControlFocus(event)},this.onTriggerKeyDown=e=>{this.catalogPicker.handleTriggerKeyDown(e)},this.onComboMouseDown=e=>{this.catalogPicker.handleComboMouseDown(e)},this.onInputFocus=event=>{this.catalogPicker.handleInputFocus(event)},this.onInput=e=>{this.catalogPicker.handleInput(e)},this.onInputKeyDown=e=>{this.catalogPicker.handleInputKeyDown(e)},this.onListboxMouseDown=e=>{this.catalogPicker.handleListboxMouseDown(e)},this.onListboxClick=e=>{this.catalogPicker.handleListboxClick(e)},this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init)),this.internals.setFormValue("")}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}[VALIDITY_ANCHOR](){return this.renderRoot?.querySelector('[part="trigger"], [part="combobox-input"]')??null}click(){this.catalogPicker.click()}focus(options){this.catalogPicker.focus(options)}blur(){this.catalogPicker.blur()}get input(){return this.catalogPicker.input}get selectionStart(){return this.input?.selectionStart??null}set selectionStart(value){this.input&&(this.input.selectionStart=value)}get selectionEnd(){return this.input?.selectionEnd??null}set selectionEnd(value){this.input&&(this.input.selectionEnd=value)}get selectionDirection(){return this.input?.selectionDirection??null}set selectionDirection(value){this.input&&(this.input.selectionDirection=value)}select(){this.catalogPicker.select()}setSelectionRange(start,end,direction){this.catalogPicker.setSelectionRange(start,end,direction)}setRangeText(replacement,start,end,selectMode){this.catalogPicker.setRangeText(replacement,start,end,selectMode)}connectedCallback(){super.connectedCallback(),this.updateValidity(),this.catalogPicker.connected(this.hasUpdated)}willUpdate(changed){if(super.willUpdate(changed),this.hasUpdated){const switchingMode=this.renderRoot.querySelector('[part="trigger"]')!==null!==this.closedMode,focused=activeElementIn(this.shadowRoot??this.ownerDocument);this.catalogPicker.suppressControlEvents=switchingMode,this.transferControlFocus=switchingMode&&focused?.nodeType===1&&focused.matches('[part="trigger"], [part="combobox-input"]')}if(this.hasUpdated&&(changed.has("catalog")||changed.has("allowCustom")||changed.has("value"))){const activeValue=this.renderRoot.querySelector('[part="option"][data-active]')?.dataset.value,rows=this.closedMode?this.effectiveEntries:this.filteredEntries;this.catalogPicker.reconcileRows(activeValue,!1),this.reconcilePreviewVisibility(this.open,rows)}changed.has("preview")&&!this.preview&&this.stopInternalPreview()}disconnectedCallback(){super.disconnectedCallback(),this.stopInternalPreview(),this.catalogPicker.disconnected()}adoptedCallback(){super.adoptedCallback(),this.stopInternalPreview(),this.catalogPicker.adopted()}get value(){return this.catalogPicker.value}set value(next){this.catalogPicker.value=next}get defaultValue(){return this.catalogPicker.defaultValue}set defaultValue(next){this.catalogPicker.defaultValue=next}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.requestUpdate("name",old)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._disabled&&(this.hide(),this.stopInternalPreview()),this.updateValidity(),this.requestUpdate("disabled",old)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.updateValidity(),this.requestUpdate("required",old)}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}updateValidity(){this.barredFromValidation?this.validityController.setValidity({}):this.required&&!this.value?this.validityController.setValidity({valueMissing:!0},this.localize("voicePickerRequired")):this.validityController.setValidity({}),this.publishValidityStates()}publishValidityStates(){syncValidityStates(this.internals,{required:this.required,hasInteracted:this.touched,barred:this.barredFromValidation})}formResetCallback(){this.touched=!1,this.catalogPicker.resetValue()}formStateRestoreCallback(state2,_mode){this.catalogPicker.restoreState(state2)}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,disabled&&(this.hide(),this.stopInternalPreview()),this.updateValidity(),this.requestUpdate()}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.touched=!0,this.publishValidityStates(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.publishValidityStates()}get closedMode(){return this.catalogPicker.closedMode}get effectiveEntries(){return this.catalogPicker.effectiveEntries}get filteredEntries(){return this.catalogPicker.filteredEntries}get malformedCatalogEntries(){const raw=this.catalog;if(!raw||raw.length===0)return[];const out=[];for(const item of raw){const record=typeof item=="string"?{id:item,label:item}:item;typeof record?.id=="string"&&record.id.trim()!==""||out.push({...record,id:"",synthetic:!1})}return out}labelFor(id){return this.catalogPicker.labelFor(id)}show(){this.catalogPicker.show()}hide(){this.catalogPicker.hide()}updated(changed){super.updated(changed);const reposition=changed.has("open")||this.open&&(changed.has("catalog")||changed.has("allowCustom"));this.catalogPicker.updated(reposition),(changed.has("required")||changed.has("touched")||changed.has("value"))&&this.toggleAttribute("data-invalid",this.touched&&!this.internals.validity.valid),this.publishValidityStates(),this.transferControlFocus&&(this.transferControlFocus=!1,this.renderRoot.querySelector('[part="trigger"], [part="combobox-input"]')?.focus()),this.catalogPicker.suppressControlEvents=!1}get internalPreviewTargetId(){return this.pendingPreviewId??this.previewingId}reconcilePreviewVisibility(open,rows){const target=this.internalPreviewTargetId;if(target===null)return;const standaloneCandidate=open&&this.activeIndex>=0?rows[this.activeIndex]?.id??this.value:this.value,hasVisibleRow=open&&rows.some(entry=>entry.id===target&&!!entry.previewUrl);target!==standaloneCandidate&&!hasVisibleRow&&this.stopInternalPreview()}reconcilePreviewForActiveIndex(next){const target=this.internalPreviewTargetId;if(target!==null){const rows=this.closedMode?this.effectiveEntries:this.filteredEntries,nextCandidate=this.open&&next>=0?rows[next]?.id??this.value:this.value;target!==nextCandidate&&this.stopInternalPreview()}}get previewCandidateId(){return this.open&&this.activeIndex>=0?(this.closedMode?this.effectiveEntries:this.filteredEntries)[this.activeIndex]?.id??this.value:this.value}requestPreview(voiceId){if(!voiceId)return;const currentTarget=this.internalPreviewTargetId;currentTarget!==null&&currentTarget!==voiceId&&this.stopInternalPreview();const previewUrl=this.effectiveEntries.find(e=>e.id===voiceId)?.previewUrl;!this.emit("lr-preview-request",{voiceId,previewUrl},{cancelable:!0}).defaultPrevented&&previewUrl&&this.playInternal(voiceId,previewUrl)}playInternal(voiceId,url){const safe=safeMediaSrc(url);if(!safe)return;this.stopInternalPreview();const audio=this.ownerDocument.createElement("audio");audio.src=safe,audio.addEventListener("ended",this.onAudioEnded),audio.addEventListener("error",this.onAudioLoadFailure);const generation=++this.previewGeneration;this.audioEl=audio,this.pendingPreviewId=voiceId;let playResult;try{playResult=audio.play()}catch{this.onAudioLoadFailure(audio);return}Promise.resolve(playResult).then(()=>{generation!==this.previewGeneration||audio!==this.audioEl||this.pendingPreviewId!==voiceId||(this.pendingPreviewId=null,this.previewingId=voiceId,this.emit("lr-preview-change",{voiceId}))},()=>this.onAudioLoadFailure(audio))}stopInternalPreview(){const hadTarget=this.internalPreviewTargetId!==null||this.audioEl!==void 0;this.audioEl&&(this.audioEl.removeEventListener("ended",this.onAudioEnded),this.audioEl.removeEventListener("error",this.onAudioLoadFailure),this.audioEl.pause(),this.audioEl=void 0),hadTarget&&this.previewGeneration++,this.pendingPreviewId=null,this.previewingId!==null&&(this.previewingId=null,this.emit("lr-preview-change",{voiceId:null}))}get previewButtonLabel(){const candidate=this.previewCandidateId,playing=this.previewingId!==null&&this.previewingId===candidate,name=this.labelFor(candidate)||candidate;return playing?this.localize("voicePickerStopPreview"):this.localize("voicePickerPreview",void 0,{name})}renderRows(rows,activeId){return rows.map((entry,i)=>{const id=`${this.listId}-opt-${i}`,selected=entry.id!==""&&entry.id===this.value,meta=[entry.language,entry.description].filter(Boolean).join(" \xB7 ");return html`<div
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{installFormControlLabelSupport}from"../../../internal/form-control-labels.js";installFormControlLabelSupport();import{sizes}from"../../../internal/sizes.styles.js";import{hostAriaLabel,nextId}from"../../../internal/a11y.js";import{chevronIcon,playIcon,pauseIcon}from"../../../internal/icons.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{attachInternalsSafely,getFormOwner,installCustomErrorProperty,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{syncValidityStates}from"../../../internal/custom-states.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{styles}from"./voice-picker.styles.js";import{trueDefaultBooleanConverter,trueDefaultSpellcheckConverter as spellcheckConverter}from"../../../internal/converters.js";import{CatalogPickerController}from"../../../internal/catalog-picker.js";import{activeElementIn}from"../../../internal/active-element.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_notInCatalog,LYRA_DEFAULT_voice,LYRA_DEFAULT_voicePickerNoVoices,LYRA_DEFAULT_voicePickerPreview,LYRA_DEFAULT_voicePickerRequired,LYRA_DEFAULT_voicePickerStopPreview}from"../../../internal/default-strings.generated.js";const MAX_VOICE_CATALOG_ENTRIES=1e4;function ownString(value,key){try{const descriptor=Object.getOwnPropertyDescriptor(value,key);return descriptor&&"value"in descriptor&&typeof descriptor.value=="string"?descriptor.value:void 0}catch{return}}function snapshotVoiceCatalog(value){if(!Array.isArray(value))return;const stringSnapshot=[],entrySnapshot=[];let objectCatalog=!1,length=0;try{length=Math.min(value.length,MAX_VOICE_CATALOG_ENTRIES)}catch{return Object.freeze(stringSnapshot)}for(let index=0;index<length;index+=1){let descriptor;try{descriptor=Object.getOwnPropertyDescriptor(value,String(index))}catch{continue}if(!descriptor||!("value"in descriptor))continue;const candidate=descriptor.value;if(typeof candidate=="string"){objectCatalog?entrySnapshot.push(Object.freeze({id:candidate,label:candidate})):stringSnapshot.push(candidate);continue}if(candidate===null||typeof candidate!="object")continue;const id=ownString(candidate,"id"),label=ownString(candidate,"label");if(id===void 0||label===void 0)continue;objectCatalog||(entrySnapshot.push(...stringSnapshot.map(entry=>Object.freeze({id:entry,label:entry}))),objectCatalog=!0);const language=ownString(candidate,"language"),description=ownString(candidate,"description"),previewUrl=ownString(candidate,"previewUrl");entrySnapshot.push(Object.freeze({id,label,...language===void 0?{}:{language},...description===void 0?{}:{description},...previewUrl===void 0?{}:{previewUrl}}))}return Object.freeze(objectCatalog?entrySnapshot:stringSnapshot)}class LyraVoicePicker extends LyraElement{static{this.defaultStrings={...super.defaultStrings,fieldRequired:LYRA_DEFAULT_fieldRequired,noMatches:LYRA_DEFAULT_noMatches,notInCatalog:LYRA_DEFAULT_notInCatalog,voice:LYRA_DEFAULT_voice,voicePickerNoVoices:LYRA_DEFAULT_voicePickerNoVoices,voicePickerPreview:LYRA_DEFAULT_voicePickerPreview,voicePickerRequired:LYRA_DEFAULT_voicePickerRequired,voicePickerStopPreview:LYRA_DEFAULT_voicePickerStopPreview}}static{this.formAssociated=!0}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},required:{type:Boolean,reflect:!0,noAccessor:!0},value:{attribute:!1,noAccessor:!0},defaultValue:{attribute:"value",reflect:!1,useDefault:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0}}}get catalog(){return this._catalog}set catalog(next){const old=this._catalog;next!==old&&(this.internalPreviewTargetId!==null&&this.stopInternalPreview(),this._catalog=snapshotVoiceCatalog(next),this.requestUpdate("catalog",old))}get open(){return this.catalogPicker.open}set open(next){this.catalogPicker.setOpen(next)}get activeIndex(){return this.catalogPicker.activeIndex}get query(){return this.catalogPicker.query}constructor(){super(),this.provider="",this.allowCustom=!1,this.readonly=!1,this.preview=!0,this.label="",this.hint="",this.errorText="",this.placeholder="",this.spellcheck=!0,this.autocapitalize="",this.autoCorrect="",this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.size="m",this.touched=!1,this.slotPresence=new SlotPresenceController(this),this.previewingId=null,this.listId=nextId("voice-picker-list"),this.controlId=nextId("voice-picker-control"),this.pendingPreviewId=null,this.previewGeneration=0,this._fieldsetDisabled=!1,this._name="",this._disabled=!1,this._required=!1,this.transferControlFocus=!1,this.catalogPicker=new CatalogPickerController(this,{catalog:()=>this.catalog,allowCustom:()=>this.allowCustom,isReadonly:()=>this.readonly,locale:()=>this.effectiveLocale,searchableFields:entry=>[entry.id,entry.label,entry.language??"",entry.description??""],emitChange:detail=>this.emit("lr-change",detail),beforeValueChange:value=>{const previewTarget=this.internalPreviewTargetId;previewTarget!==null&&previewTarget!==value&&this.stopInternalPreview()},beforeActiveIndexChange:next=>this.reconcilePreviewForActiveIndex(next),afterQueryChange:()=>this.reconcilePreviewVisibility(this.open,this.catalogPicker.filteredEntries),onValueChange:(value,oldValue)=>{this.internals.setFormValue(value),this.updateValidity(),this.requestUpdate("value",oldValue)},onDefaultValueChange:(_value,oldValue)=>this.requestUpdate("defaultValue",oldValue),onStateChange:(state2,oldValue)=>{state2==="open"?(this.catalogPicker.open||this.reconcilePreviewVisibility(!1,[]),this.requestUpdate("open",oldValue)):this.requestUpdate()},onControlBlur:()=>{this.effectiveDisabled||(this.touched=!0)}}),this.onAudioEnded=event=>{event.currentTarget===this.audioEl&&this.stopInternalPreview()},this.onAudioLoadFailure=eventOrAudio=>{const direct=eventOrAudio,isDomErrorEvent=direct.localName!=="audio",audioLike=direct.localName==="audio"?eventOrAudio:eventOrAudio.currentTarget,failedAudio=audioLike?.localName==="audio"&&typeof audioLike.pause=="function"&&typeof audioLike.removeEventListener=="function"?audioLike:void 0;if(!failedAudio||(failedAudio.removeEventListener("ended",this.onAudioEnded),failedAudio.removeEventListener("error",this.onAudioLoadFailure),failedAudio.pause(),failedAudio!==this.audioEl))return;const pendingVoiceId=this.pendingPreviewId;this.previewGeneration++,this.audioEl=void 0,this.pendingPreviewId=null,isDomErrorEvent&&this.previewingId===null&&pendingVoiceId!==null&&(this.previewingId=pendingVoiceId,this.emit("lr-preview-change",{voiceId:pendingVoiceId})),this.previewingId!==null&&(this.previewingId=null,this.emit("lr-preview-change",{voiceId:null}))},this.onPreviewButtonClick=()=>{const candidate=this.previewCandidateId;candidate&&(this.internalPreviewTargetId===candidate?this.stopInternalPreview():this.requestPreview(candidate))},this.onOptionPreviewClick=(e,entry)=>{e.stopPropagation(),this.internalPreviewTargetId===entry.id?this.stopInternalPreview():this.requestPreview(entry.id)},this.onTriggerClick=()=>{this.effectiveDisabled||(this.open?this.hide():this.show())},this.onControlBlur=event=>{this.catalogPicker.handleControlBlur(event)},this.onControlFocus=event=>{this.catalogPicker.handleControlFocus(event)},this.onTriggerKeyDown=e=>{this.catalogPicker.handleTriggerKeyDown(e)},this.onComboMouseDown=e=>{this.catalogPicker.handleComboMouseDown(e)},this.onInputFocus=event=>{this.catalogPicker.handleInputFocus(event)},this.onInput=e=>{this.catalogPicker.handleInput(e)},this.onInputKeyDown=e=>{this.catalogPicker.handleInputKeyDown(e)},this.onListboxMouseDown=e=>{this.catalogPicker.handleListboxMouseDown(e)},this.onListboxClick=e=>{this.catalogPicker.handleListboxClick(e)},this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init)),this.internals.setFormValue("")}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}[VALIDITY_ANCHOR](){return this.renderRoot?.querySelector('[part="trigger"], [part="combobox-input"]')??null}click(){this.catalogPicker.click()}focus(options){this.catalogPicker.focus(options)}blur(){this.catalogPicker.blur()}get input(){return this.catalogPicker.input}get selectionStart(){return this.input?.selectionStart??null}set selectionStart(value){this.input&&(this.input.selectionStart=value)}get selectionEnd(){return this.input?.selectionEnd??null}set selectionEnd(value){this.input&&(this.input.selectionEnd=value)}get selectionDirection(){return this.input?.selectionDirection??null}set selectionDirection(value){this.input&&(this.input.selectionDirection=value)}select(){this.catalogPicker.select()}setSelectionRange(start,end,direction){this.catalogPicker.setSelectionRange(start,end,direction)}setRangeText(replacement,start,end,selectMode){this.catalogPicker.setRangeText(replacement,start,end,selectMode)}connectedCallback(){super.connectedCallback(),this.updateValidity(),this.catalogPicker.connected(this.hasUpdated)}willUpdate(changed){if(super.willUpdate(changed),this.hasUpdated){const switchingMode=this.renderRoot.querySelector('[part="trigger"]')!==null!==this.closedMode,focused=activeElementIn(this.shadowRoot??this.ownerDocument);this.catalogPicker.suppressControlEvents=switchingMode,this.transferControlFocus=switchingMode&&focused?.nodeType===1&&focused.matches('[part="trigger"], [part="combobox-input"]')}if(this.hasUpdated&&(changed.has("catalog")||changed.has("allowCustom")||changed.has("value"))){const activeValue=this.renderRoot.querySelector('[part="option"][data-active]')?.dataset.value,rows=this.closedMode?this.effectiveEntries:this.filteredEntries;this.catalogPicker.reconcileRows(activeValue,!1),this.reconcilePreviewVisibility(this.open,rows)}changed.has("preview")&&!this.preview&&this.stopInternalPreview()}disconnectedCallback(){super.disconnectedCallback(),this.stopInternalPreview(),this.catalogPicker.disconnected()}adoptedCallback(){super.adoptedCallback(),this.stopInternalPreview(),this.catalogPicker.adopted()}get value(){return this.catalogPicker.value}set value(next){this.catalogPicker.value=next}get defaultValue(){return this.catalogPicker.defaultValue}set defaultValue(next){this.catalogPicker.defaultValue=next}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.requestUpdate("name",old)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._disabled&&(this.hide(),this.stopInternalPreview()),this.updateValidity(),this.requestUpdate("disabled",old)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.updateValidity(),this.requestUpdate("required",old)}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}updateValidity(){this.barredFromValidation?this.validityController.setValidity({}):this.required&&!this.value?this.validityController.setValidity({valueMissing:!0},this.localize("voicePickerRequired")):this.validityController.setValidity({}),this.publishValidityStates()}publishValidityStates(){syncValidityStates(this.internals,{required:this.required,hasInteracted:this.touched,barred:this.barredFromValidation})}formResetCallback(){this.touched=!1,this.catalogPicker.resetValue()}formStateRestoreCallback(state2,_mode){this.catalogPicker.restoreState(state2)}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,disabled&&(this.hide(),this.stopInternalPreview()),this.updateValidity(),this.requestUpdate()}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.touched=!0,this.publishValidityStates(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.publishValidityStates()}get closedMode(){return this.catalogPicker.closedMode}get effectiveEntries(){return this.catalogPicker.effectiveEntries}get filteredEntries(){return this.catalogPicker.filteredEntries}get malformedCatalogEntries(){const raw=this.catalog;if(!raw||raw.length===0)return[];const out=[];for(const item of raw){const record=typeof item=="string"?{id:item,label:item}:item;typeof record?.id=="string"&&record.id.trim()!==""||out.push({...record,id:"",synthetic:!1})}return out}labelFor(id){return this.catalogPicker.labelFor(id)}show(){this.catalogPicker.show()}hide(){this.catalogPicker.hide()}updated(changed){super.updated(changed);const reposition=changed.has("open")||this.open&&(changed.has("catalog")||changed.has("allowCustom"));this.catalogPicker.updated(reposition),(changed.has("required")||changed.has("readonly")||changed.has("touched")||changed.has("value"))&&(changed.has("readonly")&&this.updateValidity(),this.toggleAttribute("data-invalid",this.touched&&!this.internals.validity.valid)),this.publishValidityStates(),this.transferControlFocus&&(this.transferControlFocus=!1,this.renderRoot.querySelector('[part="trigger"], [part="combobox-input"]')?.focus()),this.catalogPicker.suppressControlEvents=!1}get internalPreviewTargetId(){return this.pendingPreviewId??this.previewingId}reconcilePreviewVisibility(open,rows){const target=this.internalPreviewTargetId;if(target===null)return;const standaloneCandidate=open&&this.activeIndex>=0?rows[this.activeIndex]?.id??this.value:this.value,hasVisibleRow=open&&rows.some(entry=>entry.id===target&&!!entry.previewUrl);target!==standaloneCandidate&&!hasVisibleRow&&this.stopInternalPreview()}reconcilePreviewForActiveIndex(next){const target=this.internalPreviewTargetId;if(target!==null){const rows=this.closedMode?this.effectiveEntries:this.filteredEntries,nextCandidate=this.open&&next>=0?rows[next]?.id??this.value:this.value;target!==nextCandidate&&this.stopInternalPreview()}}get previewCandidateId(){return this.open&&this.activeIndex>=0?(this.closedMode?this.effectiveEntries:this.filteredEntries)[this.activeIndex]?.id??this.value:this.value}requestPreview(voiceId){if(!voiceId)return;const currentTarget=this.internalPreviewTargetId;currentTarget!==null&&currentTarget!==voiceId&&this.stopInternalPreview();const previewUrl=this.effectiveEntries.find(e=>e.id===voiceId)?.previewUrl;!this.emit("lr-preview-request",{voiceId,previewUrl},{cancelable:!0}).defaultPrevented&&previewUrl&&this.playInternal(voiceId,previewUrl)}playInternal(voiceId,url){const safe=safeMediaSrc(url);if(!safe)return;this.stopInternalPreview();const audio=this.ownerDocument.createElement("audio");audio.src=safe,audio.addEventListener("ended",this.onAudioEnded),audio.addEventListener("error",this.onAudioLoadFailure);const generation=++this.previewGeneration;this.audioEl=audio,this.pendingPreviewId=voiceId;let playResult;try{playResult=audio.play()}catch{this.onAudioLoadFailure(audio);return}Promise.resolve(playResult).then(()=>{generation!==this.previewGeneration||audio!==this.audioEl||this.pendingPreviewId!==voiceId||(this.pendingPreviewId=null,this.previewingId=voiceId,this.emit("lr-preview-change",{voiceId}))},()=>this.onAudioLoadFailure(audio))}stopInternalPreview(){const hadTarget=this.internalPreviewTargetId!==null||this.audioEl!==void 0;this.audioEl&&(this.audioEl.removeEventListener("ended",this.onAudioEnded),this.audioEl.removeEventListener("error",this.onAudioLoadFailure),this.audioEl.pause(),this.audioEl=void 0),hadTarget&&this.previewGeneration++,this.pendingPreviewId=null,this.previewingId!==null&&(this.previewingId=null,this.emit("lr-preview-change",{voiceId:null}))}get previewButtonLabel(){const candidate=this.previewCandidateId,playing=this.previewingId!==null&&this.previewingId===candidate,name=this.labelFor(candidate)||candidate;return playing?this.localize("voicePickerStopPreview"):this.localize("voicePickerPreview",void 0,{name})}renderRows(rows,activeId){return rows.map((entry,i)=>{const id=`${this.listId}-opt-${i}`,selected=entry.id!==""&&entry.id===this.value,meta=[entry.language,entry.description].filter(Boolean).join(" · ");return html`<div
2
2
  part="option"
3
3
  id=${id}
4
4
  role="option"
@@ -29,7 +29,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
29
29
  >
30
30
  ${rows.length===0?html`<div part="empty" role="option" aria-selected="false" aria-disabled="true">${emptyText}</div>`:this.renderRows(rows,activeId)}
31
31
  </div>
32
- `}get hasVisibleLabel(){return this.label.length>0||this.slotPresence.has("label")}renderLabel(){return html`<label part="form-control-label" for=${this.controlId} ?hidden=${!this.hasVisibleLabel}
32
+ `}get hasVisibleLabel(){return(this.label??"").length>0||this.slotPresence.has("label")}renderLabel(){return html`<label part="form-control-label" for=${this.controlId} ?hidden=${!this.hasVisibleLabel}
33
33
  >${this.label}<slot name="label"></slot></label
34
34
  >`}renderHintError(hasError,hasHint){return html`
35
35
  <div id="voice-picker-error" part="error" ?hidden=${!hasError}>
@@ -51,7 +51,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
51
51
  >
52
52
  ${playing?pauseIcon():playIcon()}
53
53
  </button>
54
- `}renderClosed(){const rows=this.effectiveEntries,activeId=this.activeIndex>=0&&rows[this.activeIndex]?`${this.listId}-opt-${this.activeIndex}`:"",hasValue=this.value.length>0,hasLabel=this.hasVisibleLabel,hasHint=this.slotPresence.has("hint")||this.hint.length>0,hasError=this.slotPresence.has("error")||this.errorText.length>0,describedBy=[hasError?"voice-picker-error":"",hasHint?"voice-picker-hint":""].filter(Boolean).join(" ");return html`
54
+ `}renderClosed(){const rows=this.effectiveEntries,activeId=this.activeIndex>=0&&rows[this.activeIndex]?`${this.listId}-opt-${this.activeIndex}`:"",hasValue=this.value.length>0,hasLabel=this.hasVisibleLabel,hasHint=this.slotPresence.has("hint")||(this.hint??"").length>0,hasError=this.slotPresence.has("error")||(this.errorText??"").length>0,describedBy=[hasError?"voice-picker-error":"",hasHint?"voice-picker-hint":""].filter(Boolean).join(" ");return html`
55
55
  ${this.renderLabel()}
56
56
  <div class="control-row">
57
57
  <button
@@ -66,6 +66,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
66
66
  aria-label=${hostAriaLabel(this)??(hasLabel?nothing:this.placeholder||this.localize("voice"))}
67
67
  aria-describedby=${describedBy||nothing}
68
68
  aria-required=${this.required?"true":"false"}
69
+ aria-readonly=${this.readonly?"true":"false"}
69
70
  aria-invalid=${this.touched&&!this.internals.validity.valid?"true":"false"}
70
71
  ?disabled=${this.effectiveDisabled}
71
72
  @click=${this.onTriggerClick}
@@ -83,7 +84,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
83
84
  </div>
84
85
  ${this.renderListbox([...rows,...this.malformedCatalogEntries],activeId,this.localize("voicePickerNoVoices"))}
85
86
  ${this.renderHintError(hasError,hasHint)}
86
- `}renderFreeText(){const rows=this.filteredEntries,activeId=this.activeIndex>=0&&rows[this.activeIndex]?`${this.listId}-opt-${this.activeIndex}`:"",hasLabel=this.hasVisibleLabel,hasHint=this.slotPresence.has("hint")||this.hint.length>0,hasError=this.slotPresence.has("error")||this.errorText.length>0,describedBy=[hasError?"voice-picker-error":"",hasHint?"voice-picker-hint":""].filter(Boolean).join(" ");return html`
87
+ `}renderFreeText(){const rows=this.filteredEntries,activeId=this.activeIndex>=0&&rows[this.activeIndex]?`${this.listId}-opt-${this.activeIndex}`:"",hasLabel=this.hasVisibleLabel,hasHint=this.slotPresence.has("hint")||(this.hint??"").length>0,hasError=this.slotPresence.has("error")||(this.errorText??"").length>0,describedBy=[hasError?"voice-picker-error":"",hasHint?"voice-picker-hint":""].filter(Boolean).join(" ");return html`
87
88
  ${this.renderLabel()}
88
89
  <div class="control-row">
89
90
  <div part="combobox" @mousedown=${this.onComboMouseDown}>
@@ -99,6 +100,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
99
100
  aria-autocomplete="list"
100
101
  aria-describedby=${describedBy||nothing}
101
102
  aria-required=${this.required?"true":"false"}
103
+ aria-readonly=${this.readonly?"true":"false"}
102
104
  aria-invalid=${this.touched&&!this.internals.validity.valid?"true":"false"}
103
105
  autocomplete=${this.autocomplete||nothing}
104
106
  spellcheck=${this.spellcheck}
@@ -107,6 +109,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
107
109
  inputmode=${this.inputMode||nothing}
108
110
  enterkeyhint=${this.enterKeyHint||nothing}
109
111
  .value=${this.open?this.query:this.labelFor(this.value)}
112
+ .readOnly=${this.readonly}
110
113
  placeholder=${this.placeholder}
111
114
  ?disabled=${this.effectiveDisabled}
112
115
  @input=${this.onInput}
@@ -122,4 +125,4 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
122
125
  ${this.renderHintError(hasError,hasHint)}
123
126
  `}render(){return html`<div part="form-control">
124
127
  ${this.closedMode?this.renderClosed():this.renderFreeText()}
125
- </div>`}}__decorate([property()],LyraVoicePicker.prototype,"provider",void 0),__decorate([property({attribute:!1})],LyraVoicePicker.prototype,"catalog",null),__decorate([property({type:Boolean,reflect:!0,attribute:"allow-custom"})],LyraVoicePicker.prototype,"allowCustom",void 0),__decorate([property({reflect:!0,converter:trueDefaultBooleanConverter})],LyraVoicePicker.prototype,"preview",void 0),__decorate([property()],LyraVoicePicker.prototype,"label",void 0),__decorate([property()],LyraVoicePicker.prototype,"hint",void 0),__decorate([property({attribute:"error-text"})],LyraVoicePicker.prototype,"errorText",void 0),__decorate([property()],LyraVoicePicker.prototype,"placeholder",void 0),__decorate([property({converter:spellcheckConverter})],LyraVoicePicker.prototype,"spellcheck",void 0),__decorate([property()],LyraVoicePicker.prototype,"autocapitalize",void 0),__decorate([property({attribute:"autocorrect"})],LyraVoicePicker.prototype,"autoCorrect",void 0),__decorate([property()],LyraVoicePicker.prototype,"autocomplete",void 0),__decorate([property({attribute:"inputmode"})],LyraVoicePicker.prototype,"inputMode",void 0),__decorate([property({attribute:"enterkeyhint"})],LyraVoicePicker.prototype,"enterKeyHint",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraVoicePicker.prototype,"open",null),__decorate([property({reflect:!0})],LyraVoicePicker.prototype,"size",void 0),__decorate([state()],LyraVoicePicker.prototype,"touched",void 0),__decorate([state()],LyraVoicePicker.prototype,"previewingId",void 0);export{LyraVoicePicker};
128
+ </div>`}}__decorate([property()],LyraVoicePicker.prototype,"provider",void 0),__decorate([property({attribute:!1})],LyraVoicePicker.prototype,"catalog",null),__decorate([property({type:Boolean,reflect:!0,attribute:"allow-custom"})],LyraVoicePicker.prototype,"allowCustom",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraVoicePicker.prototype,"readonly",void 0),__decorate([property({reflect:!0,converter:trueDefaultBooleanConverter})],LyraVoicePicker.prototype,"preview",void 0),__decorate([property()],LyraVoicePicker.prototype,"label",void 0),__decorate([property()],LyraVoicePicker.prototype,"hint",void 0),__decorate([property({attribute:"error-text"})],LyraVoicePicker.prototype,"errorText",void 0),__decorate([property()],LyraVoicePicker.prototype,"placeholder",void 0),__decorate([property({converter:spellcheckConverter})],LyraVoicePicker.prototype,"spellcheck",void 0),__decorate([property()],LyraVoicePicker.prototype,"autocapitalize",void 0),__decorate([property({attribute:"autocorrect"})],LyraVoicePicker.prototype,"autoCorrect",void 0),__decorate([property()],LyraVoicePicker.prototype,"autocomplete",void 0),__decorate([property({attribute:"inputmode"})],LyraVoicePicker.prototype,"inputMode",void 0),__decorate([property({attribute:"enterkeyhint"})],LyraVoicePicker.prototype,"enterKeyHint",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraVoicePicker.prototype,"open",null),__decorate([property({reflect:!0})],LyraVoicePicker.prototype,"size",void 0),__decorate([state()],LyraVoicePicker.prototype,"touched",void 0),__decorate([state()],LyraVoicePicker.prototype,"previewingId",void 0);export{LyraVoicePicker};
@@ -1 +1 @@
1
- import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/form-control.styles.js";const styles=css` :host { position: relative; display: inline-block; inline-size: 100%; min-inline-size: 0; max-inline-size: var(--lr-size-24rem); --_lr-voice-picker-gap-default: var(--lr-space-xs); --_lr-voice-picker-radius-default: var(--lr-form-control-radius); } :host(:disabled) { cursor: not-allowed; } [part='form-control-label'] { display: block; margin-block-end: var(--lr-space-xs); overflow-wrap: anywhere; font-size: var(--lr-font-size-md-sm); font-weight: var(--lr-font-weight-semibold); } [part='form-control-label'][hidden] { display: none; } ${formControlRequiredMarker} .control-row { display: flex; align-items: stretch; gap: var(--lr-voice-picker-gap, var(--_lr-voice-picker-gap-default)); } [part='trigger'], [part='combobox'] { display: flex; align-items: center; gap: var(--lr-voice-picker-gap, var(--_lr-voice-picker-gap-default)); flex: 1 1 auto; min-inline-size: 0; min-block-size: var(--lr-form-control-height); box-sizing: border-box; padding: var(--lr-form-control-padding-block) var(--lr-form-control-padding-inline); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); background: var(--lr-color-surface); color: inherit; font: inherit; font-size: var(--lr-form-control-font-size); } [part='trigger'] { cursor: pointer; text-align: start; } [part='combobox'] { cursor: text; } [part='trigger']:hover:not(:disabled) { border-color: var(--lr-color-brand); } [part='trigger']:active:not(:disabled) { border-color: var(--lr-color-brand); background: color-mix(in oklab, var(--lr-color-surface), var(--lr-color-mix-partner) var(--lr-color-mix-active)); } [part='trigger']:focus-visible, [part='combobox']:focus-within { outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color); outline-offset: var(--lr-focus-ring-offset); } :host([open]) [part='trigger'] { border-color: var(--lr-voice-picker-open-border-color, var(--lr-color-brand)); } :host(:disabled) [part='trigger'], :host(:disabled) [part='combobox'] { opacity: var(--lr-opacity-disabled); cursor: not-allowed; } [part='provider-badge'] { flex: 0 1 auto; min-inline-size: 0; max-inline-size: 40%; overflow: hidden; text-overflow: ellipsis; padding-inline-end: var(--lr-space-xs); margin-inline-end: var(--lr-space-xs); border-inline-end: var(--lr-border-width-thin) solid var(--lr-color-border); font-size: var(--lr-size-0-6875rem); font-weight: var(--lr-font-weight-bold); text-transform: uppercase; letter-spacing: var(--lr-size-0-04em); color: var(--lr-color-text-quiet); white-space: nowrap; } .trigger-label { flex: 1 1 auto; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .trigger-label[data-placeholder] { color: var(--lr-color-text-quiet); } [part='combobox-input'] { flex: 1 1 auto; min-inline-size: 0; border: none; outline: none; background: transparent; color: inherit; font: inherit; } [part='combobox-input']::placeholder { color: var(--lr-color-text-quiet); } [part='expand-icon'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--lr-color-text-quiet); min-inline-size: min(var(--lr-icon-button-size), var(--lr-form-control-height)); min-block-size: min(var(--lr-icon-button-size), var(--lr-form-control-height)); line-height: var(--lr-line-height-none); } [part='expand-icon'] svg { transform: rotate(90deg); } [part='preview-button'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; inline-size: max(var(--lr-icon-button-size), var(--lr-form-control-height)); block-size: max(var(--lr-icon-button-size), var(--lr-form-control-height)); min-inline-size: var(--lr-icon-button-size); min-block-size: var(--lr-icon-button-size); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); background: var(--lr-color-surface); color: var(--lr-color-text); cursor: pointer; } [part='preview-button']:hover:not(:disabled) { background: var(--lr-color-brand-quiet); } [part='preview-button']:active:not(:disabled) { background: color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active)); } [part='preview-button']:focus-visible { outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color); outline-offset: var(--lr-focus-ring-offset); } [part='preview-button']:disabled { opacity: var(--lr-opacity-disabled); cursor: not-allowed; } [part='preview-button'][aria-pressed='true'] { border-color: var(--lr-voice-picker-preview-active-border, var(--lr-color-brand)); color: var(--lr-voice-picker-preview-active-color, var(--lr-color-brand)); } [part='listbox'] { position: fixed; z-index: var(--lr-layer-dropdown); box-sizing: border-box; max-block-size: min(var(--lr-size-18rem), var(--lr-positioner-available-block-size, var(--lr-size-18rem))); overflow-y: auto; overflow-x: hidden; inline-size: max-content; min-inline-size: min(var(--lr-size-12rem), var(--lr-positioner-available-inline-size, var(--lr-size-12rem))); max-inline-size: min(var(--lr-popover-viewport-clamp), var(--lr-size-28rem), var(--lr-positioner-available-inline-size, 100vw)); padding: var(--lr-space-xs); background: var(--lr-color-surface); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); box-shadow: var(--lr-shadow-m); visibility: hidden; opacity: 0; transform: translateY(var(--lr-size-neg-0-25rem)); transition: opacity var(--lr-transition-fast), transform var(--lr-transition-fast), visibility var(--lr-transition-fast); } :host([open]) [part='listbox'] { visibility: visible; opacity: 1; transform: translateY(0); } @media (prefers-reduced-motion: reduce) { [part='listbox'] { transition: none !important; } } [part='option'] { display: flex; align-items: center; gap: var(--lr-voice-picker-gap, var(--_lr-voice-picker-gap-default)); inline-size: 100%; box-sizing: border-box; padding: var(--lr-space-xs) var(--lr-space-s); border: var(--lr-border-width-thin) solid transparent; border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; } [part='option'][aria-selected='true'] { border-color: var(--lr-voice-picker-option-selected-border, var(--lr-color-brand)); color: var(--lr-voice-picker-option-selected-color, var(--lr-color-brand)); background: var(--lr-voice-picker-option-selected-bg, transparent); font-weight: var( --lr-voice-picker-option-selected-font-weight, var(--lr-font-weight-semibold) ); } [part='option']:hover, [part='option'][data-active] { background: var(--lr-voice-picker-option-active-bg, var(--lr-color-brand-quiet)); } [part='option']:active { background: color-mix( in oklab, var(--lr-voice-picker-option-active-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='option-label'] { flex: 1 1 auto; min-inline-size: 0; display: flex; flex-direction: column; overflow: hidden; } [part='option-label'] > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } [part='option-meta'] { font-size: var(--lr-size-0-6875rem); color: var(--lr-color-text-quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } [part='option'][data-synthetic] { border-style: var(--lr-voice-picker-option-synthetic-border-style, dashed); border-color: var(--lr-voice-picker-option-synthetic-border-color, var(--lr-color-border)); } [part='option'][data-synthetic] [part='option-label'] { font-style: var(--lr-voice-picker-option-synthetic-font-style, italic); } [part='option-badge'] { flex: 0 0 auto; font-size: var(--lr-size-0-6875rem); font-style: normal; font-weight: var(--lr-font-weight-normal); color: var(--lr-color-text-quiet); white-space: nowrap; } [part='option-preview'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-inline-size: var(--lr-icon-button-size); min-block-size: var(--lr-icon-button-size); border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); color: var(--lr-color-text-quiet); cursor: pointer; } [part='option-preview']:hover { background: var(--lr-voice-picker-preview-hover-bg, var(--lr-color-brand-quiet)); color: var(--lr-voice-picker-preview-hover-color, var(--lr-color-brand)); } [part='option-preview']:active { background: color-mix( in oklab, var(--lr-voice-picker-preview-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); color: var(--lr-voice-picker-preview-hover-color, var(--lr-color-brand)); } [part='empty'] { padding: var(--lr-space-m); color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-md-sm); } [part='hint'] { margin-block-start: var(--lr-space-xs); overflow-wrap: anywhere; font-size: var(--lr-font-size-sm); color: var(--lr-color-text-quiet); } [part='hint'][hidden] { display: none; } [part='error'] { margin-block-start: var(--lr-space-xs); overflow-wrap: anywhere; font-size: var(--lr-font-size-sm); color: var(--lr-color-danger); } [part='error'][hidden] { display: none; } `;export{styles};
1
+ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/form-control.styles.js";const styles=css` :host { position: relative; display: inline-block; inline-size: 100%; min-inline-size: 0; max-inline-size: var(--lr-size-24rem); --_lr-voice-picker-gap-default: var(--lr-space-xs); --_lr-voice-picker-radius-default: var(--lr-form-control-radius); } :host(:disabled) { cursor: not-allowed; } [part='form-control-label'] { display: block; margin-block-end: var(--lr-space-xs); overflow-wrap: anywhere; font-size: var(--lr-font-size-md-sm); font-weight: var(--lr-font-weight-semibold); } [part='form-control-label'][hidden] { display: none; } ${formControlRequiredMarker} .control-row { display: flex; align-items: stretch; gap: var(--lr-voice-picker-gap, var(--_lr-voice-picker-gap-default)); } [part='trigger'], [part='combobox'] { display: flex; align-items: center; gap: var(--lr-voice-picker-gap, var(--_lr-voice-picker-gap-default)); flex: 1 1 auto; min-inline-size: 0; min-block-size: var(--lr-form-control-height); box-sizing: border-box; padding: var(--lr-form-control-padding-block) var(--lr-form-control-padding-inline); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); background: var(--lr-color-surface); color: inherit; font: inherit; font-size: var(--lr-form-control-font-size); } [part='trigger'] { cursor: pointer; text-align: start; } [part='combobox'] { cursor: text; } [part='trigger']:hover:not(:disabled) { border-color: var(--lr-color-brand); } [part='trigger']:active:not(:disabled) { border-color: var(--lr-color-brand); background: color-mix(in oklab, var(--lr-color-surface), var(--lr-color-mix-partner) var(--lr-color-mix-active)); } [part='trigger']:focus-visible, [part='combobox']:focus-within { outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color); outline-offset: var(--lr-focus-ring-offset); } :host([open]) [part='trigger'] { border-color: var(--lr-voice-picker-open-border-color, var(--lr-color-brand)); } :host(:disabled) [part='trigger'], :host(:disabled) [part='combobox'] { opacity: var(--lr-opacity-disabled); cursor: not-allowed; } [part='provider-badge'] { flex: 0 1 auto; min-inline-size: 0; max-inline-size: 40%; overflow: hidden; text-overflow: ellipsis; padding-inline-end: var(--lr-space-xs); margin-inline-end: var(--lr-space-xs); border-inline-end: var(--lr-border-width-thin) solid var(--lr-color-border); font-size: var(--lr-size-0-6875rem); font-weight: var(--lr-font-weight-bold); text-transform: uppercase; letter-spacing: var(--lr-size-0-04em); color: var(--lr-color-text-quiet); white-space: nowrap; } .trigger-label { flex: 1 1 auto; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .trigger-label[data-placeholder] { color: var(--lr-color-text-quiet); } [part='combobox-input'] { flex: 1 1 auto; min-inline-size: 0; border: none; outline: none; background: transparent; color: inherit; font: inherit; } [part='combobox-input']::placeholder { color: var(--lr-color-text-quiet); } [part='expand-icon'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--lr-color-text-quiet); min-inline-size: min(var(--lr-icon-button-size), var(--lr-form-control-height)); min-block-size: min(var(--lr-icon-button-size), var(--lr-form-control-height)); line-height: var(--lr-line-height-none); } [part='expand-icon'] svg { transform: rotate(90deg); } [part='preview-button'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; inline-size: max(var(--lr-icon-button-size), var(--lr-form-control-height)); block-size: max(var(--lr-icon-button-size), var(--lr-form-control-height)); min-inline-size: var(--lr-icon-button-size); min-block-size: var(--lr-icon-button-size); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); background: var(--lr-color-surface); color: var(--lr-color-text); font: inherit; cursor: pointer; } [part='preview-button']:hover:not(:disabled) { background: var(--lr-voice-picker-preview-hover-bg, var(--lr-color-brand-quiet)); color: var(--lr-voice-picker-preview-hover-color, var(--lr-color-brand)); } [part='preview-button']:active:not(:disabled) { background: color-mix( in oklab, var(--lr-voice-picker-preview-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); color: var(--lr-voice-picker-preview-hover-color, var(--lr-color-brand)); } [part='preview-button']:focus-visible { outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color); outline-offset: var(--lr-focus-ring-offset); } [part='preview-button']:disabled { opacity: var(--lr-opacity-disabled); cursor: not-allowed; } [part='preview-button'][aria-pressed='true'] { border-color: var(--lr-voice-picker-preview-active-border, var(--lr-color-brand)); color: var(--lr-voice-picker-preview-active-color, var(--lr-color-brand)); } [part='listbox'] { position: fixed; z-index: var(--lr-layer-dropdown); box-sizing: border-box; max-block-size: min(var(--lr-size-18rem), var(--lr-positioner-available-block-size, var(--lr-size-18rem))); overflow-y: auto; overflow-x: hidden; inline-size: max-content; min-inline-size: min(var(--lr-size-12rem), var(--lr-positioner-available-inline-size, var(--lr-size-12rem))); max-inline-size: min(var(--lr-popover-viewport-clamp), var(--lr-size-28rem), var(--lr-positioner-available-inline-size, 100vw)); padding: var(--lr-space-xs); background: var(--lr-color-surface); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); box-shadow: var(--lr-shadow-m); visibility: hidden; opacity: 0; transform: translateY(var(--lr-size-neg-0-25rem)); transition: opacity var(--lr-transition-fast), transform var(--lr-transition-fast), visibility var(--lr-transition-fast); } :host([open]) [part='listbox'] { visibility: visible; opacity: 1; transform: translateY(0); } @media (prefers-reduced-motion: reduce) { [part='listbox'] { transition: none !important; } } [part='option'] { display: flex; align-items: center; gap: var(--lr-voice-picker-gap, var(--_lr-voice-picker-gap-default)); inline-size: 100%; box-sizing: border-box; padding: var(--lr-space-xs) var(--lr-space-s); border: var(--lr-border-width-thin) solid transparent; border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; } [part='option'][aria-selected='true'] { border-color: var(--lr-voice-picker-option-selected-border, var(--lr-color-brand)); color: var(--lr-voice-picker-option-selected-color, var(--lr-color-brand)); background: var(--lr-voice-picker-option-selected-bg, transparent); font-weight: var( --lr-voice-picker-option-selected-font-weight, var(--lr-font-weight-semibold) ); } [part='option']:hover, [part='option'][data-active] { background: var(--lr-voice-picker-option-active-bg, var(--lr-color-brand-quiet)); } [part='option']:active { background: color-mix( in oklab, var(--lr-voice-picker-option-active-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='option-label'] { flex: 1 1 auto; min-inline-size: 0; display: flex; flex-direction: column; overflow: hidden; } [part='option-label'] > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } [part='option-meta'] { font-size: var(--lr-size-0-6875rem); color: var(--lr-color-text-quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } [part='option']:hover [part='option-meta'], [part='option'][data-active] [part='option-meta'] { color: var(--lr-color-text); } [part='option'][data-synthetic] { border-style: var(--lr-voice-picker-option-synthetic-border-style, dashed); border-color: var(--lr-voice-picker-option-synthetic-border-color, var(--lr-color-border)); } [part='option'][data-synthetic] [part='option-label'] { font-style: var(--lr-voice-picker-option-synthetic-font-style, italic); } [part='option-badge'] { flex: 0 0 auto; font-size: var(--lr-size-0-6875rem); font-style: normal; font-weight: var(--lr-font-weight-normal); color: var(--lr-color-text-quiet); white-space: nowrap; } [part='option-preview'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-inline-size: var(--lr-icon-button-size); min-block-size: var(--lr-icon-button-size); border-radius: var(--lr-voice-picker-radius, var(--_lr-voice-picker-radius-default)); color: var(--lr-color-text-quiet); cursor: pointer; } [part='option-preview']:hover { background: var(--lr-voice-picker-preview-hover-bg, var(--lr-color-brand-quiet)); color: var(--lr-voice-picker-preview-hover-color, var(--lr-color-brand)); } [part='option-preview']:active { background: color-mix( in oklab, var(--lr-voice-picker-preview-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); color: var(--lr-voice-picker-preview-hover-color, var(--lr-color-brand)); } [part='empty'] { padding: var(--lr-space-m); color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-md-sm); } [part='hint'] { margin-block-start: var(--lr-space-xs); overflow-wrap: anywhere; font-size: var(--lr-font-size-sm); color: var(--lr-color-text-quiet); } [part='hint'][hidden] { display: none; } [part='error'] { margin-block-start: var(--lr-space-xs); overflow-wrap: anywhere; font-size: var(--lr-font-size-sm); color: var(--lr-color-danger); } [part='error'][hidden] { display: none; } `;export{styles};
@@ -1,8 +1,3 @@
1
- /**
2
- * DOM-free, bounded allowlist resolution for `<lr-widget-renderer>`. Authored input is copied into
3
- * a capped snapshot exactly once before validation/resolution, so getters and sibling indices
4
- * outside the admitted prefix are never touched and later passes cannot observe mutation.
5
- */
6
1
  import{type LyraWidgetTypeRegistry}from'./registry.js';export interface LyraWidgetNode{readonly type:string;readonly id?:string;readonly props?:Readonly<Record<string,unknown>>;readonly children?:readonly(LyraWidgetNode|string)[];readonly slot?:string;readonly actionId?:string;readonly payload?:unknown;}export interface LyraWidgetBinding{readonly $bind:string;readonly fallback?:string|number|boolean|null;}
7
2
  /** Version-two document. Controlled binding state is supplied separately through `bindingState`. */
8
3
  export interface LyraWidgetDocument{readonly version:'2';readonly root:LyraWidgetNode;}
@@ -25,7 +20,10 @@ nodePath:string;kind:'builtin-row'|'builtin-col'|'builtin-text'|'mapped';tag?:st
25
20
  /** Semantic control classification, independent of actions and bindings. */
26
21
  interactive:boolean;props:Record<string,unknown>;actionEvent?:string;actionId?:string;payload?:unknown;bindings:Array<{prop:string;path:string;event?:string;}>;children:ResolvedNode[];slot?:string;}export type ResolvedNode=ResolvedText|ResolvedElement;export interface ResolveContext{registry:LyraWidgetTypeRegistry;bindingState:unknown;
27
22
  /** Warning keys retained for one renderer document/registry generation. */
28
- warned:Set<string>;warn?:(message:string)=>void;}
23
+ warned:Set<string>;
24
+ /** Explicit diagnostic callback, active in every runtime. Without one, authoring warnings
25
+ * are emitted only in development; keys and caps belong to this context generation. */
26
+ warn?:(message:string)=>void;}
29
27
  /** Resolves one bounded immutable snapshot through `ctx.registry`. Structural invalidity returns
30
28
  * `null`; throwing getters/registry access propagate so the renderer can emit one normalized error. */
31
29
  export declare function resolveTree(root:LyraWidgetNode|null|undefined,ctx:ResolveContext):ResolvedNode|null;
@@ -1 +1 @@
1
- import{isWidgetTypeRegistry}from"./registry.js";import{readWidgetPointer,WIDGET_MAX_DEPTH,WIDGET_MAX_NODES,WIDGET_MAX_PROPS_PER_NODE,WIDGET_MAX_WARNINGS}from"../../../internal/widget-resolver.js";const WIDGET_MAX_STRING_LENGTH=16384;function truncateWidgetString(value){if(value.length<=WIDGET_MAX_STRING_LENGTH)return value;const capped=value.slice(0,WIDGET_MAX_STRING_LENGTH),last=capped.charCodeAt(capped.length-1);return last>=55296&&last<=56319?capped.slice(0,-1):capped}const DOCUMENT_INVALID=Symbol("invalid-widget-document"),DOCUMENT_MISSING=Symbol("missing-widget-document-field");function readDocumentField(input,key){try{return Object.hasOwn(input,key)?Reflect.get(input,key):DOCUMENT_MISSING}catch{return DOCUMENT_INVALID}}function snapshotDocumentProps(input){const output={};let admitted=0;try{for(const key in input){if(!Object.hasOwn(input,key))continue;if(admitted>=WIDGET_MAX_PROPS_PER_NODE)break;const value=Reflect.get(input,key);admitted+=1,output[key]=typeof value=="string"?truncateWidgetString(value):value}}catch{return DOCUMENT_INVALID}return Object.freeze(output)}function snapshotDocumentNode(input,depth,context){if(depth>WIDGET_MAX_DEPTH||context.remaining<=0)return null;if(context.remaining-=1,input===null||typeof input!="object"||Array.isArray(input)||context.ancestors.has(input))return DOCUMENT_INVALID;const type=readDocumentField(input,"type");if(typeof type!="string")return DOCUMENT_INVALID;const id=readDocumentField(input,"id"),slot=readDocumentField(input,"slot"),actionId=readDocumentField(input,"actionId"),propsInput=readDocumentField(input,"props"),childrenInput=readDocumentField(input,"children");if([id,slot,actionId,propsInput,childrenInput].includes(DOCUMENT_INVALID)||id!==DOCUMENT_MISSING&&(typeof id!="string"||id.length===0||id!==id.trim()))return DOCUMENT_INVALID;if(typeof id=="string"){if(context.ids.has(id))return DOCUMENT_INVALID;context.ids.add(id)}if(slot!==DOCUMENT_MISSING&&(typeof slot!="string"||slot.length===0||slot!==slot.trim())||actionId!==DOCUMENT_MISSING&&(typeof actionId!="string"||actionId.length===0||actionId!==actionId.trim())||propsInput!==DOCUMENT_MISSING&&(propsInput===null||typeof propsInput!="object"||Array.isArray(propsInput))||childrenInput!==DOCUMENT_MISSING&&!Array.isArray(childrenInput))return DOCUMENT_INVALID;const props=propsInput===DOCUMENT_MISSING?void 0:snapshotDocumentProps(propsInput);if(props===DOCUMENT_INVALID)return DOCUMENT_INVALID;let payload=DOCUMENT_MISSING;if(actionId!==DOCUMENT_MISSING&&(payload=readDocumentField(input,"payload"),payload===DOCUMENT_INVALID))return DOCUMENT_INVALID;const children=[];if(childrenInput!==DOCUMENT_MISSING&&depth<WIDGET_MAX_DEPTH){const length=readDocumentField(childrenInput,"length");if(typeof length!="number"||!Number.isSafeInteger(length)||length<0)return DOCUMENT_INVALID;context.ancestors.add(input);try{for(let index=0;index<length&&context.remaining>0;index++){const child=readDocumentField(childrenInput,index);if(child===DOCUMENT_INVALID||child===DOCUMENT_MISSING)return DOCUMENT_INVALID;if(typeof child=="string"){context.remaining-=1,children.push(truncateWidgetString(child));continue}const snapshot=snapshotDocumentNode(child,depth+1,context);if(snapshot===DOCUMENT_INVALID)return DOCUMENT_INVALID;snapshot&&children.push(snapshot)}}finally{context.ancestors.delete(input)}}return Object.freeze({type,...typeof id=="string"?{id}:{},...typeof slot=="string"?{slot}:{},...typeof actionId=="string"?{actionId,payload:payload===DOCUMENT_MISSING?void 0:payload}:{},...props===void 0?{}:{props},...children.length===0?{}:{children:Object.freeze(children)}})}function createWidgetDocument(root){const snapshot=snapshotDocumentNode(root,0,{ancestors:new Set,ids:new Set,remaining:WIDGET_MAX_NODES});if(snapshot===DOCUMENT_INVALID||snapshot===null)throw new TypeError("A widget document root must be a valid bounded widget node.");return Object.freeze({version:"2",root:snapshot})}const WARNING_SUPPRESSION_KEY="__warning-cap__",INVALID=Symbol("invalid-widget-input"),ROW_COL_PROP_ENUMS={gap:["s","m","l"],align:["start","center","end","stretch"],justify:["start","center","end","between"]};function warnOnce(ctx,key,message){if(!ctx.warned.has(key)){if(ctx.warned.size>=WIDGET_MAX_WARNINGS){if(ctx.warned.has(WARNING_SUPPRESSION_KEY))return;ctx.warned.add(WARNING_SUPPRESSION_KEY),(ctx.warn??console.warn)(`[lr-widget-renderer] suppressed further diagnostics after ${WIDGET_MAX_WARNINGS} unique warnings`);return}ctx.warned.add(key),(ctx.warn??console.warn)(`[lr-widget-renderer] ${message}`)}}function capResolvedString(value,ctx,key,subject){const capped=truncateWidgetString(value);return capped.length!==value.length&&warnOnce(ctx,`__string-cap__:${key}`,`truncated ${subject} after the ${WIDGET_MAX_STRING_LENGTH}-character string cap was reached`),capped}function isBinding(value){return!!(value&&typeof value=="object"&&!Array.isArray(value)&&typeof value.$bind=="string")}function resolveValue(value,ctx){if(!isBinding(value))return{value};const resolved=readWidgetPointer(ctx.bindingState,value.$bind);return{value:resolved===void 0?value.fallback:resolved,path:value.$bind}}function consumeNodeBudget(snapshot){return snapshot.remaining<=0?(warnOnce(snapshot.resolve,"__node-cap__",`stopped resolving after the ${WIDGET_MAX_NODES}-node cap was reached`),!1):(snapshot.remaining--,!0)}function snapshotProps(input,type,ctx){const out={};let visited=0;for(const key in input){if(visited>=WIDGET_MAX_PROPS_PER_NODE){warnOnce(ctx,`__prop-cap__:${type}`,`stopped reading props on type "${type}" after the ${WIDGET_MAX_PROPS_PER_NODE}-prop cap was reached`);break}visited++,Object.hasOwn(input,key)&&(out[key]=input[key])}return out}function definitionFor(type,registry){return registry.get(type)}function snapshotNode(input,depth,snapshot){if(depth>WIDGET_MAX_DEPTH)return warnOnce(snapshot.resolve,"__depth-cap__",`stopped resolving after the ${WIDGET_MAX_DEPTH}-level depth cap was reached`),null;if(!consumeNodeBudget(snapshot))return null;if(input===null||typeof input!="object"||Array.isArray(input)||snapshot.ancestors.has(input))return INVALID;const candidate=input,type=candidate.type;if(typeof type!="string")return INVALID;if(!(type==="row"||type==="col"||type==="text")&&!definitionFor(type,snapshot.resolve.registry))return{type};const id=candidate.id;if(id!==void 0&&(typeof id!="string"||id.length===0||id!==id.trim()))return INVALID;const slot=candidate.slot;if(slot!==void 0&&(typeof slot!="string"||slot.length===0||slot!==slot.trim()))return INVALID;const actionId=candidate.actionId;if(actionId!==void 0&&(typeof actionId!="string"||actionId.length===0||actionId!==actionId.trim()))return INVALID;const propsInput=candidate.props;if(propsInput!==void 0&&(propsInput===null||typeof propsInput!="object"||Array.isArray(propsInput)))return INVALID;const childrenInput=candidate.children;if(childrenInput!==void 0&&!Array.isArray(childrenInput))return INVALID;const node={type,...id!==void 0?{id}:{},...slot!==void 0?{slot}:{},...actionId!==void 0?{actionId,payload:candidate.payload}:{},...propsInput!==void 0?{props:snapshotProps(propsInput,type,snapshot.resolve)}:{}};if(childrenInput===void 0||depth===WIDGET_MAX_DEPTH)return childrenInput&&childrenInput.length>0&&warnOnce(snapshot.resolve,"__depth-cap__",`stopped resolving after the ${WIDGET_MAX_DEPTH}-level depth cap was reached`),node;const children=[];snapshot.ancestors.add(input);try{const childCount=childrenInput.length;for(let index=0;index<childCount;index++){if(snapshot.remaining<=0){consumeNodeBudget(snapshot);break}const child=childrenInput[index];if(typeof child=="string"){if(!consumeNodeBudget(snapshot))break;children.push(child);continue}const accepted=snapshotNode(child,depth+1,snapshot);if(accepted===INVALID)return INVALID;accepted&&children.push(accepted)}}finally{snapshot.ancestors.delete(input)}return children.length>0?{...node,children}:node}function filterRowColProps(props){const out={};if(!props)return out;for(const[key,allowed]of Object.entries(ROW_COL_PROP_ENUMS)){const value=props[key];typeof value=="string"&&allowed.includes(value)&&(out[key]=value)}return out}function filterMappedProps(props,def,ctx,type){const out={},bindings=[],allowlist=def.props??{};if(props)for(const[key,rawValue]of Object.entries(props)){const expectedType=allowlist[key],{value,path}=resolveValue(rawValue,ctx);if(expectedType===void 0||typeof value!==expectedType){warnOnce(ctx,`${type}:${key}`,`skipped disallowed or mistyped prop "${key}" on type "${type}"`);continue}out[key]=typeof value=="string"?capResolvedString(value,ctx,`${type}:${key}`,`string prop "${key}" on type "${type}"`):value,path&&bindings.push({prop:key,path,event:def.bindings?.[key]?.event})}return{props:{...out,...def.forcedProps??{}},bindings}}function containsInteractive(node){return node.kind==="text"?!1:node.interactive||node.children.some(containsInteractive)}function resolveChild(value,ctx,path){return typeof value=="string"?{nodeKey:`path:${path}`,nodePath:path,kind:"text",text:capResolvedString(value,ctx,"__text__","a text child")}:resolveNode(value,ctx,path)}function resolveNode(node,ctx,path){const authoredId=node.id,nodeKey=authoredId?`id:${authoredId}`:`path:${path}`;let kind,tag,interactive=!1,props,actionEvent,bindings=[],slots=[];if(node.type==="row"||node.type==="col")kind=node.type==="row"?"builtin-row":"builtin-col",props=filterRowColProps(node.props);else if(node.type==="text"){kind="builtin-text";const resolved=resolveValue(node.props?.value,ctx);if(props=typeof resolved.value=="string"||typeof resolved.value=="number"?{value:capResolvedString(String(resolved.value),ctx,"__text-value__",'the "value" of a built-in text node')}:{},resolved.path){if(!authoredId)throw warnOnce(ctx,`__required-id__:${path}`,"rejected bound text without a stable id"),new TypeError("A bound widget node requires a stable id.");bindings=[{prop:"value",path:resolved.path}]}}else{const def=definitionFor(node.type,ctx.registry);if(!def)return warnOnce(ctx,node.type,`skipped unknown widget type "${node.type}" (and its subtree)`),null;kind="mapped",tag=def.tag,interactive=def.interaction==="control";const filtered=filterMappedProps(node.props,def,ctx,node.type);if(props=filtered.props,bindings=filtered.bindings,slots=def.slots??[],node.actionId!==void 0&&def.action&&(actionEvent=def.action.event),(actionEvent||bindings.length>0)&&!authoredId)throw warnOnce(ctx,`__required-id__:${path}`,`rejected stateful or actionable type "${node.type}" without a stable id`),new TypeError("A stateful or actionable widget node requires a stable id.")}const children=[];for(let index=0;index<(node.children?.length??0);index++){const resolvedChild=resolveChild(node.children[index],ctx,`${path}.${index}`);if(resolvedChild){if(interactive&&containsInteractive(resolvedChild)){warnOnce(ctx,`__nested-interactive__:${node.type}`,`skipped a control descendant inside control type "${node.type}"`);continue}resolvedChild.slot!==void 0&&!slots.includes(resolvedChild.slot)&&(resolvedChild.slot=void 0),children.push(resolvedChild)}}return{nodeId:authoredId,nodeKey,nodePath:path,kind,tag,interactive,props,actionEvent,actionId:actionEvent?node.actionId:void 0,payload:actionEvent?node.payload:void 0,bindings,children,slot:node.slot}}function hasDuplicateAuthoredIds(root,ctx){const counts=new Map,pending=[root];for(;pending.length>0;){const node=pending.pop();node.id&&counts.set(node.id,(counts.get(node.id)??0)+1);for(const child of node.children??[])typeof child!="string"&&pending.push(child)}let duplicate=!1;for(const[id,count]of counts)count<2||(duplicate=!0,warnOnce(ctx,`__duplicate-id__:${id}`,`rejected duplicate widget id "${id}"`));return duplicate}function resolveTree(root,ctx){if(root==null)return null;if(!isWidgetTypeRegistry(ctx.registry))throw new TypeError("A widget renderer registry must be created with createWidgetTypeRegistry().");const snapshot=snapshotNode(root,0,{resolve:ctx,ancestors:new Set,remaining:WIDGET_MAX_NODES});return snapshot===INVALID||snapshot===null||hasDuplicateAuthoredIds(snapshot,ctx)?null:resolveNode(snapshot,ctx,"0")}export{WIDGET_MAX_STRING_LENGTH,createWidgetDocument,resolveTree};
1
+ import{devWarn}from"../../../internal/dev-mode-attribute-warning.js";import{isWidgetTypeRegistry}from"./registry.js";import{readWidgetPointer,WIDGET_MAX_DEPTH,WIDGET_MAX_NODES,WIDGET_MAX_PROPS_PER_NODE,WIDGET_MAX_WARNINGS}from"../../../internal/widget-resolver.js";const WIDGET_MAX_STRING_LENGTH=16384;function truncateWidgetString(value){if(value.length<=WIDGET_MAX_STRING_LENGTH)return value;const capped=value.slice(0,WIDGET_MAX_STRING_LENGTH),last=capped.charCodeAt(capped.length-1);return last>=55296&&last<=56319?capped.slice(0,-1):capped}const DOCUMENT_INVALID=Symbol("invalid-widget-document"),DOCUMENT_MISSING=Symbol("missing-widget-document-field");function readDocumentField(input,key){try{return Object.hasOwn(input,key)?Reflect.get(input,key):DOCUMENT_MISSING}catch{return DOCUMENT_INVALID}}function snapshotDocumentProps(input){const output={};let admitted=0;try{for(const key in input){if(!Object.hasOwn(input,key))continue;if(admitted>=WIDGET_MAX_PROPS_PER_NODE)break;const value=Reflect.get(input,key);admitted+=1,output[key]=typeof value=="string"?truncateWidgetString(value):value}}catch{return DOCUMENT_INVALID}return Object.freeze(output)}function snapshotDocumentNode(input,depth,context){if(depth>WIDGET_MAX_DEPTH||context.remaining<=0)return null;if(context.remaining-=1,input===null||typeof input!="object"||Array.isArray(input)||context.ancestors.has(input))return DOCUMENT_INVALID;const type=readDocumentField(input,"type");if(typeof type!="string")return DOCUMENT_INVALID;const id=readDocumentField(input,"id"),slot=readDocumentField(input,"slot"),actionId=readDocumentField(input,"actionId"),propsInput=readDocumentField(input,"props"),childrenInput=readDocumentField(input,"children");if([id,slot,actionId,propsInput,childrenInput].includes(DOCUMENT_INVALID)||id!==DOCUMENT_MISSING&&(typeof id!="string"||id.length===0||id!==id.trim()))return DOCUMENT_INVALID;if(typeof id=="string"){if(context.ids.has(id))return DOCUMENT_INVALID;context.ids.add(id)}if(slot!==DOCUMENT_MISSING&&(typeof slot!="string"||slot.length===0||slot!==slot.trim())||actionId!==DOCUMENT_MISSING&&(typeof actionId!="string"||actionId.length===0||actionId!==actionId.trim())||propsInput!==DOCUMENT_MISSING&&(propsInput===null||typeof propsInput!="object"||Array.isArray(propsInput))||childrenInput!==DOCUMENT_MISSING&&!Array.isArray(childrenInput))return DOCUMENT_INVALID;const props=propsInput===DOCUMENT_MISSING?void 0:snapshotDocumentProps(propsInput);if(props===DOCUMENT_INVALID)return DOCUMENT_INVALID;let payload=DOCUMENT_MISSING;if(actionId!==DOCUMENT_MISSING&&(payload=readDocumentField(input,"payload"),payload===DOCUMENT_INVALID))return DOCUMENT_INVALID;const children=[];if(childrenInput!==DOCUMENT_MISSING&&depth<WIDGET_MAX_DEPTH){const length=readDocumentField(childrenInput,"length");if(typeof length!="number"||!Number.isSafeInteger(length)||length<0)return DOCUMENT_INVALID;context.ancestors.add(input);try{for(let index=0;index<length&&context.remaining>0;index++){const child=readDocumentField(childrenInput,index);if(child===DOCUMENT_INVALID||child===DOCUMENT_MISSING)return DOCUMENT_INVALID;if(typeof child=="string"){context.remaining-=1,children.push(truncateWidgetString(child));continue}const snapshot=snapshotDocumentNode(child,depth+1,context);if(snapshot===DOCUMENT_INVALID)return DOCUMENT_INVALID;snapshot&&children.push(snapshot)}}finally{context.ancestors.delete(input)}}return Object.freeze({type,...typeof id=="string"?{id}:{},...typeof slot=="string"?{slot}:{},...typeof actionId=="string"?{actionId,payload:payload===DOCUMENT_MISSING?void 0:payload}:{},...props===void 0?{}:{props},...children.length===0?{}:{children:Object.freeze(children)}})}function createWidgetDocument(root){const snapshot=snapshotDocumentNode(root,0,{ancestors:new Set,ids:new Set,remaining:WIDGET_MAX_NODES});if(snapshot===DOCUMENT_INVALID||snapshot===null)throw new TypeError("A widget document root must be a valid bounded widget node.");return Object.freeze({version:"2",root:snapshot})}const WARNING_SUPPRESSION_KEY="__warning-cap__",INVALID=Symbol("invalid-widget-input"),ROW_COL_PROP_ENUMS={gap:["s","m","l"],align:["start","center","end","stretch"],justify:["start","center","end","between"]};function warnOnce(ctx,key,message){if(!ctx.warned.has(key)){if(ctx.warned.size>=WIDGET_MAX_WARNINGS){if(ctx.warned.has(WARNING_SUPPRESSION_KEY))return;ctx.warned.add(WARNING_SUPPRESSION_KEY),(ctx.warn??devWarn)(`[lr-widget-renderer] suppressed further diagnostics after ${WIDGET_MAX_WARNINGS} unique warnings`);return}ctx.warned.add(key),(ctx.warn??devWarn)(`[lr-widget-renderer] ${message}`)}}function capResolvedString(value,ctx,key,subject){const capped=truncateWidgetString(value);return capped.length!==value.length&&warnOnce(ctx,`__string-cap__:${key}`,`truncated ${subject} after the ${WIDGET_MAX_STRING_LENGTH}-character string cap was reached`),capped}function isBinding(value){return!!(value&&typeof value=="object"&&!Array.isArray(value)&&typeof value.$bind=="string")}function resolveValue(value,ctx){if(!isBinding(value))return{value};const resolved=readWidgetPointer(ctx.bindingState,value.$bind);return{value:resolved===void 0?value.fallback:resolved,path:value.$bind}}function consumeNodeBudget(snapshot){return snapshot.remaining<=0?(warnOnce(snapshot.resolve,"__node-cap__",`stopped resolving after the ${WIDGET_MAX_NODES}-node cap was reached`),!1):(snapshot.remaining--,!0)}function snapshotProps(input,type,ctx){const out={};let visited=0;for(const key in input){if(visited>=WIDGET_MAX_PROPS_PER_NODE){warnOnce(ctx,`__prop-cap__:${type}`,`stopped reading props on type "${type}" after the ${WIDGET_MAX_PROPS_PER_NODE}-prop cap was reached`);break}visited++,Object.hasOwn(input,key)&&(out[key]=input[key])}return out}function definitionFor(type,registry){return registry.get(type)}function snapshotNode(input,depth,snapshot){if(depth>WIDGET_MAX_DEPTH)return warnOnce(snapshot.resolve,"__depth-cap__",`stopped resolving after the ${WIDGET_MAX_DEPTH}-level depth cap was reached`),null;if(!consumeNodeBudget(snapshot))return null;if(input===null||typeof input!="object"||Array.isArray(input)||snapshot.ancestors.has(input))return INVALID;const candidate=input,type=candidate.type;if(typeof type!="string")return INVALID;if(!(type==="row"||type==="col"||type==="text")&&!definitionFor(type,snapshot.resolve.registry))return{type};const id=candidate.id;if(id!==void 0&&(typeof id!="string"||id.length===0||id!==id.trim()))return INVALID;const slot=candidate.slot;if(slot!==void 0&&(typeof slot!="string"||slot.length===0||slot!==slot.trim()))return INVALID;const actionId=candidate.actionId;if(actionId!==void 0&&(typeof actionId!="string"||actionId.length===0||actionId!==actionId.trim()))return INVALID;const propsInput=candidate.props;if(propsInput!==void 0&&(propsInput===null||typeof propsInput!="object"||Array.isArray(propsInput)))return INVALID;const childrenInput=candidate.children;if(childrenInput!==void 0&&!Array.isArray(childrenInput))return INVALID;const node={type,...id!==void 0?{id}:{},...slot!==void 0?{slot}:{},...actionId!==void 0?{actionId,payload:candidate.payload}:{},...propsInput!==void 0?{props:snapshotProps(propsInput,type,snapshot.resolve)}:{}};if(childrenInput===void 0||depth===WIDGET_MAX_DEPTH)return childrenInput&&childrenInput.length>0&&warnOnce(snapshot.resolve,"__depth-cap__",`stopped resolving after the ${WIDGET_MAX_DEPTH}-level depth cap was reached`),node;const children=[];snapshot.ancestors.add(input);try{const childCount=childrenInput.length;for(let index=0;index<childCount;index++){if(snapshot.remaining<=0){consumeNodeBudget(snapshot);break}const child=childrenInput[index];if(typeof child=="string"){if(!consumeNodeBudget(snapshot))break;children.push(child);continue}const accepted=snapshotNode(child,depth+1,snapshot);if(accepted===INVALID)return INVALID;accepted&&children.push(accepted)}}finally{snapshot.ancestors.delete(input)}return children.length>0?{...node,children}:node}function filterRowColProps(props){const out={};if(!props)return out;for(const[key,allowed]of Object.entries(ROW_COL_PROP_ENUMS)){const value=props[key];typeof value=="string"&&allowed.includes(value)&&(out[key]=value)}return out}function filterMappedProps(props,def,ctx,type){const out={},bindings=[],allowlist=def.props??{};if(props)for(const[key,rawValue]of Object.entries(props)){const expectedType=allowlist[key],{value,path}=resolveValue(rawValue,ctx);if(expectedType===void 0||typeof value!==expectedType){warnOnce(ctx,`${type}:${key}`,`skipped disallowed or mistyped prop "${key}" on type "${type}"`);continue}out[key]=typeof value=="string"?capResolvedString(value,ctx,`${type}:${key}`,`string prop "${key}" on type "${type}"`):value,path&&bindings.push({prop:key,path,event:def.bindings?.[key]?.event})}return{props:{...out,...def.forcedProps??{}},bindings}}function containsInteractive(node){return node.kind==="text"?!1:node.interactive||node.children.some(containsInteractive)}function resolveChild(value,ctx,path){return typeof value=="string"?{nodeKey:`path:${path}`,nodePath:path,kind:"text",text:capResolvedString(value,ctx,"__text__","a text child")}:resolveNode(value,ctx,path)}function resolveNode(node,ctx,path){const authoredId=node.id,nodeKey=authoredId?`id:${authoredId}`:`path:${path}`;let kind,tag,interactive=!1,props,actionEvent,bindings=[],slots=[];if(node.type==="row"||node.type==="col")kind=node.type==="row"?"builtin-row":"builtin-col",props=filterRowColProps(node.props);else if(node.type==="text"){kind="builtin-text";const resolved=resolveValue(node.props?.value,ctx);if(props=typeof resolved.value=="string"||typeof resolved.value=="number"?{value:capResolvedString(String(resolved.value),ctx,"__text-value__",'the "value" of a built-in text node')}:{},resolved.path){if(!authoredId)throw warnOnce(ctx,`__required-id__:${path}`,"rejected bound text without a stable id"),new TypeError("A bound widget node requires a stable id.");bindings=[{prop:"value",path:resolved.path}]}}else{const def=definitionFor(node.type,ctx.registry);if(!def)return warnOnce(ctx,node.type,`skipped unknown widget type "${node.type}" (and its subtree)`),null;kind="mapped",tag=def.tag,interactive=def.interaction==="control";const filtered=filterMappedProps(node.props,def,ctx,node.type);if(props=filtered.props,bindings=filtered.bindings,slots=def.slots??[],node.actionId!==void 0&&def.action&&(actionEvent=def.action.event),(actionEvent||bindings.length>0)&&!authoredId)throw warnOnce(ctx,`__required-id__:${path}`,`rejected stateful or actionable type "${node.type}" without a stable id`),new TypeError("A stateful or actionable widget node requires a stable id.")}const children=[];for(let index=0;index<(node.children?.length??0);index++){const resolvedChild=resolveChild(node.children[index],ctx,`${path}.${index}`);if(resolvedChild){if(interactive&&containsInteractive(resolvedChild)){warnOnce(ctx,`__nested-interactive__:${node.type}`,`skipped a control descendant inside control type "${node.type}"`);continue}resolvedChild.slot!==void 0&&!slots.includes(resolvedChild.slot)&&(resolvedChild.slot=void 0),children.push(resolvedChild)}}return{nodeId:authoredId,nodeKey,nodePath:path,kind,tag,interactive,props,actionEvent,actionId:actionEvent?node.actionId:void 0,payload:actionEvent?node.payload:void 0,bindings,children,slot:node.slot}}function hasDuplicateAuthoredIds(root,ctx){const counts=new Map,pending=[root];for(;pending.length>0;){const node=pending.pop();node.id&&counts.set(node.id,(counts.get(node.id)??0)+1);for(const child of node.children??[])typeof child!="string"&&pending.push(child)}let duplicate=!1;for(const[id,count]of counts)count<2||(duplicate=!0,warnOnce(ctx,`__duplicate-id__:${id}`,`rejected duplicate widget id "${id}"`));return duplicate}function resolveTree(root,ctx){if(root==null)return null;if(!isWidgetTypeRegistry(ctx.registry))throw new TypeError("A widget renderer registry must be created with createWidgetTypeRegistry().");const snapshot=snapshotNode(root,0,{resolve:ctx,ancestors:new Set,remaining:WIDGET_MAX_NODES});return snapshot===INVALID||snapshot===null||hasDuplicateAuthoredIds(snapshot,ctx)?null:resolveNode(snapshot,ctx,"0")}export{WIDGET_MAX_STRING_LENGTH,createWidgetDocument,resolveTree};
@@ -1,4 +1,4 @@
1
- import{type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraDatePickerFirstDayOfWeek}from'../../forms/date-picker/date-picker.class.js';export interface CalendarEvent{readonly id?:string;readonly date:string;readonly title:string;readonly color?:string;readonly data?:unknown;}export interface LyraCalendarEventMap{'lr-date-select':CustomEvent<{date:string;}>;'lr-event-select':CustomEvent<{event:CalendarEvent;}>;'lr-view-change':CustomEvent<{viewDate:string;}>;}
1
+ import{type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraDatePickerFirstDayOfWeek}from'../../forms/date-picker/date-picker.class.js';export interface CalendarEvent{readonly id?:string;readonly date:string|number|Date;readonly title:string;readonly color?:string;readonly data?:unknown;}export interface LyraCalendarEventMap{'lr-date-select':CustomEvent<{date:string;}>;'lr-event-select':CustomEvent<{event:CalendarEvent;}>;'lr-view-change':CustomEvent<{viewDate:string;}>;}
2
2
  /** The two display modes `view` accepts. */
3
3
  export type CalendarView='month'|'agenda';
4
4
  /** The shared closed weekday vocabulary `lr-date-picker`/`lr-date-input` already accept
@@ -9,10 +9,15 @@ export type LyraCalendarFirstDayOfWeek=LyraDatePickerFirstDayOfWeek;
9
9
  *
10
10
  * Month-view event markers are real buttons inside each focusable gridcell, so
11
11
  * keyboard users can activate individual events without switching views.
12
- * Agenda view renders the same events as full-width buttons.
12
+ * Agenda view renders the same events as full-width buttons. Early ISO dates retain their
13
+ * authored local year in month rendering and navigation. Colored agenda actions keep their
14
+ * foreground/background pairing during hover and press; callers remain responsible for choosing
15
+ * accessible custom event colors.
13
16
  *
14
- * Public collection properties take bounded, clone-owned readonly snapshots. Create a new
15
- * collection and reassign it after changes; mutating the assigned array does not update the view.
17
+ * Public collection properties take bounded, detached readonly sequences. Calendar-only fields
18
+ * are projected from own data descriptors once per assignment; `lr-event-select` retains the
19
+ * caller's original event identity. Create a new collection and reassign it after changes;
20
+ * mutating the assigned array does not update the view.
16
21
  *
17
22
  * `firstDayOfWeek` defaults to `'auto'`, deriving the week start from `effectiveLocale` (via the
18
23
  * shared `resolveFirstDayOfWeek()` contract also used by `lr-date-picker`/`lr-date-input`), and
@@ -39,6 +44,12 @@ export type LyraCalendarFirstDayOfWeek=LyraDatePickerFirstDayOfWeek;
39
44
  * @csspart event - Event marker.
40
45
  * @csspart agenda - Agenda list.
41
46
  * @csspart agenda-event - One focusable event button in agenda view (`view="agenda"` only).
47
+ * @cssprop [--lr-calendar-nav-hover-bg=var(--lr-color-brand-quiet)] - Month-navigation hover background.
48
+ * @cssprop [--lr-calendar-nav-active-bg=color-mix(in oklab, var(--lr-calendar-nav-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active))] - Month-navigation pressed background.
49
+ * @cssprop [--lr-calendar-day-hover-bg=var(--lr-color-brand-quiet)] - Day hover background.
50
+ * @cssprop [--lr-calendar-day-active-bg=color-mix(in oklab, var(--lr-calendar-day-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active))] - Day pressed background.
51
+ * @cssprop [--lr-calendar-agenda-event-hover-bg=var(--lr-color-brand-quiet)] - Agenda-event hover background override; without one, colored events retain their event fill.
52
+ * @cssprop [--lr-calendar-agenda-event-active-bg=color-mix(in oklab, var(--lr-calendar-agenda-event-hover-bg, var(--lr-color-brand-quiet)), var(--lr-color-mix-partner) var(--lr-color-mix-active))] - Agenda-event pressed background override; without one, colored events retain their event fill.
42
53
  * @cssprop [--lr-calendar-day-min-block-size=var(--lr-size-6rem)] - Minimum block size of a day cell.
43
54
  * @cssprop [--lr-calendar-day-min-block-size-narrow=var(--lr-size-4rem)] - Minimum block size of a day cell once the host is narrower than 28rem.
44
55
  * @cssprop [--lr-calendar-day-selected-bg=var(--lr-color-brand-quiet)] - Background of a selected day cell, decoupled from the shared token also driving the nav-button/agenda-event hover background.
@@ -59,7 +70,7 @@ protected static readonly identityCollectionProperties:readonly string[];static
59
70
  * `resolveFirstDayOfWeek()` contract, which derives `'auto'` from `effectiveLocale` and falls
60
71
  * back to Sunday (0) for anything else. */
61
72
  private get normalizedFirstDayOfWeek();private changeMonth;private selectDate;
62
- /** Invalid rows are omitted without cloning so `lr-event-select` retains caller identity. */
73
+ /** Invalid rows are omitted; all later rendering uses the descriptor-safe projection. */
63
74
  private get effectiveEvents();
64
75
  /** `events` bucketed by ISO date, built once per render — the month grid reads events for each of its 42 day cells and re-renders on every roving-focus arrow-key move, so a per-cell linear scan of `events` would cost O(cells × events) per keystroke. */
65
76
  private bucketEventsByDate;private weeks;