@heartlandone/vega 2.94.0 → 2.96.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/dist/cjs/{app-globals-d05c3410.js → app-globals-38afea36.js} +7 -7
- package/dist/cjs/{child-nodes-event-prevent-slimmer-e67ee84c.js → child-nodes-event-prevent-slimmer-e0ac8467.js} +1 -1
- package/dist/cjs/{code-block-493c7ce7.js → code-block-4126dc3b.js} +1501 -55
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-ab21fcbf.js → component-value-history-controller-slimmer.abstract-38ba956e.js} +2 -2
- package/dist/cjs/{content-state-fc34a814.js → content-state-50e8a03c.js} +142 -580
- package/dist/cjs/{element-appender-slimmer-1d6323c2.js → element-appender-slimmer-7773fdab.js} +115 -0
- package/dist/cjs/{event-emit-slimmer-d234a619.js → event-emit-slimmer-34aa195e.js} +1 -1
- package/dist/cjs/{image-annotation-action-7c4cd316.js → image-annotation-action-89363de8.js} +2 -2
- package/dist/cjs/{image-extension-30a7c10f.js → image-extension-c881c454.js} +2 -2
- package/dist/cjs/index.cjs.js +11 -11
- package/dist/cjs/{internal-vega-event-manager-13c4012b.js → internal-vega-event-manager-7003c84a.js} +10 -2
- package/dist/cjs/{link-extension-92a63cb7.js → link-extension-b7f99a52.js} +2 -2
- package/dist/cjs/loader.cjs.js +9 -9
- package/dist/cjs/{public-rules-9e1ea1d9.js → public-rules-72894208.js} +3 -3
- package/dist/cjs/{range-30219330.js → range-95d41dea.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-23bf7485.js → rich-text-editor-required-rule-4d6d2493.js} +1 -1
- package/dist/cjs/shared-backdrop-manager-71e54fdb.js +199 -0
- package/dist/cjs/{split-cell-operation-43752212.js → split-cell-operation-70be116d.js} +2 -2
- package/dist/cjs/{token-extension-ea891d54.js → token-extension-eb828948.js} +36 -12
- package/dist/cjs/vega-accordion.cjs.entry.js +2 -2
- package/dist/cjs/vega-app-footer.cjs.entry.js +2 -2
- package/dist/cjs/vega-app-header-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-banner.cjs.entry.js +2 -2
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-circle.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-link.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_5.cjs.entry.js +3 -3
- package/dist/cjs/vega-carousel.cjs.entry.js +2 -2
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-chip.cjs.entry.js +3 -3
- package/dist/cjs/vega-code-block.cjs.entry.js +6 -6
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +22 -4
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-dialog_2.cjs.entry.js +160 -70
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +41 -13
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +2 -2
- package/dist/cjs/vega-form.cjs.entry.js +3 -3
- package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-passcode.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +54 -5
- package/dist/cjs/vega-input.cjs.entry.js +2 -2
- package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -2
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +32 -193
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
- package/dist/cjs/vega-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +13 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +58 -9
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +611 -93
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +5 -5
- package/dist/cjs/vega-section-title.cjs.entry.js +896 -14
- package/dist/cjs/vega-segment-control.cjs.entry.js +2 -2
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +2 -2
- package/dist/cjs/vega-signature-capture.cjs.entry.js +2 -2
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -3
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-table_11.cjs.entry.js +3 -3
- package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +1 -1
- package/dist/cjs/vega.cjs.js +9 -9
- package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +5 -1
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +52 -1
- package/dist/collection/components/vega-dialog/vega-dialog.js +1 -1
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-render-mode-controller.js +7 -6
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +36 -8
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-dropdown-controller.js +11 -1
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-items-slot-controler.js +23 -2
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +4 -0
- package/dist/collection/components/vega-input-select/vega-input-select.js +53 -2
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-backdrop-manager.js +141 -0
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.js +10 -17
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-z-index-controller.js +2 -2
- package/dist/collection/components/vega-modal/slimmers/renderers/vega-modal-renderer.js +3 -2
- package/dist/collection/components/vega-modal/vega-modal.js +77 -8
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +7 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +6 -0
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +4 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.js +10 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy.js +8 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-annotation-strategy.abstract.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.js +36 -4
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-items-strategy.abstract.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-nest-items-strategy.js +74 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.js +81 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.js +160 -9
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +376 -10
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-unnest-items-strategy.js +104 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/nest-list-items-action.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +10 -1
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +11 -3
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +7 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +8 -4
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +34 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +20 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.js +25 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +30 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/abstract-list-keyboard-handler.js +204 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-shift-tab-outdent-handler.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-tab-indent-handler.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/list-keyboard-slimmer.js +180 -0
- package/dist/collection/components/vega-section-title/slimmers/a11y-tree/build-section-title-a11y-tree.js +54 -0
- package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +4 -4
- package/dist/collection/components/vega-section-title/vega-section-title.js +18 -2
- package/dist/collection/helpers/a11y-tree/a11y-node-dto.js +210 -0
- package/dist/collection/helpers/a11y-tree/a11y-tree-applier.js +189 -0
- package/dist/collection/helpers/a11y-tree/a11y-tree.types.js +48 -0
- package/dist/collection/helpers/a11y-tree/strategies/baseline-strategy.js +78 -0
- package/dist/collection/helpers/a11y-tree/strategies/firefox-nvda-strategy.js +56 -0
- package/dist/collection/helpers/a11y-tree/strategies/webkit-voiceover-strategy.js +140 -0
- package/dist/collection/helpers/a11y-tree/strategy-resolver.js +172 -0
- package/dist/collection/helpers/backdrop/shared-backdrop-manager.js +32 -1
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +11 -3
- package/dist/collection/helpers/slimmers/a11y-tree-slimmer.js +54 -0
- package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +29 -0
- package/dist/collection/helpers/slimmers/element-appender/visibility-modifiers/clip-on-scroll-modifier.js +70 -0
- package/dist/collection/helpers/slimmers/element-appender/visibility-modifiers/visibility-modifier.interface.js +1 -0
- package/dist/collection/helpers/ui/element-appender.js +16 -0
- package/dist/esm/{app-globals-f2336686.js → app-globals-d7b651c1.js} +7 -7
- package/dist/esm/{child-nodes-event-prevent-slimmer-96c14f5a.js → child-nodes-event-prevent-slimmer-82626871.js} +1 -1
- package/dist/esm/{code-block-e12588fe.js → code-block-0a88b481.js} +1495 -51
- package/dist/esm/{component-value-history-controller-slimmer.abstract-4e8eb313.js → component-value-history-controller-slimmer.abstract-6846edfa.js} +2 -2
- package/dist/esm/{content-state-8032467a.js → content-state-79ca99e5.js} +105 -541
- package/dist/esm/{element-appender-slimmer-7fcb944b.js → element-appender-slimmer-73ad10ae.js} +115 -0
- package/dist/esm/{event-emit-slimmer-db4a82e0.js → event-emit-slimmer-2452278f.js} +1 -1
- package/dist/esm/{image-annotation-action-b3b6c308.js → image-annotation-action-bb299ef1.js} +3 -3
- package/dist/esm/{image-extension-b6c7e4a7.js → image-extension-48a96f98.js} +2 -2
- package/dist/esm/index.js +10 -10
- package/dist/esm/{internal-vega-event-manager-48690e5b.js → internal-vega-event-manager-2ecc9186.js} +11 -3
- package/dist/esm/{link-extension-97fcb8fb.js → link-extension-09534514.js} +2 -2
- package/dist/esm/loader.js +10 -10
- package/dist/esm/{public-rules-c06f0d2a.js → public-rules-5eb03ef0.js} +3 -3
- package/dist/esm/{range-e999837f.js → range-d4deb7df.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-71f8ee98.js → rich-text-editor-required-rule-5bbbce23.js} +1 -1
- package/dist/esm/shared-backdrop-manager-a7c63838.js +197 -0
- package/dist/esm/{split-cell-operation-359f8082.js → split-cell-operation-7f3058ad.js} +2 -2
- package/dist/esm/{token-extension-9896879b.js → token-extension-40c32bcc.js} +32 -8
- package/dist/esm/vega-accordion.entry.js +3 -3
- package/dist/esm/vega-app-footer.entry.js +3 -3
- package/dist/esm/vega-app-header-button.entry.js +4 -4
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +4 -4
- package/dist/esm/vega-button-group_2.entry.js +4 -4
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +4 -4
- package/dist/esm/vega-calendar_5.entry.js +4 -4
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +4 -4
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-code-block.entry.js +7 -7
- package/dist/esm/vega-color-picker.entry.js +3 -3
- package/dist/esm/vega-color-swatch-picker.entry.js +4 -4
- package/dist/esm/vega-color-swatch.entry.js +3 -3
- package/dist/esm/vega-combo-box.entry.js +23 -5
- package/dist/esm/vega-date-picker_2.entry.js +5 -5
- package/dist/esm/vega-dialog_2.entry.js +161 -71
- package/dist/esm/vega-dropdown_5.entry.js +42 -14
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-270fe47e.js → vega-event-id-f55f6977.js} +1 -1
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-form.entry.js +4 -4
- package/dist/esm/vega-image-uploader.entry.js +4 -4
- package/dist/esm/vega-input-credit-card.entry.js +4 -4
- package/dist/esm/vega-input-numeric.entry.js +4 -4
- package/dist/esm/vega-input-passcode.entry.js +4 -4
- package/dist/esm/vega-input-phone-number.entry.js +4 -4
- package/dist/esm/vega-input-range.entry.js +4 -4
- package/dist/esm/vega-input-select.entry.js +55 -6
- package/dist/esm/vega-input.entry.js +3 -3
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +32 -193
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +4 -4
- package/dist/esm/vega-progress-tracker_2.entry.js +14 -4
- package/dist/esm/vega-radio_2.entry.js +4 -4
- package/dist/esm/vega-rich-text-content.entry.js +59 -10
- package/dist/esm/vega-rich-text-editor_4.entry.js +608 -90
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +3 -3
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +3 -3
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +6 -6
- package/dist/esm/vega-section-title.entry.js +897 -15
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-selection-tile_2.entry.js +4 -4
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +3 -3
- package/dist/esm/vega-stepper.entry.js +4 -4
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +4 -4
- package/dist/esm/vega-textarea.entry.js +4 -4
- package/dist/esm/vega-time-picker_2.entry.js +5 -5
- package/dist/esm/vega-toggle-switch.entry.js +3 -3
- package/dist/esm/vega-tooltip_2.entry.js +1 -1
- package/dist/esm/vega.js +10 -10
- package/dist/sri/vega-sri-manifest.json +272 -268
- package/dist/types/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.d.ts +1 -0
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +21 -0
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-render-mode-controller.d.ts +2 -1
- package/dist/types/components/vega-dropdown/types.d.ts +2 -2
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +36 -9
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-dropdown-controller.d.ts +2 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-items-slot-controler.d.ts +10 -0
- package/dist/types/components/vega-input-select/types.d.ts +1 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +21 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-backdrop-manager.d.ts +66 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.d.ts +1 -5
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-z-index-controller.d.ts +1 -1
- package/dist/types/components/vega-modal/slimmers/renderers/vega-modal-renderer.d.ts +1 -1
- package/dist/types/components/vega-modal/vega-modal.d.ts +34 -6
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.d.ts +2 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-annotation-strategy.abstract.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.d.ts +14 -2
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-items-strategy.abstract.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-nest-items-strategy.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.d.ts +30 -3
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.d.ts +99 -3
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-unnest-items-strategy.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/nest-list-items-action.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +6 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/abstract-list-keyboard-handler.d.ts +99 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-shift-tab-outdent-handler.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-tab-indent-handler.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/list-keyboard-slimmer.d.ts +73 -0
- package/dist/types/components/vega-section-title/slimmers/a11y-tree/build-section-title-a11y-tree.d.ts +41 -0
- package/dist/types/components/vega-section-title/vega-section-title.d.ts +9 -0
- package/dist/types/components.d.ts +42 -8
- package/dist/types/helpers/a11y-tree/a11y-node-dto.d.ts +173 -0
- package/dist/types/helpers/a11y-tree/a11y-tree-applier.d.ts +28 -0
- package/dist/types/helpers/a11y-tree/a11y-tree.types.d.ts +137 -0
- package/dist/types/helpers/a11y-tree/strategies/baseline-strategy.d.ts +18 -0
- package/dist/types/helpers/a11y-tree/strategies/firefox-nvda-strategy.d.ts +16 -0
- package/dist/types/helpers/a11y-tree/strategies/webkit-voiceover-strategy.d.ts +23 -0
- package/dist/types/helpers/a11y-tree/strategy-resolver.d.ts +59 -0
- package/dist/types/helpers/backdrop/shared-backdrop-manager.d.ts +16 -0
- package/dist/types/helpers/slimmers/a11y-tree-slimmer.d.ts +49 -0
- package/dist/types/helpers/slimmers/element-appender/element-appender-slimmer.d.ts +9 -0
- package/dist/types/helpers/slimmers/element-appender/visibility-modifiers/clip-on-scroll-modifier.d.ts +37 -0
- package/dist/types/helpers/slimmers/element-appender/visibility-modifiers/visibility-modifier.interface.d.ts +56 -0
- package/dist/types/helpers/ui/element-appender.d.ts +7 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-3e8baeac.entry.js → p-0512308f.entry.js} +1 -1
- package/dist/vega/{p-46fe3154.entry.js → p-1d8312d3.entry.js} +1 -1
- package/dist/vega/{p-f5d7b89f.entry.js → p-1dfbc542.entry.js} +1 -1
- package/dist/vega/{p-fbd3be00.entry.js → p-200c8914.entry.js} +1 -1
- package/dist/vega/{p-e235020b.entry.js → p-22cc174e.entry.js} +1 -1
- package/dist/vega/{p-b1ff70bf.js → p-2c737fc8.js} +1 -1
- package/dist/vega/{p-782eb312.entry.js → p-2d77ae73.entry.js} +1 -1
- package/dist/vega/{p-cb90163a.entry.js → p-2d8d4d5b.entry.js} +1 -1
- package/dist/vega/{p-f651df3b.entry.js → p-2df5d59b.entry.js} +1 -1
- package/dist/vega/p-31216140.js +1 -0
- package/dist/vega/{p-f7e459cd.js → p-312d8205.js} +1 -1
- package/dist/vega/{p-a7209700.js → p-3345d903.js} +1 -1
- package/dist/vega/{p-44439ecc.entry.js → p-36d2df7a.entry.js} +1 -1
- package/dist/vega/{p-02355de8.js → p-3c23ec90.js} +1 -1
- package/dist/vega/{p-2bf17505.entry.js → p-3d6f761a.entry.js} +1 -1
- package/dist/vega/p-4151f53a.entry.js +1 -0
- package/dist/vega/{p-a057285e.entry.js → p-49e1cf4d.entry.js} +1 -1
- package/dist/vega/{p-698fbd73.js → p-5447a8e8.js} +1 -1
- package/dist/vega/p-55e0014a.js +3 -0
- package/dist/vega/{p-45e8424a.entry.js → p-56d19601.entry.js} +1 -1
- package/dist/vega/{p-addbca58.entry.js → p-5924adae.entry.js} +1 -1
- package/dist/vega/{p-9dca874d.entry.js → p-5e4517eb.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-65fee02f.entry.js +1 -0
- package/dist/vega/{p-140616fe.js → p-66647244.js} +1 -1
- package/dist/vega/{p-62d6e063.entry.js → p-6680ba17.entry.js} +1 -1
- package/dist/vega/p-6a51d720.js +1 -0
- package/dist/vega/{p-fe24b459.js → p-6c7b6d45.js} +1 -1
- package/dist/vega/{p-288d65ad.entry.js → p-6fcec7c7.entry.js} +1 -1
- package/dist/vega/{p-d08ffdf1.entry.js → p-74f86ff9.entry.js} +1 -1
- package/dist/vega/{p-6ad7144a.entry.js → p-775ecfad.entry.js} +1 -1
- package/dist/vega/{p-6f70a10f.entry.js → p-7950f3e2.entry.js} +1 -1
- package/dist/vega/{p-f246f125.entry.js → p-80b7945a.entry.js} +1 -1
- package/dist/vega/p-8354cff0.entry.js +1 -0
- package/dist/vega/{p-5db61a12.entry.js → p-841b3281.entry.js} +1 -1
- package/dist/vega/{p-579cdeae.js → p-84b7a775.js} +1 -1
- package/dist/vega/p-87e5cb56.entry.js +1 -0
- package/dist/vega/p-8c30a60d.js +1 -0
- package/dist/vega/{p-f8a29127.entry.js → p-8d96f0e8.entry.js} +1 -1
- package/dist/vega/{p-95913e3c.entry.js → p-91303402.entry.js} +1 -1
- package/dist/vega/p-96da7d30.entry.js +1 -0
- package/dist/vega/{p-51b68d25.js → p-9d3f69cb.js} +1 -1
- package/dist/vega/{p-ed103a1a.entry.js → p-9d96d83f.entry.js} +1 -1
- package/dist/vega/{p-6dfe2407.js → p-9f11b579.js} +1 -1
- package/dist/vega/p-9f201152.entry.js +1 -0
- package/dist/vega/{p-48ee3e24.entry.js → p-a775825e.entry.js} +1 -1
- package/dist/vega/{p-9d18ba7f.entry.js → p-acaff62d.entry.js} +1 -1
- package/dist/vega/{p-b8f8e480.entry.js → p-ae146458.entry.js} +1 -1
- package/dist/vega/{p-e8ee70c5.entry.js → p-b3a2ce06.entry.js} +1 -1
- package/dist/vega/{p-5107277d.entry.js → p-b4c26035.entry.js} +1 -1
- package/dist/vega/p-b63319e9.entry.js +1 -0
- package/dist/vega/{p-c9daabe1.entry.js → p-b660f38c.entry.js} +1 -1
- package/dist/vega/{p-8c083255.entry.js → p-b8c13ac9.entry.js} +1 -1
- package/dist/vega/p-b8ffa42f.entry.js +1 -0
- package/dist/vega/{p-7b57a845.entry.js → p-b9e72de2.entry.js} +1 -1
- package/dist/vega/{p-0af32f31.entry.js → p-bb60e381.entry.js} +1 -1
- package/dist/vega/p-bbad318e.entry.js +1 -0
- package/dist/vega/p-c0e42c03.entry.js +1 -0
- package/dist/vega/{p-c67b9aba.entry.js → p-c41f5684.entry.js} +1 -1
- package/dist/vega/{p-4fe40b76.js → p-c4564904.js} +1 -1
- package/dist/vega/{p-341a6b32.entry.js → p-c54b5a8f.entry.js} +1 -1
- package/dist/vega/p-cd1e976c.entry.js +1 -0
- package/dist/vega/p-d9158512.js +1 -0
- package/dist/vega/{p-2dc5edd0.entry.js → p-db11134b.entry.js} +1 -1
- package/dist/vega/{p-14559974.entry.js → p-e1737c8e.entry.js} +1 -1
- package/dist/vega/{p-0b311599.entry.js → p-e1b57e8f.entry.js} +1 -1
- package/dist/vega/{p-9f38448c.entry.js → p-e5ff77f7.entry.js} +1 -1
- package/dist/vega/p-e62d41ee.js +1 -0
- package/dist/vega/{p-6f01a71a.entry.js → p-ebe32b25.entry.js} +1 -1
- package/dist/vega/p-ec162599.entry.js +1 -0
- package/dist/vega/{p-9f7154d2.js → p-ec5dee32.js} +1 -1
- package/dist/vega/{p-d3a36d19.entry.js → p-ec64cc59.entry.js} +1 -1
- package/dist/vega/p-f29d9707.entry.js +1 -0
- package/dist/vega/{p-5df2d6a1.entry.js → p-f78944d7.entry.js} +1 -1
- package/dist/vega/{p-c9c6daa6.entry.js → p-f9bfee81.entry.js} +1 -1
- package/dist/vega/{p-26c7fe8b.entry.js → p-fa65956c.entry.js} +1 -1
- package/dist/vega/{p-f96d0503.entry.js → p-fc7e4c8a.entry.js} +1 -1
- package/dist/vega/{p-b39d4a88.entry.js → p-fd23c365.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -2
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-backdrop-controller.js +0 -73
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-backdrop-controller.d.ts +0 -27
- package/dist/vega/p-0b9c7c79.entry.js +0 -1
- package/dist/vega/p-0be4df0a.js +0 -1
- package/dist/vega/p-2364be92.entry.js +0 -1
- package/dist/vega/p-270697c0.entry.js +0 -1
- package/dist/vega/p-282b37cb.js +0 -1
- package/dist/vega/p-38c9d782.js +0 -1
- package/dist/vega/p-52c6a399.entry.js +0 -1
- package/dist/vega/p-73f2c3c0.entry.js +0 -1
- package/dist/vega/p-762ea523.entry.js +0 -1
- package/dist/vega/p-7a88a3d3.entry.js +0 -1
- package/dist/vega/p-83a16285.entry.js +0 -1
- package/dist/vega/p-91287214.entry.js +0 -1
- package/dist/vega/p-c66d2a1e.js +0 -1
- package/dist/vega/p-cad5222a.entry.js +0 -1
- package/dist/vega/p-d25ca0c3.entry.js +0 -1
- package/dist/vega/p-f05a193e.entry.js +0 -1
- package/dist/vega/p-f4da615a.js +0 -3
- package/dist/vega/p-f906a7bc.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const codeBlock = require('./code-block-
|
|
3
|
+
const codeBlock = require('./code-block-4126dc3b.js');
|
|
4
4
|
const misc = require('./misc-3d30df91.js');
|
|
5
5
|
const typeGuard = require('./type-guard-f354af8b.js');
|
|
6
6
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
@@ -10,446 +10,6 @@ const ui = require('./ui-c91c37a7.js');
|
|
|
10
10
|
const object = require('./object-b53e9416.js');
|
|
11
11
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* Remove list item nest list block strategy.
|
|
15
|
-
*/
|
|
16
|
-
class ListItemRemoveNestListStrategy extends codeBlock.ActionHandleStrategy {
|
|
17
|
-
/**
|
|
18
|
-
* Remove the nest list block from the list item, clear the property children when the children is empty.
|
|
19
|
-
*
|
|
20
|
-
* @param {RemoveNestListAction} action - The action instance.
|
|
21
|
-
* @param {RTEListItemBlock} target - The list item block.
|
|
22
|
-
*/
|
|
23
|
-
handleAction(action, target) {
|
|
24
|
-
if (target.nestList) {
|
|
25
|
-
if (target.nestList.length > 1) {
|
|
26
|
-
target.nestList = target.nestList.filter((child) => child !== action.nestListBlockToBeRemoved);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
target.nestList = undefined;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Replace list item nest list strategy.
|
|
37
|
-
*/
|
|
38
|
-
class ListItemReplaceNestListStrategy extends codeBlock.ActionHandleStrategy {
|
|
39
|
-
/**
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
handleAction(action, target) {
|
|
43
|
-
action.newList.forEach((listBlock) => {
|
|
44
|
-
listBlock.parent = target;
|
|
45
|
-
});
|
|
46
|
-
target.nestList = action.newList;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Insert image node to list item block strategy.
|
|
52
|
-
*/
|
|
53
|
-
class ListItemInsertImageStrategy extends codeBlock.ActionHandleStrategy {
|
|
54
|
-
/**
|
|
55
|
-
* The image node can not insert into list item block, so insert image after parent list block.
|
|
56
|
-
*
|
|
57
|
-
* @param {InsertImageToBlockAction} action - The action instance.
|
|
58
|
-
* @param {RTEListItemBlock} target - The list item block.
|
|
59
|
-
*/
|
|
60
|
-
handleAction(action, target) {
|
|
61
|
-
target.parent.apply(action);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* List item block
|
|
67
|
-
*/
|
|
68
|
-
class RTEListItemBlock extends codeBlock.RTETextBlock {
|
|
69
|
-
constructor(id, nestList, options) {
|
|
70
|
-
super(id, 'list-item', options);
|
|
71
|
-
this.dtoName = RTEListItemBlock.dtoName;
|
|
72
|
-
/**
|
|
73
|
-
* TODO: Refactor the list item properties children and nestList, merge two properties together.
|
|
74
|
-
*
|
|
75
|
-
* 1. Update the type of `children` to include `RTEListBlock` as a possible type.
|
|
76
|
-
* 2. The list block children should text block array and nest list block array, The text block should wrap a `li` tag when rendering.
|
|
77
|
-
*/
|
|
78
|
-
this.nestList = [];
|
|
79
|
-
this.nestList = nestList;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Converts a VegaRTEListItemBlock object to an RTEListItemBlock
|
|
83
|
-
*
|
|
84
|
-
* @param {VegaRTEListBlock} block - Converts a `VegaRTEListItemBlock` object into an `RTEListItemBlock`.
|
|
85
|
-
* @param {VegaRTETransformOptions} options - Optional transformation options.
|
|
86
|
-
* @returns {RTEListItemBlock} Return an instance of `RTEListItemBlock`
|
|
87
|
-
*/
|
|
88
|
-
static from(block, options = { autoMatchFormat: true }) {
|
|
89
|
-
const listItemBlock = new RTEListItemBlock(block.id, undefined, options);
|
|
90
|
-
listItemBlock.children = block.nodes.map((richText) => codeBlock.RTETextNode.from(richText, listItemBlock, options));
|
|
91
|
-
if (block.children) {
|
|
92
|
-
listItemBlock.nestList = block.children.map((child) => {
|
|
93
|
-
const listBlock = RTEListBlock.from(child);
|
|
94
|
-
listBlock.parent = listItemBlock;
|
|
95
|
-
return listBlock;
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const { annotations } = block;
|
|
99
|
-
if (annotations) {
|
|
100
|
-
Object.entries(annotations).forEach(([type, value]) => {
|
|
101
|
-
const item = this.createAnnotationEntity(type, value);
|
|
102
|
-
if (typeGuard.isNonNullable(item)) {
|
|
103
|
-
listItemBlock.annotationMap.set(...item);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return listItemBlock;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* @inheritDoc
|
|
111
|
-
*/
|
|
112
|
-
toJSON() {
|
|
113
|
-
var _a;
|
|
114
|
-
return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.nestList) === null || _a === void 0 ? void 0 : _a.map((block) => block.toJSON()) });
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* @inheritDoc
|
|
118
|
-
*/
|
|
119
|
-
toHtml(options) {
|
|
120
|
-
const attrStr = super.generateAttributeString(options);
|
|
121
|
-
return [`<li${attrStr}>`, this.getChildrenHtml(options), `</li>`].join('');
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* @inheritDoc
|
|
125
|
-
*/
|
|
126
|
-
cloneWithNodes(nodes) {
|
|
127
|
-
const block = new RTEListItemBlock(misc.generateUUID());
|
|
128
|
-
block.children = [];
|
|
129
|
-
block.apply(new codeBlock.AppendChildrenAction(nodes));
|
|
130
|
-
return block;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* @inheritDoc
|
|
134
|
-
*/
|
|
135
|
-
getLastNode() {
|
|
136
|
-
if (this.nestList && this.nestList.length > 0) {
|
|
137
|
-
const childListBlock = this.nestList[this.nestList.length - 1];
|
|
138
|
-
return childListBlock.getLastNode();
|
|
139
|
-
}
|
|
140
|
-
return super.getLastNode();
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Create a new list item block.
|
|
144
|
-
*
|
|
145
|
-
* @returns {RTEListItemBlock} - A list item block.
|
|
146
|
-
*/
|
|
147
|
-
createNewListItem() {
|
|
148
|
-
return new RTEListItemBlock(misc.generateUUID());
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* @inheritDoc
|
|
152
|
-
*/
|
|
153
|
-
clone(parent) {
|
|
154
|
-
var _a;
|
|
155
|
-
const block = new RTEListItemBlock(this.id);
|
|
156
|
-
block.children = this.children.map((node) => node.clone(block));
|
|
157
|
-
block.annotationMap = super.cloneAnnotations();
|
|
158
|
-
block.nestList = (_a = this.nestList) === null || _a === void 0 ? void 0 : _a.map((child) => child.clone(block));
|
|
159
|
-
block.parent = parent;
|
|
160
|
-
return block;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
(() => {
|
|
164
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.TextStyleAnnotationAction.name, RTEListItemBlock.name, new codeBlock.BlockUpdateTextStyleStrategy());
|
|
165
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.HorizontalAlignmentAnnotationAction.name, RTEListItemBlock.name, new codeBlock.BlockUpdateHorizontalAlignmentStrategy());
|
|
166
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEListItemBlock.name, new codeBlock.BlockInsertLineBreakStrategy());
|
|
167
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEListItemBlock.name, new codeBlock.BlockInsertLineBreakWithBlocksStrategy());
|
|
168
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_NEST_LIST, RTEListItemBlock.name, new ListItemRemoveNestListStrategy());
|
|
169
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTEListItemBlock.name, new codeBlock.BlockSplitWithTextNodeStrategy());
|
|
170
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.REPLACE_CHILD_NODES, RTEListItemBlock.name, new codeBlock.BlockReplaceNodesStrategy());
|
|
171
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.REPLACE_NEST_LIST, RTEListItemBlock.name, new ListItemReplaceNestListStrategy());
|
|
172
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTEListItemBlock.name, new codeBlock.BlockMergeNodesStrategy());
|
|
173
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListItemBlock.name, new ListItemInsertImageStrategy());
|
|
174
|
-
})();
|
|
175
|
-
RTEListItemBlock.dtoName = 'RTEListItemBlock';
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Convert the selected blocks to list strategy.
|
|
179
|
-
*/
|
|
180
|
-
class ListTransformToListStrategy extends codeBlock.ActionHandleStrategy {
|
|
181
|
-
/**
|
|
182
|
-
* @inheritDoc
|
|
183
|
-
*/
|
|
184
|
-
handleAction(action, target) {
|
|
185
|
-
const selectedBlocks = action.selectedBlocks;
|
|
186
|
-
const bulletList = target.parent.createList(action.listType);
|
|
187
|
-
const isSameList = selectedBlocks.every((block) => block.parent === target);
|
|
188
|
-
if (isSameList) {
|
|
189
|
-
// Select one or more list items belonging to the same list, and all items in this list should be updated
|
|
190
|
-
bulletList.apply(new codeBlock.AppendChildrenAction(target.children));
|
|
191
|
-
target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, bulletList));
|
|
192
|
-
target.parent.apply(new codeBlock.RemoveChildrenAction(target));
|
|
193
|
-
selectedBlocks.forEach((block) => block.children.map((node) => node.apply(new codeBlock.SyncUpSelectionAction())));
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
const listItems = action.selectedBlocks.map((block) => target.parent.toListItem(block));
|
|
197
|
-
bulletList.apply(new codeBlock.AppendChildrenAction(listItems));
|
|
198
|
-
target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, bulletList));
|
|
199
|
-
action.selectedBlocks.forEach((block) => {
|
|
200
|
-
block.parent.apply(new codeBlock.RemoveChildrenAction(block));
|
|
201
|
-
});
|
|
202
|
-
if (target.children.length === 0) {
|
|
203
|
-
target.parent.apply(new codeBlock.RemoveChildrenAction(target));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Convert the selected list block to paragraph strategy.
|
|
211
|
-
*/
|
|
212
|
-
class ListTransformToParagraphStrategy extends codeBlock.ActionHandleStrategy {
|
|
213
|
-
/**
|
|
214
|
-
* @inheritDoc
|
|
215
|
-
*/
|
|
216
|
-
handleAction(action, target) {
|
|
217
|
-
let isSelectedFirstBlock = false;
|
|
218
|
-
let isSelectedLastBlock = false;
|
|
219
|
-
const selectedBlocks = action.selectedBlocks;
|
|
220
|
-
const currentParagraph = selectedBlocks.map((block) => {
|
|
221
|
-
block.children.map((node) => node.apply(new codeBlock.SyncUpSelectionAction()));
|
|
222
|
-
if (block === target.children[0])
|
|
223
|
-
isSelectedFirstBlock = true;
|
|
224
|
-
if (block === target.children[target.children.length - 1])
|
|
225
|
-
isSelectedLastBlock = true;
|
|
226
|
-
return this.toParagraph(block);
|
|
227
|
-
});
|
|
228
|
-
if (isSelectedFirstBlock) {
|
|
229
|
-
target.parent.apply(new codeBlock.InsertChildrenBeforeAction(target, ...currentParagraph));
|
|
230
|
-
}
|
|
231
|
-
else if (isSelectedLastBlock) {
|
|
232
|
-
target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, ...currentParagraph));
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
const startIndex = target.children.indexOf(selectedBlocks[0]);
|
|
236
|
-
const lastIndex = target.children.indexOf(selectedBlocks[selectedBlocks.length - 1]);
|
|
237
|
-
const firstBulletList = target.parent.createList(target.type);
|
|
238
|
-
firstBulletList.apply(new codeBlock.AppendChildrenAction(target.children.slice(0, startIndex)));
|
|
239
|
-
const lastBulletList = target.parent.createList(target.type);
|
|
240
|
-
lastBulletList.apply(new codeBlock.AppendChildrenAction(target.children.slice(lastIndex + 1)));
|
|
241
|
-
target.parent.apply(new codeBlock.InsertChildrenBeforeAction(target, firstBulletList, ...currentParagraph, lastBulletList));
|
|
242
|
-
target.parent.apply(new codeBlock.RemoveChildrenAction(target));
|
|
243
|
-
}
|
|
244
|
-
selectedBlocks.map((block) => {
|
|
245
|
-
target.apply(new codeBlock.RemoveChildrenAction(block));
|
|
246
|
-
});
|
|
247
|
-
if (target.children.length === 0) {
|
|
248
|
-
target.parent.apply(new codeBlock.RemoveChildrenAction(target));
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Converts a RTEListItemBlock to a RTETextBlock representing a paragraph.
|
|
253
|
-
*
|
|
254
|
-
* @param {RTEListItemBlock} block - The block that will be covered
|
|
255
|
-
* @returns {RTETextBlock} Returns a `RTETextBlock`.
|
|
256
|
-
*/
|
|
257
|
-
toParagraph(block) {
|
|
258
|
-
const textBlock = new codeBlock.RTETextBlock(misc.generateUUID(), 'paragraph');
|
|
259
|
-
textBlock.apply(new codeBlock.AppendChildrenAction(block['children']));
|
|
260
|
-
textBlock['annotationMap'] = block['annotationMap'];
|
|
261
|
-
return textBlock;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Insert image to list block strategy.
|
|
267
|
-
*/
|
|
268
|
-
class ListInsertImageStrategy extends codeBlock.ActionHandleStrategy {
|
|
269
|
-
/**
|
|
270
|
-
* Insert image block at behind of the list item block.
|
|
271
|
-
*
|
|
272
|
-
* @param {InsertImageToBlockAction} action - The insert image action instance.
|
|
273
|
-
* @param {RTEListBlock} target - The list block.
|
|
274
|
-
*/
|
|
275
|
-
handleAction(action, target) {
|
|
276
|
-
const imageBlock = action.imageBlockToBeInserted;
|
|
277
|
-
if (target.parent['type'] !== 'list-item') {
|
|
278
|
-
target.parent.apply(new codeBlock.InsertChildrenAfterAction(target, imageBlock));
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
target.parent.apply(action);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* List annotation
|
|
288
|
-
*/
|
|
289
|
-
class ListAnnotation extends codeBlock.BlockAnnotation {
|
|
290
|
-
constructor() {
|
|
291
|
-
super(...arguments);
|
|
292
|
-
this.type = codeBlock.BlockAnnotationTypeEnum.LIST;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Get the default standalone styles for a list block.
|
|
296
|
-
*
|
|
297
|
-
* @returns {AnnotationStyle} The default styles.
|
|
298
|
-
*/
|
|
299
|
-
static getDefaultStyles() {
|
|
300
|
-
return {
|
|
301
|
-
paddingLeft: '8px',
|
|
302
|
-
marginLeft: '16px',
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* @inheritDoc
|
|
307
|
-
*/
|
|
308
|
-
renderStyle(options) {
|
|
309
|
-
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
310
|
-
return null;
|
|
311
|
-
return ListAnnotation.getDefaultStyles();
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* @inheritDoc
|
|
315
|
-
*/
|
|
316
|
-
renderClass(options) {
|
|
317
|
-
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
318
|
-
return null;
|
|
319
|
-
return 'v-rte--list';
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* @inheritDoc
|
|
323
|
-
*/
|
|
324
|
-
clone() {
|
|
325
|
-
return new ListAnnotation();
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* @inheritDoc
|
|
329
|
-
*/
|
|
330
|
-
toJSON() {
|
|
331
|
-
return undefined;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* List block
|
|
337
|
-
*/
|
|
338
|
-
class RTEListBlock extends codeBlock.RTEBlock {
|
|
339
|
-
constructor(id, type, options) {
|
|
340
|
-
super(id);
|
|
341
|
-
this.dtoName = RTEListBlock.dtoName;
|
|
342
|
-
this.type = 'bullet-list';
|
|
343
|
-
this.children = [];
|
|
344
|
-
this.type = type;
|
|
345
|
-
const { autoMatchFormat } = options || { autoMatchFormat: true };
|
|
346
|
-
if (autoMatchFormat) {
|
|
347
|
-
this.annotationMap.set(codeBlock.BlockAnnotationTypeEnum.LIST, new ListAnnotation());
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Converts a VegaRTEListBlock object to an RTEListBlock
|
|
352
|
-
*
|
|
353
|
-
* @param {VegaRTEListBlock} block - Converts a `VegaRTEListBlock` object into an `RTEListBlock`.
|
|
354
|
-
* @param {VegaRTETransformOptions} options - Optional transformation options.
|
|
355
|
-
* @returns {RTEListBlock} Return an instance of `RTEListBlock`
|
|
356
|
-
*/
|
|
357
|
-
static from(block, options = { autoMatchFormat: true }) {
|
|
358
|
-
const listBlock = new RTEListBlock(block.id, block.type, options);
|
|
359
|
-
const { annotations } = block;
|
|
360
|
-
if (annotations) {
|
|
361
|
-
Object.entries(annotations).forEach(([type, value]) => {
|
|
362
|
-
const item = this.createAnnotationEntity(type, value);
|
|
363
|
-
if (typeGuard.isNonNullable(item)) {
|
|
364
|
-
listBlock.annotationMap.set(...item);
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
listBlock.children = block.blocks.map((item) => {
|
|
369
|
-
const listItemBlock = RTEListItemBlock.from(item, options);
|
|
370
|
-
listItemBlock.parent = listBlock;
|
|
371
|
-
return listItemBlock;
|
|
372
|
-
});
|
|
373
|
-
return listBlock;
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* The function `createAnnotationEntity` creates a block annotation entity based on the provided type
|
|
377
|
-
* and value.
|
|
378
|
-
*
|
|
379
|
-
* @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
|
|
380
|
-
* the type of annotation entity to create.
|
|
381
|
-
* @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
|
|
382
|
-
* that will be used to create the annotation entity. It can be of any type depending on the specific
|
|
383
|
-
* annotation being created.
|
|
384
|
-
* @returns {Nullable<BlockAnnotationsEntity>} The `createAnnotationEntity` function returns a nullable tuple containing a
|
|
385
|
-
* `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
|
|
386
|
-
*/
|
|
387
|
-
static createAnnotationEntity(type, value) {
|
|
388
|
-
switch (type) {
|
|
389
|
-
case 'customAttribute':
|
|
390
|
-
return codeBlock.CustomAttributeAnnotation.from(value);
|
|
391
|
-
case 'customClass':
|
|
392
|
-
return codeBlock.CustomClassAnnotation.from(value);
|
|
393
|
-
case 'customStyle':
|
|
394
|
-
return codeBlock.CustomStyleAnnotation.from(value);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* @inheritDoc
|
|
399
|
-
*/
|
|
400
|
-
toJSON() {
|
|
401
|
-
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.children.map((block) => block.toJSON()) });
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* @inheritDoc
|
|
405
|
-
*/
|
|
406
|
-
toHtml(options) {
|
|
407
|
-
const BlockTag = this.getBlockTag();
|
|
408
|
-
const attrStr = super.generateAttributeString(options);
|
|
409
|
-
return [
|
|
410
|
-
`<${BlockTag}${attrStr}>`,
|
|
411
|
-
this.children.map((block) => block.toHtml(options)).join(''),
|
|
412
|
-
`</${BlockTag}>`,
|
|
413
|
-
].join('');
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* @inheritDoc
|
|
417
|
-
*/
|
|
418
|
-
isNotEmpty() {
|
|
419
|
-
return this.children.length > 0;
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* @inheritDoc
|
|
423
|
-
*/
|
|
424
|
-
getLastNode() {
|
|
425
|
-
return this.children[this.children.length - 1].getLastNode();
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* @inheritDoc
|
|
429
|
-
*/
|
|
430
|
-
clone(parent) {
|
|
431
|
-
const clonedListBlock = new RTEListBlock(this.id, this.type);
|
|
432
|
-
clonedListBlock.children = this.children.map((item) => item.clone(clonedListBlock));
|
|
433
|
-
clonedListBlock.annotationMap = super.cloneAnnotations();
|
|
434
|
-
clonedListBlock.parent = parent;
|
|
435
|
-
return clonedListBlock;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Returns the block tag based on the type of the list block.
|
|
439
|
-
*
|
|
440
|
-
* @returns {RTEListBlockTagType} - The block tag for the list block, either 'ol' or 'ul'.
|
|
441
|
-
*/
|
|
442
|
-
getBlockTag() {
|
|
443
|
-
return this.type === 'number-list' ? 'ol' : 'ul';
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
(() => {
|
|
447
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTEListBlock.name, new ListTransformToListStrategy());
|
|
448
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK, RTEListBlock.name, new ListTransformToParagraphStrategy());
|
|
449
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListBlock.name, new ListInsertImageStrategy());
|
|
450
|
-
})();
|
|
451
|
-
RTEListBlock.dtoName = 'RTEListBlock';
|
|
452
|
-
|
|
453
13
|
/**
|
|
454
14
|
* Transform the selected text blocks to a code block strategy.
|
|
455
15
|
*/
|
|
@@ -1197,85 +757,6 @@ class RTEImageBlock extends codeBlock.RTEBlock {
|
|
|
1197
757
|
})();
|
|
1198
758
|
RTEImageBlock.dtoName = 'RTEImageBlock';
|
|
1199
759
|
|
|
1200
|
-
/**
|
|
1201
|
-
* HTML Block
|
|
1202
|
-
*/
|
|
1203
|
-
class RTEHtmlBlock extends codeBlock.RTEBlock {
|
|
1204
|
-
constructor(id, htmlTag) {
|
|
1205
|
-
super(id);
|
|
1206
|
-
this.dtoName = RTEHtmlBlock.dtoName;
|
|
1207
|
-
this.type = 'html-block';
|
|
1208
|
-
this.children = [];
|
|
1209
|
-
this.htmlTag = htmlTag;
|
|
1210
|
-
}
|
|
1211
|
-
/**
|
|
1212
|
-
* Converts a VegaRTEHtmlBlock to an RTEHtmlBlock.
|
|
1213
|
-
*
|
|
1214
|
-
* @param {VegaRTEHtmlBlock} block - The VegaRTEHtmlBlock to convert.
|
|
1215
|
-
* @param {VegaRTETransformOptions} [options] - Optional transformation options.
|
|
1216
|
-
* @returns {RTEHtmlBlock} The converted RTEHtmlBlock.
|
|
1217
|
-
*/
|
|
1218
|
-
static from(block, options) {
|
|
1219
|
-
const htmlBlock = new RTEHtmlBlock(block.id, block.htmlTag);
|
|
1220
|
-
const { annotations } = block;
|
|
1221
|
-
if (annotations) {
|
|
1222
|
-
super.convertAnnotationsToMap(htmlBlock.annotationMap, annotations);
|
|
1223
|
-
}
|
|
1224
|
-
htmlBlock.children = this.generateBlockChildren(block.children, options, htmlBlock);
|
|
1225
|
-
return htmlBlock;
|
|
1226
|
-
}
|
|
1227
|
-
/**
|
|
1228
|
-
* @inheritDoc
|
|
1229
|
-
*/
|
|
1230
|
-
clone(parent) {
|
|
1231
|
-
const clonedBlock = new RTEHtmlBlock(this.id, this.htmlTag);
|
|
1232
|
-
clonedBlock.children = this.children.map((child) => child.clone(clonedBlock));
|
|
1233
|
-
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
1234
|
-
clonedBlock.parent = parent;
|
|
1235
|
-
return clonedBlock;
|
|
1236
|
-
}
|
|
1237
|
-
/**
|
|
1238
|
-
* @inheritDoc
|
|
1239
|
-
*/
|
|
1240
|
-
getLastNode() {
|
|
1241
|
-
return this.children[this.children.length - 1].getLastNode();
|
|
1242
|
-
}
|
|
1243
|
-
/**
|
|
1244
|
-
* @inheritDoc
|
|
1245
|
-
*/
|
|
1246
|
-
isNotEmpty() {
|
|
1247
|
-
// Any RTEHtmlBlock — whether void (hr, br), childless (canvas, iframe),
|
|
1248
|
-
// or with children — represents real user content. Only the default empty
|
|
1249
|
-
// text paragraph should make the editor report as empty.
|
|
1250
|
-
return true;
|
|
1251
|
-
}
|
|
1252
|
-
/**
|
|
1253
|
-
* @inheritDoc
|
|
1254
|
-
*/
|
|
1255
|
-
toHtml(options) {
|
|
1256
|
-
const BlockTag = this.htmlTag;
|
|
1257
|
-
const attrStr = super.generateAttributeString(options);
|
|
1258
|
-
// Handle void/self-closing tags (hr, input, col, etc.)
|
|
1259
|
-
// Uses HTML5 syntax without self-closing slash for consistency with img and br tags
|
|
1260
|
-
if (codeBlock.HTML_VOID_TAGS.has(this.htmlTag)) {
|
|
1261
|
-
return `<${BlockTag}${attrStr}>`;
|
|
1262
|
-
}
|
|
1263
|
-
// Handle normal tags with children
|
|
1264
|
-
return [
|
|
1265
|
-
`<${BlockTag}${attrStr}>`,
|
|
1266
|
-
this.children.map((block) => block.toHtml(options)).join(''),
|
|
1267
|
-
`</${BlockTag}>`,
|
|
1268
|
-
].join('');
|
|
1269
|
-
}
|
|
1270
|
-
/**
|
|
1271
|
-
* @inheritDoc
|
|
1272
|
-
*/
|
|
1273
|
-
toJSON() {
|
|
1274
|
-
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, htmlTag: this.htmlTag, children: this.children.map((child) => child.toJSON()) });
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
RTEHtmlBlock.dtoName = 'RTEHtmlBlock';
|
|
1278
|
-
|
|
1279
760
|
/**
|
|
1280
761
|
* Merge the two blocks node into first block if the two blocks nodes type is same(text node or image node)
|
|
1281
762
|
*
|
|
@@ -1327,6 +808,8 @@ class BlockDeleteTextOrDecoratorNodeStrategy extends codeBlock.BlockDeleteNodeCo
|
|
|
1327
808
|
return;
|
|
1328
809
|
}
|
|
1329
810
|
else {
|
|
811
|
+
const nodeIndex = target.children.indexOf(startContainerNode);
|
|
812
|
+
const nextSiblingNode = target.children[nodeIndex + 1];
|
|
1330
813
|
const previousNode = this.getPreviousNode(startContainerNode);
|
|
1331
814
|
// Remove the last character will not delete paragraph, the paragraph will removed after press delete again
|
|
1332
815
|
if ((previousNode && previousNode.parent === target && previousNode['text'] === '\n') ||
|
|
@@ -1336,7 +819,14 @@ class BlockDeleteTextOrDecoratorNodeStrategy extends codeBlock.BlockDeleteNodeCo
|
|
|
1336
819
|
}
|
|
1337
820
|
else {
|
|
1338
821
|
target.apply(new codeBlock.RemoveChildrenAction(startContainerNode));
|
|
1339
|
-
|
|
822
|
+
// If this was the first node, the previous node may belong to an ancestor list
|
|
823
|
+
// item. Keep the caret at the deletion boundary before the surviving sibling.
|
|
824
|
+
if (nextSiblingNode && (previousNode === null || previousNode === void 0 ? void 0 : previousNode.parent) !== target) {
|
|
825
|
+
action.nextNode = nextSiblingNode;
|
|
826
|
+
}
|
|
827
|
+
else {
|
|
828
|
+
action.previousNode = previousNode;
|
|
829
|
+
}
|
|
1340
830
|
return;
|
|
1341
831
|
}
|
|
1342
832
|
}
|
|
@@ -1714,19 +1204,6 @@ class ListItemInsertNewParagraphStrategy extends codeBlock.ActionHandleStrategy
|
|
|
1714
1204
|
}
|
|
1715
1205
|
}
|
|
1716
1206
|
|
|
1717
|
-
/**
|
|
1718
|
-
* Delete the nest list block action
|
|
1719
|
-
*
|
|
1720
|
-
* @example needRemovedNestList.parent.apply(new RemoveNestListAction(needRemovedNestList))
|
|
1721
|
-
*/
|
|
1722
|
-
class RemoveNestListAction extends codeBlock.ModifyContentAction {
|
|
1723
|
-
constructor(childList) {
|
|
1724
|
-
super();
|
|
1725
|
-
this.type = codeBlock.ModifyContentActionType.DELETE_NEST_LIST;
|
|
1726
|
-
this.nestListBlockToBeRemoved = childList;
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
1207
|
/**
|
|
1731
1208
|
* List remove list item strategy.
|
|
1732
1209
|
*/
|
|
@@ -1738,18 +1215,94 @@ class ListRemoveListItemStrategy extends codeBlock.RemoveChildrenStrategy {
|
|
|
1738
1215
|
* @param {RTEListBlock} target - The list block.
|
|
1739
1216
|
*/
|
|
1740
1217
|
handleAction(action, target) {
|
|
1218
|
+
var _a, _b;
|
|
1219
|
+
const removingListItem = action.entityToBeRemoved instanceof codeBlock.RTEListItemBlock ? action.entityToBeRemoved : null;
|
|
1220
|
+
const removingIndex = removingListItem ? target.children.indexOf(removingListItem) : -1;
|
|
1221
|
+
if (((_a = removingListItem === null || removingListItem === void 0 ? void 0 : removingListItem.nestList) === null || _a === void 0 ? void 0 : _a.length) && removingIndex >= 0) {
|
|
1222
|
+
this.promoteNestListsToUpperLevel(removingListItem, target, removingIndex);
|
|
1223
|
+
}
|
|
1741
1224
|
super.handleAction(action, target);
|
|
1742
1225
|
const parent = target.parent;
|
|
1743
1226
|
if (target.children.length === 0 && parent) {
|
|
1744
1227
|
// The parent is a list item mean the current block is a nest list, so we need to use RemoveNestListAction to remove the item
|
|
1745
1228
|
if (parent['type'] === 'list-item') {
|
|
1746
|
-
parent
|
|
1229
|
+
const parentListItem = parent;
|
|
1230
|
+
if ((_b = parentListItem.nestList) === null || _b === void 0 ? void 0 : _b.includes(target)) {
|
|
1231
|
+
parentListItem.apply(new codeBlock.RemoveNestListAction(target));
|
|
1232
|
+
}
|
|
1747
1233
|
}
|
|
1748
1234
|
else {
|
|
1749
1235
|
parent.apply(new codeBlock.RemoveChildrenAction(target));
|
|
1750
1236
|
}
|
|
1751
1237
|
}
|
|
1752
1238
|
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Promote nested lists of the list item being removed by one level.
|
|
1241
|
+
*
|
|
1242
|
+
* Same-type nested lists are flattened into the current (target) list to avoid
|
|
1243
|
+
* creating redundant list wrappers. Different-type nested lists stay nested under
|
|
1244
|
+
* the parent list item as siblings of the target list, positioned relative to the
|
|
1245
|
+
* target so document order is preserved. When the parent is the root content, the
|
|
1246
|
+
* different-type lists are inserted right after the target list instead.
|
|
1247
|
+
*
|
|
1248
|
+
* @param {RTEListItemBlock} removingListItem - The list item being removed.
|
|
1249
|
+
* @param {RTEListBlock} target - The list currently containing the item.
|
|
1250
|
+
* @param {number} removingIndex - The original index of the removing item.
|
|
1251
|
+
*/
|
|
1252
|
+
promoteNestListsToUpperLevel(removingListItem, target, removingIndex) {
|
|
1253
|
+
var _a, _b;
|
|
1254
|
+
const promotedLists = [...((_a = removingListItem.nestList) !== null && _a !== void 0 ? _a : [])];
|
|
1255
|
+
let insertionIndex = removingIndex + 1;
|
|
1256
|
+
const differentTypeLists = [];
|
|
1257
|
+
promotedLists.forEach((listBlock) => {
|
|
1258
|
+
if (listBlock.type === target.type) {
|
|
1259
|
+
const promotedItems = [...listBlock.children];
|
|
1260
|
+
if (promotedItems.length > 0) {
|
|
1261
|
+
promotedItems.forEach((item) => {
|
|
1262
|
+
item.parent = target;
|
|
1263
|
+
});
|
|
1264
|
+
target.children.splice(insertionIndex, 0, ...promotedItems);
|
|
1265
|
+
insertionIndex += promotedItems.length;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
else {
|
|
1269
|
+
differentTypeLists.push(listBlock);
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
const parent = target.parent;
|
|
1273
|
+
if (differentTypeLists.length > 0 && parent instanceof codeBlock.RTEListItemBlock) {
|
|
1274
|
+
// Different-type promoted lists stay nested under the parent item, as siblings
|
|
1275
|
+
// of the target list. When the removed item was merged into the parent, its
|
|
1276
|
+
// own nested lists follow it up one level and belong to the parent item — not
|
|
1277
|
+
// flattened into the grandparent list. Position them relative to the target so
|
|
1278
|
+
// document order is preserved.
|
|
1279
|
+
const currentNestLists = [...((_b = parent.nestList) !== null && _b !== void 0 ? _b : [])];
|
|
1280
|
+
const targetIndex = currentNestLists.indexOf(target);
|
|
1281
|
+
if (targetIndex >= 0) {
|
|
1282
|
+
// When removing the first item, its nested lists were visually above the
|
|
1283
|
+
// remaining items, so they must be placed before the target list to
|
|
1284
|
+
// preserve document order.
|
|
1285
|
+
const insertAt = removingIndex === 0 ? targetIndex : targetIndex + 1;
|
|
1286
|
+
currentNestLists.splice(insertAt, 0, ...differentTypeLists);
|
|
1287
|
+
}
|
|
1288
|
+
else {
|
|
1289
|
+
currentNestLists.push(...differentTypeLists);
|
|
1290
|
+
}
|
|
1291
|
+
parent.apply(new codeBlock.ReplaceNestListAction(currentNestLists));
|
|
1292
|
+
}
|
|
1293
|
+
else if (differentTypeLists.length > 0) {
|
|
1294
|
+
// Mirror the nested-parent ordering rule: when removing the first item,
|
|
1295
|
+
// its nested lists were visually above the remaining items, so insert
|
|
1296
|
+
// before the target to preserve document order.
|
|
1297
|
+
if (removingIndex === 0) {
|
|
1298
|
+
parent.apply(new codeBlock.InsertChildrenBeforeAction(target, ...differentTypeLists));
|
|
1299
|
+
}
|
|
1300
|
+
else {
|
|
1301
|
+
parent.apply(new codeBlock.InsertChildrenAfterAction(target, ...differentTypeLists));
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
removingListItem.apply(new codeBlock.ReplaceNestListAction([]));
|
|
1305
|
+
}
|
|
1753
1306
|
}
|
|
1754
1307
|
|
|
1755
1308
|
/** Handles pasted content in a block. */
|
|
@@ -1841,14 +1394,14 @@ class RTEDTOActionStrategyManager {
|
|
|
1841
1394
|
* @param {string} dtoClassName - The name of the RTE block class name.
|
|
1842
1395
|
*/
|
|
1843
1396
|
registerBlockBasicStrategies(dtoClassName) {
|
|
1844
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_CHILDREN, dtoClassName, dtoClassName === RTEListBlock.name
|
|
1397
|
+
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_CHILDREN, dtoClassName, dtoClassName === codeBlock.RTEListBlock.name
|
|
1845
1398
|
? new ListRemoveListItemStrategy()
|
|
1846
1399
|
: new codeBlock.RemoveChildrenStrategy());
|
|
1847
1400
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.APPEND_CHILDREN, dtoClassName, new AppendChildrenStrategy());
|
|
1848
1401
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, dtoClassName, new InsertChildrenBeforeStrategy());
|
|
1849
1402
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_AFTER, dtoClassName, new InsertChildrenAfterStrategy());
|
|
1850
1403
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_BLOCK_CONTENT, dtoClassName, new BlockDeleteTextOrDecoratorNodeStrategy());
|
|
1851
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, dtoClassName, dtoClassName === RTEListItemBlock.name
|
|
1404
|
+
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, dtoClassName, dtoClassName === codeBlock.RTEListItemBlock.name
|
|
1852
1405
|
? new ListItemInsertNewParagraphStrategy()
|
|
1853
1406
|
: new BlockInsertNewParagraphStrategy());
|
|
1854
1407
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_TEXT_TO_DECORATOR_NODE, dtoClassName, new InsertTextToDecoratorNodeStrategy());
|
|
@@ -2957,7 +2510,7 @@ class HtmlBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
2957
2510
|
*/
|
|
2958
2511
|
handle(elementsArray, options) {
|
|
2959
2512
|
const element = elementsArray[0];
|
|
2960
|
-
return RTEHtmlBlock.from(this.generateHtmlBlock(element, options), options);
|
|
2513
|
+
return codeBlock.RTEHtmlBlock.from(this.generateHtmlBlock(element, options), options);
|
|
2961
2514
|
}
|
|
2962
2515
|
/**
|
|
2963
2516
|
* @inheritDoc
|
|
@@ -3077,7 +2630,7 @@ class HtmlBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3077
2630
|
id: misc.generateUUID(),
|
|
3078
2631
|
type: 'html-block',
|
|
3079
2632
|
htmlTag: element.nodeName.toLowerCase(),
|
|
3080
|
-
annotations: htmlElementToAnnotationGenerator.generate(RTEHtmlBlock, element, options),
|
|
2633
|
+
annotations: htmlElementToAnnotationGenerator.generate(codeBlock.RTEHtmlBlock, element, options),
|
|
3081
2634
|
children: [],
|
|
3082
2635
|
};
|
|
3083
2636
|
}
|
|
@@ -3105,11 +2658,11 @@ class UlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3105
2658
|
handle(elementsArray, options) {
|
|
3106
2659
|
if (elementsArray[0].childNodes.length === 0)
|
|
3107
2660
|
return null;
|
|
3108
|
-
return RTEListBlock.from({
|
|
2661
|
+
return codeBlock.RTEListBlock.from({
|
|
3109
2662
|
id: misc.generateUUID(),
|
|
3110
2663
|
type: 'bullet-list',
|
|
3111
2664
|
blocks: [],
|
|
3112
|
-
annotations: htmlElementToAnnotationGenerator.generate(RTEListBlock, elementsArray[0], options),
|
|
2665
|
+
annotations: htmlElementToAnnotationGenerator.generate(codeBlock.RTEListBlock, elementsArray[0], options),
|
|
3113
2666
|
}, options);
|
|
3114
2667
|
}
|
|
3115
2668
|
/**
|
|
@@ -3119,7 +2672,7 @@ class UlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3119
2672
|
* @param {RTEContentBlock[]} childBlocks - Current list item blocks.
|
|
3120
2673
|
*/
|
|
3121
2674
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
3122
|
-
currentBlock.children = childBlocks.filter((block) => block instanceof RTEListItemBlock);
|
|
2675
|
+
currentBlock.children = childBlocks.filter((block) => block instanceof codeBlock.RTEListItemBlock);
|
|
3123
2676
|
childBlocks.forEach((block) => (block.parent = currentBlock));
|
|
3124
2677
|
}
|
|
3125
2678
|
/**
|
|
@@ -3154,11 +2707,11 @@ class OlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3154
2707
|
handle(elementsArray, options) {
|
|
3155
2708
|
if (elementsArray[0].childNodes.length === 0)
|
|
3156
2709
|
return null;
|
|
3157
|
-
return RTEListBlock.from({
|
|
2710
|
+
return codeBlock.RTEListBlock.from({
|
|
3158
2711
|
id: misc.generateUUID(),
|
|
3159
2712
|
type: 'number-list',
|
|
3160
2713
|
blocks: [],
|
|
3161
|
-
annotations: htmlElementToAnnotationGenerator.generate(RTEListBlock, elementsArray[0], options),
|
|
2714
|
+
annotations: htmlElementToAnnotationGenerator.generate(codeBlock.RTEListBlock, elementsArray[0], options),
|
|
3162
2715
|
}, options);
|
|
3163
2716
|
}
|
|
3164
2717
|
/**
|
|
@@ -3168,7 +2721,7 @@ class OlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3168
2721
|
* @param {RTEContentBlock[]} childBlocks - Current list item blocks.
|
|
3169
2722
|
*/
|
|
3170
2723
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
3171
|
-
currentBlock.children = childBlocks.filter((block) => block instanceof RTEListItemBlock);
|
|
2724
|
+
currentBlock.children = childBlocks.filter((block) => block instanceof codeBlock.RTEListItemBlock);
|
|
3172
2725
|
childBlocks.forEach((block) => (block.parent = currentBlock));
|
|
3173
2726
|
}
|
|
3174
2727
|
/**
|
|
@@ -3209,7 +2762,7 @@ class ULNotLiChildToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbst
|
|
|
3209
2762
|
*/
|
|
3210
2763
|
handle(elementsArray, options) {
|
|
3211
2764
|
const nodes = this.generateChildNodes(elementsArray, {}, options);
|
|
3212
|
-
return RTEListItemBlock.from({
|
|
2765
|
+
return codeBlock.RTEListItemBlock.from({
|
|
3213
2766
|
id: misc.generateUUID(),
|
|
3214
2767
|
type: 'list-item',
|
|
3215
2768
|
nodes: nodes,
|
|
@@ -3271,7 +2824,7 @@ class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3271
2824
|
if (!['UL', 'OL'].includes(parent.nodeName)) {
|
|
3272
2825
|
return this.generateWithListBlock(elementsArray, options);
|
|
3273
2826
|
}
|
|
3274
|
-
return RTEListItemBlock.from(this.generateListItemBlockDTO(firstElement, options), options);
|
|
2827
|
+
return codeBlock.RTEListItemBlock.from(this.generateListItemBlockDTO(firstElement, options), options);
|
|
3275
2828
|
}
|
|
3276
2829
|
/**
|
|
3277
2830
|
* Append child list blocks to current list item block.
|
|
@@ -3281,6 +2834,8 @@ class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3281
2834
|
*/
|
|
3282
2835
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
3283
2836
|
currentBlock.nestList = childBlocks.filter((block) => ['bullet-list', 'number-list'].includes(block.type));
|
|
2837
|
+
// Maintain bidirectional parent link so that nested list blocks can traverse up to the list item.
|
|
2838
|
+
currentBlock.nestList.forEach((block) => (block.parent = currentBlock));
|
|
3284
2839
|
}
|
|
3285
2840
|
/**
|
|
3286
2841
|
* Should continue process to child elements.
|
|
@@ -3298,7 +2853,7 @@ class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3298
2853
|
* @returns {RTEListBlock} - List block DTO.
|
|
3299
2854
|
*/
|
|
3300
2855
|
generateWithListBlock(elements, options) {
|
|
3301
|
-
return RTEListBlock.from({
|
|
2856
|
+
return codeBlock.RTEListBlock.from({
|
|
3302
2857
|
id: misc.generateUUID(),
|
|
3303
2858
|
type: 'bullet-list',
|
|
3304
2859
|
blocks: elements.map((item) => {
|
|
@@ -3317,7 +2872,7 @@ class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3317
2872
|
return {
|
|
3318
2873
|
id: misc.generateUUID(),
|
|
3319
2874
|
type: 'list-item',
|
|
3320
|
-
annotations: htmlElementToAnnotationGenerator.generate(RTEListItemBlock, element, options),
|
|
2875
|
+
annotations: htmlElementToAnnotationGenerator.generate(codeBlock.RTEListItemBlock, element, options),
|
|
3321
2876
|
nodes: this.generateChildNodes(Array.from(element.childNodes.length ? element.childNodes : [element]).filter((item) => {
|
|
3322
2877
|
return !['UL', 'OL'].includes(item.nodeName);
|
|
3323
2878
|
}), htmlElementToAnnotationGenerator.generate(codeBlock.RTETextNode, element, Object.assign(Object.assign({}, options), { skipCustomAnnotations: true })), options),
|
|
@@ -3989,7 +3544,7 @@ class ImageFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
|
3989
3544
|
class ListBlockFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
3990
3545
|
constructor() {
|
|
3991
3546
|
super(...arguments);
|
|
3992
|
-
this.stylesToBeFiltered = ListAnnotation.getDefaultStyles();
|
|
3547
|
+
this.stylesToBeFiltered = codeBlock.ListAnnotation.getDefaultStyles();
|
|
3993
3548
|
this.elementTagName = 'ol,ul';
|
|
3994
3549
|
}
|
|
3995
3550
|
/**
|
|
@@ -4008,11 +3563,15 @@ class ListBlockFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
|
4008
3563
|
* @inheritDoc
|
|
4009
3564
|
*/
|
|
4010
3565
|
toCssText() {
|
|
4011
|
-
const
|
|
4012
|
-
|
|
4013
|
-
|
|
3566
|
+
const containerClass = codeBlock.RTEFilterStylesStrategy.RTE_CONTENT_CONTAINER_CLASS_NAME;
|
|
3567
|
+
const tags = this.elementTagName.split(',').map((tag) => tag.trim());
|
|
3568
|
+
const baseSelector = tags.map((tag) => `.${containerClass} ${tag}`).join(', ');
|
|
3569
|
+
const markerSelector = tags
|
|
3570
|
+
.map((tag) => `.${containerClass} ${tag} > li::marker`)
|
|
4014
3571
|
.join(', ');
|
|
4015
|
-
|
|
3572
|
+
const markerStyles = this.convertStylesMapToCssText(codeBlock.ListAnnotation.getDefaultMarkerStyles());
|
|
3573
|
+
return (`${baseSelector} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} } ` +
|
|
3574
|
+
`${markerSelector} { ${markerStyles} }`);
|
|
4016
3575
|
}
|
|
4017
3576
|
}
|
|
4018
3577
|
|
|
@@ -4495,21 +4054,21 @@ codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-4', codeBlock.RTETextB
|
|
|
4495
4054
|
codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-5', codeBlock.RTETextBlock);
|
|
4496
4055
|
codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-6', codeBlock.RTETextBlock);
|
|
4497
4056
|
codeBlock.RTEDTOClassManager.registerRTEDTOClass('heading-6', codeBlock.RTETextBlock);
|
|
4498
|
-
codeBlock.RTEDTOClassManager.registerRTEDTOClass('list-item', RTEListItemBlock);
|
|
4499
|
-
codeBlock.RTEDTOClassManager.registerRTEDTOClass('bullet-list', RTEListBlock);
|
|
4500
|
-
codeBlock.RTEDTOClassManager.registerRTEDTOClass('number-list', RTEListBlock);
|
|
4057
|
+
codeBlock.RTEDTOClassManager.registerRTEDTOClass('list-item', codeBlock.RTEListItemBlock);
|
|
4058
|
+
codeBlock.RTEDTOClassManager.registerRTEDTOClass('bullet-list', codeBlock.RTEListBlock);
|
|
4059
|
+
codeBlock.RTEDTOClassManager.registerRTEDTOClass('number-list', codeBlock.RTEListBlock);
|
|
4501
4060
|
codeBlock.RTEDTOClassManager.registerRTEDTOClass('image', RTEImageBlock);
|
|
4502
4061
|
codeBlock.RTEDTOClassManager.registerRTEDTOClass('code-block', codeBlock.RTECodeBlock);
|
|
4503
|
-
codeBlock.RTEDTOClassManager.registerRTEDTOClass('html-block', RTEHtmlBlock);
|
|
4062
|
+
codeBlock.RTEDTOClassManager.registerRTEDTOClass('html-block', codeBlock.RTEHtmlBlock);
|
|
4504
4063
|
// Register the default node DTOs
|
|
4505
4064
|
codeBlock.RTEDTOClassManager.registerRTEDTOClass('text', codeBlock.RTETextNode);
|
|
4506
4065
|
codeBlock.RTEDTOClassManager.registerRTEDTOClass('image', RTEImageNode);
|
|
4507
4066
|
// Register basic strategies for default block DTOs
|
|
4508
4067
|
RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(codeBlock.RTETextBlock.name);
|
|
4509
|
-
RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(RTEListBlock.name);
|
|
4510
|
-
RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(RTEListItemBlock.name);
|
|
4068
|
+
RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(codeBlock.RTEListBlock.name);
|
|
4069
|
+
RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(codeBlock.RTEListItemBlock.name);
|
|
4511
4070
|
RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(RTEImageBlock.name);
|
|
4512
|
-
RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(RTEHtmlBlock.name);
|
|
4071
|
+
RTEDTOActionStrategyManager$1.registerBlockBasicStrategies(codeBlock.RTEHtmlBlock.name);
|
|
4513
4072
|
// Register element to DTO strategies for default node DTOs, The order of registration matters, the later registered strategy has higher priority.
|
|
4514
4073
|
ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new ContinueInlineToRTETextBlockStrategy());
|
|
4515
4074
|
ElementToDTOClassStrategyManager.registerElementToBlockStrategy(new SpanImageToRTEImageBlockStrategy());
|
|
@@ -4528,8 +4087,8 @@ ElementToDTOClassStrategyManager.registerElementToNodeStrategy(new InlineElement
|
|
|
4528
4087
|
ElementToDTOClassStrategyManager.registerElementToNodeStrategy(new PlainTextToTextNodeStrategy());
|
|
4529
4088
|
// Register filter styles strategies (remove redundant default styles during HTML → DTO conversion)
|
|
4530
4089
|
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextBlock.dtoName, new AlignmentFilterStylesStrategy());
|
|
4531
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListBlock.dtoName, new AlignmentFilterStylesStrategy());
|
|
4532
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new AlignmentFilterStylesStrategy());
|
|
4090
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListBlock.dtoName, new AlignmentFilterStylesStrategy());
|
|
4091
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new AlignmentFilterStylesStrategy());
|
|
4533
4092
|
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextNode.dtoName, new TextFormatFilterStylesStrategy());
|
|
4534
4093
|
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextBlock.dtoName, new ParagraphFilterStylesStrategy());
|
|
4535
4094
|
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextBlock.dtoName, new HeadingFilterStylesStrategy(1));
|
|
@@ -4546,16 +4105,16 @@ codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTETextNode.dtoName
|
|
|
4546
4105
|
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEImageNode.dtoName, new ImageFilterStylesStrategy());
|
|
4547
4106
|
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTECodeBlock.dtoName, new codeBlock.CodeBlockFilterStylesStrategy());
|
|
4548
4107
|
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTECodeBlockNode.dtoName, new codeBlock.CodeBlockNodeFilterStylesStrategy());
|
|
4549
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListBlock.dtoName, new ListBlockFilterStylesStrategy());
|
|
4550
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListItemBlockFilterStylesStrategy());
|
|
4551
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(1));
|
|
4552
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(2));
|
|
4553
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(3));
|
|
4554
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(4));
|
|
4555
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(5));
|
|
4556
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(6));
|
|
4557
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListTitleItemBlockFilterStylesStrategy('title'));
|
|
4558
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(RTEListItemBlock.dtoName, new ListTitleItemBlockFilterStylesStrategy('subtitle'));
|
|
4108
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListBlock.dtoName, new ListBlockFilterStylesStrategy());
|
|
4109
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListItemBlockFilterStylesStrategy());
|
|
4110
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(1));
|
|
4111
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(2));
|
|
4112
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(3));
|
|
4113
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(4));
|
|
4114
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(5));
|
|
4115
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListHeadingItemBlockFilterStylesStrategy(6));
|
|
4116
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListTitleItemBlockFilterStylesStrategy('title'));
|
|
4117
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(codeBlock.RTEListItemBlock.dtoName, new ListTitleItemBlockFilterStylesStrategy('subtitle'));
|
|
4559
4118
|
|
|
4560
4119
|
/**
|
|
4561
4120
|
* StylePreservator handles CSP-compliant style management by temporarily converting
|
|
@@ -4987,14 +4546,19 @@ class VegaRTEContent {
|
|
|
4987
4546
|
/**
|
|
4988
4547
|
* Convert text to list.
|
|
4989
4548
|
*
|
|
4990
|
-
* @param {RTETextBlock} block -
|
|
4549
|
+
* @param {RTETextBlock | RTEListItemBlock} block - Block to convert or rebuild.
|
|
4991
4550
|
* @returns {RTEListItemBlock} list item block dto.
|
|
4992
4551
|
*/
|
|
4993
4552
|
toListItem(block) {
|
|
4553
|
+
var _a;
|
|
4994
4554
|
block.children.map((node) => node.apply(new codeBlock.SyncUpSelectionAction()));
|
|
4995
|
-
const listItemBlock = new RTEListItemBlock(misc.generateUUID());
|
|
4555
|
+
const listItemBlock = new codeBlock.RTEListItemBlock(misc.generateUUID());
|
|
4996
4556
|
listItemBlock.apply(new codeBlock.AppendChildrenAction(block['children']));
|
|
4997
4557
|
listItemBlock['annotationMap'] = block['annotationMap'];
|
|
4558
|
+
if (block instanceof codeBlock.RTEListItemBlock && ((_a = block.nestList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
4559
|
+
listItemBlock.apply(new codeBlock.ReplaceNestListAction([...block.nestList]));
|
|
4560
|
+
block.apply(new codeBlock.ReplaceNestListAction([]));
|
|
4561
|
+
}
|
|
4998
4562
|
return listItemBlock;
|
|
4999
4563
|
}
|
|
5000
4564
|
/**
|
|
@@ -5004,7 +4568,7 @@ class VegaRTEContent {
|
|
|
5004
4568
|
* @returns {RTEListBlock} list block dto.
|
|
5005
4569
|
*/
|
|
5006
4570
|
createList(type) {
|
|
5007
|
-
return new RTEListBlock(misc.generateUUID(), type);
|
|
4571
|
+
return new codeBlock.RTEListBlock(misc.generateUUID(), type);
|
|
5008
4572
|
}
|
|
5009
4573
|
/**
|
|
5010
4574
|
* Finds a node by its ID in the content.
|
|
@@ -5031,7 +4595,7 @@ class VegaRTEContent {
|
|
|
5031
4595
|
}
|
|
5032
4596
|
}
|
|
5033
4597
|
}
|
|
5034
|
-
if (block instanceof RTEListItemBlock && block.nestList) {
|
|
4598
|
+
if (block instanceof codeBlock.RTEListItemBlock && block.nestList) {
|
|
5035
4599
|
for (const cBlock of block.nestList) {
|
|
5036
4600
|
const foundNode = this.findNodeInBlocksById(id, cBlock.children);
|
|
5037
4601
|
if (foundNode) {
|
|
@@ -5039,7 +4603,7 @@ class VegaRTEContent {
|
|
|
5039
4603
|
}
|
|
5040
4604
|
}
|
|
5041
4605
|
}
|
|
5042
|
-
if (block instanceof RTEListBlock && block.children) {
|
|
4606
|
+
if (block instanceof codeBlock.RTEListBlock && block.children) {
|
|
5043
4607
|
const foundNode = this.findNodeInBlocksById(id, block.children);
|
|
5044
4608
|
if (foundNode) {
|
|
5045
4609
|
return foundNode;
|
|
@@ -5074,8 +4638,6 @@ exports.PasteContentStrategy = PasteContentStrategy;
|
|
|
5074
4638
|
exports.RTEDTOActionStrategyManager = RTEDTOActionStrategyManager$1;
|
|
5075
4639
|
exports.RTEImageBlock = RTEImageBlock;
|
|
5076
4640
|
exports.RTEImageNode = RTEImageNode;
|
|
5077
|
-
exports.RTEListBlock = RTEListBlock;
|
|
5078
|
-
exports.RTEListItemBlock = RTEListItemBlock;
|
|
5079
4641
|
exports.StylePreservator = StylePreservator;
|
|
5080
4642
|
exports.UpdateCursorPositionAction = UpdateCursorPositionAction;
|
|
5081
4643
|
exports.VegaRTEContent = VegaRTEContent;
|