@heartlandone/vega 2.78.0 → 2.80.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 (1535) hide show
  1. package/dist/cjs/align-left-4a76df69.js +22 -0
  2. package/dist/cjs/app-globals-7a48292d.js +430 -0
  3. package/dist/cjs/aria-dialog-focusable-trap-slimmer-5a0a78fe.js +272 -0
  4. package/dist/cjs/auto-run-when-re-render-task-queue-slimmer.abstract-5734634d.js +51 -0
  5. package/dist/cjs/breakpoints-1cc2c4c6.js +56 -0
  6. package/dist/cjs/child-nodes-notify-observer-slimmer-a8d13f4c.js +90 -0
  7. package/dist/cjs/code-block-71a330a1.js +4521 -0
  8. package/dist/cjs/component-value-history-controller-slimmer.abstract-fd077a6c.js +714 -0
  9. package/dist/cjs/content-state-afa26456.js +4459 -0
  10. package/dist/cjs/date-required-rule-9f0e3e99.js +92 -0
  11. package/dist/cjs/deprecated-property-slimmer-300a3929.js +51 -0
  12. package/dist/cjs/design-token-3f9589eb.js +402 -0
  13. package/dist/cjs/dom-node-subject-observer-factory-a3a60da4.js +141 -0
  14. package/dist/cjs/dto-renderer-manager-ae5fcbba.js +58 -0
  15. package/dist/cjs/element-appender-slimmer-7a66229b.js +1974 -0
  16. package/dist/cjs/event-emit-slimmer-024e26bb.js +267 -0
  17. package/dist/cjs/form-field-controller-slimmer-c487cf2b.js +1266 -0
  18. package/dist/cjs/image-annotation-action-4e72af4b.js +285 -0
  19. package/dist/cjs/index-58ea899e.js +4 -0
  20. package/dist/cjs/index.cjs.js +41 -36
  21. package/dist/cjs/inject-keyboard-manager-d1a82089.js +37 -0
  22. package/dist/cjs/internal-translation-controller-9f58a4e4.js +301 -0
  23. package/dist/cjs/keyboard-manager-9dbbb0d4.js +148 -0
  24. package/dist/cjs/keyboard-manager-slimmer-68cff676.js +39 -0
  25. package/dist/cjs/loader.cjs.js +26 -21
  26. package/dist/cjs/month-view-generator-65a2f883.js +101 -0
  27. package/dist/cjs/object-b53e9416.js +52 -0
  28. package/dist/cjs/page-resize-observer-slimmer-273d62ef.js +123 -0
  29. package/dist/cjs/public-rules-36f202b3.js +46 -0
  30. package/dist/cjs/range-fa15d524.js +178 -0
  31. package/dist/cjs/responsive-format-facade-4419b4ae.js +944 -0
  32. package/dist/cjs/rich-text-editor-required-rule-7d4c2973.js +64 -0
  33. package/dist/cjs/split-cell-operation-19f98afb.js +2411 -0
  34. package/dist/cjs/string-format-strategy.abstract-c65d9861.js +63 -0
  35. package/dist/cjs/string-input-formatter-slimmer-c2e04acc.js +230 -0
  36. package/dist/cjs/string-mask-strategy-418fc0b8.js +203 -0
  37. package/dist/cjs/style-formatter-3c9ce0e5.js +34 -0
  38. package/dist/cjs/sub-state-notify-slimmer-7a4c6061.js +81 -0
  39. package/dist/cjs/sub-state-observer-slimmer-f728e068.js +134 -0
  40. package/dist/cjs/time-required-rule-ad091302.js +141 -0
  41. package/dist/cjs/token-extension-90396de7.js +7438 -0
  42. package/dist/cjs/translation-slimmer-c069ca84.js +42 -0
  43. package/dist/cjs/type-guard-d760850a.js +2033 -0
  44. package/dist/cjs/ui-32120990.js +62 -0
  45. package/dist/cjs/ui-9e8c9732.js +283 -0
  46. package/dist/cjs/valid-credit-card-number-rule-5ce8e973.js +173 -0
  47. package/dist/cjs/vega-accordion.cjs.entry.js +9 -9
  48. package/dist/cjs/vega-app-header-button.cjs.entry.js +10 -10
  49. package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
  50. package/dist/cjs/vega-banner.cjs.entry.js +3 -3
  51. package/dist/cjs/vega-box.cjs.entry.js +9 -9
  52. package/dist/cjs/vega-breadcrumb.cjs.entry.js +3 -3
  53. package/dist/cjs/vega-button-circle.cjs.entry.js +10 -10
  54. package/dist/cjs/vega-button-group_2.cjs.entry.js +6 -6
  55. package/dist/cjs/vega-button-link.cjs.entry.js +3 -3
  56. package/dist/cjs/vega-button.cjs.entry.js +10 -10
  57. package/dist/cjs/vega-calendar_4.cjs.entry.js +247 -173
  58. package/dist/cjs/vega-card.cjs.entry.js +7 -7
  59. package/dist/cjs/vega-carousel.cjs.entry.js +11 -11
  60. package/dist/cjs/vega-checkbox_2.cjs.entry.js +11 -11
  61. package/dist/cjs/vega-chip.cjs.entry.js +10 -10
  62. package/dist/cjs/vega-code-block.cjs.entry.js +16 -15
  63. package/dist/cjs/vega-color-picker.cjs.entry.js +10 -10
  64. package/dist/cjs/vega-combo-box.cjs.entry.js +13 -13
  65. package/dist/cjs/vega-date-picker_2.cjs.entry.js +109 -36
  66. package/dist/cjs/vega-dialog_2.cjs.entry.js +53 -15
  67. package/dist/cjs/vega-divider.cjs.entry.js +7 -7
  68. package/dist/cjs/vega-dropdown_5.cjs.entry.js +17 -17
  69. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  70. package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
  71. package/dist/cjs/vega-file-uploader.cjs.entry.js +11 -11
  72. package/dist/cjs/vega-flag-icon.cjs.entry.js +6 -6
  73. package/dist/cjs/vega-flex.cjs.entry.js +9 -9
  74. package/dist/cjs/vega-font.cjs.entry.js +8 -8
  75. package/dist/cjs/vega-form.cjs.entry.js +13 -13
  76. package/dist/cjs/vega-grid.cjs.entry.js +9 -8
  77. package/dist/cjs/vega-icon.cjs.entry.js +7 -7
  78. package/dist/cjs/vega-image-uploader.cjs.entry.js +13 -13
  79. package/dist/cjs/vega-input-credit-card.cjs.entry.js +14 -14
  80. package/dist/cjs/vega-input-numeric.cjs.entry.js +14 -14
  81. package/dist/cjs/vega-input-passcode.cjs.entry.js +13 -13
  82. package/dist/cjs/vega-input-phone-number.cjs.entry.js +12 -12
  83. package/dist/cjs/vega-input-range.cjs.entry.js +11 -11
  84. package/dist/cjs/vega-input-select.cjs.entry.js +13 -13
  85. package/dist/cjs/vega-input.cjs.entry.js +56 -33
  86. package/dist/cjs/vega-internal-event-id-a1837fa2.js +126 -0
  87. package/dist/cjs/vega-item-toggle.cjs.entry.js +6 -6
  88. package/dist/cjs/vega-left-nav_5.cjs.entry.js +15 -15
  89. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +7 -7
  90. package/dist/cjs/vega-page-notification_2.cjs.entry.js +2 -2
  91. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
  92. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +5 -5
  93. package/dist/cjs/vega-pagination.cjs.entry.js +11 -11
  94. package/dist/cjs/vega-popover_2.cjs.entry.js +53 -16
  95. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +14 -14
  96. package/dist/cjs/vega-radio_2.cjs.entry.js +14 -14
  97. package/dist/cjs/vega-rich-text-content.cjs.entry.js +22 -24
  98. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +217 -252
  99. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +1527 -0
  100. package/dist/cjs/vega-segment-control.cjs.entry.js +6 -6
  101. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +13 -13
  102. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +12 -12
  103. package/dist/cjs/vega-sidenav_3.cjs.entry.js +12 -12
  104. package/dist/cjs/vega-signature-capture.cjs.entry.js +15 -15
  105. package/dist/cjs/vega-stepper.cjs.entry.js +10 -10
  106. package/dist/cjs/vega-tab-group_2.cjs.entry.js +6 -6
  107. package/dist/cjs/vega-table_11.cjs.entry.js +14 -14
  108. package/dist/cjs/vega-text.cjs.entry.js +4 -4
  109. package/dist/cjs/vega-textarea.cjs.entry.js +10 -10
  110. package/dist/cjs/vega-time-picker_2.cjs.entry.js +62 -20
  111. package/dist/cjs/vega-toggle-switch.cjs.entry.js +10 -10
  112. package/dist/cjs/vega-tooltip_2.cjs.entry.js +14 -14
  113. package/dist/cjs/vega.cjs.js +26 -21
  114. package/dist/cjs/wait-for-component-did-render-b6aba2de.js +32 -0
  115. package/dist/collection/collection-manifest.json +10 -0
  116. package/dist/collection/components/vega-backdrop/slimmers/renerers/vega-backdrop-renderer.js +1 -1
  117. package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-day-view-focus-slimmer.js +34 -0
  118. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.js +1 -1
  119. package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.js +2 -1
  120. package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +28 -7
  121. package/dist/collection/components/vega-calendar/vega-calendar-event/slimmers/renderers/vega-calendar-event-renderer.js +4 -4
  122. package/dist/collection/components/vega-calendar/vega-calendar-event/vega-calendar-event.css +15 -12
  123. package/dist/collection/components/vega-calendar/vega-calendar-event/vega-calendar-event.js +1 -1
  124. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.js +20 -3
  125. package/dist/collection/components/vega-calendar/vega-calendar.css +1 -1
  126. package/dist/collection/components/vega-calendar/vega-calendar.js +5 -0
  127. package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +13 -1
  128. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +28 -2
  129. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-input-renderer-base.abstract.js +7 -1
  130. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-range-input-renderer.js +15 -2
  131. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-renderer.js +1 -1
  132. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-single-input-renderer.js +18 -1
  133. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +5 -5
  134. package/dist/collection/components/vega-grid/vega-grid.css +72 -0
  135. package/dist/collection/components/vega-grid/vega-grid.js +30 -0
  136. package/dist/collection/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.js +13 -12
  137. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-renderer.js +4 -1
  138. package/dist/collection/components/vega-input/vega-input.js +35 -1
  139. package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.js +34 -1
  140. package/dist/collection/components/vega-modal/slimmers/renderers/vega-modal-renderer.js +7 -2
  141. package/dist/collection/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.js +26 -1
  142. package/dist/collection/components/vega-popover/vega-popover-content-box/vega-popover-content-box.js +6 -1
  143. package/dist/collection/components/vega-popover/vega-popover.js +7 -0
  144. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +9 -1
  145. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +10 -0
  146. package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +2 -1
  147. package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +13 -6
  148. package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +18 -9
  149. package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +11 -1
  150. package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +2 -1
  151. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +12 -1
  152. package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +12 -4
  153. package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +2 -1
  154. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-format-default-styles.js +22 -0
  155. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +43 -32
  156. package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +2 -1
  157. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +24 -2
  158. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.js +35 -0
  159. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy.abstract.js +62 -0
  160. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/image-node/image-filter-styles-strategy.js +16 -0
  161. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +12 -0
  162. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.js +13 -0
  163. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/alignment-filter-styles-strategy.js +39 -0
  164. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/code-filter-styles-strategy.js +26 -0
  165. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/link-filter-styles-strategy.js +30 -0
  166. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/text-format-filter-styles-strategy.js +89 -0
  167. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +0 -10
  168. package/dist/collection/components/vega-rich-text-editor/dto/setup.js +18 -0
  169. package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +2 -1
  170. package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +10 -5
  171. package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +18 -1
  172. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-children-remove-interceptor.js +42 -0
  173. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-content-delete-interceptor.js +26 -0
  174. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-row-insert-interceptor.js +23 -0
  175. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-table-insert-paragraph-interceptor.js +55 -0
  176. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/create-segment-table-cell-strategy.js +33 -0
  177. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-block-strategy.js +25 -0
  178. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-column-strategy.js +176 -0
  179. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-row-strategy.js +154 -0
  180. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-block-strategy.js +54 -0
  181. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-column-strategy.js +163 -0
  182. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-into-different-section-strategy.js +83 -0
  183. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-into-same-section-strategy.js +55 -0
  184. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/merge-cells-strategy.js +120 -0
  185. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/replace-table-cell-strategy.js +21 -0
  186. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/select-table-column-strategy.js +33 -0
  187. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-cell-horizontally-strategy.js +143 -0
  188. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-cell-vertically-strategy.js +80 -0
  189. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-table-cell-strategy.js +45 -0
  190. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-column-strategy.abstract.js +27 -0
  191. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-row-strategy.abstract.js +296 -0
  192. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-row-strategy.js +274 -0
  193. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-table-column-strategy.js +159 -0
  194. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-cell-properties-strategy.js +33 -0
  195. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-properties-strategy.js +36 -0
  196. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/create-segment-table-cell-action.js +13 -0
  197. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-block-action.js +13 -0
  198. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-column-action.js +13 -0
  199. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-row-action.js +18 -0
  200. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-block-action.js +13 -0
  201. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-column-action.js +19 -0
  202. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-into-different-section-action.js +21 -0
  203. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-into-same-section-action.js +27 -0
  204. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/merge-cells-action.js +17 -0
  205. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/replace-table-cell-action.js +13 -0
  206. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/select-table-column-action.js +13 -0
  207. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/split-cell-horizontally-action.js +12 -0
  208. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/split-cell-vertically-action.js +12 -0
  209. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/split-table-cell-action.js +13 -0
  210. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.js +18 -0
  211. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-caption-action.js +13 -0
  212. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.js +28 -0
  213. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-head-cell-annotations-action.js +17 -0
  214. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/toggle-header-row-action.js +13 -0
  215. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/toggle-header-table-column-action.js +15 -0
  216. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/update-table-properties-action.js +38 -0
  217. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.js +78 -0
  218. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.js +69 -0
  219. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +108 -0
  220. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.js +14 -0
  221. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.js +106 -0
  222. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.js +69 -0
  223. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.js +192 -0
  224. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-color-annotation.js +66 -0
  225. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.js +56 -0
  226. package/dist/collection/components/vega-rich-text-editor/extensions/table/constants/styles.constants.js +27 -0
  227. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +119 -0
  228. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +56 -0
  229. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +69 -0
  230. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +97 -0
  231. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +60 -0
  232. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +53 -0
  233. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +60 -0
  234. package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/caption-to-caption-block-strategy.js +71 -0
  235. package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/table-to-table-block-strategy.js +42 -0
  236. package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tbody-to-table-body-block-strategy.js +42 -0
  237. package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/td-to-table-cell-block-strategy.js +93 -0
  238. package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/thead-to-table-head-block-strategy.js +42 -0
  239. package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tr-to-table-row-block-strategy.js +42 -0
  240. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.js +15 -0
  241. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.js +22 -0
  242. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.js +72 -0
  243. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.js +263 -0
  244. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.js +12 -0
  245. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.js +15 -0
  246. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-popover-base-renderer.js +19 -0
  247. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +116 -0
  248. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.js +15 -0
  249. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +148 -0
  250. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-toolbar-popover-renderer.js +178 -0
  251. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/caption-operation.js +78 -0
  252. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-cancel-event-handler.js +17 -0
  253. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-change-event-handler.js +15 -0
  254. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-save-event-handler.js +19 -0
  255. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties.js +136 -0
  256. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/column-operation.js +109 -0
  257. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/merge-cells-operation.js +100 -0
  258. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/row-operation.js +160 -0
  259. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.js +45 -0
  260. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/split-cell-operation.js +57 -0
  261. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-cancel-event-handler.js +19 -0
  262. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-change-event-handler.js +20 -0
  263. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-save-event-handler.js +20 -0
  264. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties.js +50 -0
  265. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +174 -0
  266. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-icon.js +3 -0
  267. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-selection.js +460 -0
  268. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +61 -0
  269. package/dist/collection/components/vega-rich-text-editor/extensions/table/utils/table-color-manager.js +55 -0
  270. package/dist/collection/components/vega-rich-text-editor/extensions/table/utils/utils.js +436 -0
  271. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-bottom.js +3 -0
  272. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-middle.js +3 -0
  273. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-top.js +3 -0
  274. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-center-horizontal.js +3 -0
  275. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-left.js +3 -0
  276. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-right.js +3 -0
  277. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/controllers/vega-rich-text-table-properties-color-controller.js +58 -0
  278. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-cell-properties-form-field-renderer.js +106 -0
  279. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-basic-form-field-renderer.abstract.js +291 -0
  280. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-field-renderer.js +58 -0
  281. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-renderer.js +111 -0
  282. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.css +149 -0
  283. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.js +251 -0
  284. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.js +36 -0
  285. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/renderers/selection-widget-renderer.js +83 -0
  286. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.css +41 -0
  287. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.js +80 -0
  288. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/assets/icon.js +20 -0
  289. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.js +27 -0
  290. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.js +26 -0
  291. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.js +90 -0
  292. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/merge-cells-button-slimmer.js +117 -0
  293. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.js +103 -0
  294. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.js +26 -0
  295. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.js +76 -0
  296. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.js +55 -0
  297. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.css +23 -0
  298. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.js +222 -0
  299. package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
  300. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +35 -6
  301. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/bold-annotaion-handler.js +3 -2
  302. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +50 -2
  303. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/italic-annotation-handler.js +2 -1
  304. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/strike-through-annotation-handler.js +2 -1
  305. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.js +3 -1
  306. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/underline-annotation-handler.js +2 -1
  307. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +2 -1
  308. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +26 -2
  309. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +4 -0
  310. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +0 -5
  311. package/dist/collection/components/vega-time-picker/slimmers/renderers/vega-time-picker-range-input-renderer.js +5 -2
  312. package/dist/collection/components/vega-time-picker/slimmers/renderers/vega-time-picker-single-input-renderer.js +4 -1
  313. package/dist/collection/components/vega-time-picker/vega-time-picker.js +36 -0
  314. package/dist/collection/constants/runtime-metrics-payload-definition/vega-time-picker/runtime-metrics-payload-definition.js +24 -0
  315. package/dist/collection/constants/ui.js +2 -0
  316. package/dist/collection/global/scripts/before-vega-load.js +2 -0
  317. package/dist/collection/helpers/calendar/calendar-date.js +10 -0
  318. package/dist/collection/helpers/calendar/calendar-view-generator/calendar-view-generator.abstract.js +2 -2
  319. package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +3 -0
  320. package/dist/collection/helpers/formatter/responsive-map-formatter/responsive-format-facade.js +3 -0
  321. package/dist/collection/helpers/formatter/responsive-map-formatter/responsive-grid-justify-items-formatter.js +29 -0
  322. package/dist/collection/helpers/formatter/string-formatter/custom-formatter-strategy.js +3 -1
  323. package/dist/collection/helpers/formatter/string-formatter/number-mask-strategy.js +3 -1
  324. package/dist/collection/helpers/formatter/string-formatter/number-thousand-comma-strategy.js +3 -2
  325. package/dist/collection/helpers/formatter/string-formatter/string-format-strategy.abstract.js +4 -1
  326. package/dist/collection/helpers/formatter/string-formatter/string-mask-strategy.js +38 -7
  327. package/dist/collection/helpers/formatter/string-formatter/thousand-comma-strategy.js +4 -0
  328. package/dist/collection/helpers/keyboard/keyboard-manager.js +11 -3
  329. package/dist/collection/helpers/slimmers/aria-dialog-focusable-trap-slimmer.js +267 -0
  330. package/dist/collection/helpers/slimmers/position-calculation/base-position-calculation-strategy.js +1 -1
  331. package/dist/collection/helpers/translation/locales/en.js +2 -0
  332. package/dist/collection/types/type-guard.js +10 -1
  333. package/dist/collection/utils/object.js +6 -4
  334. package/dist/collection/utils/ui.js +28 -2
  335. package/dist/esm/align-left-7f959adf.js +17 -0
  336. package/dist/esm/app-globals-e77015e3.js +428 -0
  337. package/dist/esm/aria-dialog-focusable-trap-slimmer-5a2f92be.js +270 -0
  338. package/dist/esm/auto-run-when-re-render-task-queue-slimmer.abstract-27820d4c.js +49 -0
  339. package/dist/esm/breakpoints-332702ed.js +53 -0
  340. package/dist/esm/child-nodes-event-prevent-slimmer-2ecc3e1f.js +156 -0
  341. package/dist/esm/child-nodes-notify-observer-slimmer-b7f0e419.js +88 -0
  342. package/dist/esm/code-block-7d6f231b.js +4455 -0
  343. package/dist/esm/component-value-history-controller-slimmer.abstract-acf65b17.js +709 -0
  344. package/dist/esm/content-state-084cd705.js +4439 -0
  345. package/dist/esm/date-required-rule-29608215.js +90 -0
  346. package/dist/esm/deprecated-property-slimmer-ea34fa7b.js +49 -0
  347. package/dist/esm/design-token-edcd787b.js +388 -0
  348. package/dist/esm/dom-node-subject-observer-factory-cea9248d.js +138 -0
  349. package/dist/esm/dto-renderer-manager-12bc9121.js +56 -0
  350. package/dist/esm/element-appender-slimmer-08ec429b.js +1972 -0
  351. package/dist/esm/event-emit-slimmer-4fba1b35.js +265 -0
  352. package/dist/esm/form-field-controller-slimmer-8dd39707.js +1264 -0
  353. package/dist/esm/image-annotation-action-a6b33a81.js +280 -0
  354. package/dist/esm/index-090d31ca.js +4 -0
  355. package/dist/esm/index.js +30 -26
  356. package/dist/esm/inject-keyboard-manager-7557816f.js +35 -0
  357. package/dist/esm/internal-translation-controller-b08aa9ab.js +298 -0
  358. package/dist/esm/internal-vega-event-manager-59f5bd47.js +494 -0
  359. package/dist/esm/keyboard-manager-1846c6a5.js +146 -0
  360. package/dist/esm/keyboard-manager-slimmer-1ae0aa4d.js +37 -0
  361. package/dist/esm/loader.js +26 -21
  362. package/dist/esm/month-view-generator-b700ed08.js +97 -0
  363. package/dist/esm/object-0c277f57.js +48 -0
  364. package/dist/esm/page-resize-observer-slimmer-e24d36c5.js +121 -0
  365. package/dist/esm/public-rules-fe2c7934.js +31 -0
  366. package/dist/esm/range-00afe462.js +176 -0
  367. package/dist/esm/responsive-format-facade-37d4d850.js +940 -0
  368. package/dist/esm/rich-text-editor-required-rule-6487ec94.js +62 -0
  369. package/dist/esm/split-cell-operation-9445e642.js +2360 -0
  370. package/dist/esm/string-format-strategy.abstract-ec6d627b.js +61 -0
  371. package/dist/esm/string-input-formatter-slimmer-959dff7a.js +228 -0
  372. package/dist/esm/string-mask-strategy-49be41f0.js +201 -0
  373. package/dist/esm/style-formatter-ad0b2bac.js +32 -0
  374. package/dist/esm/sub-state-notify-slimmer-ee8c417b.js +79 -0
  375. package/dist/esm/sub-state-observer-slimmer-4d30fa5c.js +132 -0
  376. package/dist/esm/time-required-rule-414b1590.js +138 -0
  377. package/dist/esm/token-extension-600b1c88.js +7417 -0
  378. package/dist/esm/translation-slimmer-35b1d0fa.js +40 -0
  379. package/dist/esm/type-guard-23a08026.js +1958 -0
  380. package/dist/esm/ui-93922c59.js +47 -0
  381. package/dist/esm/ui-ba5a4758.js +267 -0
  382. package/dist/esm/valid-credit-card-number-rule-60abddac.js +171 -0
  383. package/dist/esm/vega-accordion.entry.js +11 -11
  384. package/dist/esm/vega-app-header-button.entry.js +13 -13
  385. package/dist/esm/vega-backdrop.entry.js +2 -2
  386. package/dist/esm/vega-banner.entry.js +5 -5
  387. package/dist/esm/vega-box.entry.js +9 -9
  388. package/dist/esm/vega-breadcrumb.entry.js +6 -6
  389. package/dist/esm/vega-button-circle.entry.js +13 -13
  390. package/dist/esm/vega-button-group_2.entry.js +9 -9
  391. package/dist/esm/vega-button-link.entry.js +6 -6
  392. package/dist/esm/vega-button.entry.js +13 -13
  393. package/dist/esm/vega-calendar_4.entry.js +250 -176
  394. package/dist/esm/vega-card.entry.js +7 -7
  395. package/dist/esm/vega-carousel.entry.js +13 -13
  396. package/dist/esm/vega-checkbox_2.entry.js +14 -14
  397. package/dist/esm/vega-chip.entry.js +13 -13
  398. package/dist/esm/vega-code-block.entry.js +18 -17
  399. package/dist/esm/vega-color-picker.entry.js +12 -12
  400. package/dist/esm/vega-combo-box.entry.js +16 -16
  401. package/dist/esm/vega-date-picker_2.entry.js +112 -39
  402. package/dist/esm/vega-dialog_2.entry.js +56 -18
  403. package/dist/esm/vega-divider.entry.js +7 -7
  404. package/dist/esm/vega-dropdown_5.entry.js +20 -20
  405. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  406. package/dist/esm/vega-event-id-4ede557a.js +114 -0
  407. package/dist/esm/vega-field-label.entry.js +5 -5
  408. package/dist/esm/vega-file-uploader.entry.js +13 -13
  409. package/dist/esm/vega-flag-icon.entry.js +6 -6
  410. package/dist/esm/vega-flex.entry.js +9 -9
  411. package/dist/esm/vega-font.entry.js +8 -8
  412. package/dist/esm/vega-form.entry.js +16 -16
  413. package/dist/esm/vega-grid.entry.js +9 -8
  414. package/dist/esm/vega-icon.entry.js +7 -7
  415. package/dist/esm/vega-image-uploader.entry.js +16 -16
  416. package/dist/esm/vega-input-credit-card.entry.js +17 -17
  417. package/dist/esm/vega-input-numeric.entry.js +17 -17
  418. package/dist/esm/vega-input-passcode.entry.js +16 -16
  419. package/dist/esm/vega-input-phone-number.entry.js +15 -15
  420. package/dist/esm/vega-input-range.entry.js +14 -14
  421. package/dist/esm/vega-input-select.entry.js +16 -16
  422. package/dist/esm/vega-input.entry.js +58 -35
  423. package/dist/esm/vega-internal-event-id-70bd893d.js +73 -0
  424. package/dist/esm/vega-item-toggle.entry.js +8 -8
  425. package/dist/esm/vega-left-nav_5.entry.js +17 -17
  426. package/dist/esm/vega-loader-wrapper_2.entry.js +7 -7
  427. package/dist/esm/vega-page-notification_2.entry.js +3 -3
  428. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +6 -6
  429. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +6 -6
  430. package/dist/esm/vega-pagination.entry.js +14 -14
  431. package/dist/esm/vega-popover_2.entry.js +55 -18
  432. package/dist/esm/vega-progress-tracker_2.entry.js +16 -16
  433. package/dist/esm/vega-radio_2.entry.js +17 -17
  434. package/dist/esm/vega-rich-text-content.entry.js +21 -23
  435. package/dist/esm/vega-rich-text-editor_4.entry.js +196 -231
  436. package/dist/esm/vega-rich-text-table-properties_3.entry.js +1521 -0
  437. package/dist/esm/vega-segment-control.entry.js +8 -8
  438. package/dist/esm/vega-selection-chip_2.entry.js +16 -16
  439. package/dist/esm/vega-selection-tile_2.entry.js +15 -15
  440. package/dist/esm/vega-sidenav_3.entry.js +14 -14
  441. package/dist/esm/vega-signature-capture.entry.js +17 -17
  442. package/dist/esm/vega-stepper.entry.js +13 -13
  443. package/dist/esm/vega-tab-group_2.entry.js +9 -9
  444. package/dist/esm/vega-table_11.entry.js +17 -17
  445. package/dist/esm/vega-text.entry.js +4 -4
  446. package/dist/esm/vega-textarea.entry.js +13 -13
  447. package/dist/esm/vega-time-picker_2.entry.js +65 -23
  448. package/dist/esm/vega-toggle-switch.entry.js +12 -12
  449. package/dist/esm/vega-tooltip_2.entry.js +14 -14
  450. package/dist/esm/vega.js +26 -21
  451. package/dist/esm/wait-for-component-did-render-03e7ccb2.js +30 -0
  452. package/dist/sri/vega-sri-manifest.json +384 -360
  453. package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-day-view-focus-slimmer.d.ts +15 -0
  454. package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.d.ts +3 -0
  455. package/dist/types/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.d.ts +6 -0
  456. package/dist/types/components/vega-calendar/vega-calendar.d.ts +2 -0
  457. package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.d.ts +2 -0
  458. package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +5 -0
  459. package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-input-renderer-base.abstract.d.ts +2 -0
  460. package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-range-input-renderer.d.ts +3 -0
  461. package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-single-input-renderer.d.ts +5 -0
  462. package/dist/types/components/vega-grid/vega-grid.d.ts +13 -1
  463. package/dist/types/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.d.ts +1 -0
  464. package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-renderer.d.ts +1 -0
  465. package/dist/types/components/vega-input/types.d.ts +30 -1
  466. package/dist/types/components/vega-input/vega-input.d.ts +10 -0
  467. package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.d.ts +13 -0
  468. package/dist/types/components/vega-modal/slimmers/renderers/vega-modal-renderer.d.ts +1 -0
  469. package/dist/types/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.d.ts +7 -0
  470. package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +3 -0
  471. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.d.ts +7 -0
  472. package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +2 -5
  473. package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +3 -3
  474. package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +6 -0
  475. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.d.ts +1 -1
  476. package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +7 -0
  477. package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +6 -0
  478. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +7 -0
  479. package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +6 -0
  480. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-format-default-styles.d.ts +22 -0
  481. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +7 -0
  482. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +10 -6
  483. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.d.ts +28 -0
  484. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy.abstract.d.ts +45 -0
  485. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/image-node/image-filter-styles-strategy.d.ts +10 -0
  486. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.d.ts +8 -0
  487. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.d.ts +9 -0
  488. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/alignment-filter-styles-strategy.d.ts +27 -0
  489. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/code-filter-styles-strategy.d.ts +17 -0
  490. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/link-filter-styles-strategy.d.ts +17 -0
  491. package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/text-format-filter-styles-strategy.d.ts +41 -0
  492. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.d.ts +0 -2
  493. package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +15 -2
  494. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-children-remove-interceptor.d.ts +25 -0
  495. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-content-delete-interceptor.d.ts +20 -0
  496. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-row-insert-interceptor.d.ts +19 -0
  497. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-table-insert-paragraph-interceptor.d.ts +31 -0
  498. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/create-segment-table-cell-strategy.d.ts +20 -0
  499. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-block-strategy.d.ts +14 -0
  500. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-column-strategy.d.ts +74 -0
  501. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-row-strategy.d.ts +55 -0
  502. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-block-strategy.d.ts +27 -0
  503. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-column-strategy.d.ts +60 -0
  504. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-into-different-section-strategy.d.ts +21 -0
  505. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-into-same-section-strategy.d.ts +13 -0
  506. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/merge-cells-strategy.d.ts +38 -0
  507. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/replace-table-cell-strategy.d.ts +12 -0
  508. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/select-table-column-strategy.d.ts +12 -0
  509. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-cell-horizontally-strategy.d.ts +43 -0
  510. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-cell-vertically-strategy.d.ts +27 -0
  511. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-table-cell-strategy.d.ts +12 -0
  512. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-column-strategy.abstract.d.ts +23 -0
  513. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-row-strategy.abstract.d.ts +120 -0
  514. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-row-strategy.d.ts +86 -0
  515. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-table-column-strategy.d.ts +55 -0
  516. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-cell-properties-strategy.d.ts +13 -0
  517. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-properties-strategy.d.ts +12 -0
  518. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/create-segment-table-cell-action.d.ts +21 -0
  519. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-block-action.d.ts +12 -0
  520. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-column-action.d.ts +15 -0
  521. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-row-action.d.ts +17 -0
  522. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-block-action.d.ts +20 -0
  523. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-column-action.d.ts +23 -0
  524. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-into-different-section-action.d.ts +20 -0
  525. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-into-same-section-action.d.ts +24 -0
  526. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/merge-cells-action.d.ts +33 -0
  527. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/replace-table-cell-action.d.ts +13 -0
  528. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/select-table-column-action.d.ts +18 -0
  529. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/split-cell-horizontally-action.d.ts +10 -0
  530. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/split-cell-vertically-action.d.ts +10 -0
  531. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/split-table-cell-action.d.ts +22 -0
  532. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.d.ts +16 -0
  533. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-caption-action.d.ts +14 -0
  534. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.d.ts +20 -0
  535. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-head-cell-annotations-action.d.ts +14 -0
  536. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/toggle-header-row-action.d.ts +12 -0
  537. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/toggle-header-table-column-action.d.ts +16 -0
  538. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/update-table-properties-action.d.ts +18 -0
  539. package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.d.ts +36 -0
  540. package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.d.ts +26 -0
  541. package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.d.ts +56 -0
  542. package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.d.ts +13 -0
  543. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.d.ts +73 -0
  544. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.d.ts +32 -0
  545. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.d.ts +100 -0
  546. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-color-annotation.d.ts +44 -0
  547. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.d.ts +27 -0
  548. package/dist/types/components/vega-rich-text-editor/extensions/table/constants/styles.constants.d.ts +4 -0
  549. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +79 -0
  550. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +42 -0
  551. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +41 -0
  552. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +64 -0
  553. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +42 -0
  554. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +34 -0
  555. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +44 -0
  556. package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/caption-to-caption-block-strategy.d.ts +37 -0
  557. package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/table-to-table-block-strategy.d.ts +26 -0
  558. package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tbody-to-table-body-block-strategy.d.ts +26 -0
  559. package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/td-to-table-cell-block-strategy.d.ts +35 -0
  560. package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/thead-to-table-head-block-strategy.d.ts +26 -0
  561. package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tr-to-table-row-block-strategy.d.ts +26 -0
  562. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.d.ts +12 -0
  563. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.d.ts +13 -0
  564. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.d.ts +30 -0
  565. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +81 -0
  566. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.d.ts +12 -0
  567. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.d.ts +12 -0
  568. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-popover-base-renderer.d.ts +16 -0
  569. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +38 -0
  570. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.d.ts +12 -0
  571. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.d.ts +59 -0
  572. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-toolbar-popover-renderer.d.ts +59 -0
  573. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/caption-operation.d.ts +36 -0
  574. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-cancel-event-handler.d.ts +17 -0
  575. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-change-event-handler.d.ts +15 -0
  576. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-save-event-handler.d.ts +17 -0
  577. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties.d.ts +62 -0
  578. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/column-operation.d.ts +55 -0
  579. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/merge-cells-operation.d.ts +44 -0
  580. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/row-operation.d.ts +69 -0
  581. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.d.ts +48 -0
  582. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/split-cell-operation.d.ts +31 -0
  583. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-cancel-event-handler.d.ts +19 -0
  584. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-change-event-handler.d.ts +17 -0
  585. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-save-event-handler.d.ts +17 -0
  586. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties.d.ts +33 -0
  587. package/dist/types/components/vega-rich-text-editor/extensions/table/table-extension.d.ts +36 -0
  588. package/dist/types/components/vega-rich-text-editor/extensions/table/table-icon.d.ts +3 -0
  589. package/dist/types/components/vega-rich-text-editor/extensions/table/table-selection.d.ts +164 -0
  590. package/dist/types/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.d.ts +26 -0
  591. package/dist/types/components/vega-rich-text-editor/extensions/table/utils/table-color-manager.d.ts +27 -0
  592. package/dist/types/components/vega-rich-text-editor/extensions/table/utils/utils.d.ts +190 -0
  593. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-bottom.d.ts +3 -0
  594. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-middle.d.ts +3 -0
  595. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-top.d.ts +3 -0
  596. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-center-horizontal.d.ts +3 -0
  597. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-left.d.ts +3 -0
  598. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-right.d.ts +3 -0
  599. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/controllers/vega-rich-text-table-properties-color-controller.d.ts +29 -0
  600. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-cell-properties-form-field-renderer.d.ts +49 -0
  601. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-basic-form-field-renderer.abstract.d.ts +111 -0
  602. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-field-renderer.d.ts +27 -0
  603. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-renderer.d.ts +39 -0
  604. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.d.ts +60 -0
  605. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.d.ts +15 -0
  606. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/renderers/selection-widget-renderer.d.ts +31 -0
  607. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.d.ts +27 -0
  608. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/assets/icon.d.ts +2 -0
  609. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.d.ts +11 -0
  610. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.d.ts +11 -0
  611. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.d.ts +28 -0
  612. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/merge-cells-button-slimmer.d.ts +23 -0
  613. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.d.ts +36 -0
  614. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.d.ts +11 -0
  615. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.d.ts +36 -0
  616. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.d.ts +12 -0
  617. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.d.ts +58 -0
  618. package/dist/types/components/vega-rich-text-editor/interface.d.ts +34 -2
  619. package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -0
  620. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/extension-controller.d.ts +10 -0
  621. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +19 -0
  622. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +19 -6
  623. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +0 -2
  624. package/dist/types/components/vega-time-picker/slimmers/renderers/vega-time-picker-range-input-renderer.d.ts +1 -0
  625. package/dist/types/components/vega-time-picker/slimmers/renderers/vega-time-picker-single-input-renderer.d.ts +1 -0
  626. package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +12 -0
  627. package/dist/types/components.d.ts +173 -2
  628. package/dist/types/constants/ui.d.ts +1 -0
  629. package/dist/types/helpers/calendar/calendar-date.d.ts +7 -0
  630. package/dist/types/helpers/calendar/calendar-view-generator/calendar-view-generator.abstract.d.ts +0 -1
  631. package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +3 -0
  632. package/dist/types/helpers/formatter/responsive-map-formatter/responsive-grid-justify-items-formatter.d.ts +19 -0
  633. package/dist/types/helpers/formatter/string-formatter/custom-formatter-strategy.d.ts +2 -1
  634. package/dist/types/helpers/formatter/string-formatter/number-mask-strategy.d.ts +2 -1
  635. package/dist/types/helpers/formatter/string-formatter/number-thousand-comma-strategy.d.ts +2 -1
  636. package/dist/types/helpers/formatter/string-formatter/string-format-strategy.abstract.d.ts +1 -0
  637. package/dist/types/helpers/formatter/string-formatter/string-mask-strategy.d.ts +32 -4
  638. package/dist/types/helpers/formatter/string-formatter/thousand-comma-strategy.d.ts +1 -0
  639. package/dist/types/helpers/keyboard/keyboard-manager.d.ts +1 -0
  640. package/dist/types/helpers/slimmers/aria-dialog-focusable-trap-slimmer.d.ts +112 -0
  641. package/dist/types/helpers/translation/interface.d.ts +3 -1
  642. package/dist/types/types/components.type.d.ts +5 -0
  643. package/dist/types/types/type-guard.d.ts +7 -0
  644. package/dist/types/types/ui.type.d.ts +13 -1
  645. package/dist/types/utils/object.d.ts +6 -2
  646. package/dist/types/utils/ui.d.ts +12 -1
  647. package/dist/vega/index.esm.js +1 -1
  648. package/dist/vega/p-010b5e74.js +1 -0
  649. package/dist/vega/p-01883ffc.entry.js +1 -0
  650. package/dist/vega/p-02578a59.js +1 -0
  651. package/dist/vega/p-0313393d.entry.js +1 -0
  652. package/dist/vega/p-043e685a.entry.js +1 -0
  653. package/dist/vega/p-04e56b0c.entry.js +1 -0
  654. package/dist/vega/p-07a2b42a.js +1 -0
  655. package/dist/vega/p-08780df0.entry.js +1 -0
  656. package/dist/vega/p-10fa4eac.js +1 -0
  657. package/dist/vega/p-1557ed92.entry.js +1 -0
  658. package/dist/vega/p-18619467.js +1 -0
  659. package/dist/vega/p-19ad4f15.entry.js +1 -0
  660. package/dist/vega/p-1a2f92a3.entry.js +1 -0
  661. package/dist/vega/p-1c45565d.js +1 -0
  662. package/dist/vega/p-1feb4f2a.entry.js +1 -0
  663. package/dist/vega/p-203bc4db.entry.js +1 -0
  664. package/dist/vega/p-204c7d41.js +1 -0
  665. package/dist/vega/p-21c9e1ca.entry.js +1 -0
  666. package/dist/vega/p-22336063.js +1 -0
  667. package/dist/vega/p-224b67ff.entry.js +1 -0
  668. package/dist/vega/p-2a9960c9.js +1 -0
  669. package/dist/vega/p-2c2df248.js +1 -0
  670. package/dist/vega/p-2d917e2d.entry.js +1 -0
  671. package/dist/vega/p-2e73582d.entry.js +1 -0
  672. package/dist/vega/p-3224e47c.js +1 -0
  673. package/dist/vega/p-334e3b02.entry.js +1 -0
  674. package/dist/vega/p-33860e54.js +1 -0
  675. package/dist/vega/p-35386999.entry.js +1 -0
  676. package/dist/vega/p-365d21ac.entry.js +1 -0
  677. package/dist/vega/p-367d44d9.entry.js +1 -0
  678. package/dist/vega/p-382b71a3.entry.js +1 -0
  679. package/dist/vega/p-3d2d267d.js +1 -0
  680. package/dist/vega/p-434fc427.entry.js +1 -0
  681. package/dist/vega/p-44c5cbb7.js +1 -0
  682. package/dist/vega/p-47ca1f69.entry.js +1 -0
  683. package/dist/vega/p-49a2e141.js +1 -0
  684. package/dist/vega/p-4d65756f.js +1 -0
  685. package/dist/vega/p-4eb282ef.entry.js +1 -0
  686. package/dist/vega/p-517434d4.entry.js +1 -0
  687. package/dist/vega/p-559197f8.js +1 -0
  688. package/dist/vega/p-576fe408.js +1 -0
  689. package/dist/vega/p-5ae4ea20.entry.js +1 -0
  690. package/dist/vega/p-5f377954.js +1 -1
  691. package/dist/vega/p-60cf2a68.js +1 -0
  692. package/dist/vega/p-612e3ded.js +1 -0
  693. package/dist/vega/p-65900dbf.entry.js +1 -0
  694. package/dist/vega/p-68124bc5.js +1 -0
  695. package/dist/vega/p-68a531cf.js +1 -0
  696. package/dist/vega/p-6af55f1c.entry.js +1 -0
  697. package/dist/vega/p-6c5250b3.js +1 -0
  698. package/dist/vega/p-6f2e5bc6.js +1 -0
  699. package/dist/vega/p-70f1cf4e.entry.js +1 -0
  700. package/dist/vega/p-716c71e6.js +1 -0
  701. package/dist/vega/p-7362723e.entry.js +1 -0
  702. package/dist/vega/p-7618dde4.js +1 -0
  703. package/dist/vega/p-76b80a0c.js +1 -0
  704. package/dist/vega/p-7912741f.entry.js +1 -0
  705. package/dist/vega/p-7942c042.entry.js +1 -0
  706. package/dist/vega/p-7c2fecfd.entry.js +1 -0
  707. package/dist/vega/p-7ceab8c7.entry.js +1 -0
  708. package/dist/vega/p-81dd00d0.js +1 -0
  709. package/dist/vega/p-82016096.js +1 -0
  710. package/dist/vega/p-8327635d.js +1 -0
  711. package/dist/vega/p-840ad046.entry.js +1 -0
  712. package/dist/vega/p-878851f6.js +1 -0
  713. package/dist/vega/p-89e56502.js +1 -0
  714. package/dist/vega/p-8adf9732.entry.js +1 -0
  715. package/dist/vega/p-90137c68.entry.js +1 -0
  716. package/dist/vega/p-9341c1a9.js +1 -0
  717. package/dist/vega/p-9390a94b.entry.js +1 -0
  718. package/dist/vega/p-9551da9c.entry.js +1 -0
  719. package/dist/vega/p-9862d1a8.entry.js +1 -0
  720. package/dist/vega/p-9dc23325.entry.js +1 -0
  721. package/dist/vega/p-a4dbf2cc.js +1 -0
  722. package/dist/vega/p-a841cf13.js +1 -0
  723. package/dist/vega/p-a99e75a1.entry.js +1 -0
  724. package/dist/vega/p-ab21fdf6.entry.js +1 -0
  725. package/dist/vega/p-b3e40faf.js +1 -0
  726. package/dist/vega/p-b5a6bd0f.entry.js +1 -0
  727. package/dist/vega/p-b5c2fff3.entry.js +1 -0
  728. package/dist/vega/p-b696a861.js +1 -0
  729. package/dist/vega/p-ba415db6.entry.js +1 -0
  730. package/dist/vega/p-be3517be.entry.js +1 -0
  731. package/dist/vega/p-c045e4c1.entry.js +1 -0
  732. package/dist/vega/p-c4e32125.entry.js +1 -0
  733. package/dist/vega/p-c5b698f6.entry.js +1 -0
  734. package/dist/vega/p-c5eb0fa6.js +1 -0
  735. package/dist/vega/p-c61279a7.entry.js +1 -0
  736. package/dist/vega/p-c6d62f0d.js +1 -0
  737. package/dist/vega/p-c78fe943.js +1 -0
  738. package/dist/vega/p-c9201bf4.js +1 -0
  739. package/dist/vega/p-cc055723.entry.js +1 -0
  740. package/dist/vega/p-cca5042b.entry.js +1 -0
  741. package/dist/vega/p-cda45d2a.entry.js +1 -0
  742. package/dist/vega/p-cdf5b2f0.entry.js +1 -0
  743. package/dist/vega/p-cf70c57d.js +1 -0
  744. package/dist/vega/p-d1494c7c.entry.js +1 -0
  745. package/dist/vega/p-d1ca70a1.js +1 -0
  746. package/dist/vega/p-d202e69d.entry.js +1 -0
  747. package/dist/vega/p-d4ea8e22.js +1 -0
  748. package/dist/vega/p-dc9b5063.entry.js +1 -0
  749. package/dist/vega/p-dcd18ab1.js +1 -0
  750. package/dist/vega/p-df5bfbc4.entry.js +1 -0
  751. package/dist/vega/p-e4726dcd.entry.js +1 -0
  752. package/dist/vega/p-e84b95d4.js +1 -0
  753. package/dist/vega/p-ea21462f.js +1 -0
  754. package/dist/vega/p-ec1d76c6.entry.js +1 -0
  755. package/dist/vega/p-f3456993.entry.js +1 -0
  756. package/dist/vega/p-f4190826.entry.js +1 -0
  757. package/dist/vega/p-f48c43f4.entry.js +1 -0
  758. package/dist/vega/p-fcabf0dc.js +1 -0
  759. package/dist/vega/p-fdac91c4.entry.js +1 -0
  760. package/dist/vega/p-ffa2e3a6.entry.js +1 -0
  761. package/dist/vega/vega.esm.js +1 -1
  762. package/package.json +3 -2
  763. package/dist/cjs/app-globals-55e26945.js +0 -428
  764. package/dist/cjs/breakpoints-a8ff22f0.js +0 -56
  765. package/dist/cjs/child-nodes-notify-observer-slimmer-ed39283b.js +0 -90
  766. package/dist/cjs/code-block-1a5fafed.js +0 -4422
  767. package/dist/cjs/component-value-history-controller-slimmer.abstract-42683f23.js +0 -736
  768. package/dist/cjs/date-required-rule-ad536cb5.js +0 -92
  769. package/dist/cjs/deprecated-property-slimmer-1eb8f031.js +0 -51
  770. package/dist/cjs/design-token-45ebd5e4.js +0 -402
  771. package/dist/cjs/dom-node-subject-observer-factory-c62823de.js +0 -141
  772. package/dist/cjs/dto-renderer-manager-7557d562.js +0 -4119
  773. package/dist/cjs/element-appender-slimmer-16ec8591.js +0 -1974
  774. package/dist/cjs/event-emit-slimmer-c84121c8.js +0 -267
  775. package/dist/cjs/form-field-controller-slimmer-73f5849e.js +0 -1266
  776. package/dist/cjs/image-annotation-action-f275863e.js +0 -313
  777. package/dist/cjs/inject-keyboard-manager-6667c0f1.js +0 -37
  778. package/dist/cjs/internal-translation-controller-24df468f.js +0 -299
  779. package/dist/cjs/keyboard-manager-7de7ecfd.js +0 -140
  780. package/dist/cjs/keyboard-manager-slimmer-b44f0dc9.js +0 -39
  781. package/dist/cjs/month-view-generator-36c42772.js +0 -102
  782. package/dist/cjs/object-e2e28e3d.js +0 -50
  783. package/dist/cjs/page-resize-observer-slimmer-e050cd26.js +0 -123
  784. package/dist/cjs/public-rules-6c6cb4ac.js +0 -46
  785. package/dist/cjs/range-e298d4aa.js +0 -178
  786. package/dist/cjs/responsive-format-facade-bddac47c.js +0 -916
  787. package/dist/cjs/rich-text-editor-required-rule-6346a888.js +0 -64
  788. package/dist/cjs/string-format-strategy.abstract-814d66c4.js +0 -60
  789. package/dist/cjs/string-input-formatter-slimmer-749e3cfe.js +0 -230
  790. package/dist/cjs/string-mask-strategy-d00871c2.js +0 -172
  791. package/dist/cjs/style-formatter-94c1a1ff.js +0 -34
  792. package/dist/cjs/sub-state-notify-slimmer-ac1dae32.js +0 -81
  793. package/dist/cjs/sub-state-observer-slimmer-e692d849.js +0 -134
  794. package/dist/cjs/time-required-rule-f1f3c8c2.js +0 -141
  795. package/dist/cjs/token-extension-1e98ddf3.js +0 -3062
  796. package/dist/cjs/translation-slimmer-3fa03d81.js +0 -42
  797. package/dist/cjs/type-guard-a0d9ff1f.js +0 -2012
  798. package/dist/cjs/ui-024696c0.js +0 -59
  799. package/dist/cjs/ui-234ea151.js +0 -256
  800. package/dist/cjs/valid-credit-card-number-rule-cba7d66a.js +0 -173
  801. package/dist/cjs/vega-internal-event-id-e0aeac45.js +0 -120
  802. package/dist/cjs/wait-for-component-did-render-cbebfc33.js +0 -32
  803. package/dist/collection/components/vega-calendar/slimmers/common/helpers/test/calendar-event-repeat-pattern-factory.test.js +0 -195
  804. package/dist/collection/components/vega-calendar/slimmers/common/layout/test/long-event-layout-generator.test.js +0 -94
  805. package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/timed-event/layout/test/day-view-event-layout-generator.test.js +0 -72
  806. package/dist/collection/components/vega-code-block/test/code-block-range.test.js +0 -81
  807. package/dist/collection/components/vega-dropdown/test/share.js +0 -13
  808. package/dist/collection/components/vega-input-credit-card/test/share.js +0 -21
  809. package/dist/collection/components/vega-nav/vega-left-nav/test/vega-left-nav-mock-data.js +0 -147
  810. package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.test.js +0 -19
  811. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/text-node-color-controller.js +0 -51
  812. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/text-node-rendering-registry.js +0 -26
  813. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/action-handle-strategy-registry.test.js +0 -71
  814. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-delete-node-content-strategy.test.js +0 -69
  815. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-insert-line-break-with-blocks-strategy.test.js +0 -24
  816. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.js +0 -20
  817. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.js +0 -15
  818. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.js +0 -32
  819. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-set-annotation-map-strategy.test.js +0 -11
  820. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-update-url-strategy.test.js +0 -16
  821. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-block-strategy-register.test.js +0 -20
  822. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-item-strategy-register.test.js +0 -87
  823. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-split-text-strategy.test.js +0 -32
  824. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-update-annotation-map-strategy.test.js +0 -17
  825. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.js +0 -77
  826. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/update-selected-text-strategy.test.js +0 -23
  827. package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-actions.test.js +0 -39
  828. package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-style.test.js +0 -71
  829. package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +0 -381
  830. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/code-block.test.js +0 -54
  831. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/html-block.test.js +0 -167
  832. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/image-block.test.js +0 -90
  833. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-block.test.js +0 -176
  834. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-item.test.js +0 -188
  835. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +0 -193
  836. package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +0 -3123
  837. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +0 -108
  838. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +0 -510
  839. package/dist/collection/components/vega-rich-text-editor/test/dto/range.test.js +0 -53
  840. package/dist/collection/components/vega-rich-text-editor/test/e2e-utils.js +0 -182
  841. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/custom-attribute-annotation-handler.test.js +0 -49
  842. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/element-to-text-node-strategy.test.js +0 -38
  843. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/html-element-to-annotation-generator.test.js +0 -26
  844. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.js +0 -32
  845. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.js +0 -61
  846. package/dist/collection/components/vega-rich-text-editor/test/extensions/extension-test-utils.js +0 -41
  847. package/dist/collection/components/vega-rich-text-editor/test/fixture.js +0 -257
  848. package/dist/collection/components/vega-rich-text-editor/test/html-cleaner/html-content-cleaner.test.js +0 -186
  849. package/dist/collection/components/vega-rich-text-editor/test/html-cleaner/remove-whitespace-after-opening-tag-processor.test.js +0 -22
  850. package/dist/collection/components/vega-rich-text-editor/test/html-cleaner/remove-whitespace-before-closing-tag-processor.test.js +0 -22
  851. package/dist/collection/components/vega-rich-text-editor/test/html-cleaner/remove-whitespace-between-tags-processor.test.js +0 -26
  852. package/dist/collection/components/vega-rich-text-editor/test/spec-utils.js +0 -32
  853. package/dist/collection/components/vega-sidenav/test/test.helper.js +0 -68
  854. package/dist/collection/components/vega-table/slimmers/controllers/dto/test/column-render-input-model.test.js +0 -83
  855. package/dist/collection/components/vega-table/slimmers/controllers/dto/test/column-structure-model.test.js +0 -147
  856. package/dist/collection/components/vega-table/test/utils.js +0 -22
  857. package/dist/collection/components/vega-table/test/vega-table-sorter.test.js +0 -508
  858. package/dist/collection/constants/tests/validator.test.js +0 -24
  859. package/dist/collection/decorators/method-decorators/tests/component-load-required.test.js +0 -114
  860. package/dist/collection/decorators/property-decorators/tests/inject-element-appender-proxy.test.js +0 -237
  861. package/dist/collection/decorators/property-decorators/tests/inject-keyboard-manager.test.js +0 -91
  862. package/dist/collection/global/tests/before-vega-load.test.js +0 -62
  863. package/dist/collection/helpers/calendar/test/calendar-date-time.test.js +0 -27
  864. package/dist/collection/helpers/calendar/test/calendar-date.test.js +0 -172
  865. package/dist/collection/helpers/calendar/test/calendar-event.test.js +0 -263
  866. package/dist/collection/helpers/calendar/test/calendar-period/day-period.test.js +0 -118
  867. package/dist/collection/helpers/calendar/test/calendar-period/month-period.test.js +0 -144
  868. package/dist/collection/helpers/calendar/test/calendar-period/week-period.test.js +0 -114
  869. package/dist/collection/helpers/calendar/test/calendar-time.test.js +0 -45
  870. package/dist/collection/helpers/calendar/test/calendar-view-generator/day-view-generator.test.js +0 -19
  871. package/dist/collection/helpers/calendar/test/calendar-view-generator/month-view-generator.test.js +0 -123
  872. package/dist/collection/helpers/calendar/test/calendar-view-generator/week-view-generator.test.js +0 -43
  873. package/dist/collection/helpers/calendar/test/calendar-view.test.js +0 -9
  874. package/dist/collection/helpers/calendar/test/index.test.js +0 -13
  875. package/dist/collection/helpers/calendar/test/utils.test.js +0 -62
  876. package/dist/collection/helpers/change-manager/test/change-manager.test.js +0 -30
  877. package/dist/collection/helpers/change-manager/test/dom-node-subject-factory.test.js +0 -38
  878. package/dist/collection/helpers/chart/test/controllers/chart-dimension-controller.test.js +0 -63
  879. package/dist/collection/helpers/chart/test/drawers/arc-path-drawer.test.js +0 -55
  880. package/dist/collection/helpers/chart/test/drawers/legend-drawer.test.js +0 -94
  881. package/dist/collection/helpers/chart/test/drawers/line-drawer.test.js +0 -25
  882. package/dist/collection/helpers/chart/test/drawers/path-drawer.test.js +0 -21
  883. package/dist/collection/helpers/chart/test/drawers/rect-drawer.test.js +0 -78
  884. package/dist/collection/helpers/chart/test/drawers/text-drawer.test.js +0 -25
  885. package/dist/collection/helpers/chart/test/drawers/x-axis-drawer.test.js +0 -38
  886. package/dist/collection/helpers/chart/test/drawers/y-axis-drawer.test.js +0 -44
  887. package/dist/collection/helpers/chart/test/graph-context-factory.test.js +0 -17
  888. package/dist/collection/helpers/chart/test/input-processors/format-time-positions-input-processor.test.js +0 -62
  889. package/dist/collection/helpers/chart/test/input-processors/horizontal-x-axis-input-processor.test.js +0 -45
  890. package/dist/collection/helpers/chart/test/input-processors/horizontal-y-axis-input-processor.test.js +0 -80
  891. package/dist/collection/helpers/chart/test/input-processors/layout-input-processor.test.js +0 -40
  892. package/dist/collection/helpers/chart/test/input-processors/line-path-input-processor.test.js +0 -16
  893. package/dist/collection/helpers/chart/test/input-processors/pie-chart-filter-input-processor.test.js +0 -20
  894. package/dist/collection/helpers/chart/test/input-processors/pie-chart-radius-input-processor.test.js +0 -48
  895. package/dist/collection/helpers/chart/test/input-processors/sort-positions-input-processor.test.js +0 -53
  896. package/dist/collection/helpers/chart/test/input-processors/x-axis-input-processor.test.js +0 -78
  897. package/dist/collection/helpers/chart/test/input-processors/x-axis-label-formatter-input-processor.test.js +0 -109
  898. package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.js +0 -39
  899. package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.test.js +0 -55
  900. package/dist/collection/helpers/chart/test/interacting-entry-generator/arc-path-hover-generator.test.js +0 -11
  901. package/dist/collection/helpers/chart/test/interacting-entry-generator/pie-legend-hover-generator.test.js +0 -25
  902. package/dist/collection/helpers/chart/test/interactors/interactor-factory.test.js +0 -19
  903. package/dist/collection/helpers/chart/test/interactors/svg-interactor.test.js +0 -48
  904. package/dist/collection/helpers/chart/test/line-chart.test.js +0 -96
  905. package/dist/collection/helpers/chart/test/pie-chart.test.js +0 -38
  906. package/dist/collection/helpers/chart/test/renderers/canvas-renderer.test.js +0 -31
  907. package/dist/collection/helpers/chart/test/renderers/renderer-factory.test.js +0 -19
  908. package/dist/collection/helpers/chart/test/renderers/svg-renderer.test.js +0 -99
  909. package/dist/collection/helpers/code-format/test/code-formatter.test.js +0 -410
  910. package/dist/collection/helpers/common/test/common.test.js +0 -7
  911. package/dist/collection/helpers/common/test/wait-for-component-did-render.test.js +0 -67
  912. package/dist/collection/helpers/common/test/wait-for-vega-handler.test.js +0 -17
  913. package/dist/collection/helpers/csp/test/styles-preservator.test.js +0 -207
  914. package/dist/collection/helpers/csp/test/vega-nonce-manager.test.js +0 -177
  915. package/dist/collection/helpers/dialog/test/vega-dialog-controller.test.js +0 -114
  916. package/dist/collection/helpers/event-manager/test/child-nodes-event-prevent-slimmer.test.js +0 -209
  917. package/dist/collection/helpers/event-manager/test/child-nodes-notify-observer-slimmer.test.js +0 -81
  918. package/dist/collection/helpers/event-manager/test/component-event-id-map.test.js +0 -16
  919. package/dist/collection/helpers/event-manager/test/event-emit-slimmer.test.js +0 -144
  920. package/dist/collection/helpers/event-manager/test/internal-vega-event-manager.test.js +0 -70
  921. package/dist/collection/helpers/event-manager/test/jquery-delegated-strategy-controller.test.js +0 -131
  922. package/dist/collection/helpers/event-manager/test/vega-event-id.test.js +0 -16
  923. package/dist/collection/helpers/event-manager/test/vega-event-manager.test.js +0 -97
  924. package/dist/collection/helpers/feature-control/tests/feature-flag-controller.test.js +0 -69
  925. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-border-radius-formatter.test.js +0 -64
  926. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-border-radius-style-formatter.test.js +0 -32
  927. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-box-display-formatter.test.js +0 -31
  928. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-custom-formatter.test.js +0 -17
  929. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-display-formatter.test.js +0 -23
  930. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-flex-direction-formatter.test.js +0 -19
  931. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-flex-wrap-formatter.test.js +0 -19
  932. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-format-mediator.test.js +0 -43
  933. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-gap-formatter.ts.test.js +0 -29
  934. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-grid-column-formatter.test.js +0 -23
  935. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-grid-row-formatter.test.js +0 -27
  936. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-margin-formatter.test.js +0 -43
  937. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-margin-style-formatter.test.js +0 -28
  938. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-padding-formatter.test.js +0 -43
  939. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-padding-style-formatter.test.js +0 -28
  940. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-size-formatter.test.js +0 -27
  941. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-text-align-formatter.test.js +0 -19
  942. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-translocation-formatter.test.js +0 -51
  943. package/dist/collection/helpers/formatter/test/responsive-map-formatter/responsive-width-and-height-formatter.test.js +0 -20
  944. package/dist/collection/helpers/formatter/test/state-formatter/state-background-color-formatter.test.js +0 -18
  945. package/dist/collection/helpers/formatter/test/state-formatter/state-border-color-formatter.test.js +0 -13
  946. package/dist/collection/helpers/formatter/test/state-formatter/state-border-formatter.test.js +0 -13
  947. package/dist/collection/helpers/formatter/test/state-formatter/state-format-facade.test.js +0 -27
  948. package/dist/collection/helpers/formatter/test/state-formatter/state-shadow-formatter.test.js +0 -13
  949. package/dist/collection/helpers/formatter/test/string-formatter/custom-formatter-strategy.test.js +0 -13
  950. package/dist/collection/helpers/formatter/test/string-formatter/number-mask-strategy.test.js +0 -101
  951. package/dist/collection/helpers/formatter/test/string-formatter/number-thousand-comma-mask-strategy.test.js +0 -40
  952. package/dist/collection/helpers/formatter/test/string-formatter/string-mask-strategy.test.js +0 -147
  953. package/dist/collection/helpers/formatter/test/string-formatter/thousand-comma-strategy.test.js +0 -21
  954. package/dist/collection/helpers/formatter/test/string-formatter/vega-phone-number-input-strategy.test.js +0 -43
  955. package/dist/collection/helpers/formatter/test/style-formatter.test.js +0 -16
  956. package/dist/collection/helpers/icon/test/icon-manager-controller.test.js +0 -101
  957. package/dist/collection/helpers/icon/test/internal-icon-manager.test.js +0 -18
  958. package/dist/collection/helpers/immutable/test/immutable-array.test.js +0 -78
  959. package/dist/collection/helpers/immutable/test/immutable-map.test.js +0 -83
  960. package/dist/collection/helpers/immutable/test/immutable-set.test.js +0 -87
  961. package/dist/collection/helpers/keyboard/test/keyboard-manager.test.js +0 -241
  962. package/dist/collection/helpers/level-tracker/test/nested-level-tracker.test.js +0 -33
  963. package/dist/collection/helpers/loading-indicator/tests/vega-loader-controller.test.js +0 -192
  964. package/dist/collection/helpers/notify/tests/vega-notify-controller.test.js +0 -165
  965. package/dist/collection/helpers/paginator/test/value-paginator.test.js +0 -15
  966. package/dist/collection/helpers/queue/test/synchronize-task-queue.test.js +0 -76
  967. package/dist/collection/helpers/remote-invocation/remote-invocation-registry.test.js +0 -17
  968. package/dist/collection/helpers/rte-manager/rte.manager.test.js +0 -94
  969. package/dist/collection/helpers/skeleton-loader/tests/vega-skeleton-loader-controller.test.js +0 -194
  970. package/dist/collection/helpers/slimmers/element-appender/test/element-appender-slimmer.test.js +0 -621
  971. package/dist/collection/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.js +0 -248
  972. package/dist/collection/helpers/slimmers/mutation-observer/test/data-tab-index-value-mapper.test.js +0 -120
  973. package/dist/collection/helpers/slimmers/mutation-observer/test/mutation-observer-slimmer.test.js +0 -182
  974. package/dist/collection/helpers/slimmers/position-calculation/test/body-position-calculation-strategy.test.js +0 -353
  975. package/dist/collection/helpers/slimmers/position-calculation/test/screen-position-calculation-strategy.test.js +0 -365
  976. package/dist/collection/helpers/slimmers/runtime-metrics/test/public-api-runtime-metrics-slimmer-base.test.js +0 -96
  977. package/dist/collection/helpers/slimmers/sub-state/test/sub-state-observer-slimmer.test.js +0 -228
  978. package/dist/collection/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.js +0 -46
  979. package/dist/collection/helpers/slimmers/test/brand-switch-state-controller-slimmer.test.js +0 -75
  980. package/dist/collection/helpers/slimmers/test/component-global-style-slimmer.test.js +0 -104
  981. package/dist/collection/helpers/slimmers/test/component-usage-runtime-metrics.test.js +0 -72
  982. package/dist/collection/helpers/slimmers/test/dark-mode-state-controller.test.js +0 -65
  983. package/dist/collection/helpers/slimmers/test/deprecated-property-slimmer.test.js +0 -36
  984. package/dist/collection/helpers/slimmers/test/field-error-controller-slimmer.test.js +0 -55
  985. package/dist/collection/helpers/slimmers/test/form-field-controller-slimmer.test.js +0 -278
  986. package/dist/collection/helpers/slimmers/test/form-field-valid-invoke-slimmer.test.js +0 -106
  987. package/dist/collection/helpers/slimmers/test/global/vega-nonce-injector-slimmer.test.js +0 -64
  988. package/dist/collection/helpers/slimmers/test/global/vega-translate-observer-slimmer.test.js +0 -89
  989. package/dist/collection/helpers/slimmers/test/global/vega-watch-method-cancel-slimmer.test.js +0 -101
  990. package/dist/collection/helpers/slimmers/test/keyboard-manager-slimmer.test.js +0 -90
  991. package/dist/collection/helpers/slimmers/test/page-resize-observer-slimmer.test.js +0 -278
  992. package/dist/collection/helpers/slimmers/test/string-input-formatter-slimmer.test.js +0 -220
  993. package/dist/collection/helpers/slimmers/test/translation-slimmer.test.js +0 -89
  994. package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +0 -614
  995. package/dist/collection/helpers/touch-helper/test/touch-listener.test.js +0 -122
  996. package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +0 -286
  997. package/dist/collection/helpers/translation/tests/translation.test.js +0 -46
  998. package/dist/collection/helpers/ui/test/element-appender.test.js +0 -530
  999. package/dist/collection/helpers/validator/test/rules/check-box-required-rule.test.js +0 -88
  1000. package/dist/collection/helpers/validator/test/rules/custom-validation-rule.test.js +0 -56
  1001. package/dist/collection/helpers/validator/test/rules/date-range-rule.test.js +0 -67
  1002. package/dist/collection/helpers/validator/test/rules/date-required-rule.test.js +0 -120
  1003. package/dist/collection/helpers/validator/test/rules/email-field-rule.test.js +0 -69
  1004. package/dist/collection/helpers/validator/test/rules/file-uploader-required-rule.test.js +0 -7
  1005. package/dist/collection/helpers/validator/test/rules/input-phone-number-required-rule.test.js +0 -105
  1006. package/dist/collection/helpers/validator/test/rules/input-range-min-and-max-rule.test.js +0 -146
  1007. package/dist/collection/helpers/validator/test/rules/input-range-required-rule.test.js +0 -82
  1008. package/dist/collection/helpers/validator/test/rules/input-select-value-in-source-rule.test.js +0 -99
  1009. package/dist/collection/helpers/validator/test/rules/max-number-rule.test.js +0 -97
  1010. package/dist/collection/helpers/validator/test/rules/max-string-length-rule.test.js +0 -85
  1011. package/dist/collection/helpers/validator/test/rules/min-and-max-date-rule.test.js +0 -174
  1012. package/dist/collection/helpers/validator/test/rules/min-number-rule.test.js +0 -97
  1013. package/dist/collection/helpers/validator/test/rules/min-string-length-rule.test.js +0 -85
  1014. package/dist/collection/helpers/validator/test/rules/public-rules.test.js +0 -80
  1015. package/dist/collection/helpers/validator/test/rules/required-field-rule.test.js +0 -126
  1016. package/dist/collection/helpers/validator/test/rules/rich-text-editor-required-rule.test.js +0 -360
  1017. package/dist/collection/helpers/validator/test/rules/time-range-required-rule.test.js +0 -82
  1018. package/dist/collection/helpers/validator/test/rules/time-range-rule.test.js +0 -67
  1019. package/dist/collection/helpers/validator/test/rules/time-required-rule.test.js +0 -116
  1020. package/dist/collection/helpers/validator/test/rules/toggle-switch-required-rule.test.js +0 -72
  1021. package/dist/collection/helpers/validator/test/rules/valid-credit-card-number-rule.test.js +0 -135
  1022. package/dist/collection/helpers/validator/test/rules/valid-phone-number-rule.test.js +0 -95
  1023. package/dist/collection/helpers/validator/test/validation-rule-handler/form-field-validation-rule-handler-chain.test.js +0 -65
  1024. package/dist/collection/helpers/validator/test/validation-rule-handler/form-field-validation-rule-handler.test.js +0 -82
  1025. package/dist/collection/helpers/validator/test/validator/form-field-controller.test.js +0 -205
  1026. package/dist/collection/helpers/vega-telemetry-helper/test/vega-env-manager.test.js +0 -14
  1027. package/dist/collection/helpers/zindex/test/internal-vega-z-index-manager.test.js +0 -176
  1028. package/dist/collection/helpers/zindex/test/vega-z-index-manager.test.js +0 -46
  1029. package/dist/collection/polyfill/d3/test/d3-array-polyfill.test.js +0 -72
  1030. package/dist/collection/polyfill/d3/test/d3-axis-polyfill.test.js +0 -171
  1031. package/dist/collection/polyfill/d3/test/d3-integration.test.js +0 -137
  1032. package/dist/collection/polyfill/d3/test/d3-scale-polyfill.test.js +0 -382
  1033. package/dist/collection/polyfill/d3/test/d3-selection-polyfill.test.js +0 -239
  1034. package/dist/collection/polyfill/d3/test/d3-shape-polyfill.test.js +0 -225
  1035. package/dist/collection/polyfill/d3/test/d3-time-format-polyfill.test.js +0 -162
  1036. package/dist/collection/polyfill/d3/test/d3-time-polyfill.test.js +0 -76
  1037. package/dist/collection/polyfill/d3/test/index.test.js +0 -78
  1038. package/dist/collection/polyfill/libphonenumber/test/as-you-type.test.js +0 -309
  1039. package/dist/collection/polyfill/libphonenumber/test/format-helpers.test.js +0 -192
  1040. package/dist/collection/polyfill/libphonenumber/test/index.test.js +0 -16
  1041. package/dist/collection/polyfill/libphonenumber/test/metadata.test.js +0 -196
  1042. package/dist/collection/polyfill/libphonenumber/test/parse-phone-number.test.js +0 -218
  1043. package/dist/collection/polyfill/libphonenumber/test/phone-number.test.js +0 -56
  1044. package/dist/collection/polyfill/prism/test/css.test.js +0 -61
  1045. package/dist/collection/polyfill/prism/test/javascript.test.js +0 -113
  1046. package/dist/collection/polyfill/prism/test/jsx.test.js +0 -48
  1047. package/dist/collection/polyfill/prism/test/language-registry.test.js +0 -77
  1048. package/dist/collection/polyfill/prism/test/markup.test.js +0 -57
  1049. package/dist/collection/polyfill/prism/test/test-utils.js +0 -22
  1050. package/dist/collection/polyfill/prism/test/tokenizer.test.js +0 -180
  1051. package/dist/collection/polyfill/prism/test/tsx.test.js +0 -87
  1052. package/dist/collection/polyfill/prism/test/typescript.test.js +0 -86
  1053. package/dist/collection/polyfill/shadow-selection/test/shadow-selection-polyfill.test.js +0 -234
  1054. package/dist/collection/polyfill/test-polyfill/e2e/retry.js +0 -42
  1055. package/dist/collection/polyfill/test-polyfill/unit/create-touch-event.js +0 -31
  1056. package/dist/collection/polyfill/test-polyfill/unit/events.js +0 -100
  1057. package/dist/collection/polyfill/test-polyfill/unit/index.js +0 -3
  1058. package/dist/collection/polyfill/test-polyfill/unit/methods.js +0 -47
  1059. package/dist/collection/polyfill/test-polyfill/unit/range.js +0 -15
  1060. package/dist/collection/polyfill/test-polyfill/unit/shadow-selection.js +0 -17
  1061. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.test.js +0 -361
  1062. package/dist/collection/test-assets/test-icons.js +0 -5
  1063. package/dist/collection/types/test/type-guard.test.js +0 -46
  1064. package/dist/collection/utils/e2e-utils.js +0 -341
  1065. package/dist/collection/utils/sanitize/test/empty-strategy.test.js +0 -12
  1066. package/dist/collection/utils/sanitize/test/html-sanitizer.test.js +0 -57
  1067. package/dist/collection/utils/sanitize/test/label-strategy.test.js +0 -56
  1068. package/dist/collection/utils/sanitize/test/sanitize-strategy.test.js +0 -85
  1069. package/dist/collection/utils/sanitize/test/sanitize.test.js +0 -22
  1070. package/dist/collection/utils/sanitize/test/serialize-fragment.test.js +0 -25
  1071. package/dist/collection/utils/sanitize/test/style-strategy.test.js +0 -45
  1072. package/dist/collection/utils/spec-utils.js +0 -225
  1073. package/dist/collection/utils/test/accessibility.test.js +0 -40
  1074. package/dist/collection/utils/test/api.test.js +0 -34
  1075. package/dist/collection/utils/test/array.test.js +0 -260
  1076. package/dist/collection/utils/test/breakpoint.test.js +0 -37
  1077. package/dist/collection/utils/test/component.test.js +0 -59
  1078. package/dist/collection/utils/test/date.test.js +0 -104
  1079. package/dist/collection/utils/test/design-token.test.js +0 -91
  1080. package/dist/collection/utils/test/effect.test.js +0 -64
  1081. package/dist/collection/utils/test/local-storage.test.js +0 -38
  1082. package/dist/collection/utils/test/log.test.js +0 -49
  1083. package/dist/collection/utils/test/misc.test.js +0 -40
  1084. package/dist/collection/utils/test/number.test.js +0 -18
  1085. package/dist/collection/utils/test/object.test.js +0 -77
  1086. package/dist/collection/utils/test/pagination.test.js +0 -40
  1087. package/dist/collection/utils/test/pixel.test.js +0 -29
  1088. package/dist/collection/utils/test/safe-document.test.js +0 -13
  1089. package/dist/collection/utils/test/spec-utils.test.js +0 -73
  1090. package/dist/collection/utils/test/string.test.js +0 -8
  1091. package/dist/collection/utils/test/test-utils.test.js +0 -70
  1092. package/dist/collection/utils/test/timer.test.js +0 -16
  1093. package/dist/collection/utils/test/ui.test.js +0 -301
  1094. package/dist/collection/utils/test-utils.js +0 -156
  1095. package/dist/esm/app-globals-3b97bb20.js +0 -426
  1096. package/dist/esm/breakpoints-13353e09.js +0 -53
  1097. package/dist/esm/child-nodes-event-prevent-slimmer-4feabae0.js +0 -156
  1098. package/dist/esm/child-nodes-notify-observer-slimmer-541dd6a4.js +0 -88
  1099. package/dist/esm/code-block-d65bab61.js +0 -4364
  1100. package/dist/esm/component-value-history-controller-slimmer.abstract-556fcf2a.js +0 -730
  1101. package/dist/esm/date-required-rule-4ffd9cae.js +0 -90
  1102. package/dist/esm/deprecated-property-slimmer-2c14df89.js +0 -49
  1103. package/dist/esm/design-token-b518a2aa.js +0 -388
  1104. package/dist/esm/dom-node-subject-observer-factory-82f346e3.js +0 -138
  1105. package/dist/esm/dto-renderer-manager-73df5cbe.js +0 -4101
  1106. package/dist/esm/element-appender-slimmer-36b7a572.js +0 -1972
  1107. package/dist/esm/event-emit-slimmer-f879fd58.js +0 -265
  1108. package/dist/esm/form-field-controller-slimmer-9a880420.js +0 -1264
  1109. package/dist/esm/image-annotation-action-eb3dcad5.js +0 -307
  1110. package/dist/esm/inject-keyboard-manager-e5481833.js +0 -35
  1111. package/dist/esm/internal-translation-controller-0787a7a7.js +0 -296
  1112. package/dist/esm/internal-vega-event-manager-3aebbe55.js +0 -494
  1113. package/dist/esm/keyboard-manager-4dfc625f.js +0 -138
  1114. package/dist/esm/keyboard-manager-slimmer-87bf68f1.js +0 -37
  1115. package/dist/esm/month-view-generator-94134ec5.js +0 -98
  1116. package/dist/esm/object-66c37948.js +0 -46
  1117. package/dist/esm/page-resize-observer-slimmer-e0505250.js +0 -121
  1118. package/dist/esm/public-rules-49912d52.js +0 -31
  1119. package/dist/esm/range-0a22b512.js +0 -176
  1120. package/dist/esm/responsive-format-facade-b3799ff9.js +0 -912
  1121. package/dist/esm/rich-text-editor-required-rule-d86e3a51.js +0 -62
  1122. package/dist/esm/string-format-strategy.abstract-e40a0df7.js +0 -58
  1123. package/dist/esm/string-input-formatter-slimmer-076764fc.js +0 -228
  1124. package/dist/esm/string-mask-strategy-df1f5707.js +0 -170
  1125. package/dist/esm/style-formatter-95255392.js +0 -32
  1126. package/dist/esm/sub-state-notify-slimmer-f4b3b0b9.js +0 -79
  1127. package/dist/esm/sub-state-observer-slimmer-058feaf0.js +0 -132
  1128. package/dist/esm/time-required-rule-b4af75ae.js +0 -138
  1129. package/dist/esm/token-extension-ffd98170.js +0 -3041
  1130. package/dist/esm/translation-slimmer-e788cae4.js +0 -40
  1131. package/dist/esm/type-guard-f69d2935.js +0 -1939
  1132. package/dist/esm/ui-41f725b7.js +0 -45
  1133. package/dist/esm/ui-ee31416b.js +0 -241
  1134. package/dist/esm/valid-credit-card-number-rule-c023326d.js +0 -171
  1135. package/dist/esm/vega-event-id-fdc58a67.js +0 -114
  1136. package/dist/esm/vega-internal-event-id-12783594.js +0 -70
  1137. package/dist/esm/wait-for-component-did-render-4d0a3428.js +0 -30
  1138. package/dist/types/components/vega-calendar/slimmers/common/helpers/test/calendar-event-repeat-pattern-factory.test.d.ts +0 -1
  1139. package/dist/types/components/vega-calendar/slimmers/common/layout/test/long-event-layout-generator.test.d.ts +0 -1
  1140. package/dist/types/components/vega-calendar/slimmers/day-view/renderers/timed-event/layout/test/day-view-event-layout-generator.test.d.ts +0 -1
  1141. package/dist/types/components/vega-code-block/test/code-block-range.test.d.ts +0 -1
  1142. package/dist/types/components/vega-dropdown/test/share.d.ts +0 -12
  1143. package/dist/types/components/vega-input-credit-card/test/share.d.ts +0 -18
  1144. package/dist/types/components/vega-nav/vega-left-nav/test/vega-left-nav-mock-data.d.ts +0 -4
  1145. package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.test.d.ts +0 -1
  1146. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/text-node-color-controller.d.ts +0 -22
  1147. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/text-node-rendering-registry.d.ts +0 -22
  1148. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/action-handle-strategy-registry.test.d.ts +0 -1
  1149. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-delete-node-content-strategy.test.d.ts +0 -1
  1150. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-insert-line-break-with-blocks-strategy.test.d.ts +0 -1
  1151. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.d.ts +0 -1
  1152. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.d.ts +0 -1
  1153. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.d.ts +0 -1
  1154. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-set-annotation-map-strategy.test.d.ts +0 -1
  1155. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-update-url-strategy.test.d.ts +0 -1
  1156. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-block-strategy-register.test.d.ts +0 -1
  1157. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-item-strategy-register.test.d.ts +0 -1
  1158. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-split-text-strategy.test.d.ts +0 -1
  1159. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-update-annotation-map-strategy.test.d.ts +0 -1
  1160. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.d.ts +0 -1
  1161. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/update-selected-text-strategy.test.d.ts +0 -1
  1162. package/dist/types/components/vega-rich-text-editor/test/dto/annotation-actions.test.d.ts +0 -1
  1163. package/dist/types/components/vega-rich-text-editor/test/dto/annotation-style.test.d.ts +0 -1
  1164. package/dist/types/components/vega-rich-text-editor/test/dto/annotations.test.d.ts +0 -1
  1165. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/code-block.test.d.ts +0 -1
  1166. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/html-block.test.d.ts +0 -1
  1167. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/image-block.test.d.ts +0 -1
  1168. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/list-block.test.d.ts +0 -1
  1169. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/list-item.test.d.ts +0 -1
  1170. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/text-block.test.d.ts +0 -1
  1171. package/dist/types/components/vega-rich-text-editor/test/dto/content-state.test.d.ts +0 -1
  1172. package/dist/types/components/vega-rich-text-editor/test/dto/nodes/image-node.test.d.ts +0 -1
  1173. package/dist/types/components/vega-rich-text-editor/test/dto/nodes/text-node.test.d.ts +0 -1
  1174. package/dist/types/components/vega-rich-text-editor/test/dto/range.test.d.ts +0 -1
  1175. package/dist/types/components/vega-rich-text-editor/test/e2e-utils.d.ts +0 -67
  1176. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/custom-attribute-annotation-handler.test.d.ts +0 -1
  1177. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/element-to-text-node-strategy.test.d.ts +0 -1
  1178. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/html-element-to-annotation-generator.test.d.ts +0 -1
  1179. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.d.ts +0 -1
  1180. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.d.ts +0 -1
  1181. package/dist/types/components/vega-rich-text-editor/test/extensions/extension-test-utils.d.ts +0 -21
  1182. package/dist/types/components/vega-rich-text-editor/test/fixture.d.ts +0 -19
  1183. package/dist/types/components/vega-rich-text-editor/test/html-cleaner/html-content-cleaner.test.d.ts +0 -1
  1184. package/dist/types/components/vega-rich-text-editor/test/html-cleaner/remove-whitespace-after-opening-tag-processor.test.d.ts +0 -1
  1185. package/dist/types/components/vega-rich-text-editor/test/html-cleaner/remove-whitespace-before-closing-tag-processor.test.d.ts +0 -1
  1186. package/dist/types/components/vega-rich-text-editor/test/html-cleaner/remove-whitespace-between-tags-processor.test.d.ts +0 -1
  1187. package/dist/types/components/vega-rich-text-editor/test/spec-utils.d.ts +0 -15
  1188. package/dist/types/components/vega-sidenav/test/test.helper.d.ts +0 -6
  1189. package/dist/types/components/vega-table/slimmers/controllers/dto/test/column-render-input-model.test.d.ts +0 -1
  1190. package/dist/types/components/vega-table/slimmers/controllers/dto/test/column-structure-model.test.d.ts +0 -1
  1191. package/dist/types/components/vega-table/test/utils.d.ts +0 -9
  1192. package/dist/types/components/vega-table/test/vega-table-sorter.test.d.ts +0 -1
  1193. package/dist/types/constants/tests/validator.test.d.ts +0 -1
  1194. package/dist/types/decorators/method-decorators/tests/component-load-required.test.d.ts +0 -1
  1195. package/dist/types/decorators/property-decorators/tests/inject-element-appender-proxy.test.d.ts +0 -1
  1196. package/dist/types/decorators/property-decorators/tests/inject-keyboard-manager.test.d.ts +0 -1
  1197. package/dist/types/global/tests/before-vega-load.test.d.ts +0 -1
  1198. package/dist/types/helpers/calendar/test/calendar-date-time.test.d.ts +0 -1
  1199. package/dist/types/helpers/calendar/test/calendar-date.test.d.ts +0 -1
  1200. package/dist/types/helpers/calendar/test/calendar-event.test.d.ts +0 -1
  1201. package/dist/types/helpers/calendar/test/calendar-period/day-period.test.d.ts +0 -1
  1202. package/dist/types/helpers/calendar/test/calendar-period/month-period.test.d.ts +0 -1
  1203. package/dist/types/helpers/calendar/test/calendar-period/week-period.test.d.ts +0 -1
  1204. package/dist/types/helpers/calendar/test/calendar-time.test.d.ts +0 -1
  1205. package/dist/types/helpers/calendar/test/calendar-view-generator/day-view-generator.test.d.ts +0 -1
  1206. package/dist/types/helpers/calendar/test/calendar-view-generator/month-view-generator.test.d.ts +0 -1
  1207. package/dist/types/helpers/calendar/test/calendar-view-generator/week-view-generator.test.d.ts +0 -1
  1208. package/dist/types/helpers/calendar/test/calendar-view.test.d.ts +0 -1
  1209. package/dist/types/helpers/calendar/test/index.test.d.ts +0 -1
  1210. package/dist/types/helpers/calendar/test/utils.test.d.ts +0 -1
  1211. package/dist/types/helpers/change-manager/test/change-manager.test.d.ts +0 -1
  1212. package/dist/types/helpers/change-manager/test/dom-node-subject-factory.test.d.ts +0 -1
  1213. package/dist/types/helpers/chart/test/controllers/chart-dimension-controller.test.d.ts +0 -1
  1214. package/dist/types/helpers/chart/test/drawers/arc-path-drawer.test.d.ts +0 -1
  1215. package/dist/types/helpers/chart/test/drawers/legend-drawer.test.d.ts +0 -1
  1216. package/dist/types/helpers/chart/test/drawers/line-drawer.test.d.ts +0 -1
  1217. package/dist/types/helpers/chart/test/drawers/path-drawer.test.d.ts +0 -1
  1218. package/dist/types/helpers/chart/test/drawers/rect-drawer.test.d.ts +0 -1
  1219. package/dist/types/helpers/chart/test/drawers/text-drawer.test.d.ts +0 -1
  1220. package/dist/types/helpers/chart/test/drawers/x-axis-drawer.test.d.ts +0 -1
  1221. package/dist/types/helpers/chart/test/drawers/y-axis-drawer.test.d.ts +0 -1
  1222. package/dist/types/helpers/chart/test/graph-context-factory.test.d.ts +0 -1
  1223. package/dist/types/helpers/chart/test/input-processors/format-time-positions-input-processor.test.d.ts +0 -1
  1224. package/dist/types/helpers/chart/test/input-processors/horizontal-x-axis-input-processor.test.d.ts +0 -1
  1225. package/dist/types/helpers/chart/test/input-processors/horizontal-y-axis-input-processor.test.d.ts +0 -1
  1226. package/dist/types/helpers/chart/test/input-processors/layout-input-processor.test.d.ts +0 -1
  1227. package/dist/types/helpers/chart/test/input-processors/line-path-input-processor.test.d.ts +0 -1
  1228. package/dist/types/helpers/chart/test/input-processors/pie-chart-filter-input-processor.test.d.ts +0 -1
  1229. package/dist/types/helpers/chart/test/input-processors/pie-chart-radius-input-processor.test.d.ts +0 -1
  1230. package/dist/types/helpers/chart/test/input-processors/sort-positions-input-processor.test.d.ts +0 -1
  1231. package/dist/types/helpers/chart/test/input-processors/x-axis-input-processor.test.d.ts +0 -1
  1232. package/dist/types/helpers/chart/test/input-processors/x-axis-label-formatter-input-processor.test.d.ts +0 -1
  1233. package/dist/types/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.d.ts +0 -1
  1234. package/dist/types/helpers/chart/test/input-processors/y-axis-input-processor.test.d.ts +0 -1
  1235. package/dist/types/helpers/chart/test/interacting-entry-generator/arc-path-hover-generator.test.d.ts +0 -1
  1236. package/dist/types/helpers/chart/test/interacting-entry-generator/pie-legend-hover-generator.test.d.ts +0 -1
  1237. package/dist/types/helpers/chart/test/interactors/interactor-factory.test.d.ts +0 -1
  1238. package/dist/types/helpers/chart/test/interactors/svg-interactor.test.d.ts +0 -1
  1239. package/dist/types/helpers/chart/test/line-chart.test.d.ts +0 -1
  1240. package/dist/types/helpers/chart/test/pie-chart.test.d.ts +0 -1
  1241. package/dist/types/helpers/chart/test/renderers/canvas-renderer.test.d.ts +0 -1
  1242. package/dist/types/helpers/chart/test/renderers/renderer-factory.test.d.ts +0 -1
  1243. package/dist/types/helpers/chart/test/renderers/svg-renderer.test.d.ts +0 -1
  1244. package/dist/types/helpers/code-format/test/code-formatter.test.d.ts +0 -1
  1245. package/dist/types/helpers/common/test/common.test.d.ts +0 -1
  1246. package/dist/types/helpers/common/test/wait-for-component-did-render.test.d.ts +0 -1
  1247. package/dist/types/helpers/common/test/wait-for-vega-handler.test.d.ts +0 -1
  1248. package/dist/types/helpers/csp/test/styles-preservator.test.d.ts +0 -1
  1249. package/dist/types/helpers/csp/test/vega-nonce-manager.test.d.ts +0 -1
  1250. package/dist/types/helpers/dialog/test/vega-dialog-controller.test.d.ts +0 -1
  1251. package/dist/types/helpers/event-manager/test/child-nodes-event-prevent-slimmer.test.d.ts +0 -1
  1252. package/dist/types/helpers/event-manager/test/child-nodes-notify-observer-slimmer.test.d.ts +0 -1
  1253. package/dist/types/helpers/event-manager/test/component-event-id-map.test.d.ts +0 -1
  1254. package/dist/types/helpers/event-manager/test/event-emit-slimmer.test.d.ts +0 -1
  1255. package/dist/types/helpers/event-manager/test/internal-vega-event-manager.test.d.ts +0 -1
  1256. package/dist/types/helpers/event-manager/test/jquery-delegated-strategy-controller.test.d.ts +0 -1
  1257. package/dist/types/helpers/event-manager/test/vega-event-id.test.d.ts +0 -1
  1258. package/dist/types/helpers/event-manager/test/vega-event-manager.test.d.ts +0 -1
  1259. package/dist/types/helpers/feature-control/tests/feature-flag-controller.test.d.ts +0 -1
  1260. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-border-radius-formatter.test.d.ts +0 -1
  1261. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-border-radius-style-formatter.test.d.ts +0 -1
  1262. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-box-display-formatter.test.d.ts +0 -1
  1263. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-custom-formatter.test.d.ts +0 -1
  1264. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-display-formatter.test.d.ts +0 -1
  1265. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-flex-direction-formatter.test.d.ts +0 -1
  1266. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-flex-wrap-formatter.test.d.ts +0 -1
  1267. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-format-mediator.test.d.ts +0 -1
  1268. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-gap-formatter.ts.test.d.ts +0 -1
  1269. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-grid-column-formatter.test.d.ts +0 -1
  1270. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-grid-row-formatter.test.d.ts +0 -1
  1271. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-margin-formatter.test.d.ts +0 -1
  1272. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-margin-style-formatter.test.d.ts +0 -1
  1273. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-padding-formatter.test.d.ts +0 -1
  1274. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-padding-style-formatter.test.d.ts +0 -1
  1275. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-size-formatter.test.d.ts +0 -1
  1276. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-text-align-formatter.test.d.ts +0 -1
  1277. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-translocation-formatter.test.d.ts +0 -1
  1278. package/dist/types/helpers/formatter/test/responsive-map-formatter/responsive-width-and-height-formatter.test.d.ts +0 -1
  1279. package/dist/types/helpers/formatter/test/state-formatter/state-background-color-formatter.test.d.ts +0 -1
  1280. package/dist/types/helpers/formatter/test/state-formatter/state-border-color-formatter.test.d.ts +0 -1
  1281. package/dist/types/helpers/formatter/test/state-formatter/state-border-formatter.test.d.ts +0 -1
  1282. package/dist/types/helpers/formatter/test/state-formatter/state-format-facade.test.d.ts +0 -1
  1283. package/dist/types/helpers/formatter/test/state-formatter/state-shadow-formatter.test.d.ts +0 -1
  1284. package/dist/types/helpers/formatter/test/string-formatter/custom-formatter-strategy.test.d.ts +0 -1
  1285. package/dist/types/helpers/formatter/test/string-formatter/number-mask-strategy.test.d.ts +0 -1
  1286. package/dist/types/helpers/formatter/test/string-formatter/number-thousand-comma-mask-strategy.test.d.ts +0 -1
  1287. package/dist/types/helpers/formatter/test/string-formatter/string-mask-strategy.test.d.ts +0 -1
  1288. package/dist/types/helpers/formatter/test/string-formatter/thousand-comma-strategy.test.d.ts +0 -1
  1289. package/dist/types/helpers/formatter/test/string-formatter/vega-phone-number-input-strategy.test.d.ts +0 -1
  1290. package/dist/types/helpers/formatter/test/style-formatter.test.d.ts +0 -1
  1291. package/dist/types/helpers/icon/test/icon-manager-controller.test.d.ts +0 -1
  1292. package/dist/types/helpers/icon/test/internal-icon-manager.test.d.ts +0 -1
  1293. package/dist/types/helpers/immutable/test/immutable-array.test.d.ts +0 -1
  1294. package/dist/types/helpers/immutable/test/immutable-map.test.d.ts +0 -1
  1295. package/dist/types/helpers/immutable/test/immutable-set.test.d.ts +0 -1
  1296. package/dist/types/helpers/keyboard/test/keyboard-manager.test.d.ts +0 -1
  1297. package/dist/types/helpers/level-tracker/test/nested-level-tracker.test.d.ts +0 -1
  1298. package/dist/types/helpers/loading-indicator/tests/vega-loader-controller.test.d.ts +0 -1
  1299. package/dist/types/helpers/notify/tests/vega-notify-controller.test.d.ts +0 -1
  1300. package/dist/types/helpers/paginator/test/value-paginator.test.d.ts +0 -1
  1301. package/dist/types/helpers/queue/test/synchronize-task-queue.test.d.ts +0 -1
  1302. package/dist/types/helpers/remote-invocation/remote-invocation-registry.test.d.ts +0 -1
  1303. package/dist/types/helpers/rte-manager/rte.manager.test.d.ts +0 -1
  1304. package/dist/types/helpers/skeleton-loader/tests/vega-skeleton-loader-controller.test.d.ts +0 -1
  1305. package/dist/types/helpers/slimmers/element-appender/test/element-appender-slimmer.test.d.ts +0 -1
  1306. package/dist/types/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.d.ts +0 -1
  1307. package/dist/types/helpers/slimmers/mutation-observer/test/data-tab-index-value-mapper.test.d.ts +0 -1
  1308. package/dist/types/helpers/slimmers/mutation-observer/test/mutation-observer-slimmer.test.d.ts +0 -1
  1309. package/dist/types/helpers/slimmers/position-calculation/test/body-position-calculation-strategy.test.d.ts +0 -15
  1310. package/dist/types/helpers/slimmers/position-calculation/test/screen-position-calculation-strategy.test.d.ts +0 -1
  1311. package/dist/types/helpers/slimmers/runtime-metrics/test/public-api-runtime-metrics-slimmer-base.test.d.ts +0 -1
  1312. package/dist/types/helpers/slimmers/sub-state/test/sub-state-observer-slimmer.test.d.ts +0 -1
  1313. package/dist/types/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.d.ts +0 -1
  1314. package/dist/types/helpers/slimmers/test/brand-switch-state-controller-slimmer.test.d.ts +0 -1
  1315. package/dist/types/helpers/slimmers/test/component-global-style-slimmer.test.d.ts +0 -1
  1316. package/dist/types/helpers/slimmers/test/component-usage-runtime-metrics.test.d.ts +0 -1
  1317. package/dist/types/helpers/slimmers/test/dark-mode-state-controller.test.d.ts +0 -1
  1318. package/dist/types/helpers/slimmers/test/deprecated-property-slimmer.test.d.ts +0 -1
  1319. package/dist/types/helpers/slimmers/test/field-error-controller-slimmer.test.d.ts +0 -1
  1320. package/dist/types/helpers/slimmers/test/form-field-controller-slimmer.test.d.ts +0 -1
  1321. package/dist/types/helpers/slimmers/test/form-field-valid-invoke-slimmer.test.d.ts +0 -1
  1322. package/dist/types/helpers/slimmers/test/global/vega-nonce-injector-slimmer.test.d.ts +0 -1
  1323. package/dist/types/helpers/slimmers/test/global/vega-translate-observer-slimmer.test.d.ts +0 -1
  1324. package/dist/types/helpers/slimmers/test/global/vega-watch-method-cancel-slimmer.test.d.ts +0 -1
  1325. package/dist/types/helpers/slimmers/test/keyboard-manager-slimmer.test.d.ts +0 -1
  1326. package/dist/types/helpers/slimmers/test/page-resize-observer-slimmer.test.d.ts +0 -1
  1327. package/dist/types/helpers/slimmers/test/string-input-formatter-slimmer.test.d.ts +0 -1
  1328. package/dist/types/helpers/slimmers/test/translation-slimmer.test.d.ts +0 -1
  1329. package/dist/types/helpers/theme/tests/theme-manager-controller.test.d.ts +0 -1
  1330. package/dist/types/helpers/touch-helper/test/touch-listener.test.d.ts +0 -1
  1331. package/dist/types/helpers/translation/tests/internal-translation-controller.test.d.ts +0 -1
  1332. package/dist/types/helpers/translation/tests/translation.test.d.ts +0 -1
  1333. package/dist/types/helpers/ui/test/element-appender.test.d.ts +0 -1
  1334. package/dist/types/helpers/validator/test/rules/check-box-required-rule.test.d.ts +0 -1
  1335. package/dist/types/helpers/validator/test/rules/custom-validation-rule.test.d.ts +0 -1
  1336. package/dist/types/helpers/validator/test/rules/date-range-rule.test.d.ts +0 -1
  1337. package/dist/types/helpers/validator/test/rules/date-required-rule.test.d.ts +0 -1
  1338. package/dist/types/helpers/validator/test/rules/email-field-rule.test.d.ts +0 -1
  1339. package/dist/types/helpers/validator/test/rules/file-uploader-required-rule.test.d.ts +0 -1
  1340. package/dist/types/helpers/validator/test/rules/input-phone-number-required-rule.test.d.ts +0 -1
  1341. package/dist/types/helpers/validator/test/rules/input-range-min-and-max-rule.test.d.ts +0 -1
  1342. package/dist/types/helpers/validator/test/rules/input-range-required-rule.test.d.ts +0 -1
  1343. package/dist/types/helpers/validator/test/rules/input-select-value-in-source-rule.test.d.ts +0 -1
  1344. package/dist/types/helpers/validator/test/rules/max-number-rule.test.d.ts +0 -1
  1345. package/dist/types/helpers/validator/test/rules/max-string-length-rule.test.d.ts +0 -1
  1346. package/dist/types/helpers/validator/test/rules/min-and-max-date-rule.test.d.ts +0 -1
  1347. package/dist/types/helpers/validator/test/rules/min-number-rule.test.d.ts +0 -1
  1348. package/dist/types/helpers/validator/test/rules/min-string-length-rule.test.d.ts +0 -1
  1349. package/dist/types/helpers/validator/test/rules/public-rules.test.d.ts +0 -1
  1350. package/dist/types/helpers/validator/test/rules/required-field-rule.test.d.ts +0 -1
  1351. package/dist/types/helpers/validator/test/rules/rich-text-editor-required-rule.test.d.ts +0 -1
  1352. package/dist/types/helpers/validator/test/rules/time-range-required-rule.test.d.ts +0 -1
  1353. package/dist/types/helpers/validator/test/rules/time-range-rule.test.d.ts +0 -1
  1354. package/dist/types/helpers/validator/test/rules/time-required-rule.test.d.ts +0 -1
  1355. package/dist/types/helpers/validator/test/rules/toggle-switch-required-rule.test.d.ts +0 -1
  1356. package/dist/types/helpers/validator/test/rules/valid-credit-card-number-rule.test.d.ts +0 -1
  1357. package/dist/types/helpers/validator/test/rules/valid-phone-number-rule.test.d.ts +0 -1
  1358. package/dist/types/helpers/validator/test/validation-rule-handler/form-field-validation-rule-handler-chain.test.d.ts +0 -1
  1359. package/dist/types/helpers/validator/test/validation-rule-handler/form-field-validation-rule-handler.test.d.ts +0 -1
  1360. package/dist/types/helpers/validator/test/validator/form-field-controller.test.d.ts +0 -1
  1361. package/dist/types/helpers/vega-telemetry-helper/test/vega-env-manager.test.d.ts +0 -1
  1362. package/dist/types/helpers/zindex/test/internal-vega-z-index-manager.test.d.ts +0 -1
  1363. package/dist/types/helpers/zindex/test/vega-z-index-manager.test.d.ts +0 -1
  1364. package/dist/types/polyfill/d3/test/d3-array-polyfill.test.d.ts +0 -1
  1365. package/dist/types/polyfill/d3/test/d3-axis-polyfill.test.d.ts +0 -1
  1366. package/dist/types/polyfill/d3/test/d3-integration.test.d.ts +0 -1
  1367. package/dist/types/polyfill/d3/test/d3-scale-polyfill.test.d.ts +0 -1
  1368. package/dist/types/polyfill/d3/test/d3-selection-polyfill.test.d.ts +0 -1
  1369. package/dist/types/polyfill/d3/test/d3-shape-polyfill.test.d.ts +0 -1
  1370. package/dist/types/polyfill/d3/test/d3-time-format-polyfill.test.d.ts +0 -1
  1371. package/dist/types/polyfill/d3/test/d3-time-polyfill.test.d.ts +0 -1
  1372. package/dist/types/polyfill/d3/test/index.test.d.ts +0 -1
  1373. package/dist/types/polyfill/libphonenumber/test/as-you-type.test.d.ts +0 -1
  1374. package/dist/types/polyfill/libphonenumber/test/format-helpers.test.d.ts +0 -1
  1375. package/dist/types/polyfill/libphonenumber/test/index.test.d.ts +0 -1
  1376. package/dist/types/polyfill/libphonenumber/test/metadata.test.d.ts +0 -1
  1377. package/dist/types/polyfill/libphonenumber/test/parse-phone-number.test.d.ts +0 -1
  1378. package/dist/types/polyfill/libphonenumber/test/phone-number.test.d.ts +0 -1
  1379. package/dist/types/polyfill/prism/test/css.test.d.ts +0 -1
  1380. package/dist/types/polyfill/prism/test/javascript.test.d.ts +0 -1
  1381. package/dist/types/polyfill/prism/test/jsx.test.d.ts +0 -1
  1382. package/dist/types/polyfill/prism/test/language-registry.test.d.ts +0 -1
  1383. package/dist/types/polyfill/prism/test/markup.test.d.ts +0 -1
  1384. package/dist/types/polyfill/prism/test/test-utils.d.ts +0 -10
  1385. package/dist/types/polyfill/prism/test/tokenizer.test.d.ts +0 -1
  1386. package/dist/types/polyfill/prism/test/tsx.test.d.ts +0 -1
  1387. package/dist/types/polyfill/prism/test/typescript.test.d.ts +0 -1
  1388. package/dist/types/polyfill/shadow-selection/test/shadow-selection-polyfill.test.d.ts +0 -0
  1389. package/dist/types/polyfill/test-polyfill/e2e/retry.d.ts +0 -8
  1390. package/dist/types/polyfill/test-polyfill/unit/create-touch-event.d.ts +0 -11
  1391. package/dist/types/polyfill/test-polyfill/unit/events.d.ts +0 -1
  1392. package/dist/types/polyfill/test-polyfill/unit/index.d.ts +0 -3
  1393. package/dist/types/polyfill/test-polyfill/unit/methods.d.ts +0 -1
  1394. package/dist/types/polyfill/test-polyfill/unit/range.d.ts +0 -7
  1395. package/dist/types/polyfill/test-polyfill/unit/shadow-selection.d.ts +0 -0
  1396. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.test.d.ts +0 -1
  1397. package/dist/types/test-assets/test-icons.d.ts +0 -4
  1398. package/dist/types/types/test/type-guard.test.d.ts +0 -1
  1399. package/dist/types/utils/e2e-utils.d.ts +0 -150
  1400. package/dist/types/utils/sanitize/test/empty-strategy.test.d.ts +0 -1
  1401. package/dist/types/utils/sanitize/test/html-sanitizer.test.d.ts +0 -1
  1402. package/dist/types/utils/sanitize/test/label-strategy.test.d.ts +0 -1
  1403. package/dist/types/utils/sanitize/test/sanitize-strategy.test.d.ts +0 -1
  1404. package/dist/types/utils/sanitize/test/sanitize.test.d.ts +0 -1
  1405. package/dist/types/utils/sanitize/test/serialize-fragment.test.d.ts +0 -1
  1406. package/dist/types/utils/sanitize/test/style-strategy.test.d.ts +0 -1
  1407. package/dist/types/utils/spec-utils.d.ts +0 -108
  1408. package/dist/types/utils/test/accessibility.test.d.ts +0 -1
  1409. package/dist/types/utils/test/api.test.d.ts +0 -1
  1410. package/dist/types/utils/test/array.test.d.ts +0 -1
  1411. package/dist/types/utils/test/breakpoint.test.d.ts +0 -1
  1412. package/dist/types/utils/test/component.test.d.ts +0 -1
  1413. package/dist/types/utils/test/date.test.d.ts +0 -1
  1414. package/dist/types/utils/test/design-token.test.d.ts +0 -1
  1415. package/dist/types/utils/test/effect.test.d.ts +0 -1
  1416. package/dist/types/utils/test/local-storage.test.d.ts +0 -1
  1417. package/dist/types/utils/test/log.test.d.ts +0 -1
  1418. package/dist/types/utils/test/misc.test.d.ts +0 -1
  1419. package/dist/types/utils/test/number.test.d.ts +0 -1
  1420. package/dist/types/utils/test/object.test.d.ts +0 -1
  1421. package/dist/types/utils/test/pagination.test.d.ts +0 -1
  1422. package/dist/types/utils/test/pixel.test.d.ts +0 -1
  1423. package/dist/types/utils/test/safe-document.test.d.ts +0 -1
  1424. package/dist/types/utils/test/spec-utils.test.d.ts +0 -1
  1425. package/dist/types/utils/test/string.test.d.ts +0 -1
  1426. package/dist/types/utils/test/test-utils.test.d.ts +0 -1
  1427. package/dist/types/utils/test/timer.test.d.ts +0 -1
  1428. package/dist/types/utils/test/ui.test.d.ts +0 -1
  1429. package/dist/types/utils/test-utils.d.ts +0 -61
  1430. package/dist/vega/p-0009e0bc.entry.js +0 -1
  1431. package/dist/vega/p-02976501.js +0 -1
  1432. package/dist/vega/p-03280f85.entry.js +0 -1
  1433. package/dist/vega/p-03b1e442.js +0 -1
  1434. package/dist/vega/p-0681ffee.entry.js +0 -1
  1435. package/dist/vega/p-093aa0cb.entry.js +0 -1
  1436. package/dist/vega/p-1828f9e6.entry.js +0 -1
  1437. package/dist/vega/p-19883e27.entry.js +0 -1
  1438. package/dist/vega/p-1e015382.js +0 -1
  1439. package/dist/vega/p-1ff45314.entry.js +0 -1
  1440. package/dist/vega/p-24b4c64f.js +0 -1
  1441. package/dist/vega/p-2e7ec8e0.entry.js +0 -1
  1442. package/dist/vega/p-309b5016.entry.js +0 -1
  1443. package/dist/vega/p-31ac7386.js +0 -1
  1444. package/dist/vega/p-3592a26d.entry.js +0 -1
  1445. package/dist/vega/p-383e235a.entry.js +0 -1
  1446. package/dist/vega/p-3992038a.js +0 -1
  1447. package/dist/vega/p-3a537cd0.js +0 -1
  1448. package/dist/vega/p-3b7ad04b.entry.js +0 -1
  1449. package/dist/vega/p-3d4b8066.entry.js +0 -1
  1450. package/dist/vega/p-3e484d99.entry.js +0 -1
  1451. package/dist/vega/p-3fd3861c.entry.js +0 -1
  1452. package/dist/vega/p-4079e932.js +0 -1
  1453. package/dist/vega/p-43df17a1.js +0 -1
  1454. package/dist/vega/p-473ceda5.entry.js +0 -1
  1455. package/dist/vega/p-474b97cf.entry.js +0 -1
  1456. package/dist/vega/p-47c202eb.entry.js +0 -1
  1457. package/dist/vega/p-4e0344bc.entry.js +0 -1
  1458. package/dist/vega/p-4efe9cd8.entry.js +0 -1
  1459. package/dist/vega/p-536ad3d7.entry.js +0 -1
  1460. package/dist/vega/p-53e0b2bd.entry.js +0 -1
  1461. package/dist/vega/p-57180993.entry.js +0 -1
  1462. package/dist/vega/p-5b238c6d.js +0 -1
  1463. package/dist/vega/p-5ba34330.js +0 -1
  1464. package/dist/vega/p-5e1d0f21.entry.js +0 -1
  1465. package/dist/vega/p-5ed5aa26.js +0 -1
  1466. package/dist/vega/p-5f81beae.js +0 -1
  1467. package/dist/vega/p-6a8ac66d.entry.js +0 -1
  1468. package/dist/vega/p-6b3776ec.js +0 -1
  1469. package/dist/vega/p-6b4021f0.entry.js +0 -1
  1470. package/dist/vega/p-6c170474.js +0 -1
  1471. package/dist/vega/p-6cf28c27.js +0 -1
  1472. package/dist/vega/p-71cd1d9e.entry.js +0 -1
  1473. package/dist/vega/p-7440325c.entry.js +0 -1
  1474. package/dist/vega/p-764425e4.entry.js +0 -1
  1475. package/dist/vega/p-77908e45.entry.js +0 -1
  1476. package/dist/vega/p-7ade785e.js +0 -1
  1477. package/dist/vega/p-7db5e003.js +0 -1
  1478. package/dist/vega/p-7db918f4.js +0 -1
  1479. package/dist/vega/p-7f398d23.entry.js +0 -1
  1480. package/dist/vega/p-7f665911.entry.js +0 -1
  1481. package/dist/vega/p-840f156e.entry.js +0 -1
  1482. package/dist/vega/p-87379d3c.js +0 -1
  1483. package/dist/vega/p-87ed06cd.entry.js +0 -1
  1484. package/dist/vega/p-882a220c.js +0 -1
  1485. package/dist/vega/p-8852361b.js +0 -1
  1486. package/dist/vega/p-898bcb24.js +0 -1
  1487. package/dist/vega/p-8fbb677e.entry.js +0 -1
  1488. package/dist/vega/p-9493d87a.js +0 -1
  1489. package/dist/vega/p-951c0172.js +0 -1
  1490. package/dist/vega/p-95919581.entry.js +0 -1
  1491. package/dist/vega/p-95d1b547.js +0 -1
  1492. package/dist/vega/p-99c8f9a4.entry.js +0 -1
  1493. package/dist/vega/p-9c713bc0.js +0 -1
  1494. package/dist/vega/p-9dc77b66.entry.js +0 -1
  1495. package/dist/vega/p-9f467a59.js +0 -1
  1496. package/dist/vega/p-a113fd15.entry.js +0 -1
  1497. package/dist/vega/p-a253e791.entry.js +0 -1
  1498. package/dist/vega/p-a3272850.entry.js +0 -1
  1499. package/dist/vega/p-a432708d.entry.js +0 -1
  1500. package/dist/vega/p-a57a7ab8.entry.js +0 -1
  1501. package/dist/vega/p-a58bd510.entry.js +0 -1
  1502. package/dist/vega/p-a957e15f.js +0 -1
  1503. package/dist/vega/p-abb81b7b.js +0 -1
  1504. package/dist/vega/p-ae6ed091.entry.js +0 -1
  1505. package/dist/vega/p-b5e31243.entry.js +0 -1
  1506. package/dist/vega/p-b88ca09b.js +0 -1
  1507. package/dist/vega/p-b901d624.js +0 -1
  1508. package/dist/vega/p-ba475520.entry.js +0 -1
  1509. package/dist/vega/p-bf04ff19.js +0 -1
  1510. package/dist/vega/p-bf19682d.js +0 -1
  1511. package/dist/vega/p-c208a3b7.js +0 -1
  1512. package/dist/vega/p-c25577ae.entry.js +0 -1
  1513. package/dist/vega/p-c2560608.entry.js +0 -1
  1514. package/dist/vega/p-c2df94f6.js +0 -1
  1515. package/dist/vega/p-c3eec160.entry.js +0 -1
  1516. package/dist/vega/p-c6031d3f.entry.js +0 -1
  1517. package/dist/vega/p-c72e08c6.entry.js +0 -1
  1518. package/dist/vega/p-c87cf96a.entry.js +0 -1
  1519. package/dist/vega/p-cc243e62.entry.js +0 -1
  1520. package/dist/vega/p-cd3d177b.entry.js +0 -1
  1521. package/dist/vega/p-d0687ec0.js +0 -1
  1522. package/dist/vega/p-d25db724.js +0 -1
  1523. package/dist/vega/p-d42dbe39.js +0 -1
  1524. package/dist/vega/p-d5570331.entry.js +0 -1
  1525. package/dist/vega/p-d5797747.js +0 -1
  1526. package/dist/vega/p-d7434f44.entry.js +0 -1
  1527. package/dist/vega/p-db92453f.entry.js +0 -1
  1528. package/dist/vega/p-e52890db.js +0 -1
  1529. package/dist/vega/p-e5be807b.entry.js +0 -1
  1530. package/dist/vega/p-e6f0097f.js +0 -1
  1531. package/dist/vega/p-e7a8b61e.entry.js +0 -1
  1532. package/dist/vega/p-f46f6679.entry.js +0 -1
  1533. package/dist/vega/p-f49e8cc5.entry.js +0 -1
  1534. package/dist/vega/p-f5b6059d.entry.js +0 -1
  1535. package/dist/vega/p-fb40a829.js +0 -1
@@ -0,0 +1,4459 @@
1
+ 'use strict';
2
+
3
+ const codeBlock = require('./code-block-71a330a1.js');
4
+ const misc = require('./misc-3d30df91.js');
5
+ const typeGuard = require('./type-guard-d760850a.js');
6
+ const changeManager = require('./change-manager-a297e4d2.js');
7
+ const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-a3a60da4.js');
8
+ const vegaInternalEventId = require('./vega-internal-event-id-a1837fa2.js');
9
+ const string = require('./string-39438062.js');
10
+ const ui = require('./ui-9e8c9732.js');
11
+ const object = require('./object-b53e9416.js');
12
+ const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
13
+
14
+ /**
15
+ * Remove list item nest list block strategy.
16
+ */
17
+ class ListItemRemoveNestListStrategy extends codeBlock.ActionHandleStrategy {
18
+ /**
19
+ * Remove the nest list block from the list item, clear the property children when the children is empty.
20
+ *
21
+ * @param {RemoveNestListAction} action - The action instance.
22
+ * @param {RTEListItemBlock} target - The list item block.
23
+ */
24
+ handleAction(action, target) {
25
+ if (target.nestList) {
26
+ if (target.nestList.length > 1) {
27
+ target.nestList = target.nestList.filter((child) => child !== action.nestListBlockToBeRemoved);
28
+ }
29
+ else {
30
+ target.nestList = undefined;
31
+ }
32
+ }
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Replace list item nest list strategy.
38
+ */
39
+ class ListItemReplaceNestListStrategy extends codeBlock.ActionHandleStrategy {
40
+ /**
41
+ * @inheritDoc
42
+ */
43
+ handleAction(action, target) {
44
+ action.newList.forEach((listBlock) => {
45
+ listBlock.parent = target;
46
+ });
47
+ target.nestList = action.newList;
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Insert image node to list item block strategy.
53
+ */
54
+ class ListItemInsertImageStrategy extends codeBlock.ActionHandleStrategy {
55
+ /**
56
+ * The image node can not insert into list item block, so insert image after parent list block.
57
+ *
58
+ * @param {InsertImageToBlockAction} action - The action instance.
59
+ * @param {RTEListItemBlock} target - The list item block.
60
+ */
61
+ handleAction(action, target) {
62
+ target.parent.apply(action);
63
+ }
64
+ }
65
+
66
+ /**
67
+ * List item block
68
+ */
69
+ class RTEListItemBlock extends codeBlock.RTETextBlock {
70
+ constructor(id, nestList, options) {
71
+ super(id, 'list-item', options);
72
+ /**
73
+ * TODO: Refactor the list item properties children and nestList, merge two properties together.
74
+ *
75
+ * 1. Update the type of `children` to include `RTEListBlock` as a possible type.
76
+ * 2. The list block children should text block array and nest list block array, The text block should wrap a `li` tag when rendering.
77
+ */
78
+ this.nestList = [];
79
+ this.nestList = nestList;
80
+ }
81
+ /**
82
+ * Converts a VegaRTEListItemBlock object to an RTEListItemBlock
83
+ *
84
+ * @param {VegaRTEListBlock} block - Converts a `VegaRTEListItemBlock` object into an `RTEListItemBlock`.
85
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
86
+ * @returns {RTEListItemBlock} Return an instance of `RTEListItemBlock`
87
+ */
88
+ static from(block, options = { autoMatchFormat: true }) {
89
+ const listItemBlock = new RTEListItemBlock(block.id, undefined, options);
90
+ listItemBlock.children = block.nodes.map((richText) => codeBlock.RTETextNode.from(richText, listItemBlock, options));
91
+ if (block.children) {
92
+ listItemBlock.nestList = block.children.map((child) => {
93
+ const listBlock = RTEListBlock.from(child);
94
+ listBlock.parent = listItemBlock;
95
+ return listBlock;
96
+ });
97
+ }
98
+ const { annotations } = block;
99
+ if (annotations) {
100
+ Object.entries(annotations).forEach(([type, value]) => {
101
+ const item = this.createAnnotationEntity(type, value);
102
+ if (typeGuard.isNonNullable(item)) {
103
+ listItemBlock.annotationMap.set(...item);
104
+ }
105
+ });
106
+ }
107
+ return listItemBlock;
108
+ }
109
+ /**
110
+ * @inheritDoc
111
+ */
112
+ toJSON() {
113
+ var _a;
114
+ 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()) });
115
+ }
116
+ /**
117
+ * @inheritDoc
118
+ */
119
+ toHtml() {
120
+ const attrStr = super.generateAttributeString();
121
+ return [
122
+ `<li${attrStr}>`,
123
+ this.children.map((node) => node.toHtml()).join(''),
124
+ `</li>`,
125
+ ].join('');
126
+ }
127
+ /**
128
+ * @inheritDoc
129
+ */
130
+ cloneWithNodes(nodes) {
131
+ const block = new RTEListItemBlock(misc.generateUUID());
132
+ block.children = [];
133
+ block.apply(new codeBlock.AppendChildrenAction(nodes));
134
+ return block;
135
+ }
136
+ /**
137
+ * @inheritDoc
138
+ */
139
+ getLastNode() {
140
+ if (this.nestList && this.nestList.length > 0) {
141
+ const childListBlock = this.nestList[this.nestList.length - 1];
142
+ return childListBlock.getLastNode();
143
+ }
144
+ return super.getLastNode();
145
+ }
146
+ /**
147
+ * Create a new list item block.
148
+ *
149
+ * @returns {RTEListItemBlock} - A list item block.
150
+ */
151
+ createNewListItem() {
152
+ return new RTEListItemBlock(misc.generateUUID());
153
+ }
154
+ /**
155
+ * @inheritDoc
156
+ */
157
+ clone(parent) {
158
+ var _a;
159
+ const block = new RTEListItemBlock(this.id);
160
+ block.children = this.children.map((node) => node.clone(block));
161
+ block.annotationMap = super.cloneAnnotations();
162
+ block.nestList = (_a = this.nestList) === null || _a === void 0 ? void 0 : _a.map((child) => child.clone(block));
163
+ block.parent = parent;
164
+ return block;
165
+ }
166
+ }
167
+ (() => {
168
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.TextStyleAnnotationAction.name, RTEListItemBlock.name, new codeBlock.BlockUpdateTextStyleStrategy());
169
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.HorizontalAlignmentAnnotationAction.name, RTEListItemBlock.name, new codeBlock.BlockUpdateHorizontalAlignmentStrategy());
170
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEListItemBlock.name, new codeBlock.BlockInsertLineBreakStrategy());
171
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEListItemBlock.name, new codeBlock.BlockInsertLineBreakWithBlocksStrategy());
172
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_NEST_LIST, RTEListItemBlock.name, new ListItemRemoveNestListStrategy());
173
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTEListItemBlock.name, new codeBlock.BlockSplitWithTextNodeStrategy());
174
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.REPLACE_CHILD_NODES, RTEListItemBlock.name, new codeBlock.BlockReplaceNodesStrategy());
175
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.REPLACE_NEST_LIST, RTEListItemBlock.name, new ListItemReplaceNestListStrategy());
176
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTEListItemBlock.name, new codeBlock.BlockMergeNodesStrategy());
177
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListItemBlock.name, new ListItemInsertImageStrategy());
178
+ })();
179
+
180
+ /**
181
+ * Convert the selected blocks to list strategy.
182
+ */
183
+ class ListTransformToListStrategy extends codeBlock.ActionHandleStrategy {
184
+ /**
185
+ * @inheritDoc
186
+ */
187
+ handleAction(action, target) {
188
+ const selectedBlocks = action.selectedBlocks;
189
+ const bulletList = target.parent.createList(action.listType);
190
+ const isSameList = selectedBlocks.every((block) => block.parent === target);
191
+ if (isSameList) {
192
+ // Select one or more list items belonging to the same list, and all items in this list should be updated
193
+ bulletList.apply(new codeBlock.AppendChildrenAction(target.children));
194
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, bulletList));
195
+ target.parent.apply(new codeBlock.RemoveChildrenAction(target));
196
+ selectedBlocks.forEach((block) => block.children.map((node) => node.apply(new codeBlock.SyncUpSelectionAction())));
197
+ }
198
+ else {
199
+ const listItems = action.selectedBlocks.map((block) => target.parent.toListItem(block));
200
+ bulletList.apply(new codeBlock.AppendChildrenAction(listItems));
201
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, bulletList));
202
+ action.selectedBlocks.forEach((block) => {
203
+ block.parent.apply(new codeBlock.RemoveChildrenAction(block));
204
+ });
205
+ if (target.children.length === 0) {
206
+ target.parent.apply(new codeBlock.RemoveChildrenAction(target));
207
+ }
208
+ }
209
+ }
210
+ }
211
+
212
+ /**
213
+ * Convert the selected list block to paragraph strategy.
214
+ */
215
+ class ListTransformToParagraphStrategy extends codeBlock.ActionHandleStrategy {
216
+ /**
217
+ * @inheritDoc
218
+ */
219
+ handleAction(action, target) {
220
+ let isSelectedFirstBlock = false;
221
+ let isSelectedLastBlock = false;
222
+ const selectedBlocks = action.selectedBlocks;
223
+ const currentParagraph = selectedBlocks.map((block) => {
224
+ block.children.map((node) => node.apply(new codeBlock.SyncUpSelectionAction()));
225
+ if (block === target.children[0])
226
+ isSelectedFirstBlock = true;
227
+ if (block === target.children[target.children.length - 1])
228
+ isSelectedLastBlock = true;
229
+ return this.toParagraph(block);
230
+ });
231
+ if (isSelectedFirstBlock) {
232
+ target.parent.apply(new codeBlock.InsertChildrenBeforeAction(target, ...currentParagraph));
233
+ }
234
+ else if (isSelectedLastBlock) {
235
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, ...currentParagraph));
236
+ }
237
+ else {
238
+ const startIndex = target.children.indexOf(selectedBlocks[0]);
239
+ const lastIndex = target.children.indexOf(selectedBlocks[selectedBlocks.length - 1]);
240
+ const firstBulletList = target.parent.createList(target.type);
241
+ firstBulletList.apply(new codeBlock.AppendChildrenAction(target.children.slice(0, startIndex)));
242
+ const lastBulletList = target.parent.createList(target.type);
243
+ lastBulletList.apply(new codeBlock.AppendChildrenAction(target.children.slice(lastIndex + 1)));
244
+ target.parent.apply(new codeBlock.InsertChildrenBeforeAction(target, firstBulletList, ...currentParagraph, lastBulletList));
245
+ target.parent.apply(new codeBlock.RemoveChildrenAction(target));
246
+ }
247
+ selectedBlocks.map((block) => {
248
+ target.apply(new codeBlock.RemoveChildrenAction(block));
249
+ });
250
+ if (target.children.length === 0) {
251
+ target.parent.apply(new codeBlock.RemoveChildrenAction(target));
252
+ }
253
+ }
254
+ /**
255
+ * Converts a RTEListItemBlock to a RTETextBlock representing a paragraph.
256
+ *
257
+ * @param {RTEListItemBlock} block - The block that will be covered
258
+ * @returns {RTETextBlock} Returns a `RTETextBlock`.
259
+ */
260
+ toParagraph(block) {
261
+ const textBlock = new codeBlock.RTETextBlock(misc.generateUUID(), 'paragraph');
262
+ textBlock.apply(new codeBlock.AppendChildrenAction(block['children']));
263
+ textBlock['annotationMap'] = block['annotationMap'];
264
+ return textBlock;
265
+ }
266
+ }
267
+
268
+ /**
269
+ * Insert image to list block strategy.
270
+ */
271
+ class ListInsertImageStrategy extends codeBlock.ActionHandleStrategy {
272
+ /**
273
+ * Insert image block at behind of the list item block.
274
+ *
275
+ * @param {InsertImageToBlockAction} action - The insert image action instance.
276
+ * @param {RTEListBlock} target - The list block.
277
+ */
278
+ handleAction(action, target) {
279
+ const imageBlock = action.imageBlockToBeInserted;
280
+ if (target.parent['type'] !== 'list-item') {
281
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, imageBlock));
282
+ }
283
+ else {
284
+ target.parent.apply(action);
285
+ }
286
+ }
287
+ }
288
+
289
+ /**
290
+ * List annotation
291
+ */
292
+ class ListAnnotation extends codeBlock.BlockAnnotation {
293
+ constructor() {
294
+ super(...arguments);
295
+ this.type = codeBlock.BlockAnnotationTypeEnum.LIST;
296
+ }
297
+ /**
298
+ * Get the default standalone styles for a list block.
299
+ *
300
+ * @returns {AnnotationStyle} The default styles.
301
+ */
302
+ static getDefaultStyles() {
303
+ return {
304
+ paddingLeft: '8px',
305
+ marginLeft: '16px',
306
+ };
307
+ }
308
+ /**
309
+ * @inheritDoc
310
+ */
311
+ renderStyle(options) {
312
+ if (!(options === null || options === void 0 ? void 0 : options.standalone))
313
+ return null;
314
+ return ListAnnotation.getDefaultStyles();
315
+ }
316
+ /**
317
+ * @inheritDoc
318
+ */
319
+ renderClass(options) {
320
+ if (options === null || options === void 0 ? void 0 : options.standalone)
321
+ return null;
322
+ return 'v-rte--list';
323
+ }
324
+ /**
325
+ * @inheritDoc
326
+ */
327
+ clone() {
328
+ return new ListAnnotation();
329
+ }
330
+ /**
331
+ * @inheritDoc
332
+ */
333
+ toJSON() {
334
+ return undefined;
335
+ }
336
+ }
337
+
338
+ /**
339
+ * List block
340
+ */
341
+ class RTEListBlock extends codeBlock.RTEBlock {
342
+ constructor(id, type, options) {
343
+ super(id);
344
+ this.type = 'bullet-list';
345
+ this.children = [];
346
+ this.type = type;
347
+ const { autoMatchFormat } = options || { autoMatchFormat: true };
348
+ if (autoMatchFormat) {
349
+ this.annotationMap.set(codeBlock.BlockAnnotationTypeEnum.LIST, new ListAnnotation());
350
+ }
351
+ }
352
+ /**
353
+ * Converts a VegaRTEListBlock object to an RTEListBlock
354
+ *
355
+ * @param {VegaRTEListBlock} block - Converts a `VegaRTEListBlock` object into an `RTEListBlock`.
356
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
357
+ * @returns {RTEListBlock} Return an instance of `RTEListBlock`
358
+ */
359
+ static from(block, options = { autoMatchFormat: true }) {
360
+ const listBlock = new RTEListBlock(block.id, block.type, options);
361
+ const { annotations } = block;
362
+ if (annotations) {
363
+ Object.entries(annotations).forEach(([type, value]) => {
364
+ const item = this.createAnnotationEntity(type, value);
365
+ if (typeGuard.isNonNullable(item)) {
366
+ listBlock.annotationMap.set(...item);
367
+ }
368
+ });
369
+ }
370
+ listBlock.children = block.blocks.map((item) => {
371
+ const listItemBlock = RTEListItemBlock.from(item, options);
372
+ listItemBlock.parent = listBlock;
373
+ return listItemBlock;
374
+ });
375
+ return listBlock;
376
+ }
377
+ /**
378
+ * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
379
+ * and value.
380
+ *
381
+ * @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
382
+ * the type of annotation entity to create.
383
+ * @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
384
+ * that will be used to create the annotation entity. It can be of any type depending on the specific
385
+ * annotation being created.
386
+ * @returns {Nullable<BlockAnnotationsEntity>} The `createAnnotationEntity` function returns a nullable tuple containing a
387
+ * `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
388
+ */
389
+ static createAnnotationEntity(type, value) {
390
+ switch (type) {
391
+ case 'customAttribute':
392
+ return codeBlock.CustomAttributeAnnotation.from(value);
393
+ case 'customClass':
394
+ return codeBlock.CustomClassAnnotation.from(value);
395
+ case 'customStyle':
396
+ return codeBlock.CustomStyleAnnotation.from(value);
397
+ }
398
+ }
399
+ /**
400
+ * @inheritDoc
401
+ */
402
+ toJSON() {
403
+ return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.children.map((block) => block.toJSON()) });
404
+ }
405
+ /**
406
+ * @inheritDoc
407
+ */
408
+ toHtml() {
409
+ const BlockTag = this.getBlockTag();
410
+ const attrStr = super.generateAttributeString();
411
+ return [
412
+ `<${BlockTag}${attrStr}>`,
413
+ this.children.map((block) => block.toHtml()).join(''),
414
+ `</${BlockTag}>`,
415
+ ].join('');
416
+ }
417
+ /**
418
+ * @inheritDoc
419
+ */
420
+ isNotEmpty() {
421
+ return this.children.length > 0;
422
+ }
423
+ /**
424
+ * @inheritDoc
425
+ */
426
+ getLastNode() {
427
+ return this.children[this.children.length - 1].getLastNode();
428
+ }
429
+ /**
430
+ * @inheritDoc
431
+ */
432
+ clone(parent) {
433
+ const clonedListBlock = new RTEListBlock(this.id, this.type);
434
+ clonedListBlock.children = this.children.map((item) => item.clone(clonedListBlock));
435
+ clonedListBlock.annotationMap = super.cloneAnnotations();
436
+ clonedListBlock.parent = parent;
437
+ return clonedListBlock;
438
+ }
439
+ /**
440
+ * Returns the block tag based on the type of the list block.
441
+ *
442
+ * @returns {RTEListBlockTagType} - The block tag for the list block, either 'ol' or 'ul'.
443
+ */
444
+ getBlockTag() {
445
+ return this.type === 'number-list' ? 'ol' : 'ul';
446
+ }
447
+ }
448
+ (() => {
449
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTEListBlock.name, new ListTransformToListStrategy());
450
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK, RTEListBlock.name, new ListTransformToParagraphStrategy());
451
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListBlock.name, new ListInsertImageStrategy());
452
+ })();
453
+
454
+ /**
455
+ * Transform the selected text blocks to a code block strategy.
456
+ */
457
+ class BlockTransformToCodeBlockStrategy extends codeBlock.ActionHandleStrategy {
458
+ /**
459
+ * Get the all select text and create a new code block.
460
+ *
461
+ * @param {TransformToCodeBlockAction} action - The action instance.
462
+ * @param {VegaRTEContent} target - The block top parent instance.
463
+ */
464
+ handleAction(action, target) {
465
+ const selectedBlocks = action.selectedBlocks;
466
+ const codeBlock$1 = new codeBlock.RTECodeBlock(misc.generateUUID(), this.getCodeContent(selectedBlocks), 'plainText');
467
+ target.apply(new codeBlock.InsertChildrenBeforeAction(selectedBlocks[0], codeBlock$1));
468
+ action.newCodeBlock = codeBlock$1;
469
+ this.removeSelectBlocks(selectedBlocks, target);
470
+ }
471
+ /**
472
+ * Get the selected text block text content.
473
+ *
474
+ * @param {RTEBlock[]} selectedBlocks - The selected blocks.
475
+ * @returns {string} - The selected text content.
476
+ */
477
+ getCodeContent(selectedBlocks) {
478
+ const selectedTextBlocks = selectedBlocks.filter((item) => item.type !== 'image' && item.type !== 'list-item');
479
+ return selectedTextBlocks
480
+ .map((block) => {
481
+ return block.children.map((node) => node.text).join('');
482
+ })
483
+ .join('\n');
484
+ }
485
+ /**
486
+ * Remove the selected blocks after append new code block.
487
+ *
488
+ * @param {RTEBlock[]} selectedBlocks - The selected blocks.
489
+ * @param {VegaRTEContent} target - The selected block top parent object.
490
+ */
491
+ removeSelectBlocks(selectedBlocks, target) {
492
+ for (let i = 0; i < selectedBlocks.length; i++) {
493
+ target.apply(new codeBlock.RemoveChildrenAction(selectedBlocks[i]));
494
+ }
495
+ }
496
+ }
497
+
498
+ /**
499
+ * Abstract class to define strategies for processing HTML elements
500
+ */
501
+ class ElementToDTOStrategy {
502
+ }
503
+ /**
504
+ * Class to represent the output of a strategy applied to HTML elements
505
+ */
506
+ class ElementToDTOStrategyOutput {
507
+ constructor(currentStrategy, currentElements) {
508
+ this.childrenOutput = [];
509
+ this.currentStrategy = currentStrategy;
510
+ this.currentElements = currentElements;
511
+ }
512
+ /**
513
+ * Set children output.
514
+ *
515
+ * @param {ElementToDTOStrategyOutput[]} childrenOutput - children outputs.
516
+ */
517
+ setChildrenOutput(childrenOutput) {
518
+ this.childrenOutput = childrenOutput;
519
+ }
520
+ /**
521
+ * Transform current output and children output to DTO
522
+ *
523
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
524
+ * @returns {Nullable<RTEContentBlock>} - DTO.
525
+ */
526
+ toDto(options = { autoMatchFormat: true, skipCustomAnnotations: true }) {
527
+ const currentBlock = this.currentStrategy.handle(this.currentElements, options);
528
+ if (this.childrenOutput.length > 0 && currentBlock) {
529
+ this.currentStrategy.appendChildBlocks(currentBlock, this.childrenOutput
530
+ .map((childOutput) => childOutput.toDto(options))
531
+ .filter(typeGuard.isNonNullable));
532
+ }
533
+ return currentBlock;
534
+ }
535
+ }
536
+
537
+ /**
538
+ * Manager for registering and retrieving strategies that convert HTML elements to DTOs.
539
+ */
540
+ class elementToDTOClassStrategyManager {
541
+ constructor() {
542
+ this.elementToBlockStrategies = [];
543
+ this.elementToNodeStrategies = [];
544
+ }
545
+ /**
546
+ * Registers a element to block strategy for converting HTML elements to DTOs. The new strategy is added to the beginning of the list to give it higher priority.
547
+ *
548
+ * @param {ElementToDTOStrategy} strategy - The strategy to register.
549
+ */
550
+ registerElementToBlockStrategy(strategy) {
551
+ if (!this.hasDuplicateStrategy(strategy, this.elementToBlockStrategies)) {
552
+ this.elementToBlockStrategies.unshift(strategy);
553
+ }
554
+ }
555
+ /**
556
+ * Registers an element to node strategy for converting HTML elements to DTOs. The new strategy is added to the beginning of the list to give it higher priority.
557
+ *
558
+ * @param {ElementToDTOStrategy} strategy - The strategy to register.
559
+ */
560
+ registerElementToNodeStrategy(strategy) {
561
+ if (!this.hasDuplicateStrategy(strategy, this.elementToNodeStrategies)) {
562
+ this.elementToNodeStrategies.unshift(strategy);
563
+ }
564
+ }
565
+ /**
566
+ * Retrieves all registered element to block strategies for converting HTML elements to DTOs.
567
+ *
568
+ * @returns {ElementToDTOStrategy[]} - A set of all registered element to block strategies.
569
+ */
570
+ getElementToBlockStrategies() {
571
+ return this.elementToBlockStrategies;
572
+ }
573
+ /**
574
+ * Retrieves all registered element to node strategies for converting HTML elements to DTOs.
575
+ *
576
+ * @returns {ElementToDTOStrategy[]} - A set of all registered element to node strategies.
577
+ */
578
+ getElementToNodeStrategies() {
579
+ return this.elementToNodeStrategies;
580
+ }
581
+ /**
582
+ * Checks if a strategy is already registered in the provided strategy list.
583
+ *
584
+ * @param {ElementToDTOStrategy} strategy - The strategy to check for duplicates.
585
+ * @param {ElementToDTOStrategy[]} strategyList - The list of strategies to check against.
586
+ * @returns {boolean} - True if the strategy is a duplicate, false otherwise.
587
+ */
588
+ hasDuplicateStrategy(strategy, strategyList) {
589
+ return strategyList.includes(strategy);
590
+ }
591
+ }
592
+ const ElementToDTOClassStrategyManager = new elementToDTOClassStrategyManager();
593
+
594
+ /** Element to DTO processor */
595
+ class ElementToDtoStrategyProcessor {
596
+ /**
597
+ * Transform process.
598
+ *
599
+ * @param {HTMLElement[]} elements - Current elements.
600
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
601
+ * @returns {ElementToDTOStrategyOutput[]} - outputs.
602
+ */
603
+ process(elements, options = { autoMatchFormat: true, skipCustomAnnotations: true }) {
604
+ const strategies = this.getElementToBlockStrategies();
605
+ const outputs = [];
606
+ for (let i = 0; i < elements.length; i++) {
607
+ if (this.isInvalidElement(elements[i]))
608
+ continue;
609
+ let canHandledCount = 0;
610
+ for (const strategy of strategies) {
611
+ canHandledCount = strategy.canHandle(elements, i, options);
612
+ if (canHandledCount > 0) {
613
+ const handledElements = elements.slice(i, i + canHandledCount);
614
+ const output = new ElementToDTOStrategyOutput(strategy, handledElements);
615
+ if (canHandledCount === 1 && strategy.shouldProceedToElementChildren()) {
616
+ output.setChildrenOutput(this.process(Array.from(handledElements[0].childNodes), options));
617
+ }
618
+ outputs.push(output);
619
+ i += canHandledCount - 1;
620
+ break;
621
+ }
622
+ }
623
+ if (canHandledCount === 0 && i < elements.length) {
624
+ const elementChildren = Array.from(elements[i].childNodes);
625
+ const childrenOutputs = this.process(Array.from(elementChildren), options);
626
+ if (childrenOutputs.length > 0) {
627
+ outputs.push(...childrenOutputs);
628
+ }
629
+ }
630
+ }
631
+ return outputs;
632
+ }
633
+ /**
634
+ * Checks if the given element is valid to parse.
635
+ *
636
+ * @param {HTMLElement} element - The pasted element.
637
+ * @returns {boolean} Is valid
638
+ */
639
+ isInvalidElement(element) {
640
+ if (element.nodeType === Node.COMMENT_NODE)
641
+ return true;
642
+ return ['META', 'STYLE'].includes(element.nodeName);
643
+ }
644
+ /**
645
+ * Get the register element to block strategies.
646
+ *
647
+ * @returns {ElementToDTOStrategy[]} - The register element to block strategies.
648
+ */
649
+ getElementToBlockStrategies() {
650
+ return ElementToDTOClassStrategyManager.getElementToBlockStrategies();
651
+ }
652
+ }
653
+ const ElementToDtoStrategyProcessor$1 = new ElementToDtoStrategyProcessor();
654
+
655
+ /**
656
+ * Update the cursor position in the editor.
657
+ */
658
+ class UpdateCursorPositionStrategy extends codeBlock.ActionHandleStrategy {
659
+ /**
660
+ * @inheritDoc
661
+ */
662
+ handleAction(action, target) {
663
+ const { offset, nextFocusNode, immediatelyRun } = action;
664
+ const host = codeBlock.stateEntityRenderingRegistry.getDOMByEntity(target);
665
+ if (host) {
666
+ changeManager.ChangeManager.notify(domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubject(host, vegaInternalEventId.VegaInternalUpdateRTECursorPosition), {
667
+ node: nextFocusNode,
668
+ offset,
669
+ updateDirectly: immediatelyRun,
670
+ });
671
+ }
672
+ }
673
+ }
674
+
675
+ /**
676
+ * Append new block array or node array to block or VegaRTEContent instance strategy.
677
+ */
678
+ class AppendChildrenStrategy extends codeBlock.ActionHandleStrategy {
679
+ /**
680
+ * @inheritDoc
681
+ */
682
+ handleAction(action, target) {
683
+ const newBlocks = action.entityToBeAppended;
684
+ if (target.children) {
685
+ newBlocks.forEach((block) => {
686
+ block.parent = target;
687
+ });
688
+ // This line is used to fix the typescript error `This expression is not callable`. https://github.com/microsoft/TypeScript/issues/44373
689
+ const arrayFixed = target.children;
690
+ target.children = arrayFixed.concat(newBlocks);
691
+ }
692
+ }
693
+ }
694
+
695
+ /**
696
+ * Insert children at the front of the block strategy.
697
+ */
698
+ class InsertChildrenBeforeStrategy extends codeBlock.ActionHandleStrategy {
699
+ /**
700
+ * @inheritDoc
701
+ */
702
+ handleAction(action, target) {
703
+ this.replaceElementWithElements(target, action.referChildren, [
704
+ ...action.childrenToBeInserted,
705
+ action.referChildren,
706
+ ]);
707
+ }
708
+ /**
709
+ * Replaces a specific block or node with an array of blocks or nodes within RTEContentBlock array.
710
+ *
711
+ * @param {RTEBlock | VegaRTEContent} target - The block or the VegaRTEContent instance.
712
+ * @param {RTEBlock | RTENode} referElement - Used as a reference element to identify the element that needs to be replaced in the array.
713
+ * @param {RTEBlock[] | RTENode[]} elements - An array of block or node objects that you want to replace the `referElement` with in the array.
714
+ */
715
+ replaceElementWithElements(target, referElement, elements) {
716
+ if (target.children) {
717
+ elements.forEach((block) => {
718
+ block.parent = target;
719
+ });
720
+ const arrayFixed = target.children;
721
+ target.children = arrayFixed.flatMap((block) => {
722
+ if (block === referElement) {
723
+ return elements;
724
+ }
725
+ else {
726
+ return block;
727
+ }
728
+ });
729
+ }
730
+ }
731
+ }
732
+
733
+ /**
734
+ * Insert children at the front of the block strategy.
735
+ */
736
+ class InsertChildrenAfterStrategy extends InsertChildrenBeforeStrategy {
737
+ /**
738
+ * @inheritDoc
739
+ */
740
+ handleAction(action, target) {
741
+ this.replaceElementWithElements(target, action.referChildren, [
742
+ action.referChildren,
743
+ ...action.childrenToBeInserted,
744
+ ]);
745
+ }
746
+ }
747
+
748
+ /**
749
+ * Annotation for image
750
+ */
751
+ class ImageAnnotation extends codeBlock.NodeAnnotation {
752
+ constructor(size, alt) {
753
+ super();
754
+ this.type = codeBlock.NodeAnnotationTypeEnum.IMAGE;
755
+ this.size = size;
756
+ this.alt = alt;
757
+ }
758
+ /**
759
+ * Generate the map item for the annotation
760
+ *
761
+ * @param {string} size - Image size
762
+ * @param {string} alt - Image alt
763
+ * @returns {[NodeAnnotationTypeEnum.IMAGE, ImageAnnotation]} Map item for the annotation
764
+ */
765
+ static from(size, alt) {
766
+ return [codeBlock.NodeAnnotationTypeEnum.IMAGE, new ImageAnnotation(size, alt)];
767
+ }
768
+ /**
769
+ * Get the default standalone base styles for an image node.
770
+ *
771
+ * @returns {AnnotationStyle} The default styles.
772
+ */
773
+ static getDefaultStyles() {
774
+ return {
775
+ verticalAlign: 'bottom',
776
+ };
777
+ }
778
+ /**
779
+ * Generate the JSON representation of the annotation
780
+ *
781
+ * @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
782
+ */
783
+ toJSON() {
784
+ return typeGuard.isNonNullable(this.alt)
785
+ ? {
786
+ size: this.size,
787
+ alt: this.alt,
788
+ }
789
+ : {
790
+ size: this.size,
791
+ };
792
+ }
793
+ /**
794
+ * @inheritDoc
795
+ */
796
+ clone() {
797
+ return new ImageAnnotation(this.size, this.alt);
798
+ }
799
+ /**
800
+ * @inheritDoc
801
+ */
802
+ renderClass(options) {
803
+ if (options === null || options === void 0 ? void 0 : options.standalone)
804
+ return null;
805
+ return this.size ? `v-rte--image-size-${this.size}` : null;
806
+ }
807
+ /**
808
+ * @inheritDoc
809
+ */
810
+ renderStyle(options) {
811
+ if (!(options === null || options === void 0 ? void 0 : options.standalone))
812
+ return null;
813
+ const baseStyle = ImageAnnotation.getDefaultStyles();
814
+ switch (this.size) {
815
+ case 'sm': {
816
+ return Object.assign(Object.assign({}, baseStyle), { width: '25%' });
817
+ }
818
+ case 'md': {
819
+ return Object.assign(Object.assign({}, baseStyle), { width: '50%' });
820
+ }
821
+ case 'lg': {
822
+ return Object.assign(Object.assign({}, baseStyle), { width: '100%' });
823
+ }
824
+ }
825
+ }
826
+ }
827
+
828
+ /**
829
+ * Update the image node annotation map strategy.
830
+ */
831
+ class ImageSetAnnotationMapStrategy extends codeBlock.ActionHandleStrategy {
832
+ /**
833
+ * @inheritDoc
834
+ */
835
+ handleAction(action, target) {
836
+ const annotation = action.toAnnotation();
837
+ target.annotationMap.set(annotation.type, annotation);
838
+ }
839
+ }
840
+
841
+ /**
842
+ * The image node update property url strategy.
843
+ */
844
+ class ImageUpdateUrlStrategy extends codeBlock.ActionHandleStrategy {
845
+ /**
846
+ * @inheritDoc
847
+ */
848
+ handleAction(action, target) {
849
+ target.url = action.url;
850
+ }
851
+ }
852
+
853
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
854
+ var t = {};
855
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
856
+ t[p] = s[p];
857
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
858
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
859
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
860
+ t[p[i]] = s[p[i]];
861
+ }
862
+ return t;
863
+ };
864
+ /**
865
+ * Image node
866
+ */
867
+ class RTEImageNode extends codeBlock.RTEDecoratorNode {
868
+ constructor(id, url, parentBlock, annotationMap) {
869
+ super(id, annotationMap);
870
+ this.type = codeBlock.NodeTypeEnum.IMAGE;
871
+ this.url = url;
872
+ this.parent = parentBlock;
873
+ }
874
+ /**
875
+ * Converts a VegaRTEImageNode into an RTEImageNode by mapping nodes and creating annotations.
876
+ *
877
+ * @param {VegaRTEImageNode} node - The node to be converted.
878
+ * @param {RTEImageBlock} parentBlock - The parent block
879
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
880
+ * @returns {RTEImageNode} An instance of `RTEImageBlock`
881
+ */
882
+ static from(node, parentBlock, options = { autoMatchFormat: true }) {
883
+ const imageNode = new RTEImageNode(node.id, node.url, parentBlock);
884
+ const autoMatchFormat = !!options.autoMatchFormat;
885
+ const _a = Object.assign({}, node.annotations), { size } = _a, otherAnnotations = __rest(_a, ["size"]);
886
+ const annotations = Object.assign(Object.assign({}, otherAnnotations), { size: size !== null && size !== void 0 ? size : (autoMatchFormat ? 'md' : undefined) });
887
+ imageNode.annotationMap = new Map(Object.keys(annotations)
888
+ .map((type) => {
889
+ if (type === 'size' || type === 'alt') {
890
+ return ImageAnnotation.from(annotations.size, annotations.alt);
891
+ }
892
+ return this.createAnnotationEntity(type, annotations[type]);
893
+ })
894
+ .filter(typeGuard.isNonNullable));
895
+ return imageNode;
896
+ }
897
+ /**
898
+ * @inheritDoc
899
+ */
900
+ toJSON() {
901
+ const annotations = Array.from(this.annotationMap.values())
902
+ .filter((annotation) => annotation instanceof ImageAnnotation || annotation instanceof codeBlock.CommonAnnotation)
903
+ .reduce((record, annotation) => {
904
+ return Object.assign(Object.assign({}, record), annotation.toJSON());
905
+ }, {});
906
+ if (annotations.alt == '')
907
+ delete annotations.alt;
908
+ return Object.assign(Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {})), { type: 'image', url: this.url });
909
+ }
910
+ /**
911
+ * @inheritDoc
912
+ */
913
+ clone(parent) {
914
+ return new RTEImageNode(this.id, this.url, parent, super.cloneAnnotations());
915
+ }
916
+ /**
917
+ * @inheritDoc
918
+ */
919
+ toHtml() {
920
+ const imageAnnotation = this.getAnnotationByType(codeBlock.NodeAnnotationTypeEnum.IMAGE);
921
+ const attrStr = super.generateAttributeString(...[
922
+ imageAnnotation && imageAnnotation.alt ? `alt="${imageAnnotation.alt}"` : null,
923
+ `src="${this.url}"`,
924
+ imageAnnotation && imageAnnotation.size ? `data-size="${imageAnnotation.size}"` : null,
925
+ ].filter(typeGuard.isNonNullable));
926
+ return `<img${attrStr}>`;
927
+ }
928
+ /**
929
+ * @inheritDoc
930
+ */
931
+ doAnnotationActionApply(action) {
932
+ const strategy = codeBlock.ActionHandleStrategyRegistry.get(codeBlock.AnnotationAction.name, RTEImageNode.name);
933
+ if (strategy) {
934
+ strategy.execute(action, this);
935
+ }
936
+ }
937
+ /**
938
+ * @inheritDoc
939
+ */
940
+ doModifyActionApply(action) {
941
+ codeBlock.ActionHandleStrategyRegistry.executeTheStrategy(action, this);
942
+ }
943
+ }
944
+ (() => {
945
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.UPDATE_IMAGE_NODE_URL, RTEImageNode.name, new ImageUpdateUrlStrategy());
946
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.AnnotationAction.name, RTEImageNode.name, new ImageSetAnnotationMapStrategy());
947
+ })();
948
+
949
+ /**
950
+ * Split the current image block with a special position strategy.
951
+ */
952
+ class BlockSplitWithImageNodeStrategy extends codeBlock.ActionHandleStrategy {
953
+ /**
954
+ * @inheritDoc
955
+ */
956
+ handleAction(action, target) {
957
+ action.newBlock = this.splitImageNodes(action.splitPointNode, action.startOffsetOfNode, target);
958
+ }
959
+ /**
960
+ * The image offset should be 0 or 1
961
+ * <vega-rich-text-image-editor><img /></vega-rich-text-image-editor>
962
+ *
963
+ * @param {RTEImageNode} imageNode The split point image node.
964
+ * @param {number} imageOffset The cursor point 0 | 1.
965
+ * @param {RTEImageBlock} target The image block.
966
+ * @returns {Nullable<RTEBlock>} The new block after split
967
+ */
968
+ splitImageNodes(imageNode, imageOffset, target) {
969
+ const nodesSplitIndex = target.children.indexOf(imageNode);
970
+ if (nodesSplitIndex > -1) {
971
+ const beforeNodes = target.children.slice(0, nodesSplitIndex + imageOffset);
972
+ const afterNodes = target.children.slice(nodesSplitIndex + imageOffset);
973
+ target.apply(new codeBlock.ReplaceChildNodesAction(beforeNodes));
974
+ const newBlock = this.cloneWithNodes(afterNodes, target);
975
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, newBlock));
976
+ return newBlock;
977
+ }
978
+ }
979
+ /**
980
+ * Creates a new RTEImageBlock instance with the provided RTEImageNode instances appended to it.
981
+ *
982
+ * @param {RTEImageNode[]} nodes - An array of RTEImageNode objects that will be used to create a new RTEImageBlock instance.
983
+ * @param {RTEImageBlock} target The image block.
984
+ * @returns {RTEImageBlock} A new `RTEImageBlock` object with the provided `nodes` appended to it.
985
+ */
986
+ cloneWithNodes(nodes, target) {
987
+ const block = target.createNewImageBlock();
988
+ block.children = [];
989
+ block.apply(new codeBlock.AppendChildrenAction(nodes));
990
+ return block;
991
+ }
992
+ }
993
+
994
+ /**
995
+ * Break the current block after press enter, this action is similar with the SplitBlockWithNodeAction,
996
+ * The SplitBlockWithNodeAction split the current block to two same type blocks, but this action will create new paragraph or list item when break at start or end.
997
+ * The property `newBlock` use to store the new create block if need.
998
+ *
999
+ * @example currentBlock.apply(new InsertNewParagraphAction(startContainerNode, startOffset))
1000
+ */
1001
+ class InsertNewParagraphAction extends codeBlock.ModifyContentAction {
1002
+ constructor(startContainerNode, startOffset) {
1003
+ super();
1004
+ this.type = codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH;
1005
+ this.startContainerNode = startContainerNode;
1006
+ this.startOffset = startOffset;
1007
+ }
1008
+ }
1009
+
1010
+ /**
1011
+ * The image block insert line break strategy.
1012
+ */
1013
+ class ImageInsertLineBreakStrategy extends codeBlock.ActionHandleStrategy {
1014
+ /**
1015
+ * The image block not support insert the line break node, so invoke the insert new paragraph logic directly.
1016
+ *
1017
+ * @param {LineBreakSingleBlockAction} action - The action instance.
1018
+ * @param {RTEImageBlock} target - The image block.
1019
+ */
1020
+ handleAction(action, target) {
1021
+ const insertNewParagraphAction = new InsertNewParagraphAction(action.startContainerNode, action.startOffset);
1022
+ target.apply(insertNewParagraphAction);
1023
+ const newBlock = insertNewParagraphAction.newBlock;
1024
+ if (newBlock) {
1025
+ action.lineBreakNode = newBlock.children[0];
1026
+ }
1027
+ }
1028
+ }
1029
+
1030
+ /**
1031
+ * Insert a line break node into multiple blocks selection at special position strategy.
1032
+ */
1033
+ class ImageInsertLineBreakWithBlocksStrategy extends codeBlock.ActionHandleStrategy {
1034
+ /**
1035
+ * @inheritDoc
1036
+ */
1037
+ handleAction(action, target) {
1038
+ action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks, target);
1039
+ }
1040
+ /**
1041
+ * Inserts a new paragraph block with a line break after a selected block of text in a rich text editor.
1042
+ *
1043
+ * @param {RTEBlock[]} selectedBlocks - An array of RTEBlock objects that represent the blocks that have been selected for a specific action in the Rich Text Editor.
1044
+ * @param {RTEImageBlock} target - The image block.
1045
+ * @returns {Nullable<RTETextNode>} Returns a Nullable RTETextNode.
1046
+ */
1047
+ lineBreakMultipleBlocks(selectedBlocks, target) {
1048
+ const newParagraph = codeBlock.RTETextBlock.from({
1049
+ id: misc.generateUUID(),
1050
+ type: 'paragraph',
1051
+ nodes: [{ id: misc.generateUUID(), type: 'text', text: '\n' }],
1052
+ });
1053
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, newParagraph));
1054
+ const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
1055
+ if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
1056
+ afterNodes.push(new codeBlock.RTETextNode(misc.generateUUID(), '\n', newParagraph));
1057
+ }
1058
+ newParagraph.apply(new codeBlock.AppendChildrenAction(afterNodes));
1059
+ return newParagraph['children'][0];
1060
+ }
1061
+ /**
1062
+ * Concat the child nodes of multiple RTEBlocks if both are not images.
1063
+ *
1064
+ * @param {RTEBlock[]} blocks - multiple block of content in a rich text editor, such as a paragraph, heading, image, etc.
1065
+ * @returns {RTENode[]} Array of connected block nodes
1066
+ */
1067
+ concatBlocksNodes(blocks) {
1068
+ const nodes = [];
1069
+ blocks.map((block) => {
1070
+ if (block.type !== 'image') {
1071
+ nodes.push(...block.children);
1072
+ block.parent.apply(new codeBlock.RemoveChildrenAction(block));
1073
+ }
1074
+ });
1075
+ return nodes;
1076
+ }
1077
+ }
1078
+
1079
+ /**
1080
+ * Insert a image node at the special position of image block.
1081
+ */
1082
+ class ImageBlockInsertImageStrategy extends codeBlock.ActionHandleStrategy {
1083
+ /**
1084
+ * @inheritDoc
1085
+ */
1086
+ handleAction(action, target) {
1087
+ const splitNode = action.splitPointNode;
1088
+ const startOffsetOfNode = action.startOffsetOfNode;
1089
+ const newImageBlock = action.imageBlockToBeInserted;
1090
+ const newImageNodes = newImageBlock.children;
1091
+ if (target.children.length < 1) {
1092
+ target.apply(new codeBlock.AppendChildrenAction(newImageNodes));
1093
+ }
1094
+ else if (this.isCaretPositionAtBlockEnd(target, splitNode, startOffsetOfNode)) {
1095
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, newImageBlock));
1096
+ }
1097
+ else if (this.isCaretPositionAtBlockStart(target, splitNode, startOffsetOfNode)) {
1098
+ target.parent.apply(new codeBlock.InsertChildrenBeforeAction(target, newImageBlock));
1099
+ }
1100
+ else {
1101
+ target.apply(new codeBlock.SplitBlockWithNodeAction(splitNode, startOffsetOfNode));
1102
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, newImageBlock));
1103
+ }
1104
+ }
1105
+ }
1106
+
1107
+ /**
1108
+ * Image block
1109
+ */
1110
+ class RTEImageBlock extends codeBlock.RTEBlock {
1111
+ constructor(id) {
1112
+ super(id);
1113
+ this.type = 'image';
1114
+ this.children = [];
1115
+ }
1116
+ /**
1117
+ * Converts a VegaRTEImageBlock object into an RTEImageBlock object by mapping nodes and creating annotations.
1118
+ *
1119
+ * @param {VegaRTEImageBlock} block - The block object to be converted.
1120
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
1121
+ * @returns {RTEImageBlock} An instance of `RTEImageBlock`
1122
+ */
1123
+ static from(block, options = { autoMatchFormat: true }) {
1124
+ const imageBlock = new RTEImageBlock(block.id);
1125
+ const { annotations } = block;
1126
+ imageBlock.children = block.nodes.map((image) => RTEImageNode.from(image, imageBlock, options));
1127
+ if (annotations) {
1128
+ super.convertAnnotationsToMap(imageBlock.annotationMap, annotations);
1129
+ }
1130
+ return imageBlock;
1131
+ }
1132
+ /**
1133
+ * @inheritDoc
1134
+ */
1135
+ toJSON() {
1136
+ return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.children.map((node) => node.toJSON()) });
1137
+ }
1138
+ /**
1139
+ * @inheritDoc
1140
+ */
1141
+ toHtml() {
1142
+ const attrStr = super.generateAttributeString();
1143
+ const children = this.children.map((node) => node.toHtml()).join('');
1144
+ return super.shouldRenderAsInternalWrapper()
1145
+ ? children
1146
+ : [`<div${attrStr}>`, children, `</div>`].join('');
1147
+ }
1148
+ /**
1149
+ * @inheritDoc
1150
+ */
1151
+ isNotEmpty() {
1152
+ return this.children.length > 0 && this.children.some((node) => node.url.length > 0);
1153
+ }
1154
+ /**
1155
+ * @inheritDoc
1156
+ */
1157
+ getLastNode() {
1158
+ return this.children[this.children.length - 1];
1159
+ }
1160
+ /**
1161
+ * Create a new image block.
1162
+ *
1163
+ * @returns {RTEImageBlock} - The empty image block.
1164
+ */
1165
+ createNewImageBlock() {
1166
+ return new RTEImageBlock(misc.generateUUID());
1167
+ }
1168
+ /**
1169
+ * @inheritDoc
1170
+ */
1171
+ clone(parent) {
1172
+ const clonedBlock = new RTEImageBlock(this.id);
1173
+ clonedBlock.children = this.children.map((node) => node.clone(clonedBlock));
1174
+ clonedBlock.annotationMap = super.cloneAnnotations();
1175
+ clonedBlock.parent = parent;
1176
+ return clonedBlock;
1177
+ }
1178
+ }
1179
+ (() => {
1180
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTEImageBlock.name, new codeBlock.BlockMergeNodesStrategy());
1181
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.REPLACE_CHILD_NODES, RTEImageBlock.name, new codeBlock.BlockReplaceNodesStrategy());
1182
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTEImageBlock.name, new BlockSplitWithImageNodeStrategy());
1183
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEImageBlock.name, new ImageInsertLineBreakStrategy());
1184
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEImageBlock.name, new ImageInsertLineBreakWithBlocksStrategy());
1185
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEImageBlock.name, new ImageBlockInsertImageStrategy());
1186
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.HorizontalAlignmentAnnotationAction.name, RTEImageBlock.name, new codeBlock.BlockUpdateHorizontalAlignmentStrategy());
1187
+ })();
1188
+
1189
+ /**
1190
+ * HTML Block
1191
+ */
1192
+ class RTEHtmlBlock extends codeBlock.RTEBlock {
1193
+ constructor(id, htmlTag) {
1194
+ super(id);
1195
+ this.type = 'html-block';
1196
+ this.children = [];
1197
+ this.htmlTag = htmlTag;
1198
+ }
1199
+ /**
1200
+ * Converts a VegaRTEHtmlBlock to an RTEHtmlBlock.
1201
+ *
1202
+ * @param {VegaRTEHtmlBlock} block - The VegaRTEHtmlBlock to convert.
1203
+ * @param {VegaRTETransformOptions} [options] - Optional transformation options.
1204
+ * @returns {RTEHtmlBlock} The converted RTEHtmlBlock.
1205
+ */
1206
+ static from(block, options) {
1207
+ const htmlBlock = new RTEHtmlBlock(block.id, block.htmlTag);
1208
+ const { annotations } = block;
1209
+ if (annotations) {
1210
+ super.convertAnnotationsToMap(htmlBlock.annotationMap, annotations);
1211
+ }
1212
+ htmlBlock.children = this.generateBlockChildren(block.children, options, htmlBlock);
1213
+ return htmlBlock;
1214
+ }
1215
+ /**
1216
+ * @inheritDoc
1217
+ */
1218
+ clone(parent) {
1219
+ const clonedBlock = new RTEHtmlBlock(this.id, this.htmlTag);
1220
+ clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
1221
+ clonedBlock.annotationMap = super.cloneAnnotations();
1222
+ clonedBlock.parent = parent;
1223
+ return clonedBlock;
1224
+ }
1225
+ /**
1226
+ * @inheritDoc
1227
+ */
1228
+ getLastNode() {
1229
+ return this.children[this.children.length - 1].getLastNode();
1230
+ }
1231
+ /**
1232
+ * @inheritDoc
1233
+ */
1234
+ isNotEmpty() {
1235
+ return this.children.length > 0;
1236
+ }
1237
+ /**
1238
+ * @inheritDoc
1239
+ */
1240
+ toHtml() {
1241
+ const BlockTag = this.htmlTag;
1242
+ const attrStr = super.generateAttributeString();
1243
+ // Handle void/self-closing tags (hr, input, col, etc.)
1244
+ // Uses HTML5 syntax without self-closing slash for consistency with img and br tags
1245
+ if (RTEHtmlBlock.VOID_TAGS.has(this.htmlTag)) {
1246
+ return `<${BlockTag}${attrStr}>`;
1247
+ }
1248
+ // Handle normal tags with children
1249
+ return [
1250
+ `<${BlockTag}${attrStr}>`,
1251
+ this.children.map((block) => block.toHtml()).join(''),
1252
+ `</${BlockTag}>`,
1253
+ ].join('');
1254
+ }
1255
+ /**
1256
+ * @inheritDoc
1257
+ */
1258
+ toJSON() {
1259
+ return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, htmlTag: this.htmlTag, children: this.children.map((child) => child.toJSON()) });
1260
+ }
1261
+ }
1262
+ /**
1263
+ * Void/self-closing tags that don't have closing tags and don't contain children.
1264
+ * These tags should be rendered as <tag> or <tag/> instead of <tag></tag>.
1265
+ *
1266
+ * Based on canHandleTags from html-block-strategy.ts, the following are void tags:
1267
+ * - HR: horizontal rule
1268
+ * - INPUT: form input
1269
+ * - COL: table column
1270
+ */
1271
+ RTEHtmlBlock.VOID_TAGS = new Set(['hr', 'input', 'col']);
1272
+
1273
+ /**
1274
+ * Merge the two blocks node into first block if the two blocks nodes type is same(text node or image node)
1275
+ *
1276
+ * @example firstBlock.apply(new MergeTwoBlocksNodesAction(secondBlock))
1277
+ */
1278
+ class MergeTwoBlocksNodesAction extends codeBlock.ModifyContentAction {
1279
+ constructor(blockNeedToBeMerged) {
1280
+ super();
1281
+ this.type = codeBlock.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES;
1282
+ this.blockNeedToBeMerged = blockNeedToBeMerged;
1283
+ }
1284
+ }
1285
+
1286
+ /**
1287
+ * Block delete text or decorator node strategy.
1288
+ */
1289
+ class BlockDeleteTextOrDecoratorNodeStrategy extends codeBlock.BlockDeleteNodeContentStrategy {
1290
+ /**
1291
+ * @inheritDoc
1292
+ */
1293
+ handleAction(action, target) {
1294
+ const { startContainerNode } = action;
1295
+ if (!startContainerNode.isContentEditable()) {
1296
+ this.deleteDecoratorNodeContent(action, target);
1297
+ }
1298
+ else if (startContainerNode.isTextNode()) {
1299
+ this.deleteTextNodeContent(action, target);
1300
+ }
1301
+ const parent = target.parent;
1302
+ if (parent && target.isListItemBlock() && parent.children.length === 0) {
1303
+ parent.parent.apply(new codeBlock.RemoveChildrenAction(parent));
1304
+ }
1305
+ }
1306
+ /**
1307
+ * Handle the delete text logic when press delete key.
1308
+ *
1309
+ * @param {DeleteBlockContentAction} action - ModifyContentAction
1310
+ * @param {RTETextBlock} target - Current text block
1311
+ */
1312
+ deleteTextNodeContent(action, target) {
1313
+ const startContainerNode = action.startContainerNode;
1314
+ const startOffset = action.startOffset;
1315
+ if (startOffset !== 0 && !startContainerNode.isEmpty()) {
1316
+ const newText = startContainerNode.text.slice(0, startOffset - 1) +
1317
+ startContainerNode.text.slice(startOffset);
1318
+ startContainerNode.apply(new codeBlock.UpdateTextAction(newText));
1319
+ if (newText) {
1320
+ action.previousNode = startContainerNode;
1321
+ return;
1322
+ }
1323
+ else {
1324
+ const previousNode = this.getPreviousNode(startContainerNode);
1325
+ // Remove the last character will not delete paragraph, the paragraph will removed after press delete again
1326
+ if ((previousNode && previousNode.parent === target && previousNode['text'] === '\n') ||
1327
+ target.children.length === 1) {
1328
+ action.previousNode = startContainerNode;
1329
+ return;
1330
+ }
1331
+ else {
1332
+ target.apply(new codeBlock.RemoveChildrenAction(startContainerNode));
1333
+ action.previousNode = previousNode;
1334
+ return;
1335
+ }
1336
+ }
1337
+ }
1338
+ else {
1339
+ let previousNode = this.getPreviousNode(startContainerNode);
1340
+ let nextNode = null;
1341
+ const isCurrentNodeEmpty = startContainerNode.isEmpty();
1342
+ if (target.children.length && previousNode && previousNode.parent !== target) {
1343
+ if (isCurrentNodeEmpty) {
1344
+ target.apply(new codeBlock.RemoveChildrenAction(startContainerNode));
1345
+ }
1346
+ if (target.type === previousNode.parent.type) {
1347
+ previousNode.parent.apply(new MergeTwoBlocksNodesAction(target));
1348
+ }
1349
+ }
1350
+ else {
1351
+ if (this.isContentFirstNode(startContainerNode) && isCurrentNodeEmpty) {
1352
+ nextNode = this.getNextNode(startContainerNode);
1353
+ }
1354
+ /**
1355
+ * Remove line break
1356
+ *
1357
+ * @example caret at the first line
1358
+ * \n
1359
+ * test
1360
+ */
1361
+ if (isCurrentNodeEmpty) {
1362
+ target.apply(new codeBlock.RemoveChildrenAction(startContainerNode));
1363
+ }
1364
+ /**
1365
+ * Remove line break or non-editable node
1366
+ *
1367
+ * @example caret at the begin of second line
1368
+ * \n
1369
+ * test
1370
+ * @example caret at the end of non-editable node and start of the text node
1371
+ * <img/><span>test</span>
1372
+ */
1373
+ if (previousNode &&
1374
+ previousNode.isTextNode() &&
1375
+ (previousNode.isEmpty() ||
1376
+ (!previousNode.isContentEditable() && previousNode.parent === target))) {
1377
+ const shouldRemoveNode = previousNode;
1378
+ previousNode = this.getPreviousNode(previousNode);
1379
+ shouldRemoveNode.parent.apply(new codeBlock.RemoveChildrenAction(shouldRemoveNode));
1380
+ if (!previousNode && !isCurrentNodeEmpty) {
1381
+ nextNode = startContainerNode;
1382
+ }
1383
+ }
1384
+ }
1385
+ // Remove the paragraph block if the content is empty
1386
+ // TODO: Check whether need to remove below logic because already handled the same logic in remove node strategy
1387
+ if (target.children.length === 0) {
1388
+ target.parent.apply(new codeBlock.RemoveChildrenAction(target));
1389
+ }
1390
+ if (previousNode) {
1391
+ action.previousNode = previousNode;
1392
+ }
1393
+ else if (nextNode) {
1394
+ action.nextNode = nextNode;
1395
+ }
1396
+ }
1397
+ }
1398
+ /**
1399
+ * Delete decorator node content
1400
+ *
1401
+ * @param {DeleteBlockContentAction} action - The delete block content action
1402
+ * @param {RTEBlock} target - The target block
1403
+ */
1404
+ deleteDecoratorNodeContent(action, target) {
1405
+ const startContainerNode = action.startContainerNode, startOffset = action.startOffset;
1406
+ let previousNode = this.getPreviousNode(startContainerNode);
1407
+ let nextNode = null;
1408
+ if (startOffset !== 0) {
1409
+ const parentBlock = target;
1410
+ if (this.isContentFirstNode(startContainerNode)) {
1411
+ nextNode = this.getNextNode(startContainerNode);
1412
+ }
1413
+ if (parentBlock.children.length === 1) {
1414
+ parentBlock.parent.apply(new codeBlock.RemoveChildrenAction(parentBlock));
1415
+ }
1416
+ else {
1417
+ parentBlock.apply(new codeBlock.RemoveChildrenAction(startContainerNode));
1418
+ }
1419
+ }
1420
+ else {
1421
+ const shouldRemoveNode = previousNode;
1422
+ if (shouldRemoveNode && !shouldRemoveNode.isContentEditable()) {
1423
+ previousNode = this.getPreviousNode(shouldRemoveNode);
1424
+ shouldRemoveNode.parent.apply(new codeBlock.RemoveChildrenAction(shouldRemoveNode));
1425
+ if (!previousNode) {
1426
+ action.nextNode = startContainerNode;
1427
+ }
1428
+ }
1429
+ }
1430
+ if (previousNode) {
1431
+ action.previousNode = previousNode;
1432
+ }
1433
+ else if (nextNode) {
1434
+ action.nextNode = nextNode;
1435
+ }
1436
+ }
1437
+ }
1438
+
1439
+ /**
1440
+ * Insert new paragraph into current block at special position.
1441
+ */
1442
+ class BlockInsertNewParagraphStrategy extends codeBlock.ActionHandleStrategy {
1443
+ /**
1444
+ * @inheritDoc
1445
+ */
1446
+ handleAction(action, target) {
1447
+ const { startContainerNode } = action;
1448
+ action.newBlock = this.breakSingleBlock(startContainerNode, action.startOffset, target);
1449
+ }
1450
+ /**
1451
+ * breakSingleTextBlock
1452
+ *
1453
+ * @param {RTETextNode} splitNode -
1454
+ * @param {number} startOffsetOfNode -
1455
+ * @param {RTEBlock} target -
1456
+ * @returns {Nullable<RTEBlock>} Nullable<RTEBlock>
1457
+ */
1458
+ breakSingleBlock(splitNode, startOffsetOfNode, target) {
1459
+ const newParagraph = this.getNewParagraph(splitNode);
1460
+ if (newParagraph) {
1461
+ if (this.isCaretPositionAtBlockEnd(target, splitNode, startOffsetOfNode)) {
1462
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, newParagraph));
1463
+ }
1464
+ else if (this.isCaretPositionAtBlockStart(target, splitNode, startOffsetOfNode)) {
1465
+ target.parent.apply(new codeBlock.InsertChildrenBeforeAction(target, newParagraph));
1466
+ }
1467
+ else {
1468
+ const splitBlockAction = new codeBlock.SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
1469
+ target.apply(splitBlockAction);
1470
+ return splitBlockAction.newBlock;
1471
+ }
1472
+ return newParagraph;
1473
+ }
1474
+ }
1475
+ /**
1476
+ * Create new Paragraph
1477
+ *
1478
+ * @param {RTENode} splitNode - The split node of the block.
1479
+ * @returns {Nullable<RTETextBlock>} - The new text block.
1480
+ */
1481
+ getNewParagraph(splitNode) {
1482
+ const newParagraph = this.createNewParagraph('');
1483
+ if (newParagraph) {
1484
+ let textNode = newParagraph.children[0];
1485
+ if (splitNode.isTextNode() && splitNode.isContentEditable()) {
1486
+ newParagraph.children = [];
1487
+ textNode = splitNode.cloneWithText('');
1488
+ // The link annotation don't need inherited
1489
+ textNode.annotationMap.delete(codeBlock.NodeAnnotationTypeEnum.LINK);
1490
+ newParagraph.apply(new codeBlock.AppendChildrenAction([textNode]));
1491
+ }
1492
+ return newParagraph;
1493
+ }
1494
+ }
1495
+ }
1496
+
1497
+ /**
1498
+ * Update the cursor position in the editor.
1499
+ *
1500
+ * @example richEditorRef.value.apply(new UpdateCursorPositionAction(nextFocusNode, [offset], [immediatelyRun]))
1501
+ */
1502
+ class UpdateCursorPositionAction extends codeBlock.ModifyContentAction {
1503
+ /**
1504
+ * Set the cursor position at end of the current node.
1505
+ *
1506
+ * @param {RTENode} nextFocusNode - The rich text editor needs focus node.
1507
+ * @param {number} offset - The cursor offset position.
1508
+ * @param {boolean} immediatelyRun - Whether to immediately set the cursor position after applying it. Usually the set action will trigger after the UI renders.
1509
+ */
1510
+ constructor(nextFocusNode, offset, immediatelyRun = false) {
1511
+ super();
1512
+ this.isFlushable = true;
1513
+ this.type = codeBlock.ModifyContentActionType.UPDATE_CURSOR_POSITION;
1514
+ this.immediatelyRun = false;
1515
+ this.nextFocusNode = nextFocusNode;
1516
+ this.offset = offset;
1517
+ this.immediatelyRun = immediatelyRun;
1518
+ // Don't flush changes if we want to immediately run the cursor update. Usually the current value is the latest value.
1519
+ if (this.immediatelyRun) {
1520
+ this.isFlushable = false;
1521
+ }
1522
+ }
1523
+ }
1524
+
1525
+ /**
1526
+ * Insert a new node in nearest position of parent block strategy.
1527
+ */
1528
+ class InsertNodeToNearestRootStrategy extends codeBlock.ActionHandleStrategy {
1529
+ /**
1530
+ * @inheritDoc
1531
+ */
1532
+ handleAction(action, target) {
1533
+ const { rteRange, nodeToBeInserted } = action;
1534
+ const { startNode, startOffset } = rteRange;
1535
+ if (startNode) {
1536
+ const parent = target;
1537
+ if (startNode.isContentEditable() && startNode.isTextNode()) {
1538
+ if (startNode.text === '\n' || !startNode.text || startOffset === 0) {
1539
+ parent.apply(new codeBlock.InsertChildrenBeforeAction(startNode, nodeToBeInserted));
1540
+ }
1541
+ else {
1542
+ const startText = startNode.text.substring(0, startOffset);
1543
+ const endText = startNode.text.substring(startOffset);
1544
+ const startTextNode = startNode.cloneWithText(startText);
1545
+ const endTextNode = startNode.cloneWithText(endText);
1546
+ const insertNodes = [startTextNode, nodeToBeInserted];
1547
+ if (endText) {
1548
+ insertNodes.push(endTextNode);
1549
+ }
1550
+ parent.apply(new codeBlock.InsertChildrenBeforeAction(startNode, ...insertNodes));
1551
+ parent.apply(new codeBlock.RemoveChildrenAction(startNode));
1552
+ }
1553
+ }
1554
+ else {
1555
+ if (startOffset !== 0) {
1556
+ parent.apply(new codeBlock.InsertChildrenAfterAction(startNode, nodeToBeInserted));
1557
+ }
1558
+ else {
1559
+ parent.apply(new codeBlock.InsertChildrenBeforeAction(startNode, nodeToBeInserted));
1560
+ }
1561
+ }
1562
+ this.updateCursorPosition(nodeToBeInserted);
1563
+ }
1564
+ }
1565
+ /**
1566
+ * Update the cursor position to end of the inserted node.
1567
+ *
1568
+ * @param {RTENode} node - node to find root content
1569
+ */
1570
+ updateCursorPosition(node) {
1571
+ const root = this.getRootContent(node.parent);
1572
+ if (root) {
1573
+ root.apply(new UpdateCursorPositionAction(node));
1574
+ }
1575
+ }
1576
+ }
1577
+
1578
+ /**
1579
+ * Strategy for inserting text into a decorator node. The decorator can not edit, so we insert the text as a new child.
1580
+ */
1581
+ class InsertTextToDecoratorNodeStrategy extends codeBlock.ActionHandleStrategy {
1582
+ /**
1583
+ * @inheritDoc
1584
+ */
1585
+ handleAction(action, target) {
1586
+ const { text, offset, decoratorNode } = action;
1587
+ const paragraph = this.createNewParagraph(text);
1588
+ if (paragraph) {
1589
+ const newTextNode = paragraph.children[0];
1590
+ if (offset !== 0) {
1591
+ target.apply(new codeBlock.InsertChildrenAfterAction(decoratorNode, newTextNode));
1592
+ }
1593
+ else {
1594
+ target.apply(new codeBlock.InsertChildrenBeforeAction(decoratorNode, newTextNode));
1595
+ }
1596
+ this.setTheCursorPosition(newTextNode);
1597
+ }
1598
+ }
1599
+ /**
1600
+ * Set the cursor position to the new text node.
1601
+ *
1602
+ * @param {RTENode} focusNode - The new text node to focus on.
1603
+ */
1604
+ setTheCursorPosition(focusNode) {
1605
+ const rootContent = this.getRootContent(focusNode.parent);
1606
+ if (rootContent) {
1607
+ rootContent.apply(new UpdateCursorPositionAction(focusNode));
1608
+ }
1609
+ }
1610
+ }
1611
+
1612
+ /**
1613
+ * Insert new paragraph into current list item block at special position.
1614
+ */
1615
+ class ListItemInsertNewParagraphStrategy extends codeBlock.ActionHandleStrategy {
1616
+ /**
1617
+ * @inheritDoc
1618
+ */
1619
+ handleAction(action, target) {
1620
+ action.newBlock = this.breakSingleListItemBlock(action.startContainerNode, action.startOffset, target);
1621
+ }
1622
+ /**
1623
+ * Breaks a single list item block at a specific position.
1624
+ *
1625
+ * @param {RTETextNode} splitNode - The node that needs to be split within a list item block.
1626
+ * @param {number} startOffsetOfNode - The index within the `splitNode` where the break operation should occur.
1627
+ * @param {RTEListItemBlock} target - The list item block.
1628
+ * @returns {Nullable<RTEBlock>} Returns either a new `RTEListItemBlock` if the caret
1629
+ * position is at the end of the `splitNode`, or it returns the result of splitting the block at the
1630
+ * caret position if it is neither at the start nor at the end.
1631
+ */
1632
+ breakSingleListItemBlock(splitNode, startOffsetOfNode, target) {
1633
+ const newListItem = target.createNewListItem();
1634
+ const newBreakNode = this.copyInlineStyleToNewNode(splitNode);
1635
+ newListItem.apply(new codeBlock.AppendChildrenAction([newBreakNode]));
1636
+ if (this.isCaretPositionAtBlockEnd(target, splitNode, startOffsetOfNode)) {
1637
+ return this.breakListItemAtEnd(newListItem, target);
1638
+ }
1639
+ else if (this.isCaretPositionAtBlockStart(target, splitNode, startOffsetOfNode)) {
1640
+ target.parent.apply(new codeBlock.InsertChildrenBeforeAction(target, newListItem));
1641
+ }
1642
+ else {
1643
+ const splitBlockAction = new codeBlock.SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
1644
+ target.apply(splitBlockAction);
1645
+ return splitBlockAction.newBlock;
1646
+ }
1647
+ return newListItem;
1648
+ }
1649
+ /**
1650
+ * Breaks a list item at the end and handles the insertion of a new list item or paragraph accordingly.
1651
+ *
1652
+ * @param {RTEListItemBlock} newListItem - Item that represents a new list item to be added to the existing list.
1653
+ * @param {RTEListItemBlock} target - The list item block.
1654
+ * @returns {RTEBlock} Returns a `RTEBlock`.
1655
+ */
1656
+ breakListItemAtEnd(newListItem, target) {
1657
+ const lastItem = target.parent.children[target.parent.children.length - 1];
1658
+ const currentItemIsEmpty = target.children.length === 1 && target.children[0].isEmpty();
1659
+ if (target === lastItem && currentItemIsEmpty) {
1660
+ const parentParent = target.parent.parent;
1661
+ if (parentParent['type'] !== 'list-item') {
1662
+ const newParagraph = codeBlock.RTETextBlock.from({
1663
+ id: misc.generateUUID(),
1664
+ type: 'paragraph',
1665
+ nodes: [],
1666
+ });
1667
+ newParagraph.apply(new codeBlock.AppendChildrenAction(newListItem.children));
1668
+ parentParent.apply(new codeBlock.InsertChildrenAfterAction(target.parent, newParagraph));
1669
+ target.parent.apply(new codeBlock.RemoveChildrenAction(target));
1670
+ return newParagraph;
1671
+ }
1672
+ else {
1673
+ parentParent.parent.apply(new codeBlock.InsertChildrenAfterAction(parentParent, newListItem));
1674
+ target.parent.apply(new codeBlock.RemoveChildrenAction(target));
1675
+ }
1676
+ }
1677
+ else {
1678
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, newListItem));
1679
+ }
1680
+ return newListItem;
1681
+ }
1682
+ /**
1683
+ * Copy the inline style to new node
1684
+ *
1685
+ * @param {RTETextNode} needCopedNode - The node that needed to be copied to
1686
+ * @returns {RTETextNode} Returns a `RTETextNode`.
1687
+ */
1688
+ copyInlineStyleToNewNode(needCopedNode) {
1689
+ const textNode = needCopedNode.cloneWithText('');
1690
+ // The link annotation doesn't need to inherit
1691
+ textNode.annotationMap.delete(codeBlock.NodeAnnotationTypeEnum.LINK);
1692
+ return textNode;
1693
+ }
1694
+ }
1695
+
1696
+ /**
1697
+ * Delete the nest list block action
1698
+ *
1699
+ * @example needRemovedNestList.parent.apply(new RemoveNestListAction(needRemovedNestList))
1700
+ */
1701
+ class RemoveNestListAction extends codeBlock.ModifyContentAction {
1702
+ constructor(childList) {
1703
+ super();
1704
+ this.type = codeBlock.ModifyContentActionType.DELETE_NEST_LIST;
1705
+ this.nestListBlockToBeRemoved = childList;
1706
+ }
1707
+ }
1708
+
1709
+ /**
1710
+ * List remove list item strategy.
1711
+ */
1712
+ class ListRemoveListItemStrategy extends codeBlock.RemoveChildrenStrategy {
1713
+ /**
1714
+ * Remove the list item, check the list item and remove self if the list item is empty.
1715
+ *
1716
+ * @param {RemoveChildrenAction} action - The remove action instance.
1717
+ * @param {RTEListBlock} target - The list block.
1718
+ */
1719
+ handleAction(action, target) {
1720
+ super.handleAction(action, target);
1721
+ const parent = target.parent;
1722
+ if (target.children.length === 0 && parent) {
1723
+ // The parent is a list item mean the current block is a nest list, so we need to use RemoveNestListAction to remove the item
1724
+ if (parent['type'] === 'list-item') {
1725
+ parent.apply(new RemoveNestListAction(target));
1726
+ }
1727
+ else {
1728
+ parent.apply(new codeBlock.RemoveChildrenAction(target));
1729
+ }
1730
+ }
1731
+ }
1732
+ }
1733
+
1734
+ /**
1735
+ * Strategy to handle the paste content into function block.
1736
+ */
1737
+ class PasteContentStrategy extends codeBlock.ActionHandleStrategy {
1738
+ /**
1739
+ * @inheritDoc
1740
+ */
1741
+ handleAction(action, target) {
1742
+ if (target.parent) {
1743
+ const { blocksToBeInserted, startNode, startOffset } = action;
1744
+ let futureFocusBlock = target;
1745
+ if (startNode === target.children[0] && startOffset === 0) {
1746
+ target.parent.apply(new codeBlock.InsertChildrenBeforeAction(target, ...blocksToBeInserted));
1747
+ }
1748
+ else {
1749
+ const breakAction = new codeBlock.SplitBlockWithNodeAction(startNode, startOffset);
1750
+ target.apply(breakAction);
1751
+ target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, ...blocksToBeInserted));
1752
+ futureFocusBlock = breakAction.newBlock;
1753
+ }
1754
+ action.futureFocusBlock = futureFocusBlock;
1755
+ }
1756
+ }
1757
+ }
1758
+
1759
+ /**
1760
+ * Manager class for registering DTO action strategies.
1761
+ */
1762
+ class RTEDTOActionStrategyManager {
1763
+ /**
1764
+ * Registers basic strategies for a given DTO class.
1765
+ *
1766
+ * @param {string} dtoClassName - The name of the RTE block class name.
1767
+ */
1768
+ registerBlockBasicStrategies(dtoClassName) {
1769
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_CHILDREN, dtoClassName, dtoClassName === RTEListBlock.name
1770
+ ? new ListRemoveListItemStrategy()
1771
+ : new codeBlock.RemoveChildrenStrategy());
1772
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.APPEND_CHILDREN, dtoClassName, new AppendChildrenStrategy());
1773
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, dtoClassName, new InsertChildrenBeforeStrategy());
1774
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_AFTER, dtoClassName, new InsertChildrenAfterStrategy());
1775
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_BLOCK_CONTENT, dtoClassName, new BlockDeleteTextOrDecoratorNodeStrategy());
1776
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, dtoClassName, dtoClassName === RTEListItemBlock.name
1777
+ ? new ListItemInsertNewParagraphStrategy()
1778
+ : new BlockInsertNewParagraphStrategy());
1779
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_TEXT_TO_DECORATOR_NODE, dtoClassName, new InsertTextToDecoratorNodeStrategy());
1780
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_NODE_TO_NEAREST_ROOT, dtoClassName, new InsertNodeToNearestRootStrategy());
1781
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.PASTE_CONTENT, dtoClassName, new PasteContentStrategy());
1782
+ }
1783
+ }
1784
+ const RTEDTOActionStrategyManager$1 = new RTEDTOActionStrategyManager();
1785
+
1786
+ /**
1787
+ * Abstract class to define handler for generate the annotations
1788
+ */
1789
+ class AnnotationGeneratorStrategyAbstract {
1790
+ }
1791
+
1792
+ /** Handle bold annotation */
1793
+ class BoldAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
1794
+ /**
1795
+ * @inheritDoc
1796
+ */
1797
+ canHandle(targetDto) {
1798
+ return targetDto.name === 'RTETextNode';
1799
+ }
1800
+ /**
1801
+ * Handle annotation.
1802
+ *
1803
+ * @param {HTMLElement} element - Current elements.
1804
+ * @param {VegaRTETextAnnotations} parentAnnotations - Parent annotations.
1805
+ * @returns {VegaRTETextAnnotations} - Annotation.
1806
+ */
1807
+ handle(element, parentAnnotations = {}) {
1808
+ return this.isBold(element) || parentAnnotations.bold ? { bold: true } : {};
1809
+ }
1810
+ /**
1811
+ * Is bold element.
1812
+ *
1813
+ * @param {HTMLElement} element - current element.
1814
+ * @returns {boolean} - boolean.
1815
+ */
1816
+ isBold(element) {
1817
+ return (element.nodeName === 'STRONG' ||
1818
+ element.nodeName === 'B' ||
1819
+ element.style.fontWeight === codeBlock.BOLD_FONT_WEIGHT_KEYWORD ||
1820
+ element.style.fontWeight === codeBlock.BOLD_FONT_WEIGHT ||
1821
+ element.classList.contains('v-rte--bold'));
1822
+ }
1823
+ }
1824
+
1825
+ /** Handle custom attribute annotation */
1826
+ class CustomAttributeAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
1827
+ /**
1828
+ * Can be handle.
1829
+ *
1830
+ * @param {RTEDtoClassPrototype} targetDto - Target DTO.
1831
+ * @param {HtmlElementToAnnotationGenerateOptions} [options] - Options for annotation generator.
1832
+ * @returns {boolean} - .
1833
+ */
1834
+ canHandle(targetDto, options) {
1835
+ return !options.skipCustomAnnotations && !!targetDto;
1836
+ }
1837
+ /**
1838
+ * Handle annotation.
1839
+ *
1840
+ * @param {HTMLElement} element - Current elements.
1841
+ * @returns {VegaRTETextAnnotations} - Annotation.
1842
+ */
1843
+ handle(element) {
1844
+ const attributes = this.getAttributes(element);
1845
+ return Object.keys(attributes).length > 0 ? { customAttribute: attributes } : {};
1846
+ }
1847
+ /**
1848
+ * Obtain the custom attributes of element, excluding 'style' and 'class'.
1849
+ *
1850
+ * @param {HTMLElement} element - current element.
1851
+ * @returns {Record<string, string>} - Record<string, string>.
1852
+ */
1853
+ getAttributes(element) {
1854
+ const attributeNames = element
1855
+ .getAttributeNames()
1856
+ .filter((attr) => attr !== 'style' && attr !== 'class' && this.isValidAttr(attr));
1857
+ return attributeNames.reduce((acc, item) => {
1858
+ acc[item] = element.getAttribute(item);
1859
+ return acc;
1860
+ }, {});
1861
+ }
1862
+ /**
1863
+ * Check if the attribute name is valid.
1864
+ *
1865
+ * @param {string} attr - Attribute name.
1866
+ * @returns {boolean} - True if valid, false otherwise.
1867
+ */
1868
+ isValidAttr(attr) {
1869
+ return /^[a-zA-Z_][\w-]*$/.test(attr);
1870
+ }
1871
+ }
1872
+
1873
+ /** Handle custom class annotation */
1874
+ class CustomClassAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
1875
+ /**
1876
+ * Can be handle.
1877
+ *
1878
+ * @param {RTEDtoClassPrototype} targetDto - Target DTO.
1879
+ * @param {HtmlElementToAnnotationGenerateOptions} [options] - Options for annotation generator.
1880
+ * @returns {boolean} - .
1881
+ */
1882
+ canHandle(targetDto, options) {
1883
+ return !options.skipCustomAnnotations && !!targetDto;
1884
+ }
1885
+ /**
1886
+ * Handle annotation.
1887
+ *
1888
+ * @param {HTMLElement} element - Current elements.
1889
+ * @returns {VegaRTETextAnnotations} - Annotation.
1890
+ */
1891
+ handle(element) {
1892
+ const classes = this.getCustomClass(element);
1893
+ return classes.length > 0 ? { customClass: classes } : {};
1894
+ }
1895
+ /**
1896
+ * Get the custom class
1897
+ *
1898
+ * @param {HTMLElement} element - current element.
1899
+ * @returns {string[]} - the class after .
1900
+ */
1901
+ getCustomClass(element) {
1902
+ return element.classList
1903
+ .toString()
1904
+ .split(' ')
1905
+ .filter((item) => !item.includes('v-rte') && item !== '');
1906
+ }
1907
+ }
1908
+
1909
+ /** Handle custom style annotation */
1910
+ class CustomStyleAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
1911
+ /**
1912
+ * Can be handle.
1913
+ *
1914
+ * @param {RTEDtoClassPrototype} targetDto - Target DTO.
1915
+ * @param {HtmlElementToAnnotationGenerateOptions} [options] - Options for annotation generator.
1916
+ * @returns {boolean} - .
1917
+ */
1918
+ canHandle(targetDto, options) {
1919
+ return !options.skipCustomAnnotations && !!targetDto;
1920
+ }
1921
+ /**
1922
+ * Handle annotation.
1923
+ *
1924
+ * @param {HTMLElement} element - Current elements.
1925
+ * @returns {VegaRTETextAnnotations} - Annotation.
1926
+ */
1927
+ handle(element) {
1928
+ const styles = this.generateCustomStyleAnnotations(element);
1929
+ return Object.keys(styles).length > 0 ? { customStyle: styles } : {};
1930
+ }
1931
+ /**
1932
+ * Obtain and format the style of element.
1933
+ *
1934
+ * @param {HTMLElement} element - current element.
1935
+ * @returns {AnnotationStyle} - Record<string, string>.
1936
+ */
1937
+ generateCustomStyleAnnotations(element) {
1938
+ const customStyle = element.getAttribute('style');
1939
+ if (!customStyle)
1940
+ return {};
1941
+ const styleValue = customStyle.split(';').filter(Boolean);
1942
+ return styleValue
1943
+ .filter((key) => key !== ' ')
1944
+ .map((key) => {
1945
+ // to remove redundant quote pairs if needed, for example: ['fontFamily: "Roboto Mono"'] will be updated to ['fontFamily: Roboto Mono']
1946
+ const styleObject = key.replace(/(['"])(.*?)\1/g, '$2').split(':');
1947
+ const styleKey = string.dashCaseToCamel(styleObject[0].trim());
1948
+ return {
1949
+ [styleKey]: styleObject[1].trim().replace(';', ''),
1950
+ };
1951
+ })
1952
+ .reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {});
1953
+ }
1954
+ }
1955
+
1956
+ /** Handle indent annotation */
1957
+ class IndentAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
1958
+ /**
1959
+ * @inheritDoc
1960
+ */
1961
+ canHandle(targetDto) {
1962
+ return ['RTETextBlock', 'RTEListItemBlock', 'RTEListBlock'].includes(targetDto.name);
1963
+ }
1964
+ /**
1965
+ * Handle annotation.
1966
+ *
1967
+ * @param {HTMLElement} element - Current elements.
1968
+ * @returns {VegaRTEBlockAnnotations} - Annotation.
1969
+ */
1970
+ handle(element) {
1971
+ const indent = this.getIndent(element);
1972
+ return indent ? { indent: indent } : {};
1973
+ }
1974
+ /**
1975
+ * Get indent of current element.
1976
+ *
1977
+ * @param {HTMLElement} element - current element.
1978
+ * @returns {Nullable<number>} - Indent.
1979
+ */
1980
+ getIndent(element) {
1981
+ const style = element.style;
1982
+ let marginLeft;
1983
+ if (style.marginLeft) {
1984
+ marginLeft = style.marginLeft;
1985
+ }
1986
+ else if (style.margin) {
1987
+ const margins = style.margin.split(' ');
1988
+ switch (margins.length) {
1989
+ case 4:
1990
+ marginLeft = margins[3];
1991
+ break;
1992
+ case 2:
1993
+ case 3:
1994
+ marginLeft = margins[1];
1995
+ break;
1996
+ default:
1997
+ marginLeft = margins[0];
1998
+ break;
1999
+ }
2000
+ }
2001
+ else {
2002
+ return null;
2003
+ }
2004
+ const marginLeftNumber = Number(marginLeft.replace('px', ''));
2005
+ return marginLeftNumber && marginLeftNumber >= 0 ? Math.floor(marginLeftNumber / 16) : null;
2006
+ }
2007
+ }
2008
+
2009
+ /** Handle text align annotation */
2010
+ class TextAlignAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2011
+ /**
2012
+ * Can be handle.
2013
+ *
2014
+ * @param {RTEDtoClassPrototype} targetDto - Target DTO.
2015
+ * @returns {boolean} - .
2016
+ */
2017
+ canHandle(targetDto) {
2018
+ return ['RTETextBlock', 'RTEListItemBlock', 'RTEListBlock'].includes(targetDto.name);
2019
+ }
2020
+ /**
2021
+ * Handle annotation.
2022
+ *
2023
+ * @param {HTMLElement} element - Current elements.
2024
+ * @returns {VegaRTEBlockAnnotations} - Annotation.
2025
+ */
2026
+ handle(element) {
2027
+ const textAlign = this.getTextAlign(element);
2028
+ return textAlign ? { textAlign: textAlign } : {};
2029
+ }
2030
+ /**
2031
+ * Get text align of current element.
2032
+ *
2033
+ * @param {HTMLElement} element - current element.
2034
+ * @returns {Nullable<VegaRTEBlockAlignment>} - Text align.
2035
+ */
2036
+ getTextAlign(element) {
2037
+ const classList = element.classList;
2038
+ if (classList.contains(`v-rte--horizontal-alignment-left`)) {
2039
+ return 'left';
2040
+ }
2041
+ else if (classList.contains(`v-rte--horizontal-alignment-center`)) {
2042
+ return 'center';
2043
+ }
2044
+ else if (classList.contains(`v-rte--horizontal-alignment-right`)) {
2045
+ return 'right';
2046
+ }
2047
+ else if (classList.contains(`v-rte--horizontal-alignment-justify`)) {
2048
+ return 'justify';
2049
+ }
2050
+ const style = element.style;
2051
+ switch (style.textAlign) {
2052
+ case 'center':
2053
+ return 'center';
2054
+ case 'right':
2055
+ return 'right';
2056
+ case 'justify':
2057
+ return 'justify';
2058
+ case 'left':
2059
+ return 'left';
2060
+ default:
2061
+ return null;
2062
+ }
2063
+ }
2064
+ }
2065
+
2066
+ /** Handle code annotation */
2067
+ class CodeAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2068
+ /**
2069
+ * @inheritDoc
2070
+ */
2071
+ canHandle(targetDto) {
2072
+ return targetDto.name === 'RTETextNode';
2073
+ }
2074
+ /**
2075
+ * Handle annotation.
2076
+ *
2077
+ * @param {HTMLElement} element - Current elements.
2078
+ * @param {VegaRTETextAnnotations} parentAnnotations - Parent annotations.
2079
+ * @returns {VegaRTETextAnnotations} - Annotation.
2080
+ */
2081
+ handle(element, parentAnnotations = {}) {
2082
+ return this.isCode(element) || parentAnnotations.code ? { code: true } : {};
2083
+ }
2084
+ /**
2085
+ * Is code element.
2086
+ *
2087
+ * @param {HTMLElement} element - current element.
2088
+ * @returns {boolean} - boolean.
2089
+ */
2090
+ isCode(element) {
2091
+ return (element.classList.contains('v-rte--code') ||
2092
+ element.nodeName === 'CODE' ||
2093
+ element.nodeName === 'PRE' ||
2094
+ element.style.fontFamily === 'monospace' ||
2095
+ element.style.fontFamily.replace(/["']/g, '') === 'Roboto Mono');
2096
+ }
2097
+ }
2098
+
2099
+ /** Handle color annotation */
2100
+ class ColorAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2101
+ /**
2102
+ * @inheritDoc
2103
+ */
2104
+ canHandle(targetDto) {
2105
+ return targetDto.name === 'RTETextNode';
2106
+ }
2107
+ /**
2108
+ * Handle annotation.
2109
+ *
2110
+ * @param {HTMLElement} element - Current elements.
2111
+ * @param {VegaRTETextAnnotations} parentAnnotations - Parent annotations.
2112
+ * @returns {VegaRTETextAnnotations} - Annotation.
2113
+ */
2114
+ handle(element, parentAnnotations = {}) {
2115
+ const color = this.getColor(element) || parentAnnotations.textColor;
2116
+ return color ? { textColor: color } : {};
2117
+ }
2118
+ /**
2119
+ * Get current color of element.
2120
+ *
2121
+ * @param {HTMLElement} element - current element.
2122
+ * @returns {Nullable<string>} - color.
2123
+ */
2124
+ getColor(element) {
2125
+ var _a;
2126
+ const color = element.style.color;
2127
+ const hexColor = (_a = ui.rgbToHex(color)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
2128
+ if (hexColor) {
2129
+ // We don't display default text color as inline style, because we defined it in the vega-rich-text-content.scss.
2130
+ const colorSchema = codeBlock.RTE_TEXT_COLORS.filter((item) => item.key !== codeBlock.RTE_DEFAULT_TEXT_COLOR.key).find((schema) => schema.light === hexColor || schema.dark === hexColor);
2131
+ if (colorSchema)
2132
+ return colorSchema.key;
2133
+ return null;
2134
+ }
2135
+ else {
2136
+ for (const color of codeBlock.RTE_TEXT_COLORS) {
2137
+ if (element.style.color.includes(color.key)) {
2138
+ return color.key;
2139
+ }
2140
+ }
2141
+ return null;
2142
+ }
2143
+ }
2144
+ }
2145
+
2146
+ /** Handle italic annotation */
2147
+ class ItalicAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2148
+ /**
2149
+ * @inheritDoc
2150
+ */
2151
+ canHandle(targetDto) {
2152
+ return targetDto.name === 'RTETextNode';
2153
+ }
2154
+ /**
2155
+ * Handle annotation.
2156
+ *
2157
+ * @param {HTMLElement} element - Current elements.
2158
+ * @param {VegaRTETextAnnotations} parentAnnotations - Parent annotations.
2159
+ * @returns {VegaRTETextAnnotations} - Annotation.
2160
+ */
2161
+ handle(element, parentAnnotations = {}) {
2162
+ return this.isItalic(element) || parentAnnotations.italic ? { italic: true } : {};
2163
+ }
2164
+ /**
2165
+ * Is italic element.
2166
+ *
2167
+ * @param {HTMLElement} element - current element.
2168
+ * @returns {boolean} - boolean.
2169
+ */
2170
+ isItalic(element) {
2171
+ return (element.nodeName === 'I' ||
2172
+ element.style.fontStyle === codeBlock.ITALIC_FONT_STYLE ||
2173
+ element.nodeName === 'EM' ||
2174
+ element.classList.contains('v-rte--italic'));
2175
+ }
2176
+ }
2177
+
2178
+ /** Handle link annotation */
2179
+ class LinkAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2180
+ constructor() {
2181
+ super(...arguments);
2182
+ this.handlers = [
2183
+ new CustomAttributeAnnotationHandler(),
2184
+ new CustomClassAnnotationHandler(),
2185
+ new CustomStyleAnnotationHandler(),
2186
+ ];
2187
+ }
2188
+ /**
2189
+ * Can be handle.
2190
+ *
2191
+ * @param {RTEDtoClassPrototype} targetDto - Target DTO.
2192
+ * @returns {boolean} - .
2193
+ */
2194
+ canHandle(targetDto) {
2195
+ return targetDto.name === 'RTETextNode';
2196
+ }
2197
+ /**
2198
+ * Handle annotation.
2199
+ *
2200
+ * @param {HTMLElement} element - Current elements.
2201
+ * @param {VegaRTETextAnnotations} parentAnnotations - Parent annotations.
2202
+ * @returns {VegaRTETextAnnotations} - Annotation.
2203
+ */
2204
+ handle(element, parentAnnotations = {}) {
2205
+ if (parentAnnotations.link)
2206
+ return { link: parentAnnotations.link };
2207
+ return element.tagName === 'A' ? { link: this.generateLinkAnnotations(element) } : {};
2208
+ }
2209
+ /**
2210
+ * Generate link annotations.
2211
+ *
2212
+ * @param {HTMLElement} element - Current elements.
2213
+ * @returns {VegaRTELink} - link annotations.
2214
+ */
2215
+ generateLinkAnnotations(element) {
2216
+ const annotations = {
2217
+ href: element.getAttribute('href') || '',
2218
+ groupKey: misc.generateUUID(),
2219
+ };
2220
+ this.handlers.forEach((handler) => {
2221
+ Object.assign(annotations, handler.handle(element));
2222
+ });
2223
+ return annotations;
2224
+ }
2225
+ }
2226
+
2227
+ /** Handle strike through annotation */
2228
+ class StrikeThroughAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2229
+ /**
2230
+ * @inheritDoc
2231
+ */
2232
+ canHandle(targetDto) {
2233
+ return targetDto.name === 'RTETextNode';
2234
+ }
2235
+ /**
2236
+ * Handle annotation.
2237
+ *
2238
+ * @param {HTMLElement} element - Current elements.
2239
+ * @param {VegaRTETextAnnotations} parentAnnotations - Parent annotations.
2240
+ * @returns {VegaRTETextAnnotations} - Annotation.
2241
+ */
2242
+ handle(element, parentAnnotations = {}) {
2243
+ return this.isStrikethrough(element) || parentAnnotations.strikethrough
2244
+ ? { strikethrough: true }
2245
+ : {};
2246
+ }
2247
+ /**
2248
+ * Is strikethrough element.
2249
+ *
2250
+ * @param {HTMLElement} element - current element.
2251
+ * @returns {boolean} - boolean.
2252
+ */
2253
+ isStrikethrough(element) {
2254
+ return (element.style.textDecoration.includes(codeBlock.STRIKETHROUGH_TEXT_DECORATION) ||
2255
+ element.nodeName === 'S' ||
2256
+ element.nodeName === 'DEL' ||
2257
+ element.classList.contains('v-rte--strikethrough'));
2258
+ }
2259
+ }
2260
+
2261
+ /** Handle underline annotation */
2262
+ class UnderlineAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2263
+ /**
2264
+ * @inheritDoc
2265
+ */
2266
+ canHandle(targetDto) {
2267
+ return targetDto.name === 'RTETextNode';
2268
+ }
2269
+ /**
2270
+ * Handle annotation.
2271
+ *
2272
+ * @param {HTMLElement} element - Current elements.
2273
+ * @param {VegaRTETextAnnotations} parentAnnotations - Parent annotations.
2274
+ * @returns {VegaRTETextAnnotations} - Annotation.
2275
+ */
2276
+ handle(element, parentAnnotations = {}) {
2277
+ return this.isUnderline(element) || parentAnnotations.underline ? { underline: true } : {};
2278
+ }
2279
+ /**
2280
+ * Is underline element.
2281
+ *
2282
+ * @param {HTMLElement} element - current element.
2283
+ * @returns {boolean} - boolean.
2284
+ */
2285
+ isUnderline(element) {
2286
+ return (element.style.textDecoration.includes(codeBlock.UNDERLINE_TEXT_DECORATION) ||
2287
+ element.nodeName === 'U' ||
2288
+ element.nodeName === 'INS' ||
2289
+ element.classList.contains('v-rte--underline'));
2290
+ }
2291
+ }
2292
+
2293
+ /**
2294
+ * Registry for managing filter styles strategies keyed by DTO class name.
2295
+ *
2296
+ * Provides common `register` / `getStrategies` primitives that both output-
2297
+ * filtering strategies (DTO → HTML) and annotation-parsing strategies
2298
+ * (HTML → DTO) build upon.
2299
+ *
2300
+ * TODO: Currently, the filter styles strategies are applied for all rich text editors. We need to apply the strategies with a specific rich text editor instance when we have multiple rich text editors in the future.
2301
+ */
2302
+ class RTEFilterStylesStrategyRegistry {
2303
+ /**
2304
+ * Registers a filter styles strategy for a specific DTO class name.
2305
+ * Duplicate strategy instances are ignored.
2306
+ *
2307
+ * @param {string} dtoClassName - The DTO class name (e.g. `RTEListBlock.name`).
2308
+ * @param {RTEFilterStylesStrategy} strategy - The strategy instance to register.
2309
+ */
2310
+ static register(dtoClassName, strategy) {
2311
+ var _a;
2312
+ const set = (_a = this.registry.get(dtoClassName)) !== null && _a !== void 0 ? _a : new Set();
2313
+ set.add(strategy);
2314
+ this.registry.set(dtoClassName, set);
2315
+ }
2316
+ /**
2317
+ * Retrieves all strategies registered for a given DTO class name.
2318
+ *
2319
+ * @param {string} dtoClassName - The DTO class name to look up.
2320
+ * @returns {RTEFilterStylesStrategy[]} Registered strategies (empty array if none).
2321
+ */
2322
+ static getStrategies(dtoClassName) {
2323
+ var _a;
2324
+ return Array.from((_a = this.registry.get(dtoClassName)) !== null && _a !== void 0 ? _a : []);
2325
+ }
2326
+ }
2327
+ RTEFilterStylesStrategyRegistry.registry = new Map();
2328
+
2329
+ /** Handle text style annotation */
2330
+ class TextStyleAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2331
+ /**
2332
+ * Can be handle.
2333
+ *
2334
+ * @param {RTEDtoClassPrototype} targetDto - Target DTO.
2335
+ * @param {HtmlElementToAnnotationGenerateOptions} options - Options for annotation generator.
2336
+ * @returns {boolean} - .
2337
+ */
2338
+ canHandle(targetDto, options) {
2339
+ return !!options.autoMatchFormat && targetDto.name === 'RTETextBlock';
2340
+ }
2341
+ /**
2342
+ * Handle annotation.
2343
+ *
2344
+ * @param {HTMLElement} element - Current elements.
2345
+ * @returns {VegaRTETextBlockAnnotations} - Annotation.
2346
+ */
2347
+ handle(element) {
2348
+ const textStyle = this.getTextStyle(element);
2349
+ return textStyle ? { textStyle: textStyle } : {};
2350
+ }
2351
+ /**
2352
+ * Get the node type of element. The element type is determined in the following
2353
+ * order: "data-type" attribute, node name, font size and class name.
2354
+ *
2355
+ * @param {HTMLElement} element - element.
2356
+ * @returns {Nullable<VegaRTETextStyleType>} - node type.
2357
+ */
2358
+ getTextStyle(element) {
2359
+ const byDataType = this.getElementTypeByDataType(element);
2360
+ if (byDataType)
2361
+ return byDataType;
2362
+ const byNodeName = this.getElementTypeByNodeName(element);
2363
+ if (byNodeName)
2364
+ return byNodeName;
2365
+ const byFontSize = this.getElementTypeByFontSize(element);
2366
+ if (byFontSize)
2367
+ return byFontSize;
2368
+ const byClassName = this.getElementTypeByClassName(element);
2369
+ if (byClassName)
2370
+ return byClassName;
2371
+ return null;
2372
+ }
2373
+ /**
2374
+ * Get the element type by data-type attribute.
2375
+ *
2376
+ * @param {HTMLElement} element - element.
2377
+ * @returns {Nullable<VegaRTETextStyleType>} - element type or null if not found.
2378
+ */
2379
+ getElementTypeByDataType(element) {
2380
+ if (element.nodeType !== Node.TEXT_NODE && element.hasAttribute('data-type')) {
2381
+ return element.getAttribute('data-type');
2382
+ }
2383
+ return null;
2384
+ }
2385
+ /**
2386
+ * Get the element type by font size.
2387
+ *
2388
+ * @param {HTMLElement} element - element.
2389
+ * @returns {Nullable<VegaRTETextStyleType>} - element type or null if not found.
2390
+ */
2391
+ getElementTypeByFontSize(element) {
2392
+ var _a;
2393
+ switch ((_a = element.style) === null || _a === void 0 ? void 0 : _a.fontSize) {
2394
+ case '36px':
2395
+ return 'title';
2396
+ case '28px':
2397
+ return 'subtitle';
2398
+ case '22px':
2399
+ return 'heading-1';
2400
+ case '20px':
2401
+ return 'heading-2';
2402
+ case '18px':
2403
+ return 'heading-3';
2404
+ default:
2405
+ return null;
2406
+ }
2407
+ }
2408
+ /**
2409
+ * Get the element type by node name.
2410
+ *
2411
+ * @param {HTMLElement} element - element.
2412
+ * @returns {Nullable<VegaRTETextStyleType>} - element type or null if not found.
2413
+ */
2414
+ getElementTypeByNodeName(element) {
2415
+ switch (element.nodeName) {
2416
+ case 'P':
2417
+ return 'paragraph';
2418
+ case 'H1':
2419
+ return 'heading-1';
2420
+ case 'H2':
2421
+ return 'heading-2';
2422
+ case 'H3':
2423
+ return 'heading-3';
2424
+ case 'H4':
2425
+ return 'heading-4';
2426
+ case 'H5':
2427
+ return 'heading-5';
2428
+ case 'H6':
2429
+ return 'heading-6';
2430
+ default:
2431
+ return null;
2432
+ }
2433
+ }
2434
+ /**
2435
+ * Get the element type by class name.
2436
+ *
2437
+ * @param {HTMLElement} element - element.
2438
+ * @returns {Nullable<VegaRTETextStyleType>} - element type or null if not found.
2439
+ */
2440
+ getElementTypeByClassName(element) {
2441
+ if (element.className) {
2442
+ const match = /\bv-rte--text-style-(title|subtitle|heading-1|heading-2|heading-3|heading-4|heading-5|heading-6|paragraph)\b/.exec(element.className);
2443
+ if (match) {
2444
+ return match[1];
2445
+ }
2446
+ }
2447
+ return null;
2448
+ }
2449
+ }
2450
+
2451
+ /** Handle image size annotation */
2452
+ class ImageSizeAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2453
+ /**
2454
+ * @inheritDoc
2455
+ */
2456
+ canHandle(targetDto) {
2457
+ return targetDto.name === 'RTEImageNode';
2458
+ }
2459
+ /**
2460
+ * Handle annotation.
2461
+ *
2462
+ * @param {HTMLElement} element - Current elements.
2463
+ * @returns {VegaRTEImageAnnotations} - Annotation.
2464
+ */
2465
+ handle(element) {
2466
+ const size = this.getImageSize(element);
2467
+ return size ? { size: size } : {};
2468
+ }
2469
+ /**
2470
+ * Determine the image display size based on the width of the current element.
2471
+ *
2472
+ * @param {HTMLElement} element - current element.
2473
+ * @returns {Nullable<VegaRichTextImageEditorSizeType>} -Image size, default 'md'.
2474
+ */
2475
+ getImageSize(element) {
2476
+ if (element.getAttribute('data-size')) {
2477
+ return element.getAttribute('data-size');
2478
+ }
2479
+ return null;
2480
+ }
2481
+ }
2482
+
2483
+ /** Handle image alt annotation */
2484
+ class ImageAltAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2485
+ /**
2486
+ * @inheritDoc
2487
+ */
2488
+ canHandle(targetDto) {
2489
+ return targetDto.name === 'RTEImageNode';
2490
+ }
2491
+ /**
2492
+ * Handle annotation.
2493
+ *
2494
+ * @param {HTMLElement} element - Current elements.
2495
+ * @returns {VegaRTEImageAnnotations} - Annotation.
2496
+ */
2497
+ handle(element) {
2498
+ return element.hasAttribute('alt') ? { alt: element.getAttribute('alt') } : {};
2499
+ }
2500
+ }
2501
+
2502
+ /**
2503
+ * Handle inline html annotation
2504
+ */
2505
+ class InlineHtmlAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
2506
+ constructor() {
2507
+ super(...arguments);
2508
+ this.customAttributeHandler = new CustomAttributeAnnotationHandler();
2509
+ this.customStyleAnnotationHandler = new CustomStyleAnnotationHandler();
2510
+ this.customClassAnnotationHandler = new CustomClassAnnotationHandler();
2511
+ }
2512
+ /**
2513
+ * @inheritDoc
2514
+ */
2515
+ canHandle(targetDto, options) {
2516
+ return targetDto.name === 'RTETextNode' && options.autoMatchFormat === false;
2517
+ }
2518
+ /**
2519
+ * @inheritDoc
2520
+ */
2521
+ handle(element, parentAnnotations) {
2522
+ const canHandle = InlineHtmlAnnotationHandler.canHandleTags.includes(element.nodeName);
2523
+ if (canHandle) {
2524
+ const inlineHtml = this.generateInlineHtmlAnnotation(element, Object.assign({}, parentAnnotations));
2525
+ if (inlineHtml) {
2526
+ return { inlineHtml: inlineHtml };
2527
+ }
2528
+ }
2529
+ return {};
2530
+ }
2531
+ /**
2532
+ * Generate inline html annotation.
2533
+ *
2534
+ * @param {HTMLElement} child - Current element.
2535
+ * @param {VegaRTETextAnnotations} annotations - Current annotations.
2536
+ * @returns {Nullable<VegaInlineHtmlSchema>} - Inline html annotation.
2537
+ */
2538
+ generateInlineHtmlAnnotation(child, annotations) {
2539
+ let { inlineHtml } = annotations;
2540
+ if (!codeBlock.RTETextNode.supportsHtmlTag(child.nodeName.toLowerCase()) ||
2541
+ (child.childNodes.length === 1 && child.childNodes[0].nodeType !== Node.TEXT_NODE)) {
2542
+ const childInlineHtmlNode = {
2543
+ htmlTag: child.nodeName.toLowerCase(),
2544
+ customAttribute: this.customAttributeHandler.handle(child).customAttribute,
2545
+ customStyle: this.customStyleAnnotationHandler.handle(child).customStyle,
2546
+ customClass: this.customClassAnnotationHandler.handle(child).customClass,
2547
+ };
2548
+ if (!inlineHtml) {
2549
+ inlineHtml = childInlineHtmlNode;
2550
+ }
2551
+ else {
2552
+ let lastChild = inlineHtml;
2553
+ while (lastChild.child &&
2554
+ child.parentNode &&
2555
+ lastChild.child.htmlTag === child.parentNode.nodeName.toLowerCase()) {
2556
+ lastChild = lastChild.child;
2557
+ }
2558
+ lastChild.child = childInlineHtmlNode;
2559
+ }
2560
+ }
2561
+ return inlineHtml ? Object.assign({}, inlineHtml) : null;
2562
+ }
2563
+ }
2564
+ InlineHtmlAnnotationHandler.canHandleTags = [
2565
+ 'A',
2566
+ 'ABBR',
2567
+ 'AUDIO',
2568
+ 'B',
2569
+ 'BDI',
2570
+ 'BDO',
2571
+ 'CITE',
2572
+ 'CODE',
2573
+ 'DEL',
2574
+ 'DFN',
2575
+ 'EMBED',
2576
+ 'EM',
2577
+ 'I',
2578
+ 'INS',
2579
+ 'KBD',
2580
+ 'MARK',
2581
+ 'METER',
2582
+ 'OUTPUT',
2583
+ 'PROGRESS',
2584
+ 'Q',
2585
+ 'S',
2586
+ 'SMALL',
2587
+ 'SPAN',
2588
+ 'STRONG',
2589
+ 'SUB',
2590
+ 'SUP',
2591
+ 'TIME',
2592
+ 'U',
2593
+ 'VAR',
2594
+ 'VIDEO',
2595
+ ];
2596
+
2597
+ /** Html element to annotations generator */
2598
+ class HtmlElementToAnnotationGenerator {
2599
+ constructor() {
2600
+ this.handlers = [
2601
+ new TextAlignAnnotationHandler(),
2602
+ new IndentAnnotationHandler(),
2603
+ new BoldAnnotationHandler(),
2604
+ new ItalicAnnotationHandler(),
2605
+ new UnderlineAnnotationHandler(),
2606
+ new StrikeThroughAnnotationHandler(),
2607
+ new ColorAnnotationHandler(),
2608
+ new LinkAnnotationHandler(),
2609
+ new CodeAnnotationHandler(),
2610
+ new ImageSizeAnnotationHandler(),
2611
+ new ImageAltAnnotationHandler(),
2612
+ new CustomAttributeAnnotationHandler(),
2613
+ new CustomClassAnnotationHandler(),
2614
+ new CustomStyleAnnotationHandler(),
2615
+ new TextStyleAnnotationHandler(),
2616
+ new InlineHtmlAnnotationHandler(),
2617
+ ];
2618
+ }
2619
+ /**
2620
+ * Register a custom annotation handler.
2621
+ * Custom handlers are added to the beginning of the handlers array,
2622
+ * giving them higher priority than default handlers.
2623
+ *
2624
+ * @param {AnnotationGeneratorStrategyAbstract} handler - The annotation handler to register.
2625
+ */
2626
+ registerHandler(handler) {
2627
+ this.handlers.unshift(handler);
2628
+ }
2629
+ /**
2630
+ * The function generates annotations for a given target DTO and HTML element based on a set of
2631
+ * strategies.
2632
+ *
2633
+ * @typedef T class name of target DTO
2634
+ * @typedef V generated annotations type
2635
+ * @param {T} targetDto - Which DTO is the generated annotations to set.
2636
+ * @param {HTMLElement} element - Current html element.
2637
+ * @param {HtmlElementToAnnotationGenerateOptions} [options] - Options
2638
+ * @returns {V} Generated annotations.
2639
+ */
2640
+ generate(targetDto, element, options = { autoMatchFormat: true }) {
2641
+ const isLinkElement = element.tagName === 'A';
2642
+ const annotations = this.handlers
2643
+ .filter((handler) => !options.autoMatchFormat && isLinkElement ? handler instanceof LinkAnnotationHandler : true)
2644
+ .filter((handler) => element.nodeType !== Node.TEXT_NODE &&
2645
+ handler.canHandle(targetDto, {
2646
+ skipCustomAnnotations: options.skipCustomAnnotations || isLinkElement,
2647
+ autoMatchFormat: options.autoMatchFormat,
2648
+ }))
2649
+ .reduce((annotations, handler) => {
2650
+ const result = handler.handle(element, options.parentAnnotations);
2651
+ return Object.assign(Object.assign({}, annotations), result);
2652
+ }, {});
2653
+ this.removeTextStyleDefaultsFromCustomStyle(annotations);
2654
+ const strategies = RTEFilterStylesStrategyRegistry.getStrategies(targetDto.name);
2655
+ for (const strategy of strategies) {
2656
+ if (options.autoMatchFormat || strategy.alwaysFilter) {
2657
+ strategy.filterAnnotations(annotations);
2658
+ }
2659
+ }
2660
+ return annotations;
2661
+ }
2662
+ /**
2663
+ * Remove default text-style properties from customStyle.
2664
+ * This prevents repeated styling when switching between source edit and normal mode.
2665
+ *
2666
+ * Note: This method mutates the customStyle object inside `annotations` in place and returns the same reference.
2667
+ *
2668
+ * @param {V} annotations - The generated annotations.
2669
+ * @returns {V} The same annotations reference with customStyle cleaned up.
2670
+ */
2671
+ removeTextStyleDefaultsFromCustomStyle(annotations) {
2672
+ const textStyle = 'textStyle' in annotations ? annotations.textStyle : undefined;
2673
+ const customStyle = annotations.customStyle;
2674
+ if (!textStyle || !customStyle) {
2675
+ return annotations;
2676
+ }
2677
+ const defaultStyles = codeBlock.TextStyleAnnotation.getDefaultStyles(textStyle);
2678
+ if (!defaultStyles) {
2679
+ return annotations;
2680
+ }
2681
+ for (const key of Object.keys(defaultStyles)) {
2682
+ if (customStyle[key] === defaultStyles[key]) {
2683
+ delete customStyle[key];
2684
+ }
2685
+ }
2686
+ if (Object.keys(customStyle).length === 0) {
2687
+ delete annotations.customStyle;
2688
+ }
2689
+ return annotations;
2690
+ }
2691
+ }
2692
+ const htmlElementToAnnotationGenerator = new HtmlElementToAnnotationGenerator();
2693
+
2694
+ /** Abstract class for block html element to RTE block dto */
2695
+ class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
2696
+ constructor() {
2697
+ super(...arguments);
2698
+ this.annotationHandler = new TextStyleAnnotationHandler();
2699
+ }
2700
+ /**
2701
+ * Generate child nodes of block element, this will inherit all annotations from parent to text node and
2702
+ * flat the child nodes.
2703
+ *
2704
+ * Example:
2705
+ * <li>
2706
+ * <u><i>text1</i></u>
2707
+ * <span></span>
2708
+ * <span style='font-weight: bold;'><span>text2</span></span>
2709
+ * text3
2710
+ * </li>
2711
+ * will tranform to:
2712
+ * <li>
2713
+ * <span>text1</span> // with underline and italic annotations
2714
+ * <span></span> // empty span
2715
+ * <span>text2</span> // with bold annotations
2716
+ * <span>text3</span> // no annotations
2717
+ * </li>
2718
+ *
2719
+ * @param {HTMLElement[]} elements - Child elements.
2720
+ * @param {VegaRTETextAnnotations} annotations - Parent annotations.
2721
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
2722
+ * @returns {VegaRTETextNode[]} - Text node DTO.
2723
+ */
2724
+ generateChildNodes(elements, annotations, options) {
2725
+ const childNodes = [];
2726
+ const disableAutoMatchFormat = !!(options && options.autoMatchFormat === false);
2727
+ const parentAnnotations = Object.assign({}, annotations);
2728
+ elements.forEach((child) => {
2729
+ const strategy = ElementToDTOClassStrategyManager.getElementToNodeStrategies().find((item) => item.canHandle([child], 0, options) > 0);
2730
+ let textNodeJson = null;
2731
+ if (strategy) {
2732
+ textNodeJson = strategy.handle([child], options, parentAnnotations);
2733
+ }
2734
+ if (textNodeJson) {
2735
+ childNodes.push(textNodeJson);
2736
+ }
2737
+ else if (ui.isHTMLElement(child) && child.childNodes.length > 0) {
2738
+ const curAnnotations = htmlElementToAnnotationGenerator.generate(codeBlock.RTETextNode, child, Object.assign({ parentAnnotations: disableAutoMatchFormat
2739
+ ? {
2740
+ inlineHtml: parentAnnotations.inlineHtml,
2741
+ link: parentAnnotations.link,
2742
+ code: parentAnnotations.code,
2743
+ }
2744
+ : annotations }, options));
2745
+ childNodes.push(...this.generateChildNodes(Array.from(child.childNodes), curAnnotations, options));
2746
+ }
2747
+ });
2748
+ return childNodes;
2749
+ }
2750
+ /**
2751
+ * Get the node type of element. The element type is determined in the following
2752
+ * order: "data-type" attribute, node name, font size and class name.
2753
+ *
2754
+ * @param {HTMLElement} element - element.
2755
+ * @returns {VegaRTETextBlockType} - Block type.
2756
+ */
2757
+ matchTextBlockType(element) {
2758
+ var _a;
2759
+ return (_a = this.annotationHandler.handle(element).textStyle) !== null && _a !== void 0 ? _a : 'paragraph';
2760
+ }
2761
+ }
2762
+
2763
+ /**
2764
+ * Converting HTML block elements into RTE blocks.
2765
+ */
2766
+ class HtmlBlockStrategy extends BlockToRTEBlockStrategyAbstract {
2767
+ /**
2768
+ * @inheritDoc
2769
+ */
2770
+ canHandle(elementsArray, currentIndex, options) {
2771
+ const element = elementsArray[currentIndex];
2772
+ // - div + img should be handled by RTEImageBlock
2773
+ const isCustomContainer = element.nodeName === 'DIV'
2774
+ ? element.childNodes.length > 0 && element.childNodes[0].nodeName !== 'IMG'
2775
+ : true;
2776
+ return !options.autoMatchFormat &&
2777
+ isCustomContainer &&
2778
+ HtmlBlockStrategy.canHandleTags.includes(elementsArray[currentIndex].nodeName)
2779
+ ? 1
2780
+ : 0;
2781
+ }
2782
+ /**
2783
+ * @inheritDoc
2784
+ */
2785
+ handle(elementsArray, options) {
2786
+ const element = elementsArray[0];
2787
+ return RTEHtmlBlock.from(this.generateHtmlBlock(element, options), options);
2788
+ }
2789
+ /**
2790
+ * @inheritDoc
2791
+ */
2792
+ appendChildBlocks(currentBlock, childBlocks) {
2793
+ currentBlock.children = childBlocks.map((block) => {
2794
+ block.parent = currentBlock;
2795
+ return block;
2796
+ });
2797
+ }
2798
+ /**
2799
+ * @inheritDoc
2800
+ */
2801
+ shouldProceedToElementChildren() {
2802
+ return true;
2803
+ }
2804
+ /**
2805
+ * Generate HTML block DTO from an HTML element.
2806
+ *
2807
+ * @param {HTMLElement} element - HTML element to convert.
2808
+ * @param {VegaRTETransformOptions} options - Options for transformation.
2809
+ * @returns {VegaRTEHtmlBlock} - HTML block DTO.
2810
+ */
2811
+ generateHtmlBlock(element, options) {
2812
+ return {
2813
+ id: misc.generateUUID(),
2814
+ type: 'html-block',
2815
+ htmlTag: element.nodeName.toLowerCase(),
2816
+ annotations: htmlElementToAnnotationGenerator.generate(RTEHtmlBlock, element, options),
2817
+ children: [],
2818
+ };
2819
+ }
2820
+ }
2821
+ HtmlBlockStrategy.canHandleTags = [
2822
+ 'ADDRESS',
2823
+ 'ARTICLE',
2824
+ 'ASIDE',
2825
+ 'BLOCKQUOTE',
2826
+ 'BUTTON',
2827
+ 'CAPTION',
2828
+ 'COL',
2829
+ 'COLGROUP',
2830
+ 'DIV',
2831
+ 'DD',
2832
+ 'DETAILS',
2833
+ 'DL',
2834
+ 'DT',
2835
+ 'FIELDSET',
2836
+ 'FIGCAPTION',
2837
+ 'FIGURE',
2838
+ 'FOOTER',
2839
+ 'FORM',
2840
+ 'HEADER',
2841
+ 'HR',
2842
+ 'HX',
2843
+ 'INPUT',
2844
+ 'LEGEND',
2845
+ 'MAIN',
2846
+ 'NAV',
2847
+ 'PRE',
2848
+ 'SECTION',
2849
+ 'SUMMARY',
2850
+ 'TABLE',
2851
+ 'TBODY',
2852
+ 'TD',
2853
+ 'TFOOT',
2854
+ 'TH',
2855
+ 'THEAD',
2856
+ 'TR',
2857
+ ];
2858
+
2859
+ /** Transform ul element to list block DTO */
2860
+ class UlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
2861
+ /**
2862
+ * Can be handle.
2863
+ *
2864
+ * @param {HTMLElement[]} elementsArray - Current elements.
2865
+ * @param {number} currentIndex - Current element index.
2866
+ * @returns {number} - can be handled element count.
2867
+ */
2868
+ canHandle(elementsArray, currentIndex) {
2869
+ return elementsArray[currentIndex].tagName === 'UL' ? 1 : 0;
2870
+ }
2871
+ /**
2872
+ * Parse to a block.
2873
+ *
2874
+ * @param {HTMLElement[]} elementsArray - Current elements.
2875
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
2876
+ * @returns {Nullable<RTEContentBlock>} - Bullet list block.
2877
+ */
2878
+ handle(elementsArray, options) {
2879
+ if (elementsArray[0].childNodes.length === 0)
2880
+ return null;
2881
+ return RTEListBlock.from({
2882
+ id: misc.generateUUID(),
2883
+ type: 'bullet-list',
2884
+ blocks: [],
2885
+ annotations: htmlElementToAnnotationGenerator.generate(RTEListBlock, elementsArray[0], options),
2886
+ }, options);
2887
+ }
2888
+ /**
2889
+ * Append child list item blocks to current list block.
2890
+ *
2891
+ * @param {RTEListBlock} currentBlock - Current list block.
2892
+ * @param {RTEContentBlock[]} childBlocks - Current list item blocks.
2893
+ */
2894
+ appendChildBlocks(currentBlock, childBlocks) {
2895
+ currentBlock.children = childBlocks.filter((block) => block instanceof RTEListItemBlock);
2896
+ childBlocks.forEach((block) => (block.parent = currentBlock));
2897
+ }
2898
+ /**
2899
+ * Should continue process to child elements.
2900
+ *
2901
+ * @returns {boolean} - boolean.
2902
+ */
2903
+ shouldProceedToElementChildren() {
2904
+ return true;
2905
+ }
2906
+ }
2907
+
2908
+ /** Transform ol element to list block DTO */
2909
+ class OlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
2910
+ /**
2911
+ * Can be handle.
2912
+ *
2913
+ * @param {HTMLElement[]} elementsArray - Current elements.
2914
+ * @param {number} currentIndex - Current element index.
2915
+ * @returns {number} - can be handled element count.
2916
+ */
2917
+ canHandle(elementsArray, currentIndex) {
2918
+ return elementsArray[currentIndex].tagName === 'OL' ? 1 : 0;
2919
+ }
2920
+ /**
2921
+ * Parse to a number list block.
2922
+ *
2923
+ * @param {HTMLElement[]} elementsArray - Current elements.
2924
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
2925
+ * @returns {Nullable<RTEContentBlock>} - Number list block.
2926
+ */
2927
+ handle(elementsArray, options) {
2928
+ if (elementsArray[0].childNodes.length === 0)
2929
+ return null;
2930
+ return RTEListBlock.from({
2931
+ id: misc.generateUUID(),
2932
+ type: 'number-list',
2933
+ blocks: [],
2934
+ annotations: htmlElementToAnnotationGenerator.generate(RTEListBlock, elementsArray[0], options),
2935
+ }, options);
2936
+ }
2937
+ /**
2938
+ * Append child list item blocks to current list block.
2939
+ *
2940
+ * @param {RTEListBlock} currentBlock - Current list block.
2941
+ * @param {RTEContentBlock[]} childBlocks - Current list item blocks.
2942
+ */
2943
+ appendChildBlocks(currentBlock, childBlocks) {
2944
+ currentBlock.children = childBlocks.filter((block) => block instanceof RTEListItemBlock);
2945
+ childBlocks.forEach((block) => (block.parent = currentBlock));
2946
+ }
2947
+ /**
2948
+ * Should continue process to child elements.
2949
+ *
2950
+ * @returns {boolean} - boolean.
2951
+ */
2952
+ shouldProceedToElementChildren() {
2953
+ return true;
2954
+ }
2955
+ }
2956
+
2957
+ /** Transform child element of UL element which are not LI element to list item block DTO */
2958
+ class ULNotLiChildToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
2959
+ /**
2960
+ * Can be handle.
2961
+ *
2962
+ * @param {HTMLElement[]} elementsArray - Current elements.
2963
+ * @param {number} currentIndex - Current element index.
2964
+ * @returns {number} - can be handled element count.
2965
+ */
2966
+ canHandle(elementsArray, currentIndex) {
2967
+ const element = elementsArray[currentIndex];
2968
+ const parent = element.parentElement;
2969
+ const isLiNode = element.nodeName !== 'LI';
2970
+ // while child is empty text node like newline or empty string, we should not covert it.
2971
+ const isEmptyNode = element.nodeType === Node.TEXT_NODE && element.textContent.trim() === '';
2972
+ // The node must be in list item.
2973
+ const isInList = typeGuard.isNonNullable(parent) && ['UL', 'OL'].includes(parent.nodeName);
2974
+ return isLiNode && !isEmptyNode && isInList ? 1 : 0;
2975
+ }
2976
+ /**
2977
+ * Parse to a list item block.
2978
+ *
2979
+ * @param {HTMLElement[]} elementsArray - Current elements.
2980
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
2981
+ * @returns {Nullable<RTEContentBlock>} - List item block.
2982
+ */
2983
+ handle(elementsArray, options) {
2984
+ const nodes = this.generateChildNodes(elementsArray, {}, options);
2985
+ return RTEListItemBlock.from({
2986
+ id: misc.generateUUID(),
2987
+ type: 'list-item',
2988
+ nodes: nodes,
2989
+ annotations: {},
2990
+ }, options);
2991
+ }
2992
+ /* istanbul ignore next */
2993
+ /**
2994
+ * Append child blocks.
2995
+ */
2996
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2997
+ appendChildBlocks() { }
2998
+ /**
2999
+ * Should continue process to child elements.
3000
+ *
3001
+ * @returns {boolean} - boolean.
3002
+ */
3003
+ shouldProceedToElementChildren() {
3004
+ return false;
3005
+ }
3006
+ }
3007
+
3008
+ /** Transform li element to list item block DTO */
3009
+ class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
3010
+ /**
3011
+ * Can be handled.
3012
+ *
3013
+ * @param {HTMLElement[]} elementsArray - Current elements.
3014
+ * @param {number} currentIndex - Current element index.
3015
+ * @returns {number} - can be handled element count.
3016
+ */
3017
+ canHandle(elementsArray, currentIndex) {
3018
+ const parent = elementsArray[currentIndex].parentElement;
3019
+ if (!['UL', 'OL'].includes(parent.nodeName) &&
3020
+ elementsArray.some((element) => element.nodeName === 'LI')) {
3021
+ let count = 0;
3022
+ for (let i = currentIndex; i < elementsArray.length; i++) {
3023
+ if (elementsArray[i].nodeName === 'LI') {
3024
+ count++;
3025
+ }
3026
+ else {
3027
+ break;
3028
+ }
3029
+ }
3030
+ return count;
3031
+ }
3032
+ return elementsArray[currentIndex].tagName === 'LI' ? 1 : 0;
3033
+ }
3034
+ /**
3035
+ * Parse to a list item block.
3036
+ *
3037
+ * @param {HTMLElement[]} elementsArray - Current elements.
3038
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
3039
+ * @returns {Nullable<RTEContentBlock>} - List item block.
3040
+ */
3041
+ handle(elementsArray, options) {
3042
+ const firstElement = elementsArray[0];
3043
+ const parent = firstElement.parentElement;
3044
+ if (!['UL', 'OL'].includes(parent.nodeName)) {
3045
+ return this.generateWithListBlock(elementsArray, options);
3046
+ }
3047
+ return RTEListItemBlock.from(this.generateListItemBlockDTO(firstElement, options), options);
3048
+ }
3049
+ /**
3050
+ * Append child list blocks to current list item block.
3051
+ *
3052
+ * @param {RTEListBlock} currentBlock - Current list item block.
3053
+ * @param {RTEListItemBlock[]} childBlocks - Current list blocks.
3054
+ */
3055
+ appendChildBlocks(currentBlock, childBlocks) {
3056
+ currentBlock.nestList = childBlocks.filter((block) => ['bullet-list', 'number-list'].includes(block.type));
3057
+ }
3058
+ /**
3059
+ * Should continue process to child elements.
3060
+ *
3061
+ * @returns {boolean} - boolean.
3062
+ */
3063
+ shouldProceedToElementChildren() {
3064
+ return true;
3065
+ }
3066
+ /**
3067
+ * Generate list block from a list of HTML elements.
3068
+ *
3069
+ * @param {HTMLElement[]} elements - List of HTML elements to convert.
3070
+ * @param {VegaRTETransformOptions} options - Options for transformation.
3071
+ * @returns {RTEListBlock} - List block DTO.
3072
+ */
3073
+ generateWithListBlock(elements, options) {
3074
+ return RTEListBlock.from({
3075
+ id: misc.generateUUID(),
3076
+ type: 'bullet-list',
3077
+ blocks: elements.map((item) => {
3078
+ return this.generateListItemBlockDTO(item, options);
3079
+ }),
3080
+ }, options);
3081
+ }
3082
+ /**
3083
+ * Generate list item block DTO from an HTML element.
3084
+ *
3085
+ * @param {HTMLElement} element - HTML element to convert.
3086
+ * @param {VegaRTETransformOptions} options - Options for transformation.
3087
+ * @returns {VegaRTEListItemBlock} - List item block DTO.
3088
+ */
3089
+ generateListItemBlockDTO(element, options) {
3090
+ return {
3091
+ id: misc.generateUUID(),
3092
+ type: 'list-item',
3093
+ annotations: htmlElementToAnnotationGenerator.generate(RTEListItemBlock, element, options),
3094
+ nodes: this.generateChildNodes(Array.from(element.childNodes.length ? element.childNodes : [element]).filter((item) => {
3095
+ return !['UL', 'OL'].includes(item.nodeName);
3096
+ }), htmlElementToAnnotationGenerator.generate(codeBlock.RTETextNode, element, Object.assign(Object.assign({}, options), { skipCustomAnnotations: true })), options),
3097
+ };
3098
+ }
3099
+ }
3100
+
3101
+ /** Transform other editor code element which has attribute data-language to RTE code block DTO */
3102
+ class JiraCodeToRTECodeBlockStrategy extends BlockToRTEBlockStrategyAbstract {
3103
+ /**
3104
+ * Can be handle.
3105
+ *
3106
+ * @param {HTMLElement[]} elementsArray - Current elements.
3107
+ * @param {number} currentIndex - Current element index.
3108
+ * @returns {number} - can be handled element count.
3109
+ */
3110
+ canHandle(elementsArray, currentIndex) {
3111
+ return (elementsArray[currentIndex].tagName === 'PRE' ||
3112
+ elementsArray[currentIndex].tagName === 'CODE') &&
3113
+ elementsArray[currentIndex].hasAttribute('data-language')
3114
+ ? 1
3115
+ : 0;
3116
+ }
3117
+ /**
3118
+ * Parse to a code block.
3119
+ *
3120
+ * @param {HTMLElement[]} elementsArray - Current elements.
3121
+ * @returns {Nullable<RTECodeBlock>} - Code block.
3122
+ */
3123
+ handle(elementsArray) {
3124
+ const codeRef = elementsArray[0];
3125
+ if (codeRef) {
3126
+ const content = codeRef.textContent;
3127
+ const language = codeRef.dataset
3128
+ .language;
3129
+ return codeBlock.RTECodeBlock.from({
3130
+ id: misc.generateUUID(),
3131
+ type: 'code-block',
3132
+ content,
3133
+ language,
3134
+ });
3135
+ }
3136
+ }
3137
+ /* istanbul ignore next */
3138
+ /**
3139
+ * Append child blocks.
3140
+ */
3141
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3142
+ appendChildBlocks() { }
3143
+ /**
3144
+ * Should continue process to child elements.
3145
+ *
3146
+ * @returns {boolean} - boolean.
3147
+ */
3148
+ shouldProceedToElementChildren() {
3149
+ return false;
3150
+ }
3151
+ }
3152
+
3153
+ /** Transform vega-code-block element to code block DTO */
3154
+ class VegaCodeBlockToRTECodeBlockStrategy extends JiraCodeToRTECodeBlockStrategy {
3155
+ /**
3156
+ * Can be handle.
3157
+ *
3158
+ * TODO: Update the browser clipboard data to fix the issue with nested vega-code-block elements.
3159
+ * In safari the html snippet will be like: <vega-code-block><p><span>paragraph</span></p><vega-code-block></vega-code-block></vega-code-block>
3160
+ * The vega-code-block nested inside the vega-code-block, so we need to check the child element.
3161
+ *
3162
+ * @param {HTMLElement[]} elementsArray - Current elements.
3163
+ * @param {number} currentIndex - Current element index.
3164
+ * @returns {number} - can be handled element count.
3165
+ */
3166
+ canHandle(elementsArray, currentIndex) {
3167
+ return (elementsArray[currentIndex].tagName === 'VEGA-CODE-BLOCK' &&
3168
+ !!elementsArray[currentIndex].querySelector('vega-code-block') === false) ||
3169
+ this.isCodeBlockContainer(elementsArray[currentIndex])
3170
+ ? 1
3171
+ : 0;
3172
+ }
3173
+ /**
3174
+ * Parse to a code block.
3175
+ *
3176
+ * @param {HTMLElement[]} elementsArray - Current elements.
3177
+ * @returns {Nullable<RTECodeBlock>} - Code block.
3178
+ */
3179
+ handle(elementsArray) {
3180
+ const codeBlockElement = this.isCodeBlockContainer(elementsArray[0])
3181
+ ? elementsArray[0].querySelector('vega-code-block')
3182
+ : elementsArray[0];
3183
+ const code = codeBlockElement.querySelector('code');
3184
+ if (code) {
3185
+ return super.handle([code]); // Call the parent method to handle the code element
3186
+ }
3187
+ else if (codeBlockElement.hasAttribute('data-content')) {
3188
+ // The code element in shadow dom could be empty in firefox.
3189
+ // eslint-disable-next-line no-restricted-globals
3190
+ const code = document.createElement('code');
3191
+ code.textContent = codeBlockElement.dataset.content;
3192
+ code.dataset.language = codeBlockElement.dataset.language;
3193
+ return super.handle([code]); // Call the parent method to handle the code element
3194
+ }
3195
+ }
3196
+ /* istanbul ignore next */
3197
+ /**
3198
+ * Append child blocks.
3199
+ */
3200
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3201
+ appendChildBlocks() { }
3202
+ /**
3203
+ * Should continue process to child elements.
3204
+ *
3205
+ * @returns {boolean} - boolean.
3206
+ */
3207
+ shouldProceedToElementChildren() {
3208
+ return false;
3209
+ }
3210
+ /**
3211
+ * Checks if the given element is a code block container.
3212
+ *
3213
+ * @param {HTMLElement} element - The element to check.
3214
+ * @returns {boolean} - Boolean result.
3215
+ */
3216
+ isCodeBlockContainer(element) {
3217
+ return (element.tagName === 'PRE' &&
3218
+ element.classList.contains('code-block-container') &&
3219
+ element.querySelectorAll('vega-code-block').length === 1);
3220
+ }
3221
+ }
3222
+
3223
+ /** Transform inline block element to text block DTO */
3224
+ class InlineBlockToRTETextBlockStrategy extends BlockToRTEBlockStrategyAbstract {
3225
+ /**
3226
+ * Can be handle.
3227
+ *
3228
+ * @param {HTMLElement[]} elementsArray - Current elements.
3229
+ * @param {number} currentIndex - Current element index.
3230
+ * @returns {number} - can be handled element count.
3231
+ */
3232
+ canHandle(elementsArray, currentIndex) {
3233
+ return [
3234
+ 'heading-1',
3235
+ 'heading-2',
3236
+ 'heading-3',
3237
+ 'heading-4',
3238
+ 'heading-5',
3239
+ 'heading-6',
3240
+ 'title',
3241
+ 'subtitle',
3242
+ ].includes(super.matchTextBlockType(elementsArray[currentIndex]))
3243
+ ? 1
3244
+ : 0;
3245
+ }
3246
+ /**
3247
+ * Parse to a text block.
3248
+ *
3249
+ * @param {HTMLElement[]} elementsArray - Current elements.
3250
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
3251
+ * @returns {Nullable<RTEContentBlock>} - Text block.
3252
+ */
3253
+ handle(elementsArray, options) {
3254
+ const nodes = this.generateChildNodes(Array.from(elementsArray[0].childNodes), {}, options);
3255
+ if (nodes.length === 0)
3256
+ return null;
3257
+ return codeBlock.RTETextBlock.from({
3258
+ id: misc.generateUUID(),
3259
+ type: super.matchTextBlockType(elementsArray[0]),
3260
+ nodes: nodes,
3261
+ annotations: htmlElementToAnnotationGenerator.generate(codeBlock.RTETextBlock, elementsArray[0], options),
3262
+ }, options);
3263
+ }
3264
+ /* istanbul ignore next */
3265
+ /**
3266
+ * Append child blocks.
3267
+ */
3268
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3269
+ appendChildBlocks() { }
3270
+ /**
3271
+ * Should continue process to child elements.
3272
+ *
3273
+ * @returns {boolean} - boolean.
3274
+ */
3275
+ shouldProceedToElementChildren() {
3276
+ return false;
3277
+ }
3278
+ }
3279
+
3280
+ /** Abstract class for block html element to RTE block dto */
3281
+ class ElementToRTEImageBlockStrategyAbstract extends BlockToRTEBlockStrategyAbstract {
3282
+ /**
3283
+ * Create a RTE Image block according to the img element.
3284
+ *
3285
+ * @param {HTMLElement} element - current element.
3286
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
3287
+ * @returns {RTEImageBlock} -RTE Image block.
3288
+ */
3289
+ createRTEImageBlock(element, options) {
3290
+ // RTEImageBlock is also wrapped by a div, should not as internal wrapper if the parent is a div.
3291
+ const isInternalWrapper = !(options && options.autoMatchFormat) &&
3292
+ !!(element.parentNode && element.parentNode.nodeName !== 'DIV');
3293
+ return RTEImageBlock.from({
3294
+ id: misc.generateUUID(),
3295
+ type: 'image',
3296
+ nodes: [
3297
+ {
3298
+ id: misc.generateUUID(),
3299
+ type: 'image',
3300
+ url: element.src,
3301
+ annotations: htmlElementToAnnotationGenerator.generate(RTEImageNode, element, options),
3302
+ },
3303
+ ],
3304
+ annotations: Object.assign(Object.assign({}, htmlElementToAnnotationGenerator.generate(RTEImageBlock, element.parentElement, options)), { internalWrapper: isInternalWrapper }),
3305
+ }, options);
3306
+ }
3307
+ }
3308
+
3309
+ /** Transform img element to image block DTO */
3310
+ class ImgToRTEImageBlockStrategy extends ElementToRTEImageBlockStrategyAbstract {
3311
+ /**
3312
+ * Can be handle.
3313
+ *
3314
+ * @param {HTMLElement[]} elementsArray - Current elements.
3315
+ * @param {number} currentIndex - Current element index.
3316
+ * @returns {number} - can be handled element count.
3317
+ */
3318
+ canHandle(elementsArray, currentIndex) {
3319
+ return elementsArray[currentIndex].tagName === 'IMG' ? 1 : 0;
3320
+ }
3321
+ /**
3322
+ * Parse to a image block.
3323
+ *
3324
+ * @param {HTMLElement[]} elementsArray - Current elements.
3325
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
3326
+ * @returns {Nullable<RTEContentBlock>} - Image block.
3327
+ */
3328
+ handle(elementsArray, options) {
3329
+ const element = elementsArray[0];
3330
+ return this.createRTEImageBlock(element, options);
3331
+ }
3332
+ /* istanbul ignore next */
3333
+ /**
3334
+ * Append child blocks.
3335
+ */
3336
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3337
+ appendChildBlocks() { }
3338
+ /**
3339
+ * Should continue process to child elements.
3340
+ *
3341
+ * @returns {boolean} - boolean.
3342
+ */
3343
+ shouldProceedToElementChildren() {
3344
+ return false;
3345
+ }
3346
+ }
3347
+
3348
+ /** Transform vega-rich-text-image-editor element to image block DTO */
3349
+ class VegaImageToRTEImageBlockStrategy extends ElementToRTEImageBlockStrategyAbstract {
3350
+ /**
3351
+ * Can be handle.
3352
+ *
3353
+ * @param {HTMLElement[]} elementsArray - Current elements.
3354
+ * @param {number} currentIndex - Current element index.
3355
+ * @returns {number} - can be handled element count.
3356
+ */
3357
+ canHandle(elementsArray, currentIndex) {
3358
+ return elementsArray[currentIndex].tagName === 'VEGA-RICH-TEXT-IMAGE-EDITOR' ? 1 : 0;
3359
+ }
3360
+ /**
3361
+ * Parse to a image block.
3362
+ *
3363
+ * @param {HTMLElement[]} elementsArray - Current elements.
3364
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
3365
+ * @returns {Nullable<RTEContentBlock>} - Image block.
3366
+ */
3367
+ handle(elementsArray, options) {
3368
+ const element = elementsArray[0];
3369
+ const image = element.querySelector('img');
3370
+ if (typeGuard.isNonNullable(image)) {
3371
+ return RTEImageBlock.from({
3372
+ id: misc.generateUUID(),
3373
+ type: 'image',
3374
+ nodes: [
3375
+ {
3376
+ id: misc.generateUUID(),
3377
+ type: 'image',
3378
+ url: image.src,
3379
+ annotations: htmlElementToAnnotationGenerator.generate(RTEImageNode, element, options),
3380
+ },
3381
+ ],
3382
+ annotations: htmlElementToAnnotationGenerator.generate(RTEImageBlock, element.parentElement, options),
3383
+ }, options);
3384
+ }
3385
+ }
3386
+ /* istanbul ignore next */
3387
+ /**
3388
+ * Append child blocks.
3389
+ */
3390
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3391
+ appendChildBlocks() { }
3392
+ /**
3393
+ * Should continue process to child elements.
3394
+ *
3395
+ * @returns {boolean} - boolean.
3396
+ */
3397
+ shouldProceedToElementChildren() {
3398
+ return false;
3399
+ }
3400
+ }
3401
+
3402
+ /** Transform img in span or other inline element to image block DTO */
3403
+ class SpanImageToRTEImageBlockStrategy extends ElementToRTEImageBlockStrategyAbstract {
3404
+ /**
3405
+ * Can be handle.
3406
+ *
3407
+ * @param {HTMLElement[]} elementsArray - Current elements.
3408
+ * @param {number} currentIndex - Current element index.
3409
+ * @returns {number} - can be handled element count.
3410
+ */
3411
+ canHandle(elementsArray, currentIndex) {
3412
+ const element = elementsArray[currentIndex];
3413
+ return element.nodeType === Node.ELEMENT_NODE &&
3414
+ element.textContent === '' &&
3415
+ element.querySelector('img')
3416
+ ? 1
3417
+ : 0;
3418
+ }
3419
+ /**
3420
+ * Parse to a image block.
3421
+ *
3422
+ * @param {HTMLElement[]} elementsArray - Current elements.
3423
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
3424
+ * @returns {Nullable<RTEContentBlock>} - Image block.
3425
+ */
3426
+ handle(elementsArray, options) {
3427
+ const element = elementsArray[0].querySelector('img');
3428
+ return this.createRTEImageBlock(element, options);
3429
+ }
3430
+ /* istanbul ignore next */
3431
+ /**
3432
+ * Append child blocks.
3433
+ */
3434
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3435
+ appendChildBlocks() { }
3436
+ /**
3437
+ * Should continue process to child elements.
3438
+ *
3439
+ * @returns {boolean} - boolean.
3440
+ */
3441
+ shouldProceedToElementChildren() {
3442
+ return false;
3443
+ }
3444
+ }
3445
+
3446
+ /** Transform continue inline block elements to text block DTO */
3447
+ class ContinueInlineToRTETextBlockStrategy extends BlockToRTEBlockStrategyAbstract {
3448
+ /**
3449
+ * Can be handle.
3450
+ *
3451
+ * @param {HTMLElement[]} elementsArray - Current elements.
3452
+ * @param {number} currentIndex - Current element index.
3453
+ * @returns {number} - can be handled element count.
3454
+ */
3455
+ canHandle(elementsArray, currentIndex) {
3456
+ let count = 0;
3457
+ for (let i = currentIndex; i < elementsArray.length; i++) {
3458
+ const element = elementsArray[i];
3459
+ if (element.nodeType === Node.TEXT_NODE ||
3460
+ (ContinueInlineToRTETextBlockStrategy.canHandleTags.includes(element.nodeName) &&
3461
+ !(element.textContent === '' && element.querySelector('IMG')))) {
3462
+ count++;
3463
+ }
3464
+ else {
3465
+ break;
3466
+ }
3467
+ }
3468
+ return count;
3469
+ }
3470
+ /**
3471
+ * Parse to a text block.
3472
+ *
3473
+ * @param {HTMLElement[]} elementsArray - Current elements.
3474
+ * @param {VegaRTETransformOptions} [options] - Options for transformation.
3475
+ * @returns {Nullable<RTEContentBlock>} - Text block.
3476
+ */
3477
+ handle(elementsArray, options) {
3478
+ const parent = elementsArray[0].parentElement;
3479
+ const autoMatchFormat = options && options.autoMatchFormat;
3480
+ const nodes = this.generateChildNodes(elementsArray, autoMatchFormat
3481
+ ? htmlElementToAnnotationGenerator.generate(codeBlock.RTETextNode, parent, Object.assign(Object.assign({}, options), { skipCustomAnnotations: true }))
3482
+ : {}, options);
3483
+ const blockType = autoMatchFormat
3484
+ ? super.matchTextBlockType(parent)
3485
+ : this.matchTextBlockTypeByTagName(parent);
3486
+ const internalWrapper = !autoMatchFormat && !blockType;
3487
+ return codeBlock.RTETextBlock.from(Object.assign({ id: misc.generateUUID(), type: blockType || 'paragraph', nodes: nodes }, (internalWrapper
3488
+ ? { annotations: { internalWrapper: internalWrapper } }
3489
+ : {
3490
+ annotations: htmlElementToAnnotationGenerator.generate(codeBlock.RTETextBlock, parent, options),
3491
+ })), options);
3492
+ }
3493
+ /* istanbul ignore next */
3494
+ /**
3495
+ * Append child blocks.
3496
+ */
3497
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3498
+ appendChildBlocks() { }
3499
+ /**
3500
+ * Should continue process to child elements.
3501
+ *
3502
+ * @returns {boolean} - boolean.
3503
+ */
3504
+ shouldProceedToElementChildren() {
3505
+ return false;
3506
+ }
3507
+ /**
3508
+ * Match the block type by tag name.
3509
+ *
3510
+ * @param {HTMLElement} element - Target element.
3511
+ * @returns {Nullable<VegaRTETextBlockType>} - Block type.
3512
+ */
3513
+ matchTextBlockTypeByTagName(element) {
3514
+ switch (element.nodeName) {
3515
+ case 'P':
3516
+ return 'paragraph';
3517
+ default:
3518
+ return null;
3519
+ }
3520
+ }
3521
+ }
3522
+ ContinueInlineToRTETextBlockStrategy.canHandleTags = [
3523
+ ...InlineHtmlAnnotationHandler.canHandleTags,
3524
+ 'CODE',
3525
+ 'A',
3526
+ 'VEGA-RICH-TEXT-LINK-EDITOR',
3527
+ 'BR',
3528
+ ];
3529
+
3530
+ /**
3531
+ * Class to handle text node elements and convert them to text node DTOs
3532
+ */
3533
+ class ElementToTextNodeStrategy extends ElementToDTOStrategy {
3534
+ /**
3535
+ * @inheritDoc
3536
+ */
3537
+ shouldProceedToElementChildren() {
3538
+ return false;
3539
+ }
3540
+ /**
3541
+ * @inheritDoc
3542
+ */
3543
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3544
+ appendChildBlocks() { }
3545
+ /**
3546
+ * Generate text node DTO object
3547
+ *
3548
+ * @param {string} text - text content.
3549
+ * @param {VegaRTETextAnnotations} annotations - Current annotations.
3550
+ * @returns {VegaRTETextNode} - Text node DTO.
3551
+ */
3552
+ generateTextNode(text, annotations) {
3553
+ return {
3554
+ id: misc.generateUUID(),
3555
+ type: 'text',
3556
+ text: text,
3557
+ annotations: annotations,
3558
+ };
3559
+ }
3560
+ }
3561
+
3562
+ /**
3563
+ * Class to handle plain text nodes and convert them to RTE text node DTOs
3564
+ */
3565
+ class PlainTextToTextNodeStrategy extends ElementToTextNodeStrategy {
3566
+ /**
3567
+ * @inheritDoc
3568
+ */
3569
+ canHandle(elementsArray, currentIndex) {
3570
+ const element = elementsArray[currentIndex];
3571
+ return element.nodeType === Node.TEXT_NODE ? 1 : 0;
3572
+ }
3573
+ /**
3574
+ * @inheritDoc
3575
+ */
3576
+ handle(elementsArray, options, parentTextAnnotations) {
3577
+ const parentAnnotations = Object.assign({}, parentTextAnnotations);
3578
+ const disableAutoMatchFormat = !!(options && options.autoMatchFormat === false);
3579
+ const child = elementsArray[0];
3580
+ const parentNodeName = child.parentNode.nodeName.toLowerCase();
3581
+ const plainText = disableAutoMatchFormat && !codeBlock.RTETextNode.supportsHtmlTag(parentNodeName);
3582
+ const textNode = this.generateTextNode(String(child.textContent), disableAutoMatchFormat
3583
+ ? object.cleanObject(Object.assign(Object.assign({}, (parentNodeName === 'span'
3584
+ ? parentAnnotations
3585
+ : {
3586
+ // text node could be wrapped in <a> tag, so we need to keep the parent link annotation
3587
+ link: parentAnnotations.link,
3588
+ code: parentNodeName === 'code' ? parentAnnotations.code : undefined,
3589
+ })), { inlineHtml: parentAnnotations.inlineHtml, plainText: plainText || undefined }))
3590
+ : parentAnnotations);
3591
+ return Object.assign({}, textNode);
3592
+ }
3593
+ }
3594
+
3595
+ /**
3596
+ * Class to handle inline html element to text node dto
3597
+ */
3598
+ class InlineElementToTextNodeStrategy extends ElementToTextNodeStrategy {
3599
+ /**
3600
+ * @inheritDoc
3601
+ */
3602
+ canHandle(elementsArray, currentIndex) {
3603
+ const element = elementsArray[currentIndex];
3604
+ return ui.isHTMLElement(element) && (element.nodeName === 'BR' || element.childNodes.length === 0)
3605
+ ? 1
3606
+ : 0;
3607
+ }
3608
+ /**
3609
+ * @inheritDoc
3610
+ */
3611
+ handle(elementsArray, options, annotations) {
3612
+ const disableAutoMatchFormat = !!(options && options.autoMatchFormat === false);
3613
+ const parentAnnotations = Object.assign({}, annotations);
3614
+ const child = elementsArray[0];
3615
+ const curAnnotations = htmlElementToAnnotationGenerator.generate(codeBlock.RTETextNode, child, Object.assign({ parentAnnotations: disableAutoMatchFormat
3616
+ ? {
3617
+ inlineHtml: parentAnnotations.inlineHtml,
3618
+ link: parentAnnotations.link,
3619
+ code: parentAnnotations.code,
3620
+ }
3621
+ : annotations }, options));
3622
+ if (child.nodeName === 'BR') {
3623
+ return this.generateTextNode('\n', curAnnotations);
3624
+ }
3625
+ else if (child.childNodes.length === 0) {
3626
+ // For empty dom, there will be no internal iteration, we need to handle it directly here.
3627
+ // Example: <span></span>, <video src='...'></video>
3628
+ const emptyNodeAnnotations = disableAutoMatchFormat
3629
+ ? object.cleanObject(Object.assign(Object.assign({}, (codeBlock.RTETextNode.supportsHtmlTag(child.nodeName.toLowerCase()) ? curAnnotations : {})), { inlineHtml: curAnnotations.inlineHtml, plainText: typeGuard.isNonNullable(curAnnotations.inlineHtml) }))
3630
+ : curAnnotations;
3631
+ return Object.assign({}, this.generateTextNode('', emptyNodeAnnotations));
3632
+ }
3633
+ }
3634
+ }
3635
+
3636
+ /**
3637
+ * Abstract strategy class for filtering default styles in the rich text editor.
3638
+ * Concrete strategies define which styles to strip via `stylesToBeFiltered`.
3639
+ *
3640
+ * This base is shared by two kinds of concrete strategies:
3641
+ * 1. Block/node output strategies – filter inline styles when converting DTO → HTML.
3642
+ * 2. Annotation parsing strategies – strip redundant defaults when converting HTML → DTO.
3643
+ */
3644
+ class RTEFilterStylesStrategy {
3645
+ /**
3646
+ * Whether this strategy should always filter, regardless of `autoMatchFormat`.
3647
+ * Override to `true` when the filtered styles are always emitted as inline
3648
+ * styles by the DTO (e.g. image `vertical-align`), so stripping them from
3649
+ * `customStyle` is always safe.
3650
+ *
3651
+ * Defaults to `false` – the strategy only runs when `autoMatchFormat` is enabled.
3652
+ *
3653
+ * @returns {boolean} Whether filtering should always apply.
3654
+ */
3655
+ get alwaysFilter() {
3656
+ return false;
3657
+ }
3658
+ /**
3659
+ * Removes matched default styles from the `customStyle` property of the given annotations object.
3660
+ * If all custom styles are defaults, the `customStyle` key is deleted entirely.
3661
+ *
3662
+ * @param {VegaRTEAnnotations} annotations - The annotations object (mutated in place).
3663
+ * @returns {VegaRTEAnnotations} The same annotations reference.
3664
+ */
3665
+ filterAnnotations(annotations) {
3666
+ const customStyle = annotations.customStyle;
3667
+ if (!customStyle) {
3668
+ return annotations;
3669
+ }
3670
+ this.extractAndDeleteMatchedStyles(customStyle);
3671
+ if (Object.keys(customStyle).length === 0) {
3672
+ delete annotations.customStyle;
3673
+ }
3674
+ return annotations;
3675
+ }
3676
+ /**
3677
+ * Removes configured default style properties from the target styles object.
3678
+ * Only properties whose value matches the configured default exactly are deleted.
3679
+ *
3680
+ * @param {Nullable<RTEFilterStyles>} styles - The styles object to mutate.
3681
+ * @returns {boolean} `true` if at least one style was extracted.
3682
+ */
3683
+ extractAndDeleteMatchedStyles(styles) {
3684
+ let wasExtracted = false;
3685
+ if (styles) {
3686
+ const defaults = this.stylesToBeFiltered;
3687
+ const styleKeys = Object.keys(defaults);
3688
+ for (const key of styleKeys) {
3689
+ if (styles[key] === defaults[key]) {
3690
+ delete styles[key];
3691
+ wasExtracted = true;
3692
+ }
3693
+ }
3694
+ }
3695
+ return wasExtracted;
3696
+ }
3697
+ }
3698
+
3699
+ /**
3700
+ * Filters the default ImageAnnotation base styles (verticalAlign) from
3701
+ * customStyle when parsing an RTEImageNode.
3702
+ */
3703
+ class ImageFilterStylesStrategy extends RTEFilterStylesStrategy {
3704
+ constructor() {
3705
+ super(...arguments);
3706
+ this.stylesToBeFiltered = ImageAnnotation.getDefaultStyles();
3707
+ }
3708
+ /** @returns {boolean} Always `true` — image defaults are emitted as inline styles. */
3709
+ get alwaysFilter() {
3710
+ return true;
3711
+ }
3712
+ }
3713
+
3714
+ /**
3715
+ * Filters the default ListAnnotation styles (paddingLeft, marginLeft) from
3716
+ * customStyle when parsing an RTEListBlock.
3717
+ */
3718
+ class ListBlockFilterStylesStrategy extends RTEFilterStylesStrategy {
3719
+ constructor() {
3720
+ super(...arguments);
3721
+ this.stylesToBeFiltered = ListAnnotation.getDefaultStyles();
3722
+ }
3723
+ }
3724
+
3725
+ /**
3726
+ * Filters the default paragraph styles from customStyle when parsing an
3727
+ * RTEListItemBlock. List-item blocks implicitly use paragraph styling,
3728
+ * so these inline defaults are redundant and should not be persisted.
3729
+ */
3730
+ class ListItemBlockFilterStylesStrategy extends RTEFilterStylesStrategy {
3731
+ constructor() {
3732
+ super(...arguments);
3733
+ this.stylesToBeFiltered = codeBlock.TextStyleAnnotation.getDefaultStyles('paragraph') || {};
3734
+ }
3735
+ }
3736
+
3737
+ /**
3738
+ * Filters redundant `textAlign` from `customStyle` when parsing blocks that carry
3739
+ * a semantic `textAlign` annotation (RTETextBlock, RTEListBlock, RTEListItemBlock).
3740
+ *
3741
+ * During source-to-normal round-trips the `HorizontalAlignmentAnnotation` emits
3742
+ * `text-align` as an inline style (standalone mode), and `CustomStyleAnnotationHandler`
3743
+ * captures it into `customStyle`. This strategy removes the duplicate so the
3744
+ * semantic annotation is the single source of truth.
3745
+ */
3746
+ class AlignmentFilterStylesStrategy extends RTEFilterStylesStrategy {
3747
+ constructor() {
3748
+ super(...arguments);
3749
+ this.stylesToBeFiltered = {};
3750
+ }
3751
+ /**
3752
+ * @returns {boolean} Always `true` — alignment inline styles are always emitted
3753
+ * in standalone/source-edit mode, so the duplicate is always safe to remove.
3754
+ */
3755
+ get alwaysFilter() {
3756
+ return true;
3757
+ }
3758
+ /**
3759
+ * Removes `textAlign` from `customStyle` when it duplicates the value returned
3760
+ * by `HorizontalAlignmentAnnotation.getDefaultStyles(textAlign)`.
3761
+ *
3762
+ * @param {VegaRTEAnnotations} annotations - The annotations object (mutated in place).
3763
+ * @returns {VegaRTEAnnotations} The same annotations reference.
3764
+ */
3765
+ filterAnnotations(annotations) {
3766
+ const { textAlign, customStyle } = annotations;
3767
+ if (!textAlign || !customStyle) {
3768
+ return annotations;
3769
+ }
3770
+ this.stylesToBeFiltered = codeBlock.HorizontalAlignmentAnnotation.getDefaultStyles(textAlign);
3771
+ return super.filterAnnotations(annotations);
3772
+ }
3773
+ }
3774
+
3775
+ /**
3776
+ * Filters the default CodeAnnotation styles (fontFamily, whiteSpace) from
3777
+ * customStyle when parsing an RTETextNode that has a `code` annotation.
3778
+ */
3779
+ class CodeFilterStylesStrategy extends RTEFilterStylesStrategy {
3780
+ constructor() {
3781
+ super(...arguments);
3782
+ this.stylesToBeFiltered = codeBlock.CodeAnnotation.getDefaultStyles();
3783
+ }
3784
+ /**
3785
+ * Only strips code-default styles when the `code` annotation is present,
3786
+ * so that a user-applied `fontFamily: 'Roboto Mono'` without code is preserved.
3787
+ *
3788
+ * @param {VegaRTEAnnotations} annotations - The annotations object (mutated in place).
3789
+ * @returns {VegaRTEAnnotations} The same annotations reference.
3790
+ */
3791
+ filterAnnotations(annotations) {
3792
+ const { code, customStyle } = annotations;
3793
+ if (!code || !customStyle) {
3794
+ return annotations;
3795
+ }
3796
+ return super.filterAnnotations(annotations);
3797
+ }
3798
+ }
3799
+
3800
+ /**
3801
+ * Filters the default internal link styles (color) from `link.customStyle` when
3802
+ * parsing an RTETextNode. Vega applies these styles during standalone rendering;
3803
+ * they are redundant when parsed back and must not be persisted as custom overrides.
3804
+ */
3805
+ class LinkFilterStylesStrategy extends RTEFilterStylesStrategy {
3806
+ constructor() {
3807
+ super(...arguments);
3808
+ this.stylesToBeFiltered = codeBlock.LinkGroupAnnotation.getDefaultStyles();
3809
+ }
3810
+ /**
3811
+ * Filter default link styles from `link.customStyle` in annotations.
3812
+ *
3813
+ * @param {VegaRTEAnnotations} annotations - The annotations to filter.
3814
+ * @returns {VegaRTEAnnotations} The same annotations reference with link.customStyle cleaned up.
3815
+ */
3816
+ filterAnnotations(annotations) {
3817
+ const link = annotations.link;
3818
+ if (!(link === null || link === void 0 ? void 0 : link.customStyle)) {
3819
+ return annotations;
3820
+ }
3821
+ this.extractAndDeleteMatchedStyles(link.customStyle);
3822
+ if (Object.keys(link.customStyle).length === 0) {
3823
+ delete link.customStyle;
3824
+ }
3825
+ return annotations;
3826
+ }
3827
+ }
3828
+
3829
+ /**
3830
+ * Filters redundant inline text formatting styles from `customStyle` when
3831
+ * parsing an RTETextNode. These styles are already represented by semantic
3832
+ * annotations and should not be persisted as custom overrides after source
3833
+ * edit round-trips.
3834
+ */
3835
+ class TextFormatFilterStylesStrategy extends RTEFilterStylesStrategy {
3836
+ constructor() {
3837
+ super(...arguments);
3838
+ this.stylesToBeFiltered = {};
3839
+ }
3840
+ /**
3841
+ * @returns {boolean} Always `true` — this strategy runs regardless of `autoMatchFormat`.
3842
+ */
3843
+ get alwaysFilter() {
3844
+ return true;
3845
+ }
3846
+ /**
3847
+ * Filter redundant text format styles from `customStyle`.
3848
+ *
3849
+ * @param {VegaRTEAnnotations} annotations - The annotations to filter.
3850
+ * @returns {VegaRTEAnnotations} The same annotations reference with customStyle cleaned up.
3851
+ */
3852
+ filterAnnotations(annotations) {
3853
+ const textAnnotations = annotations;
3854
+ const customStyle = textAnnotations.customStyle;
3855
+ if (!customStyle) {
3856
+ return annotations;
3857
+ }
3858
+ // Only delete styles that match the default values(BOLD_FONT_WEIGHT) to avoid affecting normal-source conversion.
3859
+ if (textAnnotations.bold && customStyle.fontWeight === codeBlock.BOLD_FONT_WEIGHT) {
3860
+ delete customStyle.fontWeight;
3861
+ }
3862
+ if (textAnnotations.italic && customStyle.fontStyle === codeBlock.ITALIC_FONT_STYLE) {
3863
+ delete customStyle.fontStyle;
3864
+ }
3865
+ const normalizedTextDecoration = this.normalizeTextDecoration(customStyle.textDecoration);
3866
+ if (normalizedTextDecoration &&
3867
+ this.shouldRemoveTextDecoration(normalizedTextDecoration, textAnnotations)) {
3868
+ delete customStyle.textDecoration;
3869
+ }
3870
+ if (Object.keys(customStyle).length === 0) {
3871
+ delete textAnnotations.customStyle;
3872
+ }
3873
+ return annotations;
3874
+ }
3875
+ /**
3876
+ * Normalizes a `text-decoration` CSS value to a sorted, unique token string of
3877
+ * toolbar-only tokens (`underline`, `line-through`). Returns `undefined` if the
3878
+ * value contains any non-toolbar token (e.g. `wavy`, a color).
3879
+ *
3880
+ * @param {string | undefined} value - The raw `textDecoration` CSS value.
3881
+ * @returns {string | undefined} Normalized token string, or `undefined` if the value cannot be safely removed.
3882
+ */
3883
+ normalizeTextDecoration(value) {
3884
+ if (!value) {
3885
+ return undefined;
3886
+ }
3887
+ const tokens = value.trim().toLowerCase().split(/\s+/);
3888
+ if (tokens.some((token) => token !== codeBlock.UNDERLINE_TEXT_DECORATION && token !== codeBlock.STRIKETHROUGH_TEXT_DECORATION)) {
3889
+ return undefined;
3890
+ }
3891
+ return Array.from(new Set(tokens)).sort().join(' ');
3892
+ }
3893
+ /**
3894
+ * Determines whether the `textDecoration` custom style should be removed based on the
3895
+ * semantic annotations present. Removal happens only when the normalized value exactly
3896
+ * matches the set of `{underline, strikethrough}` annotations.
3897
+ *
3898
+ * @param {string} normalizedTextDecoration - The normalized `textDecoration` token string.
3899
+ * @param {VegaRTETextAnnotations} annotations - The text annotations to check against.
3900
+ * @returns {boolean} `true` if the `textDecoration` style is redundant and should be removed.
3901
+ */
3902
+ shouldRemoveTextDecoration(normalizedTextDecoration, annotations) {
3903
+ const expectedTokens = [];
3904
+ if (annotations.underline) {
3905
+ expectedTokens.push(codeBlock.UNDERLINE_TEXT_DECORATION);
3906
+ }
3907
+ if (annotations.strikethrough) {
3908
+ expectedTokens.push(codeBlock.STRIKETHROUGH_TEXT_DECORATION);
3909
+ }
3910
+ if (expectedTokens.length === 0) {
3911
+ return false;
3912
+ }
3913
+ return normalizedTextDecoration === expectedTokens.sort().join(' ');
3914
+ }
3915
+ }
3916
+
3917
+ /**
3918
+ * Register and setup the default DTO classes and their basic action strategies.
3919
+ */
3920
+ // Register the default block DTOs
3921
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('paragraph', codeBlock.RTETextBlock);
3922
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('title', codeBlock.RTETextBlock);
3923
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('subtitle', codeBlock.RTETextBlock);
3924
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-1', codeBlock.RTETextBlock);
3925
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-2', codeBlock.RTETextBlock);
3926
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-3', codeBlock.RTETextBlock);
3927
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-4', codeBlock.RTETextBlock);
3928
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-5', codeBlock.RTETextBlock);
3929
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-6', codeBlock.RTETextBlock);
3930
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-6', codeBlock.RTETextBlock);
3931
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('list-item', RTEListItemBlock);
3932
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('bullet-list', RTEListBlock);
3933
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('number-list', RTEListBlock);
3934
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('image', RTEImageBlock);
3935
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('code-block', codeBlock.RTECodeBlock);
3936
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('html-block', RTEHtmlBlock);
3937
+ // Register the default node DTOs
3938
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('text', codeBlock.RTETextNode);
3939
+ codeBlock.RTEDTOClassManager.registerRTEDTOClass('image', RTEImageNode);
3940
+ // Register basic strategies for default block DTOs
3941
+ RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(codeBlock.RTETextBlock.name);
3942
+ RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(RTEListBlock.name);
3943
+ RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(RTEListItemBlock.name);
3944
+ RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(RTEImageBlock.name);
3945
+ RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(RTEHtmlBlock.name);
3946
+ // Register element to DTO strategies for default node DTOs, The order of registration matters, the later registered strategy has higher priority.
3947
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new ContinueInlineToRTETextBlockStrategy());
3948
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new SpanImageToRTEImageBlockStrategy());
3949
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new VegaImageToRTEImageBlockStrategy());
3950
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new ImgToRTEImageBlockStrategy());
3951
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new InlineBlockToRTETextBlockStrategy());
3952
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new JiraCodeToRTECodeBlockStrategy());
3953
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new VegaCodeBlockToRTECodeBlockStrategy());
3954
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new LiToRTEListItemBlockStrategy());
3955
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new ULNotLiChildToRTEListItemBlockStrategy());
3956
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new OlToRTEListBlockStrategy());
3957
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new UlToRTEListBlockStrategy());
3958
+ ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new HtmlBlockStrategy());
3959
+ ElementToDTOClassStrategyManager.registerElementToNodeStrategy(new InlineElementToTextNodeStrategy());
3960
+ ElementToDTOClassStrategyManager.registerElementToNodeStrategy(new PlainTextToTextNodeStrategy());
3961
+ // Register filter styles strategies (remove redundant default styles during HTML → DTO conversion)
3962
+ RTEFilterStylesStrategyRegistry.register(RTEListBlock.name, new ListBlockFilterStylesStrategy());
3963
+ RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.name, new ListItemBlockFilterStylesStrategy());
3964
+ RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextBlock.name, new AlignmentFilterStylesStrategy());
3965
+ RTEFilterStylesStrategyRegistry.register(RTEListBlock.name, new AlignmentFilterStylesStrategy());
3966
+ RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.name, new AlignmentFilterStylesStrategy());
3967
+ RTEFilterStylesStrategyRegistry.register(RTEImageNode.name, new ImageFilterStylesStrategy());
3968
+ RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextNode.name, new LinkFilterStylesStrategy());
3969
+ RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextNode.name, new TextFormatFilterStylesStrategy());
3970
+ RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextNode.name, new CodeFilterStylesStrategy());
3971
+
3972
+ /**
3973
+ * StylePreservator handles CSP-compliant style management by temporarily converting
3974
+ * inline styles to data attributes during HTML parsing operations.
3975
+ *
3976
+ * @example
3977
+ * ```typescript
3978
+ * const context = StylePreservator.preserve('<div style="color: red;">Content</div>');
3979
+ * const safeHtml = context.getProcessedHtml();
3980
+ * context.restore(parsedElements);
3981
+ * ```
3982
+ */
3983
+ class StylePreservator {
3984
+ /**
3985
+ * Preserves inline styles by converting them to data attributes.
3986
+ *
3987
+ * @param {string} htmlString - The HTML string containing inline styles
3988
+ * @returns {StylePreservationContext} A context object for later style restoration
3989
+ */
3990
+ static preserve(htmlString) {
3991
+ const processedHtml = htmlString.replace(/\s+style=/g, ' data-style=');
3992
+ return new StylePreservationContext(processedHtml);
3993
+ }
3994
+ }
3995
+ /**
3996
+ * Context class that manages the lifecycle of preserved styles.
3997
+ */
3998
+ class StylePreservationContext {
3999
+ constructor(processedHtml) {
4000
+ this.processedHtml = processedHtml;
4001
+ }
4002
+ /**
4003
+ * Returns the HTML string with style attributes converted to data-style.
4004
+ *
4005
+ * @returns {string} The processed HTML string
4006
+ */
4007
+ getProcessedHtml() {
4008
+ return this.processedHtml;
4009
+ }
4010
+ /**
4011
+ * Restores data-style attributes back to style attributes.
4012
+ *
4013
+ * @param {HTMLElement[]} elements - Array of HTML elements to process
4014
+ * @returns {void}
4015
+ */
4016
+ restore(elements) {
4017
+ this.walkNodes(elements);
4018
+ }
4019
+ /**
4020
+ * Recursively walk through nodes and restore styles
4021
+ *
4022
+ * @param {HTMLElement[]} elements - list of nodes
4023
+ * @returns {void}
4024
+ */
4025
+ walkNodes(elements) {
4026
+ elements.forEach((element) => {
4027
+ if (ui.isHTMLElement(element)) {
4028
+ // Restore data-style back to style
4029
+ const dataStyle = element.getAttribute('data-style');
4030
+ if (dataStyle) {
4031
+ element.style.cssText = dataStyle;
4032
+ element.removeAttribute('data-style');
4033
+ }
4034
+ // Recursively process child nodes
4035
+ if (element.children.length > 0) {
4036
+ this.walkNodes(Array.from(element.children));
4037
+ }
4038
+ }
4039
+ });
4040
+ }
4041
+ }
4042
+
4043
+ /**
4044
+ * Removes whitespace between tags, except preserves ALL whitespace between matching opening/closing tag pairs.
4045
+ *
4046
+ * This processor scans for patterns of `<tag>(whitespace)<tag>` and:
4047
+ * - If the first tag is an opening tag and the second tag is its matching closing tag (e.g., `<span> </span>`),
4048
+ * preserves ALL the whitespace between them (including spaces, tabs, newlines)
4049
+ * - Otherwise, removes all the whitespace between the tags
4050
+ *
4051
+ * Examples:
4052
+ * - `</p>\n\t<div>` → `</p><div>` (different tags: closing p, opening div - whitespace removed)
4053
+ * - `<div>\n\t<span>` → `<div><span>` (different tags: opening div, opening span - whitespace removed)
4054
+ * - `<span> </span>` → `<span> </span>` (matching tags: opening span, closing span - space preserved)
4055
+ * - `<span> </span>` → `<span> </span>` (matching tags - multiple spaces preserved)
4056
+ * - `<span>\n\t</span>` → `<span>\n\t</span>` (matching tags - \n\t preserved)
4057
+ * - `<code> </code>` → `<code> </code>` (matching tags - space preserved)
4058
+ * - `</div> <p>` → `</div><p>` (different tags: closing div, opening p - whitespace removed)
4059
+ */
4060
+ class RemoveWhitespaceBetweenTagsProcessor {
4061
+ /**
4062
+ * Process the HTML string to remove whitespace between non-matching tags.
4063
+ *
4064
+ * @param {string} html - The HTML string to process.
4065
+ * @returns {string} The processed HTML string.
4066
+ */
4067
+ process(html) {
4068
+ return html.replace(/(<[^>]+>)(\s+)(<[^>]+>)/g, (_match, tag1, whitespace, tag2) => {
4069
+ const openingTagName = this.extractOpeningTagName(tag1);
4070
+ const closingTagName = this.extractClosingTagName(tag2);
4071
+ // Preserve all whitespace if tags match (e.g., <span> </span>)
4072
+ if (openingTagName && closingTagName && openingTagName === closingTagName) {
4073
+ return `${tag1}${whitespace}${tag2}`;
4074
+ }
4075
+ // Remove whitespace for non-matching tags
4076
+ return `${tag1}${tag2}`;
4077
+ });
4078
+ }
4079
+ /**
4080
+ * Extracts the tag name from an opening HTML tag.
4081
+ *
4082
+ * Supports standard HTML tags (div, span, h1, etc.) and custom elements with hyphens (my-component).
4083
+ *
4084
+ * Examples:
4085
+ * - `<span>` → `span`
4086
+ * - `<div class="test">` → `div`
4087
+ * - `<my-component id="123">` → `my-component`
4088
+ * - `</span>` → `null` (not an opening tag)
4089
+ *
4090
+ * @param {string} tag - The tag string to extract from (e.g., '<span>', '<div class="test">').
4091
+ * @returns {string | null} The tag name or null if not an opening tag.
4092
+ * @private
4093
+ */
4094
+ extractOpeningTagName(tag) {
4095
+ // Pattern: <(tag name) where tag name starts with letter, followed by letters/numbers/hyphens
4096
+ const match = tag.match(/<(\w[\w-]*)/);
4097
+ return match ? match[1] : null;
4098
+ }
4099
+ /**
4100
+ * Extracts the tag name from a closing HTML tag.
4101
+ *
4102
+ * Supports standard HTML tags (div, span, h1, etc.) and custom elements with hyphens (my-component).
4103
+ *
4104
+ * Examples:
4105
+ * - `</span>` → `span`
4106
+ * - `</div>` → `div`
4107
+ * - `</my-component>` → `my-component`
4108
+ * - `<span>` → `null` (not a closing tag)
4109
+ *
4110
+ * @param {string} tag - The tag string to extract from (e.g., '</span>', '</div>').
4111
+ * @returns {string | null} The tag name or null if not a closing tag.
4112
+ * @private
4113
+ */
4114
+ extractClosingTagName(tag) {
4115
+ // Pattern: </(tag name) where tag name starts with letter, followed by letters/numbers/hyphens
4116
+ const match = tag.match(/<\/(\w[\w-]*)/);
4117
+ return match ? match[1] : null;
4118
+ }
4119
+ }
4120
+
4121
+ /**
4122
+ * Removes `\n` and `\t` characters after opening tags (before text content).
4123
+ *
4124
+ * Transforms patterns like `>[\n\t]+(text)` to `>(text)`.
4125
+ *
4126
+ * Examples:
4127
+ * - `<p>\n\tHello` → `<p>Hello`
4128
+ * - `<div>\n\n\tWorld` → `<div>World`
4129
+ */
4130
+ class RemoveWhitespaceAfterOpeningTagProcessor {
4131
+ /**
4132
+ * Process the HTML string to remove `\n` and `\t` after opening tags.
4133
+ *
4134
+ * @param {string} html - The HTML string to process.
4135
+ * @returns {string} The processed HTML string.
4136
+ */
4137
+ process(html) {
4138
+ // Pattern: `>[\n\t]+(text)` → `>(text)`
4139
+ return html.replace(/(>)[\n\t]+(?=.)/g, '$1');
4140
+ }
4141
+ }
4142
+
4143
+ /**
4144
+ * Removes `\n` and `\t` characters before closing tags (after text content).
4145
+ *
4146
+ * Transforms patterns like `(text)[\n\t]+<` to `(text)<`.
4147
+ *
4148
+ * Examples:
4149
+ * - `World\n\t</p>` → `World</p>`
4150
+ * - `Hello\n</div>` → `Hello</div>`
4151
+ */
4152
+ class RemoveWhitespaceBeforeClosingTagProcessor {
4153
+ /**
4154
+ * Process the HTML string to remove `\n` and `\t` before closing tags.
4155
+ *
4156
+ * @param {string} html - The HTML string to process.
4157
+ * @returns {string} The processed HTML string.
4158
+ */
4159
+ process(html) {
4160
+ // Pattern: `(text)[\n\t]+<` → `(text)<`
4161
+ return html.replace(/(.?)[\n\t]+(?=<)/g, '$1');
4162
+ }
4163
+ }
4164
+
4165
+ /**
4166
+ * Main HTML content cleaner that orchestrates multiple cleaning processors.
4167
+ *
4168
+ * This class implements a chain of responsibility pattern where each processor
4169
+ * handles a specific aspect of HTML cleaning. The processors are applied in sequence
4170
+ * and the entire chain is repeated until no more changes occur.
4171
+ *
4172
+ * Processors (in order):
4173
+ * 1. RemoveWhitespaceBetweenTagsProcessor - Removes whitespace between non-matching tags
4174
+ * 2. RemoveWhitespaceAfterOpeningTagProcessor - Removes \n and \t after opening tags
4175
+ * 3. RemoveWhitespaceBeforeClosingTagProcessor - Removes \n and \t before closing tags
4176
+ */
4177
+ class HTMLContentCleaner {
4178
+ constructor() {
4179
+ this.processors = [
4180
+ new RemoveWhitespaceBetweenTagsProcessor(),
4181
+ new RemoveWhitespaceAfterOpeningTagProcessor(),
4182
+ new RemoveWhitespaceBeforeClosingTagProcessor(),
4183
+ ];
4184
+ }
4185
+ /**
4186
+ * Cleans HTML by applying all processors in the chain repeatedly until no changes occur.
4187
+ *
4188
+ * The cleaning process:
4189
+ * 1. Applies each processor in sequence
4190
+ * 2. Compares the result with the input
4191
+ * 3. If changes were made, repeats the process
4192
+ * 4. Returns the final cleaned HTML
4193
+ *
4194
+ * Examples of transformations:
4195
+ * - `<p>\n\t <span>test</span>\n\t </p>` → `<p><span>test</span></p>`
4196
+ * - `<p>\n\tHello</p>` → `<p>Hello</p>`
4197
+ * - `<p>Hello\n\t</p>` → `<p>Hello</p>`
4198
+ * - `<span> </span>` → `<span> </span>` (preserved - matching tags)
4199
+ * - `<p>Hello World</p>` → `<p>Hello World</p>` (preserved - regular spaces)
4200
+ *
4201
+ * @param {string} html - The HTML string to clean.
4202
+ * @returns {string} The cleaned HTML string.
4203
+ */
4204
+ clean(html) {
4205
+ if (!html || html.trim().length === 0) {
4206
+ return html;
4207
+ }
4208
+ let result = html;
4209
+ let previousResult;
4210
+ // Keep processing until no more changes occur
4211
+ do {
4212
+ previousResult = result;
4213
+ // Apply each processor in the chain
4214
+ for (const processor of this.processors) {
4215
+ result = processor.process(result);
4216
+ }
4217
+ } while (result !== previousResult);
4218
+ return result;
4219
+ }
4220
+ }
4221
+
4222
+ /**
4223
+ * Class representing the content state of the rich text editor.
4224
+ */
4225
+ class VegaRTEContent {
4226
+ constructor(blocks) {
4227
+ blocks.forEach((block) => {
4228
+ block.parent = this;
4229
+ });
4230
+ this.children = blocks;
4231
+ }
4232
+ /**
4233
+ * Converts a JSON array of blocks to a class array of RTEContentBlock.
4234
+ *
4235
+ * @param {VegaRTEContentBlock[]} value The JSON array of blocks to convert.
4236
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
4237
+ * @returns {VegaRTEContent} The converted array of RTEContentBlock.
4238
+ */
4239
+ static fromJSON(value, options = { autoMatchFormat: true }) {
4240
+ const blocks = value.map((block) => {
4241
+ const BlockClass = codeBlock.RTEDTOClassManager.getRTEBlockClass(block.type);
4242
+ if (BlockClass) {
4243
+ return BlockClass.from(block, options);
4244
+ }
4245
+ else {
4246
+ throw new Error(`[Vega] Unknown block type: ${block.type}`);
4247
+ }
4248
+ });
4249
+ return new VegaRTEContent(blocks);
4250
+ }
4251
+ /**
4252
+ * Create an empty content state
4253
+ *
4254
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
4255
+ * @returns {VegaRTEContent} An empty content state
4256
+ */
4257
+ static createEmptyContent(options = { autoMatchFormat: true }) {
4258
+ return VegaRTEContent.fromJSON([
4259
+ {
4260
+ id: misc.generateUUID(),
4261
+ type: 'paragraph',
4262
+ annotations: {
4263
+ internalWrapper: !options.autoMatchFormat,
4264
+ },
4265
+ nodes: [
4266
+ {
4267
+ id: misc.generateUUID(),
4268
+ annotations: { plainText: !options.autoMatchFormat },
4269
+ type: 'text',
4270
+ text: '',
4271
+ },
4272
+ ],
4273
+ },
4274
+ ], options);
4275
+ }
4276
+ /**
4277
+ * Converts HTML content to a VegaRTEContent instance.
4278
+ *
4279
+ * @param {string} html - The HTML string to convert.
4280
+ * @param {VegaRTETransformOptions} options - Optional transformation options.
4281
+ * @returns {VegaRTEContent} The converted content state.
4282
+ */
4283
+ static fromHtml(html, options = { autoMatchFormat: true, skipCustomAnnotations: false }) {
4284
+ const cleaner = new HTMLContentCleaner();
4285
+ const formattedHtml = cleaner.clean(html);
4286
+ const context = StylePreservator.preserve(formattedHtml);
4287
+ const safeHtml = context.getProcessedHtml();
4288
+ const body = new DOMParser().parseFromString(safeHtml, 'text/html').body;
4289
+ const htmlElements = Array.from(body.childNodes);
4290
+ context.restore(htmlElements);
4291
+ const blocks = ElementToDtoStrategyProcessor$1.process(htmlElements, options)
4292
+ .filter(typeGuard.isNonNullable)
4293
+ .map((output) => output.toDto(options))
4294
+ .filter(typeGuard.isNonNullable);
4295
+ return new VegaRTEContent(blocks);
4296
+ }
4297
+ /**
4298
+ * Clones the content state.
4299
+ *
4300
+ * @param {boolean} deep - If true, performs a deep clone of the content state.
4301
+ * @returns {VegaRTEContent} The cloned content state.
4302
+ */
4303
+ clone(deep = false) {
4304
+ return deep
4305
+ ? new VegaRTEContent(this.children.map((block) => block.clone(this)))
4306
+ : new VegaRTEContent([...this.children]);
4307
+ }
4308
+ /**
4309
+ * Converts the content state to a JSON array of blocks.
4310
+ *
4311
+ * @returns {VegaRTEContentBlock[]} The JSON array of blocks.
4312
+ */
4313
+ toJSON() {
4314
+ return this.children.map((block) => block.toJSON());
4315
+ }
4316
+ /**
4317
+ * Converts the content state to HTML.
4318
+ *
4319
+ * @deprecated The [`options`]{@link options} parameter is deprecated and will be removed in the future.
4320
+ * @param {VegaRTETransformOptions} [options] - Deprecated. Optional rendering context (currently unused).
4321
+ * @returns {string} The HTML representation of the content state.
4322
+ */
4323
+ toHtml(options) {
4324
+ if (options) {
4325
+ globalSlimmerRegistry.LogUtility.warn(`The 'options' parameter in toHtml method is deprecated and will be removed in the future.`);
4326
+ }
4327
+ if (this.isEmpty()) {
4328
+ return '';
4329
+ }
4330
+ return this.children.map((block) => block.toHtml()).join('');
4331
+ }
4332
+ /**
4333
+ * Checks if the content state is empty.
4334
+ *
4335
+ * @returns {boolean} True if the content state is empty, false otherwise.
4336
+ */
4337
+ isEmpty() {
4338
+ return this.children.length === 0 || (this.children.length === 1 && !this.children[0].isNotEmpty());
4339
+ }
4340
+ /**
4341
+ * Internal method to add the block item, remove the block item
4342
+ *
4343
+ * @param {ModifyContentAction} action - Modify content action
4344
+ */
4345
+ apply(action) {
4346
+ codeBlock.ActionHandleStrategyRegistry.executeTheStrategy(action, this);
4347
+ // Check if the action has been executed and is flushable
4348
+ if (action['executedFlag'] && action.isFlushable) {
4349
+ const host = codeBlock.stateEntityRenderingRegistry.getDOMByEntity(this);
4350
+ if (host) {
4351
+ changeManager.ChangeManager.notify(domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubject(host, vegaInternalEventId.VegaInternalRichTextEditorFlushChanges), {});
4352
+ }
4353
+ }
4354
+ }
4355
+ /**
4356
+ * Get the last node in the content.
4357
+ *
4358
+ * @returns {Nullable<RTENode>} The last node in the content or null if there are no nodes.
4359
+ */
4360
+ getLastNode() {
4361
+ if (this.children.length === 0) {
4362
+ return null;
4363
+ }
4364
+ const lastBlock = this.children[this.children.length - 1];
4365
+ return lastBlock.getLastNode();
4366
+ }
4367
+ /**
4368
+ * Convert text to list.
4369
+ *
4370
+ * @param {RTETextBlock} block - block
4371
+ * @returns {RTEListItemBlock} list item block dto.
4372
+ */
4373
+ toListItem(block) {
4374
+ block.children.map((node) => node.apply(new codeBlock.SyncUpSelectionAction()));
4375
+ const listItemBlock = new RTEListItemBlock(misc.generateUUID());
4376
+ listItemBlock.apply(new codeBlock.AppendChildrenAction(block['children']));
4377
+ listItemBlock['annotationMap'] = block['annotationMap'];
4378
+ return listItemBlock;
4379
+ }
4380
+ /**
4381
+ * create list.
4382
+ *
4383
+ * @param {ListType} type - type
4384
+ * @returns {RTEListBlock} list block dto.
4385
+ */
4386
+ createList(type) {
4387
+ return new RTEListBlock(misc.generateUUID(), type);
4388
+ }
4389
+ /**
4390
+ * Finds a node by its ID in the content.
4391
+ *
4392
+ * @param {string} id - The ID of the node to find.
4393
+ * @returns {Nullable<RTENode>} The found node or null if not found.
4394
+ */
4395
+ findNodeById(id) {
4396
+ return this.findNodeInBlocksById(id, this.children);
4397
+ }
4398
+ /**
4399
+ * Recursively searches for a node by its ID in the given blocks.
4400
+ *
4401
+ * @param {string} id - The ID of the node to find.
4402
+ * @param {RTEContentBlock[]} blocks - The blocks to search within.
4403
+ * @returns {Nullable<RTENode>} The found node or null if not found.
4404
+ */
4405
+ findNodeInBlocksById(id, blocks) {
4406
+ for (const block of blocks) {
4407
+ if ('children' in block) {
4408
+ for (const node of block.children) {
4409
+ if (node.id === id) {
4410
+ return node;
4411
+ }
4412
+ }
4413
+ }
4414
+ if (block instanceof RTEListItemBlock && block.nestList) {
4415
+ for (const cBlock of block.nestList) {
4416
+ const foundNode = this.findNodeInBlocksById(id, cBlock.children);
4417
+ if (foundNode) {
4418
+ return foundNode;
4419
+ }
4420
+ }
4421
+ }
4422
+ if (block instanceof RTEListBlock && block.children) {
4423
+ const foundNode = this.findNodeInBlocksById(id, block.children);
4424
+ if (foundNode) {
4425
+ return foundNode;
4426
+ }
4427
+ }
4428
+ }
4429
+ return null;
4430
+ }
4431
+ }
4432
+ (() => {
4433
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_CHILDREN, VegaRTEContent.name, new codeBlock.RemoveChildrenStrategy());
4434
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.APPEND_CHILDREN, VegaRTEContent.name, new AppendChildrenStrategy());
4435
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, VegaRTEContent.name, new InsertChildrenBeforeStrategy());
4436
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_AFTER, VegaRTEContent.name, new InsertChildrenAfterStrategy());
4437
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.TRANSFORM_TO_CODE_BLOCK, VegaRTEContent.name, new BlockTransformToCodeBlockStrategy());
4438
+ codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.UPDATE_CURSOR_POSITION, VegaRTEContent.name, new UpdateCursorPositionStrategy());
4439
+ })();
4440
+
4441
+ exports.AnnotationGeneratorStrategyAbstract = AnnotationGeneratorStrategyAbstract;
4442
+ exports.BlockToRTEBlockStrategyAbstract = BlockToRTEBlockStrategyAbstract;
4443
+ exports.ElementToDTOClassStrategyManager = ElementToDTOClassStrategyManager;
4444
+ exports.ElementToDTOStrategy = ElementToDTOStrategy;
4445
+ exports.ElementToDtoStrategyProcessor = ElementToDtoStrategyProcessor$1;
4446
+ exports.ImageAnnotation = ImageAnnotation;
4447
+ exports.InsertChildrenBeforeStrategy = InsertChildrenBeforeStrategy;
4448
+ exports.InsertNewParagraphAction = InsertNewParagraphAction;
4449
+ exports.MergeTwoBlocksNodesAction = MergeTwoBlocksNodesAction;
4450
+ exports.PasteContentStrategy = PasteContentStrategy;
4451
+ exports.RTEDTOActionStrategyManager = RTEDTOActionStrategyManager$1;
4452
+ exports.RTEImageBlock = RTEImageBlock;
4453
+ exports.RTEImageNode = RTEImageNode;
4454
+ exports.RTEListBlock = RTEListBlock;
4455
+ exports.RTEListItemBlock = RTEListItemBlock;
4456
+ exports.StylePreservator = StylePreservator;
4457
+ exports.UpdateCursorPositionAction = UpdateCursorPositionAction;
4458
+ exports.VegaRTEContent = VegaRTEContent;
4459
+ exports.htmlElementToAnnotationGenerator = htmlElementToAnnotationGenerator;