@globalpayments/vega 2.55.0 → 2.56.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-f1ff47e3.js → app-globals-7e482341.js} +2 -2
- package/dist/cjs/{code-block-2d014e17.js → code-block-e56c5216.js} +99 -110
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-6bfb9145.js → component-value-history-controller-slimmer.abstract-9a1285a1.js} +5 -5
- package/dist/cjs/{content-state-6a5da7ec.js → content-state-e07c843c.js} +90 -84
- package/dist/cjs/{design-token-d15e60fa.js → design-token-3e0bd48d.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-2f16891f.js → element-appender-slimmer-2b9ca234.js} +1 -1
- package/dist/cjs/{image-annotation-action-617bbb13.js → image-annotation-action-76e3c89d.js} +1 -1
- package/dist/cjs/index.cjs.js +12 -5
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{public-rules-a3b7e267.js → public-rules-1ac67099.js} +3 -3
- package/dist/cjs/{responsive-format-facade-4a19e115.js → responsive-format-facade-e2e11c24.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-e9c7c379.js → rich-text-editor-required-rule-63f50aa4.js} +3 -3
- package/dist/cjs/{style-formatter-b8cea5ee.js → style-formatter-0213d3a8.js} +1 -1
- package/dist/cjs/types-a4295b11.js +12 -0
- package/dist/cjs/vega-accordion.cjs.entry.js +4 -4
- package/dist/cjs/vega-app-header-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-box.cjs.entry.js +5 -5
- package/dist/cjs/vega-button-circle.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_3.cjs.entry.js +49 -10
- package/dist/cjs/vega-card.cjs.entry.js +4 -4
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +4 -1
- package/dist/cjs/vega-chip.cjs.entry.js +4 -4
- package/dist/cjs/vega-code-block.cjs.entry.js +6 -16
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-dialog_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-divider.cjs.entry.js +4 -4
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +13 -10
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-flag-icon.cjs.entry.js +4 -4
- package/dist/cjs/vega-flex.cjs.entry.js +5 -5
- package/dist/cjs/vega-font.cjs.entry.js +4 -4
- package/dist/cjs/vega-grid.cjs.entry.js +4 -4
- package/dist/cjs/vega-icon.cjs.entry.js +4 -4
- package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-select.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +4 -4
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
- package/dist/cjs/vega-popover_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-radio_2.cjs.entry.js +4 -1
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +13 -13
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +68 -68
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_8.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega.cjs.js +4 -4
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.js +24 -7
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +11 -2
- package/dist/collection/components/vega-calendar/vega-calendar.css +6 -0
- package/dist/collection/components/vega-calendar/vega-calendar.js +43 -0
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +4 -1
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-scrollable-controller.js +6 -4
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +1 -1
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-radio/vega-radio.js +4 -1
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-split-text-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-blocks-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-nodes-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-image-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +28 -47
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.js +7 -7
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-before-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-with-blocks-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-child-block-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-node-with-nodes-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-nodes-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-image-node-strategy.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-text-node-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-block-insert-image-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-with-blocks-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-delete-text-content-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-new-paragraph-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-nest-list-strategy.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-node-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +9 -9
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +5 -5
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +7 -7
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +6 -6
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +18 -12
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +9 -9
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +14 -14
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +20 -20
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.js +8 -8
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +8 -8
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +5 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +6 -6
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-image-controller.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-insert-line-break-with-blocks-strategy.test.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-item-strategy-register.test.js +56 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-split-text-strategy.test.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/code-block.test.js +5 -5
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/image-block.test.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-block.test.js +7 -7
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-item.test.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +18 -18
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +9 -9
- package/dist/collection/helpers/validator/rules/rich-text-editor-required-rule.js +2 -2
- package/dist/collection/types/public-api.js +1 -0
- package/dist/esm/{app-globals-4881974a.js → app-globals-b5881948.js} +2 -2
- package/dist/esm/{code-block-ef2f04ca.js → code-block-1cdb0599.js} +99 -110
- package/dist/esm/{component-value-history-controller-slimmer.abstract-0a0ef33f.js → component-value-history-controller-slimmer.abstract-c12b2958.js} +5 -5
- package/dist/esm/{content-state-69d29a07.js → content-state-cf27d19b.js} +90 -84
- package/dist/esm/{design-token-9bbefd23.js → design-token-96e03257.js} +1 -1
- package/dist/esm/{element-appender-slimmer-8652e8d7.js → element-appender-slimmer-00dcccb9.js} +1 -1
- package/dist/esm/{image-annotation-action-1497f70e.js → image-annotation-action-e76b3396.js} +1 -1
- package/dist/esm/index.js +6 -5
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{public-rules-3436034b.js → public-rules-e8616346.js} +3 -3
- package/dist/esm/{responsive-format-facade-bcc2fd21.js → responsive-format-facade-464498b6.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-cc5b6a2d.js → rich-text-editor-required-rule-69844536.js} +3 -3
- package/dist/esm/{style-formatter-00d6c32f.js → style-formatter-670e20f7.js} +1 -1
- package/dist/esm/types-0cadfd73.js +12 -0
- package/dist/esm/vega-accordion.entry.js +4 -4
- package/dist/esm/vega-app-header-button.entry.js +4 -4
- package/dist/esm/vega-box.entry.js +5 -5
- package/dist/esm/vega-button-circle.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_3.entry.js +49 -10
- package/dist/esm/vega-card.entry.js +4 -4
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +4 -1
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-code-block.entry.js +3 -13
- package/dist/esm/vega-date-picker_2.entry.js +4 -4
- package/dist/esm/vega-dialog_2.entry.js +4 -4
- package/dist/esm/vega-divider.entry.js +4 -4
- package/dist/esm/vega-dropdown_5.entry.js +13 -10
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-flag-icon.entry.js +4 -4
- package/dist/esm/vega-flex.entry.js +5 -5
- package/dist/esm/vega-font.entry.js +4 -4
- package/dist/esm/vega-grid.entry.js +4 -4
- package/dist/esm/vega-icon.entry.js +4 -4
- package/dist/esm/vega-image-uploader.entry.js +3 -3
- package/dist/esm/vega-input-phone-number.entry.js +2 -2
- package/dist/esm/vega-input-select.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +4 -4
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination.entry.js +3 -3
- package/dist/esm/vega-popover_2.entry.js +4 -4
- package/dist/esm/vega-radio_2.entry.js +4 -1
- package/dist/esm/vega-rich-text-content.entry.js +13 -13
- package/dist/esm/vega-rich-text-editor_4.entry.js +68 -68
- package/dist/esm/vega-selection-chip_2.entry.js +3 -3
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +4 -4
- package/dist/esm/vega-table_8.entry.js +3 -3
- package/dist/esm/vega-time-picker_2.entry.js +4 -4
- package/dist/esm/vega-tooltip_2.entry.js +4 -4
- package/dist/esm/vega.js +4 -4
- package/dist/types/components/vega-app-header-button/types.d.ts +2 -0
- package/dist/types/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.d.ts +1 -0
- package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.d.ts +1 -0
- package/dist/types/components/vega-calendar/types.d.ts +2 -0
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +14 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +13 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +8 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +2 -2
- package/dist/types/components.d.ts +15 -1
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-0e8324f2.entry.js → p-03c759ae.entry.js} +1 -1
- package/dist/vega/p-04c8b83d.entry.js +1 -0
- package/dist/vega/{p-c212a1e3.entry.js → p-08a0cbd0.entry.js} +1 -1
- package/dist/vega/{p-72e14f49.entry.js → p-0c660956.entry.js} +1 -1
- package/dist/vega/{p-1b165fbb.entry.js → p-144d2390.entry.js} +1 -1
- package/dist/vega/{p-c48a8510.entry.js → p-1737536e.entry.js} +1 -1
- package/dist/vega/{p-ad858290.entry.js → p-1a7d0e21.entry.js} +1 -1
- package/dist/vega/{p-9dc9fcf3.js → p-1c3e1134.js} +1 -1
- package/dist/vega/{p-ecd9a973.entry.js → p-1ebc1acf.entry.js} +1 -1
- package/dist/vega/{p-1d41f551.entry.js → p-2a6517f9.entry.js} +1 -1
- package/dist/vega/p-2f6c4f2c.entry.js +1 -0
- package/dist/vega/{p-f17c9093.entry.js → p-302e01e9.entry.js} +1 -1
- package/dist/vega/{p-f7062473.entry.js → p-3162a3f0.entry.js} +1 -1
- package/dist/vega/{p-6681efd5.js → p-397c7199.js} +1 -1
- package/dist/vega/p-46eb330f.entry.js +1 -0
- package/dist/vega/{p-8270bb8f.entry.js → p-487c0f17.entry.js} +1 -1
- package/dist/vega/{p-ca91268b.entry.js → p-4a12fb0d.entry.js} +1 -1
- package/dist/vega/{p-f9cf7e36.js → p-4b2a90b8.js} +1 -1
- package/dist/vega/{p-84a31a31.entry.js → p-4c595d8d.entry.js} +1 -1
- package/dist/vega/{p-43ba9a8a.entry.js → p-576b812b.entry.js} +1 -1
- package/dist/vega/{p-56dc1345.entry.js → p-59f1fd3e.entry.js} +1 -1
- package/dist/vega/{p-5a6b8846.entry.js → p-5be150cb.entry.js} +1 -1
- package/dist/vega/{p-a63e2fee.entry.js → p-5cb92c51.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-5f86a286.entry.js +1 -0
- package/dist/vega/{p-4f5079bc.entry.js → p-636142ae.entry.js} +1 -1
- package/dist/vega/{p-327be043.js → p-66516ee9.js} +1 -1
- package/dist/vega/p-68864531.js +1 -0
- package/dist/vega/p-6a7b7214.js +1 -0
- package/dist/vega/p-6b8d105e.entry.js +1 -0
- package/dist/vega/{p-c7e2a155.entry.js → p-7728041e.entry.js} +1 -1
- package/dist/vega/p-778fd499.js +1 -0
- package/dist/vega/{p-13ca73c7.entry.js → p-7cc20ed5.entry.js} +1 -1
- package/dist/vega/{p-e66f6b59.entry.js → p-81e56716.entry.js} +2 -2
- package/dist/vega/p-962b40d1.entry.js +1 -0
- package/dist/vega/{p-c10b4f47.entry.js → p-9d286c08.entry.js} +1 -1
- package/dist/vega/{p-cae183fd.entry.js → p-a42bc438.entry.js} +1 -1
- package/dist/vega/{p-b89a9760.js → p-ae74d511.js} +1 -1
- package/dist/vega/{p-da95668c.entry.js → p-b3da0b44.entry.js} +1 -1
- package/dist/vega/{p-1e4b6f0a.entry.js → p-c0043eed.entry.js} +1 -1
- package/dist/vega/p-c685adcd.js +1 -0
- package/dist/vega/p-c9f544bd.entry.js +1 -0
- package/dist/vega/p-d1cb7f28.js +1 -0
- package/dist/vega/{p-9c0cda62.js → p-d8e1ed2d.js} +1 -1
- package/dist/vega/{p-9a0d3d2d.entry.js → p-dc383362.entry.js} +1 -1
- package/dist/vega/{p-822cd8e5.js → p-dc3d93d6.js} +1 -1
- package/dist/vega/{p-79370ad4.entry.js → p-e2282f71.entry.js} +1 -1
- package/dist/vega/{p-c8a87f06.entry.js → p-e5eda663.entry.js} +1 -1
- package/dist/vega/{p-7704a608.entry.js → p-ec7dc51f.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +6 -2
- package/dist/vega/p-29262ad6.entry.js +0 -1
- package/dist/vega/p-3eb2d433.js +0 -1
- package/dist/vega/p-3fa7d356.js +0 -1
- package/dist/vega/p-468bf93a.entry.js +0 -1
- package/dist/vega/p-547692bf.entry.js +0 -1
- package/dist/vega/p-57005931.entry.js +0 -1
- package/dist/vega/p-5e8e4aba.js +0 -1
- package/dist/vega/p-cb36ccf0.entry.js +0 -1
- package/dist/vega/p-e8b56d3f.entry.js +0 -1
- package/dist/vega/p-ec3495de.entry.js +0 -1
- package/dist/vega/p-fecb4044.js +0 -1
|
@@ -10,10 +10,10 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
10
10
|
* @returns {Nullable<RTENode>} the previous block last node
|
|
11
11
|
*/
|
|
12
12
|
getPreviousNode(currentNode) {
|
|
13
|
-
const currentBlock = currentNode.
|
|
14
|
-
const currentIndex = currentBlock
|
|
13
|
+
const currentBlock = currentNode.parent;
|
|
14
|
+
const currentIndex = currentBlock.children.indexOf(currentNode);
|
|
15
15
|
if (currentIndex > 0) {
|
|
16
|
-
return currentBlock[
|
|
16
|
+
return currentBlock.children[currentIndex - 1];
|
|
17
17
|
}
|
|
18
18
|
else if (currentBlock.parent) {
|
|
19
19
|
const previousBlock = this.getPreviousBlock(currentBlock);
|
|
@@ -29,10 +29,10 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
29
29
|
* @returns {Nullable<RTENode>} the next block first node
|
|
30
30
|
*/
|
|
31
31
|
getNextNode(currentNode) {
|
|
32
|
-
const currentBlock = currentNode.
|
|
33
|
-
const currentIndex = currentBlock
|
|
34
|
-
if (currentBlock[
|
|
35
|
-
return currentBlock[
|
|
32
|
+
const currentBlock = currentNode.parent;
|
|
33
|
+
const currentIndex = currentBlock.children.indexOf(currentNode);
|
|
34
|
+
if (currentBlock.children[currentIndex + 1]) {
|
|
35
|
+
return currentBlock.children[currentIndex + 1];
|
|
36
36
|
}
|
|
37
37
|
else if (currentBlock.parent) {
|
|
38
38
|
const nextBlock = this.getNextBlock(currentBlock);
|
|
@@ -48,20 +48,20 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
48
48
|
* @returns {boolean} True or false;
|
|
49
49
|
*/
|
|
50
50
|
isContentFirstNode(currentNode) {
|
|
51
|
-
const currentBlock = currentNode.
|
|
52
|
-
const currentIndex = currentBlock
|
|
51
|
+
const currentBlock = currentNode.parent;
|
|
52
|
+
const currentIndex = currentBlock.children.indexOf(currentNode);
|
|
53
53
|
const parent = currentBlock.parent;
|
|
54
|
-
if (currentBlock.
|
|
54
|
+
if (currentBlock.isListItemBlock()) {
|
|
55
55
|
const listParent = parent.parent;
|
|
56
56
|
return (currentIndex === 0 &&
|
|
57
|
-
Array.isArray(parent
|
|
58
|
-
parent[
|
|
57
|
+
Array.isArray(parent.children) &&
|
|
58
|
+
parent.children[0] === currentBlock &&
|
|
59
59
|
listParent['type'] !== 'list-item' &&
|
|
60
|
-
Array.isArray(listParent
|
|
61
|
-
listParent[
|
|
60
|
+
Array.isArray(listParent.children) &&
|
|
61
|
+
listParent.children[0] === parent);
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
|
-
return (currentIndex === 0 && Array.isArray(parent
|
|
64
|
+
return (currentIndex === 0 && Array.isArray(parent.children) && parent.children[0] === currentBlock);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -72,10 +72,10 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
72
72
|
* @returns {Nullable<RTEBlock>} The previous block if existing
|
|
73
73
|
*/
|
|
74
74
|
getPreviousBlock(currentBlock) {
|
|
75
|
-
if (currentBlock && currentBlock.parent && currentBlock.parent
|
|
76
|
-
const currentBlockIndex = currentBlock.parent
|
|
75
|
+
if (currentBlock && currentBlock.parent && currentBlock.parent.children) {
|
|
76
|
+
const currentBlockIndex = currentBlock.parent.children.indexOf(currentBlock);
|
|
77
77
|
if (currentBlockIndex > 0) {
|
|
78
|
-
return currentBlock.parent[
|
|
78
|
+
return currentBlock.parent.children[currentBlockIndex - 1];
|
|
79
79
|
}
|
|
80
80
|
else if ((currentBlock.parent['type'] === 'number-list' ||
|
|
81
81
|
currentBlock.parent['type'] === 'bullet-list') &&
|
|
@@ -91,26 +91,7 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
91
91
|
* @returns {Nullable<RTENode>} Returns the last node of the given `currentBlock` object.
|
|
92
92
|
*/
|
|
93
93
|
getBlockLastNode(currentBlock) {
|
|
94
|
-
|
|
95
|
-
if (currentBlock['children'] && currentBlock['children'].length > 0) {
|
|
96
|
-
return this.getBlockLastNode(currentBlock['children'][currentBlock['children'].length - 1]);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
return currentBlock['nodes'][currentBlock['nodes'].length - 1];
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
else if (currentBlock.type === 'number-list' || currentBlock.type === 'bullet-list') {
|
|
103
|
-
const listItems = currentBlock.blocks;
|
|
104
|
-
if (listItems) {
|
|
105
|
-
const lastListItem = listItems[listItems.length - 1];
|
|
106
|
-
return this.getBlockLastNode(lastListItem);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
if (currentBlock['nodes']) {
|
|
111
|
-
return currentBlock['nodes'][currentBlock['nodes'].length - 1];
|
|
112
|
-
}
|
|
113
|
-
}
|
|
94
|
+
return currentBlock.getLastNode();
|
|
114
95
|
}
|
|
115
96
|
/**
|
|
116
97
|
* Returns the first node within a given RTE block, handling different block types accordingly.
|
|
@@ -120,14 +101,14 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
120
101
|
*/
|
|
121
102
|
getBlockFirstNode(currentBlock) {
|
|
122
103
|
if (currentBlock.type === 'number-list' || currentBlock.type === 'bullet-list') {
|
|
123
|
-
if (currentBlock.
|
|
124
|
-
const firstListItem = currentBlock.
|
|
104
|
+
if (currentBlock.children) {
|
|
105
|
+
const firstListItem = currentBlock.children[0];
|
|
125
106
|
return this.getBlockFirstNode(firstListItem);
|
|
126
107
|
}
|
|
127
108
|
}
|
|
128
109
|
else {
|
|
129
|
-
if (currentBlock
|
|
130
|
-
return currentBlock[
|
|
110
|
+
if (currentBlock.children) {
|
|
111
|
+
return currentBlock.children[0];
|
|
131
112
|
}
|
|
132
113
|
}
|
|
133
114
|
}
|
|
@@ -138,13 +119,13 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
138
119
|
* @returns {Nullable<RTEBlock>} The next block if existing
|
|
139
120
|
*/
|
|
140
121
|
getNextBlock(currentBlock) {
|
|
141
|
-
if (currentBlock && currentBlock.parent && currentBlock.parent
|
|
142
|
-
const currentBlockIndex = currentBlock.parent
|
|
143
|
-
if (currentBlock.parent[
|
|
144
|
-
return currentBlock.parent[
|
|
122
|
+
if (currentBlock && currentBlock.parent && currentBlock.parent.children) {
|
|
123
|
+
const currentBlockIndex = currentBlock.parent.children.indexOf(currentBlock);
|
|
124
|
+
if (currentBlock.parent.children[currentBlockIndex + 1]) {
|
|
125
|
+
return currentBlock.parent.children[currentBlockIndex + 1];
|
|
145
126
|
}
|
|
146
127
|
else if (currentBlock.type === 'list-item' &&
|
|
147
|
-
currentBlock.parent.
|
|
128
|
+
currentBlock.parent.children.length === currentBlockIndex + 1) {
|
|
148
129
|
return this.getNextBlock(currentBlock.parent);
|
|
149
130
|
}
|
|
150
131
|
}
|
|
@@ -33,8 +33,8 @@ export class BlockDeleteTextContentStrategy extends BlockDeleteNodeContentStrate
|
|
|
33
33
|
else {
|
|
34
34
|
const previousNode = this.getPreviousNode(startContainerNode);
|
|
35
35
|
// Remove the last character will not delete paragraph, the paragraph will removed after press delete again
|
|
36
|
-
if ((previousNode && previousNode.
|
|
37
|
-
target.
|
|
36
|
+
if ((previousNode && previousNode.parent === target && previousNode['text'] === '\n') ||
|
|
37
|
+
target.children.length === 1) {
|
|
38
38
|
action.previousNode = startContainerNode;
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
@@ -48,12 +48,12 @@ export class BlockDeleteTextContentStrategy extends BlockDeleteNodeContentStrate
|
|
|
48
48
|
else {
|
|
49
49
|
let previousNode = this.getPreviousNode(startContainerNode);
|
|
50
50
|
let nextNode = null;
|
|
51
|
-
if (target.
|
|
51
|
+
if (target.children.length && previousNode && previousNode.parent !== target) {
|
|
52
52
|
if (startContainerNode.isEmpty()) {
|
|
53
53
|
target.apply(new RemoveChildAction(startContainerNode));
|
|
54
54
|
}
|
|
55
|
-
if (target.type === previousNode.
|
|
56
|
-
previousNode.
|
|
55
|
+
if (target.type === previousNode.parent.type) {
|
|
56
|
+
previousNode.parent.apply(new MergeTwoBlocksNodesAction(target));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
@@ -80,14 +80,14 @@ export class BlockDeleteTextContentStrategy extends BlockDeleteNodeContentStrate
|
|
|
80
80
|
if (previousNode instanceof RTETextNode && previousNode.isEmpty()) {
|
|
81
81
|
const shouldRemoveNode = previousNode;
|
|
82
82
|
previousNode = this.getPreviousNode(previousNode);
|
|
83
|
-
shouldRemoveNode.
|
|
83
|
+
shouldRemoveNode.parent.apply(new RemoveChildAction(shouldRemoveNode));
|
|
84
84
|
if (!previousNode) {
|
|
85
85
|
nextNode = startContainerNode;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
//Remove the paragraph block if the content is empty
|
|
90
|
-
if (target.
|
|
90
|
+
if (target.children.length === 0) {
|
|
91
91
|
target.parent.apply(new RemoveChildAction(target));
|
|
92
92
|
}
|
|
93
93
|
if (previousNode) {
|
|
@@ -20,12 +20,12 @@ export class BlockInsertBlocksBeforeStrategy extends ActionHandleStrategy {
|
|
|
20
20
|
* @param {RTEBlock[]} blocks - An array of RTEBlock objects that you want to replace the `referBlock` with in the `blocks` array.
|
|
21
21
|
*/
|
|
22
22
|
replaceBlockWithBlocks(target, referBlock, blocks) {
|
|
23
|
-
if (target.
|
|
23
|
+
if (target.children) {
|
|
24
24
|
blocks.forEach((block) => {
|
|
25
25
|
block.parent = target;
|
|
26
26
|
});
|
|
27
|
-
const arrayFixed = target.
|
|
28
|
-
target.
|
|
27
|
+
const arrayFixed = target.children;
|
|
28
|
+
target.children = arrayFixed.flatMap((block) => {
|
|
29
29
|
if (block === referBlock) {
|
|
30
30
|
return blocks;
|
|
31
31
|
}
|
|
@@ -25,10 +25,10 @@ export class BlockInsertLineBreakStrategy extends ActionHandleStrategy {
|
|
|
25
25
|
const lineBreakNode = new RTETextNode(generateUUID(), '\n', target);
|
|
26
26
|
const beforeText = splitNode.text.slice(0, startOffsetOfNode);
|
|
27
27
|
const afterText = splitNode.text.slice(startOffsetOfNode);
|
|
28
|
-
const nodesSplitIndex = target.
|
|
28
|
+
const nodesSplitIndex = target.children.indexOf(splitNode);
|
|
29
29
|
if (nodesSplitIndex > -1) {
|
|
30
|
-
const beforeNodes = target.
|
|
31
|
-
const afterNodes = target.
|
|
30
|
+
const beforeNodes = target.children.slice(0, nodesSplitIndex);
|
|
31
|
+
const afterNodes = target.children.slice(nodesSplitIndex + 1);
|
|
32
32
|
if (beforeText) {
|
|
33
33
|
beforeNodes.push(splitNode.cloneWithText(beforeText));
|
|
34
34
|
}
|
|
@@ -21,7 +21,7 @@ export class BlockInsertLineBreakWithBlocksStrategy extends ActionHandleStrategy
|
|
|
21
21
|
* @returns {Nullable<RTETextNode>} Nullable<RTETextNode>
|
|
22
22
|
*/
|
|
23
23
|
lineBreakMultipleBlocks(selectedBlocks, target) {
|
|
24
|
-
const beforeNodes = target.
|
|
24
|
+
const beforeNodes = target.children;
|
|
25
25
|
const lineBreakNode = new RTETextNode(generateUUID(), '\n', target);
|
|
26
26
|
const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
|
|
27
27
|
this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes, target);
|
|
@@ -37,7 +37,7 @@ export class BlockInsertLineBreakWithBlocksStrategy extends ActionHandleStrategy
|
|
|
37
37
|
const nodes = [];
|
|
38
38
|
blocks.map((block) => {
|
|
39
39
|
if (block.type !== 'image') {
|
|
40
|
-
nodes.push(...block
|
|
40
|
+
nodes.push(...block.children);
|
|
41
41
|
block.parent.apply(new RemoveChildAction(block));
|
|
42
42
|
}
|
|
43
43
|
});
|
|
@@ -14,9 +14,9 @@ export class BlockMergeNodesStrategy extends ActionHandleStrategy {
|
|
|
14
14
|
handleAction(action, target) {
|
|
15
15
|
const anotherBlock = action.blockNeedToBeMerged;
|
|
16
16
|
if (target.type === anotherBlock.type || (target.type !== 'image' && anotherBlock.type !== 'image')) {
|
|
17
|
-
let shouldMergeNodes = anotherBlock
|
|
18
|
-
if (anotherBlock
|
|
19
|
-
shouldMergeNodes = anotherBlock
|
|
17
|
+
let shouldMergeNodes = anotherBlock.children;
|
|
18
|
+
if (anotherBlock.type !== 'image') {
|
|
19
|
+
shouldMergeNodes = anotherBlock.children.filter((node) => node.text);
|
|
20
20
|
}
|
|
21
21
|
target.apply(new AppendChildNodesAction(shouldMergeNodes));
|
|
22
22
|
anotherBlock.parent.apply(new RemoveChildAction(anotherBlock));
|
|
@@ -8,8 +8,8 @@ export class BlockRemoveChildBlockStrategy extends ActionHandleStrategy {
|
|
|
8
8
|
*/
|
|
9
9
|
handleAction(action, target) {
|
|
10
10
|
const blockToBeRemoved = action.entityToBeRemoved;
|
|
11
|
-
if (target.
|
|
12
|
-
target.
|
|
11
|
+
if (target.children) {
|
|
12
|
+
target.children = target.children.filter((block) => block !== blockToBeRemoved);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -12,9 +12,9 @@ export class BlockRemoveNodeStrategy extends ActionHandleStrategy {
|
|
|
12
12
|
* @param {RTEBlockWithNodes} target - The parent block of the node that will be removed.
|
|
13
13
|
*/
|
|
14
14
|
handleAction(action, target) {
|
|
15
|
-
const arrayFixed = target.
|
|
16
|
-
target.
|
|
17
|
-
if (target.
|
|
15
|
+
const arrayFixed = target.children;
|
|
16
|
+
target.children = arrayFixed.filter((node) => node !== action.entityToBeRemoved);
|
|
17
|
+
if (target.children.length === 0 && target.parent) {
|
|
18
18
|
target.parent.apply(new RemoveChildAction(target));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -11,11 +11,11 @@ export class BlockReplaceNodeWithNodesStrategy extends ActionHandleStrategy {
|
|
|
11
11
|
* @param {RTENode[]} newNodes - The array of the text node or the image node.
|
|
12
12
|
*/
|
|
13
13
|
replaceNodeWithNodes(target, referNode, newNodes) {
|
|
14
|
-
if (target
|
|
14
|
+
if (target.children) {
|
|
15
15
|
newNodes.forEach((node) => {
|
|
16
|
-
node.
|
|
16
|
+
node.parent = target;
|
|
17
17
|
});
|
|
18
|
-
target
|
|
18
|
+
target.children = target.children.flatMap((node) => {
|
|
19
19
|
if (node === referNode) {
|
|
20
20
|
return newNodes;
|
|
21
21
|
}
|
|
@@ -11,7 +11,7 @@ export class BlockReplaceNodesStrategy extends ActionHandleStrategy {
|
|
|
11
11
|
* @param {RTETextBlock | RTEImageBlock} target - The text block or the image block.
|
|
12
12
|
*/
|
|
13
13
|
handleAction(action, target) {
|
|
14
|
-
target.
|
|
14
|
+
target.children = [];
|
|
15
15
|
target.apply(new AppendChildNodesAction(action.newChildNodes));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -22,10 +22,10 @@ export class BlockSplitWithImageNodeStrategy extends ActionHandleStrategy {
|
|
|
22
22
|
* @returns {Nullable<RTEBlock>} The new block after split
|
|
23
23
|
*/
|
|
24
24
|
splitImageNodes(imageNode, imageOffset, target) {
|
|
25
|
-
const nodesSplitIndex = target.
|
|
25
|
+
const nodesSplitIndex = target.children.indexOf(imageNode);
|
|
26
26
|
if (nodesSplitIndex > -1) {
|
|
27
|
-
const beforeNodes = target.
|
|
28
|
-
const afterNodes = target.
|
|
27
|
+
const beforeNodes = target.children.slice(0, nodesSplitIndex + imageOffset);
|
|
28
|
+
const afterNodes = target.children.slice(nodesSplitIndex + imageOffset);
|
|
29
29
|
target.apply(new ReplaceChildNodesAction(beforeNodes));
|
|
30
30
|
const newBlock = this.cloneWithNodes(afterNodes, target);
|
|
31
31
|
target.parent.apply(new InsertBlocksAfterAction(target, newBlock));
|
|
@@ -41,7 +41,7 @@ export class BlockSplitWithImageNodeStrategy extends ActionHandleStrategy {
|
|
|
41
41
|
*/
|
|
42
42
|
cloneWithNodes(nodes, target) {
|
|
43
43
|
const block = target.createNewImageBlock();
|
|
44
|
-
block.
|
|
44
|
+
block.children = [];
|
|
45
45
|
block.apply(new AppendChildNodesAction(nodes));
|
|
46
46
|
return block;
|
|
47
47
|
}
|
|
@@ -23,10 +23,10 @@ export class BlockSplitWithTextNodeStrategy extends ActionHandleStrategy {
|
|
|
23
23
|
if (splitNode) {
|
|
24
24
|
const beforeText = splitNode.text.slice(0, startOffsetOfNode);
|
|
25
25
|
const afterText = splitNode.text.slice(startOffsetOfNode);
|
|
26
|
-
const nodesSplitIndex = textBlock.
|
|
26
|
+
const nodesSplitIndex = textBlock.children.indexOf(splitNode);
|
|
27
27
|
if (nodesSplitIndex > -1) {
|
|
28
|
-
const beforeNodes = textBlock.
|
|
29
|
-
const afterNodes = textBlock.
|
|
28
|
+
const beforeNodes = textBlock.children.slice(0, nodesSplitIndex);
|
|
29
|
+
const afterNodes = textBlock.children.slice(nodesSplitIndex + 1);
|
|
30
30
|
if (beforeText) {
|
|
31
31
|
beforeNodes.push(splitNode.cloneWithText(beforeText));
|
|
32
32
|
}
|
|
@@ -30,7 +30,7 @@ export class BlockTransformToCodeBlockStrategy extends ActionHandleStrategy {
|
|
|
30
30
|
const selectedTextBlocks = selectedBlocks.filter((item) => item.type !== 'image' && item.type !== 'list-item');
|
|
31
31
|
return selectedTextBlocks
|
|
32
32
|
.map((block) => {
|
|
33
|
-
return block.
|
|
33
|
+
return block.children.map((node) => node.text).join('');
|
|
34
34
|
})
|
|
35
35
|
.join('\n');
|
|
36
36
|
}
|
|
@@ -15,7 +15,7 @@ export class CodeBlockRemoveSelfStrategy extends BlockDeleteNodeContentStrategy
|
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
17
17
|
handleAction(_action, target) {
|
|
18
|
-
const node = target.
|
|
18
|
+
const node = target.children[0];
|
|
19
19
|
const parent = target.parent;
|
|
20
20
|
if (parent) {
|
|
21
21
|
let focusNode = this.getPreviousNode(node);
|
|
@@ -28,14 +28,14 @@ export class CodeBlockRemoveSelfStrategy extends BlockDeleteNodeContentStrategy
|
|
|
28
28
|
const focusElement = focusNode
|
|
29
29
|
? stateEntityRenderingRegistry.getDOMByEntity(focusNode)
|
|
30
30
|
: null;
|
|
31
|
-
if (parent.
|
|
31
|
+
if (parent.children.length === 0) {
|
|
32
32
|
const defaultParagraph = RTETextBlock.from({
|
|
33
33
|
id: generateUUID(),
|
|
34
34
|
type: 'paragraph',
|
|
35
35
|
nodes: [{ id: generateUUID(), type: 'text', text: '' }],
|
|
36
36
|
});
|
|
37
37
|
target.parent.apply(new AppendChildNodesAction([defaultParagraph]));
|
|
38
|
-
focusNode = defaultParagraph.
|
|
38
|
+
focusNode = defaultParagraph.children[0];
|
|
39
39
|
offset = 0;
|
|
40
40
|
}
|
|
41
41
|
this.notifyUpdateSelection(focusNode, focusElement, offset, target);
|
|
@@ -14,8 +14,8 @@ export class ImageBlockInsertImageStrategy extends ActionHandleStrategy {
|
|
|
14
14
|
const splitNode = action.splitPointNode;
|
|
15
15
|
const startOffsetOfNode = action.startOffsetOfNode;
|
|
16
16
|
const newImageBlock = action.imageBlockToBeInserted;
|
|
17
|
-
const newImageNodes = newImageBlock.
|
|
18
|
-
if (target.
|
|
17
|
+
const newImageNodes = newImageBlock.children;
|
|
18
|
+
if (target.children.length < 1) {
|
|
19
19
|
target.apply(new AppendChildNodesAction(newImageNodes));
|
|
20
20
|
}
|
|
21
21
|
else if (this.isCaretPositionAtImageBlockEnd(target, splitNode, startOffsetOfNode)) {
|
|
@@ -15,7 +15,7 @@ export class ImageInsertLineBreakStrategy extends ActionHandleStrategy {
|
|
|
15
15
|
target.apply(insertNewParagraphAction);
|
|
16
16
|
const newBlock = insertNewParagraphAction.newBlock;
|
|
17
17
|
if (newBlock) {
|
|
18
|
-
action.lineBreakNode = newBlock.
|
|
18
|
+
action.lineBreakNode = newBlock.children[0];
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -34,7 +34,7 @@ export class ImageInsertLineBreakWithBlocksStrategy extends ActionHandleStrategy
|
|
|
34
34
|
afterNodes.push(new RTETextNode(generateUUID(), '\n', newParagraph));
|
|
35
35
|
}
|
|
36
36
|
newParagraph.apply(new AppendChildNodesAction(afterNodes));
|
|
37
|
-
return newParagraph['
|
|
37
|
+
return newParagraph['children'][0];
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Concat the child nodes of multiple RTEBlocks if both are not images.
|
|
@@ -46,7 +46,7 @@ export class ImageInsertLineBreakWithBlocksStrategy extends ActionHandleStrategy
|
|
|
46
46
|
const nodes = [];
|
|
47
47
|
blocks.map((block) => {
|
|
48
48
|
if (block.type !== 'image') {
|
|
49
|
-
nodes.push(...block
|
|
49
|
+
nodes.push(...block.children);
|
|
50
50
|
block.parent.apply(new RemoveChildAction(block));
|
|
51
51
|
}
|
|
52
52
|
});
|
|
@@ -13,7 +13,7 @@ export class ListItemDeleteTextContentStrategy extends BlockDeleteTextContentStr
|
|
|
13
13
|
handleAction(action, target) {
|
|
14
14
|
const listBlock = target.parent;
|
|
15
15
|
this.deleteNodeContent(action, target);
|
|
16
|
-
if (listBlock.
|
|
16
|
+
if (listBlock.children.length === 0) {
|
|
17
17
|
listBlock.parent.apply(new RemoveChildAction(listBlock));
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -52,8 +52,8 @@ export class ListItemInsertNewParagraphStrategy extends ActionHandleStrategy {
|
|
|
52
52
|
* @returns {RTEBlock} Returns a `RTEBlock`.
|
|
53
53
|
*/
|
|
54
54
|
breakListItemAtEnd(newListItem, target) {
|
|
55
|
-
const lastItem = target.parent.
|
|
56
|
-
const currentItemIsEmpty = target.
|
|
55
|
+
const lastItem = target.parent.children[target.parent.children.length - 1];
|
|
56
|
+
const currentItemIsEmpty = target.children.length === 1 && target.children[0].isEmpty();
|
|
57
57
|
if (target === lastItem && currentItemIsEmpty) {
|
|
58
58
|
const parentParent = target.parent.parent;
|
|
59
59
|
if (parentParent['type'] !== 'list-item') {
|
|
@@ -62,7 +62,7 @@ export class ListItemInsertNewParagraphStrategy extends ActionHandleStrategy {
|
|
|
62
62
|
type: 'paragraph',
|
|
63
63
|
nodes: [],
|
|
64
64
|
});
|
|
65
|
-
newParagraph.apply(new AppendChildNodesAction(newListItem.
|
|
65
|
+
newParagraph.apply(new AppendChildNodesAction(newListItem.children));
|
|
66
66
|
parentParent.apply(new InsertBlocksAfterAction(target.parent, newParagraph));
|
|
67
67
|
target.parent.apply(new RemoveChildAction(target));
|
|
68
68
|
return newParagraph;
|
|
@@ -10,12 +10,12 @@ export class ListItemRemoveNestListStrategy extends ActionHandleStrategy {
|
|
|
10
10
|
* @param {RTEListItemBlock} target - The list item block.
|
|
11
11
|
*/
|
|
12
12
|
handleAction(action, target) {
|
|
13
|
-
if (target.
|
|
14
|
-
if (target.
|
|
15
|
-
target.
|
|
13
|
+
if (target.nestList) {
|
|
14
|
+
if (target.nestList.length > 1) {
|
|
15
|
+
target.nestList = target.nestList.filter((child) => child !== action.nestListBlockToBeRemoved);
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
18
|
-
target.
|
|
18
|
+
target.nestList = undefined;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -11,8 +11,8 @@ export class ListItemRemoveNodeStrategy extends ActionHandleStrategy {
|
|
|
11
11
|
* @param {RTEListItemBlock} target - The list item block.
|
|
12
12
|
*/
|
|
13
13
|
handleAction(action, target) {
|
|
14
|
-
target.
|
|
15
|
-
if (target.
|
|
14
|
+
target.children = target.children.filter((node) => node !== action.entityToBeRemoved);
|
|
15
|
+
if (target.children.length === 0 && (!target.nestList || !target.nestList.length)) {
|
|
16
16
|
target.parent.apply(new RemoveChildAction(target));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -14,7 +14,7 @@ export class ListRemoveListItemStrategy extends BlockRemoveChildBlockStrategy {
|
|
|
14
14
|
handleAction(action, target) {
|
|
15
15
|
super.handleAction(action, target);
|
|
16
16
|
const parent = target.parent;
|
|
17
|
-
if (target.
|
|
17
|
+
if (target.children.length === 0 && parent) {
|
|
18
18
|
// The parent is a list item mean the current block is a nest list, so we need to use RemoveNestListAction to remove the item
|
|
19
19
|
if (parent['type'] === 'list-item') {
|
|
20
20
|
parent.apply(new RemoveNestListAction(target));
|
|
@@ -16,10 +16,10 @@ export class ListTransformToListStrategy extends ActionHandleStrategy {
|
|
|
16
16
|
const isSameList = selectedBlocks.every((block) => block.parent === target);
|
|
17
17
|
if (isSameList) {
|
|
18
18
|
// Select one or more list items belonging to the same list, and all items in this list should be updated
|
|
19
|
-
bulletList.apply(new AppendChildNodesAction(target.
|
|
19
|
+
bulletList.apply(new AppendChildNodesAction(target.children));
|
|
20
20
|
target.parent.apply(new InsertBlocksAfterAction(target, bulletList));
|
|
21
21
|
target.parent.apply(new RemoveChildAction(target));
|
|
22
|
-
selectedBlocks.forEach((block) => block.
|
|
22
|
+
selectedBlocks.forEach((block) => block.children.map((node) => node.apply(new SyncUpSelectionAction())));
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
const listItems = action.selectedBlocks.map((block) => target.parent.toListItem(block));
|
|
@@ -28,7 +28,7 @@ export class ListTransformToListStrategy extends ActionHandleStrategy {
|
|
|
28
28
|
action.selectedBlocks.forEach((block) => {
|
|
29
29
|
block.parent.apply(new RemoveChildAction(block));
|
|
30
30
|
});
|
|
31
|
-
if (target.
|
|
31
|
+
if (target.children.length === 0) {
|
|
32
32
|
target.parent.apply(new RemoveChildAction(target));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -18,10 +18,10 @@ export class ListTransformToParagraphStrategy extends ActionHandleStrategy {
|
|
|
18
18
|
let isSelectedLastBlock = false;
|
|
19
19
|
const selectedBlocks = action.selectedBlocks;
|
|
20
20
|
const currentParagraph = selectedBlocks.map((block) => {
|
|
21
|
-
block.
|
|
22
|
-
if (block === target.
|
|
21
|
+
block.children.map((node) => node.apply(new SyncUpSelectionAction()));
|
|
22
|
+
if (block === target.children[0])
|
|
23
23
|
isSelectedFirstBlock = true;
|
|
24
|
-
if (block === target.
|
|
24
|
+
if (block === target.children[target.children.length - 1])
|
|
25
25
|
isSelectedLastBlock = true;
|
|
26
26
|
return this.toParagraph(block);
|
|
27
27
|
});
|
|
@@ -32,19 +32,19 @@ export class ListTransformToParagraphStrategy extends ActionHandleStrategy {
|
|
|
32
32
|
target.parent.apply(new InsertBlocksAfterAction(target, ...currentParagraph));
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
const startIndex = target.
|
|
36
|
-
const lastIndex = target.
|
|
35
|
+
const startIndex = target.children.indexOf(selectedBlocks[0]);
|
|
36
|
+
const lastIndex = target.children.indexOf(selectedBlocks[selectedBlocks.length - 1]);
|
|
37
37
|
const firstBulletList = target.parent.createList(target.type);
|
|
38
|
-
firstBulletList.apply(new AppendChildNodesAction(target.
|
|
38
|
+
firstBulletList.apply(new AppendChildNodesAction(target.children.slice(0, startIndex)));
|
|
39
39
|
const lastBulletList = target.parent.createList(target.type);
|
|
40
|
-
lastBulletList.apply(new AppendChildNodesAction(target.
|
|
40
|
+
lastBulletList.apply(new AppendChildNodesAction(target.children.slice(lastIndex + 1)));
|
|
41
41
|
target.parent.apply(new InsertBlocksBeforeAction(target, firstBulletList, ...currentParagraph, lastBulletList));
|
|
42
42
|
target.parent.apply(new RemoveChildAction(target));
|
|
43
43
|
}
|
|
44
44
|
selectedBlocks.map((block) => {
|
|
45
45
|
target.apply(new RemoveChildAction(block));
|
|
46
46
|
});
|
|
47
|
-
if (target.
|
|
47
|
+
if (target.children.length === 0) {
|
|
48
48
|
target.parent.apply(new RemoveChildAction(target));
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -56,7 +56,7 @@ export class ListTransformToParagraphStrategy extends ActionHandleStrategy {
|
|
|
56
56
|
*/
|
|
57
57
|
toParagraph(block) {
|
|
58
58
|
const textBlock = new RTETextBlock(generateUUID(), 'paragraph');
|
|
59
|
-
textBlock.apply(new AppendChildNodesAction(block['
|
|
59
|
+
textBlock.apply(new AppendChildNodesAction(block['children']));
|
|
60
60
|
textBlock['annotationMap'] = block['annotationMap'];
|
|
61
61
|
return textBlock;
|
|
62
62
|
}
|
|
@@ -19,7 +19,7 @@ export class SwitchOutFromCodeBlockStrategy extends ActionHandleStrategy {
|
|
|
19
19
|
const textArray = content.split('\n');
|
|
20
20
|
const updateAction = new UpdateCodeBlockAction(textArray.slice(0, textArray.length - 2).join('\n'), language);
|
|
21
21
|
updateAction.isFlushable = false;
|
|
22
|
-
target.
|
|
22
|
+
target.children[0].apply(updateAction);
|
|
23
23
|
const textBlock = RTETextBlock.from({
|
|
24
24
|
id: generateUUID(),
|
|
25
25
|
type: 'paragraph',
|
|
@@ -31,7 +31,7 @@ export class SwitchOutFromCodeBlockStrategy extends ActionHandleStrategy {
|
|
|
31
31
|
if (currentNodeDom) {
|
|
32
32
|
const nodeSubject = domNodeSubjectFactory.getSubjectFromParentNodeByEventId(currentNodeDom, VegaInternalRichTextEditorSelectionRangeChange);
|
|
33
33
|
if (nodeSubject) {
|
|
34
|
-
changeManager.notify(nodeSubject, { node: textBlock.
|
|
34
|
+
changeManager.notify(nodeSubject, { node: textBlock.children[0] });
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -75,6 +75,14 @@ export class RTEBlock {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Check if the block is a list item block
|
|
80
|
+
*
|
|
81
|
+
* @returns {boolean} True if the block is a list item block, false otherwise.
|
|
82
|
+
*/
|
|
83
|
+
isListItemBlock() {
|
|
84
|
+
return this.type === 'list-item';
|
|
85
|
+
}
|
|
78
86
|
/**
|
|
79
87
|
* Apply action to block
|
|
80
88
|
*
|