@heartlandone/vega 2.95.0 → 2.97.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 (518) hide show
  1. package/dist/cjs/{app-globals-76815382.js → app-globals-3f57f7b9.js} +10 -10
  2. package/dist/cjs/{code-block-493c7ce7.js → code-block-28a7732e.js} +1508 -56
  3. package/dist/cjs/{component-value-history-controller-slimmer.abstract-ab21fcbf.js → component-value-history-controller-slimmer.abstract-50cdba6e.js} +3 -3
  4. package/dist/cjs/{content-state-fc34a814.js → content-state-e2ab0f06.js} +143 -581
  5. package/dist/cjs/{date-required-rule-4ab06a82.js → date-required-rule-5250f26d.js} +1 -1
  6. package/dist/cjs/{design-token-d3d12fa0.js → design-token-74674ee7.js} +3 -3
  7. package/dist/cjs/{element-appender-slimmer-1d6323c2.js → element-appender-slimmer-ccb2e3c2.js} +117 -2
  8. package/dist/cjs/{form-field-controller-slimmer-d638ba12.js → form-field-controller-slimmer-58621b5e.js} +5 -14
  9. package/dist/cjs/form-field-key-8d5edf75.js +25 -0
  10. package/dist/cjs/{image-annotation-action-7c4cd316.js → image-annotation-action-b54dc669.js} +2 -2
  11. package/dist/cjs/{image-extension-30a7c10f.js → image-extension-1e3eeaa3.js} +2 -2
  12. package/dist/cjs/index.cjs.js +19 -19
  13. package/dist/cjs/{inject-keyboard-manager-5a105612.js → inject-keyboard-manager-6a6f5c9f.js} +1 -1
  14. package/dist/cjs/{internal-calendar-period-factory-b76006f7.js → internal-calendar-period-factory-dfcdd3f6.js} +1 -1
  15. package/dist/cjs/{internal-translation-controller-eb02c3b1.js → internal-translation-controller-1dac2df8.js} +7 -0
  16. package/dist/cjs/{keyboard-manager-ca76d4dc.js → keyboard-manager-c56033b1.js} +1 -1
  17. package/dist/cjs/{keyboard-manager-slimmer-a1223714.js → keyboard-manager-slimmer-7043a106.js} +1 -1
  18. package/dist/cjs/{link-extension-92a63cb7.js → link-extension-71c27ff3.js} +3 -3
  19. package/dist/cjs/loader.cjs.js +12 -12
  20. package/dist/cjs/{month-view-generator-876c50d4.js → month-view-generator-7b704a80.js} +1 -1
  21. package/dist/cjs/{public-rules-9e1ea1d9.js → public-rules-55e34d2e.js} +7 -7
  22. package/dist/cjs/{range-30219330.js → range-eebe0e3c.js} +1 -1
  23. package/dist/cjs/{responsive-format-facade-25e9f30d.js → responsive-format-facade-493d1763.js} +1 -1
  24. package/dist/cjs/{rich-text-editor-required-rule-23bf7485.js → rich-text-editor-required-rule-4fdee376.js} +1 -1
  25. package/dist/cjs/{split-cell-operation-43752212.js → split-cell-operation-51097409.js} +3 -3
  26. package/dist/cjs/{state-border-formatter-f1ce0f3b.js → state-border-formatter-711c7aaa.js} +1 -1
  27. package/dist/cjs/{string-format-strategy.abstract-b22f7754.js → string-format-strategy.abstract-b61bdcbd.js} +1 -1
  28. package/dist/cjs/{string-input-formatter-slimmer-d2c248f7.js → string-input-formatter-slimmer-18d45942.js} +1 -1
  29. package/dist/cjs/{string-mask-strategy-fc01a500.js → string-mask-strategy-ad3fa0ac.js} +2 -2
  30. package/dist/cjs/{style-formatter-73205450.js → style-formatter-8f711cb0.js} +2 -2
  31. package/dist/cjs/{time-required-rule-12d2f394.js → time-required-rule-87417359.js} +1 -1
  32. package/dist/cjs/{token-extension-d123d9d0.js → token-extension-608bbf7b.js} +38 -14
  33. package/dist/cjs/{translation-slimmer-9099f56c.js → translation-slimmer-77c7f37d.js} +1 -1
  34. package/dist/cjs/{type-guard-f354af8b.js → type-guard-a57ef3ac.js} +1 -1
  35. package/dist/cjs/{valid-credit-card-number-rule-8d370163.js → valid-credit-card-number-rule-4c0a3040.js} +1 -1
  36. package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
  37. package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
  38. package/dist/cjs/vega-backdrop.cjs.entry.js +63 -8
  39. package/dist/cjs/vega-box.cjs.entry.js +6 -6
  40. package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
  41. package/dist/cjs/vega-button.cjs.entry.js +3 -3
  42. package/dist/cjs/vega-calendar_5.cjs.entry.js +7 -7
  43. package/dist/cjs/vega-card.cjs.entry.js +5 -5
  44. package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
  45. package/dist/cjs/vega-checkbox_2.cjs.entry.js +20 -3
  46. package/dist/cjs/vega-chip.cjs.entry.js +5 -5
  47. package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
  48. package/dist/cjs/vega-color-picker.cjs.entry.js +11 -2
  49. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +12 -3
  50. package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
  51. package/dist/cjs/vega-combo-box.cjs.entry.js +17 -8
  52. package/dist/cjs/vega-date-picker_2.cjs.entry.js +22 -13
  53. package/dist/cjs/vega-dialog_2.cjs.entry.js +3 -3
  54. package/dist/cjs/vega-divider.cjs.entry.js +5 -5
  55. package/dist/cjs/vega-dropdown_5.cjs.entry.js +33 -10
  56. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  57. package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
  58. package/dist/cjs/vega-file-uploader.cjs.entry.js +12 -3
  59. package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
  60. package/dist/cjs/vega-flex.cjs.entry.js +6 -6
  61. package/dist/cjs/vega-font.cjs.entry.js +5 -5
  62. package/dist/cjs/vega-form.cjs.entry.js +28 -25
  63. package/dist/cjs/vega-grid.cjs.entry.js +5 -5
  64. package/dist/cjs/vega-icon.cjs.entry.js +5 -5
  65. package/dist/cjs/vega-image-uploader.cjs.entry.js +14 -5
  66. package/dist/cjs/vega-input-credit-card.cjs.entry.js +16 -7
  67. package/dist/cjs/vega-input-numeric.cjs.entry.js +14 -5
  68. package/dist/cjs/vega-input-passcode.cjs.entry.js +14 -5
  69. package/dist/cjs/vega-input-phone-number.cjs.entry.js +13 -4
  70. package/dist/cjs/vega-input-range.cjs.entry.js +12 -3
  71. package/dist/cjs/vega-input-select.cjs.entry.js +14 -5
  72. package/dist/cjs/vega-input.cjs.entry.js +9 -7
  73. package/dist/cjs/vega-left-nav_5.cjs.entry.js +71 -11
  74. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
  75. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
  76. package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
  77. package/dist/cjs/vega-popover_2.cjs.entry.js +8 -8
  78. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
  79. package/dist/cjs/vega-radio_2.cjs.entry.js +17 -5
  80. package/dist/cjs/vega-rich-text-content.cjs.entry.js +86 -14
  81. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +2122 -451
  82. package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +1 -1
  83. package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
  84. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
  85. package/dist/cjs/vega-section-title.cjs.entry.js +896 -14
  86. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +13 -4
  87. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +11 -2
  88. package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
  89. package/dist/cjs/vega-signature-capture.cjs.entry.js +16 -7
  90. package/dist/cjs/vega-stepper.cjs.entry.js +12 -3
  91. package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
  92. package/dist/cjs/vega-textarea.cjs.entry.js +12 -3
  93. package/dist/cjs/vega-time-picker_2.cjs.entry.js +18 -9
  94. package/dist/cjs/vega-toggle-switch.cjs.entry.js +12 -3
  95. package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
  96. package/dist/cjs/vega.cjs.js +12 -12
  97. package/dist/collection/components/vega-backdrop/slimmers/controller/vega-backdrop-visible-controller.js +63 -8
  98. package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.js +33 -1
  99. package/dist/collection/components/vega-checkbox/vega-checkbox.js +34 -2
  100. package/dist/collection/components/vega-color-picker/vega-color-picker.js +33 -1
  101. package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.js +33 -1
  102. package/dist/collection/components/vega-combo-box/vega-combo-box.js +35 -3
  103. package/dist/collection/components/vega-date-picker/vega-date-picker.js +33 -1
  104. package/dist/collection/components/vega-dropdown/vega-dropdown.js +30 -7
  105. package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +33 -1
  106. package/dist/collection/components/vega-form/slimmers/controllers/vega-form-field-controller.js +9 -9
  107. package/dist/collection/components/vega-form/slimmers/controllers/vega-form-field-validation-state-controller.js +5 -5
  108. package/dist/collection/components/vega-form/slimmers/renderers/native-form-renderer.js +4 -1
  109. package/dist/collection/components/vega-form/vega-form.js +32 -0
  110. package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +33 -1
  111. package/dist/collection/components/vega-input/vega-input.js +5 -4
  112. package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +34 -2
  113. package/dist/collection/components/vega-input-numeric/vega-input-numeric.js +33 -1
  114. package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +33 -1
  115. package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +33 -1
  116. package/dist/collection/components/vega-input-range/vega-input-range.js +33 -1
  117. package/dist/collection/components/vega-input-select/vega-input-select.js +35 -3
  118. package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-manager.js +17 -1
  119. package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.js +48 -5
  120. package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.js +18 -3
  121. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +4 -0
  122. package/dist/collection/components/vega-rich-text-editor/constants/constant.js +3 -0
  123. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +29 -0
  124. 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
  125. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy.js +8 -3
  126. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-annotation-strategy.abstract.js +60 -0
  127. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.js +36 -4
  128. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-items-strategy.abstract.js +27 -0
  129. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-nest-items-strategy.js +74 -0
  130. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.js +81 -1
  131. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.js +30 -0
  132. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.js +160 -9
  133. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +376 -10
  134. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-unnest-items-strategy.js +104 -0
  135. package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +2 -0
  136. package/dist/collection/components/vega-rich-text-editor/dto/actions/nest-list-items-action.js +12 -0
  137. package/dist/collection/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.js +12 -0
  138. package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +12 -0
  139. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +10 -1
  140. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +11 -3
  141. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +7 -1
  142. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +8 -4
  143. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +26 -3
  144. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +34 -1
  145. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +20 -3
  146. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.js +25 -1
  147. 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
  148. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.js +29 -0
  149. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +1 -1
  150. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/keyboard-link-handler.js +297 -0
  151. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +13 -0
  152. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +30 -1
  153. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/abstract-list-keyboard-handler.js +204 -0
  154. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-shift-tab-outdent-handler.js +42 -0
  155. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-tab-indent-handler.js +34 -0
  156. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/list-keyboard-slimmer.js +180 -0
  157. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +8 -2
  158. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +33 -1
  159. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.js +398 -0
  160. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-state-manager.js +111 -0
  161. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-type-config-controller.js +173 -0
  162. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/link-type-handler.js +49 -0
  163. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +114 -106
  164. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/utils/link-url-normalizer.js +80 -0
  165. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.js +44 -1
  166. package/dist/collection/components/vega-section-title/slimmers/a11y-tree/build-section-title-a11y-tree.js +54 -0
  167. package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +4 -4
  168. package/dist/collection/components/vega-section-title/vega-section-title.js +18 -2
  169. package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.js +33 -1
  170. package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.js +33 -1
  171. package/dist/collection/components/vega-signature-capture/vega-signature-capture.js +33 -1
  172. package/dist/collection/components/vega-stepper/vega-stepper.js +34 -2
  173. package/dist/collection/components/vega-textarea/vega-textarea.js +34 -2
  174. package/dist/collection/components/vega-time-picker/vega-time-picker.js +33 -1
  175. package/dist/collection/components/vega-toggle-switch/vega-toggle-switch.js +34 -2
  176. package/dist/collection/helpers/a11y-tree/a11y-node-dto.js +210 -0
  177. package/dist/collection/helpers/a11y-tree/a11y-tree-applier.js +189 -0
  178. package/dist/collection/helpers/a11y-tree/a11y-tree.types.js +48 -0
  179. package/dist/collection/helpers/a11y-tree/strategies/baseline-strategy.js +78 -0
  180. package/dist/collection/helpers/a11y-tree/strategies/firefox-nvda-strategy.js +56 -0
  181. package/dist/collection/helpers/a11y-tree/strategies/webkit-voiceover-strategy.js +140 -0
  182. package/dist/collection/helpers/a11y-tree/strategy-resolver.js +172 -0
  183. package/dist/collection/helpers/slimmers/a11y-tree-slimmer.js +54 -0
  184. package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +29 -0
  185. package/dist/collection/helpers/slimmers/element-appender/visibility-modifiers/clip-on-scroll-modifier.js +70 -0
  186. package/dist/collection/helpers/slimmers/element-appender/visibility-modifiers/visibility-modifier.interface.js +1 -0
  187. package/dist/collection/helpers/slimmers/{field-error-controller-silmmer.js → form/field-error-controller-silmmer.js} +3 -3
  188. package/dist/collection/helpers/slimmers/{field-error-ui-controller-slimmer.js → form/field-error-ui-controller-slimmer.js} +9 -9
  189. package/dist/collection/helpers/slimmers/{form-field-controller-slimmer.js → form/form-field-controller-slimmer.js} +9 -18
  190. package/dist/collection/helpers/slimmers/{form-field-message-translator.js → form/form-field-message-translator.js} +1 -1
  191. package/dist/collection/helpers/slimmers/{form-field-state-controller-slimmer.js → form/form-field-state-controller-slimmer.js} +1 -1
  192. package/dist/collection/helpers/slimmers/{form-field-valid-invoke-slimmer.js → form/form-field-valid-invoke-slimmer.js} +2 -2
  193. package/dist/collection/helpers/slimmers/form/utils/form-field-key.js +20 -0
  194. package/dist/collection/helpers/translation/locales/en.js +7 -0
  195. package/dist/collection/helpers/ui/element-appender.js +16 -0
  196. package/dist/collection/helpers/validator/form-field-controller.js +5 -4
  197. package/dist/esm/{app-globals-eafcc7a1.js → app-globals-d3991e53.js} +10 -10
  198. package/dist/esm/{code-block-e12588fe.js → code-block-8df86434.js} +1499 -52
  199. package/dist/esm/{component-value-history-controller-slimmer.abstract-4e8eb313.js → component-value-history-controller-slimmer.abstract-e4b95997.js} +3 -3
  200. package/dist/esm/{content-state-8032467a.js → content-state-c63fbeda.js} +106 -542
  201. package/dist/esm/{date-required-rule-b88e1650.js → date-required-rule-85334d0c.js} +1 -1
  202. package/dist/esm/{design-token-76bd217c.js → design-token-10ff79b5.js} +3 -3
  203. package/dist/esm/{element-appender-slimmer-7fcb944b.js → element-appender-slimmer-24be8e94.js} +117 -2
  204. package/dist/esm/{form-field-controller-slimmer-395c23e3.js → form-field-controller-slimmer-d8628837.js} +5 -14
  205. package/dist/esm/form-field-key-44ab39d0.js +22 -0
  206. package/dist/esm/{image-annotation-action-08a20d5e.js → image-annotation-action-fcceff95.js} +2 -2
  207. package/dist/esm/{image-extension-b6c7e4a7.js → image-extension-3280bdb0.js} +2 -2
  208. package/dist/esm/index.js +17 -17
  209. package/dist/esm/{inject-keyboard-manager-86126b5b.js → inject-keyboard-manager-ea1aad5b.js} +1 -1
  210. package/dist/esm/{internal-calendar-period-factory-3a07dba0.js → internal-calendar-period-factory-7b294fb6.js} +1 -1
  211. package/dist/esm/{internal-translation-controller-16709132.js → internal-translation-controller-fac22598.js} +7 -0
  212. package/dist/esm/{keyboard-manager-a0c3e1cf.js → keyboard-manager-50da85d7.js} +1 -1
  213. package/dist/esm/{keyboard-manager-slimmer-f3f66c15.js → keyboard-manager-slimmer-1f7c8bfb.js} +1 -1
  214. package/dist/esm/{link-extension-97fcb8fb.js → link-extension-f92c06ef.js} +3 -3
  215. package/dist/esm/loader.js +12 -12
  216. package/dist/esm/{month-view-generator-fd0e1856.js → month-view-generator-a1a9a4ec.js} +1 -1
  217. package/dist/esm/{public-rules-c06f0d2a.js → public-rules-3695aaf7.js} +7 -7
  218. package/dist/esm/{range-e999837f.js → range-717d552d.js} +1 -1
  219. package/dist/esm/{responsive-format-facade-ced96b0b.js → responsive-format-facade-f19b601c.js} +1 -1
  220. package/dist/esm/{rich-text-editor-required-rule-71f8ee98.js → rich-text-editor-required-rule-2e39264a.js} +1 -1
  221. package/dist/esm/{split-cell-operation-359f8082.js → split-cell-operation-6c26af91.js} +3 -3
  222. package/dist/esm/{state-border-formatter-b680e922.js → state-border-formatter-bfda33aa.js} +1 -1
  223. package/dist/esm/{string-format-strategy.abstract-23faab71.js → string-format-strategy.abstract-1f4ff1b3.js} +1 -1
  224. package/dist/esm/{string-input-formatter-slimmer-4b4866a6.js → string-input-formatter-slimmer-68b2af39.js} +1 -1
  225. package/dist/esm/{string-mask-strategy-66586cd8.js → string-mask-strategy-bbbcdbef.js} +2 -2
  226. package/dist/esm/{style-formatter-f4e16af5.js → style-formatter-e9adc8f4.js} +2 -2
  227. package/dist/esm/{time-required-rule-6e80a9ab.js → time-required-rule-1ce2d0a0.js} +1 -1
  228. package/dist/esm/{token-extension-f5bf9c21.js → token-extension-5082a4d2.js} +33 -9
  229. package/dist/esm/{translation-slimmer-21748a0e.js → translation-slimmer-ee0f0e76.js} +1 -1
  230. package/dist/esm/{type-guard-ec5e8628.js → type-guard-f2624334.js} +1 -1
  231. package/dist/esm/{valid-credit-card-number-rule-ca5a47d6.js → valid-credit-card-number-rule-60212b1d.js} +1 -1
  232. package/dist/esm/vega-accordion.entry.js +6 -6
  233. package/dist/esm/vega-app-header-button.entry.js +5 -5
  234. package/dist/esm/vega-backdrop.entry.js +63 -8
  235. package/dist/esm/vega-box.entry.js +6 -6
  236. package/dist/esm/vega-button-circle.entry.js +5 -5
  237. package/dist/esm/vega-button.entry.js +3 -3
  238. package/dist/esm/vega-calendar_5.entry.js +7 -7
  239. package/dist/esm/vega-card.entry.js +5 -5
  240. package/dist/esm/vega-carousel.entry.js +3 -3
  241. package/dist/esm/vega-checkbox_2.entry.js +20 -3
  242. package/dist/esm/vega-chip.entry.js +5 -5
  243. package/dist/esm/vega-code-block.entry.js +8 -8
  244. package/dist/esm/vega-color-picker.entry.js +11 -2
  245. package/dist/esm/vega-color-swatch-picker.entry.js +12 -3
  246. package/dist/esm/vega-color-swatch.entry.js +2 -2
  247. package/dist/esm/vega-combo-box.entry.js +17 -8
  248. package/dist/esm/vega-date-picker_2.entry.js +22 -13
  249. package/dist/esm/vega-dialog_2.entry.js +3 -3
  250. package/dist/esm/vega-divider.entry.js +5 -5
  251. package/dist/esm/vega-dropdown_5.entry.js +33 -10
  252. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  253. package/dist/esm/vega-field-label.entry.js +2 -2
  254. package/dist/esm/vega-file-uploader.entry.js +12 -3
  255. package/dist/esm/vega-flag-icon.entry.js +5 -5
  256. package/dist/esm/vega-flex.entry.js +6 -6
  257. package/dist/esm/vega-font.entry.js +5 -5
  258. package/dist/esm/vega-form.entry.js +28 -25
  259. package/dist/esm/vega-grid.entry.js +5 -5
  260. package/dist/esm/vega-icon.entry.js +5 -5
  261. package/dist/esm/vega-image-uploader.entry.js +14 -5
  262. package/dist/esm/vega-input-credit-card.entry.js +16 -7
  263. package/dist/esm/vega-input-numeric.entry.js +14 -5
  264. package/dist/esm/vega-input-passcode.entry.js +14 -5
  265. package/dist/esm/vega-input-phone-number.entry.js +13 -4
  266. package/dist/esm/vega-input-range.entry.js +12 -3
  267. package/dist/esm/vega-input-select.entry.js +14 -5
  268. package/dist/esm/vega-input.entry.js +9 -7
  269. package/dist/esm/vega-left-nav_5.entry.js +71 -11
  270. package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
  271. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
  272. package/dist/esm/vega-pagination.entry.js +4 -4
  273. package/dist/esm/vega-popover_2.entry.js +8 -8
  274. package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
  275. package/dist/esm/vega-radio_2.entry.js +17 -5
  276. package/dist/esm/vega-rich-text-content.entry.js +86 -14
  277. package/dist/esm/vega-rich-text-editor_4.entry.js +2118 -447
  278. package/dist/esm/vega-rich-text-find-replace-panel.entry.js +1 -1
  279. package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
  280. package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
  281. package/dist/esm/vega-section-title.entry.js +897 -15
  282. package/dist/esm/vega-selection-chip_2.entry.js +13 -4
  283. package/dist/esm/vega-selection-tile_2.entry.js +11 -2
  284. package/dist/esm/vega-sidenav_3.entry.js +3 -3
  285. package/dist/esm/vega-signature-capture.entry.js +16 -7
  286. package/dist/esm/vega-stepper.entry.js +12 -3
  287. package/dist/esm/vega-table_11.entry.js +4 -4
  288. package/dist/esm/vega-textarea.entry.js +12 -3
  289. package/dist/esm/vega-time-picker_2.entry.js +18 -9
  290. package/dist/esm/vega-toggle-switch.entry.js +12 -3
  291. package/dist/esm/vega-tooltip_2.entry.js +6 -6
  292. package/dist/esm/vega.js +12 -12
  293. package/dist/sri/vega-sri-manifest.json +319 -315
  294. package/dist/types/components/vega-backdrop/slimmers/controller/vega-backdrop-visible-controller.d.ts +21 -0
  295. package/dist/types/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.d.ts +9 -1
  296. package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +9 -1
  297. package/dist/types/components/vega-color-picker/vega-color-picker.d.ts +9 -1
  298. package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.d.ts +9 -1
  299. package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +15 -7
  300. package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +9 -1
  301. package/dist/types/components/vega-dropdown/types.d.ts +2 -2
  302. package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +32 -9
  303. package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +9 -1
  304. package/dist/types/components/vega-form/slimmers/controllers/vega-form-field-controller.d.ts +3 -2
  305. package/dist/types/components/vega-form/slimmers/renderers/native-form-renderer.d.ts +1 -0
  306. package/dist/types/components/vega-form/vega-form.d.ts +8 -0
  307. package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +9 -1
  308. package/dist/types/components/vega-input/vega-input.d.ts +3 -2
  309. package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +9 -1
  310. package/dist/types/components/vega-input-numeric/vega-input-numeric.d.ts +9 -1
  311. package/dist/types/components/vega-input-passcode/vega-input-passcode.d.ts +9 -1
  312. package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +9 -1
  313. package/dist/types/components/vega-input-range/vega-input-range.d.ts +9 -1
  314. package/dist/types/components/vega-input-select/vega-input-select.d.ts +15 -7
  315. package/dist/types/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-manager.d.ts +7 -0
  316. package/dist/types/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.d.ts +17 -0
  317. package/dist/types/components/vega-radio/vega-radio-group/vega-radio-group.d.ts +5 -1
  318. package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +3 -0
  319. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-annotation-strategy.abstract.d.ts +36 -0
  320. 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
  321. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-items-strategy.abstract.d.ts +22 -0
  322. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-nest-items-strategy.d.ts +21 -0
  323. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.d.ts +14 -0
  324. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.d.ts +15 -0
  325. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.d.ts +30 -3
  326. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.d.ts +99 -3
  327. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-unnest-items-strategy.d.ts +22 -0
  328. package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -0
  329. package/dist/types/components/vega-rich-text-editor/dto/actions/nest-list-items-action.d.ts +11 -0
  330. package/dist/types/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.d.ts +11 -0
  331. package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +8 -0
  332. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +6 -1
  333. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +5 -1
  334. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +2 -2
  335. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +2 -0
  336. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.d.ts +8 -0
  337. package/dist/types/components/vega-rich-text-editor/extensions/link/type.d.ts +34 -0
  338. package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.d.ts +18 -0
  339. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +4 -4
  340. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/keyboard-link-handler.d.ts +111 -0
  341. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +7 -0
  342. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +8 -0
  343. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/abstract-list-keyboard-handler.d.ts +99 -0
  344. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-shift-tab-outdent-handler.d.ts +15 -0
  345. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-tab-indent-handler.d.ts +15 -0
  346. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/list-keyboard-slimmer.d.ts +73 -0
  347. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +9 -1
  348. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.d.ts +149 -0
  349. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-state-manager.d.ts +84 -0
  350. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-type-config-controller.d.ts +82 -0
  351. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/link-type-handler.d.ts +33 -0
  352. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +24 -17
  353. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/utils/link-url-normalizer.d.ts +37 -0
  354. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +4 -0
  355. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.d.ts +12 -0
  356. package/dist/types/components/vega-section-title/slimmers/a11y-tree/build-section-title-a11y-tree.d.ts +41 -0
  357. package/dist/types/components/vega-section-title/vega-section-title.d.ts +9 -0
  358. package/dist/types/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.d.ts +9 -1
  359. package/dist/types/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.d.ts +9 -1
  360. package/dist/types/components/vega-signature-capture/vega-signature-capture.d.ts +9 -1
  361. package/dist/types/components/vega-stepper/vega-stepper.d.ts +9 -1
  362. package/dist/types/components/vega-textarea/vega-textarea.d.ts +9 -1
  363. package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +9 -1
  364. package/dist/types/components/vega-toggle-switch/vega-toggle-switch.d.ts +9 -1
  365. package/dist/types/components.d.ts +297 -14
  366. package/dist/types/helpers/a11y-tree/a11y-node-dto.d.ts +173 -0
  367. package/dist/types/helpers/a11y-tree/a11y-tree-applier.d.ts +28 -0
  368. package/dist/types/helpers/a11y-tree/a11y-tree.types.d.ts +137 -0
  369. package/dist/types/helpers/a11y-tree/strategies/baseline-strategy.d.ts +18 -0
  370. package/dist/types/helpers/a11y-tree/strategies/firefox-nvda-strategy.d.ts +16 -0
  371. package/dist/types/helpers/a11y-tree/strategies/webkit-voiceover-strategy.d.ts +23 -0
  372. package/dist/types/helpers/a11y-tree/strategy-resolver.d.ts +59 -0
  373. package/dist/types/helpers/slimmers/a11y-tree-slimmer.d.ts +49 -0
  374. package/dist/types/helpers/slimmers/element-appender/element-appender-slimmer.d.ts +9 -0
  375. package/dist/types/helpers/slimmers/element-appender/visibility-modifiers/clip-on-scroll-modifier.d.ts +37 -0
  376. package/dist/types/helpers/slimmers/element-appender/visibility-modifiers/visibility-modifier.interface.d.ts +56 -0
  377. package/dist/types/helpers/slimmers/{field-error-controller-silmmer.d.ts → form/field-error-controller-silmmer.d.ts} +1 -1
  378. package/dist/types/helpers/slimmers/{field-error-ui-controller-slimmer.d.ts → form/field-error-ui-controller-slimmer.d.ts} +2 -2
  379. package/dist/types/helpers/slimmers/{form-field-controller-slimmer.d.ts → form/form-field-controller-slimmer.d.ts} +6 -14
  380. package/dist/types/helpers/slimmers/{form-field-message-translator.d.ts → form/form-field-message-translator.d.ts} +2 -2
  381. package/dist/types/helpers/slimmers/{form-field-state-controller-slimmer.d.ts → form/form-field-state-controller-slimmer.d.ts} +2 -2
  382. package/dist/types/helpers/slimmers/{form-field-valid-invoke-slimmer.d.ts → form/form-field-valid-invoke-slimmer.d.ts} +3 -3
  383. package/dist/types/helpers/slimmers/form/utils/form-field-key.d.ts +17 -0
  384. package/dist/types/helpers/translation/interface.d.ts +7 -0
  385. package/dist/types/helpers/ui/element-appender.d.ts +7 -0
  386. package/dist/types/helpers/validator/form-field-controller.d.ts +3 -3
  387. package/dist/vega/index.esm.js +1 -1
  388. package/dist/vega/p-040ea356.entry.js +1 -0
  389. package/dist/vega/p-046203cb.entry.js +1 -0
  390. package/dist/vega/p-0499e65a.entry.js +1 -0
  391. package/dist/vega/{p-0be4df0a.js → p-0809c651.js} +1 -1
  392. package/dist/vega/{p-02355de8.js → p-09524fec.js} +1 -1
  393. package/dist/vega/{p-74f86ff9.entry.js → p-0cf3b5c1.entry.js} +1 -1
  394. package/dist/vega/p-10d43a80.entry.js +1 -0
  395. package/dist/vega/{p-3d6f761a.entry.js → p-1132a74e.entry.js} +1 -1
  396. package/dist/vega/{p-ba662fe5.js → p-12e8a1b2.js} +1 -1
  397. package/dist/vega/p-1d5e05d9.js +3 -0
  398. package/dist/vega/{p-3dee1e55.js → p-1e0a8fd3.js} +1 -1
  399. package/dist/vega/{p-919cddc3.js → p-1ea9ad9a.js} +1 -1
  400. package/dist/vega/p-21626b93.entry.js +1 -0
  401. package/dist/vega/p-21f608e8.entry.js +1 -0
  402. package/dist/vega/p-2540fd1c.entry.js +1 -0
  403. package/dist/vega/{p-9f201152.entry.js → p-26760c66.entry.js} +1 -1
  404. package/dist/vega/{p-892edf88.entry.js → p-2acf9b42.entry.js} +1 -1
  405. package/dist/vega/p-2bb60f89.js +1 -0
  406. package/dist/vega/{p-b1eb9ff0.js → p-2c2e8615.js} +1 -1
  407. package/dist/vega/p-2d158cbd.js +1 -0
  408. package/dist/vega/p-2d7388c9.entry.js +1 -0
  409. package/dist/vega/{p-b3a2ce06.entry.js → p-2eb8e167.entry.js} +1 -1
  410. package/dist/vega/p-2ff4ae1c.js +1 -0
  411. package/dist/vega/p-3488a3f1.entry.js +1 -0
  412. package/dist/vega/p-363ee8a5.entry.js +1 -0
  413. package/dist/vega/p-36c89520.entry.js +1 -0
  414. package/dist/vega/{p-e1737c8e.entry.js → p-3980dfa8.entry.js} +1 -1
  415. package/dist/vega/{p-14baa886.js → p-39c5054b.js} +1 -1
  416. package/dist/vega/p-3af5e87b.entry.js +1 -0
  417. package/dist/vega/{p-8db904dc.js → p-456f678b.js} +1 -1
  418. package/dist/vega/{p-6c9c2f8c.entry.js → p-461100b8.entry.js} +1 -1
  419. package/dist/vega/p-4c3a08be.entry.js +1 -0
  420. package/dist/vega/p-53fd3c41.entry.js +1 -0
  421. package/dist/vega/{p-6fcec7c7.entry.js → p-56417ec5.entry.js} +1 -1
  422. package/dist/vega/{p-8a001caa.js → p-5e37b041.js} +1 -1
  423. package/dist/vega/p-5f377954.js +1 -1
  424. package/dist/vega/{p-a0a58295.entry.js → p-5f96e741.entry.js} +1 -1
  425. package/dist/vega/p-65fee02f.entry.js +1 -0
  426. package/dist/vega/p-6b76b572.entry.js +1 -0
  427. package/dist/vega/{p-75e33859.js → p-6c95a6a3.js} +1 -1
  428. package/dist/vega/p-703ac992.entry.js +1 -0
  429. package/dist/vega/p-71909102.js +1 -0
  430. package/dist/vega/{p-e1b57e8f.entry.js → p-72ab5cd5.entry.js} +1 -1
  431. package/dist/vega/{p-8720816e.js → p-781b7a54.js} +1 -1
  432. package/dist/vega/{p-7950f3e2.entry.js → p-81d4dfcb.entry.js} +1 -1
  433. package/dist/vega/p-8611465f.entry.js +1 -0
  434. package/dist/vega/{p-0d18368b.js → p-874e5624.js} +1 -1
  435. package/dist/vega/{p-4fe40b76.js → p-8e7932bc.js} +1 -1
  436. package/dist/vega/p-8ed3b2b6.entry.js +1 -0
  437. package/dist/vega/{p-9c39f90b.entry.js → p-8ff92914.entry.js} +1 -1
  438. package/dist/vega/{p-9bdc6e11.entry.js → p-92528dc9.entry.js} +1 -1
  439. package/dist/vega/p-9664e914.entry.js +1 -0
  440. package/dist/vega/p-98fc5821.entry.js +1 -0
  441. package/dist/vega/{p-fe24b459.js → p-9be02fa5.js} +1 -1
  442. package/dist/vega/p-9c4c474e.entry.js +1 -0
  443. package/dist/vega/{p-8354cff0.entry.js → p-a034dfc0.entry.js} +1 -1
  444. package/dist/vega/{p-e48a870f.entry.js → p-a484e32d.entry.js} +1 -1
  445. package/dist/vega/{p-b9e72de2.entry.js → p-a8174ad8.entry.js} +1 -1
  446. package/dist/vega/{p-49e1cf4d.entry.js → p-a91927eb.entry.js} +1 -1
  447. package/dist/vega/{p-b187b82d.entry.js → p-abbceebf.entry.js} +1 -1
  448. package/dist/vega/{p-e4266b45.entry.js → p-ac94ba1b.entry.js} +1 -1
  449. package/dist/vega/{p-b775e51f.js → p-ae2abdfa.js} +1 -1
  450. package/dist/vega/{p-bb60e381.entry.js → p-aeb50cad.entry.js} +1 -1
  451. package/dist/vega/{p-a890d60b.entry.js → p-b00ec194.entry.js} +1 -1
  452. package/dist/vega/{p-f78944d7.entry.js → p-b3733762.entry.js} +1 -1
  453. package/dist/vega/p-b594a11c.entry.js +1 -0
  454. package/dist/vega/{p-b4e7c967.js → p-b622c455.js} +1 -1
  455. package/dist/vega/{p-1232b553.entry.js → p-b98ead05.entry.js} +1 -1
  456. package/dist/vega/{p-e5ff77f7.entry.js → p-c2277448.entry.js} +1 -1
  457. package/dist/vega/{p-9f7154d2.js → p-c29934ef.js} +1 -1
  458. package/dist/vega/p-c3646101.entry.js +1 -0
  459. package/dist/vega/p-ca270da3.entry.js +1 -0
  460. package/dist/vega/{p-b4c26035.entry.js → p-ccbe3f1b.entry.js} +1 -1
  461. package/dist/vega/{p-6cde45fc.js → p-cd69aeae.js} +1 -1
  462. package/dist/vega/{p-579cdeae.js → p-d25c1a48.js} +1 -1
  463. package/dist/vega/{p-5924adae.entry.js → p-d2cbcf5e.entry.js} +1 -1
  464. package/dist/vega/{p-df828d90.entry.js → p-d3413a78.entry.js} +1 -1
  465. package/dist/vega/{p-f1974321.js → p-d609c3fd.js} +1 -1
  466. package/dist/vega/{p-a7209700.js → p-dad7d2ac.js} +1 -1
  467. package/dist/vega/{p-61ce8029.js → p-dbb4b1d1.js} +1 -1
  468. package/dist/vega/p-dcd3e3a7.js +1 -0
  469. package/dist/vega/p-de8f0d98.js +1 -0
  470. package/dist/vega/{p-e235020b.entry.js → p-deaf037a.entry.js} +1 -1
  471. package/dist/vega/p-e1029acc.js +1 -0
  472. package/dist/vega/p-e18c0656.entry.js +1 -0
  473. package/dist/vega/p-e3fdb65c.entry.js +1 -0
  474. package/dist/vega/p-e7e963ba.entry.js +1 -0
  475. package/dist/vega/{p-f7e459cd.js → p-e9b005df.js} +1 -1
  476. package/dist/vega/{p-88be9ec5.js → p-e9d09211.js} +1 -1
  477. package/dist/vega/{p-3c309a38.js → p-f1078e63.js} +1 -1
  478. package/dist/vega/{p-595998d9.entry.js → p-f29ea345.entry.js} +1 -1
  479. package/dist/vega/p-f5095035.entry.js +1 -0
  480. package/dist/vega/{p-05d04c07.entry.js → p-f95d8d10.entry.js} +1 -1
  481. package/dist/vega/vega.esm.js +1 -1
  482. package/package.json +3 -2
  483. package/dist/vega/p-0512308f.entry.js +0 -1
  484. package/dist/vega/p-1d8312d3.entry.js +0 -1
  485. package/dist/vega/p-2d77ae73.entry.js +0 -1
  486. package/dist/vega/p-2d8d4d5b.entry.js +0 -1
  487. package/dist/vega/p-320091b7.js +0 -1
  488. package/dist/vega/p-36949349.js +0 -1
  489. package/dist/vega/p-38c9d782.js +0 -1
  490. package/dist/vega/p-4151f53a.entry.js +0 -1
  491. package/dist/vega/p-4ff48b84.js +0 -1
  492. package/dist/vega/p-513bc0d9.js +0 -1
  493. package/dist/vega/p-5e4517eb.entry.js +0 -1
  494. package/dist/vega/p-6680ba17.entry.js +0 -1
  495. package/dist/vega/p-80b7945a.entry.js +0 -1
  496. package/dist/vega/p-841b3281.entry.js +0 -1
  497. package/dist/vega/p-87e5cb56.entry.js +0 -1
  498. package/dist/vega/p-8d4b85e7.entry.js +0 -1
  499. package/dist/vega/p-91303402.entry.js +0 -1
  500. package/dist/vega/p-97215133.js +0 -1
  501. package/dist/vega/p-9d96d83f.entry.js +0 -1
  502. package/dist/vega/p-a05a2f1e.entry.js +0 -1
  503. package/dist/vega/p-a775825e.entry.js +0 -1
  504. package/dist/vega/p-ae146458.entry.js +0 -1
  505. package/dist/vega/p-b8c13ac9.entry.js +0 -1
  506. package/dist/vega/p-ba2b9663.entry.js +0 -1
  507. package/dist/vega/p-bbad318e.entry.js +0 -1
  508. package/dist/vega/p-c079c935.entry.js +0 -1
  509. package/dist/vega/p-c0e42c03.entry.js +0 -1
  510. package/dist/vega/p-c41f5684.entry.js +0 -1
  511. package/dist/vega/p-c54b5a8f.entry.js +0 -1
  512. package/dist/vega/p-c5d3b008.entry.js +0 -1
  513. package/dist/vega/p-cd1e976c.entry.js +0 -1
  514. package/dist/vega/p-d25ca0c3.entry.js +0 -1
  515. package/dist/vega/p-ebe32b25.entry.js +0 -1
  516. package/dist/vega/p-ec162599.entry.js +0 -1
  517. package/dist/vega/p-f4da615a.js +0 -3
  518. package/dist/vega/p-fc7e4c8a.entry.js +0 -1
@@ -5,7 +5,7 @@ const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-facto
5
5
  const vegaInternalEventId = require('./vega-internal-event-id-ecc5b87a.js');
6
6
  const string = require('./string-39438062.js');
7
7
  const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
8
- const typeGuard = require('./type-guard-f354af8b.js');
8
+ const typeGuard = require('./type-guard-a57ef3ac.js');
9
9
  const typography = require('./typography-3ea4fe41.js');
10
10
  const misc = require('./misc-3d30df91.js');
11
11
  const darkModeStyleController = require('./dark-mode-style-controller-32d4054a.js');
@@ -139,6 +139,8 @@ exports.ModifyContentActionType = void 0;
139
139
  ModifyContentActionType["LINE_BREAK_MULTIPLE_BLOCKS"] = "LINE_BREAK_MULTIPLE_BLOCKS";
140
140
  ModifyContentActionType["TRANSFORM_LIST_BLOCK"] = "TRANSFORM_LIST_BLOCK";
141
141
  ModifyContentActionType["TRANSFORM_PARAGRAPH_BLOCK"] = "TRANSFORM_PARAGRAPH_BLOCK";
142
+ ModifyContentActionType["NEST_LIST_ITEMS"] = "NEST_LIST_ITEMS";
143
+ ModifyContentActionType["UNNEST_LIST_ITEMS"] = "UNNEST_LIST_ITEMS";
142
144
  ModifyContentActionType["DELETE_BLOCK_CONTENT"] = "DELETE_BLOCK_CONTENT";
143
145
  ModifyContentActionType["INSERT_IMAGE_TO_BLOCK"] = "INSERT_IMAGE_TO_BLOCK";
144
146
  ModifyContentActionType["UPDATE_IMAGE_NODE_URL"] = "UPDATE_IMAGE_NODE_URL";
@@ -2406,6 +2408,9 @@ const HTML_VOID_TAGS = new Set([
2406
2408
  * This value is based on the paragraph line-height and padding of text content.
2407
2409
  */
2408
2410
  const VegaRTEOneRowHeightPx = 22;
2411
+ const RTE_DEFAULT_LINK_TYPE_KEY = 'url';
2412
+ const RTE_EMAIL_LINK_TYPE_KEY = 'email';
2413
+ const RTE_SUPPORTED_LINK_TYPE_KEYS = [RTE_DEFAULT_LINK_TYPE_KEY, RTE_EMAIL_LINK_TYPE_KEY];
2409
2414
 
2410
2415
  /**
2411
2416
  * Annotation to make text with text color
@@ -4261,6 +4266,37 @@ class BlockInsertImageIntoTextStrategy extends ActionHandleStrategy {
4261
4266
  }
4262
4267
  }
4263
4268
 
4269
+ /**
4270
+ * Normalize a mixed paragraph/list selection before rebuilding it as a list.
4271
+ *
4272
+ * Selected list items whose owning ancestor item is also selected remain inside
4273
+ * that ancestor's nestList instead of being emitted again as flattened siblings.
4274
+ * Their immediate list type is still updated because the nested item was part of
4275
+ * the toolbar selection.
4276
+ *
4277
+ * @param {RTEBlock[]} selectedBlocks - Blocks selected by the toolbar action.
4278
+ * @param {ListType} listType - Target list type.
4279
+ * @returns {RTEBlock[]} Top-level selected blocks to emit into the rebuilt list.
4280
+ */
4281
+ function normalizeMixedListSelection(selectedBlocks, listType) {
4282
+ const selectedListItems = new Set(selectedBlocks.filter((block) => block.dtoName === 'RTEListItemBlock'));
4283
+ return selectedBlocks.filter((block) => {
4284
+ if (!(block.dtoName === 'RTEListItemBlock')) {
4285
+ return true;
4286
+ }
4287
+ let parentList = block.parent;
4288
+ while (parentList.parent && parentList.parent.dtoName === 'RTEListItemBlock') {
4289
+ const ownerItem = parentList.parent;
4290
+ if (selectedListItems.has(ownerItem)) {
4291
+ block.parent.type = listType;
4292
+ return false;
4293
+ }
4294
+ parentList = ownerItem.parent;
4295
+ }
4296
+ return true;
4297
+ });
4298
+ }
4299
+
4264
4300
  /**
4265
4301
  * Convert the selected blocks to list strategy.
4266
4302
  */
@@ -4272,12 +4308,16 @@ class BlockTransformToListStrategy extends ActionHandleStrategy {
4272
4308
  * @param {RTETextBlock} target - The first item of the selected block.
4273
4309
  */
4274
4310
  handleAction(action, target) {
4275
- const contentState = target.parent;
4311
+ const contentState = this.getRootContent(target);
4312
+ if (!contentState) {
4313
+ return;
4314
+ }
4315
+ const container = target.parent;
4276
4316
  const bulletList = contentState.createList(action.listType);
4277
- const selectedBlocks = action.selectedBlocks;
4317
+ const selectedBlocks = normalizeMixedListSelection(action.selectedBlocks, action.listType);
4278
4318
  const listItems = selectedBlocks.map((block) => contentState.toListItem(block));
4279
4319
  bulletList.apply(new AppendChildrenAction(listItems));
4280
- contentState.apply(new InsertChildrenAfterAction(action.selectedBlocks[0], bulletList));
4320
+ container.apply(new InsertChildrenAfterAction(action.selectedBlocks[0], bulletList));
4281
4321
  selectedBlocks.forEach((block) => {
4282
4322
  block.parent.apply(new RemoveChildrenAction(block));
4283
4323
  });
@@ -4674,78 +4714,1485 @@ class RTETextBlock extends RTEBlock {
4674
4714
  RTETextBlock.dtoName = 'RTETextBlock';
4675
4715
 
4676
4716
  /**
4677
- * The delete node content contains some common functions that used for image block delete the image node or text block delete text node.
4717
+ * Remove list item nest list block strategy.
4678
4718
  */
4679
- class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
4719
+ class ListItemRemoveNestListStrategy extends ActionHandleStrategy {
4680
4720
  /**
4681
- * Returns the previous node relative to the current node in a rich text editor structure.
4721
+ * Remove the nest list block from the list item, clear the property children when the children is empty.
4682
4722
  *
4683
- * @param {RTENode} currentNode - An object of type `RTENode`.
4684
- * @returns {Nullable<RTENode>} the previous block last node
4723
+ * @param {RemoveNestListAction} action - The action instance.
4724
+ * @param {RTEListItemBlock} target - The list item block.
4685
4725
  */
4686
- getPreviousNode(currentNode) {
4687
- const currentBlock = currentNode.parent;
4688
- const currentIndex = currentBlock.children.indexOf(currentNode);
4689
- if (currentIndex > 0) {
4690
- return currentBlock.children[currentIndex - 1];
4726
+ handleAction(action, target) {
4727
+ if (target.nestList) {
4728
+ if (target.nestList.length > 1) {
4729
+ target.nestList = target.nestList.filter((child) => child !== action.nestListBlockToBeRemoved);
4730
+ }
4731
+ else {
4732
+ target.nestList = undefined;
4733
+ }
4691
4734
  }
4692
- else if (currentBlock.parent) {
4693
- const previousBlock = this.getPreviousBlock(currentBlock);
4694
- if (previousBlock) {
4695
- return this.getBlockLastNode(previousBlock);
4735
+ }
4736
+ }
4737
+
4738
+ /**
4739
+ * Base strategy for list operations that reconstruct or merge list containers.
4740
+ * Keeps annotation cloning and equality rules consistent across those operations.
4741
+ */
4742
+ class ListAnnotationStrategy extends ActionHandleStrategy {
4743
+ /**
4744
+ * Copy list-container annotations without sharing mutable annotation instances.
4745
+ * Factory-provided defaults remain intact unless the source supplies the same key.
4746
+ *
4747
+ * @param {RTEListBlock} source - List whose annotations should be copied.
4748
+ * @param {RTEListBlock} target - Newly created list receiving the annotations.
4749
+ */
4750
+ copyListAnnotations(source, target) {
4751
+ source.annotationMap.forEach((annotation, key) => {
4752
+ target.annotationMap.set(key, annotation.clone());
4753
+ });
4754
+ }
4755
+ /**
4756
+ * Compare list annotations independently of map/object insertion order. Map keys
4757
+ * are compared separately because rendering annotations such as LIST intentionally
4758
+ * do not serialize to the DTO but still affect the rendered list.
4759
+ * Array order remains significant because it can affect rendered class order.
4760
+ *
4761
+ * @param {RTEListBlock} first - First list to compare.
4762
+ * @param {RTEListBlock} second - Second list to compare.
4763
+ * @returns {boolean} Whether both list containers have equivalent annotations.
4764
+ */
4765
+ haveSameListAnnotations(first, second) {
4766
+ var _a, _b;
4767
+ const firstKeys = Array.from(first.annotationMap.keys()).sort();
4768
+ const secondKeys = Array.from(second.annotationMap.keys()).sort();
4769
+ if (JSON.stringify(firstKeys) !== JSON.stringify(secondKeys)) {
4770
+ return false;
4771
+ }
4772
+ return (JSON.stringify(this.normalizeAnnotationValue((_a = first.toJSON().annotations) !== null && _a !== void 0 ? _a : {})) ===
4773
+ JSON.stringify(this.normalizeAnnotationValue((_b = second.toJSON().annotations) !== null && _b !== void 0 ? _b : {})));
4774
+ }
4775
+ /**
4776
+ * Recursively sort object keys for stable annotation comparison.
4777
+ *
4778
+ * @param {unknown} value - Annotation value to normalize.
4779
+ * @returns {unknown} Normalized annotation value.
4780
+ */
4781
+ normalizeAnnotationValue(value) {
4782
+ if (Array.isArray(value)) {
4783
+ return value.map((item) => this.normalizeAnnotationValue(item));
4784
+ }
4785
+ if (value && typeof value === 'object') {
4786
+ const record = value;
4787
+ return Object.keys(record)
4788
+ .sort()
4789
+ .reduce((normalized, key) => {
4790
+ normalized[key] = this.normalizeAnnotationValue(record[key]);
4791
+ return normalized;
4792
+ }, {});
4793
+ }
4794
+ return value;
4795
+ }
4796
+ }
4797
+
4798
+ /**
4799
+ * Replace list item nest list strategy.
4800
+ *
4801
+ * This is the single write-through point for `nestList` mutations. It automatically
4802
+ * normalizes the incoming array by merging adjacent lists only when their types
4803
+ * and container annotations match. Styled list boundaries remain independent.
4804
+ */
4805
+ class ListItemReplaceNestListStrategy extends ListAnnotationStrategy {
4806
+ /**
4807
+ * @inheritDoc
4808
+ */
4809
+ handleAction(action, target) {
4810
+ const normalized = this.mergeAdjacentSameType(action.newList);
4811
+ normalized.forEach((listBlock) => {
4812
+ listBlock.parent = target;
4813
+ });
4814
+ target.nestList = normalized;
4815
+ }
4816
+ /**
4817
+ * Merge adjacent entries that share the same list type and annotations.
4818
+ * This is an idempotent O(n) pass — calling it on an already-normalized array is a no-op.
4819
+ *
4820
+ * @param {RTEListBlock[]} lists - The nest list array to normalize.
4821
+ * @returns {RTEListBlock[]} A new array with adjacent same-type entries merged.
4822
+ */
4823
+ mergeAdjacentSameType(lists) {
4824
+ if (lists.length <= 1) {
4825
+ return lists;
4826
+ }
4827
+ const merged = [lists[0]];
4828
+ for (let i = 1; i < lists.length; i++) {
4829
+ const prev = merged[merged.length - 1];
4830
+ const current = lists[i];
4831
+ if (prev.type === current.type && this.haveSameListAnnotations(prev, current)) {
4832
+ current.children.forEach((item) => {
4833
+ item.parent = prev;
4834
+ });
4835
+ prev.children = prev.children.concat(current.children);
4836
+ }
4837
+ else {
4838
+ merged.push(current);
4696
4839
  }
4697
4840
  }
4841
+ return merged;
4698
4842
  }
4843
+ }
4844
+
4845
+ /**
4846
+ * Insert image node to list item block strategy.
4847
+ */
4848
+ class ListItemInsertImageStrategy extends ActionHandleStrategy {
4699
4849
  /**
4700
- * Returns the next node relative to the current node in a rich text editor structure.
4850
+ * The image node can not insert into list item block, so insert image after parent list block.
4701
4851
  *
4702
- * @param {RTENode} currentNode - An object of type `RTENode`.
4703
- * @returns {Nullable<RTENode>} the next block first node
4852
+ * @param {InsertImageToBlockAction} action - The action instance.
4853
+ * @param {RTEListItemBlock} target - The list item block.
4704
4854
  */
4705
- getNextNode(currentNode) {
4706
- const currentBlock = currentNode.parent;
4707
- const currentIndex = currentBlock.children.indexOf(currentNode);
4708
- if (currentBlock.children[currentIndex + 1]) {
4709
- return currentBlock.children[currentIndex + 1];
4855
+ handleAction(action, target) {
4856
+ target.parent.apply(action);
4857
+ }
4858
+ }
4859
+
4860
+ /**
4861
+ * List item block.
4862
+ *
4863
+ * Bidirectional nesting contract:
4864
+ * - nestList stores nested list blocks owned by this list item.
4865
+ * - Every nested list block must have listBlock.parent === this list item.
4866
+ */
4867
+ class RTEListItemBlock extends RTETextBlock {
4868
+ constructor(id, nestList, options) {
4869
+ super(id, 'list-item', options);
4870
+ this.dtoName = RTEListItemBlock.dtoName;
4871
+ /**
4872
+ * TODO: Refactor the list item properties children and nestList, merge two properties together.
4873
+ *
4874
+ * 1. Update the type of `children` to include `RTEListBlock` as a possible type.
4875
+ * 2. The list block children should text block array and nest list block array, The text block should wrap a `li` tag when rendering.
4876
+ */
4877
+ this.nestList = [];
4878
+ this.nestList = nestList;
4879
+ }
4880
+ /**
4881
+ * Converts a VegaRTEListItemBlock object to an RTEListItemBlock
4882
+ *
4883
+ * @param {VegaRTEListBlock} block - Converts a `VegaRTEListItemBlock` object into an `RTEListItemBlock`.
4884
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
4885
+ * @returns {RTEListItemBlock} Return an instance of `RTEListItemBlock`
4886
+ */
4887
+ static from(block, options = { autoMatchFormat: true }) {
4888
+ const listItemBlock = new RTEListItemBlock(block.id, undefined, options);
4889
+ listItemBlock.children = block.nodes.map((richText) => RTETextNode.from(richText, listItemBlock, options));
4890
+ if (block.children) {
4891
+ listItemBlock.nestList = block.children.map((child) => {
4892
+ const listBlock = RTEListBlock.from(child, options);
4893
+ listBlock.parent = listItemBlock;
4894
+ return listBlock;
4895
+ });
4710
4896
  }
4711
- else if (currentBlock.parent) {
4712
- const nextBlock = this.getNextBlock(currentBlock);
4713
- if (nextBlock) {
4714
- return this.getBlockFirstNode(nextBlock);
4897
+ const { annotations } = block;
4898
+ if (annotations) {
4899
+ Object.entries(annotations).forEach(([type, value]) => {
4900
+ const item = this.createAnnotationEntity(type, value);
4901
+ if (typeGuard.isNonNullable(item)) {
4902
+ listItemBlock.annotationMap.set(...item);
4903
+ }
4904
+ });
4905
+ }
4906
+ return listItemBlock;
4907
+ }
4908
+ /**
4909
+ * @inheritDoc
4910
+ */
4911
+ toJSON() {
4912
+ var _a;
4913
+ return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.nestList) === null || _a === void 0 ? void 0 : _a.map((block) => block.toJSON()) });
4914
+ }
4915
+ /**
4916
+ * @inheritDoc
4917
+ */
4918
+ toHtml(options) {
4919
+ var _a;
4920
+ const attrStr = super.generateAttributeString(options);
4921
+ const nestListHtml = ((_a = this.nestList) === null || _a === void 0 ? void 0 : _a.length)
4922
+ ? this.nestList.map((list) => list.toHtml(options)).join('')
4923
+ : '';
4924
+ return [`<li${attrStr}>`, this.getChildrenHtml(options), nestListHtml, `</li>`].join('');
4925
+ }
4926
+ /**
4927
+ * @inheritDoc
4928
+ */
4929
+ cloneWithNodes(nodes) {
4930
+ const block = new RTEListItemBlock(misc.generateUUID());
4931
+ block.children = [];
4932
+ block.apply(new AppendChildrenAction(nodes));
4933
+ return block;
4934
+ }
4935
+ /**
4936
+ * @inheritDoc
4937
+ */
4938
+ getLastNode() {
4939
+ if (this.nestList && this.nestList.length > 0) {
4940
+ const childListBlock = this.nestList[this.nestList.length - 1];
4941
+ return childListBlock.getLastNode();
4942
+ }
4943
+ return super.getLastNode();
4944
+ }
4945
+ /**
4946
+ * Create a new list item block.
4947
+ *
4948
+ * @returns {RTEListItemBlock} - A list item block.
4949
+ */
4950
+ createNewListItem() {
4951
+ return new RTEListItemBlock(misc.generateUUID());
4952
+ }
4953
+ /**
4954
+ * @inheritDoc
4955
+ */
4956
+ clone(parent) {
4957
+ var _a;
4958
+ const block = new RTEListItemBlock(this.id);
4959
+ block.children = this.children.map((node) => node.clone(block));
4960
+ block.annotationMap = super.cloneAnnotations();
4961
+ block.nestList = (_a = this.nestList) === null || _a === void 0 ? void 0 : _a.map((child) => child.clone(block));
4962
+ block.parent = parent;
4963
+ return block;
4964
+ }
4965
+ }
4966
+ (() => {
4967
+ ActionHandleStrategyRegistry.register(TextStyleAnnotationAction.name, RTEListItemBlock.name, new BlockUpdateTextStyleStrategy());
4968
+ ActionHandleStrategyRegistry.register(HorizontalAlignmentAnnotationAction.name, RTEListItemBlock.name, new BlockUpdateHorizontalAlignmentStrategy());
4969
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEListItemBlock.name, new BlockInsertLineBreakStrategy());
4970
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEListItemBlock.name, new BlockInsertLineBreakWithBlocksStrategy());
4971
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_NEST_LIST, RTEListItemBlock.name, new ListItemRemoveNestListStrategy());
4972
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTEListItemBlock.name, new BlockSplitWithTextNodeStrategy());
4973
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.REPLACE_CHILD_NODES, RTEListItemBlock.name, new BlockReplaceNodesStrategy());
4974
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.REPLACE_NEST_LIST, RTEListItemBlock.name, new ListItemReplaceNestListStrategy());
4975
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTEListItemBlock.name, new BlockMergeNodesStrategy());
4976
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListItemBlock.name, new ListItemInsertImageStrategy());
4977
+ })();
4978
+ RTEListItemBlock.dtoName = 'RTEListItemBlock';
4979
+
4980
+ /**
4981
+ * Replace the nest list with new list array
4982
+ *
4983
+ * @example listItemBlock.apply(new ReplaceNestListAction(newListBlockArray))
4984
+ */
4985
+ class ReplaceNestListAction extends ModifyContentAction {
4986
+ constructor(newList) {
4987
+ super();
4988
+ this.type = exports.ModifyContentActionType.REPLACE_NEST_LIST;
4989
+ this.newList = newList;
4990
+ }
4991
+ }
4992
+
4993
+ /**
4994
+ * Convert the selected blocks to list strategy.
4995
+ */
4996
+ class ListTransformToListStrategy extends ListAnnotationStrategy {
4997
+ /**
4998
+ * @inheritDoc
4999
+ */
5000
+ handleAction(action, target) {
5001
+ var _a;
5002
+ const selectedBlocks = action.selectedBlocks;
5003
+ const isSameList = selectedBlocks.every((block) => block.parent === target);
5004
+ const rootContent = this.getRootContent(target);
5005
+ if (!rootContent) {
5006
+ return;
5007
+ }
5008
+ // Nested list case: target.parent is RTEListItemBlock, not VegaRTEContent.
5009
+ // Replace the entry in the parent item's nestList using the existing ReplaceNestListAction.
5010
+ if (target.parent instanceof RTEListItemBlock) {
5011
+ if (isSameList) {
5012
+ const newList = this.createListFromSource(rootContent, target, action.listType);
5013
+ newList.apply(new AppendChildrenAction(target.children));
5014
+ const parentListItem = target.parent;
5015
+ const newNestList = ((_a = parentListItem.nestList) !== null && _a !== void 0 ? _a : []).map((list) => (list === target ? newList : list));
5016
+ // Adjacent same-type merge is handled automatically by ListItemReplaceNestListStrategy.
5017
+ parentListItem.apply(new ReplaceNestListAction(newNestList));
5018
+ selectedBlocks.forEach((block) => block.children.map((node) => node.apply(new SyncUpSelectionAction())));
5019
+ }
5020
+ else {
5021
+ this.handleCrossListTransform(action, target);
5022
+ }
5023
+ return;
5024
+ }
5025
+ // Root list case: target.parent is VegaRTEContent.
5026
+ // When all selected blocks are list items from different lists, convert each
5027
+ // affected list's type in place (preserving nesting), then normalize adjacent
5028
+ // same-type root lists into one.
5029
+ if (!isSameList && selectedBlocks.every((block) => block instanceof RTEListItemBlock)) {
5030
+ const affectedLists = new Set(selectedBlocks.map((block) => block.parent));
5031
+ // Track which root lists result from conversion (new lists replace old ones).
5032
+ const convertedRootLists = new Set();
5033
+ affectedLists.forEach((list) => {
5034
+ if (list.type !== action.listType) {
5035
+ this.convertListTypeInPlace(list, action.listType);
5036
+ }
5037
+ });
5038
+ // Collect current top-level lists that contain any selected item, grouped
5039
+ // by their root or HTML-block container.
5040
+ const affectedContainers = new Set();
5041
+ selectedBlocks.forEach((block) => {
5042
+ const parentList = block.parent;
5043
+ if (!(parentList.parent instanceof RTEListItemBlock)) {
5044
+ convertedRootLists.add(parentList);
5045
+ affectedContainers.add(parentList.parent);
5046
+ }
5047
+ });
5048
+ // Only merge adjacent root lists when BOTH are affected by this transform.
5049
+ affectedContainers.forEach((container) => {
5050
+ for (let i = 0; i < container.children.length - 1;) {
5051
+ const current = container.children[i];
5052
+ const next = container.children[i + 1];
5053
+ if (current instanceof RTEListBlock &&
5054
+ next instanceof RTEListBlock &&
5055
+ current.type === next.type &&
5056
+ this.haveSameListAnnotations(current, next) &&
5057
+ convertedRootLists.has(current) &&
5058
+ convertedRootLists.has(next)) {
5059
+ current.apply(new AppendChildrenAction([...next.children]));
5060
+ container.apply(new RemoveChildrenAction(next));
5061
+ convertedRootLists.delete(next);
5062
+ }
5063
+ else {
5064
+ i++;
5065
+ }
5066
+ }
5067
+ });
5068
+ selectedBlocks.forEach((block) => block.children.map((node) => node.apply(new SyncUpSelectionAction())));
5069
+ return;
5070
+ }
5071
+ const bulletList = this.createListFromSource(rootContent, target, action.listType);
5072
+ const targetContainer = target.parent;
5073
+ if (isSameList) {
5074
+ // Select one or more list items belonging to the same list, and all items in this list should be updated
5075
+ bulletList.apply(new AppendChildrenAction(target.children));
5076
+ targetContainer.apply(new InsertChildrenAfterAction(target, bulletList));
5077
+ targetContainer.apply(new RemoveChildrenAction(target));
5078
+ selectedBlocks.forEach((block) => block.children.map((node) => node.apply(new SyncUpSelectionAction())));
5079
+ }
5080
+ else {
5081
+ const mixedSelection = normalizeMixedListSelection(action.selectedBlocks, action.listType);
5082
+ const listItems = mixedSelection.map((block) => rootContent.toListItem(block));
5083
+ bulletList.apply(new AppendChildrenAction(listItems));
5084
+ targetContainer.apply(new InsertChildrenAfterAction(target, bulletList));
5085
+ mixedSelection.forEach((block) => {
5086
+ block.parent.apply(new RemoveChildrenAction(block));
5087
+ });
5088
+ if (target.children.length === 0) {
5089
+ targetContainer.apply(new RemoveChildrenAction(target));
4715
5090
  }
4716
5091
  }
4717
5092
  }
4718
5093
  /**
4719
- * Determines if a given node is the first node within the current state.
5094
+ * Convert a single list's type in place, preserving its items and their nested
5095
+ * structure. Root lists are swapped in the content children; nested lists are
5096
+ * swapped inside their parent item's nestList.
4720
5097
  *
4721
- * @param {RTENode} currentNode - An object representing a node in a rich text editor (RTE).
4722
- * @returns {boolean} True or false;
5098
+ * @param {RTEListBlock} list - The list whose type should be converted.
5099
+ * @param {RTEListBlock['type']} listType - The target list type.
4723
5100
  */
4724
- isContentFirstNode(currentNode) {
4725
- const currentBlock = currentNode.parent;
4726
- const currentIndex = currentBlock.children.indexOf(currentNode);
4727
- const parent = currentBlock.parent;
4728
- if (currentBlock.isListItemBlock()) {
4729
- const listParent = parent.parent;
4730
- return (currentIndex === 0 &&
4731
- Array.isArray(parent.children) &&
4732
- parent.children[0] === currentBlock &&
4733
- listParent['type'] !== 'list-item' &&
4734
- Array.isArray(listParent.children) &&
4735
- listParent.children[0] === parent);
5101
+ convertListTypeInPlace(list, listType) {
5102
+ var _a;
5103
+ const rootContent = this.getRootContent(list);
5104
+ if (!rootContent) {
5105
+ return;
5106
+ }
5107
+ const parent = list.parent;
5108
+ const newList = this.createListFromSource(rootContent, list, listType);
5109
+ newList.apply(new AppendChildrenAction([...list.children]));
5110
+ if (parent instanceof RTEListItemBlock) {
5111
+ // Adjacent same-type merge is handled automatically by ListItemReplaceNestListStrategy.
5112
+ const newNestList = ((_a = parent.nestList) !== null && _a !== void 0 ? _a : []).map((entry) => entry === list ? newList : entry);
5113
+ parent.apply(new ReplaceNestListAction(newNestList));
4736
5114
  }
4737
5115
  else {
4738
- return (currentIndex === 0 && Array.isArray(parent.children) && parent.children[0] === currentBlock);
5116
+ parent.apply(new InsertChildrenAfterAction(list, newList));
5117
+ parent.apply(new RemoveChildrenAction(list));
4739
5118
  }
4740
5119
  }
4741
5120
  /**
4742
- * TODO: The getPreviousBlock add nest list support
4743
- * This function retrieves the previous block in a rich text editor, considering different scenarios such as being in a bullet list.
5121
+ * Handle the case where selected blocks span multiple nestLists under the same parent item.
5122
+ * Transform each affected list and then merge adjacent same-type lists.
4744
5123
  *
4745
- * @param {RTEBlock} currentBlock - Used to retrieve the previous block relative to the given `currentBlock` within a rich text editor context.
4746
- * @returns {Nullable<RTEBlock>} The previous block if existing
5124
+ * @param {TransformListAction} action - The transform action with selection and target list type.
5125
+ * @param {RTEListBlock} target - The nested list where transformation starts.
4747
5126
  */
4748
- getPreviousBlock(currentBlock) {
5127
+ handleCrossListTransform(action, target) {
5128
+ if (!(target.parent instanceof RTEListItemBlock)) {
5129
+ return;
5130
+ }
5131
+ const rootContent = this.getRootContent(target);
5132
+ if (!rootContent) {
5133
+ return;
5134
+ }
5135
+ const parentListItem = target.parent;
5136
+ const parentNestLists = parentListItem.nestList;
5137
+ const affectedLists = new Set(action.selectedBlocks
5138
+ .filter((block) => block instanceof RTEListItemBlock)
5139
+ .map((block) => block.parent)
5140
+ .filter((list) => parentNestLists.includes(list)));
5141
+ if (!affectedLists.size) {
5142
+ return;
5143
+ }
5144
+ const newNestList = parentNestLists.map((list) => {
5145
+ if (!affectedLists.has(list)) {
5146
+ return list;
5147
+ }
5148
+ const newList = this.createListFromSource(rootContent, list, action.listType);
5149
+ newList.apply(new AppendChildrenAction(list.children));
5150
+ return newList;
5151
+ });
5152
+ // Adjacent same-type merge is handled automatically by ListItemReplaceNestListStrategy.
5153
+ parentListItem.apply(new ReplaceNestListAction(newNestList));
5154
+ action.selectedBlocks.forEach((block) => block.children.map((node) => node.apply(new SyncUpSelectionAction())));
5155
+ }
5156
+ /**
5157
+ * Create a replacement list through the owning content factory while retaining
5158
+ * the source list's container annotations.
5159
+ *
5160
+ * @param {VegaRTEContent} rootContent - Editor content owning the factory.
5161
+ * @param {RTEListBlock} source - List whose annotations should be retained.
5162
+ * @param {RTEListBlock['type']} listType - Replacement list type.
5163
+ * @returns {RTEListBlock} New annotated list shell.
5164
+ */
5165
+ createListFromSource(rootContent, source, listType) {
5166
+ const list = rootContent.createList(listType);
5167
+ this.copyListAnnotations(source, list);
5168
+ return list;
5169
+ }
5170
+ }
5171
+
5172
+ /**
5173
+ * Action to toggle bullet annotation
5174
+ */
5175
+ class TransformParagraphAction extends ModifyContentAction {
5176
+ constructor(selectedBlocks) {
5177
+ super();
5178
+ this.type = exports.ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK;
5179
+ this.isFlushable = true;
5180
+ this.selectedBlocks = selectedBlocks;
5181
+ }
5182
+ }
5183
+
5184
+ /**
5185
+ * HTML Block
5186
+ */
5187
+ class RTEHtmlBlock extends RTEBlock {
5188
+ constructor(id, htmlTag) {
5189
+ super(id);
5190
+ this.dtoName = RTEHtmlBlock.dtoName;
5191
+ this.type = 'html-block';
5192
+ this.children = [];
5193
+ this.htmlTag = htmlTag;
5194
+ }
5195
+ /**
5196
+ * Converts a VegaRTEHtmlBlock to an RTEHtmlBlock.
5197
+ *
5198
+ * @param {VegaRTEHtmlBlock} block - The VegaRTEHtmlBlock to convert.
5199
+ * @param {VegaRTETransformOptions} [options] - Optional transformation options.
5200
+ * @returns {RTEHtmlBlock} The converted RTEHtmlBlock.
5201
+ */
5202
+ static from(block, options) {
5203
+ const htmlBlock = new RTEHtmlBlock(block.id, block.htmlTag);
5204
+ const { annotations } = block;
5205
+ if (annotations) {
5206
+ super.convertAnnotationsToMap(htmlBlock.annotationMap, annotations);
5207
+ }
5208
+ htmlBlock.children = this.generateBlockChildren(block.children, options, htmlBlock);
5209
+ return htmlBlock;
5210
+ }
5211
+ /**
5212
+ * @inheritDoc
5213
+ */
5214
+ clone(parent) {
5215
+ const clonedBlock = new RTEHtmlBlock(this.id, this.htmlTag);
5216
+ clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
5217
+ clonedBlock.annotationMap = super.cloneAnnotations();
5218
+ clonedBlock.parent = parent;
5219
+ return clonedBlock;
5220
+ }
5221
+ /**
5222
+ * @inheritDoc
5223
+ */
5224
+ getLastNode() {
5225
+ return this.children[this.children.length - 1].getLastNode();
5226
+ }
5227
+ /**
5228
+ * @inheritDoc
5229
+ */
5230
+ isNotEmpty() {
5231
+ // Any RTEHtmlBlock — whether void (hr, br), childless (canvas, iframe),
5232
+ // or with children — represents real user content. Only the default empty
5233
+ // text paragraph should make the editor report as empty.
5234
+ return true;
5235
+ }
5236
+ /**
5237
+ * @inheritDoc
5238
+ */
5239
+ toHtml(options) {
5240
+ const BlockTag = this.htmlTag;
5241
+ const attrStr = super.generateAttributeString(options);
5242
+ // Handle void/self-closing tags (hr, input, col, etc.)
5243
+ // Uses HTML5 syntax without self-closing slash for consistency with img and br tags
5244
+ if (HTML_VOID_TAGS.has(this.htmlTag)) {
5245
+ return `<${BlockTag}${attrStr}>`;
5246
+ }
5247
+ // Handle normal tags with children
5248
+ return [
5249
+ `<${BlockTag}${attrStr}>`,
5250
+ this.children.map((block) => block.toHtml(options)).join(''),
5251
+ `</${BlockTag}>`,
5252
+ ].join('');
5253
+ }
5254
+ /**
5255
+ * @inheritDoc
5256
+ */
5257
+ toJSON() {
5258
+ return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, htmlTag: this.htmlTag, children: this.children.map((child) => child.toJSON()) });
5259
+ }
5260
+ }
5261
+ RTEHtmlBlock.dtoName = 'RTEHtmlBlock';
5262
+
5263
+ /**
5264
+ * Convert the selected list block to paragraph strategy.
5265
+ */
5266
+ class ListTransformToParagraphStrategy extends ListAnnotationStrategy {
5267
+ /**
5268
+ * @inheritDoc
5269
+ */
5270
+ handleAction(action, target) {
5271
+ const selectedSegments = this.getSelectedSegments(action.selectedBlocks);
5272
+ if (selectedSegments.length === 0 || !this.hasConsistentTargetAndRoot(selectedSegments, target)) {
5273
+ return;
5274
+ }
5275
+ this.syncSelection(selectedSegments);
5276
+ [...selectedSegments]
5277
+ .reverse()
5278
+ .forEach((segment) => this.transformSegment(segment));
5279
+ }
5280
+ /**
5281
+ * Ensure the action is applied to the first selected item's parent list and
5282
+ * every selected item belongs to the same editor content.
5283
+ *
5284
+ * @param {RTEListItemBlock[][]} selectedSegments - Normalized selection segments.
5285
+ * @param {RTEListBlock} target - List receiving the transform action.
5286
+ * @returns {boolean} Whether the target and root content are consistent.
5287
+ */
5288
+ hasConsistentTargetAndRoot(selectedSegments, target) {
5289
+ if (selectedSegments[0][0].parent !== target) {
5290
+ return false;
5291
+ }
5292
+ const targetRoot = this.getRootContent(target);
5293
+ return Boolean(targetRoot &&
5294
+ selectedSegments.every((segment) => segment.every((item) => this.getRootContent(item) === targetRoot)));
5295
+ }
5296
+ /**
5297
+ * Capture selected text nodes in document order before reverse-order tree
5298
+ * mutations move them into paragraphs.
5299
+ *
5300
+ * @param {RTEListItemBlock[][]} selectedSegments - Normalized selection segments.
5301
+ */
5302
+ syncSelection(selectedSegments) {
5303
+ selectedSegments.forEach((segment) => {
5304
+ segment.forEach((block) => {
5305
+ block.children.forEach((node) => node.apply(new SyncUpSelectionAction()));
5306
+ });
5307
+ });
5308
+ }
5309
+ /**
5310
+ * Transform one normalized segment without recursively dispatching another
5311
+ * flushable action.
5312
+ *
5313
+ * @param {RTEListItemBlock[]} segment - Contiguous items sharing one parent list.
5314
+ */
5315
+ transformSegment(segment) {
5316
+ const segmentTarget = segment[0].parent;
5317
+ const normalizedAction = new TransformParagraphAction(segment);
5318
+ if (segmentTarget.parent instanceof RTEListItemBlock) {
5319
+ this.handleNestedListCase(normalizedAction, segmentTarget);
5320
+ return;
5321
+ }
5322
+ this.handleRootListCase(normalizedAction, segmentTarget);
5323
+ }
5324
+ /**
5325
+ * Handle the case where the target list is at root level (parent is VegaRTEContent).
5326
+ *
5327
+ * @param {TransformParagraphAction} action - The paragraph transform action.
5328
+ * @param {RTEListBlock} target - The root list being transformed.
5329
+ */
5330
+ handleRootListCase(action, target) {
5331
+ // handleAction validates that the target belongs to an editor content root.
5332
+ const rootContent = this.getRootContent(target);
5333
+ let isSelectedFirstBlock = false;
5334
+ let isSelectedLastBlock = false;
5335
+ const selectedBlocks = action.selectedBlocks;
5336
+ // Build an operation-local insertion sequence. Paragraphs are merge
5337
+ // boundaries; only consecutive same-type promoted lists are merged.
5338
+ const insertionBlocks = [];
5339
+ selectedBlocks.forEach((block) => {
5340
+ var _a;
5341
+ if (block === target.children[0])
5342
+ isSelectedFirstBlock = true;
5343
+ if (block === target.children[target.children.length - 1])
5344
+ isSelectedLastBlock = true;
5345
+ insertionBlocks.push(this.toParagraph(block));
5346
+ for (const nestList of (_a = block.nestList) !== null && _a !== void 0 ? _a : []) {
5347
+ this.appendListBlock(insertionBlocks, nestList);
5348
+ }
5349
+ });
5350
+ if (isSelectedFirstBlock) {
5351
+ target.parent.apply(new InsertChildrenBeforeAction(target, ...insertionBlocks));
5352
+ }
5353
+ else if (isSelectedLastBlock) {
5354
+ target.parent.apply(new InsertChildrenAfterAction(target, ...insertionBlocks));
5355
+ }
5356
+ else {
5357
+ const startIndex = target.children.indexOf(selectedBlocks[0]);
5358
+ const lastIndex = target.children.indexOf(selectedBlocks[selectedBlocks.length - 1]);
5359
+ const firstBulletList = this.createListFromSource(rootContent, target);
5360
+ firstBulletList.apply(new AppendChildrenAction(target.children.slice(0, startIndex)));
5361
+ const lastBulletList = this.createListFromSource(rootContent, target);
5362
+ lastBulletList.apply(new AppendChildrenAction(target.children.slice(lastIndex + 1)));
5363
+ // Merge last insertionBlock with lastBulletList if same type
5364
+ const lastInsertion = insertionBlocks[insertionBlocks.length - 1];
5365
+ if (lastInsertion instanceof RTEListBlock &&
5366
+ lastBulletList.children.length > 0 &&
5367
+ lastInsertion.type === lastBulletList.type &&
5368
+ this.haveSameListAnnotations(lastInsertion, lastBulletList)) {
5369
+ lastInsertion.apply(new AppendChildrenAction(lastBulletList.children));
5370
+ target.parent.apply(new InsertChildrenBeforeAction(target, firstBulletList, ...insertionBlocks));
5371
+ }
5372
+ else {
5373
+ target.parent.apply(new InsertChildrenBeforeAction(target, firstBulletList, ...insertionBlocks, lastBulletList));
5374
+ }
5375
+ target.parent.apply(new RemoveChildrenAction(target));
5376
+ }
5377
+ selectedBlocks.map((block) => {
5378
+ // Clear nestList before removal to prevent ListRemoveListItemStrategy
5379
+ // from promoting the same nested lists a second time.
5380
+ block.nestList = [];
5381
+ target.apply(new RemoveChildrenAction(block));
5382
+ });
5383
+ if (target.children.length === 0) {
5384
+ target.parent.apply(new RemoveChildrenAction(target));
5385
+ }
5386
+ else if (isSelectedFirstBlock) {
5387
+ // When removing the first item(s), a promoted same-type nestList (last
5388
+ // insertionBlock) ends up immediately before the remaining target. Merge
5389
+ // them so the user doesn't see two adjacent same-type lists.
5390
+ const lastInserted = insertionBlocks[insertionBlocks.length - 1];
5391
+ if (lastInserted instanceof RTEListBlock &&
5392
+ lastInserted.type === target.type &&
5393
+ this.haveSameListAnnotations(lastInserted, target)) {
5394
+ lastInserted.apply(new AppendChildrenAction([...target.children]));
5395
+ target.parent.apply(new RemoveChildrenAction(target));
5396
+ }
5397
+ }
5398
+ }
5399
+ /**
5400
+ * Handle the case where the target list is nested (parent is RTEListItemBlock).
5401
+ *
5402
+ * Algorithm:
5403
+ * 1. Build the ancestor path from root list down to the target nested list.
5404
+ * 2. At each level on the path, collect "trailing" items (items after the ancestor).
5405
+ * 3. Trim each list along the path to keep only the "before" portion.
5406
+ * 4. Collect trailing items from all levels + selected item's own nestList children.
5407
+ * 5. Group trailing items into lists by consecutive type.
5408
+ * 6. Insert into content: [before-root-list, paragraphs, ...after-lists].
5409
+ *
5410
+ * @param {TransformParagraphAction} action - The paragraph transform action.
5411
+ * @param {RTEListBlock} target - The nested list being transformed.
5412
+ */
5413
+ handleNestedListCase(action, target) {
5414
+ const selectedBlocks = action.selectedBlocks;
5415
+ const rootContent = this.getRootContent(target);
5416
+ const selectedItem = selectedBlocks[0];
5417
+ const selectedIndex = target.children.indexOf(selectedItem);
5418
+ // Emit each selected item as paragraph + its own nested lists so that
5419
+ // selecting multiple levels never moves a child list past another paragraph.
5420
+ const insertions = [];
5421
+ selectedBlocks.forEach((block) => {
5422
+ var _a;
5423
+ insertions.push(this.toParagraph(block));
5424
+ for (const nestList of (_a = block.nestList) !== null && _a !== void 0 ? _a : []) {
5425
+ this.appendListBlock(insertions, nestList);
5426
+ }
5427
+ });
5428
+ const lastSelectedIndex = target.children.indexOf(selectedBlocks[selectedBlocks.length - 1]);
5429
+ // Collect trailing items from the nested list (items AFTER the last selected)
5430
+ const nestedTrailingItems = target.children.slice(lastSelectedIndex + 1);
5431
+ const ancestorPath = [];
5432
+ let currentList = target;
5433
+ while (currentList.parent instanceof RTEListItemBlock) {
5434
+ const parentItem = currentList.parent;
5435
+ const grandParentList = parentItem.parent;
5436
+ const ancestorIndex = grandParentList.children.indexOf(parentItem);
5437
+ // Collect nestLists of parentItem that are AFTER currentList
5438
+ const parentNestLists = parentItem.nestList;
5439
+ const nestListIndex = parentNestLists.indexOf(currentList);
5440
+ const trailingNestLists = parentNestLists.slice(nestListIndex + 1);
5441
+ ancestorPath.push({ list: grandParentList, ancestorIndex, trailingNestLists });
5442
+ currentList = grandParentList;
5443
+ }
5444
+ // currentList is now the root-level list
5445
+ const rootList = currentList;
5446
+ const rootContainer = rootList.parent;
5447
+ const trailingGroups = [];
5448
+ // 1. Trailing items from the target nested list (same type as target)
5449
+ if (nestedTrailingItems.length > 0) {
5450
+ trailingGroups.push({ items: nestedTrailingItems, sourceList: target });
5451
+ }
5452
+ // 2. Trailing nestLists from ancestors (innermost to outermost)
5453
+ // 3. Trailing items from each ancestor level's list
5454
+ for (const level of ancestorPath) {
5455
+ // Trailing nestLists from the ancestor item
5456
+ for (const trailingNest of level.trailingNestLists) {
5457
+ if (trailingNest.children.length > 0) {
5458
+ trailingGroups.push({ items: [...trailingNest.children], sourceList: trailingNest });
5459
+ }
5460
+ }
5461
+ // Trailing items from ancestor's list (items after the ancestor item)
5462
+ const trailingFromLevel = level.list.children.slice(level.ancestorIndex + 1);
5463
+ if (trailingFromLevel.length > 0) {
5464
+ trailingGroups.push({ items: trailingFromLevel, sourceList: level.list });
5465
+ }
5466
+ }
5467
+ // Merge only groups whose list type and container annotations match. Different
5468
+ // class/style/attribute boundaries must survive the structural reconstruction.
5469
+ const mergedGroups = [];
5470
+ for (const group of trailingGroups) {
5471
+ const prev = mergedGroups[mergedGroups.length - 1];
5472
+ if (prev &&
5473
+ prev.sourceList.type === group.sourceList.type &&
5474
+ this.haveSameListAnnotations(prev.sourceList, group.sourceList)) {
5475
+ prev.items.push(...group.items);
5476
+ }
5477
+ else {
5478
+ mergedGroups.push({ items: [...group.items], sourceList: group.sourceList });
5479
+ }
5480
+ }
5481
+ // Build the "after" lists
5482
+ const afterLists = mergedGroups.map((group) => {
5483
+ const newList = this.createListFromSource(rootContent, group.sourceList);
5484
+ newList.apply(new AppendChildrenAction(group.items));
5485
+ return newList;
5486
+ });
5487
+ afterLists.forEach((list) => this.appendListBlock(insertions, list));
5488
+ // --- Now trim the "before" portion ---
5489
+ // Trim target nested list: keep only items before selected
5490
+ target.children = target.children.slice(0, selectedIndex);
5491
+ // Clean up the target nested list's parent item's nestList
5492
+ const targetParentItem = target.parent;
5493
+ const targetParentNestLists = targetParentItem.nestList;
5494
+ const targetNestIndex = targetParentNestLists.indexOf(target);
5495
+ // Keep only nestLists up to and including the target (remove trailing ones we already collected)
5496
+ let trimmedNestList = targetParentNestLists.slice(0, targetNestIndex + 1);
5497
+ // If target is now empty, remove it too
5498
+ if (target.children.length === 0) {
5499
+ trimmedNestList = trimmedNestList.filter((l) => l !== target);
5500
+ }
5501
+ targetParentItem.apply(new ReplaceNestListAction(trimmedNestList));
5502
+ // Trim ancestor levels: remove trailing items and trailing nestLists
5503
+ for (const level of ancestorPath) {
5504
+ // Remove trailing items from the ancestor's list
5505
+ level.list.children = level.list.children.slice(0, level.ancestorIndex + 1);
5506
+ // Remove trailing nestLists from the ancestor item
5507
+ if (level.trailingNestLists.length > 0) {
5508
+ const ancestorItem = level.list.children[level.ancestorIndex];
5509
+ const ancestorNestLists = ancestorItem.nestList;
5510
+ const firstTrailingNestIndex = ancestorNestLists.indexOf(level.trailingNestLists[0]);
5511
+ if (firstTrailingNestIndex >= 0) {
5512
+ const keptNestLists = ancestorNestLists.slice(0, firstTrailingNestIndex);
5513
+ ancestorItem.apply(new ReplaceNestListAction(keptNestLists));
5514
+ }
5515
+ }
5516
+ }
5517
+ rootContainer.apply(new InsertChildrenAfterAction(rootList, ...insertions));
5518
+ }
5519
+ /**
5520
+ * Normalize selected items into document order and split them into contiguous
5521
+ * segments that share the same immediate parent list. Unlike Shift+Tab, the
5522
+ * toolbar action keeps selected descendants so every selected item becomes a
5523
+ * paragraph.
5524
+ *
5525
+ * @param {RTEBlock[]} selectedBlocks - Raw selected blocks.
5526
+ * @returns {RTEListItemBlock[][]} Parent-based contiguous selection segments.
5527
+ */
5528
+ getSelectedSegments(selectedBlocks) {
5529
+ const selectedItems = Array.from(new Set(selectedBlocks.filter((block) => block instanceof RTEListItemBlock)))
5530
+ .map((item) => ({ item, path: this.getStructuralPath(item) }))
5531
+ .filter((entry) => entry.path !== null)
5532
+ .sort((a, b) => this.compareStructuralPaths(a.path, b.path))
5533
+ .map((entry) => entry.item);
5534
+ const segments = [];
5535
+ for (const item of selectedItems) {
5536
+ const segment = segments[segments.length - 1];
5537
+ const previousItem = segment === null || segment === void 0 ? void 0 : segment[segment.length - 1];
5538
+ const isContiguousSibling = (previousItem === null || previousItem === void 0 ? void 0 : previousItem.parent) === item.parent &&
5539
+ item.parent.children.indexOf(item) - item.parent.children.indexOf(previousItem) === 1;
5540
+ if (isContiguousSibling) {
5541
+ segment.push(item);
5542
+ }
5543
+ else {
5544
+ segments.push([item]);
5545
+ }
5546
+ }
5547
+ return segments;
5548
+ }
5549
+ /**
5550
+ * Resolve a list item's structural document path, including the positions of
5551
+ * root lists, owning list items, nested lists, and the item itself.
5552
+ *
5553
+ * @param {RTEListItemBlock} item - Selected list item.
5554
+ * @returns {number[] | null} Structural path, or null for a detached item.
5555
+ */
5556
+ getStructuralPath(item) {
5557
+ var _a;
5558
+ const path = [];
5559
+ const visitedLists = new Set();
5560
+ let currentItem = item;
5561
+ let currentList = item.parent;
5562
+ while (!visitedLists.has(currentList)) {
5563
+ visitedLists.add(currentList);
5564
+ const itemIndex = currentList.children.indexOf(currentItem);
5565
+ if (itemIndex < 0) {
5566
+ return null;
5567
+ }
5568
+ path.unshift(itemIndex);
5569
+ if (currentList.parent.dtoName === 'VegaRTEContent' ||
5570
+ currentList.parent.dtoName === 'RTEHtmlBlock') {
5571
+ const containerPath = this.getContainerPath(currentList);
5572
+ return containerPath ? [...containerPath, ...path] : null;
5573
+ }
5574
+ if (!(currentList.parent instanceof RTEListItemBlock)) {
5575
+ return null;
5576
+ }
5577
+ const ownerItem = currentList.parent;
5578
+ const nestListIndex = ((_a = ownerItem.nestList) !== null && _a !== void 0 ? _a : []).indexOf(currentList);
5579
+ if (nestListIndex < 0) {
5580
+ return null;
5581
+ }
5582
+ path.unshift(nestListIndex);
5583
+ currentItem = ownerItem;
5584
+ currentList = ownerItem.parent;
5585
+ }
5586
+ return null;
5587
+ }
5588
+ /**
5589
+ * Resolve a root list's path through zero or more HTML containers to the
5590
+ * editor content.
5591
+ *
5592
+ * @param {RTEListBlock} rootList - List whose parent is a content container.
5593
+ * @returns {number[] | null} Container path, or null for detached/cyclic ownership.
5594
+ */
5595
+ getContainerPath(rootList) {
5596
+ const path = [];
5597
+ const visitedContainers = new Set();
5598
+ let child = rootList;
5599
+ let container = rootList.parent;
5600
+ while (container instanceof RTEHtmlBlock) {
5601
+ if (visitedContainers.has(container)) {
5602
+ return null;
5603
+ }
5604
+ visitedContainers.add(container);
5605
+ const childIndex = container.children.indexOf(child);
5606
+ if (childIndex < 0) {
5607
+ return null;
5608
+ }
5609
+ path.unshift(childIndex);
5610
+ child = container;
5611
+ container = container.parent;
5612
+ }
5613
+ const rootChildIndex = container.children.indexOf(child);
5614
+ if (rootChildIndex < 0) {
5615
+ return null;
5616
+ }
5617
+ path.unshift(rootChildIndex);
5618
+ return path;
5619
+ }
5620
+ /**
5621
+ * Compare two structural paths in document order.
5622
+ *
5623
+ * @param {number[]} firstPath - First structural path.
5624
+ * @param {number[]} secondPath - Second structural path.
5625
+ * @returns {number} Relative document order.
5626
+ */
5627
+ compareStructuralPaths(firstPath, secondPath) {
5628
+ const length = Math.min(firstPath.length, secondPath.length);
5629
+ for (let index = 0; index < length; index++) {
5630
+ if (firstPath[index] !== secondPath[index]) {
5631
+ return firstPath[index] - secondPath[index];
5632
+ }
5633
+ }
5634
+ return firstPath.length - secondPath.length;
5635
+ }
5636
+ /**
5637
+ * Append a list to an operation-local block sequence, merging only with the
5638
+ * immediately preceding same-type list in that sequence.
5639
+ *
5640
+ * @param {RTEBlock[]} blocks - Operation-local output sequence.
5641
+ * @param {RTEListBlock} list - List to append or merge.
5642
+ */
5643
+ appendListBlock(blocks, list) {
5644
+ const previousBlock = blocks[blocks.length - 1];
5645
+ if (previousBlock instanceof RTEListBlock &&
5646
+ previousBlock.type === list.type &&
5647
+ this.haveSameListAnnotations(previousBlock, list)) {
5648
+ previousBlock.apply(new AppendChildrenAction([...list.children]));
5649
+ return;
5650
+ }
5651
+ blocks.push(list);
5652
+ }
5653
+ /**
5654
+ * Create a list through the content factory and retain the source list's
5655
+ * container annotations when a structural split requires a new list block.
5656
+ *
5657
+ * @param {VegaRTEContent} rootContent - Editor content that owns the factory.
5658
+ * @param {RTEListBlock} source - List whose type and annotations should be retained.
5659
+ * @returns {RTEListBlock} Newly created list shell.
5660
+ */
5661
+ createListFromSource(rootContent, source) {
5662
+ const list = rootContent.createList(source.type);
5663
+ this.copyListAnnotations(source, list);
5664
+ return list;
5665
+ }
5666
+ /**
5667
+ * Converts a RTEListItemBlock to a RTETextBlock representing a paragraph.
5668
+ *
5669
+ * @param {RTEListItemBlock} block - The block that will be covered
5670
+ * @returns {RTETextBlock} Returns a `RTETextBlock`.
5671
+ */
5672
+ toParagraph(block) {
5673
+ const textBlock = new RTETextBlock(misc.generateUUID(), 'paragraph');
5674
+ textBlock.apply(new AppendChildrenAction(block['children']));
5675
+ textBlock['annotationMap'] = block['annotationMap'];
5676
+ return textBlock;
5677
+ }
5678
+ }
5679
+
5680
+ /**
5681
+ * Insert image to list block strategy.
5682
+ */
5683
+ class ListInsertImageStrategy extends ActionHandleStrategy {
5684
+ /**
5685
+ * Insert image block at behind of the list item block.
5686
+ *
5687
+ * @param {InsertImageToBlockAction} action - The insert image action instance.
5688
+ * @param {RTEListBlock} target - The list block.
5689
+ */
5690
+ handleAction(action, target) {
5691
+ const imageBlock = action.imageBlockToBeInserted;
5692
+ if (target.parent['type'] !== 'list-item') {
5693
+ target.parent.apply(new InsertChildrenAfterAction(target, imageBlock));
5694
+ }
5695
+ else {
5696
+ target.parent.apply(action);
5697
+ }
5698
+ }
5699
+ }
5700
+
5701
+ /**
5702
+ * Shared base strategy for list-item operations that require ordered contiguous
5703
+ * item selection within the same target list.
5704
+ */
5705
+ class AbstractListItemsStrategy extends ActionHandleStrategy {
5706
+ /**
5707
+ * Returns selected list items ordered by their position in target and validated
5708
+ * as a contiguous range. Returns an empty array when selection is invalid.
5709
+ *
5710
+ * @param {RTEListBlock} target - The target list block containing selected items.
5711
+ * @param {RTEListItemBlock[]} selectedBlocks - Selected list items from action payload.
5712
+ * @returns {RTEListItemBlock[]} Ordered contiguous selected items, or empty array.
5713
+ */
5714
+ getOrderedContiguousItems(target, selectedBlocks) {
5715
+ const orderedItems = [...selectedBlocks].sort((a, b) => target.children.indexOf(a) - target.children.indexOf(b));
5716
+ const startIndex = target.children.indexOf(orderedItems[0]);
5717
+ if (startIndex < 0) {
5718
+ return [];
5719
+ }
5720
+ return target.children
5721
+ .slice(startIndex, startIndex + orderedItems.length)
5722
+ .every((item, index) => item === orderedItems[index])
5723
+ ? orderedItems
5724
+ : [];
5725
+ }
5726
+ }
5727
+
5728
+ /**
5729
+ * Move selected list items into a nested list under the previous sibling.
5730
+ */
5731
+ class ListNestItemsStrategy extends AbstractListItemsStrategy {
5732
+ /**
5733
+ * @inheritDoc
5734
+ */
5735
+ handleAction(action, target) {
5736
+ var _a, _b;
5737
+ const selectedItems = this.getOrderedContiguousItems(target, action.selectedBlocks);
5738
+ if (!selectedItems.length) {
5739
+ return;
5740
+ }
5741
+ const startIndex = target.children.indexOf(selectedItems[0]);
5742
+ if (startIndex <= 0) {
5743
+ return;
5744
+ }
5745
+ const previousSibling = target.children[startIndex - 1];
5746
+ const selectedItemSet = new Set(selectedItems);
5747
+ // Tab behavior intentionally keeps using the last nested list entry if present,
5748
+ // even when mixed nested-list types exist, to preserve current behavior.
5749
+ // This also matches the behavior of other rich text editors, especially CKEditor.
5750
+ let nestedList = (_a = previousSibling.nestList) === null || _a === void 0 ? void 0 : _a[previousSibling.nestList.length - 1];
5751
+ if (!nestedList) {
5752
+ nestedList = new RTEListBlock(misc.generateUUID(), target.type);
5753
+ previousSibling.apply(new ReplaceNestListAction([...((_b = previousSibling.nestList) !== null && _b !== void 0 ? _b : []), nestedList]));
5754
+ }
5755
+ target.children = target.children.filter((item) => !selectedItemSet.has(item));
5756
+ nestedList.children = nestedList.children.concat(selectedItems);
5757
+ selectedItems.forEach((item) => {
5758
+ var _a;
5759
+ item.parent = nestedList;
5760
+ if ((_a = item.nestList) === null || _a === void 0 ? void 0 : _a.length) {
5761
+ this.unifyDescendantNestLists(item, item.nestList[0].type);
5762
+ }
5763
+ item.children.forEach((node) => node.apply(new SyncUpSelectionAction()));
5764
+ });
5765
+ }
5766
+ /**
5767
+ * Recursively unify all nestLists of a list item (and its descendants) to the given type.
5768
+ * Adjacent same-type merge is handled automatically by ListItemReplaceNestListStrategy
5769
+ * when ReplaceNestListAction is applied, so this method only needs to set the type.
5770
+ *
5771
+ * @param {RTEListItemBlock} item - The list item whose descendants should be normalized.
5772
+ * @param {RTEListBlock['type']} targetType - The target list type used for normalization.
5773
+ */
5774
+ unifyDescendantNestLists(item, targetType) {
5775
+ var _a;
5776
+ if (!((_a = item.nestList) === null || _a === void 0 ? void 0 : _a.length)) {
5777
+ return;
5778
+ }
5779
+ let typeChanged = false;
5780
+ for (const list of item.nestList) {
5781
+ if (list.type !== targetType) {
5782
+ list.type = targetType;
5783
+ typeChanged = true;
5784
+ }
5785
+ // Recursively unify children
5786
+ for (const child of list.children) {
5787
+ this.unifyDescendantNestLists(child, targetType);
5788
+ }
5789
+ }
5790
+ // If any type was changed, re-apply through ReplaceNestListAction so that the
5791
+ // centralized normalize in ListItemReplaceNestListStrategy merges adjacent same-type entries.
5792
+ if (typeChanged) {
5793
+ item.apply(new ReplaceNestListAction([...item.nestList]));
5794
+ }
5795
+ }
5796
+ }
5797
+
5798
+ /**
5799
+ * Delete the nest list block action
5800
+ *
5801
+ * @example needRemovedNestList.parent.apply(new RemoveNestListAction(needRemovedNestList))
5802
+ */
5803
+ class RemoveNestListAction extends ModifyContentAction {
5804
+ constructor(childList) {
5805
+ super();
5806
+ this.type = exports.ModifyContentActionType.DELETE_NEST_LIST;
5807
+ this.nestListBlockToBeRemoved = childList;
5808
+ }
5809
+ }
5810
+
5811
+ /**
5812
+ * Promote selected nested list items one level up.
5813
+ */
5814
+ class ListUnnestItemsStrategy extends AbstractListItemsStrategy {
5815
+ /**
5816
+ * @inheritDoc
5817
+ */
5818
+ handleAction(action, target) {
5819
+ var _a;
5820
+ const selectedItems = this.getOrderedContiguousItems(target, action.selectedBlocks);
5821
+ const parentListParent = target.parent;
5822
+ if (!selectedItems.length || !(parentListParent instanceof RTEListItemBlock)) {
5823
+ return;
5824
+ }
5825
+ const selectedStartIndex = target.children.indexOf(selectedItems[0]);
5826
+ const selectedEndIndex = target.children.indexOf(selectedItems[selectedItems.length - 1]);
5827
+ if (selectedStartIndex < 0 || selectedEndIndex < selectedStartIndex) {
5828
+ return;
5829
+ }
5830
+ const parentListItem = parentListParent;
5831
+ const grandParentList = parentListItem.parent;
5832
+ const insertAfterIndex = grandParentList.children.indexOf(parentListItem);
5833
+ if (insertAfterIndex < 0) {
5834
+ return;
5835
+ }
5836
+ const trailingSiblingItems = target.children.slice(selectedEndIndex + 1);
5837
+ const selectedItemSet = new Set(selectedItems);
5838
+ target.children = target.children.filter((item) => !selectedItemSet.has(item));
5839
+ grandParentList.children = [
5840
+ ...grandParentList.children.slice(0, insertAfterIndex + 1),
5841
+ ...selectedItems,
5842
+ ...grandParentList.children.slice(insertAfterIndex + 1),
5843
+ ];
5844
+ selectedItems.forEach((item) => {
5845
+ item.parent = grandParentList;
5846
+ item.children.forEach((node) => node.apply(new SyncUpSelectionAction()));
5847
+ });
5848
+ if (trailingSiblingItems.length > 0) {
5849
+ const trailingSiblingSet = new Set(trailingSiblingItems);
5850
+ target.children = target.children.filter((item) => !trailingSiblingSet.has(item));
5851
+ const newParentItem = selectedItems[selectedItems.length - 1];
5852
+ let nestedList = (_a = newParentItem.nestList) === null || _a === void 0 ? void 0 : _a[newParentItem.nestList.length - 1];
5853
+ // Shift+Tab follows same-type guard: when the last nested list has a
5854
+ // different type, create a new child list of target.type instead of merging.
5855
+ if (nestedList && nestedList.type !== target.type) {
5856
+ nestedList = null;
5857
+ }
5858
+ if (!nestedList) {
5859
+ nestedList = new RTEListBlock(misc.generateUUID(), target.type);
5860
+ const existingNestLists = Array.isArray(newParentItem.nestList)
5861
+ ? newParentItem.nestList
5862
+ : [];
5863
+ newParentItem.apply(new ReplaceNestListAction([...existingNestLists, nestedList]));
5864
+ }
5865
+ nestedList.children = nestedList.children.concat(trailingSiblingItems);
5866
+ trailingSiblingItems.forEach((item) => {
5867
+ item.parent = nestedList;
5868
+ });
5869
+ }
5870
+ // Lists after target are visually after every target item. Once selected items
5871
+ // move above their former parent, transfer those later branches to the last
5872
+ // selected item even when target still contains leading items; otherwise the
5873
+ // branches render before the promoted selection and document order changes.
5874
+ const trailingNestLists = this.collectTrailingNestLists(parentListItem, target);
5875
+ if (trailingNestLists.length > 0) {
5876
+ const lastSelected = selectedItems[selectedItems.length - 1];
5877
+ const existingNest = Array.isArray(lastSelected.nestList)
5878
+ ? lastSelected.nestList
5879
+ : [];
5880
+ lastSelected.apply(new ReplaceNestListAction([...existingNest, ...trailingNestLists]));
5881
+ }
5882
+ if (target.children.length === 0) {
5883
+ parentListItem.apply(new RemoveNestListAction(target));
5884
+ }
5885
+ }
5886
+ /**
5887
+ * Collect and remove nestList entries that appear after the given target list
5888
+ * in the parent item's nestList array. These trailing entries need to be
5889
+ * transferred to the unnested item to preserve visual document order.
5890
+ *
5891
+ * @param {RTEListItemBlock} parentListItem - The list item owning the nestList.
5892
+ * @param {RTEListBlock} target - The list being removed (used as the reference point).
5893
+ * @returns {RTEListBlock[]} The trailing nestList entries (already removed from parentListItem).
5894
+ */
5895
+ collectTrailingNestLists(parentListItem, target) {
5896
+ var _a;
5897
+ const nestLists = (_a = parentListItem.nestList) !== null && _a !== void 0 ? _a : [];
5898
+ const targetIndex = nestLists.indexOf(target);
5899
+ if (targetIndex < 0 || targetIndex >= nestLists.length - 1) {
5900
+ return [];
5901
+ }
5902
+ const trailing = nestLists.slice(targetIndex + 1);
5903
+ // Keep only entries up to and including target (target will be removed separately).
5904
+ parentListItem.apply(new ReplaceNestListAction(nestLists.slice(0, targetIndex + 1)));
5905
+ return trailing;
5906
+ }
5907
+ }
5908
+
5909
+ /**
5910
+ * List annotation
5911
+ */
5912
+ class ListAnnotation extends BlockAnnotation {
5913
+ constructor() {
5914
+ super(...arguments);
5915
+ this.type = exports.BlockAnnotationTypeEnum.LIST;
5916
+ }
5917
+ /**
5918
+ * Get the default standalone styles for a list block.
5919
+ *
5920
+ * @returns {AnnotationStyle} The default styles.
5921
+ */
5922
+ static getDefaultStyles() {
5923
+ return {
5924
+ paddingLeft: '8px',
5925
+ marginLeft: '16px',
5926
+ };
5927
+ }
5928
+ /**
5929
+ * Get the default standalone styles for a list block's item marker
5930
+ * (`li::marker`). Capping the marker font-size keeps bullets/numbers
5931
+ * at a normal size when list items are styled as title/subtitle.
5932
+ *
5933
+ * @returns {AnnotationStyle} The default marker styles.
5934
+ */
5935
+ static getDefaultMarkerStyles() {
5936
+ return {
5937
+ fontSize: '16px',
5938
+ };
5939
+ }
5940
+ /**
5941
+ * @inheritDoc
5942
+ */
5943
+ renderStyle(options) {
5944
+ if (!(options === null || options === void 0 ? void 0 : options.standalone))
5945
+ return null;
5946
+ return ListAnnotation.getDefaultStyles();
5947
+ }
5948
+ /**
5949
+ * @inheritDoc
5950
+ */
5951
+ renderClass(options) {
5952
+ if (options === null || options === void 0 ? void 0 : options.standalone)
5953
+ return null;
5954
+ return 'v-rte--list';
5955
+ }
5956
+ /**
5957
+ * @inheritDoc
5958
+ */
5959
+ clone() {
5960
+ return new ListAnnotation();
5961
+ }
5962
+ /**
5963
+ * @inheritDoc
5964
+ */
5965
+ toJSON() {
5966
+ return undefined;
5967
+ }
5968
+ }
5969
+
5970
+ /**
5971
+ * List block.
5972
+ *
5973
+ * Bidirectional nesting contract:
5974
+ * - Every child list item must have item.parent === this list block.
5975
+ * - If this list block is nested, its parent must be a list item and that
5976
+ * list item keeps this block in listItem.nestList.
5977
+ */
5978
+ class RTEListBlock extends RTEBlock {
5979
+ constructor(id, type, options) {
5980
+ super(id);
5981
+ this.dtoName = RTEListBlock.dtoName;
5982
+ this.type = 'bullet-list';
5983
+ this.children = [];
5984
+ this.type = type;
5985
+ const { autoMatchFormat } = options || { autoMatchFormat: true };
5986
+ if (autoMatchFormat) {
5987
+ this.annotationMap.set(exports.BlockAnnotationTypeEnum.LIST, new ListAnnotation());
5988
+ }
5989
+ }
5990
+ /**
5991
+ * Converts a VegaRTEListBlock object to an RTEListBlock
5992
+ *
5993
+ * @param {VegaRTEListBlock} block - Converts a `VegaRTEListBlock` object into an `RTEListBlock`.
5994
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
5995
+ * @returns {RTEListBlock} Return an instance of `RTEListBlock`
5996
+ */
5997
+ static from(block, options = { autoMatchFormat: true }) {
5998
+ const listBlock = new RTEListBlock(block.id, block.type, options);
5999
+ const { annotations } = block;
6000
+ if (annotations) {
6001
+ Object.entries(annotations).forEach(([type, value]) => {
6002
+ const item = this.createAnnotationEntity(type, value);
6003
+ if (typeGuard.isNonNullable(item)) {
6004
+ listBlock.annotationMap.set(...item);
6005
+ }
6006
+ });
6007
+ }
6008
+ listBlock.children = block.blocks.map((item) => {
6009
+ const listItemBlock = RTEListItemBlock.from(item, options);
6010
+ listItemBlock.parent = listBlock;
6011
+ return listItemBlock;
6012
+ });
6013
+ return listBlock;
6014
+ }
6015
+ /**
6016
+ * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
6017
+ * and value.
6018
+ *
6019
+ * @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
6020
+ * the type of annotation entity to create.
6021
+ * @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
6022
+ * that will be used to create the annotation entity. It can be of any type depending on the specific
6023
+ * annotation being created.
6024
+ * @returns {Nullable<BlockAnnotationsEntity>} The `createAnnotationEntity` function returns a nullable tuple containing a
6025
+ * `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
6026
+ */
6027
+ static createAnnotationEntity(type, value) {
6028
+ switch (type) {
6029
+ case 'customAttribute':
6030
+ return CustomAttributeAnnotation.from(value);
6031
+ case 'customClass':
6032
+ return CustomClassAnnotation.from(value);
6033
+ case 'customStyle':
6034
+ return CustomStyleAnnotation.from(value);
6035
+ }
6036
+ }
6037
+ /**
6038
+ * @inheritDoc
6039
+ */
6040
+ toJSON() {
6041
+ return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.children.map((block) => block.toJSON()) });
6042
+ }
6043
+ /**
6044
+ * @inheritDoc
6045
+ */
6046
+ toHtml(options) {
6047
+ const BlockTag = this.getBlockTag();
6048
+ const attrStr = super.generateAttributeString(options);
6049
+ return [
6050
+ `<${BlockTag}${attrStr}>`,
6051
+ this.children.map((block) => block.toHtml(options)).join(''),
6052
+ `</${BlockTag}>`,
6053
+ ].join('');
6054
+ }
6055
+ /**
6056
+ * @inheritDoc
6057
+ */
6058
+ isNotEmpty() {
6059
+ return this.children.length > 0;
6060
+ }
6061
+ /**
6062
+ * @inheritDoc
6063
+ */
6064
+ getLastNode() {
6065
+ return this.children[this.children.length - 1].getLastNode();
6066
+ }
6067
+ /**
6068
+ * @inheritDoc
6069
+ */
6070
+ clone(parent) {
6071
+ const clonedListBlock = new RTEListBlock(this.id, this.type);
6072
+ clonedListBlock.children = this.children.map((item) => item.clone(clonedListBlock));
6073
+ clonedListBlock.annotationMap = super.cloneAnnotations();
6074
+ clonedListBlock.parent = parent;
6075
+ return clonedListBlock;
6076
+ }
6077
+ /**
6078
+ * Returns the block tag based on the type of the list block.
6079
+ *
6080
+ * @returns {RTEListBlockTagType} - The block tag for the list block, either 'ol' or 'ul'.
6081
+ */
6082
+ getBlockTag() {
6083
+ return this.type === 'number-list' ? 'ol' : 'ul';
6084
+ }
6085
+ }
6086
+ (() => {
6087
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTEListBlock.name, new ListTransformToListStrategy());
6088
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK, RTEListBlock.name, new ListTransformToParagraphStrategy());
6089
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListBlock.name, new ListInsertImageStrategy());
6090
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.NEST_LIST_ITEMS, RTEListBlock.name, new ListNestItemsStrategy());
6091
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.UNNEST_LIST_ITEMS, RTEListBlock.name, new ListUnnestItemsStrategy());
6092
+ })();
6093
+ RTEListBlock.dtoName = 'RTEListBlock';
6094
+
6095
+ /**
6096
+ * The delete node content contains some common functions that used for image block delete the image node or text block delete text node.
6097
+ */
6098
+ class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
6099
+ /**
6100
+ * Returns the previous node relative to the current node in a rich text editor structure.
6101
+ *
6102
+ * @param {RTENode} currentNode - An object of type `RTENode`.
6103
+ * @returns {Nullable<RTENode>} the previous block last node
6104
+ */
6105
+ getPreviousNode(currentNode) {
6106
+ var _a;
6107
+ const currentBlock = currentNode.parent;
6108
+ const currentIndex = currentBlock.children.indexOf(currentNode);
6109
+ if (currentIndex > 0) {
6110
+ return currentBlock.children[currentIndex - 1];
6111
+ }
6112
+ else if (currentBlock.parent) {
6113
+ // Special case: cursor is at the start of the first item in a nested list.
6114
+ // Return the last direct text node of the grandparent list item so that
6115
+ // Backspace correctly merges the nested item into the parent item rather
6116
+ // than descending into the nested list's own descendants.
6117
+ if (currentBlock.isListItemBlock() &&
6118
+ currentBlock.parent.children.indexOf(currentBlock) === 0 &&
6119
+ currentBlock.parent.parent instanceof RTEListItemBlock) {
6120
+ const grandParentItem = currentBlock.parent.parent;
6121
+ const nestedListIndex = ((_a = grandParentItem.nestList) !== null && _a !== void 0 ? _a : []).indexOf(currentBlock.parent);
6122
+ if (nestedListIndex !== 0) {
6123
+ const previousBlock = this.getPreviousBlock(currentBlock);
6124
+ return previousBlock ? this.getBlockLastNode(previousBlock) : null;
6125
+ }
6126
+ const textNodes = grandParentItem.children;
6127
+ return textNodes.length > 0 ? textNodes[textNodes.length - 1] : null;
6128
+ }
6129
+ const previousBlock = this.getPreviousBlock(currentBlock);
6130
+ if (previousBlock) {
6131
+ return this.getBlockLastNode(previousBlock);
6132
+ }
6133
+ }
6134
+ }
6135
+ /**
6136
+ * Returns the next node relative to the current node in a rich text editor structure.
6137
+ *
6138
+ * @param {RTENode} currentNode - An object of type `RTENode`.
6139
+ * @returns {Nullable<RTENode>} the next block first node
6140
+ */
6141
+ getNextNode(currentNode) {
6142
+ const currentBlock = currentNode.parent;
6143
+ const currentIndex = currentBlock.children.indexOf(currentNode);
6144
+ if (currentBlock.children[currentIndex + 1]) {
6145
+ return currentBlock.children[currentIndex + 1];
6146
+ }
6147
+ else if (currentBlock.parent) {
6148
+ const nextBlock = this.getNextBlock(currentBlock);
6149
+ if (nextBlock) {
6150
+ return this.getBlockFirstNode(nextBlock);
6151
+ }
6152
+ }
6153
+ }
6154
+ /**
6155
+ * Determines if a given node is the first node within the current state.
6156
+ *
6157
+ * @param {RTENode} currentNode - An object representing a node in a rich text editor (RTE).
6158
+ * @returns {boolean} True or false;
6159
+ */
6160
+ isContentFirstNode(currentNode) {
6161
+ const currentBlock = currentNode.parent;
6162
+ const currentIndex = currentBlock.children.indexOf(currentNode);
6163
+ const parent = currentBlock.parent;
6164
+ if (currentBlock.isListItemBlock()) {
6165
+ const listParent = parent.parent;
6166
+ return (currentIndex === 0 &&
6167
+ Array.isArray(parent.children) &&
6168
+ parent.children[0] === currentBlock &&
6169
+ listParent['type'] !== 'list-item' &&
6170
+ Array.isArray(listParent.children) &&
6171
+ listParent.children[0] === parent);
6172
+ }
6173
+ else {
6174
+ return (currentIndex === 0 && Array.isArray(parent.children) && parent.children[0] === currentBlock);
6175
+ }
6176
+ }
6177
+ /**
6178
+ * TODO: The getPreviousBlock add nest list support
6179
+ * This function retrieves the previous block in a rich text editor, considering different scenarios such as being in a bullet list.
6180
+ *
6181
+ * @param {RTEBlock} currentBlock - Used to retrieve the previous block relative to the given `currentBlock` within a rich text editor context.
6182
+ * @returns {Nullable<RTEBlock>} The previous block if existing
6183
+ */
6184
+ getPreviousBlock(currentBlock) {
6185
+ var _a;
6186
+ if (currentBlock.parent instanceof RTEListItemBlock) {
6187
+ const nestedLists = (_a = currentBlock.parent.nestList) !== null && _a !== void 0 ? _a : [];
6188
+ const nestedListIndex = nestedLists.indexOf(currentBlock);
6189
+ if (nestedListIndex > 0) {
6190
+ return nestedLists[nestedListIndex - 1];
6191
+ }
6192
+ if (nestedListIndex === 0) {
6193
+ return currentBlock.parent;
6194
+ }
6195
+ }
4749
6196
  if (currentBlock && currentBlock.parent && currentBlock.parent.children) {
4750
6197
  const currentBlockIndex = currentBlock.parent.children.indexOf(currentBlock);
4751
6198
  if (currentBlockIndex > 0) {
@@ -5326,13 +6773,9 @@ exports.BOLD_FONT_WEIGHT = BOLD_FONT_WEIGHT;
5326
6773
  exports.BOLD_FONT_WEIGHT_KEYWORD = BOLD_FONT_WEIGHT_KEYWORD;
5327
6774
  exports.BlockAnnotation = BlockAnnotation;
5328
6775
  exports.BlockDeleteNodeContentStrategy = BlockDeleteNodeContentStrategy;
5329
- exports.BlockInsertLineBreakStrategy = BlockInsertLineBreakStrategy;
5330
- exports.BlockInsertLineBreakWithBlocksStrategy = BlockInsertLineBreakWithBlocksStrategy;
5331
6776
  exports.BlockMergeNodesStrategy = BlockMergeNodesStrategy;
5332
6777
  exports.BlockReplaceNodesStrategy = BlockReplaceNodesStrategy;
5333
- exports.BlockSplitWithTextNodeStrategy = BlockSplitWithTextNodeStrategy;
5334
6778
  exports.BlockUpdateHorizontalAlignmentStrategy = BlockUpdateHorizontalAlignmentStrategy;
5335
- exports.BlockUpdateTextStyleStrategy = BlockUpdateTextStyleStrategy;
5336
6779
  exports.BoldAnnotation = BoldAnnotation;
5337
6780
  exports.BoldAnnotationAction = BoldAnnotationAction;
5338
6781
  exports.ClearFormattingAnnotationAction = ClearFormattingAnnotationAction;
@@ -5344,7 +6787,6 @@ exports.CommonAnnotation = CommonAnnotation;
5344
6787
  exports.CustomAttributeAnnotation = CustomAttributeAnnotation;
5345
6788
  exports.CustomClassAnnotation = CustomClassAnnotation;
5346
6789
  exports.CustomStyleAnnotation = CustomStyleAnnotation;
5347
- exports.HTML_VOID_TAGS = HTML_VOID_TAGS;
5348
6790
  exports.HorizontalAlignmentAnnotation = HorizontalAlignmentAnnotation;
5349
6791
  exports.HorizontalAlignmentAnnotationAction = HorizontalAlignmentAnnotationAction;
5350
6792
  exports.ITALIC_FONT_STYLE = ITALIC_FONT_STYLE;
@@ -5354,6 +6796,7 @@ exports.InsertChildrenBeforeAction = InsertChildrenBeforeAction;
5354
6796
  exports.ItalicAnnotationAction = ItalicAnnotationAction;
5355
6797
  exports.LinkAnnotationAction = LinkAnnotationAction;
5356
6798
  exports.LinkFilterStylesStrategy = LinkFilterStylesStrategy;
6799
+ exports.ListAnnotation = ListAnnotation;
5357
6800
  exports.ModifyContentAction = ModifyContentAction;
5358
6801
  exports.NodeAnnotation = NodeAnnotation;
5359
6802
  exports.Predicate = Predicate;
@@ -5365,14 +6808,22 @@ exports.RTEDTOClassManager = RTEDTOClassManager$1;
5365
6808
  exports.RTEDecoratorNode = RTEDecoratorNode;
5366
6809
  exports.RTEFilterStylesStrategy = RTEFilterStylesStrategy;
5367
6810
  exports.RTEFilterStylesStrategyRegistry = RTEFilterStylesStrategyRegistry;
6811
+ exports.RTEHtmlBlock = RTEHtmlBlock;
6812
+ exports.RTEListBlock = RTEListBlock;
6813
+ exports.RTEListItemBlock = RTEListItemBlock;
5368
6814
  exports.RTENode = RTENode;
5369
6815
  exports.RTETextBlock = RTETextBlock;
5370
6816
  exports.RTETextNode = RTETextNode;
6817
+ exports.RTE_DEFAULT_LINK_TYPE_KEY = RTE_DEFAULT_LINK_TYPE_KEY;
5371
6818
  exports.RTE_DEFAULT_TEXT_COLOR = RTE_DEFAULT_TEXT_COLOR;
6819
+ exports.RTE_EMAIL_LINK_TYPE_KEY = RTE_EMAIL_LINK_TYPE_KEY;
6820
+ exports.RTE_SUPPORTED_LINK_TYPE_KEYS = RTE_SUPPORTED_LINK_TYPE_KEYS;
5372
6821
  exports.RTE_TEXT_COLORS = RTE_TEXT_COLORS;
5373
6822
  exports.RemoveChildrenAction = RemoveChildrenAction;
5374
6823
  exports.RemoveChildrenStrategy = RemoveChildrenStrategy;
6824
+ exports.RemoveNestListAction = RemoveNestListAction;
5375
6825
  exports.ReplaceChildNodesAction = ReplaceChildNodesAction;
6826
+ exports.ReplaceNestListAction = ReplaceNestListAction;
5376
6827
  exports.STRIKETHROUGH_TEXT_DECORATION = STRIKETHROUGH_TEXT_DECORATION;
5377
6828
  exports.SelectionChangeAction = SelectionChangeAction;
5378
6829
  exports.SplitBlockWithNodeAction = SplitBlockWithNodeAction;
@@ -5381,6 +6832,7 @@ exports.SyncUpSelectionAction = SyncUpSelectionAction;
5381
6832
  exports.TextColorAnnotationAction = TextColorAnnotationAction;
5382
6833
  exports.TextStyleAnnotation = TextStyleAnnotation;
5383
6834
  exports.TextStyleAnnotationAction = TextStyleAnnotationAction;
6835
+ exports.TransformParagraphAction = TransformParagraphAction;
5384
6836
  exports.UNDERLINE_TEXT_DECORATION = UNDERLINE_TEXT_DECORATION;
5385
6837
  exports.UnderlineAnnotationAction = UnderlineAnnotationAction;
5386
6838
  exports.UpdateCodeBlockAction = UpdateCodeBlockAction;