@heartlandone/vega 2.74.0-RTE-table-preview → 2.75.0-RTE-table-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 (595) hide show
  1. package/dist/cjs/{app-globals-be2e868e.js → app-globals-6c9a0e62.js} +11 -10
  2. package/dist/cjs/{child-nodes-event-prevent-slimmer-536d29fc.js → child-nodes-event-prevent-slimmer-aca87dac.js} +1 -1
  3. package/dist/cjs/click-outside-only-to-dismiss-strategy-407f6d1e.js +32 -0
  4. package/dist/cjs/{code-block-22ee2550.js → code-block-d9001f03.js} +2 -2
  5. package/dist/cjs/{component-value-history-controller-slimmer.abstract-3486cbc0.js → component-value-history-controller-slimmer.abstract-b00e9f58.js} +4 -4
  6. package/dist/cjs/{content-state-0be6fda3.js → content-state-466f277f.js} +3 -3
  7. package/dist/cjs/{date-required-rule-99cca681.js → date-required-rule-30ee62d0.js} +1 -1
  8. package/dist/cjs/{design-token-505997df.js → design-token-a569577e.js} +2 -2
  9. package/dist/cjs/{dom-node-subject-observer-factory-1c8f7880.js → dom-node-subject-observer-factory-b5e71bf6.js} +4 -0
  10. package/dist/cjs/{element-appender-slimmer-26420c09.js → element-appender-slimmer-b7fdd82e.js} +160 -36
  11. package/dist/cjs/{event-emit-slimmer-6a591353.js → event-emit-slimmer-2dacabbd.js} +2 -2
  12. package/dist/cjs/{form-field-controller-slimmer-56c551ea.js → form-field-controller-slimmer-3ea2464a.js} +2 -2
  13. package/dist/cjs/{image-annotation-action-462fd073.js → image-annotation-action-4435d531.js} +3 -31
  14. package/dist/cjs/{index-fc538f17.js → index-19e5b936.js} +1 -1
  15. package/dist/cjs/index.cjs.js +22 -22
  16. package/dist/cjs/{inject-keyboard-manager-a6101379.js → inject-keyboard-manager-d21b4387.js} +1 -1
  17. package/dist/cjs/{internal-vega-event-manager-d587a33c.js → internal-vega-event-manager-6befeb34.js} +13 -2
  18. package/dist/cjs/{keyboard-manager-d8adb0ed.js → keyboard-manager-3dea6b28.js} +1 -1
  19. package/dist/cjs/{keyboard-manager-slimmer-15e65357.js → keyboard-manager-slimmer-0d45f944.js} +1 -1
  20. package/dist/cjs/{language-extension-414149c2.js → language-extension-26331915.js} +2 -2
  21. package/dist/cjs/loader.cjs.js +15 -15
  22. package/dist/cjs/{month-view-generator-706c5477.js → month-view-generator-49cc5fc2.js} +1 -1
  23. package/dist/cjs/{public-rules-2d18cf41.js → public-rules-942bd931.js} +7 -7
  24. package/dist/cjs/{range-439a0c0c.js → range-cafe69a9.js} +1 -1
  25. package/dist/cjs/{responsive-format-facade-0ececeb3.js → responsive-format-facade-6c22bbbd.js} +5 -4
  26. package/dist/cjs/{rich-text-editor-required-rule-5a4f3626.js → rich-text-editor-required-rule-0dcb08c8.js} +1 -1
  27. package/dist/cjs/sanitize-fb222510.js +131 -0
  28. package/dist/cjs/{styles.constants-3aff0b56.js → split-cell-operation-9930fde8.js} +1230 -403
  29. package/dist/cjs/{string-format-strategy.abstract-a8264fca.js → string-format-strategy.abstract-63514c60.js} +1 -1
  30. package/dist/cjs/{string-input-formatter-slimmer-a8f4a9b1.js → string-input-formatter-slimmer-655d0322.js} +3 -3
  31. package/dist/cjs/{string-mask-strategy-4e7d3780.js → string-mask-strategy-d23ac21a.js} +2 -2
  32. package/dist/cjs/{style-formatter-142500c0.js → style-formatter-0e0ae896.js} +2 -2
  33. package/dist/cjs/{sub-state-notify-slimmer-011866d9.js → sub-state-notify-slimmer-3fa87162.js} +1 -1
  34. package/dist/cjs/{sub-state-observer-slimmer-23d43f1e.js → sub-state-observer-slimmer-77deba40.js} +1 -1
  35. package/dist/cjs/{table-extension-2a20da57.js → table-extension-5f27207f.js} +676 -373
  36. package/dist/cjs/{time-required-rule-9d39a620.js → time-required-rule-c96ecdc9.js} +1 -1
  37. package/dist/cjs/{type-guard-69d2cf01.js → type-guard-a0f026d8.js} +12 -0
  38. package/dist/cjs/{valid-credit-card-number-rule-9f40d1d9.js → valid-credit-card-number-rule-c854bed9.js} +1 -1
  39. package/dist/cjs/vega-accordion.cjs.entry.js +12 -12
  40. package/dist/cjs/vega-app-header-button.cjs.entry.js +13 -13
  41. package/dist/cjs/vega-banner.cjs.entry.js +3 -3
  42. package/dist/cjs/vega-box.cjs.entry.js +12 -12
  43. package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
  44. package/dist/cjs/vega-button-circle.cjs.entry.js +12 -12
  45. package/dist/cjs/vega-button-group_2.cjs.entry.js +6 -6
  46. package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
  47. package/dist/cjs/vega-button.cjs.entry.js +11 -11
  48. package/dist/cjs/vega-calendar_4.cjs.entry.js +8 -8
  49. package/dist/cjs/vega-card.cjs.entry.js +12 -12
  50. package/dist/cjs/vega-carousel.cjs.entry.js +11 -11
  51. package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
  52. package/dist/cjs/vega-chip.cjs.entry.js +13 -13
  53. package/dist/cjs/vega-code-block.cjs.entry.js +10 -10
  54. package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
  55. package/dist/cjs/vega-combo-box.cjs.entry.js +11 -10
  56. package/dist/cjs/vega-date-picker_2.cjs.entry.js +392 -345
  57. package/dist/cjs/vega-dialog_2.cjs.entry.js +14 -14
  58. package/dist/cjs/vega-divider.cjs.entry.js +13 -13
  59. package/dist/cjs/vega-dropdown_5.cjs.entry.js +40 -22
  60. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  61. package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
  62. package/dist/cjs/vega-file-uploader.cjs.entry.js +5 -5
  63. package/dist/cjs/vega-flag-icon.cjs.entry.js +11 -11
  64. package/dist/cjs/vega-flex.cjs.entry.js +13 -13
  65. package/dist/cjs/vega-font.cjs.entry.js +12 -12
  66. package/dist/cjs/vega-form.cjs.entry.js +8 -8
  67. package/dist/cjs/vega-grid.cjs.entry.js +12 -12
  68. package/dist/cjs/vega-icon.cjs.entry.js +12 -12
  69. package/dist/cjs/vega-image-uploader.cjs.entry.js +14 -14
  70. package/dist/cjs/vega-input-credit-card.cjs.entry.js +10 -10
  71. package/dist/cjs/vega-input-numeric.cjs.entry.js +10 -10
  72. package/dist/cjs/vega-input-passcode.cjs.entry.js +9 -9
  73. package/dist/cjs/vega-input-phone-number.cjs.entry.js +14 -14
  74. package/dist/cjs/vega-input-range.cjs.entry.js +6 -6
  75. package/dist/cjs/vega-input-select.cjs.entry.js +21 -16
  76. package/dist/cjs/vega-input.cjs.entry.js +339 -98
  77. package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
  78. package/dist/cjs/vega-left-nav_5.cjs.entry.js +12 -12
  79. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +13 -13
  80. package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
  81. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
  82. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
  83. package/dist/cjs/vega-pagination.cjs.entry.js +13 -13
  84. package/dist/cjs/vega-popover_2.cjs.entry.js +15 -15
  85. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +12 -12
  86. package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
  87. package/dist/cjs/vega-rich-text-content.cjs.entry.js +13 -16
  88. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +143 -194
  89. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +312 -104
  90. package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
  91. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +14 -14
  92. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +7 -7
  93. package/dist/cjs/vega-sidenav_3.cjs.entry.js +15 -15
  94. package/dist/cjs/vega-signature-capture.cjs.entry.js +14 -14
  95. package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
  96. package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
  97. package/dist/cjs/vega-table_11.cjs.entry.js +13 -13
  98. package/dist/cjs/vega-textarea.cjs.entry.js +6 -6
  99. package/dist/cjs/vega-time-picker_2.cjs.entry.js +19 -18
  100. package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
  101. package/dist/cjs/vega-tooltip_2.cjs.entry.js +14 -14
  102. package/dist/cjs/vega.cjs.js +15 -15
  103. package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +1 -1
  104. package/dist/collection/components/vega-button-group/vega-button-group-item/vega-button-group-item.js +1 -1
  105. package/dist/collection/components/vega-calendar/vega-calendar.js +1 -1
  106. package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +2 -1
  107. package/dist/collection/components/vega-date-picker/assets/icons.js +4 -1
  108. package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +2 -1
  109. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +2 -2
  110. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.js +109 -0
  111. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-renderer.js +4 -0
  112. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.js +42 -70
  113. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +12 -56
  114. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +435 -108
  115. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +5 -0
  116. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-search-controller.js +5 -1
  117. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-source-controller.js +7 -0
  118. package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +3 -2
  119. package/dist/collection/components/vega-dropdown/vega-dropdown.js +21 -6
  120. package/dist/collection/components/vega-field-label/vega-field-label.js +1 -1
  121. package/dist/collection/components/vega-input/slimmers/controllers/vega-input-render-mode-controller.js +51 -0
  122. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-renderer.js +6 -0
  123. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-suggestions-renderer.js +142 -0
  124. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-renderer.js +12 -1
  125. package/dist/collection/components/vega-input/vega-input.js +200 -3
  126. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +8 -3
  127. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +9 -1
  128. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +0 -10
  129. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-strategy.js +74 -28
  130. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/merge-cells-strategy.js +120 -0
  131. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-cell-horizontally-strategy.js +143 -0
  132. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-cell-vertically-strategy.js +80 -0
  133. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-cell-properties-strategy.js +2 -1
  134. package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-properties-strategy.js +2 -2
  135. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/merge-cells-action.js +17 -0
  136. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/split-cell-horizontally-action.js +12 -0
  137. package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/split-cell-vertically-action.js +12 -0
  138. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.js +9 -30
  139. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +26 -0
  140. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.js +26 -11
  141. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.js +52 -12
  142. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-color-annotation.js +66 -0
  143. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.js +11 -6
  144. package/dist/collection/components/vega-rich-text-editor/extensions/table/constants/styles.constants.js +8 -8
  145. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +1 -1
  146. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +32 -1
  147. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +1 -1
  148. package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/td-to-table-cell-block-strategy.js +1 -1
  149. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.js +3 -1
  150. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +2 -9
  151. package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +4 -0
  152. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties.js +19 -15
  153. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/merge-cells-operation.js +100 -0
  154. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.js +1 -0
  155. package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/split-cell-operation.js +57 -0
  156. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +14 -2
  157. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-selection.js +102 -13
  158. package/dist/collection/components/vega-rich-text-editor/extensions/table/utils/table-color-manager.js +51 -0
  159. package/dist/collection/components/vega-rich-text-editor/extensions/table/utils/utils.js +253 -0
  160. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/controllers/vega-rich-text-table-properties-color-controller.js +33 -2
  161. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-cell-properties-form-field-renderer.js +1 -1
  162. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-basic-form-field-renderer.abstract.js +38 -6
  163. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-field-renderer.js +1 -1
  164. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-renderer.js +20 -2
  165. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.css +1 -0
  166. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.js +24 -14
  167. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.js +2 -2
  168. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/merge-cells-button-slimmer.js +117 -0
  169. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.js +6 -4
  170. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.js +6 -1
  171. package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.js +15 -8
  172. package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-annotation-handler.test.js +41 -46
  173. package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-cell-annotation-handler.test.js +69 -48
  174. package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-head-cell-annotation-handler.test.js +50 -54
  175. package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-annotation.test.js +106 -14
  176. package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-cell-annotation.test.js +204 -9
  177. package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-color-annotation.test.js +32 -0
  178. package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-dto.test.js +583 -6
  179. package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-element-to-dto-strategies.test.js +114 -25
  180. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +0 -5
  181. package/dist/collection/components/vega-selection-chip/vega-selection-chip.js +1 -1
  182. package/dist/collection/components/vega-time-picker/slimmers/controllers/vega-time-picker-range-dropdown-controller.js +2 -1
  183. package/dist/collection/components/vega-time-picker/slimmers/controllers/vega-time-picker-single-dropdown-controller.js +2 -1
  184. package/dist/collection/constants/ui.js +2 -0
  185. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +13 -2
  186. package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +2 -0
  187. package/dist/collection/helpers/event-manager/test/component-event-id-map.test.js +3 -1
  188. package/dist/collection/helpers/event-manager/test/vega-event-manager.test.js +3 -1
  189. package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +60 -32
  190. package/dist/collection/helpers/slimmers/element-appender/test/element-appender-slimmer.test.js +3 -2
  191. package/dist/collection/helpers/slimmers/element-appender/trigger-strategies/click-outside-only-to-dismiss-strategy.js +28 -0
  192. package/dist/collection/helpers/slimmers/element-appender/trigger-strategies/click-trigger-strategy.js +33 -0
  193. package/dist/collection/helpers/slimmers/element-appender/trigger-strategies/hover-trigger-strategy.js +42 -0
  194. package/dist/collection/helpers/slimmers/element-appender/trigger-strategies/none-trigger-strategy.js +22 -0
  195. package/dist/collection/helpers/slimmers/element-appender/trigger-strategies/trigger-strategy.interface.js +1 -0
  196. package/dist/collection/types/test/type-guard.test.js +8 -1
  197. package/dist/collection/types/type-guard.js +11 -0
  198. package/dist/collection/utils/sanitize.js +126 -0
  199. package/dist/collection/utils/test/sanitize.test.js +65 -0
  200. package/dist/esm/{app-globals-8b873b6f.js → app-globals-4146c01c.js} +9 -8
  201. package/dist/esm/{child-nodes-event-prevent-slimmer-a6afdb1e.js → child-nodes-event-prevent-slimmer-225e7b58.js} +1 -1
  202. package/dist/esm/click-outside-only-to-dismiss-strategy-3d286c1b.js +30 -0
  203. package/dist/esm/{code-block-76b29be1.js → code-block-36393b45.js} +3 -3
  204. package/dist/esm/{component-value-history-controller-slimmer.abstract-e1b0e163.js → component-value-history-controller-slimmer.abstract-82339b2b.js} +4 -4
  205. package/dist/esm/{content-state-03f1d302.js → content-state-e8ef033a.js} +3 -3
  206. package/dist/esm/{date-required-rule-a9980386.js → date-required-rule-47ecc28f.js} +1 -1
  207. package/dist/esm/{design-token-8fedb532.js → design-token-c57a58b4.js} +2 -2
  208. package/dist/esm/{dom-node-subject-observer-factory-e998eba4.js → dom-node-subject-observer-factory-d4e16f66.js} +3 -1
  209. package/dist/esm/{element-appender-slimmer-7b9326e2.js → element-appender-slimmer-a7341fc1.js} +160 -36
  210. package/dist/esm/{event-emit-slimmer-bbf6668c.js → event-emit-slimmer-1bb4b533.js} +2 -2
  211. package/dist/esm/{form-field-controller-slimmer-a0cff4d3.js → form-field-controller-slimmer-907bf7c2.js} +2 -2
  212. package/dist/esm/{image-annotation-action-47cdc068.js → image-annotation-action-82cef6e4.js} +4 -31
  213. package/dist/esm/{index-da7e5fe5.js → index-2466b0c0.js} +1 -1
  214. package/dist/esm/index.js +21 -21
  215. package/dist/esm/{inject-keyboard-manager-9241968c.js → inject-keyboard-manager-83d76ff5.js} +1 -1
  216. package/dist/esm/{internal-vega-event-manager-e799c54a.js → internal-vega-event-manager-2cbb828a.js} +13 -2
  217. package/dist/esm/{keyboard-manager-89acac79.js → keyboard-manager-c92808d8.js} +1 -1
  218. package/dist/esm/{keyboard-manager-slimmer-e303cb7d.js → keyboard-manager-slimmer-79c78ce8.js} +1 -1
  219. package/dist/esm/{language-extension-de6e6caf.js → language-extension-dcc43702.js} +2 -2
  220. package/dist/esm/loader.js +15 -15
  221. package/dist/esm/{month-view-generator-4bec99fd.js → month-view-generator-16192182.js} +1 -1
  222. package/dist/esm/{public-rules-c48cc5c9.js → public-rules-b8ea651f.js} +7 -7
  223. package/dist/esm/{range-af6150a8.js → range-872aad9f.js} +1 -1
  224. package/dist/esm/{responsive-format-facade-16da4623.js → responsive-format-facade-9278eae4.js} +5 -4
  225. package/dist/esm/{rich-text-editor-required-rule-7255832e.js → rich-text-editor-required-rule-36dd4242.js} +1 -1
  226. package/dist/esm/sanitize-fd0cb40d.js +129 -0
  227. package/dist/esm/{styles.constants-0dd6f7fa.js → split-cell-operation-6749f654.js} +1218 -405
  228. package/dist/esm/{string-format-strategy.abstract-75540c16.js → string-format-strategy.abstract-fc60db79.js} +1 -1
  229. package/dist/esm/{string-input-formatter-slimmer-82f85b0b.js → string-input-formatter-slimmer-7a1e8754.js} +3 -3
  230. package/dist/esm/{string-mask-strategy-4a18ed1a.js → string-mask-strategy-0b0accaa.js} +2 -2
  231. package/dist/esm/{style-formatter-6ca58f6b.js → style-formatter-e937952a.js} +2 -2
  232. package/dist/esm/{sub-state-notify-slimmer-4060c333.js → sub-state-notify-slimmer-2ecdba12.js} +1 -1
  233. package/dist/esm/{sub-state-observer-slimmer-bfa5e63e.js → sub-state-observer-slimmer-2d5dba8d.js} +1 -1
  234. package/dist/esm/{table-extension-c83b7a56.js → table-extension-6b31754b.js} +587 -283
  235. package/dist/esm/{time-required-rule-8ec1faf5.js → time-required-rule-5fa43804.js} +1 -1
  236. package/dist/esm/{type-guard-b48aec98.js → type-guard-c65a227d.js} +12 -1
  237. package/dist/esm/{valid-credit-card-number-rule-96eaf9b1.js → valid-credit-card-number-rule-666c415d.js} +1 -1
  238. package/dist/esm/vega-accordion.entry.js +12 -12
  239. package/dist/esm/vega-app-header-button.entry.js +13 -13
  240. package/dist/esm/vega-banner.entry.js +3 -3
  241. package/dist/esm/vega-box.entry.js +12 -12
  242. package/dist/esm/vega-breadcrumb.entry.js +4 -4
  243. package/dist/esm/vega-button-circle.entry.js +12 -12
  244. package/dist/esm/vega-button-group_2.entry.js +6 -6
  245. package/dist/esm/vega-button-link.entry.js +4 -4
  246. package/dist/esm/vega-button.entry.js +11 -11
  247. package/dist/esm/vega-calendar_4.entry.js +8 -8
  248. package/dist/esm/vega-card.entry.js +12 -12
  249. package/dist/esm/vega-carousel.entry.js +11 -11
  250. package/dist/esm/vega-checkbox_2.entry.js +6 -6
  251. package/dist/esm/vega-chip.entry.js +13 -13
  252. package/dist/esm/vega-code-block.entry.js +10 -10
  253. package/dist/esm/vega-color-picker.entry.js +5 -5
  254. package/dist/esm/vega-combo-box.entry.js +11 -10
  255. package/dist/esm/vega-date-picker_2.entry.js +392 -345
  256. package/dist/esm/vega-dialog_2.entry.js +14 -14
  257. package/dist/esm/vega-divider.entry.js +13 -13
  258. package/dist/esm/vega-dropdown_5.entry.js +40 -22
  259. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  260. package/dist/esm/vega-field-label.entry.js +3 -3
  261. package/dist/esm/vega-file-uploader.entry.js +5 -5
  262. package/dist/esm/vega-flag-icon.entry.js +11 -11
  263. package/dist/esm/vega-flex.entry.js +13 -13
  264. package/dist/esm/vega-font.entry.js +12 -12
  265. package/dist/esm/vega-form.entry.js +8 -8
  266. package/dist/esm/vega-grid.entry.js +12 -12
  267. package/dist/esm/vega-icon.entry.js +12 -12
  268. package/dist/esm/vega-image-uploader.entry.js +14 -14
  269. package/dist/esm/vega-input-credit-card.entry.js +10 -10
  270. package/dist/esm/vega-input-numeric.entry.js +10 -10
  271. package/dist/esm/vega-input-passcode.entry.js +9 -9
  272. package/dist/esm/vega-input-phone-number.entry.js +14 -14
  273. package/dist/esm/vega-input-range.entry.js +6 -6
  274. package/dist/esm/vega-input-select.entry.js +21 -16
  275. package/dist/esm/vega-input.entry.js +340 -99
  276. package/dist/esm/vega-item-toggle.entry.js +3 -3
  277. package/dist/esm/vega-left-nav_5.entry.js +12 -12
  278. package/dist/esm/vega-loader-wrapper_2.entry.js +13 -13
  279. package/dist/esm/vega-page-notification_2.entry.js +1 -1
  280. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -3
  281. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
  282. package/dist/esm/vega-pagination.entry.js +13 -13
  283. package/dist/esm/vega-popover_2.entry.js +15 -15
  284. package/dist/esm/vega-progress-tracker_2.entry.js +12 -12
  285. package/dist/esm/vega-radio_2.entry.js +9 -9
  286. package/dist/esm/vega-rich-text-content.entry.js +14 -17
  287. package/dist/esm/vega-rich-text-editor_4.entry.js +144 -195
  288. package/dist/esm/vega-rich-text-table-properties_3.entry.js +293 -85
  289. package/dist/esm/vega-segment-control.entry.js +3 -3
  290. package/dist/esm/vega-selection-chip_2.entry.js +14 -14
  291. package/dist/esm/vega-selection-tile_2.entry.js +7 -7
  292. package/dist/esm/vega-sidenav_3.entry.js +15 -15
  293. package/dist/esm/vega-signature-capture.entry.js +14 -14
  294. package/dist/esm/vega-stepper.entry.js +6 -6
  295. package/dist/esm/vega-tab-group_2.entry.js +4 -4
  296. package/dist/esm/vega-table_11.entry.js +13 -13
  297. package/dist/esm/vega-textarea.entry.js +6 -6
  298. package/dist/esm/vega-time-picker_2.entry.js +19 -18
  299. package/dist/esm/vega-toggle-switch.entry.js +5 -5
  300. package/dist/esm/vega-tooltip_2.entry.js +14 -14
  301. package/dist/esm/vega.js +15 -15
  302. package/dist/sri/vega-sri-manifest.json +339 -715
  303. package/dist/types/components/vega-date-picker/assets/icons.d.ts +1 -1
  304. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.d.ts +20 -0
  305. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +1 -0
  306. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.d.ts +4 -11
  307. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +4 -9
  308. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +2 -0
  309. package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-source-controller.d.ts +2 -0
  310. package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +9 -4
  311. package/dist/types/components/vega-input/slimmers/controllers/vega-input-render-mode-controller.d.ts +27 -0
  312. package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-renderer.d.ts +1 -0
  313. package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-suggestions-renderer.d.ts +40 -0
  314. package/dist/types/components/vega-input/slimmers/renderers/vega-input-renderer.d.ts +3 -0
  315. package/dist/types/components/vega-input/types.d.ts +4 -0
  316. package/dist/types/components/vega-input/vega-input.d.ts +55 -1
  317. package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +3 -0
  318. package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.d.ts +1 -1
  319. package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.d.ts +0 -2
  320. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-strategy.d.ts +17 -0
  321. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/merge-cells-strategy.d.ts +38 -0
  322. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-cell-horizontally-strategy.d.ts +43 -0
  323. package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/split-cell-vertically-strategy.d.ts +27 -0
  324. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/merge-cells-action.d.ts +33 -0
  325. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/split-cell-horizontally-action.d.ts +10 -0
  326. package/dist/types/components/vega-rich-text-editor/extensions/table/actions/split-cell-vertically-action.d.ts +10 -0
  327. package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.d.ts +0 -7
  328. package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.d.ts +14 -0
  329. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.d.ts +15 -6
  330. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.d.ts +11 -2
  331. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-color-annotation.d.ts +43 -0
  332. package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.d.ts +2 -2
  333. package/dist/types/components/vega-rich-text-editor/extensions/table/constants/styles.constants.d.ts +2 -2
  334. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +19 -0
  335. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +2 -2
  336. package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +1 -8
  337. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/merge-cells-operation.d.ts +44 -0
  338. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.d.ts +2 -1
  339. package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/split-cell-operation.d.ts +31 -0
  340. package/dist/types/components/vega-rich-text-editor/extensions/table/table-extension.d.ts +3 -3
  341. package/dist/types/components/vega-rich-text-editor/extensions/table/table-selection.d.ts +15 -0
  342. package/dist/types/components/vega-rich-text-editor/extensions/table/utils/table-color-manager.d.ts +26 -0
  343. package/dist/types/components/vega-rich-text-editor/extensions/table/utils/utils.d.ts +102 -2
  344. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/controllers/vega-rich-text-table-properties-color-controller.d.ts +16 -1
  345. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-basic-form-field-renderer.abstract.d.ts +18 -6
  346. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-renderer.d.ts +7 -1
  347. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.d.ts +14 -11
  348. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.d.ts +3 -3
  349. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/merge-cells-button-slimmer.d.ts +23 -0
  350. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.d.ts +1 -0
  351. package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.d.ts +9 -6
  352. package/dist/types/components/vega-rich-text-editor/interface.d.ts +0 -5
  353. package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-cell-annotation-handler.test.d.ts +8 -1
  354. package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-color-annotation.test.d.ts +1 -0
  355. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +0 -2
  356. package/dist/types/components.d.ts +72 -30
  357. package/dist/types/constants/ui.d.ts +1 -1
  358. package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +2 -0
  359. package/dist/types/helpers/slimmers/element-appender/element-appender-slimmer.d.ts +4 -9
  360. package/dist/types/helpers/slimmers/element-appender/trigger-strategies/click-outside-only-to-dismiss-strategy.d.ts +21 -0
  361. package/dist/types/helpers/slimmers/element-appender/trigger-strategies/click-trigger-strategy.d.ts +21 -0
  362. package/dist/types/helpers/slimmers/element-appender/trigger-strategies/hover-trigger-strategy.d.ts +22 -0
  363. package/dist/types/helpers/slimmers/element-appender/trigger-strategies/none-trigger-strategy.d.ts +18 -0
  364. package/dist/types/helpers/slimmers/element-appender/trigger-strategies/trigger-strategy.interface.d.ts +37 -0
  365. package/dist/types/types/components.type.d.ts +3 -1
  366. package/dist/types/types/type-guard.d.ts +8 -0
  367. package/dist/types/types/ui.type.d.ts +9 -0
  368. package/dist/types/utils/sanitize.d.ts +71 -0
  369. package/dist/types/utils/spec-utils.d.ts +2 -0
  370. package/dist/types/utils/test/sanitize.test.d.ts +1 -0
  371. package/dist/vega/index.esm.js +1 -57
  372. package/dist/vega/{p-780cbfb0.entry.js → p-01dc2e48.entry.js} +1 -1
  373. package/dist/vega/p-0459a474.entry.js +1 -0
  374. package/dist/vega/p-0770a0eb.entry.js +1 -0
  375. package/dist/vega/{p-a924c1e2.entry.js → p-0bf4a3a7.entry.js} +1 -1
  376. package/dist/vega/{p-ff9a0e6e.js → p-0d57293b.js} +1 -1
  377. package/dist/vega/{p-22da15d7.entry.js → p-1199ebf6.entry.js} +1 -1
  378. package/dist/vega/p-11a6c1b7.js +1 -0
  379. package/dist/vega/{p-79e8236a.entry.js → p-1415d93b.entry.js} +1 -1
  380. package/dist/vega/p-1431c8b9.js +1 -0
  381. package/dist/vega/p-18560714.entry.js +1 -0
  382. package/dist/vega/{p-a007b493.entry.js → p-1a161082.entry.js} +1 -1
  383. package/dist/vega/{p-161b9c5b.js → p-1f83cebf.js} +1 -1
  384. package/dist/vega/{p-16af7681.js → p-20010bd6.js} +1 -1
  385. package/dist/vega/p-205d8401.js +1 -0
  386. package/dist/vega/{p-29a9c8f5.entry.js → p-20a98a99.entry.js} +1 -1
  387. package/dist/vega/{p-86caa739.entry.js → p-228784f7.entry.js} +1 -1
  388. package/dist/vega/{p-b91c2c9d.js → p-22989693.js} +1 -1
  389. package/dist/vega/{p-1bda4016.entry.js → p-273911b2.entry.js} +1 -1
  390. package/dist/vega/{p-e797bf8d.entry.js → p-28e630b2.entry.js} +1 -1
  391. package/dist/vega/{p-d466baf7.js → p-29f6b2d5.js} +1 -1
  392. package/dist/vega/{p-6d9731c1.entry.js → p-2af2e1ad.entry.js} +1 -1
  393. package/dist/vega/{p-d55365b9.entry.js → p-2af78c38.entry.js} +1 -1
  394. package/dist/vega/{p-c3d388b5.entry.js → p-2c830cba.entry.js} +1 -1
  395. package/dist/vega/{p-61ae4e9c.entry.js → p-3224d794.entry.js} +1 -1
  396. package/dist/vega/{p-216f3436.entry.js → p-326b5392.entry.js} +1 -1
  397. package/dist/vega/{p-69af3422.entry.js → p-3413a678.entry.js} +1 -1
  398. package/dist/vega/p-3532aa12.js +1 -0
  399. package/dist/vega/p-395cdd84.entry.js +1 -0
  400. package/dist/vega/{p-9aac9879.entry.js → p-3a6ff599.entry.js} +1 -1
  401. package/dist/vega/p-3be82c0f.entry.js +1 -0
  402. package/dist/vega/p-3c0f55f7.entry.js +1 -0
  403. package/dist/vega/{p-10ffb765.js → p-3e30567a.js} +1 -1
  404. package/dist/vega/p-3e5f362f.js +1 -0
  405. package/dist/vega/p-42cd1fde.js +1 -0
  406. package/dist/vega/p-476a173a.js +1 -0
  407. package/dist/vega/p-4b6c60cb.entry.js +1 -0
  408. package/dist/vega/{p-12a97dad.entry.js → p-4c36b528.entry.js} +1 -1
  409. package/dist/vega/{p-fa34ace2.entry.js → p-4ecf0ee7.entry.js} +1 -1
  410. package/dist/vega/{p-813b2915.entry.js → p-4f4c7593.entry.js} +1 -1
  411. package/dist/vega/p-585edae4.entry.js +1 -0
  412. package/dist/vega/{p-39d56e3d.js → p-5b048141.js} +1 -1
  413. package/dist/vega/p-5f377954.js +1 -1
  414. package/dist/vega/{p-63246470.js → p-5fdb9047.js} +1 -1
  415. package/dist/vega/{p-d4e35d2e.entry.js → p-60483e3d.entry.js} +1 -1
  416. package/dist/vega/{p-de70aac1.js → p-60851f9d.js} +1 -1
  417. package/dist/vega/{p-73688c4e.entry.js → p-61145506.entry.js} +1 -1
  418. package/dist/vega/{p-8162980c.js → p-61ddae59.js} +1 -1
  419. package/dist/vega/{p-98b78c75.entry.js → p-64386be8.entry.js} +1 -1
  420. package/dist/vega/{p-73689ec0.entry.js → p-6490b69a.entry.js} +1 -1
  421. package/dist/vega/{p-50a506ea.entry.js → p-6bc1552e.entry.js} +1 -1
  422. package/dist/vega/{p-206245d2.entry.js → p-6e4e7192.entry.js} +1 -1
  423. package/dist/vega/{p-8ac453cb.entry.js → p-76d144f5.entry.js} +1 -1
  424. package/dist/vega/{p-dc2813eb.entry.js → p-76eb9cd0.entry.js} +1 -1
  425. package/dist/vega/{p-e788598a.entry.js → p-77c9949d.entry.js} +1 -1
  426. package/dist/vega/p-8187878e.js +1 -0
  427. package/dist/vega/p-8198a77c.js +1 -0
  428. package/dist/vega/{p-0e4cecbd.entry.js → p-82ad1006.entry.js} +1 -1
  429. package/dist/vega/{p-8a4d8139.entry.js → p-839c9d62.entry.js} +1 -1
  430. package/dist/vega/{p-d07d04e0.entry.js → p-849f78a7.entry.js} +1 -1
  431. package/dist/vega/{p-ac4bd1f8.js → p-85bfa0f7.js} +1 -1
  432. package/dist/vega/{p-dd5d917b.entry.js → p-87764570.entry.js} +1 -1
  433. package/dist/vega/{p-abf871cd.entry.js → p-88c894e8.entry.js} +1 -1
  434. package/dist/vega/{p-c00adad9.js → p-89083d63.js} +1 -1
  435. package/dist/vega/{p-a8dad05d.js → p-920719ad.js} +1 -1
  436. package/dist/vega/p-9472d19a.js +1 -0
  437. package/dist/vega/{p-c6d98c60.entry.js → p-96657262.entry.js} +1 -1
  438. package/dist/vega/p-979e4bd4.entry.js +1 -0
  439. package/dist/vega/{p-f6eab527.entry.js → p-9c624e03.entry.js} +1 -1
  440. package/dist/vega/{p-088f4613.entry.js → p-a01f985f.entry.js} +1 -1
  441. package/dist/vega/{p-a4ec6575.js → p-a2aeb646.js} +1 -1
  442. package/dist/vega/{p-22c76be7.entry.js → p-a495463f.entry.js} +1 -1
  443. package/dist/vega/p-b4ea3fad.js +1 -0
  444. package/dist/vega/{p-151b1deb.js → p-b56b0b89.js} +1 -1
  445. package/dist/vega/{p-3bc7e162.entry.js → p-b5b75a2f.entry.js} +1 -1
  446. package/dist/vega/{p-d991fb11.js → p-badad9ed.js} +1 -1
  447. package/dist/vega/{p-24766b9d.entry.js → p-bccaf3d2.entry.js} +1 -1
  448. package/dist/vega/{p-e13c163c.entry.js → p-bde5c990.entry.js} +1 -1
  449. package/dist/vega/{p-ab0e013c.entry.js → p-beb6c1ce.entry.js} +1 -1
  450. package/dist/vega/{p-068ee55e.entry.js → p-c02b01ec.entry.js} +1 -1
  451. package/dist/vega/p-c1fdcb62.js +1 -0
  452. package/dist/vega/{p-5d2704c1.entry.js → p-c5e7035b.entry.js} +1 -1
  453. package/dist/vega/{p-5367eaab.js → p-c841be8d.js} +1 -1
  454. package/dist/vega/{p-6f08e3e1.entry.js → p-cd078909.entry.js} +1 -1
  455. package/dist/vega/{p-d1d0f08a.js → p-d0e31633.js} +1 -1
  456. package/dist/vega/{p-a439e59b.entry.js → p-d5c09a94.entry.js} +1 -1
  457. package/dist/vega/{p-c8ad47c9.js → p-d907f8a2.js} +1 -1
  458. package/dist/vega/{p-6c1ef2ed.js → p-dd11f735.js} +1 -1
  459. package/dist/vega/{p-c9541fc2.entry.js → p-de850e98.entry.js} +1 -1
  460. package/dist/vega/{p-3d85411d.js → p-e16b3adf.js} +1 -1
  461. package/dist/vega/{p-34a994a1.entry.js → p-e1dd23f8.entry.js} +1 -1
  462. package/dist/vega/{p-7ca9f6f1.js → p-e1de1cdc.js} +1 -1
  463. package/dist/vega/{p-1f4a814e.entry.js → p-e7cfb6b6.entry.js} +1 -1
  464. package/dist/vega/{p-ddf81373.js → p-e819940c.js} +1 -1
  465. package/dist/vega/{p-e0cefd90.entry.js → p-e95ed6f3.entry.js} +1 -1
  466. package/dist/vega/p-ebb14c84.js +1 -0
  467. package/dist/vega/{p-f519cdc3.entry.js → p-f0a8aed3.entry.js} +1 -1
  468. package/dist/vega/p-f2b8abd3.entry.js +1 -0
  469. package/dist/vega/{p-d4719c14.entry.js → p-fb238751.entry.js} +1 -1
  470. package/dist/vega/p-fdebc47f.entry.js +1 -0
  471. package/dist/vega/vega.esm.js +1 -172
  472. package/package.json +1 -1
  473. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/text-node-color-controller.js +0 -51
  474. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/text-node-rendering-registry.js +0 -26
  475. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/text-node-color-controller.d.ts +0 -22
  476. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/text-node-rendering-registry.d.ts +0 -22
  477. package/dist/vega/app-globals-955a2b3b.js +0 -427
  478. package/dist/vega/child-nodes-event-prevent-slimmer-a604a6dd.js +0 -156
  479. package/dist/vega/design-token-56b26205.js +0 -402
  480. package/dist/vega/element-appender-slimmer-8355fb28.js +0 -1508
  481. package/dist/vega/event-emit-slimmer-7a14f5e9.js +0 -265
  482. package/dist/vega/internal-vega-event-manager-8c62c88e.js +0 -458
  483. package/dist/vega/p-08b4d097.entry.js +0 -1
  484. package/dist/vega/p-207cfa6a.js +0 -1
  485. package/dist/vega/p-213be5e9.entry.js +0 -1
  486. package/dist/vega/p-224a4f3f.entry.js +0 -1
  487. package/dist/vega/p-40660c09.js +0 -1
  488. package/dist/vega/p-550ce71a.entry.js +0 -1
  489. package/dist/vega/p-6665d083.entry.js +0 -1
  490. package/dist/vega/p-7172332a.entry.js +0 -1
  491. package/dist/vega/p-82ec9721.entry.js +0 -1
  492. package/dist/vega/p-99e3dcab.js +0 -1
  493. package/dist/vega/p-9a83a6b0.js +0 -1
  494. package/dist/vega/p-a4d0ab07.js +0 -1
  495. package/dist/vega/p-a6e03df4.entry.js +0 -1
  496. package/dist/vega/p-c335088c.js +0 -1
  497. package/dist/vega/p-c674b07c.js +0 -1
  498. package/dist/vega/p-d1349401.entry.js +0 -1
  499. package/dist/vega/p-d2033624.js +0 -1
  500. package/dist/vega/p-db482ee1.js +0 -1
  501. package/dist/vega/p-f4b46f6b.entry.js +0 -1
  502. package/dist/vega/p-fbfb4c70.entry.js +0 -1
  503. package/dist/vega/p-ff57c872.js +0 -1
  504. package/dist/vega/p-ff921d10.js +0 -1
  505. package/dist/vega/public-api-8dd022fa.js +0 -6043
  506. package/dist/vega/public-api-baaf7593.js +0 -4
  507. package/dist/vega/responsive-format-facade-98596535.js +0 -913
  508. package/dist/vega/style-formatter-0ae102e9.js +0 -32
  509. package/dist/vega/vega-accordion.entry.js +0 -291
  510. package/dist/vega/vega-app-header-button.entry.js +0 -452
  511. package/dist/vega/vega-banner.entry.js +0 -351
  512. package/dist/vega/vega-box.entry.js +0 -353
  513. package/dist/vega/vega-breadcrumb.entry.js +0 -249
  514. package/dist/vega/vega-button-circle.entry.js +0 -245
  515. package/dist/vega/vega-button-group.entry.js +0 -203
  516. package/dist/vega/vega-button-link.entry.js +0 -226
  517. package/dist/vega/vega-button.entry.js +0 -259
  518. package/dist/vega/vega-calendar.entry.js +0 -3884
  519. package/dist/vega/vega-card.entry.js +0 -226
  520. package/dist/vega/vega-carousel.entry.js +0 -540
  521. package/dist/vega/vega-checkbox-group.entry.js +0 -266
  522. package/dist/vega/vega-checkbox.entry.js +0 -335
  523. package/dist/vega/vega-chip.entry.js +0 -321
  524. package/dist/vega/vega-code-block.entry.js +0 -4372
  525. package/dist/vega/vega-color-picker.entry.js +0 -258
  526. package/dist/vega/vega-combo-box.entry.js +0 -748
  527. package/dist/vega/vega-date-picker-calendar.entry.js +0 -1381
  528. package/dist/vega/vega-date-picker.entry.js +0 -1646
  529. package/dist/vega/vega-dialog.entry.js +0 -158
  530. package/dist/vega/vega-divider.entry.js +0 -179
  531. package/dist/vega/vega-dropdown-content-box.entry.js +0 -57
  532. package/dist/vega/vega-dropdown-item.entry.js +0 -352
  533. package/dist/vega/vega-dropdown.entry.js +0 -2136
  534. package/dist/vega/vega-field-label.entry.js +0 -182
  535. package/dist/vega/vega-file-uploader.entry.js +0 -751
  536. package/dist/vega/vega-flag-icon.entry.js +0 -216
  537. package/dist/vega/vega-flex.entry.js +0 -224
  538. package/dist/vega/vega-font.entry.js +0 -327
  539. package/dist/vega/vega-form.entry.js +0 -1008
  540. package/dist/vega/vega-grid.entry.js +0 -129
  541. package/dist/vega/vega-icon.entry.js +0 -256
  542. package/dist/vega/vega-image-uploader.entry.js +0 -977
  543. package/dist/vega/vega-input-credit-card.entry.js +0 -549
  544. package/dist/vega/vega-input-numeric.entry.js +0 -471
  545. package/dist/vega/vega-input-passcode.entry.js +0 -728
  546. package/dist/vega/vega-input-phone-number.entry.js +0 -9143
  547. package/dist/vega/vega-input-range.entry.js +0 -693
  548. package/dist/vega/vega-input-select.entry.js +0 -1268
  549. package/dist/vega/vega-input.entry.js +0 -1735
  550. package/dist/vega/vega-item-toggle.entry.js +0 -190
  551. package/dist/vega/vega-left-nav-group.entry.js +0 -433
  552. package/dist/vega/vega-left-nav-link.entry.js +0 -317
  553. package/dist/vega/vega-left-nav-section.entry.js +0 -97
  554. package/dist/vega/vega-left-nav.entry.js +0 -654
  555. package/dist/vega/vega-loading-indicator.entry.js +0 -209
  556. package/dist/vega/vega-modal.entry.js +0 -1287
  557. package/dist/vega/vega-nav-card.entry.js +0 -163
  558. package/dist/vega/vega-pagination-page-selector-mobile.entry.js +0 -214
  559. package/dist/vega/vega-pagination.entry.js +0 -629
  560. package/dist/vega/vega-popover-content-box.entry.js +0 -101
  561. package/dist/vega/vega-popover.entry.js +0 -362
  562. package/dist/vega/vega-progress-tracker.entry.js +0 -757
  563. package/dist/vega/vega-radio-group.entry.js +0 -496
  564. package/dist/vega/vega-radio.entry.js +0 -272
  565. package/dist/vega/vega-rich-text-editor-toolbar-button.entry.js +0 -169
  566. package/dist/vega/vega-rich-text-editor.entry.js +0 -4107
  567. package/dist/vega/vega-rich-text-image-editor.entry.js +0 -216
  568. package/dist/vega/vega-rich-text-link-editor.entry.js +0 -238
  569. package/dist/vega/vega-rich-text-table-properties.entry.js +0 -641
  570. package/dist/vega/vega-rich-text-table-setting.entry.js +0 -525
  571. package/dist/vega/vega-segment-control.entry.js +0 -350
  572. package/dist/vega/vega-selection-chip-group.entry.js +0 -447
  573. package/dist/vega/vega-selection-chip.entry.js +0 -443
  574. package/dist/vega/vega-selection-tile-group.entry.js +0 -438
  575. package/dist/vega/vega-selection-tile.entry.js +0 -409
  576. package/dist/vega/vega-sidenav-link.entry.js +0 -160
  577. package/dist/vega/vega-sidenav.entry.js +0 -766
  578. package/dist/vega/vega-signature-capture.entry.js +0 -589
  579. package/dist/vega/vega-stepper.entry.js +0 -292
  580. package/dist/vega/vega-tab-group-panel.entry.js +0 -79
  581. package/dist/vega/vega-tab-group.entry.js +0 -1281
  582. package/dist/vega/vega-table-body.entry.js +0 -48
  583. package/dist/vega/vega-table-cell.entry.js +0 -243
  584. package/dist/vega/vega-table-foot-cell.entry.js +0 -169
  585. package/dist/vega/vega-table-foot-row.entry.js +0 -219
  586. package/dist/vega/vega-table-foot.entry.js +0 -136
  587. package/dist/vega/vega-table-head-cell.entry.js +0 -339
  588. package/dist/vega/vega-table-head-row.entry.js +0 -416
  589. package/dist/vega/vega-table-head.entry.js +0 -113
  590. package/dist/vega/vega-table-row.entry.js +0 -666
  591. package/dist/vega/vega-table.entry.js +0 -3707
  592. package/dist/vega/vega-textarea.entry.js +0 -329
  593. package/dist/vega/vega-time-picker.entry.js +0 -2039
  594. package/dist/vega/vega-toggle-switch.entry.js +0 -194
  595. package/dist/vega/vega-tooltip.entry.js +0 -339
@@ -1,33 +1,348 @@
1
- import { B as BlockAnnotation, f as RTEBlock, M as ModifyContentAction, i as RTENode, d as ActionHandleStrategy, j as InsertChildrenBeforeAction, m as RemoveChildrenAction } from './code-block-76b29be1.js';
1
+ import { B as BlockAnnotation, f as RTEBlock, M as ModifyContentAction, n as CommonAnnotationTypeEnum, C as CustomAttributeAnnotation, i as RTENode, d as ActionHandleStrategy, j as InsertChildrenBeforeAction, m as RemoveChildrenAction } from './code-block-36393b45.js';
2
2
  import { c as cleanObject } from './object-66c37948.js';
3
- import { i as isNonNullable } from './type-guard-b48aec98.js';
4
- import { g as generateUUID } from './create-public-api-runtime-metrics-slimmer-bedf3a1e.js';
5
- import { U as UpdateCursorPositionAction, V as VegaRTEContent } from './content-state-03f1d302.js';
3
+ import { V as VegaInternalThemeManager } from './dark-mode-style-controller-de88a117.js';
4
+ import './global-slimmer-registry-17c4efd4.js';
5
+ import { I as InjectVegaTelemetrySlimmer, c as createPublicAPIRuntimeMetricsSlimmer, g as generateUUID } from './create-public-api-runtime-metrics-slimmer-bedf3a1e.js';
6
+ import { r as rgbToHex } from './ui-bb99c0c2.js';
7
+ import { i as isNonNullable } from './type-guard-c65a227d.js';
8
+ import { U as UpdateCursorPositionAction, V as VegaRTEContent } from './content-state-e8ef033a.js';
9
+
10
+ const ThemeManagerRuntimeMetricsPayloadDefinition = [
11
+ {
12
+ payloadKey: 'IS_OVERRIDECOLORS_METHOD_CALLED',
13
+ payloadDescription: 'Indicate if the method overrideColors of public API ThemeManager is called',
14
+ /**
15
+ * Indicate whether the method is collected when the method been called .
16
+ *
17
+ * @param {string} scope - The class name of public api
18
+ * @param {string} methodName - The method name called by the public api
19
+ * @returns {boolean} A boolean value
20
+ */
21
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'overrideColors',
22
+ /**
23
+ * The function checks if the method is be called.
24
+ *
25
+ * @returns {boolean} A boolean value
26
+ */
27
+ payloadValue: () => {
28
+ return true;
29
+ },
30
+ },
31
+ {
32
+ payloadKey: 'IS_RESET_METHOD_CALLED',
33
+ payloadDescription: 'Indicate if the method reset of public API ThemeManager is called',
34
+ /**
35
+ * Indicate whether the method is collected when the method been called .
36
+ *
37
+ * @param {string} scope - The class name of public api
38
+ * @param {string} methodName - The method name called by the public api
39
+ * @returns {boolean} A boolean value
40
+ */
41
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'reset',
42
+ /**
43
+ * The function checks if the method is be called.
44
+ *
45
+ * @returns {boolean} A boolean value
46
+ */
47
+ payloadValue: () => {
48
+ return true;
49
+ },
50
+ },
51
+ {
52
+ payloadKey: 'IS_TOGGLEDARKMODE_METHOD_CALLED',
53
+ payloadDescription: 'Indicate if the method toggleDarkMode of public API ThemeManager is called',
54
+ /**
55
+ * Indicate whether the method is collected when the method been called .
56
+ *
57
+ * @param {string} scope - The class name of public api
58
+ * @param {string} methodName - The method name called by the public api
59
+ * @returns {boolean} A boolean value
60
+ */
61
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'toggleDarkMode',
62
+ /**
63
+ * The function checks if the method is be called.
64
+ *
65
+ * @returns {boolean} A boolean value
66
+ */
67
+ payloadValue: () => {
68
+ return true;
69
+ },
70
+ },
71
+ {
72
+ payloadKey: 'IS_ISDARKMODE_METHOD_CALLED',
73
+ payloadDescription: 'Indicate if the method isDarkMode of public API ThemeManager is called',
74
+ /**
75
+ * Indicate whether the method is collected when the method been called .
76
+ *
77
+ * @param {string} scope - The class name of public api
78
+ * @param {string} methodName - The method name called by the public api
79
+ * @returns {boolean} A boolean value
80
+ */
81
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'isDarkMode',
82
+ /**
83
+ * The function checks if the method is be called.
84
+ *
85
+ * @returns {boolean} A boolean value
86
+ */
87
+ payloadValue: () => {
88
+ return true;
89
+ },
90
+ },
91
+ {
92
+ payloadKey: 'IS_APPLY_BRANDING_METHOD_CALLED',
93
+ payloadDescription: 'Indicate if the method applyBranding of public API ThemeManager is called',
94
+ /**
95
+ * Indicate whether the method is collected when the method been called .
96
+ *
97
+ * @param {string} scope - The class name of public api
98
+ * @param {string} methodName - The method name called by the public api
99
+ * @returns {boolean} A boolean value
100
+ */
101
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'applyBranding',
102
+ /**
103
+ * The function checks if the method is be called.
104
+ *
105
+ * @returns {boolean} A boolean value
106
+ */
107
+ payloadValue: () => {
108
+ return true;
109
+ },
110
+ },
111
+ ];
112
+
113
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
114
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
115
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
116
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
117
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
118
+ };
119
+ /**
120
+ * Vega components theme manager
121
+ */
122
+ class ThemeManager {
123
+ constructor() {
124
+ this.vegaPublicAPIRuntimeMetricsSlimmer = createPublicAPIRuntimeMetricsSlimmer(ThemeManager, ['overrideColors', 'reset', 'toggleDarkMode', 'isDarkMode', 'applyBranding'], ThemeManagerRuntimeMetricsPayloadDefinition);
125
+ }
126
+ /**
127
+ * It takes the colors you passed in, parses them into the correct format, and then applies them to the theme
128
+ *
129
+ * @param {VegaThemeOverrideColors} overrideColors - OverrideColors - This is the object that you pass to the function.
130
+ * @vegaVersion 1.20.0
131
+ */
132
+ async overrideColors(overrideColors) {
133
+ void VegaInternalThemeManager.overrideColors(overrideColors);
134
+ }
135
+ /**
136
+ * It removes all the custom override theme styles from the DOM
137
+ *
138
+ * @vegaVersion 1.20.0
139
+ */
140
+ async reset() {
141
+ void VegaInternalThemeManager.reset();
142
+ }
143
+ /**
144
+ * This function toggles the dark mode of a webpage by adding or removing a 'dark' class to the HTML element.
145
+ *
146
+ * @param {boolean | undefined} darkMode - A boolean or undefined value that determines whether to enable or disable dark mode.
147
+ * If it is true, dark mode is enabled.
148
+ * If it is false, dark mode is disabled.
149
+ * @vegaVersion 1.32.0
150
+ */
151
+ toggleDarkMode(darkMode) {
152
+ VegaInternalThemeManager.toggleDarkMode(darkMode);
153
+ }
154
+ /**
155
+ * The function checks if the HTML element has a class of "dark" and returns a boolean value accordingly.
156
+ *
157
+ * @returns {boolean} A boolean value indicating whether the HTML element has a class of "dark", which is
158
+ * typically used to indicate that the website is in dark mode.
159
+ * @vegaVersion 1.32.0
160
+ */
161
+ isDarkMode() {
162
+ return VegaInternalThemeManager.isDarkMode();
163
+ }
164
+ /**
165
+ * This function switches the Vega theme to a brand theme based on the provided options.
166
+ *
167
+ * @param {BrandOptions} options - The options includes 'gp', 'genius' and 'heartland' options
168
+ * @vegaVersion 2.47.0
169
+ */
170
+ applyBranding(options) {
171
+ VegaInternalThemeManager.applyBranding(options);
172
+ }
173
+ }
174
+ __decorate([
175
+ InjectVegaTelemetrySlimmer()
176
+ ], ThemeManager.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
177
+ const VegaThemeManager = new ThemeManager();
178
+
179
+ const RTE_TABLE_BORDER_STYLES = [
180
+ 'none',
181
+ 'solid',
182
+ 'dashed',
183
+ 'dotted',
184
+ 'double',
185
+ 'groove',
186
+ 'ridge',
187
+ 'inset',
188
+ 'outset',
189
+ ];
190
+ const RTE_TABLE_DEFAULT_COLORS = [
191
+ { key: 'white', dark: '#04041C', light: '#FCFCFC' },
192
+ { key: 'red', dark: '#AA091C', light: '#FF4C61' },
193
+ { key: 'orange', dark: '#974502', light: '#FDAB68' },
194
+ { key: 'yellow', dark: '#735C00', light: '#FFDC4C' },
195
+ { key: 'green', dark: '#2E6D18', light: '#7BDA58' },
196
+ { key: 'teal', dark: '#287171', light: '#7BD1D1' },
197
+ { key: 'gray', dark: '#595959', light: '#999999' },
198
+ { key: 'black', dark: '#FCFCFC', light: '#04041C' },
199
+ ];
200
+
201
+ /**
202
+ * Manages table colors for the rich text editor.
203
+ */
204
+ class RTETableColorManager {
205
+ /**
206
+ * Get the list of table colors.
207
+ *
208
+ * @returns {VegaRTEColorSchema[]} - Array of table colors.
209
+ */
210
+ static getTableColors() {
211
+ return RTETableColorManager.TABLE_COLORS;
212
+ }
213
+ /**
214
+ * Set the list of table colors.
215
+ *
216
+ * @param {VegaRTEColorSchema[]} colors - Array of table colors.
217
+ */
218
+ static setTableColors(colors) {
219
+ RTETableColorManager.TABLE_COLORS = colors;
220
+ }
221
+ /**
222
+ * Get color key from color value
223
+ *
224
+ * @param {string} colorValue - color value
225
+ * @returns {string} - color key
226
+ */
227
+ static getColorKey(colorValue) {
228
+ var _a;
229
+ let result = null;
230
+ const tableColors = RTETableColorManager.TABLE_COLORS;
231
+ if (tableColors) {
232
+ const hexColor = (_a = rgbToHex(colorValue)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
233
+ if (hexColor) {
234
+ result = tableColors.find((schema) => VegaThemeManager.isDarkMode() ? schema.dark === hexColor : schema.light === hexColor);
235
+ }
236
+ else {
237
+ for (const color of tableColors) {
238
+ if (color.key === colorValue) {
239
+ result = color;
240
+ break;
241
+ }
242
+ }
243
+ }
244
+ }
245
+ return result ? result.key : '';
246
+ }
247
+ }
248
+ RTETableColorManager.TABLE_COLORS = RTE_TABLE_DEFAULT_COLORS;
249
+
250
+ /**
251
+ * Class representing a table color annotation in the rich text editor.
252
+ */
253
+ class RTETableColorAnnotation extends BlockAnnotation {
254
+ constructor(colorKey) {
255
+ super();
256
+ this.type = RTETableExtensionAnnotationTypeEnum.COLOR;
257
+ if (colorKey) {
258
+ this.color = this.formatColor(colorKey);
259
+ }
260
+ }
261
+ /**
262
+ * Render the style for the annotation
263
+ *
264
+ * @returns {AnnotationStyle} The style object containing the color
265
+ */
266
+ renderStyle() {
267
+ const color = this.color
268
+ ? VegaInternalThemeManager.isDarkMode()
269
+ ? this.color.dark
270
+ : this.color.light
271
+ : '';
272
+ return { color };
273
+ }
274
+ /**
275
+ * Render the CSS class for the annotation
276
+ *
277
+ * @returns {Nullable<string>} Always returns null as no CSS class is used
278
+ */
279
+ renderClass() {
280
+ return null;
281
+ }
282
+ /**
283
+ * Convert the annotation to a JSON representation
284
+ *
285
+ * @returns {Record<string, string>} A JSON object containing the color key
286
+ */
287
+ toJSON() {
288
+ var _a;
289
+ return {
290
+ color: ((_a = this.color) === null || _a === void 0 ? void 0 : _a.key) || '',
291
+ };
292
+ }
293
+ /**
294
+ * Clone the current annotation
295
+ *
296
+ * @returns {BlockAnnotation<RTETableExtensionAnnotationTypeEnum.COLOR>} A new instance of RTETableColorAnnotation with the same color key
297
+ */
298
+ clone() {
299
+ var _a;
300
+ return new RTETableColorAnnotation((_a = this.color) === null || _a === void 0 ? void 0 : _a.key);
301
+ }
302
+ /**
303
+ * format table color
304
+ *
305
+ * @param {string} colorKey - table color
306
+ * @returns {Nullable<VegaRTEColorSchema>} - VegaRTEColorSchema
307
+ */
308
+ formatColor(colorKey) {
309
+ return RTETableColorManager.getTableColors().find((item) => item.key === colorKey);
310
+ }
311
+ }
6
312
 
7
313
  var RTETableExtensionAnnotationTypeEnum;
8
314
  (function (RTETableExtensionAnnotationTypeEnum) {
9
315
  RTETableExtensionAnnotationTypeEnum["TABLE"] = "EXTENSION_TABLE";
10
316
  RTETableExtensionAnnotationTypeEnum["CELL"] = "EXTENSION_TABLE_CELL";
11
317
  RTETableExtensionAnnotationTypeEnum["CAPTION"] = "EXTENSION_TABLE_CAPTION";
318
+ RTETableExtensionAnnotationTypeEnum["COLOR"] = "EXTENSION_TABLE_COLOR";
12
319
  })(RTETableExtensionAnnotationTypeEnum || (RTETableExtensionAnnotationTypeEnum = {}));
13
320
  /**
14
321
  * Class representing a table annotation in the rich text editor.
15
322
  */
16
323
  class RTETableAnnotation extends BlockAnnotation {
17
- constructor({ backgroundColor, border, width, height, alignment = 'center', } = {}) {
324
+ constructor({ backgroundColor, border, width, height, alignment, borderCollapse } = {}, useInternalStyle = true) {
18
325
  super();
19
326
  this.type = RTETableExtensionAnnotationTypeEnum.TABLE;
327
+ this.useInternalStyle = useInternalStyle;
20
328
  this.backgroundColor = backgroundColor;
21
329
  this.border = border;
22
330
  this.width = width;
23
331
  this.height = height;
24
- this.alignment = alignment;
332
+ this.alignment =
333
+ useInternalStyle && alignment === undefined ? RTETableAnnotation.DEFAULT_ALIGNMENT : alignment;
334
+ this.backgroundColorAnnotation = new RTETableColorAnnotation(backgroundColor);
335
+ this.borderColorAnnotation = new RTETableColorAnnotation(border === null || border === void 0 ? void 0 : border.color);
336
+ this.borderCollapse =
337
+ useInternalStyle && borderCollapse === undefined
338
+ ? RTETableAnnotation.DEFAULT_BORDER_COLLAPSE
339
+ : borderCollapse;
25
340
  }
26
341
  /**
27
342
  * @inheritDoc
28
343
  */
29
- static from(value) {
30
- return [RTETableExtensionAnnotationTypeEnum.TABLE, new RTETableAnnotation(value)];
344
+ static from(value, useInternalStyle = true) {
345
+ return [RTETableExtensionAnnotationTypeEnum.TABLE, new RTETableAnnotation(value, useInternalStyle)];
31
346
  }
32
347
  /**
33
348
  * Generates the CSS border string from the border properties.
@@ -38,7 +353,7 @@ class RTETableAnnotation extends BlockAnnotation {
38
353
  if (!this.border) {
39
354
  return null;
40
355
  }
41
- return `${this.border.style} ${this.border.width} ${this.border.color}`.trim();
356
+ return `${this.border.style} ${this.border.width} ${this.borderColorAnnotation.renderStyle().color}`.trim();
42
357
  }
43
358
  /**
44
359
  * @inheritDoc
@@ -50,7 +365,8 @@ class RTETableAnnotation extends BlockAnnotation {
50
365
  width: this.width,
51
366
  height: this.height,
52
367
  alignment: this.alignment,
53
- });
368
+ borderCollapse: this.borderCollapse,
369
+ }, this.useInternalStyle);
54
370
  }
55
371
  /**
56
372
  * @inheritDoc
@@ -63,6 +379,7 @@ class RTETableAnnotation extends BlockAnnotation {
63
379
  width: this.width,
64
380
  height: this.height,
65
381
  alignment: this.alignment,
382
+ borderCollapse: this.borderCollapse,
66
383
  }),
67
384
  };
68
385
  }
@@ -70,11 +387,10 @@ class RTETableAnnotation extends BlockAnnotation {
70
387
  * @inheritDoc
71
388
  */
72
389
  renderStyle() {
73
- const defaultStyles = {
74
- borderCollapse: 'collapse',
75
- };
76
- const tableStyles = Object.assign({ backgroundColor: this.backgroundColor, border: this.borderStr, width: this.width, height: this.height }, this.renderAlignmentStyle());
77
- return cleanObject(Object.assign(Object.assign({}, defaultStyles), tableStyles));
390
+ const backgroundColor = this.backgroundColorAnnotation.renderStyle().color;
391
+ const tableStyles = Object.assign({ border: this.borderStr, width: this.width, height: this.height, borderCollapse: this.borderCollapse }, this.renderAlignmentStyle());
392
+ backgroundColor && (tableStyles.backgroundColor = backgroundColor);
393
+ return cleanObject(tableStyles);
78
394
  }
79
395
  /**
80
396
  * @inheritDoc
@@ -88,11 +404,15 @@ class RTETableAnnotation extends BlockAnnotation {
88
404
  * @returns {Record<string, string>} The alignment styles.
89
405
  */
90
406
  renderAlignmentStyle() {
407
+ if (!this.alignment)
408
+ return {};
91
409
  return {
92
410
  margin: this.alignment === 'center' ? '0 auto' : this.alignment === 'left' ? '0' : '0 0 0 auto',
93
411
  };
94
412
  }
95
413
  }
414
+ RTETableAnnotation.DEFAULT_BORDER_COLLAPSE = 'collapse';
415
+ RTETableAnnotation.DEFAULT_ALIGNMENT = 'center';
96
416
 
97
417
  /**
98
418
  * Class representing a table block in the rich text editor.
@@ -116,7 +436,7 @@ class RTETableBlock extends RTEBlock {
116
436
  super.convertAnnotationsToMap(tableBlock.annotationMap, Object.assign({}, block.annotations));
117
437
  tableBlock.children = super.generateBlockChildren(block.children, options, tableBlock);
118
438
  if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.table) {
119
- tableBlock.annotationMap.set(...RTETableAnnotation.from(block.annotations.table));
439
+ tableBlock.annotationMap.set(...RTETableAnnotation.from(block.annotations.table, options === null || options === void 0 ? void 0 : options.autoMatchFormat));
120
440
  }
121
441
  return tableBlock;
122
442
  }
@@ -219,6 +539,7 @@ var TableSettingType;
219
539
  TableSettingType["MERGE_CELLS"] = "MERGE_CELLS";
220
540
  TableSettingType["TABLE"] = "TABLE";
221
541
  TableSettingType["CELL"] = "CELL";
542
+ TableSettingType["SPLIT_CELL"] = "SPLIT_CELL";
222
543
  })(TableSettingType || (TableSettingType = {}));
223
544
  /**
224
545
  * Abstract class for setting event handlers.
@@ -428,28 +749,194 @@ class RTETableBodyBlock extends RTEBlock {
428
749
  }
429
750
 
430
751
  /**
431
- * Class representing a table head block in the rich text editor.
752
+ * Class representing a table cell annotation in the rich text editor.
432
753
  */
433
- class RTETableHeadBlock extends RTEBlock {
434
- constructor(id) {
754
+ class RTETableCellAnnotation extends BlockAnnotation {
755
+ constructor({ backgroundColor, padding, border, width, height, textAlign, verticalAlign, minWidth, boxSizing, } = {}, useInternalStyle = true) {
756
+ super();
757
+ this.type = RTETableExtensionAnnotationTypeEnum.CELL;
758
+ this.useInternalStyle = useInternalStyle;
759
+ this.backgroundColor = backgroundColor;
760
+ this.width = width;
761
+ this.height = height;
762
+ this.backgroundColorAnnotation = new RTETableColorAnnotation(backgroundColor);
763
+ this.borderColorAnnotation = new RTETableColorAnnotation(border === null || border === void 0 ? void 0 : border.color);
764
+ this.padding =
765
+ useInternalStyle && padding === undefined ? RTETableCellAnnotation.DEFAULT_PADDING : padding;
766
+ this.border =
767
+ useInternalStyle && border === undefined ? RTETableCellAnnotation.DEFAULT_BORDER : border;
768
+ this.textAlign =
769
+ useInternalStyle && textAlign === undefined
770
+ ? RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN
771
+ : textAlign;
772
+ this.verticalAlign =
773
+ useInternalStyle && verticalAlign === undefined
774
+ ? RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN
775
+ : verticalAlign;
776
+ this.minWidth =
777
+ useInternalStyle && minWidth === undefined
778
+ ? RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH
779
+ : minWidth;
780
+ this.boxSizing =
781
+ useInternalStyle && boxSizing === undefined
782
+ ? RTETableCellAnnotation.DEFAULT_BOX_SIZING
783
+ : boxSizing;
784
+ }
785
+ /**
786
+ * @inheritDoc
787
+ */
788
+ static from(cellAnnotation, useInternalStyle) {
789
+ return [
790
+ RTETableExtensionAnnotationTypeEnum.CELL,
791
+ new RTETableCellAnnotation(cellAnnotation, useInternalStyle),
792
+ ];
793
+ }
794
+ /**
795
+ * Generates the CSS border string from the border properties.
796
+ *
797
+ * @returns {Nullable<string>} The CSS border string.
798
+ */
799
+ get borderStr() {
800
+ if (!this.border)
801
+ return null;
802
+ return `${this.border.style} ${this.border.width} ${this.borderColorAnnotation.renderStyle().color ||
803
+ RTETableCellAnnotation.DEFAULT_BORDER.color}`;
804
+ }
805
+ /**
806
+ * @inheritDoc
807
+ */
808
+ clone() {
809
+ return new RTETableCellAnnotation({
810
+ backgroundColor: this.backgroundColor,
811
+ padding: this.padding,
812
+ border: this.border,
813
+ width: this.width,
814
+ height: this.height,
815
+ textAlign: this.textAlign,
816
+ verticalAlign: this.verticalAlign,
817
+ minWidth: this.minWidth,
818
+ boxSizing: this.boxSizing,
819
+ }, this.useInternalStyle);
820
+ }
821
+ /**
822
+ * @inheritDoc
823
+ */
824
+ toJSON() {
825
+ return {
826
+ tableCell: cleanObject({
827
+ backgroundColor: this.backgroundColor,
828
+ padding: this.padding,
829
+ border: this.border,
830
+ width: this.width,
831
+ height: this.height,
832
+ textAlign: this.textAlign,
833
+ verticalAlign: this.verticalAlign,
834
+ minWidth: this.minWidth,
835
+ boxSizing: this.boxSizing,
836
+ }),
837
+ };
838
+ }
839
+ /**
840
+ * @inheritDoc
841
+ */
842
+ renderStyle(options) {
843
+ const backgroundColor = this.backgroundColorAnnotation.renderStyle().color;
844
+ const style = {
845
+ padding: this.padding,
846
+ border: this.borderStr,
847
+ width: this.width,
848
+ height: this.height,
849
+ textAlign: this.textAlign,
850
+ verticalAlign: this.verticalAlign,
851
+ minWidth: this.minWidth,
852
+ boxSizing: this.boxSizing,
853
+ };
854
+ if (backgroundColor) {
855
+ style.backgroundColor = backgroundColor;
856
+ }
857
+ if (!(options === null || options === void 0 ? void 0 : options.standalone)) {
858
+ return cleanObject(this.removeDefaultValues(style));
859
+ }
860
+ return cleanObject(style);
861
+ }
862
+ /**
863
+ * @inheritDoc
864
+ */
865
+ renderClass() {
866
+ return null;
867
+ }
868
+ /**
869
+ * Removes default values from the style object to avoid redundancy.
870
+ *
871
+ * @param {Record<string, Nullable<string>>} style - The style object to clean.
872
+ * @returns {Record<string, Nullable<string>>} The cleaned style object.
873
+ */
874
+ removeDefaultValues(style) {
875
+ const cleanedStyle = Object.assign({}, style);
876
+ if (cleanedStyle.padding === RTETableCellAnnotation.DEFAULT_PADDING) {
877
+ delete cleanedStyle.padding;
878
+ }
879
+ if (cleanedStyle.border ===
880
+ `${RTETableCellAnnotation.DEFAULT_BORDER.style} ${RTETableCellAnnotation.DEFAULT_BORDER.width} ${RTETableCellAnnotation.DEFAULT_BORDER.color}`) {
881
+ delete cleanedStyle.border;
882
+ }
883
+ if (cleanedStyle.textAlign === RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN) {
884
+ delete cleanedStyle.textAlign;
885
+ }
886
+ if (cleanedStyle.verticalAlign === RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN) {
887
+ delete cleanedStyle.verticalAlign;
888
+ }
889
+ if (cleanedStyle.minWidth === RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH) {
890
+ delete cleanedStyle.minWidth;
891
+ }
892
+ if (cleanedStyle.boxSizing === RTETableCellAnnotation.DEFAULT_BOX_SIZING) {
893
+ delete cleanedStyle.boxSizing;
894
+ }
895
+ return cleanedStyle;
896
+ }
897
+ }
898
+ RTETableCellAnnotation.DEFAULT_PADDING = '12px';
899
+ RTETableCellAnnotation.DEFAULT_BORDER = {
900
+ style: 'solid',
901
+ width: '1px',
902
+ color: '#ddd',
903
+ };
904
+ RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN = 'left';
905
+ RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN = 'middle';
906
+ RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH = '55px';
907
+ RTETableCellAnnotation.DEFAULT_BOX_SIZING = 'border-box';
908
+
909
+ /**
910
+ * Class representing a table cell block in the rich text editor.
911
+ */
912
+ class RTETableCellBlock extends RTEBlock {
913
+ constructor(id, options) {
435
914
  super(id);
436
- this.type = 'table-head';
915
+ this.type = 'table-cell';
437
916
  this.children = [];
917
+ const { autoMatchFormat } = options || { autoMatchFormat: true };
918
+ if (autoMatchFormat) {
919
+ this.annotationMap.set(RTETableExtensionAnnotationTypeEnum.CELL, new RTETableCellAnnotation());
920
+ }
438
921
  }
439
922
  /**
440
923
  * @inheritDoc
441
924
  */
442
925
  static from(block, options) {
443
- const headBlock = new RTETableHeadBlock(block.id);
444
- super.convertAnnotationsToMap(headBlock.annotationMap, Object.assign({}, block.annotations));
445
- headBlock.children = super.generateBlockChildren(block.children, options, headBlock);
446
- return headBlock;
926
+ var _a;
927
+ const tableCellBlock = new RTETableCellBlock(block.id, options);
928
+ super.convertAnnotationsToMap(tableCellBlock.annotationMap, Object.assign({}, block.annotations));
929
+ if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
930
+ tableCellBlock.annotationMap.set(...RTETableCellAnnotation.from(block.annotations.tableCell, options === null || options === void 0 ? void 0 : options.autoMatchFormat));
931
+ }
932
+ tableCellBlock.children = super.generateBlockChildren(block.children, options, tableCellBlock);
933
+ return tableCellBlock;
447
934
  }
448
935
  /**
449
936
  * @inheritDoc
450
937
  */
451
938
  clone(parent) {
452
- const clonedBlock = new RTETableHeadBlock(this.id);
939
+ const clonedBlock = new RTETableCellBlock(this.id);
453
940
  clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
454
941
  clonedBlock.parent = parent;
455
942
  clonedBlock.annotationMap = super.cloneAnnotations();
@@ -467,17 +954,31 @@ class RTETableHeadBlock extends RTEBlock {
467
954
  isNotEmpty() {
468
955
  return this.children.length > 0;
469
956
  }
957
+ /**
958
+ * Get the rowSpan of the table cell
959
+ *
960
+ * @returns {number} - rowSpan value
961
+ */
962
+ get rowSpan() {
963
+ const rowSpan = this.getCustomAttributeByName('rowspan');
964
+ return !isNaN(Number(rowSpan)) ? Math.max(Number(rowSpan), 1) : 1;
965
+ }
966
+ /**
967
+ * Get the colSpan of the table cell
968
+ *
969
+ * @returns {number} - colSpan value
970
+ */
971
+ get colSpan() {
972
+ const colSpan = this.getCustomAttributeByName('colspan');
973
+ return !isNaN(Number(colSpan)) ? Math.max(Number(colSpan), 1) : 1;
974
+ }
470
975
  /**
471
976
  * @inheritDoc
472
977
  */
473
978
  toHtml() {
474
- const childrenHtml = this.children
475
- .map((child) => {
476
- return child.toHtml();
477
- })
478
- .join('');
979
+ const childrenHtml = this.children.map((child) => child.toHtml()).join('');
479
980
  const attrStr = super.generateAttributeString();
480
- return `<thead${attrStr}>${childrenHtml}</thead>`;
981
+ return `<td${attrStr}>${childrenHtml}</td>`;
481
982
  }
482
983
  /**
483
984
  * @inheritDoc
@@ -485,9 +986,290 @@ class RTETableHeadBlock extends RTEBlock {
485
986
  toJSON() {
486
987
  return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
487
988
  }
488
- }
489
-
490
- /**
989
+ /**
990
+ * Get custom attribute by name
991
+ *
992
+ * @param {string} attrName - attribute name
993
+ * @returns {Nullable<string>} - attribute value
994
+ */
995
+ getCustomAttributeByName(attrName) {
996
+ const customAttrAnnotation = this.getCustomAttributesAnnotation();
997
+ if (customAttrAnnotation) {
998
+ const customAttributes = customAttrAnnotation.toJSON()['customAttribute'] || {};
999
+ return customAttributes[attrName];
1000
+ }
1001
+ }
1002
+ }
1003
+
1004
+ /**
1005
+ * Class representing a table head block in the rich text editor.
1006
+ */
1007
+ class RTETableHeadBlock extends RTEBlock {
1008
+ constructor(id) {
1009
+ super(id);
1010
+ this.type = 'table-head';
1011
+ this.children = [];
1012
+ }
1013
+ /**
1014
+ * @inheritDoc
1015
+ */
1016
+ static from(block, options) {
1017
+ const headBlock = new RTETableHeadBlock(block.id);
1018
+ super.convertAnnotationsToMap(headBlock.annotationMap, Object.assign({}, block.annotations));
1019
+ headBlock.children = super.generateBlockChildren(block.children, options, headBlock);
1020
+ return headBlock;
1021
+ }
1022
+ /**
1023
+ * @inheritDoc
1024
+ */
1025
+ clone(parent) {
1026
+ const clonedBlock = new RTETableHeadBlock(this.id);
1027
+ clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
1028
+ clonedBlock.parent = parent;
1029
+ clonedBlock.annotationMap = super.cloneAnnotations();
1030
+ return clonedBlock;
1031
+ }
1032
+ /**
1033
+ * @inheritDoc
1034
+ */
1035
+ getLastNode() {
1036
+ return this.children[this.children.length - 1].getLastNode();
1037
+ }
1038
+ /**
1039
+ * @inheritDoc
1040
+ */
1041
+ isNotEmpty() {
1042
+ return this.children.length > 0;
1043
+ }
1044
+ /**
1045
+ * @inheritDoc
1046
+ */
1047
+ toHtml() {
1048
+ const childrenHtml = this.children
1049
+ .map((child) => {
1050
+ return child.toHtml();
1051
+ })
1052
+ .join('');
1053
+ const attrStr = super.generateAttributeString();
1054
+ return `<thead${attrStr}>${childrenHtml}</thead>`;
1055
+ }
1056
+ /**
1057
+ * @inheritDoc
1058
+ */
1059
+ toJSON() {
1060
+ return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
1061
+ }
1062
+ }
1063
+
1064
+ /**
1065
+ * Class representing a table head cell annotation in the rich text editor.
1066
+ */
1067
+ class RTETableHeadCellAnnotation extends RTETableCellAnnotation {
1068
+ constructor(annotation = {}, useInternalStyle = true) {
1069
+ super(annotation, useInternalStyle);
1070
+ }
1071
+ /**
1072
+ * @inheritDoc
1073
+ */
1074
+ static from(cellAnnotation, useInternalStyle) {
1075
+ return [
1076
+ RTETableExtensionAnnotationTypeEnum.CELL,
1077
+ new RTETableHeadCellAnnotation(cellAnnotation, useInternalStyle),
1078
+ ];
1079
+ }
1080
+ /**
1081
+ * @inheritDoc
1082
+ */
1083
+ clone() {
1084
+ return new RTETableHeadCellAnnotation({
1085
+ backgroundColor: this.backgroundColor,
1086
+ padding: this.padding,
1087
+ border: this.border,
1088
+ width: this.width,
1089
+ height: this.height,
1090
+ textAlign: this.textAlign,
1091
+ verticalAlign: this.verticalAlign,
1092
+ minWidth: this.minWidth,
1093
+ boxSizing: this.boxSizing,
1094
+ }, this.useInternalStyle);
1095
+ }
1096
+ /**
1097
+ * @inheritDoc
1098
+ */
1099
+ renderStyle(options) {
1100
+ var _a;
1101
+ const styles = super.renderStyle(options);
1102
+ return cleanObject(Object.assign(Object.assign({}, styles), { backgroundColor: (_a = styles.backgroundColor) !== null && _a !== void 0 ? _a : RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR }));
1103
+ }
1104
+ }
1105
+ RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR = '#f2f2f2';
1106
+
1107
+ /**
1108
+ * Class representing a table head block in the rich text editor.
1109
+ */
1110
+ class RTETableHeadCellBlock extends RTETableCellBlock {
1111
+ constructor(id, options) {
1112
+ super(id, options);
1113
+ this.type = 'table-head-cell';
1114
+ const { autoMatchFormat } = options || { autoMatchFormat: true };
1115
+ if (autoMatchFormat) {
1116
+ this.annotationMap.set(RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation());
1117
+ }
1118
+ }
1119
+ /**
1120
+ * @inheritDoc
1121
+ */
1122
+ static from(block, options) {
1123
+ var _a;
1124
+ const headCellBlock = new RTETableHeadCellBlock(block.id, options);
1125
+ super.convertAnnotationsToMap(headCellBlock.annotationMap, Object.assign({}, block.annotations));
1126
+ if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
1127
+ headCellBlock.annotationMap.set(...RTETableHeadCellAnnotation.from(block.annotations.tableCell, options === null || options === void 0 ? void 0 : options.autoMatchFormat));
1128
+ }
1129
+ headCellBlock.children = super.generateBlockChildren(block.children, options, headCellBlock);
1130
+ return headCellBlock;
1131
+ }
1132
+ /**
1133
+ * @inheritDoc
1134
+ */
1135
+ clone(parent) {
1136
+ const clonedBlock = new RTETableHeadCellBlock(this.id);
1137
+ clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
1138
+ clonedBlock.parent = parent;
1139
+ clonedBlock.annotationMap = super.cloneAnnotations();
1140
+ return clonedBlock;
1141
+ }
1142
+ /**
1143
+ * @inheritDoc
1144
+ */
1145
+ toHtml() {
1146
+ const childrenHtml = this.children.map((child) => child.toHtml()).join('');
1147
+ const attrStr = super.generateAttributeString();
1148
+ return `<th${attrStr}>${childrenHtml}</th>`;
1149
+ }
1150
+ /**
1151
+ * @inheritDoc
1152
+ */
1153
+ toJSON() {
1154
+ return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
1155
+ }
1156
+ }
1157
+
1158
+ const MERGE_CELLS = 'MERGE_CELLS';
1159
+ /**
1160
+ * Action to merge cells into the RTETable.
1161
+ */
1162
+ class MergeCellsAction extends ModifyContentAction {
1163
+ constructor(targetCell, mergeCells, colSpan, rowSpan, direction) {
1164
+ super();
1165
+ this.type = MERGE_CELLS;
1166
+ this.isFlushable = true;
1167
+ this.targetCell = targetCell;
1168
+ this.mergeCells = mergeCells;
1169
+ this.colSpan = colSpan;
1170
+ this.rowSpan = rowSpan;
1171
+ this.direction = direction;
1172
+ }
1173
+ }
1174
+
1175
+ var MergeCellsOperationType;
1176
+ (function (MergeCellsOperationType) {
1177
+ MergeCellsOperationType["MERGE_CELLS"] = "MERGE_CELLS";
1178
+ MergeCellsOperationType["MERGE_CELL_UP"] = "MERGE_CELL_UP";
1179
+ MergeCellsOperationType["MERGE_CELL_RIGHT"] = "MERGE_CELL_RIGHT";
1180
+ MergeCellsOperationType["MERGE_CELL_DOWN"] = "MERGE_CELL_DOWN";
1181
+ MergeCellsOperationType["MERGE_CELL_LEFT"] = "MERGE_CELL_LEFT";
1182
+ })(MergeCellsOperationType || (MergeCellsOperationType = {}));
1183
+ /**
1184
+ * Event handler for merge cells operations in a table.
1185
+ */
1186
+ class MergeCellsOperationEventHandler extends SettingEventHandler {
1187
+ /**
1188
+ * @inheritDoc
1189
+ */
1190
+ canHandle(action) {
1191
+ return action[0] === TableSettingType.MERGE_CELLS;
1192
+ }
1193
+ /**
1194
+ * @inheritDoc
1195
+ */
1196
+ execute(action, extensionContext) {
1197
+ const selectedCells = extensionContext.tableSelection.getSelectedCells();
1198
+ const operation = action[1];
1199
+ switch (operation) {
1200
+ case MergeCellsOperationType.MERGE_CELL_UP:
1201
+ case MergeCellsOperationType.MERGE_CELL_RIGHT:
1202
+ case MergeCellsOperationType.MERGE_CELL_DOWN:
1203
+ case MergeCellsOperationType.MERGE_CELL_LEFT:
1204
+ {
1205
+ const mergeCells = this.getDirectionMergeCells(operation, selectedCells[0]);
1206
+ this.handleMergeCells(mergeCells, operation);
1207
+ }
1208
+ break;
1209
+ default:
1210
+ {
1211
+ if (selectedCells.length > 1) {
1212
+ this.handleMergeCells(selectedCells, MergeCellsOperationType.MERGE_CELLS);
1213
+ }
1214
+ }
1215
+ break;
1216
+ }
1217
+ }
1218
+ /**
1219
+ * Get the adjacent cell in the specified direction.
1220
+ *
1221
+ * @param {MergeCellsOperationType} direction - The direction to look for the adjacent cell.
1222
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} cell - The current cell.
1223
+ * @returns {Array<RTETableCellBlock | RTETableHeadCellBlock>} Array containing the cells to merge.
1224
+ */
1225
+ getDirectionMergeCells(direction, cell) {
1226
+ const adjacent = getAdjacentCell(cell, direction);
1227
+ if (!adjacent) {
1228
+ return [cell];
1229
+ }
1230
+ switch (direction) {
1231
+ case MergeCellsOperationType.MERGE_CELL_UP:
1232
+ return [adjacent, cell];
1233
+ case MergeCellsOperationType.MERGE_CELL_DOWN:
1234
+ return [cell, adjacent];
1235
+ case MergeCellsOperationType.MERGE_CELL_LEFT:
1236
+ return [adjacent, cell];
1237
+ default:
1238
+ return [cell, adjacent];
1239
+ }
1240
+ }
1241
+ /**
1242
+ * Handle the merge cells operation by creating and applying a MergeCellsAction.
1243
+ *
1244
+ * @param {Array<RTETableCellBlock | RTETableHeadCellBlock>} mergeCells - The cells to merge.
1245
+ * @param {MergeCellsOperationType} direction - The merge cell direction.
1246
+ */
1247
+ handleMergeCells(mergeCells, direction) {
1248
+ if (mergeCells.length < 2) {
1249
+ return;
1250
+ }
1251
+ const rectInfo = getRectangularBounds(mergeCells);
1252
+ const { minRow, maxRow, minCol, maxCol, targetCell } = rectInfo;
1253
+ const colSpan = maxCol - minCol + 1;
1254
+ const rowSpan = maxRow - minRow + 1;
1255
+ const action = new MergeCellsAction(targetCell, mergeCells, colSpan, rowSpan, direction);
1256
+ this.applyActionOnTable(action, targetCell);
1257
+ }
1258
+ /**
1259
+ * Apply the specified action on the table containing the selected cell.
1260
+ *
1261
+ * @param {MergeCellsAction} action - The action to apply.
1262
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} selectedCell - The selected table cell.
1263
+ */
1264
+ applyActionOnTable(action, selectedCell) {
1265
+ const table = getParentBlockByType(selectedCell, RTETableBlock);
1266
+ if (table) {
1267
+ table.apply(action);
1268
+ }
1269
+ }
1270
+ }
1271
+
1272
+ /**
491
1273
  * Recursively searches for a parent block of a specific type.
492
1274
  *
493
1275
  * @typedef T - Generic type extending RTEBlock.
@@ -585,400 +1367,376 @@ function getDefaultCellBlockTemplate(cellType) {
585
1367
  ],
586
1368
  };
587
1369
  }
588
-
589
- var RowOperationType;
590
- (function (RowOperationType) {
591
- RowOperationType["HEADER_ROW"] = "HEADER_ROW";
592
- RowOperationType["ADD_ROW_ABOVE"] = "ADD_ROW_ABOVE";
593
- RowOperationType["ADD_ROW_BELOW"] = "ADD_ROW_BELOW";
594
- RowOperationType["DELETE_ROW"] = "DELETE_ROW";
595
- RowOperationType["SELECT_ROW"] = "SELECT_ROW";
596
- })(RowOperationType || (RowOperationType = {}));
597
1370
  /**
598
- * Event handler for row operations in a table.
1371
+ * Get the actual col span and row span of a cell.
1372
+ *
1373
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} cell - The cell to check.
1374
+ * @returns {CellSpan} The actual span values.
599
1375
  */
600
- class RowOperationEventHandler extends SettingEventHandler {
601
- /**
602
- * @inheritDoc
603
- */
604
- canHandle(action) {
605
- return action[0] === TableSettingType.ROW;
606
- }
607
- /**
608
- * @inheritDoc
609
- */
610
- execute(action, extensionContext) {
611
- const operation = action[1];
612
- switch (operation) {
613
- case RowOperationType.ADD_ROW_ABOVE:
614
- case RowOperationType.ADD_ROW_BELOW:
615
- this.handleInsertRow(operation, extensionContext);
616
- break;
617
- case RowOperationType.DELETE_ROW:
618
- this.handleDeleteRow(extensionContext);
619
- break;
620
- case RowOperationType.HEADER_ROW:
621
- this.handleToggleHeader(extensionContext);
622
- break;
623
- case RowOperationType.SELECT_ROW:
624
- this.handleSelectRow(extensionContext);
625
- break;
626
- }
627
- }
628
- /**
629
- * Adds a new row to the table at the specified position.
630
- *
631
- * @param {RowOperationType} direction - The position to insert the new row (above or below).
632
- * @param {RTETableExtensionContext} extensionContext - The extension context.
633
- */
634
- handleInsertRow(direction, extensionContext) {
635
- const selectedRows = this.getAllSelectedRows(extensionContext);
636
- if (selectedRows.length > 0) {
637
- const action = new InsertTableRowAction(direction === RowOperationType.ADD_ROW_ABOVE
638
- ? InsertTableRowDirection.ABOVE
639
- : InsertTableRowDirection.BELOW, selectedRows);
640
- this.applyActionToTable(selectedRows[0], action);
641
- }
642
- }
643
- /**
644
- * Deletes the selected row(s) from the table.
645
- *
646
- * @param {RTETableExtensionContext} extensionContext - The extension context.
647
- */
648
- handleDeleteRow(extensionContext) {
649
- const selectedRows = this.getAllSelectedRows(extensionContext);
650
- if (selectedRows.length) {
651
- const action = new DeleteTableRowAction(selectedRows);
652
- this.applyActionToTable(selectedRows[0], action);
653
- }
654
- }
655
- /**
656
- * Converts selected rows to header rows or reverts them back to normal rows.
657
- *
658
- * @param {RTETableExtensionContext} extensionContext - The extension context.
659
- */
660
- handleToggleHeader(extensionContext) {
661
- const selectedRows = this.getAllSelectedRows(extensionContext);
662
- if (selectedRows.length > 0) {
663
- const action = new ToggleHeaderRowAction(selectedRows);
664
- this.applyActionToTable(selectedRows[0], action);
665
- }
666
- }
667
- /**
668
- * Selects the focus row(s) in the table.
669
- *
670
- * @param {RTETableExtensionContext} extensionContext - The extension context.
671
- */
672
- handleSelectRow(extensionContext) {
673
- const selectedRows = this.getAllSelectedRows(extensionContext);
674
- if (selectedRows.length > 0 && extensionContext && extensionContext.tableSelection) {
675
- const allCells = selectedRows.flatMap((row) => row.children);
676
- extensionContext.tableSelection.setSelectedCells(allCells);
677
- }
678
- }
679
- /**
680
- * Get all selected table rows.
681
- *
682
- * @param {RTETableExtensionContext} extensionContext - The extension context.
683
- * @returns {RTETableRowBlock[]} The selected table row blocks.
684
- */
685
- getAllSelectedRows(extensionContext) {
686
- const selectedRows = new Set();
687
- if (extensionContext && extensionContext.tableSelection) {
688
- const { tableSelection } = extensionContext;
689
- const selectedCells = tableSelection.getSelectedCells();
690
- selectedCells.forEach((cell) => {
691
- const rowBlock = getParentBlockByType(cell, RTETableRowBlock);
692
- if (rowBlock) {
693
- selectedRows.add(rowBlock);
694
- }
695
- });
696
- }
697
- return Array.from(selectedRows);
698
- }
699
- /**
700
- * Applies the given action to the table containing the reference block.
701
- *
702
- * @param {RTEBlock} refBlock - The reference block within the table.
703
- * @param {ModifyContentAction} action - The action to apply to the table.
704
- */
705
- applyActionToTable(refBlock, action) {
706
- const table = getParentBlockByType(refBlock, RTETableBlock);
707
- if (table) {
708
- table.apply(action);
709
- }
710
- }
1376
+ function getCellSpan(cell) {
1377
+ return { colSpan: cell.colSpan, rowSpan: cell.rowSpan };
711
1378
  }
712
-
713
1379
  /**
714
- * Class representing a table cell annotation in the rich text editor.
1380
+ * Get the actual column position of a cell considering previous cells' colspan
1381
+ * and cells from previous rows with rowspan that extend into the current row.
1382
+ *
1383
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} cell - The cell to check.
1384
+ * @param {RTETableRowBlock[]} allRows - The table all rows.
1385
+ * @returns {number} The actual column position.
715
1386
  */
716
- class RTETableCellAnnotation extends BlockAnnotation {
717
- constructor({ backgroundColor, padding = RTETableCellAnnotation.DEFAULT_PADDING, border = RTETableCellAnnotation.DEFAULT_BORDER, width, height, textAlign = RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN, verticalAlign = RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN, } = {}) {
718
- super();
719
- this.type = RTETableExtensionAnnotationTypeEnum.CELL;
720
- this.backgroundColor = backgroundColor;
721
- this.padding = padding;
722
- this.border = border;
723
- this.width = width;
724
- this.height = height;
725
- this.textAlign = textAlign;
726
- this.verticalAlign = verticalAlign;
727
- }
728
- /**
729
- * @inheritDoc
730
- */
731
- static from(cellAnnotation) {
732
- return [RTETableExtensionAnnotationTypeEnum.CELL, new RTETableCellAnnotation(cellAnnotation)];
733
- }
734
- /**
735
- * Generates the CSS border string from the border properties.
736
- *
737
- * @returns {Nullable<string>} The CSS border string.
738
- */
739
- get borderStr() {
740
- if (!this.border)
741
- return null;
742
- return `${this.border.style} ${this.border.width} ${this.border.color}`;
743
- }
744
- /**
745
- * @inheritDoc
746
- */
747
- clone() {
748
- return new RTETableCellAnnotation({
749
- backgroundColor: this.backgroundColor,
750
- padding: this.padding,
751
- border: this.border,
752
- width: this.width,
753
- height: this.height,
754
- textAlign: this.textAlign,
755
- verticalAlign: this.verticalAlign,
756
- });
757
- }
758
- /**
759
- * @inheritDoc
760
- */
761
- toJSON() {
762
- return {
763
- tableCell: cleanObject({
764
- backgroundColor: this.backgroundColor,
765
- padding: this.padding,
766
- border: this.border,
767
- width: this.width,
768
- height: this.height,
769
- textAlign: this.textAlign,
770
- verticalAlign: this.verticalAlign,
771
- }),
772
- };
773
- }
774
- /**
775
- * @inheritDoc
776
- */
777
- renderStyle(options) {
778
- const style = {
779
- backgroundColor: this.backgroundColor,
780
- padding: this.padding,
781
- border: this.borderStr,
782
- width: this.width,
783
- height: this.height,
784
- textAlign: this.textAlign,
785
- verticalAlign: this.verticalAlign,
786
- };
787
- if (!(options === null || options === void 0 ? void 0 : options.standalone)) {
788
- return cleanObject(this.removeDefaultValues(style));
789
- }
790
- return cleanObject(Object.assign(Object.assign({}, style), { minWidth: RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH }));
791
- }
792
- /**
793
- * @inheritDoc
794
- */
795
- renderClass() {
796
- return null;
797
- }
798
- /**
799
- * Removes default values from the style object to avoid redundancy.
800
- *
801
- * @param {Record<string, Nullable<string>>} style - The style object to clean.
802
- * @returns {Record<string, Nullable<string>>} The cleaned style object.
803
- */
804
- removeDefaultValues(style) {
805
- const cleanedStyle = Object.assign({}, style);
806
- if (cleanedStyle.padding === RTETableCellAnnotation.DEFAULT_PADDING) {
807
- delete cleanedStyle.padding;
808
- }
809
- if (cleanedStyle.border ===
810
- `${RTETableCellAnnotation.DEFAULT_BORDER.style} ${RTETableCellAnnotation.DEFAULT_BORDER.width} ${RTETableCellAnnotation.DEFAULT_BORDER.color}`) {
811
- delete cleanedStyle.border;
812
- }
813
- if (cleanedStyle.textAlign === RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN) {
814
- delete cleanedStyle.textAlign;
815
- }
816
- if (cleanedStyle.verticalAlign === RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN) {
817
- delete cleanedStyle.verticalAlign;
1387
+ function getActualColumnPosition(cell, allRows) {
1388
+ const tableGrid = buildTableGrid(allRows);
1389
+ for (let row = 0; row < tableGrid.length; row++) {
1390
+ const cols = tableGrid[row];
1391
+ for (let col = 0; col < cols.length; col++) {
1392
+ if (cols[col] === cell.id) {
1393
+ return col;
1394
+ }
818
1395
  }
819
- return cleanedStyle;
820
1396
  }
1397
+ return -1;
821
1398
  }
822
- RTETableCellAnnotation.DEFAULT_PADDING = '12px';
823
- RTETableCellAnnotation.DEFAULT_BORDER = {
824
- style: 'solid',
825
- width: '1px',
826
- color: '#ddd',
827
- };
828
- RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN = 'left';
829
- RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN = 'middle';
830
- RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH = '30px';
831
-
832
1399
  /**
833
- * Class representing a table cell block in the rich text editor.
1400
+ * Build a 2D grid representation of a table section where each occupied position
1401
+ * contains the cell id covering that (row, col) coordinate, accounting for colSpan/rowSpan.
1402
+ *
1403
+ * @param {RTETableRowBlock[]} allRows - All rows in the current table section.
1404
+ * @returns {string[][]} The table grid.
834
1405
  */
835
- class RTETableCellBlock extends RTEBlock {
836
- constructor(id, options) {
837
- super(id);
838
- this.type = 'table-cell';
839
- this.children = [];
840
- const { autoMatchFormat } = options || { autoMatchFormat: true };
841
- if (autoMatchFormat) {
842
- this.annotationMap.set(RTETableExtensionAnnotationTypeEnum.CELL, new RTETableCellAnnotation());
1406
+ function buildTableGrid(allRows) {
1407
+ const grid = [];
1408
+ allRows.forEach((row, rowIndex) => {
1409
+ if (!grid[rowIndex]) {
1410
+ grid[rowIndex] = [];
843
1411
  }
1412
+ let colIndex = 0;
1413
+ row.children.forEach((cell) => {
1414
+ const { colSpan, rowSpan } = getCellSpan(cell);
1415
+ while (grid[rowIndex][colIndex] !== undefined) {
1416
+ colIndex++;
1417
+ }
1418
+ for (let r = 0; r < rowSpan; r++) {
1419
+ for (let c = 0; c < colSpan; c++) {
1420
+ if (!grid[rowIndex + r]) {
1421
+ grid[rowIndex + r] = [];
1422
+ }
1423
+ grid[rowIndex + r][colIndex + c] = cell.id;
1424
+ }
1425
+ }
1426
+ colIndex += colSpan;
1427
+ });
1428
+ });
1429
+ return grid;
1430
+ }
1431
+ /**
1432
+ * Get the adjacent cell in the specified direction based on the table matrix.
1433
+ *
1434
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} cell - The current cell.
1435
+ * @param {AdjacentCellDirection} direction - The direction to locate the adjacent cell.
1436
+ * @returns {RTETableCellBlock | RTETableHeadCellBlock | null} The adjacent cell or null.
1437
+ */
1438
+ function getAdjacentCell(cell, direction) {
1439
+ if (!cell) {
1440
+ return null;
844
1441
  }
845
- /**
846
- * @inheritDoc
847
- */
848
- static from(block, options) {
849
- var _a;
850
- const tableCellBlock = new RTETableCellBlock(block.id, options);
851
- super.convertAnnotationsToMap(tableCellBlock.annotationMap, Object.assign({}, block.annotations));
852
- if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
853
- tableCellBlock.annotationMap.set(...RTETableCellAnnotation.from(block.annotations.tableCell));
854
- }
855
- tableCellBlock.children = super.generateBlockChildren(block.children, options, tableCellBlock);
856
- return tableCellBlock;
857
- }
858
- /**
859
- * @inheritDoc
860
- */
861
- clone(parent) {
862
- const clonedBlock = new RTETableCellBlock(this.id);
863
- clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
864
- clonedBlock.parent = parent;
865
- clonedBlock.annotationMap = super.cloneAnnotations();
866
- return clonedBlock;
867
- }
868
- /**
869
- * @inheritDoc
870
- */
871
- getLastNode() {
872
- return this.children[this.children.length - 1].getLastNode();
1442
+ const row = cell.parent;
1443
+ const sectionRows = row.parent.children;
1444
+ const rowIndex = sectionRows.indexOf(row);
1445
+ const { colSpan, rowSpan } = getCellSpan(cell);
1446
+ const cellColPosition = getActualColumnPosition(cell, sectionRows);
1447
+ let targetRowIndex = rowIndex;
1448
+ let targetColPosition = cellColPosition;
1449
+ switch (direction) {
1450
+ case MergeCellsOperationType.MERGE_CELL_LEFT:
1451
+ targetColPosition = cellColPosition - 1;
1452
+ break;
1453
+ case MergeCellsOperationType.MERGE_CELL_RIGHT:
1454
+ targetColPosition = cellColPosition + colSpan;
1455
+ break;
1456
+ case MergeCellsOperationType.MERGE_CELL_UP:
1457
+ targetRowIndex = rowIndex - 1;
1458
+ break;
1459
+ default:
1460
+ targetRowIndex = rowIndex + rowSpan;
1461
+ break;
1462
+ }
1463
+ return findCellAtPosition(sectionRows, targetRowIndex, targetColPosition);
1464
+ }
1465
+ /**
1466
+ * Find the cell that covers the specified matrix position.
1467
+ *
1468
+ * @param {RTETableRowBlock[]} rows - Rows in the current table section.
1469
+ * @param {number} targetRowIndex - Target matrix row index.
1470
+ * @param {number} targetColPosition - Target matrix column position.
1471
+ * @returns {RTETableCellBlock | RTETableHeadCellBlock | null} The covering cell or null.
1472
+ */
1473
+ function findCellAtPosition(rows, targetRowIndex, targetColPosition) {
1474
+ for (let r = 0; r < rows.length; r++) {
1475
+ const currentRow = rows[r];
1476
+ for (const candidate of currentRow.children) {
1477
+ const { colSpan, rowSpan } = getCellSpan(candidate);
1478
+ const candidateColPosition = getActualColumnPosition(candidate, rows);
1479
+ const candidateRowStart = r;
1480
+ const candidateRowEnd = r + rowSpan - 1;
1481
+ const candidateColEnd = candidateColPosition + colSpan - 1;
1482
+ const isSameMatrixRow = targetRowIndex >= candidateRowStart && targetRowIndex <= candidateRowEnd;
1483
+ const isTargetColumnCovered = targetColPosition >= candidateColPosition && targetColPosition <= candidateColEnd;
1484
+ if (isSameMatrixRow && isTargetColumnCovered) {
1485
+ return candidate;
1486
+ }
1487
+ }
873
1488
  }
874
- /**
875
- * @inheritDoc
876
- */
877
- isNotEmpty() {
878
- return this.children.length > 0;
1489
+ return null;
1490
+ }
1491
+ /**
1492
+ * Get the rectangular bounds of selected cells.
1493
+ * Calculates the bounding box (minRow, maxRow, minCol, maxCol) and returns related information.
1494
+ *
1495
+ * @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
1496
+ * @returns {RectangularBounds} The rectangular bounds' information.
1497
+ */
1498
+ function getRectangularBounds(selectedCells) {
1499
+ const firstCell = selectedCells[0];
1500
+ const firstRow = firstCell.parent;
1501
+ const table = firstRow.parent;
1502
+ const allRows = table.children;
1503
+ let minRow = Number.POSITIVE_INFINITY;
1504
+ let maxRow = -1;
1505
+ let minCol = Number.POSITIVE_INFINITY;
1506
+ let maxCol = -1;
1507
+ const coveredPositions = new Set();
1508
+ selectedCells.forEach((cell) => {
1509
+ const row = cell.parent;
1510
+ const rowIndex = allRows.indexOf(row);
1511
+ const actualColPosition = getActualColumnPosition(cell, allRows);
1512
+ const { colSpan, rowSpan } = getCellSpan(cell);
1513
+ const cellMinRow = rowIndex;
1514
+ const cellMaxRow = rowIndex + rowSpan - 1;
1515
+ const cellMinCol = actualColPosition;
1516
+ const cellMaxCol = actualColPosition + colSpan - 1;
1517
+ for (let r = cellMinRow; r <= cellMaxRow; r++) {
1518
+ for (let c = cellMinCol; c <= cellMaxCol; c++) {
1519
+ coveredPositions.add(`${r},${c}`);
1520
+ }
1521
+ }
1522
+ minRow = Math.min(minRow, cellMinRow);
1523
+ maxRow = Math.max(maxRow, cellMaxRow);
1524
+ minCol = Math.min(minCol, cellMinCol);
1525
+ maxCol = Math.max(maxCol, cellMaxCol);
1526
+ });
1527
+ const targetCell = selectedCells[0];
1528
+ return {
1529
+ minRow,
1530
+ maxRow,
1531
+ minCol,
1532
+ maxCol,
1533
+ targetCell,
1534
+ coveredPositions,
1535
+ };
1536
+ }
1537
+ /**
1538
+ * Calculate the total number of columns in the table.
1539
+ * Accounts for cells with col span.
1540
+ *
1541
+ * @param {RTETableBlock} table - The table block.
1542
+ * @returns {number} The total number of columns in the table.
1543
+ */
1544
+ function getTableColumnCount(table) {
1545
+ const rows = getAllTableRows(table);
1546
+ // Calculate the total columns from the first row, accounting for col span
1547
+ let totalColumns = 0;
1548
+ const firstRow = rows[0];
1549
+ for (const cell of firstRow.children) {
1550
+ const { colSpan } = getCellSpan(cell);
1551
+ totalColumns += colSpan;
1552
+ }
1553
+ return totalColumns;
1554
+ }
1555
+ /**
1556
+ * Check if the selected cells form a rectangular area.
1557
+ * Considers cells with col span and row span.
1558
+ *
1559
+ * @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
1560
+ * @returns {boolean} True if the selected cells form a rectangle, false otherwise.
1561
+ */
1562
+ function isRectangularSelection(selectedCells) {
1563
+ if (selectedCells.length === 1) {
1564
+ return true;
1565
+ }
1566
+ const bounds = getRectangularBounds(selectedCells);
1567
+ const { minRow, maxRow, minCol, maxCol, coveredPositions } = bounds;
1568
+ const expectedPositions = (maxRow - minRow + 1) * (maxCol - minCol + 1);
1569
+ if (coveredPositions.size !== expectedPositions) {
1570
+ return false;
879
1571
  }
880
- /**
881
- * @inheritDoc
882
- */
883
- toHtml() {
884
- const childrenHtml = this.children.map((child) => child.toHtml()).join('');
885
- const attrStr = super.generateAttributeString();
886
- return `<td${attrStr}>${childrenHtml}</td>`;
1572
+ return true;
1573
+ }
1574
+ /**
1575
+ * Set the col span and row span attributes for a target cell.
1576
+ * When colSpan equals the table's total columns, rowSpan is removed.
1577
+ *
1578
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} targetCell - The target cell to set attributes on.
1579
+ * @param {number} colSpan - The column span value.
1580
+ * @param {number} rowSpan - The row span value.
1581
+ * @param {RTETableBlock} table - The table block.
1582
+ */
1583
+ function setSpanAttributes(targetCell, colSpan, rowSpan, table) {
1584
+ const existingAnnotation = targetCell.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_ATTRIBUTE);
1585
+ const existingAttrs = existingAnnotation
1586
+ ? Object.assign({}, existingAnnotation['customAttribute']) : {};
1587
+ delete existingAttrs.colspan;
1588
+ delete existingAttrs.rowspan;
1589
+ if (colSpan > 1) {
1590
+ existingAttrs.colspan = String(colSpan);
1591
+ }
1592
+ // When colspan equals table column count, don't set rowspan
1593
+ const tableColumnCount = getTableColumnCount(table);
1594
+ if (rowSpan > 1 && colSpan !== tableColumnCount) {
1595
+ existingAttrs.rowspan = String(rowSpan);
1596
+ }
1597
+ if (Object.keys(existingAttrs).length > 0) {
1598
+ const customAttributeAnnotation = new CustomAttributeAnnotation(existingAttrs);
1599
+ targetCell.annotationMap.set(CommonAnnotationTypeEnum.CUSTOM_ATTRIBUTE, customAttributeAnnotation);
1600
+ }
1601
+ else {
1602
+ targetCell.annotationMap.delete(CommonAnnotationTypeEnum.CUSTOM_ATTRIBUTE);
887
1603
  }
888
- /**
889
- * @inheritDoc
890
- */
891
- toJSON() {
892
- return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
1604
+ }
1605
+ /**
1606
+ * Create a new cell of the specified type.
1607
+ *
1608
+ * @param {string} cellType - The type of cell ('table-cell' or 'table-head-cell').
1609
+ * @returns {RTETableCellBlock | RTETableHeadCellBlock} The newly created cell.
1610
+ */
1611
+ function createNewCell(cellType) {
1612
+ const cellTemplate = getDefaultCellBlockTemplate(cellType);
1613
+ if (cellType === 'table-head-cell') {
1614
+ return RTETableHeadCellBlock.from(cellTemplate);
893
1615
  }
1616
+ return RTETableCellBlock.from(cellTemplate);
894
1617
  }
895
1618
 
1619
+ var RowOperationType;
1620
+ (function (RowOperationType) {
1621
+ RowOperationType["HEADER_ROW"] = "HEADER_ROW";
1622
+ RowOperationType["ADD_ROW_ABOVE"] = "ADD_ROW_ABOVE";
1623
+ RowOperationType["ADD_ROW_BELOW"] = "ADD_ROW_BELOW";
1624
+ RowOperationType["DELETE_ROW"] = "DELETE_ROW";
1625
+ RowOperationType["SELECT_ROW"] = "SELECT_ROW";
1626
+ })(RowOperationType || (RowOperationType = {}));
896
1627
  /**
897
- * Class representing a table head cell annotation in the rich text editor.
1628
+ * Event handler for row operations in a table.
898
1629
  */
899
- class RTETableHeadCellAnnotation extends RTETableCellAnnotation {
900
- constructor(annotation = {}) {
901
- super(annotation);
902
- }
1630
+ class RowOperationEventHandler extends SettingEventHandler {
903
1631
  /**
904
1632
  * @inheritDoc
905
1633
  */
906
- static from(cellAnnotation) {
907
- return [RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation(cellAnnotation)];
1634
+ canHandle(action) {
1635
+ return action[0] === TableSettingType.ROW;
908
1636
  }
909
1637
  /**
910
1638
  * @inheritDoc
911
1639
  */
912
- clone() {
913
- return new RTETableHeadCellAnnotation({
914
- backgroundColor: this.backgroundColor,
915
- padding: this.padding,
916
- border: this.border,
917
- width: this.width,
918
- height: this.height,
919
- textAlign: this.textAlign,
920
- verticalAlign: this.verticalAlign,
921
- });
1640
+ execute(action, extensionContext) {
1641
+ const operation = action[1];
1642
+ switch (operation) {
1643
+ case RowOperationType.ADD_ROW_ABOVE:
1644
+ case RowOperationType.ADD_ROW_BELOW:
1645
+ this.handleInsertRow(operation, extensionContext);
1646
+ break;
1647
+ case RowOperationType.DELETE_ROW:
1648
+ this.handleDeleteRow(extensionContext);
1649
+ break;
1650
+ case RowOperationType.HEADER_ROW:
1651
+ this.handleToggleHeader(extensionContext);
1652
+ break;
1653
+ case RowOperationType.SELECT_ROW:
1654
+ this.handleSelectRow(extensionContext);
1655
+ break;
1656
+ }
922
1657
  }
923
1658
  /**
924
- * @inheritDoc
1659
+ * Adds a new row to the table at the specified position.
1660
+ *
1661
+ * @param {RowOperationType} direction - The position to insert the new row (above or below).
1662
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
925
1663
  */
926
- renderStyle(options) {
927
- var _a;
928
- const styles = super.renderStyle(options);
929
- return cleanObject(Object.assign(Object.assign({}, styles), { backgroundColor: (_a = this.backgroundColor) !== null && _a !== void 0 ? _a : RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR }));
1664
+ handleInsertRow(direction, extensionContext) {
1665
+ const selectedRows = this.getAllSelectedRows(extensionContext);
1666
+ if (selectedRows.length > 0) {
1667
+ const action = new InsertTableRowAction(direction === RowOperationType.ADD_ROW_ABOVE
1668
+ ? InsertTableRowDirection.ABOVE
1669
+ : InsertTableRowDirection.BELOW, selectedRows);
1670
+ this.applyActionToTable(selectedRows[0], action);
1671
+ }
930
1672
  }
931
- }
932
- RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR = '#f2f2f2';
933
-
934
- /**
935
- * Class representing a table head block in the rich text editor.
936
- */
937
- class RTETableHeadCellBlock extends RTETableCellBlock {
938
- constructor(id, options) {
939
- super(id, options);
940
- this.type = 'table-head-cell';
941
- const { autoMatchFormat } = options || { autoMatchFormat: true };
942
- if (autoMatchFormat) {
943
- this.annotationMap.set(RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation());
1673
+ /**
1674
+ * Deletes the selected row(s) from the table.
1675
+ *
1676
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
1677
+ */
1678
+ handleDeleteRow(extensionContext) {
1679
+ const selectedRows = this.getAllSelectedRows(extensionContext);
1680
+ if (selectedRows.length) {
1681
+ const action = new DeleteTableRowAction(selectedRows);
1682
+ this.applyActionToTable(selectedRows[0], action);
944
1683
  }
945
1684
  }
946
1685
  /**
947
- * @inheritDoc
1686
+ * Converts selected rows to header rows or reverts them back to normal rows.
1687
+ *
1688
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
948
1689
  */
949
- static from(block, options) {
950
- var _a;
951
- const headCellBlock = new RTETableHeadCellBlock(block.id, options);
952
- super.convertAnnotationsToMap(headCellBlock.annotationMap, Object.assign({}, block.annotations));
953
- if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
954
- headCellBlock.annotationMap.set(...RTETableHeadCellAnnotation.from(block.annotations.tableCell));
1690
+ handleToggleHeader(extensionContext) {
1691
+ const selectedRows = this.getAllSelectedRows(extensionContext);
1692
+ if (selectedRows.length > 0) {
1693
+ const action = new ToggleHeaderRowAction(selectedRows);
1694
+ this.applyActionToTable(selectedRows[0], action);
955
1695
  }
956
- headCellBlock.children = super.generateBlockChildren(block.children, options, headCellBlock);
957
- return headCellBlock;
958
1696
  }
959
1697
  /**
960
- * @inheritDoc
1698
+ * Selects the focus row(s) in the table.
1699
+ *
1700
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
961
1701
  */
962
- clone(parent) {
963
- const clonedBlock = new RTETableHeadCellBlock(this.id);
964
- clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
965
- clonedBlock.parent = parent;
966
- clonedBlock.annotationMap = super.cloneAnnotations();
967
- return clonedBlock;
1702
+ handleSelectRow(extensionContext) {
1703
+ const selectedRows = this.getAllSelectedRows(extensionContext);
1704
+ if (selectedRows.length > 0 && extensionContext && extensionContext.tableSelection) {
1705
+ const allCells = selectedRows.flatMap((row) => row.children);
1706
+ extensionContext.tableSelection.setSelectedCells(allCells);
1707
+ }
968
1708
  }
969
1709
  /**
970
- * @inheritDoc
1710
+ * Get all selected table rows.
1711
+ *
1712
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
1713
+ * @returns {RTETableRowBlock[]} The selected table row blocks.
971
1714
  */
972
- toHtml() {
973
- const childrenHtml = this.children.map((child) => child.toHtml()).join('');
974
- const attrStr = super.generateAttributeString();
975
- return `<th${attrStr}>${childrenHtml}</th>`;
1715
+ getAllSelectedRows(extensionContext) {
1716
+ const selectedRows = new Set();
1717
+ if (extensionContext && extensionContext.tableSelection) {
1718
+ const { tableSelection } = extensionContext;
1719
+ const selectedCells = tableSelection.getSelectedCells();
1720
+ selectedCells.forEach((cell) => {
1721
+ const rowBlock = getParentBlockByType(cell, RTETableRowBlock);
1722
+ if (rowBlock) {
1723
+ selectedRows.add(rowBlock);
1724
+ }
1725
+ });
1726
+ }
1727
+ return Array.from(selectedRows);
976
1728
  }
977
1729
  /**
978
- * @inheritDoc
1730
+ * Applies the given action to the table containing the reference block.
1731
+ *
1732
+ * @param {RTEBlock} refBlock - The reference block within the table.
1733
+ * @param {ModifyContentAction} action - The action to apply to the table.
979
1734
  */
980
- toJSON() {
981
- return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
1735
+ applyActionToTable(refBlock, action) {
1736
+ const table = getParentBlockByType(refBlock, RTETableBlock);
1737
+ if (table) {
1738
+ table.apply(action);
1739
+ }
982
1740
  }
983
1741
  }
984
1742
 
@@ -1252,26 +2010,81 @@ class ColumnOperationEventHandler extends SettingEventHandler {
1252
2010
  }
1253
2011
  }
1254
2012
 
1255
- const RTE_TABLE_BORDER_STYLES = [
1256
- 'none',
1257
- 'solid',
1258
- 'dashed',
1259
- 'dotted',
1260
- 'double',
1261
- 'groove',
1262
- 'ridge',
1263
- 'inset',
1264
- 'outset',
1265
- ];
1266
- const RTE_TABLE_DEFAULT_COLORS = [
1267
- { dark: '#04041C', light: '#FCFCFC' },
1268
- { dark: '#AA091C', light: '#FF4C61' },
1269
- { dark: '#974502', light: '#FDAB68' },
1270
- { dark: '#735C00', light: '#FFDC4C' },
1271
- { dark: '#2E6D18', light: '#7BDA58' },
1272
- { dark: '#287171', light: '#7BD1D1' },
1273
- { dark: '#595959', light: '#999999' },
1274
- { dark: '#FCFCFC', light: '#04041C' },
1275
- ];
2013
+ const SPLIT_CELL_HORIZONTALLY = 'SPLIT_CELL_HORIZONTALLY';
2014
+ /**
2015
+ * Action to split a table cell horizontally.
2016
+ */
2017
+ class SplitCellHorizontallyAction extends ModifyContentAction {
2018
+ constructor() {
2019
+ super();
2020
+ this.isFlushable = true;
2021
+ this.type = SPLIT_CELL_HORIZONTALLY;
2022
+ }
2023
+ }
2024
+
2025
+ const SPLIT_CELL_VERTICALLY = 'SPLIT_CELL_VERTICALLY';
2026
+ /**
2027
+ * Action to split a table cell vertically.
2028
+ */
2029
+ class SplitCellVerticallyAction extends ModifyContentAction {
2030
+ constructor() {
2031
+ super();
2032
+ this.isFlushable = true;
2033
+ this.type = SPLIT_CELL_VERTICALLY;
2034
+ }
2035
+ }
2036
+
2037
+ var SplitCellOperationType;
2038
+ (function (SplitCellOperationType) {
2039
+ SplitCellOperationType["SPLIT_CELL_HORIZONTALLY"] = "SPLIT_CELL_HORIZONTALLY";
2040
+ SplitCellOperationType["SPLIT_CELL_VERTICALLY"] = "SPLIT_CELL_VERTICALLY";
2041
+ })(SplitCellOperationType || (SplitCellOperationType = {}));
2042
+ /**
2043
+ * Event handler for split cell operations in a table.
2044
+ */
2045
+ class SplitCellOperationEventHandler extends SettingEventHandler {
2046
+ /**
2047
+ * @inheritDoc
2048
+ */
2049
+ canHandle(action) {
2050
+ return action[0] === TableSettingType.SPLIT_CELL;
2051
+ }
2052
+ /**
2053
+ * @inheritDoc
2054
+ */
2055
+ execute(action, extensionContext) {
2056
+ const selectedCells = extensionContext.tableSelection.getSelectedCells();
2057
+ if (selectedCells && selectedCells.length === 1) {
2058
+ const targetCell = selectedCells[0];
2059
+ const operation = action[1];
2060
+ switch (operation) {
2061
+ case SplitCellOperationType.SPLIT_CELL_HORIZONTALLY:
2062
+ this.handleSplitCellHorizontally(targetCell);
2063
+ break;
2064
+ case SplitCellOperationType.SPLIT_CELL_VERTICALLY:
2065
+ this.handleSplitCellVertically(targetCell);
2066
+ break;
2067
+ }
2068
+ }
2069
+ }
2070
+ /**
2071
+ * Splits the selected table cell horizontally (split top/bottom).
2072
+ *
2073
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} selectedCell - The table cell block to split.
2074
+ */
2075
+ handleSplitCellHorizontally(selectedCell) {
2076
+ const action = new SplitCellHorizontallyAction();
2077
+ selectedCell.apply(action);
2078
+ }
2079
+ /**
2080
+ * Splits the selected table cell vertically (split left/right).
2081
+ *
2082
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} selectedCell - The table cell block to split.
2083
+ */
2084
+ handleSplitCellVertically(selectedCell) {
2085
+ const action = new SplitCellVerticallyAction();
2086
+ selectedCell.apply(action);
2087
+ }
2088
+ }
1276
2089
 
1277
- export { ColumnOperationType as A, RowOperationType as B, ColumnOperationEventHandler as C, DELETE_TABLE_ROW as D, InsertTableRowDirection as I, RTETableExtensionAnnotationTypeEnum as R, SettingEventHandler as S, TableSettingType as T, RowOperationEventHandler as a, RTETableAnnotation as b, RTETableCellAnnotation as c, RTETableHeadCellAnnotation as d, RTETableHeadCellBlock as e, RTETableBlock as f, generateTableBody as g, RTETableCellBlock as h, RTETableRowBlock as i, RTETableBodyBlock as j, RTETableHeadBlock as k, getParentBlockByType as l, TableColumnStrategy as m, getAllTableRows as n, InsertTableColumnDirection as o, getDefaultCellBlockTemplate as p, getFirstNode as q, RTE_TABLE_DEFAULT_COLORS as r, INSERT_TABLE_ROW as s, TOGGLE_HEADER_ROW as t, INSERT_TABLE_COLUMN as u, DELETE_TABLE_COLUMN as v, TOGGLE_HEADER_TABLE_COLUMN as w, ToggleHeaderTableColumnStrategy as x, SELECT_TABLE_COLUMN as y, RTE_TABLE_BORDER_STYLES as z };
2090
+ export { INSERT_TABLE_ROW as A, TOGGLE_HEADER_ROW as B, ColumnOperationEventHandler as C, DELETE_TABLE_ROW as D, INSERT_TABLE_COLUMN as E, DELETE_TABLE_COLUMN as F, TOGGLE_HEADER_TABLE_COLUMN as G, ToggleHeaderTableColumnStrategy as H, InsertTableRowDirection as I, SPLIT_CELL_HORIZONTALLY as J, SPLIT_CELL_VERTICALLY as K, SELECT_TABLE_COLUMN as L, MergeCellsOperationEventHandler as M, MERGE_CELLS as N, RTE_TABLE_BORDER_STYLES as O, ColumnOperationType as P, RowOperationType as Q, RTETableExtensionAnnotationTypeEnum as R, SettingEventHandler as S, TableSettingType as T, SplitCellOperationType as U, VegaThemeManager as V, isRectangularSelection as W, getAdjacentCell as X, RowOperationEventHandler as a, SplitCellOperationEventHandler as b, RTETableAnnotation as c, RTETableCellAnnotation as d, RTETableHeadCellAnnotation as e, RTETableHeadCellBlock as f, RTETableColorManager as g, RTETableBlock as h, generateTableBody as i, RTETableCellBlock as j, RTETableRowBlock as k, RTETableBodyBlock as l, RTETableHeadBlock as m, getParentBlockByType as n, TableColumnStrategy as o, getAllTableRows as p, InsertTableColumnDirection as q, getDefaultCellBlockTemplate as r, getFirstNode as s, setSpanAttributes as t, MergeCellsOperationType as u, buildTableGrid as v, getCellSpan as w, getActualColumnPosition as x, createNewCell as y, RTE_TABLE_DEFAULT_COLORS as z };