@heartlandone/vega 2.49.1 → 2.50.0-RTE-preview

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (646) hide show
  1. package/dist/cjs/{app-globals-65622aeb.js → app-globals-8e811cac.js} +6 -6
  2. package/dist/cjs/{child-nodes-event-prevent-slimmer-cc193ee1.js → child-nodes-event-prevent-slimmer-26ecfb15.js} +1 -1
  3. package/dist/cjs/{content-state-6a48bcb5.js → code-block-4cd8bccd.js} +1166 -1131
  4. package/dist/cjs/content-state-6cb98931.js +2496 -0
  5. package/dist/cjs/{design-token-cba4222e.js → design-token-8b48cb59.js} +1 -1
  6. package/dist/cjs/{element-appender-slimmer-4a26ecb2.js → element-appender-slimmer-d6b975e6.js} +3 -3
  7. package/dist/cjs/{event-emit-slimmer-8247249c.js → event-emit-slimmer-ee7a8c06.js} +1 -1
  8. package/dist/cjs/{form-field-controller-slimmer-4b0af5bc.js → form-field-controller-slimmer-88cbb139.js} +4 -4
  9. package/dist/cjs/{image-annotation-action-9c2b9c8e.js → image-annotation-action-f36b1a72.js} +65 -35
  10. package/dist/cjs/{index-c4dec3aa.js → index-4dd54e6b.js} +1 -1
  11. package/dist/cjs/{index-09acd3c9.js → index-7700600c.js} +9 -0
  12. package/dist/cjs/index.cjs.js +17 -16
  13. package/dist/cjs/{internal-vega-event-manager-c9948b59.js → internal-vega-event-manager-58afcde7.js} +1 -0
  14. package/dist/cjs/loader.cjs.js +11 -9
  15. package/dist/cjs/{public-rules-10ec636d.js → public-rules-555271e0.js} +8 -6
  16. package/dist/cjs/{responsive-format-facade-263d49f6.js → responsive-format-facade-8ce41c8a.js} +3 -3
  17. package/dist/cjs/{rich-text-editor-required-rule-5faded94.js → rich-text-editor-required-rule-d1b38bf7.js} +1 -1
  18. package/dist/cjs/selection-controller-828990cc.js +765 -0
  19. package/dist/cjs/string-39438062.js +24 -0
  20. package/dist/cjs/{string-input-formatter-slimmer-50322824.js → string-input-formatter-slimmer-9e7d7ce2.js} +2 -2
  21. package/dist/cjs/{style-formatter-ae0ef7fc.js → style-formatter-2294d77f.js} +1 -1
  22. package/dist/cjs/{sub-state-notify-slimmer-7f437b19.js → sub-state-notify-slimmer-f3ee01b7.js} +1 -1
  23. package/dist/cjs/{sub-state-observer-slimmer-e90362cd.js → sub-state-observer-slimmer-e1a00b74.js} +1 -1
  24. package/dist/cjs/{translation-212b1875.js → translation-e5003a00.js} +5 -0
  25. package/dist/cjs/{translation-slimmer-d1512c6d.js → translation-slimmer-127a0f83.js} +1 -1
  26. package/dist/cjs/vega-accordion.cjs.entry.js +11 -9
  27. package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
  28. package/dist/cjs/vega-app-header-button.cjs.entry.js +12 -10
  29. package/dist/cjs/vega-backdrop.cjs.entry.js +1 -1
  30. package/dist/cjs/vega-banner.cjs.entry.js +3 -3
  31. package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
  32. package/dist/cjs/vega-box.cjs.entry.js +11 -9
  33. package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -1
  34. package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
  35. package/dist/cjs/vega-button-circle.cjs.entry.js +12 -10
  36. package/dist/cjs/vega-button-group_2.cjs.entry.js +7 -7
  37. package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
  38. package/dist/cjs/vega-button.cjs.entry.js +11 -9
  39. package/dist/cjs/vega-calendar_3.cjs.entry.js +9 -9
  40. package/dist/cjs/vega-card.cjs.entry.js +10 -8
  41. package/dist/cjs/vega-carousel.cjs.entry.js +10 -8
  42. package/dist/cjs/vega-checkbox_2.cjs.entry.js +9 -9
  43. package/dist/cjs/vega-chip.cjs.entry.js +12 -10
  44. package/dist/cjs/vega-code-block.cjs.entry.js +4073 -0
  45. package/dist/cjs/vega-color-picker.cjs.entry.js +8 -8
  46. package/dist/cjs/vega-combo-box.cjs.entry.js +9 -9
  47. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  48. package/dist/cjs/vega-date-picker_2.cjs.entry.js +17 -16
  49. package/dist/cjs/vega-dialog_2.cjs.entry.js +12 -10
  50. package/dist/cjs/vega-divider.cjs.entry.js +10 -8
  51. package/dist/cjs/vega-dropdown_5.cjs.entry.js +15 -13
  52. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  53. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  54. package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
  55. package/dist/cjs/vega-file-uploader.cjs.entry.js +9 -9
  56. package/dist/cjs/vega-flag-icon.cjs.entry.js +10 -8
  57. package/dist/cjs/vega-flex.cjs.entry.js +11 -9
  58. package/dist/cjs/vega-font.cjs.entry.js +10 -8
  59. package/dist/cjs/vega-form.cjs.entry.js +10 -10
  60. package/dist/cjs/vega-grid.cjs.entry.js +10 -8
  61. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  62. package/dist/cjs/vega-icon.cjs.entry.js +10 -8
  63. package/dist/cjs/vega-image-uploader.cjs.entry.js +14 -13
  64. package/dist/cjs/vega-input-credit-card.cjs.entry.js +9 -9
  65. package/dist/cjs/vega-input-numeric.cjs.entry.js +10 -10
  66. package/dist/cjs/vega-input-phone-number.cjs.entry.js +12 -11
  67. package/dist/cjs/vega-input-range.cjs.entry.js +10 -10
  68. package/dist/cjs/vega-input-select.cjs.entry.js +19 -18
  69. package/dist/cjs/vega-input.cjs.entry.js +10 -10
  70. package/dist/cjs/{vega-internal-event-id-bfea9b93.js → vega-internal-event-id-62371952.js} +2 -0
  71. package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
  72. package/dist/cjs/vega-left-nav_5.cjs.entry.js +13 -11
  73. package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
  74. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +9 -7
  75. package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
  76. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +4 -4
  77. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +4 -4
  78. package/dist/cjs/vega-pagination.cjs.entry.js +12 -10
  79. package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
  80. package/dist/cjs/vega-popover_2.cjs.entry.js +11 -9
  81. package/dist/cjs/vega-progress-tracker.cjs.entry.js +3 -3
  82. package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
  83. package/dist/cjs/vega-rich-text-content.cjs.entry.js +311 -137
  84. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +1225 -2502
  85. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  86. package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
  87. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +14 -13
  88. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +10 -10
  89. package/dist/cjs/vega-sidenav_3.cjs.entry.js +12 -10
  90. package/dist/cjs/vega-signature-capture.cjs.entry.js +14 -13
  91. package/dist/cjs/{vega-skeleton-loader-controller-db868c98.js → vega-skeleton-loader-controller-83e05b6c.js} +1 -1
  92. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  93. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  94. package/dist/cjs/vega-stepper.cjs.entry.js +9 -9
  95. package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
  96. package/dist/cjs/vega-table_8.cjs.entry.js +14 -12
  97. package/dist/cjs/vega-text.cjs.entry.js +1 -1
  98. package/dist/cjs/vega-textarea.cjs.entry.js +9 -9
  99. package/dist/cjs/vega-time-picker_2.cjs.entry.js +15 -14
  100. package/dist/cjs/vega-toggle-switch.cjs.entry.js +8 -8
  101. package/dist/cjs/vega-tooltip_2.cjs.entry.js +10 -8
  102. package/dist/cjs/vega.cjs.js +11 -9
  103. package/dist/collection/collection-manifest.json +7 -1
  104. package/dist/collection/components/vega-code-block/assets/copy.js +3 -0
  105. package/dist/collection/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.js +62 -0
  106. package/dist/collection/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.js +48 -0
  107. package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +99 -0
  108. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-content-parse-controller.js +50 -0
  109. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-focus-controller.js +57 -0
  110. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.js +255 -0
  111. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.js +266 -0
  112. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.js +44 -0
  113. package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-content-renderer.js +123 -0
  114. package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +67 -0
  115. package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-renderer.js +122 -0
  116. package/dist/collection/components/vega-code-block/types.js +10 -0
  117. package/dist/collection/components/vega-code-block/vega-code-block.css +158 -0
  118. package/dist/collection/components/vega-code-block/vega-code-block.js +399 -0
  119. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +5 -5
  120. package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +2 -0
  121. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +60 -5
  122. package/dist/collection/components/vega-rich-text-editor/assets/file-code.js +3 -0
  123. package/dist/collection/components/vega-rich-text-editor/assets/rectangle-code.js +3 -0
  124. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +24 -0
  125. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy.js +15 -0
  126. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy.js +15 -0
  127. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy.js +1 -0
  128. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy.js +13 -0
  129. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy.js +14 -0
  130. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.js +3 -1
  131. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.js +1 -1
  132. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.js +48 -0
  133. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.js +17 -0
  134. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +77 -0
  135. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.js +38 -0
  136. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-code-block-strategy.js +14 -0
  137. package/dist/collection/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.js +20 -0
  138. package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +4 -0
  139. package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-code-block-action.js +13 -0
  140. package/dist/collection/components/vega-rich-text-editor/dto/actions/switch-out-from-code-block-action.js +15 -0
  141. package/dist/collection/components/vega-rich-text-editor/dto/actions/transform-to-code-block-action.js +13 -0
  142. package/dist/collection/components/vega-rich-text-editor/dto/actions/update-code-block-action.js +15 -0
  143. package/dist/collection/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.js +1 -0
  144. package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +13 -5
  145. package/dist/collection/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.js +2 -0
  146. package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +14 -9
  147. package/dist/collection/components/vega-rich-text-editor/dto/annotations/common-annotation.abstract.js +12 -0
  148. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.js +65 -0
  149. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-class-annotation.js +54 -0
  150. package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-style-annotation.js +57 -0
  151. package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +26 -10
  152. package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +16 -7
  153. package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +8 -2
  154. package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +13 -5
  155. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +12 -9
  156. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +89 -0
  157. package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +41 -0
  158. package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +9 -9
  159. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +3 -7
  160. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +74 -12
  161. package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +9 -9
  162. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +69 -2
  163. package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +106 -0
  164. package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +15 -1
  165. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +50 -0
  166. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +12 -1
  167. package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +66 -2
  168. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +29 -0
  169. package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +56 -0
  170. package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +26 -9
  171. package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +81 -0
  172. package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +15 -2
  173. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.js +5 -22
  174. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +9 -93
  175. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +62 -0
  176. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +1 -1
  177. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +121 -0
  178. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +1 -1
  179. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +1 -1
  180. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +2 -23
  181. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.js +81 -0
  182. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +47 -7
  183. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.js +0 -27
  184. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +3 -2
  185. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +19 -4
  186. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +155 -15
  187. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +2 -1
  188. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +6 -1
  189. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-rte-image-block-strategy.abstract.js +38 -0
  190. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.js +3 -20
  191. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.js +59 -5
  192. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.js +54 -0
  193. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +1 -1
  194. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +3 -2
  195. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.js +3 -20
  196. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-not-li-child-to-rte-list-item-block.js +7 -3
  197. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +3 -2
  198. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.js +69 -0
  199. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +4 -7
  200. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +7 -5
  201. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +7 -5
  202. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +25 -10
  203. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.js +64 -0
  204. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +59 -53
  205. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +21 -8
  206. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +10 -0
  207. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +5 -3
  208. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +5 -3
  209. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.js +5 -3
  210. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.js +5 -3
  211. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +5 -3
  212. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +65 -0
  213. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +5 -3
  214. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.js +2 -2
  215. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +8 -2
  216. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.js +2 -2
  217. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.js +2 -2
  218. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.js +2 -2
  219. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +2 -2
  220. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +5 -3
  221. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +3 -3
  222. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +2 -2
  223. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +3 -3
  224. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +60 -0
  225. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +5 -3
  226. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +5 -3
  227. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +6 -4
  228. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +3 -2
  229. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +5 -3
  230. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.js +28 -0
  231. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +31 -3
  232. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.js +21 -0
  233. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.js +2 -0
  234. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.js +3 -0
  235. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.js +23 -1
  236. package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +247 -27
  237. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/code-block.test.js +54 -0
  238. package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +1793 -0
  239. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +12 -0
  240. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +41 -4
  241. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.js +32 -0
  242. package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.js +61 -0
  243. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +7 -0
  244. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +18 -1
  245. package/dist/collection/helpers/code-format/code-formatter.js +108 -0
  246. package/dist/collection/helpers/code-format/test/code-formatter.test.js +362 -0
  247. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -1
  248. package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
  249. package/dist/collection/helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract.js +47 -0
  250. package/dist/collection/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.js +46 -0
  251. package/dist/collection/helpers/translation/locales/en.js +5 -0
  252. package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +5 -0
  253. package/dist/collection/polyfill/shadow-selection/shadow-selection-polyfill.js +17 -15
  254. package/dist/collection/polyfill/shadow-selection/test/shadow-selection-polyfill.test.js +1 -0
  255. package/dist/collection/polyfill/test-polyfill/unit/methods.js +9 -0
  256. package/dist/collection/utils/string.js +10 -0
  257. package/dist/esm/{app-globals-1f8c30e9.js → app-globals-9058ac3b.js} +6 -6
  258. package/dist/esm/{child-nodes-event-prevent-slimmer-5d45361e.js → child-nodes-event-prevent-slimmer-1142fb79.js} +1 -1
  259. package/dist/esm/{content-state-dbc9f635.js → code-block-8b5bd928.js} +1141 -1122
  260. package/dist/esm/content-state-8c3f862b.js +2489 -0
  261. package/dist/esm/{design-token-0699f0ca.js → design-token-bd436e0d.js} +1 -1
  262. package/dist/esm/{dom-node-subject-factory-f77cf9cc.js → dom-node-subject-factory-eb6bba5d.js} +1 -1
  263. package/dist/esm/{dom-node-subject-observer-factory-715dccf9.js → dom-node-subject-observer-factory-6083d518.js} +1 -1
  264. package/dist/esm/{element-appender-slimmer-96cb54e2.js → element-appender-slimmer-baf5e249.js} +5 -5
  265. package/dist/esm/{event-emit-slimmer-b7d511f6.js → event-emit-slimmer-480d3b54.js} +3 -3
  266. package/dist/esm/{form-field-controller-slimmer-89a72ee7.js → form-field-controller-slimmer-bfb4034d.js} +6 -6
  267. package/dist/esm/{image-annotation-action-1aa938ab.js → image-annotation-action-a8b860ad.js} +57 -28
  268. package/dist/esm/{index-187f71d1.js → index-d0a47531.js} +9 -0
  269. package/dist/esm/{index-4aa167d6.js → index-db0ec3ee.js} +2 -2
  270. package/dist/esm/index.js +12 -11
  271. package/dist/esm/{internal-vega-event-manager-87dc436c.js → internal-vega-event-manager-56c6469a.js} +2 -1
  272. package/dist/esm/loader.js +12 -10
  273. package/dist/esm/polyfills/core-js.js +0 -0
  274. package/dist/esm/polyfills/dom.js +0 -0
  275. package/dist/esm/polyfills/es5-html-element.js +0 -0
  276. package/dist/esm/polyfills/index.js +0 -0
  277. package/dist/esm/polyfills/system.js +0 -0
  278. package/dist/esm/{public-rules-5cf6aa95.js → public-rules-90fbd41a.js} +8 -6
  279. package/dist/esm/{responsive-format-facade-42f3fcfa.js → responsive-format-facade-827de03a.js} +3 -3
  280. package/dist/esm/{rich-text-editor-required-rule-6a7cd3ee.js → rich-text-editor-required-rule-0d470d82.js} +1 -1
  281. package/dist/esm/selection-controller-dd4f4407.js +759 -0
  282. package/dist/esm/string-a953eafc.js +21 -0
  283. package/dist/esm/{string-input-formatter-slimmer-c61f82d6.js → string-input-formatter-slimmer-0d30b976.js} +3 -3
  284. package/dist/esm/{style-formatter-cb00c709.js → style-formatter-232842f5.js} +1 -1
  285. package/dist/esm/{sub-state-notify-slimmer-4e3cf09d.js → sub-state-notify-slimmer-04e06501.js} +2 -2
  286. package/dist/esm/{sub-state-observer-slimmer-be7a6ce3.js → sub-state-observer-slimmer-b4c2ddc3.js} +2 -2
  287. package/dist/esm/{translation-cf7f020a.js → translation-71e0711d.js} +5 -0
  288. package/dist/esm/{translation-slimmer-88966d5c.js → translation-slimmer-e6b130bf.js} +1 -1
  289. package/dist/esm/vega-accordion.entry.js +13 -11
  290. package/dist/esm/vega-app-footer.entry.js +1 -1
  291. package/dist/esm/vega-app-header-button.entry.js +14 -12
  292. package/dist/esm/vega-backdrop.entry.js +1 -1
  293. package/dist/esm/vega-banner.entry.js +5 -5
  294. package/dist/esm/vega-bar-chart.entry.js +1 -1
  295. package/dist/esm/vega-box.entry.js +12 -10
  296. package/dist/esm/vega-brand-logo.entry.js +1 -1
  297. package/dist/esm/vega-breadcrumb.entry.js +6 -6
  298. package/dist/esm/vega-button-circle.entry.js +14 -12
  299. package/dist/esm/vega-button-group_2.entry.js +9 -9
  300. package/dist/esm/vega-button-link.entry.js +6 -6
  301. package/dist/esm/vega-button.entry.js +13 -11
  302. package/dist/esm/vega-calendar_3.entry.js +11 -11
  303. package/dist/esm/vega-card.entry.js +11 -9
  304. package/dist/esm/vega-carousel.entry.js +12 -10
  305. package/dist/esm/vega-checkbox_2.entry.js +11 -11
  306. package/dist/esm/vega-chip.entry.js +14 -12
  307. package/dist/esm/vega-code-block.entry.js +4069 -0
  308. package/dist/esm/vega-color-picker.entry.js +10 -10
  309. package/dist/esm/vega-combo-box.entry.js +11 -11
  310. package/dist/esm/vega-counter-badge.entry.js +1 -1
  311. package/dist/esm/vega-date-picker_2.entry.js +19 -18
  312. package/dist/esm/vega-dialog_2.entry.js +14 -12
  313. package/dist/esm/vega-divider.entry.js +11 -9
  314. package/dist/esm/vega-dropdown_5.entry.js +17 -15
  315. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  316. package/dist/esm/vega-field-error.entry.js +1 -1
  317. package/dist/esm/vega-field-label.entry.js +5 -5
  318. package/dist/esm/vega-file-uploader.entry.js +11 -11
  319. package/dist/esm/vega-flag-icon.entry.js +11 -9
  320. package/dist/esm/vega-flex.entry.js +12 -10
  321. package/dist/esm/vega-font.entry.js +11 -9
  322. package/dist/esm/vega-form.entry.js +12 -12
  323. package/dist/esm/vega-grid.entry.js +11 -9
  324. package/dist/esm/vega-hint.entry.js +1 -1
  325. package/dist/esm/vega-icon.entry.js +11 -9
  326. package/dist/esm/vega-image-uploader.entry.js +16 -15
  327. package/dist/esm/vega-input-credit-card.entry.js +11 -11
  328. package/dist/esm/vega-input-numeric.entry.js +12 -12
  329. package/dist/esm/vega-input-phone-number.entry.js +14 -13
  330. package/dist/esm/vega-input-range.entry.js +12 -12
  331. package/dist/esm/vega-input-select.entry.js +21 -20
  332. package/dist/esm/vega-input.entry.js +12 -12
  333. package/dist/esm/{vega-internal-event-id-85ad403f.js → vega-internal-event-id-820393ad.js} +2 -1
  334. package/dist/esm/vega-item-toggle.entry.js +5 -5
  335. package/dist/esm/vega-left-nav_5.entry.js +15 -13
  336. package/dist/esm/vega-line-chart.entry.js +1 -1
  337. package/dist/esm/vega-loader-wrapper_2.entry.js +10 -8
  338. package/dist/esm/vega-page-notification_2.entry.js +3 -3
  339. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +6 -6
  340. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +6 -6
  341. package/dist/esm/vega-pagination.entry.js +14 -12
  342. package/dist/esm/vega-pie-chart.entry.js +1 -1
  343. package/dist/esm/vega-popover_2.entry.js +13 -11
  344. package/dist/esm/vega-progress-tracker.entry.js +5 -5
  345. package/dist/esm/vega-radio_2.entry.js +11 -11
  346. package/dist/esm/vega-rich-text-content.entry.js +305 -131
  347. package/dist/esm/vega-rich-text-editor_4.entry.js +1132 -2409
  348. package/dist/esm/vega-section-title.entry.js +1 -1
  349. package/dist/esm/vega-segment-control.entry.js +5 -5
  350. package/dist/esm/vega-selection-chip_2.entry.js +16 -15
  351. package/dist/esm/vega-selection-tile_2.entry.js +12 -12
  352. package/dist/esm/vega-sidenav_3.entry.js +14 -12
  353. package/dist/esm/vega-signature-capture.entry.js +16 -15
  354. package/dist/esm/{vega-skeleton-loader-controller-c2a8bd27.js → vega-skeleton-loader-controller-878e1b28.js} +1 -1
  355. package/dist/esm/vega-skeleton.entry.js +1 -1
  356. package/dist/esm/vega-slot-container.entry.js +1 -1
  357. package/dist/esm/vega-stepper.entry.js +11 -11
  358. package/dist/esm/vega-tab-group_2.entry.js +6 -6
  359. package/dist/esm/vega-table_8.entry.js +16 -14
  360. package/dist/esm/vega-text.entry.js +1 -1
  361. package/dist/esm/vega-textarea.entry.js +11 -11
  362. package/dist/esm/vega-time-picker_2.entry.js +17 -16
  363. package/dist/esm/vega-toggle-switch.entry.js +10 -10
  364. package/dist/esm/vega-tooltip_2.entry.js +12 -10
  365. package/dist/esm/vega.js +12 -10
  366. package/dist/types/components/vega-code-block/assets/copy.d.ts +3 -0
  367. package/dist/types/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.d.ts +40 -0
  368. package/dist/types/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.d.ts +19 -0
  369. package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +43 -0
  370. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-content-parse-controller.d.ts +23 -0
  371. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-focus-controller.d.ts +21 -0
  372. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.d.ts +100 -0
  373. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.d.ts +93 -0
  374. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.d.ts +21 -0
  375. package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-content-renderer.d.ts +57 -0
  376. package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.d.ts +23 -0
  377. package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-renderer.d.ts +50 -0
  378. package/dist/types/components/vega-code-block/types.d.ts +19 -0
  379. package/dist/types/components/vega-code-block/vega-code-block.d.ts +116 -0
  380. package/dist/types/components/vega-rich-text-editor/assets/file-code.d.ts +3 -0
  381. package/dist/types/components/vega-rich-text-editor/assets/rectangle-code.d.ts +3 -0
  382. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.d.ts +15 -0
  383. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy.d.ts +15 -0
  384. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy.d.ts +15 -0
  385. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy.d.ts +12 -0
  386. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.d.ts +3 -3
  387. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.d.ts +4 -5
  388. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.d.ts +29 -0
  389. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.d.ts +15 -0
  390. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.d.ts +28 -0
  391. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.d.ts +12 -0
  392. package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-code-block-strategy.d.ts +12 -0
  393. package/dist/types/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.d.ts +17 -0
  394. package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +5 -1
  395. package/dist/types/components/vega-rich-text-editor/dto/actions/remove-code-block-action.d.ts +10 -0
  396. package/dist/types/components/vega-rich-text-editor/dto/actions/switch-out-from-code-block-action.d.ts +14 -0
  397. package/dist/types/components/vega-rich-text-editor/dto/actions/transform-to-code-block-action.d.ts +14 -0
  398. package/dist/types/components/vega-rich-text-editor/dto/actions/update-code-block-action.d.ts +14 -0
  399. package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +2 -1
  400. package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +17 -4
  401. package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +7 -5
  402. package/dist/types/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.d.ts +2 -1
  403. package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +5 -9
  404. package/dist/types/components/vega-rich-text-editor/dto/annotations/common-annotation.abstract.d.ts +20 -0
  405. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.d.ts +43 -0
  406. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-class-annotation.d.ts +40 -0
  407. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-style-annotation.d.ts +42 -0
  408. package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +5 -9
  409. package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +7 -5
  410. package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +5 -1
  411. package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +7 -5
  412. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +6 -4
  413. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +48 -0
  414. package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +25 -0
  415. package/dist/types/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.d.ts +15 -3
  416. package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +5 -9
  417. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +3 -7
  418. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +7 -5
  419. package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +5 -9
  420. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +39 -4
  421. package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +56 -0
  422. package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +4 -0
  423. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +20 -2
  424. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +4 -0
  425. package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +14 -4
  426. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +13 -0
  427. package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +45 -0
  428. package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +4 -0
  429. package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +46 -2
  430. package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +7 -2
  431. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.d.ts +4 -11
  432. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.d.ts +7 -5
  433. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.d.ts +39 -0
  434. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +24 -0
  435. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +0 -1
  436. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.d.ts +37 -0
  437. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.d.ts +22 -0
  438. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.d.ts +1 -15
  439. package/dist/types/components/vega-rich-text-editor/interface.d.ts +65 -26
  440. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.d.ts +64 -6
  441. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.d.ts +3 -1
  442. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-rte-image-block-strategy.abstract.d.ts +20 -0
  443. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.d.ts +2 -2
  444. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.d.ts +30 -1
  445. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.d.ts +31 -0
  446. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.d.ts +2 -3
  447. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.d.ts +2 -2
  448. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.d.ts +2 -3
  449. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.d.ts +42 -0
  450. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.d.ts +2 -2
  451. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +7 -1
  452. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.d.ts +45 -0
  453. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +17 -23
  454. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +6 -4
  455. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +2 -0
  456. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.d.ts +2 -2
  457. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +3 -2
  458. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.d.ts +2 -2
  459. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.d.ts +2 -2
  460. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.d.ts +2 -2
  461. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.d.ts +22 -0
  462. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.d.ts +2 -2
  463. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.d.ts +2 -2
  464. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.d.ts +4 -2
  465. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.d.ts +2 -2
  466. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.d.ts +2 -2
  467. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.d.ts +2 -2
  468. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.d.ts +3 -2
  469. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.d.ts +2 -2
  470. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.d.ts +2 -2
  471. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.d.ts +3 -2
  472. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.d.ts +2 -2
  473. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +13 -0
  474. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.d.ts +2 -2
  475. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.d.ts +3 -2
  476. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.d.ts +3 -2
  477. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +3 -2
  478. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.d.ts +2 -2
  479. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.d.ts +17 -0
  480. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +8 -2
  481. package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.d.ts +1 -0
  482. package/dist/types/components/vega-rich-text-editor/test/dto/blocks/code-block.test.d.ts +1 -0
  483. package/dist/types/components/vega-rich-text-editor/test/dto/content-state.test.d.ts +1 -1
  484. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.d.ts +1 -0
  485. package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.d.ts +1 -0
  486. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +7 -0
  487. package/dist/types/components.d.ts +95 -0
  488. package/dist/types/helpers/code-format/code-formatter.d.ts +34 -0
  489. package/dist/types/helpers/code-format/test/code-formatter.test.d.ts +1 -0
  490. package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
  491. package/dist/types/helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract.d.ts +20 -0
  492. package/dist/types/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.d.ts +1 -0
  493. package/dist/types/helpers/translation/interface.d.ts +6 -1
  494. package/dist/types/polyfill/shadow-selection/shadow-selection-polyfill.d.ts +26 -0
  495. package/dist/types/types/components.type.d.ts +1 -0
  496. package/dist/types/utils/string.d.ts +7 -0
  497. package/dist/vega/index.esm.js +1 -1
  498. package/dist/vega/p-0104207d.entry.js +1 -0
  499. package/dist/vega/p-010f1715.entry.js +1 -0
  500. package/dist/vega/p-01593f9d.js +1 -0
  501. package/dist/vega/p-020b04ed.js +1 -0
  502. package/dist/vega/p-02841589.js +1 -0
  503. package/dist/vega/p-03cfb331.entry.js +9 -0
  504. package/dist/vega/{p-b649e86e.entry.js → p-0bff8716.entry.js} +1 -1
  505. package/dist/vega/p-1056a049.entry.js +1 -0
  506. package/dist/vega/p-10e41bbe.js +1 -0
  507. package/dist/vega/{p-83ef9e7d.entry.js → p-12e6173c.entry.js} +1 -1
  508. package/dist/vega/{p-54add0d2.js → p-1397ba3f.js} +1 -1
  509. package/dist/vega/p-13d9a1fd.entry.js +1 -0
  510. package/dist/vega/p-13eae47f.entry.js +1 -0
  511. package/dist/vega/p-1630864e.entry.js +1 -0
  512. package/dist/vega/p-1b335e30.entry.js +1 -0
  513. package/dist/vega/{p-8ade44bf.js → p-1e194737.js} +1 -1
  514. package/dist/vega/{p-252e42c7.entry.js → p-1f346008.entry.js} +1 -1
  515. package/dist/vega/p-1f86ab76.entry.js +1 -0
  516. package/dist/vega/p-1fe746ab.entry.js +1 -0
  517. package/dist/vega/{p-8c388b58.entry.js → p-211c028f.entry.js} +1 -1
  518. package/dist/vega/p-21d26bb4.js +2 -0
  519. package/dist/vega/{p-b351ace3.entry.js → p-23e6f2b2.entry.js} +1 -1
  520. package/dist/vega/p-268aea63.js +1 -0
  521. package/dist/vega/{p-a01f149d.entry.js → p-27ccf34d.entry.js} +1 -1
  522. package/dist/vega/{p-913eb7f9.entry.js → p-29f9be26.entry.js} +1 -1
  523. package/dist/vega/{p-27003a81.entry.js → p-30dcf606.entry.js} +1 -1
  524. package/dist/vega/{p-89ab72e3.js → p-3c20ae84.js} +1 -1
  525. package/dist/vega/p-4172fb81.js +1 -0
  526. package/dist/vega/{p-45f696b4.js → p-419697c6.js} +1 -1
  527. package/dist/vega/p-427e4cee.entry.js +1 -0
  528. package/dist/vega/p-4604ed0e.entry.js +1 -0
  529. package/dist/vega/{p-8d283666.js → p-4ab3df00.js} +1 -1
  530. package/dist/vega/{p-72ecfd40.js → p-4e8fb53a.js} +1 -1
  531. package/dist/vega/p-50a3ae3d.js +1 -0
  532. package/dist/vega/{p-b847a143.entry.js → p-50b80d76.entry.js} +1 -1
  533. package/dist/vega/p-531ffb18.entry.js +1 -0
  534. package/dist/vega/p-53daeb45.entry.js +1 -0
  535. package/dist/vega/p-54fdd401.entry.js +1 -0
  536. package/dist/vega/{p-47ff95ba.entry.js → p-5741ecf0.entry.js} +1 -1
  537. package/dist/vega/{p-6cabdb36.js → p-58f8928a.js} +1 -1
  538. package/dist/vega/{p-4a32a6c0.entry.js → p-5c4cb804.entry.js} +1 -1
  539. package/dist/vega/{p-a46bc9f1.entry.js → p-5ce386c8.entry.js} +1 -1
  540. package/dist/vega/p-5f377954.js +1 -1
  541. package/dist/vega/{p-0079088b.entry.js → p-5fd5a538.entry.js} +1 -1
  542. package/dist/vega/{p-0969877b.entry.js → p-64f452fe.entry.js} +1 -1
  543. package/dist/vega/p-66759f4e.js +1 -0
  544. package/dist/vega/{p-bc2dd43d.js → p-6ea42854.js} +1 -1
  545. package/dist/vega/p-70f25341.entry.js +1 -0
  546. package/dist/vega/{p-ec1f2d21.entry.js → p-737bccb9.entry.js} +1 -1
  547. package/dist/vega/{p-bcb10ae3.entry.js → p-7503fe08.entry.js} +1 -1
  548. package/dist/vega/{p-46714da3.entry.js → p-7b0a4688.entry.js} +1 -1
  549. package/dist/vega/p-7def7b74.entry.js +1 -0
  550. package/dist/vega/{p-48517a5d.entry.js → p-7f5a85c6.entry.js} +1 -1
  551. package/dist/vega/p-825ae7c4.js +1 -0
  552. package/dist/vega/p-831c4144.entry.js +1 -0
  553. package/dist/vega/p-85dc08b4.entry.js +1 -0
  554. package/dist/vega/{p-a821bcf3.js → p-86782109.js} +1 -1
  555. package/dist/vega/p-87459914.js +1 -0
  556. package/dist/vega/{p-1971d980.entry.js → p-87a1fc77.entry.js} +1 -1
  557. package/dist/vega/p-89565247.entry.js +1 -0
  558. package/dist/vega/{p-7088ead9.entry.js → p-89e915e9.entry.js} +1 -1
  559. package/dist/vega/{p-81fbfb6d.entry.js → p-8aa7e56e.entry.js} +1 -1
  560. package/dist/vega/p-94263ece.entry.js +1 -0
  561. package/dist/vega/{p-d0007822.entry.js → p-9524e48a.entry.js} +1 -1
  562. package/dist/vega/{p-147e3cbd.entry.js → p-991b4717.entry.js} +1 -1
  563. package/dist/vega/{p-647025dd.entry.js → p-99b9b320.entry.js} +1 -1
  564. package/dist/vega/{p-aea89be5.entry.js → p-9ba14b7c.entry.js} +1 -1
  565. package/dist/vega/p-9cb79f8d.entry.js +1 -0
  566. package/dist/vega/p-9e3f52f0.entry.js +1 -0
  567. package/dist/vega/{p-6586e2a2.entry.js → p-a0e122a6.entry.js} +1 -1
  568. package/dist/vega/{p-9803042f.entry.js → p-b0fe6c0f.entry.js} +1 -1
  569. package/dist/vega/{p-b2bca332.entry.js → p-b518e1a0.entry.js} +1 -1
  570. package/dist/vega/p-b538e81a.entry.js +1 -0
  571. package/dist/vega/p-b824baf7.entry.js +1 -0
  572. package/dist/vega/{p-2fadef27.entry.js → p-b959b4d4.entry.js} +1 -1
  573. package/dist/vega/{p-54f17c2e.entry.js → p-bb4f0fa1.entry.js} +1 -1
  574. package/dist/vega/{p-2da83c2a.js → p-bbb39d6f.js} +1 -1
  575. package/dist/vega/{p-cfda64fd.entry.js → p-bc8fd0ee.entry.js} +1 -1
  576. package/dist/vega/p-bcaf8375.entry.js +1 -0
  577. package/dist/vega/{p-02d7d948.entry.js → p-bec90ff3.entry.js} +1 -1
  578. package/dist/vega/p-c6b94dde.entry.js +1 -0
  579. package/dist/vega/{p-c754b32c.js → p-ce6b62c4.js} +1 -1
  580. package/dist/vega/{p-5e34ea25.entry.js → p-d00fbc11.entry.js} +1 -1
  581. package/dist/vega/{p-10a40dfb.entry.js → p-d2a2af2c.entry.js} +1 -1
  582. package/dist/vega/p-d64b20c2.js +1 -0
  583. package/dist/vega/p-da779940.entry.js +1 -0
  584. package/dist/vega/{p-a7dcb2a3.js → p-db910162.js} +1 -1
  585. package/dist/vega/{p-6f81fe1e.js → p-e1a2a701.js} +1 -1
  586. package/dist/vega/p-e3694aa5.entry.js +1 -0
  587. package/dist/vega/p-e7318c4c.entry.js +1 -0
  588. package/dist/vega/{p-a5c39ba2.entry.js → p-e8fc027e.entry.js} +1 -1
  589. package/dist/vega/{p-6a830bc5.entry.js → p-e92ecb78.entry.js} +1 -1
  590. package/dist/vega/p-e969c3f4.entry.js +1 -0
  591. package/dist/vega/{p-61eb7f32.entry.js → p-ec8b7f01.entry.js} +1 -1
  592. package/dist/vega/p-eed9bda2.entry.js +1 -0
  593. package/dist/vega/p-f4c54c98.entry.js +1 -0
  594. package/dist/vega/{p-5160a6b9.entry.js → p-f5fc80bc.entry.js} +1 -1
  595. package/dist/vega/p-f67be7ef.js +1 -0
  596. package/dist/vega/{p-5e3a15a1.js → p-f9fafc55.js} +1 -1
  597. package/dist/vega/{p-27e56c67.entry.js → p-fc21fb2d.entry.js} +1 -1
  598. package/dist/vega/p-fed9220b.entry.js +1 -0
  599. package/dist/vega/vega.esm.js +1 -1
  600. package/package.json +2 -1
  601. package/dist/cjs/string-21427167.js +0 -13
  602. package/dist/esm/string-be824360.js +0 -11
  603. package/dist/vega/p-06adb37e.entry.js +0 -1
  604. package/dist/vega/p-06c5fe97.entry.js +0 -1
  605. package/dist/vega/p-0bb29d98.js +0 -1
  606. package/dist/vega/p-0ed7a098.entry.js +0 -1
  607. package/dist/vega/p-0f6b3a89.entry.js +0 -1
  608. package/dist/vega/p-136f665b.entry.js +0 -1
  609. package/dist/vega/p-1503f791.js +0 -1
  610. package/dist/vega/p-16fd7c32.js +0 -1
  611. package/dist/vega/p-1a263af1.entry.js +0 -1
  612. package/dist/vega/p-1af4771a.entry.js +0 -1
  613. package/dist/vega/p-1c298d5a.js +0 -2
  614. package/dist/vega/p-1c63afd2.entry.js +0 -1
  615. package/dist/vega/p-1e05b7b4.entry.js +0 -1
  616. package/dist/vega/p-1ea863a6.entry.js +0 -1
  617. package/dist/vega/p-271b30b9.entry.js +0 -1
  618. package/dist/vega/p-2d1d4f33.entry.js +0 -1
  619. package/dist/vega/p-353b3ded.entry.js +0 -1
  620. package/dist/vega/p-44b0a005.js +0 -1
  621. package/dist/vega/p-4e76904e.entry.js +0 -1
  622. package/dist/vega/p-4ec0d36f.entry.js +0 -1
  623. package/dist/vega/p-5c954088.entry.js +0 -1
  624. package/dist/vega/p-646a9198.entry.js +0 -1
  625. package/dist/vega/p-6d7d923b.js +0 -1
  626. package/dist/vega/p-6e898779.js +0 -1
  627. package/dist/vega/p-77492977.entry.js +0 -1
  628. package/dist/vega/p-804f71b3.js +0 -1
  629. package/dist/vega/p-8789d34d.entry.js +0 -1
  630. package/dist/vega/p-8813c0ac.entry.js +0 -1
  631. package/dist/vega/p-8a85c7af.entry.js +0 -1
  632. package/dist/vega/p-8ba43640.entry.js +0 -1
  633. package/dist/vega/p-98c64d77.entry.js +0 -1
  634. package/dist/vega/p-9f3539a4.entry.js +0 -1
  635. package/dist/vega/p-b42aea55.entry.js +0 -1
  636. package/dist/vega/p-b5d70ee0.entry.js +0 -1
  637. package/dist/vega/p-bf1894ec.js +0 -1
  638. package/dist/vega/p-bfb344e1.entry.js +0 -1
  639. package/dist/vega/p-c9a4e79a.entry.js +0 -1
  640. package/dist/vega/p-dbc82247.js +0 -1
  641. package/dist/vega/p-e2e36d2b.entry.js +0 -1
  642. package/dist/vega/p-ef8272b5.entry.js +0 -1
  643. package/dist/vega/p-f4c1d961.js +0 -1
  644. package/dist/vega/p-f5279deb.entry.js +0 -1
  645. package/dist/vega/p-f8033cd3.entry.js +0 -1
  646. package/dist/vega/p-fe63bd50.entry.js +0 -1
@@ -1,7 +1,6 @@
1
1
  import { RTEBlock } from './block.abstract';
2
2
  import { RTEImageNode } from '../nodes/image-node';
3
3
  import { ModifyContentActionType } from '../actions/modify-content-action.abstract';
4
- import { isNonNullable } from '../../../../types/type-guard';
5
4
  import { generateUUID } from '../../../../utils/misc';
6
5
  import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action-handle-strategy-registry';
7
6
  import { BlockDeleteImageStrategy } from '../action-handle-strategies/modify-content-strategies/block-delete-image-strategy';
@@ -16,6 +15,9 @@ import { ImageInsertLineBreakWithBlocksStrategy } from '../action-handle-strateg
16
15
  import { ImageBlockInsertImageStrategy } from '../action-handle-strategies/modify-content-strategies/image-block-insert-image-strategy';
17
16
  import { BlockInsertNodesBeforeNodeStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-nodes-before-node-strategy';
18
17
  import { BlockInsertNodesAfterNodeStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-nodes-after-node-strategy';
18
+ import { isNonNullable } from '../../../../types/type-guard';
19
+ import { HorizontalAlignmentAnnotationAction } from '../actions/horizontal-alignment-annotation-action';
20
+ import { BlockUpdateHorizontalAlignmentStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy';
19
21
  /**
20
22
  * Image block
21
23
  */
@@ -51,6 +53,17 @@ export class RTEImageBlock extends RTEBlock {
51
53
  toJSON() {
52
54
  return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.nodes.map((node) => node.toJSON()) });
53
55
  }
56
+ /**
57
+ * @inheritDoc
58
+ */
59
+ toHtml() {
60
+ const attrStr = super.generateAttributeString();
61
+ return [
62
+ `<div${attrStr}>`,
63
+ this.nodes.map((node) => node.toHtml()).join(''),
64
+ `</div>`,
65
+ ].join('');
66
+ }
54
67
  /**
55
68
  * @inheritDoc
56
69
  */
@@ -99,4 +112,5 @@ export class RTEImageBlock extends RTEBlock {
99
112
  ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEImageBlock.name, new ImageBlockInsertImageStrategy());
100
113
  ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_NODES_BEFORE, RTEImageBlock.name, new BlockInsertNodesBeforeNodeStrategy());
101
114
  ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_NODES_AFTER, RTEImageBlock.name, new BlockInsertNodesAfterNodeStrategy());
115
+ ActionHandleStrategyRegistry.register(HorizontalAlignmentAnnotationAction.name, RTEImageBlock.name, new BlockUpdateHorizontalAlignmentStrategy());
102
116
  })();
@@ -9,6 +9,12 @@ import { ListRemoveListItemStrategy } from '../action-handle-strategies/modify-c
9
9
  import { ListTransformToListStrategy } from '../action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy';
10
10
  import { ListTransformToParagraphStrategy } from '../action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy';
11
11
  import { ListInsertImageStrategy } from '../action-handle-strategies/modify-content-strategies/list-insert-image-strategy';
12
+ import { BlockAnnotationTypeEnum } from '../annotations/block-annotation.abstract';
13
+ import { ListAnnotation } from '../annotations/list-annotation';
14
+ import { isNonNullable } from '../../../../types/type-guard';
15
+ import { CustomAttributeAnnotation } from '../annotations/custom-attribute-annotation';
16
+ import { CustomClassAnnotation } from '../annotations/custom-class-annotation';
17
+ import { CustomStyleAnnotation } from '../annotations/custom-style-annotation';
12
18
  /**
13
19
  * List block
14
20
  */
@@ -18,6 +24,7 @@ export class RTEListBlock extends RTEBlock {
18
24
  this.type = 'bullet-list';
19
25
  this.blocks = [];
20
26
  this.type = type;
27
+ this.annotationMap.set(BlockAnnotationTypeEnum.LIST, new ListAnnotation());
21
28
  }
22
29
  /**
23
30
  * Converts a VegaRTEListBlock object to an RTEListBlock
@@ -27,6 +34,15 @@ export class RTEListBlock extends RTEBlock {
27
34
  */
28
35
  static from(block) {
29
36
  const listBlock = new RTEListBlock(block.id, block.type);
37
+ const { annotations } = block;
38
+ if (annotations) {
39
+ Object.entries(annotations).forEach(([type, value]) => {
40
+ const item = this.createAnnotationEntity(type, value);
41
+ if (isNonNullable(item)) {
42
+ listBlock.annotationMap.set(...item);
43
+ }
44
+ });
45
+ }
30
46
  listBlock.blocks = block.blocks.map((item) => {
31
47
  const listItemBlock = RTEListItemBlock.from(item);
32
48
  listItemBlock.parent = listBlock;
@@ -34,12 +50,46 @@ export class RTEListBlock extends RTEBlock {
34
50
  });
35
51
  return listBlock;
36
52
  }
53
+ /**
54
+ * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
55
+ * and value.
56
+ *
57
+ * @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
58
+ * the type of annotation entity to create.
59
+ * @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
60
+ * that will be used to create the annotation entity. It can be of any type depending on the specific
61
+ * annotation being created.
62
+ * @returns {Nullable<BlockAnnotationsEntity>} The `createAnnotationEntity` function returns a nullable tuple containing a
63
+ * `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
64
+ */
65
+ static createAnnotationEntity(type, value) {
66
+ switch (type) {
67
+ case 'customAttribute':
68
+ return CustomAttributeAnnotation.from(value);
69
+ case 'customClass':
70
+ return CustomClassAnnotation.from(value);
71
+ case 'customStyle':
72
+ return CustomStyleAnnotation.from(value);
73
+ }
74
+ }
37
75
  /**
38
76
  * @inheritDoc
39
77
  */
40
78
  toJSON() {
41
79
  return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.blocks.map((block) => block.toJSON()) });
42
80
  }
81
+ /**
82
+ * @inheritDoc
83
+ */
84
+ toHtml() {
85
+ const BlockTag = this.type === 'number-list' ? 'ol' : 'ul';
86
+ const attrStr = super.generateAttributeString();
87
+ return [
88
+ `<${BlockTag}${attrStr}>`,
89
+ this.blocks.map((block) => block.toHtml()).join(''),
90
+ `</${BlockTag}>`,
91
+ ].join('');
92
+ }
43
93
  /**
44
94
  * @inheritDoc
45
95
  */
@@ -4,7 +4,6 @@ import { ModifyContentActionType } from '../actions/modify-content-action.abstra
4
4
  import { AppendChildNodesAction } from '../actions/append-child-nodes-action';
5
5
  import { generateUUID } from '../../../../utils/misc';
6
6
  import { RTETextBlock } from './text-block';
7
- import { isNonNullable } from '../../../../types/type-guard';
8
7
  import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action-handle-strategy-registry';
9
8
  import { ListItemDeleteTextContentStrategy } from '../action-handle-strategies/modify-content-strategies/list-item-delete-text-content-strategy';
10
9
  import { BlockInsertLineBreakStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-line-break-strategy';
@@ -19,6 +18,7 @@ import { BlockMergeNodesStrategy } from '../action-handle-strategies/modify-cont
19
18
  import { ListItemInsertNewParagraphStrategy } from '../action-handle-strategies/modify-content-strategies/list-item-insert-new-paragraph-strategy';
20
19
  import { ListItemInsertImageStrategy } from '../action-handle-strategies/modify-content-strategies/list-item-insert-image-strategy';
21
20
  import { BlockInsertNodesBeforeNodeStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-nodes-before-node-strategy';
21
+ import { isNonNullable } from '../../../../types/type-guard';
22
22
  /**
23
23
  * List item block
24
24
  */
@@ -62,6 +62,17 @@ export class RTEListItemBlock extends RTETextBlock {
62
62
  var _a;
63
63
  return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((block) => block.toJSON()) });
64
64
  }
65
+ /**
66
+ * @inheritDoc
67
+ */
68
+ toHtml() {
69
+ const attrStr = super.generateAttributeString();
70
+ return [
71
+ `<li${attrStr}>`,
72
+ this.nodes.map((node) => node.toHtml()).join(''),
73
+ `</li>`,
74
+ ].join('');
75
+ }
65
76
  /**
66
77
  * @inheritDoc
67
78
  */
@@ -1,5 +1,4 @@
1
1
  import { RTETextNode } from '../nodes/text-node';
2
- import { isNonNullable } from '../../../../types/type-guard';
3
2
  import { TextStyleAnnotation } from '../annotations/text-style-annotation';
4
3
  import { ModifyContentActionType } from '../actions/modify-content-action.abstract';
5
4
  import { AppendChildNodesAction } from '../actions/append-child-nodes-action';
@@ -24,6 +23,12 @@ import { BlockDeleteTextContentStrategy } from '../action-handle-strategies/modi
24
23
  import { BlockInsertImageIntoTextStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-image-into-text-strategy';
25
24
  import { BlockInsertNodesBeforeNodeStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-nodes-before-node-strategy';
26
25
  import { BlockTransformToListStrategy } from '../action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy';
26
+ import { InternalAnnotationTypeEnum } from '../annotations/annotation.abstract';
27
+ import { isNonNullable } from '../../../../types/type-guard';
28
+ import { HorizontalAlignmentAnnotationAction } from '../actions/horizontal-alignment-annotation-action';
29
+ import { BlockUpdateHorizontalAlignmentStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy';
30
+ import { BlockUpdateIndentStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy';
31
+ import { IndentAnnotationAction } from '../actions/indent-annotation-action';
27
32
  /**
28
33
  * Text block
29
34
  */
@@ -68,7 +73,7 @@ export class RTETextBlock extends RTEBlock {
68
73
  * @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
69
74
  * that will be used to create the annotation entity. It can be of any type depending on the specific
70
75
  * annotation being created.
71
- * @returns {Nullable<[BlockAnnotationTypeEnum, BlockAnnotation]>} The `createAnnotationEntity` function returns a nullable tuple containing a
76
+ * @returns {Nullable<BlockAnnotationsEntity>} The `createAnnotationEntity` function returns a nullable tuple containing a
72
77
  * `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
73
78
  */
74
79
  static createAnnotationEntity(type, value) {
@@ -125,6 +130,36 @@ export class RTETextBlock extends RTEBlock {
125
130
  toJSON() {
126
131
  return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, nodes: this.nodes.map((node) => node.toJSON()) });
127
132
  }
133
+ /**
134
+ * @inheritDoc
135
+ */
136
+ toHtml() {
137
+ const BlockTag = this.getBlockTag();
138
+ const attrStr = super.generateAttributeString();
139
+ const linkGroupAnnotation = this.getAnnotationByType(InternalAnnotationTypeEnum.LINK_GROUP);
140
+ let nodesHtml = this.nodes.map((node) => node.toHtml()).join('');
141
+ if (linkGroupAnnotation && this.nodes.length > 0) {
142
+ //TODO: should revert to above code while https://gethired.atlassian.net/browse/VD-6513 have be fixed.
143
+ // const linkAnnotation: Nullable<LinkAnnotation> =
144
+ // this.nodes[0].getAnnotationByType<LinkAnnotation>(NodeAnnotationTypeEnum.LINK);
145
+ let linkAnnotation;
146
+ this.nodes.find((node) => {
147
+ const link = node.getAnnotationByType(NodeAnnotationTypeEnum.LINK);
148
+ if (link) {
149
+ linkAnnotation = link;
150
+ return true;
151
+ }
152
+ });
153
+ if (linkAnnotation) {
154
+ nodesHtml = [
155
+ `<a ${linkGroupAnnotation.toString(linkAnnotation, { standalone: true })}>`,
156
+ nodesHtml,
157
+ `</a>`,
158
+ ].join('');
159
+ }
160
+ }
161
+ return [`<${BlockTag}${attrStr}>`, nodesHtml, `</${BlockTag}>`].join('');
162
+ }
128
163
  /**
129
164
  * Clone the nodes to a new block
130
165
  *
@@ -171,6 +206,33 @@ export class RTETextBlock extends RTEBlock {
171
206
  createNewParagraph() {
172
207
  return new RTETextBlock(generateUUID(), 'paragraph');
173
208
  }
209
+ /**
210
+ * Get the HTML tag for the block based on its type.
211
+ *
212
+ * @returns {RTETextBlockTagType} The HTML tag for the block.
213
+ */
214
+ getBlockTag() {
215
+ switch (this.type) {
216
+ case 'title':
217
+ case 'subtitle':
218
+ return `div`;
219
+ case 'heading-1':
220
+ return `h1`;
221
+ case 'heading-2':
222
+ return `h2`;
223
+ case 'heading-3':
224
+ return `h3`;
225
+ case 'heading-4':
226
+ return `h4`;
227
+ case 'heading-5':
228
+ return `h5`;
229
+ case 'heading-6':
230
+ return `h6`;
231
+ case 'paragraph':
232
+ default:
233
+ return 'p';
234
+ }
235
+ }
174
236
  /**
175
237
  * @inheritDoc
176
238
  */
@@ -183,6 +245,8 @@ export class RTETextBlock extends RTEBlock {
183
245
  }
184
246
  (() => {
185
247
  ActionHandleStrategyRegistry.register(TextStyleAnnotationAction.name, RTETextBlock.name, new BlockUpdateTextStyleStrategy());
248
+ ActionHandleStrategyRegistry.register(HorizontalAlignmentAnnotationAction.name, RTETextBlock.name, new BlockUpdateHorizontalAlignmentStrategy());
249
+ ActionHandleStrategyRegistry.register(IndentAnnotationAction.name, RTETextBlock.name, new BlockUpdateIndentStrategy());
186
250
  ActionHandleStrategyRegistry.register(LinkGroupAnnotationAction.name, RTETextBlock.name, new BlockUpdateLinkGroupStrategy());
187
251
  ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, RTETextBlock.name, new BlockRemoveNodeStrategy());
188
252
  ActionHandleStrategyRegistry.register(ModifyContentActionType.APPEND_CHILD_NODES, RTETextBlock.name, new BlockAppendNodesStrategy());
@@ -11,6 +11,10 @@ import { BlockRemoveChildBlockStrategy } from './action-handle-strategies/modify
11
11
  import { BlockAppendBlocksStrategy } from './action-handle-strategies/modify-content-strategies/block-append-blocks-strategy';
12
12
  import { BlockInsertBlocksBeforeStrategy } from './action-handle-strategies/modify-content-strategies/block-insert-blocks-before-strategy';
13
13
  import { BlockInsertBlocksAfterStrategy } from './action-handle-strategies/modify-content-strategies/block-insert-blocks-after-strategy';
14
+ import { RTECodeBlock } from './blocks/code-block';
15
+ import { BlockTransformToCodeBlockStrategy } from './action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy';
16
+ import ElementToDtoStrategyProcessor from '../slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor';
17
+ import { isNonNullable } from '../../../types/type-guard';
14
18
  /**
15
19
  * Class representing the content state of the rich text editor.
16
20
  */
@@ -43,6 +47,8 @@ export class VegaRTEContent {
43
47
  case 'bullet-list':
44
48
  case 'number-list':
45
49
  return RTEListBlock.from(block);
50
+ case 'code-block':
51
+ return RTECodeBlock.from(block);
46
52
  default: {
47
53
  throw new Error(`[Vega] Unknown block type: ${block.type}`);
48
54
  }
@@ -70,6 +76,20 @@ export class VegaRTEContent {
70
76
  },
71
77
  ]);
72
78
  }
79
+ /**
80
+ * Converts HTML content to a VegaRTEContent instance.
81
+ *
82
+ * @param {string} html - The HTML string to convert.
83
+ * @returns {VegaRTEContent} The converted content state.
84
+ */
85
+ static fromHtml(html) {
86
+ const body = new DOMParser().parseFromString(html, 'text/html').body;
87
+ const blocks = ElementToDtoStrategyProcessor.process(Array.from(body.childNodes))
88
+ .filter(isNonNullable)
89
+ .map((output) => output.toDto())
90
+ .filter(isNonNullable);
91
+ return new VegaRTEContent(blocks);
92
+ }
73
93
  /**
74
94
  * Clones the content state.
75
95
  *
@@ -89,6 +109,14 @@ export class VegaRTEContent {
89
109
  toJSON() {
90
110
  return this.blocks.map((block) => block.toJSON());
91
111
  }
112
+ /**
113
+ * Converts the content state to HTML.
114
+ *
115
+ * @returns {string} The HTML representation of the content state.
116
+ */
117
+ toHtml() {
118
+ return this.blocks.map((block) => block.toHtml()).join('');
119
+ }
92
120
  /**
93
121
  * Internal method to add the block item, remove the block item
94
122
  *
@@ -167,4 +195,5 @@ export class VegaRTEContent {
167
195
  ActionHandleStrategyRegistry.register(ModifyContentActionType.APPEND_CHILD_NODES, VegaRTEContent.name, new BlockAppendBlocksStrategy());
168
196
  ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_BLOCKS_BEFORE, VegaRTEContent.name, new BlockInsertBlocksBeforeStrategy());
169
197
  ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_BLOCKS_AFTER, VegaRTEContent.name, new BlockInsertBlocksAfterStrategy());
198
+ ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_TO_CODE_BLOCK, VegaRTEContent.name, new BlockTransformToCodeBlockStrategy());
170
199
  })();
@@ -0,0 +1,56 @@
1
+ import { ModifyContentActionType } from '../actions/modify-content-action.abstract';
2
+ import { NodeTypeEnum, RTENode } from './node.abstract';
3
+ import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action-handle-strategy-registry';
4
+ import { UpdateCodeBlockStrategy } from '../action-handle-strategies/modify-content-strategies/update-code-block-strategy';
5
+ import { SelectionChangeAction } from '../actions/selection-change-action';
6
+ import { CodeNodeSetSelectionRangeAnnotationStrategy } from '../action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy';
7
+ /**
8
+ * RTE code node DTO class.
9
+ */
10
+ export class RTECodeBlockNode extends RTENode {
11
+ constructor(id, content, language, parentBlock) {
12
+ super(id);
13
+ this.type = NodeTypeEnum.CODE_BLOCK_NODE;
14
+ this.text = '';
15
+ this.annotationMap = new Map();
16
+ this.text = content;
17
+ this.parentBlock = parentBlock;
18
+ this.language = language;
19
+ }
20
+ /**
21
+ * The code node toJSON method will called internal.
22
+ *
23
+ * @returns {VegaRTECodeNode} - An object contains content property.
24
+ */
25
+ toJSON() {
26
+ return { id: this.id, type: 'text', text: this.text, language: this.language };
27
+ }
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ toHtml() {
32
+ return `<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;'>${this.text}</code>`;
33
+ }
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ clone() {
38
+ return new RTECodeBlockNode(this.id, this.text, this.language, this.parentBlock);
39
+ }
40
+ /**
41
+ * @inheritDoc
42
+ */
43
+ doAnnotationActionApply(action) {
44
+ ActionHandleStrategyRegistry.executeTheStrategy(action, this);
45
+ }
46
+ /**
47
+ * @inheritDoc
48
+ */
49
+ doModifyActionApply(action) {
50
+ ActionHandleStrategyRegistry.executeTheStrategy(action, this);
51
+ }
52
+ }
53
+ (() => {
54
+ ActionHandleStrategyRegistry.register(ModifyContentActionType.UPDATE_CODE_BLOCK, RTECodeBlockNode.name, new UpdateCodeBlockStrategy());
55
+ ActionHandleStrategyRegistry.register(SelectionChangeAction.name, RTECodeBlockNode.name, new CodeNodeSetSelectionRangeAnnotationStrategy());
56
+ })();
@@ -7,6 +7,7 @@ import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action
7
7
  import { ImageSetAnnotationMapStrategy } from '../action-handle-strategies/apply-annotation-strategies/image-set-annotation-map-strategy';
8
8
  import { ImageUpdateUrlStrategy } from '../action-handle-strategies/modify-content-strategies/image-update-url-strategy';
9
9
  import { AnnotationAction } from '../actions/annotation-action.abstract';
10
+ import { CommonAnnotation } from '../annotations/common-annotation.abstract';
10
11
  /**
11
12
  * Image node
12
13
  */
@@ -34,7 +35,12 @@ export class RTEImageNode extends RTENode {
34
35
  annotations = node.annotations;
35
36
  }
36
37
  imageNode.annotationMap = new Map(Object.keys(annotations)
37
- .map(() => ImageAnnotation.from(annotations.size, annotations.alt))
38
+ .map((type) => {
39
+ if (type === 'size' || type === 'alt') {
40
+ return ImageAnnotation.from(annotations.size, annotations.alt);
41
+ }
42
+ return this.createAnnotationEntity(type, annotations[type]);
43
+ })
38
44
  .filter(isNonNullable));
39
45
  return imageNode;
40
46
  }
@@ -42,14 +48,13 @@ export class RTEImageNode extends RTENode {
42
48
  * @inheritDoc
43
49
  */
44
50
  toJSON() {
45
- const imageAnnotation = this.annotationMap.get(NodeAnnotationTypeEnum.IMAGE);
46
- const annotations = {};
47
- if (imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.size) {
48
- annotations.size = imageAnnotation.size;
49
- }
50
- if (imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.alt) {
51
- annotations.alt = imageAnnotation.alt;
52
- }
51
+ const annotations = Array.from(this.annotationMap.values())
52
+ .filter((annotation) => annotation instanceof ImageAnnotation || annotation instanceof CommonAnnotation)
53
+ .reduce((record, annotation) => {
54
+ return Object.assign(Object.assign({}, record), annotation.toJSON());
55
+ }, {});
56
+ if (annotations.alt == '')
57
+ delete annotations.alt;
53
58
  return Object.assign(Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {})), { type: 'image', url: this.url });
54
59
  }
55
60
  /**
@@ -58,6 +63,18 @@ export class RTEImageNode extends RTENode {
58
63
  clone() {
59
64
  return new RTEImageNode(this.id, this.url, this.parentBlock, super.cloneAnnotations());
60
65
  }
66
+ /**
67
+ * @inheritDoc
68
+ */
69
+ toHtml() {
70
+ const imageAnnotation = this.getAnnotationByType(NodeAnnotationTypeEnum.IMAGE);
71
+ const attrStr = super.generateAttributeString(...[
72
+ imageAnnotation && imageAnnotation.alt ? `alt="${imageAnnotation.alt}"` : null,
73
+ `src="${this.url}"`,
74
+ `data-size="${imageAnnotation.size}"`,
75
+ ].filter(isNonNullable));
76
+ return `<img${attrStr}>`;
77
+ }
61
78
  /**
62
79
  * @inheritDoc
63
80
  */
@@ -3,10 +3,18 @@ import stateEntityRenderingRegistry from '../../slimmers/controllers/state-entit
3
3
  import domNodeSubjectFactory from '../../../../helpers/change-manager/subject/dom-node-subject/dom-node-subject-factory';
4
4
  import { VegaInternalRichTextEditorFlushChanges } from '../../../../helpers/event-manager/event-id/vega-internal-event-id';
5
5
  import { ModifyContentAction } from '../actions/modify-content-action.abstract';
6
+ import { NodeAnnotation } from '../annotations/node-annotation.abstract';
7
+ import { camelToDashCase } from '../../../../utils/string';
8
+ import { isNonNullable } from '../../../../types/type-guard';
9
+ import { CustomAttributeAnnotation } from '../annotations/custom-attribute-annotation';
10
+ import { CustomClassAnnotation } from '../annotations/custom-class-annotation';
11
+ import { CommonAnnotationTypeEnum } from '../annotations/common-annotation.abstract';
12
+ import { CustomStyleAnnotation } from '../annotations/custom-style-annotation';
6
13
  export var NodeTypeEnum;
7
14
  (function (NodeTypeEnum) {
8
15
  NodeTypeEnum["TEXT"] = "TEXT";
9
16
  NodeTypeEnum["IMAGE"] = "IMAGE";
17
+ NodeTypeEnum["CODE_BLOCK_NODE"] = "CODE_BLOCK_NODE";
10
18
  })(NodeTypeEnum || (NodeTypeEnum = {}));
11
19
  /**
12
20
  * Abstract class for all nodes
@@ -19,6 +27,24 @@ export class RTENode {
19
27
  this.annotationMap = annotationMap;
20
28
  }
21
29
  }
30
+ /**
31
+ * Creates different types of text annotations based on the provided type and value.
32
+ *
33
+ * @param {keyof VegaRTETextAnnotations} type - The key of the type.
34
+ * @param {unknown} value - The value that will be used to create the specific type of annotation entity based on the `type` provided.
35
+ * @returns {Nullable<[RTENodeAnnotationMapKey, RTENodeAnnotationMapValue]>} Returning a nullable tuple containing a key and a
36
+ * value from the `RTENodeAnnotationMapKey` and `RTENodeAnnotationMapValue` types.
37
+ */
38
+ static createAnnotationEntity(type, value) {
39
+ switch (type) {
40
+ case 'customAttribute':
41
+ return CustomAttributeAnnotation.from(value);
42
+ case 'customClass':
43
+ return CustomClassAnnotation.from(value);
44
+ case 'customStyle':
45
+ return CustomStyleAnnotation.from(value);
46
+ }
47
+ }
22
48
  /**
23
49
  * Get annotation by type
24
50
  *
@@ -51,6 +77,61 @@ export class RTENode {
51
77
  }
52
78
  return this;
53
79
  }
80
+ /**
81
+ * Get styles from annotations
82
+ *
83
+ * @param {RTERenderContext} [options={ standalone: false }] - Options to control style mode
84
+ * @returns {AnnotationStyle} - Annotation styles
85
+ */
86
+ getStyles(options = { standalone: false }) {
87
+ return Array.from(this.annotationMap.values())
88
+ .filter((annotation) => annotation instanceof NodeAnnotation || annotation instanceof CustomStyleAnnotation)
89
+ .map((annotation) => annotation.renderStyle(options))
90
+ .filter(Boolean)
91
+ .reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {});
92
+ }
93
+ /**
94
+ * Get classes from annotations
95
+ *
96
+ * @param {RTERenderContext} [options={ standalone: false }] - Options to control style mode
97
+ * @returns {string} - Annotation style
98
+ */
99
+ getClasses(options = { standalone: false }) {
100
+ return Array.from(this.annotationMap.values())
101
+ .filter((annotation) => annotation instanceof NodeAnnotation || annotation instanceof CustomClassAnnotation)
102
+ .map((annotation) => annotation.renderClass(options))
103
+ .filter(isNonNullable)
104
+ .reduce((pre, cur) => [pre, cur].join(' ').trim(), '');
105
+ }
106
+ /**
107
+ * Get custom attribute annotation, excluding "class" and "style"
108
+ *
109
+ * @returns {CustomAttributeAnnotation} - custom attribute annotation
110
+ */
111
+ getCustomAttributesAnnotation() {
112
+ return this.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_ATTRIBUTE);
113
+ }
114
+ /**
115
+ * Generate attributes as string
116
+ *
117
+ * @param {...string} attrs - Additional attributes to include
118
+ * @returns {string} - Attributes as string
119
+ */
120
+ generateAttributeString(...attrs) {
121
+ var _a;
122
+ const styles = Object.entries(Object.assign({}, this.getStyles({ standalone: true })))
123
+ .map(([key, value]) => `${camelToDashCase(key)}: ${value};`)
124
+ .join('');
125
+ const customClassAnnotation = this.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_CLASS);
126
+ const customAttributeString = ((_a = this.getCustomAttributesAnnotation()) === null || _a === void 0 ? void 0 : _a.toString(attrs)) || [];
127
+ const attributes = [
128
+ ...customAttributeString,
129
+ customClassAnnotation === null || customClassAnnotation === void 0 ? void 0 : customClassAnnotation.toString(),
130
+ styles ? `style="${styles}"` : null,
131
+ ...attrs,
132
+ ].filter(isNonNullable);
133
+ return attributes.length ? ` ${attributes.join(' ')}` : '';
134
+ }
54
135
  /**
55
136
  * apply annotation action or modify content action
56
137
  *
@@ -1,5 +1,5 @@
1
1
  import { NodeTypeEnum, RTENode } from './node.abstract';
2
- import { NodeAnnotation } from '../annotations/node-annotation.abstract';
2
+ import { NodeAnnotation, NodeAnnotationTypeEnum } from '../annotations/node-annotation.abstract';
3
3
  import { AnnotationAction } from '../actions/annotation-action.abstract';
4
4
  import { TextSplittableAction } from '../actions/splittable-action.abstract';
5
5
  import { SelectionRangeAnnotation } from '../annotations/selection-range-annotation';
@@ -26,6 +26,7 @@ import { NodeUpdateTextStrategy } from '../action-handle-strategies/modify-conte
26
26
  import { NodeReplaceSelectedTextStrategy } from '../action-handle-strategies/modify-content-strategies/node-replace-selected-text-strategy';
27
27
  import { NodeSplitTextStrategy } from '../action-handle-strategies/apply-annotation-strategies/node-split-text-strategy';
28
28
  import { NodeUpdateAnnotationMapStrategy } from '../action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy';
29
+ import { CommonAnnotation } from '../annotations/common-annotation.abstract';
29
30
  /**
30
31
  * Text node
31
32
  */
@@ -83,18 +84,30 @@ export class RTETextNode extends RTENode {
83
84
  case 'link':
84
85
  return LinkAnnotation.from(value);
85
86
  }
87
+ return RTENode.createAnnotationEntity(type, value);
86
88
  }
87
89
  /**
88
90
  * @inheritDoc
89
91
  */
90
92
  toJSON() {
91
93
  const annotations = Array.from(this.annotationMap.values())
92
- .filter((annotation) => annotation instanceof NodeAnnotation)
94
+ .filter((annotation) => annotation instanceof NodeAnnotation || annotation instanceof CommonAnnotation)
93
95
  .reduce((record, annotation) => {
94
96
  return Object.assign(Object.assign({}, record), annotation.toJSON());
95
97
  }, {});
96
98
  return Object.assign(Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {})), { type: 'text', text: this.text });
97
99
  }
100
+ /**
101
+ * @inheritDoc
102
+ */
103
+ toHtml() {
104
+ var _a;
105
+ const NodeTag = ((_a = this.getAnnotationByType(NodeAnnotationTypeEnum.CODE)) === null || _a === void 0 ? void 0 : _a.code)
106
+ ? 'code'
107
+ : 'span';
108
+ const attrStr = super.generateAttributeString();
109
+ return `<${NodeTag}${attrStr}>${this.text}</${NodeTag}>`;
110
+ }
98
111
  /**
99
112
  * Creates a new RTETextNode with the specified text and copies the parent block and annotation map from the original node.
100
113
  *
@@ -1,6 +1,4 @@
1
1
  import stateEntityRenderingRegistry from '../../../slimmers/controllers/state-entity-rendering-registry';
2
- import { BlockAnnotation } from '../../annotations/block-annotation.abstract';
3
- import { isNonNullable } from '../../../../../types/type-guard';
4
2
  export class RTEBlockRenderer {
5
3
  registerRef(ref, block) {
6
4
  if (ref) {
@@ -8,28 +6,13 @@ export class RTEBlockRenderer {
8
6
  }
9
7
  }
10
8
  /**
11
- * Get styles from annotations
9
+ * The attributes of the element rendered by the block
12
10
  *
13
11
  * @param {RTEBlock} block - RTE block entity
14
- * @returns {AnnotationStyle} - Annotation style
12
+ * @returns {Record<string, string>} - element props
15
13
  */
16
- getStyles(block) {
17
- return Array.from(block.annotationMap.values())
18
- .filter((annotation) => annotation instanceof BlockAnnotation)
19
- .map((annotation) => annotation.render())
20
- .filter(isNonNullable)
21
- .reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {});
22
- }
23
- /**
24
- * Get classes from annotations
25
- *
26
- * @param {RTEBlock} block - RTE block entity
27
- * @returns {string} - Annotation style
28
- */
29
- getClasses(block) {
30
- return Array.from(block.annotationMap.values())
31
- .map((annotation) => { var _a; return (_a = annotation.renderClass) === null || _a === void 0 ? void 0 : _a.call(annotation); })
32
- .filter(isNonNullable)
33
- .reduce((pre, cur) => [pre, cur].join(' '), '');
14
+ getCustomAttrs(block) {
15
+ var _a;
16
+ return ((_a = block.getCustomAttributesAnnotation()) === null || _a === void 0 ? void 0 : _a.render()) || {};
34
17
  }
35
18
  }