@heartlandone/vega 2.49.0 → 2.50.0-RTE-preview

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 (672) hide show
  1. package/dist/cjs/{app-globals-e17dedba.js → app-globals-8e811cac.js} +7 -7
  2. package/dist/cjs/{array-3aa164ce.js → array-249289f2.js} +18 -15
  3. package/dist/cjs/{child-nodes-event-prevent-slimmer-37870b2e.js → child-nodes-event-prevent-slimmer-26ecfb15.js} +2 -2
  4. package/dist/cjs/{content-state-6a48bcb5.js → code-block-4cd8bccd.js} +1166 -1131
  5. package/dist/cjs/content-state-6cb98931.js +2496 -0
  6. package/dist/cjs/{design-token-6e2c52f1.js → design-token-8b48cb59.js} +1 -1
  7. package/dist/cjs/{element-appender-slimmer-9fb99abd.js → element-appender-slimmer-d6b975e6.js} +3 -3
  8. package/dist/cjs/{event-emit-slimmer-8247249c.js → event-emit-slimmer-ee7a8c06.js} +1 -1
  9. package/dist/cjs/{feature-flag-controller-075fa683.js → feature-flag-controller-5e58aae4.js} +6 -0
  10. package/dist/cjs/{form-field-controller-slimmer-527c25a0.js → form-field-controller-slimmer-88cbb139.js} +9 -7
  11. package/dist/cjs/{image-annotation-action-9c2b9c8e.js → image-annotation-action-f36b1a72.js} +65 -35
  12. package/dist/cjs/{index-c4dec3aa.js → index-4dd54e6b.js} +1 -1
  13. package/dist/cjs/{index-09acd3c9.js → index-7700600c.js} +9 -0
  14. package/dist/cjs/index.cjs.js +19 -18
  15. package/dist/cjs/{internal-vega-event-manager-c9948b59.js → internal-vega-event-manager-58afcde7.js} +1 -0
  16. package/dist/cjs/{legend-input-processor-b071654c.js → legend-input-processor-8bcce3bf.js} +1 -1
  17. package/dist/cjs/loader.cjs.js +12 -10
  18. package/dist/cjs/{mutation-observer-filters-1f8c32a3.js → mutation-observer-filters-38cebc6d.js} +1 -1
  19. package/dist/cjs/{public-rules-10ec636d.js → public-rules-555271e0.js} +8 -6
  20. package/dist/cjs/{responsive-format-facade-9be0a851.js → responsive-format-facade-8ce41c8a.js} +5 -5
  21. package/dist/cjs/{rich-text-editor-required-rule-5faded94.js → rich-text-editor-required-rule-d1b38bf7.js} +1 -1
  22. package/dist/cjs/selection-controller-828990cc.js +765 -0
  23. package/dist/cjs/string-39438062.js +24 -0
  24. package/dist/cjs/{string-input-formatter-slimmer-50322824.js → string-input-formatter-slimmer-9e7d7ce2.js} +2 -2
  25. package/dist/cjs/{style-formatter-5b95a2a6.js → style-formatter-2294d77f.js} +1 -1
  26. package/dist/cjs/{sub-state-notify-slimmer-7f437b19.js → sub-state-notify-slimmer-f3ee01b7.js} +1 -1
  27. package/dist/cjs/{sub-state-observer-slimmer-e90362cd.js → sub-state-observer-slimmer-e1a00b74.js} +1 -1
  28. package/dist/cjs/{translation-212b1875.js → translation-e5003a00.js} +5 -0
  29. package/dist/cjs/{translation-slimmer-d1512c6d.js → translation-slimmer-127a0f83.js} +1 -1
  30. package/dist/cjs/vega-accordion.cjs.entry.js +13 -11
  31. package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
  32. package/dist/cjs/vega-app-header-button.cjs.entry.js +14 -12
  33. package/dist/cjs/vega-backdrop.cjs.entry.js +1 -1
  34. package/dist/cjs/vega-banner.cjs.entry.js +4 -4
  35. package/dist/cjs/vega-bar-chart.cjs.entry.js +4 -4
  36. package/dist/cjs/vega-box.cjs.entry.js +13 -11
  37. package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -1
  38. package/dist/cjs/vega-breadcrumb.cjs.entry.js +5 -5
  39. package/dist/cjs/vega-button-circle.cjs.entry.js +14 -12
  40. package/dist/cjs/vega-button-group_2.cjs.entry.js +8 -8
  41. package/dist/cjs/vega-button-link.cjs.entry.js +5 -5
  42. package/dist/cjs/vega-button.cjs.entry.js +13 -11
  43. package/dist/cjs/vega-calendar_3.cjs.entry.js +11 -11
  44. package/dist/cjs/vega-card.cjs.entry.js +12 -10
  45. package/dist/cjs/vega-carousel.cjs.entry.js +12 -10
  46. package/dist/cjs/vega-checkbox_2.cjs.entry.js +12 -12
  47. package/dist/cjs/vega-chip.cjs.entry.js +14 -12
  48. package/dist/cjs/vega-code-block.cjs.entry.js +4073 -0
  49. package/dist/cjs/vega-color-picker.cjs.entry.js +10 -10
  50. package/dist/cjs/vega-combo-box.cjs.entry.js +12 -12
  51. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  52. package/dist/cjs/vega-date-picker_2.cjs.entry.js +20 -19
  53. package/dist/cjs/vega-dialog_2.cjs.entry.js +14 -12
  54. package/dist/cjs/vega-divider.cjs.entry.js +12 -10
  55. package/dist/cjs/vega-dropdown_5.cjs.entry.js +17 -15
  56. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  57. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  58. package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
  59. package/dist/cjs/vega-file-uploader.cjs.entry.js +11 -11
  60. package/dist/cjs/vega-flag-icon.cjs.entry.js +12 -10
  61. package/dist/cjs/vega-flex.cjs.entry.js +13 -11
  62. package/dist/cjs/vega-font.cjs.entry.js +12 -10
  63. package/dist/cjs/vega-form.cjs.entry.js +13 -13
  64. package/dist/cjs/vega-grid.cjs.entry.js +12 -10
  65. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  66. package/dist/cjs/vega-icon.cjs.entry.js +12 -10
  67. package/dist/cjs/vega-image-uploader.cjs.entry.js +17 -16
  68. package/dist/cjs/vega-input-credit-card.cjs.entry.js +12 -12
  69. package/dist/cjs/vega-input-numeric.cjs.entry.js +13 -13
  70. package/dist/cjs/vega-input-phone-number.cjs.entry.js +25 -16
  71. package/dist/cjs/vega-input-range.cjs.entry.js +13 -13
  72. package/dist/cjs/vega-input-select.cjs.entry.js +22 -21
  73. package/dist/cjs/vega-input.cjs.entry.js +25 -14
  74. package/dist/cjs/{vega-internal-event-id-bfea9b93.js → vega-internal-event-id-62371952.js} +2 -0
  75. package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
  76. package/dist/cjs/vega-left-nav_5.cjs.entry.js +15 -13
  77. package/dist/cjs/vega-line-chart.cjs.entry.js +4 -4
  78. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +11 -9
  79. package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
  80. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +5 -5
  81. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +4 -4
  82. package/dist/cjs/vega-pagination.cjs.entry.js +14 -12
  83. package/dist/cjs/vega-pie-chart.cjs.entry.js +3 -3
  84. package/dist/cjs/vega-popover_2.cjs.entry.js +13 -11
  85. package/dist/cjs/vega-progress-tracker.cjs.entry.js +3 -3
  86. package/dist/cjs/vega-radio_2.cjs.entry.js +12 -12
  87. package/dist/cjs/vega-rich-text-content.cjs.entry.js +311 -137
  88. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +1228 -2505
  89. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  90. package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
  91. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +17 -16
  92. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +13 -13
  93. package/dist/cjs/vega-sidenav_3.cjs.entry.js +14 -12
  94. package/dist/cjs/vega-signature-capture.cjs.entry.js +17 -16
  95. package/dist/cjs/{vega-skeleton-loader-controller-db868c98.js → vega-skeleton-loader-controller-83e05b6c.js} +1 -1
  96. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  97. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  98. package/dist/cjs/vega-stepper.cjs.entry.js +12 -12
  99. package/dist/cjs/vega-tab-group_2.cjs.entry.js +5 -5
  100. package/dist/cjs/vega-table_8.cjs.entry.js +17 -15
  101. package/dist/cjs/vega-text.cjs.entry.js +1 -1
  102. package/dist/cjs/vega-textarea.cjs.entry.js +12 -12
  103. package/dist/cjs/vega-time-picker_2.cjs.entry.js +18 -17
  104. package/dist/cjs/vega-toggle-switch.cjs.entry.js +10 -10
  105. package/dist/cjs/vega-tooltip_2.cjs.entry.js +12 -10
  106. package/dist/cjs/vega.cjs.js +12 -10
  107. package/dist/cjs/{y-axis-input-processor-72684c57.js → y-axis-input-processor-e371c142.js} +2 -2
  108. package/dist/collection/collection-manifest.json +7 -1
  109. package/dist/collection/components/vega-code-block/assets/copy.js +3 -0
  110. package/dist/collection/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.js +62 -0
  111. package/dist/collection/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.js +48 -0
  112. package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +99 -0
  113. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-content-parse-controller.js +50 -0
  114. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-focus-controller.js +57 -0
  115. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.js +255 -0
  116. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.js +266 -0
  117. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.js +44 -0
  118. package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-content-renderer.js +123 -0
  119. package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +67 -0
  120. package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-renderer.js +122 -0
  121. package/dist/collection/components/vega-code-block/types.js +10 -0
  122. package/dist/collection/components/vega-code-block/vega-code-block.css +158 -0
  123. package/dist/collection/components/vega-code-block/vega-code-block.js +399 -0
  124. package/dist/collection/components/vega-input/vega-input.js +13 -2
  125. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +2 -0
  126. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +5 -5
  127. package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +2 -0
  128. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +60 -5
  129. package/dist/collection/components/vega-rich-text-editor/assets/file-code.js +3 -0
  130. package/dist/collection/components/vega-rich-text-editor/assets/rectangle-code.js +3 -0
  131. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +24 -0
  132. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy.js +15 -0
  133. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy.js +15 -0
  134. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy.js +1 -0
  135. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy.js +13 -0
  136. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy.js +14 -0
  137. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.js +3 -1
  138. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.js +1 -1
  139. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.js +48 -0
  140. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.js +17 -0
  141. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +77 -0
  142. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.js +38 -0
  143. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-code-block-strategy.js +14 -0
  144. package/dist/collection/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.js +20 -0
  145. package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +4 -0
  146. package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-code-block-action.js +13 -0
  147. package/dist/collection/components/vega-rich-text-editor/dto/actions/switch-out-from-code-block-action.js +15 -0
  148. package/dist/collection/components/vega-rich-text-editor/dto/actions/transform-to-code-block-action.js +13 -0
  149. package/dist/collection/components/vega-rich-text-editor/dto/actions/update-code-block-action.js +15 -0
  150. package/dist/collection/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.js +1 -0
  151. package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +13 -5
  152. package/dist/collection/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.js +2 -0
  153. package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +14 -9
  154. package/dist/collection/components/vega-rich-text-editor/dto/annotations/common-annotation.abstract.js +12 -0
  155. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.js +65 -0
  156. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-class-annotation.js +54 -0
  157. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-style-annotation.js +57 -0
  158. package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +26 -10
  159. package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +16 -7
  160. package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +8 -2
  161. package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +13 -5
  162. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +12 -9
  163. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +89 -0
  164. package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +41 -0
  165. package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +9 -9
  166. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +3 -7
  167. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +74 -12
  168. package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +9 -9
  169. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +69 -2
  170. package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +106 -0
  171. package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +15 -1
  172. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +50 -0
  173. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +12 -1
  174. package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +66 -2
  175. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +29 -0
  176. package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +56 -0
  177. package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +26 -9
  178. package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +81 -0
  179. package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +15 -2
  180. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.js +5 -22
  181. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +9 -93
  182. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +62 -0
  183. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +1 -1
  184. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +121 -0
  185. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +1 -1
  186. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +1 -1
  187. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +2 -23
  188. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.js +81 -0
  189. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +47 -7
  190. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.js +0 -27
  191. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +3 -2
  192. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +19 -4
  193. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +165 -25
  194. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +2 -1
  195. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +6 -1
  196. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-rte-image-block-strategy.abstract.js +38 -0
  197. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.js +3 -20
  198. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.js +59 -5
  199. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.js +54 -0
  200. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +1 -1
  201. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +3 -2
  202. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.js +3 -20
  203. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-not-li-child-to-rte-list-item-block.js +7 -3
  204. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +3 -2
  205. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.js +69 -0
  206. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +4 -7
  207. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +7 -5
  208. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +7 -5
  209. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +25 -10
  210. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.js +64 -0
  211. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +59 -53
  212. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +21 -8
  213. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +10 -0
  214. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +5 -3
  215. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +5 -3
  216. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.js +5 -3
  217. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.js +5 -3
  218. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +5 -3
  219. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +65 -0
  220. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +5 -3
  221. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.js +2 -2
  222. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +8 -2
  223. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.js +2 -2
  224. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.js +2 -2
  225. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.js +2 -2
  226. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +2 -2
  227. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +5 -3
  228. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +3 -3
  229. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +2 -2
  230. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +3 -3
  231. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +60 -0
  232. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +5 -3
  233. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +5 -3
  234. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +6 -4
  235. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +3 -2
  236. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +5 -3
  237. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.js +28 -0
  238. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +31 -3
  239. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.js +21 -0
  240. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.js +2 -0
  241. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.js +3 -0
  242. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.js +23 -1
  243. package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +247 -27
  244. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/code-block.test.js +54 -0
  245. package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +1793 -0
  246. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +12 -0
  247. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +41 -4
  248. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.js +32 -0
  249. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.js +61 -0
  250. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +7 -0
  251. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +18 -1
  252. package/dist/collection/helpers/code-format/code-formatter.js +108 -0
  253. package/dist/collection/helpers/code-format/test/code-formatter.test.js +362 -0
  254. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -1
  255. package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
  256. package/dist/collection/helpers/feature-control/feature-flags-map.js +6 -0
  257. package/dist/collection/helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract.js +47 -0
  258. package/dist/collection/helpers/slimmers/form-field-controller-slimmer.js +3 -1
  259. package/dist/collection/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.js +46 -0
  260. package/dist/collection/helpers/translation/locales/en.js +5 -0
  261. package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +5 -0
  262. package/dist/collection/polyfill/shadow-selection/shadow-selection-polyfill.js +17 -15
  263. package/dist/collection/polyfill/shadow-selection/test/shadow-selection-polyfill.test.js +1 -0
  264. package/dist/collection/polyfill/test-polyfill/unit/methods.js +9 -0
  265. package/dist/collection/utils/array.js +18 -15
  266. package/dist/collection/utils/string.js +10 -0
  267. package/dist/collection/utils/test/array.test.js +78 -16
  268. package/dist/esm/{app-globals-b7b43a4e.js → app-globals-9058ac3b.js} +7 -7
  269. package/dist/esm/{array-3113609f.js → array-7888f339.js} +18 -15
  270. package/dist/esm/{child-nodes-event-prevent-slimmer-d3a94ef2.js → child-nodes-event-prevent-slimmer-1142fb79.js} +2 -2
  271. package/dist/esm/{content-state-dbc9f635.js → code-block-8b5bd928.js} +1141 -1122
  272. package/dist/esm/content-state-8c3f862b.js +2489 -0
  273. package/dist/esm/{design-token-e263e6a2.js → design-token-bd436e0d.js} +1 -1
  274. package/dist/esm/{dom-node-subject-factory-f77cf9cc.js → dom-node-subject-factory-eb6bba5d.js} +1 -1
  275. package/dist/esm/{dom-node-subject-observer-factory-715dccf9.js → dom-node-subject-observer-factory-6083d518.js} +1 -1
  276. package/dist/esm/{element-appender-slimmer-55d63b1f.js → element-appender-slimmer-baf5e249.js} +5 -5
  277. package/dist/esm/{event-emit-slimmer-b7d511f6.js → event-emit-slimmer-480d3b54.js} +3 -3
  278. package/dist/esm/{feature-flag-controller-690eac1d.js → feature-flag-controller-0fbe8fb0.js} +6 -0
  279. package/dist/esm/{form-field-controller-slimmer-e7dc3db1.js → form-field-controller-slimmer-bfb4034d.js} +11 -9
  280. package/dist/esm/{image-annotation-action-1aa938ab.js → image-annotation-action-a8b860ad.js} +57 -28
  281. package/dist/esm/{index-187f71d1.js → index-d0a47531.js} +9 -0
  282. package/dist/esm/{index-4aa167d6.js → index-db0ec3ee.js} +2 -2
  283. package/dist/esm/index.js +14 -13
  284. package/dist/esm/{internal-vega-event-manager-87dc436c.js → internal-vega-event-manager-56c6469a.js} +2 -1
  285. package/dist/esm/{legend-input-processor-8bcd5c5a.js → legend-input-processor-8f76ce8a.js} +1 -1
  286. package/dist/esm/loader.js +13 -11
  287. package/dist/esm/{mutation-observer-filters-7ee2b410.js → mutation-observer-filters-1a054fb0.js} +1 -1
  288. package/dist/esm/polyfills/core-js.js +0 -0
  289. package/dist/esm/polyfills/dom.js +0 -0
  290. package/dist/esm/polyfills/es5-html-element.js +0 -0
  291. package/dist/esm/polyfills/index.js +0 -0
  292. package/dist/esm/polyfills/system.js +0 -0
  293. package/dist/esm/{public-rules-5cf6aa95.js → public-rules-90fbd41a.js} +8 -6
  294. package/dist/esm/{responsive-format-facade-bc2f8ad3.js → responsive-format-facade-827de03a.js} +5 -5
  295. package/dist/esm/{rich-text-editor-required-rule-6a7cd3ee.js → rich-text-editor-required-rule-0d470d82.js} +1 -1
  296. package/dist/esm/selection-controller-dd4f4407.js +759 -0
  297. package/dist/esm/string-a953eafc.js +21 -0
  298. package/dist/esm/{string-input-formatter-slimmer-c61f82d6.js → string-input-formatter-slimmer-0d30b976.js} +3 -3
  299. package/dist/esm/{style-formatter-0f221459.js → style-formatter-232842f5.js} +1 -1
  300. package/dist/esm/{sub-state-notify-slimmer-4e3cf09d.js → sub-state-notify-slimmer-04e06501.js} +2 -2
  301. package/dist/esm/{sub-state-observer-slimmer-be7a6ce3.js → sub-state-observer-slimmer-b4c2ddc3.js} +2 -2
  302. package/dist/esm/{translation-cf7f020a.js → translation-71e0711d.js} +5 -0
  303. package/dist/esm/{translation-slimmer-88966d5c.js → translation-slimmer-e6b130bf.js} +1 -1
  304. package/dist/esm/vega-accordion.entry.js +15 -13
  305. package/dist/esm/vega-app-footer.entry.js +1 -1
  306. package/dist/esm/vega-app-header-button.entry.js +16 -14
  307. package/dist/esm/vega-backdrop.entry.js +1 -1
  308. package/dist/esm/vega-banner.entry.js +6 -6
  309. package/dist/esm/vega-bar-chart.entry.js +4 -4
  310. package/dist/esm/vega-box.entry.js +14 -12
  311. package/dist/esm/vega-brand-logo.entry.js +1 -1
  312. package/dist/esm/vega-breadcrumb.entry.js +7 -7
  313. package/dist/esm/vega-button-circle.entry.js +16 -14
  314. package/dist/esm/vega-button-group_2.entry.js +10 -10
  315. package/dist/esm/vega-button-link.entry.js +7 -7
  316. package/dist/esm/vega-button.entry.js +15 -13
  317. package/dist/esm/vega-calendar_3.entry.js +13 -13
  318. package/dist/esm/vega-card.entry.js +13 -11
  319. package/dist/esm/vega-carousel.entry.js +14 -12
  320. package/dist/esm/vega-checkbox_2.entry.js +14 -14
  321. package/dist/esm/vega-chip.entry.js +16 -14
  322. package/dist/esm/vega-code-block.entry.js +4069 -0
  323. package/dist/esm/vega-color-picker.entry.js +12 -12
  324. package/dist/esm/vega-combo-box.entry.js +14 -14
  325. package/dist/esm/vega-counter-badge.entry.js +1 -1
  326. package/dist/esm/vega-date-picker_2.entry.js +22 -21
  327. package/dist/esm/vega-dialog_2.entry.js +16 -14
  328. package/dist/esm/vega-divider.entry.js +13 -11
  329. package/dist/esm/vega-dropdown_5.entry.js +19 -17
  330. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  331. package/dist/esm/vega-field-error.entry.js +1 -1
  332. package/dist/esm/vega-field-label.entry.js +5 -5
  333. package/dist/esm/vega-file-uploader.entry.js +13 -13
  334. package/dist/esm/vega-flag-icon.entry.js +13 -11
  335. package/dist/esm/vega-flex.entry.js +14 -12
  336. package/dist/esm/vega-font.entry.js +13 -11
  337. package/dist/esm/vega-form.entry.js +15 -15
  338. package/dist/esm/vega-grid.entry.js +13 -11
  339. package/dist/esm/vega-hint.entry.js +1 -1
  340. package/dist/esm/vega-icon.entry.js +13 -11
  341. package/dist/esm/vega-image-uploader.entry.js +19 -18
  342. package/dist/esm/vega-input-credit-card.entry.js +14 -14
  343. package/dist/esm/vega-input-numeric.entry.js +15 -15
  344. package/dist/esm/vega-input-phone-number.entry.js +27 -18
  345. package/dist/esm/vega-input-range.entry.js +15 -15
  346. package/dist/esm/vega-input-select.entry.js +24 -23
  347. package/dist/esm/vega-input.entry.js +27 -16
  348. package/dist/esm/{vega-internal-event-id-85ad403f.js → vega-internal-event-id-820393ad.js} +2 -1
  349. package/dist/esm/vega-item-toggle.entry.js +5 -5
  350. package/dist/esm/vega-left-nav_5.entry.js +17 -15
  351. package/dist/esm/vega-line-chart.entry.js +4 -4
  352. package/dist/esm/vega-loader-wrapper_2.entry.js +12 -10
  353. package/dist/esm/vega-page-notification_2.entry.js +3 -3
  354. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +7 -7
  355. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +6 -6
  356. package/dist/esm/vega-pagination.entry.js +16 -14
  357. package/dist/esm/vega-pie-chart.entry.js +3 -3
  358. package/dist/esm/vega-popover_2.entry.js +15 -13
  359. package/dist/esm/vega-progress-tracker.entry.js +5 -5
  360. package/dist/esm/vega-radio_2.entry.js +14 -14
  361. package/dist/esm/vega-rich-text-content.entry.js +305 -131
  362. package/dist/esm/vega-rich-text-editor_4.entry.js +1135 -2412
  363. package/dist/esm/vega-section-title.entry.js +1 -1
  364. package/dist/esm/vega-segment-control.entry.js +5 -5
  365. package/dist/esm/vega-selection-chip_2.entry.js +19 -18
  366. package/dist/esm/vega-selection-tile_2.entry.js +15 -15
  367. package/dist/esm/vega-sidenav_3.entry.js +16 -14
  368. package/dist/esm/vega-signature-capture.entry.js +19 -18
  369. package/dist/esm/{vega-skeleton-loader-controller-c2a8bd27.js → vega-skeleton-loader-controller-878e1b28.js} +1 -1
  370. package/dist/esm/vega-skeleton.entry.js +1 -1
  371. package/dist/esm/vega-slot-container.entry.js +1 -1
  372. package/dist/esm/vega-stepper.entry.js +14 -14
  373. package/dist/esm/vega-tab-group_2.entry.js +7 -7
  374. package/dist/esm/vega-table_8.entry.js +19 -17
  375. package/dist/esm/vega-text.entry.js +1 -1
  376. package/dist/esm/vega-textarea.entry.js +14 -14
  377. package/dist/esm/vega-time-picker_2.entry.js +20 -19
  378. package/dist/esm/vega-toggle-switch.entry.js +12 -12
  379. package/dist/esm/vega-tooltip_2.entry.js +14 -12
  380. package/dist/esm/vega.js +13 -11
  381. package/dist/esm/{y-axis-input-processor-26fab110.js → y-axis-input-processor-e090b01c.js} +2 -2
  382. package/dist/types/components/vega-code-block/assets/copy.d.ts +3 -0
  383. package/dist/types/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.d.ts +40 -0
  384. package/dist/types/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.d.ts +19 -0
  385. package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +43 -0
  386. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-content-parse-controller.d.ts +23 -0
  387. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-focus-controller.d.ts +21 -0
  388. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.d.ts +100 -0
  389. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.d.ts +93 -0
  390. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.d.ts +21 -0
  391. package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-content-renderer.d.ts +57 -0
  392. package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.d.ts +23 -0
  393. package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-renderer.d.ts +50 -0
  394. package/dist/types/components/vega-code-block/types.d.ts +19 -0
  395. package/dist/types/components/vega-code-block/vega-code-block.d.ts +116 -0
  396. package/dist/types/components/vega-input/vega-input.d.ts +4 -0
  397. package/dist/types/components/vega-rich-text-editor/assets/file-code.d.ts +3 -0
  398. package/dist/types/components/vega-rich-text-editor/assets/rectangle-code.d.ts +3 -0
  399. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.d.ts +15 -0
  400. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy.d.ts +15 -0
  401. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy.d.ts +15 -0
  402. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy.d.ts +12 -0
  403. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.d.ts +3 -3
  404. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.d.ts +4 -5
  405. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.d.ts +29 -0
  406. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.d.ts +15 -0
  407. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.d.ts +28 -0
  408. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.d.ts +12 -0
  409. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-code-block-strategy.d.ts +12 -0
  410. package/dist/types/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.d.ts +17 -0
  411. package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +5 -1
  412. package/dist/types/components/vega-rich-text-editor/dto/actions/remove-code-block-action.d.ts +10 -0
  413. package/dist/types/components/vega-rich-text-editor/dto/actions/switch-out-from-code-block-action.d.ts +14 -0
  414. package/dist/types/components/vega-rich-text-editor/dto/actions/transform-to-code-block-action.d.ts +14 -0
  415. package/dist/types/components/vega-rich-text-editor/dto/actions/update-code-block-action.d.ts +14 -0
  416. package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +2 -1
  417. package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +17 -4
  418. package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +7 -5
  419. package/dist/types/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.d.ts +2 -1
  420. package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +5 -9
  421. package/dist/types/components/vega-rich-text-editor/dto/annotations/common-annotation.abstract.d.ts +20 -0
  422. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.d.ts +43 -0
  423. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-class-annotation.d.ts +40 -0
  424. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-style-annotation.d.ts +42 -0
  425. package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +5 -9
  426. package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +7 -5
  427. package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +5 -1
  428. package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +7 -5
  429. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +6 -4
  430. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +48 -0
  431. package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +25 -0
  432. package/dist/types/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.d.ts +15 -3
  433. package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +5 -9
  434. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +3 -7
  435. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +7 -5
  436. package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +5 -9
  437. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +39 -4
  438. package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +56 -0
  439. package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +4 -0
  440. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +20 -2
  441. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +4 -0
  442. package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +14 -4
  443. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +13 -0
  444. package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +45 -0
  445. package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +4 -0
  446. package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +46 -2
  447. package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +7 -2
  448. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.d.ts +4 -11
  449. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.d.ts +7 -5
  450. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.d.ts +39 -0
  451. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +24 -0
  452. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +0 -1
  453. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.d.ts +37 -0
  454. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.d.ts +22 -0
  455. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.d.ts +1 -15
  456. package/dist/types/components/vega-rich-text-editor/interface.d.ts +65 -26
  457. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.d.ts +66 -8
  458. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.d.ts +3 -1
  459. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-rte-image-block-strategy.abstract.d.ts +20 -0
  460. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.d.ts +2 -2
  461. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.d.ts +30 -1
  462. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.d.ts +31 -0
  463. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.d.ts +2 -3
  464. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.d.ts +2 -2
  465. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.d.ts +2 -3
  466. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.d.ts +42 -0
  467. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.d.ts +2 -2
  468. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +7 -1
  469. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.d.ts +45 -0
  470. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +17 -23
  471. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +6 -4
  472. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +2 -0
  473. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.d.ts +2 -2
  474. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +3 -2
  475. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.d.ts +2 -2
  476. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.d.ts +2 -2
  477. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.d.ts +2 -2
  478. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.d.ts +22 -0
  479. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.d.ts +2 -2
  480. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.d.ts +2 -2
  481. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.d.ts +4 -2
  482. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.d.ts +2 -2
  483. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.d.ts +2 -2
  484. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.d.ts +2 -2
  485. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.d.ts +3 -2
  486. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.d.ts +2 -2
  487. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.d.ts +2 -2
  488. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.d.ts +3 -2
  489. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.d.ts +2 -2
  490. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +13 -0
  491. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.d.ts +2 -2
  492. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.d.ts +3 -2
  493. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.d.ts +3 -2
  494. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +3 -2
  495. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.d.ts +2 -2
  496. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.d.ts +17 -0
  497. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +8 -2
  498. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.d.ts +1 -0
  499. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/code-block.test.d.ts +1 -0
  500. package/dist/types/components/vega-rich-text-editor/test/dto/content-state.test.d.ts +1 -1
  501. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.d.ts +1 -0
  502. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.d.ts +1 -0
  503. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +7 -0
  504. package/dist/types/components.d.ts +95 -0
  505. package/dist/types/helpers/code-format/code-formatter.d.ts +34 -0
  506. package/dist/types/helpers/code-format/test/code-formatter.test.d.ts +1 -0
  507. package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
  508. package/dist/types/helpers/feature-control/feature-flag.d.ts +2 -1
  509. package/dist/types/helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract.d.ts +20 -0
  510. package/dist/types/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.d.ts +1 -0
  511. package/dist/types/helpers/translation/interface.d.ts +6 -1
  512. package/dist/types/polyfill/shadow-selection/shadow-selection-polyfill.d.ts +26 -0
  513. package/dist/types/types/components.type.d.ts +1 -0
  514. package/dist/types/utils/array.d.ts +6 -5
  515. package/dist/types/utils/string.d.ts +7 -0
  516. package/dist/vega/index.esm.js +1 -1
  517. package/dist/vega/p-0104207d.entry.js +1 -0
  518. package/dist/vega/p-010f1715.entry.js +1 -0
  519. package/dist/vega/p-01593f9d.js +1 -0
  520. package/dist/vega/p-020b04ed.js +1 -0
  521. package/dist/vega/p-02841589.js +1 -0
  522. package/dist/vega/p-03cfb331.entry.js +9 -0
  523. package/dist/vega/{p-5a8f129f.entry.js → p-0bff8716.entry.js} +1 -1
  524. package/dist/vega/p-1056a049.entry.js +1 -0
  525. package/dist/vega/p-10e41bbe.js +1 -0
  526. package/dist/vega/{p-28b7d6ba.entry.js → p-12e6173c.entry.js} +1 -1
  527. package/dist/vega/{p-88c9efbb.js → p-1397ba3f.js} +1 -1
  528. package/dist/vega/p-13d9a1fd.entry.js +1 -0
  529. package/dist/vega/p-13eae47f.entry.js +1 -0
  530. package/dist/vega/p-1630864e.entry.js +1 -0
  531. package/dist/vega/p-1b335e30.entry.js +1 -0
  532. package/dist/vega/{p-8ade44bf.js → p-1e194737.js} +1 -1
  533. package/dist/vega/{p-2198de3e.entry.js → p-1f346008.entry.js} +1 -1
  534. package/dist/vega/p-1f86ab76.entry.js +1 -0
  535. package/dist/vega/p-1fe746ab.entry.js +1 -0
  536. package/dist/vega/{p-6ec8a9d8.entry.js → p-211c028f.entry.js} +1 -1
  537. package/dist/vega/p-21d26bb4.js +2 -0
  538. package/dist/vega/{p-353d32c0.entry.js → p-23e6f2b2.entry.js} +1 -1
  539. package/dist/vega/p-268aea63.js +1 -0
  540. package/dist/vega/{p-a01f149d.entry.js → p-27ccf34d.entry.js} +1 -1
  541. package/dist/vega/{p-913eb7f9.entry.js → p-29f9be26.entry.js} +1 -1
  542. package/dist/vega/{p-27003a81.entry.js → p-30dcf606.entry.js} +1 -1
  543. package/dist/vega/{p-1abe125f.js → p-3c20ae84.js} +1 -1
  544. package/dist/vega/p-4172fb81.js +1 -0
  545. package/dist/vega/{p-431ab4dd.js → p-419697c6.js} +1 -1
  546. package/dist/vega/p-427e4cee.entry.js +1 -0
  547. package/dist/vega/{p-3220920f.js → p-45e28b9b.js} +1 -1
  548. package/dist/vega/p-4604ed0e.entry.js +1 -0
  549. package/dist/vega/{p-8d283666.js → p-4ab3df00.js} +1 -1
  550. package/dist/vega/{p-1e940ce8.js → p-4d793cb0.js} +1 -1
  551. package/dist/vega/{p-72ecfd40.js → p-4e8fb53a.js} +1 -1
  552. package/dist/vega/{p-6b75fe39.js → p-50a3ae3d.js} +1 -1
  553. package/dist/vega/{p-4fa94b35.entry.js → p-50b80d76.entry.js} +1 -1
  554. package/dist/vega/p-52b8f2d2.js +1 -0
  555. package/dist/vega/p-531ffb18.entry.js +1 -0
  556. package/dist/vega/p-53daeb45.entry.js +1 -0
  557. package/dist/vega/p-54fdd401.entry.js +1 -0
  558. package/dist/vega/{p-ac82ca73.entry.js → p-5741ecf0.entry.js} +1 -1
  559. package/dist/vega/{p-6cabdb36.js → p-58f8928a.js} +1 -1
  560. package/dist/vega/{p-d6591d70.entry.js → p-5c4cb804.entry.js} +1 -1
  561. package/dist/vega/{p-1cd2d7b8.entry.js → p-5ce386c8.entry.js} +1 -1
  562. package/dist/vega/p-5f377954.js +1 -1
  563. package/dist/vega/{p-f7423232.entry.js → p-5fd5a538.entry.js} +1 -1
  564. package/dist/vega/{p-0969877b.entry.js → p-64f452fe.entry.js} +1 -1
  565. package/dist/vega/p-66759f4e.js +1 -0
  566. package/dist/vega/{p-8afa2115.js → p-6ea42854.js} +1 -1
  567. package/dist/vega/p-70f25341.entry.js +1 -0
  568. package/dist/vega/{p-7db32dc0.entry.js → p-737bccb9.entry.js} +1 -1
  569. package/dist/vega/{p-bcb10ae3.entry.js → p-7503fe08.entry.js} +1 -1
  570. package/dist/vega/{p-50355e06.entry.js → p-7b0a4688.entry.js} +1 -1
  571. package/dist/vega/p-7def7b74.entry.js +1 -0
  572. package/dist/vega/{p-48517a5d.entry.js → p-7f5a85c6.entry.js} +1 -1
  573. package/dist/vega/p-825ae7c4.js +1 -0
  574. package/dist/vega/p-831c4144.entry.js +1 -0
  575. package/dist/vega/p-85dc08b4.entry.js +1 -0
  576. package/dist/vega/{p-a821bcf3.js → p-86782109.js} +1 -1
  577. package/dist/vega/p-87459914.js +1 -0
  578. package/dist/vega/{p-e719b1a9.entry.js → p-87a1fc77.entry.js} +1 -1
  579. package/dist/vega/p-89565247.entry.js +1 -0
  580. package/dist/vega/{p-0a18f5f6.entry.js → p-89e915e9.entry.js} +1 -1
  581. package/dist/vega/{p-6cd8e6f4.entry.js → p-8aa7e56e.entry.js} +1 -1
  582. package/dist/vega/p-94263ece.entry.js +1 -0
  583. package/dist/vega/{p-d0007822.entry.js → p-9524e48a.entry.js} +1 -1
  584. package/dist/vega/{p-472727a4.entry.js → p-991b4717.entry.js} +1 -1
  585. package/dist/vega/{p-a8e9bfae.entry.js → p-99b9b320.entry.js} +1 -1
  586. package/dist/vega/{p-aea89be5.entry.js → p-9ba14b7c.entry.js} +1 -1
  587. package/dist/vega/p-9cb79f8d.entry.js +1 -0
  588. package/dist/vega/p-9e3f52f0.entry.js +1 -0
  589. package/dist/vega/{p-6586e2a2.entry.js → p-a0e122a6.entry.js} +1 -1
  590. package/dist/vega/{p-96b4c0cc.entry.js → p-b0fe6c0f.entry.js} +1 -1
  591. package/dist/vega/{p-b2bca332.entry.js → p-b518e1a0.entry.js} +1 -1
  592. package/dist/vega/p-b538e81a.entry.js +1 -0
  593. package/dist/vega/p-b824baf7.entry.js +1 -0
  594. package/dist/vega/{p-2fadef27.entry.js → p-b959b4d4.entry.js} +1 -1
  595. package/dist/vega/{p-57e813f2.entry.js → p-bb4f0fa1.entry.js} +1 -1
  596. package/dist/vega/{p-2da83c2a.js → p-bbb39d6f.js} +1 -1
  597. package/dist/vega/{p-700da800.entry.js → p-bc8fd0ee.entry.js} +1 -1
  598. package/dist/vega/p-bcaf8375.entry.js +1 -0
  599. package/dist/vega/p-bec90ff3.entry.js +1 -0
  600. package/dist/vega/p-c6b94dde.entry.js +1 -0
  601. package/dist/vega/{p-c754b32c.js → p-ce6b62c4.js} +1 -1
  602. package/dist/vega/{p-5e34ea25.entry.js → p-d00fbc11.entry.js} +1 -1
  603. package/dist/vega/p-d27ae9ff.js +1 -0
  604. package/dist/vega/{p-10a40dfb.entry.js → p-d2a2af2c.entry.js} +1 -1
  605. package/dist/vega/p-d64b20c2.js +1 -0
  606. package/dist/vega/p-da779940.entry.js +1 -0
  607. package/dist/vega/{p-7f6702f7.js → p-db910162.js} +1 -1
  608. package/dist/vega/{p-6f81fe1e.js → p-e1a2a701.js} +1 -1
  609. package/dist/vega/p-e3694aa5.entry.js +1 -0
  610. package/dist/vega/p-e7318c4c.entry.js +1 -0
  611. package/dist/vega/{p-a5c39ba2.entry.js → p-e8fc027e.entry.js} +1 -1
  612. package/dist/vega/{p-ccdd49be.entry.js → p-e92ecb78.entry.js} +1 -1
  613. package/dist/vega/p-e969c3f4.entry.js +1 -0
  614. package/dist/vega/{p-8bc4c015.entry.js → p-ec8b7f01.entry.js} +1 -1
  615. package/dist/vega/{p-a25939ad.js → p-eda5b7fd.js} +1 -1
  616. package/dist/vega/p-eed9bda2.entry.js +1 -0
  617. package/dist/vega/p-f4c54c98.entry.js +1 -0
  618. package/dist/vega/{p-ff41dc6a.entry.js → p-f5fc80bc.entry.js} +1 -1
  619. package/dist/vega/p-f67be7ef.js +1 -0
  620. package/dist/vega/{p-5e3a15a1.js → p-f9fafc55.js} +1 -1
  621. package/dist/vega/{p-27e56c67.entry.js → p-fc21fb2d.entry.js} +1 -1
  622. package/dist/vega/p-fed9220b.entry.js +1 -0
  623. package/dist/vega/vega.esm.js +1 -1
  624. package/package.json +2 -1
  625. package/dist/cjs/string-21427167.js +0 -13
  626. package/dist/esm/string-be824360.js +0 -11
  627. package/dist/vega/p-01fd343e.entry.js +0 -1
  628. package/dist/vega/p-0bb29d98.js +0 -1
  629. package/dist/vega/p-1503f791.js +0 -1
  630. package/dist/vega/p-1c298d5a.js +0 -2
  631. package/dist/vega/p-24e0cdcc.entry.js +0 -1
  632. package/dist/vega/p-2565cb0c.entry.js +0 -1
  633. package/dist/vega/p-26e4221c.entry.js +0 -1
  634. package/dist/vega/p-27e3825f.entry.js +0 -1
  635. package/dist/vega/p-2bd64faf.entry.js +0 -1
  636. package/dist/vega/p-33ffaa71.entry.js +0 -1
  637. package/dist/vega/p-34a70d18.entry.js +0 -1
  638. package/dist/vega/p-3647d61d.js +0 -1
  639. package/dist/vega/p-3aa244d4.entry.js +0 -1
  640. package/dist/vega/p-429616af.entry.js +0 -1
  641. package/dist/vega/p-44b0a005.js +0 -1
  642. package/dist/vega/p-4e167a8c.js +0 -1
  643. package/dist/vega/p-4e76904e.entry.js +0 -1
  644. package/dist/vega/p-52e17867.entry.js +0 -1
  645. package/dist/vega/p-57cdacb1.entry.js +0 -1
  646. package/dist/vega/p-58b8c06b.entry.js +0 -1
  647. package/dist/vega/p-59ccf915.entry.js +0 -1
  648. package/dist/vega/p-5cbadf95.entry.js +0 -1
  649. package/dist/vega/p-63414091.entry.js +0 -1
  650. package/dist/vega/p-6aa569e5.entry.js +0 -1
  651. package/dist/vega/p-6d7d923b.js +0 -1
  652. package/dist/vega/p-6e898779.js +0 -1
  653. package/dist/vega/p-804f71b3.js +0 -1
  654. package/dist/vega/p-84aac4b1.entry.js +0 -1
  655. package/dist/vega/p-8aec8dac.entry.js +0 -1
  656. package/dist/vega/p-8ba43640.entry.js +0 -1
  657. package/dist/vega/p-a8b681ed.entry.js +0 -1
  658. package/dist/vega/p-b5f5a5e0.js +0 -1
  659. package/dist/vega/p-ba6c7f00.entry.js +0 -1
  660. package/dist/vega/p-be40684b.entry.js +0 -1
  661. package/dist/vega/p-bf1894ec.js +0 -1
  662. package/dist/vega/p-c1e1adf9.entry.js +0 -1
  663. package/dist/vega/p-c5f8b3a3.entry.js +0 -1
  664. package/dist/vega/p-c96effa5.entry.js +0 -1
  665. package/dist/vega/p-ca34443a.entry.js +0 -1
  666. package/dist/vega/p-cb637815.entry.js +0 -1
  667. package/dist/vega/p-ce70a54a.entry.js +0 -1
  668. package/dist/vega/p-dbc82247.js +0 -1
  669. package/dist/vega/p-e29da13d.entry.js +0 -1
  670. package/dist/vega/p-fb853d5f.entry.js +0 -1
  671. package/dist/vega/p-fd018044.entry.js +0 -1
  672. package/dist/vega/p-fda0c179.entry.js +0 -1
@@ -0,0 +1,759 @@
1
+ import { M as MapToComponentMethod, V as VegaSlimmer, L as LogUtility, c as MapToComponentField } from './global-slimmer-registry-17c4efd4.js';
2
+ import { d as debounce } from './timer-9321173b.js';
3
+ import { E as RTENode, F as stateEntityRenderingRegistry, a as RTEImageNode, V as RTECodeBlockNode, g as RTETextNode, Z as ZERO_WIDTH_SPACE, P as SelectionChangeAction, G as InternalAnnotationTypeEnum, z as RTECodeBlock } from './code-block-8b5bd928.js';
4
+ import { g as getActiveElement } from './component-cae24190.js';
5
+ import { C as ChangeManager } from './change-manager-6a7eb88c.js';
6
+ import { d as domNodeSubjectFactory } from './dom-node-subject-factory-eb6bba5d.js';
7
+ import { b as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-820393ad.js';
8
+ import { O as Observer } from './observer-3959f9dd.js';
9
+ import { f as findParent } from './ui-ed1283bb.js';
10
+ import { S as SynchronizeTaskQueue } from './synchronize-task-queue-ac8acc3b.js';
11
+
12
+ let processing = false;
13
+ /**
14
+ * Simulate a selection for browsers that don't support shadow selection.
15
+ * Cypress test case added in https://github.com/heartlandpayments/Vega/pull/1561/files#diff-83bdbaaf47fc156ab878099aa1f21b0e8ab92abe5852521299f1fb6efab001c2R300
16
+ */
17
+ class ShadowSelection {
18
+ constructor() {
19
+ this.rangeCount = 0;
20
+ this.ranges = [];
21
+ }
22
+ /**
23
+ * Returns a Range object at a specified index.
24
+ *
25
+ * @param {number} index - A specified index.
26
+ * @returns {Range} - A Range object.
27
+ */
28
+ getRangeAt(index) {
29
+ return this.ranges[index];
30
+ }
31
+ /**
32
+ * Adds a Range to ranges array.
33
+ *
34
+ * @param {Range} range - The range of selection.
35
+ */
36
+ addRange(range) {
37
+ this.ranges.push(range);
38
+ this.rangeCount = this.ranges.length;
39
+ if (!processing) {
40
+ const windowSelection = window.getSelection();
41
+ windowSelection.removeAllRanges();
42
+ windowSelection.setBaseAndExtent(range.startContainer, range.startOffset, range.endContainer, range.endOffset);
43
+ }
44
+ }
45
+ /**
46
+ * Clears all ranges.
47
+ */
48
+ removeAllRanges() {
49
+ this.ranges = [];
50
+ this.rangeCount = 0;
51
+ }
52
+ }
53
+ /**
54
+ * Due to the ShadowRoot.getSelection is not a standard API, we add this polyfill to achieve this function.
55
+ *
56
+ * - On Chromium, calling document.getSelection will not pierce into the Shadow DOM and gives you some unhelpful high-level element.
57
+ * But it does expose the non-standard getSelection method on the ShadowRoot.
58
+ *
59
+ * - On Firefox, it does not implement ShadowRoot.getSelection,
60
+ * but document.getSelection will pierce through shadow dom and give you the exact element.
61
+ *
62
+ * - On Safari, Selection.getComposedRanges is supported as of v17. On versions before that,
63
+ * ShadowRoot.getSelection is not supported and apparently document.getSelection does not pierce the Shadow DOM, meaning you are just out of luck.
64
+ *
65
+ * https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot#shadowroot.getselection
66
+ * https://stackoverflow.com/a/70523247
67
+ */
68
+ class ShadowSelectionPolyfill {
69
+ constructor() {
70
+ this.supportShadowSelection = typeof window.ShadowRoot.prototype['getSelection'] === 'function';
71
+ this.supportBeforeInput = typeof window.InputEvent.prototype.getTargetRanges === 'function';
72
+ this.isFirefox = window.navigator.userAgent.toLowerCase().indexOf('firefox') > 0;
73
+ this.listen();
74
+ }
75
+ /**
76
+ * For Firefox, we directly use document.getSelection()
77
+ * For other browser which not support shadowroot.getSelection, we use this.selection which is built by us.
78
+ * For browser which supported shadowroot.getSelection, we use shadowRoot.getselection().
79
+ *
80
+ * @param {ShadowRoot} shadow - A shadow.
81
+ * @returns {Nullable<Selection>} - The shadow selection.
82
+ */
83
+ getSelection(shadow) {
84
+ if (this.supportShadowSelection) {
85
+ return shadow['getSelection']();
86
+ }
87
+ else {
88
+ return this.isFirefox
89
+ ? this.getFirefoxSelection()
90
+ : this.polyfilledShadowSelection;
91
+ }
92
+ }
93
+ /**
94
+ * Get selection in firefox.
95
+ *
96
+ * Example:
97
+ *
98
+ * <span>span1</span><span>span2</span><span>span3</span>
99
+ *
100
+ * In firefox, while selected `span2`, the range be likely to:
101
+ * range:
102
+ * startContainer: #text 'span1'
103
+ * startOffset: 5
104
+ * endContainer: #text 'span3'
105
+ * endOffset: 0
106
+ * start is end of brefore node and end is start of after node.
107
+ *
108
+ * So we should modify the startContainer and endContainer here.
109
+ *
110
+ * modified range:
111
+ * startContainer: #text 'span2'
112
+ * startOffset: 0
113
+ * endContainer: #text 'span2'
114
+ * endOffset: 5
115
+ *
116
+ * @returns {Selection} - document selection
117
+ */
118
+ getFirefoxSelection() {
119
+ const selection = document.getSelection();
120
+ if (selection.rangeCount > 0) {
121
+ const range = selection.getRangeAt(0);
122
+ const startNode = range.startContainer;
123
+ const endNode = range.endContainer;
124
+ if (startNode !== endNode && startNode.textContent.length === range.startOffset) {
125
+ const nextSibling = startNode.nodeType === Node.TEXT_NODE
126
+ ? startNode.parentNode.nextSibling
127
+ : startNode.nextSibling;
128
+ range.setStart(nextSibling.firstChild, 0);
129
+ }
130
+ if (endNode !== startNode && range.endOffset === 0) {
131
+ const previousSibling = endNode.nodeType === Node.TEXT_NODE
132
+ ? endNode.parentNode.previousSibling
133
+ : endNode.previousSibling;
134
+ range.setEnd(previousSibling.lastChild, previousSibling.lastChild.textContent.length);
135
+ }
136
+ }
137
+ return selection;
138
+ }
139
+ /**
140
+ * Sets up event listeners for `selectionchange` and `beforeinput` events to simulate shadow selection.
141
+ */
142
+ listen() {
143
+ if (this.isFirefox || this.supportShadowSelection || !this.supportBeforeInput)
144
+ return;
145
+ this.polyfilledShadowSelection = new ShadowSelection();
146
+ window.addEventListener('selectionchange', () => {
147
+ if (!processing) {
148
+ processing = true;
149
+ const active = getActiveElement();
150
+ if (active && active.hasAttribute('contenteditable')) {
151
+ // This command will not actually work, it only trigger the `beforeinput` event,
152
+ // the `beforeinput` event will prevented this command work.
153
+ document.execCommand('indent');
154
+ }
155
+ else {
156
+ this.polyfilledShadowSelection.removeAllRanges();
157
+ }
158
+ processing = false;
159
+ }
160
+ }, true);
161
+ window.addEventListener('beforeinput', (event) => {
162
+ if (processing) {
163
+ const ranges = event.getTargetRanges();
164
+ const range = ranges[0];
165
+ const newRange = new Range();
166
+ newRange.setStart(range.startContainer, range.startOffset);
167
+ newRange.setEnd(range.endContainer, range.endOffset);
168
+ this.polyfilledShadowSelection.removeAllRanges();
169
+ this.polyfilledShadowSelection.addRange(newRange);
170
+ event.preventDefault();
171
+ event.stopImmediatePropagation();
172
+ }
173
+ }, true);
174
+ }
175
+ }
176
+ const ShadowSelectionPolyfill$1 = new ShadowSelectionPolyfill();
177
+
178
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
179
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
180
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
181
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
182
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
183
+ };
184
+ /**
185
+ * The current slimmer contains a task queue and will call the task after component re-render.
186
+ */
187
+ class AutoRunWhenReRenderTaskQueueSlimmer extends VegaSlimmer {
188
+ constructor(maxCount) {
189
+ super();
190
+ this.autoRunTaskQueue = new SynchronizeTaskQueue(maxCount);
191
+ }
192
+ /**
193
+ * Update the caret position after the component re-render
194
+ */
195
+ async executeTaskHook() {
196
+ if (this.autoRunTaskQueue.queue.length) {
197
+ await this.autoRunTaskQueue.runTask();
198
+ }
199
+ }
200
+ /**
201
+ * Push the update task to a queue.
202
+ *
203
+ * @param {boolean} [immediatelyRun] - Should the task run immediately. default is false
204
+ */
205
+ enqueueTheTaskIntoQueue(immediatelyRun = false) {
206
+ void this.autoRunTaskQueue.enqueue({
207
+ /** Add task to the queue and run it until component did render */
208
+ run: async () => {
209
+ try {
210
+ await this.doTask();
211
+ }
212
+ catch (e) {
213
+ LogUtility.error('The auto task run failed.', e);
214
+ }
215
+ },
216
+ }, immediatelyRun);
217
+ }
218
+ }
219
+ __decorate$1([
220
+ MapToComponentMethod('componentDidUpdate')
221
+ ], AutoRunWhenReRenderTaskQueueSlimmer.prototype, "executeTaskHook", null);
222
+
223
+ /** Manages selection range for a rich text editor, providing methods to set, sync, and create native ranges based on RTENodes and Nodes. */
224
+ class RTERange {
225
+ /**
226
+ * Initial the rte range properties
227
+ *
228
+ * @param {Node} [startContainer] The range start element.
229
+ * @param {Node} [endContainer] The range end element.
230
+ * @param {number} [startOffset] The range start element content offset, default value is 0.
231
+ * @param {number} [endOffset] The range end element content offset, default value is 0.
232
+ * @param {RTENode} [startNode] The range start node, the start node could be null if the start element is root element.
233
+ * @param {RTENode} [endNode] The range start node, the start node could be null if the start element is root element.
234
+ * @param {Range} [nativeRange] The browser native range instance.
235
+ */
236
+ constructor(startContainer, endContainer, startOffset = 0, endOffset = 0, startNode, endNode, nativeRange) {
237
+ this._startOffset = 0;
238
+ this._endOffset = 0;
239
+ this._startContainer = startContainer;
240
+ this._endContainer = endContainer;
241
+ this._startOffset = startOffset;
242
+ this._endOffset = endOffset;
243
+ this._startNode = startNode;
244
+ this._endNode = endNode;
245
+ if (nativeRange) {
246
+ this._oldNativeRange = nativeRange;
247
+ }
248
+ }
249
+ /**
250
+ * Returns the start container as a Node or null if it is not set.
251
+ * The start container could be null when the dom node should be create after re-render.
252
+ *
253
+ * @returns {Nullable<Node>} The range start element.
254
+ */
255
+ get startContainer() {
256
+ return this._startContainer;
257
+ }
258
+ /**
259
+ * Returns the end container as a Node or null if it is not set.
260
+ * The end container could be null when the dom node should be create after re-render.
261
+ *
262
+ * @returns {Nullable<Node>} The range start element.
263
+ */
264
+ get endContainer() {
265
+ return this._endContainer;
266
+ }
267
+ /**
268
+ * Returns the range start RTE node as a RTENode or null if it is not set.
269
+ * The start RTENode could be null when the range start node is the root element of the rich text editor.
270
+ *
271
+ * @returns {Nullable<RTENode>} The range start element.
272
+ */
273
+ get startNode() {
274
+ return this._startNode;
275
+ }
276
+ /**
277
+ * Returns the range end RTE node as a RTENode or null if it is not set.
278
+ * The end RTENode could be null when the range end node is the root element of the rich text editor.
279
+ *
280
+ * @returns {Nullable<RTENode>} The range start element.
281
+ */
282
+ get endNode() {
283
+ return this._endNode;
284
+ }
285
+ /**
286
+ * Returns range's start offset.
287
+ *
288
+ * @returns {number} The character length in text node or the element index of parent element.
289
+ */
290
+ get startOffset() {
291
+ return this._startOffset;
292
+ }
293
+ /**
294
+ * Returns range's start offset.
295
+ *
296
+ * @returns {number} The character length in text node or the element index of parent element.
297
+ */
298
+ get endOffset() {
299
+ return this._endOffset;
300
+ }
301
+ /**
302
+ * Updates the range options for a Rich Text Editor.
303
+ * This method will called after modify the content, the start node and end node should be rte node.
304
+ * This method will called after selectionchange event emit, the start node and end node should be the html node.
305
+ *
306
+ * @param {RTERangeOptions} options - An object that contains the following properties:
307
+ * @param {Range} [nativeRange] - The native range instance
308
+ * @returns {RTERange} - The new RTERange instance
309
+ */
310
+ updateRTERange(options, nativeRange) {
311
+ const { startOffset, endOffset } = options;
312
+ this._startOffset = startOffset;
313
+ this._endOffset = endOffset;
314
+ const startNode = options.startNode;
315
+ const endNode = options.endNode;
316
+ if (startNode instanceof RTENode) {
317
+ this._startNode = startNode;
318
+ this._endNode = endNode;
319
+ const startContainer = this.getElementByRTENode(this._startNode);
320
+ const endContainer = this._startNode === this._endNode ? startContainer : this.getElementByRTENode(this._endNode);
321
+ if (startContainer) {
322
+ this._startContainer = startContainer;
323
+ this._endContainer = endContainer;
324
+ }
325
+ }
326
+ else {
327
+ // The selectionchange callback has a 50 ms delay, so we need to check the next range is the same as the current ret range.
328
+ this._startContainer = startNode;
329
+ this._endContainer = endNode;
330
+ this._startNode = this.getRTENodeByElement(this._startContainer);
331
+ this._endNode =
332
+ this._startContainer === this._endContainer
333
+ ? this._startNode
334
+ : this.getRTENodeByElement(this._endContainer);
335
+ if (nativeRange) {
336
+ this._oldNativeRange = nativeRange;
337
+ }
338
+ }
339
+ return new RTERange(this._startContainer, this._endContainer, this._startOffset, this._endOffset, this._startNode, this._endNode, this._oldNativeRange);
340
+ }
341
+ /**
342
+ * Creates a new instance of the `RTERange` class with the same properties as the current instance.
343
+ *
344
+ * @returns {RTERange} A new `RTERange` instance with the same start and end containers, offsets, and nodes.
345
+ */
346
+ clone() {
347
+ return new RTERange(this._startContainer, this._endContainer, this._startOffset, this._endOffset, this._startNode, this._endNode, this._oldNativeRange);
348
+ }
349
+ /**
350
+ * Creates a Range object based on start and end nodes and offsets.
351
+ * Invoke this method to get the future range state if the range content modified.
352
+ * Invoke this method to get the native range instance if range start node and end node not defined
353
+ *
354
+ * @returns {Nullable<Range>} The range instance. The return value could be null if the start node or end node are not rendered.
355
+ */
356
+ toNativeRange() {
357
+ const startContainer = this.getElementByRTENode(this._startNode);
358
+ const endContainer = this._startNode === this._endNode ? startContainer : this.getElementByRTENode(this._endNode);
359
+ const range = new Range();
360
+ if (startContainer && endContainer) {
361
+ range.setStart(startContainer, this._startOffset);
362
+ range.setEnd(endContainer, this._endOffset);
363
+ this._startContainer = startContainer;
364
+ this._endContainer = endContainer;
365
+ this._oldNativeRange = range;
366
+ return range;
367
+ }
368
+ else if (this._oldNativeRange) {
369
+ return this._oldNativeRange;
370
+ }
371
+ }
372
+ /**
373
+ * Retrieves the DOM element associated with a given RTENode entity.
374
+ *
375
+ * @param {Nullable<RTENode>} node - Represents a node in a Rich Text Editor.
376
+ * @returns {Nullable<Node>} a Node object or null.
377
+ */
378
+ getElementByRTENode(node) {
379
+ if (node) {
380
+ const element = stateEntityRenderingRegistry.getDOMByEntity(node);
381
+ if (element) {
382
+ return node instanceof RTEImageNode
383
+ ? findParent(element, 'vega-rich-text-image-editor')
384
+ : element.firstChild;
385
+ }
386
+ }
387
+ }
388
+ /**
389
+ * Retrieves an RTENode based on the given element by checking its type and parent elements.
390
+ *
391
+ * @param {Node} element - An element in the DOM (Document Object Model).
392
+ * @returns { Nullable<RTENode>} Returns a nullable `RTENode` object.
393
+ */
394
+ getRTENodeByElement(element) {
395
+ if (element) {
396
+ const registerElement = element.nodeType === Node.TEXT_NODE
397
+ ? element.parentElement
398
+ : element.nodeName === 'VEGA-RICH-TEXT-IMAGE-EDITOR'
399
+ ? element.querySelector('img')
400
+ : element;
401
+ return stateEntityRenderingRegistry.getEntityByDOM(registerElement);
402
+ }
403
+ }
404
+ }
405
+
406
+ /**
407
+ * Represents the state of the selection in the RTE.
408
+ */
409
+ class RTESelectionState {
410
+ constructor(range) {
411
+ this.range = range;
412
+ }
413
+ /**
414
+ * Clones the selection state, updating the range nodes based on the provided content.
415
+ *
416
+ * @returns {RTESelectionState} A new instance of RTESelectionState with the updated range.
417
+ */
418
+ clone() {
419
+ const newRange = this.range.clone();
420
+ return new RTESelectionState(newRange);
421
+ }
422
+ }
423
+
424
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
425
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
426
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
427
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
428
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
429
+ };
430
+ /**
431
+ * The text selection controller
432
+ */
433
+ class SelectionController extends AutoRunWhenReRenderTaskQueueSlimmer {
434
+ constructor() {
435
+ super(1);
436
+ this.currentRange = new RTERange();
437
+ this.handleSelectionWithDebounce = debounce(this.handleSelectionChange, SelectionController.SELECTION_CHANGE_DEBOUNCE_TIME, this);
438
+ this.pendingRestoreSelectionNodes = [];
439
+ /**
440
+ * The method invoke after the component re-render.
441
+ */
442
+ this.doTask = async () => {
443
+ // add await Promise.resolve to put the code behind to a micro task
444
+ await Promise.resolve();
445
+ const range = this.currentRange.toNativeRange();
446
+ if (range) {
447
+ this.setSelectionRange(range);
448
+ }
449
+ };
450
+ }
451
+ /**
452
+ * Component lifecycle - [connectedCallback]{@link VegaRichTextEditor.connectedCallback}
453
+ */
454
+ connectedCallback() {
455
+ this.registerSelectionRangeChangeObserver();
456
+ }
457
+ /**
458
+ * Component lifecycle - [disconnectedCallback]{@link VegaRichTextEditor.disconnectedCallback}
459
+ */
460
+ disconnectedCallback() {
461
+ ChangeManager.unregister(domNodeSubjectFactory.getSubject(this.host, VegaInternalRichTextEditorSelectionRangeChange), this.selectionRangeChangeObserver);
462
+ }
463
+ /**
464
+ * Component lifecycle - [componentDidLoad]{@link VegaRichTextEditor.componentDidLoad}
465
+ */
466
+ componentDidLoad() {
467
+ document.addEventListener('selectionchange', this.handleSelectionWithDebounce);
468
+ }
469
+ /**
470
+ * Watches the internal value of the editor
471
+ */
472
+ watchValueUpdate() {
473
+ this.prepareRestoreSelectionState();
474
+ this.restoreSelection();
475
+ }
476
+ /**
477
+ * Get the current RTE selection range
478
+ *
479
+ * @returns {RTERange} - The current RTE selection range
480
+ */
481
+ getCurrentRange() {
482
+ return this.currentRange;
483
+ }
484
+ /**
485
+ * Get the selected rich text node
486
+ *
487
+ * @returns {RTENode[]} Selected rich text nodes
488
+ */
489
+ getSelectedNodes() {
490
+ return Array.from(this.selectionMap.values()).flat();
491
+ }
492
+ /**
493
+ * Get the selected rich text blocks
494
+ *
495
+ * @returns {RTEBlock[]} Selected rich text blocks
496
+ */
497
+ getSelectedBlocks() {
498
+ return Array.from(this.selectionMap.keys());
499
+ }
500
+ /**
501
+ * Set the selection state
502
+ *
503
+ * @param {RTESelectionState} state - The selection state to set
504
+ */
505
+ setSelectionState(state) {
506
+ this.selectionState = state;
507
+ }
508
+ /**
509
+ * Sets the next selection state with specified start and end nodes, offsets, push the update task to a queue
510
+ *
511
+ * @param {SelectionStateType['startNode']} startNode - The starting node of the selection range. It is a Node object representing the node where the selection range starts.
512
+ * @param {number} startOffset - The `startNode` where the selection range should start. It indicates the position within the `startNode` where the selection should begin.
513
+ * @param {SelectionStateType['endNode']} [endNode] - The ending node of the selection range. If a value is provided for `endNode`, it will be used as the ending node of the selection range.
514
+ * @param {number} [endOffset] - The ending offset within the `endNode` where the selection range should end.
515
+ * @param {boolean} [immediatelyRun] - Should the task run immediately. default is false
516
+ */
517
+ enqueueSelectionRangeFutureState(startNode, startOffset, endNode, endOffset, immediatelyRun = false) {
518
+ if (startNode instanceof RTECodeBlockNode) {
519
+ this.internalCodeBlockSelectionController.enqueueSelectionRangeFutureState(startNode, startOffset, immediatelyRun);
520
+ }
521
+ else {
522
+ endNode = endNode || startNode;
523
+ endOffset = endOffset || endOffset === 0 ? endOffset : startOffset;
524
+ this.currentRange = this.currentRange.updateRTERange({
525
+ startNode,
526
+ endNode,
527
+ startOffset,
528
+ endOffset,
529
+ });
530
+ super.enqueueTheTaskIntoQueue(immediatelyRun);
531
+ }
532
+ }
533
+ /**
534
+ * Set selection with a new range
535
+ *
536
+ * @param {Range} range - The range to set
537
+ */
538
+ setSelectionRange(range) {
539
+ const selection = this.getSelection();
540
+ if (selection) {
541
+ selection.removeAllRanges();
542
+ selection.addRange(range);
543
+ this.saveSelection();
544
+ }
545
+ }
546
+ /**
547
+ * Get the rich text content selected range
548
+ *
549
+ * @returns {Selection} A [Selection](https://developer.mozilla.org/en-US/docs/Web/API/Selection) object
550
+ */
551
+ getSelection() {
552
+ const richTextContentRef = this.vegaRichTextEditorRenderer.getRichTextContentRef();
553
+ return ShadowSelectionPolyfill$1.getSelection(richTextContentRef.shadowRoot);
554
+ }
555
+ /**
556
+ * Save the current selection range detail
557
+ */
558
+ saveSelection() {
559
+ const selection = this.getSelection();
560
+ // The range is out of date if the queue is not empty, or the range is update by the composition text insert, so we should not update the RTERange
561
+ if (selection &&
562
+ selection.rangeCount > 0 &&
563
+ this.autoRunTaskQueue.queue.length === 0 &&
564
+ !this.insertCompositionTextController.isComposing()) {
565
+ const range = selection.getRangeAt(0);
566
+ const { startContainer: startNode, endContainer: endNode, startOffset, endOffset } = range;
567
+ this.currentRange = this.currentRange.updateRTERange({ startNode, endNode, startOffset, endOffset }, range);
568
+ }
569
+ }
570
+ /**
571
+ * Restore the selection to the current selected nodes
572
+ */
573
+ restoreSelection() {
574
+ if (this.selectionState) {
575
+ const { startNode, endNode, startOffset, endOffset } = this.selectionState.range;
576
+ if (startNode instanceof RTETextNode && startNode === endNode && startNode.text.length === 0) {
577
+ this.enqueueSelectionRangeFutureState(startNode, ZERO_WIDTH_SPACE.length);
578
+ }
579
+ else {
580
+ this.enqueueSelectionRangeFutureState(startNode, startOffset, endNode, endOffset);
581
+ }
582
+ this.selectionState = null;
583
+ }
584
+ }
585
+ /**
586
+ * Get selected rich text
587
+ */
588
+ handleSelectionChange() {
589
+ if (this.disabled || this.sourceView)
590
+ return;
591
+ const selection = this.getSelection();
592
+ if (!selection || selection.rangeCount === 0)
593
+ return;
594
+ this.clearSelectionMap();
595
+ this.saveSelection();
596
+ const range = selection.getRangeAt(0);
597
+ const commonAncestor = range.commonAncestorContainer;
598
+ const selectedNodes = [];
599
+ /**
600
+ * Rich text node filter
601
+ *
602
+ * @param {Node} node - Start node
603
+ */
604
+ const filterNode = (node) => {
605
+ if (!range.intersectsNode(node)) {
606
+ return;
607
+ }
608
+ if (node.nodeType === Node.TEXT_NODE) {
609
+ const currentNode = node.parentElement;
610
+ const nodeEntity = stateEntityRenderingRegistry.getEntityByDOM(currentNode);
611
+ if (nodeEntity instanceof RTENode) {
612
+ selectedNodes.push(nodeEntity);
613
+ return;
614
+ }
615
+ }
616
+ if (node.nodeType === Node.ELEMENT_NODE) {
617
+ const entityElement = node.nodeName === 'VEGA-RICH-TEXT-IMAGE-EDITOR'
618
+ ? node.querySelector('img')
619
+ : node;
620
+ const nodeEntity = stateEntityRenderingRegistry.getEntityByDOM(entityElement);
621
+ if (nodeEntity instanceof RTECodeBlock) {
622
+ if (this.internalCodeBlockSelectionController.isCodeBlockSelected(nodeEntity, range)) {
623
+ selectedNodes.push(nodeEntity.nodes[0]);
624
+ }
625
+ return;
626
+ }
627
+ if (nodeEntity instanceof RTENode) {
628
+ selectedNodes.push(nodeEntity);
629
+ return;
630
+ }
631
+ }
632
+ node.childNodes.forEach(filterNode);
633
+ };
634
+ filterNode(commonAncestor);
635
+ selectedNodes.forEach((node) => {
636
+ if (this.selectionMap.has(node.parentBlock)) {
637
+ this.selectionMap.get(node.parentBlock).push(node);
638
+ }
639
+ else {
640
+ this.selectionMap.set(node.parentBlock, [node]);
641
+ }
642
+ });
643
+ this.getSelectedNodes().forEach((node) => node.apply(new SelectionChangeAction(range)));
644
+ }
645
+ /**
646
+ * Clear the selection map.
647
+ * The code node don't need clear here, because the code node will manager the selection state itself. `code-node-renderer.tsx#handleSelectionChange`
648
+ */
649
+ clearSelectionMap() {
650
+ this.getSelectedNodes()
651
+ .filter((node) => node.type !== 'CODE_BLOCK_NODE')
652
+ .forEach((node) => {
653
+ node.annotationMap.delete(InternalAnnotationTypeEnum.SELECTION_RANGE);
654
+ });
655
+ this.selectionMap = new Map();
656
+ }
657
+ /**
658
+ * Check if the selection range change is acceptable
659
+ *
660
+ * @returns {boolean} - Returns a boolean value.
661
+ */
662
+ isAcceptableSelectionRangeChange() {
663
+ return true;
664
+ }
665
+ /**
666
+ * Register the selection range change observer
667
+ */
668
+ registerSelectionRangeChangeObserver() {
669
+ this.selectionRangeChangeObserver = new Observer(this.isAcceptableSelectionRangeChange.bind(this), (payload) => {
670
+ if (!payload.updateDirectly) {
671
+ this.pendingRestoreSelectionNodes.push(payload.node);
672
+ }
673
+ else {
674
+ this.enqueueSelectionRangeFutureState(payload.node, payload.offset);
675
+ }
676
+ });
677
+ ChangeManager.register(domNodeSubjectFactory.getSubject(this.host, VegaInternalRichTextEditorSelectionRangeChange), this.selectionRangeChangeObserver);
678
+ }
679
+ /**
680
+ * Prepare the selection state to restore
681
+ */
682
+ prepareRestoreSelectionState() {
683
+ if (this.pendingRestoreSelectionNodes.length > 0) {
684
+ const startNode = this.pendingRestoreSelectionNodes[0];
685
+ const endNode = this.pendingRestoreSelectionNodes.length > 1
686
+ ? this.pendingRestoreSelectionNodes[this.pendingRestoreSelectionNodes.length - 1]
687
+ : startNode;
688
+ const { startOffset, endOffset, endContainer, startContainer } = this.currentRange;
689
+ const nodesInCurrentRange = startContainer &&
690
+ stateEntityRenderingRegistry.getDOMByEntity(startNode) === startContainer.parentElement &&
691
+ endContainer &&
692
+ stateEntityRenderingRegistry.getDOMByEntity(endNode) === endContainer.parentElement;
693
+ if (nodesInCurrentRange) {
694
+ this.currentRange = this.currentRange.updateRTERange({
695
+ startNode,
696
+ endNode,
697
+ startOffset,
698
+ endOffset,
699
+ });
700
+ this.selectionState = new RTESelectionState(this.currentRange);
701
+ }
702
+ else {
703
+ this.currentRange = this.currentRange.updateRTERange({
704
+ startNode,
705
+ endNode,
706
+ startOffset: 0,
707
+ endOffset: endNode.text.length,
708
+ });
709
+ this.selectionState = new RTESelectionState(this.currentRange);
710
+ }
711
+ this.pendingRestoreSelectionNodes = [];
712
+ }
713
+ }
714
+ }
715
+ SelectionController.SELECTION_CHANGE_DEBOUNCE_TIME = 50;
716
+ __decorate([
717
+ MapToComponentField()
718
+ ], SelectionController.prototype, "vegaRichTextEditorRenderer", void 0);
719
+ __decorate([
720
+ MapToComponentField({ writable: true })
721
+ ], SelectionController.prototype, "selectionMap", void 0);
722
+ __decorate([
723
+ MapToComponentField()
724
+ ], SelectionController.prototype, "host", void 0);
725
+ __decorate([
726
+ MapToComponentField()
727
+ ], SelectionController.prototype, "value", void 0);
728
+ __decorate([
729
+ MapToComponentField()
730
+ ], SelectionController.prototype, "disabled", void 0);
731
+ __decorate([
732
+ MapToComponentField()
733
+ ], SelectionController.prototype, "sourceView", void 0);
734
+ __decorate([
735
+ MapToComponentField()
736
+ ], SelectionController.prototype, "valueController", void 0);
737
+ __decorate([
738
+ MapToComponentField()
739
+ ], SelectionController.prototype, "insertCompositionTextController", void 0);
740
+ __decorate([
741
+ MapToComponentField()
742
+ ], SelectionController.prototype, "historyController", void 0);
743
+ __decorate([
744
+ MapToComponentField()
745
+ ], SelectionController.prototype, "internalCodeBlockSelectionController", void 0);
746
+ __decorate([
747
+ MapToComponentMethod('connectedCallback')
748
+ ], SelectionController.prototype, "connectedCallback", null);
749
+ __decorate([
750
+ MapToComponentMethod('disconnectedCallback')
751
+ ], SelectionController.prototype, "disconnectedCallback", null);
752
+ __decorate([
753
+ MapToComponentMethod('componentDidLoad')
754
+ ], SelectionController.prototype, "componentDidLoad", null);
755
+ __decorate([
756
+ MapToComponentMethod('watchValueUpdate')
757
+ ], SelectionController.prototype, "watchValueUpdate", null);
758
+
759
+ export { AutoRunWhenReRenderTaskQueueSlimmer as A, RTESelectionState as R, ShadowSelection as S, ShadowSelectionPolyfill$1 as a, SelectionController as b };