@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
|
@@ -18,7 +18,7 @@ export class RTECodeBlock extends RTEBlock {
|
|
|
18
18
|
constructor(id, content, language) {
|
|
19
19
|
super(id);
|
|
20
20
|
this.type = 'code-block';
|
|
21
|
-
this.
|
|
21
|
+
this.children = [new RTECodeBlockNode(`${id}-1`, content, language, this)];
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Converts a VegaRTECodeBlock into an RTECodeBlock.
|
|
@@ -33,7 +33,7 @@ export class RTECodeBlock extends RTEBlock {
|
|
|
33
33
|
* @inheritDoc
|
|
34
34
|
*/
|
|
35
35
|
toJSON() {
|
|
36
|
-
const { language, text } = this.
|
|
36
|
+
const { language, text } = this.children[0];
|
|
37
37
|
return {
|
|
38
38
|
id: this.id,
|
|
39
39
|
type: 'code-block',
|
|
@@ -72,13 +72,13 @@ export class RTECodeBlock extends RTEBlock {
|
|
|
72
72
|
* @inheritDoc
|
|
73
73
|
*/
|
|
74
74
|
isNotEmpty() {
|
|
75
|
-
return !!this.
|
|
75
|
+
return !!this.children.length;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* @inheritDoc
|
|
79
79
|
*/
|
|
80
80
|
getLastNode() {
|
|
81
|
-
return this.
|
|
81
|
+
return this.children[0];
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* The code block is selected or not.
|
|
@@ -86,7 +86,7 @@ export class RTECodeBlock extends RTEBlock {
|
|
|
86
86
|
* @returns {boolean} - The boolean result.
|
|
87
87
|
*/
|
|
88
88
|
isSelected() {
|
|
89
|
-
return this.
|
|
89
|
+
return this.children[0].annotationMap.has(InternalAnnotationTypeEnum.SELECTION_RANGE);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
(() => {
|
|
@@ -23,7 +23,7 @@ export class RTEImageBlock extends RTEBlock {
|
|
|
23
23
|
constructor(id) {
|
|
24
24
|
super(id);
|
|
25
25
|
this.type = 'image';
|
|
26
|
-
this.
|
|
26
|
+
this.children = [];
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Converts a VegaRTEImageBlock object into an RTEImageBlock object by mapping nodes and creating annotations.
|
|
@@ -34,7 +34,7 @@ export class RTEImageBlock extends RTEBlock {
|
|
|
34
34
|
static from(block) {
|
|
35
35
|
const imageBlock = new RTEImageBlock(block.id);
|
|
36
36
|
const { annotations } = block;
|
|
37
|
-
imageBlock.
|
|
37
|
+
imageBlock.children = block.nodes.map((image) => RTEImageNode.from(image, imageBlock));
|
|
38
38
|
if (annotations) {
|
|
39
39
|
Object.entries(annotations).forEach(([type, value]) => {
|
|
40
40
|
const item = this.createAnnotationEntity(type, value);
|
|
@@ -49,19 +49,19 @@ export class RTEImageBlock extends RTEBlock {
|
|
|
49
49
|
* @inheritDoc
|
|
50
50
|
*/
|
|
51
51
|
toJSON() {
|
|
52
|
-
return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.
|
|
52
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.children.map((node) => node.toJSON()) });
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* @inheritDoc
|
|
56
56
|
*/
|
|
57
57
|
isNotEmpty() {
|
|
58
|
-
return this.
|
|
58
|
+
return this.children.length > 0 && this.children.some((node) => node.url.length > 0);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* @inheritDoc
|
|
62
62
|
*/
|
|
63
63
|
getLastNode() {
|
|
64
|
-
return this.
|
|
64
|
+
return this.children[this.children.length - 1];
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Create a new image block.
|
|
@@ -76,9 +76,9 @@ export class RTEImageBlock extends RTEBlock {
|
|
|
76
76
|
*/
|
|
77
77
|
clone() {
|
|
78
78
|
const clonedBlock = new RTEImageBlock(this.id);
|
|
79
|
-
clonedBlock.
|
|
79
|
+
clonedBlock.children = this.children.map((node) => {
|
|
80
80
|
const clonedNode = node.clone();
|
|
81
|
-
clonedNode.
|
|
81
|
+
clonedNode.parent = clonedBlock;
|
|
82
82
|
return clonedNode;
|
|
83
83
|
});
|
|
84
84
|
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
@@ -16,7 +16,7 @@ export class RTEListBlock extends RTEBlock {
|
|
|
16
16
|
constructor(id, type) {
|
|
17
17
|
super(id);
|
|
18
18
|
this.type = 'bullet-list';
|
|
19
|
-
this.
|
|
19
|
+
this.children = [];
|
|
20
20
|
this.type = type;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -27,7 +27,7 @@ export class RTEListBlock extends RTEBlock {
|
|
|
27
27
|
*/
|
|
28
28
|
static from(block) {
|
|
29
29
|
const listBlock = new RTEListBlock(block.id, block.type);
|
|
30
|
-
listBlock.
|
|
30
|
+
listBlock.children = block.blocks.map((item) => {
|
|
31
31
|
const listItemBlock = RTEListItemBlock.from(item);
|
|
32
32
|
listItemBlock.parent = listBlock;
|
|
33
33
|
return listItemBlock;
|
|
@@ -38,26 +38,26 @@ export class RTEListBlock extends RTEBlock {
|
|
|
38
38
|
* @inheritDoc
|
|
39
39
|
*/
|
|
40
40
|
toJSON() {
|
|
41
|
-
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.
|
|
41
|
+
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.children.map((block) => block.toJSON()) });
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* @inheritDoc
|
|
45
45
|
*/
|
|
46
46
|
isNotEmpty() {
|
|
47
|
-
return this.
|
|
47
|
+
return this.children.length > 0;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* @inheritDoc
|
|
51
51
|
*/
|
|
52
52
|
getLastNode() {
|
|
53
|
-
return this.
|
|
53
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* @inheritDoc
|
|
57
57
|
*/
|
|
58
58
|
clone() {
|
|
59
59
|
const clonedListBlock = new RTEListBlock(this.id, this.type);
|
|
60
|
-
clonedListBlock.
|
|
60
|
+
clonedListBlock.children = this.children.map((item) => {
|
|
61
61
|
const clonedListItemBlock = item.clone();
|
|
62
62
|
clonedListItemBlock.parent = clonedListBlock;
|
|
63
63
|
return clonedListItemBlock;
|
|
@@ -23,10 +23,16 @@ import { BlockInsertNodesBeforeNodeStrategy } from '../action-handle-strategies/
|
|
|
23
23
|
* List item block
|
|
24
24
|
*/
|
|
25
25
|
export class RTEListItemBlock extends RTETextBlock {
|
|
26
|
-
constructor(id,
|
|
26
|
+
constructor(id, nestList) {
|
|
27
27
|
super(id, 'list-item');
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* TODO: Refactor the list item properties children and nestList, merge two properties together.
|
|
30
|
+
*
|
|
31
|
+
* 1. Update the type of `children` to include `RTEListBlock` as a possible type.
|
|
32
|
+
* 2. The list block children should text block array and nest list block array, The text block should wrap a `li` tag when rendering.
|
|
33
|
+
*/
|
|
34
|
+
this.nestList = [];
|
|
35
|
+
this.nestList = nestList;
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
32
38
|
* Converts a VegaRTEListItemBlock object to an RTEListItemBlock
|
|
@@ -36,9 +42,9 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
36
42
|
*/
|
|
37
43
|
static from(block) {
|
|
38
44
|
const listItemBlock = new RTEListItemBlock(block.id);
|
|
39
|
-
listItemBlock.
|
|
45
|
+
listItemBlock.children = block.nodes.map((richText) => RTETextNode.from(richText, listItemBlock));
|
|
40
46
|
if (block.children) {
|
|
41
|
-
listItemBlock.
|
|
47
|
+
listItemBlock.nestList = block.children.map((child) => {
|
|
42
48
|
const listBlock = RTEListBlock.from(child);
|
|
43
49
|
listBlock.parent = listItemBlock;
|
|
44
50
|
return listBlock;
|
|
@@ -60,14 +66,14 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
60
66
|
*/
|
|
61
67
|
toJSON() {
|
|
62
68
|
var _a;
|
|
63
|
-
return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.
|
|
69
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.nestList) === null || _a === void 0 ? void 0 : _a.map((block) => block.toJSON()) });
|
|
64
70
|
}
|
|
65
71
|
/**
|
|
66
72
|
* @inheritDoc
|
|
67
73
|
*/
|
|
68
74
|
cloneWithNodes(nodes) {
|
|
69
75
|
const block = new RTEListItemBlock(generateUUID());
|
|
70
|
-
block.
|
|
76
|
+
block.children = [];
|
|
71
77
|
block.apply(new AppendChildNodesAction(nodes));
|
|
72
78
|
return block;
|
|
73
79
|
}
|
|
@@ -75,8 +81,8 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
75
81
|
* @inheritDoc
|
|
76
82
|
*/
|
|
77
83
|
getLastNode() {
|
|
78
|
-
if (this.
|
|
79
|
-
const childListBlock = this.
|
|
84
|
+
if (this.nestList && this.nestList.length > 0) {
|
|
85
|
+
const childListBlock = this.nestList[this.nestList.length - 1];
|
|
80
86
|
return childListBlock.getLastNode();
|
|
81
87
|
}
|
|
82
88
|
return super.getLastNode();
|
|
@@ -95,13 +101,13 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
95
101
|
clone() {
|
|
96
102
|
var _a;
|
|
97
103
|
const block = new RTEListItemBlock(this.id);
|
|
98
|
-
block.
|
|
104
|
+
block.children = this.children.map((node) => {
|
|
99
105
|
const clonedNode = node.clone();
|
|
100
|
-
clonedNode.
|
|
106
|
+
clonedNode.parent = block;
|
|
101
107
|
return clonedNode;
|
|
102
108
|
});
|
|
103
109
|
block.annotationMap = super.cloneAnnotations();
|
|
104
|
-
block.
|
|
110
|
+
block.nestList = (_a = this.nestList) === null || _a === void 0 ? void 0 : _a.map((child) => {
|
|
105
111
|
const clonedChild = child.clone();
|
|
106
112
|
clonedChild.parent = block;
|
|
107
113
|
return clonedChild;
|
|
@@ -30,7 +30,7 @@ import { BlockTransformToListStrategy } from '../action-handle-strategies/modify
|
|
|
30
30
|
export class RTETextBlock extends RTEBlock {
|
|
31
31
|
constructor(id, type) {
|
|
32
32
|
super(id);
|
|
33
|
-
this.
|
|
33
|
+
this.children = [];
|
|
34
34
|
this.type = type;
|
|
35
35
|
if (RTETextBlock.isAcceptableTextStyle(type)) {
|
|
36
36
|
this.annotationMap = new Map([TextStyleAnnotation.from(type)]);
|
|
@@ -48,7 +48,7 @@ export class RTETextBlock extends RTEBlock {
|
|
|
48
48
|
static from(block) {
|
|
49
49
|
const textBlock = new RTETextBlock(block.id, block.type);
|
|
50
50
|
const { annotations } = block;
|
|
51
|
-
textBlock.
|
|
51
|
+
textBlock.children = block.nodes.map((richText) => RTETextNode.from(richText, textBlock));
|
|
52
52
|
if (annotations) {
|
|
53
53
|
Object.entries(annotations).forEach(([type, value]) => {
|
|
54
54
|
const item = this.createAnnotationEntity(type, value);
|
|
@@ -104,7 +104,7 @@ export class RTETextBlock extends RTEBlock {
|
|
|
104
104
|
* @param {AnnotationAction} action - AnnotationAction
|
|
105
105
|
*/
|
|
106
106
|
mergeNodes(action) {
|
|
107
|
-
this.
|
|
107
|
+
this.children = this.children.reduce((prev, cur) => {
|
|
108
108
|
const lastNode = prev.at(-1);
|
|
109
109
|
if (action instanceof LinkAnnotationAction && action.needMergeNode) {
|
|
110
110
|
const lastNodeLinkAnnotation = lastNode === null || lastNode === void 0 ? void 0 : lastNode.getAnnotationByType(NodeAnnotationTypeEnum.LINK);
|
|
@@ -123,7 +123,7 @@ export class RTETextBlock extends RTEBlock {
|
|
|
123
123
|
* @inheritDoc
|
|
124
124
|
*/
|
|
125
125
|
toJSON() {
|
|
126
|
-
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, nodes: this.
|
|
126
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, nodes: this.children.map((node) => node.toJSON()) });
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
129
|
* Clone the nodes to a new block
|
|
@@ -133,7 +133,7 @@ export class RTETextBlock extends RTEBlock {
|
|
|
133
133
|
*/
|
|
134
134
|
cloneWithNodes(nodes) {
|
|
135
135
|
const block = new RTETextBlock(generateUUID(), this.type);
|
|
136
|
-
block.
|
|
136
|
+
block.children = [];
|
|
137
137
|
block.apply(new AppendChildNodesAction(nodes));
|
|
138
138
|
return block;
|
|
139
139
|
}
|
|
@@ -142,9 +142,9 @@ export class RTETextBlock extends RTEBlock {
|
|
|
142
142
|
*/
|
|
143
143
|
clone() {
|
|
144
144
|
const clonedBlock = new RTETextBlock(this.id, this.type);
|
|
145
|
-
clonedBlock.
|
|
145
|
+
clonedBlock.children = this.children.map((node) => {
|
|
146
146
|
const clonedNode = node.clone();
|
|
147
|
-
clonedNode.
|
|
147
|
+
clonedNode.parent = clonedBlock;
|
|
148
148
|
return clonedNode;
|
|
149
149
|
});
|
|
150
150
|
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
@@ -155,13 +155,13 @@ export class RTETextBlock extends RTEBlock {
|
|
|
155
155
|
* @inheritDoc
|
|
156
156
|
*/
|
|
157
157
|
isNotEmpty() {
|
|
158
|
-
return this.
|
|
158
|
+
return this.children.length > 0 && this.children.some((node) => !node.isEmpty());
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* @inheritDoc
|
|
162
162
|
*/
|
|
163
163
|
getLastNode() {
|
|
164
|
-
return this.
|
|
164
|
+
return this.children[this.children.length - 1];
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* Create new empty paragraph.
|
|
@@ -21,7 +21,7 @@ export class VegaRTEContent {
|
|
|
21
21
|
blocks.forEach((block) => {
|
|
22
22
|
block.parent = this;
|
|
23
23
|
});
|
|
24
|
-
this.
|
|
24
|
+
this.children = blocks;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Converts a JSON array of blocks to a class array of RTEContentBlock.
|
|
@@ -82,8 +82,8 @@ export class VegaRTEContent {
|
|
|
82
82
|
*/
|
|
83
83
|
clone(deep = false) {
|
|
84
84
|
return deep
|
|
85
|
-
? new VegaRTEContent(this.
|
|
86
|
-
: new VegaRTEContent([...this.
|
|
85
|
+
? new VegaRTEContent(this.children.map((block) => block.clone()))
|
|
86
|
+
: new VegaRTEContent([...this.children]);
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Converts the content state to a JSON array of blocks.
|
|
@@ -91,7 +91,7 @@ export class VegaRTEContent {
|
|
|
91
91
|
* @returns {VegaRTEContentBlock[]} The JSON array of blocks.
|
|
92
92
|
*/
|
|
93
93
|
toJSON() {
|
|
94
|
-
return this.
|
|
94
|
+
return this.children.map((block) => block.toJSON());
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* Internal method to add the block item, remove the block item
|
|
@@ -108,9 +108,9 @@ export class VegaRTEContent {
|
|
|
108
108
|
* @returns {RTEListItemBlock} list item block dto.
|
|
109
109
|
*/
|
|
110
110
|
toListItem(block) {
|
|
111
|
-
block.
|
|
111
|
+
block.children.map((node) => node.apply(new SyncUpSelectionAction()));
|
|
112
112
|
const listItemBlock = new RTEListItemBlock(generateUUID());
|
|
113
|
-
listItemBlock.apply(new AppendChildNodesAction(block['
|
|
113
|
+
listItemBlock.apply(new AppendChildNodesAction(block['children']));
|
|
114
114
|
listItemBlock['annotationMap'] = block['annotationMap'];
|
|
115
115
|
return listItemBlock;
|
|
116
116
|
}
|
|
@@ -130,7 +130,7 @@ export class VegaRTEContent {
|
|
|
130
130
|
* @returns {Nullable<RTENode>} The found node or null if not found.
|
|
131
131
|
*/
|
|
132
132
|
findNodeById(id) {
|
|
133
|
-
return this.findNodeInBlocksById(id, this.
|
|
133
|
+
return this.findNodeInBlocksById(id, this.children);
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
136
|
* Recursively searches for a node by its ID in the given blocks.
|
|
@@ -141,23 +141,23 @@ export class VegaRTEContent {
|
|
|
141
141
|
*/
|
|
142
142
|
findNodeInBlocksById(id, blocks) {
|
|
143
143
|
for (const block of blocks) {
|
|
144
|
-
if ('
|
|
145
|
-
for (const node of block.
|
|
144
|
+
if ('children' in block) {
|
|
145
|
+
for (const node of block.children) {
|
|
146
146
|
if (node.id === id) {
|
|
147
147
|
return node;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
if (block instanceof RTEListItemBlock && block.
|
|
152
|
-
for (const cBlock of block.
|
|
153
|
-
const foundNode = this.findNodeInBlocksById(id, cBlock.
|
|
151
|
+
if (block instanceof RTEListItemBlock && block.nestList) {
|
|
152
|
+
for (const cBlock of block.nestList) {
|
|
153
|
+
const foundNode = this.findNodeInBlocksById(id, cBlock.children);
|
|
154
154
|
if (foundNode) {
|
|
155
155
|
return foundNode;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
if (block instanceof RTEListBlock && block.
|
|
160
|
-
const foundNode = this.findNodeInBlocksById(id, block.
|
|
159
|
+
if (block instanceof RTEListBlock && block.children) {
|
|
160
|
+
const foundNode = this.findNodeInBlocksById(id, block.children);
|
|
161
161
|
if (foundNode) {
|
|
162
162
|
return foundNode;
|
|
163
163
|
}
|
|
@@ -14,7 +14,7 @@ export class RTECodeBlockNode extends RTENode {
|
|
|
14
14
|
this.text = '';
|
|
15
15
|
this.annotationMap = new Map();
|
|
16
16
|
this.text = content;
|
|
17
|
-
this.
|
|
17
|
+
this.parent = parentBlock;
|
|
18
18
|
this.language = language;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -29,7 +29,7 @@ export class RTECodeBlockNode extends RTENode {
|
|
|
29
29
|
* @inheritDoc
|
|
30
30
|
*/
|
|
31
31
|
clone() {
|
|
32
|
-
return new RTECodeBlockNode(this.id, this.text, this.language, this.
|
|
32
|
+
return new RTECodeBlockNode(this.id, this.text, this.language, this.parent);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* @inheritDoc
|
|
@@ -15,7 +15,7 @@ export class RTEImageNode extends RTENode {
|
|
|
15
15
|
super(id, annotationMap);
|
|
16
16
|
this.type = NodeTypeEnum.IMAGE;
|
|
17
17
|
this.url = url;
|
|
18
|
-
this.
|
|
18
|
+
this.parent = parentBlock;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Converts a VegaRTEImageNode into an RTEImageNode by mapping nodes and creating annotations.
|
|
@@ -56,7 +56,7 @@ export class RTEImageNode extends RTENode {
|
|
|
56
56
|
* @inheritDoc
|
|
57
57
|
*/
|
|
58
58
|
clone() {
|
|
59
|
-
return new RTEImageNode(this.id, this.url, this.
|
|
59
|
+
return new RTEImageNode(this.id, this.url, this.parent, super.cloneAnnotations());
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* @inheritDoc
|
|
@@ -33,7 +33,7 @@ export class RTETextNode extends RTENode {
|
|
|
33
33
|
constructor(id, text, parentBlock, annotationMap) {
|
|
34
34
|
super(id, annotationMap);
|
|
35
35
|
this.type = NodeTypeEnum.TEXT;
|
|
36
|
-
this.
|
|
36
|
+
this.parent = parentBlock;
|
|
37
37
|
this.text = text;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -102,13 +102,13 @@ export class RTETextNode extends RTENode {
|
|
|
102
102
|
* @returns {RTETextNode} An new RTETextNode
|
|
103
103
|
*/
|
|
104
104
|
cloneWithText(text) {
|
|
105
|
-
return new RTETextNode(generateUUID(), text, this.
|
|
105
|
+
return new RTETextNode(generateUUID(), text, this.parent, super.cloneAnnotations());
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* @inheritDoc
|
|
109
109
|
*/
|
|
110
110
|
clone() {
|
|
111
|
-
return new RTETextNode(this.id, this.text, this.
|
|
111
|
+
return new RTETextNode(this.id, this.text, this.parent, super.cloneAnnotations());
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
114
|
* Checks if a node is empty
|
|
@@ -135,7 +135,7 @@ export class RTETextNode extends RTENode {
|
|
|
135
135
|
else {
|
|
136
136
|
this.applyActionToNode(this, action);
|
|
137
137
|
}
|
|
138
|
-
this.
|
|
138
|
+
this.parent.mergeNodes(action);
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* @inheritDoc
|
|
@@ -17,8 +17,8 @@ export class RTEBlockTextNodesRenderer extends RTEBlockRenderer {
|
|
|
17
17
|
renderNodes(block, renderContext) {
|
|
18
18
|
const linkGroupAnnotation = block.getAnnotationByType(InternalAnnotationTypeEnum.LINK_GROUP);
|
|
19
19
|
return linkGroupAnnotation
|
|
20
|
-
? this.renderLinkNodes(block.
|
|
21
|
-
: block.
|
|
20
|
+
? this.renderLinkNodes(block.children, renderContext)
|
|
21
|
+
: block.children.map((node) => RTETextNodeRenderer.render(node));
|
|
22
22
|
}
|
|
23
23
|
renderLinkNodes(nodes, { editable }) {
|
|
24
24
|
const blockNodes = this.groupNodesByLink(nodes);
|
package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js
CHANGED
|
@@ -39,7 +39,7 @@ class RTECodeBlockRenderer extends RTEBlockRenderer {
|
|
|
39
39
|
* @returns {HTMLElement} - The code block container element and code node elements.
|
|
40
40
|
*/
|
|
41
41
|
render(block, renderContext) {
|
|
42
|
-
const { id, nodes } = block;
|
|
42
|
+
const { id, children: nodes } = block;
|
|
43
43
|
return (
|
|
44
44
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
45
45
|
h("pre", { key: id, class: "code-block-container", ref: (node) => this.registerRef(node, block), onKeyDown: this.preventParentDoFocus, onClick: this.preventParentDoFocus, "data-language": nodes[0].language },
|
|
@@ -7,7 +7,7 @@ class RTEImageBlockRenderer extends RTEBlockRenderer {
|
|
|
7
7
|
return block instanceof RTEImageBlock;
|
|
8
8
|
}
|
|
9
9
|
render(block, renderContext) {
|
|
10
|
-
return (h("div", { key: block.id, style: Object.assign({}, super.getStyles(block)), ref: (ref) => super.registerRef(ref, block), class: super.getClasses(block) }, block.
|
|
10
|
+
return (h("div", { key: block.id, style: Object.assign({}, super.getStyles(block)), ref: (ref) => super.registerRef(ref, block), class: super.getClasses(block) }, block.children.map((node) => {
|
|
11
11
|
return RTEImageNodeRenderer.render(node, renderContext);
|
|
12
12
|
})));
|
|
13
13
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js
CHANGED
|
@@ -8,7 +8,7 @@ class RTEListBlockRenderer extends RTEBlockRenderer {
|
|
|
8
8
|
}
|
|
9
9
|
render(block, renderContext) {
|
|
10
10
|
const BlockTag = block.type === 'number-list' ? 'ol' : 'ul';
|
|
11
|
-
return (h(BlockTag, { key: block.id, ref: (ref) => super.registerRef(ref, block) }, block.
|
|
11
|
+
return (h(BlockTag, { key: block.id, ref: (ref) => super.registerRef(ref, block) }, block.children.map((listItemBlock) => RTEListItemBlockRenderer.render(listItemBlock, renderContext))));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export default new RTEListBlockRenderer();
|
|
@@ -5,7 +5,7 @@ class RTEListItemBlockRenderer extends RTEBlockTextNodesRenderer {
|
|
|
5
5
|
render(block, renderContext) {
|
|
6
6
|
return (h("li", { key: block.id, ref: (ref) => super.registerRef(ref, block), style: super.getStyles(block), class: super.getClasses(block) },
|
|
7
7
|
super.renderNodes(block, renderContext),
|
|
8
|
-
this.renderChildren(block.
|
|
8
|
+
this.renderChildren(block.nestList, renderContext)));
|
|
9
9
|
}
|
|
10
10
|
renderChildren(children, renderContext) {
|
|
11
11
|
return children === null || children === void 0 ? void 0 : children.map((block) => RTEListBlockRenderer.render(block, renderContext));
|
|
@@ -28,7 +28,7 @@ class RTECodeBlockNodeRenderer extends RTENodeRenderer {
|
|
|
28
28
|
const { code, language } = codeBlockValue;
|
|
29
29
|
if (this.shouldSwitchOutOfCodeBlock(node.text, code)) {
|
|
30
30
|
const switchAction = new SwitchOutFromCodeBlockAction(code, language);
|
|
31
|
-
node.
|
|
31
|
+
node.parent.apply(switchAction);
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
node.apply(new UpdateCodeBlockAction(code, language));
|
|
@@ -42,7 +42,7 @@ class RTECodeBlockNodeRenderer extends RTENodeRenderer {
|
|
|
42
42
|
*/
|
|
43
43
|
handleCodeBlockRemove(input, node) {
|
|
44
44
|
input.preventDefault();
|
|
45
|
-
node.
|
|
45
|
+
node.parent.apply(new RemoveCodeBlockAction());
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* The cursor should jump out of code block if enter three line breaks at the end.
|
|
@@ -80,7 +80,7 @@ export class DeleteSelectedNodesController extends VegaSlimmer {
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
shouldRemovedItems.forEach((item) => {
|
|
83
|
-
item.
|
|
83
|
+
item.parent.apply(new RemoveChildAction(item));
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
this.removeRangeStartAndEndSelectedText();
|
|
@@ -93,23 +93,23 @@ export class DeleteSelectedNodesController extends VegaSlimmer {
|
|
|
93
93
|
startOffset !== 1 &&
|
|
94
94
|
(endNode !== startNode || endOffset !== 0)) {
|
|
95
95
|
// the image block will be deleted when the image is the only item
|
|
96
|
-
if (startNode.
|
|
96
|
+
if (startNode.parent.children.length === 1) {
|
|
97
97
|
const paragraph = this.createEmptyParagraph();
|
|
98
|
-
startNode.
|
|
99
|
-
startNode.
|
|
100
|
-
return paragraph.
|
|
98
|
+
startNode.parent.parent.apply(new InsertBlocksBeforeAction(startNode.parent, paragraph));
|
|
99
|
+
startNode.parent.apply(new RemoveChildAction(startNode));
|
|
100
|
+
return paragraph.children[0];
|
|
101
101
|
}
|
|
102
|
-
else if (startNode === startNode.
|
|
102
|
+
else if (startNode === startNode.parent.children[0]) {
|
|
103
103
|
// the start node should be the next image item if the image is first item
|
|
104
|
-
startNode.
|
|
105
|
-
return startNode.
|
|
104
|
+
startNode.parent.apply(new RemoveChildAction(startNode));
|
|
105
|
+
return startNode.parent.children[0];
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
else if (startNode instanceof RTECodeBlockNode) {
|
|
109
109
|
const paragraph = this.createEmptyParagraph();
|
|
110
|
-
startNode.
|
|
111
|
-
startNode.
|
|
112
|
-
return paragraph.
|
|
110
|
+
startNode.parent.parent.apply(new InsertBlocksBeforeAction(startNode.parent, paragraph));
|
|
111
|
+
startNode.parent.apply(new RemoveChildAction(startNode));
|
|
112
|
+
return paragraph.children[0];
|
|
113
113
|
}
|
|
114
114
|
return startNode;
|
|
115
115
|
}
|
|
@@ -149,24 +149,24 @@ export class DeleteSelectedNodesController extends VegaSlimmer {
|
|
|
149
149
|
const selectedNodes = this.selectionController.getSelectedNodes();
|
|
150
150
|
const startRTENode = selectedNodes[0];
|
|
151
151
|
const endRTENode = selectedNodes[selectedNodes.length - 1];
|
|
152
|
-
if (startRTENode && startRTENode.
|
|
153
|
-
const endBlock = endRTENode.
|
|
152
|
+
if (startRTENode && startRTENode.parent && endRTENode && endRTENode.parent) {
|
|
153
|
+
const endBlock = endRTENode.parent;
|
|
154
154
|
if (this.shouldMergeTextNode(startRTENode, endRTENode)) {
|
|
155
155
|
startRTENode.apply(new UpdateTextAction(startRTENode.text + endRTENode.text));
|
|
156
|
-
if (startRTENode.
|
|
157
|
-
startRTENode.
|
|
156
|
+
if (startRTENode.parent === endRTENode.parent) {
|
|
157
|
+
startRTENode.parent.apply(new RemoveChildAction(endRTENode));
|
|
158
158
|
}
|
|
159
159
|
else {
|
|
160
|
-
endRTENode.
|
|
160
|
+
endRTENode.parent.apply(new RemoveChildAction(endRTENode.parent.children[0]));
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
if (startRTENode instanceof RTETextNode &&
|
|
164
164
|
endRTENode instanceof RTETextNode &&
|
|
165
|
-
startRTENode.
|
|
166
|
-
startRTENode.
|
|
167
|
-
endBlock.
|
|
165
|
+
startRTENode.parent !== endRTENode.parent) {
|
|
166
|
+
startRTENode.parent.apply(new AppendChildNodesAction(endBlock.children));
|
|
167
|
+
endBlock.children = [];
|
|
168
168
|
}
|
|
169
|
-
if (endBlock.
|
|
169
|
+
if (endBlock.children.length < 1) {
|
|
170
170
|
endBlock.parent.apply(new RemoveChildAction(endBlock));
|
|
171
171
|
}
|
|
172
172
|
}
|
package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js
CHANGED
|
@@ -33,7 +33,7 @@ export class FocusController extends VegaSlimmer {
|
|
|
33
33
|
* @returns {Promise<void>} - A promise that resolves when the focus is set
|
|
34
34
|
*/
|
|
35
35
|
async focusOnLastTextNode(options) {
|
|
36
|
-
const lastBlock = this.value.
|
|
36
|
+
const lastBlock = this.value.children[this.value.children.length - 1];
|
|
37
37
|
if (!(lastBlock instanceof RTETextBlock) || (options === null || options === void 0 ? void 0 : options.newLine)) {
|
|
38
38
|
const newTextBlock = RTETextBlock.from({
|
|
39
39
|
id: generateUUID(),
|
|
@@ -36,7 +36,7 @@ export class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstrac
|
|
|
36
36
|
* @param {RTEListItemBlock[]} childBlocks - Current list blocks.
|
|
37
37
|
*/
|
|
38
38
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
39
|
-
currentBlock.
|
|
39
|
+
currentBlock.nestList = childBlocks.filter((block) => ['bullet-list', 'number-list'].includes(block.type));
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Should continue process to child elements.
|
|
@@ -36,7 +36,7 @@ export class OlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
36
36
|
* @param {RTEListItemBlock[]} childBlocks - Current list item blocks.
|
|
37
37
|
*/
|
|
38
38
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
39
|
-
currentBlock.
|
|
39
|
+
currentBlock.children = childBlocks;
|
|
40
40
|
childBlocks.forEach((block) => (block.parent = currentBlock));
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
@@ -36,7 +36,7 @@ export class UlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
36
36
|
* @param {RTEListItemBlock[]} childBlocks - Current list item blocks.
|
|
37
37
|
*/
|
|
38
38
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
39
|
-
currentBlock.
|
|
39
|
+
currentBlock.children = childBlocks;
|
|
40
40
|
childBlocks.forEach((block) => (block.parent = currentBlock));
|
|
41
41
|
}
|
|
42
42
|
/**
|