@heartlandone/vega 2.73.0 → 2.74.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.
- package/dist/cjs/align-left-4a76df69.js +22 -0
- package/dist/cjs/{app-globals-cc162173.js → app-globals-be2e868e.js} +18 -17
- package/dist/cjs/{code-block-823cd481.js → code-block-22ee2550.js} +35 -4
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-e2e0c6f3.js → component-value-history-controller-slimmer.abstract-3486cbc0.js} +26 -5
- package/dist/cjs/{dto-renderer-manager-bd2bd447.js → content-state-0be6fda3.js} +33 -60
- package/dist/cjs/{design-token-11656685.js → design-token-505997df.js} +1 -1
- package/dist/cjs/dto-renderer-manager-ae5fcbba.js +58 -0
- package/dist/cjs/{element-appender-slimmer-12f40b8b.js → element-appender-slimmer-26420c09.js} +6 -6
- package/dist/cjs/{form-field-controller-slimmer-6e3e14fd.js → form-field-controller-slimmer-56c551ea.js} +2 -2
- package/dist/cjs/{image-annotation-action-7408a4b3.js → image-annotation-action-462fd073.js} +3 -3
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/{index-638a0f0d.js → index-fc538f17.js} +1 -1
- package/dist/cjs/index.cjs.js +43 -38
- package/dist/cjs/{language-extension-716015a5.js → language-extension-414149c2.js} +8 -8
- package/dist/cjs/loader.cjs.js +13 -8
- package/dist/cjs/{public-rules-2950f1fc.js → public-rules-2d18cf41.js} +4 -4
- package/dist/cjs/{range-c3c48132.js → range-439a0c0c.js} +1 -1
- package/dist/cjs/{responsive-format-facade-96c5f598.js → responsive-format-facade-0ececeb3.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-4aab05a3.js → rich-text-editor-required-rule-5a4f3626.js} +2 -2
- package/dist/cjs/{string-input-formatter-slimmer-338bbd73.js → string-input-formatter-slimmer-a8f4a9b1.js} +2 -2
- package/dist/cjs/{style-formatter-9c42d41b.js → style-formatter-142500c0.js} +1 -1
- package/dist/cjs/styles.constants-3aff0b56.js +1306 -0
- package/dist/cjs/{sub-state-notify-slimmer-1efa69c4.js → sub-state-notify-slimmer-011866d9.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-6afa62f5.js → sub-state-observer-slimmer-23d43f1e.js} +1 -1
- package/dist/cjs/table-extension-2a20da57.js +6018 -0
- package/dist/cjs/vega-accordion.cjs.entry.js +10 -6
- package/dist/cjs/vega-app-header-button.cjs.entry.js +10 -6
- package/dist/cjs/vega-box.cjs.entry.js +11 -7
- package/dist/cjs/vega-button-circle.cjs.entry.js +10 -6
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +9 -5
- package/dist/cjs/vega-calendar_4.cjs.entry.js +3 -3
- package/dist/cjs/vega-card.cjs.entry.js +10 -6
- package/dist/cjs/vega-carousel.cjs.entry.js +9 -5
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-chip.cjs.entry.js +10 -6
- package/dist/cjs/vega-code-block.cjs.entry.js +4 -4
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-combo-box.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +15 -11
- package/dist/cjs/vega-dialog_2.cjs.entry.js +17 -13
- package/dist/cjs/vega-divider.cjs.entry.js +10 -6
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +24 -11
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +10 -6
- package/dist/cjs/vega-flex.cjs.entry.js +11 -7
- package/dist/cjs/vega-font.cjs.entry.js +10 -6
- package/dist/cjs/vega-form.cjs.entry.js +4 -4
- package/dist/cjs/vega-grid.cjs.entry.js +10 -6
- package/dist/cjs/vega-icon.cjs.entry.js +10 -6
- package/dist/cjs/vega-image-uploader.cjs.entry.js +12 -8
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-passcode.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +10 -6
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +181 -50
- package/dist/cjs/vega-input.cjs.entry.js +5 -5
- package/dist/cjs/{vega-internal-event-id-f2465f1b.js → vega-internal-event-id-73334b4b.js} +4 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +17 -13
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +11 -7
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +9 -5
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -7
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +11 -7
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +10 -9
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +70 -54
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +1313 -0
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +12 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +15 -11
- package/dist/cjs/vega-signature-capture.cjs.entry.js +12 -8
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -3
- package/dist/cjs/vega-table_11.cjs.entry.js +16 -13
- package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +12 -8
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +10 -6
- package/dist/cjs/vega.cjs.js +13 -8
- package/dist/collection/collection-manifest.json +10 -0
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +6 -3
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +31 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-item-controller.js +89 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +33 -13
- package/dist/collection/components/vega-input-select/vega-input-select.js +27 -7
- package/dist/collection/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +10 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/plain-text-annotation.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +24 -2
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +18 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +18 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-children-remove-interceptor.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-content-delete-interceptor.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-row-insert-interceptor.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-block-strategy.js +25 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-column-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-row-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-block-strategy.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-column-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-strategy.js +117 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/select-table-column-strategy.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-column-strategy.abstract.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-row-strategy.js +133 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-table-column-strategy.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-cell-properties-strategy.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-properties-strategy.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-column-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/delete-table-row-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-column-action.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-action.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/select-table-column-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-caption-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-head-cell-annotations-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/toggle-header-row-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/toggle-header-table-column-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/update-table-properties-action.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +82 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.js +91 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.js +121 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.js +40 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/constants/styles.constants.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +119 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +56 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +66 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +53 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/caption-to-caption-block-strategy.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/table-to-table-block-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tbody-to-table-body-block-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/td-to-table-cell-block-strategy.js +71 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/thead-to-table-head-block-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tr-to-table-row-block-strategy.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.js +74 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.js +254 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +149 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +148 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/caption-operation.js +78 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-cancel-event-handler.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-change-event-handler.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-save-event-handler.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties.js +131 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/column-operation.js +109 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/row-operation.js +132 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.js +44 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-cancel-event-handler.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-change-event-handler.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-save-event-handler.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +152 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-icon.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-selection.js +371 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +234 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/utils/utils.js +102 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-bottom.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-middle.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-top.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-center-horizontal.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-left.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-right.js +3 -0
- 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 +27 -0
- 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 +106 -0
- 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 +259 -0
- 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 +58 -0
- 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 +93 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.css +148 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.js +241 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/renderers/selection-widget-renderer.js +83 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.css +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.js +80 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/assets/icon.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.js +86 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.js +101 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.js +75 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.css +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.js +215 -0
- package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +21 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +10 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +23 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +6 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +257 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/annotation-handler-registration.test.js +164 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-annotation-handler.test.js +293 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-cell-annotation-handler.test.js +295 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-head-cell-annotation-handler.test.js +415 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/caption-operation.test.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-annotation.test.js +89 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-caption-annotations.test.js +79 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-cell-annotation.test.js +128 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-dto.test.js +517 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-element-to-dto-strategies.test.js +1450 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/table/table-test-utils.js +172 -0
- package/dist/collection/components/vega-rich-text-editor/test/spec-utils.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +4 -0
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +2 -0
- package/dist/collection/utils/spec-utils.js +4 -3
- package/dist/esm/align-left-7f959adf.js +17 -0
- package/dist/esm/{app-globals-949d2e18.js → app-globals-8b873b6f.js} +7 -6
- package/dist/esm/{child-nodes-event-prevent-slimmer-e6f98de5.js → child-nodes-event-prevent-slimmer-a6afdb1e.js} +1 -1
- package/dist/esm/{code-block-666674d7.js → code-block-76b29be1.js} +37 -6
- package/dist/esm/{component-value-history-controller-slimmer.abstract-171dda08.js → component-value-history-controller-slimmer.abstract-e1b0e163.js} +27 -6
- package/dist/esm/{dto-renderer-manager-49ae5d56.js → content-state-03f1d302.js} +32 -61
- package/dist/esm/{design-token-9b510e59.js → design-token-8fedb532.js} +1 -1
- package/dist/esm/{dom-node-subject-observer-factory-1aaa1159.js → dom-node-subject-observer-factory-e998eba4.js} +1 -1
- package/dist/esm/dto-renderer-manager-12bc9121.js +56 -0
- package/dist/esm/{element-appender-slimmer-b9890dcb.js → element-appender-slimmer-7b9326e2.js} +4 -4
- package/dist/esm/{event-emit-slimmer-2d791d0e.js → event-emit-slimmer-bbf6668c.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-257928c1.js → form-field-controller-slimmer-a0cff4d3.js} +3 -3
- package/dist/esm/{image-annotation-action-b3eea6a2.js → image-annotation-action-47cdc068.js} +3 -3
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/{index-0d487fae.js → index-da7e5fe5.js} +2 -2
- package/dist/esm/index.js +17 -13
- package/dist/esm/{internal-vega-event-manager-fdee2a0a.js → internal-vega-event-manager-e799c54a.js} +1 -1
- package/dist/esm/{language-extension-b3f836d4.js → language-extension-de6e6caf.js} +2 -2
- package/dist/esm/loader.js +15 -10
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{public-rules-b164e40e.js → public-rules-c48cc5c9.js} +5 -5
- package/dist/esm/{range-9cc1422b.js → range-af6150a8.js} +1 -1
- package/dist/esm/{responsive-format-facade-94897ae8.js → responsive-format-facade-16da4623.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-2131f21c.js → rich-text-editor-required-rule-7255832e.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-3a42d9b8.js → string-input-formatter-slimmer-82f85b0b.js} +3 -3
- package/dist/esm/{style-formatter-bb5aec96.js → style-formatter-6ca58f6b.js} +1 -1
- package/dist/esm/styles.constants-0dd6f7fa.js +1277 -0
- package/dist/esm/{sub-state-notify-slimmer-71b9bbd5.js → sub-state-notify-slimmer-4060c333.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-41a1b380.js → sub-state-observer-slimmer-bfa5e63e.js} +2 -2
- package/dist/esm/table-extension-c83b7a56.js +5998 -0
- package/dist/esm/vega-accordion.entry.js +13 -9
- package/dist/esm/vega-app-header-button.entry.js +14 -10
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +13 -9
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +14 -10
- package/dist/esm/vega-button-group_2.entry.js +7 -7
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +13 -9
- package/dist/esm/vega-calendar_4.entry.js +7 -7
- package/dist/esm/vega-card.entry.js +12 -8
- package/dist/esm/vega-carousel.entry.js +12 -8
- package/dist/esm/vega-checkbox_2.entry.js +7 -7
- package/dist/esm/vega-chip.entry.js +14 -10
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +6 -6
- package/dist/esm/vega-combo-box.entry.js +7 -7
- package/dist/esm/vega-date-picker_2.entry.js +19 -15
- package/dist/esm/vega-dialog_2.entry.js +14 -10
- package/dist/esm/vega-divider.entry.js +12 -8
- package/dist/esm/vega-dropdown_5.entry.js +28 -15
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +6 -6
- package/dist/esm/vega-flag-icon.entry.js +12 -8
- package/dist/esm/vega-flex.entry.js +13 -9
- package/dist/esm/vega-font.entry.js +12 -8
- package/dist/esm/vega-form.entry.js +8 -8
- package/dist/esm/vega-grid.entry.js +12 -8
- package/dist/esm/vega-icon.entry.js +12 -8
- package/dist/esm/vega-image-uploader.entry.js +15 -11
- package/dist/esm/vega-input-credit-card.entry.js +7 -7
- package/dist/esm/vega-input-numeric.entry.js +8 -8
- package/dist/esm/vega-input-passcode.entry.js +7 -7
- package/dist/esm/vega-input-phone-number.entry.js +14 -10
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +185 -54
- package/dist/esm/vega-input.entry.js +8 -8
- package/dist/esm/{vega-internal-event-id-4a06d705.js → vega-internal-event-id-3edc9b4e.js} +3 -1
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +16 -12
- package/dist/esm/vega-loader-wrapper_2.entry.js +11 -7
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +4 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +13 -9
- package/dist/esm/vega-popover_2.entry.js +14 -10
- package/dist/esm/vega-progress-tracker_2.entry.js +14 -10
- package/dist/esm/vega-radio_2.entry.js +7 -7
- package/dist/esm/vega-rich-text-content.entry.js +8 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +53 -37
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +1307 -0
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +16 -12
- package/dist/esm/vega-selection-tile_2.entry.js +8 -8
- package/dist/esm/vega-sidenav_3.entry.js +14 -10
- package/dist/esm/vega-signature-capture.entry.js +15 -11
- package/dist/esm/vega-stepper.entry.js +7 -7
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +14 -11
- package/dist/esm/vega-textarea.entry.js +7 -7
- package/dist/esm/vega-time-picker_2.entry.js +16 -12
- package/dist/esm/vega-toggle-switch.entry.js +6 -6
- package/dist/esm/vega-tooltip_2.entry.js +12 -8
- package/dist/esm/vega.js +15 -10
- package/dist/sri/vega-sri-manifest.json +696 -296
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +8 -1
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-item-controller.d.ts +29 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +1 -1
- package/dist/types/components/vega-input-select/types.d.ts +5 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +12 -4
- package/dist/types/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +2 -5
- package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +10 -6
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +8 -1
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +15 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-children-remove-interceptor.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-cell-content-delete-interceptor.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-interceptors/prevent-row-insert-interceptor.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-block-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-column-strategy.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/delete-table-row-strategy.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-column-strategy.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/insert-table-row-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/select-table-column-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/table-column-strategy.abstract.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-row-strategy.d.ts +41 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/toggle-header-table-column-strategy.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-cell-properties-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/action-handler-strategies/update-table-properties-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-block-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-column-action.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/delete-table-row-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-block-action.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-column-action.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/insert-table-row-action.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/select-table-column-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-caption-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-head-cell-annotations-action.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/toggle-header-row-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/toggle-header-table-column-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/update-table-properties-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.d.ts +43 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.d.ts +64 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.d.ts +67 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-head-cell-annotation.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/constants/styles.constants.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +79 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +41 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +34 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/caption-to-caption-block-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/table-to-table-block-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tbody-to-table-body-block-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/td-to-table-cell-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/thead-to-table-head-block-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/tr-to-table-row-block-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.d.ts +37 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +88 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +61 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.d.ts +66 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/caption-operation.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-cancel-event-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-change-event-handler.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties-save-event-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/cell-properties.d.ts +62 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/column-operation.d.ts +55 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/row-operation.d.ts +61 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/setting-event-handler.abstract.d.ts +47 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-cancel-event-handler.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-change-event-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties-save-event-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/setting-event-handlers/table-properties.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-extension.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-icon.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-selection.d.ts +149 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.d.ts +86 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/utils/utils.d.ts +53 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-bottom.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-middle.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/align-top.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-center-horizontal.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-left.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/assets/objects-align-right.d.ts +3 -0
- 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 +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-cell-properties-form-field-renderer.d.ts +49 -0
- 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 +99 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-field-renderer.d.ts +27 -0
- 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 +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.d.ts +57 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/renderers/selection-widget-renderer.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/assets/icon.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.d.ts +36 -0
- 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 +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.d.ts +55 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +39 -2
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/extension-controller.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +19 -6
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/annotation-handler-registration.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-annotation-handler.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-cell-annotation-handler.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/annotation-handler/table-head-cell-annotation-handler.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/caption-operation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-annotation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-caption-annotations.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-cell-annotation.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-dto.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-element-to-dto-strategies.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/table/table-test-utils.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/test/spec-utils.d.ts +4 -0
- package/dist/types/components.d.ts +155 -6
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +2 -0
- package/dist/types/types/components.type.d.ts +5 -0
- package/dist/types/utils/spec-utils.d.ts +2 -3
- package/dist/vega/app-globals-955a2b3b.js +427 -0
- package/dist/vega/child-nodes-event-prevent-slimmer-a604a6dd.js +156 -0
- package/dist/vega/design-token-56b26205.js +402 -0
- package/dist/vega/element-appender-slimmer-8355fb28.js +1508 -0
- package/dist/vega/event-emit-slimmer-7a14f5e9.js +265 -0
- package/dist/vega/index.esm.js +57 -1
- package/dist/vega/internal-vega-event-manager-8c62c88e.js +458 -0
- package/dist/vega/p-068ee55e.entry.js +1 -0
- package/dist/vega/p-088f4613.entry.js +1 -0
- package/dist/vega/{p-3162a7fd.entry.js → p-08b4d097.entry.js} +1 -1
- package/dist/vega/p-0e4cecbd.entry.js +1 -0
- package/dist/vega/p-10ffb765.js +1 -0
- package/dist/vega/{p-ead1da57.entry.js → p-12a97dad.entry.js} +1 -1
- package/dist/vega/p-151b1deb.js +1 -0
- package/dist/vega/{p-30e7544c.js → p-16af7681.js} +1 -1
- package/dist/vega/p-1b44db34.js +1 -0
- package/dist/vega/p-1bda4016.entry.js +1 -0
- package/dist/vega/{p-6e84e451.entry.js → p-1f4a814e.entry.js} +1 -1
- package/dist/vega/{p-2ae5ad30.entry.js → p-206245d2.entry.js} +1 -1
- package/dist/vega/p-213be5e9.entry.js +1 -0
- package/dist/vega/{p-7a8c4cf8.entry.js → p-216f3436.entry.js} +1 -1
- package/dist/vega/p-224a4f3f.entry.js +1 -0
- package/dist/vega/p-22c76be7.entry.js +1 -0
- package/dist/vega/p-22da15d7.entry.js +1 -0
- package/dist/vega/{p-2409a475.entry.js → p-24766b9d.entry.js} +1 -1
- package/dist/vega/p-29a9c8f5.entry.js +1 -0
- package/dist/vega/p-34a994a1.entry.js +1 -0
- package/dist/vega/p-39d56e3d.js +1 -0
- package/dist/vega/{p-c7194674.entry.js → p-3bc7e162.entry.js} +1 -1
- package/dist/vega/p-40660c09.js +1 -0
- package/dist/vega/p-50a506ea.entry.js +1 -0
- package/dist/vega/{p-f2c8c363.js → p-5367eaab.js} +1 -1
- package/dist/vega/p-550ce71a.entry.js +1 -0
- package/dist/vega/p-5d2704c1.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-61ae4e9c.entry.js +1 -0
- package/dist/vega/{p-2971b17a.js → p-63246470.js} +1 -1
- package/dist/vega/p-6665d083.entry.js +1 -0
- package/dist/vega/p-69af3422.entry.js +1 -0
- package/dist/vega/p-6d9731c1.entry.js +1 -0
- package/dist/vega/p-6f08e3e1.entry.js +1 -0
- package/dist/vega/p-7172332a.entry.js +1 -0
- package/dist/vega/{p-9d8e2939.entry.js → p-73688c4e.entry.js} +1 -1
- package/dist/vega/p-73689ec0.entry.js +1 -0
- package/dist/vega/{p-9fb71d8c.entry.js → p-780cbfb0.entry.js} +1 -1
- package/dist/vega/p-79e8236a.entry.js +1 -0
- package/dist/vega/{p-8fba7f9a.js → p-7ca9f6f1.js} +1 -1
- package/dist/vega/{p-f6cd7a08.entry.js → p-813b2915.entry.js} +1 -1
- package/dist/vega/{p-e88f2dc3.js → p-8162980c.js} +1 -1
- package/dist/vega/p-82ec9721.entry.js +1 -0
- package/dist/vega/{p-7f9acdf7.entry.js → p-86caa739.entry.js} +1 -1
- package/dist/vega/p-8a4d8139.entry.js +1 -0
- package/dist/vega/{p-be0b67b8.entry.js → p-8ac453cb.entry.js} +1 -1
- package/dist/vega/p-98b78c75.entry.js +1 -0
- package/dist/vega/{p-76e6c13a.js → p-99e3dcab.js} +1 -1
- package/dist/vega/{p-44bc9ea9.entry.js → p-9aac9879.entry.js} +1 -1
- package/dist/vega/p-a007b493.entry.js +1 -0
- package/dist/vega/p-a439e59b.entry.js +1 -0
- package/dist/vega/p-a4d0ab07.js +1 -0
- package/dist/vega/{p-f38a4be2.entry.js → p-a6e03df4.entry.js} +1 -1
- package/dist/vega/{p-4957f07a.entry.js → p-a924c1e2.entry.js} +1 -1
- package/dist/vega/p-ab0e013c.entry.js +1 -0
- package/dist/vega/p-abf871cd.entry.js +1 -0
- package/dist/vega/{p-9dfe2bbc.js → p-ac4bd1f8.js} +1 -1
- package/dist/vega/{p-3566ad76.js → p-b91c2c9d.js} +1 -1
- package/dist/vega/{p-184d8443.js → p-c00adad9.js} +1 -1
- package/dist/vega/{p-697eb0e1.js → p-c335088c.js} +1 -1
- package/dist/vega/{p-623c3911.entry.js → p-c3d388b5.entry.js} +1 -1
- package/dist/vega/p-c674b07c.js +1 -0
- package/dist/vega/p-c6d98c60.entry.js +1 -0
- package/dist/vega/p-c78fe943.js +1 -0
- package/dist/vega/{p-7f86b3c8.js → p-c8ad47c9.js} +1 -1
- package/dist/vega/{p-96797fee.entry.js → p-c9541fc2.entry.js} +1 -1
- package/dist/vega/{p-a58bdbad.entry.js → p-d07d04e0.entry.js} +1 -1
- package/dist/vega/p-d1349401.entry.js +1 -0
- package/dist/vega/{p-c0036e71.js → p-d2033624.js} +1 -1
- package/dist/vega/{p-74a77cad.js → p-d466baf7.js} +1 -1
- package/dist/vega/p-d4719c14.entry.js +1 -0
- package/dist/vega/{p-82dbff54.entry.js → p-d4e35d2e.entry.js} +1 -1
- package/dist/vega/p-d55365b9.entry.js +1 -0
- package/dist/vega/p-db482ee1.js +1 -0
- package/dist/vega/p-dc2813eb.entry.js +1 -0
- package/dist/vega/{p-676eaf3f.entry.js → p-dd5d917b.entry.js} +1 -1
- package/dist/vega/{p-5be29f14.js → p-ddf81373.js} +1 -1
- package/dist/vega/p-e0cefd90.entry.js +1 -0
- package/dist/vega/p-e13c163c.entry.js +1 -0
- package/dist/vega/{p-a5d4d168.entry.js → p-e788598a.entry.js} +1 -1
- package/dist/vega/{p-6b9d2996.entry.js → p-e797bf8d.entry.js} +1 -1
- package/dist/vega/p-f4b46f6b.entry.js +1 -0
- package/dist/vega/p-f519cdc3.entry.js +1 -0
- package/dist/vega/{p-9b673fd4.entry.js → p-f6eab527.entry.js} +1 -1
- package/dist/vega/{p-c7f292dd.entry.js → p-fa34ace2.entry.js} +1 -1
- package/dist/vega/p-fbfb4c70.entry.js +1 -0
- package/dist/vega/p-fcabf0dc.js +1 -0
- package/dist/vega/{p-8bd496b4.js → p-ff57c872.js} +1 -1
- package/dist/vega/p-ff921d10.js +1 -0
- package/dist/vega/p-ff9a0e6e.js +1 -0
- package/dist/vega/public-api-8dd022fa.js +6043 -0
- package/dist/vega/public-api-baaf7593.js +4 -0
- package/dist/vega/responsive-format-facade-98596535.js +913 -0
- package/dist/vega/style-formatter-0ae102e9.js +32 -0
- package/dist/vega/vega-accordion.entry.js +291 -0
- package/dist/vega/vega-app-header-button.entry.js +452 -0
- package/dist/vega/vega-banner.entry.js +351 -0
- package/dist/vega/vega-box.entry.js +353 -0
- package/dist/vega/vega-breadcrumb.entry.js +249 -0
- package/dist/vega/vega-button-circle.entry.js +245 -0
- package/dist/vega/vega-button-group.entry.js +203 -0
- package/dist/vega/vega-button-link.entry.js +226 -0
- package/dist/vega/vega-button.entry.js +259 -0
- package/dist/vega/vega-calendar.entry.js +3884 -0
- package/dist/vega/vega-card.entry.js +226 -0
- package/dist/vega/vega-carousel.entry.js +540 -0
- package/dist/vega/vega-checkbox-group.entry.js +266 -0
- package/dist/vega/vega-checkbox.entry.js +335 -0
- package/dist/vega/vega-chip.entry.js +321 -0
- package/dist/vega/vega-code-block.entry.js +4372 -0
- package/dist/vega/vega-color-picker.entry.js +258 -0
- package/dist/vega/vega-combo-box.entry.js +748 -0
- package/dist/vega/vega-date-picker-calendar.entry.js +1381 -0
- package/dist/vega/vega-date-picker.entry.js +1646 -0
- package/dist/vega/vega-dialog.entry.js +158 -0
- package/dist/vega/vega-divider.entry.js +179 -0
- package/dist/vega/vega-dropdown-content-box.entry.js +57 -0
- package/dist/vega/vega-dropdown-item.entry.js +352 -0
- package/dist/vega/vega-dropdown.entry.js +2136 -0
- package/dist/vega/vega-field-label.entry.js +182 -0
- package/dist/vega/vega-file-uploader.entry.js +751 -0
- package/dist/vega/vega-flag-icon.entry.js +216 -0
- package/dist/vega/vega-flex.entry.js +224 -0
- package/dist/vega/vega-font.entry.js +327 -0
- package/dist/vega/vega-form.entry.js +1008 -0
- package/dist/vega/vega-grid.entry.js +129 -0
- package/dist/vega/vega-icon.entry.js +256 -0
- package/dist/vega/vega-image-uploader.entry.js +977 -0
- package/dist/vega/vega-input-credit-card.entry.js +549 -0
- package/dist/vega/vega-input-numeric.entry.js +471 -0
- package/dist/vega/vega-input-passcode.entry.js +728 -0
- package/dist/vega/vega-input-phone-number.entry.js +9143 -0
- package/dist/vega/vega-input-range.entry.js +693 -0
- package/dist/vega/vega-input-select.entry.js +1268 -0
- package/dist/vega/vega-input.entry.js +1735 -0
- package/dist/vega/vega-item-toggle.entry.js +190 -0
- package/dist/vega/vega-left-nav-group.entry.js +433 -0
- package/dist/vega/vega-left-nav-link.entry.js +317 -0
- package/dist/vega/vega-left-nav-section.entry.js +97 -0
- package/dist/vega/vega-left-nav.entry.js +654 -0
- package/dist/vega/vega-loading-indicator.entry.js +209 -0
- package/dist/vega/vega-modal.entry.js +1287 -0
- package/dist/vega/vega-nav-card.entry.js +163 -0
- package/dist/vega/vega-pagination-page-selector-mobile.entry.js +214 -0
- package/dist/vega/vega-pagination.entry.js +629 -0
- package/dist/vega/vega-popover-content-box.entry.js +101 -0
- package/dist/vega/vega-popover.entry.js +362 -0
- package/dist/vega/vega-progress-tracker.entry.js +757 -0
- package/dist/vega/vega-radio-group.entry.js +496 -0
- package/dist/vega/vega-radio.entry.js +272 -0
- package/dist/vega/vega-rich-text-editor-toolbar-button.entry.js +169 -0
- package/dist/vega/vega-rich-text-editor.entry.js +4107 -0
- package/dist/vega/vega-rich-text-image-editor.entry.js +216 -0
- package/dist/vega/vega-rich-text-link-editor.entry.js +238 -0
- package/dist/vega/vega-rich-text-table-properties.entry.js +641 -0
- package/dist/vega/vega-rich-text-table-setting.entry.js +525 -0
- package/dist/vega/vega-segment-control.entry.js +350 -0
- package/dist/vega/vega-selection-chip-group.entry.js +447 -0
- package/dist/vega/vega-selection-chip.entry.js +443 -0
- package/dist/vega/vega-selection-tile-group.entry.js +438 -0
- package/dist/vega/vega-selection-tile.entry.js +409 -0
- package/dist/vega/vega-sidenav-link.entry.js +160 -0
- package/dist/vega/vega-sidenav.entry.js +766 -0
- package/dist/vega/vega-signature-capture.entry.js +589 -0
- package/dist/vega/vega-stepper.entry.js +292 -0
- package/dist/vega/vega-tab-group-panel.entry.js +79 -0
- package/dist/vega/vega-tab-group.entry.js +1281 -0
- package/dist/vega/vega-table-body.entry.js +48 -0
- package/dist/vega/vega-table-cell.entry.js +243 -0
- package/dist/vega/vega-table-foot-cell.entry.js +169 -0
- package/dist/vega/vega-table-foot-row.entry.js +219 -0
- package/dist/vega/vega-table-foot.entry.js +136 -0
- package/dist/vega/vega-table-head-cell.entry.js +339 -0
- package/dist/vega/vega-table-head-row.entry.js +416 -0
- package/dist/vega/vega-table-head.entry.js +113 -0
- package/dist/vega/vega-table-row.entry.js +666 -0
- package/dist/vega/vega-table.entry.js +3707 -0
- package/dist/vega/vega-textarea.entry.js +329 -0
- package/dist/vega/vega-time-picker.entry.js +2039 -0
- package/dist/vega/vega-toggle-switch.entry.js +194 -0
- package/dist/vega/vega-tooltip.entry.js +339 -0
- package/dist/vega/vega.esm.js +172 -1
- package/package.json +1 -1
- package/style/vega-icons.css +17266 -0
- package/dist/cjs/function-extension-78ec27e0.js +0 -2927
- package/dist/esm/function-extension-8b06c6f8.js +0 -2908
- package/dist/vega/p-03e16a05.entry.js +0 -1
- package/dist/vega/p-0ad59141.entry.js +0 -1
- package/dist/vega/p-0ba0f83d.entry.js +0 -1
- package/dist/vega/p-114c6df8.entry.js +0 -1
- package/dist/vega/p-1e019406.js +0 -1
- package/dist/vega/p-1faef917.entry.js +0 -1
- package/dist/vega/p-21cba83b.entry.js +0 -1
- package/dist/vega/p-21e7808a.entry.js +0 -1
- package/dist/vega/p-2b20a215.entry.js +0 -1
- package/dist/vega/p-2bc4f7d9.entry.js +0 -1
- package/dist/vega/p-2e0deef6.js +0 -1
- package/dist/vega/p-2f592078.entry.js +0 -1
- package/dist/vega/p-38ed3d59.entry.js +0 -1
- package/dist/vega/p-3938880f.entry.js +0 -1
- package/dist/vega/p-398220f5.entry.js +0 -1
- package/dist/vega/p-40561fa0.entry.js +0 -1
- package/dist/vega/p-42a283b5.entry.js +0 -1
- package/dist/vega/p-524ffc12.entry.js +0 -1
- package/dist/vega/p-59fa3f68.js +0 -1
- package/dist/vega/p-5b71c85e.js +0 -1
- package/dist/vega/p-5f09868d.entry.js +0 -1
- package/dist/vega/p-6e701542.entry.js +0 -1
- package/dist/vega/p-70b2906a.entry.js +0 -1
- package/dist/vega/p-721b2981.entry.js +0 -1
- package/dist/vega/p-75d91ee9.entry.js +0 -1
- package/dist/vega/p-79a544d6.js +0 -1
- package/dist/vega/p-7b337fd4.entry.js +0 -1
- package/dist/vega/p-7be3aefc.entry.js +0 -1
- package/dist/vega/p-94cf46ca.entry.js +0 -1
- package/dist/vega/p-a125cfec.entry.js +0 -1
- package/dist/vega/p-a3c4fa30.entry.js +0 -1
- package/dist/vega/p-aab0deab.js +0 -1
- package/dist/vega/p-adc615a4.entry.js +0 -1
- package/dist/vega/p-b007d0d5.entry.js +0 -1
- package/dist/vega/p-b406a846.entry.js +0 -1
- package/dist/vega/p-bd60c72e.entry.js +0 -1
- package/dist/vega/p-bf61d136.js +0 -1
- package/dist/vega/p-c2ac6b47.entry.js +0 -1
- package/dist/vega/p-c4700277.entry.js +0 -1
- package/dist/vega/p-ce2ffff7.js +0 -1
- package/dist/vega/p-d01fe83d.entry.js +0 -1
- package/dist/vega/p-db62b038.entry.js +0 -1
- package/dist/vega/p-dd72ad9e.js +0 -1
- package/dist/vega/p-e39aa2ea.entry.js +0 -1
- package/dist/vega/p-f3831dc9.entry.js +0 -1
- package/dist/vega/p-f427d88c.entry.js +0 -1
|
@@ -0,0 +1,1306 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const codeBlock = require('./code-block-22ee2550.js');
|
|
4
|
+
const object = require('./object-e2e28e3d.js');
|
|
5
|
+
const typeGuard = require('./type-guard-69d2cf01.js');
|
|
6
|
+
const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtime-metrics-slimmer-e2e274e1.js');
|
|
7
|
+
const contentState = require('./content-state-0be6fda3.js');
|
|
8
|
+
|
|
9
|
+
exports.RTETableExtensionAnnotationTypeEnum = void 0;
|
|
10
|
+
(function (RTETableExtensionAnnotationTypeEnum) {
|
|
11
|
+
RTETableExtensionAnnotationTypeEnum["TABLE"] = "EXTENSION_TABLE";
|
|
12
|
+
RTETableExtensionAnnotationTypeEnum["CELL"] = "EXTENSION_TABLE_CELL";
|
|
13
|
+
RTETableExtensionAnnotationTypeEnum["CAPTION"] = "EXTENSION_TABLE_CAPTION";
|
|
14
|
+
})(exports.RTETableExtensionAnnotationTypeEnum || (exports.RTETableExtensionAnnotationTypeEnum = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Class representing a table annotation in the rich text editor.
|
|
17
|
+
*/
|
|
18
|
+
class RTETableAnnotation extends codeBlock.BlockAnnotation {
|
|
19
|
+
constructor({ backgroundColor, border, width, height, alignment = 'center', } = {}) {
|
|
20
|
+
super();
|
|
21
|
+
this.type = exports.RTETableExtensionAnnotationTypeEnum.TABLE;
|
|
22
|
+
this.backgroundColor = backgroundColor;
|
|
23
|
+
this.border = border;
|
|
24
|
+
this.width = width;
|
|
25
|
+
this.height = height;
|
|
26
|
+
this.alignment = alignment;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
static from(value) {
|
|
32
|
+
return [exports.RTETableExtensionAnnotationTypeEnum.TABLE, new RTETableAnnotation(value)];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Generates the CSS border string from the border properties.
|
|
36
|
+
*
|
|
37
|
+
* @returns {Nullable<string>} The CSS border string.
|
|
38
|
+
*/
|
|
39
|
+
get borderStr() {
|
|
40
|
+
if (!this.border) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return `${this.border.style} ${this.border.width} ${this.border.color}`.trim();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @inheritDoc
|
|
47
|
+
*/
|
|
48
|
+
clone() {
|
|
49
|
+
return new RTETableAnnotation({
|
|
50
|
+
backgroundColor: this.backgroundColor,
|
|
51
|
+
border: this.border,
|
|
52
|
+
width: this.width,
|
|
53
|
+
height: this.height,
|
|
54
|
+
alignment: this.alignment,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @inheritDoc
|
|
59
|
+
*/
|
|
60
|
+
toJSON() {
|
|
61
|
+
return {
|
|
62
|
+
table: object.cleanObject({
|
|
63
|
+
backgroundColor: this.backgroundColor,
|
|
64
|
+
border: this.border,
|
|
65
|
+
width: this.width,
|
|
66
|
+
height: this.height,
|
|
67
|
+
alignment: this.alignment,
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @inheritDoc
|
|
73
|
+
*/
|
|
74
|
+
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));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @inheritDoc
|
|
83
|
+
*/
|
|
84
|
+
renderClass() {
|
|
85
|
+
return 'v-rte--extension-table';
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Generates the alignment styles for the table.
|
|
89
|
+
*
|
|
90
|
+
* @returns {Record<string, string>} The alignment styles.
|
|
91
|
+
*/
|
|
92
|
+
renderAlignmentStyle() {
|
|
93
|
+
return {
|
|
94
|
+
margin: this.alignment === 'center' ? '0 auto' : this.alignment === 'left' ? '0' : '0 0 0 auto',
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Class representing a table block in the rich text editor.
|
|
101
|
+
*/
|
|
102
|
+
class RTETableBlock extends codeBlock.RTEBlock {
|
|
103
|
+
constructor(id, options) {
|
|
104
|
+
super(id);
|
|
105
|
+
this.type = 'table-block';
|
|
106
|
+
this.children = [];
|
|
107
|
+
const { autoMatchFormat } = options || { autoMatchFormat: true };
|
|
108
|
+
if (autoMatchFormat) {
|
|
109
|
+
this.annotationMap.set(exports.RTETableExtensionAnnotationTypeEnum.TABLE, new RTETableAnnotation());
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @inheritDoc
|
|
114
|
+
*/
|
|
115
|
+
static from(block, options) {
|
|
116
|
+
var _a;
|
|
117
|
+
const tableBlock = new RTETableBlock(block.id, options);
|
|
118
|
+
super.convertAnnotationsToMap(tableBlock.annotationMap, Object.assign({}, block.annotations));
|
|
119
|
+
tableBlock.children = super.generateBlockChildren(block.children, options, tableBlock);
|
|
120
|
+
if ((_a = block.annotations) === null || _a === void 0 ? void 0 : _a.table) {
|
|
121
|
+
tableBlock.annotationMap.set(...RTETableAnnotation.from(block.annotations.table));
|
|
122
|
+
}
|
|
123
|
+
return tableBlock;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @inheritDoc
|
|
127
|
+
*/
|
|
128
|
+
clone(parent) {
|
|
129
|
+
const clonedBlock = new RTETableBlock(this.id);
|
|
130
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
131
|
+
clonedBlock.parent = parent;
|
|
132
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
133
|
+
return clonedBlock;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @inheritDoc
|
|
137
|
+
*/
|
|
138
|
+
getLastNode() {
|
|
139
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get the first node of the table block.
|
|
143
|
+
*
|
|
144
|
+
* @returns {RTENode} The first node of the table block.
|
|
145
|
+
*/
|
|
146
|
+
getFirstNode() {
|
|
147
|
+
if (this.hasCaption()) {
|
|
148
|
+
return this.children[0].children[0].getLastNode();
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
const childNode = this.children[0].children[0]
|
|
152
|
+
.children[0];
|
|
153
|
+
return childNode.getLastNode();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* @inheritDoc
|
|
158
|
+
*/
|
|
159
|
+
isNotEmpty() {
|
|
160
|
+
return this.children.length > 0;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @inheritDoc
|
|
164
|
+
*/
|
|
165
|
+
toHtml() {
|
|
166
|
+
const childrenHtml = this.children.map((child) => child.toHtml()).join('');
|
|
167
|
+
const attrStr = super.generateAttributeString();
|
|
168
|
+
return `<table${attrStr}>${childrenHtml}</table>`;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @inheritDoc
|
|
172
|
+
*/
|
|
173
|
+
toJSON() {
|
|
174
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Retrieves the caption block from the children collection, if present.
|
|
178
|
+
*
|
|
179
|
+
* @returns {Nullable<RTETableCaptionBlock>} The caption block or `null`.
|
|
180
|
+
*/
|
|
181
|
+
getCaption() {
|
|
182
|
+
const caption = this.children.find((child) => child.type === 'table-caption');
|
|
183
|
+
return caption !== null && caption !== void 0 ? caption : null;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Inserts, replaces, or removes the caption block within the children.
|
|
187
|
+
*
|
|
188
|
+
* @param {Nullable<RTETableCaptionBlock>} caption - The caption block to set, or `null` to remove.
|
|
189
|
+
*/
|
|
190
|
+
setCaption(caption) {
|
|
191
|
+
const index = this.children.findIndex((child) => child.type === 'table-caption');
|
|
192
|
+
if (!caption) {
|
|
193
|
+
if (index >= 0) {
|
|
194
|
+
this.children.splice(index, 1);
|
|
195
|
+
}
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
caption.parent = this;
|
|
199
|
+
if (index >= 0) {
|
|
200
|
+
this.children[index] = caption;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
this.children.unshift(caption);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Checks whether the table currently stores a caption block reference.
|
|
208
|
+
*
|
|
209
|
+
* @returns {boolean} `true` when a caption DTO is attached; otherwise `false`.
|
|
210
|
+
*/
|
|
211
|
+
hasCaption() {
|
|
212
|
+
return typeGuard.isNonNullable(this.getCaption());
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
exports.TableSettingType = void 0;
|
|
217
|
+
(function (TableSettingType) {
|
|
218
|
+
TableSettingType["ROW"] = "ROW";
|
|
219
|
+
TableSettingType["CAPTION"] = "CAPTION";
|
|
220
|
+
TableSettingType["COLUMN"] = "COLUMN";
|
|
221
|
+
TableSettingType["MERGE_CELLS"] = "MERGE_CELLS";
|
|
222
|
+
TableSettingType["TABLE"] = "TABLE";
|
|
223
|
+
TableSettingType["CELL"] = "CELL";
|
|
224
|
+
})(exports.TableSettingType || (exports.TableSettingType = {}));
|
|
225
|
+
/**
|
|
226
|
+
* Abstract class for setting event handlers.
|
|
227
|
+
*/
|
|
228
|
+
class SettingEventHandler {
|
|
229
|
+
/**
|
|
230
|
+
* Applies a cursor update action so the editor focuses on the resolved node.
|
|
231
|
+
*
|
|
232
|
+
* @param {RTETableBlock} block - Table block currently being toggled.
|
|
233
|
+
* @param {Nullable<RTENode>} focusNode - Target node that should receive the caret.
|
|
234
|
+
*/
|
|
235
|
+
syncCursorPosition(block, focusNode) {
|
|
236
|
+
const rootContent = this.findRootContent(block);
|
|
237
|
+
if (focusNode && rootContent) {
|
|
238
|
+
const offset = focusNode.getRangeEndOffset();
|
|
239
|
+
rootContent.apply(new contentState.UpdateCursorPositionAction(focusNode, offset));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Walks up the parent chain to locate the nearest VegaRTEContent root.
|
|
244
|
+
*
|
|
245
|
+
* @param {RTETableBlock} block - Table block used as the starting point.
|
|
246
|
+
* @returns {Nullable<VegaRTEContent>} Content root containing the table, if found.
|
|
247
|
+
*/
|
|
248
|
+
findRootContent(block) {
|
|
249
|
+
let currentParent = block.parent;
|
|
250
|
+
while (currentParent) {
|
|
251
|
+
if (currentParent instanceof contentState.VegaRTEContent) {
|
|
252
|
+
return currentParent;
|
|
253
|
+
}
|
|
254
|
+
currentParent = currentParent.parent;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const DELETE_TABLE_ROW = 'DELETE_TABLE_ROW';
|
|
260
|
+
/**
|
|
261
|
+
* Action class for deleting a specific table row.
|
|
262
|
+
*/
|
|
263
|
+
class DeleteTableRowAction extends codeBlock.ModifyContentAction {
|
|
264
|
+
/**
|
|
265
|
+
* Constructs an InsertTableRowAction.
|
|
266
|
+
*
|
|
267
|
+
* @param {RTETableRowBlock[]} rowsToBeRemoved - The rows to be removed from the table.
|
|
268
|
+
*/
|
|
269
|
+
constructor(rowsToBeRemoved) {
|
|
270
|
+
super();
|
|
271
|
+
this.isFlushable = true;
|
|
272
|
+
this.type = DELETE_TABLE_ROW;
|
|
273
|
+
this.rowsToBeRemoved = rowsToBeRemoved;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const INSERT_TABLE_ROW = 'INSERT_TABLE_ROW';
|
|
278
|
+
exports.InsertTableRowDirection = void 0;
|
|
279
|
+
(function (InsertTableRowDirection) {
|
|
280
|
+
InsertTableRowDirection["ABOVE"] = "ABOVE";
|
|
281
|
+
InsertTableRowDirection["BELOW"] = "BELOW";
|
|
282
|
+
})(exports.InsertTableRowDirection || (exports.InsertTableRowDirection = {}));
|
|
283
|
+
/**
|
|
284
|
+
* Action class for inserting a new row into a table within the rich text editor.
|
|
285
|
+
*/
|
|
286
|
+
class InsertTableRowAction extends codeBlock.ModifyContentAction {
|
|
287
|
+
/**
|
|
288
|
+
* Constructs an InsertTableRowAction.
|
|
289
|
+
*
|
|
290
|
+
* @param {InsertTableRowDirection} insertDirection - The direction to insert the new row (above or below the current row).
|
|
291
|
+
* @param {RTETableRowBlock[]} selectedRows - The currently selected rows in the table.
|
|
292
|
+
*/
|
|
293
|
+
constructor(insertDirection, selectedRows = []) {
|
|
294
|
+
super();
|
|
295
|
+
this.isFlushable = true;
|
|
296
|
+
this.type = INSERT_TABLE_ROW;
|
|
297
|
+
this.selectedRows = [];
|
|
298
|
+
this.insertDirection = insertDirection;
|
|
299
|
+
this.selectedRows = selectedRows;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const TOGGLE_HEADER_ROW = 'TOGGLE_HEADER_ROW';
|
|
304
|
+
/**
|
|
305
|
+
* Action to convert selected rows to header rows or revert them back to normal rows.
|
|
306
|
+
*/
|
|
307
|
+
class ToggleHeaderRowAction extends codeBlock.ModifyContentAction {
|
|
308
|
+
constructor(selectedRows) {
|
|
309
|
+
super();
|
|
310
|
+
this.isFlushable = true;
|
|
311
|
+
this.type = TOGGLE_HEADER_ROW;
|
|
312
|
+
this.selectedRows = selectedRows;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Class representing a table row block in the rich text editor.
|
|
318
|
+
*/
|
|
319
|
+
class RTETableRowBlock extends codeBlock.RTEBlock {
|
|
320
|
+
constructor(id) {
|
|
321
|
+
super(id);
|
|
322
|
+
this.type = 'table-row';
|
|
323
|
+
this.children = [];
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* @inheritDoc
|
|
327
|
+
*/
|
|
328
|
+
static from(block, options) {
|
|
329
|
+
const rowBlock = new RTETableRowBlock(block.id);
|
|
330
|
+
super.convertAnnotationsToMap(rowBlock.annotationMap, Object.assign({}, block.annotations));
|
|
331
|
+
rowBlock.children = super.generateBlockChildren(block.children, options, rowBlock);
|
|
332
|
+
return rowBlock;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* @inheritDoc
|
|
336
|
+
*/
|
|
337
|
+
clone(parent) {
|
|
338
|
+
const clonedBlock = new RTETableRowBlock(this.id);
|
|
339
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
340
|
+
clonedBlock.parent = parent;
|
|
341
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
342
|
+
return clonedBlock;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* @inheritDoc
|
|
346
|
+
*/
|
|
347
|
+
getLastNode() {
|
|
348
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @inheritDoc
|
|
352
|
+
*/
|
|
353
|
+
isNotEmpty() {
|
|
354
|
+
return this.children.length > 0;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* @inheritDoc
|
|
358
|
+
*/
|
|
359
|
+
toHtml() {
|
|
360
|
+
const childrenHtml = this.children
|
|
361
|
+
.map((child) => {
|
|
362
|
+
return child.toHtml();
|
|
363
|
+
})
|
|
364
|
+
.join('');
|
|
365
|
+
const attrStr = super.generateAttributeString();
|
|
366
|
+
return `<tr${attrStr}>${childrenHtml}</tr>`;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* @inheritDoc
|
|
370
|
+
*/
|
|
371
|
+
toJSON() {
|
|
372
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Class representing a table body block in the rich text editor.
|
|
378
|
+
*/
|
|
379
|
+
class RTETableBodyBlock extends codeBlock.RTEBlock {
|
|
380
|
+
constructor(id) {
|
|
381
|
+
super(id);
|
|
382
|
+
this.type = 'table-body';
|
|
383
|
+
this.children = [];
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* @inheritDoc
|
|
387
|
+
*/
|
|
388
|
+
static from(block, options) {
|
|
389
|
+
const tableBodyBlock = new RTETableBodyBlock(block.id);
|
|
390
|
+
super.convertAnnotationsToMap(tableBodyBlock.annotationMap, Object.assign({}, block.annotations));
|
|
391
|
+
tableBodyBlock.children = super.generateBlockChildren(block.children, options, tableBodyBlock);
|
|
392
|
+
return tableBodyBlock;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* @inheritDoc
|
|
396
|
+
*/
|
|
397
|
+
clone(parent) {
|
|
398
|
+
const clonedBlock = new RTETableBodyBlock(this.id);
|
|
399
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
400
|
+
clonedBlock.parent = parent;
|
|
401
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
402
|
+
return clonedBlock;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* @inheritDoc
|
|
406
|
+
*/
|
|
407
|
+
getLastNode() {
|
|
408
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @inheritDoc
|
|
412
|
+
*/
|
|
413
|
+
isNotEmpty() {
|
|
414
|
+
return this.children.length > 0;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* @inheritDoc
|
|
418
|
+
*/
|
|
419
|
+
toHtml() {
|
|
420
|
+
const childrenHtml = this.children.map((child) => child.toHtml()).join('');
|
|
421
|
+
const attrStr = super.generateAttributeString();
|
|
422
|
+
return `<tbody${attrStr}>${childrenHtml}</tbody>`;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* @inheritDoc
|
|
426
|
+
*/
|
|
427
|
+
toJSON() {
|
|
428
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Class representing a table head block in the rich text editor.
|
|
434
|
+
*/
|
|
435
|
+
class RTETableHeadBlock extends codeBlock.RTEBlock {
|
|
436
|
+
constructor(id) {
|
|
437
|
+
super(id);
|
|
438
|
+
this.type = 'table-head';
|
|
439
|
+
this.children = [];
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* @inheritDoc
|
|
443
|
+
*/
|
|
444
|
+
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;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* @inheritDoc
|
|
452
|
+
*/
|
|
453
|
+
clone(parent) {
|
|
454
|
+
const clonedBlock = new RTETableHeadBlock(this.id);
|
|
455
|
+
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
456
|
+
clonedBlock.parent = parent;
|
|
457
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
458
|
+
return clonedBlock;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* @inheritDoc
|
|
462
|
+
*/
|
|
463
|
+
getLastNode() {
|
|
464
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* @inheritDoc
|
|
468
|
+
*/
|
|
469
|
+
isNotEmpty() {
|
|
470
|
+
return this.children.length > 0;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* @inheritDoc
|
|
474
|
+
*/
|
|
475
|
+
toHtml() {
|
|
476
|
+
const childrenHtml = this.children
|
|
477
|
+
.map((child) => {
|
|
478
|
+
return child.toHtml();
|
|
479
|
+
})
|
|
480
|
+
.join('');
|
|
481
|
+
const attrStr = super.generateAttributeString();
|
|
482
|
+
return `<thead${attrStr}>${childrenHtml}</thead>`;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* @inheritDoc
|
|
486
|
+
*/
|
|
487
|
+
toJSON() {
|
|
488
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Recursively searches for a parent block of a specific type.
|
|
494
|
+
*
|
|
495
|
+
* @typedef T - Generic type extending RTEBlock.
|
|
496
|
+
* @param {RTEBlock} block - The starting block to search from.
|
|
497
|
+
* @param {ClassType<unknown>} dtoClass - The class type to match the parent block against.
|
|
498
|
+
* @returns {T | null} - The found parent block of the specified type, or null if not found.
|
|
499
|
+
*/
|
|
500
|
+
function getParentBlockByType(block, dtoClass) {
|
|
501
|
+
if (block) {
|
|
502
|
+
if (block instanceof dtoClass) {
|
|
503
|
+
return block;
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
return getParentBlockByType(block.parent, dtoClass);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return null;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Generate the table body with the specified number of rows and columns.
|
|
513
|
+
*
|
|
514
|
+
* @param {number} rowCount - The number of rows in the table body.
|
|
515
|
+
* @param {number} columnCount - The number of columns in the table body.
|
|
516
|
+
* @returns {VegaRTETableBodyBlock} The generated table body block.
|
|
517
|
+
*/
|
|
518
|
+
function generateTableBody(rowCount, columnCount) {
|
|
519
|
+
return {
|
|
520
|
+
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
521
|
+
type: 'table-body',
|
|
522
|
+
children: Array.from({ length: rowCount }, () => generateTableRow(columnCount)),
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Create a table row block with the specified number of columns and cell type.
|
|
527
|
+
*
|
|
528
|
+
* @param {number} columnCount - The number of columns in the row.
|
|
529
|
+
* @returns {VegaRTETableRowBlock} The created table row block.
|
|
530
|
+
*/
|
|
531
|
+
function generateTableRow(columnCount) {
|
|
532
|
+
return {
|
|
533
|
+
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
534
|
+
type: 'table-row',
|
|
535
|
+
children: Array.from({ length: columnCount }, () => getDefaultCellBlockTemplate('table-cell')),
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Get all table rows from a table block (including rows from all table bodies and headers).
|
|
540
|
+
*
|
|
541
|
+
* @param {RTETableBlock} tableBlock - The table block.
|
|
542
|
+
* @returns {RTETableRowBlock[]} Array of all table row blocks.
|
|
543
|
+
*/
|
|
544
|
+
function getAllTableRows(tableBlock) {
|
|
545
|
+
return tableBlock.children
|
|
546
|
+
.filter((child) => child instanceof RTETableBodyBlock || child instanceof RTETableHeadBlock)
|
|
547
|
+
.flatMap((body) => body.children);
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Find the first node within a block recursively.
|
|
551
|
+
*
|
|
552
|
+
* @param {Nullable<RTEBlock>} block - The block to find the first node in.
|
|
553
|
+
* @returns {Nullable<RTENode>} The focusable node within the block.
|
|
554
|
+
*/
|
|
555
|
+
function getFirstNode(block) {
|
|
556
|
+
if (!block || !block.children || !block.children[0])
|
|
557
|
+
return null;
|
|
558
|
+
const firstNode = block.children[0];
|
|
559
|
+
if (firstNode instanceof codeBlock.RTENode) {
|
|
560
|
+
return firstNode;
|
|
561
|
+
}
|
|
562
|
+
return getFirstNode(firstNode);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Get the default cell block template.
|
|
566
|
+
*
|
|
567
|
+
* @param {string} cellType - The type of the cell block.
|
|
568
|
+
* @returns {VegaRTETableCellBlock} The default cell block template.
|
|
569
|
+
*/
|
|
570
|
+
function getDefaultCellBlockTemplate(cellType) {
|
|
571
|
+
const id = createPublicApiRuntimeMetricsSlimmer.generateUUID();
|
|
572
|
+
return {
|
|
573
|
+
id,
|
|
574
|
+
type: cellType,
|
|
575
|
+
children: [
|
|
576
|
+
{
|
|
577
|
+
id: `${id}-p`,
|
|
578
|
+
type: 'paragraph',
|
|
579
|
+
nodes: [
|
|
580
|
+
{
|
|
581
|
+
id: `${id}-p-t`,
|
|
582
|
+
type: 'text',
|
|
583
|
+
text: '',
|
|
584
|
+
},
|
|
585
|
+
],
|
|
586
|
+
},
|
|
587
|
+
],
|
|
588
|
+
};
|
|
589
|
+
}
|
|
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
|
+
/**
|
|
600
|
+
* Event handler for row operations in a table.
|
|
601
|
+
*/
|
|
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
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Class representing a table cell annotation in the rich text editor.
|
|
717
|
+
*/
|
|
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;
|
|
820
|
+
}
|
|
821
|
+
return cleanedStyle;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
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
|
+
/**
|
|
835
|
+
* Class representing a table cell block in the rich text editor.
|
|
836
|
+
*/
|
|
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());
|
|
845
|
+
}
|
|
846
|
+
}
|
|
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();
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* @inheritDoc
|
|
878
|
+
*/
|
|
879
|
+
isNotEmpty() {
|
|
880
|
+
return this.children.length > 0;
|
|
881
|
+
}
|
|
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>`;
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* @inheritDoc
|
|
892
|
+
*/
|
|
893
|
+
toJSON() {
|
|
894
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Class representing a table head cell annotation in the rich text editor.
|
|
900
|
+
*/
|
|
901
|
+
class RTETableHeadCellAnnotation extends RTETableCellAnnotation {
|
|
902
|
+
constructor(annotation = {}) {
|
|
903
|
+
super(annotation);
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* @inheritDoc
|
|
907
|
+
*/
|
|
908
|
+
static from(cellAnnotation) {
|
|
909
|
+
return [exports.RTETableExtensionAnnotationTypeEnum.CELL, new RTETableHeadCellAnnotation(cellAnnotation)];
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* @inheritDoc
|
|
913
|
+
*/
|
|
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
|
+
});
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* @inheritDoc
|
|
927
|
+
*/
|
|
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 }));
|
|
932
|
+
}
|
|
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());
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* @inheritDoc
|
|
950
|
+
*/
|
|
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));
|
|
957
|
+
}
|
|
958
|
+
headCellBlock.children = super.generateBlockChildren(block.children, options, headCellBlock);
|
|
959
|
+
return headCellBlock;
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* @inheritDoc
|
|
963
|
+
*/
|
|
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;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* @inheritDoc
|
|
973
|
+
*/
|
|
974
|
+
toHtml() {
|
|
975
|
+
const childrenHtml = this.children.map((child) => child.toHtml()).join('');
|
|
976
|
+
const attrStr = super.generateAttributeString();
|
|
977
|
+
return `<th${attrStr}>${childrenHtml}</th>`;
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* @inheritDoc
|
|
981
|
+
*/
|
|
982
|
+
toJSON() {
|
|
983
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Abstract base strategy for handling table column operations.
|
|
989
|
+
* Provides common functionality for all column-related strategies.
|
|
990
|
+
*/
|
|
991
|
+
class TableColumnStrategy extends codeBlock.ActionHandleStrategy {
|
|
992
|
+
/**
|
|
993
|
+
* Finds the index range of cells within a table row.
|
|
994
|
+
* Returns the start and end indices of the given cell range.
|
|
995
|
+
*
|
|
996
|
+
* @param {(RTETableCellBlock | RTETableHeadCellBlock)[]} cellRange - The range of table cells to find indices for.
|
|
997
|
+
* @returns {[number, number]} A tuple containing the start and end indices.
|
|
998
|
+
*/
|
|
999
|
+
getBoundaryCellIndexOfRow(cellRange) {
|
|
1000
|
+
const firstCell = cellRange[0];
|
|
1001
|
+
const lastCell = cellRange[cellRange.length - 1];
|
|
1002
|
+
return [firstCell.parent.children.indexOf(firstCell), lastCell.parent.children.indexOf(lastCell)];
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Strategy to handle the toggle of header state of a table column.
|
|
1008
|
+
*/
|
|
1009
|
+
class ToggleHeaderTableColumnStrategy extends TableColumnStrategy {
|
|
1010
|
+
/**
|
|
1011
|
+
* Check if all selected cells are header cells.
|
|
1012
|
+
*
|
|
1013
|
+
* @param {(RTETableCellBlock | RTETableHeadCellBlock)[]} selectedCellRange - The range of selected table cell blocks.
|
|
1014
|
+
* @returns {boolean} True if all selected cells are header cells, false otherwise.
|
|
1015
|
+
*/
|
|
1016
|
+
static isFullHeaderSelection(selectedCellRange) {
|
|
1017
|
+
if (selectedCellRange.length === 0) {
|
|
1018
|
+
return false;
|
|
1019
|
+
}
|
|
1020
|
+
const endSelectedCell = selectedCellRange[selectedCellRange.length - 1];
|
|
1021
|
+
const endSelectedCellIndex = endSelectedCell.parent.children.findIndex((child) => child === endSelectedCell);
|
|
1022
|
+
const table = getParentBlockByType(endSelectedCell, RTETableBlock);
|
|
1023
|
+
if (table) {
|
|
1024
|
+
const allTableRows = getAllTableRows(table);
|
|
1025
|
+
return allTableRows.every((row) => {
|
|
1026
|
+
const cell = row.children[endSelectedCellIndex];
|
|
1027
|
+
return cell instanceof RTETableHeadCellBlock;
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
return false;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* @inheritDoc
|
|
1034
|
+
*/
|
|
1035
|
+
handleAction(action, target) {
|
|
1036
|
+
var _a;
|
|
1037
|
+
const headerOn = action.headerOn;
|
|
1038
|
+
const [startCellIndex, endCellIndex] = this.getBoundaryCellIndexOfRow(action.tableCellHeaderRange);
|
|
1039
|
+
const allTableBodyRows = ((_a = target.children.find((body) => body instanceof RTETableBodyBlock)) === null || _a === void 0 ? void 0 : _a.children) || [];
|
|
1040
|
+
allTableBodyRows.forEach((row) => {
|
|
1041
|
+
const firstTableCellIndex = row.children.findIndex((cell) => !(cell instanceof RTETableHeadCellBlock));
|
|
1042
|
+
if (headerOn) {
|
|
1043
|
+
this.toggleCellsToHeader(firstTableCellIndex, endCellIndex, row);
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
this.toggleHeaderCellsToCells(firstTableCellIndex, row, startCellIndex);
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1049
|
+
const root = this.getRootContent(target);
|
|
1050
|
+
if (root && action.tableCellHeaderRange[0].parent) {
|
|
1051
|
+
const focusNode = action.tableCellHeaderRange[0].parent.getFirstNode();
|
|
1052
|
+
focusNode && root.apply(new contentState.UpdateCursorPositionAction(focusNode, 0));
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Toggles the specified header cells in a row to cells.
|
|
1057
|
+
*
|
|
1058
|
+
* @param {number} firstTableCellIndex - The index of the first table cell in the row.
|
|
1059
|
+
* @param {RTETableRowBlock} row - The table row block containing the cells to toggle.
|
|
1060
|
+
* @param {number} startCellIndex - The index of the first cell to toggle.
|
|
1061
|
+
*/
|
|
1062
|
+
toggleHeaderCellsToCells(firstTableCellIndex, row, startCellIndex) {
|
|
1063
|
+
const lastTableHeaderCellIndex = firstTableCellIndex >= 0 ? firstTableCellIndex - 1 : row.children.length - 1;
|
|
1064
|
+
for (let cellIndex = startCellIndex; cellIndex <= lastTableHeaderCellIndex; cellIndex++) {
|
|
1065
|
+
const cellToToggle = row.children[cellIndex];
|
|
1066
|
+
const newCell = RTETableCellBlock.from(cellToToggle.toJSON());
|
|
1067
|
+
this.replaceCellInRow(row, cellToToggle, newCell);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Toggles the specified cells in a row to header cells.
|
|
1072
|
+
*
|
|
1073
|
+
* @param {number} firstTableCellIndex - The index of the first table cell in the row.
|
|
1074
|
+
* @param {number} endCellIndex - The index of the last cell to toggle.
|
|
1075
|
+
* @param {RTETableRowBlock} row - The table row block containing the cells to toggle.
|
|
1076
|
+
*/
|
|
1077
|
+
toggleCellsToHeader(firstTableCellIndex, endCellIndex, row) {
|
|
1078
|
+
for (let tableCellIndex = firstTableCellIndex; tableCellIndex <= endCellIndex; tableCellIndex++) {
|
|
1079
|
+
const cellToToggle = row.children[tableCellIndex];
|
|
1080
|
+
const newHeaderCell = RTETableHeadCellBlock.from(cellToToggle.toJSON());
|
|
1081
|
+
this.replaceCellInRow(row, cellToToggle, newHeaderCell);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Replaces a cell in a given row at the specified index with a new cell.
|
|
1086
|
+
*
|
|
1087
|
+
* @param {RTETableRowBlock} row - The table row block containing the cell to replace.
|
|
1088
|
+
* @param {RTETableCellBlock | RTETableHeadCellBlock} oldCell - The cell to replace.
|
|
1089
|
+
* @param {RTETableCellBlock | RTETableHeadCellBlock} newCell - The new cell to insert.
|
|
1090
|
+
*/
|
|
1091
|
+
replaceCellInRow(row, oldCell, newCell) {
|
|
1092
|
+
row.apply(new codeBlock.InsertChildrenBeforeAction(oldCell, newCell));
|
|
1093
|
+
row.apply(new codeBlock.RemoveChildrenAction(oldCell));
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
const DELETE_TABLE_COLUMN = 'DELETE_TABLE_COLUMN';
|
|
1098
|
+
/**
|
|
1099
|
+
* Action to delete a table column
|
|
1100
|
+
*/
|
|
1101
|
+
class DeleteTableColumnAction extends codeBlock.ModifyContentAction {
|
|
1102
|
+
constructor(target) {
|
|
1103
|
+
super();
|
|
1104
|
+
this.isFlushable = true;
|
|
1105
|
+
this.type = DELETE_TABLE_COLUMN;
|
|
1106
|
+
this.tableCellDeleteRange = target;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
const INSERT_TABLE_COLUMN = 'INSERT_TABLE_COLUMN';
|
|
1111
|
+
exports.InsertTableColumnDirection = void 0;
|
|
1112
|
+
(function (InsertTableColumnDirection) {
|
|
1113
|
+
InsertTableColumnDirection["LEFT"] = "LEFT";
|
|
1114
|
+
InsertTableColumnDirection["RIGHT"] = "RIGHT";
|
|
1115
|
+
})(exports.InsertTableColumnDirection || (exports.InsertTableColumnDirection = {}));
|
|
1116
|
+
/**
|
|
1117
|
+
* Action to insert a table column into the RTETable.
|
|
1118
|
+
*/
|
|
1119
|
+
class InsertTableColumnAction extends codeBlock.ModifyContentAction {
|
|
1120
|
+
constructor(insertDirection, tableCellInsertRange) {
|
|
1121
|
+
super();
|
|
1122
|
+
this.isFlushable = true;
|
|
1123
|
+
this.type = INSERT_TABLE_COLUMN;
|
|
1124
|
+
this.tableCellInsertRange = tableCellInsertRange;
|
|
1125
|
+
this.insertDirection = insertDirection;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
const SELECT_TABLE_COLUMN = 'SELECT_TABLE_COLUMN';
|
|
1130
|
+
/**
|
|
1131
|
+
* Action to select a table column into the RTETable.
|
|
1132
|
+
*/
|
|
1133
|
+
class SelectTableColumnAction extends codeBlock.ModifyContentAction {
|
|
1134
|
+
constructor(tableCellSelectRange, selectCellCallback) {
|
|
1135
|
+
super();
|
|
1136
|
+
this.type = SELECT_TABLE_COLUMN;
|
|
1137
|
+
this.tableCellSelectRange = tableCellSelectRange;
|
|
1138
|
+
this.selectCellCallback = selectCellCallback;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
const TOGGLE_HEADER_TABLE_COLUMN = 'TOGGLE_HEADER_TABLE_COLUMN';
|
|
1143
|
+
/**
|
|
1144
|
+
* Action to toggle header state of a table column in the RTETable.
|
|
1145
|
+
*/
|
|
1146
|
+
class ToggleHeaderTableColumnAction extends codeBlock.ModifyContentAction {
|
|
1147
|
+
constructor(tableCellHeaderRange, headerOn) {
|
|
1148
|
+
super();
|
|
1149
|
+
this.isFlushable = true;
|
|
1150
|
+
this.type = TOGGLE_HEADER_TABLE_COLUMN;
|
|
1151
|
+
this.headerOn = false;
|
|
1152
|
+
this.tableCellHeaderRange = tableCellHeaderRange;
|
|
1153
|
+
this.headerOn = headerOn;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
exports.ColumnOperationType = void 0;
|
|
1158
|
+
(function (ColumnOperationType) {
|
|
1159
|
+
ColumnOperationType["HEADER_COLUMN"] = "HEADER_COLUMN";
|
|
1160
|
+
ColumnOperationType["ADD_COLUMN_LEFT"] = "ADD_COLUMN_LEFT";
|
|
1161
|
+
ColumnOperationType["ADD_COLUMN_RIGHT"] = "ADD_COLUMN_RIGHT";
|
|
1162
|
+
ColumnOperationType["DELETE_COLUMN"] = "DELETE_COLUMN";
|
|
1163
|
+
ColumnOperationType["SELECT_COLUMN"] = "SELECT_COLUMN";
|
|
1164
|
+
})(exports.ColumnOperationType || (exports.ColumnOperationType = {}));
|
|
1165
|
+
/**
|
|
1166
|
+
* Event handler for column operations in a table.
|
|
1167
|
+
*/
|
|
1168
|
+
class ColumnOperationEventHandler extends SettingEventHandler {
|
|
1169
|
+
/**
|
|
1170
|
+
* @inheritDoc
|
|
1171
|
+
*/
|
|
1172
|
+
canHandle(action) {
|
|
1173
|
+
return action[0] === exports.TableSettingType.COLUMN;
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* @inheritDoc
|
|
1177
|
+
*/
|
|
1178
|
+
execute(action, extensionContext) {
|
|
1179
|
+
const selectedCells = extensionContext.tableSelection.getSelectedCells();
|
|
1180
|
+
if (!selectedCells || selectedCells.length === 0) {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
const operation = action[1];
|
|
1184
|
+
switch (operation) {
|
|
1185
|
+
case exports.ColumnOperationType.ADD_COLUMN_LEFT:
|
|
1186
|
+
case exports.ColumnOperationType.ADD_COLUMN_RIGHT:
|
|
1187
|
+
this.handleInsertColumn(operation, selectedCells);
|
|
1188
|
+
break;
|
|
1189
|
+
case exports.ColumnOperationType.DELETE_COLUMN:
|
|
1190
|
+
this.handleDeleteColumn(selectedCells);
|
|
1191
|
+
break;
|
|
1192
|
+
case exports.ColumnOperationType.SELECT_COLUMN:
|
|
1193
|
+
this.handleSelectColumn(selectedCells, extensionContext);
|
|
1194
|
+
break;
|
|
1195
|
+
case exports.ColumnOperationType.HEADER_COLUMN:
|
|
1196
|
+
this.handleToggleHeaderColumn(selectedCells);
|
|
1197
|
+
break;
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Adds a new column to the table at the specified position.
|
|
1202
|
+
*
|
|
1203
|
+
* @param {ColumnOperationType} direction - The position to insert the new column (left or right).
|
|
1204
|
+
* @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
|
|
1205
|
+
*/
|
|
1206
|
+
handleInsertColumn(direction, selectedCells) {
|
|
1207
|
+
const action = new InsertTableColumnAction(direction === exports.ColumnOperationType.ADD_COLUMN_LEFT
|
|
1208
|
+
? exports.InsertTableColumnDirection.LEFT
|
|
1209
|
+
: exports.InsertTableColumnDirection.RIGHT, selectedCells);
|
|
1210
|
+
this.applyActionOnTable(action, selectedCells[0]);
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Deletes the selected column from the table.
|
|
1214
|
+
*
|
|
1215
|
+
* @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
|
|
1216
|
+
*/
|
|
1217
|
+
handleDeleteColumn(selectedCells) {
|
|
1218
|
+
const action = new DeleteTableColumnAction(selectedCells);
|
|
1219
|
+
this.applyActionOnTable(action, selectedCells[0]);
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Selects the entire column in the table.
|
|
1223
|
+
*
|
|
1224
|
+
* @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
|
|
1225
|
+
* @param {RTETableExtensionContext} extensionContext - The table extension context.
|
|
1226
|
+
*/
|
|
1227
|
+
handleSelectColumn(selectedCells, extensionContext) {
|
|
1228
|
+
const action = new SelectTableColumnAction(selectedCells, (allSelectedCells) => {
|
|
1229
|
+
extensionContext.tableSelection.setSelectedCells(allSelectedCells);
|
|
1230
|
+
});
|
|
1231
|
+
this.applyActionOnTable(action, selectedCells[0]);
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* Toggles the header state of the selected column in the table.
|
|
1235
|
+
*
|
|
1236
|
+
* @param {RTETableCellBlock[] | RTETableHeadCellBlock[]} selectedCells - The selected table cells.
|
|
1237
|
+
*/
|
|
1238
|
+
handleToggleHeaderColumn(selectedCells) {
|
|
1239
|
+
const headerOn = !ToggleHeaderTableColumnStrategy.isFullHeaderSelection(selectedCells);
|
|
1240
|
+
const action = new ToggleHeaderTableColumnAction(selectedCells, headerOn);
|
|
1241
|
+
this.applyActionOnTable(action, selectedCells[0]);
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Apply the specified action on the table containing the selected cell.
|
|
1245
|
+
*
|
|
1246
|
+
* @param {DeleteTableColumnAction | InsertTableColumnAction} action - The action to apply.
|
|
1247
|
+
* @param {RTETableCellBlock | RTETableHeadCellBlock} selectedCell - The selected table cell.
|
|
1248
|
+
*/
|
|
1249
|
+
applyActionOnTable(action, selectedCell) {
|
|
1250
|
+
const table = getParentBlockByType(selectedCell, RTETableBlock);
|
|
1251
|
+
if (table) {
|
|
1252
|
+
table.apply(action);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
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
|
+
];
|
|
1278
|
+
|
|
1279
|
+
exports.ColumnOperationEventHandler = ColumnOperationEventHandler;
|
|
1280
|
+
exports.DELETE_TABLE_COLUMN = DELETE_TABLE_COLUMN;
|
|
1281
|
+
exports.DELETE_TABLE_ROW = DELETE_TABLE_ROW;
|
|
1282
|
+
exports.INSERT_TABLE_COLUMN = INSERT_TABLE_COLUMN;
|
|
1283
|
+
exports.INSERT_TABLE_ROW = INSERT_TABLE_ROW;
|
|
1284
|
+
exports.RTETableAnnotation = RTETableAnnotation;
|
|
1285
|
+
exports.RTETableBlock = RTETableBlock;
|
|
1286
|
+
exports.RTETableBodyBlock = RTETableBodyBlock;
|
|
1287
|
+
exports.RTETableCellAnnotation = RTETableCellAnnotation;
|
|
1288
|
+
exports.RTETableCellBlock = RTETableCellBlock;
|
|
1289
|
+
exports.RTETableHeadBlock = RTETableHeadBlock;
|
|
1290
|
+
exports.RTETableHeadCellAnnotation = RTETableHeadCellAnnotation;
|
|
1291
|
+
exports.RTETableHeadCellBlock = RTETableHeadCellBlock;
|
|
1292
|
+
exports.RTETableRowBlock = RTETableRowBlock;
|
|
1293
|
+
exports.RTE_TABLE_BORDER_STYLES = RTE_TABLE_BORDER_STYLES;
|
|
1294
|
+
exports.RTE_TABLE_DEFAULT_COLORS = RTE_TABLE_DEFAULT_COLORS;
|
|
1295
|
+
exports.RowOperationEventHandler = RowOperationEventHandler;
|
|
1296
|
+
exports.SELECT_TABLE_COLUMN = SELECT_TABLE_COLUMN;
|
|
1297
|
+
exports.SettingEventHandler = SettingEventHandler;
|
|
1298
|
+
exports.TOGGLE_HEADER_ROW = TOGGLE_HEADER_ROW;
|
|
1299
|
+
exports.TOGGLE_HEADER_TABLE_COLUMN = TOGGLE_HEADER_TABLE_COLUMN;
|
|
1300
|
+
exports.TableColumnStrategy = TableColumnStrategy;
|
|
1301
|
+
exports.ToggleHeaderTableColumnStrategy = ToggleHeaderTableColumnStrategy;
|
|
1302
|
+
exports.generateTableBody = generateTableBody;
|
|
1303
|
+
exports.getAllTableRows = getAllTableRows;
|
|
1304
|
+
exports.getDefaultCellBlockTemplate = getDefaultCellBlockTemplate;
|
|
1305
|
+
exports.getFirstNode = getFirstNode;
|
|
1306
|
+
exports.getParentBlockByType = getParentBlockByType;
|