@globalpayments/vega 2.33.0 → 2.34.1

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 (893) hide show
  1. package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
  2. package/dist/cjs/{app-globals-d28dd560.js → app-globals-48582633.js} +31 -22
  3. package/dist/cjs/block-annotation.abstract-4d88b939.js +875 -0
  4. package/dist/cjs/{breakpoints-7e2dff90.js → breakpoints-17d6c4c7.js} +2 -13
  5. package/dist/cjs/breakpoints-ebde4837.js +14 -0
  6. package/dist/cjs/{change-manager-a297e4d2.js → change-manager-bda1d107.js} +1 -1
  7. package/dist/cjs/{chevron-down-ca2fa88e.js → chevron-down-9847bf78.js} +0 -5
  8. package/dist/cjs/chevron-up-21465cf7.js +7 -0
  9. package/dist/cjs/{child-nodes-event-prevent-slimmer-f07a8fe9.js → child-nodes-event-prevent-slimmer-e1a6e5ad.js} +3 -3
  10. package/dist/cjs/{child-nodes-notify-observer-slimmer-79f2f5a7.js → child-nodes-notify-observer-slimmer-03a3f79e.js} +5 -5
  11. package/dist/cjs/{component-73a88c4e.js → component-63af66ea.js} +1 -1
  12. package/dist/cjs/{component-global-style-slimmer-6749808c.js → component-global-style-slimmer-6b64a26c.js} +1 -1
  13. package/dist/cjs/{component-usage-runtime-metrics-1ee24991.js → component-usage-runtime-metrics-019d3c00.js} +2 -2
  14. package/dist/cjs/content-state-6a5b9736.js +1954 -0
  15. package/dist/cjs/{create-public-api-runtime-metrics-slimmer-5cc88124.js → create-public-api-runtime-metrics-slimmer-8c6a8fb7.js} +3 -3
  16. package/dist/cjs/{date-0a6bb035.js → date-ffe382a4.js} +1 -1
  17. package/dist/cjs/{deprecated-property-slimmer-fc729fd9.js → deprecated-property-slimmer-f36e3779.js} +2 -2
  18. package/dist/cjs/{design-token-92906579.js → design-token-908e3f69.js} +5 -5
  19. package/dist/cjs/{vega-event-id-81270f6a.js → dom-node-subject-observer-factory-093462f1.js} +170 -0
  20. package/dist/cjs/{dynamic-slimmer-f31fdfd7.js → dynamic-slimmer-dc30600a.js} +1 -1
  21. package/dist/cjs/{element-appender-slimmer-415d261a.js → element-appender-slimmer-0dd70e61.js} +17 -10
  22. package/dist/cjs/{event-emit-slimmer-83278943.js → event-emit-slimmer-a46bb411.js} +5 -5
  23. package/dist/cjs/{feature-flag-controller-0d1015fa.js → feature-flag-controller-e97b5f29.js} +3 -3
  24. package/dist/cjs/{form-field-controller-slimmer-2a982ead.js → form-field-controller-slimmer-9aeabcdc.js} +16 -17
  25. package/dist/cjs/{index-09acd3c9.js → global-slimmer-registry-dd2691b8.js} +296 -274
  26. package/dist/cjs/{icon-manager-3787af39.js → icon-manager-36dcfb65.js} +2 -2
  27. package/dist/cjs/index-8b247c17.js +325 -0
  28. package/dist/cjs/index.cjs.js +37 -30
  29. package/dist/cjs/{inject-keyboard-manager-e79a1ade.js → inject-keyboard-manager-af37c861.js} +1 -1
  30. package/dist/cjs/{internal-icon-manager-2ff58050.js → internal-icon-manager-2282a62f.js} +1 -1
  31. package/dist/cjs/{internal-vega-event-manager-5fe83465.js → internal-vega-event-manager-d7643ec6.js} +72 -68
  32. package/dist/cjs/{internal-vega-z-index-manager-f03ddb37.js → internal-vega-z-index-manager-e24e4309.js} +1 -1
  33. package/dist/cjs/{keyboard-manager-34b78600.js → keyboard-manager-5afbc8f1.js} +1 -1
  34. package/dist/cjs/{keyboard-manager-slimmer-8e2d4b5d.js → keyboard-manager-slimmer-9be2a880.js} +2 -2
  35. package/dist/cjs/loader.cjs.js +28 -23
  36. package/dist/cjs/{mutation-observer-slimmer-895b3d3e.js → mutation-observer-slimmer-98bbbdf0.js} +1 -1
  37. package/dist/cjs/{vega-skeleton-loader-controller-4a1eedcd.js → node.abstract-f8075f84.js} +234 -840
  38. package/dist/cjs/{page-resize-observer-slimmer-a8cf1874.js → page-resize-observer-slimmer-e54fa9d4.js} +2 -2
  39. package/dist/cjs/{remote-invocation-registry-32aaf6c2.js → remote-invocation-registry-71a45468.js} +4 -4
  40. package/dist/cjs/{required-field-rule-9a57b1a0.js → required-field-rule-7f9945fa.js} +2 -1
  41. package/dist/cjs/{responsive-format-facade-ad2f67bf.js → responsive-format-facade-74079f1b.js} +3 -3
  42. package/dist/cjs/{state-background-color-formatter-418b84e6.js → state-background-color-formatter-d32a1098.js} +2 -2
  43. package/dist/cjs/{static-subject-title-471e1793.js → static-subject-title-d66b88fb.js} +2 -0
  44. package/dist/cjs/{string-input-formatter-slimmer-79272527.js → string-input-formatter-slimmer-297765c0.js} +2 -2
  45. package/dist/cjs/{style-formatter-68f3a5f8.js → style-formatter-5deb065f.js} +2 -2
  46. package/dist/cjs/{sub-state-notify-slimmer-13f1892b.js → sub-state-notify-slimmer-73201c53.js} +6 -7
  47. package/dist/cjs/{sub-state-observer-slimmer-6c0b635d.js → sub-state-observer-slimmer-10c0d402.js} +6 -7
  48. package/dist/cjs/{synchronize-task-queue-8977cf10.js → synchronize-task-queue-1ee80e94.js} +10 -1
  49. package/dist/cjs/text-color-toolbar-button-slimmer-21a166e4.js +210 -0
  50. package/dist/cjs/text-node-494856f3.js +955 -0
  51. package/dist/cjs/{translation-42c1b2c8.js → translation-f6b7ee84.js} +4 -4
  52. package/dist/cjs/{translation-slimmer-32aa13e7.js → translation-slimmer-90f9f71f.js} +2 -2
  53. package/dist/cjs/trash-can-46a5e19a.js +7 -0
  54. package/dist/cjs/{type-guard-a07b353b.js → type-guard-4ba85fdc.js} +18 -18
  55. package/dist/cjs/{ui-08f33116.js → ui-b5906704.js} +20 -1
  56. package/dist/cjs/vega-accordion.cjs.entry.js +46 -47
  57. package/dist/cjs/vega-app-footer.cjs.entry.js +12 -13
  58. package/dist/cjs/vega-app-header-button.cjs.entry.js +48 -48
  59. package/dist/cjs/vega-backdrop.cjs.entry.js +8 -9
  60. package/dist/cjs/vega-banner.cjs.entry.js +36 -38
  61. package/dist/cjs/vega-bar-chart.cjs.entry.js +5 -6
  62. package/dist/cjs/vega-box.cjs.entry.js +15 -15
  63. package/dist/cjs/vega-breadcrumb.cjs.entry.js +34 -36
  64. package/dist/cjs/vega-button-circle.cjs.entry.js +29 -30
  65. package/dist/cjs/vega-button-group_2.cjs.entry.js +32 -34
  66. package/dist/cjs/vega-button-link.cjs.entry.js +26 -28
  67. package/dist/cjs/vega-button.cjs.entry.js +30 -31
  68. package/dist/cjs/vega-calendar_3.cjs.entry.js +139 -140
  69. package/dist/cjs/vega-card.cjs.entry.js +13 -13
  70. package/dist/cjs/vega-carousel.cjs.entry.js +27 -29
  71. package/dist/cjs/vega-checkbox_2.cjs.entry.js +49 -50
  72. package/dist/cjs/vega-chip.cjs.entry.js +39 -40
  73. package/dist/cjs/vega-color-picker.cjs.entry.js +29 -31
  74. package/dist/cjs/vega-combo-box.cjs.entry.js +52 -53
  75. package/dist/cjs/vega-counter-badge.cjs.entry.js +9 -10
  76. package/dist/cjs/vega-date-picker_2.cjs.entry.js +62 -62
  77. package/dist/cjs/{vega-dialog-controller-dce8cdaf.js → vega-dialog-controller-aaf1f43e.js} +2 -2
  78. package/dist/cjs/vega-dialog_2.cjs.entry.js +50 -51
  79. package/dist/cjs/vega-divider.cjs.entry.js +13 -13
  80. package/dist/cjs/vega-dropdown_5.cjs.entry.js +133 -134
  81. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  82. package/dist/cjs/vega-field-error.cjs.entry.js +8 -9
  83. package/dist/cjs/vega-field-label.cjs.entry.js +20 -23
  84. package/dist/cjs/vega-file-uploader.cjs.entry.js +76 -81
  85. package/dist/cjs/vega-flex.cjs.entry.js +18 -17
  86. package/dist/cjs/vega-font.cjs.entry.js +16 -16
  87. package/dist/cjs/vega-form.cjs.entry.js +41 -42
  88. package/dist/cjs/vega-grid.cjs.entry.js +13 -13
  89. package/dist/cjs/vega-hint.cjs.entry.js +6 -7
  90. package/dist/cjs/vega-icon.cjs.entry.js +18 -18
  91. package/dist/cjs/vega-image-uploader.cjs.entry.js +57 -58
  92. package/dist/cjs/vega-input-credit-card.cjs.entry.js +42 -43
  93. package/dist/cjs/vega-input-numeric.cjs.entry.js +35 -36
  94. package/dist/cjs/vega-input-phone-number.cjs.entry.js +51 -52
  95. package/dist/cjs/vega-input-range.cjs.entry.js +44 -45
  96. package/dist/cjs/vega-input-select.cjs.entry.js +71 -71
  97. package/dist/cjs/vega-input.cjs.entry.js +50 -52
  98. package/dist/cjs/{vega-internal-event-id-79be9bc5.js → vega-internal-event-id-85b68849.js} +12 -0
  99. package/dist/cjs/vega-item-toggle.cjs.entry.js +19 -22
  100. package/dist/cjs/vega-left-nav_5.cjs.entry.js +107 -107
  101. package/dist/cjs/vega-line-chart.cjs.entry.js +6 -7
  102. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +18 -18
  103. package/dist/cjs/vega-page-notification_2.cjs.entry.js +18 -21
  104. package/dist/cjs/vega-pagination.cjs.entry.js +58 -57
  105. package/dist/cjs/vega-pie-chart.cjs.entry.js +6 -7
  106. package/dist/cjs/vega-popover_2.cjs.entry.js +72 -37
  107. package/dist/cjs/vega-progress-tracker.cjs.entry.js +27 -30
  108. package/dist/cjs/vega-radio_2.cjs.entry.js +53 -54
  109. package/dist/cjs/vega-rich-text-content.cjs.entry.js +179 -0
  110. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +5107 -0
  111. package/dist/cjs/vega-section-title.cjs.entry.js +14 -15
  112. package/dist/cjs/vega-segment-control.cjs.entry.js +24 -26
  113. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +53 -54
  114. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +64 -65
  115. package/dist/cjs/vega-sidenav_3.cjs.entry.js +48 -50
  116. package/dist/cjs/vega-signature-capture.cjs.entry.js +44 -46
  117. package/dist/cjs/vega-skeleton.cjs.entry.js +25 -26
  118. package/dist/cjs/vega-slot-container.cjs.entry.js +5 -6
  119. package/dist/cjs/vega-stepper.cjs.entry.js +38 -39
  120. package/dist/cjs/vega-tab-group_2.cjs.entry.js +58 -59
  121. package/dist/cjs/vega-table_8.cjs.entry.js +184 -184
  122. package/dist/cjs/vega-text.cjs.entry.js +10 -10
  123. package/dist/cjs/vega-textarea.cjs.entry.js +39 -40
  124. package/dist/cjs/vega-time-picker_2.cjs.entry.js +88 -89
  125. package/dist/cjs/vega-toggle-switch.cjs.entry.js +25 -27
  126. package/dist/cjs/vega-tooltip_2.cjs.entry.js +22 -22
  127. package/dist/cjs/vega.cjs.js +28 -23
  128. package/dist/collection/collection-manifest.json +18 -0
  129. package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +2 -2
  130. package/dist/collection/components/vega-pagination/vega-pagination.js +5 -2
  131. package/dist/collection/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.js +42 -4
  132. package/dist/collection/components/vega-rich-text-content/slimmers/controllers/vega-rich-text-content-state-controller.js +38 -0
  133. package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +59 -0
  134. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +132 -0
  135. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +124 -0
  136. package/dist/collection/components/vega-rich-text-editor/assets/align-center.js +3 -0
  137. package/dist/collection/components/vega-rich-text-editor/assets/align-justify.js +3 -0
  138. package/dist/collection/components/vega-rich-text-editor/assets/align-left.js +3 -0
  139. package/dist/collection/components/vega-rich-text-editor/assets/align-right.js +3 -0
  140. package/dist/collection/components/vega-rich-text-editor/assets/bold.js +3 -0
  141. package/dist/collection/components/vega-rich-text-editor/assets/code-simple.js +3 -0
  142. package/dist/collection/components/vega-rich-text-editor/assets/image.js +3 -0
  143. package/dist/collection/components/vega-rich-text-editor/assets/indent.js +3 -0
  144. package/dist/collection/components/vega-rich-text-editor/assets/italic.js +3 -0
  145. package/dist/collection/components/vega-rich-text-editor/assets/link.js +3 -0
  146. package/dist/collection/components/vega-rich-text-editor/assets/list-ol.js +3 -0
  147. package/dist/collection/components/vega-rich-text-editor/assets/list-ul.js +3 -0
  148. package/dist/collection/components/vega-rich-text-editor/assets/outdent.js +3 -0
  149. package/dist/collection/components/vega-rich-text-editor/assets/strikethrough.js +3 -0
  150. package/dist/collection/components/vega-rich-text-editor/assets/text-size.js +3 -0
  151. package/dist/collection/components/vega-rich-text-editor/assets/text-slash.js +3 -0
  152. package/dist/collection/components/vega-rich-text-editor/assets/text.js +3 -0
  153. package/dist/collection/components/vega-rich-text-editor/assets/underline.js +3 -0
  154. package/dist/collection/components/vega-rich-text-editor/constants/constant.js +33 -0
  155. package/dist/collection/components/vega-rich-text-editor/dto/actions/annotation-action.abstract.js +5 -0
  156. package/dist/collection/components/vega-rich-text-editor/dto/actions/append-child-nodes-action.js +9 -0
  157. package/dist/collection/components/vega-rich-text-editor/dto/actions/bold-annotation-action.js +20 -0
  158. package/dist/collection/components/vega-rich-text-editor/dto/actions/break-single-block-action.js +16 -0
  159. package/dist/collection/components/vega-rich-text-editor/dto/actions/clear-child-nodes-action.js +12 -0
  160. package/dist/collection/components/vega-rich-text-editor/dto/actions/clear-formatting-annotation-action.js +19 -0
  161. package/dist/collection/components/vega-rich-text-editor/dto/actions/code-annotation-action.js +20 -0
  162. package/dist/collection/components/vega-rich-text-editor/dto/actions/delete-block-content-action.js +14 -0
  163. package/dist/collection/components/vega-rich-text-editor/dto/actions/delete-node-annotation-action.js +19 -0
  164. package/dist/collection/components/vega-rich-text-editor/dto/actions/horizontal-alignment-annotation-action.js +20 -0
  165. package/dist/collection/components/vega-rich-text-editor/dto/actions/image-annotation-action.js +21 -0
  166. package/dist/collection/components/vega-rich-text-editor/dto/actions/indent-annotation-action.js +20 -0
  167. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-blocks-after-block.js +14 -0
  168. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-blocks-before-block.js +14 -0
  169. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-image-to-block-action.js +16 -0
  170. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-nodes-after-node-action.js +14 -0
  171. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-nodes-before-node-action.js +14 -0
  172. package/dist/collection/components/vega-rich-text-editor/dto/actions/italic-annotation-action.js +20 -0
  173. package/dist/collection/components/vega-rich-text-editor/dto/actions/line-break-multiple-block-action.js +13 -0
  174. package/dist/collection/components/vega-rich-text-editor/dto/actions/line-break-single-block-action.js +14 -0
  175. package/dist/collection/components/vega-rich-text-editor/dto/actions/link-annotation-action.js +26 -0
  176. package/dist/collection/components/vega-rich-text-editor/dto/actions/link-group-annotation-action.js +21 -0
  177. package/dist/collection/components/vega-rich-text-editor/dto/actions/merge-two-blocks-nodes-action.js +13 -0
  178. package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +32 -0
  179. package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-child-action.js +14 -0
  180. package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-nest-list-action.js +13 -0
  181. package/dist/collection/components/vega-rich-text-editor/dto/actions/replace-child-nodes-action.js +13 -0
  182. package/dist/collection/components/vega-rich-text-editor/dto/actions/replace-nest-list-action.js +13 -0
  183. package/dist/collection/components/vega-rich-text-editor/dto/actions/replace-selected-text-action.js +15 -0
  184. package/dist/collection/components/vega-rich-text-editor/dto/actions/selection-change-action.js +20 -0
  185. package/dist/collection/components/vega-rich-text-editor/dto/actions/split-block-with-node-action.js +15 -0
  186. package/dist/collection/components/vega-rich-text-editor/dto/actions/splittable-action.abstract.js +13 -0
  187. package/dist/collection/components/vega-rich-text-editor/dto/actions/strikethrough-annotation-action.js +20 -0
  188. package/dist/collection/components/vega-rich-text-editor/dto/actions/sync-up-selection-action.js +18 -0
  189. package/dist/collection/components/vega-rich-text-editor/dto/actions/text-color-annotation-action.js +20 -0
  190. package/dist/collection/components/vega-rich-text-editor/dto/actions/text-style-annotation-action.js +21 -0
  191. package/dist/collection/components/vega-rich-text-editor/dto/actions/transform-list-action.js +13 -0
  192. package/dist/collection/components/vega-rich-text-editor/dto/actions/transform-paragraph-action.js +12 -0
  193. package/dist/collection/components/vega-rich-text-editor/dto/actions/underline-annotation-action.js +20 -0
  194. package/dist/collection/components/vega-rich-text-editor/dto/actions/update-text-action.js +14 -0
  195. package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation.abstract.js +11 -0
  196. package/dist/collection/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.js +12 -0
  197. package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +38 -0
  198. package/dist/collection/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.js +19 -0
  199. package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +46 -0
  200. package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +46 -0
  201. package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +56 -0
  202. package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +36 -0
  203. package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +38 -0
  204. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +48 -0
  205. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +102 -0
  206. package/dist/collection/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.js +18 -0
  207. package/dist/collection/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.js +11 -0
  208. package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +46 -0
  209. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +59 -0
  210. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +61 -0
  211. package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +46 -0
  212. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +336 -0
  213. package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +247 -0
  214. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +170 -0
  215. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +209 -0
  216. package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +412 -0
  217. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +135 -0
  218. package/dist/collection/components/vega-rich-text-editor/dto/helper/block-base-operator.js +47 -0
  219. package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +93 -0
  220. package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +103 -0
  221. package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +265 -0
  222. package/dist/collection/components/vega-rich-text-editor/dto/range.js +178 -0
  223. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js +73 -0
  224. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +258 -0
  225. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +71 -0
  226. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +70 -0
  227. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +37 -0
  228. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.js +55 -0
  229. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.js +85 -0
  230. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +49 -0
  231. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +50 -0
  232. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.js +60 -0
  233. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +50 -0
  234. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +56 -0
  235. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +191 -0
  236. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.js +108 -0
  237. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +100 -0
  238. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +90 -0
  239. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +95 -0
  240. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +93 -0
  241. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-image-controller.js +117 -0
  242. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/rich-text-content-controller.js +15 -0
  243. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +294 -0
  244. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.js +38 -0
  245. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/text-node-color-controller.js +51 -0
  246. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/text-node-rendering-registry.js +26 -0
  247. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +201 -0
  248. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +91 -0
  249. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +97 -0
  250. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +51 -0
  251. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +70 -0
  252. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.js +70 -0
  253. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.js +68 -0
  254. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +46 -0
  255. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +47 -0
  256. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.js +47 -0
  257. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +77 -0
  258. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.js +47 -0
  259. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.js +47 -0
  260. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.js +47 -0
  261. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +72 -0
  262. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +49 -0
  263. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +46 -0
  264. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +97 -0
  265. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +45 -0
  266. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +52 -0
  267. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +129 -0
  268. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +128 -0
  269. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +62 -0
  270. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +52 -0
  271. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +126 -0
  272. package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-actions.test.js +38 -0
  273. package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +134 -0
  274. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/image-block.test.js +90 -0
  275. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-block.test.js +224 -0
  276. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-item.test.js +228 -0
  277. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +173 -0
  278. package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +172 -0
  279. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +93 -0
  280. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +433 -0
  281. package/dist/collection/components/vega-rich-text-editor/test/dto/range.test.js +53 -0
  282. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.js +57 -0
  283. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.css +50 -0
  284. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.js +246 -0
  285. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +264 -0
  286. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +676 -0
  287. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/slimmers/renderers/vega-rich-text-image-editor-renderer.js +133 -0
  288. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.css +13 -0
  289. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.js +165 -0
  290. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +144 -0
  291. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.css +11 -0
  292. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.js +247 -0
  293. package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +3 -0
  294. package/dist/collection/constants/ui.js +1 -0
  295. package/dist/collection/global/scripts/before-vega-load.js +9 -1
  296. package/dist/collection/helpers/change-manager/subject/static-subject/static-subject-title.js +1 -0
  297. package/dist/collection/helpers/common/index.js +27 -0
  298. package/dist/collection/helpers/common/test/wait-for-vega-handler.test.js +1 -1
  299. package/dist/collection/helpers/dialog/test/vega-dialog-controller.test.js +1 -1
  300. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +5 -1
  301. package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
  302. package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +6 -0
  303. package/dist/collection/helpers/event-manager/test/vega-event-manager.test.js +1 -1
  304. package/dist/collection/helpers/feature-control/feature-flag-controller.js +1 -1
  305. package/dist/collection/helpers/feature-control/tests/feature-flag-controller.test.js +1 -1
  306. package/dist/collection/helpers/icon/test/icon-manager-controller.test.js +1 -1
  307. package/dist/collection/helpers/loading-indicator/tests/vega-loader-controller.test.js +1 -1
  308. package/dist/collection/helpers/notify/tests/vega-notify-controller.test.js +1 -1
  309. package/dist/collection/helpers/public-api.js +1 -0
  310. package/dist/collection/helpers/queue/synchronize-task-queue.js +10 -1
  311. package/dist/collection/helpers/queue/test/synchronize-task-queue.test.js +28 -0
  312. package/dist/collection/helpers/skeleton-loader/tests/vega-skeleton-loader-controller.test.js +1 -1
  313. package/dist/collection/helpers/slimmers/component-usage-runtime-metrics.js +1 -1
  314. package/dist/collection/helpers/slimmers/dark-mode-state-controller-slimmer.js +46 -0
  315. package/dist/collection/helpers/slimmers/element-appender-slimmer.js +10 -3
  316. package/dist/collection/helpers/slimmers/runtime-metrics/public-api-runtime-metrics-slimmer-base.js +1 -1
  317. package/dist/collection/helpers/slimmers/runtime-metrics/test/public-api-runtime-metrics-slimmer-base.test.js +1 -1
  318. package/dist/collection/helpers/slimmers/test/component-usage-runtime-metrics.test.js +1 -1
  319. package/dist/collection/helpers/slimmers/test/dark-mode-state-controller.test.js +65 -0
  320. package/dist/collection/helpers/theme/controllers/dark-mode-style-controller.js +45 -3
  321. package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +2 -2
  322. package/dist/collection/helpers/theme/theme-manager.js +3 -0
  323. package/dist/collection/helpers/validator/rules/{file-uploader-required-rule.js → object-array-required-rule.js} +3 -3
  324. package/dist/collection/helpers/validator/rules/required-field-rule.js +2 -1
  325. package/dist/collection/helpers/validator/rules/rich-text-editor-required-rule.js +57 -0
  326. package/dist/collection/helpers/validator/test/rules/object-array-required-rule.test.js +7 -0
  327. package/dist/collection/helpers/validator/test/rules/required-field-rule.test.js +11 -0
  328. package/dist/collection/helpers/validator/test/rules/rich-text-editor-required-rule.test.js +317 -0
  329. package/dist/collection/helpers/zindex/test/vega-z-index-manager.test.js +1 -1
  330. package/dist/collection/polyfill/shadow-selection/shadow-selection-polyfill.js +164 -0
  331. package/dist/collection/polyfill/shadow-selection/test/shadow-selection-polyfill.test.js +233 -0
  332. package/dist/collection/polyfill/test-polyfill/unit/index.js +1 -0
  333. package/dist/collection/polyfill/test-polyfill/unit/methods.js +9 -0
  334. package/dist/collection/polyfill/test-polyfill/unit/range.js +15 -0
  335. package/dist/collection/polyfill/test-polyfill/unit/shadow-selection.js +17 -0
  336. package/dist/collection/utils/spec-utils.js +2 -1
  337. package/dist/collection/utils/test/ui.test.js +6 -1
  338. package/dist/collection/utils/ui.js +18 -0
  339. package/dist/collection/value-model-adapters/angular-ng-model-accessor-adapter.js +1 -0
  340. package/dist/collection/value-model-adapters/vue-component-v-model-adaptor.js +1 -0
  341. package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
  342. package/dist/esm/{app-globals-c018477a.js → app-globals-48531a04.js} +22 -13
  343. package/dist/esm/block-annotation.abstract-b0554e2b.js +868 -0
  344. package/dist/esm/{breakpoints-36a3ed69.js → breakpoints-91116111.js} +2 -12
  345. package/dist/esm/breakpoints-d9faf11c.js +12 -0
  346. package/dist/esm/{change-manager-6a7eb88c.js → change-manager-8f5b72c2.js} +1 -1
  347. package/dist/esm/chevron-down-4a75d28e.js +5 -0
  348. package/dist/esm/chevron-up-b1989751.js +5 -0
  349. package/dist/esm/{child-nodes-event-prevent-slimmer-8de7e3bb.js → child-nodes-event-prevent-slimmer-8ceabe63.js} +3 -3
  350. package/dist/esm/{child-nodes-notify-observer-slimmer-3d52b843.js → child-nodes-notify-observer-slimmer-afc15e00.js} +4 -4
  351. package/dist/esm/{component-cae24190.js → component-051a594c.js} +1 -1
  352. package/dist/esm/{component-global-style-slimmer-000e0c11.js → component-global-style-slimmer-631f956f.js} +1 -1
  353. package/dist/esm/{component-usage-runtime-metrics-b3f6ac79.js → component-usage-runtime-metrics-21813c36.js} +2 -2
  354. package/dist/esm/content-state-4b036bf1.js +1934 -0
  355. package/dist/esm/{create-public-api-runtime-metrics-slimmer-cc1164bb.js → create-public-api-runtime-metrics-slimmer-14cb4599.js} +3 -3
  356. package/dist/esm/{date-732bc749.js → date-655c0af8.js} +1 -1
  357. package/dist/esm/{deprecated-property-slimmer-43d184b3.js → deprecated-property-slimmer-9ea5019c.js} +2 -2
  358. package/dist/esm/{design-token-2a527af3.js → design-token-20fdba82.js} +6 -6
  359. package/dist/esm/dom-node-subject-observer-factory-80358591.js +269 -0
  360. package/dist/esm/{dynamic-slimmer-90b8af32.js → dynamic-slimmer-85746483.js} +1 -1
  361. package/dist/esm/{element-appender-slimmer-48d826b2.js → element-appender-slimmer-4dfa326d.js} +17 -10
  362. package/dist/esm/{event-emit-slimmer-493e6b9d.js → event-emit-slimmer-c03cf145.js} +5 -5
  363. package/dist/esm/{feature-flag-controller-6bbf53c1.js → feature-flag-controller-dfde0cfa.js} +3 -3
  364. package/dist/esm/{form-field-controller-slimmer-88492678.js → form-field-controller-slimmer-de5fe574.js} +11 -12
  365. package/dist/esm/{index-187f71d1.js → global-slimmer-registry-6887a59f.js} +284 -275
  366. package/dist/esm/{icon-manager-1ee2c968.js → icon-manager-3cef32e7.js} +2 -2
  367. package/dist/esm/index-44c794b4.js +323 -0
  368. package/dist/esm/index.js +29 -23
  369. package/dist/esm/{inject-keyboard-manager-8a82e8c9.js → inject-keyboard-manager-45309420.js} +1 -1
  370. package/dist/esm/{internal-icon-manager-7004584d.js → internal-icon-manager-7fc7535a.js} +1 -1
  371. package/dist/esm/{internal-vega-event-manager-48ac30f1.js → internal-vega-event-manager-3a3815d3.js} +6 -2
  372. package/dist/esm/{internal-vega-z-index-manager-7d2b54c3.js → internal-vega-z-index-manager-89e8b6f5.js} +1 -1
  373. package/dist/esm/{keyboard-manager-d1f9ddc1.js → keyboard-manager-2c06eafe.js} +1 -1
  374. package/dist/esm/{keyboard-manager-slimmer-8723f20f.js → keyboard-manager-slimmer-fd177285.js} +2 -2
  375. package/dist/esm/{legend-input-processor-0cef3ebe.js → legend-input-processor-15939912.js} +1 -1
  376. package/dist/esm/loader.js +28 -23
  377. package/dist/esm/{mutation-observer-slimmer-6cef9549.js → mutation-observer-slimmer-ca2cb2e8.js} +1 -1
  378. package/dist/esm/{vega-skeleton-loader-controller-1911558d.js → node.abstract-93746055.js} +226 -833
  379. package/dist/esm/{page-resize-observer-slimmer-994c1e1b.js → page-resize-observer-slimmer-8589ebc8.js} +2 -2
  380. package/dist/esm/{remote-invocation-registry-1682b34e.js → remote-invocation-registry-2ec6936d.js} +2 -2
  381. package/dist/esm/{required-field-rule-5da360cc.js → required-field-rule-368b31fa.js} +2 -1
  382. package/dist/esm/{responsive-format-facade-3dc84e41.js → responsive-format-facade-559ec469.js} +3 -3
  383. package/dist/esm/{state-background-color-formatter-0540d006.js → state-background-color-formatter-16031a43.js} +2 -2
  384. package/dist/esm/{static-subject-title-500cf2a3.js → static-subject-title-e06a3840.js} +2 -1
  385. package/dist/esm/{string-input-formatter-slimmer-fc23bc9f.js → string-input-formatter-slimmer-c9fb1fa1.js} +2 -2
  386. package/dist/esm/{style-formatter-ccb2da0d.js → style-formatter-51845b6d.js} +2 -2
  387. package/dist/esm/{sub-state-notify-slimmer-21b1c646.js → sub-state-notify-slimmer-6e97a58a.js} +5 -6
  388. package/dist/esm/{sub-state-observer-slimmer-8c80d874.js → sub-state-observer-slimmer-0968ce04.js} +5 -6
  389. package/dist/esm/{synchronize-task-queue-8f5fbbd9.js → synchronize-task-queue-ac8acc3b.js} +10 -1
  390. package/dist/esm/text-color-toolbar-button-slimmer-b2270b64.js +207 -0
  391. package/dist/esm/text-node-a652ca87.js +933 -0
  392. package/dist/esm/{translation-4eb3cf85.js → translation-b3fe8e74.js} +4 -4
  393. package/dist/esm/{translation-slimmer-9d07a0ff.js → translation-slimmer-860cd766.js} +2 -2
  394. package/dist/esm/trash-can-8819a939.js +5 -0
  395. package/dist/esm/{type-guard-63caf78b.js → type-guard-158f6d7a.js} +20 -20
  396. package/dist/esm/{typography-a8fc4764.js → typography-396de03f.js} +1 -1
  397. package/dist/esm/{ui-0132dbb5.js → ui-5600b48f.js} +20 -2
  398. package/dist/esm/vega-accordion.entry.js +22 -23
  399. package/dist/esm/vega-app-footer.entry.js +3 -4
  400. package/dist/esm/vega-app-header-button.entry.js +26 -26
  401. package/dist/esm/vega-backdrop.entry.js +4 -5
  402. package/dist/esm/vega-banner.entry.js +15 -17
  403. package/dist/esm/vega-bar-chart.entry.js +5 -6
  404. package/dist/esm/vega-box.entry.js +13 -13
  405. package/dist/esm/vega-breadcrumb.entry.js +13 -15
  406. package/dist/esm/vega-button-circle.entry.js +21 -22
  407. package/dist/esm/vega-button-group_2.entry.js +16 -18
  408. package/dist/esm/vega-button-link.entry.js +13 -15
  409. package/dist/esm/vega-button.entry.js +20 -21
  410. package/dist/esm/vega-calendar_3.entry.js +29 -30
  411. package/dist/esm/vega-card.entry.js +11 -11
  412. package/dist/esm/vega-carousel.entry.js +17 -19
  413. package/dist/esm/vega-checkbox_2.entry.js +24 -25
  414. package/dist/esm/vega-chip.entry.js +21 -22
  415. package/dist/esm/vega-color-picker.entry.js +19 -21
  416. package/dist/esm/vega-combo-box.entry.js +27 -28
  417. package/dist/esm/vega-counter-badge.entry.js +3 -4
  418. package/dist/esm/vega-date-picker_2.entry.js +37 -37
  419. package/dist/esm/{vega-dialog-controller-8b343a17.js → vega-dialog-controller-5b23f68c.js} +2 -2
  420. package/dist/esm/vega-dialog_2.entry.js +24 -25
  421. package/dist/esm/vega-divider.entry.js +11 -11
  422. package/dist/esm/vega-dropdown_5.entry.js +33 -34
  423. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  424. package/dist/esm/vega-field-error.entry.js +5 -6
  425. package/dist/esm/vega-field-label.entry.js +9 -12
  426. package/dist/esm/vega-file-uploader.entry.js +27 -32
  427. package/dist/esm/vega-flex.entry.js +16 -15
  428. package/dist/esm/vega-font.entry.js +12 -12
  429. package/dist/esm/vega-form.entry.js +23 -24
  430. package/dist/esm/vega-grid.entry.js +11 -11
  431. package/dist/esm/vega-hint.entry.js +3 -4
  432. package/dist/esm/vega-icon.entry.js +14 -14
  433. package/dist/esm/vega-image-uploader.entry.js +28 -29
  434. package/dist/esm/vega-input-credit-card.entry.js +25 -26
  435. package/dist/esm/vega-input-numeric.entry.js +26 -27
  436. package/dist/esm/vega-input-phone-number.entry.js +25 -26
  437. package/dist/esm/vega-input-range.entry.js +23 -24
  438. package/dist/esm/vega-input-select.entry.js +31 -31
  439. package/dist/esm/vega-input.entry.js +23 -25
  440. package/dist/esm/{vega-internal-event-id-770faa12.js → vega-internal-event-id-4af5c6e9.js} +7 -1
  441. package/dist/esm/vega-item-toggle.entry.js +10 -13
  442. package/dist/esm/vega-left-nav_5.entry.js +32 -32
  443. package/dist/esm/vega-line-chart.entry.js +6 -7
  444. package/dist/esm/vega-loader-wrapper_2.entry.js +10 -10
  445. package/dist/esm/vega-page-notification_2.entry.js +6 -9
  446. package/dist/esm/vega-pagination.entry.js +22 -21
  447. package/dist/esm/vega-pie-chart.entry.js +5 -6
  448. package/dist/esm/vega-popover_2.entry.js +59 -24
  449. package/dist/esm/vega-progress-tracker.entry.js +10 -13
  450. package/dist/esm/vega-radio_2.entry.js +26 -27
  451. package/dist/esm/vega-rich-text-content.entry.js +175 -0
  452. package/dist/esm/vega-rich-text-editor_4.entry.js +5100 -0
  453. package/dist/esm/vega-section-title.entry.js +3 -4
  454. package/dist/esm/vega-segment-control.entry.js +12 -14
  455. package/dist/esm/vega-selection-chip_2.entry.js +28 -29
  456. package/dist/esm/vega-selection-tile_2.entry.js +26 -27
  457. package/dist/esm/vega-sidenav_3.entry.js +23 -25
  458. package/dist/esm/vega-signature-capture.entry.js +27 -29
  459. package/dist/esm/vega-skeleton.entry.js +3 -4
  460. package/dist/esm/vega-slot-container.entry.js +2 -3
  461. package/dist/esm/vega-stepper.entry.js +22 -23
  462. package/dist/esm/vega-tab-group_2.entry.js +18 -19
  463. package/dist/esm/vega-table_8.entry.js +34 -34
  464. package/dist/esm/vega-text.entry.js +6 -6
  465. package/dist/esm/vega-textarea.entry.js +23 -24
  466. package/dist/esm/vega-time-picker_2.entry.js +31 -32
  467. package/dist/esm/vega-toggle-switch.entry.js +18 -20
  468. package/dist/esm/vega-tooltip_2.entry.js +16 -16
  469. package/dist/esm/vega.js +28 -23
  470. package/dist/esm/{y-axis-input-processor-a4d6aa50.js → y-axis-input-processor-a26a57e5.js} +1 -1
  471. package/dist/types/components/vega-pagination/vega-pagination.d.ts +1 -0
  472. package/dist/types/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.d.ts +19 -0
  473. package/dist/types/components/vega-rich-text-content/slimmers/controllers/vega-rich-text-content-state-controller.d.ts +11 -0
  474. package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +20 -0
  475. package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +44 -0
  476. package/dist/types/components/vega-rich-text-editor/assets/align-center.d.ts +3 -0
  477. package/dist/types/components/vega-rich-text-editor/assets/align-justify.d.ts +3 -0
  478. package/dist/types/components/vega-rich-text-editor/assets/align-left.d.ts +3 -0
  479. package/dist/types/components/vega-rich-text-editor/assets/align-right.d.ts +3 -0
  480. package/dist/types/components/vega-rich-text-editor/assets/bold.d.ts +3 -0
  481. package/dist/types/components/vega-rich-text-editor/assets/code-simple.d.ts +3 -0
  482. package/dist/types/components/vega-rich-text-editor/assets/image.d.ts +3 -0
  483. package/dist/types/components/vega-rich-text-editor/assets/indent.d.ts +3 -0
  484. package/dist/types/components/vega-rich-text-editor/assets/italic.d.ts +3 -0
  485. package/dist/types/components/vega-rich-text-editor/assets/link.d.ts +3 -0
  486. package/dist/types/components/vega-rich-text-editor/assets/list-ol.d.ts +3 -0
  487. package/dist/types/components/vega-rich-text-editor/assets/list-ul.d.ts +3 -0
  488. package/dist/types/components/vega-rich-text-editor/assets/outdent.d.ts +3 -0
  489. package/dist/types/components/vega-rich-text-editor/assets/strikethrough.d.ts +3 -0
  490. package/dist/types/components/vega-rich-text-editor/assets/text-size.d.ts +3 -0
  491. package/dist/types/components/vega-rich-text-editor/assets/text-slash.d.ts +3 -0
  492. package/dist/types/components/vega-rich-text-editor/assets/text.d.ts +3 -0
  493. package/dist/types/components/vega-rich-text-editor/assets/underline.d.ts +3 -0
  494. package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +3 -0
  495. package/dist/types/components/vega-rich-text-editor/dto/actions/annotation-action.abstract.d.ts +12 -0
  496. package/dist/types/components/vega-rich-text-editor/dto/actions/append-child-nodes-action.d.ts +9 -0
  497. package/dist/types/components/vega-rich-text-editor/dto/actions/bold-annotation-action.d.ts +16 -0
  498. package/dist/types/components/vega-rich-text-editor/dto/actions/break-single-block-action.d.ts +18 -0
  499. package/dist/types/components/vega-rich-text-editor/dto/actions/clear-child-nodes-action.d.ts +9 -0
  500. package/dist/types/components/vega-rich-text-editor/dto/actions/clear-formatting-annotation-action.d.ts +14 -0
  501. package/dist/types/components/vega-rich-text-editor/dto/actions/code-annotation-action.d.ts +16 -0
  502. package/dist/types/components/vega-rich-text-editor/dto/actions/delete-block-content-action.d.ts +16 -0
  503. package/dist/types/components/vega-rich-text-editor/dto/actions/delete-node-annotation-action.d.ts +18 -0
  504. package/dist/types/components/vega-rich-text-editor/dto/actions/horizontal-alignment-annotation-action.d.ts +17 -0
  505. package/dist/types/components/vega-rich-text-editor/dto/actions/image-annotation-action.d.ts +18 -0
  506. package/dist/types/components/vega-rich-text-editor/dto/actions/indent-annotation-action.d.ts +16 -0
  507. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-blocks-after-block.d.ts +13 -0
  508. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-blocks-before-block.d.ts +13 -0
  509. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-image-to-block-action.d.ts +16 -0
  510. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-nodes-after-node-action.d.ts +13 -0
  511. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-nodes-before-node-action.d.ts +13 -0
  512. package/dist/types/components/vega-rich-text-editor/dto/actions/italic-annotation-action.d.ts +16 -0
  513. package/dist/types/components/vega-rich-text-editor/dto/actions/line-break-multiple-block-action.d.ts +15 -0
  514. package/dist/types/components/vega-rich-text-editor/dto/actions/line-break-single-block-action.d.ts +15 -0
  515. package/dist/types/components/vega-rich-text-editor/dto/actions/link-annotation-action.d.ts +24 -0
  516. package/dist/types/components/vega-rich-text-editor/dto/actions/link-group-annotation-action.d.ts +18 -0
  517. package/dist/types/components/vega-rich-text-editor/dto/actions/merge-two-blocks-nodes-action.d.ts +12 -0
  518. package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +30 -0
  519. package/dist/types/components/vega-rich-text-editor/dto/actions/remove-child-action.d.ts +14 -0
  520. package/dist/types/components/vega-rich-text-editor/dto/actions/remove-nest-list-action.d.ts +12 -0
  521. package/dist/types/components/vega-rich-text-editor/dto/actions/replace-child-nodes-action.d.ts +12 -0
  522. package/dist/types/components/vega-rich-text-editor/dto/actions/replace-nest-list-action.d.ts +12 -0
  523. package/dist/types/components/vega-rich-text-editor/dto/actions/replace-selected-text-action.d.ts +13 -0
  524. package/dist/types/components/vega-rich-text-editor/dto/actions/selection-change-action.d.ts +16 -0
  525. package/dist/types/components/vega-rich-text-editor/dto/actions/split-block-with-node-action.d.ts +17 -0
  526. package/dist/types/components/vega-rich-text-editor/dto/actions/splittable-action.abstract.d.ts +10 -0
  527. package/dist/types/components/vega-rich-text-editor/dto/actions/strikethrough-annotation-action.d.ts +16 -0
  528. package/dist/types/components/vega-rich-text-editor/dto/actions/sync-up-selection-action.d.ts +16 -0
  529. package/dist/types/components/vega-rich-text-editor/dto/actions/text-color-annotation-action.d.ts +16 -0
  530. package/dist/types/components/vega-rich-text-editor/dto/actions/text-style-annotation-action.d.ts +18 -0
  531. package/dist/types/components/vega-rich-text-editor/dto/actions/transform-list-action.d.ts +13 -0
  532. package/dist/types/components/vega-rich-text-editor/dto/actions/transform-paragraph-action.d.ts +11 -0
  533. package/dist/types/components/vega-rich-text-editor/dto/actions/underline-annotation-action.d.ts +16 -0
  534. package/dist/types/components/vega-rich-text-editor/dto/actions/update-text-action.d.ts +11 -0
  535. package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +13 -0
  536. package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +22 -0
  537. package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +30 -0
  538. package/dist/types/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.d.ts +9 -0
  539. package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +36 -0
  540. package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +36 -0
  541. package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +33 -0
  542. package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +30 -0
  543. package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +30 -0
  544. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +37 -0
  545. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +16 -0
  546. package/dist/types/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.d.ts +28 -0
  547. package/dist/types/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.d.ts +9 -0
  548. package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +36 -0
  549. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +43 -0
  550. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +30 -0
  551. package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +36 -0
  552. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +167 -0
  553. package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +48 -0
  554. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +29 -0
  555. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +32 -0
  556. package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +62 -0
  557. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +58 -0
  558. package/dist/types/components/vega-rich-text-editor/dto/helper/block-base-operator.d.ts +24 -0
  559. package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +18 -0
  560. package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +65 -0
  561. package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +31 -0
  562. package/dist/types/components/vega-rich-text-editor/dto/range.d.ts +102 -0
  563. package/dist/types/components/vega-rich-text-editor/interface.d.ts +175 -0
  564. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/focus-controller.d.ts +33 -0
  565. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.d.ts +111 -0
  566. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.d.ts +32 -0
  567. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.d.ts +19 -0
  568. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +32 -0
  569. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.d.ts +31 -0
  570. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.d.ts +38 -0
  571. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.d.ts +35 -0
  572. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.d.ts +36 -0
  573. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.d.ts +31 -0
  574. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.d.ts +36 -0
  575. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.d.ts +31 -0
  576. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +78 -0
  577. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.d.ts +33 -0
  578. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.d.ts +53 -0
  579. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.d.ts +22 -0
  580. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +44 -0
  581. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.d.ts +25 -0
  582. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/insert-image-controller.d.ts +39 -0
  583. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/rich-text-content-controller.d.ts +13 -0
  584. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +123 -0
  585. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.d.ts +33 -0
  586. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/text-node-color-controller.d.ts +22 -0
  587. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/text-node-rendering-registry.d.ts +22 -0
  588. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +70 -0
  589. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +38 -0
  590. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +21 -0
  591. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.d.ts +9 -0
  592. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +16 -0
  593. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.d.ts +19 -0
  594. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.d.ts +19 -0
  595. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.d.ts +9 -0
  596. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.d.ts +9 -0
  597. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.d.ts +9 -0
  598. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.d.ts +19 -0
  599. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.d.ts +9 -0
  600. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.d.ts +9 -0
  601. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.d.ts +9 -0
  602. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.d.ts +19 -0
  603. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.d.ts +9 -0
  604. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.d.ts +9 -0
  605. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.d.ts +16 -0
  606. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.d.ts +9 -0
  607. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.d.ts +9 -0
  608. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.d.ts +28 -0
  609. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.d.ts +21 -0
  610. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +49 -0
  611. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.d.ts +9 -0
  612. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +53 -0
  613. package/dist/types/components/vega-rich-text-editor/test/dto/annotations.test.d.ts +1 -0
  614. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/image-block.test.d.ts +1 -0
  615. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/list-block.test.d.ts +1 -0
  616. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/list-item.test.d.ts +1 -0
  617. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/text-block.test.d.ts +1 -0
  618. package/dist/types/components/vega-rich-text-editor/test/dto/content-state.test.d.ts +1 -0
  619. package/dist/types/components/vega-rich-text-editor/test/dto/nodes/image-node.test.d.ts +1 -0
  620. package/dist/types/components/vega-rich-text-editor/test/dto/nodes/text-node.test.d.ts +1 -0
  621. package/dist/types/components/vega-rich-text-editor/test/dto/range.test.d.ts +1 -0
  622. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.d.ts +11 -0
  623. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.d.ts +62 -0
  624. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +186 -0
  625. package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/slimmers/renderers/vega-rich-text-image-editor-renderer.d.ts +20 -0
  626. package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/types.d.ts +15 -0
  627. package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.d.ts +46 -0
  628. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +29 -0
  629. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +15 -0
  630. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.d.ts +64 -0
  631. package/dist/types/components.d.ts +378 -0
  632. package/dist/types/constants/ui.d.ts +1 -1
  633. package/dist/types/helpers/change-manager/subject/static-subject/static-subject-title.d.ts +2 -1
  634. package/dist/types/helpers/common/index.d.ts +8 -0
  635. package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
  636. package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +6 -0
  637. package/dist/types/helpers/public-api.d.ts +1 -0
  638. package/dist/types/helpers/queue/synchronize-task-queue.d.ts +7 -0
  639. package/dist/types/helpers/slimmers/dark-mode-state-controller-slimmer.d.ts +21 -0
  640. package/dist/types/helpers/slimmers/element-appender-slimmer.d.ts +2 -0
  641. package/dist/types/helpers/slimmers/test/dark-mode-state-controller.test.d.ts +1 -0
  642. package/dist/types/helpers/theme/controllers/dark-mode-style-controller.d.ts +20 -0
  643. package/dist/types/helpers/validator/rules/form-field-validation-rule.d.ts +7 -1
  644. package/dist/types/helpers/validator/rules/{file-uploader-required-rule.d.ts → object-array-required-rule.d.ts} +3 -3
  645. package/dist/types/helpers/validator/rules/rich-text-editor-required-rule.d.ts +39 -0
  646. package/dist/types/helpers/validator/test/rules/object-array-required-rule.test.d.ts +1 -0
  647. package/dist/types/helpers/validator/test/rules/rich-text-editor-required-rule.test.d.ts +1 -0
  648. package/dist/types/polyfill/shadow-selection/shadow-selection-polyfill.d.ts +64 -0
  649. package/dist/types/polyfill/shadow-selection/test/shadow-selection-polyfill.test.d.ts +0 -0
  650. package/dist/types/polyfill/test-polyfill/unit/index.d.ts +1 -0
  651. package/dist/types/polyfill/test-polyfill/unit/range.d.ts +7 -0
  652. package/dist/types/polyfill/test-polyfill/unit/shadow-selection.d.ts +0 -0
  653. package/dist/types/types/components.type.d.ts +15 -0
  654. package/dist/types/utils/ui.d.ts +7 -0
  655. package/dist/vega/index.esm.js +1 -1
  656. package/dist/vega/p-0190095c.entry.js +1 -0
  657. package/dist/vega/p-034e6348.entry.js +1 -0
  658. package/dist/vega/p-0cd2b50f.entry.js +1 -0
  659. package/dist/vega/{p-5453f591.js → p-0e0c47ad.js} +1 -1
  660. package/dist/vega/p-10393104.js +1 -0
  661. package/dist/vega/p-109a00cf.entry.js +1 -0
  662. package/dist/vega/p-112455b1.js +1 -0
  663. package/dist/vega/{p-bdb94242.js → p-11a19ca0.js} +1 -1
  664. package/dist/vega/{p-a04632d0.js → p-11cb477b.js} +1 -1
  665. package/dist/vega/p-1564cc4d.entry.js +1 -0
  666. package/dist/vega/p-18886765.entry.js +1 -0
  667. package/dist/vega/p-1995e98e.js +1 -0
  668. package/dist/vega/p-19b26168.entry.js +1 -0
  669. package/dist/vega/{p-b62f0454.js → p-1ec4b319.js} +1 -1
  670. package/dist/vega/p-1ec763ab.js +1 -0
  671. package/dist/vega/p-1fb56e14.js +1 -0
  672. package/dist/vega/p-21992602.entry.js +1 -0
  673. package/dist/vega/p-22563151.entry.js +1 -0
  674. package/dist/vega/p-23795da1.entry.js +1 -0
  675. package/dist/vega/p-29277e41.entry.js +1 -0
  676. package/dist/vega/{p-9b797118.js → p-296cc56b.js} +1 -1
  677. package/dist/vega/p-2a7e9422.entry.js +1 -0
  678. package/dist/vega/p-2ca6d977.entry.js +1 -0
  679. package/dist/vega/p-2e419309.entry.js +1 -0
  680. package/dist/vega/p-3039bef8.js +1 -0
  681. package/dist/vega/{p-e2acbc60.js → p-3152031c.js} +1 -1
  682. package/dist/vega/p-34939c97.entry.js +1 -0
  683. package/dist/vega/{p-a46329bb.js → p-368d0060.js} +1 -1
  684. package/dist/vega/p-3897bb2d.entry.js +1 -0
  685. package/dist/vega/{p-69e63d21.entry.js → p-390c5236.entry.js} +1 -1
  686. package/dist/vega/{p-af7a3154.js → p-3953c705.js} +1 -1
  687. package/dist/vega/{p-c4a52c83.js → p-39836361.js} +1 -1
  688. package/dist/vega/{p-a190c86a.js → p-3b4bde3e.js} +1 -1
  689. package/dist/vega/p-3ce31dc3.js +1 -0
  690. package/dist/vega/{p-04215e74.js → p-3f1b542a.js} +1 -1
  691. package/dist/vega/{p-2d0d575f.js → p-443ad3b3.js} +1 -1
  692. package/dist/vega/p-452e284a.js +1 -0
  693. package/dist/vega/p-4bcd6612.js +1 -0
  694. package/dist/vega/p-4c41dd64.js +1 -0
  695. package/dist/vega/p-55beac7f.entry.js +1 -0
  696. package/dist/vega/p-57405834.entry.js +1 -0
  697. package/dist/vega/p-584dcd9b.js +1 -0
  698. package/dist/vega/p-589e6041.entry.js +1 -0
  699. package/dist/vega/{p-6a334573.js → p-59bdf9b8.js} +1 -1
  700. package/dist/vega/p-5e95402a.entry.js +1 -0
  701. package/dist/vega/p-5eee21b4.entry.js +1 -0
  702. package/dist/vega/p-5f377954.js +1 -1
  703. package/dist/vega/p-613ddaab.js +1 -0
  704. package/dist/vega/{p-2d5a9f66.js → p-62774231.js} +1 -1
  705. package/dist/vega/p-62cea2e7.entry.js +1 -0
  706. package/dist/vega/p-65b79fd7.js +1 -0
  707. package/dist/vega/p-6741e2b9.entry.js +1 -0
  708. package/dist/vega/p-6a084fe1.entry.js +1 -0
  709. package/dist/vega/{p-760283d1.entry.js → p-6b286226.entry.js} +1 -1
  710. package/dist/vega/p-6b722905.entry.js +1 -0
  711. package/dist/vega/p-6e4b2752.entry.js +1 -0
  712. package/dist/vega/{p-47c87634.js → p-70151c27.js} +1 -1
  713. package/dist/vega/p-7209d03b.js +1 -0
  714. package/dist/vega/p-734ea281.entry.js +1 -0
  715. package/dist/vega/p-76fc408e.entry.js +1 -0
  716. package/dist/vega/p-7a40e033.js +1 -0
  717. package/dist/vega/p-7a9f453e.entry.js +1 -0
  718. package/dist/vega/p-80ccd894.entry.js +1 -0
  719. package/dist/vega/{p-ed237efc.js → p-81ead59a.js} +1 -1
  720. package/dist/vega/{p-987fbbd0.js → p-843a0c1c.js} +1 -1
  721. package/dist/vega/p-84c597c8.entry.js +1 -0
  722. package/dist/vega/p-8836c1b9.js +1 -0
  723. package/dist/vega/p-8b78c6a3.entry.js +1 -0
  724. package/dist/vega/p-8be45a45.entry.js +1 -0
  725. package/dist/vega/p-8c26227e.js +1 -0
  726. package/dist/vega/p-8d7b45f7.entry.js +1 -0
  727. package/dist/vega/p-8e17b9dd.entry.js +1 -0
  728. package/dist/vega/p-8f004647.entry.js +1 -0
  729. package/dist/vega/p-8f93242a.js +1 -0
  730. package/dist/vega/p-925a2137.js +1 -0
  731. package/dist/vega/p-92f88033.entry.js +1 -0
  732. package/dist/vega/p-94de7a02.entry.js +1 -0
  733. package/dist/vega/p-9968e71d.entry.js +1 -0
  734. package/dist/vega/p-9c1eeff2.js +2 -0
  735. package/dist/vega/p-9d1b9e70.entry.js +1 -0
  736. package/dist/vega/p-9e732a26.entry.js +1 -0
  737. package/dist/vega/p-9f39dd10.js +1 -0
  738. package/dist/vega/p-a5ffe912.js +1 -0
  739. package/dist/vega/p-a6104aa7.js +1 -0
  740. package/dist/vega/p-a6169ad6.entry.js +1 -0
  741. package/dist/vega/{p-6a8f1251.js → p-a6a7d0c9.js} +1 -1
  742. package/dist/vega/p-a8bf559a.js +1 -0
  743. package/dist/vega/p-aacf6920.js +1 -0
  744. package/dist/vega/p-acf7f903.js +1 -0
  745. package/dist/vega/p-afec17ad.entry.js +1 -0
  746. package/dist/vega/p-b1f65b13.js +1 -0
  747. package/dist/vega/{p-0c051d2a.entry.js → p-b3f9cc3a.entry.js} +2 -2
  748. package/dist/vega/p-b693c1ac.entry.js +1 -0
  749. package/dist/vega/p-b9e2add4.entry.js +1 -0
  750. package/dist/vega/p-bd894860.entry.js +1 -0
  751. package/dist/vega/p-c0d6a587.entry.js +1 -0
  752. package/dist/vega/p-c26e6820.entry.js +1 -0
  753. package/dist/vega/p-c34487e1.entry.js +1 -0
  754. package/dist/vega/p-c532b132.entry.js +1 -0
  755. package/dist/vega/p-ca2fb711.js +1 -0
  756. package/dist/vega/p-cebf93f1.entry.js +1 -0
  757. package/dist/vega/p-cfdc148a.entry.js +1 -0
  758. package/dist/vega/p-d0351d71.entry.js +1 -0
  759. package/dist/vega/p-d057999f.js +1 -0
  760. package/dist/vega/{p-c7d70786.js → p-d171cf44.js} +1 -1
  761. package/dist/vega/p-d2ab6096.entry.js +1 -0
  762. package/dist/vega/p-d35643c5.entry.js +1 -0
  763. package/dist/vega/p-d400a1d9.entry.js +1 -0
  764. package/dist/vega/p-d6732a72.entry.js +1 -0
  765. package/dist/vega/p-d720b06a.entry.js +1 -0
  766. package/dist/vega/{p-c59042c0.js → p-d884c644.js} +1 -1
  767. package/dist/vega/p-d987e404.entry.js +1 -0
  768. package/dist/vega/p-d9b86108.entry.js +1 -0
  769. package/dist/vega/p-e0b25eaf.js +1 -0
  770. package/dist/vega/{p-9f3b1d77.js → p-e1e1fcf0.js} +1 -1
  771. package/dist/vega/p-e27e115d.entry.js +1 -0
  772. package/dist/vega/p-e65c8ac7.entry.js +1 -0
  773. package/dist/vega/p-e79057cc.js +1 -0
  774. package/dist/vega/p-e89e9769.entry.js +1 -0
  775. package/dist/vega/{p-781fd6e0.js → p-eac38d87.js} +1 -1
  776. package/dist/vega/p-ecd64c7f.entry.js +1 -0
  777. package/dist/vega/p-ed45b3b6.js +1 -0
  778. package/dist/vega/p-f357cf46.js +1 -0
  779. package/dist/vega/p-f5b2e72a.entry.js +1 -0
  780. package/dist/vega/p-f6af3749.js +1 -0
  781. package/dist/vega/p-f763e2eb.js +1 -0
  782. package/dist/vega/p-fc622a75.js +1 -0
  783. package/dist/vega/vega.esm.js +1 -1
  784. package/package.json +3 -4
  785. package/dist/cjs/dom-node-subject-observer-factory-2e41340d.js +0 -141
  786. package/dist/cjs/global-slimmer-registry-b3bce7e0.js +0 -297
  787. package/dist/cjs/index-40a1cd3a.js +0 -15
  788. package/dist/cjs/index-5792390b.js +0 -1024
  789. package/dist/cjs/observer-f49483e8.js +0 -32
  790. package/dist/collection/helpers/validator/test/rules/file-uploader-required-rule.test.js +0 -7
  791. package/dist/esm/chevron-down-4303bddb.js +0 -9
  792. package/dist/esm/dom-node-subject-observer-factory-9461cd67.js +0 -138
  793. package/dist/esm/global-slimmer-registry-17c4efd4.js +0 -283
  794. package/dist/esm/index-0830dd1d.js +0 -13
  795. package/dist/esm/index-0863eec6.js +0 -1019
  796. package/dist/esm/observer-3959f9dd.js +0 -30
  797. package/dist/esm/vega-event-id-0f8fc134.js +0 -103
  798. package/dist/vega/p-07a8cf89.entry.js +0 -1
  799. package/dist/vega/p-07af8ee4.entry.js +0 -1
  800. package/dist/vega/p-0916da7a.entry.js +0 -1
  801. package/dist/vega/p-0abae6cc.entry.js +0 -1
  802. package/dist/vega/p-0e59c3b7.entry.js +0 -1
  803. package/dist/vega/p-0fe89d42.js +0 -1
  804. package/dist/vega/p-0fecf145.js +0 -1
  805. package/dist/vega/p-11786565.entry.js +0 -1
  806. package/dist/vega/p-13d34a23.entry.js +0 -1
  807. package/dist/vega/p-14fc5aed.entry.js +0 -1
  808. package/dist/vega/p-16bb355d.js +0 -1
  809. package/dist/vega/p-17233d94.entry.js +0 -1
  810. package/dist/vega/p-1a8dd528.entry.js +0 -1
  811. package/dist/vega/p-1c298d5a.js +0 -2
  812. package/dist/vega/p-2b5ab7f9.entry.js +0 -1
  813. package/dist/vega/p-32f651f7.js +0 -1
  814. package/dist/vega/p-331a62d5.js +0 -1
  815. package/dist/vega/p-36395deb.entry.js +0 -1
  816. package/dist/vega/p-38b93319.entry.js +0 -1
  817. package/dist/vega/p-4022f395.entry.js +0 -1
  818. package/dist/vega/p-4163c2c2.js +0 -1
  819. package/dist/vega/p-4625a2b4.js +0 -1
  820. package/dist/vega/p-483d0916.entry.js +0 -1
  821. package/dist/vega/p-4921c38c.entry.js +0 -1
  822. package/dist/vega/p-4963e445.entry.js +0 -1
  823. package/dist/vega/p-497eba8c.entry.js +0 -1
  824. package/dist/vega/p-49db0660.entry.js +0 -1
  825. package/dist/vega/p-4d25df7d.js +0 -1
  826. package/dist/vega/p-535f0758.js +0 -1
  827. package/dist/vega/p-53702f16.js +0 -1
  828. package/dist/vega/p-53d34f58.entry.js +0 -1
  829. package/dist/vega/p-5440344e.js +0 -1
  830. package/dist/vega/p-576fe8cf.entry.js +0 -1
  831. package/dist/vega/p-590870e4.js +0 -1
  832. package/dist/vega/p-5915634b.js +0 -1
  833. package/dist/vega/p-597871ab.entry.js +0 -1
  834. package/dist/vega/p-5fbac513.js +0 -1
  835. package/dist/vega/p-603f7aa3.entry.js +0 -1
  836. package/dist/vega/p-61f6167c.js +0 -1
  837. package/dist/vega/p-66ffdfdf.entry.js +0 -1
  838. package/dist/vega/p-6758dc5e.entry.js +0 -1
  839. package/dist/vega/p-68ad953c.js +0 -1
  840. package/dist/vega/p-6c6d86da.js +0 -1
  841. package/dist/vega/p-6e1ab235.js +0 -1
  842. package/dist/vega/p-6f027906.entry.js +0 -1
  843. package/dist/vega/p-6f788b49.entry.js +0 -1
  844. package/dist/vega/p-7372cd79.entry.js +0 -1
  845. package/dist/vega/p-7df3aa44.entry.js +0 -1
  846. package/dist/vega/p-810ba5c3.entry.js +0 -1
  847. package/dist/vega/p-84118b6d.entry.js +0 -1
  848. package/dist/vega/p-848825ff.entry.js +0 -1
  849. package/dist/vega/p-84fa8466.js +0 -1
  850. package/dist/vega/p-87640a4d.entry.js +0 -1
  851. package/dist/vega/p-8a091eb7.js +0 -1
  852. package/dist/vega/p-8b084bf9.entry.js +0 -1
  853. package/dist/vega/p-8f5ffac5.entry.js +0 -1
  854. package/dist/vega/p-910410ad.entry.js +0 -1
  855. package/dist/vega/p-943e89b4.js +0 -1
  856. package/dist/vega/p-99a35465.entry.js +0 -1
  857. package/dist/vega/p-99cf17e3.entry.js +0 -1
  858. package/dist/vega/p-9ba085c1.entry.js +0 -1
  859. package/dist/vega/p-9e9ec748.js +0 -1
  860. package/dist/vega/p-9f984c33.entry.js +0 -1
  861. package/dist/vega/p-9fbdeada.js +0 -1
  862. package/dist/vega/p-a7fdb16a.js +0 -1
  863. package/dist/vega/p-a828eeef.entry.js +0 -1
  864. package/dist/vega/p-acc14aa2.js +0 -1
  865. package/dist/vega/p-ae5751fb.entry.js +0 -1
  866. package/dist/vega/p-b3e754da.entry.js +0 -1
  867. package/dist/vega/p-b4e92130.entry.js +0 -1
  868. package/dist/vega/p-b5990090.js +0 -1
  869. package/dist/vega/p-b8e42c11.entry.js +0 -1
  870. package/dist/vega/p-bb6f8b70.entry.js +0 -1
  871. package/dist/vega/p-c1dfdc13.js +0 -1
  872. package/dist/vega/p-c51a48d6.entry.js +0 -1
  873. package/dist/vega/p-d6d10fb3.entry.js +0 -1
  874. package/dist/vega/p-d7df87b4.entry.js +0 -1
  875. package/dist/vega/p-daaf3ee3.entry.js +0 -1
  876. package/dist/vega/p-dadd7db4.entry.js +0 -1
  877. package/dist/vega/p-db94558e.entry.js +0 -1
  878. package/dist/vega/p-dba59bd7.entry.js +0 -1
  879. package/dist/vega/p-e5cd92f0.entry.js +0 -1
  880. package/dist/vega/p-e5e0394a.entry.js +0 -1
  881. package/dist/vega/p-ec157238.js +0 -1
  882. package/dist/vega/p-eddcb385.entry.js +0 -1
  883. package/dist/vega/p-f2685ec5.entry.js +0 -1
  884. package/dist/vega/p-f404aa83.js +0 -1
  885. package/dist/vega/p-f46c930f.js +0 -1
  886. package/dist/vega/p-f556c3cd.entry.js +0 -1
  887. package/dist/vega/p-f5876e05.entry.js +0 -1
  888. package/dist/vega/p-f64fb740.entry.js +0 -1
  889. package/dist/vega/p-f76e9940.entry.js +0 -1
  890. package/dist/vega/p-f7728ead.entry.js +0 -1
  891. package/dist/vega/p-fae41be0.entry.js +0 -1
  892. package/dist/vega/p-faea1620.js +0 -1
  893. /package/dist/types/{helpers/validator/test/rules/file-uploader-required-rule.test.d.ts → components/vega-rich-text-editor/test/dto/annotation-actions.test.d.ts} +0 -0
@@ -0,0 +1,1954 @@
1
+ 'use strict';
2
+
3
+ const globalSlimmerRegistry = require('./global-slimmer-registry-dd2691b8.js');
4
+ const blockAnnotation_abstract = require('./block-annotation.abstract-4d88b939.js');
5
+ const changeManager = require('./change-manager-bda1d107.js');
6
+ const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-093462f1.js');
7
+ const node_abstract = require('./node.abstract-f8075f84.js');
8
+ const vegaInternalEventId = require('./vega-internal-event-id-85b68849.js');
9
+ const typeGuard = require('./type-guard-4ba85fdc.js');
10
+ const textNode = require('./text-node-494856f3.js');
11
+ const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtime-metrics-slimmer-8c6a8fb7.js');
12
+
13
+ /**
14
+ * Annotation to make block with horizontal alignment
15
+ */
16
+ class HorizontalAlignmentAnnotation extends blockAnnotation_abstract.BlockAnnotation {
17
+ constructor(textAlign) {
18
+ super();
19
+ this.type = blockAnnotation_abstract.BlockAnnotationTypeEnum.ALIGNMENT;
20
+ this.textAlign = textAlign;
21
+ }
22
+ /**
23
+ * Generate the map item for the annotation
24
+ *
25
+ * @param {VegaRTEBlockAlignment} textAlign - Text alignment
26
+ * @returns {[BlockAnnotationTypeEnum.ALIGNMENT, HorizontalAlignmentAnnotation]} Map item for the annotation
27
+ */
28
+ static from(textAlign) {
29
+ return [blockAnnotation_abstract.BlockAnnotationTypeEnum.ALIGNMENT, new HorizontalAlignmentAnnotation(textAlign)];
30
+ }
31
+ /**
32
+ * Generate the JSON item of the annotation
33
+ *
34
+ * @returns {Record<string, unknown>} JSON representation of the annotation
35
+ */
36
+ toJSON() {
37
+ return {
38
+ textAlign: this.textAlign,
39
+ };
40
+ }
41
+ /**
42
+ * Generate the class for the annotation
43
+ *
44
+ * @returns {string} - Annotation class
45
+ */
46
+ renderClass() {
47
+ return `v-rte--horizontal-alignment-${this.textAlign}`;
48
+ }
49
+ /**
50
+ * Generate the style for the annotation
51
+ *
52
+ * @returns {Nullable<AnnotationStyle>} - Annotation style
53
+ */
54
+ render() {
55
+ return null;
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Annotation for block indentation
61
+ */
62
+ class IndentAnnotation extends blockAnnotation_abstract.BlockAnnotation {
63
+ constructor(indent) {
64
+ super();
65
+ this.type = blockAnnotation_abstract.BlockAnnotationTypeEnum.INDENT;
66
+ this.indent = Math.max(0, indent);
67
+ }
68
+ /**
69
+ * Generate the map item for the annotation
70
+ *
71
+ * @param {number} indent - Text alignment
72
+ * @returns {[BlockAnnotationTypeEnum.INDENT, IndentAnnotation]} Map item for the annotation
73
+ */
74
+ static from(indent) {
75
+ return [blockAnnotation_abstract.BlockAnnotationTypeEnum.INDENT, new IndentAnnotation(indent)];
76
+ }
77
+ /**
78
+ * Generate the JSON item of the annotation
79
+ *
80
+ * @returns {Record<string, unknown>} JSON representation of the annotation
81
+ */
82
+ toJSON() {
83
+ return this.indent > 0 ? { indent: this.indent } : null;
84
+ }
85
+ /**
86
+ * Generate the style for the annotation
87
+ *
88
+ * @returns {Nullable<AnnotationStyle>} - Annotation style
89
+ */
90
+ render() {
91
+ return this.indent > 0 ? { 'margin-left': `${this.indent * 16}px` } : null;
92
+ }
93
+ }
94
+
95
+ /** The class contains some common method to modify the blocks property */
96
+ class BlockBaseOperator {
97
+ /**
98
+ * Replaces a specific block with an array of blocks within a RTEContentBlock array.
99
+ *
100
+ * @param {RTEBlock} referBlock - Used as a reference block to identify the block that needs to be replaced in the `blocks` array.
101
+ * @param {RTEBlock[]} blocks - An array of RTEBlock objects that you want to replace the `referBlock` with in the `blocks` array.
102
+ */
103
+ replaceBlockWithBlocks(referBlock, blocks) {
104
+ if (this.blocks) {
105
+ blocks.forEach((block) => {
106
+ block.parent = this;
107
+ });
108
+ this.blocks = this.blocks.flatMap((block) => {
109
+ if (block === referBlock) {
110
+ return blocks;
111
+ }
112
+ else {
113
+ return block;
114
+ }
115
+ });
116
+ }
117
+ }
118
+ /**
119
+ * Appends new blocks to an array and sets their parent property to a specific type.
120
+ *
121
+ * @param {RTEBlock[]} newBlocks - An array of `RTEBlock` objects that are being passed to the `appendChildBlocks` method.
122
+ */
123
+ appendChildBlocks(newBlocks) {
124
+ if (this.blocks) {
125
+ newBlocks.forEach((block) => {
126
+ block.parent = this;
127
+ });
128
+ this.blocks = this.blocks.concat(newBlocks);
129
+ }
130
+ }
131
+ /**
132
+ * Removes a specified RTEBlock from an array of blocks.
133
+ *
134
+ * @param {RTEBlock} blockToBeRemoved - The block that needs to be removed from the `blocks` array.
135
+ */
136
+ removeChildBlock(blockToBeRemoved) {
137
+ if (this.blocks) {
138
+ this.blocks = this.blocks.filter((block) => block !== blockToBeRemoved);
139
+ }
140
+ }
141
+ }
142
+
143
+ /** Append blocks or nodes to a block */
144
+ class AppendChildNodesAction extends node_abstract.ModifyContentAction {
145
+ constructor(childNodes) {
146
+ super();
147
+ this.type = node_abstract.ModifyContentActionType.APPEND_CHILD_NODES;
148
+ this.entityToBeAppended = childNodes;
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Delete child node or child block from the current list action
154
+ *
155
+ * @example needRemovedNode.parentBlock.apply(new RemoveChildAction(needRemovedNode))
156
+ * @example needRemovedBlock.parent.apply(new RemoveChildAction(needRemovedBlock))
157
+ */
158
+ class RemoveChildAction extends node_abstract.ModifyContentAction {
159
+ constructor(childNode) {
160
+ super();
161
+ this.type = node_abstract.ModifyContentActionType.DELETE_CHILD;
162
+ this.entityToBeRemoved = childNode;
163
+ }
164
+ }
165
+
166
+ /**
167
+ * Abstract class for block
168
+ */
169
+ class RTEBlock extends BlockBaseOperator {
170
+ constructor(id) {
171
+ super();
172
+ this.annotationMap = new Map();
173
+ this.id = id;
174
+ }
175
+ /**
176
+ * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
177
+ * and value.
178
+ *
179
+ * @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
180
+ * the type of annotation entity to create.
181
+ * @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
182
+ * that will be used to create the annotation entity. It can be of any type depending on the specific
183
+ * annotation being created.
184
+ * @returns {Nullable<[BlockAnnotationTypeEnum, BlockAnnotation]>} The `createAnnotationEntity` function returns a nullable tuple containing a
185
+ * `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
186
+ */
187
+ static createAnnotationEntity(type, value) {
188
+ switch (type) {
189
+ case 'textAlign':
190
+ return HorizontalAlignmentAnnotation.from(value);
191
+ case 'indent':
192
+ return IndentAnnotation.from(value);
193
+ }
194
+ }
195
+ /**
196
+ * Class to JSON object
197
+ *
198
+ * @returns {VegaRTEBlockBase} - JSON object
199
+ */
200
+ toJSON() {
201
+ const annotations = Array.from(this.annotationMap.values())
202
+ .filter((annotation) => annotation instanceof blockAnnotation_abstract.BlockAnnotation)
203
+ .reduce((record, annotation) => {
204
+ return Object.assign(Object.assign({}, record), annotation.toJSON());
205
+ }, {});
206
+ return Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {}));
207
+ }
208
+ /**
209
+ * Get annotation by type
210
+ *
211
+ * @param {keyof typeof BlockAnnotationTypeEnum} type - Annotation type
212
+ * @returns {Nullable<BlockAnnotation> | Nullable<LinkGroupAnnotation>} - Annotation
213
+ */
214
+ getAnnotationByType(type) {
215
+ return this.annotationMap.get(type);
216
+ }
217
+ /**
218
+ * Apply action to block
219
+ *
220
+ * @param {AnnotationAction} action - Annotation action
221
+ */
222
+ apply(action) {
223
+ this.doApply(action);
224
+ if (action.isFlushable) {
225
+ const domNode = node_abstract.stateEntityRenderingRegistry.getDOMByEntity(this);
226
+ if (domNode) {
227
+ const nodeSubject = domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubjectFromParentNodeByEventId(domNode, vegaInternalEventId.VegaInternalRichTextEditorFlushChanges);
228
+ if (nodeSubject) {
229
+ changeManager.ChangeManager.notify(nodeSubject, {});
230
+ }
231
+ }
232
+ }
233
+ }
234
+ /**
235
+ * Apply action to block
236
+ *
237
+ * @param {AnnotationAction|ModifyContentAction} action - Annotation action
238
+ */
239
+ doApply(action) {
240
+ if (action instanceof node_abstract.ModifyContentAction) {
241
+ this.doModifyActionApply(action);
242
+ }
243
+ else {
244
+ this.applyAnnotationAction(action);
245
+ }
246
+ }
247
+ /**
248
+ * Apply annotation action to block
249
+ *
250
+ * @param {AnnotationAction} action - Annotation action
251
+ */
252
+ applyAnnotationAction(action) {
253
+ const annotation = action.toAnnotation();
254
+ this.annotationMap.set(annotation.type, annotation);
255
+ typeof this.doAnnotationActionApply === 'function' && this.doAnnotationActionApply(action);
256
+ }
257
+ /**
258
+ * Get styles from annotations
259
+ *
260
+ * @returns {AnnotationStyle} - Annotation style
261
+ */
262
+ getStyles() {
263
+ return Array.from(this.annotationMap.values())
264
+ .filter((annotation) => annotation instanceof blockAnnotation_abstract.BlockAnnotation)
265
+ .map((annotation) => annotation.render())
266
+ .filter(typeGuard.isNonNullable)
267
+ .reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {});
268
+ }
269
+ /**
270
+ * Get classes from annotations
271
+ *
272
+ * @returns {AnnotationStyle} - Annotation style
273
+ */
274
+ getClasses() {
275
+ return Array.from(this.annotationMap.values())
276
+ .map((annotation) => { var _a; return (_a = annotation.renderClass) === null || _a === void 0 ? void 0 : _a.call(annotation); })
277
+ .filter(typeGuard.isNonNullable)
278
+ .reduce((pre, cur) => [pre, cur].join(' '), '');
279
+ }
280
+ /**
281
+ * Appends a list of RTENode objects to the current node's child nodes and sets the parent block of each node to the current node.
282
+ *
283
+ * @param {RTENode[]} nodesToBeAppended - An array of `RTENode` objects that you want to append to the current block.
284
+ */
285
+ appendChildNodes(nodesToBeAppended) {
286
+ nodesToBeAppended.forEach((node) => {
287
+ node.parentBlock = this;
288
+ });
289
+ this['nodes'] = this['nodes'].concat(nodesToBeAppended);
290
+ }
291
+ /**
292
+ * Merges the child nodes of two RTEBlocks if they have the same type or both are not images.
293
+ *
294
+ * @param {RTEBlock} secondBlock - A block of content in a rich text editor, such as a paragraph, heading, image, etc.
295
+ */
296
+ mergeTwoBlocksNodes(secondBlock) {
297
+ if (this.type === secondBlock.type || (this.type !== 'image' && secondBlock.type !== 'image')) {
298
+ let shouldMergeNodes = secondBlock['nodes'];
299
+ if (this.type !== 'image') {
300
+ shouldMergeNodes = secondBlock['nodes'].filter((node) => node['text'] && node['text'] !== textNode.ZERO_WIDTH_SPACE);
301
+ }
302
+ this.apply(new AppendChildNodesAction(shouldMergeNodes));
303
+ secondBlock.parent.apply(new RemoveChildAction(secondBlock));
304
+ }
305
+ }
306
+ /**
307
+ * Concat the child nodes of multiple RTEBlocks if both are not images.
308
+ *
309
+ * @param {RTEBlock[]} blocks - multiple block of content in a rich text editor, such as a paragraph, heading, image, etc.
310
+ * @returns {RTENode[]} Array of connected block nodes
311
+ */
312
+ concatBlocksNodes(blocks) {
313
+ const nodes = [];
314
+ blocks.map((block) => {
315
+ if (block.type !== 'image') {
316
+ nodes.push(...block['nodes']);
317
+ block.parent.apply(new RemoveChildAction(block));
318
+ }
319
+ });
320
+ return nodes;
321
+ }
322
+ /**
323
+ * Returns the previous node relative to the current node in a rich text editor structure.
324
+ *
325
+ * @param {RTENode} currentNode - An object of type `RTENode`.
326
+ * @returns {Nullable<RTENode>} the previous block last node
327
+ */
328
+ getPreviousNode(currentNode) {
329
+ const currentBlock = currentNode.parentBlock;
330
+ const currentIndex = currentBlock['nodes'].indexOf(currentNode);
331
+ if (currentIndex > 0) {
332
+ return currentBlock['nodes'][currentIndex - 1];
333
+ }
334
+ else if (currentBlock.parent) {
335
+ const previousBlock = this.getPreviousBlock(currentBlock);
336
+ if (previousBlock) {
337
+ return this.getBlockLastNode(previousBlock);
338
+ }
339
+ }
340
+ }
341
+ /**
342
+ * Returns the next node relative to the current node in a rich text editor structure.
343
+ *
344
+ * @param {RTENode} currentNode - An object of type `RTENode`.
345
+ * @returns {Nullable<RTENode>} the next block first node
346
+ */
347
+ getNextNode(currentNode) {
348
+ const currentBlock = currentNode.parentBlock;
349
+ const currentIndex = currentBlock['nodes'].indexOf(currentNode);
350
+ if (currentBlock['nodes'][currentIndex + 1]) {
351
+ return currentBlock['nodes'][currentIndex + 1];
352
+ }
353
+ else if (currentBlock.parent) {
354
+ const nextBlock = this.getNextBlock(currentBlock);
355
+ if (nextBlock) {
356
+ return this.getBlockFirstNode(nextBlock);
357
+ }
358
+ }
359
+ }
360
+ /**
361
+ * Determines if a given node is the first node within the current state.
362
+ *
363
+ * @param {RTENode} currentNode - An object representing a node in a rich text editor (RTE).
364
+ * @returns {boolean} True or false;
365
+ */
366
+ isContentFirstNode(currentNode) {
367
+ const currentBlock = currentNode.parentBlock;
368
+ const currentIndex = currentBlock['nodes'].indexOf(currentNode);
369
+ const parent = currentBlock.parent;
370
+ if (currentBlock.type === 'list-item') {
371
+ const listParent = parent.parent;
372
+ return (currentIndex === 0 &&
373
+ Array.isArray(parent.blocks) &&
374
+ parent.blocks[0] === currentBlock &&
375
+ listParent['type'] !== 'list-item' &&
376
+ Array.isArray(listParent.blocks) &&
377
+ listParent.blocks[0] === parent);
378
+ }
379
+ else {
380
+ return currentIndex === 0 && Array.isArray(parent.blocks) && parent.blocks[0] === currentBlock;
381
+ }
382
+ }
383
+ /**
384
+ * Returns the last node within a given RTE block, handling different block types accordingly.
385
+ *
386
+ * @param {RTEBlock} currentBlock - Returns the last node within that block.
387
+ * @returns {Nullable<RTENode>} Returns the last node of the given `currentBlock` object.
388
+ */
389
+ getBlockLastNode(currentBlock) {
390
+ if (currentBlock.type === 'list-item') {
391
+ if (currentBlock['children'] && currentBlock['children'].length > 0) {
392
+ return this.getBlockLastNode(currentBlock['children'][currentBlock['children'].length - 1]);
393
+ }
394
+ else {
395
+ return currentBlock['nodes'][currentBlock['nodes'].length - 1];
396
+ }
397
+ }
398
+ else if (currentBlock.type === 'number-list' || currentBlock.type === 'bullet-list') {
399
+ if (currentBlock.blocks) {
400
+ const lastListItem = currentBlock.blocks[currentBlock.blocks.length - 1];
401
+ return this.getBlockLastNode(lastListItem);
402
+ }
403
+ }
404
+ else {
405
+ if (currentBlock['nodes']) {
406
+ return currentBlock['nodes'][currentBlock['nodes'].length - 1];
407
+ }
408
+ }
409
+ }
410
+ /**
411
+ * Returns the first node within a given RTE block, handling different block types accordingly.
412
+ *
413
+ * @param {RTEBlock} currentBlock - Returns the first node within that block.
414
+ * @returns {Nullable<RTENode>} Returns the first node of the given `currentBlock` object.
415
+ */
416
+ getBlockFirstNode(currentBlock) {
417
+ if (currentBlock.type === 'number-list' || currentBlock.type === 'bullet-list') {
418
+ if (currentBlock.blocks) {
419
+ const firstListItem = currentBlock.blocks[0];
420
+ return this.getBlockFirstNode(firstListItem);
421
+ }
422
+ }
423
+ else {
424
+ if (currentBlock['nodes']) {
425
+ return currentBlock['nodes'][0];
426
+ }
427
+ }
428
+ }
429
+ /**
430
+ * TODO: The getPreviousBlock add nest list support
431
+ * This function retrieves the previous block in a rich text editor, considering different scenarios such as being in a bullet list.
432
+ *
433
+ * @param {RTEBlock} currentBlock - Used to retrieve the previous block relative to the given `currentBlock` within a rich text editor context.
434
+ * @returns {Nullable<RTEBlock>} The previous block if existing
435
+ */
436
+ getPreviousBlock(currentBlock) {
437
+ if (currentBlock && currentBlock.parent && currentBlock.parent.blocks) {
438
+ const currentBlockIndex = currentBlock.parent.blocks.indexOf(currentBlock);
439
+ if (currentBlockIndex > 0) {
440
+ return currentBlock.parent.blocks[currentBlockIndex - 1];
441
+ }
442
+ else if ((currentBlock.parent['type'] === 'number-list' ||
443
+ currentBlock.parent['type'] === 'bullet-list') &&
444
+ currentBlockIndex === 0) {
445
+ return this.getPreviousBlock(currentBlock.parent);
446
+ }
447
+ }
448
+ }
449
+ /**
450
+ * This function retrieves the next block in a rich text editor, considering different scenarios such as being in a bullet list.
451
+ *
452
+ * @param {RTEBlock} currentBlock - Used to retrieve the next block relative to the given `currentBlock` within a rich text editor context.
453
+ * @returns {Nullable<RTEBlock>} The next block if existing
454
+ */
455
+ getNextBlock(currentBlock) {
456
+ if (currentBlock && currentBlock.parent && currentBlock.parent.blocks) {
457
+ const currentBlockIndex = currentBlock.parent.blocks.indexOf(currentBlock);
458
+ if (currentBlock.parent.blocks[currentBlockIndex + 1]) {
459
+ return currentBlock.parent.blocks[currentBlockIndex + 1];
460
+ }
461
+ else if (currentBlock.type === 'list-item' &&
462
+ currentBlock.parent.blocks.length === currentBlockIndex + 1) {
463
+ return this.getNextBlock(currentBlock.parent);
464
+ }
465
+ }
466
+ }
467
+ /**
468
+ * Replaces a specific node with an array of nodes within a RTENode array.
469
+ *
470
+ * @param {RTENode} referNode - Used as a reference node to identify the node that needs to be replaced in the `nodes` array.
471
+ * @param {RTENode[]} nodes - An array of RTENode objects that you want to replace the `referNode` with in the `nodes` array.
472
+ */
473
+ replaceNodeWithNodes(referNode, nodes) {
474
+ if (this['nodes']) {
475
+ nodes.forEach((node) => {
476
+ node.parentBlock = this;
477
+ });
478
+ this['nodes'] = this['nodes'].flatMap((node) => {
479
+ if (node === referNode) {
480
+ return nodes;
481
+ }
482
+ else {
483
+ return node;
484
+ }
485
+ });
486
+ }
487
+ }
488
+ }
489
+
490
+ /**
491
+ * Annotation for image
492
+ */
493
+ class ImageAnnotation extends node_abstract.NodeAnnotation {
494
+ constructor(size = 'md', alt) {
495
+ super();
496
+ this.type = node_abstract.NodeAnnotationTypeEnum.IMAGE;
497
+ this.size = size;
498
+ this.alt = alt;
499
+ }
500
+ /**
501
+ * Generate the map item for the annotation
502
+ *
503
+ * @param {string} size - Image size
504
+ * @param {string} alt - Image alt
505
+ * @returns {[NodeAnnotationTypeEnum.IMAGE, ImageAnnotation]} Map item for the annotation
506
+ */
507
+ static from(size, alt) {
508
+ return [node_abstract.NodeAnnotationTypeEnum.IMAGE, new ImageAnnotation(size, alt)];
509
+ }
510
+ /**
511
+ * Generate the JSON representation of the annotation
512
+ *
513
+ * @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
514
+ */
515
+ toJSON() {
516
+ return typeGuard.isNonNullable(this.alt)
517
+ ? {
518
+ size: this.size,
519
+ alt: this.alt,
520
+ }
521
+ : {
522
+ size: this.size,
523
+ };
524
+ }
525
+ /**
526
+ * Generate the style for the image
527
+ *
528
+ * @returns {Nullable<AnnotationStyle>} image style
529
+ */
530
+ render() {
531
+ switch (this.size) {
532
+ case 'sm': {
533
+ return { width: '25%' };
534
+ }
535
+ case 'md': {
536
+ return { width: '50%' };
537
+ }
538
+ case 'lg': {
539
+ return { width: '100%' };
540
+ }
541
+ }
542
+ }
543
+ }
544
+
545
+ /**
546
+ * Action to add an image annotation to the editor
547
+ */
548
+ class ImageAnnotationAction extends textNode.AnnotationAction {
549
+ constructor(size, alt) {
550
+ super();
551
+ this.isFlushable = true;
552
+ this.size = size;
553
+ this.alt = alt;
554
+ }
555
+ /**
556
+ * Converts the action to an annotation
557
+ *
558
+ * @returns {ImageAnnotation} The annotation
559
+ */
560
+ toAnnotation() {
561
+ return new ImageAnnotation(this.size, this.alt);
562
+ }
563
+ }
564
+
565
+ class RTEImageNode extends node_abstract.RTENode {
566
+ constructor(id, url, parentBlock, annotationMap) {
567
+ super(id, annotationMap);
568
+ this.type = node_abstract.NodeTypeEnum.IMAGE;
569
+ this.url = url;
570
+ this.parentBlock = parentBlock;
571
+ }
572
+ static from(image, parentBlock) {
573
+ const imageNode = new RTEImageNode(image.id, image.url, parentBlock);
574
+ let annotations;
575
+ if (!image.annotations || Object.keys(image.annotations).length === 0) {
576
+ annotations = { size: 'md' };
577
+ }
578
+ else {
579
+ annotations = image.annotations;
580
+ }
581
+ imageNode.annotationMap = new Map(Object.keys(annotations)
582
+ .map(() => ImageAnnotation.from(annotations.size, annotations.alt))
583
+ .filter(typeGuard.isNonNullable));
584
+ return imageNode;
585
+ }
586
+ toJSON() {
587
+ const imageAnnotation = this.annotationMap.get(node_abstract.NodeAnnotationTypeEnum.IMAGE);
588
+ const annotations = {};
589
+ if (imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.size) {
590
+ annotations.size = imageAnnotation.size;
591
+ }
592
+ if (imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.alt) {
593
+ annotations.alt = imageAnnotation.alt;
594
+ }
595
+ return Object.assign(Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {})), { type: 'image', url: this.url });
596
+ }
597
+ render({ editable } = {}) {
598
+ const imageAnnotation = this.annotationMap.get(node_abstract.NodeAnnotationTypeEnum.IMAGE);
599
+ const size = imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.size;
600
+ const alt = imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.alt;
601
+ const handleChange = ({ detail, }) => {
602
+ switch (detail.action) {
603
+ case 'edit': {
604
+ const size = detail.payload.size;
605
+ const alt = detail.payload.alt;
606
+ this.apply(new ImageAnnotationAction(size, alt));
607
+ break;
608
+ }
609
+ /*
610
+ * The below method is e2e-test covered in
611
+ * @see{module:vega-rich-text-editor-image-click-delete-button}
612
+ */
613
+ /* istanbul ignore next */
614
+ case 'delete': {
615
+ const event = new InputEvent('beforeinput', {
616
+ inputType: 'deleteContentBackward',
617
+ bubbles: true,
618
+ });
619
+ setTimeout(() => {
620
+ node_abstract.stateEntityRenderingRegistry.getDOMByEntity(this).dispatchEvent(event);
621
+ }, 50);
622
+ break;
623
+ }
624
+ }
625
+ };
626
+ return editable ? (globalSlimmerRegistry.h("vega-rich-text-image-editor", { style: this.getStyles(), size: size, alt: alt, ref: (ref) => {
627
+ domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, domNodeSubjectObserverFactory.VegaChange, handleChange);
628
+ } }, this.renderImage(editable, alt))) : (this.renderImage(editable, alt));
629
+ }
630
+ doAnnotationActionApply(action) {
631
+ const annotation = action.toAnnotation();
632
+ this.annotationMap.set(annotation.type, annotation);
633
+ }
634
+ // placeholder method
635
+ /* istanbul ignore next */
636
+ doModifyActionApply(action) {
637
+ }
638
+ registerRef(ref) {
639
+ if (ref) {
640
+ node_abstract.stateEntityRenderingRegistry.register(ref, this);
641
+ }
642
+ }
643
+ renderImage(editable, alt) {
644
+ return (globalSlimmerRegistry.h("img", { style: editable ? { width: '100%' } : this.getStyles(), alt: alt, src: this.url, ref: this.registerRef.bind(this) }));
645
+ }
646
+ }
647
+
648
+ /**
649
+ * Clear the current block nodes and append new nodes
650
+ *
651
+ * @example block.apply(new ReplaceChildNodesAction(newNodes))
652
+ */
653
+ class ReplaceChildNodesAction extends node_abstract.ModifyContentAction {
654
+ constructor(newChildNodes) {
655
+ super();
656
+ this.type = node_abstract.ModifyContentActionType.REPLACE_CHILD_NODES;
657
+ this.newChildNodes = newChildNodes;
658
+ }
659
+ }
660
+
661
+ /**
662
+ * Insert a new block after a existing block
663
+ *
664
+ * @example currentBlock.parent.apply(new InsertBlocksAfterAction(currentBlock, newBlock, ...))
665
+ */
666
+ class InsertBlocksAfterAction extends node_abstract.ModifyContentAction {
667
+ constructor(referBlock, ...blocksToBeInserted) {
668
+ super();
669
+ this.type = node_abstract.ModifyContentActionType.INSERT_BLOCKS_AFTER;
670
+ this.referBlock = referBlock;
671
+ this.blocksToBeInserted = blocksToBeInserted;
672
+ }
673
+ }
674
+
675
+ /**
676
+ * Split the block with a split point node.
677
+ * The property `newBlock` use to store the new create block if need.
678
+ *
679
+ * @example block.apply(new SplitBlockWithNodeAction(node, offset))
680
+ */
681
+ class SplitBlockWithNodeAction extends node_abstract.ModifyContentAction {
682
+ constructor(splitPointNode, startOffsetOfNode) {
683
+ super();
684
+ this.type = node_abstract.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE;
685
+ this.splitPointNode = splitPointNode;
686
+ this.startOffsetOfNode = startOffsetOfNode;
687
+ }
688
+ }
689
+
690
+ /**
691
+ * Text style annotation
692
+ */
693
+ class TextStyleAnnotation extends blockAnnotation_abstract.BlockAnnotation {
694
+ constructor(textStyle) {
695
+ super();
696
+ this.type = blockAnnotation_abstract.BlockAnnotationTypeEnum.TEXT_STYLE;
697
+ this.textStyle = textStyle;
698
+ }
699
+ /**
700
+ * Generate the map item for the annotations
701
+ *
702
+ * @param {VegaRTETextStyleType} textStyle - the text style type
703
+ * @returns {[BlockAnnotationTypeEnum.TEXT_STYLE, TextStyleAnnotation]} Map item for the annotation
704
+ */
705
+ static from(textStyle) {
706
+ return [blockAnnotation_abstract.BlockAnnotationTypeEnum.TEXT_STYLE, new TextStyleAnnotation(textStyle)];
707
+ }
708
+ /**
709
+ * Generate the JSON representation of the annotation
710
+ *
711
+ * @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
712
+ */
713
+ toJSON() {
714
+ return { textStyle: this.textStyle };
715
+ }
716
+ /**
717
+ * Render the styles by block type
718
+ *
719
+ * @returns {AnnotationStyle} the styles to apply
720
+ */
721
+ render() {
722
+ const paragraphStyle = {
723
+ fontFamily: 'Inter',
724
+ fontSize: '16px',
725
+ lineHeight: '22px',
726
+ fontWeight: '500',
727
+ };
728
+ switch (this.textStyle) {
729
+ case 'paragraph': {
730
+ return paragraphStyle;
731
+ }
732
+ case 'title': {
733
+ return { fontFamily: 'Inter', fontSize: '36px', lineHeight: '40px', fontWeight: '500' };
734
+ }
735
+ case 'subtitle': {
736
+ return { fontFamily: 'Inter', fontSize: '28px', lineHeight: '32px', fontWeight: '500' };
737
+ }
738
+ case 'heading-1': {
739
+ return { fontFamily: 'Inter', fontSize: '22px', lineHeight: '24px', fontWeight: '500' };
740
+ }
741
+ case 'heading-2': {
742
+ return { fontFamily: 'Inter', fontSize: '20px', lineHeight: '24px', fontWeight: '500' };
743
+ }
744
+ case 'heading-3': {
745
+ return { fontFamily: 'Inter', fontSize: '18px', lineHeight: '22px', fontWeight: '500' };
746
+ }
747
+ }
748
+ }
749
+ }
750
+
751
+ /**
752
+ * Action to change the text style of a block
753
+ */
754
+ class TextStyleAnnotationAction extends textNode.AnnotationAction {
755
+ constructor(textStyle, bold) {
756
+ super();
757
+ this.isFlushable = true;
758
+ this.textStyle = textStyle;
759
+ this.bold = bold;
760
+ }
761
+ /**
762
+ * Converts the action to a block annotation
763
+ *
764
+ * @returns {BlockAnnotation} the block annotation
765
+ */
766
+ toAnnotation() {
767
+ return new TextStyleAnnotation(this.textStyle);
768
+ }
769
+ }
770
+
771
+ /**
772
+ * Action to toggle bold annotation
773
+ */
774
+ class BoldAnnotationAction extends textNode.TextSplittableAction {
775
+ constructor(bold) {
776
+ super();
777
+ this.isFlushable = true;
778
+ this.bold = bold;
779
+ }
780
+ /**
781
+ * Converts the action to an annotation
782
+ *
783
+ * @returns {BoldAnnotation} the annotation
784
+ */
785
+ toAnnotation() {
786
+ return new textNode.BoldAnnotation(this.bold);
787
+ }
788
+ }
789
+
790
+ /**
791
+ * Merge the two blocks node into first block if the two blocks nodes type is same(text node or image node)
792
+ *
793
+ * @example firstBlock.apply(new MergeTwoBlocksNodesAction(secondBlock))
794
+ */
795
+ class MergeTwoBlocksNodesAction extends node_abstract.ModifyContentAction {
796
+ constructor(blockNeedToBeMerged) {
797
+ super();
798
+ this.type = node_abstract.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES;
799
+ this.blockNeedToBeMerged = blockNeedToBeMerged;
800
+ }
801
+ }
802
+
803
+ /**
804
+ * Insert a new block before a existing block
805
+ *
806
+ * @example currentBlock.parent.apply(new InsertBlocksBeforeAction(currentBlock, newBlock, ...))
807
+ */
808
+ class InsertBlocksBeforeAction extends node_abstract.ModifyContentAction {
809
+ constructor(referBlock, ...blocksToBeInserted) {
810
+ super();
811
+ this.type = node_abstract.ModifyContentActionType.INSERT_BLOCKS_BEFORE;
812
+ this.referBlock = referBlock;
813
+ this.blocksToBeInserted = blocksToBeInserted;
814
+ }
815
+ }
816
+
817
+ /**
818
+ * Text block
819
+ */
820
+ class RTETextBlock extends RTEBlock {
821
+ constructor(id, type) {
822
+ super(id);
823
+ this.nodes = [];
824
+ this.type = type;
825
+ if (RTETextBlock.isAcceptableTextStyle(type)) {
826
+ this.annotationMap = new Map([TextStyleAnnotation.from(type)]);
827
+ }
828
+ else {
829
+ this.annotationMap = new Map([TextStyleAnnotation.from('paragraph')]);
830
+ }
831
+ }
832
+ static from(block) {
833
+ const textBlock = new RTETextBlock(block.id, block.type);
834
+ const { annotations } = block;
835
+ textBlock.nodes = block.nodes.map((richText) => textNode.RTETextNode.from(richText, textBlock));
836
+ if (annotations) {
837
+ Object.entries(annotations).forEach(([type, value]) => {
838
+ const item = this.createAnnotationEntity(type, value);
839
+ if (typeGuard.isNonNullable(item)) {
840
+ textBlock.annotationMap.set(...item);
841
+ }
842
+ });
843
+ }
844
+ return textBlock;
845
+ }
846
+ /**
847
+ * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
848
+ * and value.
849
+ *
850
+ * @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
851
+ * the type of annotation entity to create.
852
+ * @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
853
+ * that will be used to create the annotation entity. It can be of any type depending on the specific
854
+ * annotation being created.
855
+ * @returns {Nullable<[BlockAnnotationTypeEnum, BlockAnnotation]>} The `createAnnotationEntity` function returns a nullable tuple containing a
856
+ * `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
857
+ */
858
+ static createAnnotationEntity(type, value) {
859
+ if (type === 'textStyle') {
860
+ return TextStyleAnnotation.from(value);
861
+ }
862
+ else {
863
+ return super.createAnnotationEntity(type, value);
864
+ }
865
+ }
866
+ static isAcceptableTextStyle(type) {
867
+ return ['title', 'subtitle', 'paragraph', 'heading-1', 'heading-2', 'heading-3'].includes(type);
868
+ }
869
+ mergeNodes(action) {
870
+ this.nodes = this.nodes.reduce((prev, cur) => {
871
+ const lastNode = prev.at(-1);
872
+ if (action instanceof textNode.LinkAnnotationAction && action.needMergeNode) {
873
+ const lastNodeLinkAnnotation = lastNode === null || lastNode === void 0 ? void 0 : lastNode.getAnnotationByType(node_abstract.NodeAnnotationTypeEnum.LINK);
874
+ const curNodeLinkAnnotation = cur.getAnnotationByType(node_abstract.NodeAnnotationTypeEnum.LINK);
875
+ if (lastNodeLinkAnnotation &&
876
+ curNodeLinkAnnotation &&
877
+ lastNodeLinkAnnotation.toEqual(curNodeLinkAnnotation)) {
878
+ return prev;
879
+ }
880
+ }
881
+ // TODO: handle other cases like merge bold nodes
882
+ return [...prev, cur];
883
+ }, []);
884
+ }
885
+ toJSON() {
886
+ return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, nodes: this.nodes.map((node) => node.toJSON()) });
887
+ }
888
+ cloneWithNodes(nodes) {
889
+ const block = new RTETextBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), this.type);
890
+ block.nodes = [];
891
+ block.apply(new AppendChildNodesAction(nodes));
892
+ return block;
893
+ }
894
+ isNotEmpty() {
895
+ return this.nodes.length > 0 && this.nodes.some((node) => !node.isEmpty());
896
+ }
897
+ getLastNode() {
898
+ return this.nodes[this.nodes.length - 1];
899
+ }
900
+ render(renderContext, children) {
901
+ const BlockTag = this.getBlockTagByType(this.type);
902
+ return (globalSlimmerRegistry.h(BlockTag, { ref: this.registerRef.bind(this), style: this.getStyles(), class: super.getClasses() },
903
+ this.renderNodes(renderContext),
904
+ children));
905
+ }
906
+ registerRef(ref) {
907
+ if (ref) {
908
+ node_abstract.stateEntityRenderingRegistry.register(ref, this);
909
+ }
910
+ }
911
+ renderNodes(renderConfig = {}) {
912
+ const linkGroupAnnotation = this.getAnnotationByType(node_abstract.InternalAnnotationTypeEnum.LINK_GROUP);
913
+ return linkGroupAnnotation
914
+ ? linkGroupAnnotation.renderNodes(this.nodes, renderConfig)
915
+ : this.nodes.map((node) => node.render());
916
+ }
917
+ doAnnotationActionApply(action) {
918
+ if (action instanceof TextStyleAnnotationAction) {
919
+ if (this.type !== 'list-item') {
920
+ this.type = action.textStyle;
921
+ }
922
+ if (action.bold) {
923
+ this.nodes.forEach((node) => {
924
+ const boldAnnotationAction = new BoldAnnotationAction(true);
925
+ boldAnnotationAction.doSplit = false;
926
+ node.apply(boldAnnotationAction);
927
+ });
928
+ }
929
+ else {
930
+ this.nodes.forEach((node) => {
931
+ node.apply(new textNode.DeleteNodeAnnotationAction(node_abstract.NodeAnnotationTypeEnum.BOLD));
932
+ });
933
+ }
934
+ return;
935
+ }
936
+ if (action instanceof textNode.LinkGroupAnnotationAction) {
937
+ const linkGroupAnnotation = this.getAnnotationByType(node_abstract.InternalAnnotationTypeEnum.LINK_GROUP);
938
+ if (linkGroupAnnotation) {
939
+ const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey);
940
+ linkGroupAnnotation.linkGroups.set(action.groupKey, [...linkGroup, ...action.nodes]);
941
+ this.annotationMap.set(node_abstract.InternalAnnotationTypeEnum.LINK_GROUP, linkGroupAnnotation);
942
+ }
943
+ return;
944
+ }
945
+ }
946
+ /**
947
+ * Apply a modify action to block
948
+ *
949
+ * @param {ModifyContentAction} action - Modify action
950
+ */
951
+ doModifyActionApply(action) {
952
+ switch (action.type) {
953
+ case node_abstract.ModifyContentActionType.DELETE_CHILD:
954
+ this.removeChildNode(action);
955
+ break;
956
+ case node_abstract.ModifyContentActionType.APPEND_CHILD_NODES:
957
+ this.appendChildNodes(action.entityToBeAppended);
958
+ break;
959
+ case node_abstract.ModifyContentActionType.CLEAR_CHILD_NODES:
960
+ this.nodes = [];
961
+ break;
962
+ case node_abstract.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE:
963
+ action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode);
964
+ break;
965
+ case node_abstract.ModifyContentActionType.REPLACE_CHILD_NODES:
966
+ this.nodes = [];
967
+ this.appendChildNodes(action.newChildNodes);
968
+ break;
969
+ case node_abstract.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES:
970
+ this.mergeTwoBlocksNodes(action.blockNeedToBeMerged);
971
+ break;
972
+ case node_abstract.ModifyContentActionType.BREAK_SINGLE_BLOCK:
973
+ action.newBlock = this.breakSingleTextBlock(action.startContainerNode, action.startOffset);
974
+ break;
975
+ case node_abstract.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK:
976
+ action.lineBreakNode = this.lineBreakSingleBlock(action.startContainerNode, action.startOffset);
977
+ break;
978
+ case node_abstract.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS:
979
+ action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks);
980
+ break;
981
+ case node_abstract.ModifyContentActionType.TRANSFORM_LIST_BLOCK:
982
+ this.convertParagraphToList(action);
983
+ break;
984
+ case node_abstract.ModifyContentActionType.DELETE_BLOCK_CONTENT:
985
+ this.deleteNodeContent(action);
986
+ break;
987
+ case node_abstract.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
988
+ this.insertImage(action);
989
+ break;
990
+ case node_abstract.ModifyContentActionType.INSERT_NODES_BEFORE:
991
+ this.replaceNodeWithNodes(action.referNode, [
992
+ ...action.nodesToBeInserted,
993
+ action.referNode,
994
+ ]);
995
+ break;
996
+ }
997
+ }
998
+ splitTextNodeBlock(splitNode, startOffsetOfNode) {
999
+ if (splitNode) {
1000
+ const beforeText = splitNode.text.slice(0, startOffsetOfNode);
1001
+ const afterText = splitNode.text.slice(startOffsetOfNode);
1002
+ const nodesSplitIndex = this.nodes.indexOf(splitNode);
1003
+ if (nodesSplitIndex > -1) {
1004
+ const beforeNodes = this.nodes.slice(0, nodesSplitIndex);
1005
+ const afterNodes = this.nodes.slice(nodesSplitIndex + 1);
1006
+ if (beforeText) {
1007
+ beforeNodes.push(splitNode.cloneWithText(beforeText));
1008
+ }
1009
+ if (afterText) {
1010
+ afterNodes.unshift(splitNode.cloneWithText(afterText));
1011
+ }
1012
+ this.apply(new ReplaceChildNodesAction(beforeNodes));
1013
+ const newBlock = this.cloneWithNodes(afterNodes);
1014
+ this.parent.apply(new InsertBlocksAfterAction(this, newBlock));
1015
+ return newBlock;
1016
+ }
1017
+ }
1018
+ }
1019
+ isCaretPositionAtStart(node, startOffset) {
1020
+ return node === this.nodes[0] && startOffset === 0;
1021
+ }
1022
+ isCaretPositionAtEnd(node, startOffset) {
1023
+ const lastNode = this.nodes[this.nodes.length - 1];
1024
+ return node === lastNode && (node.isEmpty() || startOffset === lastNode.text.length);
1025
+ }
1026
+ lineBreakSingleBlock(splitNode, startOffsetOfNode) {
1027
+ if (splitNode) {
1028
+ const lineBreakNode = new textNode.RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', this);
1029
+ const beforeText = splitNode.text.slice(0, startOffsetOfNode);
1030
+ const afterText = splitNode.text.slice(startOffsetOfNode);
1031
+ const nodesSplitIndex = this.nodes.indexOf(splitNode);
1032
+ if (nodesSplitIndex > -1) {
1033
+ const beforeNodes = this.nodes.slice(0, nodesSplitIndex);
1034
+ const afterNodes = this.nodes.slice(nodesSplitIndex + 1);
1035
+ if (beforeText) {
1036
+ beforeNodes.push(splitNode.cloneWithText(beforeText));
1037
+ }
1038
+ if (afterText) {
1039
+ afterNodes.unshift(splitNode.cloneWithText(afterText));
1040
+ }
1041
+ this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes);
1042
+ }
1043
+ return lineBreakNode;
1044
+ }
1045
+ }
1046
+ lineBreakMultipleBlocks(selectedBlocks) {
1047
+ const beforeNodes = this['nodes'];
1048
+ const lineBreakNode = new textNode.RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', this);
1049
+ const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
1050
+ this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes);
1051
+ return lineBreakNode;
1052
+ }
1053
+ deleteNodeContent(action) {
1054
+ const startContainerNode = action.startContainerNode;
1055
+ const startOffset = action.startOffset;
1056
+ if (startOffset !== 0 && !startContainerNode.isEmpty()) {
1057
+ const newText = startContainerNode.text.slice(0, startOffset - 1) +
1058
+ startContainerNode.text.slice(startOffset);
1059
+ startContainerNode.apply(new textNode.UpdateTextAction(newText));
1060
+ if (newText) {
1061
+ action.previousNode = startContainerNode;
1062
+ return;
1063
+ }
1064
+ else {
1065
+ const previousNode = this.getPreviousNode(startContainerNode);
1066
+ // Remove the last character will not delete paragraph, the paragraph will removed after press delete again
1067
+ if ((previousNode && previousNode.parentBlock === this && previousNode['text'] === '\n') ||
1068
+ this.nodes.length === 1) {
1069
+ action.previousNode = startContainerNode;
1070
+ return;
1071
+ }
1072
+ else {
1073
+ this.apply(new RemoveChildAction(startContainerNode));
1074
+ action.previousNode = previousNode;
1075
+ return;
1076
+ }
1077
+ }
1078
+ }
1079
+ else {
1080
+ let previousNode = this.getPreviousNode(startContainerNode);
1081
+ let nextNode = null;
1082
+ if (this.nodes.length && previousNode && previousNode.parentBlock !== this) {
1083
+ if (startContainerNode.isEmpty()) {
1084
+ this.apply(new RemoveChildAction(startContainerNode));
1085
+ }
1086
+ previousNode.parentBlock.apply(new MergeTwoBlocksNodesAction(this));
1087
+ }
1088
+ else {
1089
+ if (this.isContentFirstNode(startContainerNode) && startContainerNode.isEmpty()) {
1090
+ nextNode = this.getNextNode(startContainerNode);
1091
+ }
1092
+ /**
1093
+ * Remove line break
1094
+ * @example caret at the first line
1095
+ * \n
1096
+ * test
1097
+ */
1098
+ if (startContainerNode.isEmpty()) {
1099
+ this.apply(new RemoveChildAction(startContainerNode));
1100
+ }
1101
+ /**
1102
+ * Remove line break
1103
+ * @example caret at the begin of second line
1104
+ * \n
1105
+ * test
1106
+ */
1107
+ if (previousNode instanceof textNode.RTETextNode && previousNode.isEmpty()) {
1108
+ const shouldRemoveNode = previousNode;
1109
+ previousNode = this.getPreviousNode(previousNode);
1110
+ shouldRemoveNode.parentBlock.apply(new RemoveChildAction(shouldRemoveNode));
1111
+ if (!previousNode) {
1112
+ nextNode = startContainerNode;
1113
+ }
1114
+ }
1115
+ }
1116
+ //Remove the paragraph block if the content is empty
1117
+ if (this.nodes.length === 0) {
1118
+ this.parent.apply(new RemoveChildAction(this));
1119
+ }
1120
+ if (previousNode) {
1121
+ action.previousNode = previousNode;
1122
+ }
1123
+ else if (nextNode) {
1124
+ action.nextNode = nextNode;
1125
+ }
1126
+ }
1127
+ }
1128
+ removeChildNode(action) {
1129
+ this.nodes = this.nodes.filter((node) => node !== action.entityToBeRemoved);
1130
+ if (this.nodes.length === 0) {
1131
+ this.parent.apply(new RemoveChildAction(this));
1132
+ }
1133
+ }
1134
+ mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes) {
1135
+ if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
1136
+ afterNodes.push(new textNode.RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', this, beforeNodes[beforeNodes.length - 1] && beforeNodes[beforeNodes.length - 1].annotationMap));
1137
+ }
1138
+ this.apply(new ReplaceChildNodesAction([...beforeNodes, lineBreakNode, ...afterNodes]));
1139
+ }
1140
+ getBlockTagByType(type) {
1141
+ switch (type) {
1142
+ case 'title':
1143
+ case 'subtitle':
1144
+ return `div`;
1145
+ case 'heading-1':
1146
+ return `h1`;
1147
+ case 'heading-2':
1148
+ return `h2`;
1149
+ case 'heading-3':
1150
+ return `h3`;
1151
+ case 'paragraph':
1152
+ return 'p';
1153
+ case 'list-item':
1154
+ return 'li';
1155
+ }
1156
+ }
1157
+ breakSingleTextBlock(splitNode, startOffsetOfNode) {
1158
+ const newParagraph = this.copyInlineStyleToNewParagraph(splitNode);
1159
+ if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
1160
+ this.parent.apply(new InsertBlocksAfterAction(this, newParagraph));
1161
+ }
1162
+ else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
1163
+ this.parent.apply(new InsertBlocksBeforeAction(this, newParagraph));
1164
+ }
1165
+ else {
1166
+ const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
1167
+ this.apply(splitBlockAction);
1168
+ return splitBlockAction.newBlock;
1169
+ }
1170
+ return newParagraph;
1171
+ }
1172
+ convertParagraphToList(action) {
1173
+ const bulletList = this.parent.createList(action.listType);
1174
+ const listItems = action.selectedBlocks.map((node) => this.parent.toListItem(node));
1175
+ bulletList.apply(new AppendChildNodesAction(listItems));
1176
+ this.parent.apply(new InsertBlocksAfterAction(action.selectedBlocks[0], bulletList));
1177
+ action.selectedBlocks.forEach((node) => {
1178
+ node.parent.apply(new RemoveChildAction(node));
1179
+ });
1180
+ }
1181
+ insertImage(action) {
1182
+ const splitNode = action.splitPointNode;
1183
+ const startOffsetOfNode = action.startOffsetOfNode;
1184
+ const newImageBlock = action.imageBlockToBeInserted;
1185
+ if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
1186
+ this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
1187
+ }
1188
+ else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
1189
+ this.parent.apply(new InsertBlocksBeforeAction(this, newImageBlock));
1190
+ }
1191
+ else {
1192
+ const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
1193
+ this.apply(splitBlockAction);
1194
+ this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
1195
+ }
1196
+ }
1197
+ copyInlineStyleToNewParagraph(needCopedNode) {
1198
+ const textNode = needCopedNode.cloneWithText('');
1199
+ // The link annotation don't need inherited
1200
+ textNode.annotationMap.delete(node_abstract.NodeAnnotationTypeEnum.LINK);
1201
+ const newParagraph = new RTETextBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), 'paragraph');
1202
+ newParagraph.apply(new AppendChildNodesAction([textNode]));
1203
+ return newParagraph;
1204
+ }
1205
+ }
1206
+
1207
+ /**
1208
+ * Image block
1209
+ */
1210
+ class RTEImageBlock extends RTEBlock {
1211
+ constructor(id) {
1212
+ super(id);
1213
+ this.type = 'image';
1214
+ this.nodes = [];
1215
+ }
1216
+ static from(block) {
1217
+ const imageBlock = new RTEImageBlock(block.id);
1218
+ const { annotations } = block;
1219
+ imageBlock.nodes = block.nodes.map((image) => RTEImageNode.from(image, imageBlock));
1220
+ if (annotations) {
1221
+ Object.entries(annotations).forEach(([type, value]) => {
1222
+ const item = this.createAnnotationEntity(type, value);
1223
+ if (typeGuard.isNonNullable(item)) {
1224
+ imageBlock.annotationMap.set(...item);
1225
+ }
1226
+ });
1227
+ }
1228
+ return imageBlock;
1229
+ }
1230
+ toJSON() {
1231
+ return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.nodes.map((node) => node.toJSON()) });
1232
+ }
1233
+ isNotEmpty() {
1234
+ return this.nodes.length > 0 && this.nodes.some((node) => node.url.length > 0);
1235
+ }
1236
+ getLastNode() {
1237
+ return this.nodes[this.nodes.length - 1];
1238
+ }
1239
+ render(renderContext) {
1240
+ return (globalSlimmerRegistry.h("div", { style: Object.assign({}, this.getStyles()), ref: this.registerRef.bind(this), class: super.getClasses() }, this.nodes.map((node) => {
1241
+ return node.render(renderContext);
1242
+ })));
1243
+ }
1244
+ /**
1245
+ * Apply modify action to block
1246
+ *
1247
+ * @param {ModifyContentAction} action - Modify action
1248
+ */
1249
+ doModifyActionApply(action) {
1250
+ switch (action.type) {
1251
+ case node_abstract.ModifyContentActionType.DELETE_CHILD:
1252
+ this.removeChildNode(action);
1253
+ break;
1254
+ case node_abstract.ModifyContentActionType.CLEAR_CHILD_NODES:
1255
+ this.nodes = [];
1256
+ break;
1257
+ case node_abstract.ModifyContentActionType.APPEND_CHILD_NODES:
1258
+ this.appendChildNodes(action.entityToBeAppended);
1259
+ break;
1260
+ case node_abstract.ModifyContentActionType.REPLACE_CHILD_NODES:
1261
+ this.nodes = [];
1262
+ this.appendChildNodes(action.newChildNodes);
1263
+ break;
1264
+ case node_abstract.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE:
1265
+ action.newBlock = this.splitImageNodes(action.splitPointNode, action.startOffsetOfNode);
1266
+ break;
1267
+ case node_abstract.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES:
1268
+ this.mergeTwoBlocksNodes(action.blockNeedToBeMerged);
1269
+ break;
1270
+ case node_abstract.ModifyContentActionType.BREAK_SINGLE_BLOCK:
1271
+ action.newBlock = this.breakSingleBlock(action.startContainerNode, action.startOffset);
1272
+ break;
1273
+ case node_abstract.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK:
1274
+ action.lineBreakNode = this.lineBreakSingleBlock(action.startContainerNode, action.startOffset);
1275
+ break;
1276
+ case node_abstract.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS:
1277
+ action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks);
1278
+ break;
1279
+ case node_abstract.ModifyContentActionType.DELETE_BLOCK_CONTENT:
1280
+ this.deleteNodeContent(action);
1281
+ break;
1282
+ case node_abstract.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
1283
+ this.insertImage(action);
1284
+ break;
1285
+ case node_abstract.ModifyContentActionType.INSERT_NODES_AFTER:
1286
+ this.replaceNodeWithNodes(action.referNode, [
1287
+ action.referNode,
1288
+ ...action.nodesToBeInserted,
1289
+ ]);
1290
+ break;
1291
+ case node_abstract.ModifyContentActionType.INSERT_NODES_BEFORE:
1292
+ this.replaceNodeWithNodes(action.referNode, [
1293
+ ...action.nodesToBeInserted,
1294
+ action.referNode,
1295
+ ]);
1296
+ break;
1297
+ }
1298
+ }
1299
+ registerRef(ref) {
1300
+ if (ref) {
1301
+ node_abstract.stateEntityRenderingRegistry.register(ref, this);
1302
+ }
1303
+ }
1304
+ removeChildNode(action) {
1305
+ this.nodes = this.nodes.filter((node) => node !== action.entityToBeRemoved);
1306
+ if (this.nodes.length === 0) {
1307
+ this.parent.apply(new RemoveChildAction(this));
1308
+ }
1309
+ }
1310
+ /**
1311
+ * The image offset should be 0 or 1
1312
+ * <vega-rich-text-image-editor><img /></vega-rich-text-image-editor>
1313
+ *
1314
+ * @param {RTEImageNode} imageNode The split point image node
1315
+ * @param {number} imageOffset The cursor point 0 | 1
1316
+ */
1317
+ splitImageNodes(imageNode, imageOffset) {
1318
+ const nodesSplitIndex = this.nodes.indexOf(imageNode);
1319
+ if (nodesSplitIndex > -1) {
1320
+ const beforeNodes = this.nodes.slice(0, nodesSplitIndex + imageOffset);
1321
+ const afterNodes = this.nodes.slice(nodesSplitIndex + imageOffset);
1322
+ this.apply(new ReplaceChildNodesAction(beforeNodes));
1323
+ const newBlock = this.cloneWithNodes(afterNodes);
1324
+ this.parent.apply(new InsertBlocksAfterAction(this, newBlock));
1325
+ return newBlock;
1326
+ }
1327
+ }
1328
+ cloneWithNodes(nodes) {
1329
+ const block = new RTEImageBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
1330
+ block.nodes = [];
1331
+ block.apply(new AppendChildNodesAction(nodes));
1332
+ return block;
1333
+ }
1334
+ breakSingleBlock(splitNode, startOffsetOfNode) {
1335
+ const newParagraph = RTETextBlock.from({
1336
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
1337
+ type: 'paragraph',
1338
+ nodes: [{ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(), type: 'text', text: '' }],
1339
+ });
1340
+ if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
1341
+ this.parent.apply(new InsertBlocksAfterAction(this, newParagraph));
1342
+ }
1343
+ else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
1344
+ this.parent.apply(new InsertBlocksBeforeAction(this, newParagraph));
1345
+ }
1346
+ else {
1347
+ const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
1348
+ this.apply(splitBlockAction);
1349
+ return splitBlockAction.newBlock;
1350
+ }
1351
+ return newParagraph;
1352
+ }
1353
+ lineBreakSingleBlock(splitNode, startOffset) {
1354
+ const newParagraph = this.breakSingleBlock(splitNode, startOffset);
1355
+ if (newParagraph) {
1356
+ return newParagraph['nodes'][0];
1357
+ }
1358
+ }
1359
+ isCaretPositionAtStart(node, startOffset) {
1360
+ return node === this.nodes[0] && startOffset === 0;
1361
+ }
1362
+ isCaretPositionAtEnd(node, startOffset) {
1363
+ const lastNode = this.nodes[this.nodes.length - 1];
1364
+ return node === lastNode && startOffset === 1;
1365
+ }
1366
+ lineBreakMultipleBlocks(selectedBlocks) {
1367
+ const newParagraph = RTETextBlock.from({
1368
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
1369
+ type: 'paragraph',
1370
+ nodes: [{ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(), type: 'text', text: '\n' }],
1371
+ });
1372
+ this.parent.apply(new InsertBlocksAfterAction(this, newParagraph));
1373
+ const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
1374
+ if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
1375
+ afterNodes.push(new textNode.RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', newParagraph));
1376
+ }
1377
+ newParagraph.apply(new AppendChildNodesAction(afterNodes));
1378
+ return newParagraph['nodes'][0];
1379
+ }
1380
+ deleteNodeContent(action) {
1381
+ const startContainerNode = action
1382
+ .startContainerNode, startOffset = action.startOffset;
1383
+ let previousNode = this.getPreviousNode(startContainerNode);
1384
+ let nextNode = null;
1385
+ if (startOffset === 1) {
1386
+ const parentBlock = startContainerNode.parentBlock;
1387
+ if (this.isContentFirstNode(startContainerNode)) {
1388
+ nextNode = this.getNextNode(startContainerNode);
1389
+ }
1390
+ if (parentBlock.nodes.length === 1) {
1391
+ parentBlock.parent.apply(new RemoveChildAction(parentBlock));
1392
+ }
1393
+ else {
1394
+ startContainerNode.parentBlock.apply(new RemoveChildAction(startContainerNode));
1395
+ }
1396
+ }
1397
+ else {
1398
+ const shouldRemoveNode = previousNode;
1399
+ if (shouldRemoveNode && shouldRemoveNode instanceof RTEImageNode) {
1400
+ previousNode = this.getPreviousNode(shouldRemoveNode);
1401
+ shouldRemoveNode.parentBlock.apply(new RemoveChildAction(shouldRemoveNode));
1402
+ if (!previousNode) {
1403
+ action.nextNode = startContainerNode;
1404
+ }
1405
+ }
1406
+ }
1407
+ if (previousNode) {
1408
+ action.previousNode = previousNode;
1409
+ }
1410
+ else if (nextNode) {
1411
+ action.nextNode = nextNode;
1412
+ }
1413
+ }
1414
+ /**
1415
+ * Image will always create new image block
1416
+ *
1417
+ * @param {InsertImageToBlockAction} action insert image to current block
1418
+ */
1419
+ insertImage(action) {
1420
+ const splitNode = action.splitPointNode;
1421
+ const startOffsetOfNode = action.startOffsetOfNode;
1422
+ const newImageNodes = action.imageBlockToBeInserted.nodes;
1423
+ const newImageBlock = action.imageBlockToBeInserted;
1424
+ if (this.nodes.length < 1) {
1425
+ this.apply(new AppendChildNodesAction(newImageNodes));
1426
+ }
1427
+ else if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
1428
+ this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
1429
+ }
1430
+ else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
1431
+ this.parent.apply(new InsertBlocksBeforeAction(this, newImageBlock));
1432
+ }
1433
+ else {
1434
+ this.apply(new SplitBlockWithNodeAction(splitNode, startOffsetOfNode));
1435
+ this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
1436
+ }
1437
+ }
1438
+ }
1439
+
1440
+ class RTEListItemBlock extends RTETextBlock {
1441
+ constructor(id, children) {
1442
+ super(id, 'list-item');
1443
+ this.children = [];
1444
+ this.children = children;
1445
+ }
1446
+ static from(block) {
1447
+ const listItemBlock = new RTEListItemBlock(block.id);
1448
+ listItemBlock.nodes = block.nodes.map((richText) => textNode.RTETextNode.from(richText, listItemBlock));
1449
+ if (block.children) {
1450
+ listItemBlock.children = block.children.map((child) => {
1451
+ const listBlock = RTEListBlock.from(child);
1452
+ listBlock.parent = listItemBlock;
1453
+ return listBlock;
1454
+ });
1455
+ }
1456
+ const { annotations } = block;
1457
+ if (annotations) {
1458
+ Object.entries(annotations).forEach(([type, value]) => {
1459
+ const item = this.createAnnotationEntity(type, value);
1460
+ if (typeGuard.isNonNullable(item)) {
1461
+ listItemBlock.annotationMap.set(...item);
1462
+ }
1463
+ });
1464
+ }
1465
+ return listItemBlock;
1466
+ }
1467
+ toJSON() {
1468
+ var _a;
1469
+ return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((block) => block.toJSON()) });
1470
+ }
1471
+ cloneWithNodes(nodes) {
1472
+ const block = new RTEListItemBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
1473
+ block.nodes = [];
1474
+ block.apply(new AppendChildNodesAction(nodes));
1475
+ return block;
1476
+ }
1477
+ isNotEmpty() {
1478
+ if (this.children) {
1479
+ return super.isNotEmpty() || this.children.some((block) => block.isNotEmpty());
1480
+ }
1481
+ else {
1482
+ return super.isNotEmpty();
1483
+ }
1484
+ }
1485
+ getLastNode() {
1486
+ if (this.children && this.children.length > 0) {
1487
+ const childListBlock = this.children[this.children.length - 1];
1488
+ return childListBlock.getLastNode();
1489
+ }
1490
+ return super.getLastNode();
1491
+ }
1492
+ render(renderContext) {
1493
+ return super.render(renderContext, this.renderChildren(renderContext));
1494
+ }
1495
+ /**
1496
+ * Apply a modify action to block
1497
+ *
1498
+ * @param {ModifyContentAction} action - Modify action
1499
+ */
1500
+ doModifyActionApply(action) {
1501
+ switch (action.type) {
1502
+ case node_abstract.ModifyContentActionType.DELETE_CHILD:
1503
+ this.removeListChildNode(action);
1504
+ break;
1505
+ case node_abstract.ModifyContentActionType.DELETE_NEST_LIST:
1506
+ this.removeNestList(action);
1507
+ break;
1508
+ case node_abstract.ModifyContentActionType.APPEND_CHILD_NODES:
1509
+ this.appendChildNodes(action.entityToBeAppended);
1510
+ break;
1511
+ case node_abstract.ModifyContentActionType.CLEAR_CHILD_NODES:
1512
+ this.nodes = [];
1513
+ break;
1514
+ case node_abstract.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE:
1515
+ this.splitListItemBlock(action);
1516
+ break;
1517
+ case node_abstract.ModifyContentActionType.REPLACE_CHILD_NODES:
1518
+ this.nodes = [];
1519
+ this.appendChildNodes(action.newChildNodes);
1520
+ break;
1521
+ case node_abstract.ModifyContentActionType.REPLACE_NEST_LIST:
1522
+ this.replaceNestList(action.newList);
1523
+ break;
1524
+ case node_abstract.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES:
1525
+ this.mergeTwoBlocksNodes(action.blockNeedToBeMerged);
1526
+ break;
1527
+ case node_abstract.ModifyContentActionType.BREAK_SINGLE_BLOCK:
1528
+ action.newBlock = this.breakSingleListItemBlock(action.startContainerNode, action.startOffset);
1529
+ break;
1530
+ case node_abstract.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK:
1531
+ action.lineBreakNode = this.lineBreakSingleBlock(action.startContainerNode, action.startOffset);
1532
+ break;
1533
+ case node_abstract.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS:
1534
+ action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks);
1535
+ break;
1536
+ case node_abstract.ModifyContentActionType.DELETE_BLOCK_CONTENT:
1537
+ this.deleteListNodeContent(action);
1538
+ break;
1539
+ case node_abstract.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
1540
+ this.parent.apply(action);
1541
+ break;
1542
+ case node_abstract.ModifyContentActionType.INSERT_NODES_BEFORE:
1543
+ this.replaceNodeWithNodes(action.referNode, [
1544
+ ...action.nodesToBeInserted,
1545
+ action.referNode,
1546
+ ]);
1547
+ break;
1548
+ }
1549
+ }
1550
+ renderChildren(renderContext) {
1551
+ var _a;
1552
+ return (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((block) => block.render(renderContext));
1553
+ }
1554
+ removeListChildNode(action) {
1555
+ this.nodes = this.nodes.filter((node) => node !== action.entityToBeRemoved);
1556
+ if (this.nodes.length === 0 && (!this.children || !this.children.length)) {
1557
+ this.parent.apply(new RemoveChildAction(this));
1558
+ }
1559
+ }
1560
+ removeNestList(action) {
1561
+ if (this.children) {
1562
+ if (this.children.length > 1) {
1563
+ this.children = this.children.filter((child) => child !== action.nestListBlockToBeRemoved);
1564
+ }
1565
+ else {
1566
+ this.children = undefined;
1567
+ }
1568
+ }
1569
+ }
1570
+ replaceNestList(newList) {
1571
+ newList.forEach((listBlock) => {
1572
+ listBlock.parent = this;
1573
+ });
1574
+ this.children = newList;
1575
+ }
1576
+ splitListItemBlock(action) {
1577
+ action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode);
1578
+ }
1579
+ breakSingleListItemBlock(splitNode, startOffsetOfNode) {
1580
+ const newListItem = new RTEListItemBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
1581
+ const newBreakNode = this.copyInlineStyleToNewNode(splitNode);
1582
+ newListItem.apply(new AppendChildNodesAction([newBreakNode]));
1583
+ if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
1584
+ return this.breakListItemAtEnd(newListItem);
1585
+ }
1586
+ else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
1587
+ this.parent.apply(new InsertBlocksBeforeAction(this, newListItem));
1588
+ }
1589
+ else {
1590
+ const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
1591
+ this.apply(splitBlockAction);
1592
+ return splitBlockAction.newBlock;
1593
+ }
1594
+ return newListItem;
1595
+ }
1596
+ breakListItemAtEnd(newListItem) {
1597
+ const lastItem = this.parent.blocks[this.parent.blocks.length - 1];
1598
+ const currentItemIsEmpty = this.nodes.length === 1 && this.nodes[0].isEmpty();
1599
+ if (this === lastItem && currentItemIsEmpty) {
1600
+ const parentParent = this.parent.parent;
1601
+ if (parentParent['type'] !== 'list-item') {
1602
+ const newParagraph = RTETextBlock.from({
1603
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
1604
+ type: 'paragraph',
1605
+ nodes: [],
1606
+ });
1607
+ newParagraph.apply(new AppendChildNodesAction(newListItem.nodes));
1608
+ parentParent.apply(new InsertBlocksAfterAction(this.parent, newParagraph));
1609
+ this.parent.apply(new RemoveChildAction(this));
1610
+ return newParagraph;
1611
+ }
1612
+ else {
1613
+ parentParent.parent.apply(new InsertBlocksAfterAction(parentParent, newListItem));
1614
+ this.parent.apply(new RemoveChildAction(this));
1615
+ }
1616
+ }
1617
+ else {
1618
+ this.parent.apply(new InsertBlocksAfterAction(this, newListItem));
1619
+ }
1620
+ return newListItem;
1621
+ }
1622
+ deleteListNodeContent(action) {
1623
+ const startContainerNode = action.startContainerNode;
1624
+ const listBlock = startContainerNode.parentBlock.parent;
1625
+ this.deleteNodeContent(action);
1626
+ if (listBlock.blocks.length === 0) {
1627
+ listBlock.parent.apply(new RemoveChildAction(listBlock));
1628
+ }
1629
+ }
1630
+ copyInlineStyleToNewNode(needCopedNode) {
1631
+ const textNode = needCopedNode.cloneWithText('');
1632
+ // The link annotation don't need inherited
1633
+ textNode.annotationMap.delete(node_abstract.NodeAnnotationTypeEnum.LINK);
1634
+ return textNode;
1635
+ }
1636
+ }
1637
+
1638
+ /**
1639
+ * Delete the nest list block action
1640
+ *
1641
+ * @example needRemovedNestList.parent.apply(new RemoveNestListAction(needRemovedNestList))
1642
+ */
1643
+ class RemoveNestListAction extends node_abstract.ModifyContentAction {
1644
+ constructor(childList) {
1645
+ super();
1646
+ this.type = node_abstract.ModifyContentActionType.DELETE_NEST_LIST;
1647
+ this.nestListBlockToBeRemoved = childList;
1648
+ }
1649
+ }
1650
+
1651
+ class RTEListBlock extends RTEBlock {
1652
+ constructor(id, type) {
1653
+ super(id);
1654
+ this.type = 'bullet-list';
1655
+ this.blocks = [];
1656
+ this.type = type;
1657
+ }
1658
+ static from(block) {
1659
+ const listBlock = new RTEListBlock(block.id, block.type);
1660
+ listBlock.blocks = block.blocks.map((item) => {
1661
+ const listItemBlock = RTEListItemBlock.from(item);
1662
+ listItemBlock.parent = listBlock;
1663
+ return listItemBlock;
1664
+ });
1665
+ return listBlock;
1666
+ }
1667
+ toJSON() {
1668
+ return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.blocks.map((block) => block.toJSON()) });
1669
+ }
1670
+ isNotEmpty() {
1671
+ return (this.blocks.length > 0 &&
1672
+ this.blocks.some((listItemBlock) => listItemBlock.isNotEmpty()));
1673
+ }
1674
+ getLastNode() {
1675
+ return this.blocks[this.blocks.length - 1].getLastNode();
1676
+ }
1677
+ render(renderContext) {
1678
+ const BlockTag = this.type === 'number-list' ? 'ol' : 'ul';
1679
+ return (globalSlimmerRegistry.h(BlockTag, { ref: this.registerRef.bind(this) }, this.blocks.map((block) => block.render(renderContext))));
1680
+ }
1681
+ /**
1682
+ * Apply a modify action to block
1683
+ *
1684
+ * @param {ModifyContentAction} action - Modify action
1685
+ */
1686
+ doModifyActionApply(action) {
1687
+ switch (action.type) {
1688
+ case node_abstract.ModifyContentActionType.DELETE_CHILD:
1689
+ this.removeListItemBlock(action.entityToBeRemoved);
1690
+ break;
1691
+ case node_abstract.ModifyContentActionType.INSERT_BLOCKS_AFTER:
1692
+ this.replaceBlockWithBlocks(action.referBlock, [
1693
+ action.referBlock,
1694
+ ...action.blocksToBeInserted,
1695
+ ]);
1696
+ break;
1697
+ case node_abstract.ModifyContentActionType.INSERT_BLOCKS_BEFORE:
1698
+ this.replaceBlockWithBlocks(action.referBlock, [
1699
+ ...action.blocksToBeInserted,
1700
+ action.referBlock,
1701
+ ]);
1702
+ break;
1703
+ case node_abstract.ModifyContentActionType.APPEND_CHILD_NODES:
1704
+ this.appendChildBlocks(action.entityToBeAppended);
1705
+ break;
1706
+ case node_abstract.ModifyContentActionType.TRANSFORM_LIST_BLOCK:
1707
+ this.convertToList(action);
1708
+ break;
1709
+ case node_abstract.ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK:
1710
+ this.convertToParagraph(action);
1711
+ break;
1712
+ case node_abstract.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
1713
+ this.insertImage(action);
1714
+ break;
1715
+ }
1716
+ }
1717
+ toParagraph(block) {
1718
+ const textBlock = new RTETextBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), 'paragraph');
1719
+ textBlock.apply(new AppendChildNodesAction(block['nodes']));
1720
+ textBlock['annotationMap'] = block['annotationMap'];
1721
+ return textBlock;
1722
+ }
1723
+ registerRef(ref) {
1724
+ if (ref) {
1725
+ node_abstract.stateEntityRenderingRegistry.register(ref, this);
1726
+ }
1727
+ }
1728
+ convertToList(action) {
1729
+ const selectedBlocks = action.selectedBlocks;
1730
+ const bulletList = this.parent.createList(action.listType);
1731
+ const isSameList = selectedBlocks.every((block) => block.parent === this);
1732
+ if (isSameList) {
1733
+ // Select one or more list items belonging to the same list, and all items in this list should be updated
1734
+ bulletList.apply(new AppendChildNodesAction(this.blocks));
1735
+ this.parent.apply(new InsertBlocksAfterAction(this, bulletList));
1736
+ this.parent.apply(new RemoveChildAction(this));
1737
+ selectedBlocks.forEach((block) => block.nodes.map((node) => node.apply(new textNode.SyncUpSelectionAction())));
1738
+ }
1739
+ else {
1740
+ const listItems = action.selectedBlocks.map((block) => this.parent.toListItem(block));
1741
+ bulletList.apply(new AppendChildNodesAction(listItems));
1742
+ this.parent.apply(new InsertBlocksAfterAction(this, bulletList));
1743
+ action.selectedBlocks.forEach((block) => {
1744
+ block.parent.apply(new RemoveChildAction(block));
1745
+ });
1746
+ if (this.blocks.length === 0) {
1747
+ this.parent.apply(new RemoveChildAction(this));
1748
+ }
1749
+ }
1750
+ }
1751
+ convertToParagraph(action) {
1752
+ let isSelectedFirstBlock = false;
1753
+ let isSelectedLastBlock = false;
1754
+ const selectedBlocks = action.selectedBlocks;
1755
+ const currentParagraph = selectedBlocks.map((block) => {
1756
+ block.nodes.map((node) => node.apply(new textNode.SyncUpSelectionAction()));
1757
+ if (block === this.blocks[0])
1758
+ isSelectedFirstBlock = true;
1759
+ if (block === this.blocks[this.blocks.length - 1])
1760
+ isSelectedLastBlock = true;
1761
+ return this.toParagraph(block);
1762
+ });
1763
+ if (isSelectedFirstBlock) {
1764
+ this.parent.apply(new InsertBlocksBeforeAction(this, ...currentParagraph));
1765
+ }
1766
+ else if (isSelectedLastBlock) {
1767
+ this.parent.apply(new InsertBlocksAfterAction(this, ...currentParagraph));
1768
+ }
1769
+ else {
1770
+ const startIndex = this.blocks.indexOf(selectedBlocks[0]);
1771
+ const lastIndex = this.blocks.indexOf(selectedBlocks[selectedBlocks.length - 1]);
1772
+ const firstBulletList = this.parent.createList(this.type);
1773
+ firstBulletList.apply(new AppendChildNodesAction(this.blocks.slice(0, startIndex)));
1774
+ const lastBulletList = this.parent.createList(this.type);
1775
+ lastBulletList.apply(new AppendChildNodesAction(this.blocks.slice(lastIndex + 1)));
1776
+ this.parent.apply(new InsertBlocksBeforeAction(this, firstBulletList, ...currentParagraph, lastBulletList));
1777
+ this.parent.apply(new RemoveChildAction(this));
1778
+ }
1779
+ selectedBlocks.map((block) => {
1780
+ this.apply(new RemoveChildAction(block));
1781
+ });
1782
+ if (this.blocks.length === 0) {
1783
+ this.parent.apply(new RemoveChildAction(this));
1784
+ }
1785
+ }
1786
+ insertImage(action) {
1787
+ const imageBlock = action.imageBlockToBeInserted;
1788
+ if (this.parent['type'] !== 'list-item') {
1789
+ this.parent.apply(new InsertBlocksAfterAction(this, imageBlock));
1790
+ }
1791
+ else {
1792
+ this.parent.apply(action);
1793
+ }
1794
+ }
1795
+ removeListItemBlock(blockToBeRemoved) {
1796
+ super.removeChildBlock(blockToBeRemoved);
1797
+ if (this.blocks.length === 0 && this.parent) {
1798
+ // The parent is a list item mean the current block is a nest list, so we need use RemoveNestListAction to remove the item
1799
+ if (this.parent instanceof RTEListItemBlock) {
1800
+ this.parent.apply(new RemoveNestListAction(this));
1801
+ }
1802
+ else {
1803
+ this.parent.apply(new RemoveChildAction(this));
1804
+ }
1805
+ }
1806
+ }
1807
+ }
1808
+
1809
+ /**
1810
+ * Class representing the content state of the rich text editor.
1811
+ */
1812
+ class VegaRTEContent extends BlockBaseOperator {
1813
+ constructor(blocks) {
1814
+ super();
1815
+ blocks.forEach((block) => {
1816
+ block.parent = this;
1817
+ });
1818
+ this.blocks = blocks;
1819
+ }
1820
+ /**
1821
+ * Converts a JSON array of blocks to a class array of RTEContentBlock.
1822
+ *
1823
+ * @param {VegaRTEContentBlock[]} value The JSON array of blocks to convert.
1824
+ * @returns {RTEContentBlock[]} The converted array of RTEContentBlock.
1825
+ */
1826
+ static fromJSON(value) {
1827
+ const blocks = value.map((block) => {
1828
+ switch (block.type) {
1829
+ case 'paragraph':
1830
+ case 'title':
1831
+ case 'subtitle':
1832
+ case 'heading-1':
1833
+ case 'heading-2':
1834
+ case 'heading-3': {
1835
+ return RTETextBlock.from(block);
1836
+ }
1837
+ case 'image':
1838
+ return RTEImageBlock.from(block);
1839
+ case 'bullet-list':
1840
+ case 'number-list':
1841
+ return RTEListBlock.from(block);
1842
+ default: {
1843
+ throw new Error(`[Vega] Unknown block type: ${block.type}`);
1844
+ }
1845
+ }
1846
+ });
1847
+ return new VegaRTEContent(blocks);
1848
+ }
1849
+ /**
1850
+ * Create an empty content state
1851
+ *
1852
+ * @returns {VegaRTEContent} An empty content state
1853
+ */
1854
+ static createEmptyContent() {
1855
+ return VegaRTEContent.fromJSON([
1856
+ {
1857
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
1858
+ type: 'paragraph',
1859
+ nodes: [
1860
+ {
1861
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
1862
+ type: 'text',
1863
+ text: '',
1864
+ },
1865
+ ],
1866
+ },
1867
+ ]);
1868
+ }
1869
+ /**
1870
+ * Clones the content state.
1871
+ *
1872
+ * @returns {VegaRTEContent} The cloned content state.
1873
+ */
1874
+ clone() {
1875
+ return new VegaRTEContent([...this.blocks]);
1876
+ }
1877
+ /**
1878
+ * Converts the content state to a JSON array of blocks.
1879
+ *
1880
+ * @returns {VegaRTEContentBlock[]} The JSON array of blocks.
1881
+ */
1882
+ toJSON() {
1883
+ return this.blocks.map((block) => block.toJSON());
1884
+ }
1885
+ /**
1886
+ * Internal method to add the block item, remove the block item
1887
+ *
1888
+ * @param {ModifyContentAction} action - Modify content action
1889
+ */
1890
+ apply(action) {
1891
+ switch (action.type) {
1892
+ case node_abstract.ModifyContentActionType.DELETE_CHILD:
1893
+ this.removeChildBlock(action.entityToBeRemoved);
1894
+ break;
1895
+ case node_abstract.ModifyContentActionType.APPEND_CHILD_NODES:
1896
+ this.appendChildBlocks(action.entityToBeAppended);
1897
+ break;
1898
+ case node_abstract.ModifyContentActionType.INSERT_BLOCKS_AFTER:
1899
+ this.replaceBlockWithBlocks(action.referBlock, [
1900
+ action.referBlock,
1901
+ ...action.blocksToBeInserted,
1902
+ ]);
1903
+ break;
1904
+ case node_abstract.ModifyContentActionType.INSERT_BLOCKS_BEFORE:
1905
+ this.replaceBlockWithBlocks(action.referBlock, [
1906
+ ...action.blocksToBeInserted,
1907
+ action.referBlock,
1908
+ ]);
1909
+ break;
1910
+ }
1911
+ }
1912
+ /**
1913
+ * Convert text to list.
1914
+ *
1915
+ * @param {RTETextBlock} block - block
1916
+ * @returns {RTEListItemBlock} list item block dto.
1917
+ */
1918
+ toListItem(block) {
1919
+ block.nodes.map((node) => node.apply(new textNode.SyncUpSelectionAction()));
1920
+ const listItemBlock = new RTEListItemBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
1921
+ listItemBlock.apply(new AppendChildNodesAction(block['nodes']));
1922
+ listItemBlock['annotationMap'] = block['annotationMap'];
1923
+ return listItemBlock;
1924
+ }
1925
+ /**
1926
+ * create list.
1927
+ *
1928
+ * @param {ListType} type - type
1929
+ * @returns {RTEListBlock} list block dto.
1930
+ */
1931
+ createList(type) {
1932
+ return new RTEListBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), type);
1933
+ }
1934
+ }
1935
+
1936
+ exports.AppendChildNodesAction = AppendChildNodesAction;
1937
+ exports.BoldAnnotationAction = BoldAnnotationAction;
1938
+ exports.HorizontalAlignmentAnnotation = HorizontalAlignmentAnnotation;
1939
+ exports.ImageAnnotationAction = ImageAnnotationAction;
1940
+ exports.IndentAnnotation = IndentAnnotation;
1941
+ exports.InsertBlocksAfterAction = InsertBlocksAfterAction;
1942
+ exports.InsertBlocksBeforeAction = InsertBlocksBeforeAction;
1943
+ exports.MergeTwoBlocksNodesAction = MergeTwoBlocksNodesAction;
1944
+ exports.RTEImageBlock = RTEImageBlock;
1945
+ exports.RTEImageNode = RTEImageNode;
1946
+ exports.RTEListBlock = RTEListBlock;
1947
+ exports.RTEListItemBlock = RTEListItemBlock;
1948
+ exports.RTETextBlock = RTETextBlock;
1949
+ exports.RemoveChildAction = RemoveChildAction;
1950
+ exports.ReplaceChildNodesAction = ReplaceChildNodesAction;
1951
+ exports.SplitBlockWithNodeAction = SplitBlockWithNodeAction;
1952
+ exports.TextStyleAnnotation = TextStyleAnnotation;
1953
+ exports.TextStyleAnnotationAction = TextStyleAnnotationAction;
1954
+ exports.VegaRTEContent = VegaRTEContent;