@heartlandone/vega 2.94.0 → 2.96.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 (381) hide show
  1. package/dist/cjs/{app-globals-d05c3410.js → app-globals-38afea36.js} +7 -7
  2. package/dist/cjs/{child-nodes-event-prevent-slimmer-e67ee84c.js → child-nodes-event-prevent-slimmer-e0ac8467.js} +1 -1
  3. package/dist/cjs/{code-block-493c7ce7.js → code-block-4126dc3b.js} +1501 -55
  4. package/dist/cjs/{component-value-history-controller-slimmer.abstract-ab21fcbf.js → component-value-history-controller-slimmer.abstract-38ba956e.js} +2 -2
  5. package/dist/cjs/{content-state-fc34a814.js → content-state-50e8a03c.js} +142 -580
  6. package/dist/cjs/{element-appender-slimmer-1d6323c2.js → element-appender-slimmer-7773fdab.js} +115 -0
  7. package/dist/cjs/{event-emit-slimmer-d234a619.js → event-emit-slimmer-34aa195e.js} +1 -1
  8. package/dist/cjs/{image-annotation-action-7c4cd316.js → image-annotation-action-89363de8.js} +2 -2
  9. package/dist/cjs/{image-extension-30a7c10f.js → image-extension-c881c454.js} +2 -2
  10. package/dist/cjs/index.cjs.js +11 -11
  11. package/dist/cjs/{internal-vega-event-manager-13c4012b.js → internal-vega-event-manager-7003c84a.js} +10 -2
  12. package/dist/cjs/{link-extension-92a63cb7.js → link-extension-b7f99a52.js} +2 -2
  13. package/dist/cjs/loader.cjs.js +9 -9
  14. package/dist/cjs/{public-rules-9e1ea1d9.js → public-rules-72894208.js} +3 -3
  15. package/dist/cjs/{range-30219330.js → range-95d41dea.js} +1 -1
  16. package/dist/cjs/{rich-text-editor-required-rule-23bf7485.js → rich-text-editor-required-rule-4d6d2493.js} +1 -1
  17. package/dist/cjs/shared-backdrop-manager-71e54fdb.js +199 -0
  18. package/dist/cjs/{split-cell-operation-43752212.js → split-cell-operation-70be116d.js} +2 -2
  19. package/dist/cjs/{token-extension-ea891d54.js → token-extension-eb828948.js} +36 -12
  20. package/dist/cjs/vega-accordion.cjs.entry.js +2 -2
  21. package/dist/cjs/vega-app-footer.cjs.entry.js +2 -2
  22. package/dist/cjs/vega-app-header-button.cjs.entry.js +3 -3
  23. package/dist/cjs/vega-banner.cjs.entry.js +2 -2
  24. package/dist/cjs/vega-breadcrumb.cjs.entry.js +3 -3
  25. package/dist/cjs/vega-button-circle.cjs.entry.js +3 -3
  26. package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
  27. package/dist/cjs/vega-button-link.cjs.entry.js +3 -3
  28. package/dist/cjs/vega-button.cjs.entry.js +3 -3
  29. package/dist/cjs/vega-calendar_5.cjs.entry.js +3 -3
  30. package/dist/cjs/vega-carousel.cjs.entry.js +2 -2
  31. package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
  32. package/dist/cjs/vega-chip.cjs.entry.js +3 -3
  33. package/dist/cjs/vega-code-block.cjs.entry.js +6 -6
  34. package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
  35. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
  36. package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
  37. package/dist/cjs/vega-combo-box.cjs.entry.js +22 -4
  38. package/dist/cjs/vega-date-picker_2.cjs.entry.js +4 -4
  39. package/dist/cjs/vega-dialog_2.cjs.entry.js +160 -70
  40. package/dist/cjs/vega-dropdown_5.cjs.entry.js +41 -13
  41. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  42. package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
  43. package/dist/cjs/vega-file-uploader.cjs.entry.js +2 -2
  44. package/dist/cjs/vega-form.cjs.entry.js +3 -3
  45. package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -3
  46. package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
  47. package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -3
  48. package/dist/cjs/vega-input-passcode.cjs.entry.js +3 -3
  49. package/dist/cjs/vega-input-phone-number.cjs.entry.js +3 -3
  50. package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
  51. package/dist/cjs/vega-input-select.cjs.entry.js +54 -5
  52. package/dist/cjs/vega-input.cjs.entry.js +2 -2
  53. package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -2
  54. package/dist/cjs/vega-left-nav_5.cjs.entry.js +32 -193
  55. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +2 -2
  56. package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
  57. package/dist/cjs/vega-popover_2.cjs.entry.js +3 -3
  58. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +13 -3
  59. package/dist/cjs/vega-radio_2.cjs.entry.js +3 -3
  60. package/dist/cjs/vega-rich-text-content.cjs.entry.js +58 -9
  61. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +611 -93
  62. package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +2 -2
  63. package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +2 -2
  64. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +5 -5
  65. package/dist/cjs/vega-section-title.cjs.entry.js +896 -14
  66. package/dist/cjs/vega-segment-control.cjs.entry.js +2 -2
  67. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +3 -3
  68. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +3 -3
  69. package/dist/cjs/vega-sidenav_3.cjs.entry.js +2 -2
  70. package/dist/cjs/vega-signature-capture.cjs.entry.js +2 -2
  71. package/dist/cjs/vega-stepper.cjs.entry.js +3 -3
  72. package/dist/cjs/vega-tab-group_2.cjs.entry.js +3 -3
  73. package/dist/cjs/vega-table_11.cjs.entry.js +3 -3
  74. package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
  75. package/dist/cjs/vega-time-picker_2.cjs.entry.js +4 -4
  76. package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
  77. package/dist/cjs/vega-tooltip_2.cjs.entry.js +1 -1
  78. package/dist/cjs/vega.cjs.js +9 -9
  79. package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +5 -1
  80. package/dist/collection/components/vega-combo-box/vega-combo-box.js +52 -1
  81. package/dist/collection/components/vega-dialog/vega-dialog.js +1 -1
  82. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-render-mode-controller.js +7 -6
  83. package/dist/collection/components/vega-dropdown/vega-dropdown.js +36 -8
  84. package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-dropdown-controller.js +11 -1
  85. package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-items-slot-controler.js +23 -2
  86. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +4 -0
  87. package/dist/collection/components/vega-input-select/vega-input-select.js +53 -2
  88. package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-backdrop-manager.js +141 -0
  89. package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.js +10 -17
  90. package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-z-index-controller.js +2 -2
  91. package/dist/collection/components/vega-modal/slimmers/renderers/vega-modal-renderer.js +3 -2
  92. package/dist/collection/components/vega-modal/vega-modal.js +77 -8
  93. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +7 -0
  94. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +6 -0
  95. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +4 -0
  96. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +29 -0
  97. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.js +10 -1
  98. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy.js +8 -3
  99. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-annotation-strategy.abstract.js +60 -0
  100. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.js +36 -4
  101. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-items-strategy.abstract.js +27 -0
  102. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-nest-items-strategy.js +74 -0
  103. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.js +81 -1
  104. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.js +30 -0
  105. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.js +160 -9
  106. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +376 -10
  107. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-unnest-items-strategy.js +104 -0
  108. package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +2 -0
  109. package/dist/collection/components/vega-rich-text-editor/dto/actions/nest-list-items-action.js +12 -0
  110. package/dist/collection/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.js +12 -0
  111. package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +12 -0
  112. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +10 -1
  113. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +11 -3
  114. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +7 -1
  115. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +8 -4
  116. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +34 -1
  117. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +20 -3
  118. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.js +25 -1
  119. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +2 -0
  120. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.js +29 -0
  121. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +30 -1
  122. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/abstract-list-keyboard-handler.js +204 -0
  123. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-shift-tab-outdent-handler.js +42 -0
  124. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-tab-indent-handler.js +34 -0
  125. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/list-keyboard-slimmer.js +180 -0
  126. package/dist/collection/components/vega-section-title/slimmers/a11y-tree/build-section-title-a11y-tree.js +54 -0
  127. package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +4 -4
  128. package/dist/collection/components/vega-section-title/vega-section-title.js +18 -2
  129. package/dist/collection/helpers/a11y-tree/a11y-node-dto.js +210 -0
  130. package/dist/collection/helpers/a11y-tree/a11y-tree-applier.js +189 -0
  131. package/dist/collection/helpers/a11y-tree/a11y-tree.types.js +48 -0
  132. package/dist/collection/helpers/a11y-tree/strategies/baseline-strategy.js +78 -0
  133. package/dist/collection/helpers/a11y-tree/strategies/firefox-nvda-strategy.js +56 -0
  134. package/dist/collection/helpers/a11y-tree/strategies/webkit-voiceover-strategy.js +140 -0
  135. package/dist/collection/helpers/a11y-tree/strategy-resolver.js +172 -0
  136. package/dist/collection/helpers/backdrop/shared-backdrop-manager.js +32 -1
  137. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +11 -3
  138. package/dist/collection/helpers/slimmers/a11y-tree-slimmer.js +54 -0
  139. package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +29 -0
  140. package/dist/collection/helpers/slimmers/element-appender/visibility-modifiers/clip-on-scroll-modifier.js +70 -0
  141. package/dist/collection/helpers/slimmers/element-appender/visibility-modifiers/visibility-modifier.interface.js +1 -0
  142. package/dist/collection/helpers/ui/element-appender.js +16 -0
  143. package/dist/esm/{app-globals-f2336686.js → app-globals-d7b651c1.js} +7 -7
  144. package/dist/esm/{child-nodes-event-prevent-slimmer-96c14f5a.js → child-nodes-event-prevent-slimmer-82626871.js} +1 -1
  145. package/dist/esm/{code-block-e12588fe.js → code-block-0a88b481.js} +1495 -51
  146. package/dist/esm/{component-value-history-controller-slimmer.abstract-4e8eb313.js → component-value-history-controller-slimmer.abstract-6846edfa.js} +2 -2
  147. package/dist/esm/{content-state-8032467a.js → content-state-79ca99e5.js} +105 -541
  148. package/dist/esm/{element-appender-slimmer-7fcb944b.js → element-appender-slimmer-73ad10ae.js} +115 -0
  149. package/dist/esm/{event-emit-slimmer-db4a82e0.js → event-emit-slimmer-2452278f.js} +1 -1
  150. package/dist/esm/{image-annotation-action-b3b6c308.js → image-annotation-action-bb299ef1.js} +3 -3
  151. package/dist/esm/{image-extension-b6c7e4a7.js → image-extension-48a96f98.js} +2 -2
  152. package/dist/esm/index.js +10 -10
  153. package/dist/esm/{internal-vega-event-manager-48690e5b.js → internal-vega-event-manager-2ecc9186.js} +11 -3
  154. package/dist/esm/{link-extension-97fcb8fb.js → link-extension-09534514.js} +2 -2
  155. package/dist/esm/loader.js +10 -10
  156. package/dist/esm/{public-rules-c06f0d2a.js → public-rules-5eb03ef0.js} +3 -3
  157. package/dist/esm/{range-e999837f.js → range-d4deb7df.js} +1 -1
  158. package/dist/esm/{rich-text-editor-required-rule-71f8ee98.js → rich-text-editor-required-rule-5bbbce23.js} +1 -1
  159. package/dist/esm/shared-backdrop-manager-a7c63838.js +197 -0
  160. package/dist/esm/{split-cell-operation-359f8082.js → split-cell-operation-7f3058ad.js} +2 -2
  161. package/dist/esm/{token-extension-9896879b.js → token-extension-40c32bcc.js} +32 -8
  162. package/dist/esm/vega-accordion.entry.js +3 -3
  163. package/dist/esm/vega-app-footer.entry.js +3 -3
  164. package/dist/esm/vega-app-header-button.entry.js +4 -4
  165. package/dist/esm/vega-banner.entry.js +3 -3
  166. package/dist/esm/vega-breadcrumb.entry.js +4 -4
  167. package/dist/esm/vega-button-circle.entry.js +4 -4
  168. package/dist/esm/vega-button-group_2.entry.js +4 -4
  169. package/dist/esm/vega-button-link.entry.js +4 -4
  170. package/dist/esm/vega-button.entry.js +4 -4
  171. package/dist/esm/vega-calendar_5.entry.js +4 -4
  172. package/dist/esm/vega-carousel.entry.js +3 -3
  173. package/dist/esm/vega-checkbox_2.entry.js +4 -4
  174. package/dist/esm/vega-chip.entry.js +4 -4
  175. package/dist/esm/vega-code-block.entry.js +7 -7
  176. package/dist/esm/vega-color-picker.entry.js +3 -3
  177. package/dist/esm/vega-color-swatch-picker.entry.js +4 -4
  178. package/dist/esm/vega-color-swatch.entry.js +3 -3
  179. package/dist/esm/vega-combo-box.entry.js +23 -5
  180. package/dist/esm/vega-date-picker_2.entry.js +5 -5
  181. package/dist/esm/vega-dialog_2.entry.js +161 -71
  182. package/dist/esm/vega-dropdown_5.entry.js +42 -14
  183. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  184. package/dist/esm/{vega-event-id-270fe47e.js → vega-event-id-f55f6977.js} +1 -1
  185. package/dist/esm/vega-field-label.entry.js +3 -3
  186. package/dist/esm/vega-file-uploader.entry.js +3 -3
  187. package/dist/esm/vega-form.entry.js +4 -4
  188. package/dist/esm/vega-image-uploader.entry.js +4 -4
  189. package/dist/esm/vega-input-credit-card.entry.js +4 -4
  190. package/dist/esm/vega-input-numeric.entry.js +4 -4
  191. package/dist/esm/vega-input-passcode.entry.js +4 -4
  192. package/dist/esm/vega-input-phone-number.entry.js +4 -4
  193. package/dist/esm/vega-input-range.entry.js +4 -4
  194. package/dist/esm/vega-input-select.entry.js +55 -6
  195. package/dist/esm/vega-input.entry.js +3 -3
  196. package/dist/esm/vega-item-toggle.entry.js +3 -3
  197. package/dist/esm/vega-left-nav_5.entry.js +32 -193
  198. package/dist/esm/vega-page-notification_2.entry.js +1 -1
  199. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -3
  200. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
  201. package/dist/esm/vega-pagination.entry.js +4 -4
  202. package/dist/esm/vega-popover_2.entry.js +4 -4
  203. package/dist/esm/vega-progress-tracker_2.entry.js +14 -4
  204. package/dist/esm/vega-radio_2.entry.js +4 -4
  205. package/dist/esm/vega-rich-text-content.entry.js +59 -10
  206. package/dist/esm/vega-rich-text-editor_4.entry.js +608 -90
  207. package/dist/esm/vega-rich-text-find-replace-panel.entry.js +3 -3
  208. package/dist/esm/vega-rich-text-special-characters-panel.entry.js +3 -3
  209. package/dist/esm/vega-rich-text-table-properties_3.entry.js +6 -6
  210. package/dist/esm/vega-section-title.entry.js +897 -15
  211. package/dist/esm/vega-segment-control.entry.js +3 -3
  212. package/dist/esm/vega-selection-chip_2.entry.js +4 -4
  213. package/dist/esm/vega-selection-tile_2.entry.js +4 -4
  214. package/dist/esm/vega-sidenav_3.entry.js +3 -3
  215. package/dist/esm/vega-signature-capture.entry.js +3 -3
  216. package/dist/esm/vega-stepper.entry.js +4 -4
  217. package/dist/esm/vega-tab-group_2.entry.js +4 -4
  218. package/dist/esm/vega-table_11.entry.js +4 -4
  219. package/dist/esm/vega-textarea.entry.js +4 -4
  220. package/dist/esm/vega-time-picker_2.entry.js +5 -5
  221. package/dist/esm/vega-toggle-switch.entry.js +3 -3
  222. package/dist/esm/vega-tooltip_2.entry.js +1 -1
  223. package/dist/esm/vega.js +10 -10
  224. package/dist/sri/vega-sri-manifest.json +272 -268
  225. package/dist/types/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.d.ts +1 -0
  226. package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +21 -0
  227. package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-render-mode-controller.d.ts +2 -1
  228. package/dist/types/components/vega-dropdown/types.d.ts +2 -2
  229. package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +36 -9
  230. package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-dropdown-controller.d.ts +2 -0
  231. package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-items-slot-controler.d.ts +10 -0
  232. package/dist/types/components/vega-input-select/types.d.ts +1 -0
  233. package/dist/types/components/vega-input-select/vega-input-select.d.ts +21 -0
  234. package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-backdrop-manager.d.ts +66 -0
  235. package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.d.ts +1 -5
  236. package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-z-index-controller.d.ts +1 -1
  237. package/dist/types/components/vega-modal/slimmers/renderers/vega-modal-renderer.d.ts +1 -1
  238. package/dist/types/components/vega-modal/vega-modal.d.ts +34 -6
  239. package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.d.ts +2 -0
  240. package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +1 -0
  241. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-annotation-strategy.abstract.d.ts +36 -0
  242. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.d.ts +14 -2
  243. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-items-strategy.abstract.d.ts +22 -0
  244. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-nest-items-strategy.d.ts +21 -0
  245. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.d.ts +14 -0
  246. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.d.ts +15 -0
  247. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.d.ts +30 -3
  248. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.d.ts +99 -3
  249. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-unnest-items-strategy.d.ts +22 -0
  250. package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -0
  251. package/dist/types/components/vega-rich-text-editor/dto/actions/nest-list-items-action.d.ts +11 -0
  252. package/dist/types/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.d.ts +11 -0
  253. package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +8 -0
  254. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +6 -1
  255. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +5 -1
  256. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +2 -2
  257. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +2 -0
  258. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.d.ts +8 -0
  259. package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.d.ts +18 -0
  260. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +8 -0
  261. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/abstract-list-keyboard-handler.d.ts +99 -0
  262. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-shift-tab-outdent-handler.d.ts +15 -0
  263. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-tab-indent-handler.d.ts +15 -0
  264. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/list-keyboard-slimmer.d.ts +73 -0
  265. package/dist/types/components/vega-section-title/slimmers/a11y-tree/build-section-title-a11y-tree.d.ts +41 -0
  266. package/dist/types/components/vega-section-title/vega-section-title.d.ts +9 -0
  267. package/dist/types/components.d.ts +42 -8
  268. package/dist/types/helpers/a11y-tree/a11y-node-dto.d.ts +173 -0
  269. package/dist/types/helpers/a11y-tree/a11y-tree-applier.d.ts +28 -0
  270. package/dist/types/helpers/a11y-tree/a11y-tree.types.d.ts +137 -0
  271. package/dist/types/helpers/a11y-tree/strategies/baseline-strategy.d.ts +18 -0
  272. package/dist/types/helpers/a11y-tree/strategies/firefox-nvda-strategy.d.ts +16 -0
  273. package/dist/types/helpers/a11y-tree/strategies/webkit-voiceover-strategy.d.ts +23 -0
  274. package/dist/types/helpers/a11y-tree/strategy-resolver.d.ts +59 -0
  275. package/dist/types/helpers/backdrop/shared-backdrop-manager.d.ts +16 -0
  276. package/dist/types/helpers/slimmers/a11y-tree-slimmer.d.ts +49 -0
  277. package/dist/types/helpers/slimmers/element-appender/element-appender-slimmer.d.ts +9 -0
  278. package/dist/types/helpers/slimmers/element-appender/visibility-modifiers/clip-on-scroll-modifier.d.ts +37 -0
  279. package/dist/types/helpers/slimmers/element-appender/visibility-modifiers/visibility-modifier.interface.d.ts +56 -0
  280. package/dist/types/helpers/ui/element-appender.d.ts +7 -0
  281. package/dist/vega/index.esm.js +1 -1
  282. package/dist/vega/{p-3e8baeac.entry.js → p-0512308f.entry.js} +1 -1
  283. package/dist/vega/{p-46fe3154.entry.js → p-1d8312d3.entry.js} +1 -1
  284. package/dist/vega/{p-f5d7b89f.entry.js → p-1dfbc542.entry.js} +1 -1
  285. package/dist/vega/{p-fbd3be00.entry.js → p-200c8914.entry.js} +1 -1
  286. package/dist/vega/{p-e235020b.entry.js → p-22cc174e.entry.js} +1 -1
  287. package/dist/vega/{p-b1ff70bf.js → p-2c737fc8.js} +1 -1
  288. package/dist/vega/{p-782eb312.entry.js → p-2d77ae73.entry.js} +1 -1
  289. package/dist/vega/{p-cb90163a.entry.js → p-2d8d4d5b.entry.js} +1 -1
  290. package/dist/vega/{p-f651df3b.entry.js → p-2df5d59b.entry.js} +1 -1
  291. package/dist/vega/p-31216140.js +1 -0
  292. package/dist/vega/{p-f7e459cd.js → p-312d8205.js} +1 -1
  293. package/dist/vega/{p-a7209700.js → p-3345d903.js} +1 -1
  294. package/dist/vega/{p-44439ecc.entry.js → p-36d2df7a.entry.js} +1 -1
  295. package/dist/vega/{p-02355de8.js → p-3c23ec90.js} +1 -1
  296. package/dist/vega/{p-2bf17505.entry.js → p-3d6f761a.entry.js} +1 -1
  297. package/dist/vega/p-4151f53a.entry.js +1 -0
  298. package/dist/vega/{p-a057285e.entry.js → p-49e1cf4d.entry.js} +1 -1
  299. package/dist/vega/{p-698fbd73.js → p-5447a8e8.js} +1 -1
  300. package/dist/vega/p-55e0014a.js +3 -0
  301. package/dist/vega/{p-45e8424a.entry.js → p-56d19601.entry.js} +1 -1
  302. package/dist/vega/{p-addbca58.entry.js → p-5924adae.entry.js} +1 -1
  303. package/dist/vega/{p-9dca874d.entry.js → p-5e4517eb.entry.js} +1 -1
  304. package/dist/vega/p-5f377954.js +1 -1
  305. package/dist/vega/p-65fee02f.entry.js +1 -0
  306. package/dist/vega/{p-140616fe.js → p-66647244.js} +1 -1
  307. package/dist/vega/{p-62d6e063.entry.js → p-6680ba17.entry.js} +1 -1
  308. package/dist/vega/p-6a51d720.js +1 -0
  309. package/dist/vega/{p-fe24b459.js → p-6c7b6d45.js} +1 -1
  310. package/dist/vega/{p-288d65ad.entry.js → p-6fcec7c7.entry.js} +1 -1
  311. package/dist/vega/{p-d08ffdf1.entry.js → p-74f86ff9.entry.js} +1 -1
  312. package/dist/vega/{p-6ad7144a.entry.js → p-775ecfad.entry.js} +1 -1
  313. package/dist/vega/{p-6f70a10f.entry.js → p-7950f3e2.entry.js} +1 -1
  314. package/dist/vega/{p-f246f125.entry.js → p-80b7945a.entry.js} +1 -1
  315. package/dist/vega/p-8354cff0.entry.js +1 -0
  316. package/dist/vega/{p-5db61a12.entry.js → p-841b3281.entry.js} +1 -1
  317. package/dist/vega/{p-579cdeae.js → p-84b7a775.js} +1 -1
  318. package/dist/vega/p-87e5cb56.entry.js +1 -0
  319. package/dist/vega/p-8c30a60d.js +1 -0
  320. package/dist/vega/{p-f8a29127.entry.js → p-8d96f0e8.entry.js} +1 -1
  321. package/dist/vega/{p-95913e3c.entry.js → p-91303402.entry.js} +1 -1
  322. package/dist/vega/p-96da7d30.entry.js +1 -0
  323. package/dist/vega/{p-51b68d25.js → p-9d3f69cb.js} +1 -1
  324. package/dist/vega/{p-ed103a1a.entry.js → p-9d96d83f.entry.js} +1 -1
  325. package/dist/vega/{p-6dfe2407.js → p-9f11b579.js} +1 -1
  326. package/dist/vega/p-9f201152.entry.js +1 -0
  327. package/dist/vega/{p-48ee3e24.entry.js → p-a775825e.entry.js} +1 -1
  328. package/dist/vega/{p-9d18ba7f.entry.js → p-acaff62d.entry.js} +1 -1
  329. package/dist/vega/{p-b8f8e480.entry.js → p-ae146458.entry.js} +1 -1
  330. package/dist/vega/{p-e8ee70c5.entry.js → p-b3a2ce06.entry.js} +1 -1
  331. package/dist/vega/{p-5107277d.entry.js → p-b4c26035.entry.js} +1 -1
  332. package/dist/vega/p-b63319e9.entry.js +1 -0
  333. package/dist/vega/{p-c9daabe1.entry.js → p-b660f38c.entry.js} +1 -1
  334. package/dist/vega/{p-8c083255.entry.js → p-b8c13ac9.entry.js} +1 -1
  335. package/dist/vega/p-b8ffa42f.entry.js +1 -0
  336. package/dist/vega/{p-7b57a845.entry.js → p-b9e72de2.entry.js} +1 -1
  337. package/dist/vega/{p-0af32f31.entry.js → p-bb60e381.entry.js} +1 -1
  338. package/dist/vega/p-bbad318e.entry.js +1 -0
  339. package/dist/vega/p-c0e42c03.entry.js +1 -0
  340. package/dist/vega/{p-c67b9aba.entry.js → p-c41f5684.entry.js} +1 -1
  341. package/dist/vega/{p-4fe40b76.js → p-c4564904.js} +1 -1
  342. package/dist/vega/{p-341a6b32.entry.js → p-c54b5a8f.entry.js} +1 -1
  343. package/dist/vega/p-cd1e976c.entry.js +1 -0
  344. package/dist/vega/p-d9158512.js +1 -0
  345. package/dist/vega/{p-2dc5edd0.entry.js → p-db11134b.entry.js} +1 -1
  346. package/dist/vega/{p-14559974.entry.js → p-e1737c8e.entry.js} +1 -1
  347. package/dist/vega/{p-0b311599.entry.js → p-e1b57e8f.entry.js} +1 -1
  348. package/dist/vega/{p-9f38448c.entry.js → p-e5ff77f7.entry.js} +1 -1
  349. package/dist/vega/p-e62d41ee.js +1 -0
  350. package/dist/vega/{p-6f01a71a.entry.js → p-ebe32b25.entry.js} +1 -1
  351. package/dist/vega/p-ec162599.entry.js +1 -0
  352. package/dist/vega/{p-9f7154d2.js → p-ec5dee32.js} +1 -1
  353. package/dist/vega/{p-d3a36d19.entry.js → p-ec64cc59.entry.js} +1 -1
  354. package/dist/vega/p-f29d9707.entry.js +1 -0
  355. package/dist/vega/{p-5df2d6a1.entry.js → p-f78944d7.entry.js} +1 -1
  356. package/dist/vega/{p-c9c6daa6.entry.js → p-f9bfee81.entry.js} +1 -1
  357. package/dist/vega/{p-26c7fe8b.entry.js → p-fa65956c.entry.js} +1 -1
  358. package/dist/vega/{p-f96d0503.entry.js → p-fc7e4c8a.entry.js} +1 -1
  359. package/dist/vega/{p-b39d4a88.entry.js → p-fd23c365.entry.js} +1 -1
  360. package/dist/vega/vega.esm.js +1 -1
  361. package/package.json +3 -2
  362. package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-backdrop-controller.js +0 -73
  363. package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-backdrop-controller.d.ts +0 -27
  364. package/dist/vega/p-0b9c7c79.entry.js +0 -1
  365. package/dist/vega/p-0be4df0a.js +0 -1
  366. package/dist/vega/p-2364be92.entry.js +0 -1
  367. package/dist/vega/p-270697c0.entry.js +0 -1
  368. package/dist/vega/p-282b37cb.js +0 -1
  369. package/dist/vega/p-38c9d782.js +0 -1
  370. package/dist/vega/p-52c6a399.entry.js +0 -1
  371. package/dist/vega/p-73f2c3c0.entry.js +0 -1
  372. package/dist/vega/p-762ea523.entry.js +0 -1
  373. package/dist/vega/p-7a88a3d3.entry.js +0 -1
  374. package/dist/vega/p-83a16285.entry.js +0 -1
  375. package/dist/vega/p-91287214.entry.js +0 -1
  376. package/dist/vega/p-c66d2a1e.js +0 -1
  377. package/dist/vega/p-cad5222a.entry.js +0 -1
  378. package/dist/vega/p-d25ca0c3.entry.js +0 -1
  379. package/dist/vega/p-f05a193e.entry.js +0 -1
  380. package/dist/vega/p-f4da615a.js +0 -3
  381. package/dist/vega/p-f906a7bc.entry.js +0 -1
@@ -0,0 +1,189 @@
1
+ import { resolveStrategy } from './strategy-resolver';
2
+ import { tryGetDocument } from '../../utils/try-get-document';
3
+ /**
4
+ * Applies an A11y Tree to a shadow root by:
5
+ *
6
+ * 1. Resolving the `A11yTreeStrategy` that best matches the current
7
+ * browser engine / AT environment.
8
+ * 2. Compiling the semantic tree into a flat list of `AriaPatch`
9
+ * instructions.
10
+ * 3. Clearing any previously managed ARIA attributes (`data-a11y-managed`).
11
+ * 4. Applying each patch to the `data-a11y-id` target node in the shadow.
12
+ * 5. Materialising one visually-hidden description `<span>` per patch that
13
+ * references `aria-describedby` and whose node carries description text.
14
+ * 6. Stamping `data-a11y-strategy-applied` on the host for observability.
15
+ *
16
+ * This is the generic, component-agnostic projection step. Components
17
+ * interact with it indirectly through `A11yTreeSlimmer`.
18
+ *
19
+ * @param {A11yNode} root - The root `A11yNode` of the semantic tree.
20
+ * @param {HTMLElement} host - The component's host element. Must have a `shadowRoot`.
21
+ * If `shadowRoot` is null (e.g. light-DOM component or early call before first
22
+ * render), the function returns immediately without throwing.
23
+ * @example
24
+ * ```ts
25
+ * // Called once per render from A11yTreeSlimmer.projectA11yTree():
26
+ * applyA11yTree(buildSectionTitleA11yTree({ titleText, description }), this.host);
27
+ * ```
28
+ */
29
+ export function applyA11yTree(root, host) {
30
+ const shadow = host.shadowRoot;
31
+ if (!shadow)
32
+ return;
33
+ const strategy = resolveStrategy(host);
34
+ const patches = strategy.compile(root);
35
+ clearPreviousPatches(shadow);
36
+ for (const patch of patches) {
37
+ applyPatch(shadow, patch);
38
+ }
39
+ // Materialise a visually-hidden description node when any patch
40
+ // references aria-describedby. This node is what the AT reads via
41
+ // the describedby relationship.
42
+ maybeRenderDescriptionNode(root, shadow, patches);
43
+ host.setAttribute('data-a11y-strategy-applied', strategy.name);
44
+ }
45
+ /**
46
+ * Remove all ARIA attributes that were set by a previous `applyA11yTree`
47
+ * call. The `data-a11y-managed` attribute on each node acts as a manifest
48
+ * of which attributes were set so we can clean up exactly those — and only
49
+ * those — without disturbing hand-authored ARIA.
50
+ *
51
+ * @param {ShadowRoot} shadow - The shadow root to clean previously managed ARIA from.
52
+ */
53
+ function clearPreviousPatches(shadow) {
54
+ shadow.querySelectorAll('[data-a11y-managed]').forEach((el) => {
55
+ var _a;
56
+ /* istanbul ignore next -- the [data-a11y-managed] selector guarantees the attribute is present, so the `?? ''` fallback is unreachable defensive code */
57
+ const attrs = ((_a = el.getAttribute('data-a11y-managed')) !== null && _a !== void 0 ? _a : '').split(' ').filter(Boolean);
58
+ attrs.forEach((a) => el.removeAttribute(a));
59
+ el.removeAttribute('data-a11y-managed');
60
+ });
61
+ }
62
+ /**
63
+ * Apply a single `AriaPatch` to the matching `data-a11y-id` element.
64
+ * Records every attribute written in `data-a11y-managed` so
65
+ * `clearPreviousPatches` can undo it on the next render.
66
+ *
67
+ * When `patch.value === null` the attribute is removed instead of set.
68
+ *
69
+ * @param {ShadowRoot} shadow - The shadow root containing the target element.
70
+ * @param {AriaPatch} patch - The ARIA patch to apply.
71
+ */
72
+ function applyPatch(shadow, patch) {
73
+ var _a;
74
+ const target = shadow.querySelector(`[data-a11y-id="${patch.targetId}"]`);
75
+ if (!target)
76
+ return;
77
+ if (patch.value === null) {
78
+ target.removeAttribute(patch.attribute);
79
+ }
80
+ else {
81
+ target.setAttribute(patch.attribute, patch.value);
82
+ }
83
+ // Track which attributes we wrote so we can clean them up later.
84
+ const prev = (_a = target.getAttribute('data-a11y-managed')) !== null && _a !== void 0 ? _a : '';
85
+ if (!prev.split(' ').includes(patch.attribute)) {
86
+ target.setAttribute('data-a11y-managed', (prev + ' ' + patch.attribute).trim());
87
+ }
88
+ }
89
+ /**
90
+ * Materialise a visually-hidden `<span>` description node for every strategy
91
+ * patch that references `aria-describedby`. Each `<span>` carries the
92
+ * description text so assistive technology can read it via the describedby
93
+ * relationship.
94
+ *
95
+ * Spans are created once and reused on subsequent renders; their text content
96
+ * is updated in place. Spans whose `aria-describedby` reference is dropped on
97
+ * a later render are pruned by `pruneStaleDescriptionNodes`.
98
+ *
99
+ * Visually-hidden styles follow the `.sr-only` pattern (not `display:none`
100
+ * which would suppress AT reading).
101
+ *
102
+ * @param {A11yNode} root - The root of the semantic tree (source of description text).
103
+ * @param {ShadowRoot} shadow - The shadow root to append/update description nodes in.
104
+ * @param {AriaPatch[]} patches - The compiled patch list to scan for `aria-describedby`.
105
+ */
106
+ function maybeRenderDescriptionNode(root, shadow, patches) {
107
+ // Collect every aria-describedby patch that has a live string target id —
108
+ // one hidden span is required per described node.
109
+ const describedByPatches = patches.filter((p) => p.attribute === 'aria-describedby' && typeof p.value === 'string');
110
+ const keepIds = new Set(describedByPatches.map((p) => p.value));
111
+ // Remove any previously-materialised description spans that are no longer
112
+ // referenced by a live aria-describedby patch — e.g. the `description` prop
113
+ // was cleared, or the description moved to a different node. Without this,
114
+ // orphaned visually-hidden spans linger in the shadow DOM and are still
115
+ // announced by AT during linear (non-describedby) traversal.
116
+ pruneStaleDescriptionNodes(shadow, keepIds);
117
+ for (const patch of describedByPatches) {
118
+ const node = findById(root, patch.targetId);
119
+ /* istanbul ignore next -- describedby patches are only emitted for nodes that carry a description, so this guard is unreachable defensive code */
120
+ if (!(node === null || node === void 0 ? void 0 : node.description))
121
+ continue;
122
+ ensureDescriptionSpan(shadow, patch.value, node.description);
123
+ }
124
+ }
125
+ /**
126
+ * Create (or update in place) a visually-hidden `<span>` carrying description
127
+ * text for a single `aria-describedby` reference.
128
+ *
129
+ * @param {ShadowRoot} shadow - The shadow root to append/update the span in.
130
+ * @param {string} id - The span id, matching the `aria-describedby` value.
131
+ * @param {string} text - The description text to expose to AT.
132
+ */
133
+ function ensureDescriptionSpan(shadow, id, text) {
134
+ let descEl = shadow.getElementById(id);
135
+ if (!descEl) {
136
+ const doc = tryGetDocument();
137
+ /* istanbul ignore next -- document is always present in the browser render path */
138
+ if (!doc)
139
+ return;
140
+ descEl = doc.createElement('span');
141
+ descEl.id = id;
142
+ // Stamp the span so pruneStaleDescriptionNodes can find and clean it up
143
+ // on a later render when it is no longer referenced.
144
+ descEl.setAttribute('data-a11y-desc', '');
145
+ descEl.style.position = 'absolute';
146
+ descEl.style.width = '1px';
147
+ descEl.style.height = '1px';
148
+ descEl.style.overflow = 'hidden';
149
+ // `clip` is kept for legacy engines; `clip-path` + `white-space: nowrap`
150
+ // cover modern engines and prevent a 1px phantom scrollbar.
151
+ descEl.style.clip = 'rect(0 0 0 0)';
152
+ descEl.style.clipPath = 'inset(50%)';
153
+ descEl.style.whiteSpace = 'nowrap';
154
+ shadow.appendChild(descEl);
155
+ }
156
+ descEl.textContent = text;
157
+ }
158
+ /**
159
+ * Remove visually-hidden description `<span>`s (stamped `data-a11y-desc`)
160
+ * that are no longer referenced by a live `aria-describedby` patch.
161
+ *
162
+ * @param {ShadowRoot} shadow - The shadow root to prune stale description nodes from.
163
+ * @param {Set<string>} keepIds - Ids of spans still referenced this render; all
164
+ * other stamped spans are removed.
165
+ */
166
+ function pruneStaleDescriptionNodes(shadow, keepIds) {
167
+ shadow.querySelectorAll('[data-a11y-desc]').forEach((el) => {
168
+ if (!keepIds.has(el.id))
169
+ el.remove();
170
+ });
171
+ }
172
+ /**
173
+ * Depth-first search for a node by `id`.
174
+ *
175
+ * @param {A11yNode} node - Node to search from.
176
+ * @param {string} id - The `id` to find.
177
+ * @returns {A11yNode | undefined} The matching node, or `undefined` when not found.
178
+ */
179
+ function findById(node, id) {
180
+ var _a;
181
+ if (node.id === id)
182
+ return node;
183
+ for (const c of (_a = node.children) !== null && _a !== void 0 ? _a : []) {
184
+ const hit = findById(c, id);
185
+ if (hit)
186
+ return hit;
187
+ }
188
+ return undefined;
189
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * A11y Tree — generic type definitions.
3
+ *
4
+ * The A11y Tree is a browser-agnostic description of the *semantic* a11y
5
+ * structure of a component. Each node captures the intent (role, label,
6
+ * description, level, etc.) and a stable `id` that the strategy layer
7
+ * can use to project ARIA attributes onto the real DOM.
8
+ *
9
+ * ## Architecture overview
10
+ *
11
+ * ```
12
+ * Component (TSX)
13
+ * ↓ builds semantic tree via DTO helpers (a11y-node-dto.ts)
14
+ * A11yNode tree (this file)
15
+ * ↓ compiled by an A11yTreeStrategy
16
+ * AriaPatch[]
17
+ * ↓ applied by a11y-tree-applier.ts
18
+ * Shadow DOM (ARIA attributes on data-a11y-id elements)
19
+ * ```
20
+ *
21
+ * The A11y Tree is NOT rendered itself. It is consumed by an
22
+ * `A11yTreeStrategy` that decides, per browser/AT, which ARIA attributes
23
+ * to attach to which DOM nodes.
24
+ *
25
+ * ## Browser-engine strategy contract
26
+ *
27
+ * Assistive technology (AT) cannot be detected from JavaScript (by design,
28
+ * for user privacy). The strategy resolver therefore branches on *browser
29
+ * engine* as a coarse proxy for the most likely AT pairing:
30
+ *
31
+ * | Engine | Assumed AT | Confidence |
32
+ * |-----------|-------------------|---------------------|
33
+ * | WebKit | VoiceOver (macOS/iOS) | medium on Apple, low elsewhere |
34
+ * | Gecko | NVDA (Windows), Orca (Linux) | medium on Win, low elsewhere |
35
+ * | Chromium | JAWS / NVDA / TalkBack | high on non-Apple, medium on Apple |
36
+ *
37
+ * **Confidence semantics** (see `A11yStrategyConfidence`):
38
+ * - `high` — direct signal (explicit override or confirmed UA).
39
+ * - `medium` — plausible proxy; AT pairing is an assumption that covers the
40
+ * majority of users on that engine+platform combination.
41
+ * - `low` — unknown UA or atypical engine/platform combo; dev-mode warning
42
+ * fires once per (strategy, reason) tuple via `resolveStrategy`.
43
+ *
44
+ * Consumers who know the AT environment (e.g. automated tests, a storybook
45
+ * knob) can pin a strategy explicitly via `data-a11y-strategy` on the host
46
+ * element — this is always treated as `high` confidence.
47
+ */
48
+ export {};
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Baseline strategy: spec-compliant ARIA, works on evergreen Chromium,
3
+ * Firefox, and Safari with their default AT pairings (NVDA, Orca,
4
+ * VoiceOver-macOS). Used as the default when no engine-specific override
5
+ * matches.
6
+ *
7
+ * ## Mapping rules
8
+ *
9
+ * | Node role | ARIA output |
10
+ * |---------------|----------------------------------------------------|
11
+ * | heading | `role="heading"` + `aria-level` |
12
+ * | group/region | `role` + `aria-label` (if present) + `aria-describedby` (if description) |
13
+ * | img (decorative) | `aria-hidden="true"` |
14
+ * | img (labelled) | `role="img"` + `aria-label` |
15
+ * | presentation/none | `role="presentation"` |
16
+ */
17
+ export const baselineStrategy = {
18
+ name: 'baseline',
19
+ /**
20
+ * Compile the semantic tree into spec-compliant ARIA patches.
21
+ *
22
+ * @param {A11yNode} root - Root of the semantic A11y Tree to compile.
23
+ * @returns {AriaPatch[]} Flat list of ARIA attribute patches to apply.
24
+ */
25
+ compile(root) {
26
+ const patches = [];
27
+ walk(root, patches);
28
+ return patches;
29
+ },
30
+ };
31
+ /**
32
+ * Recursively translate a node and its children into ARIA patches.
33
+ *
34
+ * @param {A11yNode} node - Current node being translated.
35
+ * @param {AriaPatch[]} patches - Accumulator the produced patches are pushed onto.
36
+ */
37
+ function walk(node, patches) {
38
+ var _a, _b;
39
+ switch (node.role) {
40
+ case 'heading':
41
+ patches.push({ targetId: node.id, attribute: 'role', value: 'heading' });
42
+ patches.push({
43
+ targetId: node.id,
44
+ attribute: 'aria-level',
45
+ value: String((_a = node.level) !== null && _a !== void 0 ? _a : 2),
46
+ });
47
+ break;
48
+ case 'group':
49
+ case 'region':
50
+ patches.push({ targetId: node.id, attribute: 'role', value: node.role });
51
+ if (node.label) {
52
+ patches.push({ targetId: node.id, attribute: 'aria-label', value: node.label });
53
+ }
54
+ if (node.description) {
55
+ // Baseline AT: describedby works reliably on group/region.
56
+ patches.push({
57
+ targetId: node.id,
58
+ attribute: 'aria-describedby',
59
+ value: `${node.id}__desc`,
60
+ });
61
+ }
62
+ break;
63
+ case 'img':
64
+ if (node.decorative) {
65
+ patches.push({ targetId: node.id, attribute: 'aria-hidden', value: 'true' });
66
+ }
67
+ else if (node.label) {
68
+ patches.push({ targetId: node.id, attribute: 'role', value: 'img' });
69
+ patches.push({ targetId: node.id, attribute: 'aria-label', value: node.label });
70
+ }
71
+ break;
72
+ case 'presentation':
73
+ case 'none':
74
+ patches.push({ targetId: node.id, attribute: 'role', value: 'presentation' });
75
+ break;
76
+ }
77
+ (_b = node.children) === null || _b === void 0 ? void 0 : _b.forEach((c) => walk(c, patches));
78
+ }
@@ -0,0 +1,56 @@
1
+ import { baselineStrategy } from './baseline-strategy';
2
+ /**
3
+ * Firefox + NVDA strategy.
4
+ *
5
+ * Firefox/NVDA generally handles spec-compliant ARIA correctly. The one
6
+ * known quirk for the Vega component family:
7
+ *
8
+ * **NVDA browse-mode may skip `aria-describedby` on `role="group"`.**
9
+ * When a group container carries a description, NVDA in browse (reading)
10
+ * mode sometimes does not announce it. Workaround: promote the container to
11
+ * `role="region"`, which is part of the landmark navigation set and is
12
+ * reliably announced by NVDA when encountered during linear reading.
13
+ *
14
+ * All other node types fall back to baseline behaviour.
15
+ */
16
+ export const firefoxNvdaStrategy = {
17
+ name: 'firefox-nvda',
18
+ /**
19
+ * Compile ARIA patches, applying the NVDA group-description workaround.
20
+ *
21
+ * @param {A11yNode} root - Root of the semantic A11y Tree to compile.
22
+ * @returns {AriaPatch[]} ARIA patches with group promoted to region when needed.
23
+ */
24
+ compile(root) {
25
+ const patches = baselineStrategy.compile(root);
26
+ // Promote all described groups to region (not just the first one).
27
+ for (const group of collectDescribedGroups(root)) {
28
+ for (const p of patches) {
29
+ if (p.targetId === group.id && p.attribute === 'role' && p.value === 'group') {
30
+ p.value = 'region';
31
+ }
32
+ }
33
+ }
34
+ return patches;
35
+ },
36
+ };
37
+ /**
38
+ * Collect every `group` node in the tree that carries a description,
39
+ * in depth-first order. Includes nested described groups.
40
+ *
41
+ * @param {A11yNode} node - Node to search from.
42
+ * @returns {A11yNode[]} All described group nodes, including nested ones.
43
+ */
44
+ function collectDescribedGroups(node) {
45
+ var _a;
46
+ const out = [];
47
+ // Check if this node is a described group
48
+ if (node.role === 'group' && node.description) {
49
+ out.push(node);
50
+ }
51
+ // Always recurse into children to find nested described groups
52
+ for (const c of (_a = node.children) !== null && _a !== void 0 ? _a : []) {
53
+ out.push(...collectDescribedGroups(c));
54
+ }
55
+ return out;
56
+ }
@@ -0,0 +1,140 @@
1
+ import { baselineStrategy } from './baseline-strategy';
2
+ /**
3
+ * WebKit + VoiceOver strategy.
4
+ *
5
+ * Applies on top of the baseline to work around two known VoiceOver quirks:
6
+ *
7
+ * **Quirk #1 — `aria-describedby` on non-focusable containers is skipped.**
8
+ * VoiceOver on Safari often does not read `aria-describedby` on non-focusable
9
+ * `role="group"` (A11yContainerNode) or `role="region"` (A11yLandmarkNode)
10
+ * containers. Workaround: fold the description text directly into the
11
+ * heading's `aria-label` (joined with `. `) so it is read together with the
12
+ * title, and remove the orphaned `aria-describedby` patch.
13
+ *
14
+ * **Quirk #2 — Decorative `<vega-icon>` announced twice.**
15
+ * Safari occasionally announces a decorative icon twice when only
16
+ * `aria-hidden` is set on the host. We additionally set `role="none"` as a
17
+ * belt-and-suspenders guard that suppresses the extra announcement.
18
+ *
19
+ * These adjustments are applied as a *diff* on top of the baseline patch
20
+ * list — the A11y Tree itself is unchanged. Other node types fall back to
21
+ * baseline behaviour.
22
+ */
23
+ export const webkitVoiceOverStrategy = {
24
+ name: 'webkit-voiceover',
25
+ /**
26
+ * Compile ARIA patches, applying the two VoiceOver workarounds.
27
+ *
28
+ * @param {A11yNode} root - Root of the semantic A11y Tree to compile.
29
+ * @returns {AriaPatch[]} ARIA patches adjusted for WebKit + VoiceOver.
30
+ */
31
+ compile(root) {
32
+ var _a;
33
+ const patches = baselineStrategy.compile(root);
34
+ // Quirk #1: fold each described container's description into its heading's
35
+ // aria-label. The non-focusable-container quirk affects both role="group"
36
+ // (A11yContainerNode) and role="region" (A11yLandmarkNode). Generalized to
37
+ // iterate every described container so components with multiple described
38
+ // groups/regions all get folded correctly instead of only the first pair.
39
+ for (const container of collectDescribedContainers(root)) {
40
+ // Use the first heading owned by this container (not crossing nested
41
+ // described-container boundaries), or fall back to the container itself.
42
+ const heading = (_a = findOwnedHeading(container)) !== null && _a !== void 0 ? _a : container;
43
+ const combined = [heading.label, container.description].filter(Boolean).join('. ');
44
+ // Emit an explicit removal patch (value: null) for the container's
45
+ // aria-describedby. VoiceOver double-announces the description when it
46
+ // is both folded into the heading label AND referenced via
47
+ // aria-describedby, so we untrack the attribute declaratively (rather
48
+ // than silently dropping the patch) to keep re-render cleanup correct.
49
+ //
50
+ // When folding onto the container itself (no owned heading found), also
51
+ // update the existing aria-label patch in-place so we do not produce a
52
+ // duplicate patch that would leave the old value visible to consumers
53
+ // using Array.find().
54
+ const foldingOntoContainer = heading.id === container.id;
55
+ for (const p of patches) {
56
+ if (p.targetId === container.id && p.attribute === 'aria-describedby') {
57
+ p.value = null;
58
+ }
59
+ if (foldingOntoContainer && p.targetId === container.id && p.attribute === 'aria-label') {
60
+ p.value = combined;
61
+ }
62
+ }
63
+ if (!foldingOntoContainer) {
64
+ patches.push({ targetId: heading.id, attribute: 'aria-label', value: combined });
65
+ }
66
+ }
67
+ // Quirk #2: harden decorative icons with role="none".
68
+ walkIcons(root, (n) => {
69
+ if (n.decorative) {
70
+ patches.push({ targetId: n.id, attribute: 'role', value: 'none' });
71
+ }
72
+ });
73
+ return patches;
74
+ },
75
+ };
76
+ /**
77
+ * Find the first heading node owned directly by a described container,
78
+ * stopping at nested described-container boundaries.
79
+ *
80
+ * A heading "owned" by a container is one that lives in that container's
81
+ * direct subtree but NOT inside a nested described group/region. Those inner
82
+ * headings belong to the inner container's own fold pass, so crossing their
83
+ * boundary would cause the outer container's description to overwrite the
84
+ * inner heading's aria-label and then be lost when the inner pass runs.
85
+ *
86
+ * If no owned heading is found, the caller falls back to the container itself
87
+ * (the `?? container` in compile()), folding the description onto the
88
+ * container's own aria-label.
89
+ *
90
+ * @param {A11yNode} node - The container to search within.
91
+ * @returns {A11yNode | undefined} First heading owned by this container, if any.
92
+ */
93
+ function findOwnedHeading(node) {
94
+ var _a;
95
+ for (const c of (_a = node.children) !== null && _a !== void 0 ? _a : []) {
96
+ // Stop at nested described-container boundaries — their headings belong
97
+ // to those containers' own fold passes, not this one.
98
+ if ((c.role === 'group' || c.role === 'region') && c.description) {
99
+ continue;
100
+ }
101
+ if (c.role === 'heading')
102
+ return c;
103
+ const hit = findOwnedHeading(c);
104
+ if (hit)
105
+ return hit;
106
+ }
107
+ return undefined;
108
+ }
109
+ /**
110
+ * Visit every image node in the tree, invoking the callback on each.
111
+ *
112
+ * @param {A11yNode} node - Node to walk from.
113
+ * @param {(n: A11yNode) => void} fn - Callback invoked for each image node.
114
+ */
115
+ function walkIcons(node, fn) {
116
+ var _a;
117
+ if (node.role === 'img')
118
+ fn(node);
119
+ (_a = node.children) === null || _a === void 0 ? void 0 : _a.forEach((c) => walkIcons(c, fn));
120
+ }
121
+ /**
122
+ * Collect every `group` or `region` node in the tree that carries a
123
+ * description, in depth-first order. Includes nested described containers.
124
+ *
125
+ * @param {A11yNode} node - Node to search from.
126
+ * @returns {A11yNode[]} All described container nodes, including nested ones.
127
+ */
128
+ function collectDescribedContainers(node) {
129
+ var _a;
130
+ const out = [];
131
+ // Check if this node is a described container
132
+ if ((node.role === 'group' || node.role === 'region') && node.description) {
133
+ out.push(node);
134
+ }
135
+ // Always recurse into children to find nested described containers
136
+ for (const c of (_a = node.children) !== null && _a !== void 0 ? _a : []) {
137
+ out.push(...collectDescribedContainers(c));
138
+ }
139
+ return out;
140
+ }
@@ -0,0 +1,172 @@
1
+ import { baselineStrategy } from './strategies/baseline-strategy';
2
+ import { firefoxNvdaStrategy } from './strategies/firefox-nvda-strategy';
3
+ import { webkitVoiceOverStrategy } from './strategies/webkit-voiceover-strategy';
4
+ /**
5
+ * All registered strategies. The resolver picks from this list; callers that
6
+ * need exhaustive enumeration (e.g. tests, Storybook knobs) can import this
7
+ * constant directly.
8
+ */
9
+ export const ALL_A11Y_STRATEGIES = [
10
+ baselineStrategy,
11
+ webkitVoiceOverStrategy,
12
+ firefoxNvdaStrategy,
13
+ ];
14
+ /**
15
+ * Picks an `A11yTreeStrategy` from the runtime environment and returns the
16
+ * full `A11yStrategyResolution` including confidence and a reason string.
17
+ *
18
+ * ## Browser-engine detection
19
+ *
20
+ * AT cannot be detected from JS (user privacy). We branch on *browser engine*
21
+ * as a coarse proxy for the most likely AT pairing on each platform:
22
+ *
23
+ * | Engine | Assumed AT | Confidence |
24
+ * |-----------|------------------------------|-------------------------|
25
+ * | WebKit | VoiceOver (macOS/iOS) | medium on Apple, low elsewhere |
26
+ * | Gecko | NVDA (Win), Orca (Linux) | medium on Win32, low elsewhere |
27
+ * | Chromium | JAWS / NVDA / TalkBack | high on non-Apple, medium on Apple |
28
+ *
29
+ * An explicit `data-a11y-strategy` attribute on the host element is always
30
+ * treated as `high` confidence (known override). If the override value does
31
+ * not match any registered strategy name, the resolver falls back to baseline
32
+ * with `low` confidence and logs an actionable warning.
33
+ *
34
+ * @param {HTMLElement} [host] - The component host element. When provided, its
35
+ * `data-a11y-strategy` attribute is checked first.
36
+ * @returns {A11yStrategyResolution} The resolved strategy with confidence and reason.
37
+ */
38
+ export function resolveStrategyDetailed(host) {
39
+ var _a, _b;
40
+ // Explicit override takes precedence over UA detection.
41
+ const override = (_a = host === null || host === void 0 ? void 0 : host.getAttribute('data-a11y-strategy')) !== null && _a !== void 0 ? _a : null;
42
+ if (override) {
43
+ const found = ALL_A11Y_STRATEGIES.find((s) => s.name === override);
44
+ if (found) {
45
+ return {
46
+ strategy: found,
47
+ confidence: 'high',
48
+ reason: `explicit override via data-a11y-strategy="${override}"`,
49
+ };
50
+ }
51
+ // Unknown override name — warn and fall back to baseline.
52
+ return {
53
+ strategy: baselineStrategy,
54
+ confidence: 'low',
55
+ reason: `unknown data-a11y-strategy="${override}"; known strategies: ${ALL_A11Y_STRATEGIES.map((s) => s.name).join(', ')}. Falling back to baseline.`,
56
+ };
57
+ }
58
+ // Read the runtime navigator explicitly from `globalThis` (not the bare
59
+ // `navigator` identifier, which build tooling may substitute). Delegate the
60
+ // pure UA→strategy mapping to `resolveStrategyFromEnv` so it can be unit
61
+ // tested deterministically without mocking globals.
62
+ const nav = globalThis.navigator;
63
+ return resolveStrategyFromEnv(nav === null || nav === void 0 ? void 0 : nav.userAgent, (_b = nav === null || nav === void 0 ? void 0 : nav.platform) !== null && _b !== void 0 ? _b : '');
64
+ }
65
+ /**
66
+ * Pure UA→strategy mapping. Separated from `resolveStrategyDetailed` so the
67
+ * browser-engine detection table can be unit tested deterministically by
68
+ * passing explicit `userAgent` / `platform` values instead of mocking the
69
+ * global `navigator` (which build/test tooling may sandbox).
70
+ *
71
+ * @param {string | undefined} userAgent - The `navigator.userAgent` string, or
72
+ * `undefined` for an SSR / non-browser environment.
73
+ * @param {string} platform - The `navigator.platform` string (empty string when
74
+ * unavailable).
75
+ * @returns {A11yStrategyResolution} The resolved strategy with confidence and reason.
76
+ */
77
+ export function resolveStrategyFromEnv(userAgent, platform) {
78
+ // SSR / non-browser environment: no UA available.
79
+ if (userAgent === undefined) {
80
+ return {
81
+ strategy: baselineStrategy,
82
+ confidence: 'medium',
83
+ reason: 'no navigator (SSR or non-browser environment); baseline assumed',
84
+ };
85
+ }
86
+ const ua = userAgent;
87
+ // Order matters: Safari UA contains "Safari" but Chrome UA also does.
88
+ if (/\bFirefox\//.test(ua)) {
89
+ // Firefox + NVDA is the canonical pairing on Windows; on other
90
+ // platforms (macOS VoiceOver, Linux Orca, Windows JAWS) this is a
91
+ // probabilistic guess.
92
+ const isWindows = /Win/i.test(platform);
93
+ return {
94
+ strategy: firefoxNvdaStrategy,
95
+ confidence: isWindows ? 'medium' : 'low',
96
+ reason: isWindows
97
+ ? 'Firefox on Windows — assumed NVDA (most common pairing on Win32)'
98
+ : 'Firefox on non-Windows platform — AT pairing is a guess (may be Orca, VoiceOver, or JAWS)',
99
+ };
100
+ }
101
+ if (/^((?!chrome|android).)*safari/i.test(ua)) {
102
+ const isApple = /Mac|iPhone|iPad|iPod/i.test(platform);
103
+ return {
104
+ strategy: webkitVoiceOverStrategy,
105
+ confidence: isApple ? 'medium' : 'low',
106
+ reason: isApple
107
+ ? 'WebKit on Apple platform — assumed VoiceOver'
108
+ : 'WebKit on non-Apple platform — AT pairing is a guess',
109
+ };
110
+ }
111
+ // Chromium (Edge/Chrome). On macOS, Chromium routes through VoiceOver's
112
+ // accessibility tree; baseline covers most users but VoiceOver quirks may
113
+ // surface. Surfaced as medium confidence so the override path stays
114
+ // discoverable.
115
+ const onApple = /Mac|iPhone|iPad|iPod/i.test(platform);
116
+ return {
117
+ strategy: baselineStrategy,
118
+ confidence: onApple ? 'medium' : 'high',
119
+ reason: onApple
120
+ ? 'Chromium on Apple platform — VoiceOver may diverge from Chromium baseline'
121
+ : 'Chromium on non-Apple platform — baseline is the expected AT mapping',
122
+ };
123
+ }
124
+ /**
125
+ * Convenience wrapper for callers that only need the resolved strategy.
126
+ * Equivalent to `resolveStrategyDetailed(host).strategy` but additionally
127
+ * emits a **dev-mode console warning** for `low`-confidence resolutions,
128
+ * pointing engineers at the `data-a11y-strategy` override mechanism.
129
+ *
130
+ * The warning is rate-limited per `(strategyName, reason)` tuple to avoid
131
+ * log spam on every render cycle.
132
+ *
133
+ * @param {HTMLElement} [host] - The component host element (optional). Used for
134
+ * the `data-a11y-strategy` override check.
135
+ * @returns {A11yTreeStrategy} The resolved strategy.
136
+ */
137
+ export function resolveStrategy(host) {
138
+ const resolution = resolveStrategyDetailed(host);
139
+ if (resolution.confidence === 'low') {
140
+ warnOnce(resolution.strategy.name, resolution.reason);
141
+ }
142
+ return resolution.strategy;
143
+ }
144
+ const warnedKeys = new Set();
145
+ /**
146
+ * Emit a console.warn once per (strategy, reason) tuple. Suppressed in
147
+ * production builds and when `console` is unavailable (SSR).
148
+ *
149
+ * @param {string} strategyName - Name of the resolved strategy.
150
+ * @param {string} reason - Human-readable reason for the resolution.
151
+ * @internal
152
+ */
153
+ function warnOnce(strategyName, reason) {
154
+ var _a, _b;
155
+ if (typeof console === 'undefined')
156
+ return;
157
+ // Only warn in dev mode. Production builds set NODE_ENV=production;
158
+ // the guard below also handles minified bundles where `process` may
159
+ // be undefined.
160
+ const env = (_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV;
161
+ if (env === 'production')
162
+ return;
163
+ const key = `${strategyName}::${reason}`;
164
+ if (warnedKeys.has(key))
165
+ return;
166
+ warnedKeys.add(key);
167
+ console.warn(`[vega a11y-tree] Low-confidence strategy resolution: using "${strategyName}". ` +
168
+ `Reason: ${reason}. ` +
169
+ `Pin via data-a11y-strategy="<strategy-name>" to silence this warning ` +
170
+ `when you know the correct AT pairing. ` +
171
+ `Known strategies: ${ALL_A11Y_STRATEGIES.map((s) => s.name).join(', ')}.`);
172
+ }