@globalpayments/vega 2.99.0 → 2.101.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 (649) hide show
  1. package/dist/cjs/{accessibility-88f8af84.js → accessibility-6ca2a237.js} +21 -0
  2. package/dist/cjs/{action-color-accessibility-validator-b8a9ef0f.js → action-color-accessibility-validator-61af71ae.js} +1 -1
  3. package/dist/cjs/{app-globals-a306dce6.js → app-globals-275ea7c7.js} +19 -10
  4. package/dist/cjs/{aria-attributes-value-mapper-9a41b9cf.js → aria-attributes-value-mapper-e8c6b0e0.js} +1 -1
  5. package/dist/cjs/{aria-dialog-focusable-trap-slimmer-62147489.js → aria-dialog-focusable-trap-slimmer-c79cc3f8.js} +1 -1
  6. package/dist/cjs/{child-nodes-event-prevent-slimmer-e0ac8467.js → child-nodes-event-prevent-slimmer-d720d7e9.js} +1 -1
  7. package/dist/cjs/{code-block-ea1f5eb3.js → code-block-c598832d.js} +815 -751
  8. package/dist/cjs/{component-value-history-controller-slimmer.abstract-7071b064.js → component-value-history-controller-slimmer.abstract-4bd47aa1.js} +4 -4
  9. package/dist/cjs/{content-state-8d07d530.js → content-state-da23e822.js} +47 -3
  10. package/dist/cjs/countries-a8e3812a.js +251 -0
  11. package/dist/cjs/{dark-mode-style-controller-f3da3342.js → dark-mode-style-controller-ec04ece9.js} +45 -45
  12. package/dist/cjs/{date-required-rule-c0c498ad.js → date-required-rule-45c802d3.js} +1 -1
  13. package/dist/cjs/{design-token-58bf7fe8.js → design-token-9d762da0.js} +3 -3
  14. package/dist/cjs/{element-appender-slimmer-a0269315.js → element-appender-slimmer-2aaf8e24.js} +22 -3
  15. package/dist/cjs/{event-emit-slimmer-34aa195e.js → event-emit-slimmer-67b5c186.js} +1 -1
  16. package/dist/cjs/{form-field-controller-slimmer-f73f200e.js → form-field-controller-slimmer-ac9337f4.js} +3 -3
  17. package/dist/cjs/{image-annotation-action-2a28038e.js → image-annotation-action-378838c2.js} +8 -7
  18. package/dist/cjs/{image-extension-9659708b.js → image-extension-673ebe7f.js} +2 -2
  19. package/dist/cjs/index.cjs.js +24 -21
  20. package/dist/cjs/{inject-keyboard-manager-4fa45f9c.js → inject-keyboard-manager-540f0876.js} +1 -1
  21. package/dist/cjs/{internal-calendar-period-factory-6196bc80.js → internal-calendar-period-factory-b11918ee.js} +1 -1
  22. package/dist/cjs/{internal-translation-controller-51f7f865.js → internal-translation-controller-27bfc8c7.js} +15 -0
  23. package/dist/cjs/{internal-vega-event-manager-7003c84a.js → internal-vega-event-manager-976b9526.js} +10 -2
  24. package/dist/cjs/{keyboard-manager-482fe257.js → keyboard-manager-16e96b62.js} +12 -5
  25. package/dist/cjs/{keyboard-manager-slimmer-a19430dd.js → keyboard-manager-slimmer-0a4e556d.js} +1 -1
  26. package/dist/cjs/{link-extension-11340e1c.js → link-extension-f493e432.js} +3 -3
  27. package/dist/cjs/loader.cjs.js +17 -16
  28. package/dist/cjs/{month-view-generator-1a534451.js → month-view-generator-0a3e04de.js} +1 -1
  29. package/dist/cjs/overlay-escape-coordination-901d8942.js +38 -0
  30. package/dist/cjs/{public-rules-6c77b545.js → public-rules-bae12c47.js} +9 -9
  31. package/dist/cjs/{range-22ddd452.js → range-9f42fb40.js} +1 -1
  32. package/dist/cjs/{responsive-format-facade-74e6d791.js → responsive-format-facade-c6d7f0a1.js} +1 -1
  33. package/dist/cjs/{rich-text-editor-required-rule-09d1093a.js → rich-text-editor-required-rule-bb232741.js} +1 -1
  34. package/dist/cjs/{split-cell-operation-11bfb305.js → split-cell-operation-0d33123e.js} +4 -4
  35. package/dist/cjs/{state-border-formatter-bf4f9f1c.js → state-border-formatter-dda9109a.js} +1 -1
  36. package/dist/cjs/{string-format-strategy.abstract-bf37b14c.js → string-format-strategy.abstract-3a968a59.js} +1 -1
  37. package/dist/cjs/{string-input-formatter-slimmer-ffeb18a6.js → string-input-formatter-slimmer-2e0a838e.js} +3 -3
  38. package/dist/cjs/{string-mask-strategy-7f394726.js → string-mask-strategy-d9f85c21.js} +2 -2
  39. package/dist/cjs/{style-formatter-4ac63910.js → style-formatter-d21a9784.js} +2 -2
  40. package/dist/cjs/{sub-state-notify-slimmer-e264a120.js → sub-state-notify-slimmer-3b33e31c.js} +1 -1
  41. package/dist/cjs/{sub-state-observer-slimmer-6033b824.js → sub-state-observer-slimmer-5b68ba3f.js} +1 -1
  42. package/dist/cjs/{time-required-rule-e2a50003.js → time-required-rule-580cbd3d.js} +1 -1
  43. package/dist/cjs/{token-extension-4686cb3b.js → token-extension-4badb962.js} +811 -53
  44. package/dist/cjs/{translation-slimmer-e4997f8f.js → translation-slimmer-31cd5a57.js} +1 -1
  45. package/dist/cjs/{type-guard-b8d7bb3f.js → type-guard-00b8efc0.js} +1 -1
  46. package/dist/cjs/{valid-credit-card-number-rule-f5a6f009.js → valid-credit-card-number-rule-70885128.js} +1 -1
  47. package/dist/cjs/vega-accordion.cjs.entry.js +9 -9
  48. package/dist/cjs/vega-app-footer.cjs.entry.js +4 -4
  49. package/dist/cjs/vega-app-header-button.cjs.entry.js +10 -10
  50. package/dist/cjs/vega-banner.cjs.entry.js +4 -4
  51. package/dist/cjs/vega-box.cjs.entry.js +6 -6
  52. package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -1
  53. package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
  54. package/dist/cjs/vega-button-circle.cjs.entry.js +12 -12
  55. package/dist/cjs/vega-button-group_2.cjs.entry.js +20 -13
  56. package/dist/cjs/vega-button-link.cjs.entry.js +8 -8
  57. package/dist/cjs/vega-button.cjs.entry.js +27 -11
  58. package/dist/cjs/vega-calendar_5.cjs.entry.js +130 -24
  59. package/dist/cjs/vega-card.cjs.entry.js +5 -5
  60. package/dist/cjs/vega-carousel.cjs.entry.js +7 -7
  61. package/dist/cjs/vega-checkbox_2.cjs.entry.js +9 -9
  62. package/dist/cjs/vega-chip.cjs.entry.js +10 -10
  63. package/dist/cjs/vega-code-block.cjs.entry.js +15 -15
  64. package/dist/cjs/vega-color-picker.cjs.entry.js +8 -8
  65. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +9 -9
  66. package/dist/cjs/vega-color-swatch.cjs.entry.js +6 -6
  67. package/dist/cjs/vega-combo-box.cjs.entry.js +15 -15
  68. package/dist/cjs/vega-date-picker_2.cjs.entry.js +22 -22
  69. package/dist/cjs/vega-dialog_2.cjs.entry.js +76 -10
  70. package/dist/cjs/vega-divider.cjs.entry.js +5 -5
  71. package/dist/cjs/vega-dropdown_5.cjs.entry.js +108 -25
  72. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  73. package/dist/cjs/{vega-event-id-58afed7a.js → vega-event-id-987a170c.js} +2 -0
  74. package/dist/cjs/vega-field-label.cjs.entry.js +29 -36
  75. package/dist/cjs/vega-file-uploader.cjs.entry.js +9 -9
  76. package/dist/cjs/vega-flag-icon.cjs.entry.js +11 -11
  77. package/dist/cjs/vega-flex.cjs.entry.js +6 -6
  78. package/dist/cjs/vega-font.cjs.entry.js +5 -5
  79. package/dist/cjs/vega-form.cjs.entry.js +9 -9
  80. package/dist/cjs/vega-grid.cjs.entry.js +5 -5
  81. package/dist/cjs/vega-icon.cjs.entry.js +5 -5
  82. package/dist/cjs/vega-image-uploader.cjs.entry.js +13 -13
  83. package/dist/cjs/vega-input-credit-card.cjs.entry.js +12 -12
  84. package/dist/cjs/vega-input-numeric.cjs.entry.js +12 -12
  85. package/dist/cjs/vega-input-passcode.cjs.entry.js +11 -11
  86. package/dist/cjs/vega-input-phone-number.cjs.entry.js +56 -275
  87. package/dist/cjs/vega-input-range.cjs.entry.js +10 -10
  88. package/dist/cjs/vega-input-select.cjs.entry.js +39 -39
  89. package/dist/cjs/vega-input.cjs.entry.js +14 -14
  90. package/dist/cjs/{vega-internal-event-id-f4d33037.js → vega-internal-event-id-98d499d7.js} +6 -2
  91. package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
  92. package/dist/cjs/vega-left-nav_5.cjs.entry.js +14 -14
  93. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
  94. package/dist/cjs/vega-page-notification_2.cjs.entry.js +2 -2
  95. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +4 -4
  96. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +4 -4
  97. package/dist/cjs/vega-pagination.cjs.entry.js +9 -9
  98. package/dist/cjs/vega-popover_2.cjs.entry.js +63 -14
  99. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +10 -10
  100. package/dist/cjs/vega-radio_2.cjs.entry.js +12 -12
  101. package/dist/cjs/vega-rich-text-content.cjs.entry.js +16 -13
  102. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +712 -250
  103. package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +6 -6
  104. package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +8 -8
  105. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +161 -108
  106. package/dist/cjs/vega-segment-control.cjs.entry.js +11 -4
  107. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +12 -12
  108. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +9 -9
  109. package/dist/cjs/vega-sidenav_3.cjs.entry.js +10 -10
  110. package/dist/cjs/vega-signature-capture.cjs.entry.js +12 -12
  111. package/dist/cjs/vega-stepper.cjs.entry.js +8 -8
  112. package/dist/cjs/vega-tab-group_2.cjs.entry.js +7 -7
  113. package/dist/cjs/vega-table_11.cjs.entry.js +625 -666
  114. package/dist/cjs/vega-textarea.cjs.entry.js +8 -8
  115. package/dist/cjs/vega-time-picker_2.cjs.entry.js +16 -16
  116. package/dist/cjs/vega-toggle-switch.cjs.entry.js +8 -8
  117. package/dist/cjs/vega-tooltip_2.cjs.entry.js +7 -7
  118. package/dist/cjs/vega.cjs.js +17 -16
  119. package/dist/cjs/{wait-for-component-did-render-44d006ee.js → wait-for-component-did-render-90edbc1a.js} +1 -1
  120. package/dist/collection/components/vega-button/vega-button.css +3 -3
  121. package/dist/collection/components/vega-button/vega-button.js +17 -2
  122. package/dist/collection/components/vega-button-circle/vega-button-circle.css +3 -3
  123. package/dist/collection/components/vega-button-group/vega-button-group-item/slimmers/renderers/vega-button-group-item-renderer.js +13 -6
  124. package/dist/collection/components/vega-button-link/vega-button-link.css +4 -4
  125. package/dist/collection/components/vega-button-link/vega-button-link.js +2 -2
  126. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.js +45 -5
  127. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.js +43 -1
  128. package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.js +23 -4
  129. package/dist/collection/components/vega-calendar/vega-calendar.js +77 -1
  130. package/dist/collection/components/vega-code-block/vega-code-block.css +4 -4
  131. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-keyboard-controller.js +148 -0
  132. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-scrollable-controller.js +5 -2
  133. package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-renderer.js +17 -0
  134. package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +2 -2
  135. package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.css +2 -1
  136. package/dist/collection/components/vega-dropdown/vega-dropdown.js +1 -1
  137. package/dist/collection/components/vega-field-label/slimmers/renderers/vega-field-label-label-announcement-renderer.js +21 -30
  138. package/dist/collection/components/vega-field-label/vega-field-label.js +7 -5
  139. package/dist/collection/components/vega-flag-icon/slimmers/controllers/vega-flag-icon-controller.js +6 -6
  140. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +4 -8
  141. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +19 -2
  142. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-prefix-icon-renderer.js +8 -28
  143. package/dist/collection/components/vega-input-select/vega-input-select.js +3 -1
  144. package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.js +66 -0
  145. package/dist/collection/components/vega-popover/slimmers/renderers/vega-popover-appender-renderer.js +17 -0
  146. package/dist/collection/components/vega-popover/vega-popover.js +33 -1
  147. package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +4 -1
  148. package/dist/collection/components/vega-rich-text-editor/constants/constant.js +9 -0
  149. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/commit-value-strategy.js +13 -0
  150. package/dist/collection/components/vega-rich-text-editor/dto/actions/commit-value-action.js +20 -0
  151. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +11 -0
  152. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +11 -2
  153. package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +18 -6
  154. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +11 -0
  155. package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +6 -0
  156. package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +8 -0
  157. package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +6 -0
  158. package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +30 -18
  159. package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/renderers/blockquote-toolbar-button-renderer.js +1 -0
  160. package/dist/collection/components/vega-rich-text-editor/extensions/copy/copy-toolbar-button-renderer.js +1 -0
  161. package/dist/collection/components/vega-rich-text-editor/extensions/cut/cut-toolbar-button-renderer.js +1 -0
  162. package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/renderers/find-replace-toolbar-button-renderer.js +51 -0
  163. package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/vega-rich-text-find-replace-panel/slimmers/renderers/find-replace-panel-renderer.js +2 -2
  164. package/dist/collection/components/vega-rich-text-editor/extensions/fullscreen/fullscreen-toolbar-button-renderer.js +3 -0
  165. package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +6 -0
  166. package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +1 -0
  167. package/dist/collection/components/vega-rich-text-editor/extensions/horizontal-line/renderers/horizontal-line-toolbar-button-renderer.js +1 -0
  168. package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +5 -3
  169. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +16 -0
  170. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.js +2 -0
  171. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.js +3 -9
  172. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.js +2 -2
  173. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.js +81 -1
  174. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-popover-base-renderer.js +148 -0
  175. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +151 -5
  176. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +144 -2
  177. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-selection.js +26 -1
  178. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +1 -0
  179. 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 +11 -2
  180. 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 +5 -2
  181. 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 +5 -1
  182. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.css +5 -0
  183. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.js +16 -1
  184. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.js +1 -0
  185. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.js +1 -0
  186. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.js +10 -9
  187. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/merge-cells-button-slimmer.js +9 -8
  188. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.js +25 -10
  189. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.js +1 -0
  190. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.js +5 -4
  191. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.js +1 -1
  192. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.css +10 -0
  193. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.js +2 -0
  194. package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +1 -0
  195. package/dist/collection/components/vega-rich-text-editor/extensions/word-count/action-handler-interceptors/prevent-hard-limit-exceed-interceptor.js +70 -0
  196. package/dist/collection/components/vega-rich-text-editor/extensions/word-count/type.js +1 -0
  197. package/dist/collection/components/vega-rich-text-editor/extensions/word-count/word-count-extension.js +62 -0
  198. package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
  199. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.js +2 -1
  200. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +7 -1
  201. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +52 -2
  202. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/word-count-controller.js +79 -0
  203. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +6 -3
  204. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +2 -1
  205. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +2 -1
  206. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +3 -2
  207. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +111 -2
  208. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +17 -6
  209. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +1 -1
  210. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +1 -1
  211. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +3 -2
  212. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +59 -8
  213. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.js +1 -1
  214. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.js +13 -1
  215. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +16 -0
  216. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.js +124 -0
  217. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +9 -1
  218. package/dist/collection/components/vega-segment-control/slimmers/renderers/vega-segment-renderer.js +8 -1
  219. package/dist/collection/components/vega-segment-control/vega-segment-control.js +23 -0
  220. package/dist/collection/components/vega-table/slimmers/controllers/dto/column-render-input-model.js +25 -8
  221. package/dist/collection/components/vega-table/slimmers/controllers/dto/row-render-input-model.js +41 -0
  222. package/dist/collection/components/vega-table/slimmers/controllers/vega-table-head-template-structure-controller.js +1 -0
  223. package/dist/collection/components/vega-table/slimmers/controllers/vega-table-render-input-controller.js +316 -18
  224. package/dist/collection/components/vega-table/slimmers/renderers/vega-table-body-renderer.js +6 -1
  225. package/dist/collection/components/vega-table/slimmers/renderers/vega-table-header-renderer.js +1 -0
  226. package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +33 -530
  227. package/dist/collection/components/vega-table/slimmers/renderers/vega-table-row-renderer.js +1 -0
  228. package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.css +10 -0
  229. package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.js +25 -8
  230. package/dist/collection/components/vega-table/vega-table-expand-row/slimmers/renderers/vega-table-expand-row-renderer.js +14 -6
  231. package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.css +20 -0
  232. package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.js +7 -0
  233. package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +21 -2
  234. package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.css +10 -0
  235. package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.js +12 -1
  236. package/dist/collection/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.js +20 -13
  237. package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.css +26 -0
  238. package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.js +12 -0
  239. package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +10 -0
  240. package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +19 -6
  241. package/dist/collection/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.js +21 -46
  242. package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.css +16 -7
  243. package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.js +9 -2
  244. package/dist/collection/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.js +28 -13
  245. package/dist/collection/components/vega-table/vega-table-row/vega-table-row.css +26 -0
  246. package/dist/collection/components/vega-table/vega-table-row/vega-table-row.js +11 -0
  247. package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-border-tokens.js +1 -1
  248. package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-color-tokens.js +20 -20
  249. package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-ring-tokens.js +1 -1
  250. package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-shadow-tokens.js +1 -1
  251. package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-border-tokens.js +1 -1
  252. package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-color-tokens.js +19 -19
  253. package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-shadow-tokens.js +1 -1
  254. package/dist/collection/constants/ui.js +1 -0
  255. package/dist/collection/global/scripts/before-vega-load.js +10 -0
  256. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +10 -2
  257. package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
  258. package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +3 -1
  259. package/dist/collection/helpers/keyboard/keyboard-manager.js +11 -4
  260. package/dist/collection/helpers/keyboard/overlay-escape-coordination.js +33 -0
  261. package/dist/collection/helpers/public-api.js +1 -0
  262. package/dist/collection/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.js +1 -1
  263. package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +8 -0
  264. package/dist/collection/helpers/slimmers/position-calculation/screen-position-calculation-strategy.js +10 -0
  265. package/dist/collection/helpers/slimmers/vega-table-child-render-input-consumer-slimmer.js +2 -0
  266. package/dist/collection/helpers/translation/locales/en.js +15 -0
  267. package/dist/collection/helpers/ui/element-appender.js +1 -0
  268. package/dist/collection/polyfill/libphonenumber/as-you-type.js +21 -3
  269. package/dist/collection/polyfill/libphonenumber/metadata.js +16 -0
  270. package/dist/collection/utils/accessibility.js +20 -0
  271. package/dist/esm/{accessibility-6af5cf2e.js → accessibility-c899a968.js} +21 -1
  272. package/dist/esm/{action-color-accessibility-validator-08877515.js → action-color-accessibility-validator-3e824a59.js} +1 -1
  273. package/dist/esm/{app-globals-c59364c2.js → app-globals-ad3c7cea.js} +19 -10
  274. package/dist/esm/{aria-attributes-value-mapper-2c632641.js → aria-attributes-value-mapper-a5c7478e.js} +1 -1
  275. package/dist/esm/{aria-dialog-focusable-trap-slimmer-f069f54d.js → aria-dialog-focusable-trap-slimmer-27a6aa19.js} +3 -3
  276. package/dist/esm/{child-nodes-event-prevent-slimmer-82626871.js → child-nodes-event-prevent-slimmer-0ebcbf47.js} +1 -1
  277. package/dist/esm/{child-nodes-notify-observer-slimmer-499a3aa7.js → child-nodes-notify-observer-slimmer-034bc78c.js} +1 -1
  278. package/dist/esm/{code-block-e6443949.js → code-block-1cdf7a51.js} +816 -754
  279. package/dist/esm/{component-value-history-controller-slimmer.abstract-ee393213.js → component-value-history-controller-slimmer.abstract-bdeeb43f.js} +6 -6
  280. package/dist/esm/{content-state-43cdacff.js → content-state-6eb610b8.js} +48 -6
  281. package/dist/esm/countries-50d3339b.js +249 -0
  282. package/dist/esm/{dark-mode-style-controller-352f15ff.js → dark-mode-style-controller-4e04a2d3.js} +45 -45
  283. package/dist/esm/{date-required-rule-b5b67498.js → date-required-rule-2ea3aec8.js} +1 -1
  284. package/dist/esm/{design-token-8319bb59.js → design-token-82a4e107.js} +3 -3
  285. package/dist/esm/{dom-node-subject-observer-factory-ddff8662.js → dom-node-subject-observer-factory-bb7e68a0.js} +1 -1
  286. package/dist/esm/{element-appender-slimmer-c81d1fe3.js → element-appender-slimmer-dd4e2908.js} +24 -5
  287. package/dist/esm/{event-emit-slimmer-2452278f.js → event-emit-slimmer-12ee1593.js} +2 -2
  288. package/dist/esm/{form-field-controller-slimmer-511b7ac5.js → form-field-controller-slimmer-5c794b4d.js} +5 -5
  289. package/dist/esm/{image-annotation-action-d7cb80aa.js → image-annotation-action-cdd50dcc.js} +9 -8
  290. package/dist/esm/{image-extension-9b8abd0d.js → image-extension-f6dbd70c.js} +2 -2
  291. package/dist/esm/index.js +24 -23
  292. package/dist/esm/{inject-keyboard-manager-dd368d56.js → inject-keyboard-manager-6a10c9b7.js} +1 -1
  293. package/dist/esm/{internal-calendar-period-factory-d58f35c6.js → internal-calendar-period-factory-d1a60f81.js} +1 -1
  294. package/dist/esm/{internal-translation-controller-b33430c6.js → internal-translation-controller-fff376d2.js} +15 -0
  295. package/dist/esm/{internal-vega-event-manager-2ecc9186.js → internal-vega-event-manager-0c381f3b.js} +10 -2
  296. package/dist/esm/{keyboard-manager-b4a0d97d.js → keyboard-manager-a58288df.js} +13 -6
  297. package/dist/esm/{keyboard-manager-slimmer-0517fc70.js → keyboard-manager-slimmer-133b86cd.js} +1 -1
  298. package/dist/esm/{link-extension-230bae8d.js → link-extension-bc234cf7.js} +3 -3
  299. package/dist/esm/loader.js +19 -18
  300. package/dist/esm/{month-view-generator-f470caac.js → month-view-generator-20e32b22.js} +1 -1
  301. package/dist/esm/overlay-escape-coordination-439f7d6f.js +35 -0
  302. package/dist/esm/{public-rules-28ef32d3.js → public-rules-8dc3fb00.js} +11 -11
  303. package/dist/esm/{range-efad2578.js → range-d2439ba7.js} +2 -2
  304. package/dist/esm/{responsive-format-facade-dec87e46.js → responsive-format-facade-07843ec3.js} +1 -1
  305. package/dist/esm/{rich-text-editor-required-rule-a697e5bd.js → rich-text-editor-required-rule-a0663a84.js} +1 -1
  306. package/dist/esm/{split-cell-operation-89b91a38.js → split-cell-operation-1a889fa0.js} +5 -5
  307. package/dist/esm/{state-border-formatter-1e900a2f.js → state-border-formatter-3b3dcfe8.js} +1 -1
  308. package/dist/esm/{string-format-strategy.abstract-d0ce3f65.js → string-format-strategy.abstract-44381dcb.js} +1 -1
  309. package/dist/esm/{string-input-formatter-slimmer-6546cfc7.js → string-input-formatter-slimmer-69887c40.js} +4 -4
  310. package/dist/esm/{string-mask-strategy-dd13ae21.js → string-mask-strategy-999fba4b.js} +2 -2
  311. package/dist/esm/{style-formatter-057d7120.js → style-formatter-c4192c99.js} +2 -2
  312. package/dist/esm/{sub-state-notify-slimmer-23b7d0e8.js → sub-state-notify-slimmer-ba72f30b.js} +2 -2
  313. package/dist/esm/{sub-state-observer-slimmer-722f6b92.js → sub-state-observer-slimmer-bee1c7fa.js} +3 -3
  314. package/dist/esm/{time-required-rule-73753a54.js → time-required-rule-0554b114.js} +1 -1
  315. package/dist/esm/{token-extension-74a0eeb1.js → token-extension-530d9bde.js} +813 -56
  316. package/dist/esm/{translation-slimmer-ef970ffc.js → translation-slimmer-77022f2e.js} +1 -1
  317. package/dist/esm/{type-guard-6fc96870.js → type-guard-26d83e7e.js} +1 -1
  318. package/dist/esm/{ui-d73f756a.js → ui-80e610f4.js} +1 -1
  319. package/dist/esm/{valid-credit-card-number-rule-b54a31e7.js → valid-credit-card-number-rule-f60b6904.js} +1 -1
  320. package/dist/esm/vega-accordion.entry.js +11 -11
  321. package/dist/esm/vega-app-footer.entry.js +6 -6
  322. package/dist/esm/vega-app-header-button.entry.js +12 -12
  323. package/dist/esm/vega-backdrop.entry.js +1 -1
  324. package/dist/esm/vega-banner.entry.js +6 -6
  325. package/dist/esm/vega-box.entry.js +7 -7
  326. package/dist/esm/vega-brand-logo.entry.js +1 -1
  327. package/dist/esm/vega-breadcrumb.entry.js +6 -6
  328. package/dist/esm/vega-button-circle.entry.js +14 -14
  329. package/dist/esm/vega-button-group_2.entry.js +22 -15
  330. package/dist/esm/vega-button-link.entry.js +10 -10
  331. package/dist/esm/vega-button.entry.js +29 -13
  332. package/dist/esm/vega-calendar_5.entry.js +132 -26
  333. package/dist/esm/vega-card.entry.js +6 -6
  334. package/dist/esm/vega-carousel.entry.js +9 -9
  335. package/dist/esm/vega-checkbox_2.entry.js +12 -12
  336. package/dist/esm/vega-chip.entry.js +12 -12
  337. package/dist/esm/vega-code-block.entry.js +17 -17
  338. package/dist/esm/vega-color-picker.entry.js +10 -10
  339. package/dist/esm/vega-color-swatch-picker.entry.js +11 -11
  340. package/dist/esm/vega-color-swatch.entry.js +8 -8
  341. package/dist/esm/vega-combo-box.entry.js +17 -17
  342. package/dist/esm/vega-date-picker_2.entry.js +24 -24
  343. package/dist/esm/vega-dialog_2.entry.js +78 -12
  344. package/dist/esm/vega-divider.entry.js +5 -5
  345. package/dist/esm/vega-dropdown_5.entry.js +111 -28
  346. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  347. package/dist/esm/{vega-event-id-f55f6977.js → vega-event-id-59cd9297.js} +2 -1
  348. package/dist/esm/vega-field-label.entry.js +31 -38
  349. package/dist/esm/vega-file-uploader.entry.js +11 -11
  350. package/dist/esm/vega-flag-icon.entry.js +11 -11
  351. package/dist/esm/vega-flex.entry.js +7 -7
  352. package/dist/esm/vega-font.entry.js +6 -6
  353. package/dist/esm/vega-form.entry.js +12 -12
  354. package/dist/esm/vega-grid.entry.js +6 -6
  355. package/dist/esm/vega-icon.entry.js +6 -6
  356. package/dist/esm/vega-image-uploader.entry.js +15 -15
  357. package/dist/esm/vega-input-credit-card.entry.js +14 -14
  358. package/dist/esm/vega-input-numeric.entry.js +14 -14
  359. package/dist/esm/vega-input-passcode.entry.js +13 -13
  360. package/dist/esm/vega-input-phone-number.entry.js +55 -274
  361. package/dist/esm/vega-input-range.entry.js +12 -12
  362. package/dist/esm/vega-input-select.entry.js +41 -41
  363. package/dist/esm/vega-input.entry.js +16 -16
  364. package/dist/esm/{vega-internal-event-id-86fce049.js → vega-internal-event-id-02093067.js} +4 -2
  365. package/dist/esm/vega-item-toggle.entry.js +5 -5
  366. package/dist/esm/vega-left-nav_5.entry.js +16 -16
  367. package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
  368. package/dist/esm/vega-page-notification_2.entry.js +4 -4
  369. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +6 -6
  370. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +6 -6
  371. package/dist/esm/vega-pagination.entry.js +11 -11
  372. package/dist/esm/vega-popover_2.entry.js +65 -16
  373. package/dist/esm/vega-progress-tracker_2.entry.js +12 -12
  374. package/dist/esm/vega-radio_2.entry.js +15 -15
  375. package/dist/esm/vega-rich-text-content.entry.js +18 -15
  376. package/dist/esm/vega-rich-text-editor_4.entry.js +715 -253
  377. package/dist/esm/vega-rich-text-find-replace-panel.entry.js +8 -8
  378. package/dist/esm/vega-rich-text-special-characters-panel.entry.js +10 -10
  379. package/dist/esm/vega-rich-text-table-properties_3.entry.js +163 -110
  380. package/dist/esm/vega-segment-control.entry.js +13 -6
  381. package/dist/esm/vega-selection-chip_2.entry.js +14 -14
  382. package/dist/esm/vega-selection-tile_2.entry.js +12 -12
  383. package/dist/esm/vega-sidenav_3.entry.js +12 -12
  384. package/dist/esm/vega-signature-capture.entry.js +14 -14
  385. package/dist/esm/vega-stepper.entry.js +10 -10
  386. package/dist/esm/vega-tab-group_2.entry.js +9 -9
  387. package/dist/esm/vega-table_11.entry.js +627 -668
  388. package/dist/esm/vega-textarea.entry.js +10 -10
  389. package/dist/esm/vega-time-picker_2.entry.js +18 -18
  390. package/dist/esm/vega-toggle-switch.entry.js +10 -10
  391. package/dist/esm/vega-tooltip_2.entry.js +9 -9
  392. package/dist/esm/vega.js +19 -18
  393. package/dist/esm/{wait-for-component-did-render-ff7062aa.js → wait-for-component-did-render-9e84d92d.js} +2 -2
  394. package/dist/sri/vega-sri-manifest.json +415 -407
  395. package/dist/types/components/vega-button/vega-button.d.ts +2 -0
  396. package/dist/types/components/vega-button-group/types.d.ts +12 -6
  397. package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.d.ts +18 -0
  398. package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.d.ts +9 -0
  399. package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.d.ts +9 -1
  400. package/dist/types/components/vega-calendar/types.d.ts +22 -0
  401. package/dist/types/components/vega-calendar/vega-calendar.d.ts +23 -1
  402. package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +1 -1
  403. package/dist/types/components/vega-field-label/slimmers/renderers/vega-field-label-label-announcement-renderer.d.ts +3 -10
  404. package/dist/types/components/vega-flag-icon/slimmers/controllers/vega-flag-icon-controller.d.ts +2 -2
  405. package/dist/types/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.d.ts +0 -1
  406. package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +8 -0
  407. package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-prefix-icon-renderer.d.ts +2 -14
  408. package/dist/types/components/vega-input-select/vega-input-select.d.ts +1 -0
  409. package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.d.ts +33 -0
  410. package/dist/types/components/vega-modal/types.d.ts +2 -1
  411. package/dist/types/components/vega-popover/slimmers/renderers/vega-popover-appender-renderer.d.ts +9 -0
  412. package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +6 -0
  413. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/commit-value-strategy.d.ts +13 -0
  414. package/dist/types/components/vega-rich-text-editor/dto/actions/commit-value-action.d.ts +20 -0
  415. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +6 -0
  416. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +4 -0
  417. package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +11 -1
  418. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +6 -0
  419. package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +4 -0
  420. package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +6 -0
  421. package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +4 -0
  422. package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +5 -0
  423. package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/renderers/find-replace-toolbar-button-renderer.d.ts +19 -0
  424. package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +4 -0
  425. package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.d.ts +14 -1
  426. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.d.ts +2 -2
  427. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +31 -1
  428. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-popover-base-renderer.d.ts +91 -0
  429. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +46 -0
  430. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.d.ts +58 -0
  431. package/dist/types/components/vega-rich-text-editor/extensions/table/table-selection.d.ts +8 -0
  432. 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 +2 -1
  433. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.d.ts +2 -0
  434. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.d.ts +3 -0
  435. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.d.ts +3 -1
  436. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.d.ts +1 -0
  437. package/dist/types/components/vega-rich-text-editor/extensions/word-count/action-handler-interceptors/prevent-hard-limit-exceed-interceptor.d.ts +38 -0
  438. package/dist/types/components/vega-rich-text-editor/extensions/word-count/type.d.ts +46 -0
  439. package/dist/types/components/vega-rich-text-editor/extensions/word-count/word-count-extension.d.ts +38 -0
  440. package/dist/types/components/vega-rich-text-editor/interface.d.ts +12 -0
  441. package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -0
  442. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +11 -1
  443. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/word-count-controller.d.ts +40 -0
  444. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.d.ts +14 -0
  445. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +3 -1
  446. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +3 -2
  447. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +12 -0
  448. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.d.ts +2 -0
  449. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +4 -0
  450. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.d.ts +68 -0
  451. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +3 -0
  452. package/dist/types/components/vega-segment-control/slimmers/renderers/vega-segment-renderer.d.ts +1 -0
  453. package/dist/types/components/vega-segment-control/types.d.ts +2 -0
  454. package/dist/types/components/vega-segment-control/vega-segment-control.d.ts +7 -1
  455. package/dist/types/components/vega-table/slimmers/controllers/dto/column-render-input-model.d.ts +17 -0
  456. package/dist/types/components/vega-table/slimmers/controllers/dto/row-render-input-model.d.ts +39 -0
  457. package/dist/types/components/vega-table/slimmers/controllers/vega-table-render-input-controller.d.ts +71 -7
  458. package/dist/types/components/vega-table/slimmers/renderers/vega-table-body-renderer.d.ts +1 -0
  459. package/dist/types/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.d.ts +3 -88
  460. package/dist/types/components/vega-table/vega-table-expand-row/slimmers/renderers/vega-table-expand-row-renderer.d.ts +1 -1
  461. package/dist/types/components/vega-table/vega-table-expand-row/vega-table-expand-row.d.ts +5 -0
  462. package/dist/types/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.d.ts +1 -0
  463. package/dist/types/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.d.ts +5 -0
  464. package/dist/types/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.d.ts +1 -3
  465. package/dist/types/components/vega-table/vega-table-foot-row/vega-table-foot-row.d.ts +5 -0
  466. package/dist/types/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.d.ts +0 -4
  467. package/dist/types/components/vega-table/vega-table-head-row/vega-table-head-row.d.ts +2 -2
  468. package/dist/types/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.d.ts +2 -3
  469. package/dist/types/components/vega-table/vega-table-row/vega-table-row.d.ts +4 -0
  470. package/dist/types/components.d.ts +33 -2
  471. package/dist/types/constants/ui.d.ts +1 -1
  472. package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
  473. package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +3 -1
  474. package/dist/types/helpers/keyboard/keyboard-manager.d.ts +9 -0
  475. package/dist/types/helpers/keyboard/overlay-escape-coordination.d.ts +28 -0
  476. package/dist/types/helpers/public-api.d.ts +1 -0
  477. package/dist/types/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.d.ts +1 -1
  478. package/dist/types/helpers/slimmers/position-calculation/position-calculation-controller.d.ts +6 -0
  479. package/dist/types/helpers/slimmers/position-calculation/screen-position-calculation-strategy.d.ts +6 -0
  480. package/dist/types/helpers/slimmers/position-calculation/screen-scroll-position-update.d.ts +2 -1
  481. package/dist/types/helpers/slimmers/vega-table-child-render-input-consumer-slimmer.d.ts +2 -1
  482. package/dist/types/helpers/translation/interface.d.ts +16 -1
  483. package/dist/types/polyfill/libphonenumber/as-you-type.d.ts +1 -0
  484. package/dist/types/polyfill/libphonenumber/metadata.d.ts +10 -0
  485. package/dist/types/types/components.type.d.ts +7 -1
  486. package/dist/types/types/public-api.d.ts +2 -0
  487. package/dist/types/utils/accessibility.d.ts +9 -0
  488. package/dist/vega/index.esm.js +1 -1
  489. package/dist/vega/p-022cbf8a.js +1 -0
  490. package/dist/vega/{p-c8ad7207.entry.js → p-02c1284e.entry.js} +1 -1
  491. package/dist/vega/{p-22edd3cc.js → p-069bbb4a.js} +1 -1
  492. package/dist/vega/p-08fd229c.js +1 -0
  493. package/dist/vega/{p-fcb6b499.js → p-0eea1ca8.js} +1 -1
  494. package/dist/vega/{p-ba6881da.entry.js → p-131ce9df.entry.js} +1 -1
  495. package/dist/vega/{p-024db952.entry.js → p-143ee395.entry.js} +1 -1
  496. package/dist/vega/p-178634f3.js +1 -0
  497. package/dist/vega/{p-9e9f49f4.js → p-1836a6a5.js} +1 -1
  498. package/dist/vega/p-1dbf8d1f.js +1 -0
  499. package/dist/vega/{p-d4d90ce2.entry.js → p-2b26e182.entry.js} +1 -1
  500. package/dist/vega/p-2dda5c65.entry.js +1 -0
  501. package/dist/vega/{p-df63c2fb.entry.js → p-30010c41.entry.js} +1 -1
  502. package/dist/vega/p-32f5a6dd.entry.js +1 -0
  503. package/dist/vega/{p-3c8421d5.entry.js → p-3460a1c5.entry.js} +1 -1
  504. package/dist/vega/p-34b523da.entry.js +1 -0
  505. package/dist/vega/p-357c0226.entry.js +1 -0
  506. package/dist/vega/p-361f8996.js +1 -0
  507. package/dist/vega/{p-526e3634.js → p-36a57431.js} +1 -1
  508. package/dist/vega/p-36ee9d54.js +1 -0
  509. package/dist/vega/{p-6659c910.entry.js → p-37d5c37e.entry.js} +1 -1
  510. package/dist/vega/{p-47a48329.entry.js → p-3d6a43df.entry.js} +1 -1
  511. package/dist/vega/{p-0ca3b4bf.entry.js → p-45ad2d90.entry.js} +1 -1
  512. package/dist/vega/{p-fb9475ab.entry.js → p-4b117bfd.entry.js} +1 -1
  513. package/dist/vega/p-4b35c748.js +1 -0
  514. package/dist/vega/{p-55dc3053.entry.js → p-4e23e56c.entry.js} +1 -1
  515. package/dist/vega/p-4e70836a.entry.js +1 -0
  516. package/dist/vega/{p-66647244.js → p-4ea477d5.js} +1 -1
  517. package/dist/vega/{p-5147c30d.entry.js → p-50e8e24f.entry.js} +1 -1
  518. package/dist/vega/{p-9c5289dc.entry.js → p-522a6eec.entry.js} +1 -1
  519. package/dist/vega/p-53e3f259.js +1 -0
  520. package/dist/vega/{p-2c737fc8.js → p-5536146c.js} +1 -1
  521. package/dist/vega/{p-944e284d.entry.js → p-55c2c0df.entry.js} +1 -1
  522. package/dist/vega/p-587130f6.entry.js +1 -0
  523. package/dist/vega/{p-9c9b0629.js → p-58c8a4ac.js} +1 -1
  524. package/dist/vega/{p-4f6aaac5.entry.js → p-594cb986.entry.js} +1 -1
  525. package/dist/vega/{p-b12de1bf.entry.js → p-5c17ddda.entry.js} +1 -1
  526. package/dist/vega/{p-7977352b.entry.js → p-5c9c0c0d.entry.js} +1 -1
  527. package/dist/vega/p-5f377954.js +1 -1
  528. package/dist/vega/p-60010f14.entry.js +1 -0
  529. package/dist/vega/p-6098c4bb.js +1 -0
  530. package/dist/vega/{p-2044eba9.js → p-60a74fb7.js} +1 -1
  531. package/dist/vega/p-61e63c0e.entry.js +1 -0
  532. package/dist/vega/{p-49d7cfed.entry.js → p-62254dc7.entry.js} +1 -1
  533. package/dist/vega/{p-2af1d8b8.entry.js → p-62ae9327.entry.js} +1 -1
  534. package/dist/vega/{p-b3c4943b.js → p-638b6a7d.js} +1 -1
  535. package/dist/vega/p-66245bc0.entry.js +1 -0
  536. package/dist/vega/{p-bdb5180c.js → p-68744e7e.js} +1 -1
  537. package/dist/vega/{p-f0a0fc77.entry.js → p-68ca8d3c.entry.js} +1 -1
  538. package/dist/vega/p-6a6c1279.js +1 -0
  539. package/dist/vega/{p-5e9e04f3.entry.js → p-6ae93679.entry.js} +1 -1
  540. package/dist/vega/{p-433b1395.entry.js → p-6d90d28d.entry.js} +1 -1
  541. package/dist/vega/p-6e9e7131.js +1 -0
  542. package/dist/vega/{p-014cd411.js → p-6eedbc4f.js} +1 -1
  543. package/dist/vega/{p-c348eaf5.js → p-6fae6768.js} +1 -1
  544. package/dist/vega/p-71813a9e.entry.js +1 -0
  545. package/dist/vega/{p-860e76f5.entry.js → p-729529d6.entry.js} +1 -1
  546. package/dist/vega/{p-aa433430.entry.js → p-75bfbffe.entry.js} +1 -1
  547. package/dist/vega/{p-d6023dc0.entry.js → p-764b4e51.entry.js} +1 -1
  548. package/dist/vega/p-77bcdd35.js +1 -0
  549. package/dist/vega/{p-c41a2d4a.js → p-7d3419c7.js} +1 -1
  550. package/dist/vega/p-8387896e.js +1 -0
  551. package/dist/vega/p-853a05eb.js +1 -0
  552. package/dist/vega/{p-db11134b.entry.js → p-8e8b5790.entry.js} +1 -1
  553. package/dist/vega/{p-444e24c6.js → p-8ebe30a8.js} +1 -1
  554. package/dist/vega/p-8f00dfe6.js +1 -0
  555. package/dist/vega/{p-4022412e.entry.js → p-9236b8d9.entry.js} +1 -1
  556. package/dist/vega/p-9402f32f.js +1 -0
  557. package/dist/vega/{p-691bdc20.js → p-941a83db.js} +1 -1
  558. package/dist/vega/{p-840444c9.entry.js → p-942f9ea6.entry.js} +1 -1
  559. package/dist/vega/{p-5110c84f.js → p-96c090c4.js} +1 -1
  560. package/dist/vega/{p-328ebbdb.entry.js → p-9fdf66a8.entry.js} +1 -1
  561. package/dist/vega/{p-867cc602.entry.js → p-a2c45173.entry.js} +1 -1
  562. package/dist/vega/{p-66fe8b4e.entry.js → p-a54ed341.entry.js} +1 -1
  563. package/dist/vega/{p-44999c88.entry.js → p-a6a89f09.entry.js} +1 -1
  564. package/dist/vega/{p-ccbed811.entry.js → p-a8a246e8.entry.js} +1 -1
  565. package/dist/vega/p-a93b3aed.js +1 -0
  566. package/dist/vega/{p-528748fa.js → p-aa135628.js} +1 -1
  567. package/dist/vega/{p-a1f220ca.js → p-ab9d53e9.js} +1 -1
  568. package/dist/vega/{p-e18c0656.entry.js → p-af0cfea0.entry.js} +1 -1
  569. package/dist/vega/p-af0e9bd5.entry.js +1 -0
  570. package/dist/vega/{p-daba4af1.js → p-b1557bbe.js} +1 -1
  571. package/dist/vega/{p-f13b39d8.js → p-b2a4314a.js} +1 -1
  572. package/dist/vega/p-b94f164a.entry.js +1 -0
  573. package/dist/vega/{p-23c1f378.entry.js → p-b97ed9f7.entry.js} +1 -1
  574. package/dist/vega/{p-1a37d63c.entry.js → p-bbfffe6b.entry.js} +1 -1
  575. package/dist/vega/{p-aa914dbd.entry.js → p-beccc38c.entry.js} +1 -1
  576. package/dist/vega/{p-dd0bd78b.js → p-c34f4cbc.js} +1 -1
  577. package/dist/vega/p-c51de680.js +3 -0
  578. package/dist/vega/{p-e1c82ca9.js → p-c576e846.js} +1 -1
  579. package/dist/vega/p-c601eea6.js +1 -0
  580. package/dist/vega/{p-200c8914.entry.js → p-c6d2513c.entry.js} +1 -1
  581. package/dist/vega/{p-d62e618a.entry.js → p-ca6bd3a0.entry.js} +1 -1
  582. package/dist/vega/{p-ce82d6bb.entry.js → p-cab890be.entry.js} +1 -1
  583. package/dist/vega/p-cb1cd15f.entry.js +1 -0
  584. package/dist/vega/p-d1f47512.js +1 -0
  585. package/dist/vega/{p-66a785d0.entry.js → p-d37d2ea4.entry.js} +1 -1
  586. package/dist/vega/{p-2f89ee14.entry.js → p-d3e99d4a.entry.js} +1 -1
  587. package/dist/vega/{p-f9bfee81.entry.js → p-d6bd3ce4.entry.js} +1 -1
  588. package/dist/vega/{p-f2384411.entry.js → p-d7838f6e.entry.js} +1 -1
  589. package/dist/vega/{p-a4360b7e.entry.js → p-d8c9ea46.entry.js} +1 -1
  590. package/dist/vega/p-d9588b3f.entry.js +1 -0
  591. package/dist/vega/p-db69a5c9.entry.js +1 -0
  592. package/dist/vega/{p-50eda925.js → p-de1d0284.js} +1 -1
  593. package/dist/vega/{p-3c559c8b.js → p-de6fc52c.js} +1 -1
  594. package/dist/vega/{p-fa5cd8b1.js → p-e14323f3.js} +1 -1
  595. package/dist/vega/{p-bd7725f7.entry.js → p-e48b7a8a.entry.js} +1 -1
  596. package/dist/vega/p-e6f67a44.js +1 -0
  597. package/dist/vega/{p-7754b10f.entry.js → p-e8e3bf74.entry.js} +1 -1
  598. package/dist/vega/p-eadc10bc.entry.js +1 -0
  599. package/dist/vega/p-ee329596.entry.js +1 -0
  600. package/dist/vega/p-f01bc6a2.js +1 -0
  601. package/dist/vega/{p-94b54a95.js → p-f324e90e.js} +1 -1
  602. package/dist/vega/{p-f9a3805d.js → p-f48519d2.js} +1 -1
  603. package/dist/vega/{p-52878ea9.js → p-f485448a.js} +1 -1
  604. package/dist/vega/{p-4afd6715.entry.js → p-f8b2dbb9.entry.js} +1 -1
  605. package/dist/vega/{p-35d37477.entry.js → p-f8d13d01.entry.js} +1 -1
  606. package/dist/vega/{p-4370b954.entry.js → p-f902305d.entry.js} +1 -1
  607. package/dist/vega/{p-3c152bad.entry.js → p-f99f054c.entry.js} +1 -1
  608. package/dist/vega/{p-77fb3971.entry.js → p-fe41e3b6.entry.js} +1 -1
  609. package/dist/vega/vega.esm.js +1 -1
  610. package/package.json +1 -1
  611. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-keyboard-conttroller.js +0 -85
  612. package/dist/vega/p-0b2c4c0b.js +0 -1
  613. package/dist/vega/p-1fa22fda.js +0 -1
  614. package/dist/vega/p-2529820e.js +0 -1
  615. package/dist/vega/p-35628af4.js +0 -1
  616. package/dist/vega/p-3a230d4b.entry.js +0 -1
  617. package/dist/vega/p-3a620268.js +0 -1
  618. package/dist/vega/p-4473d8b1.js +0 -3
  619. package/dist/vega/p-4a2fe3a4.js +0 -1
  620. package/dist/vega/p-5447a8e8.js +0 -1
  621. package/dist/vega/p-5af312f8.js +0 -1
  622. package/dist/vega/p-5b3c8a56.js +0 -1
  623. package/dist/vega/p-6493f13a.entry.js +0 -1
  624. package/dist/vega/p-66728dd4.entry.js +0 -1
  625. package/dist/vega/p-67e88cd7.entry.js +0 -1
  626. package/dist/vega/p-67eaf77e.js +0 -1
  627. package/dist/vega/p-6d6b4495.entry.js +0 -1
  628. package/dist/vega/p-7b133734.entry.js +0 -1
  629. package/dist/vega/p-7b84a943.entry.js +0 -1
  630. package/dist/vega/p-83ad8988.js +0 -1
  631. package/dist/vega/p-8c30a60d.js +0 -1
  632. package/dist/vega/p-8d2a9012.js +0 -1
  633. package/dist/vega/p-8d4be607.js +0 -1
  634. package/dist/vega/p-8d77c7cf.js +0 -1
  635. package/dist/vega/p-8f3b93db.js +0 -1
  636. package/dist/vega/p-9c2b3279.js +0 -1
  637. package/dist/vega/p-9c9ff871.entry.js +0 -1
  638. package/dist/vega/p-9d90e271.entry.js +0 -1
  639. package/dist/vega/p-a7517760.entry.js +0 -1
  640. package/dist/vega/p-c8fb3aac.entry.js +0 -1
  641. package/dist/vega/p-cede3535.js +0 -1
  642. package/dist/vega/p-cf4b3d40.entry.js +0 -1
  643. package/dist/vega/p-d35a31a5.entry.js +0 -1
  644. package/dist/vega/p-ded1ecc1.entry.js +0 -1
  645. package/dist/vega/p-e1a65e06.entry.js +0 -1
  646. package/dist/vega/p-e469ba27.entry.js +0 -1
  647. package/dist/vega/p-e4c5cb4f.js +0 -1
  648. package/dist/vega/p-fd23c365.entry.js +0 -1
  649. /package/dist/types/components/vega-dropdown/slimmers/controllers/{vega-dropdown-keyboard-conttroller.d.ts → vega-dropdown-keyboard-controller.d.ts} +0 -0
@@ -2,13 +2,13 @@
2
2
 
3
3
  const changeManager = require('./change-manager-a297e4d2.js');
4
4
  const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-c82df135.js');
5
- const vegaInternalEventId = require('./vega-internal-event-id-f4d33037.js');
5
+ const vegaInternalEventId = require('./vega-internal-event-id-98d499d7.js');
6
6
  const string = require('./string-39438062.js');
7
7
  const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
8
- const typeGuard = require('./type-guard-b8d7bb3f.js');
8
+ const typeGuard = require('./type-guard-00b8efc0.js');
9
9
  const typography = require('./typography-3ea4fe41.js');
10
10
  const misc = require('./misc-3d30df91.js');
11
- const darkModeStyleController = require('./dark-mode-style-controller-f3da3342.js');
11
+ const darkModeStyleController = require('./dark-mode-style-controller-ec04ece9.js');
12
12
  const object = require('./object-b53e9416.js');
13
13
  const ui = require('./ui-c91c37a7.js');
14
14
 
@@ -1597,6 +1597,14 @@ class RTENode {
1597
1597
  isTextNode() {
1598
1598
  return false;
1599
1599
  }
1600
+ /**
1601
+ * Get the plain text content of the node, used for character counting. Default implementation returns an empty string, subclasses should override this method to provide the actual plain text content.
1602
+ *
1603
+ * @returns {string} The plain text content of the node.
1604
+ */
1605
+ getPlainText() {
1606
+ return '';
1607
+ }
1600
1608
  /**
1601
1609
  * Get the HTMLElement reference associated with this node.
1602
1610
  *
@@ -1903,6 +1911,17 @@ class RTEBlock {
1903
1911
  }
1904
1912
  return firstItem;
1905
1913
  }
1914
+ /**
1915
+ * Get the plain text content of the block, used for character counting.
1916
+ *
1917
+ * @returns {string} The concatenated plain text of all child nodes and blocks.
1918
+ */
1919
+ getPlainText() {
1920
+ var _a;
1921
+ return ((_a = this.children) !== null && _a !== void 0 ? _a : [])
1922
+ .map((child) => child.getPlainText())
1923
+ .join('');
1924
+ }
1906
1925
  /**
1907
1926
  * Check if the block is a list item block
1908
1927
  *
@@ -2016,12 +2035,186 @@ class RTEBlock {
2016
2035
  }
2017
2036
  }
2018
2037
 
2038
+ /**
2039
+ * Append children to a block or rte content
2040
+ *
2041
+ * @example parent.apply(new AppendChildrenAction([newChildren]))
2042
+ */
2043
+ class AppendChildrenAction extends ModifyContentAction {
2044
+ constructor(childNodes) {
2045
+ super();
2046
+ this.type = exports.ModifyContentActionType.APPEND_CHILDREN;
2047
+ this.entityToBeAppended = childNodes;
2048
+ }
2049
+ }
2050
+
2051
+ const TEXT_STYLE_DEFAULT_FONT_WEIGHT = '500';
2052
+ const TEXT_STYLE_BASE = {
2053
+ fontFamily: 'Inter',
2054
+ fontSize: '16px',
2055
+ lineHeight: '22px',
2056
+ minHeight: '22px',
2057
+ fontWeight: TEXT_STYLE_DEFAULT_FONT_WEIGHT,
2058
+ };
2059
+ const PARAGRAPH_TEXT_STYLE = Object.assign(Object.assign({}, TEXT_STYLE_BASE), { marginTop: '0px', marginBottom: '0px' });
2060
+ const TEXT_STYLE_DEFAULTS = {
2061
+ 'paragraph': PARAGRAPH_TEXT_STYLE,
2062
+ 'title': Object.assign(Object.assign({}, TEXT_STYLE_BASE), { fontSize: '36px', lineHeight: '40px', minHeight: '40px' }),
2063
+ 'subtitle': Object.assign(Object.assign({}, TEXT_STYLE_BASE), { fontSize: '28px', lineHeight: '32px', minHeight: '32px' }),
2064
+ 'heading-1': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '22px', lineHeight: '24px', minHeight: '24px' }),
2065
+ 'heading-2': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '20px', lineHeight: '24px', minHeight: '24px' }),
2066
+ 'heading-3': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '18px' }),
2067
+ 'heading-4': Object.assign({}, PARAGRAPH_TEXT_STYLE),
2068
+ 'heading-5': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '14px' }),
2069
+ 'heading-6': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '12px' }),
2070
+ };
2071
+
2072
+ /**
2073
+ * Text style annotation
2074
+ */
2075
+ class TextStyleAnnotation extends BlockAnnotation {
2076
+ constructor(textStyle) {
2077
+ super();
2078
+ this.type = exports.BlockAnnotationTypeEnum.TEXT_STYLE;
2079
+ this.textStyle = textStyle;
2080
+ }
2081
+ /**
2082
+ * Generate the map item for the annotations
2083
+ *
2084
+ * @param {VegaRTETextStyleType} textStyle - the text style type
2085
+ * @returns {[BlockAnnotationTypeEnum.TEXT_STYLE, TextStyleAnnotation]} Map item for the annotation
2086
+ */
2087
+ static from(textStyle) {
2088
+ return [exports.BlockAnnotationTypeEnum.TEXT_STYLE, new TextStyleAnnotation(textStyle)];
2089
+ }
2090
+ /**
2091
+ * Get the default styles for a given text style type.
2092
+ *
2093
+ * @param {VegaRTETextStyleType} textStyle - The text style type.
2094
+ * @returns {Nullable<AnnotationStyle>} The default styles for the given text style type.
2095
+ */
2096
+ static getDefaultStyles(textStyle) {
2097
+ if (!textStyle)
2098
+ return null;
2099
+ return TEXT_STYLE_DEFAULTS[textStyle];
2100
+ }
2101
+ /**
2102
+ * Generate the JSON representation of the annotation
2103
+ *
2104
+ * @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
2105
+ */
2106
+ toJSON() {
2107
+ return { textStyle: this.textStyle };
2108
+ }
2109
+ /**
2110
+ * @inheritDoc
2111
+ */
2112
+ clone() {
2113
+ return new TextStyleAnnotation(this.textStyle);
2114
+ }
2115
+ /**
2116
+ * @inheritDoc
2117
+ */
2118
+ renderClass(options) {
2119
+ if (options === null || options === void 0 ? void 0 : options.standalone)
2120
+ return null;
2121
+ return this.textStyle ? `v-rte--text-style-${this.textStyle}` : null;
2122
+ }
2123
+ /**
2124
+ * @inheritDoc
2125
+ */
2126
+ renderStyle(options) {
2127
+ if (!(options === null || options === void 0 ? void 0 : options.standalone))
2128
+ return null;
2129
+ return this.textStyle ? TextStyleAnnotation.getDefaultStyles(this.textStyle) : null;
2130
+ }
2131
+ }
2132
+
2019
2133
  /**
2020
2134
  * Abstract class for annotation actions
2021
2135
  */
2022
2136
  class AnnotationAction {
2023
2137
  }
2024
2138
 
2139
+ /**
2140
+ * Action to change the text style of a block
2141
+ */
2142
+ class TextStyleAnnotationAction extends AnnotationAction {
2143
+ constructor(textStyle, bold) {
2144
+ super();
2145
+ this.isFlushable = true;
2146
+ this.textStyle = textStyle;
2147
+ this.bold = bold;
2148
+ }
2149
+ /**
2150
+ * Converts the action to a block annotation
2151
+ *
2152
+ * @returns {BlockAnnotation} the block annotation
2153
+ */
2154
+ toAnnotation() {
2155
+ return new TextStyleAnnotation(this.textStyle);
2156
+ }
2157
+ }
2158
+
2159
+ /**
2160
+ * Annotation to make text a link
2161
+ */
2162
+ class LinkAnnotation extends NodeAnnotation {
2163
+ constructor(link, useInternalStyle = true) {
2164
+ super();
2165
+ this.type = exports.NodeAnnotationTypeEnum.LINK;
2166
+ this.link = link;
2167
+ this.useInternalStyle = useInternalStyle;
2168
+ }
2169
+ /**
2170
+ * Generate the map item for the annotation
2171
+ *
2172
+ * @param {VegaRTELink} link - Bold annotation
2173
+ * @param {boolean} useInternalStyle - Whether to use default style for the link
2174
+ * @returns {[NodeAnnotationTypeEnum.LINK, LinkAnnotation]} Map item for the annotation
2175
+ */
2176
+ static from(link, useInternalStyle = true) {
2177
+ return [exports.NodeAnnotationTypeEnum.LINK, new LinkAnnotation(link, useInternalStyle)];
2178
+ }
2179
+ /**
2180
+ * Generate the JSON representation of the annotation
2181
+ *
2182
+ * @returns {Record<'link', VegaRTELink>} JSON representation of the annotation
2183
+ */
2184
+ toJSON() {
2185
+ return {
2186
+ link: this.link,
2187
+ };
2188
+ }
2189
+ /**
2190
+ * @inheritDoc
2191
+ */
2192
+ clone() {
2193
+ return new LinkAnnotation(this.link, this.useInternalStyle);
2194
+ }
2195
+ /**
2196
+ * Verify whether two link annotation is same or not
2197
+ *
2198
+ * @param {LinkAnnotation} annotation - Compared annotation
2199
+ * @returns {boolean} Whether two link annotation is same or not
2200
+ */
2201
+ toEqual(annotation) {
2202
+ return this.link.groupKey === annotation.link.groupKey;
2203
+ }
2204
+ /**
2205
+ * @inheritDoc
2206
+ */
2207
+ renderClass() {
2208
+ return null;
2209
+ }
2210
+ /**
2211
+ * @inheritDoc
2212
+ */
2213
+ renderStyle() {
2214
+ return null;
2215
+ }
2216
+ }
2217
+
2025
2218
  /**
2026
2219
  * Abstract class for which can be splittable
2027
2220
  */
@@ -2036,21 +2229,48 @@ class TextSplittableAction extends AnnotationAction {
2036
2229
  }
2037
2230
 
2038
2231
  /**
2039
- * Annotation to represent a selection range
2232
+ * Action to toggle link annotation
2040
2233
  */
2041
- class SelectionRangeAnnotation extends Annotation {
2042
- constructor(range) {
2234
+ class LinkAnnotationAction extends TextSplittableAction {
2235
+ constructor({ link, newText, needMergeNode, doSplit, type, }) {
2043
2236
  super();
2044
- this.type = exports.InternalAnnotationTypeEnum.SELECTION_RANGE;
2045
- this.range = range;
2237
+ this.isFlushable = true;
2238
+ this.link = link;
2239
+ this.needMergeNode = needMergeNode;
2240
+ this.newText = newText;
2241
+ this.type = type;
2242
+ if (typeGuard.isNonNullable(doSplit)) {
2243
+ this.doSplit = doSplit;
2244
+ }
2046
2245
  }
2047
2246
  /**
2048
- * Clone the selection range annotation
2247
+ * Converts the action to an annotation
2049
2248
  *
2050
- * @returns {SelectionRangeAnnotation} A cloned instance of the selection range annotation
2249
+ * @returns {LinkAnnotation} the annotation
2051
2250
  */
2052
- clone() {
2053
- return new SelectionRangeAnnotation(this.range);
2251
+ toAnnotation() {
2252
+ return new LinkAnnotation(this.link);
2253
+ }
2254
+ }
2255
+
2256
+ /**
2257
+ * Action to link a group of nodes
2258
+ */
2259
+ class LinkGroupAnnotationAction extends AnnotationAction {
2260
+ constructor(groupKey, nodes, type) {
2261
+ super();
2262
+ this.isFlushable = false;
2263
+ this.groupKey = groupKey;
2264
+ this.nodes = nodes;
2265
+ this.type = type;
2266
+ }
2267
+ /**
2268
+ * Converts the action to an annotation
2269
+ *
2270
+ * @returns {Annotation} The annotation
2271
+ */
2272
+ toAnnotation() {
2273
+ return new LinkGroupAnnotation(this.groupKey);
2054
2274
  }
2055
2275
  }
2056
2276
 
@@ -2078,22 +2298,22 @@ const CODE_FONT_FAMILY = 'Roboto Mono';
2078
2298
  const CODE_WHITE_SPACE = 'pre-wrap';
2079
2299
 
2080
2300
  /**
2081
- * Annotation to make text with strikethrough
2301
+ * Annotation to make text bold
2082
2302
  */
2083
- class StrikethroughAnnotation extends NodeAnnotation {
2084
- constructor(underline) {
2303
+ class BoldAnnotation extends NodeAnnotation {
2304
+ constructor(bold) {
2085
2305
  super();
2086
- this.type = exports.NodeAnnotationTypeEnum.STRIKETHROUGH;
2087
- this.strikethrough = underline;
2306
+ this.type = exports.NodeAnnotationTypeEnum.BOLD;
2307
+ this.bold = bold;
2088
2308
  }
2089
2309
  /**
2090
2310
  * Generate the map item for the annotation
2091
2311
  *
2092
- * @param {Nullable<boolean>} strikethrough - Strikethrough annotation
2093
- * @returns {[NodeAnnotationTypeEnum.STRIKETHROUGH, StrikethroughAnnotation]} Map item for the annotation
2312
+ * @param {boolean} bold - Bold annotation
2313
+ * @returns {[NodeAnnotationTypeEnum.BOLD, BoldAnnotation]} Map item for the annotation
2094
2314
  */
2095
- static from(strikethrough) {
2096
- return [exports.NodeAnnotationTypeEnum.STRIKETHROUGH, new StrikethroughAnnotation(strikethrough)];
2315
+ static from(bold) {
2316
+ return [exports.NodeAnnotationTypeEnum.BOLD, new BoldAnnotation(bold)];
2097
2317
  }
2098
2318
  /**
2099
2319
  * Generate the JSON representation of the annotation
@@ -2102,14 +2322,14 @@ class StrikethroughAnnotation extends NodeAnnotation {
2102
2322
  */
2103
2323
  toJSON() {
2104
2324
  return {
2105
- strikethrough: this.strikethrough,
2325
+ bold: this.bold,
2106
2326
  };
2107
2327
  }
2108
2328
  /**
2109
2329
  * @inheritDoc
2110
2330
  */
2111
2331
  clone() {
2112
- return new StrikethroughAnnotation(this.strikethrough);
2332
+ return new BoldAnnotation(this.bold);
2113
2333
  }
2114
2334
  /**
2115
2335
  * @inheritDoc
@@ -2117,7 +2337,7 @@ class StrikethroughAnnotation extends NodeAnnotation {
2117
2337
  renderClass(options) {
2118
2338
  if (options === null || options === void 0 ? void 0 : options.standalone)
2119
2339
  return null;
2120
- return this.strikethrough ? 'v-rte--strikethrough' : null;
2340
+ return this.bold ? 'v-rte--bold' : null;
2121
2341
  }
2122
2342
  /**
2123
2343
  * @inheritDoc
@@ -2125,27 +2345,383 @@ class StrikethroughAnnotation extends NodeAnnotation {
2125
2345
  renderStyle(options) {
2126
2346
  if (!(options === null || options === void 0 ? void 0 : options.standalone))
2127
2347
  return null;
2128
- return this.strikethrough ? { textDecoration: STRIKETHROUGH_TEXT_DECORATION } : null;
2348
+ return this.bold ? { fontWeight: BOLD_FONT_WEIGHT } : null;
2129
2349
  }
2130
2350
  }
2131
2351
 
2132
2352
  /**
2133
- * Annotation to make text with underline
2353
+ * Action to toggle bold annotation
2134
2354
  */
2135
- class UnderlineAnnotation extends NodeAnnotation {
2355
+ class BoldAnnotationAction extends TextSplittableAction {
2356
+ constructor(bold) {
2357
+ super();
2358
+ this.isFlushable = true;
2359
+ this.bold = bold;
2360
+ }
2361
+ /**
2362
+ * Converts the action to an annotation
2363
+ *
2364
+ * @returns {BoldAnnotation} the annotation
2365
+ */
2366
+ toAnnotation() {
2367
+ return new BoldAnnotation(this.bold);
2368
+ }
2369
+ }
2370
+
2371
+ /**
2372
+ * Delete the node annotation by type
2373
+ */
2374
+ class DeleteNodeAnnotationAction extends AnnotationAction {
2375
+ constructor(annotationType) {
2376
+ super();
2377
+ this.isFlushable = true;
2378
+ this.annotationType = annotationType;
2379
+ }
2380
+ /**
2381
+ * Don't need this for this action
2382
+ *
2383
+ * @returns {Nullable<Annotation>} undefined
2384
+ */
2385
+ toAnnotation() {
2386
+ return undefined;
2387
+ }
2388
+ }
2389
+
2390
+ /**
2391
+ * The base action handle strategy class, use to modify the rich text node content or modify the annotation.
2392
+ */
2393
+ class ActionHandleStrategy {
2394
+ /**
2395
+ * Public method to invoke the handle logic.
2396
+ *
2397
+ * @typedef R generic type
2398
+ * @param {ModifyContentAction | AnnotationAction} action - The action instance. Contains the action type and necessary params.
2399
+ * @param {RTENode | RTEBlock | VegaRTEContent} target - The rich text node instance that will be modified.
2400
+ * @returns {R} - The invoke result in special strategy.
2401
+ */
2402
+ execute(action, target) {
2403
+ globalSlimmerRegistry.LogUtility.log(`Executing action ${action.constructor.name} on ${target.constructor.name} ${target['id']}`);
2404
+ return this.handleAction(action, target);
2405
+ }
2406
+ /**
2407
+ * Update the custom style annotation of a block or node
2408
+ *
2409
+ * @param {RTEBlock | RTETextNode} item - block or node
2410
+ * @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
2411
+ */
2412
+ updateCustomStyleAnnotation(item, styleKeys) {
2413
+ const customStyleAnnotation = item.annotationMap.get(exports.CommonAnnotationTypeEnum.CUSTOM_STYLE);
2414
+ if (customStyleAnnotation && this.isCustomStyle(customStyleAnnotation, styleKeys)) {
2415
+ item.annotationMap.set(customStyleAnnotation.type, new CustomStyleAnnotation(customStyleAnnotation.removeStyles(styleKeys)));
2416
+ }
2417
+ }
2418
+ /**
2419
+ * Create a new paragraph block with the given text.
2420
+ *
2421
+ * @param {string} text - The text content for the new paragraph.
2422
+ * @returns {Nullable<RTETextBlock>} - The newly created paragraph block, or null if creation failed.
2423
+ */
2424
+ createNewParagraph(text) {
2425
+ const dtoClass = RTEDTOClassManager$1.getRTEBlockClass('paragraph');
2426
+ if (dtoClass) {
2427
+ const newParagraph = dtoClass.from({
2428
+ id: misc.generateUUID(),
2429
+ type: 'paragraph',
2430
+ nodes: [{ id: misc.generateUUID(), type: 'text', text }],
2431
+ });
2432
+ return newParagraph;
2433
+ }
2434
+ }
2435
+ /**
2436
+ * Get the root content from a child block or node.
2437
+ *
2438
+ * @param {RTEBlock | RTENode} child - The child block or node.
2439
+ * @returns {Nullable<VegaRTEContent>} The root content, if found.
2440
+ */
2441
+ getRootContent(child) {
2442
+ const parent = child.parent;
2443
+ if (parent) {
2444
+ if (parent.dtoName === 'VegaRTEContent') {
2445
+ return parent;
2446
+ }
2447
+ else {
2448
+ return this.getRootContent(parent);
2449
+ }
2450
+ }
2451
+ }
2452
+ /**
2453
+ * Check the caret position at the start of a block.
2454
+ *
2455
+ * @param {RTEBlock} block - The RTE Block.
2456
+ * @param {RTENode} node - The RTE Node.
2457
+ * @param {number} offset - The offset position.
2458
+ * @returns {boolean} - Whether the caret is at the start of the block.
2459
+ */
2460
+ isCaretPositionAtBlockStart(block, node, offset) {
2461
+ return node === block.children[0] && offset === 0;
2462
+ }
2463
+ /**
2464
+ * Check the caret position at the end of a block.
2465
+ *
2466
+ * @param {RTEBlock} block - The RTE Block.
2467
+ * @param {RTENode} node - The RTE Node.
2468
+ * @param {number} offset - The offset position.
2469
+ * @returns {boolean} - Whether the caret is at the end of the block.
2470
+ */
2471
+ isCaretPositionAtBlockEnd(block, node, offset) {
2472
+ if (!node.isContentEditable()) {
2473
+ return this.isCaretPositionAtDecoratorBlockEnd(block, node, offset);
2474
+ }
2475
+ else {
2476
+ return this.isCaretPositionAtTextBlockEnd(block, node, offset);
2477
+ }
2478
+ }
2479
+ /**
2480
+ * Get the registered DOM element by the RTE entity.
2481
+ *
2482
+ * @param {RTEBlock | RTENode} instance - The RTE block or node instance.
2483
+ * @returns {Nullable<HTMLElement>} The registered DOM element.
2484
+ */
2485
+ getDOMByEntity(instance) {
2486
+ return stateEntityRenderingRegistry.getDOMByEntity(instance);
2487
+ }
2488
+ /**
2489
+ * Checks if the caret position is at the end of a specified RTETextNode.
2490
+ *
2491
+ * @param {RTETextBlock} textBlock - `RTETextBlock` - a text block.
2492
+ * @param {RTETextNode} node - `RTETextNode` - a node representing an image in a rich text editor.
2493
+ * @param {number} startOffset - The position within the text node where the caret is located.
2494
+ * @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTETextNode.
2495
+ */
2496
+ isCaretPositionAtTextBlockEnd(textBlock, node, startOffset) {
2497
+ const lastNode = textBlock.children[textBlock.children.length - 1];
2498
+ return node === lastNode && (node.isEmpty() || startOffset === lastNode.text.length);
2499
+ }
2500
+ /**
2501
+ * Checks if the caret position is at the end of a given decorator node.
2502
+ *
2503
+ * @param {RTEBlock} target - The image block.
2504
+ * @param {RTENode} node - `node` is a RTEDecoratorNode or non-editable text node.
2505
+ * @param {number} startOffset - The position within the `RTEDecoratorNode` where the caret is located.
2506
+ * @returns {boolean}Returns a boolean value indicating whether the caret position is at the end of the `RTEDecoratorNode`.
2507
+ */
2508
+ isCaretPositionAtDecoratorBlockEnd(target, node, startOffset) {
2509
+ return node === target.children[target.children.length - 1] && startOffset !== 0;
2510
+ }
2511
+ /**
2512
+ * Determines if the custom style annotation includes any the custom style.
2513
+ *
2514
+ * @param {CustomStyleAnnotation} customStyleAnnotation - custom style annotation
2515
+ * @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
2516
+ * @returns {boolean} - True if the custom key includes the custom style, false otherwise.
2517
+ */
2518
+ isCustomStyle(customStyleAnnotation, styleKeys) {
2519
+ return styleKeys.some((item) => Object.keys(customStyleAnnotation.customStyle).includes(item));
2520
+ }
2521
+ }
2522
+
2523
+ /**
2524
+ * Update the text block text style strategy.
2525
+ */
2526
+ class BlockUpdateTextStyleStrategy extends ActionHandleStrategy {
2527
+ /**
2528
+ * Update the text block type and add or remove the bold style from child nodes.
2529
+ *
2530
+ * @param {TextStyleAnnotationAction} action - The text style annotation action.
2531
+ * @param {RTETextBlock} target - The current text block.
2532
+ */
2533
+ handleAction(action, target) {
2534
+ if (target.type !== 'list-item') {
2535
+ target.type = action.textStyle;
2536
+ }
2537
+ if (action.bold) {
2538
+ target.children.forEach((node) => {
2539
+ const boldAnnotationAction = new BoldAnnotationAction(true);
2540
+ boldAnnotationAction.doSplit = false;
2541
+ node.apply(boldAnnotationAction);
2542
+ });
2543
+ }
2544
+ else {
2545
+ target.children.forEach((node) => {
2546
+ node.apply(new DeleteNodeAnnotationAction(exports.NodeAnnotationTypeEnum.BOLD));
2547
+ });
2548
+ }
2549
+ this.updateCustomStyleAnnotation(target, ['fontFamily', 'lineHeight', 'fontWeight', 'fontSize']);
2550
+ }
2551
+ }
2552
+
2553
+ /**
2554
+ * Update the text block link group annotation strategy.
2555
+ */
2556
+ class BlockUpdateLinkGroupStrategy extends ActionHandleStrategy {
2557
+ /**
2558
+ * Update link group after the child link node update.
2559
+ *
2560
+ * @param {LinkGroupAnnotationAction} action - The link group annotation action instance.
2561
+ * @param {RTETextBlock} target - The current text block.
2562
+ */
2563
+ handleAction(action, target) {
2564
+ let linkGroupAnnotation = target.getAnnotationByType(exports.InternalAnnotationTypeEnum.LINK_GROUP);
2565
+ if (action.type === 'update_link') {
2566
+ if (linkGroupAnnotation) {
2567
+ const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey);
2568
+ if (linkGroup) {
2569
+ linkGroupAnnotation.linkGroups.set(action.groupKey, [linkGroup[0]]);
2570
+ }
2571
+ }
2572
+ }
2573
+ else {
2574
+ if (linkGroupAnnotation) {
2575
+ const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey) || [];
2576
+ linkGroupAnnotation.linkGroups.set(action.groupKey, [...linkGroup, ...action.nodes]);
2577
+ }
2578
+ else {
2579
+ linkGroupAnnotation = action.toAnnotation();
2580
+ linkGroupAnnotation.linkGroups.set(action.groupKey, [...action.nodes]);
2581
+ }
2582
+ target.annotationMap.set(exports.InternalAnnotationTypeEnum.LINK_GROUP, linkGroupAnnotation);
2583
+ }
2584
+ }
2585
+ }
2586
+
2587
+ /**
2588
+ * Insert a new children after a existing children
2589
+ *
2590
+ * @example parent.apply(new InsertChildrenAfterAction(existingChildren, newChildren, ...))
2591
+ */
2592
+ class InsertChildrenAfterAction extends ModifyContentAction {
2593
+ constructor(referBlock, ...blocksToBeInserted) {
2594
+ super();
2595
+ this.type = exports.ModifyContentActionType.INSERT_CHILDREN_AFTER;
2596
+ this.referChildren = referBlock;
2597
+ this.childrenToBeInserted = blocksToBeInserted;
2598
+ }
2599
+ }
2600
+
2601
+ /**
2602
+ * Clear the current block nodes and append new nodes
2603
+ *
2604
+ * @example block.apply(new ReplaceChildNodesAction(newNodes))
2605
+ */
2606
+ class ReplaceChildNodesAction extends ModifyContentAction {
2607
+ constructor(newChildNodes) {
2608
+ super();
2609
+ this.type = exports.ModifyContentActionType.REPLACE_CHILD_NODES;
2610
+ this.newChildNodes = newChildNodes;
2611
+ }
2612
+ }
2613
+
2614
+ /**
2615
+ * Split the current node with a special position strategy.
2616
+ */
2617
+ class BlockSplitWithTextNodeStrategy extends ActionHandleStrategy {
2618
+ /**
2619
+ * @inheritDoc
2620
+ */
2621
+ handleAction(action, target) {
2622
+ action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode, target);
2623
+ }
2624
+ /**
2625
+ * Splits a text node at a specified offset within a block of nodes and returns a new block with the split nodes.
2626
+ *
2627
+ * @param {RTETextNode} splitNode - The text node that will be split
2628
+ * @param {number} startOffsetOfNode - The index at which will split the text content of the `splitNode`.
2629
+ * @param {RTETextBlock} textBlock - The text block need to be splited.
2630
+ * @returns {Nullable<RTEBlock>} return either an RTEBlock object or null.
2631
+ */
2632
+ splitTextNodeBlock(splitNode, startOffsetOfNode, textBlock) {
2633
+ if (splitNode) {
2634
+ const beforeText = splitNode.text.slice(0, startOffsetOfNode);
2635
+ const afterText = splitNode.text.slice(startOffsetOfNode);
2636
+ const nodesSplitIndex = textBlock.children.indexOf(splitNode);
2637
+ if (nodesSplitIndex > -1) {
2638
+ const beforeNodes = textBlock.children.slice(0, nodesSplitIndex);
2639
+ const afterNodes = textBlock.children.slice(nodesSplitIndex + 1);
2640
+ if (splitNode.isContentEditable()) {
2641
+ if (beforeText) {
2642
+ beforeNodes.push(splitNode.cloneWithText(beforeText));
2643
+ }
2644
+ if (afterText) {
2645
+ afterNodes.unshift(splitNode.cloneWithText(afterText));
2646
+ }
2647
+ }
2648
+ else {
2649
+ startOffsetOfNode > 0 ? beforeNodes.push(splitNode) : afterNodes.unshift(splitNode);
2650
+ }
2651
+ textBlock.apply(new ReplaceChildNodesAction(beforeNodes));
2652
+ const newBlock = textBlock.cloneWithNodes(afterNodes);
2653
+ textBlock.parent.apply(new InsertChildrenAfterAction(textBlock, newBlock));
2654
+ return newBlock;
2655
+ }
2656
+ }
2657
+ }
2658
+ }
2659
+
2660
+ /**
2661
+ * Remove all nodes and append new nodes strategy.
2662
+ */
2663
+ class BlockReplaceNodesStrategy extends ActionHandleStrategy {
2664
+ /**
2665
+ * Empty the text block or image block nodes and add new nodes.
2666
+ *
2667
+ * @param {ReplaceChildNodesAction} action - The replace child nodes action instance.
2668
+ * @param {RTETextBlock | RTEImageBlock} target - The text block or the image block.
2669
+ */
2670
+ handleAction(action, target) {
2671
+ target.children = [];
2672
+ target.apply(new AppendChildrenAction(action.newChildNodes));
2673
+ }
2674
+ }
2675
+
2676
+ /**
2677
+ * Remove a children from the current block
2678
+ *
2679
+ * @example needRemovedChildren.parent.apply(new RemoveChildrenAction(needRemovedChildren))
2680
+ */
2681
+ class RemoveChildrenAction extends ModifyContentAction {
2682
+ constructor(childNode) {
2683
+ super();
2684
+ this.type = exports.ModifyContentActionType.DELETE_CHILDREN;
2685
+ this.entityToBeRemoved = childNode;
2686
+ }
2687
+ }
2688
+
2689
+ /**
2690
+ * Annotation to represent a selection range
2691
+ */
2692
+ class SelectionRangeAnnotation extends Annotation {
2693
+ constructor(range) {
2694
+ super();
2695
+ this.type = exports.InternalAnnotationTypeEnum.SELECTION_RANGE;
2696
+ this.range = range;
2697
+ }
2698
+ /**
2699
+ * Clone the selection range annotation
2700
+ *
2701
+ * @returns {SelectionRangeAnnotation} A cloned instance of the selection range annotation
2702
+ */
2703
+ clone() {
2704
+ return new SelectionRangeAnnotation(this.range);
2705
+ }
2706
+ }
2707
+
2708
+ /**
2709
+ * Annotation to make text with strikethrough
2710
+ */
2711
+ class StrikethroughAnnotation extends NodeAnnotation {
2136
2712
  constructor(underline) {
2137
2713
  super();
2138
- this.type = exports.NodeAnnotationTypeEnum.UNDERLINE;
2139
- this.underline = underline;
2714
+ this.type = exports.NodeAnnotationTypeEnum.STRIKETHROUGH;
2715
+ this.strikethrough = underline;
2140
2716
  }
2141
2717
  /**
2142
2718
  * Generate the map item for the annotation
2143
2719
  *
2144
- * @param {boolean} underline - Underline annotation
2145
- * @returns {[NodeAnnotationTypeEnum.UNDERLINE, UnderlineAnnotation]} Map item for the annotation
2720
+ * @param {Nullable<boolean>} strikethrough - Strikethrough annotation
2721
+ * @returns {[NodeAnnotationTypeEnum.STRIKETHROUGH, StrikethroughAnnotation]} Map item for the annotation
2146
2722
  */
2147
- static from(underline) {
2148
- return [exports.NodeAnnotationTypeEnum.UNDERLINE, new UnderlineAnnotation(underline)];
2723
+ static from(strikethrough) {
2724
+ return [exports.NodeAnnotationTypeEnum.STRIKETHROUGH, new StrikethroughAnnotation(strikethrough)];
2149
2725
  }
2150
2726
  /**
2151
2727
  * Generate the JSON representation of the annotation
@@ -2154,14 +2730,14 @@ class UnderlineAnnotation extends NodeAnnotation {
2154
2730
  */
2155
2731
  toJSON() {
2156
2732
  return {
2157
- underline: this.underline,
2733
+ strikethrough: this.strikethrough,
2158
2734
  };
2159
2735
  }
2160
2736
  /**
2161
2737
  * @inheritDoc
2162
2738
  */
2163
2739
  clone() {
2164
- return new UnderlineAnnotation(this.underline);
2740
+ return new StrikethroughAnnotation(this.strikethrough);
2165
2741
  }
2166
2742
  /**
2167
2743
  * @inheritDoc
@@ -2169,7 +2745,7 @@ class UnderlineAnnotation extends NodeAnnotation {
2169
2745
  renderClass(options) {
2170
2746
  if (options === null || options === void 0 ? void 0 : options.standalone)
2171
2747
  return null;
2172
- return this.underline ? 'v-rte--underline' : null;
2748
+ return this.strikethrough ? 'v-rte--strikethrough' : null;
2173
2749
  }
2174
2750
  /**
2175
2751
  * @inheritDoc
@@ -2177,27 +2753,27 @@ class UnderlineAnnotation extends NodeAnnotation {
2177
2753
  renderStyle(options) {
2178
2754
  if (!(options === null || options === void 0 ? void 0 : options.standalone))
2179
2755
  return null;
2180
- return this.underline ? { textDecoration: UNDERLINE_TEXT_DECORATION } : null;
2756
+ return this.strikethrough ? { textDecoration: STRIKETHROUGH_TEXT_DECORATION } : null;
2181
2757
  }
2182
2758
  }
2183
2759
 
2184
2760
  /**
2185
- * Annotation to make text Italic
2761
+ * Annotation to make text with underline
2186
2762
  */
2187
- class ItalicAnnotation extends NodeAnnotation {
2188
- constructor(italic) {
2763
+ class UnderlineAnnotation extends NodeAnnotation {
2764
+ constructor(underline) {
2189
2765
  super();
2190
- this.type = exports.NodeAnnotationTypeEnum.ITALIC;
2191
- this.italic = italic;
2766
+ this.type = exports.NodeAnnotationTypeEnum.UNDERLINE;
2767
+ this.underline = underline;
2192
2768
  }
2193
2769
  /**
2194
2770
  * Generate the map item for the annotation
2195
2771
  *
2196
- * @param {boolean} italic - Italic annotation
2197
- * @returns {[NodeAnnotationTypeEnum.ITALIC, ItalicAnnotation]} Map item for the annotation
2772
+ * @param {boolean} underline - Underline annotation
2773
+ * @returns {[NodeAnnotationTypeEnum.UNDERLINE, UnderlineAnnotation]} Map item for the annotation
2198
2774
  */
2199
- static from(italic) {
2200
- return [exports.NodeAnnotationTypeEnum.ITALIC, new ItalicAnnotation(italic)];
2775
+ static from(underline) {
2776
+ return [exports.NodeAnnotationTypeEnum.UNDERLINE, new UnderlineAnnotation(underline)];
2201
2777
  }
2202
2778
  /**
2203
2779
  * Generate the JSON representation of the annotation
@@ -2206,14 +2782,14 @@ class ItalicAnnotation extends NodeAnnotation {
2206
2782
  */
2207
2783
  toJSON() {
2208
2784
  return {
2209
- italic: this.italic,
2785
+ underline: this.underline,
2210
2786
  };
2211
2787
  }
2212
2788
  /**
2213
2789
  * @inheritDoc
2214
2790
  */
2215
2791
  clone() {
2216
- return new ItalicAnnotation(this.italic);
2792
+ return new UnderlineAnnotation(this.underline);
2217
2793
  }
2218
2794
  /**
2219
2795
  * @inheritDoc
@@ -2221,7 +2797,7 @@ class ItalicAnnotation extends NodeAnnotation {
2221
2797
  renderClass(options) {
2222
2798
  if (options === null || options === void 0 ? void 0 : options.standalone)
2223
2799
  return null;
2224
- return this.italic ? 'v-rte--italic' : null;
2800
+ return this.underline ? 'v-rte--underline' : null;
2225
2801
  }
2226
2802
  /**
2227
2803
  * @inheritDoc
@@ -2229,27 +2805,27 @@ class ItalicAnnotation extends NodeAnnotation {
2229
2805
  renderStyle(options) {
2230
2806
  if (!(options === null || options === void 0 ? void 0 : options.standalone))
2231
2807
  return null;
2232
- return this.italic ? { fontStyle: ITALIC_FONT_STYLE } : null;
2808
+ return this.underline ? { textDecoration: UNDERLINE_TEXT_DECORATION } : null;
2233
2809
  }
2234
2810
  }
2235
2811
 
2236
2812
  /**
2237
- * Annotation to make text bold
2813
+ * Annotation to make text Italic
2238
2814
  */
2239
- class BoldAnnotation extends NodeAnnotation {
2240
- constructor(bold) {
2815
+ class ItalicAnnotation extends NodeAnnotation {
2816
+ constructor(italic) {
2241
2817
  super();
2242
- this.type = exports.NodeAnnotationTypeEnum.BOLD;
2243
- this.bold = bold;
2818
+ this.type = exports.NodeAnnotationTypeEnum.ITALIC;
2819
+ this.italic = italic;
2244
2820
  }
2245
2821
  /**
2246
2822
  * Generate the map item for the annotation
2247
2823
  *
2248
- * @param {boolean} bold - Bold annotation
2249
- * @returns {[NodeAnnotationTypeEnum.BOLD, BoldAnnotation]} Map item for the annotation
2824
+ * @param {boolean} italic - Italic annotation
2825
+ * @returns {[NodeAnnotationTypeEnum.ITALIC, ItalicAnnotation]} Map item for the annotation
2250
2826
  */
2251
- static from(bold) {
2252
- return [exports.NodeAnnotationTypeEnum.BOLD, new BoldAnnotation(bold)];
2827
+ static from(italic) {
2828
+ return [exports.NodeAnnotationTypeEnum.ITALIC, new ItalicAnnotation(italic)];
2253
2829
  }
2254
2830
  /**
2255
2831
  * Generate the JSON representation of the annotation
@@ -2258,14 +2834,14 @@ class BoldAnnotation extends NodeAnnotation {
2258
2834
  */
2259
2835
  toJSON() {
2260
2836
  return {
2261
- bold: this.bold,
2837
+ italic: this.italic,
2262
2838
  };
2263
2839
  }
2264
2840
  /**
2265
2841
  * @inheritDoc
2266
2842
  */
2267
2843
  clone() {
2268
- return new BoldAnnotation(this.bold);
2844
+ return new ItalicAnnotation(this.italic);
2269
2845
  }
2270
2846
  /**
2271
2847
  * @inheritDoc
@@ -2273,7 +2849,7 @@ class BoldAnnotation extends NodeAnnotation {
2273
2849
  renderClass(options) {
2274
2850
  if (options === null || options === void 0 ? void 0 : options.standalone)
2275
2851
  return null;
2276
- return this.bold ? 'v-rte--bold' : null;
2852
+ return this.italic ? 'v-rte--italic' : null;
2277
2853
  }
2278
2854
  /**
2279
2855
  * @inheritDoc
@@ -2281,7 +2857,7 @@ class BoldAnnotation extends NodeAnnotation {
2281
2857
  renderStyle(options) {
2282
2858
  if (!(options === null || options === void 0 ? void 0 : options.standalone))
2283
2859
  return null;
2284
- return this.bold ? { fontWeight: BOLD_FONT_WEIGHT } : null;
2860
+ return this.italic ? { fontStyle: ITALIC_FONT_STYLE } : null;
2285
2861
  }
2286
2862
  }
2287
2863
 
@@ -2384,6 +2960,14 @@ const RTE_TEXT_COLORS = [
2384
2960
  },
2385
2961
  ];
2386
2962
  const ZERO_WIDTH_SPACE = '\u200b';
2963
+ // Identifies the input source that triggered a value flush.
2964
+ exports.RTEUpdateSource = void 0;
2965
+ (function (RTEUpdateSource) {
2966
+ RTEUpdateSource["Default"] = "default";
2967
+ RTEUpdateSource["Composition"] = "composition";
2968
+ })(exports.RTEUpdateSource || (exports.RTEUpdateSource = {}));
2969
+ // Event property key used to carry the update source across the synthetic beforeinput event.
2970
+ const RTE_UPDATE_SOURCE_KEY = '__updateSource';
2387
2971
  const VegaRTEDefaultTextStyleItems = [
2388
2972
  { key: 'title' },
2389
2973
  { key: 'subtitle' },
@@ -2442,114 +3026,45 @@ const RTE_BLOCK_BOUNDARY_ATTRIBUTE = 'data-vega-rte-block-boundary';
2442
3026
  */
2443
3027
  const RTE_PASTE_MODE_DATA_TYPE = 'application/x-vega-rte-paste-mode';
2444
3028
  /**
2445
- * Custom DataTransfer MIME type value used to indicate that the paste content
2446
- * originated from Microsoft Word.
2447
- */
2448
- const RTE_PASTE_MODE_WORD = 'word';
2449
-
2450
- /**
2451
- * Annotation to make text with text color
2452
- */
2453
- class TextColorAnnotation extends NodeAnnotation {
2454
- constructor(textColor) {
2455
- super();
2456
- this.type = exports.NodeAnnotationTypeEnum.TEXT_COLOR;
2457
- this.textColor = this.formatTextColor(textColor);
2458
- }
2459
- /**
2460
- * Generate the map item for the annotation
2461
- *
2462
- * @param {string} textColor - text color annotation
2463
- * @returns {[NodeAnnotationTypeEnum.TEXT_COLOR, TextColorAnnotation]} Map item for the annotation
2464
- */
2465
- static from(textColor) {
2466
- return [exports.NodeAnnotationTypeEnum.TEXT_COLOR, new TextColorAnnotation(textColor)];
2467
- }
2468
- /**
2469
- * Generate the JSON representation of the annotation
2470
- *
2471
- * @returns {Record<string, unknown>} JSON representation of the annotation
2472
- */
2473
- toJSON() {
2474
- return {
2475
- textColor: this.textColor.key,
2476
- };
2477
- }
2478
- /**
2479
- * @inheritDoc
2480
- */
2481
- clone() {
2482
- return new TextColorAnnotation(this.textColor.key);
2483
- }
2484
- /**
2485
- * @inheritDoc
2486
- */
2487
- renderClass() {
2488
- return null;
2489
- }
2490
- /**
2491
- * @inheritDoc
2492
- */
2493
- renderStyle() {
2494
- return {
2495
- color: darkModeStyleController.VegaInternalThemeManager.isDarkMode() ? this.textColor.dark : this.textColor.light,
2496
- };
2497
- }
2498
- /**
2499
- * format text color
2500
- *
2501
- * @param {string} textColor - text color
2502
- * @returns {VegaRTEColorSchema} - VegaRTEColorSchema
2503
- */
2504
- formatTextColor(textColor) {
2505
- return (RTE_TEXT_COLORS.find((item) => item.key === textColor) || RTE_TEXT_COLORS[0]);
2506
- }
2507
- }
3029
+ * Custom DataTransfer MIME type value used to indicate that the paste content
3030
+ * originated from Microsoft Word.
3031
+ */
3032
+ const RTE_PASTE_MODE_WORD = 'word';
3033
+ const RTE_WORD_COUNT_KEY = 'rte-word-count';
2508
3034
 
2509
3035
  /**
2510
- * Annotation to make text a link
3036
+ * Annotation to make text with text color
2511
3037
  */
2512
- class LinkAnnotation extends NodeAnnotation {
2513
- constructor(link, useInternalStyle = true) {
3038
+ class TextColorAnnotation extends NodeAnnotation {
3039
+ constructor(textColor) {
2514
3040
  super();
2515
- this.type = exports.NodeAnnotationTypeEnum.LINK;
2516
- this.link = link;
2517
- this.useInternalStyle = useInternalStyle;
3041
+ this.type = exports.NodeAnnotationTypeEnum.TEXT_COLOR;
3042
+ this.textColor = this.formatTextColor(textColor);
2518
3043
  }
2519
3044
  /**
2520
3045
  * Generate the map item for the annotation
2521
3046
  *
2522
- * @param {VegaRTELink} link - Bold annotation
2523
- * @param {boolean} useInternalStyle - Whether to use default style for the link
2524
- * @returns {[NodeAnnotationTypeEnum.LINK, LinkAnnotation]} Map item for the annotation
3047
+ * @param {string} textColor - text color annotation
3048
+ * @returns {[NodeAnnotationTypeEnum.TEXT_COLOR, TextColorAnnotation]} Map item for the annotation
2525
3049
  */
2526
- static from(link, useInternalStyle = true) {
2527
- return [exports.NodeAnnotationTypeEnum.LINK, new LinkAnnotation(link, useInternalStyle)];
3050
+ static from(textColor) {
3051
+ return [exports.NodeAnnotationTypeEnum.TEXT_COLOR, new TextColorAnnotation(textColor)];
2528
3052
  }
2529
3053
  /**
2530
3054
  * Generate the JSON representation of the annotation
2531
3055
  *
2532
- * @returns {Record<'link', VegaRTELink>} JSON representation of the annotation
3056
+ * @returns {Record<string, unknown>} JSON representation of the annotation
2533
3057
  */
2534
3058
  toJSON() {
2535
3059
  return {
2536
- link: this.link,
3060
+ textColor: this.textColor.key,
2537
3061
  };
2538
3062
  }
2539
3063
  /**
2540
3064
  * @inheritDoc
2541
3065
  */
2542
3066
  clone() {
2543
- return new LinkAnnotation(this.link, this.useInternalStyle);
2544
- }
2545
- /**
2546
- * Verify whether two link annotation is same or not
2547
- *
2548
- * @param {LinkAnnotation} annotation - Compared annotation
2549
- * @returns {boolean} Whether two link annotation is same or not
2550
- */
2551
- toEqual(annotation) {
2552
- return this.link.groupKey === annotation.link.groupKey;
3067
+ return new TextColorAnnotation(this.textColor.key);
2553
3068
  }
2554
3069
  /**
2555
3070
  * @inheritDoc
@@ -2561,28 +3076,18 @@ class LinkAnnotation extends NodeAnnotation {
2561
3076
  * @inheritDoc
2562
3077
  */
2563
3078
  renderStyle() {
2564
- return null;
2565
- }
2566
- }
2567
-
2568
- /**
2569
- * Action to link a group of nodes
2570
- */
2571
- class LinkGroupAnnotationAction extends AnnotationAction {
2572
- constructor(groupKey, nodes, type) {
2573
- super();
2574
- this.isFlushable = false;
2575
- this.groupKey = groupKey;
2576
- this.nodes = nodes;
2577
- this.type = type;
3079
+ return {
3080
+ color: darkModeStyleController.VegaInternalThemeManager.isDarkMode() ? this.textColor.dark : this.textColor.light,
3081
+ };
2578
3082
  }
2579
3083
  /**
2580
- * Converts the action to an annotation
3084
+ * format text color
2581
3085
  *
2582
- * @returns {Annotation} The annotation
3086
+ * @param {string} textColor - text color
3087
+ * @returns {VegaRTEColorSchema} - VegaRTEColorSchema
2583
3088
  */
2584
- toAnnotation() {
2585
- return new LinkGroupAnnotation(this.groupKey);
3089
+ formatTextColor(textColor) {
3090
+ return (RTE_TEXT_COLORS.find((item) => item.key === textColor) || RTE_TEXT_COLORS[0]);
2586
3091
  }
2587
3092
  }
2588
3093
 
@@ -2604,139 +3109,6 @@ class SyncUpSelectionAction extends AnnotationAction {
2604
3109
  }
2605
3110
  }
2606
3111
 
2607
- /**
2608
- * The base action handle strategy class, use to modify the rich text node content or modify the annotation.
2609
- */
2610
- class ActionHandleStrategy {
2611
- /**
2612
- * Public method to invoke the handle logic.
2613
- *
2614
- * @typedef R generic type
2615
- * @param {ModifyContentAction | AnnotationAction} action - The action instance. Contains the action type and necessary params.
2616
- * @param {RTENode | RTEBlock | VegaRTEContent} target - The rich text node instance that will be modified.
2617
- * @returns {R} - The invoke result in special strategy.
2618
- */
2619
- execute(action, target) {
2620
- globalSlimmerRegistry.LogUtility.log(`Executing action ${action.constructor.name} on ${target.constructor.name} ${target['id']}`);
2621
- return this.handleAction(action, target);
2622
- }
2623
- /**
2624
- * Update the custom style annotation of a block or node
2625
- *
2626
- * @param {RTEBlock | RTETextNode} item - block or node
2627
- * @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
2628
- */
2629
- updateCustomStyleAnnotation(item, styleKeys) {
2630
- const customStyleAnnotation = item.annotationMap.get(exports.CommonAnnotationTypeEnum.CUSTOM_STYLE);
2631
- if (customStyleAnnotation && this.isCustomStyle(customStyleAnnotation, styleKeys)) {
2632
- item.annotationMap.set(customStyleAnnotation.type, new CustomStyleAnnotation(customStyleAnnotation.removeStyles(styleKeys)));
2633
- }
2634
- }
2635
- /**
2636
- * Create a new paragraph block with the given text.
2637
- *
2638
- * @param {string} text - The text content for the new paragraph.
2639
- * @returns {Nullable<RTETextBlock>} - The newly created paragraph block, or null if creation failed.
2640
- */
2641
- createNewParagraph(text) {
2642
- const dtoClass = RTEDTOClassManager$1.getRTEBlockClass('paragraph');
2643
- if (dtoClass) {
2644
- const newParagraph = dtoClass.from({
2645
- id: misc.generateUUID(),
2646
- type: 'paragraph',
2647
- nodes: [{ id: misc.generateUUID(), type: 'text', text }],
2648
- });
2649
- return newParagraph;
2650
- }
2651
- }
2652
- /**
2653
- * Get the root content from a child block or node.
2654
- *
2655
- * @param {RTEBlock | RTENode} child - The child block or node.
2656
- * @returns {Nullable<VegaRTEContent>} The root content, if found.
2657
- */
2658
- getRootContent(child) {
2659
- const parent = child.parent;
2660
- if (parent) {
2661
- if (parent.dtoName === 'VegaRTEContent') {
2662
- return parent;
2663
- }
2664
- else {
2665
- return this.getRootContent(parent);
2666
- }
2667
- }
2668
- }
2669
- /**
2670
- * Check the caret position at the start of a block.
2671
- *
2672
- * @param {RTEBlock} block - The RTE Block.
2673
- * @param {RTENode} node - The RTE Node.
2674
- * @param {number} offset - The offset position.
2675
- * @returns {boolean} - Whether the caret is at the start of the block.
2676
- */
2677
- isCaretPositionAtBlockStart(block, node, offset) {
2678
- return node === block.children[0] && offset === 0;
2679
- }
2680
- /**
2681
- * Check the caret position at the end of a block.
2682
- *
2683
- * @param {RTEBlock} block - The RTE Block.
2684
- * @param {RTENode} node - The RTE Node.
2685
- * @param {number} offset - The offset position.
2686
- * @returns {boolean} - Whether the caret is at the end of the block.
2687
- */
2688
- isCaretPositionAtBlockEnd(block, node, offset) {
2689
- if (!node.isContentEditable()) {
2690
- return this.isCaretPositionAtDecoratorBlockEnd(block, node, offset);
2691
- }
2692
- else {
2693
- return this.isCaretPositionAtTextBlockEnd(block, node, offset);
2694
- }
2695
- }
2696
- /**
2697
- * Get the registered DOM element by the RTE entity.
2698
- *
2699
- * @param {RTEBlock | RTENode} instance - The RTE block or node instance.
2700
- * @returns {Nullable<HTMLElement>} The registered DOM element.
2701
- */
2702
- getDOMByEntity(instance) {
2703
- return stateEntityRenderingRegistry.getDOMByEntity(instance);
2704
- }
2705
- /**
2706
- * Checks if the caret position is at the end of a specified RTETextNode.
2707
- *
2708
- * @param {RTETextBlock} textBlock - `RTETextBlock` - a text block.
2709
- * @param {RTETextNode} node - `RTETextNode` - a node representing an image in a rich text editor.
2710
- * @param {number} startOffset - The position within the text node where the caret is located.
2711
- * @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTETextNode.
2712
- */
2713
- isCaretPositionAtTextBlockEnd(textBlock, node, startOffset) {
2714
- const lastNode = textBlock.children[textBlock.children.length - 1];
2715
- return node === lastNode && (node.isEmpty() || startOffset === lastNode.text.length);
2716
- }
2717
- /**
2718
- * Checks if the caret position is at the end of a given decorator node.
2719
- *
2720
- * @param {RTEBlock} target - The image block.
2721
- * @param {RTENode} node - `node` is a RTEDecoratorNode or non-editable text node.
2722
- * @param {number} startOffset - The position within the `RTEDecoratorNode` where the caret is located.
2723
- * @returns {boolean}Returns a boolean value indicating whether the caret position is at the end of the `RTEDecoratorNode`.
2724
- */
2725
- isCaretPositionAtDecoratorBlockEnd(target, node, startOffset) {
2726
- return node === target.children[target.children.length - 1] && startOffset !== 0;
2727
- }
2728
- /**
2729
- * Determines if the custom style annotation includes any the custom style.
2730
- *
2731
- * @param {CustomStyleAnnotation} customStyleAnnotation - custom style annotation
2732
- * @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
2733
- * @returns {boolean} - True if the custom key includes the custom style, false otherwise.
2734
- */
2735
- isCustomStyle(customStyleAnnotation, styleKeys) {
2736
- return styleKeys.some((item) => Object.keys(customStyleAnnotation.customStyle).includes(item));
2737
- }
2738
- }
2739
-
2740
3112
  /**
2741
3113
  * Split the corresponding link group nodes *
2742
3114
  */
@@ -2886,25 +3258,6 @@ class NodeSplitTextStrategy extends ActionHandleStrategy {
2886
3258
  }
2887
3259
  }
2888
3260
 
2889
- /**
2890
- * Action to toggle bold annotation
2891
- */
2892
- class BoldAnnotationAction extends TextSplittableAction {
2893
- constructor(bold) {
2894
- super();
2895
- this.isFlushable = true;
2896
- this.bold = bold;
2897
- }
2898
- /**
2899
- * Converts the action to an annotation
2900
- *
2901
- * @returns {BoldAnnotation} the annotation
2902
- */
2903
- toAnnotation() {
2904
- return new BoldAnnotation(this.bold);
2905
- }
2906
- }
2907
-
2908
3261
  /**
2909
3262
  * Annotation to host which annotations will be clear formatting
2910
3263
  */
@@ -2961,66 +3314,22 @@ class CodeAnnotationAction extends TextSplittableAction {
2961
3314
  }
2962
3315
  }
2963
3316
 
2964
- /**
2965
- * Delete the node annotation by type
2966
- */
2967
- class DeleteNodeAnnotationAction extends AnnotationAction {
2968
- constructor(annotationType) {
2969
- super();
2970
- this.isFlushable = true;
2971
- this.annotationType = annotationType;
2972
- }
2973
- /**
2974
- * Don't need this for this action
2975
- *
2976
- * @returns {Nullable<Annotation>} undefined
2977
- */
2978
- toAnnotation() {
2979
- return undefined;
2980
- }
2981
- }
2982
-
2983
3317
  /**
2984
3318
  * Action to toggle the italic annotation
2985
3319
  */
2986
3320
  class ItalicAnnotationAction extends TextSplittableAction {
2987
- constructor(italic) {
2988
- super();
2989
- this.isFlushable = true;
2990
- this.italic = italic;
2991
- }
2992
- /**
2993
- * Converts the action to an annotation
2994
- *
2995
- * @returns {ItalicAnnotation} The annotation
2996
- */
2997
- toAnnotation() {
2998
- return new ItalicAnnotation(this.italic);
2999
- }
3000
- }
3001
-
3002
- /**
3003
- * Action to toggle link annotation
3004
- */
3005
- class LinkAnnotationAction extends TextSplittableAction {
3006
- constructor({ link, newText, needMergeNode, doSplit, type, }) {
3321
+ constructor(italic) {
3007
3322
  super();
3008
3323
  this.isFlushable = true;
3009
- this.link = link;
3010
- this.needMergeNode = needMergeNode;
3011
- this.newText = newText;
3012
- this.type = type;
3013
- if (typeGuard.isNonNullable(doSplit)) {
3014
- this.doSplit = doSplit;
3015
- }
3324
+ this.italic = italic;
3016
3325
  }
3017
3326
  /**
3018
3327
  * Converts the action to an annotation
3019
3328
  *
3020
- * @returns {LinkAnnotation} the annotation
3329
+ * @returns {ItalicAnnotation} The annotation
3021
3330
  */
3022
3331
  toAnnotation() {
3023
- return new LinkAnnotation(this.link);
3332
+ return new ItalicAnnotation(this.italic);
3024
3333
  }
3025
3334
  }
3026
3335
 
@@ -3573,6 +3882,12 @@ class RTETextNode extends RTENode {
3573
3882
  isContentEditable() {
3574
3883
  return true;
3575
3884
  }
3885
+ /**
3886
+ * @inheritDoc
3887
+ */
3888
+ getPlainText() {
3889
+ return this.text;
3890
+ }
3576
3891
  /**
3577
3892
  * Returns the inline HTML wrapper descriptor at the given depth in the
3578
3893
  * annotation chain. Depth 0 is the outermost wrapper, depth 1 is its child, etc.
@@ -3676,413 +3991,132 @@ class RTETextNode extends RTENode {
3676
3991
  /**
3677
3992
  * @inheritDoc
3678
3993
  */
3679
- doModifyActionApply(action) {
3680
- ActionHandleStrategyRegistry.executeTheStrategy(action, this);
3681
- }
3682
- /**
3683
- * Apply action to node
3684
- *
3685
- * @param {RTETextNode} node - Text node
3686
- * @param {AnnotationAction} action - AnnotationAction
3687
- */
3688
- applyActionToNode(node, action) {
3689
- const annotation = action.toAnnotation();
3690
- if (action instanceof SyncUpSelectionAction) {
3691
- this.syncUpSelectedNodes(node);
3692
- return;
3693
- }
3694
- // Sync up RTETextNode selected state to selection controller for any action apply, except selection range change.
3695
- if (!(annotation instanceof SelectionRangeAnnotation)) {
3696
- this.syncUpSelectedNodes(node);
3697
- }
3698
- /**
3699
- * 1. Try to get the specific strategy for the action and node type first (e.g., LinkAnnotationAction on RTETextNode).
3700
- * 2. If no specific strategy found, try to get the generic NodeUpdateAnnotationMapStrategy for AnnotationAction on RTETextNode.
3701
- */
3702
- const strategy = ActionHandleStrategyRegistry.get(action.constructor.name, node.constructor.name);
3703
- if (strategy) {
3704
- strategy.execute(action, node);
3705
- return;
3706
- }
3707
- const updateAnnotationMapStrategy = ActionHandleStrategyRegistry.get(AnnotationAction.name, RTETextNode.name);
3708
- if (updateAnnotationMapStrategy) {
3709
- updateAnnotationMapStrategy.execute(action, node);
3710
- return;
3711
- }
3712
- }
3713
- /**
3714
- * Sync up the selected node by change manager
3715
- *
3716
- * @param {RTETextNode} selectedNode - The selected node
3717
- */
3718
- syncUpSelectedNodes(selectedNode) {
3719
- const currentNodeDom = this.getElementRef();
3720
- if (currentNodeDom) {
3721
- const nodeSubject = domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubjectFromParentNodeByEventId(currentNodeDom, vegaInternalEventId.VegaInternalRichTextEditorSelectionRangeChange);
3722
- if (nodeSubject) {
3723
- changeManager.ChangeManager.notify(nodeSubject, { node: selectedNode });
3724
- }
3725
- }
3726
- }
3727
- /**
3728
- * @param {InlineHtmlAnnotation} inlineHtmlNode - The inline HTML annotation to wrap the text node.
3729
- * @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
3730
- * @returns {string} The HTML string representation of the text node wrapped with the inline HTML.
3731
- */
3732
- renderWithWrapperStr(inlineHtmlNode, options) {
3733
- const { htmlTag, child } = inlineHtmlNode;
3734
- const attrStr = this.annotationAttrStr(inlineHtmlNode);
3735
- if (!child) {
3736
- if (HTML_VOID_TAGS.has(htmlTag)) {
3737
- return `<${htmlTag}${attrStr}>`;
3738
- }
3739
- if (!this.text) {
3740
- return `<${htmlTag}${attrStr}></${htmlTag}>`;
3741
- }
3742
- return `<${htmlTag}${attrStr}>${this.renderTextStr(options)}</${htmlTag}>`;
3743
- }
3744
- return `<${htmlTag}${attrStr}>${this.renderWithWrapperStr(child, options)}</${htmlTag}>`;
3745
- }
3746
- /**
3747
- * Generate the attribute string for the inline HTML annotation
3748
- *
3749
- * @param {InlineHtmlAnnotation} annotation - The inline HTML annotation
3750
- * @returns {string} The attribute string for the inline HTML annotation
3751
- */
3752
- annotationAttrStr(annotation) {
3753
- const { customAttribute, customClass, customStyle } = annotation;
3754
- const attrs = [
3755
- ...((customAttribute === null || customAttribute === void 0 ? void 0 : customAttribute.toString()) || []),
3756
- customClass === null || customClass === void 0 ? void 0 : customClass.toString(),
3757
- customStyle === null || customStyle === void 0 ? void 0 : customStyle.toString(),
3758
- ].filter(typeGuard.isNonNullable);
3759
- return attrs.length > 0 ? ` ${attrs.join(' ')}` : '';
3760
- }
3761
- /**
3762
- * Generates the HTML representation of the text node.
3763
- *
3764
- * @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
3765
- * @returns {string} The HTML string representation of the text node.
3766
- */
3767
- renderTextStr(options) {
3768
- var _a;
3769
- const NodeTag = ((_a = this.getAnnotationByType(exports.NodeAnnotationTypeEnum.CODE)) === null || _a === void 0 ? void 0 : _a.code)
3770
- ? 'code'
3771
- : 'span';
3772
- const attrStr = super.generateAttributeString(options);
3773
- // If the text contains a newline character, we need to replace it with a <br> tag.
3774
- if (this.text === '\n') {
3775
- return `<br>`;
3776
- }
3777
- if (this.shouldRenderAsPlainText()) {
3778
- return this.text;
3779
- }
3780
- const content = NodeTag === 'code' ? escapeHtml(this.text) : this.text;
3781
- return `<${NodeTag}${attrStr}>${content}</${NodeTag}>`;
3782
- }
3783
- /**
3784
- * Determines if the text node should be rendered as plain text.
3785
- *
3786
- * @returns {boolean} `true` if the text node should be rendered as plain text, otherwise `false`.
3787
- */
3788
- shouldRenderAsPlainText() {
3789
- const plainTextAnnotation = super.getAnnotationByType(exports.NodeAnnotationTypeEnum.PLAIN_TEXT);
3790
- if (plainTextAnnotation) {
3791
- return (plainTextAnnotation.plainText &&
3792
- Array.from(this.annotationMap.values()).filter((annotation) => (annotation instanceof NodeAnnotation &&
3793
- !(annotation instanceof LinkAnnotation) &&
3794
- !(annotation instanceof PlainTextAnnotation)) ||
3795
- annotation instanceof CommonAnnotation).length === 0);
3796
- }
3797
- else {
3798
- return false;
3799
- }
3800
- }
3801
- }
3802
- RTETextNode.registerActionStrategyStatus = {};
3803
- RTETextNode.htmlTag = 'span';
3804
- RTETextNode.dtoName = 'RTETextNode';
3805
-
3806
- /**
3807
- * Append children to a block or rte content
3808
- *
3809
- * @example parent.apply(new AppendChildrenAction([newChildren]))
3810
- */
3811
- class AppendChildrenAction extends ModifyContentAction {
3812
- constructor(childNodes) {
3813
- super();
3814
- this.type = exports.ModifyContentActionType.APPEND_CHILDREN;
3815
- this.entityToBeAppended = childNodes;
3816
- }
3817
- }
3818
-
3819
- const TEXT_STYLE_DEFAULT_FONT_WEIGHT = '500';
3820
- const TEXT_STYLE_BASE = {
3821
- fontFamily: 'Inter',
3822
- fontSize: '16px',
3823
- lineHeight: '22px',
3824
- minHeight: '22px',
3825
- fontWeight: TEXT_STYLE_DEFAULT_FONT_WEIGHT,
3826
- };
3827
- const PARAGRAPH_TEXT_STYLE = Object.assign(Object.assign({}, TEXT_STYLE_BASE), { marginTop: '0px', marginBottom: '0px' });
3828
- const TEXT_STYLE_DEFAULTS = {
3829
- 'paragraph': PARAGRAPH_TEXT_STYLE,
3830
- 'title': Object.assign(Object.assign({}, TEXT_STYLE_BASE), { fontSize: '36px', lineHeight: '40px', minHeight: '40px' }),
3831
- 'subtitle': Object.assign(Object.assign({}, TEXT_STYLE_BASE), { fontSize: '28px', lineHeight: '32px', minHeight: '32px' }),
3832
- 'heading-1': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '22px', lineHeight: '24px', minHeight: '24px' }),
3833
- 'heading-2': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '20px', lineHeight: '24px', minHeight: '24px' }),
3834
- 'heading-3': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '18px' }),
3835
- 'heading-4': Object.assign({}, PARAGRAPH_TEXT_STYLE),
3836
- 'heading-5': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '14px' }),
3837
- 'heading-6': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '12px' }),
3838
- };
3839
-
3840
- /**
3841
- * Text style annotation
3842
- */
3843
- class TextStyleAnnotation extends BlockAnnotation {
3844
- constructor(textStyle) {
3845
- super();
3846
- this.type = exports.BlockAnnotationTypeEnum.TEXT_STYLE;
3847
- this.textStyle = textStyle;
3848
- }
3849
- /**
3850
- * Generate the map item for the annotations
3851
- *
3852
- * @param {VegaRTETextStyleType} textStyle - the text style type
3853
- * @returns {[BlockAnnotationTypeEnum.TEXT_STYLE, TextStyleAnnotation]} Map item for the annotation
3854
- */
3855
- static from(textStyle) {
3856
- return [exports.BlockAnnotationTypeEnum.TEXT_STYLE, new TextStyleAnnotation(textStyle)];
3857
- }
3858
- /**
3859
- * Get the default styles for a given text style type.
3860
- *
3861
- * @param {VegaRTETextStyleType} textStyle - The text style type.
3862
- * @returns {Nullable<AnnotationStyle>} The default styles for the given text style type.
3863
- */
3864
- static getDefaultStyles(textStyle) {
3865
- if (!textStyle)
3866
- return null;
3867
- return TEXT_STYLE_DEFAULTS[textStyle];
3868
- }
3869
- /**
3870
- * Generate the JSON representation of the annotation
3871
- *
3872
- * @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
3873
- */
3874
- toJSON() {
3875
- return { textStyle: this.textStyle };
3876
- }
3877
- /**
3878
- * @inheritDoc
3879
- */
3880
- clone() {
3881
- return new TextStyleAnnotation(this.textStyle);
3882
- }
3883
- /**
3884
- * @inheritDoc
3885
- */
3886
- renderClass(options) {
3887
- if (options === null || options === void 0 ? void 0 : options.standalone)
3888
- return null;
3889
- return this.textStyle ? `v-rte--text-style-${this.textStyle}` : null;
3890
- }
3891
- /**
3892
- * @inheritDoc
3893
- */
3894
- renderStyle(options) {
3895
- if (!(options === null || options === void 0 ? void 0 : options.standalone))
3896
- return null;
3897
- return this.textStyle ? TextStyleAnnotation.getDefaultStyles(this.textStyle) : null;
3898
- }
3899
- }
3900
-
3901
- /**
3902
- * Action to change the text style of a block
3903
- */
3904
- class TextStyleAnnotationAction extends AnnotationAction {
3905
- constructor(textStyle, bold) {
3906
- super();
3907
- this.isFlushable = true;
3908
- this.textStyle = textStyle;
3909
- this.bold = bold;
3910
- }
3911
- /**
3912
- * Converts the action to a block annotation
3913
- *
3914
- * @returns {BlockAnnotation} the block annotation
3915
- */
3916
- toAnnotation() {
3917
- return new TextStyleAnnotation(this.textStyle);
3994
+ doModifyActionApply(action) {
3995
+ ActionHandleStrategyRegistry.executeTheStrategy(action, this);
3918
3996
  }
3919
- }
3920
-
3921
- /**
3922
- * Update the text block text style strategy.
3923
- */
3924
- class BlockUpdateTextStyleStrategy extends ActionHandleStrategy {
3925
3997
  /**
3926
- * Update the text block type and add or remove the bold style from child nodes.
3998
+ * Apply action to node
3927
3999
  *
3928
- * @param {TextStyleAnnotationAction} action - The text style annotation action.
3929
- * @param {RTETextBlock} target - The current text block.
4000
+ * @param {RTETextNode} node - Text node
4001
+ * @param {AnnotationAction} action - AnnotationAction
3930
4002
  */
3931
- handleAction(action, target) {
3932
- if (target.type !== 'list-item') {
3933
- target.type = action.textStyle;
4003
+ applyActionToNode(node, action) {
4004
+ const annotation = action.toAnnotation();
4005
+ if (action instanceof SyncUpSelectionAction) {
4006
+ this.syncUpSelectedNodes(node);
4007
+ return;
3934
4008
  }
3935
- if (action.bold) {
3936
- target.children.forEach((node) => {
3937
- const boldAnnotationAction = new BoldAnnotationAction(true);
3938
- boldAnnotationAction.doSplit = false;
3939
- node.apply(boldAnnotationAction);
3940
- });
4009
+ // Sync up RTETextNode selected state to selection controller for any action apply, except selection range change.
4010
+ if (!(annotation instanceof SelectionRangeAnnotation)) {
4011
+ this.syncUpSelectedNodes(node);
3941
4012
  }
3942
- else {
3943
- target.children.forEach((node) => {
3944
- node.apply(new DeleteNodeAnnotationAction(exports.NodeAnnotationTypeEnum.BOLD));
3945
- });
4013
+ /**
4014
+ * 1. Try to get the specific strategy for the action and node type first (e.g., LinkAnnotationAction on RTETextNode).
4015
+ * 2. If no specific strategy found, try to get the generic NodeUpdateAnnotationMapStrategy for AnnotationAction on RTETextNode.
4016
+ */
4017
+ const strategy = ActionHandleStrategyRegistry.get(action.constructor.name, node.constructor.name);
4018
+ if (strategy) {
4019
+ strategy.execute(action, node);
4020
+ return;
4021
+ }
4022
+ const updateAnnotationMapStrategy = ActionHandleStrategyRegistry.get(AnnotationAction.name, RTETextNode.name);
4023
+ if (updateAnnotationMapStrategy) {
4024
+ updateAnnotationMapStrategy.execute(action, node);
4025
+ return;
3946
4026
  }
3947
- this.updateCustomStyleAnnotation(target, ['fontFamily', 'lineHeight', 'fontWeight', 'fontSize']);
3948
4027
  }
3949
- }
3950
-
3951
- /**
3952
- * Update the text block link group annotation strategy.
3953
- */
3954
- class BlockUpdateLinkGroupStrategy extends ActionHandleStrategy {
3955
4028
  /**
3956
- * Update link group after the child link node update.
4029
+ * Sync up the selected node by change manager
3957
4030
  *
3958
- * @param {LinkGroupAnnotationAction} action - The link group annotation action instance.
3959
- * @param {RTETextBlock} target - The current text block.
4031
+ * @param {RTETextNode} selectedNode - The selected node
3960
4032
  */
3961
- handleAction(action, target) {
3962
- let linkGroupAnnotation = target.getAnnotationByType(exports.InternalAnnotationTypeEnum.LINK_GROUP);
3963
- if (action.type === 'update_link') {
3964
- if (linkGroupAnnotation) {
3965
- const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey);
3966
- if (linkGroup) {
3967
- linkGroupAnnotation.linkGroups.set(action.groupKey, [linkGroup[0]]);
3968
- }
4033
+ syncUpSelectedNodes(selectedNode) {
4034
+ const currentNodeDom = this.getElementRef();
4035
+ if (currentNodeDom) {
4036
+ const nodeSubject = domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubjectFromParentNodeByEventId(currentNodeDom, vegaInternalEventId.VegaInternalRichTextEditorSelectionRangeChange);
4037
+ if (nodeSubject) {
4038
+ changeManager.ChangeManager.notify(nodeSubject, { node: selectedNode });
3969
4039
  }
3970
4040
  }
3971
- else {
3972
- if (linkGroupAnnotation) {
3973
- const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey) || [];
3974
- linkGroupAnnotation.linkGroups.set(action.groupKey, [...linkGroup, ...action.nodes]);
4041
+ }
4042
+ /**
4043
+ * @param {InlineHtmlAnnotation} inlineHtmlNode - The inline HTML annotation to wrap the text node.
4044
+ * @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
4045
+ * @returns {string} The HTML string representation of the text node wrapped with the inline HTML.
4046
+ */
4047
+ renderWithWrapperStr(inlineHtmlNode, options) {
4048
+ const { htmlTag, child } = inlineHtmlNode;
4049
+ const attrStr = this.annotationAttrStr(inlineHtmlNode);
4050
+ if (!child) {
4051
+ if (HTML_VOID_TAGS.has(htmlTag)) {
4052
+ return `<${htmlTag}${attrStr}>`;
3975
4053
  }
3976
- else {
3977
- linkGroupAnnotation = action.toAnnotation();
3978
- linkGroupAnnotation.linkGroups.set(action.groupKey, [...action.nodes]);
4054
+ if (!this.text) {
4055
+ return `<${htmlTag}${attrStr}></${htmlTag}>`;
3979
4056
  }
3980
- target.annotationMap.set(exports.InternalAnnotationTypeEnum.LINK_GROUP, linkGroupAnnotation);
4057
+ return `<${htmlTag}${attrStr}>${this.renderTextStr(options)}</${htmlTag}>`;
3981
4058
  }
4059
+ return `<${htmlTag}${attrStr}>${this.renderWithWrapperStr(child, options)}</${htmlTag}>`;
3982
4060
  }
3983
- }
3984
-
3985
- /**
3986
- * Insert a new children after a existing children
3987
- *
3988
- * @example parent.apply(new InsertChildrenAfterAction(existingChildren, newChildren, ...))
3989
- */
3990
- class InsertChildrenAfterAction extends ModifyContentAction {
3991
- constructor(referBlock, ...blocksToBeInserted) {
3992
- super();
3993
- this.type = exports.ModifyContentActionType.INSERT_CHILDREN_AFTER;
3994
- this.referChildren = referBlock;
3995
- this.childrenToBeInserted = blocksToBeInserted;
3996
- }
3997
- }
3998
-
3999
- /**
4000
- * Clear the current block nodes and append new nodes
4001
- *
4002
- * @example block.apply(new ReplaceChildNodesAction(newNodes))
4003
- */
4004
- class ReplaceChildNodesAction extends ModifyContentAction {
4005
- constructor(newChildNodes) {
4006
- super();
4007
- this.type = exports.ModifyContentActionType.REPLACE_CHILD_NODES;
4008
- this.newChildNodes = newChildNodes;
4009
- }
4010
- }
4011
-
4012
- /**
4013
- * Split the current node with a special position strategy.
4014
- */
4015
- class BlockSplitWithTextNodeStrategy extends ActionHandleStrategy {
4016
4061
  /**
4017
- * @inheritDoc
4062
+ * Generate the attribute string for the inline HTML annotation
4063
+ *
4064
+ * @param {InlineHtmlAnnotation} annotation - The inline HTML annotation
4065
+ * @returns {string} The attribute string for the inline HTML annotation
4018
4066
  */
4019
- handleAction(action, target) {
4020
- action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode, target);
4067
+ annotationAttrStr(annotation) {
4068
+ const { customAttribute, customClass, customStyle } = annotation;
4069
+ const attrs = [
4070
+ ...((customAttribute === null || customAttribute === void 0 ? void 0 : customAttribute.toString()) || []),
4071
+ customClass === null || customClass === void 0 ? void 0 : customClass.toString(),
4072
+ customStyle === null || customStyle === void 0 ? void 0 : customStyle.toString(),
4073
+ ].filter(typeGuard.isNonNullable);
4074
+ return attrs.length > 0 ? ` ${attrs.join(' ')}` : '';
4021
4075
  }
4022
4076
  /**
4023
- * Splits a text node at a specified offset within a block of nodes and returns a new block with the split nodes.
4077
+ * Generates the HTML representation of the text node.
4024
4078
  *
4025
- * @param {RTETextNode} splitNode - The text node that will be split
4026
- * @param {number} startOffsetOfNode - The index at which will split the text content of the `splitNode`.
4027
- * @param {RTETextBlock} textBlock - The text block need to be splited.
4028
- * @returns {Nullable<RTEBlock>} return either an RTEBlock object or null.
4079
+ * @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
4080
+ * @returns {string} The HTML string representation of the text node.
4029
4081
  */
4030
- splitTextNodeBlock(splitNode, startOffsetOfNode, textBlock) {
4031
- if (splitNode) {
4032
- const beforeText = splitNode.text.slice(0, startOffsetOfNode);
4033
- const afterText = splitNode.text.slice(startOffsetOfNode);
4034
- const nodesSplitIndex = textBlock.children.indexOf(splitNode);
4035
- if (nodesSplitIndex > -1) {
4036
- const beforeNodes = textBlock.children.slice(0, nodesSplitIndex);
4037
- const afterNodes = textBlock.children.slice(nodesSplitIndex + 1);
4038
- if (splitNode.isContentEditable()) {
4039
- if (beforeText) {
4040
- beforeNodes.push(splitNode.cloneWithText(beforeText));
4041
- }
4042
- if (afterText) {
4043
- afterNodes.unshift(splitNode.cloneWithText(afterText));
4044
- }
4045
- }
4046
- else {
4047
- startOffsetOfNode > 0 ? beforeNodes.push(splitNode) : afterNodes.unshift(splitNode);
4048
- }
4049
- textBlock.apply(new ReplaceChildNodesAction(beforeNodes));
4050
- const newBlock = textBlock.cloneWithNodes(afterNodes);
4051
- textBlock.parent.apply(new InsertChildrenAfterAction(textBlock, newBlock));
4052
- return newBlock;
4053
- }
4082
+ renderTextStr(options) {
4083
+ var _a;
4084
+ const NodeTag = ((_a = this.getAnnotationByType(exports.NodeAnnotationTypeEnum.CODE)) === null || _a === void 0 ? void 0 : _a.code)
4085
+ ? 'code'
4086
+ : 'span';
4087
+ const attrStr = super.generateAttributeString(options);
4088
+ // If the text contains a newline character, we need to replace it with a <br> tag.
4089
+ if (this.text === '\n') {
4090
+ return `<br>`;
4091
+ }
4092
+ if (this.shouldRenderAsPlainText()) {
4093
+ return this.text;
4054
4094
  }
4095
+ const content = NodeTag === 'code' ? escapeHtml(this.text) : this.text;
4096
+ return `<${NodeTag}${attrStr}>${content}</${NodeTag}>`;
4055
4097
  }
4056
- }
4057
-
4058
- /**
4059
- * Remove all nodes and append new nodes strategy.
4060
- */
4061
- class BlockReplaceNodesStrategy extends ActionHandleStrategy {
4062
4098
  /**
4063
- * Empty the text block or image block nodes and add new nodes.
4099
+ * Determines if the text node should be rendered as plain text.
4064
4100
  *
4065
- * @param {ReplaceChildNodesAction} action - The replace child nodes action instance.
4066
- * @param {RTETextBlock | RTEImageBlock} target - The text block or the image block.
4101
+ * @returns {boolean} `true` if the text node should be rendered as plain text, otherwise `false`.
4067
4102
  */
4068
- handleAction(action, target) {
4069
- target.children = [];
4070
- target.apply(new AppendChildrenAction(action.newChildNodes));
4071
- }
4072
- }
4073
-
4074
- /**
4075
- * Remove a children from the current block
4076
- *
4077
- * @example needRemovedChildren.parent.apply(new RemoveChildrenAction(needRemovedChildren))
4078
- */
4079
- class RemoveChildrenAction extends ModifyContentAction {
4080
- constructor(childNode) {
4081
- super();
4082
- this.type = exports.ModifyContentActionType.DELETE_CHILDREN;
4083
- this.entityToBeRemoved = childNode;
4103
+ shouldRenderAsPlainText() {
4104
+ const plainTextAnnotation = super.getAnnotationByType(exports.NodeAnnotationTypeEnum.PLAIN_TEXT);
4105
+ if (plainTextAnnotation) {
4106
+ return (plainTextAnnotation.plainText &&
4107
+ Array.from(this.annotationMap.values()).filter((annotation) => (annotation instanceof NodeAnnotation &&
4108
+ !(annotation instanceof LinkAnnotation) &&
4109
+ !(annotation instanceof PlainTextAnnotation)) ||
4110
+ annotation instanceof CommonAnnotation).length === 0);
4111
+ }
4112
+ else {
4113
+ return false;
4114
+ }
4084
4115
  }
4085
4116
  }
4117
+ RTETextNode.registerActionStrategyStatus = {};
4118
+ RTETextNode.htmlTag = 'span';
4119
+ RTETextNode.dtoName = 'RTETextNode';
4086
4120
 
4087
4121
  /**
4088
4122
  * Append the second block child nodes to the first block child nodes and remove the second block strategy.
@@ -4482,18 +4516,30 @@ class RTETextBlock extends RTEBlock {
4482
4516
  const textBlock = new RTETextBlock(block.id, block.type, options);
4483
4517
  const annotations = options.autoMatchFormat
4484
4518
  ? Object.assign(Object.assign({}, block.annotations), { textStyle: (_b = (_a = block.annotations) === null || _a === void 0 ? void 0 : _a.textStyle) !== null && _b !== void 0 ? _b : textBlock.type }) : block.annotations;
4485
- textBlock.children = block.nodes
4519
+ textBlock.children = RTETextBlock.convertNodes(block.nodes, textBlock, options);
4520
+ if (annotations) {
4521
+ super.convertAnnotationsToMap(textBlock.annotationMap, annotations);
4522
+ }
4523
+ return textBlock;
4524
+ }
4525
+ /**
4526
+ * Convert raw node payloads to their registered `RTENode` subclasses via
4527
+ * `RTEDTOClassManager`, preserving custom types (e.g. `RTETokenNode`).
4528
+ *
4529
+ * @param {VegaRTETextNode[]} nodes - Raw node payloads.
4530
+ * @param {RTETextBlock} parent - Parent block for the converted nodes.
4531
+ * @param {VegaRTETransformOptions} [options] - Optional transform options.
4532
+ * @returns {RTETextNode[]} Converted nodes; unregistered types are dropped.
4533
+ */
4534
+ static convertNodes(nodes, parent, options) {
4535
+ return nodes
4486
4536
  .map((richText) => {
4487
4537
  const NodeClass = RTEDTOClassManager$1.getRTENodeClass(richText.type);
4488
4538
  if (NodeClass) {
4489
- return NodeClass.from(richText, textBlock, options);
4539
+ return NodeClass.from(richText, parent, options);
4490
4540
  }
4491
4541
  })
4492
4542
  .filter(typeGuard.isNonNullable);
4493
- if (annotations) {
4494
- super.convertAnnotationsToMap(textBlock.annotationMap, annotations);
4495
- }
4496
- return textBlock;
4497
4543
  }
4498
4544
  /**
4499
4545
  * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
@@ -4925,7 +4971,7 @@ class RTEListItemBlock extends RTETextBlock {
4925
4971
  */
4926
4972
  static from(block, options = { autoMatchFormat: true }) {
4927
4973
  const listItemBlock = new RTEListItemBlock(block.id, undefined, options);
4928
- listItemBlock.children = block.nodes.map((richText) => RTETextNode.from(richText, listItemBlock, options));
4974
+ listItemBlock.children = RTEListItemBlock.convertNodes(block.nodes, listItemBlock, options);
4929
4975
  if (block.children) {
4930
4976
  listItemBlock.nestList = block.children.map((child) => {
4931
4977
  const listBlock = RTEListBlock.from(child, options);
@@ -4981,6 +5027,16 @@ class RTEListItemBlock extends RTETextBlock {
4981
5027
  }
4982
5028
  return super.getLastNode();
4983
5029
  }
5030
+ /**
5031
+ * @inheritDoc
5032
+ */
5033
+ getPlainText() {
5034
+ var _a;
5035
+ const nestListText = ((_a = this.nestList) !== null && _a !== void 0 ? _a : [])
5036
+ .map((list) => list.getPlainText())
5037
+ .join('');
5038
+ return super.getPlainText() + nestListText;
5039
+ }
4984
5040
  /**
4985
5041
  * Create a new list item block.
4986
5042
  *
@@ -6583,6 +6639,12 @@ class RTECodeBlockNode extends RTEDecoratorNode {
6583
6639
  toJSON() {
6584
6640
  return { id: this.id, type: 'text', text: this.text, language: this.language };
6585
6641
  }
6642
+ /**
6643
+ * @inheritDoc
6644
+ */
6645
+ getPlainText() {
6646
+ return this.text;
6647
+ }
6586
6648
  /**
6587
6649
  * @inheritDoc
6588
6650
  */
@@ -6862,6 +6924,8 @@ exports.RTE_PASTE_MODE_DATA_TYPE = RTE_PASTE_MODE_DATA_TYPE;
6862
6924
  exports.RTE_PASTE_MODE_WORD = RTE_PASTE_MODE_WORD;
6863
6925
  exports.RTE_SUPPORTED_LINK_TYPE_KEYS = RTE_SUPPORTED_LINK_TYPE_KEYS;
6864
6926
  exports.RTE_TEXT_COLORS = RTE_TEXT_COLORS;
6927
+ exports.RTE_UPDATE_SOURCE_KEY = RTE_UPDATE_SOURCE_KEY;
6928
+ exports.RTE_WORD_COUNT_KEY = RTE_WORD_COUNT_KEY;
6865
6929
  exports.RemoveChildrenAction = RemoveChildrenAction;
6866
6930
  exports.RemoveChildrenStrategy = RemoveChildrenStrategy;
6867
6931
  exports.RemoveNestListAction = RemoveNestListAction;