@globalpayments/vega 2.49.1 → 2.51.0
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/LICENSE +9 -17
- package/dist/cjs/{app-globals-65622aeb.js → app-globals-4ecf85bb.js} +11 -8
- package/dist/cjs/{child-nodes-event-prevent-slimmer-cc193ee1.js → child-nodes-event-prevent-slimmer-29020cc8.js} +1 -1
- package/dist/cjs/{child-nodes-notify-observer-slimmer-5817a53b.js → child-nodes-notify-observer-slimmer-30ba81ac.js} +1 -1
- package/dist/cjs/{content-state-6a48bcb5.js → code-block-2d014e17.js} +212 -975
- package/dist/cjs/{component-73a88c4e.js → component-1e352960.js} +1 -0
- package/dist/cjs/{component-global-style-slimmer-6749808c.js → component-global-style-slimmer-b0b4b997.js} +3 -0
- package/dist/cjs/content-state-6a5da7ec.js +1146 -0
- package/dist/cjs/{dark-mode-style-controller-4adb7fb2.js → dark-mode-style-controller-f9a32d68.js} +8 -0
- package/dist/cjs/{design-token-cba4222e.js → design-token-3f4f0bc3.js} +1 -1
- package/dist/cjs/{dom-node-subject-factory-d5826bff.js → dom-node-subject-factory-769dd00f.js} +1 -1
- package/dist/cjs/{dom-node-subject-observer-factory-a7a3b196.js → dom-node-subject-observer-factory-5aa4cc83.js} +1 -1
- package/dist/cjs/{effect-37695d3d.js → effect-98e88068.js} +2 -8
- package/dist/cjs/{element-appender-slimmer-4a26ecb2.js → element-appender-slimmer-5b1d8ffb.js} +13 -8
- package/dist/cjs/{event-emit-slimmer-8247249c.js → event-emit-slimmer-36036ef7.js} +15 -4
- package/dist/cjs/{form-field-controller-slimmer-4b0af5bc.js → form-field-controller-slimmer-01c01946.js} +9 -7
- package/dist/cjs/{image-annotation-action-9c2b9c8e.js → image-annotation-action-617bbb13.js} +19 -18
- package/dist/cjs/{index-09acd3c9.js → index-7700600c.js} +9 -0
- package/dist/cjs/{index-c4dec3aa.js → index-ebb1bb17.js} +3 -3
- package/dist/cjs/index.cjs.js +21 -20
- package/dist/cjs/{inject-keyboard-manager-b301e887.js → inject-keyboard-manager-dd628ccc.js} +1 -1
- package/dist/cjs/{internal-vega-event-manager-c9948b59.js → internal-vega-event-manager-e98944ac.js} +8 -1
- package/dist/cjs/{keyboard-manager-2ccf4b16.js → keyboard-manager-8c74eeb9.js} +3 -1
- package/dist/cjs/{keyboard-manager-slimmer-900cf2f5.js → keyboard-manager-slimmer-eb364bee.js} +1 -1
- package/dist/cjs/{legend-input-processor-8bcce3bf.js → legend-input-processor-b1f323fa.js} +2 -0
- package/dist/cjs/loader.cjs.js +15 -14
- package/dist/cjs/{page-resize-observer-slimmer-44e08878.js → page-resize-observer-slimmer-efa79728.js} +1 -0
- package/dist/cjs/{public-rules-10ec636d.js → public-rules-a3b7e267.js} +8 -7
- package/dist/cjs/{responsive-format-facade-263d49f6.js → responsive-format-facade-6b81192d.js} +6 -6
- package/dist/cjs/{rich-text-editor-required-rule-5faded94.js → rich-text-editor-required-rule-e9c7c379.js} +1 -1
- package/dist/cjs/selection-controller-1d7c0999.js +762 -0
- package/dist/cjs/{string-input-formatter-slimmer-50322824.js → string-input-formatter-slimmer-a5feb2ed.js} +3 -3
- package/dist/cjs/{style-formatter-ae0ef7fc.js → style-formatter-497d0fa4.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-7f437b19.js → sub-state-notify-slimmer-f68fbf29.js} +2 -2
- package/dist/cjs/{sub-state-observer-slimmer-e90362cd.js → sub-state-observer-slimmer-e06cdf7e.js} +3 -3
- package/dist/cjs/{translation-212b1875.js → translation-e5003a00.js} +5 -0
- package/dist/cjs/{translation-slimmer-d1512c6d.js → translation-slimmer-127a0f83.js} +1 -1
- package/dist/cjs/{ui-13b42af0.js → ui-6c069604.js} +2 -0
- package/dist/cjs/vega-accordion.cjs.entry.js +17 -16
- package/dist/cjs/vega-app-footer.cjs.entry.js +3 -3
- package/dist/cjs/vega-app-header-button.cjs.entry.js +18 -17
- package/dist/cjs/vega-backdrop.cjs.entry.js +3 -3
- package/dist/cjs/vega-banner.cjs.entry.js +7 -7
- package/dist/cjs/vega-bar-chart.cjs.entry.js +3 -3
- package/dist/cjs/vega-box.cjs.entry.js +18 -15
- package/dist/cjs/vega-brand-logo.cjs.entry.js +3 -3
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +8 -8
- package/dist/cjs/vega-button-circle.cjs.entry.js +18 -17
- package/dist/cjs/vega-button-group_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-button-link.cjs.entry.js +8 -8
- package/dist/cjs/vega-button.cjs.entry.js +17 -16
- package/dist/cjs/vega-calendar_3.cjs.entry.js +14 -14
- package/dist/cjs/vega-card.cjs.entry.js +15 -14
- package/dist/cjs/vega-carousel.cjs.entry.js +20 -16
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +14 -14
- package/dist/cjs/vega-chip.cjs.entry.js +18 -17
- package/dist/cjs/vega-code-block.cjs.entry.js +4160 -0
- package/dist/cjs/vega-color-picker.cjs.entry.js +12 -12
- package/dist/cjs/vega-combo-box.cjs.entry.js +15 -15
- package/dist/cjs/vega-counter-badge.cjs.entry.js +2 -2
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +34 -24
- package/dist/cjs/vega-dialog_2.cjs.entry.js +25 -18
- package/dist/cjs/vega-divider.cjs.entry.js +15 -14
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +25 -24
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-error.cjs.entry.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +7 -7
- package/dist/cjs/vega-file-uploader.cjs.entry.js +13 -13
- package/dist/cjs/vega-flag-icon.cjs.entry.js +15 -14
- package/dist/cjs/vega-flex.cjs.entry.js +16 -15
- package/dist/cjs/vega-font.cjs.entry.js +15 -14
- package/dist/cjs/vega-form.cjs.entry.js +15 -15
- package/dist/cjs/vega-grid.cjs.entry.js +15 -14
- package/dist/cjs/vega-hint.cjs.entry.js +2 -2
- package/dist/cjs/vega-icon.cjs.entry.js +19 -15
- package/dist/cjs/vega-image-uploader.cjs.entry.js +22 -19
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-numeric.cjs.entry.js +16 -16
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +18 -17
- package/dist/cjs/vega-input-range.cjs.entry.js +16 -16
- package/dist/cjs/vega-input-select.cjs.entry.js +25 -24
- package/dist/cjs/vega-input.cjs.entry.js +35 -17
- package/dist/cjs/{vega-internal-event-id-bfea9b93.js → vega-internal-event-id-6cdc95fe.js} +4 -0
- package/dist/cjs/vega-item-toggle.cjs.entry.js +7 -7
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +26 -20
- package/dist/cjs/vega-line-chart.cjs.entry.js +4 -4
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +15 -13
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +8 -8
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +8 -8
- package/dist/cjs/vega-pagination.cjs.entry.js +18 -17
- package/dist/cjs/vega-pie-chart.cjs.entry.js +3 -3
- package/dist/cjs/vega-popover_2.cjs.entry.js +19 -18
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +7 -7
- package/dist/cjs/vega-radio_2.cjs.entry.js +16 -16
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +189 -32
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +814 -1181
- package/dist/cjs/vega-section-title.cjs.entry.js +2 -2
- package/dist/cjs/vega-segment-control.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +20 -19
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +15 -15
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +23 -18
- package/dist/cjs/vega-signature-capture.cjs.entry.js +21 -19
- package/dist/cjs/{vega-skeleton-loader-controller-db868c98.js → vega-skeleton-loader-controller-ae2ab090.js} +15 -5
- package/dist/cjs/vega-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
- package/dist/cjs/vega-stepper.cjs.entry.js +13 -13
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-table_8.cjs.entry.js +377 -286
- package/dist/cjs/vega-text.cjs.entry.js +5 -3
- package/dist/cjs/vega-textarea.cjs.entry.js +13 -13
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +25 -24
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +12 -12
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +18 -17
- package/dist/cjs/vega.cjs.js +15 -14
- package/dist/cjs/{wait-for-vega-handler-0a0738ac.js → wait-for-vega-handler-4491efc9.js} +3 -1
- package/dist/cjs/{y-axis-input-processor-e371c142.js → y-axis-input-processor-19a07af5.js} +1 -1
- package/dist/collection/collection-manifest.json +7 -1
- package/dist/collection/components/vega-box/slimmers/controllers/vega-box-responsive-style-controller.js +1 -0
- package/dist/collection/components/vega-box/slimmers/controllers/vega-box-state-styles-controller.js +1 -0
- package/dist/collection/components/vega-carousel/vega-carousel.js +3 -0
- package/dist/collection/components/vega-code-block/assets/copy.js +3 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/code-block-range.js +129 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.js +87 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.js +34 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/insert-composition-text-controller.js +100 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +86 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-content-parse-controller.js +50 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-focus-controller.js +57 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.js +240 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.js +133 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.js +44 -0
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-content-renderer.js +117 -0
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +67 -0
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-renderer.js +122 -0
- package/dist/collection/components/vega-code-block/test/code-block-range.test.js +81 -0
- package/dist/collection/components/vega-code-block/types.js +10 -0
- package/dist/collection/components/vega-code-block/vega-code-block.css +160 -0
- package/dist/collection/components/vega-code-block/vega-code-block.js +404 -0
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-month-year-dropdown-renderer.js +5 -0
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +4 -0
- package/dist/collection/components/vega-icon/vega-icon.js +4 -1
- package/dist/collection/components/vega-image-uploader/slimmers/controllers/vega-image-uploader-preview-controller.js +2 -0
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-compact-width-controller.js +1 -0
- package/dist/collection/components/vega-input/vega-input.css +12 -2
- package/dist/collection/components/vega-input/vega-input.js +27 -3
- package/dist/collection/components/vega-input-range/slimmers/renderers/vega-input-range-clear-icon-renderer.js +1 -1
- package/dist/collection/components/vega-input-range/vega-input-range.css +10 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +5 -5
- package/dist/collection/components/vega-loader-wrapper/slimmers/controllers/manage-vega-loader-wrapper-z-index-controller.js +1 -0
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-backdrop-controller.js +3 -0
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.js +2 -0
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-nested-modal-controller.js +1 -0
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-controller.js +3 -0
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.js +2 -0
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +2 -0
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +7 -0
- package/dist/collection/components/vega-rich-text-editor/assets/rectangle-code.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.js +48 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +77 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-code-block-strategy.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-code-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/switch-out-from-code-block-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/transform-to-code-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/update-code-block-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +98 -0
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +62 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.js +78 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +19 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.js +70 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +7 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +7 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +24 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.js +64 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +56 -52
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +21 -8
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +65 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/code-block.test.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/test/e2e-utils.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.js +32 -0
- package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +10 -0
- package/dist/collection/components/vega-sidenav/slimmers/controllers/vega-sidenav-backdrop-controller.js +3 -0
- package/dist/collection/components/vega-sidenav/slimmers/controllers/vega-sidenav-open-status-controller.js +1 -0
- package/dist/collection/components/vega-signature-capture/slimmers/written-mode/controllers/written-mode-svg-controller.js +1 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/slimmers/controllers/vega-table-head-cell-sort-config-controller.js +92 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +6 -0
- package/dist/collection/components/vega-text/slimmers/renderers/vega-text-tooltip-renderer.js +2 -0
- package/dist/collection/components/vega-time-picker/slimmers/renderers/vega-time-picker-range-clear-button-renderer.js +1 -1
- package/dist/collection/components/vega-time-picker/vega-time-picker.css +10 -0
- package/dist/collection/global/scripts/before-vega-load.js +3 -0
- package/dist/collection/helpers/chart/graph-context-factory.js +2 -0
- package/dist/collection/helpers/common/wait-for-vega-handler.js +3 -1
- package/dist/collection/helpers/dialog/vega-dialog-controller.js +2 -0
- package/dist/collection/helpers/event-manager/event-delegated/vega-button-click-strategy.js +1 -0
- package/dist/collection/helpers/event-manager/event-delegated/vega-checkbox-change-strategy.js +1 -0
- package/dist/collection/helpers/event-manager/event-delegated/vega-input-select-change-strategy.js +1 -0
- package/dist/collection/helpers/event-manager/event-delegated/vega-input-strategy.js +1 -0
- package/dist/collection/helpers/event-manager/event-delegated/vega-radio-change-strategy.js +1 -0
- package/dist/collection/helpers/event-manager/event-delegated/vega-textarea-change-strategy.js +1 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -1
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +2 -0
- package/dist/collection/helpers/event-manager/slimmers/event-emit-slimmer.js +3 -1
- package/dist/collection/helpers/event-manager/test/event-emit-slimmer.test.js +11 -1
- package/dist/collection/helpers/keyboard/keyboard-manager.js +2 -0
- package/dist/collection/helpers/notify/vega-notify-controller.js +6 -1
- package/dist/collection/helpers/skeleton-loader/vega-skeleton-loader-controller.js +3 -0
- package/dist/collection/helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract.js +47 -0
- package/dist/collection/helpers/slimmers/component-global-style-slimmer.js +3 -0
- package/dist/collection/helpers/slimmers/element-appender/body-positioned-wrapper/default-wrapper.js +1 -0
- package/dist/collection/helpers/slimmers/element-appender/body-positioned-wrapper/position-relative-to-wrapper.js +2 -0
- package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +2 -0
- package/dist/collection/helpers/slimmers/field-error-ui-controller-strategies/sibling-container-error-label-container-retrieval-strategy.js +1 -0
- package/dist/collection/helpers/slimmers/field-error-ui-controller-strategies/sibling-container-self-retrieval-strategy.js +1 -0
- package/dist/collection/helpers/slimmers/page-resize-observer-slimmer.js +1 -0
- package/dist/collection/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.js +46 -0
- package/dist/collection/helpers/theme/controllers/color-schema-overriding-controller.js +2 -0
- package/dist/collection/helpers/theme/controllers/style-controller.abstract.js +3 -0
- package/dist/collection/helpers/theme/internal-theme-manager.js +3 -0
- package/dist/collection/helpers/translation/locales/en.js +5 -0
- package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +5 -0
- package/dist/collection/helpers/ui/element-appender.js +1 -1
- package/dist/collection/polyfill/shadow-selection/shadow-selection-polyfill.js +3 -1
- package/dist/collection/utils/component.js +1 -0
- package/dist/collection/utils/e2e-utils.js +3 -0
- package/dist/collection/utils/effect.js +2 -0
- package/dist/collection/utils/safe-document.js +9 -0
- package/dist/collection/utils/test/safe-document.test.js +13 -0
- package/dist/collection/utils/test-utils.js +1 -0
- package/dist/collection/utils/ui.js +3 -0
- package/dist/esm/{app-globals-1f8c30e9.js → app-globals-d96d623d.js} +11 -8
- package/dist/esm/{child-nodes-event-prevent-slimmer-5d45361e.js → child-nodes-event-prevent-slimmer-2b975cbf.js} +1 -1
- package/dist/esm/{child-nodes-notify-observer-slimmer-ddaad39a.js → child-nodes-notify-observer-slimmer-eeed5986.js} +1 -1
- package/dist/esm/{content-state-dbc9f635.js → code-block-ef2f04ca.js} +195 -970
- package/dist/esm/{component-cae24190.js → component-7d906393.js} +1 -0
- package/dist/esm/{component-global-style-slimmer-000e0c11.js → component-global-style-slimmer-dad40b64.js} +3 -0
- package/dist/esm/content-state-69d29a07.js +1140 -0
- package/dist/esm/{dark-mode-style-controller-2ada8e22.js → dark-mode-style-controller-ea798fc8.js} +8 -0
- package/dist/esm/{design-token-0699f0ca.js → design-token-2060cd0d.js} +1 -1
- package/dist/esm/{dom-node-subject-factory-f77cf9cc.js → dom-node-subject-factory-6374611f.js} +2 -2
- package/dist/esm/{dom-node-subject-observer-factory-715dccf9.js → dom-node-subject-observer-factory-c345ca2e.js} +1 -1
- package/dist/esm/{effect-8efd2c3c.js → effect-f50e072d.js} +2 -8
- package/dist/esm/{element-appender-slimmer-96cb54e2.js → element-appender-slimmer-64a77b7f.js} +13 -8
- package/dist/esm/{event-emit-slimmer-b7d511f6.js → event-emit-slimmer-7428cc01.js} +15 -4
- package/dist/esm/{form-field-controller-slimmer-89a72ee7.js → form-field-controller-slimmer-87d80e46.js} +9 -7
- package/dist/esm/{image-annotation-action-1aa938ab.js → image-annotation-action-1497f70e.js} +7 -6
- package/dist/esm/{index-187f71d1.js → index-d0a47531.js} +9 -0
- package/dist/esm/{index-4aa167d6.js → index-f5d2fe61.js} +3 -3
- package/dist/esm/index.js +15 -14
- package/dist/esm/{inject-keyboard-manager-f513be4a.js → inject-keyboard-manager-e39c0fd9.js} +1 -1
- package/dist/esm/{internal-vega-event-manager-87dc436c.js → internal-vega-event-manager-d80c53c5.js} +8 -1
- package/dist/esm/{keyboard-manager-262be5ce.js → keyboard-manager-9564ad83.js} +3 -1
- package/dist/esm/{keyboard-manager-slimmer-42bf9773.js → keyboard-manager-slimmer-2218e6ba.js} +1 -1
- package/dist/esm/{legend-input-processor-8f76ce8a.js → legend-input-processor-1d266967.js} +2 -0
- package/dist/esm/loader.js +15 -14
- package/dist/esm/{page-resize-observer-slimmer-15a84d26.js → page-resize-observer-slimmer-c51f1912.js} +1 -0
- package/dist/esm/{public-rules-5cf6aa95.js → public-rules-3436034b.js} +8 -7
- package/dist/esm/{responsive-format-facade-42f3fcfa.js → responsive-format-facade-8c0ce819.js} +6 -6
- package/dist/esm/{rich-text-editor-required-rule-6a7cd3ee.js → rich-text-editor-required-rule-cc5b6a2d.js} +1 -1
- package/dist/esm/selection-controller-3d6dfc87.js +757 -0
- package/dist/esm/{string-input-formatter-slimmer-c61f82d6.js → string-input-formatter-slimmer-e53b6412.js} +3 -3
- package/dist/esm/{style-formatter-cb00c709.js → style-formatter-1eca1299.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-4e3cf09d.js → sub-state-notify-slimmer-b6c8051c.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-be7a6ce3.js → sub-state-observer-slimmer-93eeb87d.js} +3 -3
- package/dist/esm/{translation-cf7f020a.js → translation-71e0711d.js} +5 -0
- package/dist/esm/{translation-slimmer-88966d5c.js → translation-slimmer-e6b130bf.js} +1 -1
- package/dist/esm/{ui-ed1283bb.js → ui-7d177fb0.js} +2 -0
- package/dist/esm/vega-accordion.entry.js +17 -16
- package/dist/esm/vega-app-footer.entry.js +3 -3
- package/dist/esm/vega-app-header-button.entry.js +18 -17
- package/dist/esm/vega-backdrop.entry.js +3 -3
- package/dist/esm/vega-banner.entry.js +7 -7
- package/dist/esm/vega-bar-chart.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +18 -15
- package/dist/esm/vega-brand-logo.entry.js +3 -3
- package/dist/esm/vega-breadcrumb.entry.js +8 -8
- package/dist/esm/vega-button-circle.entry.js +18 -17
- package/dist/esm/vega-button-group_2.entry.js +11 -11
- package/dist/esm/vega-button-link.entry.js +8 -8
- package/dist/esm/vega-button.entry.js +17 -16
- package/dist/esm/vega-calendar_3.entry.js +14 -14
- package/dist/esm/vega-card.entry.js +15 -14
- package/dist/esm/vega-carousel.entry.js +20 -16
- package/dist/esm/vega-checkbox_2.entry.js +14 -14
- package/dist/esm/vega-chip.entry.js +18 -17
- package/dist/esm/vega-code-block.entry.js +4156 -0
- package/dist/esm/vega-color-picker.entry.js +12 -12
- package/dist/esm/vega-combo-box.entry.js +15 -15
- package/dist/esm/vega-counter-badge.entry.js +2 -2
- package/dist/esm/vega-date-picker_2.entry.js +34 -24
- package/dist/esm/vega-dialog_2.entry.js +25 -18
- package/dist/esm/vega-divider.entry.js +15 -14
- package/dist/esm/vega-dropdown_5.entry.js +25 -24
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-error.entry.js +2 -2
- package/dist/esm/vega-field-label.entry.js +7 -7
- package/dist/esm/vega-file-uploader.entry.js +13 -13
- package/dist/esm/vega-flag-icon.entry.js +15 -14
- package/dist/esm/vega-flex.entry.js +16 -15
- package/dist/esm/vega-font.entry.js +15 -14
- package/dist/esm/vega-form.entry.js +15 -15
- package/dist/esm/vega-grid.entry.js +15 -14
- package/dist/esm/vega-hint.entry.js +2 -2
- package/dist/esm/vega-icon.entry.js +19 -15
- package/dist/esm/vega-image-uploader.entry.js +22 -19
- package/dist/esm/vega-input-credit-card.entry.js +13 -13
- package/dist/esm/vega-input-numeric.entry.js +16 -16
- package/dist/esm/vega-input-phone-number.entry.js +18 -17
- package/dist/esm/vega-input-range.entry.js +16 -16
- package/dist/esm/vega-input-select.entry.js +25 -24
- package/dist/esm/vega-input.entry.js +35 -17
- package/dist/esm/{vega-internal-event-id-85ad403f.js → vega-internal-event-id-178b2743.js} +3 -1
- package/dist/esm/vega-item-toggle.entry.js +7 -7
- package/dist/esm/vega-left-nav_5.entry.js +26 -20
- package/dist/esm/vega-line-chart.entry.js +4 -4
- package/dist/esm/vega-loader-wrapper_2.entry.js +15 -13
- package/dist/esm/vega-page-notification_2.entry.js +5 -5
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +8 -8
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +8 -8
- package/dist/esm/vega-pagination.entry.js +18 -17
- package/dist/esm/vega-pie-chart.entry.js +3 -3
- package/dist/esm/vega-popover_2.entry.js +19 -18
- package/dist/esm/vega-progress-tracker.entry.js +7 -7
- package/dist/esm/vega-radio_2.entry.js +16 -16
- package/dist/esm/vega-rich-text-content.entry.js +170 -13
- package/dist/esm/vega-rich-text-editor_4.entry.js +679 -1046
- package/dist/esm/vega-section-title.entry.js +2 -2
- package/dist/esm/vega-segment-control.entry.js +8 -8
- package/dist/esm/vega-selection-chip_2.entry.js +20 -19
- package/dist/esm/vega-selection-tile_2.entry.js +15 -15
- package/dist/esm/vega-sidenav_3.entry.js +23 -18
- package/dist/esm/vega-signature-capture.entry.js +21 -19
- package/dist/esm/{vega-skeleton-loader-controller-c2a8bd27.js → vega-skeleton-loader-controller-06f48dd2.js} +15 -5
- package/dist/esm/vega-skeleton.entry.js +2 -2
- package/dist/esm/vega-slot-container.entry.js +1 -1
- package/dist/esm/vega-stepper.entry.js +13 -13
- package/dist/esm/vega-tab-group_2.entry.js +9 -9
- package/dist/esm/vega-table_8.entry.js +377 -286
- package/dist/esm/vega-text.entry.js +5 -3
- package/dist/esm/vega-textarea.entry.js +13 -13
- package/dist/esm/vega-time-picker_2.entry.js +25 -24
- package/dist/esm/vega-toggle-switch.entry.js +12 -12
- package/dist/esm/vega-tooltip_2.entry.js +18 -17
- package/dist/esm/vega.js +15 -14
- package/dist/esm/{wait-for-vega-handler-b18eb955.js → wait-for-vega-handler-e0a928cd.js} +3 -1
- package/dist/esm/{y-axis-input-processor-e090b01c.js → y-axis-input-processor-95995d34.js} +1 -1
- package/dist/types/components/vega-code-block/assets/copy.d.ts +3 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/code-block-range.d.ts +64 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.d.ts +47 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.d.ts +19 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/insert-composition-text-controller.d.ts +50 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +43 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-content-parse-controller.d.ts +23 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-focus-controller.d.ts +21 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.d.ts +92 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.d.ts +63 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.d.ts +21 -0
- package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-content-renderer.d.ts +55 -0
- package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.d.ts +23 -0
- package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-renderer.d.ts +50 -0
- package/dist/types/components/vega-code-block/test/code-block-range.test.d.ts +1 -0
- package/dist/types/components/vega-code-block/types.d.ts +19 -0
- package/dist/types/components/vega-code-block/vega-code-block.d.ts +118 -0
- package/dist/types/components/vega-input/types.d.ts +2 -0
- package/dist/types/components/vega-input/vega-input.d.ts +9 -2
- package/dist/types/components/vega-rich-text-editor/assets/rectangle-code.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.d.ts +4 -5
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-code-block-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/remove-code-block-action.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/switch-out-from-code-block-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/transform-to-code-block-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/update-code-block-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +52 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +41 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.d.ts +39 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.d.ts +37 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +16 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +16 -23
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +6 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/blocks/code-block.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +4 -0
- package/dist/types/components/vega-table/interface.d.ts +3 -0
- package/dist/types/components/vega-table/vega-table-head-cell/slimmers/controllers/vega-table-head-cell-sort-config-controller.d.ts +42 -0
- package/dist/types/components/vega-table/vega-table-head-cell/vega-table-head-cell.d.ts +2 -0
- package/dist/types/components.d.ts +98 -3
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +2 -0
- package/dist/types/helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract.d.ts +20 -0
- package/dist/types/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.d.ts +1 -0
- package/dist/types/helpers/translation/interface.d.ts +6 -1
- package/dist/types/polyfill/shadow-selection/shadow-selection-polyfill.d.ts +26 -0
- package/dist/types/types/components.type.d.ts +2 -1
- package/dist/types/utils/safe-document.d.ts +7 -0
- package/dist/types/utils/test/safe-document.test.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-a46bc9f1.entry.js → p-06cd4a19.entry.js} +1 -1
- package/dist/vega/p-06fb002a.js +1 -0
- package/dist/vega/{p-b351ace3.entry.js → p-07cdaf74.entry.js} +1 -1
- package/dist/vega/{p-b847a143.entry.js → p-07e40eea.entry.js} +1 -1
- package/dist/vega/{p-913eb7f9.entry.js → p-0ce88865.entry.js} +1 -1
- package/dist/vega/{p-ec1f2d21.entry.js → p-1071f790.entry.js} +1 -1
- package/dist/vega/{p-45e28b9b.js → p-111d41fe.js} +1 -1
- package/dist/vega/p-12929d20.entry.js +1 -0
- package/dist/vega/{p-72ecfd40.js → p-138fcf6e.js} +1 -1
- package/dist/vega/{p-a01f149d.entry.js → p-151dec6a.entry.js} +1 -1
- package/dist/vega/{p-06adb37e.entry.js → p-1b81fc7a.entry.js} +1 -1
- package/dist/vega/{p-56a0b13d.js → p-1df029c2.js} +1 -1
- package/dist/vega/p-21d26bb4.js +2 -0
- package/dist/vega/p-21d4f12e.entry.js +1 -0
- package/dist/vega/{p-4a32a6c0.entry.js → p-21d5656d.entry.js} +1 -1
- package/dist/vega/{p-a7dcb2a3.js → p-21e180f2.js} +1 -1
- package/dist/vega/{p-0079088b.entry.js → p-2329cb73.entry.js} +1 -1
- package/dist/vega/{p-8c388b58.entry.js → p-29fe94b6.entry.js} +1 -1
- package/dist/vega/p-2f5d9aab.js +1 -0
- package/dist/vega/p-30c363d8.entry.js +9 -0
- package/dist/vega/{p-5e34ea25.entry.js → p-32a24ef1.entry.js} +1 -1
- package/dist/vega/p-33bd7e31.js +1 -0
- package/dist/vega/{p-46714da3.entry.js → p-36827489.entry.js} +1 -1
- package/dist/vega/{p-81fbfb6d.entry.js → p-388abe56.entry.js} +1 -1
- package/dist/vega/p-3b34389d.js +1 -0
- package/dist/vega/p-3eb2d433.js +1 -0
- package/dist/vega/{p-2da83c2a.js → p-3fa7d356.js} +1 -1
- package/dist/vega/p-425ba7d6.js +1 -0
- package/dist/vega/p-447a2b18.entry.js +1 -0
- package/dist/vega/{p-8d283666.js → p-4ab3df00.js} +1 -1
- package/dist/vega/{p-b649e86e.entry.js → p-4bca12ee.entry.js} +1 -1
- package/dist/vega/{p-b2bca332.entry.js → p-5016b57e.entry.js} +1 -1
- package/dist/vega/p-52905c68.entry.js +1 -0
- package/dist/vega/p-52bdeea0.entry.js +1 -0
- package/dist/vega/p-53803447.entry.js +1 -0
- package/dist/vega/{p-54f17c2e.entry.js → p-53815555.entry.js} +1 -1
- package/dist/vega/{p-d7937711.js → p-55563f5f.js} +1 -1
- package/dist/vega/{p-48517a5d.entry.js → p-578ac47f.entry.js} +1 -1
- package/dist/vega/p-586139ce.entry.js +1 -0
- package/dist/vega/p-597732e9.entry.js +1 -0
- package/dist/vega/{p-0969877b.entry.js → p-5c9efff8.entry.js} +1 -1
- package/dist/vega/{p-5e3a15a1.js → p-5e530257.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-60164904.entry.js +1 -0
- package/dist/vega/p-613ee009.js +1 -0
- package/dist/vega/p-61b72038.entry.js +1 -0
- package/dist/vega/p-642da014.entry.js +1 -0
- package/dist/vega/{p-9803042f.entry.js → p-647734d1.entry.js} +1 -1
- package/dist/vega/{p-cd205d96.js → p-65cca90f.js} +1 -1
- package/dist/vega/{p-6586e2a2.entry.js → p-66145767.entry.js} +1 -1
- package/dist/vega/p-6681efd5.js +1 -0
- package/dist/vega/{p-45f696b4.js → p-6b7dca3e.js} +1 -1
- package/dist/vega/{p-5160a6b9.entry.js → p-6ceb2d26.entry.js} +1 -1
- package/dist/vega/{p-6f81fe1e.js → p-6e01f0a2.js} +1 -1
- package/dist/vega/p-6f3dd430.entry.js +1 -0
- package/dist/vega/p-71d897e5.entry.js +1 -0
- package/dist/vega/{p-8ba43640.entry.js → p-72a4edf2.entry.js} +1 -1
- package/dist/vega/{p-bcb10ae3.entry.js → p-7503fe08.entry.js} +1 -1
- package/dist/vega/p-7add21f8.entry.js +1 -0
- package/dist/vega/{p-bfb344e1.entry.js → p-7df1ad72.entry.js} +1 -1
- package/dist/vega/{p-aea89be5.entry.js → p-7e70938a.entry.js} +1 -1
- package/dist/vega/{p-5064a804.js → p-864de9a1.js} +1 -1
- package/dist/vega/{p-10a40dfb.entry.js → p-86713a15.entry.js} +1 -1
- package/dist/vega/p-8a0d7805.entry.js +1 -0
- package/dist/vega/{p-89ab72e3.js → p-8bdc9e75.js} +1 -1
- package/dist/vega/{p-6cabdb36.js → p-8e31e7ea.js} +1 -1
- package/dist/vega/p-901b20d6.entry.js +1 -0
- package/dist/vega/p-90954fe4.entry.js +1 -0
- package/dist/vega/{p-6d7d923b.js → p-9c0cda62.js} +1 -1
- package/dist/vega/p-9d3292b7.entry.js +1 -0
- package/dist/vega/p-9eab97ee.entry.js +1 -0
- package/dist/vega/p-a0bd5bd7.entry.js +1 -0
- package/dist/vega/{p-54add0d2.js → p-a0dab2d0.js} +1 -1
- package/dist/vega/{p-83ef9e7d.entry.js → p-a1fbf49b.entry.js} +1 -1
- package/dist/vega/{p-d0007822.entry.js → p-aab6f547.entry.js} +1 -1
- package/dist/vega/p-b264d92e.entry.js +1 -0
- package/dist/vega/p-b51fa6ac.entry.js +1 -0
- package/dist/vega/p-b7594b78.entry.js +1 -0
- package/dist/vega/{p-6a830bc5.entry.js → p-c192c2d2.entry.js} +1 -1
- package/dist/vega/p-c4447540.entry.js +1 -0
- package/dist/vega/p-c8023434.entry.js +1 -0
- package/dist/vega/p-c91190df.entry.js +1 -0
- package/dist/vega/{p-647025dd.entry.js → p-cada532e.entry.js} +1 -1
- package/dist/vega/p-d0f0a908.entry.js +1 -0
- package/dist/vega/{p-02d7d948.entry.js → p-d53b262c.entry.js} +1 -1
- package/dist/vega/p-d64b20c2.js +1 -0
- package/dist/vega/{p-a5c39ba2.entry.js → p-d9cb6ec4.entry.js} +1 -1
- package/dist/vega/p-e16e23b7.entry.js +1 -0
- package/dist/vega/{p-1971d980.entry.js → p-e37ac14f.entry.js} +1 -1
- package/dist/vega/p-e5f1fd0b.entry.js +1 -0
- package/dist/vega/p-e7b00bf0.js +1 -0
- package/dist/vega/{p-147e3cbd.entry.js → p-e81b672b.entry.js} +1 -1
- package/dist/vega/{p-cfda64fd.entry.js → p-e860318d.entry.js} +1 -1
- package/dist/vega/p-ea723616.entry.js +1 -0
- package/dist/vega/{p-8ade44bf.js → p-eb832119.js} +1 -1
- package/dist/vega/{p-27003a81.entry.js → p-ec7d98f0.entry.js} +1 -1
- package/dist/vega/{p-a821bcf3.js → p-eea36d3c.js} +1 -1
- package/dist/vega/{p-252e42c7.entry.js → p-f0f787a2.entry.js} +1 -1
- package/dist/vega/p-f2f31686.entry.js +1 -0
- package/dist/vega/{p-27e56c67.entry.js → p-f41ae5e0.entry.js} +1 -1
- package/dist/vega/p-f4a13f3f.js +1 -0
- package/dist/vega/p-f9a9fca6.entry.js +1 -0
- package/dist/vega/{p-2fadef27.entry.js → p-fac5990f.entry.js} +1 -1
- package/dist/vega/p-fd0b2509.entry.js +1 -0
- package/dist/vega/p-fecb4044.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -2
- package/dist/vega/p-06c5fe97.entry.js +0 -1
- package/dist/vega/p-0ed7a098.entry.js +0 -1
- package/dist/vega/p-0f6b3a89.entry.js +0 -1
- package/dist/vega/p-136f665b.entry.js +0 -1
- package/dist/vega/p-1503f791.js +0 -1
- package/dist/vega/p-16fd7c32.js +0 -1
- package/dist/vega/p-1a263af1.entry.js +0 -1
- package/dist/vega/p-1af4771a.entry.js +0 -1
- package/dist/vega/p-1c298d5a.js +0 -2
- package/dist/vega/p-1c63afd2.entry.js +0 -1
- package/dist/vega/p-1e05b7b4.entry.js +0 -1
- package/dist/vega/p-1ea863a6.entry.js +0 -1
- package/dist/vega/p-271b30b9.entry.js +0 -1
- package/dist/vega/p-2d1d4f33.entry.js +0 -1
- package/dist/vega/p-353b3ded.entry.js +0 -1
- package/dist/vega/p-44b0a005.js +0 -1
- package/dist/vega/p-47ff95ba.entry.js +0 -1
- package/dist/vega/p-4e76904e.entry.js +0 -1
- package/dist/vega/p-4ec0d36f.entry.js +0 -1
- package/dist/vega/p-5c954088.entry.js +0 -1
- package/dist/vega/p-61eb7f32.entry.js +0 -1
- package/dist/vega/p-646a9198.entry.js +0 -1
- package/dist/vega/p-6e898779.js +0 -1
- package/dist/vega/p-7088ead9.entry.js +0 -1
- package/dist/vega/p-77492977.entry.js +0 -1
- package/dist/vega/p-804f71b3.js +0 -1
- package/dist/vega/p-8789d34d.entry.js +0 -1
- package/dist/vega/p-8813c0ac.entry.js +0 -1
- package/dist/vega/p-8a85c7af.entry.js +0 -1
- package/dist/vega/p-98c64d77.entry.js +0 -1
- package/dist/vega/p-9f3539a4.entry.js +0 -1
- package/dist/vega/p-b42aea55.entry.js +0 -1
- package/dist/vega/p-b5d70ee0.entry.js +0 -1
- package/dist/vega/p-bc2dd43d.js +0 -1
- package/dist/vega/p-bf1894ec.js +0 -1
- package/dist/vega/p-c754b32c.js +0 -1
- package/dist/vega/p-c9a4e79a.entry.js +0 -1
- package/dist/vega/p-dbc82247.js +0 -1
- package/dist/vega/p-e2e36d2b.entry.js +0 -1
- package/dist/vega/p-ef8272b5.entry.js +0 -1
- package/dist/vega/p-f4c1d961.js +0 -1
- package/dist/vega/p-f5279deb.entry.js +0 -1
- package/dist/vega/p-f8033cd3.entry.js +0 -1
- package/dist/vega/p-fe63bd50.entry.js +0 -1
- /package/dist/vega/{p-eda5b7fd.js → p-05b10af4.js} +0 -0
- /package/dist/vega/{p-50677c8e.js → p-0c8bd757.js} +0 -0
- /package/dist/vega/{p-af7a3154.js → p-13effc6b.js} +0 -0
- /package/dist/vega/{p-ecfa7534.js → p-272440e8.js} +0 -0
- /package/dist/vega/{p-9b797118.js → p-519a7d55.js} +0 -0
- /package/dist/vega/{p-c0291e2e.js → p-834434d5.js} +0 -0
- /package/dist/vega/{p-bf953152.js → p-d5776087.js} +0 -0
- /package/dist/vega/{p-0fd6c35b.js → p-fa5eb496.js} +0 -0
|
@@ -0,0 +1,1140 @@
|
|
|
1
|
+
import { B as BlockDeleteNodeContentStrategy, R as RemoveChildAction, a as RTEImageNode, A as ActionHandleStrategy, b as ReplaceChildNodesAction, I as InsertBlocksAfterAction, c as AppendChildNodesAction, d as RTETextBlock, e as InsertBlocksBeforeAction, S as SplitBlockWithNodeAction, M as ModifyContentAction, f as ModifyContentActionType, g as RTETextNode, h as BlockReplaceNodeWithNodesStrategy, i as RTEBlock, j as ActionHandleStrategyRegistry, k as BlockMergeNodesStrategy, l as BlockRemoveNodeStrategy, m as BlockAppendNodesStrategy, n as BlockReplaceNodesStrategy, o as BlockInsertNodesBeforeNodeStrategy, p as BlockDeleteTextContentStrategy, N as NodeAnnotationTypeEnum, q as BlockInsertLineBreakStrategy, r as BlockInsertLineBreakWithBlocksStrategy, s as BlockSplitWithTextNodeStrategy, t as SyncUpSelectionAction, u as RTECodeBlock } from './code-block-ef2f04ca.js';
|
|
2
|
+
import { i as isNonNullable } from './type-guard-158f6d7a.js';
|
|
3
|
+
import { g as generateUUID } from './create-public-api-runtime-metrics-slimmer-8ada793f.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The image block delete the image node strategy.
|
|
7
|
+
*/
|
|
8
|
+
class BlockDeleteImageStrategy extends BlockDeleteNodeContentStrategy {
|
|
9
|
+
/**
|
|
10
|
+
* @inheritDoc
|
|
11
|
+
*/
|
|
12
|
+
handleAction(action, target) {
|
|
13
|
+
this.deleteNodeContent(action, target);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Deletes content from a block node based on specific conditions.
|
|
17
|
+
*
|
|
18
|
+
* @param {DeleteBlockContentAction} action - Delete block content action
|
|
19
|
+
* @param {RTEImageBlock} target - The image block.
|
|
20
|
+
*/
|
|
21
|
+
deleteNodeContent(action, target) {
|
|
22
|
+
const startContainerNode = action
|
|
23
|
+
.startContainerNode, startOffset = action.startOffset;
|
|
24
|
+
let previousNode = this.getPreviousNode(startContainerNode);
|
|
25
|
+
let nextNode = null;
|
|
26
|
+
if (startOffset === 1) {
|
|
27
|
+
const parentBlock = target;
|
|
28
|
+
if (this.isContentFirstNode(startContainerNode)) {
|
|
29
|
+
nextNode = this.getNextNode(startContainerNode);
|
|
30
|
+
}
|
|
31
|
+
if (parentBlock.nodes.length === 1) {
|
|
32
|
+
parentBlock.parent.apply(new RemoveChildAction(parentBlock));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
parentBlock.apply(new RemoveChildAction(startContainerNode));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const shouldRemoveNode = previousNode;
|
|
40
|
+
if (shouldRemoveNode && shouldRemoveNode instanceof RTEImageNode) {
|
|
41
|
+
previousNode = this.getPreviousNode(shouldRemoveNode);
|
|
42
|
+
shouldRemoveNode.parentBlock.apply(new RemoveChildAction(shouldRemoveNode));
|
|
43
|
+
if (!previousNode) {
|
|
44
|
+
action.nextNode = startContainerNode;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (previousNode) {
|
|
49
|
+
action.previousNode = previousNode;
|
|
50
|
+
}
|
|
51
|
+
else if (nextNode) {
|
|
52
|
+
action.nextNode = nextNode;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Split the current image block with a special position strategy.
|
|
59
|
+
*/
|
|
60
|
+
class BlockSplitWithImageNodeStrategy extends ActionHandleStrategy {
|
|
61
|
+
/**
|
|
62
|
+
* @inheritDoc
|
|
63
|
+
*/
|
|
64
|
+
handleAction(action, target) {
|
|
65
|
+
action.newBlock = this.splitImageNodes(action.splitPointNode, action.startOffsetOfNode, target);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The image offset should be 0 or 1
|
|
69
|
+
* <vega-rich-text-image-editor><img /></vega-rich-text-image-editor>
|
|
70
|
+
*
|
|
71
|
+
* @param {RTEImageNode} imageNode The split point image node.
|
|
72
|
+
* @param {number} imageOffset The cursor point 0 | 1.
|
|
73
|
+
* @param {RTEImageBlock} target The image block.
|
|
74
|
+
* @returns {Nullable<RTEBlock>} The new block after split
|
|
75
|
+
*/
|
|
76
|
+
splitImageNodes(imageNode, imageOffset, target) {
|
|
77
|
+
const nodesSplitIndex = target.nodes.indexOf(imageNode);
|
|
78
|
+
if (nodesSplitIndex > -1) {
|
|
79
|
+
const beforeNodes = target.nodes.slice(0, nodesSplitIndex + imageOffset);
|
|
80
|
+
const afterNodes = target.nodes.slice(nodesSplitIndex + imageOffset);
|
|
81
|
+
target.apply(new ReplaceChildNodesAction(beforeNodes));
|
|
82
|
+
const newBlock = this.cloneWithNodes(afterNodes, target);
|
|
83
|
+
target.parent.apply(new InsertBlocksAfterAction(target, newBlock));
|
|
84
|
+
return newBlock;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Creates a new RTEImageBlock instance with the provided RTEImageNode instances appended to it.
|
|
89
|
+
*
|
|
90
|
+
* @param {RTEImageNode[]} nodes - An array of RTEImageNode objects that will be used to create a new RTEImageBlock instance.
|
|
91
|
+
* @param {RTEImageBlock} target The image block.
|
|
92
|
+
* @returns {RTEImageBlock} A new `RTEImageBlock` object with the provided `nodes` appended to it.
|
|
93
|
+
*/
|
|
94
|
+
cloneWithNodes(nodes, target) {
|
|
95
|
+
const block = target.createNewImageBlock();
|
|
96
|
+
block.nodes = [];
|
|
97
|
+
block.apply(new AppendChildNodesAction(nodes));
|
|
98
|
+
return block;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Insert a new paragraph at the image block special position strategy.
|
|
104
|
+
*/
|
|
105
|
+
class ImageInsertNewParagraphStrategy extends ActionHandleStrategy {
|
|
106
|
+
/**
|
|
107
|
+
* @inheritDoc
|
|
108
|
+
*/
|
|
109
|
+
handleAction(action, target) {
|
|
110
|
+
action.newBlock = this.breakSingleBlock(action.startContainerNode, action.startOffset, target);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Used to split a block of text at a specific position and insert a new paragraph block.
|
|
114
|
+
*
|
|
115
|
+
* @param {RTEImageNode} splitNode - The node that needs to be split into separate blocks.
|
|
116
|
+
* @param {number} startOffsetOfNode - The index or position within the `splitNode` where the block should be broken or split.
|
|
117
|
+
* @param {RTEImageBlock} target - The image block.
|
|
118
|
+
* @returns {Nullable<RTEBlock>} Returns either a new paragraph block or the new block created after splitting the original block.
|
|
119
|
+
*/
|
|
120
|
+
breakSingleBlock(splitNode, startOffsetOfNode, target) {
|
|
121
|
+
const newParagraph = RTETextBlock.from({
|
|
122
|
+
id: generateUUID(),
|
|
123
|
+
type: 'paragraph',
|
|
124
|
+
nodes: [{ id: generateUUID(), type: 'text', text: '' }],
|
|
125
|
+
});
|
|
126
|
+
if (this.isCaretPositionAtImageBlockEnd(target, splitNode, startOffsetOfNode)) {
|
|
127
|
+
target.parent.apply(new InsertBlocksAfterAction(target, newParagraph));
|
|
128
|
+
}
|
|
129
|
+
else if (this.isCaretPositionAtImageBlockStart(target, splitNode, startOffsetOfNode)) {
|
|
130
|
+
target.parent.apply(new InsertBlocksBeforeAction(target, newParagraph));
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
|
|
134
|
+
target.apply(splitBlockAction);
|
|
135
|
+
return splitBlockAction.newBlock;
|
|
136
|
+
}
|
|
137
|
+
return newParagraph;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Break the current block after press enter, this action is similar with the SplitBlockWithNodeAction,
|
|
143
|
+
* The SplitBlockWithNodeAction split the current block to two same type blocks, but this action will create new paragraph or list item when break at start or end.
|
|
144
|
+
* The property `newBlock` use to store the new create block if need.
|
|
145
|
+
*
|
|
146
|
+
* @example currentBlock.apply(new BreakSingleBlockAction(startContainerNode, startOffset))
|
|
147
|
+
*/
|
|
148
|
+
class BreakSingleBlockAction extends ModifyContentAction {
|
|
149
|
+
constructor(startContainerNode, startOffset) {
|
|
150
|
+
super();
|
|
151
|
+
this.type = ModifyContentActionType.BREAK_SINGLE_BLOCK;
|
|
152
|
+
this.startContainerNode = startContainerNode;
|
|
153
|
+
this.startOffset = startOffset;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The image block insert line break strategy.
|
|
159
|
+
*/
|
|
160
|
+
class ImageInsertLineBreakStrategy extends ActionHandleStrategy {
|
|
161
|
+
/**
|
|
162
|
+
* The image block not support insert the line break node, so invoke the insert new paragraph logic directly.
|
|
163
|
+
*
|
|
164
|
+
* @param {LineBreakSingleBlockAction} action - The action instance.
|
|
165
|
+
* @param {RTEImageBlock} target - The image block.
|
|
166
|
+
*/
|
|
167
|
+
handleAction(action, target) {
|
|
168
|
+
const insertNewParagraphAction = new BreakSingleBlockAction(action.startContainerNode, action.startOffset);
|
|
169
|
+
target.apply(insertNewParagraphAction);
|
|
170
|
+
const newBlock = insertNewParagraphAction.newBlock;
|
|
171
|
+
if (newBlock) {
|
|
172
|
+
action.lineBreakNode = newBlock.nodes[0];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Insert a line break node into multiple blocks selection at special position strategy.
|
|
179
|
+
*/
|
|
180
|
+
class ImageInsertLineBreakWithBlocksStrategy extends ActionHandleStrategy {
|
|
181
|
+
/**
|
|
182
|
+
* @inheritDoc
|
|
183
|
+
*/
|
|
184
|
+
handleAction(action, target) {
|
|
185
|
+
action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks, target);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Inserts a new paragraph block with a line break after a selected block of text in a rich text editor.
|
|
189
|
+
*
|
|
190
|
+
* @param {RTEBlock[]} selectedBlocks - An array of RTEBlock objects that represent the blocks that have been selected for a specific action in the Rich Text Editor.
|
|
191
|
+
* @param {RTEImageBlock} target - The image block.
|
|
192
|
+
* @returns {Nullable<RTETextNode>} Returns a Nullable RTETextNode.
|
|
193
|
+
*/
|
|
194
|
+
lineBreakMultipleBlocks(selectedBlocks, target) {
|
|
195
|
+
const newParagraph = RTETextBlock.from({
|
|
196
|
+
id: generateUUID(),
|
|
197
|
+
type: 'paragraph',
|
|
198
|
+
nodes: [{ id: generateUUID(), type: 'text', text: '\n' }],
|
|
199
|
+
});
|
|
200
|
+
target.parent.apply(new InsertBlocksAfterAction(target, newParagraph));
|
|
201
|
+
const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
|
|
202
|
+
if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
|
|
203
|
+
afterNodes.push(new RTETextNode(generateUUID(), '\n', newParagraph));
|
|
204
|
+
}
|
|
205
|
+
newParagraph.apply(new AppendChildNodesAction(afterNodes));
|
|
206
|
+
return newParagraph['nodes'][0];
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Concat the child nodes of multiple RTEBlocks if both are not images.
|
|
210
|
+
*
|
|
211
|
+
* @param {RTEBlock[]} blocks - multiple block of content in a rich text editor, such as a paragraph, heading, image, etc.
|
|
212
|
+
* @returns {RTENode[]} Array of connected block nodes
|
|
213
|
+
*/
|
|
214
|
+
concatBlocksNodes(blocks) {
|
|
215
|
+
const nodes = [];
|
|
216
|
+
blocks.map((block) => {
|
|
217
|
+
if (block.type !== 'image') {
|
|
218
|
+
nodes.push(...block['nodes']);
|
|
219
|
+
block.parent.apply(new RemoveChildAction(block));
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return nodes;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Insert a image node at the special position of image block.
|
|
228
|
+
*/
|
|
229
|
+
class ImageBlockInsertImageStrategy extends ActionHandleStrategy {
|
|
230
|
+
/**
|
|
231
|
+
* @inheritDoc
|
|
232
|
+
*/
|
|
233
|
+
handleAction(action, target) {
|
|
234
|
+
const splitNode = action.splitPointNode;
|
|
235
|
+
const startOffsetOfNode = action.startOffsetOfNode;
|
|
236
|
+
const newImageBlock = action.imageBlockToBeInserted;
|
|
237
|
+
const newImageNodes = newImageBlock.nodes;
|
|
238
|
+
if (target.nodes.length < 1) {
|
|
239
|
+
target.apply(new AppendChildNodesAction(newImageNodes));
|
|
240
|
+
}
|
|
241
|
+
else if (this.isCaretPositionAtImageBlockEnd(target, splitNode, startOffsetOfNode)) {
|
|
242
|
+
target.parent.apply(new InsertBlocksAfterAction(target, newImageBlock));
|
|
243
|
+
}
|
|
244
|
+
else if (this.isCaretPositionAtImageBlockStart(target, splitNode, startOffsetOfNode)) {
|
|
245
|
+
target.parent.apply(new InsertBlocksBeforeAction(target, newImageBlock));
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
target.apply(new SplitBlockWithNodeAction(splitNode, startOffsetOfNode));
|
|
249
|
+
target.parent.apply(new InsertBlocksAfterAction(target, newImageBlock));
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Insert some text nodes at the behind of the node strategy.
|
|
256
|
+
*/
|
|
257
|
+
class BlockInsertNodesAfterNodeStrategy extends BlockReplaceNodeWithNodesStrategy {
|
|
258
|
+
/**
|
|
259
|
+
* @inheritDoc
|
|
260
|
+
*/
|
|
261
|
+
handleAction(action, target) {
|
|
262
|
+
const referNode = action.referNode;
|
|
263
|
+
const nodes = [referNode, ...action.nodesToBeInserted];
|
|
264
|
+
this.replaceNodeWithNodes(target, referNode, nodes);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Image block
|
|
270
|
+
*/
|
|
271
|
+
class RTEImageBlock extends RTEBlock {
|
|
272
|
+
constructor(id) {
|
|
273
|
+
super(id);
|
|
274
|
+
this.type = 'image';
|
|
275
|
+
this.nodes = [];
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Converts a VegaRTEImageBlock object into an RTEImageBlock object by mapping nodes and creating annotations.
|
|
279
|
+
*
|
|
280
|
+
* @param {VegaRTEImageBlock} block - The block object to be converted.
|
|
281
|
+
* @returns {RTEImageBlock} An instance of `RTEImageBlock`
|
|
282
|
+
*/
|
|
283
|
+
static from(block) {
|
|
284
|
+
const imageBlock = new RTEImageBlock(block.id);
|
|
285
|
+
const { annotations } = block;
|
|
286
|
+
imageBlock.nodes = block.nodes.map((image) => RTEImageNode.from(image, imageBlock));
|
|
287
|
+
if (annotations) {
|
|
288
|
+
Object.entries(annotations).forEach(([type, value]) => {
|
|
289
|
+
const item = this.createAnnotationEntity(type, value);
|
|
290
|
+
if (isNonNullable(item)) {
|
|
291
|
+
imageBlock.annotationMap.set(...item);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
return imageBlock;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* @inheritDoc
|
|
299
|
+
*/
|
|
300
|
+
toJSON() {
|
|
301
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.nodes.map((node) => node.toJSON()) });
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* @inheritDoc
|
|
305
|
+
*/
|
|
306
|
+
isNotEmpty() {
|
|
307
|
+
return this.nodes.length > 0 && this.nodes.some((node) => node.url.length > 0);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* @inheritDoc
|
|
311
|
+
*/
|
|
312
|
+
getLastNode() {
|
|
313
|
+
return this.nodes[this.nodes.length - 1];
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Create a new image block.
|
|
317
|
+
*
|
|
318
|
+
* @returns {RTEImageBlock} - The empty image block.
|
|
319
|
+
*/
|
|
320
|
+
createNewImageBlock() {
|
|
321
|
+
return new RTEImageBlock(generateUUID());
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* @inheritDoc
|
|
325
|
+
*/
|
|
326
|
+
clone() {
|
|
327
|
+
const clonedBlock = new RTEImageBlock(this.id);
|
|
328
|
+
clonedBlock.nodes = this.nodes.map((node) => {
|
|
329
|
+
const clonedNode = node.clone();
|
|
330
|
+
clonedNode.parentBlock = clonedBlock;
|
|
331
|
+
return clonedNode;
|
|
332
|
+
});
|
|
333
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
334
|
+
clonedBlock.parent = this.parent;
|
|
335
|
+
return clonedBlock;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
(() => {
|
|
339
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_BLOCK_CONTENT, RTEImageBlock.name, new BlockDeleteImageStrategy());
|
|
340
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTEImageBlock.name, new BlockMergeNodesStrategy());
|
|
341
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, RTEImageBlock.name, new BlockRemoveNodeStrategy());
|
|
342
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.APPEND_CHILD_NODES, RTEImageBlock.name, new BlockAppendNodesStrategy());
|
|
343
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.REPLACE_CHILD_NODES, RTEImageBlock.name, new BlockReplaceNodesStrategy());
|
|
344
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTEImageBlock.name, new BlockSplitWithImageNodeStrategy());
|
|
345
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.BREAK_SINGLE_BLOCK, RTEImageBlock.name, new ImageInsertNewParagraphStrategy());
|
|
346
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEImageBlock.name, new ImageInsertLineBreakStrategy());
|
|
347
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEImageBlock.name, new ImageInsertLineBreakWithBlocksStrategy());
|
|
348
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEImageBlock.name, new ImageBlockInsertImageStrategy());
|
|
349
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_NODES_BEFORE, RTEImageBlock.name, new BlockInsertNodesBeforeNodeStrategy());
|
|
350
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_NODES_AFTER, RTEImageBlock.name, new BlockInsertNodesAfterNodeStrategy());
|
|
351
|
+
})();
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* The list item block block delete text content strategy.
|
|
355
|
+
*/
|
|
356
|
+
class ListItemDeleteTextContentStrategy extends BlockDeleteTextContentStrategy {
|
|
357
|
+
/**
|
|
358
|
+
* Delete the list item content and delete the parent list after delete the last item.
|
|
359
|
+
*
|
|
360
|
+
* @param {DeleteBlockContentAction} action - The delete block content action instance.
|
|
361
|
+
* @param {RTEListItemBlock} target - The list item block.
|
|
362
|
+
*/
|
|
363
|
+
handleAction(action, target) {
|
|
364
|
+
const listBlock = target.parent;
|
|
365
|
+
this.deleteNodeContent(action, target);
|
|
366
|
+
if (listBlock.blocks.length === 0) {
|
|
367
|
+
listBlock.parent.apply(new RemoveChildAction(listBlock));
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Remove list item child node strategy.
|
|
374
|
+
*/
|
|
375
|
+
class ListItemRemoveNodeStrategy extends ActionHandleStrategy {
|
|
376
|
+
/**
|
|
377
|
+
* Remove child node from the list item, remove the list item if the list item is empty.
|
|
378
|
+
*
|
|
379
|
+
* @param {RemoveChildAction} action - The remove child action instance.
|
|
380
|
+
* @param {RTEListItemBlock} target - The list item block.
|
|
381
|
+
*/
|
|
382
|
+
handleAction(action, target) {
|
|
383
|
+
target.nodes = target.nodes.filter((node) => node !== action.entityToBeRemoved);
|
|
384
|
+
if (target.nodes.length === 0 && (!target.children || !target.children.length)) {
|
|
385
|
+
target.parent.apply(new RemoveChildAction(target));
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Remove list item nest list block strategy.
|
|
392
|
+
*/
|
|
393
|
+
class ListItemRemoveNestListStrategy extends ActionHandleStrategy {
|
|
394
|
+
/**
|
|
395
|
+
* Remove the nest list block from the list item, clear the property children when the children is empty.
|
|
396
|
+
*
|
|
397
|
+
* @param {RemoveNestListAction} action - The action instance.
|
|
398
|
+
* @param {RTEListItemBlock} target - The list item block.
|
|
399
|
+
*/
|
|
400
|
+
handleAction(action, target) {
|
|
401
|
+
if (target.children) {
|
|
402
|
+
if (target.children.length > 1) {
|
|
403
|
+
target.children = target.children.filter((child) => child !== action.nestListBlockToBeRemoved);
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
target.children = undefined;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Replace list item nest list strategy.
|
|
414
|
+
*/
|
|
415
|
+
class ListItemReplaceNestListStrategy extends ActionHandleStrategy {
|
|
416
|
+
/**
|
|
417
|
+
* @inheritDoc
|
|
418
|
+
*/
|
|
419
|
+
handleAction(action, target) {
|
|
420
|
+
action.newList.forEach((listBlock) => {
|
|
421
|
+
listBlock.parent = target;
|
|
422
|
+
});
|
|
423
|
+
target.children = action.newList;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Insert new paragraph into current list item block at special position.
|
|
429
|
+
*/
|
|
430
|
+
class ListItemInsertNewParagraphStrategy extends ActionHandleStrategy {
|
|
431
|
+
/**
|
|
432
|
+
* @inheritDoc
|
|
433
|
+
*/
|
|
434
|
+
handleAction(action, target) {
|
|
435
|
+
action.newBlock = this.breakSingleListItemBlock(action.startContainerNode, action.startOffset, target);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Breaks a single list item block at a specific position.
|
|
439
|
+
*
|
|
440
|
+
* @param {RTETextNode} splitNode - The node that needs to be split within a list item block.
|
|
441
|
+
* @param {number} startOffsetOfNode - The index within the `splitNode` where the break operation should occur.
|
|
442
|
+
* @param {RTEListItemBlock} target - The list item block.
|
|
443
|
+
* @returns {Nullable<RTEBlock>} Returns either a new `RTEListItemBlock` if the caret
|
|
444
|
+
* position is at the end of the `splitNode`, or it returns the result of splitting the block at the
|
|
445
|
+
* caret position if it is neither at the start nor at the end.
|
|
446
|
+
*/
|
|
447
|
+
breakSingleListItemBlock(splitNode, startOffsetOfNode, target) {
|
|
448
|
+
const newListItem = target.createNewListItem();
|
|
449
|
+
const newBreakNode = this.copyInlineStyleToNewNode(splitNode);
|
|
450
|
+
newListItem.apply(new AppendChildNodesAction([newBreakNode]));
|
|
451
|
+
if (this.isCaretPositionAtTextBlockEnd(target, splitNode, startOffsetOfNode)) {
|
|
452
|
+
return this.breakListItemAtEnd(newListItem, target);
|
|
453
|
+
}
|
|
454
|
+
else if (this.isCaretPositionAtTextBlockStart(target, splitNode, startOffsetOfNode)) {
|
|
455
|
+
target.parent.apply(new InsertBlocksBeforeAction(target, newListItem));
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
|
|
459
|
+
target.apply(splitBlockAction);
|
|
460
|
+
return splitBlockAction.newBlock;
|
|
461
|
+
}
|
|
462
|
+
return newListItem;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Breaks a list item at the end and handles the insertion of a new list item or paragraph accordingly.
|
|
466
|
+
*
|
|
467
|
+
* @param {RTEListItemBlock} newListItem - Item that represents a new list item to be added to the existing list.
|
|
468
|
+
* @param {RTEListItemBlock} target - The list item block.
|
|
469
|
+
* @returns {RTEBlock} Returns a `RTEBlock`.
|
|
470
|
+
*/
|
|
471
|
+
breakListItemAtEnd(newListItem, target) {
|
|
472
|
+
const lastItem = target.parent.blocks[target.parent.blocks.length - 1];
|
|
473
|
+
const currentItemIsEmpty = target.nodes.length === 1 && target.nodes[0].isEmpty();
|
|
474
|
+
if (target === lastItem && currentItemIsEmpty) {
|
|
475
|
+
const parentParent = target.parent.parent;
|
|
476
|
+
if (parentParent['type'] !== 'list-item') {
|
|
477
|
+
const newParagraph = RTETextBlock.from({
|
|
478
|
+
id: generateUUID(),
|
|
479
|
+
type: 'paragraph',
|
|
480
|
+
nodes: [],
|
|
481
|
+
});
|
|
482
|
+
newParagraph.apply(new AppendChildNodesAction(newListItem.nodes));
|
|
483
|
+
parentParent.apply(new InsertBlocksAfterAction(target.parent, newParagraph));
|
|
484
|
+
target.parent.apply(new RemoveChildAction(target));
|
|
485
|
+
return newParagraph;
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
parentParent.parent.apply(new InsertBlocksAfterAction(parentParent, newListItem));
|
|
489
|
+
target.parent.apply(new RemoveChildAction(target));
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
target.parent.apply(new InsertBlocksAfterAction(target, newListItem));
|
|
494
|
+
}
|
|
495
|
+
return newListItem;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Copy the inline style to new node
|
|
499
|
+
*
|
|
500
|
+
* @param {RTETextNode} needCopedNode - The node that needed to be copied to
|
|
501
|
+
* @returns {RTETextNode} Returns a `RTETextNode`.
|
|
502
|
+
*/
|
|
503
|
+
copyInlineStyleToNewNode(needCopedNode) {
|
|
504
|
+
const textNode = needCopedNode.cloneWithText('');
|
|
505
|
+
// The link annotation doesn't need to inherit
|
|
506
|
+
textNode.annotationMap.delete(NodeAnnotationTypeEnum.LINK);
|
|
507
|
+
return textNode;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Insert image node to list item block strategy.
|
|
513
|
+
*/
|
|
514
|
+
class ListItemInsertImageStrategy extends ActionHandleStrategy {
|
|
515
|
+
/**
|
|
516
|
+
* The image node can not insert into list item block, so insert image after parent list block.
|
|
517
|
+
*
|
|
518
|
+
* @param {InsertImageToBlockAction} action - The action instance.
|
|
519
|
+
* @param {RTEListItemBlock} target - The list item block.
|
|
520
|
+
*/
|
|
521
|
+
handleAction(action, target) {
|
|
522
|
+
target.parent.apply(action);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* List item block
|
|
528
|
+
*/
|
|
529
|
+
class RTEListItemBlock extends RTETextBlock {
|
|
530
|
+
constructor(id, children) {
|
|
531
|
+
super(id, 'list-item');
|
|
532
|
+
this.children = [];
|
|
533
|
+
this.children = children;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Converts a VegaRTEListItemBlock object to an RTEListItemBlock
|
|
537
|
+
*
|
|
538
|
+
* @param {VegaRTEListBlock} block - Converts a `VegaRTEListItemBlock` object into an `RTEListItemBlock`.
|
|
539
|
+
* @returns {RTEListItemBlock} Return an instance of `RTEListItemBlock`
|
|
540
|
+
*/
|
|
541
|
+
static from(block) {
|
|
542
|
+
const listItemBlock = new RTEListItemBlock(block.id);
|
|
543
|
+
listItemBlock.nodes = block.nodes.map((richText) => RTETextNode.from(richText, listItemBlock));
|
|
544
|
+
if (block.children) {
|
|
545
|
+
listItemBlock.children = block.children.map((child) => {
|
|
546
|
+
const listBlock = RTEListBlock.from(child);
|
|
547
|
+
listBlock.parent = listItemBlock;
|
|
548
|
+
return listBlock;
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
const { annotations } = block;
|
|
552
|
+
if (annotations) {
|
|
553
|
+
Object.entries(annotations).forEach(([type, value]) => {
|
|
554
|
+
const item = this.createAnnotationEntity(type, value);
|
|
555
|
+
if (isNonNullable(item)) {
|
|
556
|
+
listItemBlock.annotationMap.set(...item);
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
return listItemBlock;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* @inheritDoc
|
|
564
|
+
*/
|
|
565
|
+
toJSON() {
|
|
566
|
+
var _a;
|
|
567
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((block) => block.toJSON()) });
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* @inheritDoc
|
|
571
|
+
*/
|
|
572
|
+
cloneWithNodes(nodes) {
|
|
573
|
+
const block = new RTEListItemBlock(generateUUID());
|
|
574
|
+
block.nodes = [];
|
|
575
|
+
block.apply(new AppendChildNodesAction(nodes));
|
|
576
|
+
return block;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* @inheritDoc
|
|
580
|
+
*/
|
|
581
|
+
getLastNode() {
|
|
582
|
+
if (this.children && this.children.length > 0) {
|
|
583
|
+
const childListBlock = this.children[this.children.length - 1];
|
|
584
|
+
return childListBlock.getLastNode();
|
|
585
|
+
}
|
|
586
|
+
return super.getLastNode();
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Create a new list item block.
|
|
590
|
+
*
|
|
591
|
+
* @returns {RTEListItemBlock} - A list item block.
|
|
592
|
+
*/
|
|
593
|
+
createNewListItem() {
|
|
594
|
+
return new RTEListItemBlock(generateUUID());
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* @inheritDoc
|
|
598
|
+
*/
|
|
599
|
+
clone() {
|
|
600
|
+
var _a;
|
|
601
|
+
const block = new RTEListItemBlock(this.id);
|
|
602
|
+
block.nodes = this.nodes.map((node) => {
|
|
603
|
+
const clonedNode = node.clone();
|
|
604
|
+
clonedNode.parentBlock = block;
|
|
605
|
+
return clonedNode;
|
|
606
|
+
});
|
|
607
|
+
block.annotationMap = super.cloneAnnotations();
|
|
608
|
+
block.children = (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((child) => {
|
|
609
|
+
const clonedChild = child.clone();
|
|
610
|
+
clonedChild.parent = block;
|
|
611
|
+
return clonedChild;
|
|
612
|
+
});
|
|
613
|
+
block.parent = this.parent;
|
|
614
|
+
return block;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
(() => {
|
|
618
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_BLOCK_CONTENT, RTEListItemBlock.name, new ListItemDeleteTextContentStrategy());
|
|
619
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEListItemBlock.name, new BlockInsertLineBreakStrategy());
|
|
620
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEListItemBlock.name, new BlockInsertLineBreakWithBlocksStrategy());
|
|
621
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, RTEListItemBlock.name, new ListItemRemoveNodeStrategy());
|
|
622
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_NEST_LIST, RTEListItemBlock.name, new ListItemRemoveNestListStrategy());
|
|
623
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.APPEND_CHILD_NODES, RTEListItemBlock.name, new BlockAppendNodesStrategy());
|
|
624
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTEListItemBlock.name, new BlockSplitWithTextNodeStrategy());
|
|
625
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.REPLACE_CHILD_NODES, RTEListItemBlock.name, new BlockReplaceNodesStrategy());
|
|
626
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.REPLACE_NEST_LIST, RTEListItemBlock.name, new ListItemReplaceNestListStrategy());
|
|
627
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTEListItemBlock.name, new BlockMergeNodesStrategy());
|
|
628
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.BREAK_SINGLE_BLOCK, RTEListItemBlock.name, new ListItemInsertNewParagraphStrategy());
|
|
629
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListItemBlock.name, new ListItemInsertImageStrategy());
|
|
630
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_NODES_BEFORE, RTEListItemBlock.name, new BlockInsertNodesBeforeNodeStrategy());
|
|
631
|
+
})();
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Insert block array at the front of the block strategy.
|
|
635
|
+
*/
|
|
636
|
+
class BlockInsertBlocksBeforeStrategy extends ActionHandleStrategy {
|
|
637
|
+
/**
|
|
638
|
+
* @inheritDoc
|
|
639
|
+
*/
|
|
640
|
+
handleAction(action, target) {
|
|
641
|
+
this.replaceBlockWithBlocks(target, action.referBlock, [
|
|
642
|
+
...action.blocksToBeInserted,
|
|
643
|
+
action.referBlock,
|
|
644
|
+
]);
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Replaces a specific block with an array of blocks within a RTEContentBlock array.
|
|
648
|
+
*
|
|
649
|
+
* @param {RTEListBlock|VegaRTEContent} target - The list block or the VegaRTEContent instance.
|
|
650
|
+
* @param {RTEBlock} referBlock - Used as a reference block to identify the block that needs to be replaced in the `blocks` array.
|
|
651
|
+
* @param {RTEBlock[]} blocks - An array of RTEBlock objects that you want to replace the `referBlock` with in the `blocks` array.
|
|
652
|
+
*/
|
|
653
|
+
replaceBlockWithBlocks(target, referBlock, blocks) {
|
|
654
|
+
if (target.blocks) {
|
|
655
|
+
blocks.forEach((block) => {
|
|
656
|
+
block.parent = target;
|
|
657
|
+
});
|
|
658
|
+
const arrayFixed = target.blocks;
|
|
659
|
+
target.blocks = arrayFixed.flatMap((block) => {
|
|
660
|
+
if (block === referBlock) {
|
|
661
|
+
return blocks;
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
return block;
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Insert block array at the behind of the block strategy.
|
|
673
|
+
*/
|
|
674
|
+
class BlockInsertBlocksAfterStrategy extends BlockInsertBlocksBeforeStrategy {
|
|
675
|
+
/**
|
|
676
|
+
* @inheritDoc
|
|
677
|
+
*/
|
|
678
|
+
handleAction(action, target) {
|
|
679
|
+
this.replaceBlockWithBlocks(target, action.referBlock, [
|
|
680
|
+
action.referBlock,
|
|
681
|
+
...action.blocksToBeInserted,
|
|
682
|
+
]);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Append new block array to list block or VegaRTEContent instance strategy.
|
|
688
|
+
*/
|
|
689
|
+
class BlockAppendBlocksStrategy extends ActionHandleStrategy {
|
|
690
|
+
/**
|
|
691
|
+
* @inheritDoc
|
|
692
|
+
*/
|
|
693
|
+
handleAction(action, target) {
|
|
694
|
+
const newBlocks = action.entityToBeAppended;
|
|
695
|
+
if (target.blocks) {
|
|
696
|
+
newBlocks.forEach((block) => {
|
|
697
|
+
block.parent = target;
|
|
698
|
+
});
|
|
699
|
+
const arrayFixed = target.blocks;
|
|
700
|
+
target.blocks = arrayFixed.concat(newBlocks);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Delete the nest list block action
|
|
707
|
+
*
|
|
708
|
+
* @example needRemovedNestList.parent.apply(new RemoveNestListAction(needRemovedNestList))
|
|
709
|
+
*/
|
|
710
|
+
class RemoveNestListAction extends ModifyContentAction {
|
|
711
|
+
constructor(childList) {
|
|
712
|
+
super();
|
|
713
|
+
this.type = ModifyContentActionType.DELETE_NEST_LIST;
|
|
714
|
+
this.nestListBlockToBeRemoved = childList;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* List block or VegaRTEContent remove child block strategy.
|
|
720
|
+
*/
|
|
721
|
+
class BlockRemoveChildBlockStrategy extends ActionHandleStrategy {
|
|
722
|
+
/**
|
|
723
|
+
* @inheritDoc
|
|
724
|
+
*/
|
|
725
|
+
handleAction(action, target) {
|
|
726
|
+
const blockToBeRemoved = action.entityToBeRemoved;
|
|
727
|
+
if (target.blocks) {
|
|
728
|
+
target.blocks = target.blocks.filter((block) => block !== blockToBeRemoved);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* List remove list item strategy.
|
|
735
|
+
*/
|
|
736
|
+
class ListRemoveListItemStrategy extends BlockRemoveChildBlockStrategy {
|
|
737
|
+
/**
|
|
738
|
+
* Remove the list item, check the list item and remove self if the list item is empty.
|
|
739
|
+
*
|
|
740
|
+
* @param {RemoveChildAction} action - The remove action instance.
|
|
741
|
+
* @param {RTEListBlock} target - The list block.
|
|
742
|
+
*/
|
|
743
|
+
handleAction(action, target) {
|
|
744
|
+
super.handleAction(action, target);
|
|
745
|
+
const parent = target.parent;
|
|
746
|
+
if (target.blocks.length === 0 && parent) {
|
|
747
|
+
// The parent is a list item mean the current block is a nest list, so we need to use RemoveNestListAction to remove the item
|
|
748
|
+
if (parent['type'] === 'list-item') {
|
|
749
|
+
parent.apply(new RemoveNestListAction(target));
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
parent.apply(new RemoveChildAction(target));
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Convert the selected blocks to list strategy.
|
|
760
|
+
*/
|
|
761
|
+
class ListTransformToListStrategy extends ActionHandleStrategy {
|
|
762
|
+
/**
|
|
763
|
+
* @inheritDoc
|
|
764
|
+
*/
|
|
765
|
+
handleAction(action, target) {
|
|
766
|
+
const selectedBlocks = action.selectedBlocks;
|
|
767
|
+
const bulletList = target.parent.createList(action.listType);
|
|
768
|
+
const isSameList = selectedBlocks.every((block) => block.parent === target);
|
|
769
|
+
if (isSameList) {
|
|
770
|
+
// Select one or more list items belonging to the same list, and all items in this list should be updated
|
|
771
|
+
bulletList.apply(new AppendChildNodesAction(target.blocks));
|
|
772
|
+
target.parent.apply(new InsertBlocksAfterAction(target, bulletList));
|
|
773
|
+
target.parent.apply(new RemoveChildAction(target));
|
|
774
|
+
selectedBlocks.forEach((block) => block.nodes.map((node) => node.apply(new SyncUpSelectionAction())));
|
|
775
|
+
}
|
|
776
|
+
else {
|
|
777
|
+
const listItems = action.selectedBlocks.map((block) => target.parent.toListItem(block));
|
|
778
|
+
bulletList.apply(new AppendChildNodesAction(listItems));
|
|
779
|
+
target.parent.apply(new InsertBlocksAfterAction(target, bulletList));
|
|
780
|
+
action.selectedBlocks.forEach((block) => {
|
|
781
|
+
block.parent.apply(new RemoveChildAction(block));
|
|
782
|
+
});
|
|
783
|
+
if (target.blocks.length === 0) {
|
|
784
|
+
target.parent.apply(new RemoveChildAction(target));
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Convert the selected list block to paragraph strategy.
|
|
792
|
+
*/
|
|
793
|
+
class ListTransformToParagraphStrategy extends ActionHandleStrategy {
|
|
794
|
+
/**
|
|
795
|
+
* @inheritDoc
|
|
796
|
+
*/
|
|
797
|
+
handleAction(action, target) {
|
|
798
|
+
let isSelectedFirstBlock = false;
|
|
799
|
+
let isSelectedLastBlock = false;
|
|
800
|
+
const selectedBlocks = action.selectedBlocks;
|
|
801
|
+
const currentParagraph = selectedBlocks.map((block) => {
|
|
802
|
+
block.nodes.map((node) => node.apply(new SyncUpSelectionAction()));
|
|
803
|
+
if (block === target.blocks[0])
|
|
804
|
+
isSelectedFirstBlock = true;
|
|
805
|
+
if (block === target.blocks[target.blocks.length - 1])
|
|
806
|
+
isSelectedLastBlock = true;
|
|
807
|
+
return this.toParagraph(block);
|
|
808
|
+
});
|
|
809
|
+
if (isSelectedFirstBlock) {
|
|
810
|
+
target.parent.apply(new InsertBlocksBeforeAction(target, ...currentParagraph));
|
|
811
|
+
}
|
|
812
|
+
else if (isSelectedLastBlock) {
|
|
813
|
+
target.parent.apply(new InsertBlocksAfterAction(target, ...currentParagraph));
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
const startIndex = target.blocks.indexOf(selectedBlocks[0]);
|
|
817
|
+
const lastIndex = target.blocks.indexOf(selectedBlocks[selectedBlocks.length - 1]);
|
|
818
|
+
const firstBulletList = target.parent.createList(target.type);
|
|
819
|
+
firstBulletList.apply(new AppendChildNodesAction(target.blocks.slice(0, startIndex)));
|
|
820
|
+
const lastBulletList = target.parent.createList(target.type);
|
|
821
|
+
lastBulletList.apply(new AppendChildNodesAction(target.blocks.slice(lastIndex + 1)));
|
|
822
|
+
target.parent.apply(new InsertBlocksBeforeAction(target, firstBulletList, ...currentParagraph, lastBulletList));
|
|
823
|
+
target.parent.apply(new RemoveChildAction(target));
|
|
824
|
+
}
|
|
825
|
+
selectedBlocks.map((block) => {
|
|
826
|
+
target.apply(new RemoveChildAction(block));
|
|
827
|
+
});
|
|
828
|
+
if (target.blocks.length === 0) {
|
|
829
|
+
target.parent.apply(new RemoveChildAction(target));
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Converts a RTEListItemBlock to a RTETextBlock representing a paragraph.
|
|
834
|
+
*
|
|
835
|
+
* @param {RTEListItemBlock} block - The block that will be covered
|
|
836
|
+
* @returns {RTETextBlock} Returns a `RTETextBlock`.
|
|
837
|
+
*/
|
|
838
|
+
toParagraph(block) {
|
|
839
|
+
const textBlock = new RTETextBlock(generateUUID(), 'paragraph');
|
|
840
|
+
textBlock.apply(new AppendChildNodesAction(block['nodes']));
|
|
841
|
+
textBlock['annotationMap'] = block['annotationMap'];
|
|
842
|
+
return textBlock;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Insert image to list block strategy.
|
|
848
|
+
*/
|
|
849
|
+
class ListInsertImageStrategy extends ActionHandleStrategy {
|
|
850
|
+
/**
|
|
851
|
+
* Insert image block at behind of the list item block.
|
|
852
|
+
*
|
|
853
|
+
* @param {InsertImageToBlockAction} action - The insert image action instance.
|
|
854
|
+
* @param {RTEListBlock} target - The list block.
|
|
855
|
+
*/
|
|
856
|
+
handleAction(action, target) {
|
|
857
|
+
const imageBlock = action.imageBlockToBeInserted;
|
|
858
|
+
if (target.parent['type'] !== 'list-item') {
|
|
859
|
+
target.parent.apply(new InsertBlocksAfterAction(target, imageBlock));
|
|
860
|
+
}
|
|
861
|
+
else {
|
|
862
|
+
target.parent.apply(action);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* List block
|
|
869
|
+
*/
|
|
870
|
+
class RTEListBlock extends RTEBlock {
|
|
871
|
+
constructor(id, type) {
|
|
872
|
+
super(id);
|
|
873
|
+
this.type = 'bullet-list';
|
|
874
|
+
this.blocks = [];
|
|
875
|
+
this.type = type;
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Converts a VegaRTEListBlock object to an RTEListBlock
|
|
879
|
+
*
|
|
880
|
+
* @param {VegaRTEListBlock} block - Converts a `VegaRTEListBlock` object into an `RTEListBlock`.
|
|
881
|
+
* @returns {RTEListBlock} Return an instance of `RTEListBlock`
|
|
882
|
+
*/
|
|
883
|
+
static from(block) {
|
|
884
|
+
const listBlock = new RTEListBlock(block.id, block.type);
|
|
885
|
+
listBlock.blocks = block.blocks.map((item) => {
|
|
886
|
+
const listItemBlock = RTEListItemBlock.from(item);
|
|
887
|
+
listItemBlock.parent = listBlock;
|
|
888
|
+
return listItemBlock;
|
|
889
|
+
});
|
|
890
|
+
return listBlock;
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* @inheritDoc
|
|
894
|
+
*/
|
|
895
|
+
toJSON() {
|
|
896
|
+
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.blocks.map((block) => block.toJSON()) });
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* @inheritDoc
|
|
900
|
+
*/
|
|
901
|
+
isNotEmpty() {
|
|
902
|
+
return this.blocks.length > 0;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* @inheritDoc
|
|
906
|
+
*/
|
|
907
|
+
getLastNode() {
|
|
908
|
+
return this.blocks[this.blocks.length - 1].getLastNode();
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* @inheritDoc
|
|
912
|
+
*/
|
|
913
|
+
clone() {
|
|
914
|
+
const clonedListBlock = new RTEListBlock(this.id, this.type);
|
|
915
|
+
clonedListBlock.blocks = this.blocks.map((item) => {
|
|
916
|
+
const clonedListItemBlock = item.clone();
|
|
917
|
+
clonedListItemBlock.parent = clonedListBlock;
|
|
918
|
+
return clonedListItemBlock;
|
|
919
|
+
});
|
|
920
|
+
clonedListBlock.annotationMap = super.cloneAnnotations();
|
|
921
|
+
clonedListBlock.parent = this.parent;
|
|
922
|
+
return clonedListBlock;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
(() => {
|
|
926
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, RTEListBlock.name, new ListRemoveListItemStrategy());
|
|
927
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_BLOCKS_BEFORE, RTEListBlock.name, new BlockInsertBlocksBeforeStrategy());
|
|
928
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_BLOCKS_AFTER, RTEListBlock.name, new BlockInsertBlocksAfterStrategy());
|
|
929
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.APPEND_CHILD_NODES, RTEListBlock.name, new BlockAppendBlocksStrategy());
|
|
930
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTEListBlock.name, new ListTransformToListStrategy());
|
|
931
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK, RTEListBlock.name, new ListTransformToParagraphStrategy());
|
|
932
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListBlock.name, new ListInsertImageStrategy());
|
|
933
|
+
})();
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Transform the selected text blocks to a code block strategy.
|
|
937
|
+
*/
|
|
938
|
+
class BlockTransformToCodeBlockStrategy extends ActionHandleStrategy {
|
|
939
|
+
/**
|
|
940
|
+
* Get the all select text and create a new code block.
|
|
941
|
+
*
|
|
942
|
+
* @param {TransformToCodeBlockAction} action - The action instance.
|
|
943
|
+
* @param {VegaRTEContent} target - The block top parent instance.
|
|
944
|
+
*/
|
|
945
|
+
handleAction(action, target) {
|
|
946
|
+
const selectedBlocks = action.selectedBlocks;
|
|
947
|
+
const codeBlock = new RTECodeBlock(generateUUID(), this.getCodeContent(selectedBlocks), 'plainText');
|
|
948
|
+
target.apply(new InsertBlocksBeforeAction(selectedBlocks[0], codeBlock));
|
|
949
|
+
action.newCodeBlock = codeBlock;
|
|
950
|
+
this.removeSelectBlocks(selectedBlocks, target);
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Get the selected text block text content.
|
|
954
|
+
*
|
|
955
|
+
* @param {RTEBlock[]} selectedBlocks - The selected blocks.
|
|
956
|
+
* @returns {string} - The selected text content.
|
|
957
|
+
*/
|
|
958
|
+
getCodeContent(selectedBlocks) {
|
|
959
|
+
const selectedTextBlocks = selectedBlocks.filter((item) => item.type !== 'image' && item.type !== 'list-item');
|
|
960
|
+
return selectedTextBlocks
|
|
961
|
+
.map((block) => {
|
|
962
|
+
return block.nodes.map((node) => node.text).join('');
|
|
963
|
+
})
|
|
964
|
+
.join('\n');
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Remove the selected blocks after append new code block.
|
|
968
|
+
*
|
|
969
|
+
* @param {RTEBlock[]} selectedBlocks - The selected blocks.
|
|
970
|
+
* @param {VegaRTEContent} target - The selected block top parent object.
|
|
971
|
+
*/
|
|
972
|
+
removeSelectBlocks(selectedBlocks, target) {
|
|
973
|
+
for (let i = 0; i < selectedBlocks.length; i++) {
|
|
974
|
+
target.apply(new RemoveChildAction(selectedBlocks[i]));
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Class representing the content state of the rich text editor.
|
|
981
|
+
*/
|
|
982
|
+
class VegaRTEContent {
|
|
983
|
+
constructor(blocks) {
|
|
984
|
+
blocks.forEach((block) => {
|
|
985
|
+
block.parent = this;
|
|
986
|
+
});
|
|
987
|
+
this.blocks = blocks;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Converts a JSON array of blocks to a class array of RTEContentBlock.
|
|
991
|
+
*
|
|
992
|
+
* @param {VegaRTEContentBlock[]} value The JSON array of blocks to convert.
|
|
993
|
+
* @returns {VegaRTEContent} The converted array of RTEContentBlock.
|
|
994
|
+
*/
|
|
995
|
+
static fromJSON(value) {
|
|
996
|
+
const blocks = value.map((block) => {
|
|
997
|
+
switch (block.type) {
|
|
998
|
+
case 'paragraph':
|
|
999
|
+
case 'title':
|
|
1000
|
+
case 'subtitle':
|
|
1001
|
+
case 'heading-1':
|
|
1002
|
+
case 'heading-2':
|
|
1003
|
+
case 'heading-3': {
|
|
1004
|
+
return RTETextBlock.from(block);
|
|
1005
|
+
}
|
|
1006
|
+
case 'image':
|
|
1007
|
+
return RTEImageBlock.from(block);
|
|
1008
|
+
case 'bullet-list':
|
|
1009
|
+
case 'number-list':
|
|
1010
|
+
return RTEListBlock.from(block);
|
|
1011
|
+
case 'code-block':
|
|
1012
|
+
return RTECodeBlock.from(block);
|
|
1013
|
+
default: {
|
|
1014
|
+
throw new Error(`[Vega] Unknown block type: ${block.type}`);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
});
|
|
1018
|
+
return new VegaRTEContent(blocks);
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Create an empty content state
|
|
1022
|
+
*
|
|
1023
|
+
* @returns {VegaRTEContent} An empty content state
|
|
1024
|
+
*/
|
|
1025
|
+
static createEmptyContent() {
|
|
1026
|
+
return VegaRTEContent.fromJSON([
|
|
1027
|
+
{
|
|
1028
|
+
id: generateUUID(),
|
|
1029
|
+
type: 'paragraph',
|
|
1030
|
+
nodes: [
|
|
1031
|
+
{
|
|
1032
|
+
id: generateUUID(),
|
|
1033
|
+
type: 'text',
|
|
1034
|
+
text: '',
|
|
1035
|
+
},
|
|
1036
|
+
],
|
|
1037
|
+
},
|
|
1038
|
+
]);
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Clones the content state.
|
|
1042
|
+
*
|
|
1043
|
+
* @param {boolean} deep - If true, performs a deep clone of the content state.
|
|
1044
|
+
* @returns {VegaRTEContent} The cloned content state.
|
|
1045
|
+
*/
|
|
1046
|
+
clone(deep = false) {
|
|
1047
|
+
return deep
|
|
1048
|
+
? new VegaRTEContent(this.blocks.map((block) => block.clone()))
|
|
1049
|
+
: new VegaRTEContent([...this.blocks]);
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Converts the content state to a JSON array of blocks.
|
|
1053
|
+
*
|
|
1054
|
+
* @returns {VegaRTEContentBlock[]} The JSON array of blocks.
|
|
1055
|
+
*/
|
|
1056
|
+
toJSON() {
|
|
1057
|
+
return this.blocks.map((block) => block.toJSON());
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Internal method to add the block item, remove the block item
|
|
1061
|
+
*
|
|
1062
|
+
* @param {ModifyContentAction} action - Modify content action
|
|
1063
|
+
*/
|
|
1064
|
+
apply(action) {
|
|
1065
|
+
ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Convert text to list.
|
|
1069
|
+
*
|
|
1070
|
+
* @param {RTETextBlock} block - block
|
|
1071
|
+
* @returns {RTEListItemBlock} list item block dto.
|
|
1072
|
+
*/
|
|
1073
|
+
toListItem(block) {
|
|
1074
|
+
block.nodes.map((node) => node.apply(new SyncUpSelectionAction()));
|
|
1075
|
+
const listItemBlock = new RTEListItemBlock(generateUUID());
|
|
1076
|
+
listItemBlock.apply(new AppendChildNodesAction(block['nodes']));
|
|
1077
|
+
listItemBlock['annotationMap'] = block['annotationMap'];
|
|
1078
|
+
return listItemBlock;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* create list.
|
|
1082
|
+
*
|
|
1083
|
+
* @param {ListType} type - type
|
|
1084
|
+
* @returns {RTEListBlock} list block dto.
|
|
1085
|
+
*/
|
|
1086
|
+
createList(type) {
|
|
1087
|
+
return new RTEListBlock(generateUUID(), type);
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Finds a node by its ID in the content.
|
|
1091
|
+
*
|
|
1092
|
+
* @param {string} id - The ID of the node to find.
|
|
1093
|
+
* @returns {Nullable<RTENode>} The found node or null if not found.
|
|
1094
|
+
*/
|
|
1095
|
+
findNodeById(id) {
|
|
1096
|
+
return this.findNodeInBlocksById(id, this.blocks);
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Recursively searches for a node by its ID in the given blocks.
|
|
1100
|
+
*
|
|
1101
|
+
* @param {string} id - The ID of the node to find.
|
|
1102
|
+
* @param {RTEContentBlock[]} blocks - The blocks to search within.
|
|
1103
|
+
* @returns {Nullable<RTENode>} The found node or null if not found.
|
|
1104
|
+
*/
|
|
1105
|
+
findNodeInBlocksById(id, blocks) {
|
|
1106
|
+
for (const block of blocks) {
|
|
1107
|
+
if ('nodes' in block) {
|
|
1108
|
+
for (const node of block.nodes) {
|
|
1109
|
+
if (node.id === id) {
|
|
1110
|
+
return node;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
if (block instanceof RTEListItemBlock && block.children) {
|
|
1115
|
+
for (const cBlock of block.children) {
|
|
1116
|
+
const foundNode = this.findNodeInBlocksById(id, cBlock.blocks);
|
|
1117
|
+
if (foundNode) {
|
|
1118
|
+
return foundNode;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
if (block instanceof RTEListBlock && block.blocks) {
|
|
1123
|
+
const foundNode = this.findNodeInBlocksById(id, block.blocks);
|
|
1124
|
+
if (foundNode) {
|
|
1125
|
+
return foundNode;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
return null;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
(() => {
|
|
1133
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, VegaRTEContent.name, new BlockRemoveChildBlockStrategy());
|
|
1134
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.APPEND_CHILD_NODES, VegaRTEContent.name, new BlockAppendBlocksStrategy());
|
|
1135
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_BLOCKS_BEFORE, VegaRTEContent.name, new BlockInsertBlocksBeforeStrategy());
|
|
1136
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_BLOCKS_AFTER, VegaRTEContent.name, new BlockInsertBlocksAfterStrategy());
|
|
1137
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_TO_CODE_BLOCK, VegaRTEContent.name, new BlockTransformToCodeBlockStrategy());
|
|
1138
|
+
})();
|
|
1139
|
+
|
|
1140
|
+
export { BreakSingleBlockAction as B, RTEImageBlock as R, VegaRTEContent as V, RTEListItemBlock as a, RTEListBlock as b };
|