@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,35 +1,350 @@
1
1
  'use strict';
2
2
 
3
- const codeBlock = require('./code-block-22ee2550.js');
3
+ const codeBlock = require('./code-block-d9001f03.js');
4
4
  const object = require('./object-e2e28e3d.js');
5
- const typeGuard = require('./type-guard-69d2cf01.js');
5
+ const darkModeStyleController = require('./dark-mode-style-controller-c21172aa.js');
6
+ require('./global-slimmer-registry-b3bce7e0.js');
6
7
  const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtime-metrics-slimmer-e2e274e1.js');
7
- const contentState = require('./content-state-0be6fda3.js');
8
+ const ui = require('./ui-9e181079.js');
9
+ const typeGuard = require('./type-guard-a0f026d8.js');
10
+ const contentState = require('./content-state-466f277f.js');
11
+
12
+ const ThemeManagerRuntimeMetricsPayloadDefinition = [
13
+ {
14
+ payloadKey: 'IS_OVERRIDECOLORS_METHOD_CALLED',
15
+ payloadDescription: 'Indicate if the method overrideColors of public API ThemeManager is called',
16
+ /**
17
+ * Indicate whether the method is collected when the method been called .
18
+ *
19
+ * @param {string} scope - The class name of public api
20
+ * @param {string} methodName - The method name called by the public api
21
+ * @returns {boolean} A boolean value
22
+ */
23
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'overrideColors',
24
+ /**
25
+ * The function checks if the method is be called.
26
+ *
27
+ * @returns {boolean} A boolean value
28
+ */
29
+ payloadValue: () => {
30
+ return true;
31
+ },
32
+ },
33
+ {
34
+ payloadKey: 'IS_RESET_METHOD_CALLED',
35
+ payloadDescription: 'Indicate if the method reset of public API ThemeManager is called',
36
+ /**
37
+ * Indicate whether the method is collected when the method been called .
38
+ *
39
+ * @param {string} scope - The class name of public api
40
+ * @param {string} methodName - The method name called by the public api
41
+ * @returns {boolean} A boolean value
42
+ */
43
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'reset',
44
+ /**
45
+ * The function checks if the method is be called.
46
+ *
47
+ * @returns {boolean} A boolean value
48
+ */
49
+ payloadValue: () => {
50
+ return true;
51
+ },
52
+ },
53
+ {
54
+ payloadKey: 'IS_TOGGLEDARKMODE_METHOD_CALLED',
55
+ payloadDescription: 'Indicate if the method toggleDarkMode of public API ThemeManager is called',
56
+ /**
57
+ * Indicate whether the method is collected when the method been called .
58
+ *
59
+ * @param {string} scope - The class name of public api
60
+ * @param {string} methodName - The method name called by the public api
61
+ * @returns {boolean} A boolean value
62
+ */
63
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'toggleDarkMode',
64
+ /**
65
+ * The function checks if the method is be called.
66
+ *
67
+ * @returns {boolean} A boolean value
68
+ */
69
+ payloadValue: () => {
70
+ return true;
71
+ },
72
+ },
73
+ {
74
+ payloadKey: 'IS_ISDARKMODE_METHOD_CALLED',
75
+ payloadDescription: 'Indicate if the method isDarkMode of public API ThemeManager is called',
76
+ /**
77
+ * Indicate whether the method is collected when the method been called .
78
+ *
79
+ * @param {string} scope - The class name of public api
80
+ * @param {string} methodName - The method name called by the public api
81
+ * @returns {boolean} A boolean value
82
+ */
83
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'isDarkMode',
84
+ /**
85
+ * The function checks if the method is be called.
86
+ *
87
+ * @returns {boolean} A boolean value
88
+ */
89
+ payloadValue: () => {
90
+ return true;
91
+ },
92
+ },
93
+ {
94
+ payloadKey: 'IS_APPLY_BRANDING_METHOD_CALLED',
95
+ payloadDescription: 'Indicate if the method applyBranding of public API ThemeManager is called',
96
+ /**
97
+ * Indicate whether the method is collected when the method been called .
98
+ *
99
+ * @param {string} scope - The class name of public api
100
+ * @param {string} methodName - The method name called by the public api
101
+ * @returns {boolean} A boolean value
102
+ */
103
+ canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'applyBranding',
104
+ /**
105
+ * The function checks if the method is be called.
106
+ *
107
+ * @returns {boolean} A boolean value
108
+ */
109
+ payloadValue: () => {
110
+ return true;
111
+ },
112
+ },
113
+ ];
114
+
115
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
116
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
117
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
118
+ 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;
119
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
120
+ };
121
+ /**
122
+ * Vega components theme manager
123
+ */
124
+ class ThemeManager {
125
+ constructor() {
126
+ this.vegaPublicAPIRuntimeMetricsSlimmer = createPublicApiRuntimeMetricsSlimmer.createPublicAPIRuntimeMetricsSlimmer(ThemeManager, ['overrideColors', 'reset', 'toggleDarkMode', 'isDarkMode', 'applyBranding'], ThemeManagerRuntimeMetricsPayloadDefinition);
127
+ }
128
+ /**
129
+ * It takes the colors you passed in, parses them into the correct format, and then applies them to the theme
130
+ *
131
+ * @param {VegaThemeOverrideColors} overrideColors - OverrideColors - This is the object that you pass to the function.
132
+ * @vegaVersion 1.20.0
133
+ */
134
+ async overrideColors(overrideColors) {
135
+ void darkModeStyleController.VegaInternalThemeManager.overrideColors(overrideColors);
136
+ }
137
+ /**
138
+ * It removes all the custom override theme styles from the DOM
139
+ *
140
+ * @vegaVersion 1.20.0
141
+ */
142
+ async reset() {
143
+ void darkModeStyleController.VegaInternalThemeManager.reset();
144
+ }
145
+ /**
146
+ * This function toggles the dark mode of a webpage by adding or removing a 'dark' class to the HTML element.
147
+ *
148
+ * @param {boolean | undefined} darkMode - A boolean or undefined value that determines whether to enable or disable dark mode.
149
+ * If it is true, dark mode is enabled.
150
+ * If it is false, dark mode is disabled.
151
+ * @vegaVersion 1.32.0
152
+ */
153
+ toggleDarkMode(darkMode) {
154
+ darkModeStyleController.VegaInternalThemeManager.toggleDarkMode(darkMode);
155
+ }
156
+ /**
157
+ * The function checks if the HTML element has a class of "dark" and returns a boolean value accordingly.
158
+ *
159
+ * @returns {boolean} A boolean value indicating whether the HTML element has a class of "dark", which is
160
+ * typically used to indicate that the website is in dark mode.
161
+ * @vegaVersion 1.32.0
162
+ */
163
+ isDarkMode() {
164
+ return darkModeStyleController.VegaInternalThemeManager.isDarkMode();
165
+ }
166
+ /**
167
+ * This function switches the Vega theme to a brand theme based on the provided options.
168
+ *
169
+ * @param {BrandOptions} options - The options includes 'gp', 'genius' and 'heartland' options
170
+ * @vegaVersion 2.47.0
171
+ */
172
+ applyBranding(options) {
173
+ darkModeStyleController.VegaInternalThemeManager.applyBranding(options);
174
+ }
175
+ }
176
+ __decorate([
177
+ createPublicApiRuntimeMetricsSlimmer.InjectVegaTelemetrySlimmer()
178
+ ], ThemeManager.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
179
+ const VegaThemeManager = new ThemeManager();
180
+
181
+ const RTE_TABLE_BORDER_STYLES = [
182
+ 'none',
183
+ 'solid',
184
+ 'dashed',
185
+ 'dotted',
186
+ 'double',
187
+ 'groove',
188
+ 'ridge',
189
+ 'inset',
190
+ 'outset',
191
+ ];
192
+ const RTE_TABLE_DEFAULT_COLORS = [
193
+ { key: 'white', dark: '#04041C', light: '#FCFCFC' },
194
+ { key: 'red', dark: '#AA091C', light: '#FF4C61' },
195
+ { key: 'orange', dark: '#974502', light: '#FDAB68' },
196
+ { key: 'yellow', dark: '#735C00', light: '#FFDC4C' },
197
+ { key: 'green', dark: '#2E6D18', light: '#7BDA58' },
198
+ { key: 'teal', dark: '#287171', light: '#7BD1D1' },
199
+ { key: 'gray', dark: '#595959', light: '#999999' },
200
+ { key: 'black', dark: '#FCFCFC', light: '#04041C' },
201
+ ];
202
+
203
+ /**
204
+ * Manages table colors for the rich text editor.
205
+ */
206
+ class RTETableColorManager {
207
+ /**
208
+ * Get the list of table colors.
209
+ *
210
+ * @returns {VegaRTEColorSchema[]} - Array of table colors.
211
+ */
212
+ static getTableColors() {
213
+ return RTETableColorManager.TABLE_COLORS;
214
+ }
215
+ /**
216
+ * Set the list of table colors.
217
+ *
218
+ * @param {VegaRTEColorSchema[]} colors - Array of table colors.
219
+ */
220
+ static setTableColors(colors) {
221
+ RTETableColorManager.TABLE_COLORS = colors;
222
+ }
223
+ /**
224
+ * Get color key from color value
225
+ *
226
+ * @param {string} colorValue - color value
227
+ * @returns {string} - color key
228
+ */
229
+ static getColorKey(colorValue) {
230
+ var _a;
231
+ let result = null;
232
+ const tableColors = RTETableColorManager.TABLE_COLORS;
233
+ if (tableColors) {
234
+ const hexColor = (_a = ui.rgbToHex(colorValue)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
235
+ if (hexColor) {
236
+ result = tableColors.find((schema) => VegaThemeManager.isDarkMode() ? schema.dark === hexColor : schema.light === hexColor);
237
+ }
238
+ else {
239
+ for (const color of tableColors) {
240
+ if (color.key === colorValue) {
241
+ result = color;
242
+ break;
243
+ }
244
+ }
245
+ }
246
+ }
247
+ return result ? result.key : '';
248
+ }
249
+ }
250
+ RTETableColorManager.TABLE_COLORS = RTE_TABLE_DEFAULT_COLORS;
251
+
252
+ /**
253
+ * Class representing a table color annotation in the rich text editor.
254
+ */
255
+ class RTETableColorAnnotation extends codeBlock.BlockAnnotation {
256
+ constructor(colorKey) {
257
+ super();
258
+ this.type = exports.RTETableExtensionAnnotationTypeEnum.COLOR;
259
+ if (colorKey) {
260
+ this.color = this.formatColor(colorKey);
261
+ }
262
+ }
263
+ /**
264
+ * Render the style for the annotation
265
+ *
266
+ * @returns {AnnotationStyle} The style object containing the color
267
+ */
268
+ renderStyle() {
269
+ const color = this.color
270
+ ? darkModeStyleController.VegaInternalThemeManager.isDarkMode()
271
+ ? this.color.dark
272
+ : this.color.light
273
+ : '';
274
+ return { color };
275
+ }
276
+ /**
277
+ * Render the CSS class for the annotation
278
+ *
279
+ * @returns {Nullable<string>} Always returns null as no CSS class is used
280
+ */
281
+ renderClass() {
282
+ return null;
283
+ }
284
+ /**
285
+ * Convert the annotation to a JSON representation
286
+ *
287
+ * @returns {Record<string, string>} A JSON object containing the color key
288
+ */
289
+ toJSON() {
290
+ var _a;
291
+ return {
292
+ color: ((_a = this.color) === null || _a === void 0 ? void 0 : _a.key) || '',
293
+ };
294
+ }
295
+ /**
296
+ * Clone the current annotation
297
+ *
298
+ * @returns {BlockAnnotation<RTETableExtensionAnnotationTypeEnum.COLOR>} A new instance of RTETableColorAnnotation with the same color key
299
+ */
300
+ clone() {
301
+ var _a;
302
+ return new RTETableColorAnnotation((_a = this.color) === null || _a === void 0 ? void 0 : _a.key);
303
+ }
304
+ /**
305
+ * format table color
306
+ *
307
+ * @param {string} colorKey - table color
308
+ * @returns {Nullable<VegaRTEColorSchema>} - VegaRTEColorSchema
309
+ */
310
+ formatColor(colorKey) {
311
+ return RTETableColorManager.getTableColors().find((item) => item.key === colorKey);
312
+ }
313
+ }
8
314
 
9
315
  exports.RTETableExtensionAnnotationTypeEnum = void 0;
10
316
  (function (RTETableExtensionAnnotationTypeEnum) {
11
317
  RTETableExtensionAnnotationTypeEnum["TABLE"] = "EXTENSION_TABLE";
12
318
  RTETableExtensionAnnotationTypeEnum["CELL"] = "EXTENSION_TABLE_CELL";
13
319
  RTETableExtensionAnnotationTypeEnum["CAPTION"] = "EXTENSION_TABLE_CAPTION";
320
+ RTETableExtensionAnnotationTypeEnum["COLOR"] = "EXTENSION_TABLE_COLOR";
14
321
  })(exports.RTETableExtensionAnnotationTypeEnum || (exports.RTETableExtensionAnnotationTypeEnum = {}));
15
322
  /**
16
323
  * Class representing a table annotation in the rich text editor.
17
324
  */
18
325
  class RTETableAnnotation extends codeBlock.BlockAnnotation {
19
- constructor({ backgroundColor, border, width, height, alignment = 'center', } = {}) {
326
+ constructor({ backgroundColor, border, width, height, alignment, borderCollapse } = {}, useInternalStyle = true) {
20
327
  super();
21
328
  this.type = exports.RTETableExtensionAnnotationTypeEnum.TABLE;
329
+ this.useInternalStyle = useInternalStyle;
22
330
  this.backgroundColor = backgroundColor;
23
331
  this.border = border;
24
332
  this.width = width;
25
333
  this.height = height;
26
- this.alignment = alignment;
334
+ this.alignment =
335
+ useInternalStyle && alignment === undefined ? RTETableAnnotation.DEFAULT_ALIGNMENT : alignment;
336
+ this.backgroundColorAnnotation = new RTETableColorAnnotation(backgroundColor);
337
+ this.borderColorAnnotation = new RTETableColorAnnotation(border === null || border === void 0 ? void 0 : border.color);
338
+ this.borderCollapse =
339
+ useInternalStyle && borderCollapse === undefined
340
+ ? RTETableAnnotation.DEFAULT_BORDER_COLLAPSE
341
+ : borderCollapse;
27
342
  }
28
343
  /**
29
344
  * @inheritDoc
30
345
  */
31
- static from(value) {
32
- return [exports.RTETableExtensionAnnotationTypeEnum.TABLE, new RTETableAnnotation(value)];
346
+ static from(value, useInternalStyle = true) {
347
+ return [exports.RTETableExtensionAnnotationTypeEnum.TABLE, new RTETableAnnotation(value, useInternalStyle)];
33
348
  }
34
349
  /**
35
350
  * Generates the CSS border string from the border properties.
@@ -40,7 +355,7 @@ class RTETableAnnotation extends codeBlock.BlockAnnotation {
40
355
  if (!this.border) {
41
356
  return null;
42
357
  }
43
- return `${this.border.style} ${this.border.width} ${this.border.color}`.trim();
358
+ return `${this.border.style} ${this.border.width} ${this.borderColorAnnotation.renderStyle().color}`.trim();
44
359
  }
45
360
  /**
46
361
  * @inheritDoc
@@ -52,7 +367,8 @@ class RTETableAnnotation extends codeBlock.BlockAnnotation {
52
367
  width: this.width,
53
368
  height: this.height,
54
369
  alignment: this.alignment,
55
- });
370
+ borderCollapse: this.borderCollapse,
371
+ }, this.useInternalStyle);
56
372
  }
57
373
  /**
58
374
  * @inheritDoc
@@ -65,6 +381,7 @@ class RTETableAnnotation extends codeBlock.BlockAnnotation {
65
381
  width: this.width,
66
382
  height: this.height,
67
383
  alignment: this.alignment,
384
+ borderCollapse: this.borderCollapse,
68
385
  }),
69
386
  };
70
387
  }
@@ -72,11 +389,10 @@ class RTETableAnnotation extends codeBlock.BlockAnnotation {
72
389
  * @inheritDoc
73
390
  */
74
391
  renderStyle() {
75
- const defaultStyles = {
76
- borderCollapse: 'collapse',
77
- };
78
- const tableStyles = Object.assign({ backgroundColor: this.backgroundColor, border: this.borderStr, width: this.width, height: this.height }, this.renderAlignmentStyle());
79
- return object.cleanObject(Object.assign(Object.assign({}, defaultStyles), tableStyles));
392
+ const backgroundColor = this.backgroundColorAnnotation.renderStyle().color;
393
+ const tableStyles = Object.assign({ border: this.borderStr, width: this.width, height: this.height, borderCollapse: this.borderCollapse }, this.renderAlignmentStyle());
394
+ backgroundColor && (tableStyles.backgroundColor = backgroundColor);
395
+ return object.cleanObject(tableStyles);
80
396
  }
81
397
  /**
82
398
  * @inheritDoc
@@ -90,11 +406,15 @@ class RTETableAnnotation extends codeBlock.BlockAnnotation {
90
406
  * @returns {Record<string, string>} The alignment styles.
91
407
  */
92
408
  renderAlignmentStyle() {
409
+ if (!this.alignment)
410
+ return {};
93
411
  return {
94
412
  margin: this.alignment === 'center' ? '0 auto' : this.alignment === 'left' ? '0' : '0 0 0 auto',
95
413
  };
96
414
  }
97
415
  }
416
+ RTETableAnnotation.DEFAULT_BORDER_COLLAPSE = 'collapse';
417
+ RTETableAnnotation.DEFAULT_ALIGNMENT = 'center';
98
418
 
99
419
  /**
100
420
  * Class representing a table block in the rich text editor.
@@ -118,7 +438,7 @@ class RTETableBlock extends codeBlock.RTEBlock {
118
438
  super.convertAnnotationsToMap(tableBlock.annotationMap, Object.assign({}, block.annotations));
119
439
  tableBlock.children = super.generateBlockChildren(block.children, options, tableBlock);
120
440
  if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.table) {
121
- tableBlock.annotationMap.set(...RTETableAnnotation.from(block.annotations.table));
441
+ tableBlock.annotationMap.set(...RTETableAnnotation.from(block.annotations.table, options === null || options === void 0 ? void 0 : options.autoMatchFormat));
122
442
  }
123
443
  return tableBlock;
124
444
  }
@@ -221,6 +541,7 @@ exports.TableSettingType = void 0;
221
541
  TableSettingType["MERGE_CELLS"] = "MERGE_CELLS";
222
542
  TableSettingType["TABLE"] = "TABLE";
223
543
  TableSettingType["CELL"] = "CELL";
544
+ TableSettingType["SPLIT_CELL"] = "SPLIT_CELL";
224
545
  })(exports.TableSettingType || (exports.TableSettingType = {}));
225
546
  /**
226
547
  * Abstract class for setting event handlers.
@@ -430,28 +751,194 @@ class RTETableBodyBlock extends codeBlock.RTEBlock {
430
751
  }
431
752
 
432
753
  /**
433
- * Class representing a table head block in the rich text editor.
754
+ * Class representing a table cell annotation in the rich text editor.
434
755
  */
435
- class RTETableHeadBlock extends codeBlock.RTEBlock {
436
- constructor(id) {
756
+ class RTETableCellAnnotation extends codeBlock.BlockAnnotation {
757
+ constructor({ backgroundColor, padding, border, width, height, textAlign, verticalAlign, minWidth, boxSizing, } = {}, useInternalStyle = true) {
758
+ super();
759
+ this.type = exports.RTETableExtensionAnnotationTypeEnum.CELL;
760
+ this.useInternalStyle = useInternalStyle;
761
+ this.backgroundColor = backgroundColor;
762
+ this.width = width;
763
+ this.height = height;
764
+ this.backgroundColorAnnotation = new RTETableColorAnnotation(backgroundColor);
765
+ this.borderColorAnnotation = new RTETableColorAnnotation(border === null || border === void 0 ? void 0 : border.color);
766
+ this.padding =
767
+ useInternalStyle && padding === undefined ? RTETableCellAnnotation.DEFAULT_PADDING : padding;
768
+ this.border =
769
+ useInternalStyle && border === undefined ? RTETableCellAnnotation.DEFAULT_BORDER : border;
770
+ this.textAlign =
771
+ useInternalStyle && textAlign === undefined
772
+ ? RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN
773
+ : textAlign;
774
+ this.verticalAlign =
775
+ useInternalStyle && verticalAlign === undefined
776
+ ? RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN
777
+ : verticalAlign;
778
+ this.minWidth =
779
+ useInternalStyle && minWidth === undefined
780
+ ? RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH
781
+ : minWidth;
782
+ this.boxSizing =
783
+ useInternalStyle && boxSizing === undefined
784
+ ? RTETableCellAnnotation.DEFAULT_BOX_SIZING
785
+ : boxSizing;
786
+ }
787
+ /**
788
+ * @inheritDoc
789
+ */
790
+ static from(cellAnnotation, useInternalStyle) {
791
+ return [
792
+ exports.RTETableExtensionAnnotationTypeEnum.CELL,
793
+ new RTETableCellAnnotation(cellAnnotation, useInternalStyle),
794
+ ];
795
+ }
796
+ /**
797
+ * Generates the CSS border string from the border properties.
798
+ *
799
+ * @returns {Nullable<string>} The CSS border string.
800
+ */
801
+ get borderStr() {
802
+ if (!this.border)
803
+ return null;
804
+ return `${this.border.style} ${this.border.width} ${this.borderColorAnnotation.renderStyle().color ||
805
+ RTETableCellAnnotation.DEFAULT_BORDER.color}`;
806
+ }
807
+ /**
808
+ * @inheritDoc
809
+ */
810
+ clone() {
811
+ return new RTETableCellAnnotation({
812
+ backgroundColor: this.backgroundColor,
813
+ padding: this.padding,
814
+ border: this.border,
815
+ width: this.width,
816
+ height: this.height,
817
+ textAlign: this.textAlign,
818
+ verticalAlign: this.verticalAlign,
819
+ minWidth: this.minWidth,
820
+ boxSizing: this.boxSizing,
821
+ }, this.useInternalStyle);
822
+ }
823
+ /**
824
+ * @inheritDoc
825
+ */
826
+ toJSON() {
827
+ return {
828
+ tableCell: object.cleanObject({
829
+ backgroundColor: this.backgroundColor,
830
+ padding: this.padding,
831
+ border: this.border,
832
+ width: this.width,
833
+ height: this.height,
834
+ textAlign: this.textAlign,
835
+ verticalAlign: this.verticalAlign,
836
+ minWidth: this.minWidth,
837
+ boxSizing: this.boxSizing,
838
+ }),
839
+ };
840
+ }
841
+ /**
842
+ * @inheritDoc
843
+ */
844
+ renderStyle(options) {
845
+ const backgroundColor = this.backgroundColorAnnotation.renderStyle().color;
846
+ const style = {
847
+ padding: this.padding,
848
+ border: this.borderStr,
849
+ width: this.width,
850
+ height: this.height,
851
+ textAlign: this.textAlign,
852
+ verticalAlign: this.verticalAlign,
853
+ minWidth: this.minWidth,
854
+ boxSizing: this.boxSizing,
855
+ };
856
+ if (backgroundColor) {
857
+ style.backgroundColor = backgroundColor;
858
+ }
859
+ if (!(options === null || options === void 0 ? void 0 : options.standalone)) {
860
+ return object.cleanObject(this.removeDefaultValues(style));
861
+ }
862
+ return object.cleanObject(style);
863
+ }
864
+ /**
865
+ * @inheritDoc
866
+ */
867
+ renderClass() {
868
+ return null;
869
+ }
870
+ /**
871
+ * Removes default values from the style object to avoid redundancy.
872
+ *
873
+ * @param {Record<string, Nullable<string>>} style - The style object to clean.
874
+ * @returns {Record<string, Nullable<string>>} The cleaned style object.
875
+ */
876
+ removeDefaultValues(style) {
877
+ const cleanedStyle = Object.assign({}, style);
878
+ if (cleanedStyle.padding === RTETableCellAnnotation.DEFAULT_PADDING) {
879
+ delete cleanedStyle.padding;
880
+ }
881
+ if (cleanedStyle.border ===
882
+ `${RTETableCellAnnotation.DEFAULT_BORDER.style} ${RTETableCellAnnotation.DEFAULT_BORDER.width} ${RTETableCellAnnotation.DEFAULT_BORDER.color}`) {
883
+ delete cleanedStyle.border;
884
+ }
885
+ if (cleanedStyle.textAlign === RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN) {
886
+ delete cleanedStyle.textAlign;
887
+ }
888
+ if (cleanedStyle.verticalAlign === RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN) {
889
+ delete cleanedStyle.verticalAlign;
890
+ }
891
+ if (cleanedStyle.minWidth === RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH) {
892
+ delete cleanedStyle.minWidth;
893
+ }
894
+ if (cleanedStyle.boxSizing === RTETableCellAnnotation.DEFAULT_BOX_SIZING) {
895
+ delete cleanedStyle.boxSizing;
896
+ }
897
+ return cleanedStyle;
898
+ }
899
+ }
900
+ RTETableCellAnnotation.DEFAULT_PADDING = '12px';
901
+ RTETableCellAnnotation.DEFAULT_BORDER = {
902
+ style: 'solid',
903
+ width: '1px',
904
+ color: '#ddd',
905
+ };
906
+ RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN = 'left';
907
+ RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN = 'middle';
908
+ RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH = '55px';
909
+ RTETableCellAnnotation.DEFAULT_BOX_SIZING = 'border-box';
910
+
911
+ /**
912
+ * Class representing a table cell block in the rich text editor.
913
+ */
914
+ class RTETableCellBlock extends codeBlock.RTEBlock {
915
+ constructor(id, options) {
437
916
  super(id);
438
- this.type = 'table-head';
917
+ this.type = 'table-cell';
439
918
  this.children = [];
919
+ const { autoMatchFormat } = options || { autoMatchFormat: true };
920
+ if (autoMatchFormat) {
921
+ this.annotationMap.set(exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableCellAnnotation());
922
+ }
440
923
  }
441
924
  /**
442
925
  * @inheritDoc
443
926
  */
444
927
  static from(block, options) {
445
- const headBlock = new RTETableHeadBlock(block.id);
446
- super.convertAnnotationsToMap(headBlock.annotationMap, Object.assign({}, block.annotations));
447
- headBlock.children = super.generateBlockChildren(block.children, options, headBlock);
448
- return headBlock;
928
+ var _a;
929
+ const tableCellBlock = new RTETableCellBlock(block.id, options);
930
+ super.convertAnnotationsToMap(tableCellBlock.annotationMap, Object.assign({}, block.annotations));
931
+ if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
932
+ tableCellBlock.annotationMap.set(...RTETableCellAnnotation.from(block.annotations.tableCell, options === null || options === void 0 ? void 0 : options.autoMatchFormat));
933
+ }
934
+ tableCellBlock.children = super.generateBlockChildren(block.children, options, tableCellBlock);
935
+ return tableCellBlock;
449
936
  }
450
937
  /**
451
938
  * @inheritDoc
452
939
  */
453
940
  clone(parent) {
454
- const clonedBlock = new RTETableHeadBlock(this.id);
941
+ const clonedBlock = new RTETableCellBlock(this.id);
455
942
  clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
456
943
  clonedBlock.parent = parent;
457
944
  clonedBlock.annotationMap = super.cloneAnnotations();
@@ -469,17 +956,31 @@ class RTETableHeadBlock extends codeBlock.RTEBlock {
469
956
  isNotEmpty() {
470
957
  return this.children.length > 0;
471
958
  }
959
+ /**
960
+ * Get the rowSpan of the table cell
961
+ *
962
+ * @returns {number} - rowSpan value
963
+ */
964
+ get rowSpan() {
965
+ const rowSpan = this.getCustomAttributeByName('rowspan');
966
+ return !isNaN(Number(rowSpan)) ? Math.max(Number(rowSpan), 1) : 1;
967
+ }
968
+ /**
969
+ * Get the colSpan of the table cell
970
+ *
971
+ * @returns {number} - colSpan value
972
+ */
973
+ get colSpan() {
974
+ const colSpan = this.getCustomAttributeByName('colspan');
975
+ return !isNaN(Number(colSpan)) ? Math.max(Number(colSpan), 1) : 1;
976
+ }
472
977
  /**
473
978
  * @inheritDoc
474
979
  */
475
980
  toHtml() {
476
- const childrenHtml = this.children
477
- .map((child) => {
478
- return child.toHtml();
479
- })
480
- .join('');
981
+ const childrenHtml = this.children.map((child) => child.toHtml()).join('');
481
982
  const attrStr = super.generateAttributeString();
482
- return `<thead${attrStr}>${childrenHtml}</thead>`;
983
+ return `<td${attrStr}>${childrenHtml}</td>`;
483
984
  }
484
985
  /**
485
986
  * @inheritDoc
@@ -487,9 +988,290 @@ class RTETableHeadBlock extends codeBlock.RTEBlock {
487
988
  toJSON() {
488
989
  return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
489
990
  }
490
- }
491
-
492
- /**
991
+ /**
992
+ * Get custom attribute by name
993
+ *
994
+ * @param {string} attrName - attribute name
995
+ * @returns {Nullable<string>} - attribute value
996
+ */
997
+ getCustomAttributeByName(attrName) {
998
+ const customAttrAnnotation = this.getCustomAttributesAnnotation();
999
+ if (customAttrAnnotation) {
1000
+ const customAttributes = customAttrAnnotation.toJSON()['customAttribute'] || {};
1001
+ return customAttributes[attrName];
1002
+ }
1003
+ }
1004
+ }
1005
+
1006
+ /**
1007
+ * Class representing a table head block in the rich text editor.
1008
+ */
1009
+ class RTETableHeadBlock extends codeBlock.RTEBlock {
1010
+ constructor(id) {
1011
+ super(id);
1012
+ this.type = 'table-head';
1013
+ this.children = [];
1014
+ }
1015
+ /**
1016
+ * @inheritDoc
1017
+ */
1018
+ static from(block, options) {
1019
+ const headBlock = new RTETableHeadBlock(block.id);
1020
+ super.convertAnnotationsToMap(headBlock.annotationMap, Object.assign({}, block.annotations));
1021
+ headBlock.children = super.generateBlockChildren(block.children, options, headBlock);
1022
+ return headBlock;
1023
+ }
1024
+ /**
1025
+ * @inheritDoc
1026
+ */
1027
+ clone(parent) {
1028
+ const clonedBlock = new RTETableHeadBlock(this.id);
1029
+ clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
1030
+ clonedBlock.parent = parent;
1031
+ clonedBlock.annotationMap = super.cloneAnnotations();
1032
+ return clonedBlock;
1033
+ }
1034
+ /**
1035
+ * @inheritDoc
1036
+ */
1037
+ getLastNode() {
1038
+ return this.children[this.children.length - 1].getLastNode();
1039
+ }
1040
+ /**
1041
+ * @inheritDoc
1042
+ */
1043
+ isNotEmpty() {
1044
+ return this.children.length > 0;
1045
+ }
1046
+ /**
1047
+ * @inheritDoc
1048
+ */
1049
+ toHtml() {
1050
+ const childrenHtml = this.children
1051
+ .map((child) => {
1052
+ return child.toHtml();
1053
+ })
1054
+ .join('');
1055
+ const attrStr = super.generateAttributeString();
1056
+ return `<thead${attrStr}>${childrenHtml}</thead>`;
1057
+ }
1058
+ /**
1059
+ * @inheritDoc
1060
+ */
1061
+ toJSON() {
1062
+ return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
1063
+ }
1064
+ }
1065
+
1066
+ /**
1067
+ * Class representing a table head cell annotation in the rich text editor.
1068
+ */
1069
+ class RTETableHeadCellAnnotation extends RTETableCellAnnotation {
1070
+ constructor(annotation = {}, useInternalStyle = true) {
1071
+ super(annotation, useInternalStyle);
1072
+ }
1073
+ /**
1074
+ * @inheritDoc
1075
+ */
1076
+ static from(cellAnnotation, useInternalStyle) {
1077
+ return [
1078
+ exports.RTETableExtensionAnnotationTypeEnum.CELL,
1079
+ new RTETableHeadCellAnnotation(cellAnnotation, useInternalStyle),
1080
+ ];
1081
+ }
1082
+ /**
1083
+ * @inheritDoc
1084
+ */
1085
+ clone() {
1086
+ return new RTETableHeadCellAnnotation({
1087
+ backgroundColor: this.backgroundColor,
1088
+ padding: this.padding,
1089
+ border: this.border,
1090
+ width: this.width,
1091
+ height: this.height,
1092
+ textAlign: this.textAlign,
1093
+ verticalAlign: this.verticalAlign,
1094
+ minWidth: this.minWidth,
1095
+ boxSizing: this.boxSizing,
1096
+ }, this.useInternalStyle);
1097
+ }
1098
+ /**
1099
+ * @inheritDoc
1100
+ */
1101
+ renderStyle(options) {
1102
+ var _a;
1103
+ const styles = super.renderStyle(options);
1104
+ return object.cleanObject(Object.assign(Object.assign({}, styles), { backgroundColor: (_a = styles.backgroundColor) !== null && _a !== void 0 ? _a : RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR }));
1105
+ }
1106
+ }
1107
+ RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR = '#f2f2f2';
1108
+
1109
+ /**
1110
+ * Class representing a table head block in the rich text editor.
1111
+ */
1112
+ class RTETableHeadCellBlock extends RTETableCellBlock {
1113
+ constructor(id, options) {
1114
+ super(id, options);
1115
+ this.type = 'table-head-cell';
1116
+ const { autoMatchFormat } = options || { autoMatchFormat: true };
1117
+ if (autoMatchFormat) {
1118
+ this.annotationMap.set(exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation());
1119
+ }
1120
+ }
1121
+ /**
1122
+ * @inheritDoc
1123
+ */
1124
+ static from(block, options) {
1125
+ var _a;
1126
+ const headCellBlock = new RTETableHeadCellBlock(block.id, options);
1127
+ super.convertAnnotationsToMap(headCellBlock.annotationMap, Object.assign({}, block.annotations));
1128
+ if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
1129
+ headCellBlock.annotationMap.set(...RTETableHeadCellAnnotation.from(block.annotations.tableCell, options === null || options === void 0 ? void 0 : options.autoMatchFormat));
1130
+ }
1131
+ headCellBlock.children = super.generateBlockChildren(block.children, options, headCellBlock);
1132
+ return headCellBlock;
1133
+ }
1134
+ /**
1135
+ * @inheritDoc
1136
+ */
1137
+ clone(parent) {
1138
+ const clonedBlock = new RTETableHeadCellBlock(this.id);
1139
+ clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
1140
+ clonedBlock.parent = parent;
1141
+ clonedBlock.annotationMap = super.cloneAnnotations();
1142
+ return clonedBlock;
1143
+ }
1144
+ /**
1145
+ * @inheritDoc
1146
+ */
1147
+ toHtml() {
1148
+ const childrenHtml = this.children.map((child) => child.toHtml()).join('');
1149
+ const attrStr = super.generateAttributeString();
1150
+ return `<th${attrStr}>${childrenHtml}</th>`;
1151
+ }
1152
+ /**
1153
+ * @inheritDoc
1154
+ */
1155
+ toJSON() {
1156
+ return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
1157
+ }
1158
+ }
1159
+
1160
+ const MERGE_CELLS = 'MERGE_CELLS';
1161
+ /**
1162
+ * Action to merge cells into the RTETable.
1163
+ */
1164
+ class MergeCellsAction extends codeBlock.ModifyContentAction {
1165
+ constructor(targetCell, mergeCells, colSpan, rowSpan, direction) {
1166
+ super();
1167
+ this.type = MERGE_CELLS;
1168
+ this.isFlushable = true;
1169
+ this.targetCell = targetCell;
1170
+ this.mergeCells = mergeCells;
1171
+ this.colSpan = colSpan;
1172
+ this.rowSpan = rowSpan;
1173
+ this.direction = direction;
1174
+ }
1175
+ }
1176
+
1177
+ exports.MergeCellsOperationType = void 0;
1178
+ (function (MergeCellsOperationType) {
1179
+ MergeCellsOperationType["MERGE_CELLS"] = "MERGE_CELLS";
1180
+ MergeCellsOperationType["MERGE_CELL_UP"] = "MERGE_CELL_UP";
1181
+ MergeCellsOperationType["MERGE_CELL_RIGHT"] = "MERGE_CELL_RIGHT";
1182
+ MergeCellsOperationType["MERGE_CELL_DOWN"] = "MERGE_CELL_DOWN";
1183
+ MergeCellsOperationType["MERGE_CELL_LEFT"] = "MERGE_CELL_LEFT";
1184
+ })(exports.MergeCellsOperationType || (exports.MergeCellsOperationType = {}));
1185
+ /**
1186
+ * Event handler for merge cells operations in a table.
1187
+ */
1188
+ class MergeCellsOperationEventHandler extends SettingEventHandler {
1189
+ /**
1190
+ * @inheritDoc
1191
+ */
1192
+ canHandle(action) {
1193
+ return action[0] === exports.TableSettingType.MERGE_CELLS;
1194
+ }
1195
+ /**
1196
+ * @inheritDoc
1197
+ */
1198
+ execute(action, extensionContext) {
1199
+ const selectedCells = extensionContext.tableSelection.getSelectedCells();
1200
+ const operation = action[1];
1201
+ switch (operation) {
1202
+ case exports.MergeCellsOperationType.MERGE_CELL_UP:
1203
+ case exports.MergeCellsOperationType.MERGE_CELL_RIGHT:
1204
+ case exports.MergeCellsOperationType.MERGE_CELL_DOWN:
1205
+ case exports.MergeCellsOperationType.MERGE_CELL_LEFT:
1206
+ {
1207
+ const mergeCells = this.getDirectionMergeCells(operation, selectedCells[0]);
1208
+ this.handleMergeCells(mergeCells, operation);
1209
+ }
1210
+ break;
1211
+ default:
1212
+ {
1213
+ if (selectedCells.length > 1) {
1214
+ this.handleMergeCells(selectedCells, exports.MergeCellsOperationType.MERGE_CELLS);
1215
+ }
1216
+ }
1217
+ break;
1218
+ }
1219
+ }
1220
+ /**
1221
+ * Get the adjacent cell in the specified direction.
1222
+ *
1223
+ * @param {MergeCellsOperationType} direction - The direction to look for the adjacent cell.
1224
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} cell - The current cell.
1225
+ * @returns {Array<RTETableCellBlock | RTETableHeadCellBlock>} Array containing the cells to merge.
1226
+ */
1227
+ getDirectionMergeCells(direction, cell) {
1228
+ const adjacent = getAdjacentCell(cell, direction);
1229
+ if (!adjacent) {
1230
+ return [cell];
1231
+ }
1232
+ switch (direction) {
1233
+ case exports.MergeCellsOperationType.MERGE_CELL_UP:
1234
+ return [adjacent, cell];
1235
+ case exports.MergeCellsOperationType.MERGE_CELL_DOWN:
1236
+ return [cell, adjacent];
1237
+ case exports.MergeCellsOperationType.MERGE_CELL_LEFT:
1238
+ return [adjacent, cell];
1239
+ default:
1240
+ return [cell, adjacent];
1241
+ }
1242
+ }
1243
+ /**
1244
+ * Handle the merge cells operation by creating and applying a MergeCellsAction.
1245
+ *
1246
+ * @param {Array<RTETableCellBlock | RTETableHeadCellBlock>} mergeCells - The cells to merge.
1247
+ * @param {MergeCellsOperationType} direction - The merge cell direction.
1248
+ */
1249
+ handleMergeCells(mergeCells, direction) {
1250
+ if (mergeCells.length < 2) {
1251
+ return;
1252
+ }
1253
+ const rectInfo = getRectangularBounds(mergeCells);
1254
+ const { minRow, maxRow, minCol, maxCol, targetCell } = rectInfo;
1255
+ const colSpan = maxCol - minCol + 1;
1256
+ const rowSpan = maxRow - minRow + 1;
1257
+ const action = new MergeCellsAction(targetCell, mergeCells, colSpan, rowSpan, direction);
1258
+ this.applyActionOnTable(action, targetCell);
1259
+ }
1260
+ /**
1261
+ * Apply the specified action on the table containing the selected cell.
1262
+ *
1263
+ * @param {MergeCellsAction} action - The action to apply.
1264
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} selectedCell - The selected table cell.
1265
+ */
1266
+ applyActionOnTable(action, selectedCell) {
1267
+ const table = getParentBlockByType(selectedCell, RTETableBlock);
1268
+ if (table) {
1269
+ table.apply(action);
1270
+ }
1271
+ }
1272
+ }
1273
+
1274
+ /**
493
1275
  * Recursively searches for a parent block of a specific type.
494
1276
  *
495
1277
  * @typedef T - Generic type extending RTEBlock.
@@ -587,400 +1369,376 @@ function getDefaultCellBlockTemplate(cellType) {
587
1369
  ],
588
1370
  };
589
1371
  }
590
-
591
- exports.RowOperationType = void 0;
592
- (function (RowOperationType) {
593
- RowOperationType["HEADER_ROW"] = "HEADER_ROW";
594
- RowOperationType["ADD_ROW_ABOVE"] = "ADD_ROW_ABOVE";
595
- RowOperationType["ADD_ROW_BELOW"] = "ADD_ROW_BELOW";
596
- RowOperationType["DELETE_ROW"] = "DELETE_ROW";
597
- RowOperationType["SELECT_ROW"] = "SELECT_ROW";
598
- })(exports.RowOperationType || (exports.RowOperationType = {}));
599
1372
  /**
600
- * Event handler for row operations in a table.
1373
+ * Get the actual col span and row span of a cell.
1374
+ *
1375
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} cell - The cell to check.
1376
+ * @returns {CellSpan} The actual span values.
601
1377
  */
602
- class RowOperationEventHandler extends SettingEventHandler {
603
- /**
604
- * @inheritDoc
605
- */
606
- canHandle(action) {
607
- return action[0] === exports.TableSettingType.ROW;
608
- }
609
- /**
610
- * @inheritDoc
611
- */
612
- execute(action, extensionContext) {
613
- const operation = action[1];
614
- switch (operation) {
615
- case exports.RowOperationType.ADD_ROW_ABOVE:
616
- case exports.RowOperationType.ADD_ROW_BELOW:
617
- this.handleInsertRow(operation, extensionContext);
618
- break;
619
- case exports.RowOperationType.DELETE_ROW:
620
- this.handleDeleteRow(extensionContext);
621
- break;
622
- case exports.RowOperationType.HEADER_ROW:
623
- this.handleToggleHeader(extensionContext);
624
- break;
625
- case exports.RowOperationType.SELECT_ROW:
626
- this.handleSelectRow(extensionContext);
627
- break;
628
- }
629
- }
630
- /**
631
- * Adds a new row to the table at the specified position.
632
- *
633
- * @param {RowOperationType} direction - The position to insert the new row (above or below).
634
- * @param {RTETableExtensionContext} extensionContext - The extension context.
635
- */
636
- handleInsertRow(direction, extensionContext) {
637
- const selectedRows = this.getAllSelectedRows(extensionContext);
638
- if (selectedRows.length > 0) {
639
- const action = new InsertTableRowAction(direction === exports.RowOperationType.ADD_ROW_ABOVE
640
- ? exports.InsertTableRowDirection.ABOVE
641
- : exports.InsertTableRowDirection.BELOW, selectedRows);
642
- this.applyActionToTable(selectedRows[0], action);
643
- }
644
- }
645
- /**
646
- * Deletes the selected row(s) from the table.
647
- *
648
- * @param {RTETableExtensionContext} extensionContext - The extension context.
649
- */
650
- handleDeleteRow(extensionContext) {
651
- const selectedRows = this.getAllSelectedRows(extensionContext);
652
- if (selectedRows.length) {
653
- const action = new DeleteTableRowAction(selectedRows);
654
- this.applyActionToTable(selectedRows[0], action);
655
- }
656
- }
657
- /**
658
- * Converts selected rows to header rows or reverts them back to normal rows.
659
- *
660
- * @param {RTETableExtensionContext} extensionContext - The extension context.
661
- */
662
- handleToggleHeader(extensionContext) {
663
- const selectedRows = this.getAllSelectedRows(extensionContext);
664
- if (selectedRows.length > 0) {
665
- const action = new ToggleHeaderRowAction(selectedRows);
666
- this.applyActionToTable(selectedRows[0], action);
667
- }
668
- }
669
- /**
670
- * Selects the focus row(s) in the table.
671
- *
672
- * @param {RTETableExtensionContext} extensionContext - The extension context.
673
- */
674
- handleSelectRow(extensionContext) {
675
- const selectedRows = this.getAllSelectedRows(extensionContext);
676
- if (selectedRows.length > 0 && extensionContext && extensionContext.tableSelection) {
677
- const allCells = selectedRows.flatMap((row) => row.children);
678
- extensionContext.tableSelection.setSelectedCells(allCells);
679
- }
680
- }
681
- /**
682
- * Get all selected table rows.
683
- *
684
- * @param {RTETableExtensionContext} extensionContext - The extension context.
685
- * @returns {RTETableRowBlock[]} The selected table row blocks.
686
- */
687
- getAllSelectedRows(extensionContext) {
688
- const selectedRows = new Set();
689
- if (extensionContext && extensionContext.tableSelection) {
690
- const { tableSelection } = extensionContext;
691
- const selectedCells = tableSelection.getSelectedCells();
692
- selectedCells.forEach((cell) => {
693
- const rowBlock = getParentBlockByType(cell, RTETableRowBlock);
694
- if (rowBlock) {
695
- selectedRows.add(rowBlock);
696
- }
697
- });
698
- }
699
- return Array.from(selectedRows);
700
- }
701
- /**
702
- * Applies the given action to the table containing the reference block.
703
- *
704
- * @param {RTEBlock} refBlock - The reference block within the table.
705
- * @param {ModifyContentAction} action - The action to apply to the table.
706
- */
707
- applyActionToTable(refBlock, action) {
708
- const table = getParentBlockByType(refBlock, RTETableBlock);
709
- if (table) {
710
- table.apply(action);
711
- }
712
- }
1378
+ function getCellSpan(cell) {
1379
+ return { colSpan: cell.colSpan, rowSpan: cell.rowSpan };
713
1380
  }
714
-
715
1381
  /**
716
- * Class representing a table cell annotation in the rich text editor.
1382
+ * Get the actual column position of a cell considering previous cells' colspan
1383
+ * and cells from previous rows with rowspan that extend into the current row.
1384
+ *
1385
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} cell - The cell to check.
1386
+ * @param {RTETableRowBlock[]} allRows - The table all rows.
1387
+ * @returns {number} The actual column position.
717
1388
  */
718
- class RTETableCellAnnotation extends codeBlock.BlockAnnotation {
719
- constructor({ backgroundColor, padding = RTETableCellAnnotation.DEFAULT_PADDING, border = RTETableCellAnnotation.DEFAULT_BORDER, width, height, textAlign = RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN, verticalAlign = RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN, } = {}) {
720
- super();
721
- this.type = exports.RTETableExtensionAnnotationTypeEnum.CELL;
722
- this.backgroundColor = backgroundColor;
723
- this.padding = padding;
724
- this.border = border;
725
- this.width = width;
726
- this.height = height;
727
- this.textAlign = textAlign;
728
- this.verticalAlign = verticalAlign;
729
- }
730
- /**
731
- * @inheritDoc
732
- */
733
- static from(cellAnnotation) {
734
- return [exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableCellAnnotation(cellAnnotation)];
735
- }
736
- /**
737
- * Generates the CSS border string from the border properties.
738
- *
739
- * @returns {Nullable<string>} The CSS border string.
740
- */
741
- get borderStr() {
742
- if (!this.border)
743
- return null;
744
- return `${this.border.style} ${this.border.width} ${this.border.color}`;
745
- }
746
- /**
747
- * @inheritDoc
748
- */
749
- clone() {
750
- return new RTETableCellAnnotation({
751
- backgroundColor: this.backgroundColor,
752
- padding: this.padding,
753
- border: this.border,
754
- width: this.width,
755
- height: this.height,
756
- textAlign: this.textAlign,
757
- verticalAlign: this.verticalAlign,
758
- });
759
- }
760
- /**
761
- * @inheritDoc
762
- */
763
- toJSON() {
764
- return {
765
- tableCell: object.cleanObject({
766
- backgroundColor: this.backgroundColor,
767
- padding: this.padding,
768
- border: this.border,
769
- width: this.width,
770
- height: this.height,
771
- textAlign: this.textAlign,
772
- verticalAlign: this.verticalAlign,
773
- }),
774
- };
775
- }
776
- /**
777
- * @inheritDoc
778
- */
779
- renderStyle(options) {
780
- const style = {
781
- backgroundColor: this.backgroundColor,
782
- padding: this.padding,
783
- border: this.borderStr,
784
- width: this.width,
785
- height: this.height,
786
- textAlign: this.textAlign,
787
- verticalAlign: this.verticalAlign,
788
- };
789
- if (!(options === null || options === void 0 ? void 0 : options.standalone)) {
790
- return object.cleanObject(this.removeDefaultValues(style));
791
- }
792
- return object.cleanObject(Object.assign(Object.assign({}, style), { minWidth: RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH }));
793
- }
794
- /**
795
- * @inheritDoc
796
- */
797
- renderClass() {
798
- return null;
799
- }
800
- /**
801
- * Removes default values from the style object to avoid redundancy.
802
- *
803
- * @param {Record<string, Nullable<string>>} style - The style object to clean.
804
- * @returns {Record<string, Nullable<string>>} The cleaned style object.
805
- */
806
- removeDefaultValues(style) {
807
- const cleanedStyle = Object.assign({}, style);
808
- if (cleanedStyle.padding === RTETableCellAnnotation.DEFAULT_PADDING) {
809
- delete cleanedStyle.padding;
810
- }
811
- if (cleanedStyle.border ===
812
- `${RTETableCellAnnotation.DEFAULT_BORDER.style} ${RTETableCellAnnotation.DEFAULT_BORDER.width} ${RTETableCellAnnotation.DEFAULT_BORDER.color}`) {
813
- delete cleanedStyle.border;
814
- }
815
- if (cleanedStyle.textAlign === RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN) {
816
- delete cleanedStyle.textAlign;
817
- }
818
- if (cleanedStyle.verticalAlign === RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN) {
819
- delete cleanedStyle.verticalAlign;
1389
+ function getActualColumnPosition(cell, allRows) {
1390
+ const tableGrid = buildTableGrid(allRows);
1391
+ for (let row = 0; row < tableGrid.length; row++) {
1392
+ const cols = tableGrid[row];
1393
+ for (let col = 0; col < cols.length; col++) {
1394
+ if (cols[col] === cell.id) {
1395
+ return col;
1396
+ }
820
1397
  }
821
- return cleanedStyle;
822
1398
  }
1399
+ return -1;
823
1400
  }
824
- RTETableCellAnnotation.DEFAULT_PADDING = '12px';
825
- RTETableCellAnnotation.DEFAULT_BORDER = {
826
- style: 'solid',
827
- width: '1px',
828
- color: '#ddd',
829
- };
830
- RTETableCellAnnotation.DEFAULT_HORIZONTAL_TEXT_ALIGN = 'left';
831
- RTETableCellAnnotation.DEFAULT_VERTICAL_TEXT_ALIGN = 'middle';
832
- RTETableCellAnnotation.DEFAULT_CELL_MIN_WIDTH = '30px';
833
-
834
1401
  /**
835
- * Class representing a table cell block in the rich text editor.
1402
+ * Build a 2D grid representation of a table section where each occupied position
1403
+ * contains the cell id covering that (row, col) coordinate, accounting for colSpan/rowSpan.
1404
+ *
1405
+ * @param {RTETableRowBlock[]} allRows - All rows in the current table section.
1406
+ * @returns {string[][]} The table grid.
836
1407
  */
837
- class RTETableCellBlock extends codeBlock.RTEBlock {
838
- constructor(id, options) {
839
- super(id);
840
- this.type = 'table-cell';
841
- this.children = [];
842
- const { autoMatchFormat } = options || { autoMatchFormat: true };
843
- if (autoMatchFormat) {
844
- this.annotationMap.set(exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableCellAnnotation());
1408
+ function buildTableGrid(allRows) {
1409
+ const grid = [];
1410
+ allRows.forEach((row, rowIndex) => {
1411
+ if (!grid[rowIndex]) {
1412
+ grid[rowIndex] = [];
845
1413
  }
1414
+ let colIndex = 0;
1415
+ row.children.forEach((cell) => {
1416
+ const { colSpan, rowSpan } = getCellSpan(cell);
1417
+ while (grid[rowIndex][colIndex] !== undefined) {
1418
+ colIndex++;
1419
+ }
1420
+ for (let r = 0; r < rowSpan; r++) {
1421
+ for (let c = 0; c < colSpan; c++) {
1422
+ if (!grid[rowIndex + r]) {
1423
+ grid[rowIndex + r] = [];
1424
+ }
1425
+ grid[rowIndex + r][colIndex + c] = cell.id;
1426
+ }
1427
+ }
1428
+ colIndex += colSpan;
1429
+ });
1430
+ });
1431
+ return grid;
1432
+ }
1433
+ /**
1434
+ * Get the adjacent cell in the specified direction based on the table matrix.
1435
+ *
1436
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} cell - The current cell.
1437
+ * @param {AdjacentCellDirection} direction - The direction to locate the adjacent cell.
1438
+ * @returns {RTETableCellBlock | RTETableHeadCellBlock | null} The adjacent cell or null.
1439
+ */
1440
+ function getAdjacentCell(cell, direction) {
1441
+ if (!cell) {
1442
+ return null;
846
1443
  }
847
- /**
848
- * @inheritDoc
849
- */
850
- static from(block, options) {
851
- var _a;
852
- const tableCellBlock = new RTETableCellBlock(block.id, options);
853
- super.convertAnnotationsToMap(tableCellBlock.annotationMap, Object.assign({}, block.annotations));
854
- if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
855
- tableCellBlock.annotationMap.set(...RTETableCellAnnotation.from(block.annotations.tableCell));
856
- }
857
- tableCellBlock.children = super.generateBlockChildren(block.children, options, tableCellBlock);
858
- return tableCellBlock;
859
- }
860
- /**
861
- * @inheritDoc
862
- */
863
- clone(parent) {
864
- const clonedBlock = new RTETableCellBlock(this.id);
865
- clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
866
- clonedBlock.parent = parent;
867
- clonedBlock.annotationMap = super.cloneAnnotations();
868
- return clonedBlock;
869
- }
870
- /**
871
- * @inheritDoc
872
- */
873
- getLastNode() {
874
- return this.children[this.children.length - 1].getLastNode();
1444
+ const row = cell.parent;
1445
+ const sectionRows = row.parent.children;
1446
+ const rowIndex = sectionRows.indexOf(row);
1447
+ const { colSpan, rowSpan } = getCellSpan(cell);
1448
+ const cellColPosition = getActualColumnPosition(cell, sectionRows);
1449
+ let targetRowIndex = rowIndex;
1450
+ let targetColPosition = cellColPosition;
1451
+ switch (direction) {
1452
+ case exports.MergeCellsOperationType.MERGE_CELL_LEFT:
1453
+ targetColPosition = cellColPosition - 1;
1454
+ break;
1455
+ case exports.MergeCellsOperationType.MERGE_CELL_RIGHT:
1456
+ targetColPosition = cellColPosition + colSpan;
1457
+ break;
1458
+ case exports.MergeCellsOperationType.MERGE_CELL_UP:
1459
+ targetRowIndex = rowIndex - 1;
1460
+ break;
1461
+ default:
1462
+ targetRowIndex = rowIndex + rowSpan;
1463
+ break;
1464
+ }
1465
+ return findCellAtPosition(sectionRows, targetRowIndex, targetColPosition);
1466
+ }
1467
+ /**
1468
+ * Find the cell that covers the specified matrix position.
1469
+ *
1470
+ * @param {RTETableRowBlock[]} rows - Rows in the current table section.
1471
+ * @param {number} targetRowIndex - Target matrix row index.
1472
+ * @param {number} targetColPosition - Target matrix column position.
1473
+ * @returns {RTETableCellBlock | RTETableHeadCellBlock | null} The covering cell or null.
1474
+ */
1475
+ function findCellAtPosition(rows, targetRowIndex, targetColPosition) {
1476
+ for (let r = 0; r < rows.length; r++) {
1477
+ const currentRow = rows[r];
1478
+ for (const candidate of currentRow.children) {
1479
+ const { colSpan, rowSpan } = getCellSpan(candidate);
1480
+ const candidateColPosition = getActualColumnPosition(candidate, rows);
1481
+ const candidateRowStart = r;
1482
+ const candidateRowEnd = r + rowSpan - 1;
1483
+ const candidateColEnd = candidateColPosition + colSpan - 1;
1484
+ const isSameMatrixRow = targetRowIndex >= candidateRowStart && targetRowIndex <= candidateRowEnd;
1485
+ const isTargetColumnCovered = targetColPosition >= candidateColPosition && targetColPosition <= candidateColEnd;
1486
+ if (isSameMatrixRow && isTargetColumnCovered) {
1487
+ return candidate;
1488
+ }
1489
+ }
875
1490
  }
876
- /**
877
- * @inheritDoc
878
- */
879
- isNotEmpty() {
880
- return this.children.length > 0;
1491
+ return null;
1492
+ }
1493
+ /**
1494
+ * Get the rectangular bounds of selected cells.
1495
+ * Calculates the bounding box (minRow, maxRow, minCol, maxCol) and returns related information.
1496
+ *
1497
+ * @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
1498
+ * @returns {RectangularBounds} The rectangular bounds' information.
1499
+ */
1500
+ function getRectangularBounds(selectedCells) {
1501
+ const firstCell = selectedCells[0];
1502
+ const firstRow = firstCell.parent;
1503
+ const table = firstRow.parent;
1504
+ const allRows = table.children;
1505
+ let minRow = Number.POSITIVE_INFINITY;
1506
+ let maxRow = -1;
1507
+ let minCol = Number.POSITIVE_INFINITY;
1508
+ let maxCol = -1;
1509
+ const coveredPositions = new Set();
1510
+ selectedCells.forEach((cell) => {
1511
+ const row = cell.parent;
1512
+ const rowIndex = allRows.indexOf(row);
1513
+ const actualColPosition = getActualColumnPosition(cell, allRows);
1514
+ const { colSpan, rowSpan } = getCellSpan(cell);
1515
+ const cellMinRow = rowIndex;
1516
+ const cellMaxRow = rowIndex + rowSpan - 1;
1517
+ const cellMinCol = actualColPosition;
1518
+ const cellMaxCol = actualColPosition + colSpan - 1;
1519
+ for (let r = cellMinRow; r <= cellMaxRow; r++) {
1520
+ for (let c = cellMinCol; c <= cellMaxCol; c++) {
1521
+ coveredPositions.add(`${r},${c}`);
1522
+ }
1523
+ }
1524
+ minRow = Math.min(minRow, cellMinRow);
1525
+ maxRow = Math.max(maxRow, cellMaxRow);
1526
+ minCol = Math.min(minCol, cellMinCol);
1527
+ maxCol = Math.max(maxCol, cellMaxCol);
1528
+ });
1529
+ const targetCell = selectedCells[0];
1530
+ return {
1531
+ minRow,
1532
+ maxRow,
1533
+ minCol,
1534
+ maxCol,
1535
+ targetCell,
1536
+ coveredPositions,
1537
+ };
1538
+ }
1539
+ /**
1540
+ * Calculate the total number of columns in the table.
1541
+ * Accounts for cells with col span.
1542
+ *
1543
+ * @param {RTETableBlock} table - The table block.
1544
+ * @returns {number} The total number of columns in the table.
1545
+ */
1546
+ function getTableColumnCount(table) {
1547
+ const rows = getAllTableRows(table);
1548
+ // Calculate the total columns from the first row, accounting for col span
1549
+ let totalColumns = 0;
1550
+ const firstRow = rows[0];
1551
+ for (const cell of firstRow.children) {
1552
+ const { colSpan } = getCellSpan(cell);
1553
+ totalColumns += colSpan;
1554
+ }
1555
+ return totalColumns;
1556
+ }
1557
+ /**
1558
+ * Check if the selected cells form a rectangular area.
1559
+ * Considers cells with col span and row span.
1560
+ *
1561
+ * @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
1562
+ * @returns {boolean} True if the selected cells form a rectangle, false otherwise.
1563
+ */
1564
+ function isRectangularSelection(selectedCells) {
1565
+ if (selectedCells.length === 1) {
1566
+ return true;
1567
+ }
1568
+ const bounds = getRectangularBounds(selectedCells);
1569
+ const { minRow, maxRow, minCol, maxCol, coveredPositions } = bounds;
1570
+ const expectedPositions = (maxRow - minRow + 1) * (maxCol - minCol + 1);
1571
+ if (coveredPositions.size !== expectedPositions) {
1572
+ return false;
881
1573
  }
882
- /**
883
- * @inheritDoc
884
- */
885
- toHtml() {
886
- const childrenHtml = this.children.map((child) => child.toHtml()).join('');
887
- const attrStr = super.generateAttributeString();
888
- return `<td${attrStr}>${childrenHtml}</td>`;
1574
+ return true;
1575
+ }
1576
+ /**
1577
+ * Set the col span and row span attributes for a target cell.
1578
+ * When colSpan equals the table's total columns, rowSpan is removed.
1579
+ *
1580
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} targetCell - The target cell to set attributes on.
1581
+ * @param {number} colSpan - The column span value.
1582
+ * @param {number} rowSpan - The row span value.
1583
+ * @param {RTETableBlock} table - The table block.
1584
+ */
1585
+ function setSpanAttributes(targetCell, colSpan, rowSpan, table) {
1586
+ const existingAnnotation = targetCell.annotationMap.get(codeBlock.CommonAnnotationTypeEnum.CUSTOM_ATTRIBUTE);
1587
+ const existingAttrs = existingAnnotation
1588
+ ? Object.assign({}, existingAnnotation['customAttribute']) : {};
1589
+ delete existingAttrs.colspan;
1590
+ delete existingAttrs.rowspan;
1591
+ if (colSpan > 1) {
1592
+ existingAttrs.colspan = String(colSpan);
1593
+ }
1594
+ // When colspan equals table column count, don't set rowspan
1595
+ const tableColumnCount = getTableColumnCount(table);
1596
+ if (rowSpan > 1 && colSpan !== tableColumnCount) {
1597
+ existingAttrs.rowspan = String(rowSpan);
1598
+ }
1599
+ if (Object.keys(existingAttrs).length > 0) {
1600
+ const customAttributeAnnotation = new codeBlock.CustomAttributeAnnotation(existingAttrs);
1601
+ targetCell.annotationMap.set(codeBlock.CommonAnnotationTypeEnum.CUSTOM_ATTRIBUTE, customAttributeAnnotation);
1602
+ }
1603
+ else {
1604
+ targetCell.annotationMap.delete(codeBlock.CommonAnnotationTypeEnum.CUSTOM_ATTRIBUTE);
889
1605
  }
890
- /**
891
- * @inheritDoc
892
- */
893
- toJSON() {
894
- return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
1606
+ }
1607
+ /**
1608
+ * Create a new cell of the specified type.
1609
+ *
1610
+ * @param {string} cellType - The type of cell ('table-cell' or 'table-head-cell').
1611
+ * @returns {RTETableCellBlock | RTETableHeadCellBlock} The newly created cell.
1612
+ */
1613
+ function createNewCell(cellType) {
1614
+ const cellTemplate = getDefaultCellBlockTemplate(cellType);
1615
+ if (cellType === 'table-head-cell') {
1616
+ return RTETableHeadCellBlock.from(cellTemplate);
895
1617
  }
1618
+ return RTETableCellBlock.from(cellTemplate);
896
1619
  }
897
1620
 
1621
+ exports.RowOperationType = void 0;
1622
+ (function (RowOperationType) {
1623
+ RowOperationType["HEADER_ROW"] = "HEADER_ROW";
1624
+ RowOperationType["ADD_ROW_ABOVE"] = "ADD_ROW_ABOVE";
1625
+ RowOperationType["ADD_ROW_BELOW"] = "ADD_ROW_BELOW";
1626
+ RowOperationType["DELETE_ROW"] = "DELETE_ROW";
1627
+ RowOperationType["SELECT_ROW"] = "SELECT_ROW";
1628
+ })(exports.RowOperationType || (exports.RowOperationType = {}));
898
1629
  /**
899
- * Class representing a table head cell annotation in the rich text editor.
1630
+ * Event handler for row operations in a table.
900
1631
  */
901
- class RTETableHeadCellAnnotation extends RTETableCellAnnotation {
902
- constructor(annotation = {}) {
903
- super(annotation);
904
- }
1632
+ class RowOperationEventHandler extends SettingEventHandler {
905
1633
  /**
906
1634
  * @inheritDoc
907
1635
  */
908
- static from(cellAnnotation) {
909
- return [exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation(cellAnnotation)];
1636
+ canHandle(action) {
1637
+ return action[0] === exports.TableSettingType.ROW;
910
1638
  }
911
1639
  /**
912
1640
  * @inheritDoc
913
1641
  */
914
- clone() {
915
- return new RTETableHeadCellAnnotation({
916
- backgroundColor: this.backgroundColor,
917
- padding: this.padding,
918
- border: this.border,
919
- width: this.width,
920
- height: this.height,
921
- textAlign: this.textAlign,
922
- verticalAlign: this.verticalAlign,
923
- });
1642
+ execute(action, extensionContext) {
1643
+ const operation = action[1];
1644
+ switch (operation) {
1645
+ case exports.RowOperationType.ADD_ROW_ABOVE:
1646
+ case exports.RowOperationType.ADD_ROW_BELOW:
1647
+ this.handleInsertRow(operation, extensionContext);
1648
+ break;
1649
+ case exports.RowOperationType.DELETE_ROW:
1650
+ this.handleDeleteRow(extensionContext);
1651
+ break;
1652
+ case exports.RowOperationType.HEADER_ROW:
1653
+ this.handleToggleHeader(extensionContext);
1654
+ break;
1655
+ case exports.RowOperationType.SELECT_ROW:
1656
+ this.handleSelectRow(extensionContext);
1657
+ break;
1658
+ }
924
1659
  }
925
1660
  /**
926
- * @inheritDoc
1661
+ * Adds a new row to the table at the specified position.
1662
+ *
1663
+ * @param {RowOperationType} direction - The position to insert the new row (above or below).
1664
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
927
1665
  */
928
- renderStyle(options) {
929
- var _a;
930
- const styles = super.renderStyle(options);
931
- return object.cleanObject(Object.assign(Object.assign({}, styles), { backgroundColor: (_a = this.backgroundColor) !== null && _a !== void 0 ? _a : RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR }));
1666
+ handleInsertRow(direction, extensionContext) {
1667
+ const selectedRows = this.getAllSelectedRows(extensionContext);
1668
+ if (selectedRows.length > 0) {
1669
+ const action = new InsertTableRowAction(direction === exports.RowOperationType.ADD_ROW_ABOVE
1670
+ ? exports.InsertTableRowDirection.ABOVE
1671
+ : exports.InsertTableRowDirection.BELOW, selectedRows);
1672
+ this.applyActionToTable(selectedRows[0], action);
1673
+ }
932
1674
  }
933
- }
934
- RTETableHeadCellAnnotation.DEFAULT_BACKGROUND_COLOR = '#f2f2f2';
935
-
936
- /**
937
- * Class representing a table head block in the rich text editor.
938
- */
939
- class RTETableHeadCellBlock extends RTETableCellBlock {
940
- constructor(id, options) {
941
- super(id, options);
942
- this.type = 'table-head-cell';
943
- const { autoMatchFormat } = options || { autoMatchFormat: true };
944
- if (autoMatchFormat) {
945
- this.annotationMap.set(exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation());
1675
+ /**
1676
+ * Deletes the selected row(s) from the table.
1677
+ *
1678
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
1679
+ */
1680
+ handleDeleteRow(extensionContext) {
1681
+ const selectedRows = this.getAllSelectedRows(extensionContext);
1682
+ if (selectedRows.length) {
1683
+ const action = new DeleteTableRowAction(selectedRows);
1684
+ this.applyActionToTable(selectedRows[0], action);
946
1685
  }
947
1686
  }
948
1687
  /**
949
- * @inheritDoc
1688
+ * Converts selected rows to header rows or reverts them back to normal rows.
1689
+ *
1690
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
950
1691
  */
951
- static from(block, options) {
952
- var _a;
953
- const headCellBlock = new RTETableHeadCellBlock(block.id, options);
954
- super.convertAnnotationsToMap(headCellBlock.annotationMap, Object.assign({}, block.annotations));
955
- if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.tableCell) {
956
- headCellBlock.annotationMap.set(...RTETableHeadCellAnnotation.from(block.annotations.tableCell));
1692
+ handleToggleHeader(extensionContext) {
1693
+ const selectedRows = this.getAllSelectedRows(extensionContext);
1694
+ if (selectedRows.length > 0) {
1695
+ const action = new ToggleHeaderRowAction(selectedRows);
1696
+ this.applyActionToTable(selectedRows[0], action);
957
1697
  }
958
- headCellBlock.children = super.generateBlockChildren(block.children, options, headCellBlock);
959
- return headCellBlock;
960
1698
  }
961
1699
  /**
962
- * @inheritDoc
1700
+ * Selects the focus row(s) in the table.
1701
+ *
1702
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
963
1703
  */
964
- clone(parent) {
965
- const clonedBlock = new RTETableHeadCellBlock(this.id);
966
- clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
967
- clonedBlock.parent = parent;
968
- clonedBlock.annotationMap = super.cloneAnnotations();
969
- return clonedBlock;
1704
+ handleSelectRow(extensionContext) {
1705
+ const selectedRows = this.getAllSelectedRows(extensionContext);
1706
+ if (selectedRows.length > 0 && extensionContext && extensionContext.tableSelection) {
1707
+ const allCells = selectedRows.flatMap((row) => row.children);
1708
+ extensionContext.tableSelection.setSelectedCells(allCells);
1709
+ }
970
1710
  }
971
1711
  /**
972
- * @inheritDoc
1712
+ * Get all selected table rows.
1713
+ *
1714
+ * @param {RTETableExtensionContext} extensionContext - The extension context.
1715
+ * @returns {RTETableRowBlock[]} The selected table row blocks.
973
1716
  */
974
- toHtml() {
975
- const childrenHtml = this.children.map((child) => child.toHtml()).join('');
976
- const attrStr = super.generateAttributeString();
977
- return `<th${attrStr}>${childrenHtml}</th>`;
1717
+ getAllSelectedRows(extensionContext) {
1718
+ const selectedRows = new Set();
1719
+ if (extensionContext && extensionContext.tableSelection) {
1720
+ const { tableSelection } = extensionContext;
1721
+ const selectedCells = tableSelection.getSelectedCells();
1722
+ selectedCells.forEach((cell) => {
1723
+ const rowBlock = getParentBlockByType(cell, RTETableRowBlock);
1724
+ if (rowBlock) {
1725
+ selectedRows.add(rowBlock);
1726
+ }
1727
+ });
1728
+ }
1729
+ return Array.from(selectedRows);
978
1730
  }
979
1731
  /**
980
- * @inheritDoc
1732
+ * Applies the given action to the table containing the reference block.
1733
+ *
1734
+ * @param {RTEBlock} refBlock - The reference block within the table.
1735
+ * @param {ModifyContentAction} action - The action to apply to the table.
981
1736
  */
982
- toJSON() {
983
- return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
1737
+ applyActionToTable(refBlock, action) {
1738
+ const table = getParentBlockByType(refBlock, RTETableBlock);
1739
+ if (table) {
1740
+ table.apply(action);
1741
+ }
984
1742
  }
985
1743
  }
986
1744
 
@@ -1254,38 +2012,96 @@ class ColumnOperationEventHandler extends SettingEventHandler {
1254
2012
  }
1255
2013
  }
1256
2014
 
1257
- const RTE_TABLE_BORDER_STYLES = [
1258
- 'none',
1259
- 'solid',
1260
- 'dashed',
1261
- 'dotted',
1262
- 'double',
1263
- 'groove',
1264
- 'ridge',
1265
- 'inset',
1266
- 'outset',
1267
- ];
1268
- const RTE_TABLE_DEFAULT_COLORS = [
1269
- { dark: '#04041C', light: '#FCFCFC' },
1270
- { dark: '#AA091C', light: '#FF4C61' },
1271
- { dark: '#974502', light: '#FDAB68' },
1272
- { dark: '#735C00', light: '#FFDC4C' },
1273
- { dark: '#2E6D18', light: '#7BDA58' },
1274
- { dark: '#287171', light: '#7BD1D1' },
1275
- { dark: '#595959', light: '#999999' },
1276
- { dark: '#FCFCFC', light: '#04041C' },
1277
- ];
2015
+ const SPLIT_CELL_HORIZONTALLY = 'SPLIT_CELL_HORIZONTALLY';
2016
+ /**
2017
+ * Action to split a table cell horizontally.
2018
+ */
2019
+ class SplitCellHorizontallyAction extends codeBlock.ModifyContentAction {
2020
+ constructor() {
2021
+ super();
2022
+ this.isFlushable = true;
2023
+ this.type = SPLIT_CELL_HORIZONTALLY;
2024
+ }
2025
+ }
2026
+
2027
+ const SPLIT_CELL_VERTICALLY = 'SPLIT_CELL_VERTICALLY';
2028
+ /**
2029
+ * Action to split a table cell vertically.
2030
+ */
2031
+ class SplitCellVerticallyAction extends codeBlock.ModifyContentAction {
2032
+ constructor() {
2033
+ super();
2034
+ this.isFlushable = true;
2035
+ this.type = SPLIT_CELL_VERTICALLY;
2036
+ }
2037
+ }
2038
+
2039
+ exports.SplitCellOperationType = void 0;
2040
+ (function (SplitCellOperationType) {
2041
+ SplitCellOperationType["SPLIT_CELL_HORIZONTALLY"] = "SPLIT_CELL_HORIZONTALLY";
2042
+ SplitCellOperationType["SPLIT_CELL_VERTICALLY"] = "SPLIT_CELL_VERTICALLY";
2043
+ })(exports.SplitCellOperationType || (exports.SplitCellOperationType = {}));
2044
+ /**
2045
+ * Event handler for split cell operations in a table.
2046
+ */
2047
+ class SplitCellOperationEventHandler extends SettingEventHandler {
2048
+ /**
2049
+ * @inheritDoc
2050
+ */
2051
+ canHandle(action) {
2052
+ return action[0] === exports.TableSettingType.SPLIT_CELL;
2053
+ }
2054
+ /**
2055
+ * @inheritDoc
2056
+ */
2057
+ execute(action, extensionContext) {
2058
+ const selectedCells = extensionContext.tableSelection.getSelectedCells();
2059
+ if (selectedCells && selectedCells.length === 1) {
2060
+ const targetCell = selectedCells[0];
2061
+ const operation = action[1];
2062
+ switch (operation) {
2063
+ case exports.SplitCellOperationType.SPLIT_CELL_HORIZONTALLY:
2064
+ this.handleSplitCellHorizontally(targetCell);
2065
+ break;
2066
+ case exports.SplitCellOperationType.SPLIT_CELL_VERTICALLY:
2067
+ this.handleSplitCellVertically(targetCell);
2068
+ break;
2069
+ }
2070
+ }
2071
+ }
2072
+ /**
2073
+ * Splits the selected table cell horizontally (split top/bottom).
2074
+ *
2075
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} selectedCell - The table cell block to split.
2076
+ */
2077
+ handleSplitCellHorizontally(selectedCell) {
2078
+ const action = new SplitCellHorizontallyAction();
2079
+ selectedCell.apply(action);
2080
+ }
2081
+ /**
2082
+ * Splits the selected table cell vertically (split left/right).
2083
+ *
2084
+ * @param {RTETableCellBlock | RTETableHeadCellBlock} selectedCell - The table cell block to split.
2085
+ */
2086
+ handleSplitCellVertically(selectedCell) {
2087
+ const action = new SplitCellVerticallyAction();
2088
+ selectedCell.apply(action);
2089
+ }
2090
+ }
1278
2091
 
1279
2092
  exports.ColumnOperationEventHandler = ColumnOperationEventHandler;
1280
2093
  exports.DELETE_TABLE_COLUMN = DELETE_TABLE_COLUMN;
1281
2094
  exports.DELETE_TABLE_ROW = DELETE_TABLE_ROW;
1282
2095
  exports.INSERT_TABLE_COLUMN = INSERT_TABLE_COLUMN;
1283
2096
  exports.INSERT_TABLE_ROW = INSERT_TABLE_ROW;
2097
+ exports.MERGE_CELLS = MERGE_CELLS;
2098
+ exports.MergeCellsOperationEventHandler = MergeCellsOperationEventHandler;
1284
2099
  exports.RTETableAnnotation = RTETableAnnotation;
1285
2100
  exports.RTETableBlock = RTETableBlock;
1286
2101
  exports.RTETableBodyBlock = RTETableBodyBlock;
1287
2102
  exports.RTETableCellAnnotation = RTETableCellAnnotation;
1288
2103
  exports.RTETableCellBlock = RTETableCellBlock;
2104
+ exports.RTETableColorManager = RTETableColorManager;
1289
2105
  exports.RTETableHeadBlock = RTETableHeadBlock;
1290
2106
  exports.RTETableHeadCellAnnotation = RTETableHeadCellAnnotation;
1291
2107
  exports.RTETableHeadCellBlock = RTETableHeadCellBlock;
@@ -1294,13 +2110,24 @@ exports.RTE_TABLE_BORDER_STYLES = RTE_TABLE_BORDER_STYLES;
1294
2110
  exports.RTE_TABLE_DEFAULT_COLORS = RTE_TABLE_DEFAULT_COLORS;
1295
2111
  exports.RowOperationEventHandler = RowOperationEventHandler;
1296
2112
  exports.SELECT_TABLE_COLUMN = SELECT_TABLE_COLUMN;
2113
+ exports.SPLIT_CELL_HORIZONTALLY = SPLIT_CELL_HORIZONTALLY;
2114
+ exports.SPLIT_CELL_VERTICALLY = SPLIT_CELL_VERTICALLY;
1297
2115
  exports.SettingEventHandler = SettingEventHandler;
2116
+ exports.SplitCellOperationEventHandler = SplitCellOperationEventHandler;
1298
2117
  exports.TOGGLE_HEADER_ROW = TOGGLE_HEADER_ROW;
1299
2118
  exports.TOGGLE_HEADER_TABLE_COLUMN = TOGGLE_HEADER_TABLE_COLUMN;
1300
2119
  exports.TableColumnStrategy = TableColumnStrategy;
1301
2120
  exports.ToggleHeaderTableColumnStrategy = ToggleHeaderTableColumnStrategy;
2121
+ exports.VegaThemeManager = VegaThemeManager;
2122
+ exports.buildTableGrid = buildTableGrid;
2123
+ exports.createNewCell = createNewCell;
1302
2124
  exports.generateTableBody = generateTableBody;
2125
+ exports.getActualColumnPosition = getActualColumnPosition;
2126
+ exports.getAdjacentCell = getAdjacentCell;
1303
2127
  exports.getAllTableRows = getAllTableRows;
2128
+ exports.getCellSpan = getCellSpan;
1304
2129
  exports.getDefaultCellBlockTemplate = getDefaultCellBlockTemplate;
1305
2130
  exports.getFirstNode = getFirstNode;
1306
2131
  exports.getParentBlockByType = getParentBlockByType;
2132
+ exports.isRectangularSelection = isRectangularSelection;
2133
+ exports.setSpanAttributes = setSpanAttributes;