@globalpayments/vega 2.58.0 → 2.59.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 (946) hide show
  1. package/dist/cjs/{app-globals-26e2fe1e.js → app-globals-64aff1a9.js} +25 -12
  2. package/dist/cjs/{brand-switch-state-controller-slimmer-5efa1b24.js → brand-switch-state-controller-slimmer-b83a4596.js} +1 -1
  3. package/dist/cjs/{child-nodes-event-prevent-slimmer-96240a0e.js → child-nodes-event-prevent-slimmer-5df43771.js} +1 -1
  4. package/dist/cjs/{child-nodes-notify-observer-slimmer-30ba81ac.js → child-nodes-notify-observer-slimmer-34ac3bfc.js} +1 -1
  5. package/dist/cjs/{code-block-7650c868.js → code-block-4bfae76d.js} +2128 -990
  6. package/dist/cjs/{component-value-history-controller-slimmer.abstract-a6e4e5bc.js → component-value-history-controller-slimmer.abstract-34f4577a.js} +112 -54
  7. package/dist/cjs/content-state-b82b74de.js +3692 -0
  8. package/dist/cjs/{dark-mode-state-controller-slimmer-add5d8a8.js → dark-mode-state-controller-slimmer-17022f93.js} +1 -1
  9. package/dist/cjs/{dark-mode-style-controller-f9a32d68.js → dark-mode-style-controller-ab0703e1.js} +1 -1
  10. package/dist/cjs/{deprecated-property-slimmer-4f15005f.js → deprecated-property-slimmer-1eb8f031.js} +1 -1
  11. package/dist/cjs/{design-token-e771bb16.js → design-token-0b1315f2.js} +1 -1
  12. package/dist/cjs/{dom-node-subject-factory-769dd00f.js → dom-node-subject-factory-bad99695.js} +1 -1
  13. package/dist/cjs/{dom-node-subject-observer-factory-5aa4cc83.js → dom-node-subject-observer-factory-df6e6df0.js} +1 -1
  14. package/dist/cjs/{element-appender-slimmer-7f98d16b.js → element-appender-slimmer-f14737af.js} +7 -7
  15. package/dist/cjs/{event-emit-slimmer-6154c759.js → event-emit-slimmer-efc70b94.js} +3 -3
  16. package/dist/cjs/{form-field-controller-slimmer-7bb7df10.js → form-field-controller-slimmer-772d1892.js} +24 -24
  17. package/dist/cjs/{image-annotation-action-6715d6f3.js → image-annotation-action-a3146135.js} +130 -29
  18. package/dist/cjs/{index-7700600c.js → index-00ba6623.js} +23 -4
  19. package/dist/cjs/{index-ee4bc191.js → index-10199ee8.js} +2 -2
  20. package/dist/cjs/index.cjs.js +23 -23
  21. package/dist/cjs/{inject-keyboard-manager-f1f781b7.js → inject-keyboard-manager-70382bae.js} +1 -1
  22. package/dist/cjs/{internal-vega-event-manager-e98944ac.js → internal-vega-event-manager-83065493.js} +1 -1
  23. package/dist/cjs/{keyboard-manager-0be55fb9.js → keyboard-manager-6858915b.js} +1 -1
  24. package/dist/cjs/{keyboard-manager-slimmer-92c7227b.js → keyboard-manager-slimmer-faca2038.js} +1 -1
  25. package/dist/cjs/loader.cjs.js +16 -14
  26. package/dist/cjs/{object-bbd4ed7f.js → object-e2e28e3d.js} +13 -0
  27. package/dist/cjs/{public-rules-036795a4.js → public-rules-26467413.js} +11 -9
  28. package/dist/cjs/{responsive-format-facade-d164ced7.js → responsive-format-facade-d2e03695.js} +4 -4
  29. package/dist/cjs/{rich-text-editor-required-rule-91eb0e22.js → rich-text-editor-required-rule-026c8c3f.js} +1 -1
  30. package/dist/cjs/{static-subject-title-7e7d791a.js → static-subject-title-85732e0f.js} +2 -0
  31. package/dist/cjs/string-39438062.js +24 -0
  32. package/dist/cjs/{string-input-formatter-slimmer-dc1747ad.js → string-input-formatter-slimmer-1b757bad.js} +3 -3
  33. package/dist/cjs/{style-formatter-3e7af35b.js → style-formatter-effb0730.js} +1 -1
  34. package/dist/cjs/{sub-state-notify-slimmer-409bbd1a.js → sub-state-notify-slimmer-943eb7cc.js} +2 -2
  35. package/dist/cjs/{sub-state-observer-slimmer-93d0a609.js → sub-state-observer-slimmer-0788232a.js} +3 -3
  36. package/dist/cjs/{translation-de7e351e.js → translation-cde4dce3.js} +31 -1
  37. package/dist/cjs/{translation-slimmer-83bdb9fe.js → translation-slimmer-af399096.js} +1 -1
  38. package/dist/cjs/{ui-6c069604.js → ui-4ce1fa08.js} +10 -0
  39. package/dist/cjs/vega-accordion.cjs.entry.js +17 -15
  40. package/dist/cjs/vega-app-footer.cjs.entry.js +4 -4
  41. package/dist/cjs/vega-app-header-button.cjs.entry.js +18 -16
  42. package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
  43. package/dist/cjs/vega-banner.cjs.entry.js +6 -6
  44. package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
  45. package/dist/cjs/vega-box.cjs.entry.js +16 -14
  46. package/dist/cjs/vega-brand-logo.cjs.entry.js +4 -4
  47. package/dist/cjs/vega-breadcrumb.cjs.entry.js +7 -7
  48. package/dist/cjs/vega-button-circle.cjs.entry.js +18 -16
  49. package/dist/cjs/vega-button-group_2.cjs.entry.js +10 -10
  50. package/dist/cjs/vega-button-link.cjs.entry.js +7 -7
  51. package/dist/cjs/vega-button.cjs.entry.js +17 -15
  52. package/dist/cjs/{vega-calendar_3.cjs.entry.js → vega-calendar_4.cjs.entry.js} +1615 -1096
  53. package/dist/cjs/vega-card.cjs.entry.js +15 -13
  54. package/dist/cjs/vega-carousel.cjs.entry.js +17 -16
  55. package/dist/cjs/vega-checkbox_2.cjs.entry.js +14 -14
  56. package/dist/cjs/vega-chip.cjs.entry.js +18 -16
  57. package/dist/cjs/vega-code-block.cjs.entry.js +22 -22
  58. package/dist/cjs/vega-color-picker.cjs.entry.js +12 -12
  59. package/dist/cjs/vega-combo-box.cjs.entry.js +15 -15
  60. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  61. package/dist/cjs/vega-date-picker_2.cjs.entry.js +25 -24
  62. package/dist/cjs/vega-dialog_2.cjs.entry.js +19 -18
  63. package/dist/cjs/vega-divider.cjs.entry.js +15 -13
  64. package/dist/cjs/vega-dropdown_5.cjs.entry.js +37 -26
  65. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  66. package/dist/cjs/vega-field-error.cjs.entry.js +3 -2
  67. package/dist/cjs/vega-field-label.cjs.entry.js +6 -6
  68. package/dist/cjs/vega-file-uploader.cjs.entry.js +13 -13
  69. package/dist/cjs/vega-flag-icon.cjs.entry.js +15 -13
  70. package/dist/cjs/vega-flex.cjs.entry.js +16 -14
  71. package/dist/cjs/vega-font.cjs.entry.js +15 -13
  72. package/dist/cjs/vega-form.cjs.entry.js +108 -18
  73. package/dist/cjs/vega-grid.cjs.entry.js +15 -13
  74. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  75. package/dist/cjs/vega-icon.cjs.entry.js +15 -13
  76. package/dist/cjs/vega-image-uploader.cjs.entry.js +21 -20
  77. package/dist/cjs/vega-input-credit-card.cjs.entry.js +13 -13
  78. package/dist/cjs/vega-input-numeric.cjs.entry.js +16 -16
  79. package/dist/cjs/vega-input-phone-number.cjs.entry.js +18 -17
  80. package/dist/cjs/vega-input-range.cjs.entry.js +14 -14
  81. package/dist/cjs/vega-input-select.cjs.entry.js +20 -19
  82. package/dist/cjs/vega-input.cjs.entry.js +15 -15
  83. package/dist/cjs/{vega-internal-event-id-bda08efa.js → vega-internal-event-id-ae6e2c13.js} +7 -1
  84. package/dist/cjs/vega-item-toggle.cjs.entry.js +8 -8
  85. package/dist/cjs/vega-left-nav_5.cjs.entry.js +21 -20
  86. package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
  87. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +14 -12
  88. package/dist/cjs/vega-page-notification_2.cjs.entry.js +4 -4
  89. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +7 -7
  90. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +8 -8
  91. package/dist/cjs/vega-pagination.cjs.entry.js +18 -16
  92. package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
  93. package/dist/cjs/vega-popover_2.cjs.entry.js +43 -20
  94. package/dist/cjs/vega-progress-tracker.cjs.entry.js +8 -8
  95. package/dist/cjs/vega-radio_2.cjs.entry.js +16 -16
  96. package/dist/cjs/vega-rich-text-content.cjs.entry.js +273 -175
  97. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +709 -1496
  98. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  99. package/dist/cjs/vega-segment-control.cjs.entry.js +6 -6
  100. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +20 -19
  101. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +15 -15
  102. package/dist/cjs/vega-sidenav_3.cjs.entry.js +18 -16
  103. package/dist/cjs/vega-signature-capture.cjs.entry.js +20 -20
  104. package/dist/cjs/{vega-skeleton-loader-controller-d534f5a1.js → vega-skeleton-loader-controller-b1971f43.js} +3 -3
  105. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  106. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  107. package/dist/cjs/vega-stepper.cjs.entry.js +13 -13
  108. package/dist/cjs/vega-tab-group_2.cjs.entry.js +8 -8
  109. package/dist/cjs/vega-table_8.cjs.entry.js +20 -19
  110. package/dist/cjs/vega-text.cjs.entry.js +2 -2
  111. package/dist/cjs/vega-textarea.cjs.entry.js +13 -13
  112. package/dist/cjs/vega-time-picker_2.cjs.entry.js +23 -22
  113. package/dist/cjs/vega-toggle-switch.cjs.entry.js +12 -12
  114. package/dist/cjs/vega-tooltip_2.cjs.entry.js +19 -18
  115. package/dist/cjs/vega.cjs.js +16 -14
  116. package/dist/collection/collection-manifest.json +8 -6
  117. package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-controller.js +3 -0
  118. package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-preivew-popover-controller.js +83 -0
  119. package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-post-operation-date-controller.js +15 -2
  120. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/base-repeat-pattern.js +16 -0
  121. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-daily-repeat-pattern.js +12 -0
  122. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-monthly-repeat-pattern.js +12 -0
  123. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-weekly-repeat-pattern.js +14 -0
  124. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-yearly-repeat-pattern.js +13 -0
  125. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.js +53 -2
  126. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.js +68 -0
  127. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-full-day-event-layout-renderer.js +5 -2
  128. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-renderer.js +10 -1
  129. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.js +3 -4
  130. package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/full-day-event/vega-calendar-full-day-event-renderer.js +3 -3
  131. package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/timed-event/vega-calendar-day-event-layout-renderer.js +5 -2
  132. package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/timed-event/vega-calendar-timed-event-renderer.js +1 -1
  133. package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.js +61 -23
  134. package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +1 -2
  135. package/dist/collection/components/vega-calendar/utils/index.js +16 -10
  136. package/dist/collection/components/vega-calendar/vega-calendar-event/slimmers/renderers/vega-calendar-event-renderer.js +5 -32
  137. package/dist/collection/components/vega-calendar/vega-calendar-event/vega-calendar-event.js +0 -5
  138. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/assets/clock.js +3 -0
  139. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/assets/close.js +3 -0
  140. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/slimmers/controllers/vega-calendar-event-preview-state-controller.js +46 -0
  141. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.js +81 -0
  142. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/vega-calendar-event-preview.css +86 -0
  143. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/vega-calendar-event-preview.js +56 -0
  144. package/dist/collection/components/vega-calendar/vega-calendar.css +10 -0
  145. package/dist/collection/components/vega-calendar/vega-calendar.js +37 -0
  146. package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +12 -3
  147. package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.css +0 -1
  148. package/dist/collection/components/vega-field-error/slimmers/controllers/vega-field-error-message-controller.js +1 -0
  149. package/dist/collection/components/vega-form/slimmers/controllers/vega-form-field-validation-state-controller.js +80 -0
  150. package/dist/collection/components/vega-form/vega-form.js +47 -0
  151. package/dist/collection/components/vega-popover/slimmers/renderers/vega-popover-appender-renderer.js +4 -1
  152. package/dist/collection/components/vega-popover/vega-popover-content-box/vega-popover-content-box.css +2521 -1
  153. package/dist/collection/components/vega-popover/vega-popover-content-box/vega-popover-content-box.js +42 -1
  154. package/dist/collection/components/vega-popover/vega-popover.js +36 -0
  155. package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +3 -15
  156. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +81 -16
  157. package/dist/collection/components/vega-rich-text-editor/assets/display-code.js +3 -0
  158. package/dist/collection/components/vega-rich-text-editor/constants/constant.js +6 -5
  159. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +90 -26
  160. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy.js +15 -0
  161. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy.js +15 -0
  162. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-link-group-strategy.js +18 -4
  163. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy.js +1 -0
  164. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-split-text-strategy.js +6 -1
  165. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy.js +15 -1
  166. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/{block-append-blocks-strategy.js → append-children-strategy.js} +3 -2
  167. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/{block-delete-text-content-strategy.js → block-delete-text-or-decorator-node-strategy.js} +60 -12
  168. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-image-into-text-strategy.js +7 -7
  169. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-with-blocks-strategy.js +2 -2
  170. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-new-paragraph-strategy.js +38 -30
  171. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy.js +4 -4
  172. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-nodes-strategy.js +2 -2
  173. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-image-node-strategy.js +4 -4
  174. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-text-node-strategy.js +2 -2
  175. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.js +4 -4
  176. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy.js +6 -6
  177. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-unlink-link-group-strategy.js +24 -0
  178. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.js +2 -2
  179. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +4 -4
  180. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/delete-link-group-strategy.js +34 -0
  181. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-block-insert-image-strategy.js +9 -9
  182. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-strategy.js +2 -2
  183. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-with-blocks-strategy.js +6 -6
  184. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-children-after-strategy.js +15 -0
  185. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-children-before-strategy.js +38 -0
  186. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-text-to-decorator-node-strategy.js +37 -0
  187. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/link-group-node-split-strategy.js +31 -0
  188. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-insert-image-strategy.js +2 -2
  189. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-new-paragraph-strategy.js +15 -15
  190. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.js +5 -5
  191. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.js +10 -10
  192. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +13 -13
  193. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/node-update-text-strategy.js +2 -2
  194. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/remove-children-strategy.js +26 -0
  195. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.js +2 -2
  196. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-cursor-position-strategy.js +23 -0
  197. package/dist/collection/components/vega-rich-text-editor/dto/actions/append-child-nodes-action.js +7 -3
  198. package/dist/collection/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.js +20 -0
  199. package/dist/collection/components/vega-rich-text-editor/dto/actions/delete-link-group-action.js +10 -0
  200. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-children-after-block.js +14 -0
  201. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-children-before-block.js +14 -0
  202. package/dist/collection/components/vega-rich-text-editor/dto/actions/{break-single-block-action.js → insert-new-paragraph-action.js} +3 -3
  203. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-text-to-decorator-node-action.js +17 -0
  204. package/dist/collection/components/vega-rich-text-editor/dto/actions/link-annotation-action.js +2 -1
  205. package/dist/collection/components/vega-rich-text-editor/dto/actions/link-group-annotation-action.js +2 -1
  206. package/dist/collection/components/vega-rich-text-editor/dto/actions/link-group-node-split-action.js +11 -0
  207. package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +10 -7
  208. package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-child-action.js +4 -5
  209. package/dist/collection/components/vega-rich-text-editor/dto/actions/unlink-link-group-action.js +11 -0
  210. package/dist/collection/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.js +20 -0
  211. package/dist/collection/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.js +2 -0
  212. package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +13 -5
  213. package/dist/collection/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.js +2 -0
  214. package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +21 -14
  215. package/dist/collection/components/vega-rich-text-editor/dto/annotations/common-annotation.abstract.js +12 -0
  216. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.js +80 -0
  217. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-class-annotation.js +54 -0
  218. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-style-annotation.js +67 -0
  219. package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +26 -10
  220. package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +17 -8
  221. package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +8 -2
  222. package/dist/collection/components/vega-rich-text-editor/dto/annotations/inline-html-annotation.js +68 -0
  223. package/dist/collection/components/vega-rich-text-editor/dto/annotations/internal-wrapper-annotation.js +41 -0
  224. package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +13 -5
  225. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +16 -11
  226. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +92 -0
  227. package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +41 -0
  228. package/dist/collection/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.js +2 -0
  229. package/dist/collection/components/vega-rich-text-editor/dto/annotations/plain-text-annotation.js +42 -0
  230. package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +9 -9
  231. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +3 -7
  232. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +74 -12
  233. package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +9 -9
  234. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +116 -4
  235. package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +10 -2
  236. package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +78 -0
  237. package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +17 -21
  238. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +66 -12
  239. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +20 -18
  240. package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +116 -37
  241. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +70 -33
  242. package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +9 -2
  243. package/dist/collection/components/vega-rich-text-editor/dto/nodes/decorator-node.js +58 -0
  244. package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +45 -19
  245. package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +145 -0
  246. package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +163 -21
  247. package/dist/collection/components/vega-rich-text-editor/dto/range.js +22 -33
  248. package/dist/collection/components/vega-rich-text-editor/dto/renderers/base-renderer.js +5 -0
  249. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.js +7 -23
  250. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +15 -93
  251. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +0 -9
  252. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/html-block-renderer.js +12 -0
  253. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +1 -5
  254. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +125 -0
  255. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +2 -6
  256. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +1 -1
  257. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +2 -27
  258. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +70 -7
  259. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.js +2 -28
  260. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +19 -5
  261. package/dist/collection/components/vega-rich-text-editor/dto/renderers/renderer-factory.js +47 -0
  262. package/dist/collection/components/vega-rich-text-editor/dto/setup.js +69 -0
  263. package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +83 -0
  264. package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +5 -0
  265. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +53 -29
  266. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js +13 -5
  267. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/annotation-generator-strategy.abstract.js +5 -0
  268. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/bold-annotaion-handler.js +33 -0
  269. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/code-annotation-handler.js +33 -0
  270. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/color-annotation-handler.js +49 -0
  271. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/custom-attribute-annotation-handler.js +48 -0
  272. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/custom-class-annotation-handler.js +36 -0
  273. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/custom-style-annotation-handler.js +48 -0
  274. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +66 -0
  275. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-alt-annotation-handler.js +19 -0
  276. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-size-annotation-handler.js +32 -0
  277. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/indent-annotation-handler.js +53 -0
  278. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.js +99 -0
  279. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/italic-annotation-handler.js +32 -0
  280. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/link-annotation-handler.js +53 -0
  281. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/strike-through-annotation-handler.js +34 -0
  282. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-align-annotation-handler.js +57 -0
  283. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.js +120 -0
  284. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/underline-annotation-handler.js +32 -0
  285. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +38 -232
  286. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +34 -19
  287. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +19 -33
  288. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +4 -3
  289. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-rte-image-block-strategy.abstract.js +33 -0
  290. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-text-node-strategy.js +33 -0
  291. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/html-block-strategy.js +99 -0
  292. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.js +5 -21
  293. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.js +8 -48
  294. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-element-to-text-node-strategy.js +46 -0
  295. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +59 -10
  296. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +8 -5
  297. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/plain-text-to-text-node-strategy.js +35 -0
  298. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.js +5 -21
  299. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-not-li-child-to-rte-list-item-block.js +11 -6
  300. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +8 -5
  301. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +9 -9
  302. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +2 -2
  303. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.js +8 -22
  304. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +2 -2
  305. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +13 -15
  306. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +36 -28
  307. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.js +6 -3
  308. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-image-controller.js +3 -3
  309. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +75 -5
  310. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.js +39 -4
  311. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +11 -0
  312. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +41 -5
  313. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +2 -2
  314. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +2 -2
  315. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.js +2 -2
  316. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.js +2 -2
  317. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +2 -2
  318. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +2 -2
  319. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +2 -2
  320. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.js +2 -2
  321. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +2 -2
  322. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.js +2 -2
  323. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.js +2 -2
  324. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.js +2 -2
  325. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +2 -2
  326. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +2 -2
  327. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +2 -2
  328. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +3 -2
  329. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +2 -2
  330. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +64 -0
  331. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +2 -2
  332. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +2 -2
  333. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +5 -4
  334. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +10 -3
  335. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +2 -2
  336. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.js +37 -0
  337. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +41 -3
  338. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.js +2 -3
  339. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.js +8 -9
  340. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.js +15 -13
  341. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-block-strategy-register.test.js +8 -8
  342. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-item-strategy-register.test.js +12 -12
  343. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-split-text-strategy.test.js +3 -2
  344. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-update-annotation-map-strategy.test.js +2 -2
  345. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.js +34 -12
  346. package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-actions.test.js +1 -0
  347. package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +258 -28
  348. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/html-block.test.js +124 -0
  349. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/image-block.test.js +10 -0
  350. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +59 -0
  351. package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +2613 -0
  352. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +29 -0
  353. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +103 -4
  354. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/custom-attribute-annotation-handler.test.js +49 -0
  355. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/element-to-text-node-strategy.test.js +38 -0
  356. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/html-element-to-annotation-generator.test.js +26 -0
  357. package/dist/collection/components/vega-rich-text-editor/test/spec-utils.js +32 -0
  358. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.js +6 -2
  359. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.css +3 -0
  360. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.js +27 -0
  361. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +7 -32
  362. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +67 -2
  363. package/dist/collection/constants/ui.js +1 -0
  364. package/dist/collection/helpers/calendar/calendar-date.js +12 -0
  365. package/dist/collection/helpers/calendar/calendar-event.js +24 -0
  366. package/dist/collection/helpers/calendar/test/calendar-date.test.js +4 -0
  367. package/dist/collection/helpers/calendar/test/calendar-event.test.js +57 -0
  368. package/dist/collection/helpers/calendar/utils.js +38 -0
  369. package/dist/collection/helpers/change-manager/subject/static-subject/static-subject-title.js +1 -0
  370. package/dist/collection/helpers/code-format/code-formatter.js +116 -0
  371. package/dist/collection/helpers/code-format/test/code-formatter.test.js +362 -0
  372. package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +4 -1
  373. package/dist/collection/helpers/rte-manager/dto-action-strategy-manager.js +37 -0
  374. package/dist/collection/helpers/rte-manager/dto-class-manager.js +51 -0
  375. package/dist/collection/helpers/rte-manager/dto-renderer-manager.js +54 -0
  376. package/dist/collection/helpers/rte-manager/element-dto-class-strategy-manager.js +56 -0
  377. package/dist/collection/helpers/rte-manager/rte.manager.test.js +94 -0
  378. package/dist/collection/helpers/slimmers/field-error-controller-silmmer.js +4 -6
  379. package/dist/collection/helpers/slimmers/field-error-ui-controller-slimmer.js +12 -10
  380. package/dist/collection/helpers/slimmers/global/vega-translate-observer-slimmer.js +17 -4
  381. package/dist/collection/helpers/slimmers/test/field-error-controller-slimmer.test.js +1 -0
  382. package/dist/collection/helpers/slimmers/test/global/vega-translate-observer-slimmer.test.js +89 -0
  383. package/dist/collection/helpers/translation/locales/en.js +30 -0
  384. package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +30 -0
  385. package/dist/collection/polyfill/shadow-selection/shadow-selection-polyfill.js +16 -14
  386. package/dist/collection/polyfill/shadow-selection/test/shadow-selection-polyfill.test.js +1 -0
  387. package/dist/collection/polyfill/test-polyfill/unit/methods.js +9 -0
  388. package/dist/collection/utils/object.js +12 -0
  389. package/dist/collection/utils/string.js +10 -0
  390. package/dist/collection/utils/test/object.test.js +27 -1
  391. package/dist/collection/utils/ui.js +9 -0
  392. package/dist/esm/{app-globals-ee6a1250.js → app-globals-05dbca3e.js} +25 -12
  393. package/dist/esm/{brand-switch-state-controller-slimmer-05c85e6d.js → brand-switch-state-controller-slimmer-d6e4d217.js} +1 -1
  394. package/dist/esm/{child-nodes-event-prevent-slimmer-b59a578e.js → child-nodes-event-prevent-slimmer-6b5b31f5.js} +1 -1
  395. package/dist/esm/{child-nodes-notify-observer-slimmer-eeed5986.js → child-nodes-notify-observer-slimmer-78f77c2c.js} +1 -1
  396. package/dist/esm/{code-block-7bd4cb87.js → code-block-3d519665.js} +2107 -970
  397. package/dist/esm/{component-value-history-controller-slimmer.abstract-41c58caf.js → component-value-history-controller-slimmer.abstract-8b5be007.js} +112 -54
  398. package/dist/esm/content-state-73900a67.js +3682 -0
  399. package/dist/esm/{dark-mode-state-controller-slimmer-f1c2c299.js → dark-mode-state-controller-slimmer-0c7d1c77.js} +1 -1
  400. package/dist/esm/{dark-mode-style-controller-ea798fc8.js → dark-mode-style-controller-3bbb32dc.js} +1 -1
  401. package/dist/esm/{deprecated-property-slimmer-32575f02.js → deprecated-property-slimmer-2c14df89.js} +1 -1
  402. package/dist/esm/{design-token-23522f5c.js → design-token-dbc8c235.js} +1 -1
  403. package/dist/esm/{dom-node-subject-factory-6374611f.js → dom-node-subject-factory-202655e7.js} +1 -1
  404. package/dist/esm/{dom-node-subject-observer-factory-c345ca2e.js → dom-node-subject-observer-factory-999e21e3.js} +1 -1
  405. package/dist/esm/{element-appender-slimmer-042df95a.js → element-appender-slimmer-6ad38a9b.js} +7 -7
  406. package/dist/esm/{event-emit-slimmer-b5cb9b81.js → event-emit-slimmer-40973ec2.js} +3 -3
  407. package/dist/esm/{form-field-controller-slimmer-f0982f11.js → form-field-controller-slimmer-47820eaa.js} +24 -24
  408. package/dist/esm/{image-annotation-action-1e88f5a0.js → image-annotation-action-4ebed11f.js} +128 -29
  409. package/dist/esm/{index-d0a47531.js → index-057d0f70.js} +23 -4
  410. package/dist/esm/{index-fb3b74bd.js → index-18a340fb.js} +2 -2
  411. package/dist/esm/index.js +16 -16
  412. package/dist/esm/{inject-keyboard-manager-5141d09a.js → inject-keyboard-manager-a28dfee4.js} +1 -1
  413. package/dist/esm/{internal-vega-event-manager-d80c53c5.js → internal-vega-event-manager-526f8ed1.js} +1 -1
  414. package/dist/esm/{keyboard-manager-3ffe81b0.js → keyboard-manager-fa6355cb.js} +1 -1
  415. package/dist/esm/{keyboard-manager-slimmer-751e98f5.js → keyboard-manager-slimmer-818050ee.js} +1 -1
  416. package/dist/esm/loader.js +16 -14
  417. package/dist/esm/{object-261e7344.js → object-66c37948.js} +13 -1
  418. package/dist/esm/{public-rules-287d4d77.js → public-rules-f28aca10.js} +11 -9
  419. package/dist/esm/{responsive-format-facade-d2632288.js → responsive-format-facade-81b72f39.js} +4 -4
  420. package/dist/esm/{rich-text-editor-required-rule-69d5f035.js → rich-text-editor-required-rule-c4ba68b8.js} +1 -1
  421. package/dist/esm/{static-subject-title-ca83d6b6.js → static-subject-title-633b3474.js} +2 -1
  422. package/dist/esm/string-a953eafc.js +21 -0
  423. package/dist/esm/{string-input-formatter-slimmer-09478e0d.js → string-input-formatter-slimmer-b144e8d7.js} +3 -3
  424. package/dist/esm/{style-formatter-f7951677.js → style-formatter-7d817448.js} +1 -1
  425. package/dist/esm/{sub-state-notify-slimmer-0a6c3cbb.js → sub-state-notify-slimmer-b3524c09.js} +2 -2
  426. package/dist/esm/{sub-state-observer-slimmer-53eec5fb.js → sub-state-observer-slimmer-c823d69c.js} +3 -3
  427. package/dist/esm/{translation-a6eacb5f.js → translation-833d9ef4.js} +31 -1
  428. package/dist/esm/{translation-slimmer-f28e4708.js → translation-slimmer-c83b52c1.js} +1 -1
  429. package/dist/esm/{ui-7d177fb0.js → ui-c20be16d.js} +10 -1
  430. package/dist/esm/vega-accordion.entry.js +17 -15
  431. package/dist/esm/vega-app-footer.entry.js +4 -4
  432. package/dist/esm/vega-app-header-button.entry.js +18 -16
  433. package/dist/esm/vega-backdrop.entry.js +2 -2
  434. package/dist/esm/vega-banner.entry.js +6 -6
  435. package/dist/esm/vega-bar-chart.entry.js +1 -1
  436. package/dist/esm/vega-box.entry.js +16 -14
  437. package/dist/esm/vega-brand-logo.entry.js +4 -4
  438. package/dist/esm/vega-breadcrumb.entry.js +7 -7
  439. package/dist/esm/vega-button-circle.entry.js +18 -16
  440. package/dist/esm/vega-button-group_2.entry.js +10 -10
  441. package/dist/esm/vega-button-link.entry.js +7 -7
  442. package/dist/esm/vega-button.entry.js +17 -15
  443. package/dist/esm/{vega-calendar_3.entry.js → vega-calendar_4.entry.js} +1615 -1097
  444. package/dist/esm/vega-card.entry.js +15 -13
  445. package/dist/esm/vega-carousel.entry.js +17 -16
  446. package/dist/esm/vega-checkbox_2.entry.js +14 -14
  447. package/dist/esm/vega-chip.entry.js +18 -16
  448. package/dist/esm/vega-code-block.entry.js +19 -19
  449. package/dist/esm/vega-color-picker.entry.js +12 -12
  450. package/dist/esm/vega-combo-box.entry.js +15 -15
  451. package/dist/esm/vega-counter-badge.entry.js +1 -1
  452. package/dist/esm/vega-date-picker_2.entry.js +25 -24
  453. package/dist/esm/vega-dialog_2.entry.js +19 -18
  454. package/dist/esm/vega-divider.entry.js +15 -13
  455. package/dist/esm/vega-dropdown_5.entry.js +37 -26
  456. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  457. package/dist/esm/vega-field-error.entry.js +3 -2
  458. package/dist/esm/vega-field-label.entry.js +6 -6
  459. package/dist/esm/vega-file-uploader.entry.js +13 -13
  460. package/dist/esm/vega-flag-icon.entry.js +15 -13
  461. package/dist/esm/vega-flex.entry.js +16 -14
  462. package/dist/esm/vega-font.entry.js +15 -13
  463. package/dist/esm/vega-form.entry.js +109 -19
  464. package/dist/esm/vega-grid.entry.js +15 -13
  465. package/dist/esm/vega-hint.entry.js +1 -1
  466. package/dist/esm/vega-icon.entry.js +15 -13
  467. package/dist/esm/vega-image-uploader.entry.js +21 -20
  468. package/dist/esm/vega-input-credit-card.entry.js +13 -13
  469. package/dist/esm/vega-input-numeric.entry.js +16 -16
  470. package/dist/esm/vega-input-phone-number.entry.js +18 -17
  471. package/dist/esm/vega-input-range.entry.js +14 -14
  472. package/dist/esm/vega-input-select.entry.js +20 -19
  473. package/dist/esm/vega-input.entry.js +15 -15
  474. package/dist/esm/{vega-internal-event-id-4072659b.js → vega-internal-event-id-b7c865de.js} +5 -2
  475. package/dist/esm/vega-item-toggle.entry.js +8 -8
  476. package/dist/esm/vega-left-nav_5.entry.js +21 -20
  477. package/dist/esm/vega-line-chart.entry.js +1 -1
  478. package/dist/esm/vega-loader-wrapper_2.entry.js +14 -12
  479. package/dist/esm/vega-page-notification_2.entry.js +4 -4
  480. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +7 -7
  481. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +8 -8
  482. package/dist/esm/vega-pagination.entry.js +18 -16
  483. package/dist/esm/vega-pie-chart.entry.js +1 -1
  484. package/dist/esm/vega-popover_2.entry.js +43 -20
  485. package/dist/esm/vega-progress-tracker.entry.js +8 -8
  486. package/dist/esm/vega-radio_2.entry.js +16 -16
  487. package/dist/esm/vega-rich-text-content.entry.js +273 -175
  488. package/dist/esm/vega-rich-text-editor_4.entry.js +693 -1480
  489. package/dist/esm/vega-section-title.entry.js +1 -1
  490. package/dist/esm/vega-segment-control.entry.js +6 -6
  491. package/dist/esm/vega-selection-chip_2.entry.js +20 -19
  492. package/dist/esm/vega-selection-tile_2.entry.js +15 -15
  493. package/dist/esm/vega-sidenav_3.entry.js +18 -16
  494. package/dist/esm/vega-signature-capture.entry.js +20 -20
  495. package/dist/esm/{vega-skeleton-loader-controller-3f6faa17.js → vega-skeleton-loader-controller-38864fcd.js} +3 -3
  496. package/dist/esm/vega-skeleton.entry.js +1 -1
  497. package/dist/esm/vega-slot-container.entry.js +1 -1
  498. package/dist/esm/vega-stepper.entry.js +13 -13
  499. package/dist/esm/vega-tab-group_2.entry.js +8 -8
  500. package/dist/esm/vega-table_8.entry.js +20 -19
  501. package/dist/esm/vega-text.entry.js +2 -2
  502. package/dist/esm/vega-textarea.entry.js +13 -13
  503. package/dist/esm/vega-time-picker_2.entry.js +23 -22
  504. package/dist/esm/vega-toggle-switch.entry.js +12 -12
  505. package/dist/esm/vega-tooltip_2.entry.js +19 -18
  506. package/dist/esm/vega.js +16 -14
  507. package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-controller.d.ts +1 -0
  508. package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-preivew-popover-controller.d.ts +48 -0
  509. package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-post-operation-date-controller.d.ts +10 -0
  510. package/dist/types/components/vega-calendar/slimmers/common/helpers/repeat-pattern/base-repeat-pattern.d.ts +8 -0
  511. package/dist/types/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-daily-repeat-pattern.d.ts +6 -0
  512. package/dist/types/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-monthly-repeat-pattern.d.ts +6 -0
  513. package/dist/types/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-weekly-repeat-pattern.d.ts +6 -0
  514. package/dist/types/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-yearly-repeat-pattern.d.ts +6 -0
  515. package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.d.ts +8 -1
  516. package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.d.ts +18 -0
  517. package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-full-day-event-layout-renderer.d.ts +3 -1
  518. package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-renderer.d.ts +3 -0
  519. package/dist/types/components/vega-calendar/slimmers/day-view/renderers/timed-event/vega-calendar-day-event-layout-renderer.d.ts +3 -1
  520. package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.d.ts +6 -1
  521. package/dist/types/components/vega-calendar/utils/index.d.ts +9 -8
  522. package/dist/types/components/vega-calendar/vega-calendar-event/slimmers/renderers/vega-calendar-event-renderer.d.ts +0 -8
  523. package/dist/types/components/vega-calendar/vega-calendar-event/vega-calendar-event.d.ts +0 -2
  524. package/dist/types/components/vega-calendar/vega-calendar-event-preview/assets/clock.d.ts +3 -0
  525. package/dist/types/components/vega-calendar/vega-calendar-event-preview/assets/close.d.ts +3 -0
  526. package/dist/types/components/vega-calendar/vega-calendar-event-preview/slimmers/controllers/vega-calendar-event-preview-state-controller.d.ts +16 -0
  527. package/dist/types/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.d.ts +13 -0
  528. package/dist/types/components/vega-calendar/vega-calendar-event-preview/types.d.ts +5 -0
  529. package/dist/types/components/vega-calendar/vega-calendar-event-preview/vega-calendar-event-preview.d.ts +22 -0
  530. package/dist/types/components/vega-calendar/vega-calendar.d.ts +10 -0
  531. package/dist/types/components/vega-field-error/types.d.ts +2 -1
  532. package/dist/types/components/vega-form/slimmers/controllers/vega-form-field-validation-state-controller.d.ts +29 -0
  533. package/dist/types/components/vega-form/types.d.ts +18 -0
  534. package/dist/types/components/vega-form/vega-form.d.ts +11 -1
  535. package/dist/types/components/vega-popover/slimmers/renderers/vega-popover-appender-renderer.d.ts +1 -0
  536. package/dist/types/components/vega-popover/vega-popover-content-box/vega-popover-content-box.d.ts +7 -0
  537. package/dist/types/components/vega-popover/vega-popover.d.ts +7 -1
  538. package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +0 -2
  539. package/dist/types/components/vega-rich-text-editor/assets/display-code.d.ts +3 -0
  540. package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +1 -0
  541. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.d.ts +4 -4
  542. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.d.ts +55 -27
  543. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy.d.ts +15 -0
  544. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy.d.ts +15 -0
  545. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/append-children-strategy.d.ts +13 -0
  546. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.d.ts +4 -4
  547. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.d.ts +26 -0
  548. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-new-paragraph-strategy.d.ts +11 -12
  549. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-unlink-link-group-strategy.d.ts +15 -0
  550. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.d.ts +2 -2
  551. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/delete-link-group-strategy.d.ts +15 -0
  552. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-children-after-strategy.d.ts +13 -0
  553. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-children-before-strategy.d.ts +23 -0
  554. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-text-to-decorator-node-strategy.d.ts +18 -0
  555. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/link-group-node-split-strategy.d.ts +15 -0
  556. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-new-paragraph-strategy.d.ts +3 -3
  557. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.d.ts +5 -5
  558. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/remove-children-strategy.d.ts +17 -0
  559. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-cursor-position-strategy.d.ts +12 -0
  560. package/dist/types/components/vega-rich-text-editor/dto/actions/append-child-nodes-action.d.ts +6 -2
  561. package/dist/types/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.d.ts +17 -0
  562. package/dist/types/components/vega-rich-text-editor/dto/actions/delete-link-group-action.d.ts +7 -0
  563. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-children-after-block.d.ts +14 -0
  564. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-children-before-block.d.ts +14 -0
  565. package/dist/types/components/vega-rich-text-editor/dto/actions/{break-single-block-action.d.ts → insert-new-paragraph-action.d.ts} +2 -2
  566. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-text-to-decorator-node-action.d.ts +14 -0
  567. package/dist/types/components/vega-rich-text-editor/dto/actions/link-annotation-action.d.ts +3 -1
  568. package/dist/types/components/vega-rich-text-editor/dto/actions/link-group-annotation-action.d.ts +2 -1
  569. package/dist/types/components/vega-rich-text-editor/dto/actions/link-group-node-split-action.d.ts +10 -0
  570. package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +12 -9
  571. package/dist/types/components/vega-rich-text-editor/dto/actions/remove-child-action.d.ts +3 -4
  572. package/dist/types/components/vega-rich-text-editor/dto/actions/unlink-link-group-action.d.ts +9 -0
  573. package/dist/types/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.d.ts +20 -0
  574. package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +2 -1
  575. package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +18 -4
  576. package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +7 -5
  577. package/dist/types/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.d.ts +2 -1
  578. package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +9 -11
  579. package/dist/types/components/vega-rich-text-editor/dto/annotations/common-annotation.abstract.d.ts +20 -0
  580. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.d.ts +44 -0
  581. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-class-annotation.d.ts +40 -0
  582. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-style-annotation.d.ts +48 -0
  583. package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +5 -9
  584. package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +10 -8
  585. package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +5 -1
  586. package/dist/types/components/vega-rich-text-editor/dto/annotations/inline-html-annotation.d.ts +37 -0
  587. package/dist/types/components/vega-rich-text-editor/dto/annotations/internal-wrapper-annotation.d.ts +31 -0
  588. package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +7 -5
  589. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +10 -6
  590. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +49 -0
  591. package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +25 -0
  592. package/dist/types/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.d.ts +18 -4
  593. package/dist/types/components/vega-rich-text-editor/dto/annotations/plain-text-annotation.d.ts +31 -0
  594. package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +5 -9
  595. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +3 -7
  596. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +9 -7
  597. package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +5 -9
  598. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +70 -9
  599. package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +7 -2
  600. package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +42 -0
  601. package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +10 -4
  602. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +33 -6
  603. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +9 -5
  604. package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +29 -14
  605. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +20 -3
  606. package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +7 -2
  607. package/dist/types/components/vega-rich-text-editor/dto/nodes/decorator-node.d.ts +41 -0
  608. package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +10 -4
  609. package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +116 -5
  610. package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +59 -4
  611. package/dist/types/components/vega-rich-text-editor/dto/range.d.ts +0 -7
  612. package/dist/types/components/vega-rich-text-editor/dto/renderers/base-renderer.d.ts +9 -0
  613. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.d.ts +7 -20
  614. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.d.ts +9 -6
  615. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.d.ts +0 -8
  616. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/html-block-renderer.d.ts +8 -0
  617. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.d.ts +0 -2
  618. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +24 -0
  619. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +0 -2
  620. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +0 -3
  621. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.d.ts +37 -0
  622. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.d.ts +3 -16
  623. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.d.ts +2 -0
  624. package/dist/types/components/vega-rich-text-editor/dto/renderers/renderer-factory.d.ts +24 -0
  625. package/dist/types/components/vega-rich-text-editor/dto/setup.d.ts +1 -0
  626. package/dist/types/components/vega-rich-text-editor/extensions/base-extension-renderer.d.ts +61 -0
  627. package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +13 -0
  628. package/dist/types/components/vega-rich-text-editor/interface.d.ts +172 -42
  629. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.d.ts +19 -0
  630. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/focus-controller.d.ts +1 -0
  631. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/annotation-generator-strategy.abstract.d.ts +16 -0
  632. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/bold-annotaion-handler.d.ts +25 -0
  633. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/code-annotation-handler.d.ts +25 -0
  634. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/color-annotation-handler.d.ts +25 -0
  635. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/custom-attribute-annotation-handler.d.ts +35 -0
  636. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/custom-class-annotation-handler.d.ts +28 -0
  637. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/custom-style-annotation-handler.d.ts +28 -0
  638. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +26 -0
  639. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-alt-annotation-handler.d.ts +17 -0
  640. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-size-annotation-handler.d.ts +24 -0
  641. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/indent-annotation-handler.d.ts +24 -0
  642. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.d.ts +28 -0
  643. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/italic-annotation-handler.d.ts +25 -0
  644. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/link-annotation-handler.d.ts +29 -0
  645. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/strike-through-annotation-handler.d.ts +25 -0
  646. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-align-annotation-handler.d.ts +27 -0
  647. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.d.ts +57 -0
  648. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/underline-annotation-handler.d.ts +25 -0
  649. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.d.ts +12 -85
  650. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.d.ts +10 -2
  651. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.d.ts +12 -3
  652. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +6 -4
  653. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-rte-image-block-strategy.abstract.d.ts +14 -0
  654. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-text-node-strategy.d.ts +23 -0
  655. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/html-block-strategy.d.ts +34 -0
  656. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.d.ts +5 -4
  657. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.d.ts +3 -9
  658. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-element-to-text-node-strategy.d.ts +17 -0
  659. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.d.ts +20 -3
  660. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.d.ts +5 -5
  661. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/plain-text-to-text-node-strategy.d.ts +16 -0
  662. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.d.ts +5 -4
  663. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-not-li-child-to-rte-list-item-block.d.ts +3 -2
  664. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.d.ts +5 -5
  665. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.d.ts +5 -4
  666. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.d.ts +0 -7
  667. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +0 -1
  668. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +20 -0
  669. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.d.ts +20 -3
  670. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +4 -0
  671. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +6 -0
  672. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.d.ts +2 -2
  673. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +3 -2
  674. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.d.ts +2 -2
  675. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.d.ts +2 -2
  676. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.d.ts +2 -2
  677. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.d.ts +2 -2
  678. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.d.ts +2 -2
  679. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.d.ts +2 -2
  680. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.d.ts +3 -2
  681. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.d.ts +2 -2
  682. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.d.ts +2 -2
  683. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.d.ts +2 -2
  684. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.d.ts +3 -2
  685. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.d.ts +2 -2
  686. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.d.ts +2 -2
  687. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.d.ts +3 -2
  688. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.d.ts +2 -2
  689. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +14 -0
  690. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.d.ts +2 -2
  691. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.d.ts +3 -2
  692. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.d.ts +3 -2
  693. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +7 -2
  694. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.d.ts +2 -2
  695. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.d.ts +24 -0
  696. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +10 -2
  697. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.d.ts +1 -1
  698. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-block-strategy-register.test.d.ts +1 -1
  699. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-split-text-strategy.test.d.ts +1 -1
  700. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.d.ts +1 -1
  701. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/html-block.test.d.ts +1 -0
  702. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/text-block.test.d.ts +1 -1
  703. package/dist/types/components/vega-rich-text-editor/test/dto/content-state.test.d.ts +1 -1
  704. package/dist/types/components/vega-rich-text-editor/test/dto/nodes/text-node.test.d.ts +1 -1
  705. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/custom-attribute-annotation-handler.test.d.ts +1 -0
  706. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/element-to-text-node-strategy.test.d.ts +1 -0
  707. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/html-element-to-annotation-generator.test.d.ts +1 -0
  708. package/dist/types/components/vega-rich-text-editor/test/spec-utils.d.ts +15 -0
  709. 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 +1 -0
  710. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.d.ts +6 -0
  711. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +17 -1
  712. package/dist/types/components.d.ts +81 -2
  713. package/dist/types/constants/ui.d.ts +1 -1
  714. package/dist/types/helpers/calendar/calendar-date.d.ts +7 -0
  715. package/dist/types/helpers/calendar/calendar-event.d.ts +15 -1
  716. package/dist/types/helpers/calendar/utils.d.ts +18 -0
  717. package/dist/types/helpers/change-manager/subject/static-subject/static-subject-title.d.ts +2 -1
  718. package/dist/types/helpers/code-format/code-formatter.d.ts +34 -0
  719. package/dist/types/helpers/code-format/test/code-formatter.test.d.ts +1 -0
  720. package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +3 -0
  721. package/dist/types/helpers/rte-manager/dto-action-strategy-manager.d.ts +13 -0
  722. package/dist/types/helpers/rte-manager/dto-class-manager.d.ts +38 -0
  723. package/dist/types/helpers/rte-manager/dto-renderer-manager.d.ts +44 -0
  724. package/dist/types/helpers/rte-manager/element-dto-class-strategy-manager.d.ts +42 -0
  725. package/dist/types/helpers/rte-manager/rte.manager.test.d.ts +1 -0
  726. package/dist/types/helpers/slimmers/field-error-ui-controller-slimmer.d.ts +1 -1
  727. package/dist/types/helpers/slimmers/form-field-controller-slimmer.d.ts +1 -1
  728. package/dist/types/helpers/slimmers/global/vega-translate-observer-slimmer.d.ts +6 -0
  729. package/dist/types/helpers/slimmers/test/global/vega-translate-observer-slimmer.test.d.ts +1 -0
  730. package/dist/types/helpers/translation/interface.d.ts +31 -1
  731. package/dist/types/types/class.type.d.ts +3 -0
  732. package/dist/types/types/components.type.d.ts +10 -2
  733. package/dist/types/utils/object.d.ts +8 -0
  734. package/dist/types/utils/string.d.ts +7 -0
  735. package/dist/types/utils/ui.d.ts +7 -0
  736. package/dist/vega/index.esm.js +1 -1
  737. package/dist/vega/p-02841589.js +1 -0
  738. package/dist/vega/{p-81ed90d5.js → p-02b29c18.js} +1 -1
  739. package/dist/vega/{p-4c4ac1a5.entry.js → p-09ddae74.entry.js} +1 -1
  740. package/dist/vega/{p-1db2ba98.entry.js → p-0c247128.entry.js} +1 -1
  741. package/dist/vega/p-0cd89fb6.js +1 -0
  742. package/dist/vega/{p-e940bc37.js → p-0f0baac3.js} +1 -1
  743. package/dist/vega/{p-fcb5b40f.entry.js → p-12ed3141.entry.js} +1 -1
  744. package/dist/vega/p-13eca7f3.entry.js +1 -0
  745. package/dist/vega/p-17d517c8.entry.js +1 -0
  746. package/dist/vega/{p-f25570f5.js → p-1a195e28.js} +1 -1
  747. package/dist/vega/{p-8782abeb.js → p-1bd516c5.js} +1 -1
  748. package/dist/vega/p-1ff1deaf.entry.js +1 -0
  749. package/dist/vega/p-2004317b.entry.js +1 -0
  750. package/dist/vega/{p-7c348ac7.entry.js → p-26ef2066.entry.js} +1 -1
  751. package/dist/vega/{p-c69a6547.entry.js → p-27b5f69c.entry.js} +1 -1
  752. package/dist/vega/p-29e0d4c8.entry.js +1 -0
  753. package/dist/vega/{p-41465ad0.entry.js → p-2a66e2f7.entry.js} +1 -1
  754. package/dist/vega/p-351405f2.entry.js +1 -0
  755. package/dist/vega/p-369f38ed.entry.js +1 -0
  756. package/dist/vega/{p-82b18195.entry.js → p-36ae2dd3.entry.js} +1 -1
  757. package/dist/vega/p-36ed226a.js +1 -0
  758. package/dist/vega/p-42033e59.js +1 -0
  759. package/dist/vega/{p-832b59af.js → p-436f7e27.js} +1 -1
  760. package/dist/vega/{p-5bd3487e.js → p-4452e085.js} +1 -1
  761. package/dist/vega/{p-710da484.entry.js → p-446d0317.entry.js} +1 -1
  762. package/dist/vega/{p-012cbd8f.js → p-4474bc63.js} +1 -1
  763. package/dist/vega/{p-6dad2e5c.entry.js → p-476cc642.entry.js} +1 -1
  764. package/dist/vega/p-48a58baf.js +2 -0
  765. package/dist/vega/p-490f5e3f.entry.js +1 -0
  766. package/dist/vega/p-4996b853.entry.js +1 -0
  767. package/dist/vega/{p-bcdb235d.js → p-4a368e1e.js} +1 -1
  768. package/dist/vega/p-4b7edf72.entry.js +1 -0
  769. package/dist/vega/{p-4674c318.entry.js → p-4fc18f2f.entry.js} +1 -1
  770. package/dist/vega/p-51cce3f9.entry.js +1 -0
  771. package/dist/vega/p-521ace2d.js +1 -0
  772. package/dist/vega/{p-1f9a735a.entry.js → p-53d67971.entry.js} +1 -1
  773. package/dist/vega/p-555804a0.entry.js +1 -0
  774. package/dist/vega/{p-d5776087.js → p-575235c8.js} +1 -1
  775. package/dist/vega/p-59e990c7.entry.js +1 -0
  776. package/dist/vega/p-5f377954.js +1 -1
  777. package/dist/vega/{p-7d5ebd26.entry.js → p-606d1f7c.entry.js} +1 -1
  778. package/dist/vega/{p-4ab67150.entry.js → p-61d1f3cb.entry.js} +1 -1
  779. package/dist/vega/{p-fda6f8bc.js → p-63c9eb58.js} +1 -1
  780. package/dist/vega/p-675b9501.entry.js +1 -0
  781. package/dist/vega/{p-5f6b942c.entry.js → p-6b292628.entry.js} +1 -1
  782. package/dist/vega/p-707bb905.entry.js +1 -0
  783. package/dist/vega/{p-c9740710.entry.js → p-70939752.entry.js} +1 -1
  784. package/dist/vega/p-7183bd72.entry.js +1 -0
  785. package/dist/vega/p-73b487b0.entry.js +1 -0
  786. package/dist/vega/p-76de6b00.entry.js +1 -0
  787. package/dist/vega/p-7a3b142b.js +1 -0
  788. package/dist/vega/{p-9b08ed46.entry.js → p-7b1bb372.entry.js} +1 -1
  789. package/dist/vega/{p-4c871d0f.entry.js → p-7cd2fac8.entry.js} +1 -1
  790. package/dist/vega/{p-0c8bd757.js → p-7e8f055d.js} +1 -1
  791. package/dist/vega/p-7f087c8b.js +1 -0
  792. package/dist/vega/{p-904d1b43.js → p-846ae5fb.js} +1 -1
  793. package/dist/vega/{p-66e9d31a.entry.js → p-847dbae4.entry.js} +1 -1
  794. package/dist/vega/{p-397b5d91.entry.js → p-850a6305.entry.js} +1 -1
  795. package/dist/vega/p-86f17433.js +1 -0
  796. package/dist/vega/{p-acd9bfa4.js → p-8852361b.js} +1 -1
  797. package/dist/vega/{p-fe1512f9.entry.js → p-8a317208.entry.js} +1 -1
  798. package/dist/vega/p-8a877e12.js +1 -0
  799. package/dist/vega/{p-4a237308.js → p-8baacfc5.js} +1 -1
  800. package/dist/vega/p-9479866e.entry.js +1 -0
  801. package/dist/vega/{p-8c4f893b.js → p-9773c913.js} +1 -1
  802. package/dist/vega/{p-bd84b7b9.entry.js → p-9a74eb86.entry.js} +1 -1
  803. package/dist/vega/p-9f453b90.entry.js +1 -0
  804. package/dist/vega/{p-9afdcf65.js → p-a204a2b2.js} +1 -1
  805. package/dist/vega/p-a328d448.entry.js +1 -0
  806. package/dist/vega/{p-59282fc8.entry.js → p-a7baad6d.entry.js} +1 -1
  807. package/dist/vega/p-ad1b22b4.entry.js +1 -0
  808. package/dist/vega/{p-8e581755.entry.js → p-ae21e5f5.entry.js} +1 -1
  809. package/dist/vega/p-ae415e7e.entry.js +1 -0
  810. package/dist/vega/{p-613ee009.js → p-af464251.js} +1 -1
  811. package/dist/vega/p-b40adb9e.js +1 -0
  812. package/dist/vega/p-b4be8573.entry.js +1 -0
  813. package/dist/vega/{p-6e01f0a2.js → p-b5822a21.js} +1 -1
  814. package/dist/vega/p-b5bef48a.js +1 -0
  815. package/dist/vega/{p-f3bd26a1.entry.js → p-b73532c0.entry.js} +1 -1
  816. package/dist/vega/{p-d789b291.js → p-bbb96a13.js} +1 -1
  817. package/dist/vega/p-bca1f8f9.js +1 -0
  818. package/dist/vega/p-bdce4143.js +1 -0
  819. package/dist/vega/p-be8bbaa5.entry.js +1 -0
  820. package/dist/vega/p-bf0ced3c.js +1 -0
  821. package/dist/vega/p-bf19682d.js +1 -0
  822. package/dist/vega/p-bf6187f7.entry.js +1 -0
  823. package/dist/vega/{p-a4a0fcfd.entry.js → p-c5c5509c.entry.js} +2 -2
  824. package/dist/vega/{p-9540e3ed.entry.js → p-c81cb852.entry.js} +1 -1
  825. package/dist/vega/p-c9c2c8c6.entry.js +1 -0
  826. package/dist/vega/p-ca30b996.js +1 -0
  827. package/dist/vega/{p-091ab617.entry.js → p-cc20f01f.entry.js} +1 -1
  828. package/dist/vega/{p-500684e1.entry.js → p-cc5a3a1b.entry.js} +1 -1
  829. package/dist/vega/{p-f940b7f7.entry.js → p-d0fbbb7f.entry.js} +1 -1
  830. package/dist/vega/p-d3bcaa82.entry.js +1 -0
  831. package/dist/vega/{p-864de9a1.js → p-d4564bfd.js} +1 -1
  832. package/dist/vega/{p-c42ec0ac.entry.js → p-d45f79ce.entry.js} +1 -1
  833. package/dist/vega/{p-34dc3f71.entry.js → p-d72abacd.entry.js} +1 -1
  834. package/dist/vega/p-dbb06804.entry.js +1 -0
  835. package/dist/vega/{p-a1e50e6c.entry.js → p-dc5026e7.entry.js} +1 -1
  836. package/dist/vega/p-df647e48.entry.js +1 -0
  837. package/dist/vega/p-e989ce94.entry.js +1 -0
  838. package/dist/vega/{p-311f338d.entry.js → p-e9ad8223.entry.js} +1 -1
  839. package/dist/vega/p-e9d2e0dc.entry.js +1 -0
  840. package/dist/vega/{p-86a300e8.entry.js → p-ebbaa112.entry.js} +1 -1
  841. package/dist/vega/{p-24042f0c.entry.js → p-f47de801.entry.js} +1 -1
  842. package/dist/vega/p-f6b11a21.entry.js +1 -0
  843. package/dist/vega/p-f6d25220.js +1 -0
  844. package/dist/vega/p-f8e62e5e.entry.js +1 -0
  845. package/dist/vega/{p-9ce0bd82.entry.js → p-fc8badd3.entry.js} +2 -2
  846. package/dist/vega/p-fd6f90fd.entry.js +1 -0
  847. package/dist/vega/{p-42ec43ef.entry.js → p-fe6ea6cf.entry.js} +1 -1
  848. package/dist/vega/{p-92355996.entry.js → p-ffaee583.entry.js} +1 -1
  849. package/dist/vega/vega.esm.js +1 -1
  850. package/package.json +5 -3
  851. package/dist/cjs/content-state-fd5ad4a8.js +0 -1152
  852. package/dist/cjs/string-21427167.js +0 -13
  853. package/dist/cjs/types-a4295b11.js +0 -12
  854. package/dist/collection/components/vega-calendar/vega-calendar-event/slimmers/controllers/vega-calendar-event-bg-color-controller.js +0 -29
  855. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-nodes-strategy.js +0 -21
  856. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-image-strategy.js +0 -54
  857. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-after-strategy.js +0 -15
  858. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-before-strategy.js +0 -38
  859. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-nodes-after-node-strategy.js +0 -14
  860. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-nodes-before-node-strategy.js +0 -14
  861. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-child-block-strategy.js +0 -15
  862. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.js +0 -21
  863. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-node-with-nodes-strategy.js +0 -28
  864. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-new-paragraph-strategy.js +0 -44
  865. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-delete-text-content-strategy.js +0 -20
  866. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-node-strategy.js +0 -19
  867. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-blocks-after-block.js +0 -14
  868. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-blocks-before-block.js +0 -14
  869. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-nodes-after-node-action.js +0 -14
  870. package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-nodes-before-node-action.js +0 -14
  871. package/dist/esm/content-state-a43e703e.js +0 -1146
  872. package/dist/esm/string-be824360.js +0 -11
  873. package/dist/esm/types-0cadfd73.js +0 -12
  874. package/dist/types/components/vega-calendar/vega-calendar-event/slimmers/controllers/vega-calendar-event-bg-color-controller.d.ts +0 -12
  875. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-blocks-strategy.d.ts +0 -13
  876. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-nodes-strategy.d.ts +0 -16
  877. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-image-strategy.d.ts +0 -19
  878. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.d.ts +0 -19
  879. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-after-strategy.d.ts +0 -13
  880. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-before-strategy.d.ts +0 -23
  881. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-nodes-after-node-strategy.d.ts +0 -13
  882. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-nodes-before-node-strategy.d.ts +0 -13
  883. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-child-block-strategy.d.ts +0 -13
  884. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.d.ts +0 -16
  885. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-node-with-nodes-strategy.d.ts +0 -20
  886. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-new-paragraph-strategy.d.ts +0 -21
  887. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-delete-text-content-strategy.d.ts +0 -15
  888. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-node-strategy.d.ts +0 -15
  889. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-blocks-after-block.d.ts +0 -13
  890. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-blocks-before-block.d.ts +0 -13
  891. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-nodes-after-node-action.d.ts +0 -13
  892. package/dist/types/components/vega-rich-text-editor/dto/actions/insert-nodes-before-node-action.d.ts +0 -13
  893. package/dist/vega/p-083af15f.entry.js +0 -1
  894. package/dist/vega/p-0b5330e1.entry.js +0 -1
  895. package/dist/vega/p-0bb29d98.js +0 -1
  896. package/dist/vega/p-1792a352.entry.js +0 -1
  897. package/dist/vega/p-1a4f77de.entry.js +0 -1
  898. package/dist/vega/p-1a6dacc7.entry.js +0 -1
  899. package/dist/vega/p-21d26bb4.js +0 -2
  900. package/dist/vega/p-27a9ad35.entry.js +0 -1
  901. package/dist/vega/p-27ec0c07.entry.js +0 -1
  902. package/dist/vega/p-317920e6.entry.js +0 -1
  903. package/dist/vega/p-376b3ec7.entry.js +0 -1
  904. package/dist/vega/p-394594e9.entry.js +0 -1
  905. package/dist/vega/p-43263510.js +0 -1
  906. package/dist/vega/p-435451be.entry.js +0 -1
  907. package/dist/vega/p-472108bd.entry.js +0 -1
  908. package/dist/vega/p-47a4c625.js +0 -1
  909. package/dist/vega/p-48ae6f02.entry.js +0 -1
  910. package/dist/vega/p-48b24fd3.entry.js +0 -1
  911. package/dist/vega/p-5773a9a3.js +0 -1
  912. package/dist/vega/p-5fe47fe8.entry.js +0 -1
  913. package/dist/vega/p-61ea2d75.entry.js +0 -1
  914. package/dist/vega/p-63adca7b.entry.js +0 -1
  915. package/dist/vega/p-699032fc.entry.js +0 -1
  916. package/dist/vega/p-6be16084.js +0 -1
  917. package/dist/vega/p-71c65f7e.js +0 -1
  918. package/dist/vega/p-81279fea.entry.js +0 -1
  919. package/dist/vega/p-88e08a33.js +0 -1
  920. package/dist/vega/p-8e2b1dae.entry.js +0 -1
  921. package/dist/vega/p-8e662f26.js +0 -1
  922. package/dist/vega/p-8f8de5ab.entry.js +0 -1
  923. package/dist/vega/p-997a2064.entry.js +0 -1
  924. package/dist/vega/p-9a956a00.js +0 -1
  925. package/dist/vega/p-9d6003ef.js +0 -1
  926. package/dist/vega/p-a04491cc.entry.js +0 -1
  927. package/dist/vega/p-a1056063.entry.js +0 -1
  928. package/dist/vega/p-a7042a5a.entry.js +0 -1
  929. package/dist/vega/p-acf7667e.entry.js +0 -1
  930. package/dist/vega/p-b21b128c.entry.js +0 -1
  931. package/dist/vega/p-b75a8edb.entry.js +0 -1
  932. package/dist/vega/p-c21295cf.entry.js +0 -1
  933. package/dist/vega/p-ce5a3589.entry.js +0 -1
  934. package/dist/vega/p-d1355307.js +0 -1
  935. package/dist/vega/p-d1cb7f28.js +0 -1
  936. package/dist/vega/p-d661a5aa.entry.js +0 -1
  937. package/dist/vega/p-d7e0c57a.js +0 -1
  938. package/dist/vega/p-e1ed78db.js +0 -1
  939. package/dist/vega/p-e7b00bf0.js +0 -1
  940. package/dist/vega/p-ef84dc90.entry.js +0 -1
  941. package/dist/vega/p-f229d6d1.js +0 -1
  942. package/dist/vega/p-f27fcc7c.entry.js +0 -1
  943. package/dist/vega/p-f543e911.entry.js +0 -1
  944. package/dist/vega/p-f5ac60f5.js +0 -1
  945. package/dist/vega/p-f7b5833d.entry.js +0 -1
  946. package/dist/vega/p-fc02a67a.js +0 -1
@@ -4,6 +4,8 @@ import { RTEImageBlock } from '../../dto/blocks/image-block';
4
4
  import { RTEListBlock } from '../../dto/blocks/list-block';
5
5
  import { BlockAnnotationTypeEnum } from '../../dto/annotations/block-annotation.abstract';
6
6
  import { NodeAnnotationTypeEnum } from '../../dto/annotations/node-annotation.abstract';
7
+ import '../../../../polyfill/test-polyfill/unit/index';
8
+ import CodeFormatter from '../../../../helpers/code-format/code-formatter';
7
9
  describe('content state', () => {
8
10
  it('fromJSON should work as expect', () => {
9
11
  expect(() => VegaRTEContent.fromJSON([
@@ -137,6 +139,24 @@ describe('content state', () => {
137
139
  },
138
140
  nodes: [
139
141
  { id: '1-1', type: 'text', text: 'This is a paragraph', annotations: { bold: true } },
142
+ {
143
+ id: '1-2',
144
+ type: 'text',
145
+ text: ', and inline HTML',
146
+ annotations: {
147
+ plainText: true,
148
+ inlineHtml: {
149
+ htmlTag: 'b',
150
+ customAttribute: { id: 'b-element' },
151
+ customClass: ['my-class-1', 'my-class-2'],
152
+ customStyle: { background: 'yellow', color: 'red' },
153
+ child: {
154
+ htmlTag: 's',
155
+ customAttribute: { id: 's-element' },
156
+ },
157
+ },
158
+ },
159
+ },
140
160
  ],
141
161
  },
142
162
  ]);
@@ -285,4 +305,2597 @@ describe('content state', () => {
285
305
  expect(content.findNodeById('not-exist')).toBeNull();
286
306
  });
287
307
  });
308
+ describe('toHtml', () => {
309
+ it('should convert paragraph to HTML correctly', () => {
310
+ const contentState = VegaRTEContent.fromJSON([
311
+ {
312
+ id: '1',
313
+ type: 'paragraph',
314
+ annotations: { textStyle: 'paragraph' },
315
+ nodes: [{ id: '1-1', type: 'text', text: 'This is a paragraph' }],
316
+ },
317
+ ]);
318
+ expect(contentState.toHtml()).toEqualHtml(`<p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;"><span>This is a paragraph</span></p>`);
319
+ });
320
+ it('should convert text node with annotations to HTML correctly', () => {
321
+ const contentState = VegaRTEContent.fromJSON([
322
+ {
323
+ id: '1',
324
+ type: 'paragraph',
325
+ annotations: { textStyle: 'paragraph' },
326
+ nodes: [
327
+ {
328
+ id: '1-1',
329
+ type: 'text',
330
+ text: 'This is a paragraph.',
331
+ annotations: { bold: true },
332
+ },
333
+ { id: '1-2', type: 'text', text: ' code', annotations: { code: true } },
334
+ { id: '1-3', type: 'text', text: ' text', annotations: { code: false } },
335
+ ],
336
+ },
337
+ ]);
338
+ expect(contentState.toHtml()).toEqual(`<p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="font-weight: 700;">This is a paragraph.</span><code style="font-family: Roboto Mono;white-space: pre-wrap;"> code</code><span> text</span></p>`);
339
+ });
340
+ it('should convert text block with annotations to HTML with inline styles correctly', () => {
341
+ const contentState = VegaRTEContent.fromJSON([
342
+ {
343
+ id: '1',
344
+ type: 'paragraph',
345
+ annotations: { textStyle: 'paragraph', textAlign: 'right' },
346
+ nodes: [
347
+ {
348
+ id: '1-1',
349
+ type: 'text',
350
+ text: 'This is a paragraph',
351
+ annotations: { bold: true, underline: true },
352
+ },
353
+ ],
354
+ },
355
+ ]);
356
+ expect(contentState.toHtml()).toEqual(`<p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;text-align: right;"><span style="font-weight: 700;text-decoration: underline;">This is a paragraph</span></p>`);
357
+ });
358
+ it('should convert image block to HTML correctly', () => {
359
+ const contentState = VegaRTEContent.fromJSON([
360
+ {
361
+ id: '1',
362
+ type: 'image',
363
+ nodes: [{ id: '1-1', type: 'image', url: 'https://example.com/image.jpg' }],
364
+ },
365
+ {
366
+ id: '2',
367
+ type: 'image',
368
+ nodes: [
369
+ {
370
+ id: '2-1',
371
+ type: 'image',
372
+ url: 'https://example.com/image.jpg',
373
+ annotations: {
374
+ alt: 'example',
375
+ },
376
+ },
377
+ ],
378
+ },
379
+ ]);
380
+ expect(contentState.toHtml()).toEqual(`<div><img style="vertical-align: bottom;width: 50%;" src="https://example.com/image.jpg" data-size="md"></div><div><img style="vertical-align: bottom;width: 50%;" alt="example" src="https://example.com/image.jpg" data-size="md"></div>`);
381
+ });
382
+ it('should convert bullet list block to HTML correctly', () => {
383
+ const contentState = VegaRTEContent.fromJSON([
384
+ {
385
+ id: '1',
386
+ type: 'bullet-list',
387
+ blocks: [
388
+ {
389
+ id: '1-1',
390
+ type: 'list-item',
391
+ nodes: [{ id: '1-1-1', type: 'text', text: 'Item 1' }],
392
+ },
393
+ {
394
+ id: '1-2',
395
+ type: 'list-item',
396
+ nodes: [{ id: '1-2-1', type: 'text', text: 'Item 2' }],
397
+ },
398
+ ],
399
+ },
400
+ ]);
401
+ expect(contentState.toHtml()).toEqual(`<ul style="padding-left: 8px;margin-left: 16px;"><li style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>Item 1</span></li><li style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>Item 2</span></li></ul>`);
402
+ });
403
+ it('should convert number list block to HTML correctly', () => {
404
+ const contentState = VegaRTEContent.fromJSON([
405
+ {
406
+ id: '1',
407
+ type: 'number-list',
408
+ blocks: [
409
+ {
410
+ id: '1-1',
411
+ type: 'list-item',
412
+ nodes: [{ id: '1-1-1', type: 'text', text: 'Item 1' }],
413
+ },
414
+ {
415
+ id: '1-2',
416
+ type: 'list-item',
417
+ nodes: [{ id: '1-2-1', type: 'text', text: 'Item 2' }],
418
+ },
419
+ ],
420
+ },
421
+ ]);
422
+ expect(contentState.toHtml()).toEqual(`<ol style="padding-left: 8px;margin-left: 16px;"><li style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>Item 1</span></li><li style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>Item 2</span></li></ol>`);
423
+ });
424
+ it('should convert code block to HTML correctly', () => {
425
+ const contentState = VegaRTEContent.fromJSON([
426
+ {
427
+ id: '1750424321364',
428
+ type: 'code-block',
429
+ content: '<div>This is a Plain Text.</div>',
430
+ },
431
+ {
432
+ id: '1750424321364',
433
+ type: 'code-block',
434
+ content: '<div>This is an HTML.</div>',
435
+ language: 'html',
436
+ },
437
+ ]);
438
+ expect(contentState.toHtml()).toEqual(`<pre data-language="plainText" style="background-color: rgba(var(--v-bg-secondary, 245, 247, 247, 1)); padding: 12px"><code style='box-sizing: border-box;color: rgba(var(--v-text-primary, 32, 54, 69, 1));text-align: left;font-family: "Roboto Mono";font-weight: 400;line-height: 22px;font-size: 16px;white-space: pre-wrap;min-height: 22px;tab-size: 2px;'><div>This is a Plain Text.</div></code></pre><pre data-language="html" style="background-color: rgba(var(--v-bg-secondary, 245, 247, 247, 1)); padding: 12px"><code style='box-sizing: border-box;color: rgba(var(--v-text-primary, 32, 54, 69, 1));text-align: left;font-family: "Roboto Mono";font-weight: 400;line-height: 22px;font-size: 16px;white-space: pre-wrap;min-height: 22px;tab-size: 2px;'><div>This is an HTML.</div></code></pre>`);
439
+ });
440
+ it('should convert text with the link annotations to HTML correctly', () => {
441
+ const contentState = VegaRTEContent.fromJSON([
442
+ {
443
+ id: '1',
444
+ type: 'paragraph',
445
+ annotations: { textStyle: 'paragraph' },
446
+ nodes: [
447
+ {
448
+ id: '1-1',
449
+ type: 'text',
450
+ text: 'This is a link',
451
+ annotations: {
452
+ link: { href: 'https://example.com', groupKey: 'link-group-1' },
453
+ },
454
+ },
455
+ ],
456
+ },
457
+ ]);
458
+ expect(contentState.toHtml()).toEqual(`<p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><a href="https://example.com" target="_blank" style="color: rgba(var(--v-text-link, 19, 98, 226, 1));"><span>This is a link</span></a></p>`);
459
+ });
460
+ it('should convert a complex value to HTML correctly', () => {
461
+ const contentState = VegaRTEContent.fromJSON([
462
+ {
463
+ id: '1750041983988',
464
+ annotations: {
465
+ textStyle: 'title',
466
+ },
467
+ type: 'title',
468
+ nodes: [
469
+ {
470
+ id: '1750041978250',
471
+ annotations: {
472
+ bold: true,
473
+ },
474
+ type: 'text',
475
+ text: 'Title',
476
+ },
477
+ ],
478
+ },
479
+ {
480
+ id: '1750041984711',
481
+ annotations: {
482
+ textStyle: 'subtitle',
483
+ },
484
+ type: 'subtitle',
485
+ nodes: [
486
+ {
487
+ id: '1750041980352',
488
+ type: 'text',
489
+ text: 'Subtitle',
490
+ },
491
+ ],
492
+ },
493
+ {
494
+ id: '1750041981840',
495
+ annotations: {
496
+ textStyle: 'heading-1',
497
+ },
498
+ type: 'heading-1',
499
+ nodes: [
500
+ {
501
+ id: '1750041978195',
502
+ annotations: {
503
+ bold: true,
504
+ },
505
+ type: 'text',
506
+ text: 'Heading 1',
507
+ },
508
+ ],
509
+ },
510
+ {
511
+ id: '1750041975899',
512
+ annotations: {
513
+ textStyle: 'heading-2',
514
+ },
515
+ type: 'heading-2',
516
+ nodes: [
517
+ {
518
+ id: '1750041981732',
519
+ annotations: {
520
+ bold: true,
521
+ },
522
+ type: 'text',
523
+ text: 'Heading 2',
524
+ },
525
+ ],
526
+ },
527
+ {
528
+ id: '1750041983133',
529
+ annotations: {
530
+ textStyle: 'heading-3',
531
+ },
532
+ type: 'heading-3',
533
+ nodes: [
534
+ {
535
+ id: '1750041980106',
536
+ annotations: {
537
+ bold: true,
538
+ },
539
+ type: 'text',
540
+ text: 'Heading 3',
541
+ },
542
+ ],
543
+ },
544
+ {
545
+ id: '1750041984506',
546
+ annotations: {
547
+ textStyle: 'paragraph',
548
+ },
549
+ type: 'paragraph',
550
+ nodes: [
551
+ {
552
+ id: '1750041974956',
553
+ annotations: {},
554
+ type: 'text',
555
+ text: 'Paragraph',
556
+ },
557
+ ],
558
+ },
559
+ {
560
+ id: '1750041983082',
561
+ annotations: {
562
+ textStyle: 'paragraph',
563
+ },
564
+ type: 'paragraph',
565
+ nodes: [
566
+ {
567
+ id: '1750041983587',
568
+ annotations: {
569
+ bold: true,
570
+ },
571
+ type: 'text',
572
+ text: 'Bold text',
573
+ },
574
+ ],
575
+ },
576
+ {
577
+ id: '1750041980108',
578
+ annotations: {
579
+ textStyle: 'paragraph',
580
+ },
581
+ type: 'paragraph',
582
+ nodes: [
583
+ {
584
+ id: '1750041983935',
585
+ annotations: {
586
+ italic: true,
587
+ },
588
+ type: 'text',
589
+ text: 'Italic text',
590
+ },
591
+ ],
592
+ },
593
+ {
594
+ id: '1750041978100',
595
+ annotations: {
596
+ textStyle: 'paragraph',
597
+ },
598
+ type: 'paragraph',
599
+ nodes: [
600
+ {
601
+ id: '1750041978568',
602
+ annotations: {
603
+ underline: true,
604
+ },
605
+ type: 'text',
606
+ text: 'Underline text',
607
+ },
608
+ ],
609
+ },
610
+ {
611
+ id: '1750041984220',
612
+ annotations: {
613
+ textStyle: 'paragraph',
614
+ },
615
+ type: 'paragraph',
616
+ nodes: [
617
+ {
618
+ id: '1750041982817',
619
+ annotations: {
620
+ underline: true,
621
+ },
622
+ type: 'text',
623
+ text: 'Strikethrough text',
624
+ },
625
+ ],
626
+ },
627
+ {
628
+ id: '1750041979619',
629
+ annotations: {
630
+ textStyle: 'paragraph',
631
+ },
632
+ type: 'paragraph',
633
+ nodes: [
634
+ {
635
+ id: '1750041982051',
636
+ annotations: {
637
+ code: true,
638
+ },
639
+ type: 'text',
640
+ text: 'Code text',
641
+ },
642
+ ],
643
+ },
644
+ {
645
+ id: '1750041977487',
646
+ annotations: {
647
+ textStyle: 'paragraph',
648
+ },
649
+ type: 'paragraph',
650
+ nodes: [
651
+ {
652
+ id: '1750041983700',
653
+ annotations: {
654
+ textColor: 'red',
655
+ },
656
+ type: 'text',
657
+ text: 'Color text',
658
+ },
659
+ ],
660
+ },
661
+ {
662
+ id: '1750041981507',
663
+ annotations: {
664
+ textStyle: 'paragraph',
665
+ textAlign: 'left',
666
+ },
667
+ type: 'paragraph',
668
+ nodes: [
669
+ {
670
+ id: '1750041979308',
671
+ type: 'text',
672
+ text: 'Left align',
673
+ },
674
+ ],
675
+ },
676
+ {
677
+ id: '1750041977501',
678
+ annotations: {
679
+ textStyle: 'paragraph',
680
+ textAlign: 'right',
681
+ },
682
+ type: 'paragraph',
683
+ nodes: [
684
+ {
685
+ id: '1750041976836',
686
+ type: 'text',
687
+ text: 'Right align',
688
+ },
689
+ ],
690
+ },
691
+ {
692
+ id: '1750041983771',
693
+ type: 'bullet-list',
694
+ blocks: [
695
+ {
696
+ id: '1750041977027',
697
+ annotations: {
698
+ textStyle: 'paragraph',
699
+ },
700
+ type: 'list-item',
701
+ nodes: [
702
+ {
703
+ id: '1750041982061',
704
+ type: 'text',
705
+ text: 'list item 1',
706
+ },
707
+ ],
708
+ children: [],
709
+ },
710
+ {
711
+ id: '1750041975174',
712
+ annotations: {
713
+ textStyle: 'paragraph',
714
+ },
715
+ type: 'list-item',
716
+ nodes: [
717
+ {
718
+ id: '1750041978832',
719
+ type: 'text',
720
+ text: 'list item 2',
721
+ },
722
+ ],
723
+ children: [],
724
+ },
725
+ ],
726
+ },
727
+ {
728
+ id: '1750041992884',
729
+ annotations: {
730
+ textStyle: 'paragraph',
731
+ indent: 2,
732
+ },
733
+ type: 'paragraph',
734
+ nodes: [
735
+ {
736
+ id: '1750041987297',
737
+ type: 'text',
738
+ text: 'More indent',
739
+ },
740
+ ],
741
+ },
742
+ {
743
+ id: '1750042019645',
744
+ annotations: {
745
+ textStyle: 'paragraph',
746
+ },
747
+ type: 'paragraph',
748
+ nodes: [
749
+ {
750
+ id: '1750042020364',
751
+ annotations: {
752
+ link: {
753
+ href: 'https://www.google.com',
754
+ groupKey: '1750042026536',
755
+ },
756
+ },
757
+ type: 'text',
758
+ text: 'Link text',
759
+ },
760
+ ],
761
+ },
762
+ {
763
+ id: '1750042030016',
764
+ annotations: {
765
+ textStyle: 'paragraph',
766
+ },
767
+ type: 'paragraph',
768
+ nodes: [
769
+ {
770
+ id: '1750042032454',
771
+ type: 'text',
772
+ text: '',
773
+ },
774
+ ],
775
+ },
776
+ {
777
+ id: '1750041979184',
778
+ annotations: {
779
+ textStyle: 'paragraph',
780
+ },
781
+ type: 'paragraph',
782
+ nodes: [
783
+ {
784
+ id: '1750041981796',
785
+ type: 'text',
786
+ text: '',
787
+ },
788
+ ],
789
+ },
790
+ ]);
791
+ expect(contentState.toHtml()).toEqual(`<div style="font-family: Inter;font-size: 36px;line-height: 40px;font-weight: 500;"><span style="font-weight: 700;">Title</span></div><div style="font-family: Inter;font-size: 28px;line-height: 32px;font-weight: 500;"><span>Subtitle</span></div><h1 style="font-family: Inter;font-size: 22px;line-height: 24px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="font-weight: 700;">Heading 1</span></h1><h2 style="font-family: Inter;font-size: 20px;line-height: 24px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="font-weight: 700;">Heading 2</span></h2><h3 style="font-family: Inter;font-size: 18px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="font-weight: 700;">Heading 3</span></h3><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>Paragraph</span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="font-weight: 700;">Bold text</span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="font-style: italic;">Italic text</span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="text-decoration: underline;">Underline text</span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="text-decoration: underline;">Strikethrough text</span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><code style="font-family: Roboto Mono;white-space: pre-wrap;">Code text</code></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span style="color: #BD2947;">Color text</span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;text-align: left;"><span>Left align</span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;text-align: right;"><span>Right align</span></p><ul style="padding-left: 8px;margin-left: 16px;"><li style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>list item 1</span></li><li style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>list item 2</span></li></ul><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;margin-left: 32px;"><span>More indent</span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><a href="https://www.google.com" target="_blank" style="color: rgba(var(--v-text-link, 19, 98, 226, 1));"><span>Link text</span></a></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span></span></p><p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span></span></p>`);
792
+ });
793
+ it('should convert paragraph with custom attributes to HTML correctly', () => {
794
+ const contentState = VegaRTEContent.fromJSON([
795
+ {
796
+ id: '1',
797
+ type: 'paragraph',
798
+ annotations: {
799
+ textStyle: 'paragraph',
800
+ customAttribute: {
801
+ id: 'p-element',
802
+ dir: 'dir-p',
803
+ },
804
+ },
805
+ nodes: [
806
+ {
807
+ id: '1-1',
808
+ type: 'text',
809
+ text: 'This is a paragraph',
810
+ annotations: {
811
+ customAttribute: {
812
+ id: 'span-element',
813
+ dir: 'dir-span',
814
+ },
815
+ },
816
+ },
817
+ ],
818
+ },
819
+ ]);
820
+ expect(contentState.toHtml()).toEqualHtml(`<p id="p-element" dir="dir-p" style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500; margin-top: 0px; margin-bottom: 0px;"><span id="span-element" dir="dir-span">This is a paragraph</span></p>`);
821
+ });
822
+ it('should convert text node with custom attributes to HTML correctly', () => {
823
+ const contentState = VegaRTEContent.fromJSON([
824
+ {
825
+ id: '1',
826
+ type: 'paragraph',
827
+ annotations: {
828
+ textStyle: 'paragraph',
829
+ customAttribute: {
830
+ id: 'p-element',
831
+ dir: 'dir-p',
832
+ },
833
+ },
834
+ nodes: [
835
+ {
836
+ id: '1-1',
837
+ type: 'text',
838
+ text: 'This is a paragraph.',
839
+ annotations: {
840
+ bold: true,
841
+ customAttribute: {
842
+ id: 'text1',
843
+ },
844
+ },
845
+ },
846
+ {
847
+ id: '1-2',
848
+ type: 'text',
849
+ text: ' code',
850
+ annotations: {
851
+ code: true,
852
+ customAttribute: {
853
+ id: 'text2',
854
+ },
855
+ },
856
+ },
857
+ {
858
+ id: '1-3',
859
+ type: 'text',
860
+ text: ' text',
861
+ annotations: {
862
+ customAttribute: {
863
+ id: 'text3',
864
+ },
865
+ },
866
+ },
867
+ ],
868
+ },
869
+ ]);
870
+ expect(contentState.toHtml()).toEqual(`<p id="p-element" dir="dir-p" style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span id="text1" style="font-weight: 700;">This is a paragraph.</span><code id="text2" style="font-family: Roboto Mono;white-space: pre-wrap;"> code</code><span id="text3"> text</span></p>`);
871
+ });
872
+ it('should convert bullet list block with custom attributes to HTML correctly', () => {
873
+ const contentState = VegaRTEContent.fromJSON([
874
+ {
875
+ id: '1',
876
+ type: 'bullet-list',
877
+ blocks: [
878
+ {
879
+ id: '1-1',
880
+ type: 'list-item',
881
+ nodes: [{ id: '1-1-1', type: 'text', text: 'Item 1' }],
882
+ annotations: {
883
+ customAttribute: {
884
+ id: 'list1',
885
+ },
886
+ },
887
+ },
888
+ {
889
+ id: '1-2',
890
+ type: 'list-item',
891
+ nodes: [{ id: '1-2-1', type: 'text', text: 'Item 2' }],
892
+ annotations: {
893
+ customAttribute: {
894
+ id: 'list2',
895
+ },
896
+ },
897
+ },
898
+ ],
899
+ annotations: {
900
+ customAttribute: {
901
+ id: 'ul',
902
+ },
903
+ },
904
+ },
905
+ ]);
906
+ expect(contentState.toHtml()).toEqual(`<ul id="ul" style="padding-left: 8px;margin-left: 16px;"><li id="list1" style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>Item 1</span></li><li id="list2" style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>Item 2</span></li></ul>`);
907
+ });
908
+ it('should convert paragraph with custom class to HTML correctly', () => {
909
+ const contentState = VegaRTEContent.fromJSON([
910
+ {
911
+ id: '1',
912
+ type: 'paragraph',
913
+ annotations: {
914
+ textStyle: 'paragraph',
915
+ customClass: ['p-class'],
916
+ },
917
+ nodes: [
918
+ {
919
+ id: '1-1',
920
+ type: 'text',
921
+ text: 'This is a paragraph',
922
+ annotations: {
923
+ customClass: ['span-class'],
924
+ },
925
+ },
926
+ ],
927
+ },
928
+ ]);
929
+ expect(contentState.toHtml()).toMatchSnapshot();
930
+ });
931
+ it('should convert text node with custom class to HTML correctly', () => {
932
+ const contentState = VegaRTEContent.fromJSON([
933
+ {
934
+ id: '1',
935
+ type: 'paragraph',
936
+ annotations: {
937
+ textStyle: 'paragraph',
938
+ customClass: ['p-class'],
939
+ },
940
+ nodes: [
941
+ {
942
+ id: '1-1',
943
+ type: 'text',
944
+ text: 'This is a paragraph.',
945
+ annotations: {
946
+ bold: true,
947
+ customClass: ['span1-class'],
948
+ },
949
+ },
950
+ {
951
+ id: '1-2',
952
+ type: 'text',
953
+ text: ' code',
954
+ annotations: {
955
+ code: true,
956
+ customClass: ['span2-class'],
957
+ },
958
+ },
959
+ {
960
+ id: '1-3',
961
+ type: 'text',
962
+ text: ' text',
963
+ annotations: {
964
+ customClass: ['span3-class'],
965
+ },
966
+ },
967
+ ],
968
+ },
969
+ ]);
970
+ expect(contentState.toHtml()).toMatchSnapshot();
971
+ });
972
+ it('should convert bullet list block with custom class to HTML correctly', () => {
973
+ const contentState = VegaRTEContent.fromJSON([
974
+ {
975
+ id: '1',
976
+ type: 'bullet-list',
977
+ blocks: [
978
+ {
979
+ id: '1-1',
980
+ type: 'list-item',
981
+ nodes: [{ id: '1-1-1', type: 'text', text: 'Item 1' }],
982
+ annotations: {
983
+ customClass: ['li1-class'],
984
+ },
985
+ },
986
+ {
987
+ id: '1-2',
988
+ type: 'list-item',
989
+ nodes: [{ id: '1-2-1', type: 'text', text: 'Item 2' }],
990
+ annotations: {
991
+ customClass: ['li2-class'],
992
+ },
993
+ },
994
+ ],
995
+ annotations: {
996
+ customClass: ['ul-class'],
997
+ },
998
+ },
999
+ ]);
1000
+ expect(contentState.toHtml()).toMatchSnapshot();
1001
+ });
1002
+ it('should convert paragraph with custom style to HTML correctly', () => {
1003
+ const contentState = VegaRTEContent.fromJSON([
1004
+ {
1005
+ id: '1',
1006
+ type: 'paragraph',
1007
+ annotations: {
1008
+ textStyle: 'paragraph',
1009
+ customStyle: {
1010
+ fontWeight: '700',
1011
+ },
1012
+ },
1013
+ nodes: [
1014
+ {
1015
+ id: '1-1',
1016
+ type: 'text',
1017
+ text: 'This is a paragraph',
1018
+ annotations: {
1019
+ customStyle: {
1020
+ fontWeight: '700',
1021
+ },
1022
+ },
1023
+ },
1024
+ ],
1025
+ },
1026
+ ]);
1027
+ expect(contentState.toHtml()).toEqualHtml(`<p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 700; margin-top: 0px; margin-bottom: 0px;"><span style="font-weight: 700">This is a paragraph</span></p>`);
1028
+ });
1029
+ it('should convert text node with custom style to HTML correctly', () => {
1030
+ const contentState = VegaRTEContent.fromJSON([
1031
+ {
1032
+ id: '1',
1033
+ type: 'paragraph',
1034
+ annotations: {
1035
+ textStyle: 'paragraph',
1036
+ customStyle: {
1037
+ textAlign: 'right',
1038
+ },
1039
+ },
1040
+ nodes: [
1041
+ {
1042
+ id: '1-1',
1043
+ type: 'text',
1044
+ text: 'This is a paragraph.',
1045
+ annotations: {
1046
+ bold: true,
1047
+ customStyle: {
1048
+ padding: '20px',
1049
+ },
1050
+ },
1051
+ },
1052
+ {
1053
+ id: '1-2',
1054
+ type: 'text',
1055
+ text: ' code',
1056
+ annotations: {
1057
+ code: true,
1058
+ customStyle: {
1059
+ padding: '30px',
1060
+ },
1061
+ },
1062
+ },
1063
+ {
1064
+ id: '1-3',
1065
+ type: 'text',
1066
+ text: ' text',
1067
+ annotations: {
1068
+ customStyle: {
1069
+ padding: '40px',
1070
+ },
1071
+ },
1072
+ },
1073
+ ],
1074
+ },
1075
+ ]);
1076
+ expect(contentState.toHtml()).toEqual(`<p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;text-align: right;"><span style="font-weight: 700;padding: 20px;">This is a paragraph.</span><code style="font-family: Roboto Mono;white-space: pre-wrap;padding: 30px;"> code</code><span style="padding: 40px;"> text</span></p>`);
1077
+ });
1078
+ it('should convert bullet list block with custom style to HTML correctly', () => {
1079
+ const contentState = VegaRTEContent.fromJSON([
1080
+ {
1081
+ id: '1',
1082
+ type: 'bullet-list',
1083
+ blocks: [
1084
+ {
1085
+ id: '1-1',
1086
+ type: 'list-item',
1087
+ nodes: [{ id: '1-1-1', type: 'text', text: 'Item 1' }],
1088
+ annotations: {
1089
+ customStyle: {
1090
+ padding: '40px',
1091
+ },
1092
+ },
1093
+ },
1094
+ {
1095
+ id: '1-2',
1096
+ type: 'list-item',
1097
+ nodes: [{ id: '1-2-1', type: 'text', text: 'Item 2' }],
1098
+ annotations: {
1099
+ customStyle: {
1100
+ padding: '50px',
1101
+ },
1102
+ },
1103
+ },
1104
+ ],
1105
+ annotations: {
1106
+ customStyle: {
1107
+ padding: '60px',
1108
+ },
1109
+ },
1110
+ },
1111
+ ]);
1112
+ expect(contentState.toHtml()).toEqual(`<ul style="padding-left: 8px;margin-left: 16px;padding: 60px;"><li style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;padding: 40px;"><span>Item 1</span></li><li style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;padding: 50px;"><span>Item 2</span></li></ul>`);
1113
+ });
1114
+ });
1115
+ describe('fromHtml', () => {
1116
+ it('should convert a simple paragraph element to the expected RTEContentBlock', () => {
1117
+ const sourceCode = '<p>Hello</p>';
1118
+ const content = VegaRTEContent.fromHtml(sourceCode);
1119
+ expect(content.toJSON()).toEqual([
1120
+ {
1121
+ id: expect.anything(),
1122
+ type: 'paragraph',
1123
+ annotations: { textStyle: 'paragraph' },
1124
+ nodes: [
1125
+ {
1126
+ id: expect.anything(),
1127
+ text: 'Hello',
1128
+ type: 'text',
1129
+ },
1130
+ ],
1131
+ },
1132
+ ]);
1133
+ });
1134
+ it('should convert a bold text element to the expected RTEContentBlock', () => {
1135
+ const sourceCode = '<span style="font-weight: 700;">Bold</span>';
1136
+ const content = VegaRTEContent.fromHtml(sourceCode);
1137
+ expect(content.toJSON()).toEqual([
1138
+ {
1139
+ id: expect.anything(),
1140
+ type: 'paragraph',
1141
+ annotations: { textStyle: 'paragraph' },
1142
+ nodes: [
1143
+ {
1144
+ id: expect.anything(),
1145
+ type: 'text',
1146
+ text: 'Bold',
1147
+ annotations: {
1148
+ bold: true,
1149
+ customStyle: {
1150
+ fontWeight: '700',
1151
+ },
1152
+ },
1153
+ },
1154
+ ],
1155
+ },
1156
+ ]);
1157
+ });
1158
+ it('should convert a list element to the expected RTEContentBlock', () => {
1159
+ const sourceCode = '<ul><li>Item 1</li><li>Item 2</li></ul>';
1160
+ const content = VegaRTEContent.fromHtml(sourceCode);
1161
+ expect(content.toJSON()).toEqual([
1162
+ {
1163
+ blocks: [
1164
+ {
1165
+ id: expect.anything(),
1166
+ type: 'list-item',
1167
+ annotations: { textStyle: 'paragraph' },
1168
+ nodes: [
1169
+ {
1170
+ id: expect.anything(),
1171
+ text: 'Item 1',
1172
+ type: 'text',
1173
+ },
1174
+ ],
1175
+ children: [],
1176
+ },
1177
+ {
1178
+ id: expect.anything(),
1179
+ type: 'list-item',
1180
+ annotations: { textStyle: 'paragraph' },
1181
+ nodes: [
1182
+ {
1183
+ id: expect.anything(),
1184
+ text: 'Item 2',
1185
+ type: 'text',
1186
+ },
1187
+ ],
1188
+ children: [],
1189
+ },
1190
+ ],
1191
+ id: expect.anything(),
1192
+ type: 'bullet-list',
1193
+ },
1194
+ ]);
1195
+ });
1196
+ it('should convert a heading element to the expected RTEContentBlock', () => {
1197
+ const sourceCode = '<h1>Heading</h1>';
1198
+ const content = VegaRTEContent.fromHtml(sourceCode);
1199
+ expect(content.toJSON()).toEqual([
1200
+ {
1201
+ id: expect.anything(),
1202
+ type: 'heading-1',
1203
+ annotations: { textStyle: 'heading-1' },
1204
+ nodes: [
1205
+ {
1206
+ id: expect.anything(),
1207
+ text: 'Heading',
1208
+ type: 'text',
1209
+ },
1210
+ ],
1211
+ },
1212
+ ]);
1213
+ });
1214
+ it('should convert a complex html with RTE classes to DTO correctly', () => {
1215
+ const sourceCode = `<div class='v-rte--text-style-title'>Title</div>
1216
+ <div class='v-rte--text-style-subtitle'>Subtitle</div>
1217
+ <h1 class='v-rte--text-style-heading-1'>Heading 1</h1>
1218
+ <h2 class='v-rte--text-style-heading-2'>Heading 2</h2>
1219
+ <h3 class='v-rte--text-style-heading-3'>Heading 3</h3>
1220
+ <p class='v-rte--text-style-paragraph'>Paragraph</p>
1221
+ <p class='v-rte--text-style-paragraph'>
1222
+ <span class='v-rte--bold'>Bold text</span>
1223
+ <span class='v-rte--italic'>Italic text</span>
1224
+ <span class='v-rte--underline'>Underline text</span>
1225
+ <span class='v-rte--strikethrough'>Strikethrough text</span>
1226
+ <code class='v-rte--code'>Code text</code>
1227
+ <span style="color: rgb(1, 128, 31);">Color text</span>
1228
+ </p>
1229
+ <ul>
1230
+ <li class='v-rte--text-style-paragraph'>List item 1</li>
1231
+ <li class='v-rte--text-style-paragraph'>List item 2</li>
1232
+ </ul>
1233
+ <ol>
1234
+ <li class='v-rte--text-style-paragraph'>List item 1</li>
1235
+ <li class='v-rte--text-style-paragraph'>List item 2</li>
1236
+ </ol>
1237
+ <p class="v-rte--text-style-paragraph v-rte--horizontal-alignment-left"><span class="">Left align</span></p>
1238
+ <p class="v-rte--text-style-paragraph v-rte--horizontal-alignment-right"><span class="">Right align</span></p>
1239
+ <p class="v-rte--text-style-paragraph v-rte--horizontal-alignment-left" style="margin-left: 16px;"><span class="">More indent 1</span></p>
1240
+ <p class="v-rte--text-style-paragraph v-rte--horizontal-alignment-left" style="margin-left: 32px;"><span class="">More indent 2</span></p>
1241
+ <p class="v-rte--text-style-paragraph"><a href="https://www.google.com" target="_blank" class="v-rte--link classA classB" id="a" data-link="link" style="fontSize: 8px; display: block;"><span class="">Link text</span></a></p>
1242
+ <div><img src="mock-img-url" style="width: 100%;"></div>`;
1243
+ const content = VegaRTEContent.fromHtml(sourceCode.replace(/[\t\n]/g, ''));
1244
+ expect(content.toJSON()).toEqual([
1245
+ {
1246
+ id: expect.anything(),
1247
+ type: 'title',
1248
+ annotations: { textStyle: 'title' },
1249
+ nodes: [
1250
+ {
1251
+ id: expect.anything(),
1252
+ text: 'Title',
1253
+ type: 'text',
1254
+ },
1255
+ ],
1256
+ },
1257
+ {
1258
+ id: expect.anything(),
1259
+ type: 'subtitle',
1260
+ annotations: { textStyle: 'subtitle' },
1261
+ nodes: [
1262
+ {
1263
+ id: expect.anything(),
1264
+ text: 'Subtitle',
1265
+ type: 'text',
1266
+ },
1267
+ ],
1268
+ },
1269
+ {
1270
+ id: expect.anything(),
1271
+ type: 'heading-1',
1272
+ annotations: { textStyle: 'heading-1' },
1273
+ nodes: [
1274
+ {
1275
+ id: expect.anything(),
1276
+ type: 'text',
1277
+ text: 'Heading 1',
1278
+ },
1279
+ ],
1280
+ },
1281
+ {
1282
+ id: expect.anything(),
1283
+ type: 'heading-2',
1284
+ annotations: { textStyle: 'heading-2' },
1285
+ nodes: [
1286
+ {
1287
+ id: expect.anything(),
1288
+ type: 'text',
1289
+ text: 'Heading 2',
1290
+ },
1291
+ ],
1292
+ },
1293
+ {
1294
+ id: expect.anything(),
1295
+ type: 'heading-3',
1296
+ annotations: { textStyle: 'heading-3' },
1297
+ nodes: [
1298
+ {
1299
+ id: expect.anything(),
1300
+ text: 'Heading 3',
1301
+ type: 'text',
1302
+ },
1303
+ ],
1304
+ },
1305
+ {
1306
+ id: expect.anything(),
1307
+ type: 'paragraph',
1308
+ annotations: { textStyle: 'paragraph' },
1309
+ nodes: [
1310
+ {
1311
+ id: expect.anything(),
1312
+ text: 'Paragraph',
1313
+ type: 'text',
1314
+ },
1315
+ ],
1316
+ },
1317
+ {
1318
+ id: expect.anything(),
1319
+ type: 'paragraph',
1320
+ annotations: { textStyle: 'paragraph' },
1321
+ nodes: [
1322
+ {
1323
+ annotations: {
1324
+ bold: true,
1325
+ },
1326
+ id: expect.anything(),
1327
+ text: 'Bold text',
1328
+ type: 'text',
1329
+ },
1330
+ {
1331
+ id: expect.anything(),
1332
+ type: 'text',
1333
+ annotations: {
1334
+ italic: true,
1335
+ },
1336
+ text: 'Italic text',
1337
+ },
1338
+ {
1339
+ id: expect.anything(),
1340
+ annotations: {
1341
+ underline: true,
1342
+ },
1343
+ text: 'Underline text',
1344
+ type: 'text',
1345
+ },
1346
+ {
1347
+ id: expect.anything(),
1348
+ type: 'text',
1349
+ annotations: {
1350
+ strikethrough: true,
1351
+ },
1352
+ text: 'Strikethrough text',
1353
+ },
1354
+ {
1355
+ id: expect.anything(),
1356
+ type: 'text',
1357
+ annotations: {
1358
+ code: true,
1359
+ },
1360
+ text: 'Code text',
1361
+ },
1362
+ {
1363
+ id: expect.anything(),
1364
+ type: 'text',
1365
+ annotations: {
1366
+ textColor: 'green',
1367
+ customStyle: {
1368
+ color: 'rgb(1, 128, 31)',
1369
+ },
1370
+ },
1371
+ text: 'Color text',
1372
+ },
1373
+ ],
1374
+ },
1375
+ {
1376
+ id: expect.anything(),
1377
+ type: 'bullet-list',
1378
+ blocks: [
1379
+ {
1380
+ id: expect.anything(),
1381
+ type: 'list-item',
1382
+ annotations: { textStyle: 'paragraph' },
1383
+ nodes: [
1384
+ {
1385
+ id: expect.anything(),
1386
+ text: 'List item 1',
1387
+ type: 'text',
1388
+ },
1389
+ ],
1390
+ children: [],
1391
+ },
1392
+ {
1393
+ id: expect.anything(),
1394
+ type: 'list-item',
1395
+ annotations: { textStyle: 'paragraph' },
1396
+ nodes: [
1397
+ {
1398
+ id: expect.anything(),
1399
+ text: 'List item 2',
1400
+ type: 'text',
1401
+ },
1402
+ ],
1403
+ children: [],
1404
+ },
1405
+ ],
1406
+ },
1407
+ {
1408
+ id: expect.anything(),
1409
+ type: 'number-list',
1410
+ blocks: [
1411
+ {
1412
+ id: expect.anything(),
1413
+ type: 'list-item',
1414
+ annotations: { textStyle: 'paragraph' },
1415
+ nodes: [
1416
+ {
1417
+ id: expect.anything(),
1418
+ text: 'List item 1',
1419
+ type: 'text',
1420
+ },
1421
+ ],
1422
+ children: [],
1423
+ },
1424
+ {
1425
+ id: expect.anything(),
1426
+ type: 'list-item',
1427
+ annotations: { textStyle: 'paragraph' },
1428
+ nodes: [
1429
+ {
1430
+ id: expect.anything(),
1431
+ text: 'List item 2',
1432
+ type: 'text',
1433
+ },
1434
+ ],
1435
+ children: [],
1436
+ },
1437
+ ],
1438
+ },
1439
+ {
1440
+ id: expect.anything(),
1441
+ type: 'paragraph',
1442
+ annotations: { textAlign: 'left', textStyle: 'paragraph' },
1443
+ nodes: [
1444
+ {
1445
+ id: expect.anything(),
1446
+ type: 'text',
1447
+ text: 'Left align',
1448
+ },
1449
+ ],
1450
+ },
1451
+ {
1452
+ id: expect.anything(),
1453
+ type: 'paragraph',
1454
+ annotations: { textAlign: 'right', textStyle: 'paragraph' },
1455
+ nodes: [
1456
+ {
1457
+ id: expect.anything(),
1458
+ type: 'text',
1459
+ text: 'Right align',
1460
+ },
1461
+ ],
1462
+ },
1463
+ {
1464
+ id: expect.anything(),
1465
+ type: 'paragraph',
1466
+ annotations: {
1467
+ indent: 1,
1468
+ textAlign: 'left',
1469
+ textStyle: 'paragraph',
1470
+ customStyle: {
1471
+ marginLeft: '16px',
1472
+ },
1473
+ },
1474
+ nodes: [
1475
+ {
1476
+ id: expect.anything(),
1477
+ type: 'text',
1478
+ text: 'More indent 1',
1479
+ },
1480
+ ],
1481
+ },
1482
+ {
1483
+ id: expect.anything(),
1484
+ type: 'paragraph',
1485
+ annotations: {
1486
+ indent: 2,
1487
+ textAlign: 'left',
1488
+ textStyle: 'paragraph',
1489
+ customStyle: {
1490
+ marginLeft: '32px',
1491
+ },
1492
+ },
1493
+ nodes: [
1494
+ {
1495
+ id: expect.anything(),
1496
+ type: 'text',
1497
+ text: 'More indent 2',
1498
+ },
1499
+ ],
1500
+ },
1501
+ {
1502
+ id: expect.anything(),
1503
+ type: 'paragraph',
1504
+ annotations: { textStyle: 'paragraph' },
1505
+ nodes: [
1506
+ {
1507
+ id: expect.anything(),
1508
+ type: 'text',
1509
+ annotations: {
1510
+ link: {
1511
+ groupKey: expect.anything(),
1512
+ href: 'https://www.google.com',
1513
+ customAttribute: {
1514
+ 'href': 'https://www.google.com',
1515
+ 'target': '_blank',
1516
+ 'id': 'a',
1517
+ 'data-link': 'link',
1518
+ },
1519
+ customStyle: { fontSize: '8px', display: 'block' },
1520
+ customClass: ['classA', 'classB'],
1521
+ },
1522
+ },
1523
+ text: 'Link text',
1524
+ },
1525
+ ],
1526
+ },
1527
+ {
1528
+ id: expect.anything(),
1529
+ type: 'image',
1530
+ nodes: [
1531
+ {
1532
+ id: expect.anything(),
1533
+ type: 'image',
1534
+ annotations: {
1535
+ size: 'md',
1536
+ customAttribute: {
1537
+ src: 'mock-img-url',
1538
+ },
1539
+ customStyle: {
1540
+ width: '100%',
1541
+ },
1542
+ },
1543
+ url: 'mock-img-url',
1544
+ },
1545
+ ],
1546
+ },
1547
+ ]);
1548
+ });
1549
+ it('should convert a paragraph element with custom attributes to the expected RTEContentBlock', () => {
1550
+ const sourceCode = '<p id="block-element" dir="block-dir">Hello</p>';
1551
+ const content = VegaRTEContent.fromHtml(sourceCode);
1552
+ expect(content.toJSON()).toEqual([
1553
+ {
1554
+ id: expect.anything(),
1555
+ type: 'paragraph',
1556
+ annotations: {
1557
+ textStyle: 'paragraph',
1558
+ customAttribute: {
1559
+ id: 'block-element',
1560
+ dir: 'block-dir',
1561
+ },
1562
+ },
1563
+ nodes: [
1564
+ {
1565
+ id: expect.anything(),
1566
+ text: 'Hello',
1567
+ type: 'text',
1568
+ },
1569
+ ],
1570
+ },
1571
+ ]);
1572
+ });
1573
+ it('should convert a text code element with custom attributes to the expected RTEContentBlock', () => {
1574
+ const sourceCode = '<p id="p-element"><code id="code">Hello</code></p>';
1575
+ const content = VegaRTEContent.fromHtml(sourceCode);
1576
+ expect(content.toJSON()).toEqual([
1577
+ {
1578
+ id: expect.anything(),
1579
+ type: 'paragraph',
1580
+ annotations: {
1581
+ textStyle: 'paragraph',
1582
+ customAttribute: {
1583
+ id: 'p-element',
1584
+ },
1585
+ },
1586
+ nodes: [
1587
+ {
1588
+ id: expect.anything(),
1589
+ text: 'Hello',
1590
+ type: 'text',
1591
+ annotations: {
1592
+ code: true,
1593
+ customAttribute: {
1594
+ id: 'code',
1595
+ },
1596
+ },
1597
+ },
1598
+ ],
1599
+ },
1600
+ ]);
1601
+ });
1602
+ it('should convert a list element with custom attributes to the expected RTEContentBlock', () => {
1603
+ const sourceCode = '<ul id="ul-element"><li id="li1-element">Item 1</li><li id="li2-element">Item 2</li></ul>';
1604
+ const content = VegaRTEContent.fromHtml(sourceCode);
1605
+ expect(content.toJSON()).toEqual([
1606
+ {
1607
+ blocks: [
1608
+ {
1609
+ id: expect.anything(),
1610
+ type: 'list-item',
1611
+ annotations: {
1612
+ textStyle: 'paragraph',
1613
+ customAttribute: {
1614
+ id: 'li1-element',
1615
+ },
1616
+ },
1617
+ nodes: [
1618
+ {
1619
+ id: expect.anything(),
1620
+ text: 'Item 1',
1621
+ type: 'text',
1622
+ },
1623
+ ],
1624
+ children: [],
1625
+ },
1626
+ {
1627
+ id: expect.anything(),
1628
+ type: 'list-item',
1629
+ annotations: {
1630
+ textStyle: 'paragraph',
1631
+ customAttribute: {
1632
+ id: 'li2-element',
1633
+ },
1634
+ },
1635
+ nodes: [
1636
+ {
1637
+ id: expect.anything(),
1638
+ text: 'Item 2',
1639
+ type: 'text',
1640
+ },
1641
+ ],
1642
+ children: [],
1643
+ },
1644
+ ],
1645
+ id: expect.anything(),
1646
+ type: 'bullet-list',
1647
+ annotations: {
1648
+ customAttribute: {
1649
+ id: 'ul-element',
1650
+ },
1651
+ },
1652
+ },
1653
+ ]);
1654
+ });
1655
+ it('should convert a heading element with custom class to the expected RTEContentBlock', () => {
1656
+ const sourceCode = '<h1 class="v-rte-class h1-class">Heading</h1>';
1657
+ const content = VegaRTEContent.fromHtml(sourceCode);
1658
+ expect(content.toJSON()).toEqual([
1659
+ {
1660
+ id: expect.anything(),
1661
+ type: 'heading-1',
1662
+ annotations: {
1663
+ textStyle: 'heading-1',
1664
+ customClass: ['h1-class'],
1665
+ },
1666
+ nodes: [
1667
+ {
1668
+ id: expect.anything(),
1669
+ text: 'Heading',
1670
+ type: 'text',
1671
+ },
1672
+ ],
1673
+ },
1674
+ ]);
1675
+ });
1676
+ it('should convert a paragraph element with custom class to the expected RTEContentBlock', () => {
1677
+ const sourceCode = '<p class="p-class1 p-class2">Hello</p>';
1678
+ const content = VegaRTEContent.fromHtml(sourceCode);
1679
+ expect(content.toJSON()).toEqual([
1680
+ {
1681
+ id: expect.anything(),
1682
+ type: 'paragraph',
1683
+ annotations: {
1684
+ textStyle: 'paragraph',
1685
+ customClass: ['p-class1', 'p-class2'],
1686
+ },
1687
+ nodes: [
1688
+ {
1689
+ id: expect.anything(),
1690
+ text: 'Hello',
1691
+ type: 'text',
1692
+ },
1693
+ ],
1694
+ },
1695
+ ]);
1696
+ });
1697
+ it('should convert a text code element with custom class to the expected RTEContentBlock', () => {
1698
+ const sourceCode = '<p class="p-class"><code class="code-class">Hello</code></p>';
1699
+ const content = VegaRTEContent.fromHtml(sourceCode);
1700
+ expect(content.toJSON()).toEqual([
1701
+ {
1702
+ id: expect.anything(),
1703
+ type: 'paragraph',
1704
+ annotations: {
1705
+ textStyle: 'paragraph',
1706
+ customClass: ['p-class'],
1707
+ },
1708
+ nodes: [
1709
+ {
1710
+ id: expect.anything(),
1711
+ text: 'Hello',
1712
+ type: 'text',
1713
+ annotations: {
1714
+ code: true,
1715
+ customClass: ['code-class'],
1716
+ },
1717
+ },
1718
+ ],
1719
+ },
1720
+ ]);
1721
+ });
1722
+ it('should convert a list element with custom class to the expected RTEContentBlock', () => {
1723
+ const sourceCode = '<ul class="ul-class"><li class="li1-class">Item 1</li><li class="li2-class">Item 2</li></ul>';
1724
+ const content = VegaRTEContent.fromHtml(sourceCode);
1725
+ expect(content.toJSON()).toEqual([
1726
+ {
1727
+ blocks: [
1728
+ {
1729
+ id: expect.anything(),
1730
+ type: 'list-item',
1731
+ annotations: {
1732
+ textStyle: 'paragraph',
1733
+ customClass: ['li1-class'],
1734
+ },
1735
+ nodes: [
1736
+ {
1737
+ id: expect.anything(),
1738
+ text: 'Item 1',
1739
+ type: 'text',
1740
+ },
1741
+ ],
1742
+ children: [],
1743
+ },
1744
+ {
1745
+ id: expect.anything(),
1746
+ type: 'list-item',
1747
+ annotations: {
1748
+ textStyle: 'paragraph',
1749
+ customClass: ['li2-class'],
1750
+ },
1751
+ nodes: [
1752
+ {
1753
+ id: expect.anything(),
1754
+ text: 'Item 2',
1755
+ type: 'text',
1756
+ },
1757
+ ],
1758
+ children: [],
1759
+ },
1760
+ ],
1761
+ id: expect.anything(),
1762
+ type: 'bullet-list',
1763
+ annotations: {
1764
+ customClass: ['ul-class'],
1765
+ },
1766
+ },
1767
+ ]);
1768
+ });
1769
+ it('should convert a heading element with custom attributes to the expected RTEContentBlock', () => {
1770
+ const sourceCode = '<h1 id="h1-element">Heading</h1>';
1771
+ const content = VegaRTEContent.fromHtml(sourceCode);
1772
+ expect(content.toJSON()).toEqual([
1773
+ {
1774
+ id: expect.anything(),
1775
+ type: 'heading-1',
1776
+ annotations: {
1777
+ textStyle: 'heading-1',
1778
+ customAttribute: {
1779
+ id: 'h1-element',
1780
+ },
1781
+ },
1782
+ nodes: [
1783
+ {
1784
+ id: expect.anything(),
1785
+ text: 'Heading',
1786
+ type: 'text',
1787
+ },
1788
+ ],
1789
+ },
1790
+ ]);
1791
+ });
1792
+ it('should convert a paragraph element with custom style to the expected RTEContentBlock', () => {
1793
+ const sourceCode = '<p style="text-align: center;">Hello</p>';
1794
+ const content = VegaRTEContent.fromHtml(sourceCode);
1795
+ expect(content.toJSON()).toEqual([
1796
+ {
1797
+ id: expect.anything(),
1798
+ type: 'paragraph',
1799
+ annotations: {
1800
+ textStyle: 'paragraph',
1801
+ textAlign: 'center',
1802
+ customStyle: {
1803
+ textAlign: 'center',
1804
+ },
1805
+ },
1806
+ nodes: [
1807
+ {
1808
+ id: expect.anything(),
1809
+ text: 'Hello',
1810
+ type: 'text',
1811
+ },
1812
+ ],
1813
+ },
1814
+ ]);
1815
+ });
1816
+ it('should convert a text code element with custom style to the expected RTEContentBlock', () => {
1817
+ const sourceCode = '<p style="text-align: center;"><code style="font-weight: 700;">Hello</code></p>';
1818
+ const content = VegaRTEContent.fromHtml(sourceCode);
1819
+ expect(content.toJSON()).toEqual([
1820
+ {
1821
+ id: expect.anything(),
1822
+ type: 'paragraph',
1823
+ annotations: {
1824
+ textStyle: 'paragraph',
1825
+ textAlign: 'center',
1826
+ customStyle: {
1827
+ textAlign: 'center',
1828
+ },
1829
+ },
1830
+ nodes: [
1831
+ {
1832
+ id: expect.anything(),
1833
+ text: 'Hello',
1834
+ type: 'text',
1835
+ annotations: {
1836
+ bold: true,
1837
+ code: true,
1838
+ customStyle: {
1839
+ fontWeight: '700',
1840
+ },
1841
+ },
1842
+ },
1843
+ ],
1844
+ },
1845
+ ]);
1846
+ });
1847
+ it('should convert a list element with custom style to the expected RTEContentBlock', () => {
1848
+ const sourceCode = '<ul style="padding: 20px;"><li style="text-align: center;">Item 1</li><li style="padding: 20px;">Item 2</li></ul>';
1849
+ const content = VegaRTEContent.fromHtml(sourceCode);
1850
+ expect(content.toJSON()).toEqual([
1851
+ {
1852
+ blocks: [
1853
+ {
1854
+ id: expect.anything(),
1855
+ type: 'list-item',
1856
+ annotations: {
1857
+ textStyle: 'paragraph',
1858
+ textAlign: 'center',
1859
+ customStyle: {
1860
+ textAlign: 'center',
1861
+ },
1862
+ },
1863
+ nodes: [
1864
+ {
1865
+ id: expect.anything(),
1866
+ text: 'Item 1',
1867
+ type: 'text',
1868
+ },
1869
+ ],
1870
+ children: [],
1871
+ },
1872
+ {
1873
+ id: expect.anything(),
1874
+ type: 'list-item',
1875
+ annotations: {
1876
+ textStyle: 'paragraph',
1877
+ customStyle: {
1878
+ padding: '20px',
1879
+ },
1880
+ },
1881
+ nodes: [
1882
+ {
1883
+ id: expect.anything(),
1884
+ text: 'Item 2',
1885
+ type: 'text',
1886
+ },
1887
+ ],
1888
+ children: [],
1889
+ },
1890
+ ],
1891
+ id: expect.anything(),
1892
+ type: 'bullet-list',
1893
+ annotations: {
1894
+ customStyle: {
1895
+ padding: '20px',
1896
+ },
1897
+ },
1898
+ },
1899
+ ]);
1900
+ });
1901
+ it('should convert the li elements into list block', () => {
1902
+ const sourceCode = '<li>Item 1</li><li>Item 2</li><li>Item 3</li>';
1903
+ const content = VegaRTEContent.fromHtml(sourceCode);
1904
+ expect(content.toHtml()).toMatchSnapshot();
1905
+ expect(content.toJSON()).toEqual([
1906
+ {
1907
+ id: expect.anything(),
1908
+ type: 'bullet-list',
1909
+ blocks: [
1910
+ {
1911
+ id: expect.anything(),
1912
+ type: 'list-item',
1913
+ annotations: { textStyle: 'paragraph' },
1914
+ nodes: [{ id: expect.anything(), type: 'text', text: 'Item 1' }],
1915
+ },
1916
+ {
1917
+ id: expect.anything(),
1918
+ type: 'list-item',
1919
+ annotations: { textStyle: 'paragraph' },
1920
+ nodes: [{ id: expect.anything(), type: 'text', text: 'Item 2' }],
1921
+ },
1922
+ {
1923
+ id: expect.anything(),
1924
+ type: 'list-item',
1925
+ annotations: { textStyle: 'paragraph' },
1926
+ nodes: [{ id: expect.anything(), type: 'text', text: 'Item 3' }],
1927
+ },
1928
+ ],
1929
+ },
1930
+ ]);
1931
+ });
1932
+ });
1933
+ describe('fromHtml with autoMatchFormat false', () => {
1934
+ it('should not match bold style', () => {
1935
+ const sourceCode = '<p style="font-weight: 700;">Hello</p>';
1936
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
1937
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<p style="font-weight: 700;">Hello</p>`);
1938
+ expect(content.toJSON()).toEqual([
1939
+ {
1940
+ id: expect.anything(),
1941
+ type: 'paragraph',
1942
+ annotations: {
1943
+ customStyle: {
1944
+ fontWeight: '700',
1945
+ },
1946
+ },
1947
+ nodes: [
1948
+ {
1949
+ id: expect.anything(),
1950
+ text: 'Hello',
1951
+ type: 'text',
1952
+ annotations: { plainText: true },
1953
+ },
1954
+ ],
1955
+ },
1956
+ ]);
1957
+ });
1958
+ it('should not match color style', () => {
1959
+ const sourceCode = '<p style="color: red">Hello</p>';
1960
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
1961
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<p style="color: red;">Hello</p>`);
1962
+ expect(content.toJSON()).toEqual([
1963
+ {
1964
+ id: expect.anything(),
1965
+ type: 'paragraph',
1966
+ annotations: {
1967
+ customStyle: {
1968
+ color: 'red',
1969
+ },
1970
+ },
1971
+ nodes: [
1972
+ {
1973
+ id: expect.anything(),
1974
+ text: 'Hello',
1975
+ type: 'text',
1976
+ annotations: { plainText: true },
1977
+ },
1978
+ ],
1979
+ },
1980
+ ]);
1981
+ });
1982
+ it('should not match link style', () => {
1983
+ const sourceCode = `<p><a href="https://example.com">Link</a></p>`;
1984
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
1985
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<p><a href="https://example.com">Link</a></p>`);
1986
+ expect(content.toJSON()).toEqual([
1987
+ {
1988
+ id: expect.anything(),
1989
+ type: 'paragraph',
1990
+ nodes: [
1991
+ {
1992
+ id: expect.anything(),
1993
+ type: 'text',
1994
+ text: 'Link',
1995
+ annotations: {
1996
+ plainText: true,
1997
+ link: {
1998
+ customAttribute: {
1999
+ href: 'https://example.com',
2000
+ },
2001
+ groupKey: expect.anything(),
2002
+ href: 'https://example.com',
2003
+ },
2004
+ },
2005
+ },
2006
+ ],
2007
+ },
2008
+ ]);
2009
+ });
2010
+ it('should not match heading', () => {
2011
+ const sourceCode = '<h1><span>Hello</span></h1>';
2012
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2013
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<h1><span>Hello</span></h1>`);
2014
+ expect(content.toJSON()).toEqual([
2015
+ {
2016
+ id: expect.anything(),
2017
+ nodes: [{ id: expect.anything(), text: 'Hello', type: 'text' }],
2018
+ type: 'heading-1',
2019
+ },
2020
+ ]);
2021
+ });
2022
+ it('should not match image style', () => {
2023
+ const sourceCode = '<img src="https://example.com/image.jpg">';
2024
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2025
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<img src="https://example.com/image.jpg">`);
2026
+ expect(content.toJSON()).toEqual([
2027
+ {
2028
+ id: expect.anything(),
2029
+ type: 'image',
2030
+ annotations: { internalWrapper: true },
2031
+ nodes: [
2032
+ {
2033
+ annotations: {
2034
+ customAttribute: { src: 'https://example.com/image.jpg' },
2035
+ size: undefined,
2036
+ },
2037
+ id: expect.anything(),
2038
+ type: 'image',
2039
+ url: 'https://example.com/image.jpg',
2040
+ },
2041
+ ],
2042
+ },
2043
+ ]);
2044
+ });
2045
+ it('should not match list style', () => {
2046
+ const sourceCode = '<ul><li>Item 1</li><li>Item 2</li></ul>';
2047
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2048
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<ul><li>Item 1</li><li>Item 2</li></ul>`);
2049
+ expect(content.toJSON()).toEqual([
2050
+ {
2051
+ id: expect.anything(),
2052
+ type: 'bullet-list',
2053
+ blocks: [
2054
+ {
2055
+ id: expect.anything(),
2056
+ type: 'list-item',
2057
+ children: [],
2058
+ nodes: [
2059
+ {
2060
+ id: expect.anything(),
2061
+ text: 'Item 1',
2062
+ type: 'text',
2063
+ annotations: { plainText: true },
2064
+ },
2065
+ ],
2066
+ },
2067
+ {
2068
+ id: expect.anything(),
2069
+ type: 'list-item',
2070
+ children: [],
2071
+ nodes: [
2072
+ {
2073
+ id: expect.anything(),
2074
+ text: 'Item 2',
2075
+ type: 'text',
2076
+ annotations: { plainText: true },
2077
+ },
2078
+ ],
2079
+ },
2080
+ ],
2081
+ },
2082
+ ]);
2083
+ });
2084
+ it('should not match div to internal style', () => {
2085
+ const sourceCode = "<div class='my-class'><span> I want this be a sentence </span><span class='my-another-class'> I want this be another sentence </span></div>";
2086
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2087
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<div class="my-class"><span> I want this be a sentence </span><span class="my-another-class"> I want this be another sentence </span></div>`);
2088
+ expect(content.toJSON()).toEqual([
2089
+ {
2090
+ id: expect.anything(),
2091
+ type: 'html-block',
2092
+ htmlTag: 'div',
2093
+ annotations: { customClass: ['my-class'] },
2094
+ children: [
2095
+ {
2096
+ id: expect.anything(),
2097
+ type: 'paragraph',
2098
+ annotations: { internalWrapper: true },
2099
+ nodes: [
2100
+ { id: expect.anything(), text: ' I want this be a sentence ', type: 'text' },
2101
+ {
2102
+ id: expect.anything(),
2103
+ type: 'text',
2104
+ annotations: { customClass: ['my-another-class'] },
2105
+ text: ' I want this be another sentence ',
2106
+ },
2107
+ ],
2108
+ },
2109
+ ],
2110
+ },
2111
+ ]);
2112
+ });
2113
+ it('should not match parent style', () => {
2114
+ const sourceCode = `<p style="font-weight: bold;font-style: italic;text-decoration: line-through;color: pink;text-shadow: 2px 2px 5px gray;font-size: 24px;">mix</p>`;
2115
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2116
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<p style="font-weight: bold;font-style: italic;text-decoration: line-through;color: pink;text-shadow: 2px 2px 5px gray;font-size: 24px;">mix</p>`);
2117
+ });
2118
+ it('should not match parent link style', () => {
2119
+ const sourceCode = `<a id="readMoreLink" class="link read-more" href="https://example.com" style="color: #2980b9; text-decoration: underline;">Read more</a>`;
2120
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2121
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<a id="readMoreLink" href="https://example.com" class="link read-more" style="color: #2980b9; text-decoration: underline;">Read more</a>`);
2122
+ });
2123
+ it('should not match code style', () => {
2124
+ const sourceCode = `<p>This is <code>code text</code>.</p>`;
2125
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2126
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2127
+ expect(content.toJSON()).toEqual([
2128
+ {
2129
+ id: expect.anything(),
2130
+ type: 'paragraph',
2131
+ nodes: [
2132
+ {
2133
+ id: expect.anything(),
2134
+ annotations: { plainText: true },
2135
+ text: 'This is ',
2136
+ type: 'text',
2137
+ },
2138
+ {
2139
+ id: expect.anything(),
2140
+ type: 'text',
2141
+ text: 'code text',
2142
+ annotations: { code: true },
2143
+ },
2144
+ { id: expect.anything(), type: 'text', annotations: { plainText: true }, text: '.' },
2145
+ ],
2146
+ },
2147
+ ]);
2148
+ });
2149
+ it('should preserve plain text nodes correctly', () => {
2150
+ const sourceCode = `<p>Plain text <span>with span</span> and <strong>bold</strong> text.</p>`;
2151
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2152
+ const htmlOutput = content.toHtml({ autoMatchFormat: false });
2153
+ expect(htmlOutput).toEqual(sourceCode);
2154
+ const jsonData = content.toJSON();
2155
+ expect(jsonData).toEqual([
2156
+ {
2157
+ id: expect.anything(),
2158
+ type: 'paragraph',
2159
+ nodes: [
2160
+ {
2161
+ id: expect.anything(),
2162
+ text: 'Plain text ',
2163
+ type: 'text',
2164
+ annotations: { plainText: true },
2165
+ },
2166
+ { id: expect.anything(), text: 'with span', type: 'text' },
2167
+ {
2168
+ id: expect.anything(),
2169
+ text: ' and ',
2170
+ type: 'text',
2171
+ annotations: { plainText: true },
2172
+ },
2173
+ {
2174
+ id: expect.anything(),
2175
+ text: 'bold',
2176
+ type: 'text',
2177
+ annotations: {
2178
+ inlineHtml: {
2179
+ htmlTag: 'strong',
2180
+ },
2181
+ plainText: true,
2182
+ },
2183
+ },
2184
+ {
2185
+ id: expect.anything(),
2186
+ text: ' text.',
2187
+ type: 'text',
2188
+ annotations: { plainText: true },
2189
+ },
2190
+ ],
2191
+ },
2192
+ ]);
2193
+ expect(VegaRTEContent.fromJSON(jsonData, { autoMatchFormat: false }).toHtml({
2194
+ autoMatchFormat: false,
2195
+ })).toEqual(htmlOutput);
2196
+ });
2197
+ it('should convert the html block to RTEContentBlock', () => {
2198
+ const sourceCode = `
2199
+ <div class='custom-container'>
2200
+ <p class='custom-p'>
2201
+ <span>Google Chrome is a free, </span><span style='font-weight: 700;'>open-source</span><span> web browser developed by Google, released in 2008.</span>
2202
+ </p>
2203
+ </div>`;
2204
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2205
+ expect(content.toJSON()).toEqual([
2206
+ {
2207
+ id: expect.anything(),
2208
+ type: 'html-block',
2209
+ htmlTag: 'div',
2210
+ annotations: { customClass: ['custom-container'] },
2211
+ children: [
2212
+ {
2213
+ id: expect.anything(),
2214
+ type: 'paragraph',
2215
+ annotations: { customClass: ['custom-p'] },
2216
+ nodes: [
2217
+ { id: expect.anything(), type: 'text', text: 'Google Chrome is a free, ' },
2218
+ {
2219
+ id: expect.anything(),
2220
+ type: 'text',
2221
+ text: 'open-source',
2222
+ annotations: { bold: true, customStyle: { fontWeight: '700' } },
2223
+ },
2224
+ {
2225
+ id: expect.anything(),
2226
+ type: 'text',
2227
+ text: ' web browser developed by Google, released in 2008.',
2228
+ },
2229
+ ],
2230
+ },
2231
+ ],
2232
+ },
2233
+ ]);
2234
+ });
2235
+ it('should convert the html block with RTE node as expect', () => {
2236
+ const sourceCode = `<section>111<span> 222 </span>333</section>`;
2237
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2238
+ expect(content.toJSON()).toEqual([
2239
+ {
2240
+ id: expect.anything(),
2241
+ type: 'html-block',
2242
+ htmlTag: 'section',
2243
+ children: [
2244
+ {
2245
+ id: expect.anything(),
2246
+ type: 'paragraph',
2247
+ annotations: { internalWrapper: true },
2248
+ nodes: [
2249
+ {
2250
+ id: expect.anything(),
2251
+ type: 'text',
2252
+ annotations: { plainText: true },
2253
+ text: '111',
2254
+ },
2255
+ { id: expect.anything(), type: 'text', text: ' 222 ' },
2256
+ {
2257
+ id: expect.anything(),
2258
+ type: 'text',
2259
+ annotations: { plainText: true },
2260
+ text: '333',
2261
+ },
2262
+ ],
2263
+ },
2264
+ ],
2265
+ },
2266
+ ]);
2267
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2268
+ });
2269
+ it('should convert the html block with an internal block wrapper to include the text nodes', () => {
2270
+ const sourceCode = `<section>111<span> 222 </span>333</section>`;
2271
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2272
+ expect(content.toJSON()).toEqual([
2273
+ {
2274
+ id: expect.anything(),
2275
+ type: 'html-block',
2276
+ htmlTag: 'section',
2277
+ children: [
2278
+ {
2279
+ id: expect.anything(),
2280
+ type: 'paragraph',
2281
+ annotations: { internalWrapper: true },
2282
+ nodes: [
2283
+ {
2284
+ id: expect.anything(),
2285
+ type: 'text',
2286
+ annotations: { plainText: true },
2287
+ text: '111',
2288
+ },
2289
+ { id: expect.anything(), type: 'text', text: ' 222 ' },
2290
+ {
2291
+ id: expect.anything(),
2292
+ type: 'text',
2293
+ annotations: { plainText: true },
2294
+ text: '333',
2295
+ },
2296
+ ],
2297
+ },
2298
+ ],
2299
+ },
2300
+ ]);
2301
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2302
+ });
2303
+ it('should convert the img element with an internal block wrapper', () => {
2304
+ const sourceCode = `<section><img src="mocked-url"></section><div><img src="mocked-url-2"></div><img src="mocked-url-3">`;
2305
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2306
+ expect(content.toJSON()).toEqual([
2307
+ {
2308
+ id: expect.anything(),
2309
+ type: 'html-block',
2310
+ htmlTag: 'section',
2311
+ children: [
2312
+ {
2313
+ id: expect.anything(),
2314
+ type: 'image',
2315
+ annotations: { internalWrapper: true },
2316
+ nodes: [
2317
+ {
2318
+ id: expect.anything(),
2319
+ type: 'image',
2320
+ url: 'mocked-url',
2321
+ annotations: { customAttribute: { src: 'mocked-url' }, size: undefined },
2322
+ },
2323
+ ],
2324
+ },
2325
+ ],
2326
+ },
2327
+ {
2328
+ id: expect.anything(),
2329
+ type: 'image',
2330
+ nodes: [
2331
+ {
2332
+ id: expect.anything(),
2333
+ type: 'image',
2334
+ url: 'mocked-url-2',
2335
+ annotations: { customAttribute: { src: 'mocked-url-2' }, size: undefined },
2336
+ },
2337
+ ],
2338
+ },
2339
+ {
2340
+ id: expect.anything(),
2341
+ type: 'image',
2342
+ annotations: { internalWrapper: true },
2343
+ nodes: [
2344
+ {
2345
+ id: expect.anything(),
2346
+ type: 'image',
2347
+ url: 'mocked-url-3',
2348
+ annotations: { customAttribute: { src: 'mocked-url-3' }, size: undefined },
2349
+ },
2350
+ ],
2351
+ },
2352
+ ]);
2353
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2354
+ });
2355
+ it('should show the internal block wrapper if the block has annotations', () => {
2356
+ const data = [
2357
+ {
2358
+ id: expect.anything(),
2359
+ type: 'html-block',
2360
+ htmlTag: 'section',
2361
+ children: [
2362
+ {
2363
+ id: expect.anything(),
2364
+ type: 'paragraph',
2365
+ annotations: { internalWrapper: true },
2366
+ nodes: [
2367
+ {
2368
+ id: expect.anything(),
2369
+ type: 'text',
2370
+ annotations: {
2371
+ plainText: true,
2372
+ link: { href: 'https://example.com', groupKey: 'link-group-1' },
2373
+ },
2374
+ text: 'link',
2375
+ },
2376
+ ],
2377
+ },
2378
+ ],
2379
+ },
2380
+ ];
2381
+ expect(VegaRTEContent.fromJSON(data, { autoMatchFormat: false }).toHtml({ autoMatchFormat: false })).toEqual(`<section><a href="https://example.com" target="_blank">link</a></section>`);
2382
+ data[0].children[0].annotations = { textAlign: 'center' };
2383
+ expect(VegaRTEContent.fromJSON(data, { autoMatchFormat: false }).toHtml({ autoMatchFormat: false })).toEqual(`<section><p style="text-align: center;"><a href="https://example.com" target="_blank">link</a></p></section>`);
2384
+ });
2385
+ it('should covert nested html block as expect', () => {
2386
+ const sourceCode = `<section><nav>React<span> Vue </span>Angular</nav></section>`;
2387
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2388
+ expect(content.toJSON()).toEqual([
2389
+ {
2390
+ id: expect.anything(),
2391
+ type: 'html-block',
2392
+ htmlTag: 'section',
2393
+ children: [
2394
+ {
2395
+ id: expect.anything(),
2396
+ type: 'html-block',
2397
+ htmlTag: 'nav',
2398
+ children: [
2399
+ {
2400
+ id: expect.anything(),
2401
+ type: 'paragraph',
2402
+ annotations: { internalWrapper: true },
2403
+ nodes: [
2404
+ {
2405
+ id: expect.anything(),
2406
+ type: 'text',
2407
+ annotations: { plainText: true },
2408
+ text: 'React',
2409
+ },
2410
+ { id: expect.anything(), type: 'text', text: ' Vue ' },
2411
+ {
2412
+ id: expect.anything(),
2413
+ type: 'text',
2414
+ annotations: { plainText: true },
2415
+ text: 'Angular',
2416
+ },
2417
+ ],
2418
+ },
2419
+ ],
2420
+ },
2421
+ ],
2422
+ },
2423
+ ]);
2424
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2425
+ });
2426
+ it('should not covert the unsupported html', () => {
2427
+ const sourceCode = `<section><abc>test </abc>123</section>`;
2428
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2429
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<section>test 123</section>`);
2430
+ });
2431
+ it('should convert as expect if it is internal element', () => {
2432
+ const sourceCode = `<h1>123</h1>`;
2433
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2434
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<h1>123</h1>`);
2435
+ expect(content.toJSON()).toEqual([
2436
+ {
2437
+ id: expect.anything(),
2438
+ type: 'heading-1',
2439
+ nodes: [
2440
+ {
2441
+ id: expect.anything(),
2442
+ text: '123',
2443
+ type: 'text',
2444
+ annotations: { plainText: true },
2445
+ },
2446
+ ],
2447
+ },
2448
+ ]);
2449
+ });
2450
+ it('should convert nested inline html node as expect', () => {
2451
+ const sourceCode = `<p><b><u><s>111</s></u></b></p>`;
2452
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2453
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2454
+ expect(content.toJSON()).toEqual([
2455
+ {
2456
+ id: expect.anything(),
2457
+ type: 'paragraph',
2458
+ nodes: [
2459
+ {
2460
+ id: expect.anything(),
2461
+ type: 'text',
2462
+ text: '111',
2463
+ annotations: {
2464
+ plainText: true,
2465
+ inlineHtml: {
2466
+ htmlTag: 'b',
2467
+ child: {
2468
+ htmlTag: 'u',
2469
+ child: {
2470
+ htmlTag: 's',
2471
+ },
2472
+ },
2473
+ },
2474
+ },
2475
+ },
2476
+ ],
2477
+ },
2478
+ ]);
2479
+ });
2480
+ it('should convert the inline html node with custom attrs', () => {
2481
+ const sourceCode = `<p><b id="b-element" class="my-class-1 my-class-2" style="color: red; background: yellow;">text</b></p>`;
2482
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2483
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2484
+ expect(content.toJSON()).toEqual([
2485
+ {
2486
+ id: expect.anything(),
2487
+ type: 'paragraph',
2488
+ nodes: [
2489
+ {
2490
+ id: expect.anything(),
2491
+ type: 'text',
2492
+ text: 'text',
2493
+ annotations: {
2494
+ plainText: true,
2495
+ inlineHtml: {
2496
+ htmlTag: 'b',
2497
+ customAttribute: { id: 'b-element' },
2498
+ customClass: ['my-class-1', 'my-class-2'],
2499
+ customStyle: { background: 'yellow', color: 'red' },
2500
+ },
2501
+ },
2502
+ },
2503
+ ],
2504
+ },
2505
+ ]);
2506
+ });
2507
+ it('should convert the inline html node with text node as expect', () => {
2508
+ const sourceCode = `<p>Do not forget to buy <mark>milk</mark> today.</p>`;
2509
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2510
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2511
+ expect(content.toJSON()).toEqual([
2512
+ {
2513
+ id: expect.anything(),
2514
+ type: 'paragraph',
2515
+ nodes: [
2516
+ {
2517
+ id: expect.anything(),
2518
+ type: 'text',
2519
+ annotations: { plainText: true },
2520
+ text: 'Do not forget to buy ',
2521
+ },
2522
+ {
2523
+ id: expect.anything(),
2524
+ type: 'text',
2525
+ text: 'milk',
2526
+ annotations: { inlineHtml: { htmlTag: 'mark' }, plainText: true },
2527
+ },
2528
+ {
2529
+ id: expect.anything(),
2530
+ annotations: { plainText: true },
2531
+ type: 'text',
2532
+ text: ' today.',
2533
+ },
2534
+ ],
2535
+ },
2536
+ ]);
2537
+ });
2538
+ it('should convert the span as inline html when it includes not text node', () => {
2539
+ const sourceCode = `<p>This is a <span style="color: red;"><b>red</b></span> word.</p>`;
2540
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2541
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2542
+ expect(content.toJSON()).toEqual([
2543
+ {
2544
+ id: expect.anything(),
2545
+ type: 'paragraph',
2546
+ nodes: [
2547
+ {
2548
+ id: expect.anything(),
2549
+ type: 'text',
2550
+ text: 'This is a ',
2551
+ annotations: { plainText: true },
2552
+ },
2553
+ {
2554
+ id: expect.anything(),
2555
+ type: 'text',
2556
+ text: 'red',
2557
+ annotations: {
2558
+ plainText: true,
2559
+ inlineHtml: {
2560
+ child: { htmlTag: 'b' },
2561
+ customStyle: { color: 'red' },
2562
+ htmlTag: 'span',
2563
+ },
2564
+ },
2565
+ },
2566
+ {
2567
+ id: expect.anything(),
2568
+ type: 'text',
2569
+ annotations: { plainText: true },
2570
+ text: ' word.',
2571
+ },
2572
+ ],
2573
+ },
2574
+ ]);
2575
+ });
2576
+ it('should convert the supported block html as expected', () => {
2577
+ const sourceCode = `<header>
2578
+ <h1>HEADER Example</h1>
2579
+ </header>
2580
+ <nav>
2581
+ <ul>
2582
+ <li>NAV Item 1</li>
2583
+ <li>NAV Item 2</li>
2584
+ </ul>
2585
+ </nav>
2586
+ <main>
2587
+ <article>
2588
+ <header>
2589
+ <h2>ARTICLE Title (HX)</h2>
2590
+ </header>
2591
+ <section>
2592
+ <h3>SECTION Heading</h3>
2593
+ <p>This is inside a section.</p>
2594
+ </section>
2595
+ <aside>
2596
+ <p>This is an ASIDE.</p>
2597
+ </aside>
2598
+ <footer>
2599
+ <p>ARTICLE Footer</p>
2600
+ </footer>
2601
+ </article>
2602
+ <address>ADDRESS: 123 Main St, City, Country</address>
2603
+ <blockquote cite="https://example.com">BLOCKQUOTE: “This is a quoted text.”ote>
2604
+ <details>
2605
+ <summary>DETAILS / SUMMARY Example</summary>
2606
+ <p>Extra information shown when expanded.</p>
2607
+ </details>
2608
+ <dl>
2609
+ <dt>DT: Term</dt>
2610
+ <dd>DD: Description of the term.</dd>
2611
+ </dl>
2612
+ <form>
2613
+ <fieldset>
2614
+ <legend>LEGEND Example</legend>
2615
+ <label>
2616
+ INPUT: <input type="text" placeholder="Enter text">
2617
+ </label>
2618
+ <button type="submit">BUTTON Submit</button>
2619
+ </fieldset>
2620
+ </form>
2621
+ <pre>
2622
+ PRE Example:
2623
+ Line 1
2624
+ Line 2
2625
+ Line 3
2626
+ </pre>
2627
+ <hr>
2628
+ <figure>
2629
+ <img src="https://via.placeholder.com/150" alt="Placeholder image">
2630
+ <figcaption>FIGCAPTION Example</figcaption>
2631
+ </figure>
2632
+ <table border="1">
2633
+ <caption>CAPTION Example</caption>
2634
+ <colgroup>
2635
+ <col span="1" style="background: #eee;">
2636
+ <col span="1" style="background: #ddd;">
2637
+ </colgroup>
2638
+ <thead>
2639
+ <tr>
2640
+ <th>TH 1</th>
2641
+ <th>TH 2</th>
2642
+ </tr>
2643
+ </thead>
2644
+ <tbody>
2645
+ <tr>
2646
+ <td>TD A</td>
2647
+ <td>TD B</td>
2648
+ </tr>
2649
+ </tbody>
2650
+ <tfoot>
2651
+ <tr>
2652
+ <td colspan="2">TFOOT Example</td>
2653
+ </tr>
2654
+ </tfoot>
2655
+ </table>
2656
+ </main>
2657
+ <footer>
2658
+ <p>FOOTER Example</p>
2659
+ </footer>
2660
+ `;
2661
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2662
+ expect(CodeFormatter.format(content.toHtml({ autoMatchFormat: false }))).toMatchSnapshot();
2663
+ });
2664
+ it('should convert the supported inline html as expected', () => {
2665
+ const sourceCode = `<p>
2666
+ <abbr>Abbreviation</abbr>
2667
+ <audio src="audio.mp3"></audio>
2668
+ <b>Bold</b>
2669
+ <bdi>BDI</bdi>
2670
+ <bdo dir="rtl">BDO</bdo>
2671
+ <cite>Citation</cite>
2672
+ <del>Deleted</del>
2673
+ <dfn>Definition</dfn>
2674
+ <embed src="embed.mp4"></embed>
2675
+ <em>Emphasis</em>
2676
+ <i>Italic</i>
2677
+ <ins>Inserted</ins>
2678
+ <kbd>Keyboard</kbd>
2679
+ <mark>Marked</mark>
2680
+ <meter value="0.5">Meter</meter>
2681
+ <output>Output</output>
2682
+ <progress value="50" max="100">Progress</progress>
2683
+ <q>Quote</q>
2684
+ <s>Strikethrough</s>
2685
+ <small>Small</small>
2686
+ <span></span>
2687
+ <span>Span</span>
2688
+ <strong>Strong</strong>
2689
+ <sub>Subscript</sub>
2690
+ <sup>Superscript</sup>
2691
+ <time>Time</time>
2692
+ <u>Underline</u>
2693
+ <var>Variable</var>
2694
+ <video src="video.mp4"></video>
2695
+ </p>`;
2696
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2697
+ expect(content.toHtml({ autoMatchFormat: false })).toMatchSnapshot();
2698
+ });
2699
+ it('should convert the code as inline html', () => {
2700
+ const sourceCode = `<code>1111</code>
2701
+ <code>
2702
+ <b>222</b>
2703
+ </code>
2704
+ <b>
2705
+ <code>333</code>
2706
+ </b>`;
2707
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2708
+ expect(content.toHtml({ autoMatchFormat: false })).toMatchSnapshot();
2709
+ });
2710
+ it('should convert the link that allow plain text', () => {
2711
+ const sourceCode = `<p><a href="https://example.com">Example <b>link</b></a></p>`;
2712
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2713
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2714
+ expect(content.toJSON()).toEqual([
2715
+ {
2716
+ id: expect.anything(),
2717
+ nodes: [
2718
+ {
2719
+ annotations: {
2720
+ plainText: true,
2721
+ link: {
2722
+ customAttribute: { href: 'https://example.com' },
2723
+ groupKey: expect.anything(),
2724
+ href: 'https://example.com',
2725
+ },
2726
+ },
2727
+ id: expect.anything(),
2728
+ text: 'Example ',
2729
+ type: 'text',
2730
+ },
2731
+ {
2732
+ annotations: {
2733
+ plainText: true,
2734
+ inlineHtml: { htmlTag: 'b' },
2735
+ link: {
2736
+ customAttribute: { href: 'https://example.com' },
2737
+ groupKey: expect.anything(),
2738
+ href: 'https://example.com',
2739
+ },
2740
+ },
2741
+ id: expect.anything(),
2742
+ text: 'link',
2743
+ type: 'text',
2744
+ },
2745
+ ],
2746
+ type: 'paragraph',
2747
+ },
2748
+ ]);
2749
+ });
2750
+ // TODO: will be tracked in https://gethired.atlassian.net/browse/VD-7062
2751
+ it('should split the multiple nested inline html', () => {
2752
+ const sourceCode = `<p><b><s>111</s><u>222</u></b></p>`;
2753
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2754
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<p><b><s>111</s></b><b><u>222</u></b></p>`);
2755
+ });
2756
+ it('should convert li elements into a list block by default', () => {
2757
+ const sourceCode = '<li>Item 1</li><li>Item 2</li><li>Item 3</li>';
2758
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2759
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>`);
2760
+ });
2761
+ it('should convert all the ul children to list item', () => {
2762
+ const sourceCode = '<ul><li>Item 1</li>Item 2<li>Item 3</li></ul>';
2763
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2764
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>`);
2765
+ });
2766
+ it('should correctly handle both standalone li elements and li elements with ul/ol', () => {
2767
+ const sourceCode = `<li>111</li><li>222</li><li>333</li><ol>444</ol><p>555</p>`;
2768
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2769
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<ul><li>111</li><li>222</li><li>333</li></ul><ol><li>444</li></ol><p>555</p>`);
2770
+ });
2771
+ it('should handle non-contiguous li elements as separate lists', () => {
2772
+ const sourceCode = '<li>Item 1</li><p>Middle</p>Plain text<li>Item 2</li><li>Item 3</li>';
2773
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2774
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(`<ul><li>Item 1</li></ul><p>Middle</p>Plain text<ul><li>Item 2</li><li>Item 3</li></ul>`);
2775
+ });
2776
+ it('should not merge bold annotation with custom attr', () => {
2777
+ const sourceCode = '<span style="font-weight: bold;">bold text</span>';
2778
+ const content = VegaRTEContent.fromHtml(sourceCode, { autoMatchFormat: false });
2779
+ expect(content.toHtml({ autoMatchFormat: false })).toEqual(sourceCode);
2780
+ });
2781
+ it('should not remove blank space between elements', () => {
2782
+ const sourceCode = '<p><span>A</span><span> </span><span>paragraph</span></p>';
2783
+ const content = VegaRTEContent.fromHtml(sourceCode);
2784
+ const paragraph = content.children[0];
2785
+ expect(paragraph.children[1].text).toEqual(' ');
2786
+ });
2787
+ });
2788
+ describe('fromJSON', () => {
2789
+ it('should translate the paragraph as expect JSON', () => {
2790
+ const content = [
2791
+ {
2792
+ id: '1',
2793
+ type: 'paragraph',
2794
+ nodes: [{ id: '1-1', type: 'text', text: 'This is a paragraph' }],
2795
+ },
2796
+ ];
2797
+ expect(VegaRTEContent.fromJSON(content).toJSON()).toEqual([
2798
+ {
2799
+ id: '1',
2800
+ type: 'paragraph',
2801
+ annotations: { textStyle: 'paragraph' },
2802
+ nodes: [{ id: '1-1', text: 'This is a paragraph', type: 'text' }],
2803
+ },
2804
+ ]);
2805
+ expect(VegaRTEContent.fromJSON(content, { autoMatchFormat: true }).toJSON()).toEqual([
2806
+ {
2807
+ id: '1',
2808
+ type: 'paragraph',
2809
+ annotations: { textStyle: 'paragraph' },
2810
+ nodes: [{ id: '1-1', text: 'This is a paragraph', type: 'text' }],
2811
+ },
2812
+ ]);
2813
+ expect(VegaRTEContent.fromJSON(content, { autoMatchFormat: false }).toJSON()).toEqual([
2814
+ {
2815
+ id: '1',
2816
+ type: 'paragraph',
2817
+ nodes: [{ id: '1-1', text: 'This is a paragraph', type: 'text' }],
2818
+ },
2819
+ ]);
2820
+ });
2821
+ it('should translate the paragraph as expect html', () => {
2822
+ const content = [
2823
+ {
2824
+ id: '1',
2825
+ type: 'paragraph',
2826
+ nodes: [{ id: '1-1', type: 'text', text: 'This is a paragraph' }],
2827
+ },
2828
+ ];
2829
+ expect(VegaRTEContent.fromJSON(content).toHtml()).toEqual(`<p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>This is a paragraph</span></p>`);
2830
+ expect(VegaRTEContent.fromJSON(content).toHtml({ autoMatchFormat: false })).toEqual(`<p style="font-family: Inter;font-size: 16px;line-height: 22px;font-weight: 500;margin-top: 0px;margin-bottom: 0px;"><span>This is a paragraph</span></p>`);
2831
+ expect(VegaRTEContent.fromJSON(content, { autoMatchFormat: false }).toHtml()).toEqual(`<p><span>This is a paragraph</span></p>`);
2832
+ expect(VegaRTEContent.fromJSON(content, { autoMatchFormat: false }).toHtml({
2833
+ autoMatchFormat: false,
2834
+ })).toEqual(`<p><span>This is a paragraph</span></p>`);
2835
+ });
2836
+ it('should translate the html block as expect html', () => {
2837
+ const content = [
2838
+ {
2839
+ id: '1753954267610',
2840
+ type: 'html-block',
2841
+ htmlTag: 'section',
2842
+ children: [
2843
+ {
2844
+ id: '1753954266383',
2845
+ type: 'heading-1',
2846
+ nodes: [
2847
+ {
2848
+ id: '1753954273029',
2849
+ type: 'text',
2850
+ text: 'WWF',
2851
+ },
2852
+ ],
2853
+ },
2854
+ {
2855
+ id: '1753954263572',
2856
+ type: 'paragraph',
2857
+ nodes: [
2858
+ {
2859
+ id: '1753954266500',
2860
+ type: 'text',
2861
+ text: 'The World Wide Fund for Nature (WWF) is....',
2862
+ },
2863
+ ],
2864
+ },
2865
+ ],
2866
+ },
2867
+ {
2868
+ id: '1753954266216',
2869
+ type: 'html-block',
2870
+ htmlTag: 'article',
2871
+ children: [
2872
+ {
2873
+ id: '1753954270592',
2874
+ type: 'heading-1',
2875
+ nodes: [
2876
+ {
2877
+ id: '1753954272730',
2878
+ type: 'text',
2879
+ text: 'Google Chrome',
2880
+ },
2881
+ ],
2882
+ },
2883
+ {
2884
+ id: '1753954265150',
2885
+ type: 'paragraph',
2886
+ nodes: [
2887
+ {
2888
+ id: '1753954272365',
2889
+ type: 'text',
2890
+ text: 'Google Chrome is a free, open-source web browser developed by Google, released in 2008.',
2891
+ },
2892
+ ],
2893
+ },
2894
+ ],
2895
+ },
2896
+ ];
2897
+ expect(VegaRTEContent.fromJSON(content, { autoMatchFormat: false }).toHtml()).toMatchSnapshot();
2898
+ expect(VegaRTEContent.fromJSON(content).toHtml()).toMatchSnapshot();
2899
+ });
2900
+ });
288
2901
  });