@globalpayments/vega 2.47.1 → 2.49.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-fdf98585.js → app-globals-e17dedba.js} +3 -3
- package/dist/cjs/{content-state-b1ec39e3.js → content-state-6a48bcb5.js} +240 -5
- package/dist/cjs/{design-token-0c22ffa8.js → design-token-6e2c52f1.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-b3109dd1.js → element-appender-slimmer-9fb99abd.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-2432e295.js → form-field-controller-slimmer-527c25a0.js} +2 -2
- package/dist/cjs/{image-annotation-action-becd6f24.js → image-annotation-action-9c2b9c8e.js} +1 -1
- package/dist/cjs/{index-ec9a1f36.js → index-c4dec3aa.js} +1 -1
- package/dist/cjs/index.cjs.js +6 -6
- package/dist/cjs/{inject-keyboard-manager-d1eac696.js → inject-keyboard-manager-b301e887.js} +1 -1
- package/dist/cjs/{keyboard-manager-97d0ddfa.js → keyboard-manager-2ccf4b16.js} +25 -5
- package/dist/cjs/{keyboard-manager-slimmer-23ce5dcf.js → keyboard-manager-slimmer-900cf2f5.js} +1 -1
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{min-number-rule-5bcccc8f.js → min-number-rule-965fc43d.js} +2 -2
- package/dist/cjs/{public-rules-3c2a69b4.js → public-rules-10ec636d.js} +3 -3
- package/dist/cjs/{responsive-format-facade-e48962dd.js → responsive-format-facade-9be0a851.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-f08f5891.js → rich-text-editor-required-rule-5faded94.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-56a2401f.js → string-input-formatter-slimmer-50322824.js} +2 -2
- package/dist/cjs/{style-formatter-48ef74d4.js → style-formatter-5b95a2a6.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-b16c9094.js → sub-state-notify-slimmer-7f437b19.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-1b6de09f.js → sub-state-observer-slimmer-e90362cd.js} +1 -1
- 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-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_3.cjs.entry.js +3 -3
- 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 +3 -3
- package/dist/cjs/vega-chip.cjs.entry.js +4 -4
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-combo-box.cjs.entry.js +5 -5
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +10 -10
- 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 +8 -8
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- 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-form.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 +16 -7
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +11 -8
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
- package/dist/cjs/vega-input.cjs.entry.js +8 -8
- package/dist/cjs/{vega-internal-event-id-dc866d43.js → vega-internal-event-id-bfea9b93.js} +4 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +447 -194
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-radio_2.cjs.entry.js +8 -5
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +19 -13
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +480 -196
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +5 -5
- package/dist/cjs/vega-signature-capture.cjs.entry.js +6 -6
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +55 -19
- package/dist/cjs/vega-table_8.cjs.entry.js +5 -5
- package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +10 -4
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +11 -11
- package/dist/cjs/vega.cjs.js +5 -5
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-actions-renderer.js +4 -1
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +11 -1
- package/dist/collection/components/vega-input/vega-input.js +4 -4
- package/dist/collection/components/vega-nav/slimmers/vega-left-nav-group-hierarchy-controller.js +31 -0
- package/dist/collection/components/vega-nav/vega-left-nav/test/vega-left-nav-mock-data.js +147 -0
- package/dist/collection/components/vega-nav/vega-left-nav/vega-left-nav.js +42 -8
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-initialize-selected-controller.js +56 -0
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-link-click-controller.js +70 -0
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-open-state-controller.js +47 -0
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-other-groups-click-controller.js +60 -0
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/renderers/vega-left-nav-group-renderer.js +10 -9
- package/dist/collection/components/vega-nav/vega-left-nav-group/vega-left-nav-group.js +21 -6
- package/dist/collection/components/vega-nav/vega-left-nav-link/slimmers/controllers/vega-left-nav-link-controller.js +21 -0
- package/dist/collection/components/vega-nav/vega-left-nav-link/slimmers/renderers/vega-left-nav-link-renderer.js +13 -1
- package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.js +5 -0
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +7 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +6 -0
- 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/image-block.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +25 -1
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +47 -2
- package/dist/collection/components/vega-rich-text-editor/dto/editor-state.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +7 -1
- package/dist/collection/components/vega-rich-text-editor/dto/range.js +8 -0
- 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/blocks/text-block-renderer.js +7 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/selection-state.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +15 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +3 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.js +16 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +18 -15
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/history-controller.js +137 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +54 -15
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +13 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +116 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/slimmers/renderers/vega-rich-text-image-editor-renderer.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.js +2 -1
- package/dist/collection/components/vega-stepper/vega-stepper.js +2 -2
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.js +22 -12
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-renderer.js +6 -2
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.js +20 -4
- package/dist/collection/components/vega-tab-group/vega-tab-group.css +16 -0
- package/dist/collection/components/vega-tab-group/vega-tab-group.js +32 -0
- package/dist/collection/components/vega-toggle-switch/vega-toggle-switch.js +8 -2
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +2 -0
- package/dist/collection/helpers/keyboard/keyboard-manager.js +25 -5
- package/dist/collection/helpers/keyboard/test/keyboard-manager.test.js +204 -105
- package/dist/collection/helpers/validator/rules/max-number-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/min-number-rule.js +1 -1
- package/dist/collection/helpers/validator/test/rules/max-number-rule.test.js +2 -2
- package/dist/collection/helpers/validator/test/rules/min-number-rule.test.js +2 -2
- package/dist/esm/{app-globals-53b6125a.js → app-globals-b7b43a4e.js} +3 -3
- package/dist/esm/{content-state-7437e069.js → content-state-dbc9f635.js} +240 -5
- package/dist/esm/{design-token-fb43f78a.js → design-token-e263e6a2.js} +1 -1
- package/dist/esm/{element-appender-slimmer-0a0b20e9.js → element-appender-slimmer-55d63b1f.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-2978abd4.js → form-field-controller-slimmer-e7dc3db1.js} +2 -2
- package/dist/esm/{image-annotation-action-51248df9.js → image-annotation-action-1aa938ab.js} +1 -1
- package/dist/esm/{index-96374234.js → index-4aa167d6.js} +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/{inject-keyboard-manager-ab0bfb8b.js → inject-keyboard-manager-f513be4a.js} +1 -1
- package/dist/esm/{keyboard-manager-8c4ef91b.js → keyboard-manager-262be5ce.js} +25 -5
- package/dist/esm/{keyboard-manager-slimmer-6f5cb52a.js → keyboard-manager-slimmer-42bf9773.js} +1 -1
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{min-number-rule-a6082418.js → min-number-rule-86421853.js} +2 -2
- package/dist/esm/{public-rules-cfc196c9.js → public-rules-5cf6aa95.js} +3 -3
- package/dist/esm/{responsive-format-facade-ae799f25.js → responsive-format-facade-bc2f8ad3.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-baf61553.js → rich-text-editor-required-rule-6a7cd3ee.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-8c7987ac.js → string-input-formatter-slimmer-c61f82d6.js} +2 -2
- package/dist/esm/{style-formatter-bf71b8e7.js → style-formatter-0f221459.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-2216c7dc.js → sub-state-notify-slimmer-4e3cf09d.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-da938c88.js → sub-state-observer-slimmer-be7a6ce3.js} +1 -1
- 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-group_2.entry.js +3 -3
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_3.entry.js +3 -3
- 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 +3 -3
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-color-picker.entry.js +3 -3
- package/dist/esm/vega-combo-box.entry.js +5 -5
- package/dist/esm/vega-date-picker_2.entry.js +10 -10
- 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 +8 -8
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- 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-form.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 +16 -7
- package/dist/esm/vega-input-credit-card.entry.js +3 -3
- package/dist/esm/vega-input-numeric.entry.js +11 -8
- package/dist/esm/vega-input-phone-number.entry.js +3 -3
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +5 -5
- package/dist/esm/vega-input.entry.js +8 -8
- package/dist/esm/{vega-internal-event-id-7d1ff289.js → vega-internal-event-id-85ad403f.js} +3 -1
- package/dist/esm/vega-left-nav_5.entry.js +447 -194
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination.entry.js +3 -3
- package/dist/esm/vega-popover_2.entry.js +11 -11
- package/dist/esm/vega-radio_2.entry.js +8 -5
- package/dist/esm/vega-rich-text-content.entry.js +19 -13
- package/dist/esm/vega-rich-text-editor_4.entry.js +480 -196
- package/dist/esm/vega-selection-chip_2.entry.js +6 -6
- package/dist/esm/vega-selection-tile_2.entry.js +4 -4
- package/dist/esm/vega-sidenav_3.entry.js +5 -5
- package/dist/esm/vega-signature-capture.entry.js +6 -6
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-tab-group_2.entry.js +55 -19
- package/dist/esm/vega-table_8.entry.js +5 -5
- package/dist/esm/vega-textarea.entry.js +3 -3
- package/dist/esm/vega-time-picker_2.entry.js +8 -8
- package/dist/esm/vega-toggle-switch.entry.js +10 -4
- package/dist/esm/vega-tooltip_2.entry.js +11 -11
- package/dist/esm/vega.js +5 -5
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-actions-renderer.d.ts +1 -0
- package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +3 -0
- package/dist/types/components/vega-input/vega-input.d.ts +2 -2
- package/dist/types/components/vega-nav/interface.d.ts +11 -0
- package/dist/types/components/vega-nav/slimmers/vega-left-nav-group-hierarchy-controller.d.ts +15 -0
- package/dist/types/components/vega-nav/vega-left-nav/test/vega-left-nav-mock-data.d.ts +4 -0
- package/dist/types/components/vega-nav/vega-left-nav/vega-left-nav.d.ts +21 -4
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-initialize-selected-controller.d.ts +20 -0
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-link-click-controller.d.ts +25 -0
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-open-state-controller.d.ts +27 -0
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-other-groups-click-controller.d.ts +17 -0
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/renderers/vega-left-nav-group-renderer.d.ts +2 -1
- package/dist/types/components/vega-nav/vega-left-nav-group/vega-left-nav-group.d.ts +12 -5
- package/dist/types/components/vega-nav/vega-left-nav-link/slimmers/controllers/vega-left-nav-link-controller.d.ts +5 -0
- package/dist/types/components/vega-nav/vega-left-nav-link/slimmers/renderers/vega-left-nav-link-renderer.d.ts +2 -0
- package/dist/types/components/vega-nav/vega-left-nav-link/vega-left-nav-link.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +19 -1
- package/dist/types/components/vega-rich-text-editor/dto/editor-state.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/range.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/selection-state.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +7 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/history-controller.d.ts +54 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +14 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +4 -1
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +2 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.d.ts +1 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-renderer.d.ts +1 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.d.ts +3 -0
- package/dist/types/components/vega-tab-group/types.d.ts +2 -0
- package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +7 -1
- package/dist/types/components/vega-toggle-switch/vega-toggle-switch.d.ts +1 -0
- package/dist/types/components.d.ts +26 -14
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +2 -0
- package/dist/types/helpers/keyboard/keyboard-manager.d.ts +11 -1
- package/dist/types/types/components.type.d.ts +2 -1
- package/dist/types/types/ui.type.d.ts +1 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-df44a712.entry.js → p-01fd343e.entry.js} +1 -1
- package/dist/vega/{p-50a076d0.entry.js → p-0a18f5f6.entry.js} +1 -1
- package/dist/vega/{p-7bc3a42b.js → p-1abe125f.js} +1 -1
- package/dist/vega/{p-4b541ce8.entry.js → p-2198de3e.entry.js} +1 -1
- package/dist/vega/{p-0073c3de.entry.js → p-24e0cdcc.entry.js} +1 -1
- package/dist/vega/{p-4f7f93ef.entry.js → p-2565cb0c.entry.js} +1 -1
- package/dist/vega/p-26e4221c.entry.js +1 -0
- package/dist/vega/{p-1c08e94a.entry.js → p-27e3825f.entry.js} +1 -1
- package/dist/vega/{p-aa109e80.entry.js → p-2bd64faf.entry.js} +1 -1
- package/dist/vega/{p-ab26cad6.js → p-2da83c2a.js} +1 -1
- package/dist/vega/{p-410755ca.entry.js → p-2fadef27.entry.js} +1 -1
- package/dist/vega/{p-01b4d6ba.entry.js → p-33ffaa71.entry.js} +1 -1
- package/dist/vega/{p-343b4522.entry.js → p-34a70d18.entry.js} +1 -1
- package/dist/vega/{p-f9b07b5e.entry.js → p-353d32c0.entry.js} +1 -1
- package/dist/vega/{p-d6d9c300.entry.js → p-3aa244d4.entry.js} +1 -1
- package/dist/vega/p-429616af.entry.js +1 -0
- package/dist/vega/p-44b0a005.js +1 -0
- package/dist/vega/{p-e1a06741.entry.js → p-472727a4.entry.js} +1 -1
- package/dist/vega/p-4e167a8c.js +1 -0
- package/dist/vega/p-4e68dfd9.js +1 -0
- package/dist/vega/p-4e76904e.entry.js +1 -0
- package/dist/vega/{p-8c32ff75.entry.js → p-4fa94b35.entry.js} +1 -1
- package/dist/vega/{p-b64d5c3a.entry.js → p-52e17867.entry.js} +1 -1
- package/dist/vega/p-56a0b13d.js +1 -0
- package/dist/vega/{p-1b731247.entry.js → p-57cdacb1.entry.js} +1 -1
- package/dist/vega/{p-bcb43c54.entry.js → p-57e813f2.entry.js} +1 -1
- package/dist/vega/{p-b06e5916.entry.js → p-58b8c06b.entry.js} +1 -1
- package/dist/vega/{p-bd5ca7cc.entry.js → p-59ccf915.entry.js} +1 -1
- package/dist/vega/{p-324dd09a.entry.js → p-5a8f129f.entry.js} +1 -1
- package/dist/vega/p-5cbadf95.entry.js +1 -0
- package/dist/vega/{p-b2643e88.js → p-5e3a15a1.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-4b1a7d31.entry.js → p-63414091.entry.js} +1 -1
- package/dist/vega/{p-0b56725e.entry.js → p-6aa569e5.entry.js} +1 -1
- package/dist/vega/{p-b9f48611.js → p-6b75fe39.js} +1 -1
- package/dist/vega/{p-69cc3fa2.js → p-6cabdb36.js} +1 -1
- package/dist/vega/{p-bab6ca81.js → p-6d7d923b.js} +1 -1
- package/dist/vega/{p-b6caa1e2.entry.js → p-6ec8a9d8.entry.js} +1 -1
- package/dist/vega/{p-d7642125.js → p-72ecfd40.js} +1 -1
- package/dist/vega/p-7db32dc0.entry.js +1 -0
- package/dist/vega/{p-f0bc8f6d.js → p-7f6702f7.js} +1 -1
- package/dist/vega/{p-c706de06.entry.js → p-84aac4b1.entry.js} +1 -1
- package/dist/vega/{p-213752bd.js → p-88c9efbb.js} +1 -1
- package/dist/vega/{p-b65de502.entry.js → p-8aec8dac.entry.js} +1 -1
- package/dist/vega/{p-1e2886b5.js → p-8afa2115.js} +1 -1
- package/dist/vega/p-8bc4c015.entry.js +1 -0
- package/dist/vega/p-96b4c0cc.entry.js +1 -0
- package/dist/vega/p-a8b681ed.entry.js +1 -0
- package/dist/vega/{p-b4dfa967.entry.js → p-ac82ca73.entry.js} +1 -1
- package/dist/vega/{p-c86a4896.entry.js → p-ba6c7f00.entry.js} +1 -1
- package/dist/vega/{p-2c1c88c0.entry.js → p-be40684b.entry.js} +1 -1
- package/dist/vega/p-bf1894ec.js +1 -0
- package/dist/vega/{p-79cc1f41.entry.js → p-c1e1adf9.entry.js} +1 -1
- package/dist/vega/p-c5f8b3a3.entry.js +1 -0
- package/dist/vega/p-c754b32c.js +1 -0
- package/dist/vega/{p-d4a61b1d.entry.js → p-c96effa5.entry.js} +1 -1
- package/dist/vega/{p-d6c37085.entry.js → p-ca34443a.entry.js} +1 -1
- package/dist/vega/{p-96410d71.entry.js → p-cb637815.entry.js} +1 -1
- package/dist/vega/{p-0523efe8.entry.js → p-ccdd49be.entry.js} +1 -1
- package/dist/vega/p-cd205d96.js +1 -0
- package/dist/vega/{p-a1bdf9a0.entry.js → p-ce70a54a.entry.js} +1 -1
- package/dist/vega/{p-e5695801.entry.js → p-d6591d70.entry.js} +1 -1
- package/dist/vega/{p-80c86d79.js → p-d7937711.js} +1 -1
- package/dist/vega/{p-59e9f57a.js → p-dbc82247.js} +1 -1
- package/dist/vega/{p-d6620b42.entry.js → p-e29da13d.entry.js} +1 -1
- package/dist/vega/p-e719b1a9.entry.js +1 -0
- package/dist/vega/{p-4f54ba1f.entry.js → p-f7423232.entry.js} +1 -1
- package/dist/vega/{p-611282a7.entry.js → p-fb853d5f.entry.js} +1 -1
- package/dist/vega/{p-8f80b321.entry.js → p-fd018044.entry.js} +1 -1
- package/dist/vega/p-fda0c179.entry.js +1 -0
- package/dist/vega/p-ff41dc6a.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-controller.js +0 -30
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-sibling-observer-controller.js +0 -48
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-controller.d.ts +0 -11
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-sibling-observer-controller.d.ts +0 -18
- package/dist/vega/p-08679cd9.entry.js +0 -1
- package/dist/vega/p-12d60f5f.js +0 -1
- package/dist/vega/p-214aa52e.js +0 -1
- package/dist/vega/p-2863aa51.entry.js +0 -1
- package/dist/vega/p-2e65e175.js +0 -1
- package/dist/vega/p-31de5cb4.entry.js +0 -1
- package/dist/vega/p-3d3cd394.js +0 -1
- package/dist/vega/p-3e285c35.js +0 -1
- package/dist/vega/p-7594875a.entry.js +0 -1
- package/dist/vega/p-8af3fc79.entry.js +0 -1
- package/dist/vega/p-8ee31f00.entry.js +0 -1
- package/dist/vega/p-952913fc.entry.js +0 -1
- package/dist/vega/p-b07add9c.entry.js +0 -1
- package/dist/vega/p-b9051ad2.js +0 -1
- package/dist/vega/p-c2321aa8.entry.js +0 -1
- package/dist/vega/p-ceb9f5aa.entry.js +0 -1
- package/dist/vega/p-db7a6878.entry.js +0 -1
- package/dist/vega/p-e59ff7d1.entry.js +0 -1
- package/dist/vega/p-f2373487.js +0 -1
|
@@ -89,6 +89,26 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
89
89
|
createNewListItem() {
|
|
90
90
|
return new RTEListItemBlock(generateUUID());
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* @inheritDoc
|
|
94
|
+
*/
|
|
95
|
+
clone() {
|
|
96
|
+
var _a;
|
|
97
|
+
const block = new RTEListItemBlock(this.id);
|
|
98
|
+
block.nodes = this.nodes.map((node) => {
|
|
99
|
+
const clonedNode = node.clone();
|
|
100
|
+
clonedNode.parentBlock = block;
|
|
101
|
+
return clonedNode;
|
|
102
|
+
});
|
|
103
|
+
block.annotationMap = super.cloneAnnotations();
|
|
104
|
+
block.children = (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((child) => {
|
|
105
|
+
const clonedChild = child.clone();
|
|
106
|
+
clonedChild.parent = block;
|
|
107
|
+
return clonedChild;
|
|
108
|
+
});
|
|
109
|
+
block.parent = this.parent;
|
|
110
|
+
return block;
|
|
111
|
+
}
|
|
92
112
|
}
|
|
93
113
|
(() => {
|
|
94
114
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_BLOCK_CONTENT, RTEListItemBlock.name, new ListItemDeleteTextContentStrategy());
|
|
@@ -86,7 +86,17 @@ export class RTETextBlock extends RTEBlock {
|
|
|
86
86
|
* @returns {boolean} Return a boolean value indicating whether the `type` parameter is valid.
|
|
87
87
|
*/
|
|
88
88
|
static isAcceptableTextStyle(type) {
|
|
89
|
-
return [
|
|
89
|
+
return [
|
|
90
|
+
'title',
|
|
91
|
+
'subtitle',
|
|
92
|
+
'paragraph',
|
|
93
|
+
'heading-1',
|
|
94
|
+
'heading-2',
|
|
95
|
+
'heading-3',
|
|
96
|
+
'heading-4',
|
|
97
|
+
'heading-5',
|
|
98
|
+
'heading-6',
|
|
99
|
+
].includes(type);
|
|
90
100
|
}
|
|
91
101
|
/**
|
|
92
102
|
* Merges RTETextNode nodes based on certain conditions.
|
|
@@ -127,6 +137,20 @@ export class RTETextBlock extends RTEBlock {
|
|
|
127
137
|
block.apply(new AppendChildNodesAction(nodes));
|
|
128
138
|
return block;
|
|
129
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* @inheritDoc
|
|
142
|
+
*/
|
|
143
|
+
clone() {
|
|
144
|
+
const clonedBlock = new RTETextBlock(this.id, this.type);
|
|
145
|
+
clonedBlock.nodes = this.nodes.map((node) => {
|
|
146
|
+
const clonedNode = node.clone();
|
|
147
|
+
clonedNode.parentBlock = clonedBlock;
|
|
148
|
+
return clonedNode;
|
|
149
|
+
});
|
|
150
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
151
|
+
clonedBlock.parent = this.parent;
|
|
152
|
+
return clonedBlock;
|
|
153
|
+
}
|
|
130
154
|
/**
|
|
131
155
|
* @inheritDoc
|
|
132
156
|
*/
|
|
@@ -73,10 +73,13 @@ export class VegaRTEContent {
|
|
|
73
73
|
/**
|
|
74
74
|
* Clones the content state.
|
|
75
75
|
*
|
|
76
|
+
* @param {boolean} deep - If true, performs a deep clone of the content state.
|
|
76
77
|
* @returns {VegaRTEContent} The cloned content state.
|
|
77
78
|
*/
|
|
78
|
-
clone() {
|
|
79
|
-
return
|
|
79
|
+
clone(deep = false) {
|
|
80
|
+
return deep
|
|
81
|
+
? new VegaRTEContent(this.blocks.map((block) => block.clone()))
|
|
82
|
+
: new VegaRTEContent([...this.blocks]);
|
|
80
83
|
}
|
|
81
84
|
/**
|
|
82
85
|
* Converts the content state to a JSON array of blocks.
|
|
@@ -116,6 +119,48 @@ export class VegaRTEContent {
|
|
|
116
119
|
createList(type) {
|
|
117
120
|
return new RTEListBlock(generateUUID(), type);
|
|
118
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Finds a node by its ID in the content.
|
|
124
|
+
*
|
|
125
|
+
* @param {string} id - The ID of the node to find.
|
|
126
|
+
* @returns {Nullable<RTENode>} The found node or null if not found.
|
|
127
|
+
*/
|
|
128
|
+
findNodeById(id) {
|
|
129
|
+
return this.findNodeInBlocksById(id, this.blocks);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Recursively searches for a node by its ID in the given blocks.
|
|
133
|
+
*
|
|
134
|
+
* @param {string} id - The ID of the node to find.
|
|
135
|
+
* @param {RTEContentBlock[]} blocks - The blocks to search within.
|
|
136
|
+
* @returns {Nullable<RTENode>} The found node or null if not found.
|
|
137
|
+
*/
|
|
138
|
+
findNodeInBlocksById(id, blocks) {
|
|
139
|
+
for (const block of blocks) {
|
|
140
|
+
if ('nodes' in block) {
|
|
141
|
+
for (const node of block.nodes) {
|
|
142
|
+
if (node.id === id) {
|
|
143
|
+
return node;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (block instanceof RTEListItemBlock && block.children) {
|
|
148
|
+
for (const cBlock of block.children) {
|
|
149
|
+
const foundNode = this.findNodeInBlocksById(id, cBlock.blocks);
|
|
150
|
+
if (foundNode) {
|
|
151
|
+
return foundNode;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (block instanceof RTEListBlock && block.blocks) {
|
|
156
|
+
const foundNode = this.findNodeInBlocksById(id, block.blocks);
|
|
157
|
+
if (foundNode) {
|
|
158
|
+
return foundNode;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
119
164
|
}
|
|
120
165
|
(() => {
|
|
121
166
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, VegaRTEContent.name, new BlockRemoveChildBlockStrategy());
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the state of the RTE
|
|
3
|
+
*/
|
|
4
|
+
export class RTEEditorState {
|
|
5
|
+
constructor(content, selection) {
|
|
6
|
+
this.content = content.clone(true);
|
|
7
|
+
this.selection = selection.clone();
|
|
8
|
+
this.refreshSelectionNodes();
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Clones the editor state, updating the content and selection based on the provided content.
|
|
12
|
+
*
|
|
13
|
+
* @returns {RTEEditorState} A new instance of RTEEditorState with the updated content and selection.
|
|
14
|
+
*/
|
|
15
|
+
clone() {
|
|
16
|
+
return new RTEEditorState(this.content, this.selection);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Refreshes the selection nodes in the editor state.
|
|
20
|
+
*/
|
|
21
|
+
refreshSelectionNodes() {
|
|
22
|
+
const { startNode: oldStartNode, endNode: oldEndNode, startOffset, endOffset, } = this.selection.range;
|
|
23
|
+
if (oldStartNode && oldEndNode) {
|
|
24
|
+
const startNode = this.content.findNodeById(oldStartNode.id);
|
|
25
|
+
const endNode = this.content.findNodeById(oldEndNode.id);
|
|
26
|
+
if (startNode && endNode) {
|
|
27
|
+
this.selection.range.updateRTERange({
|
|
28
|
+
startNode,
|
|
29
|
+
endNode,
|
|
30
|
+
startOffset,
|
|
31
|
+
endOffset,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -52,6 +52,12 @@ export class RTEImageNode extends RTENode {
|
|
|
52
52
|
}
|
|
53
53
|
return Object.assign(Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {})), { type: 'image', url: this.url });
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* @inheritDoc
|
|
57
|
+
*/
|
|
58
|
+
clone() {
|
|
59
|
+
return new RTEImageNode(this.id, this.url, this.parentBlock, super.cloneAnnotations());
|
|
60
|
+
}
|
|
55
61
|
/**
|
|
56
62
|
* @inheritDoc
|
|
57
63
|
*/
|
|
@@ -76,4 +76,12 @@ export class RTENode {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Clones the annotations of the current RTETextNode.
|
|
81
|
+
*
|
|
82
|
+
* @returns {NodeAnnotations} A new Map containing cloned annotations.
|
|
83
|
+
*/
|
|
84
|
+
cloneAnnotations() {
|
|
85
|
+
return new Map(Array.from(this.annotationMap.entries()).map(([key, value]) => [key, value.clone()]));
|
|
86
|
+
}
|
|
79
87
|
}
|
|
@@ -102,7 +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.parentBlock,
|
|
105
|
+
return new RTETextNode(generateUUID(), text, this.parentBlock, super.cloneAnnotations());
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @inheritDoc
|
|
109
|
+
*/
|
|
110
|
+
clone() {
|
|
111
|
+
return new RTETextNode(this.id, this.text, this.parentBlock, super.cloneAnnotations());
|
|
106
112
|
}
|
|
107
113
|
/**
|
|
108
114
|
* Checks if a node is empty
|
|
@@ -120,6 +120,14 @@ export class RTERange {
|
|
|
120
120
|
}
|
|
121
121
|
return new RTERange(this._startContainer, this._endContainer, this._startOffset, this._endOffset, this._startNode, this._endNode, this._oldNativeRange);
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Creates a new instance of the `RTERange` class with the same properties as the current instance.
|
|
125
|
+
*
|
|
126
|
+
* @returns {RTERange} A new `RTERange` instance with the same start and end containers, offsets, and nodes.
|
|
127
|
+
*/
|
|
128
|
+
clone() {
|
|
129
|
+
return new RTERange(this._startContainer, this._endContainer, this._startOffset, this._endOffset, this._startNode, this._endNode, this._oldNativeRange);
|
|
130
|
+
}
|
|
123
131
|
/**
|
|
124
132
|
* Creates a Range object based on start and end nodes and offsets.
|
|
125
133
|
* Invoke this method to get the future range state if the range content modified.
|
|
@@ -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", { style: Object.assign({}, super.getStyles(block)), ref: (ref) => super.registerRef(ref, block), class: super.getClasses(block) }, block.nodes.map((node) => {
|
|
10
|
+
return (h("div", { key: block.id, style: Object.assign({}, super.getStyles(block)), ref: (ref) => super.registerRef(ref, block), class: super.getClasses(block) }, block.nodes.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, { ref: (ref) => super.registerRef(ref, block) }, block.blocks.map((listItemBlock) => RTEListItemBlockRenderer.render(listItemBlock, renderContext))));
|
|
11
|
+
return (h(BlockTag, { key: block.id, ref: (ref) => super.registerRef(ref, block) }, block.blocks.map((listItemBlock) => RTEListItemBlockRenderer.render(listItemBlock, renderContext))));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export default new RTEListBlockRenderer();
|
|
@@ -3,7 +3,7 @@ import RTEListBlockRenderer from './list-block-renderer';
|
|
|
3
3
|
import { RTEBlockTextNodesRenderer } from './block-text-nodes-renderer.abstract';
|
|
4
4
|
class RTEListItemBlockRenderer extends RTEBlockTextNodesRenderer {
|
|
5
5
|
render(block, renderContext) {
|
|
6
|
-
return (h("li", { ref: (ref) => super.registerRef(ref, block), style: super.getStyles(block), class: super.getClasses(block) },
|
|
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
8
|
this.renderChildren(block.children, renderContext)));
|
|
9
9
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js
CHANGED
|
@@ -7,7 +7,7 @@ class RTETextBlockRenderer extends RTEBlockTextNodesRenderer {
|
|
|
7
7
|
}
|
|
8
8
|
render(block, renderContext) {
|
|
9
9
|
const BlockTag = this.getBlockTagByType(block.type);
|
|
10
|
-
return (h(BlockTag, { ref: (ref) => super.registerRef(ref, block), style: super.getStyles(block), class: super.getClasses(block) }, super.renderNodes(block, renderContext)));
|
|
10
|
+
return (h(BlockTag, { key: block.id, ref: (ref) => super.registerRef(ref, block), style: super.getStyles(block), class: super.getClasses(block) }, super.renderNodes(block, renderContext)));
|
|
11
11
|
}
|
|
12
12
|
getBlockTagByType(type) {
|
|
13
13
|
switch (type) {
|
|
@@ -20,6 +20,12 @@ class RTETextBlockRenderer extends RTEBlockTextNodesRenderer {
|
|
|
20
20
|
return `h2`;
|
|
21
21
|
case 'heading-3':
|
|
22
22
|
return `h3`;
|
|
23
|
+
case 'heading-4':
|
|
24
|
+
return `h4`;
|
|
25
|
+
case 'heading-5':
|
|
26
|
+
return `h5`;
|
|
27
|
+
case 'heading-6':
|
|
28
|
+
return `h6`;
|
|
23
29
|
case 'paragraph':
|
|
24
30
|
return 'p';
|
|
25
31
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js
CHANGED
|
@@ -38,7 +38,7 @@ class RTEImageNodeRenderer extends RTENodeRenderer {
|
|
|
38
38
|
render(node, renderContext) {
|
|
39
39
|
const imageAnnotation = node.getAnnotationByType(NodeAnnotationTypeEnum.IMAGE);
|
|
40
40
|
const { size, alt } = imageAnnotation || new ImageAnnotation('md', '');
|
|
41
|
-
return renderContext.editable ? (h("vega-rich-text-image-editor", { style: super.getStyles(node), size: size, alt: alt, ref: (ref) => {
|
|
41
|
+
return renderContext.editable ? (h("vega-rich-text-image-editor", { key: node.id, style: super.getStyles(node), size: size, alt: alt, ref: (ref) => {
|
|
42
42
|
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaChange, (e) => this.handleChange(e, node));
|
|
43
43
|
} }, this.renderImage(alt, node, renderContext))) : (this.renderImage(alt, node, renderContext));
|
|
44
44
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js
CHANGED
|
@@ -7,9 +7,9 @@ class RTETextNodeRenderer extends RTENodeRenderer {
|
|
|
7
7
|
render(node) {
|
|
8
8
|
const codeAnnotation = node.annotationMap.get(NodeAnnotationTypeEnum.CODE);
|
|
9
9
|
if (codeAnnotation === null || codeAnnotation === void 0 ? void 0 : codeAnnotation.code) {
|
|
10
|
-
return (h("code", { style: super.getStyles(node), class: super.getClasses(node), ref: (ref) => this.registerRef(ref, node) }, node.text || ZERO_WIDTH_SPACE));
|
|
10
|
+
return (h("code", { key: node.id, style: super.getStyles(node), class: super.getClasses(node), ref: (ref) => this.registerRef(ref, node) }, node.text || ZERO_WIDTH_SPACE));
|
|
11
11
|
}
|
|
12
|
-
return (h("span", { style: super.getStyles(node), class: super.getClasses(node), ref: (ref) => this.registerRef(ref, node) }, node.text || ZERO_WIDTH_SPACE));
|
|
12
|
+
return (h("span", { key: node.id, style: super.getStyles(node), class: super.getClasses(node), ref: (ref) => this.registerRef(ref, node) }, node.text || ZERO_WIDTH_SPACE));
|
|
13
13
|
}
|
|
14
14
|
registerRef(ref, node) {
|
|
15
15
|
super.registerRef(ref, node);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the state of the selection in the RTE.
|
|
3
|
+
*/
|
|
4
|
+
export class RTESelectionState {
|
|
5
|
+
constructor(range) {
|
|
6
|
+
this.range = range;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Clones the selection state, updating the range nodes based on the provided content.
|
|
10
|
+
*
|
|
11
|
+
* @returns {RTESelectionState} A new instance of RTESelectionState with the updated range.
|
|
12
|
+
*/
|
|
13
|
+
clone() {
|
|
14
|
+
const newRange = this.range.clone();
|
|
15
|
+
return new RTESelectionState(newRange);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -34,12 +34,12 @@ export class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
34
34
|
childNodes.push({
|
|
35
35
|
id: generateUUID(),
|
|
36
36
|
type: 'text',
|
|
37
|
-
text: child.textContent,
|
|
37
|
+
text: String(child.textContent),
|
|
38
38
|
annotations: annotations,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
childNodes.push(...this.generateChildNodes(Array.from(child.childNodes), Object.assign({}, annotations, this.generateTextNodeAnnotations(child))));
|
|
42
|
+
childNodes.push(...this.generateChildNodes(Array.from(child.childNodes), Object.assign({}, annotations, this.generateTextNodeAnnotations(child, annotations))));
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
return childNodes;
|
|
@@ -67,7 +67,7 @@ export class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
67
67
|
* @returns {boolean} - boolean.
|
|
68
68
|
*/
|
|
69
69
|
isInvalidTextNode(element) {
|
|
70
|
-
if (element.nodeValue.includes('\t')) {
|
|
70
|
+
if (element.nodeValue && element.nodeValue.includes('\t')) {
|
|
71
71
|
const value = element.nodeValue.replace(/\n|\t/gm, '');
|
|
72
72
|
if (value.length === 0)
|
|
73
73
|
return true;
|
|
@@ -78,9 +78,10 @@ export class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
78
78
|
* Generate annotations map for text node element.
|
|
79
79
|
*
|
|
80
80
|
* @param {HTMLElement} element - current element.
|
|
81
|
+
* @param {VegaRTETextAnnotations} parentAnnotations - parent annotations
|
|
81
82
|
* @returns {VegaRTETextAnnotations | VegaRTECodeAnnotations} - Text node annotations.
|
|
82
83
|
*/
|
|
83
|
-
generateTextNodeAnnotations(element) {
|
|
84
|
+
generateTextNodeAnnotations(element, parentAnnotations) {
|
|
84
85
|
if (this.isCode(element))
|
|
85
86
|
return { code: true };
|
|
86
87
|
const annotations = {
|
|
@@ -89,6 +90,10 @@ export class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
89
90
|
underline: this.isUnderline(element),
|
|
90
91
|
strikethrough: this.isStrikethrough(element),
|
|
91
92
|
};
|
|
93
|
+
parentAnnotations.bold && (annotations.bold = true);
|
|
94
|
+
parentAnnotations.underline && (annotations.underline = true);
|
|
95
|
+
parentAnnotations.italic && (annotations.italic = true);
|
|
96
|
+
parentAnnotations.strikethrough && (annotations.strikethrough = true);
|
|
92
97
|
const color = this.getColor(element);
|
|
93
98
|
const link = this.getLink(element);
|
|
94
99
|
if (color)
|
|
@@ -104,7 +109,9 @@ export class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
104
109
|
* @returns {boolean} - boolean.
|
|
105
110
|
*/
|
|
106
111
|
isCode(element) {
|
|
107
|
-
return element.classList.contains('v-rte--code') ||
|
|
112
|
+
return (element.classList.contains('v-rte--code') ||
|
|
113
|
+
element.nodeName === 'CODE' ||
|
|
114
|
+
element.style.fontFamily === 'monospace');
|
|
108
115
|
}
|
|
109
116
|
/**
|
|
110
117
|
* Is bold element.
|
|
@@ -114,6 +121,7 @@ export class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
114
121
|
*/
|
|
115
122
|
isBold(element) {
|
|
116
123
|
return (element.nodeName === 'STRONG' ||
|
|
124
|
+
element.nodeName === 'B' ||
|
|
117
125
|
element.style.fontWeight === 'bold' ||
|
|
118
126
|
element.style.fontWeight === '700');
|
|
119
127
|
}
|
|
@@ -135,6 +143,7 @@ export class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
135
143
|
isUnderline(element) {
|
|
136
144
|
return (element.style.textDecoration.includes('underline') ||
|
|
137
145
|
element.nodeName === 'U' ||
|
|
146
|
+
element.nodeName === 'INS' ||
|
|
138
147
|
element.classList.contains('v-rte--underline'));
|
|
139
148
|
}
|
|
140
149
|
/**
|
|
@@ -146,6 +155,7 @@ export class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
146
155
|
isStrikethrough(element) {
|
|
147
156
|
return (element.style.textDecoration.includes('line-through') ||
|
|
148
157
|
element.nodeName === 'S' ||
|
|
158
|
+
element.nodeName === 'DEL' ||
|
|
149
159
|
element.classList.contains('v-rte--strikethrough'));
|
|
150
160
|
}
|
|
151
161
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNonNullable } from '../../../../../../types/type-guard';
|
|
1
2
|
/**
|
|
2
3
|
* Abstract class to define strategies for processing HTML elements
|
|
3
4
|
*/
|
|
@@ -23,14 +24,14 @@ export class ElementToDTOStrategyOutput {
|
|
|
23
24
|
/**
|
|
24
25
|
* Transform current output and children output to DTO
|
|
25
26
|
*
|
|
26
|
-
* @returns {RTEContentBlock} - DTO.
|
|
27
|
+
* @returns {Nullable<RTEContentBlock>} - DTO.
|
|
27
28
|
*/
|
|
28
29
|
toDto() {
|
|
29
30
|
const currentBlock = this.currentStrategy.handle(this.currentElements);
|
|
30
31
|
if (this.childrenOutput.length > 0 && currentBlock) {
|
|
31
32
|
this.currentStrategy.appendChildBlocks(currentBlock, this.childrenOutput
|
|
32
33
|
.map((childOutput) => childOutput.toDto())
|
|
33
|
-
.filter(
|
|
34
|
+
.filter(isNonNullable));
|
|
34
35
|
}
|
|
35
36
|
return currentBlock;
|
|
36
37
|
}
|
|
@@ -11,7 +11,16 @@ export class InlineBlockToRTETextBlockStrategy extends BlockToRTEBlockStrategyAb
|
|
|
11
11
|
* @returns {number} - can be handled element count.
|
|
12
12
|
*/
|
|
13
13
|
canHandle(elementsArray, currentIndex) {
|
|
14
|
-
return [
|
|
14
|
+
return [
|
|
15
|
+
'heading-1',
|
|
16
|
+
'heading-2',
|
|
17
|
+
'heading-3',
|
|
18
|
+
'heading-4',
|
|
19
|
+
'heading-5',
|
|
20
|
+
'heading-6',
|
|
21
|
+
'title',
|
|
22
|
+
'subtitle',
|
|
23
|
+
].includes(this.getElementType(elementsArray[currentIndex]))
|
|
15
24
|
? 1
|
|
16
25
|
: 0;
|
|
17
26
|
}
|
|
@@ -78,6 +87,12 @@ export class InlineBlockToRTETextBlockStrategy extends BlockToRTEBlockStrategyAb
|
|
|
78
87
|
return 'heading-2';
|
|
79
88
|
case 'H3':
|
|
80
89
|
return 'heading-3';
|
|
90
|
+
case 'H4':
|
|
91
|
+
return 'heading-4';
|
|
92
|
+
case 'H5':
|
|
93
|
+
return 'heading-5';
|
|
94
|
+
case 'H6':
|
|
95
|
+
return 'heading-6';
|
|
81
96
|
default:
|
|
82
97
|
return '';
|
|
83
98
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { generateUUID } from '../../../../../../utils/misc';
|
|
2
2
|
import { RTEImageBlock } from '../../../../dto/blocks/image-block';
|
|
3
3
|
import { BlockToRTEBlockStrategyAbstract } from './block-to-rte-block-strategy.abstract';
|
|
4
|
+
import { isNonNullable } from '../../../../../../types/type-guard';
|
|
4
5
|
/** Transform vega-rich-text-image-editor element to image block DTO */
|
|
5
6
|
export class VegaImageToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
6
7
|
/**
|
|
@@ -22,22 +23,24 @@ export class VegaImageToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbs
|
|
|
22
23
|
handle(elementsArray) {
|
|
23
24
|
const element = elementsArray[0];
|
|
24
25
|
const image = element.querySelector('img');
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
if (isNonNullable(image)) {
|
|
27
|
+
return RTEImageBlock.from({
|
|
28
|
+
id: generateUUID(),
|
|
29
|
+
type: 'image',
|
|
30
|
+
nodes: [
|
|
31
|
+
{
|
|
32
|
+
id: generateUUID(),
|
|
33
|
+
type: 'image',
|
|
34
|
+
url: image.src,
|
|
35
|
+
annotations: {
|
|
36
|
+
size: element.size || 'md',
|
|
37
|
+
alt: element.alt,
|
|
38
|
+
},
|
|
36
39
|
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
40
|
+
],
|
|
41
|
+
annotations: this.generateBlockAnnotations(element),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
41
44
|
}
|
|
42
45
|
/* istanbul ignore next */
|
|
43
46
|
/**
|
package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/history-controller.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { MapToComponentField, MapToComponentMethod } from 'vega-slimmer/core';
|
|
8
|
+
import { RTEEditorState } from '../../dto/editor-state';
|
|
9
|
+
import { debounce } from '../../../../utils/timer';
|
|
10
|
+
import { RTESelectionState } from '../../dto/selection-state';
|
|
11
|
+
import { KeyboardManagerSlimmer } from '../../../../helpers/slimmers/keyboard-manager-slimmer';
|
|
12
|
+
/**
|
|
13
|
+
* History controller for RTE.
|
|
14
|
+
*/
|
|
15
|
+
export class HistoryController extends KeyboardManagerSlimmer {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(() => this.getKeyboardShortcutOptions.call(this));
|
|
18
|
+
this.redoStack = [];
|
|
19
|
+
this.undoStack = [];
|
|
20
|
+
this.registerHistoryDelay = 300;
|
|
21
|
+
this.registerHistoryDebounced = debounce(() => {
|
|
22
|
+
this.internalRegisterHistory(new RTEEditorState(this.value, new RTESelectionState(this.selectionController.getCurrentRange())));
|
|
23
|
+
}, this.registerHistoryDelay, this);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Component lifecycle - [componentDidLoad]
|
|
27
|
+
*/
|
|
28
|
+
registerInitState() {
|
|
29
|
+
if (this.value) {
|
|
30
|
+
this.internalRegisterHistory(new RTEEditorState(this.value, new RTESelectionState(this.selectionController.getCurrentRange())));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Restores the previous state from the undo stack.
|
|
35
|
+
*/
|
|
36
|
+
async undo() {
|
|
37
|
+
if (this.undoStack.length > 0) {
|
|
38
|
+
const clonedState = this.undoStack.pop().clone();
|
|
39
|
+
this.redoStack.push(clonedState);
|
|
40
|
+
const prev = this.undoStack[this.undoStack.length - 1];
|
|
41
|
+
if (prev) {
|
|
42
|
+
await this.restoreState(prev.clone());
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Restores the next state from the redo stack.
|
|
48
|
+
*/
|
|
49
|
+
async redo() {
|
|
50
|
+
if (this.redoStack.length > 0) {
|
|
51
|
+
const clonedState = this.redoStack.pop().clone();
|
|
52
|
+
this.undoStack.push(clonedState);
|
|
53
|
+
await this.restoreState(clonedState);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Registers history based on the editor state.
|
|
58
|
+
*
|
|
59
|
+
* @param {RTEEditorState} editorState - The state to record in history.
|
|
60
|
+
*/
|
|
61
|
+
registerHistory(editorState) {
|
|
62
|
+
// TODO: feat: add a `force` option to register history immediately when needed.
|
|
63
|
+
this.registerHistoryDebounced(editorState);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Internal function to register history immediately.
|
|
67
|
+
*
|
|
68
|
+
* @param {RTEEditorState} state - The state to record in history.
|
|
69
|
+
*/
|
|
70
|
+
internalRegisterHistory(state) {
|
|
71
|
+
this.redoStack = []; // clear redo stack when new action happens.
|
|
72
|
+
this.undoStack.push(state);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Restores the editor state based on the provided history state.
|
|
76
|
+
*
|
|
77
|
+
* @param {RTEEditorState} state - The state to restore to.
|
|
78
|
+
*/
|
|
79
|
+
async restoreState(state) {
|
|
80
|
+
const { content, selection } = state;
|
|
81
|
+
this.selectionController.setSelectionState(selection);
|
|
82
|
+
await this.valueController.flushChanges(content, false);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns the keyboard shortcut options for undo/redo functionality.
|
|
86
|
+
*
|
|
87
|
+
* @returns {KeyboardEventListener[]} - An array of keyboard shortcut options.
|
|
88
|
+
*/
|
|
89
|
+
getKeyboardShortcutOptions() {
|
|
90
|
+
const baseOption = {
|
|
91
|
+
keyCode: 'KeyZ',
|
|
92
|
+
activeElementInScope: [this.vegaRichTextEditorRenderer.getRTEEditableElementRef()],
|
|
93
|
+
eventName: 'keydown',
|
|
94
|
+
modifierPressed: true,
|
|
95
|
+
};
|
|
96
|
+
return [
|
|
97
|
+
Object.assign(Object.assign({}, baseOption), { shiftKey: false,
|
|
98
|
+
/**
|
|
99
|
+
* Callback function for the undo action.
|
|
100
|
+
*
|
|
101
|
+
* @param {KeyboardEvent} e - The keyboard event triggered by the user.
|
|
102
|
+
*/
|
|
103
|
+
callback: (e) => {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
void this.undo();
|
|
106
|
+
} }),
|
|
107
|
+
Object.assign(Object.assign({}, baseOption), { shiftKey: true,
|
|
108
|
+
/**
|
|
109
|
+
* Callback function for the redo action.
|
|
110
|
+
*
|
|
111
|
+
* @param {KeyboardEvent} e - The keyboard event triggered by the user.
|
|
112
|
+
*/
|
|
113
|
+
callback: (e) => {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
void this.redo();
|
|
116
|
+
} }),
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
__decorate([
|
|
121
|
+
MapToComponentField()
|
|
122
|
+
], HistoryController.prototype, "host", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
MapToComponentField()
|
|
125
|
+
], HistoryController.prototype, "vegaRichTextEditorRenderer", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
MapToComponentField()
|
|
128
|
+
], HistoryController.prototype, "valueController", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
MapToComponentField()
|
|
131
|
+
], HistoryController.prototype, "value", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
MapToComponentField()
|
|
134
|
+
], HistoryController.prototype, "selectionController", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
MapToComponentMethod('componentDidLoad')
|
|
137
|
+
], HistoryController.prototype, "registerInitState", null);
|