@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
|
@@ -3,50 +3,416 @@ import { AppendChildrenAction } from '../../actions/append-child-nodes-action';
|
|
|
3
3
|
import { InsertChildrenAfterAction } from '../../actions/insert-children-after-block';
|
|
4
4
|
import { InsertChildrenBeforeAction } from '../../actions/insert-children-before-block';
|
|
5
5
|
import { RemoveChildrenAction } from '../../actions/remove-child-action';
|
|
6
|
+
import { ReplaceNestListAction } from '../../actions/replace-nest-list-action';
|
|
6
7
|
import { SyncUpSelectionAction } from '../../actions/sync-up-selection-action';
|
|
8
|
+
import { TransformParagraphAction } from '../../actions/transform-paragraph-action';
|
|
9
|
+
import { RTEHtmlBlock } from '../../blocks/html-block';
|
|
10
|
+
import { RTEListBlock } from '../../blocks/list-block';
|
|
11
|
+
import { RTEListItemBlock } from '../../blocks/list-item-block';
|
|
7
12
|
import { RTETextBlock } from '../../blocks/text-block';
|
|
8
|
-
import {
|
|
13
|
+
import { ListAnnotationStrategy } from './list-annotation-strategy.abstract';
|
|
9
14
|
/**
|
|
10
15
|
* Convert the selected list block to paragraph strategy.
|
|
11
16
|
*/
|
|
12
|
-
export class ListTransformToParagraphStrategy extends
|
|
17
|
+
export class ListTransformToParagraphStrategy extends ListAnnotationStrategy {
|
|
13
18
|
/**
|
|
14
19
|
* @inheritDoc
|
|
15
20
|
*/
|
|
16
21
|
handleAction(action, target) {
|
|
22
|
+
const selectedSegments = this.getSelectedSegments(action.selectedBlocks);
|
|
23
|
+
if (selectedSegments.length === 0 || !this.hasConsistentTargetAndRoot(selectedSegments, target)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.syncSelection(selectedSegments);
|
|
27
|
+
[...selectedSegments]
|
|
28
|
+
.reverse()
|
|
29
|
+
.forEach((segment) => this.transformSegment(segment));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Ensure the action is applied to the first selected item's parent list and
|
|
33
|
+
* every selected item belongs to the same editor content.
|
|
34
|
+
*
|
|
35
|
+
* @param {RTEListItemBlock[][]} selectedSegments - Normalized selection segments.
|
|
36
|
+
* @param {RTEListBlock} target - List receiving the transform action.
|
|
37
|
+
* @returns {boolean} Whether the target and root content are consistent.
|
|
38
|
+
*/
|
|
39
|
+
hasConsistentTargetAndRoot(selectedSegments, target) {
|
|
40
|
+
if (selectedSegments[0][0].parent !== target) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const targetRoot = this.getRootContent(target);
|
|
44
|
+
return Boolean(targetRoot &&
|
|
45
|
+
selectedSegments.every((segment) => segment.every((item) => this.getRootContent(item) === targetRoot)));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Capture selected text nodes in document order before reverse-order tree
|
|
49
|
+
* mutations move them into paragraphs.
|
|
50
|
+
*
|
|
51
|
+
* @param {RTEListItemBlock[][]} selectedSegments - Normalized selection segments.
|
|
52
|
+
*/
|
|
53
|
+
syncSelection(selectedSegments) {
|
|
54
|
+
selectedSegments.forEach((segment) => {
|
|
55
|
+
segment.forEach((block) => {
|
|
56
|
+
block.children.forEach((node) => node.apply(new SyncUpSelectionAction()));
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Transform one normalized segment without recursively dispatching another
|
|
62
|
+
* flushable action.
|
|
63
|
+
*
|
|
64
|
+
* @param {RTEListItemBlock[]} segment - Contiguous items sharing one parent list.
|
|
65
|
+
*/
|
|
66
|
+
transformSegment(segment) {
|
|
67
|
+
const segmentTarget = segment[0].parent;
|
|
68
|
+
const normalizedAction = new TransformParagraphAction(segment);
|
|
69
|
+
if (segmentTarget.parent instanceof RTEListItemBlock) {
|
|
70
|
+
this.handleNestedListCase(normalizedAction, segmentTarget);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this.handleRootListCase(normalizedAction, segmentTarget);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Handle the case where the target list is at root level (parent is VegaRTEContent).
|
|
77
|
+
*
|
|
78
|
+
* @param {TransformParagraphAction} action - The paragraph transform action.
|
|
79
|
+
* @param {RTEListBlock} target - The root list being transformed.
|
|
80
|
+
*/
|
|
81
|
+
handleRootListCase(action, target) {
|
|
82
|
+
// handleAction validates that the target belongs to an editor content root.
|
|
83
|
+
const rootContent = this.getRootContent(target);
|
|
17
84
|
let isSelectedFirstBlock = false;
|
|
18
85
|
let isSelectedLastBlock = false;
|
|
19
86
|
const selectedBlocks = action.selectedBlocks;
|
|
20
|
-
|
|
21
|
-
|
|
87
|
+
// Build an operation-local insertion sequence. Paragraphs are merge
|
|
88
|
+
// boundaries; only consecutive same-type promoted lists are merged.
|
|
89
|
+
const insertionBlocks = [];
|
|
90
|
+
selectedBlocks.forEach((block) => {
|
|
91
|
+
var _a;
|
|
22
92
|
if (block === target.children[0])
|
|
23
93
|
isSelectedFirstBlock = true;
|
|
24
94
|
if (block === target.children[target.children.length - 1])
|
|
25
95
|
isSelectedLastBlock = true;
|
|
26
|
-
|
|
96
|
+
insertionBlocks.push(this.toParagraph(block));
|
|
97
|
+
for (const nestList of (_a = block.nestList) !== null && _a !== void 0 ? _a : []) {
|
|
98
|
+
this.appendListBlock(insertionBlocks, nestList);
|
|
99
|
+
}
|
|
27
100
|
});
|
|
28
101
|
if (isSelectedFirstBlock) {
|
|
29
|
-
target.parent.apply(new InsertChildrenBeforeAction(target, ...
|
|
102
|
+
target.parent.apply(new InsertChildrenBeforeAction(target, ...insertionBlocks));
|
|
30
103
|
}
|
|
31
104
|
else if (isSelectedLastBlock) {
|
|
32
|
-
target.parent.apply(new InsertChildrenAfterAction(target, ...
|
|
105
|
+
target.parent.apply(new InsertChildrenAfterAction(target, ...insertionBlocks));
|
|
33
106
|
}
|
|
34
107
|
else {
|
|
35
108
|
const startIndex = target.children.indexOf(selectedBlocks[0]);
|
|
36
109
|
const lastIndex = target.children.indexOf(selectedBlocks[selectedBlocks.length - 1]);
|
|
37
|
-
const firstBulletList =
|
|
110
|
+
const firstBulletList = this.createListFromSource(rootContent, target);
|
|
38
111
|
firstBulletList.apply(new AppendChildrenAction(target.children.slice(0, startIndex)));
|
|
39
|
-
const lastBulletList =
|
|
112
|
+
const lastBulletList = this.createListFromSource(rootContent, target);
|
|
40
113
|
lastBulletList.apply(new AppendChildrenAction(target.children.slice(lastIndex + 1)));
|
|
41
|
-
|
|
114
|
+
// Merge last insertionBlock with lastBulletList if same type
|
|
115
|
+
const lastInsertion = insertionBlocks[insertionBlocks.length - 1];
|
|
116
|
+
if (lastInsertion instanceof RTEListBlock &&
|
|
117
|
+
lastBulletList.children.length > 0 &&
|
|
118
|
+
lastInsertion.type === lastBulletList.type &&
|
|
119
|
+
this.haveSameListAnnotations(lastInsertion, lastBulletList)) {
|
|
120
|
+
lastInsertion.apply(new AppendChildrenAction(lastBulletList.children));
|
|
121
|
+
target.parent.apply(new InsertChildrenBeforeAction(target, firstBulletList, ...insertionBlocks));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
target.parent.apply(new InsertChildrenBeforeAction(target, firstBulletList, ...insertionBlocks, lastBulletList));
|
|
125
|
+
}
|
|
42
126
|
target.parent.apply(new RemoveChildrenAction(target));
|
|
43
127
|
}
|
|
44
128
|
selectedBlocks.map((block) => {
|
|
129
|
+
// Clear nestList before removal to prevent ListRemoveListItemStrategy
|
|
130
|
+
// from promoting the same nested lists a second time.
|
|
131
|
+
block.nestList = [];
|
|
45
132
|
target.apply(new RemoveChildrenAction(block));
|
|
46
133
|
});
|
|
47
134
|
if (target.children.length === 0) {
|
|
48
135
|
target.parent.apply(new RemoveChildrenAction(target));
|
|
49
136
|
}
|
|
137
|
+
else if (isSelectedFirstBlock) {
|
|
138
|
+
// When removing the first item(s), a promoted same-type nestList (last
|
|
139
|
+
// insertionBlock) ends up immediately before the remaining target. Merge
|
|
140
|
+
// them so the user doesn't see two adjacent same-type lists.
|
|
141
|
+
const lastInserted = insertionBlocks[insertionBlocks.length - 1];
|
|
142
|
+
if (lastInserted instanceof RTEListBlock &&
|
|
143
|
+
lastInserted.type === target.type &&
|
|
144
|
+
this.haveSameListAnnotations(lastInserted, target)) {
|
|
145
|
+
lastInserted.apply(new AppendChildrenAction([...target.children]));
|
|
146
|
+
target.parent.apply(new RemoveChildrenAction(target));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Handle the case where the target list is nested (parent is RTEListItemBlock).
|
|
152
|
+
*
|
|
153
|
+
* Algorithm:
|
|
154
|
+
* 1. Build the ancestor path from root list down to the target nested list.
|
|
155
|
+
* 2. At each level on the path, collect "trailing" items (items after the ancestor).
|
|
156
|
+
* 3. Trim each list along the path to keep only the "before" portion.
|
|
157
|
+
* 4. Collect trailing items from all levels + selected item's own nestList children.
|
|
158
|
+
* 5. Group trailing items into lists by consecutive type.
|
|
159
|
+
* 6. Insert into content: [before-root-list, paragraphs, ...after-lists].
|
|
160
|
+
*
|
|
161
|
+
* @param {TransformParagraphAction} action - The paragraph transform action.
|
|
162
|
+
* @param {RTEListBlock} target - The nested list being transformed.
|
|
163
|
+
*/
|
|
164
|
+
handleNestedListCase(action, target) {
|
|
165
|
+
const selectedBlocks = action.selectedBlocks;
|
|
166
|
+
const rootContent = this.getRootContent(target);
|
|
167
|
+
const selectedItem = selectedBlocks[0];
|
|
168
|
+
const selectedIndex = target.children.indexOf(selectedItem);
|
|
169
|
+
// Emit each selected item as paragraph + its own nested lists so that
|
|
170
|
+
// selecting multiple levels never moves a child list past another paragraph.
|
|
171
|
+
const insertions = [];
|
|
172
|
+
selectedBlocks.forEach((block) => {
|
|
173
|
+
var _a;
|
|
174
|
+
insertions.push(this.toParagraph(block));
|
|
175
|
+
for (const nestList of (_a = block.nestList) !== null && _a !== void 0 ? _a : []) {
|
|
176
|
+
this.appendListBlock(insertions, nestList);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
const lastSelectedIndex = target.children.indexOf(selectedBlocks[selectedBlocks.length - 1]);
|
|
180
|
+
// Collect trailing items from the nested list (items AFTER the last selected)
|
|
181
|
+
const nestedTrailingItems = target.children.slice(lastSelectedIndex + 1);
|
|
182
|
+
const ancestorPath = [];
|
|
183
|
+
let currentList = target;
|
|
184
|
+
while (currentList.parent instanceof RTEListItemBlock) {
|
|
185
|
+
const parentItem = currentList.parent;
|
|
186
|
+
const grandParentList = parentItem.parent;
|
|
187
|
+
const ancestorIndex = grandParentList.children.indexOf(parentItem);
|
|
188
|
+
// Collect nestLists of parentItem that are AFTER currentList
|
|
189
|
+
const parentNestLists = parentItem.nestList;
|
|
190
|
+
const nestListIndex = parentNestLists.indexOf(currentList);
|
|
191
|
+
const trailingNestLists = parentNestLists.slice(nestListIndex + 1);
|
|
192
|
+
ancestorPath.push({ list: grandParentList, ancestorIndex, trailingNestLists });
|
|
193
|
+
currentList = grandParentList;
|
|
194
|
+
}
|
|
195
|
+
// currentList is now the root-level list
|
|
196
|
+
const rootList = currentList;
|
|
197
|
+
const rootContainer = rootList.parent;
|
|
198
|
+
const trailingGroups = [];
|
|
199
|
+
// 1. Trailing items from the target nested list (same type as target)
|
|
200
|
+
if (nestedTrailingItems.length > 0) {
|
|
201
|
+
trailingGroups.push({ items: nestedTrailingItems, sourceList: target });
|
|
202
|
+
}
|
|
203
|
+
// 2. Trailing nestLists from ancestors (innermost to outermost)
|
|
204
|
+
// 3. Trailing items from each ancestor level's list
|
|
205
|
+
for (const level of ancestorPath) {
|
|
206
|
+
// Trailing nestLists from the ancestor item
|
|
207
|
+
for (const trailingNest of level.trailingNestLists) {
|
|
208
|
+
if (trailingNest.children.length > 0) {
|
|
209
|
+
trailingGroups.push({ items: [...trailingNest.children], sourceList: trailingNest });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Trailing items from ancestor's list (items after the ancestor item)
|
|
213
|
+
const trailingFromLevel = level.list.children.slice(level.ancestorIndex + 1);
|
|
214
|
+
if (trailingFromLevel.length > 0) {
|
|
215
|
+
trailingGroups.push({ items: trailingFromLevel, sourceList: level.list });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// Merge only groups whose list type and container annotations match. Different
|
|
219
|
+
// class/style/attribute boundaries must survive the structural reconstruction.
|
|
220
|
+
const mergedGroups = [];
|
|
221
|
+
for (const group of trailingGroups) {
|
|
222
|
+
const prev = mergedGroups[mergedGroups.length - 1];
|
|
223
|
+
if (prev &&
|
|
224
|
+
prev.sourceList.type === group.sourceList.type &&
|
|
225
|
+
this.haveSameListAnnotations(prev.sourceList, group.sourceList)) {
|
|
226
|
+
prev.items.push(...group.items);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
mergedGroups.push({ items: [...group.items], sourceList: group.sourceList });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Build the "after" lists
|
|
233
|
+
const afterLists = mergedGroups.map((group) => {
|
|
234
|
+
const newList = this.createListFromSource(rootContent, group.sourceList);
|
|
235
|
+
newList.apply(new AppendChildrenAction(group.items));
|
|
236
|
+
return newList;
|
|
237
|
+
});
|
|
238
|
+
afterLists.forEach((list) => this.appendListBlock(insertions, list));
|
|
239
|
+
// --- Now trim the "before" portion ---
|
|
240
|
+
// Trim target nested list: keep only items before selected
|
|
241
|
+
target.children = target.children.slice(0, selectedIndex);
|
|
242
|
+
// Clean up the target nested list's parent item's nestList
|
|
243
|
+
const targetParentItem = target.parent;
|
|
244
|
+
const targetParentNestLists = targetParentItem.nestList;
|
|
245
|
+
const targetNestIndex = targetParentNestLists.indexOf(target);
|
|
246
|
+
// Keep only nestLists up to and including the target (remove trailing ones we already collected)
|
|
247
|
+
let trimmedNestList = targetParentNestLists.slice(0, targetNestIndex + 1);
|
|
248
|
+
// If target is now empty, remove it too
|
|
249
|
+
if (target.children.length === 0) {
|
|
250
|
+
trimmedNestList = trimmedNestList.filter((l) => l !== target);
|
|
251
|
+
}
|
|
252
|
+
targetParentItem.apply(new ReplaceNestListAction(trimmedNestList));
|
|
253
|
+
// Trim ancestor levels: remove trailing items and trailing nestLists
|
|
254
|
+
for (const level of ancestorPath) {
|
|
255
|
+
// Remove trailing items from the ancestor's list
|
|
256
|
+
level.list.children = level.list.children.slice(0, level.ancestorIndex + 1);
|
|
257
|
+
// Remove trailing nestLists from the ancestor item
|
|
258
|
+
if (level.trailingNestLists.length > 0) {
|
|
259
|
+
const ancestorItem = level.list.children[level.ancestorIndex];
|
|
260
|
+
const ancestorNestLists = ancestorItem.nestList;
|
|
261
|
+
const firstTrailingNestIndex = ancestorNestLists.indexOf(level.trailingNestLists[0]);
|
|
262
|
+
if (firstTrailingNestIndex >= 0) {
|
|
263
|
+
const keptNestLists = ancestorNestLists.slice(0, firstTrailingNestIndex);
|
|
264
|
+
ancestorItem.apply(new ReplaceNestListAction(keptNestLists));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
rootContainer.apply(new InsertChildrenAfterAction(rootList, ...insertions));
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Normalize selected items into document order and split them into contiguous
|
|
272
|
+
* segments that share the same immediate parent list. Unlike Shift+Tab, the
|
|
273
|
+
* toolbar action keeps selected descendants so every selected item becomes a
|
|
274
|
+
* paragraph.
|
|
275
|
+
*
|
|
276
|
+
* @param {RTEBlock[]} selectedBlocks - Raw selected blocks.
|
|
277
|
+
* @returns {RTEListItemBlock[][]} Parent-based contiguous selection segments.
|
|
278
|
+
*/
|
|
279
|
+
getSelectedSegments(selectedBlocks) {
|
|
280
|
+
const selectedItems = Array.from(new Set(selectedBlocks.filter((block) => block instanceof RTEListItemBlock)))
|
|
281
|
+
.map((item) => ({ item, path: this.getStructuralPath(item) }))
|
|
282
|
+
.filter((entry) => entry.path !== null)
|
|
283
|
+
.sort((a, b) => this.compareStructuralPaths(a.path, b.path))
|
|
284
|
+
.map((entry) => entry.item);
|
|
285
|
+
const segments = [];
|
|
286
|
+
for (const item of selectedItems) {
|
|
287
|
+
const segment = segments[segments.length - 1];
|
|
288
|
+
const previousItem = segment === null || segment === void 0 ? void 0 : segment[segment.length - 1];
|
|
289
|
+
const isContiguousSibling = (previousItem === null || previousItem === void 0 ? void 0 : previousItem.parent) === item.parent &&
|
|
290
|
+
item.parent.children.indexOf(item) - item.parent.children.indexOf(previousItem) === 1;
|
|
291
|
+
if (isContiguousSibling) {
|
|
292
|
+
segment.push(item);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
segments.push([item]);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return segments;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Resolve a list item's structural document path, including the positions of
|
|
302
|
+
* root lists, owning list items, nested lists, and the item itself.
|
|
303
|
+
*
|
|
304
|
+
* @param {RTEListItemBlock} item - Selected list item.
|
|
305
|
+
* @returns {number[] | null} Structural path, or null for a detached item.
|
|
306
|
+
*/
|
|
307
|
+
getStructuralPath(item) {
|
|
308
|
+
var _a;
|
|
309
|
+
const path = [];
|
|
310
|
+
const visitedLists = new Set();
|
|
311
|
+
let currentItem = item;
|
|
312
|
+
let currentList = item.parent;
|
|
313
|
+
while (!visitedLists.has(currentList)) {
|
|
314
|
+
visitedLists.add(currentList);
|
|
315
|
+
const itemIndex = currentList.children.indexOf(currentItem);
|
|
316
|
+
if (itemIndex < 0) {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
path.unshift(itemIndex);
|
|
320
|
+
if (currentList.parent.dtoName === 'VegaRTEContent' ||
|
|
321
|
+
currentList.parent.dtoName === 'RTEHtmlBlock') {
|
|
322
|
+
const containerPath = this.getContainerPath(currentList);
|
|
323
|
+
return containerPath ? [...containerPath, ...path] : null;
|
|
324
|
+
}
|
|
325
|
+
if (!(currentList.parent instanceof RTEListItemBlock)) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
const ownerItem = currentList.parent;
|
|
329
|
+
const nestListIndex = ((_a = ownerItem.nestList) !== null && _a !== void 0 ? _a : []).indexOf(currentList);
|
|
330
|
+
if (nestListIndex < 0) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
path.unshift(nestListIndex);
|
|
334
|
+
currentItem = ownerItem;
|
|
335
|
+
currentList = ownerItem.parent;
|
|
336
|
+
}
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Resolve a root list's path through zero or more HTML containers to the
|
|
341
|
+
* editor content.
|
|
342
|
+
*
|
|
343
|
+
* @param {RTEListBlock} rootList - List whose parent is a content container.
|
|
344
|
+
* @returns {number[] | null} Container path, or null for detached/cyclic ownership.
|
|
345
|
+
*/
|
|
346
|
+
getContainerPath(rootList) {
|
|
347
|
+
const path = [];
|
|
348
|
+
const visitedContainers = new Set();
|
|
349
|
+
let child = rootList;
|
|
350
|
+
let container = rootList.parent;
|
|
351
|
+
while (container instanceof RTEHtmlBlock) {
|
|
352
|
+
if (visitedContainers.has(container)) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
visitedContainers.add(container);
|
|
356
|
+
const childIndex = container.children.indexOf(child);
|
|
357
|
+
if (childIndex < 0) {
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
path.unshift(childIndex);
|
|
361
|
+
child = container;
|
|
362
|
+
container = container.parent;
|
|
363
|
+
}
|
|
364
|
+
const rootChildIndex = container.children.indexOf(child);
|
|
365
|
+
if (rootChildIndex < 0) {
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
path.unshift(rootChildIndex);
|
|
369
|
+
return path;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Compare two structural paths in document order.
|
|
373
|
+
*
|
|
374
|
+
* @param {number[]} firstPath - First structural path.
|
|
375
|
+
* @param {number[]} secondPath - Second structural path.
|
|
376
|
+
* @returns {number} Relative document order.
|
|
377
|
+
*/
|
|
378
|
+
compareStructuralPaths(firstPath, secondPath) {
|
|
379
|
+
const length = Math.min(firstPath.length, secondPath.length);
|
|
380
|
+
for (let index = 0; index < length; index++) {
|
|
381
|
+
if (firstPath[index] !== secondPath[index]) {
|
|
382
|
+
return firstPath[index] - secondPath[index];
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return firstPath.length - secondPath.length;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Append a list to an operation-local block sequence, merging only with the
|
|
389
|
+
* immediately preceding same-type list in that sequence.
|
|
390
|
+
*
|
|
391
|
+
* @param {RTEBlock[]} blocks - Operation-local output sequence.
|
|
392
|
+
* @param {RTEListBlock} list - List to append or merge.
|
|
393
|
+
*/
|
|
394
|
+
appendListBlock(blocks, list) {
|
|
395
|
+
const previousBlock = blocks[blocks.length - 1];
|
|
396
|
+
if (previousBlock instanceof RTEListBlock &&
|
|
397
|
+
previousBlock.type === list.type &&
|
|
398
|
+
this.haveSameListAnnotations(previousBlock, list)) {
|
|
399
|
+
previousBlock.apply(new AppendChildrenAction([...list.children]));
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
blocks.push(list);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Create a list through the content factory and retain the source list's
|
|
406
|
+
* container annotations when a structural split requires a new list block.
|
|
407
|
+
*
|
|
408
|
+
* @param {VegaRTEContent} rootContent - Editor content that owns the factory.
|
|
409
|
+
* @param {RTEListBlock} source - List whose type and annotations should be retained.
|
|
410
|
+
* @returns {RTEListBlock} Newly created list shell.
|
|
411
|
+
*/
|
|
412
|
+
createListFromSource(rootContent, source) {
|
|
413
|
+
const list = rootContent.createList(source.type);
|
|
414
|
+
this.copyListAnnotations(source, list);
|
|
415
|
+
return list;
|
|
50
416
|
}
|
|
51
417
|
/**
|
|
52
418
|
* Converts a RTEListItemBlock to a RTETextBlock representing a paragraph.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { generateUUID } from '../../../../../utils/misc';
|
|
2
|
+
import { SyncUpSelectionAction } from '../../actions/sync-up-selection-action';
|
|
3
|
+
import { RemoveNestListAction } from '../../actions/remove-nest-list-action';
|
|
4
|
+
import { ReplaceNestListAction } from '../../actions/replace-nest-list-action';
|
|
5
|
+
import { RTEListBlock } from '../../blocks/list-block';
|
|
6
|
+
import { RTEListItemBlock } from '../../blocks/list-item-block';
|
|
7
|
+
import { AbstractListItemsStrategy } from './list-items-strategy.abstract';
|
|
8
|
+
/**
|
|
9
|
+
* Promote selected nested list items one level up.
|
|
10
|
+
*/
|
|
11
|
+
export class ListUnnestItemsStrategy extends AbstractListItemsStrategy {
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
handleAction(action, target) {
|
|
16
|
+
var _a;
|
|
17
|
+
const selectedItems = this.getOrderedContiguousItems(target, action.selectedBlocks);
|
|
18
|
+
const parentListParent = target.parent;
|
|
19
|
+
if (!selectedItems.length || !(parentListParent instanceof RTEListItemBlock)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const selectedStartIndex = target.children.indexOf(selectedItems[0]);
|
|
23
|
+
const selectedEndIndex = target.children.indexOf(selectedItems[selectedItems.length - 1]);
|
|
24
|
+
if (selectedStartIndex < 0 || selectedEndIndex < selectedStartIndex) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const parentListItem = parentListParent;
|
|
28
|
+
const grandParentList = parentListItem.parent;
|
|
29
|
+
const insertAfterIndex = grandParentList.children.indexOf(parentListItem);
|
|
30
|
+
if (insertAfterIndex < 0) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const trailingSiblingItems = target.children.slice(selectedEndIndex + 1);
|
|
34
|
+
const selectedItemSet = new Set(selectedItems);
|
|
35
|
+
target.children = target.children.filter((item) => !selectedItemSet.has(item));
|
|
36
|
+
grandParentList.children = [
|
|
37
|
+
...grandParentList.children.slice(0, insertAfterIndex + 1),
|
|
38
|
+
...selectedItems,
|
|
39
|
+
...grandParentList.children.slice(insertAfterIndex + 1),
|
|
40
|
+
];
|
|
41
|
+
selectedItems.forEach((item) => {
|
|
42
|
+
item.parent = grandParentList;
|
|
43
|
+
item.children.forEach((node) => node.apply(new SyncUpSelectionAction()));
|
|
44
|
+
});
|
|
45
|
+
if (trailingSiblingItems.length > 0) {
|
|
46
|
+
const trailingSiblingSet = new Set(trailingSiblingItems);
|
|
47
|
+
target.children = target.children.filter((item) => !trailingSiblingSet.has(item));
|
|
48
|
+
const newParentItem = selectedItems[selectedItems.length - 1];
|
|
49
|
+
let nestedList = (_a = newParentItem.nestList) === null || _a === void 0 ? void 0 : _a[newParentItem.nestList.length - 1];
|
|
50
|
+
// Shift+Tab follows same-type guard: when the last nested list has a
|
|
51
|
+
// different type, create a new child list of target.type instead of merging.
|
|
52
|
+
if (nestedList && nestedList.type !== target.type) {
|
|
53
|
+
nestedList = null;
|
|
54
|
+
}
|
|
55
|
+
if (!nestedList) {
|
|
56
|
+
nestedList = new RTEListBlock(generateUUID(), target.type);
|
|
57
|
+
const existingNestLists = Array.isArray(newParentItem.nestList)
|
|
58
|
+
? newParentItem.nestList
|
|
59
|
+
: [];
|
|
60
|
+
newParentItem.apply(new ReplaceNestListAction([...existingNestLists, nestedList]));
|
|
61
|
+
}
|
|
62
|
+
nestedList.children = nestedList.children.concat(trailingSiblingItems);
|
|
63
|
+
trailingSiblingItems.forEach((item) => {
|
|
64
|
+
item.parent = nestedList;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// Lists after target are visually after every target item. Once selected items
|
|
68
|
+
// move above their former parent, transfer those later branches to the last
|
|
69
|
+
// selected item even when target still contains leading items; otherwise the
|
|
70
|
+
// branches render before the promoted selection and document order changes.
|
|
71
|
+
const trailingNestLists = this.collectTrailingNestLists(parentListItem, target);
|
|
72
|
+
if (trailingNestLists.length > 0) {
|
|
73
|
+
const lastSelected = selectedItems[selectedItems.length - 1];
|
|
74
|
+
const existingNest = Array.isArray(lastSelected.nestList)
|
|
75
|
+
? lastSelected.nestList
|
|
76
|
+
: [];
|
|
77
|
+
lastSelected.apply(new ReplaceNestListAction([...existingNest, ...trailingNestLists]));
|
|
78
|
+
}
|
|
79
|
+
if (target.children.length === 0) {
|
|
80
|
+
parentListItem.apply(new RemoveNestListAction(target));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Collect and remove nestList entries that appear after the given target list
|
|
85
|
+
* in the parent item's nestList array. These trailing entries need to be
|
|
86
|
+
* transferred to the unnested item to preserve visual document order.
|
|
87
|
+
*
|
|
88
|
+
* @param {RTEListItemBlock} parentListItem - The list item owning the nestList.
|
|
89
|
+
* @param {RTEListBlock} target - The list being removed (used as the reference point).
|
|
90
|
+
* @returns {RTEListBlock[]} The trailing nestList entries (already removed from parentListItem).
|
|
91
|
+
*/
|
|
92
|
+
collectTrailingNestLists(parentListItem, target) {
|
|
93
|
+
var _a;
|
|
94
|
+
const nestLists = (_a = parentListItem.nestList) !== null && _a !== void 0 ? _a : [];
|
|
95
|
+
const targetIndex = nestLists.indexOf(target);
|
|
96
|
+
if (targetIndex < 0 || targetIndex >= nestLists.length - 1) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
const trailing = nestLists.slice(targetIndex + 1);
|
|
100
|
+
// Keep only entries up to and including target (target will be removed separately).
|
|
101
|
+
parentListItem.apply(new ReplaceNestListAction(nestLists.slice(0, targetIndex + 1)));
|
|
102
|
+
return trailing;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -16,6 +16,8 @@ export var ModifyContentActionType;
|
|
|
16
16
|
ModifyContentActionType["LINE_BREAK_MULTIPLE_BLOCKS"] = "LINE_BREAK_MULTIPLE_BLOCKS";
|
|
17
17
|
ModifyContentActionType["TRANSFORM_LIST_BLOCK"] = "TRANSFORM_LIST_BLOCK";
|
|
18
18
|
ModifyContentActionType["TRANSFORM_PARAGRAPH_BLOCK"] = "TRANSFORM_PARAGRAPH_BLOCK";
|
|
19
|
+
ModifyContentActionType["NEST_LIST_ITEMS"] = "NEST_LIST_ITEMS";
|
|
20
|
+
ModifyContentActionType["UNNEST_LIST_ITEMS"] = "UNNEST_LIST_ITEMS";
|
|
19
21
|
ModifyContentActionType["DELETE_BLOCK_CONTENT"] = "DELETE_BLOCK_CONTENT";
|
|
20
22
|
ModifyContentActionType["INSERT_IMAGE_TO_BLOCK"] = "INSERT_IMAGE_TO_BLOCK";
|
|
21
23
|
ModifyContentActionType["UPDATE_IMAGE_NODE_URL"] = "UPDATE_IMAGE_NODE_URL";
|
package/dist/collection/components/vega-rich-text-editor/dto/actions/nest-list-items-action.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ModifyContentAction, ModifyContentActionType } from './modify-content-action.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Action to nest the selected list items under the previous sibling.
|
|
4
|
+
*/
|
|
5
|
+
export class NestListItemsAction extends ModifyContentAction {
|
|
6
|
+
constructor(selectedBlocks) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = ModifyContentActionType.NEST_LIST_ITEMS;
|
|
9
|
+
this.isFlushable = true;
|
|
10
|
+
this.selectedBlocks = selectedBlocks;
|
|
11
|
+
}
|
|
12
|
+
}
|
package/dist/collection/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ModifyContentAction, ModifyContentActionType } from './modify-content-action.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Action to promote the selected nested list items one level up.
|
|
4
|
+
*/
|
|
5
|
+
export class UnnestListItemsAction extends ModifyContentAction {
|
|
6
|
+
constructor(selectedBlocks) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = ModifyContentActionType.UNNEST_LIST_ITEMS;
|
|
9
|
+
this.isFlushable = true;
|
|
10
|
+
this.selectedBlocks = selectedBlocks;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -18,6 +18,18 @@ export class ListAnnotation extends BlockAnnotation {
|
|
|
18
18
|
marginLeft: '16px',
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the default standalone styles for a list block's item marker
|
|
23
|
+
* (`li::marker`). Capping the marker font-size keeps bullets/numbers
|
|
24
|
+
* at a normal size when list items are styled as title/subtitle.
|
|
25
|
+
*
|
|
26
|
+
* @returns {AnnotationStyle} The default marker styles.
|
|
27
|
+
*/
|
|
28
|
+
static getDefaultMarkerStyles() {
|
|
29
|
+
return {
|
|
30
|
+
fontSize: '16px',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
21
33
|
/**
|
|
22
34
|
* @inheritDoc
|
|
23
35
|
*/
|
|
@@ -5,6 +5,8 @@ import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action
|
|
|
5
5
|
import { ListTransformToListStrategy } from '../action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy';
|
|
6
6
|
import { ListTransformToParagraphStrategy } from '../action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy';
|
|
7
7
|
import { ListInsertImageStrategy } from '../action-handle-strategies/modify-content-strategies/list-insert-image-strategy';
|
|
8
|
+
import { ListNestItemsStrategy } from '../action-handle-strategies/modify-content-strategies/list-nest-items-strategy';
|
|
9
|
+
import { ListUnnestItemsStrategy } from '../action-handle-strategies/modify-content-strategies/list-unnest-items-strategy';
|
|
8
10
|
import { BlockAnnotationTypeEnum } from '../annotations/block-annotation.abstract';
|
|
9
11
|
import { ListAnnotation } from '../annotations/list-annotation';
|
|
10
12
|
import { isNonNullable } from '../../../../types/type-guard';
|
|
@@ -12,7 +14,12 @@ import { CustomAttributeAnnotation } from '../annotations/custom-attribute-annot
|
|
|
12
14
|
import { CustomClassAnnotation } from '../annotations/custom-class-annotation';
|
|
13
15
|
import { CustomStyleAnnotation } from '../annotations/custom-style-annotation';
|
|
14
16
|
/**
|
|
15
|
-
* List block
|
|
17
|
+
* List block.
|
|
18
|
+
*
|
|
19
|
+
* Bidirectional nesting contract:
|
|
20
|
+
* - Every child list item must have item.parent === this list block.
|
|
21
|
+
* - If this list block is nested, its parent must be a list item and that
|
|
22
|
+
* list item keeps this block in listItem.nestList.
|
|
16
23
|
*/
|
|
17
24
|
export class RTEListBlock extends RTEBlock {
|
|
18
25
|
constructor(id, type, options) {
|
|
@@ -126,5 +133,7 @@ export class RTEListBlock extends RTEBlock {
|
|
|
126
133
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTEListBlock.name, new ListTransformToListStrategy());
|
|
127
134
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK, RTEListBlock.name, new ListTransformToParagraphStrategy());
|
|
128
135
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListBlock.name, new ListInsertImageStrategy());
|
|
136
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.NEST_LIST_ITEMS, RTEListBlock.name, new ListNestItemsStrategy());
|
|
137
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.UNNEST_LIST_ITEMS, RTEListBlock.name, new ListUnnestItemsStrategy());
|
|
129
138
|
})();
|
|
130
139
|
RTEListBlock.dtoName = 'RTEListBlock';
|
|
@@ -19,7 +19,11 @@ import { BlockUpdateTextStyleStrategy } from '../action-handle-strategies/apply-
|
|
|
19
19
|
import { HorizontalAlignmentAnnotationAction } from '../actions/horizontal-alignment-annotation-action';
|
|
20
20
|
import { BlockUpdateHorizontalAlignmentStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy';
|
|
21
21
|
/**
|
|
22
|
-
* List item block
|
|
22
|
+
* List item block.
|
|
23
|
+
*
|
|
24
|
+
* Bidirectional nesting contract:
|
|
25
|
+
* - nestList stores nested list blocks owned by this list item.
|
|
26
|
+
* - Every nested list block must have listBlock.parent === this list item.
|
|
23
27
|
*/
|
|
24
28
|
export class RTEListItemBlock extends RTETextBlock {
|
|
25
29
|
constructor(id, nestList, options) {
|
|
@@ -46,7 +50,7 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
46
50
|
listItemBlock.children = block.nodes.map((richText) => RTETextNode.from(richText, listItemBlock, options));
|
|
47
51
|
if (block.children) {
|
|
48
52
|
listItemBlock.nestList = block.children.map((child) => {
|
|
49
|
-
const listBlock = RTEListBlock.from(child);
|
|
53
|
+
const listBlock = RTEListBlock.from(child, options);
|
|
50
54
|
listBlock.parent = listItemBlock;
|
|
51
55
|
return listBlock;
|
|
52
56
|
});
|
|
@@ -73,8 +77,12 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
73
77
|
* @inheritDoc
|
|
74
78
|
*/
|
|
75
79
|
toHtml(options) {
|
|
80
|
+
var _a;
|
|
76
81
|
const attrStr = super.generateAttributeString(options);
|
|
77
|
-
|
|
82
|
+
const nestListHtml = ((_a = this.nestList) === null || _a === void 0 ? void 0 : _a.length)
|
|
83
|
+
? this.nestList.map((list) => list.toHtml(options)).join('')
|
|
84
|
+
: '';
|
|
85
|
+
return [`<li${attrStr}>`, this.getChildrenHtml(options), nestListHtml, `</li>`].join('');
|
|
78
86
|
}
|
|
79
87
|
/**
|
|
80
88
|
* @inheritDoc
|