@globalpayments/vega 2.61.0 → 2.62.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-7e624dd0.js → app-globals-8f5fa42a.js} +23 -15
- package/dist/cjs/base-renderer-0a3b62b7.js +9 -0
- package/dist/cjs/{child-nodes-event-prevent-slimmer-184fe3b2.js → child-nodes-event-prevent-slimmer-4e96270e.js} +1 -1
- package/dist/cjs/{code-block-ecb2df41.js → code-block-eb66d852.js} +73 -22
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-58a0f64c.js → component-value-history-controller-slimmer.abstract-62cdf04c.js} +16 -182
- package/dist/cjs/{design-token-16f74439.js → design-token-76bb47bd.js} +1 -1
- package/dist/cjs/{dom-node-subject-factory-4eb1fec2.js → dom-node-subject-observer-factory-58e3c010.js} +41 -0
- package/dist/cjs/{content-state-d7b8e70b.js → dto-renderer-manager-f3894490.js} +1647 -1501
- package/dist/cjs/{element-appender-slimmer-c4816142.js → element-appender-slimmer-e8dac628.js} +7 -8
- package/dist/cjs/{event-emit-slimmer-2da7c9d6.js → event-emit-slimmer-428d8802.js} +3 -4
- package/dist/cjs/{form-field-controller-slimmer-dab30e5c.js → form-field-controller-slimmer-cc6e53a4.js} +4 -5
- package/dist/cjs/{image-annotation-action-7eaab3ce.js → image-annotation-action-a628ec9b.js} +24 -81
- package/dist/cjs/{index-da628bba.js → index-5505e8dd.js} +3 -3
- package/dist/cjs/index.cjs.js +49 -23
- package/dist/cjs/{icon-manager-9072356d.js → internal-icon-manager-32f9ed63.js} +51 -0
- package/dist/cjs/{internal-vega-event-manager-7b87c2f4.js → internal-vega-event-manager-28b957c8.js} +73 -73
- package/dist/cjs/language-extension-20a1dba5.js +207 -0
- package/dist/cjs/loader.cjs.js +14 -12
- package/dist/cjs/{public-rules-21622bd0.js → public-rules-5d0f3a5f.js} +5 -5
- package/dist/cjs/range-cfc45f9e.js +178 -0
- package/dist/cjs/{responsive-format-facade-0d22ff78.js → responsive-format-facade-7e933525.js} +4 -3
- package/dist/cjs/{rich-text-editor-required-rule-8d7e441a.js → rich-text-editor-required-rule-72170c10.js} +2 -2
- package/dist/cjs/{string-input-formatter-slimmer-5a744e71.js → string-input-formatter-slimmer-f6c7a255.js} +4 -4
- package/dist/cjs/{style-formatter-a66813a2.js → style-formatter-702df81e.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-9602b5bb.js → sub-state-notify-slimmer-bb64fcfc.js} +4 -4
- package/dist/cjs/{sub-state-observer-slimmer-df7df5bb.js → sub-state-observer-slimmer-84175d61.js} +4 -4
- package/dist/cjs/{vega-skeleton-loader-controller-9c54f3aa.js → token-extension-23ccff1d.js} +679 -3
- package/dist/cjs/vega-accordion.cjs.entry.js +15 -16
- package/dist/cjs/vega-app-header-button.cjs.entry.js +20 -21
- package/dist/cjs/vega-banner.cjs.entry.js +7 -9
- package/dist/cjs/vega-box.cjs.entry.js +13 -12
- package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -2
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +8 -9
- package/dist/cjs/vega-button-circle.cjs.entry.js +16 -16
- package/dist/cjs/vega-button-group_2.cjs.entry.js +11 -12
- package/dist/cjs/vega-button-link.cjs.entry.js +7 -8
- package/dist/cjs/vega-button.cjs.entry.js +15 -15
- package/dist/cjs/vega-calendar_4.cjs.entry.js +22 -24
- package/dist/cjs/vega-card.cjs.entry.js +12 -11
- package/dist/cjs/vega-carousel.cjs.entry.js +13 -13
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +12 -13
- package/dist/cjs/vega-chip.cjs.entry.js +17 -17
- package/dist/cjs/vega-code-block.cjs.entry.js +16 -17
- package/dist/cjs/vega-color-picker.cjs.entry.js +6 -7
- package/dist/cjs/vega-combo-box.cjs.entry.js +14 -15
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +30 -31
- package/dist/cjs/vega-dialog_2.cjs.entry.js +27 -27
- package/dist/cjs/vega-divider.cjs.entry.js +12 -11
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +32 -32
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +6 -7
- package/dist/cjs/vega-file-uploader.cjs.entry.js +15 -17
- package/dist/cjs/vega-flag-icon.cjs.entry.js +13 -13
- package/dist/cjs/vega-flex.cjs.entry.js +12 -11
- package/dist/cjs/vega-font.cjs.entry.js +12 -11
- package/dist/cjs/vega-form.cjs.entry.js +13 -14
- package/dist/cjs/vega-grid.cjs.entry.js +12 -11
- package/dist/cjs/vega-icon.cjs.entry.js +15 -14
- package/dist/cjs/vega-image-uploader.cjs.entry.js +18 -18
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +14 -16
- package/dist/cjs/vega-input-numeric.cjs.entry.js +10 -11
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +20 -21
- package/dist/cjs/vega-input-range.cjs.entry.js +11 -12
- package/dist/cjs/vega-input-select.cjs.entry.js +27 -28
- package/dist/cjs/vega-input.cjs.entry.js +12 -13
- package/dist/cjs/vega-item-toggle.cjs.entry.js +5 -6
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +33 -34
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +13 -12
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +2 -3
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +8 -9
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -4
- package/dist/cjs/vega-pagination.cjs.entry.js +18 -18
- package/dist/cjs/vega-popover_2.cjs.entry.js +18 -18
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +5 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +13 -14
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +53 -48
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +387 -261
- package/dist/cjs/vega-segment-control.cjs.entry.js +5 -6
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +20 -20
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +13 -14
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +24 -25
- package/dist/cjs/vega-signature-capture.cjs.entry.js +16 -17
- package/dist/cjs/vega-stepper.cjs.entry.js +12 -13
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +8 -9
- package/dist/cjs/vega-table_8.cjs.entry.js +58 -59
- package/dist/cjs/vega-textarea.cjs.entry.js +9 -10
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +24 -24
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +7 -8
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +12 -12
- package/dist/cjs/vega.cjs.js +14 -12
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +10 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-split-text-strategy.js +6 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.js +12 -6
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-node-to-nearest-root-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-cursor-position-strategy.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-node-to-nearest-root-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +36 -10
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +10 -4
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +145 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-extension.js +113 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +90 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/insert-token-node-action.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/insert-token-node-strategy.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +67 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +88 -0
- package/dist/collection/components/vega-rich-text-editor/public-api.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js +8 -6
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +9 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +43 -18
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +6 -6
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.js +9 -9
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +44 -11
- package/dist/collection/global/scripts/before-vega-load.js +9 -0
- package/dist/collection/helpers/code-format/test/code-formatter.test.js +1 -1
- package/dist/collection/helpers/public-api.js +1 -1
- package/dist/collection/helpers/rte-manager/dto-action-strategy-manager.js +2 -0
- package/dist/esm/{app-globals-ce54f0ac.js → app-globals-aaff0b25.js} +13 -5
- package/dist/esm/base-renderer-101f6d04.js +7 -0
- package/dist/esm/{child-nodes-event-prevent-slimmer-2a3115ae.js → child-nodes-event-prevent-slimmer-7fe3dc57.js} +1 -1
- package/dist/esm/{code-block-89a4dd13.js → code-block-68300b47.js} +67 -17
- package/dist/esm/{component-value-history-controller-slimmer.abstract-95b199df.js → component-value-history-controller-slimmer.abstract-ac2f1bfd.js} +13 -179
- package/dist/esm/{design-token-eaa7c221.js → design-token-1a36307e.js} +1 -1
- package/dist/esm/{dom-node-subject-factory-3c2e13f1.js → dom-node-subject-observer-factory-c7bc3035.js} +41 -1
- package/dist/esm/{content-state-fc47457c.js → dto-renderer-manager-af66bbd9.js} +1643 -1502
- package/dist/esm/{element-appender-slimmer-ce83db8a.js → element-appender-slimmer-fe68ec2d.js} +3 -4
- package/dist/esm/{event-emit-slimmer-4428ce26.js → event-emit-slimmer-3922d816.js} +2 -3
- package/dist/esm/{form-field-controller-slimmer-6e69ca4e.js → form-field-controller-slimmer-f7e8845b.js} +2 -3
- package/dist/esm/{image-annotation-action-53812eb7.js → image-annotation-action-f61c2693.js} +20 -76
- package/dist/esm/{index-1d479c88.js → index-7fe93427.js} +1 -1
- package/dist/esm/index.js +13 -10
- package/dist/esm/{icon-manager-2ee1c619.js → internal-icon-manager-f0486245.js} +51 -1
- package/dist/esm/{internal-vega-event-manager-a654cf8a.js → internal-vega-event-manager-cb06e987.js} +1 -1
- package/dist/esm/language-extension-1ada2a9d.js +204 -0
- package/dist/esm/loader.js +14 -12
- package/dist/esm/{public-rules-095284f6.js → public-rules-9f62069a.js} +5 -5
- package/dist/esm/range-c2eeb794.js +176 -0
- package/dist/esm/{responsive-format-facade-86b6de3b.js → responsive-format-facade-5711c77d.js} +4 -3
- package/dist/esm/{rich-text-editor-required-rule-4e8d2db8.js → rich-text-editor-required-rule-de738309.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-60897659.js → string-input-formatter-slimmer-69117deb.js} +2 -2
- package/dist/esm/{style-formatter-a0719a8f.js → style-formatter-2479dc61.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-ee730968.js → sub-state-notify-slimmer-4252a90e.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-d474634d.js → sub-state-observer-slimmer-baa8853a.js} +1 -1
- package/dist/esm/{vega-skeleton-loader-controller-394a6026.js → token-extension-6fc5e1f5.js} +672 -4
- package/dist/esm/vega-accordion.entry.js +13 -14
- package/dist/esm/vega-app-header-button.entry.js +14 -15
- package/dist/esm/vega-banner.entry.js +4 -6
- package/dist/esm/vega-box.entry.js +13 -12
- package/dist/esm/vega-brand-logo.entry.js +1 -2
- package/dist/esm/vega-breadcrumb.entry.js +4 -5
- package/dist/esm/vega-button-circle.entry.js +14 -14
- package/dist/esm/vega-button-group_2.entry.js +6 -7
- package/dist/esm/vega-button-link.entry.js +5 -6
- package/dist/esm/vega-button.entry.js +13 -13
- package/dist/esm/vega-calendar_4.entry.js +7 -9
- package/dist/esm/vega-card.entry.js +12 -11
- package/dist/esm/vega-carousel.entry.js +12 -12
- package/dist/esm/vega-checkbox_2.entry.js +6 -7
- package/dist/esm/vega-chip.entry.js +14 -14
- package/dist/esm/vega-code-block.entry.js +8 -9
- package/dist/esm/vega-color-picker.entry.js +5 -6
- package/dist/esm/vega-combo-box.entry.js +6 -7
- package/dist/esm/vega-date-picker_2.entry.js +16 -17
- package/dist/esm/vega-dialog_2.entry.js +15 -15
- package/dist/esm/vega-divider.entry.js +12 -11
- package/dist/esm/vega-dropdown_5.entry.js +15 -15
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +4 -5
- package/dist/esm/vega-file-uploader.entry.js +6 -8
- package/dist/esm/vega-flag-icon.entry.js +12 -12
- package/dist/esm/vega-flex.entry.js +12 -11
- package/dist/esm/vega-font.entry.js +12 -11
- package/dist/esm/vega-form.entry.js +7 -8
- package/dist/esm/vega-grid.entry.js +12 -11
- package/dist/esm/vega-icon.entry.js +12 -11
- package/dist/esm/vega-image-uploader.entry.js +12 -12
- package/dist/esm/vega-input-credit-card.entry.js +7 -9
- package/dist/esm/vega-input-numeric.entry.js +7 -8
- package/dist/esm/vega-input-phone-number.entry.js +12 -13
- package/dist/esm/vega-input-range.entry.js +7 -8
- package/dist/esm/vega-input-select.entry.js +14 -15
- package/dist/esm/vega-input.entry.js +7 -8
- package/dist/esm/vega-item-toggle.entry.js +3 -4
- package/dist/esm/vega-left-nav_5.entry.js +14 -15
- package/dist/esm/vega-loader-wrapper_2.entry.js +11 -10
- package/dist/esm/vega-page-notification_2.entry.js +1 -2
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -2
- package/dist/esm/vega-pagination.entry.js +10 -10
- package/dist/esm/vega-popover_2.entry.js +14 -14
- package/dist/esm/vega-progress-tracker.entry.js +3 -4
- package/dist/esm/vega-radio_2.entry.js +6 -7
- package/dist/esm/vega-rich-text-content.entry.js +24 -19
- package/dist/esm/vega-rich-text-editor_4.entry.js +342 -216
- package/dist/esm/vega-segment-control.entry.js +4 -5
- package/dist/esm/vega-selection-chip_2.entry.js +15 -15
- package/dist/esm/vega-selection-tile_2.entry.js +7 -8
- package/dist/esm/vega-sidenav_3.entry.js +16 -17
- package/dist/esm/vega-signature-capture.entry.js +14 -15
- package/dist/esm/vega-stepper.entry.js +6 -7
- package/dist/esm/vega-tab-group_2.entry.js +4 -5
- package/dist/esm/vega-table_8.entry.js +12 -13
- package/dist/esm/vega-textarea.entry.js +6 -7
- package/dist/esm/vega-time-picker_2.entry.js +14 -14
- package/dist/esm/vega-toggle-switch.entry.js +6 -7
- package/dist/esm/vega-tooltip_2.entry.js +12 -12
- package/dist/esm/vega.js +14 -12
- package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-node-to-nearest-root-strategy.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/insert-node-to-nearest-root-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.d.ts +4 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +2 -3
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +11 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +95 -2
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +82 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-extension.d.ts +50 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.d.ts +54 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/insert-token-node-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/insert-token-node-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.d.ts +24 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +38 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node.d.ts +39 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.d.ts +47 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +52 -1
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/extension-controller.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +10 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +4 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.d.ts +7 -7
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +10 -0
- package/dist/types/components.d.ts +21 -0
- package/dist/types/helpers/public-api.d.ts +1 -1
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/types/types/public-api.d.ts +11 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-03cc47b7.entry.js +1 -0
- package/dist/vega/p-07836d27.entry.js +1 -0
- package/dist/vega/p-079f5d94.entry.js +1 -0
- package/dist/vega/p-09cb98f3.entry.js +1 -0
- package/dist/vega/{p-fb232e29.entry.js → p-0b91bb73.entry.js} +1 -1
- package/dist/vega/p-15a78afd.entry.js +1 -0
- package/dist/vega/p-16075b30.entry.js +1 -0
- package/dist/vega/{p-67101f43.entry.js → p-1c08077c.entry.js} +1 -1
- package/dist/vega/{p-c5e862aa.js → p-1da54ff3.js} +1 -1
- package/dist/vega/p-20a180e4.js +1 -0
- package/dist/vega/p-25ddb070.entry.js +1 -0
- package/dist/vega/p-2788afe7.entry.js +1 -0
- package/dist/vega/p-2a1b3108.entry.js +1 -0
- package/dist/vega/p-2ee4def0.js +1 -0
- package/dist/vega/p-2f88ba36.entry.js +1 -0
- package/dist/vega/p-327cd6ec.entry.js +1 -0
- package/dist/vega/{p-f2a1fe6a.js → p-39c185a5.js} +1 -1
- package/dist/vega/p-3b1bedaf.entry.js +1 -0
- package/dist/vega/p-3c96bbe1.entry.js +1 -0
- package/dist/vega/p-3cdbee7e.js +1 -0
- package/dist/vega/p-3d0d8a21.entry.js +1 -0
- package/dist/vega/p-3d53858c.entry.js +1 -0
- package/dist/vega/{p-927cab0c.entry.js → p-3f3bbaaa.entry.js} +2 -2
- package/dist/vega/p-42c364e0.entry.js +1 -0
- package/dist/vega/p-4f56a427.entry.js +1 -0
- package/dist/vega/p-4f5a2b0c.entry.js +1 -0
- package/dist/vega/p-51d40b0d.entry.js +1 -0
- package/dist/vega/p-5420c1d4.entry.js +1 -0
- package/dist/vega/p-589b7ea3.entry.js +1 -0
- package/dist/vega/p-5d3c6a06.entry.js +1 -0
- package/dist/vega/p-5dec47da.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-6244b0ad.entry.js +1 -0
- package/dist/vega/p-63212cc1.js +1 -0
- package/dist/vega/p-6585cfd5.entry.js +1 -0
- package/dist/vega/p-6ba27010.js +1 -0
- package/dist/vega/{p-129f5938.js → p-6caa6bb2.js} +1 -1
- package/dist/vega/p-74ac2a48.js +1 -0
- package/dist/vega/p-76c7538a.entry.js +1 -0
- package/dist/vega/p-7d8eaca9.entry.js +1 -0
- package/dist/vega/p-7da6e7bd.js +1 -0
- package/dist/vega/p-81765b4b.entry.js +1 -0
- package/dist/vega/p-81fbf18f.entry.js +1 -0
- package/dist/vega/p-8682ee0a.entry.js +1 -0
- package/dist/vega/p-893d5dfa.js +1 -0
- package/dist/vega/p-8a484812.entry.js +1 -0
- package/dist/vega/p-8a6b820a.entry.js +1 -0
- package/dist/vega/p-8c9ea6f4.js +1 -0
- package/dist/vega/p-8e58d6cb.entry.js +1 -0
- package/dist/vega/p-8e812dca.entry.js +1 -0
- package/dist/vega/p-8f056ac2.js +1 -0
- package/dist/vega/{p-e66aef91.entry.js → p-9125ba84.entry.js} +1 -1
- package/dist/vega/p-92469fa1.entry.js +1 -0
- package/dist/vega/p-9ab3bb6f.entry.js +1 -0
- package/dist/vega/p-9ca0bdcc.js +1 -0
- package/dist/vega/p-a1362aa4.entry.js +1 -0
- package/dist/vega/p-a61e4bba.entry.js +1 -0
- package/dist/vega/p-a646b66d.js +1 -0
- package/dist/vega/p-a7b5f497.js +1 -0
- package/dist/vega/p-ac5c5221.entry.js +1 -0
- package/dist/vega/p-b1a5ff74.entry.js +1 -0
- package/dist/vega/p-b32f7aac.entry.js +1 -0
- package/dist/vega/{p-dc6f45af.entry.js → p-baafe7d9.entry.js} +1 -1
- package/dist/vega/{p-3a6abcd7.entry.js → p-bb51e020.entry.js} +1 -1
- package/dist/vega/{p-e764acd5.js → p-bb61f015.js} +1 -1
- package/dist/vega/p-bc0ae89a.entry.js +1 -0
- package/dist/vega/p-bd39af8a.entry.js +1 -0
- package/dist/vega/{p-cd18f0fe.js → p-bdd9ef3b.js} +1 -1
- package/dist/vega/{p-5f85811c.entry.js → p-c167fa41.entry.js} +1 -1
- package/dist/vega/{p-7ecf65ec.js → p-c2377afa.js} +1 -1
- package/dist/vega/p-c671f57e.js +1 -0
- package/dist/vega/p-c6a354b1.js +1 -0
- package/dist/vega/p-c7726252.js +1 -0
- package/dist/vega/p-ce1766fa.js +1 -0
- package/dist/vega/p-cfb2af9c.entry.js +1 -0
- package/dist/vega/{p-3bf95faf.entry.js → p-d2790023.entry.js} +2 -2
- package/dist/vega/p-d3bbfb1b.js +1 -0
- package/dist/vega/{p-5faa7313.entry.js → p-d9617358.entry.js} +1 -1
- package/dist/vega/p-d982babe.entry.js +1 -0
- package/dist/vega/p-dcae53cf.entry.js +1 -0
- package/dist/vega/p-ddfad815.entry.js +1 -0
- package/dist/vega/p-e00ed9bd.entry.js +1 -0
- package/dist/vega/p-e365aba9.entry.js +1 -0
- package/dist/vega/p-ebfc5739.entry.js +1 -0
- package/dist/vega/{p-aeccc7f8.js → p-f1436035.js} +1 -1
- package/dist/vega/p-fe2cb3a1.entry.js +1 -0
- package/dist/vega/p-ff3a8907.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/dom-node-subject-observer-factory-15130e50.js +0 -45
- package/dist/cjs/internal-icon-manager-f8677abb.js +0 -55
- package/dist/esm/dom-node-subject-observer-factory-1e456cd4.js +0 -43
- package/dist/esm/internal-icon-manager-7eac52c8.js +0 -53
- package/dist/vega/p-0070e970.entry.js +0 -1
- package/dist/vega/p-0169af6b.entry.js +0 -1
- package/dist/vega/p-03e9cbc8.js +0 -1
- package/dist/vega/p-04341cd4.entry.js +0 -1
- package/dist/vega/p-0664ca9c.js +0 -1
- package/dist/vega/p-074b73f8.js +0 -1
- package/dist/vega/p-08fb66a4.entry.js +0 -1
- package/dist/vega/p-0cf35281.entry.js +0 -1
- package/dist/vega/p-0e75ddb2.entry.js +0 -1
- package/dist/vega/p-13cb5a04.entry.js +0 -1
- package/dist/vega/p-18223240.js +0 -1
- package/dist/vega/p-19ce9ae6.js +0 -1
- package/dist/vega/p-27f922fe.entry.js +0 -1
- package/dist/vega/p-2c7b7dd6.entry.js +0 -1
- package/dist/vega/p-310f9e76.entry.js +0 -1
- package/dist/vega/p-330d7ba8.js +0 -1
- package/dist/vega/p-34fdbe7a.js +0 -1
- package/dist/vega/p-3d6c302d.js +0 -1
- package/dist/vega/p-42563036.entry.js +0 -1
- package/dist/vega/p-441a681b.js +0 -1
- package/dist/vega/p-4a357f30.entry.js +0 -1
- package/dist/vega/p-4e8b6eb6.entry.js +0 -1
- package/dist/vega/p-50dd3cf1.js +0 -1
- package/dist/vega/p-518722aa.js +0 -1
- package/dist/vega/p-5422fdc4.entry.js +0 -1
- package/dist/vega/p-5c36a6cb.entry.js +0 -1
- package/dist/vega/p-5d095f9b.entry.js +0 -1
- package/dist/vega/p-68806f9c.entry.js +0 -1
- package/dist/vega/p-6cf490d9.entry.js +0 -1
- package/dist/vega/p-6def20e1.js +0 -1
- package/dist/vega/p-78d3f99b.entry.js +0 -1
- package/dist/vega/p-792715f3.js +0 -1
- package/dist/vega/p-7a201c6e.entry.js +0 -1
- package/dist/vega/p-7c22a1c3.entry.js +0 -1
- package/dist/vega/p-7f329473.entry.js +0 -1
- package/dist/vega/p-80f1b680.js +0 -1
- package/dist/vega/p-82beb586.entry.js +0 -1
- package/dist/vega/p-84eb131b.entry.js +0 -1
- package/dist/vega/p-8c46e116.js +0 -1
- package/dist/vega/p-909820dd.entry.js +0 -1
- package/dist/vega/p-989e141d.entry.js +0 -1
- package/dist/vega/p-a29e5d32.js +0 -1
- package/dist/vega/p-a3942d0b.entry.js +0 -1
- package/dist/vega/p-a66533c1.entry.js +0 -1
- package/dist/vega/p-a9b831d8.entry.js +0 -1
- package/dist/vega/p-b1d0e4cb.entry.js +0 -1
- package/dist/vega/p-b34f9891.entry.js +0 -1
- package/dist/vega/p-b820e42f.entry.js +0 -1
- package/dist/vega/p-c4677b0c.entry.js +0 -1
- package/dist/vega/p-c467fe81.entry.js +0 -1
- package/dist/vega/p-c7762c86.entry.js +0 -1
- package/dist/vega/p-c9e57cf1.entry.js +0 -1
- package/dist/vega/p-d0b3e319.entry.js +0 -1
- package/dist/vega/p-d7b4ffed.entry.js +0 -1
- package/dist/vega/p-e4586f13.entry.js +0 -1
- package/dist/vega/p-e71c4a09.entry.js +0 -1
- package/dist/vega/p-ea66d9f7.entry.js +0 -1
- package/dist/vega/p-ebbaa112.entry.js +0 -1
- package/dist/vega/p-ec6819fe.entry.js +0 -1
- package/dist/vega/p-ec9a8f81.entry.js +0 -1
- package/dist/vega/p-ed01328c.entry.js +0 -1
- package/dist/vega/p-ed798cd4.entry.js +0 -1
- package/dist/vega/p-edb71a72.entry.js +0 -1
- package/dist/vega/p-f08a4adf.js +0 -1
- package/dist/vega/p-f4e23c23.entry.js +0 -1
- package/dist/vega/p-f825e8a2.entry.js +0 -1
- package/dist/vega/p-f9deb43e.entry.js +0 -1
- package/dist/vega/p-fdd930a9.entry.js +0 -1
- package/dist/vega/p-fe52c370.entry.js +0 -1
|
@@ -47,6 +47,8 @@ import { HistoryController } from './slimmers/controllers/history-controller';
|
|
|
47
47
|
import { CodeBlockToolbarButtonSlimmer } from './slimmers/renderers/tools/code-block-toolbar-button-slimmer';
|
|
48
48
|
import { InternalCodeBlockSelectionController } from './slimmers/controllers/internal-code-block-selection-controller';
|
|
49
49
|
import { SourceEditToolbarButtonSlimmer } from './slimmers/renderers/tools/source-edit-toolbar-button-slimmer';
|
|
50
|
+
import { RTEExtensionController } from './slimmers/controllers/extension-controller';
|
|
51
|
+
import { VegaRTEPresetToolbarItems } from './constants/constant';
|
|
50
52
|
/**
|
|
51
53
|
* @vegaVersion 2.34.0
|
|
52
54
|
*/
|
|
@@ -103,6 +105,7 @@ export class VegaRichTextEditor {
|
|
|
103
105
|
this.deleteSelectedNodesController = new DeleteSelectedNodesController();
|
|
104
106
|
this.historyController = new HistoryController();
|
|
105
107
|
this.internalCodeBlockSelectionController = new InternalCodeBlockSelectionController();
|
|
108
|
+
this.rteExtensionController = new RTEExtensionController();
|
|
106
109
|
this.richTextContentEditable = true;
|
|
107
110
|
this.selectionMap = new Map();
|
|
108
111
|
this.isInDarkMode = VegaInternalThemeManager.isDarkMode();
|
|
@@ -166,16 +169,7 @@ export class VegaRichTextEditor {
|
|
|
166
169
|
*
|
|
167
170
|
* @vegaVersion 2.34.0
|
|
168
171
|
*/
|
|
169
|
-
this.toolbarItems =
|
|
170
|
-
['textStyles'],
|
|
171
|
-
['bold', 'italic', 'underline', 'strikethrough', 'code'],
|
|
172
|
-
['textColor'],
|
|
173
|
-
['horizontalAlignment', 'bulletsNumbers'],
|
|
174
|
-
['moreIndent', 'lessIndent'],
|
|
175
|
-
['link'],
|
|
176
|
-
['image'],
|
|
177
|
-
['clearStyle'],
|
|
178
|
-
];
|
|
172
|
+
this.toolbarItems = VegaRTEPresetToolbarItems;
|
|
179
173
|
/**
|
|
180
174
|
* Determines whether to allow source edit mode in the rich text editor.
|
|
181
175
|
*
|
|
@@ -209,6 +203,12 @@ export class VegaRichTextEditor {
|
|
|
209
203
|
* @vegaVersion 2.34.0
|
|
210
204
|
*/
|
|
211
205
|
this.validationRules = [];
|
|
206
|
+
/**
|
|
207
|
+
* Specifies the configuration for the rich text editor extensions.
|
|
208
|
+
*
|
|
209
|
+
* @vegaVersion 2.62.0
|
|
210
|
+
*/
|
|
211
|
+
this.extensions = [];
|
|
212
212
|
}
|
|
213
213
|
watchRichTextContentEditable() {
|
|
214
214
|
methodPlaceholder();
|
|
@@ -225,6 +225,9 @@ export class VegaRichTextEditor {
|
|
|
225
225
|
watchValidationRules() {
|
|
226
226
|
methodPlaceholder();
|
|
227
227
|
}
|
|
228
|
+
watchExtensions() {
|
|
229
|
+
methodPlaceholder();
|
|
230
|
+
}
|
|
228
231
|
componentWillLoad() {
|
|
229
232
|
this.richTextContentController.syncRichTextContentEditable();
|
|
230
233
|
}
|
|
@@ -415,7 +418,7 @@ export class VegaRichTextEditor {
|
|
|
415
418
|
}],
|
|
416
419
|
"text": "Specifies the built-in toolbar items available in the rich-text editor."
|
|
417
420
|
},
|
|
418
|
-
"defaultValue": "
|
|
421
|
+
"defaultValue": "VegaRTEPresetToolbarItems"
|
|
419
422
|
},
|
|
420
423
|
"allowSourceEdit": {
|
|
421
424
|
"type": "boolean",
|
|
@@ -527,6 +530,30 @@ export class VegaRichTextEditor {
|
|
|
527
530
|
"text": "Defines custom validation rules for the rich text editor."
|
|
528
531
|
},
|
|
529
532
|
"defaultValue": "[]"
|
|
533
|
+
},
|
|
534
|
+
"extensions": {
|
|
535
|
+
"type": "unknown",
|
|
536
|
+
"mutable": false,
|
|
537
|
+
"complexType": {
|
|
538
|
+
"original": "VegaRTEExtension[]",
|
|
539
|
+
"resolved": "VegaRTEExtension[]",
|
|
540
|
+
"references": {
|
|
541
|
+
"VegaRTEExtension": {
|
|
542
|
+
"location": "import",
|
|
543
|
+
"path": "./extensions/extension.abstract"
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
"required": false,
|
|
548
|
+
"optional": false,
|
|
549
|
+
"docs": {
|
|
550
|
+
"tags": [{
|
|
551
|
+
"name": "vegaVersion",
|
|
552
|
+
"text": "2.62.0"
|
|
553
|
+
}],
|
|
554
|
+
"text": "Specifies the configuration for the rich text editor extensions."
|
|
555
|
+
},
|
|
556
|
+
"defaultValue": "[]"
|
|
530
557
|
}
|
|
531
558
|
}; }
|
|
532
559
|
static get states() { return {
|
|
@@ -650,6 +677,9 @@ export class VegaRichTextEditor {
|
|
|
650
677
|
}, {
|
|
651
678
|
"propName": "validationRules",
|
|
652
679
|
"methodName": "watchValidationRules"
|
|
680
|
+
}, {
|
|
681
|
+
"propName": "extensions",
|
|
682
|
+
"methodName": "watchExtensions"
|
|
653
683
|
}]; }
|
|
654
684
|
}
|
|
655
685
|
__decorate([
|
|
@@ -769,3 +799,6 @@ __decorate([
|
|
|
769
799
|
__decorate([
|
|
770
800
|
InjectVegaSlimmer()
|
|
771
801
|
], VegaRichTextEditor.prototype, "internalCodeBlockSelectionController", void 0);
|
|
802
|
+
__decorate([
|
|
803
|
+
InjectVegaSlimmer()
|
|
804
|
+
], VegaRichTextEditor.prototype, "rteExtensionController", void 0);
|
|
@@ -17,6 +17,9 @@ import { VegaSkeletonLoader } from '../../helpers/skeleton-loader/vega-skeleton-
|
|
|
17
17
|
import { VegaTranslation } from '../../helpers/translation';
|
|
18
18
|
import { VegaTranslateObserverSlimmer } from '../../helpers/slimmers/global/vega-translate-observer-slimmer';
|
|
19
19
|
import { VegaRTEContent } from '../../components/vega-rich-text-editor/dto/content-state';
|
|
20
|
+
import { VegaRTETokenExtension } from '../../components/vega-rich-text-editor/extensions/tokens/token-extension';
|
|
21
|
+
import { VegaRTELanguageExtension } from '../../components/vega-rich-text-editor/extensions/languages/language-extension';
|
|
22
|
+
import { VegaRTEPresetToolbarItems } from '../../components/vega-rich-text-editor/constants/constant';
|
|
20
23
|
/**
|
|
21
24
|
* Default export function that will be used by stencil global script,
|
|
22
25
|
* which will be invoked before library loaded.
|
|
@@ -173,9 +176,15 @@ function injectVegaTranslationIntoGlobal() {
|
|
|
173
176
|
}
|
|
174
177
|
/**
|
|
175
178
|
* Inject VegaRTEContent to global as a public api
|
|
179
|
+
* Inject VegaRTETokenExtension to global as a public api
|
|
180
|
+
* Inject VegaRTELanguageExtension to global as a public api
|
|
181
|
+
* Inject VegaRTEPresetToolbarItems to global as a variable
|
|
176
182
|
*/
|
|
177
183
|
function injectVegaRichTextEditorClassIntoGlobal() {
|
|
178
184
|
globalThis.VegaRTEContent = VegaRTEContent;
|
|
185
|
+
globalThis.VegaRTETokenExtension = VegaRTETokenExtension;
|
|
186
|
+
globalThis.VegaRTELanguageExtension = VegaRTELanguageExtension;
|
|
187
|
+
globalThis.VegaRTEPresetToolbarItems = VegaRTEPresetToolbarItems;
|
|
179
188
|
}
|
|
180
189
|
/**
|
|
181
190
|
* Inject VegaPublicValidationRules to global as a public api
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VegaRTEContent } from '../../../components/vega-rich-text-editor/dto/content-state';
|
|
2
1
|
import CodeFormatter from '../code-formatter';
|
|
2
|
+
import { VegaRTEContent } from '../../public-api';
|
|
3
3
|
describe('Code formatter', () => {
|
|
4
4
|
it('should format simple HTML with option useTabs', () => {
|
|
5
5
|
const input = `<p><span>Text</span></p>`;
|
|
@@ -14,4 +14,4 @@ export { ValidCreditCardNumberRule } from './validator/rules/valid-credit-card-n
|
|
|
14
14
|
export { waitForVega } from './common';
|
|
15
15
|
export { VegaSkeletonLoader } from './skeleton-loader/vega-skeleton-loader-controller';
|
|
16
16
|
export { VegaTranslation, en as VegaTranslationResourceEN } from './translation';
|
|
17
|
-
export
|
|
17
|
+
export * from '../components/vega-rich-text-editor/public-api';
|
|
@@ -4,6 +4,7 @@ import { BlockDeleteTextOrDecoratorNodeStrategy } from '../../components/vega-ri
|
|
|
4
4
|
import { BlockInsertNewParagraphStrategy } from '../../components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-new-paragraph-strategy';
|
|
5
5
|
import { InsertChildrenAfterStrategy } from '../../components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-children-after-strategy';
|
|
6
6
|
import { InsertChildrenBeforeStrategy } from '../../components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-children-before-strategy';
|
|
7
|
+
import { InsertNodeToNearestRootStrategy } from '../../components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-node-to-nearest-root-strategy';
|
|
7
8
|
import { InsertTextToDecoratorNodeStrategy } from '../../components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-text-to-decorator-node-strategy';
|
|
8
9
|
import { ListItemInsertNewParagraphStrategy } from '../../components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-new-paragraph-strategy';
|
|
9
10
|
import { ListRemoveListItemStrategy } from '../../components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy';
|
|
@@ -32,6 +33,7 @@ class RTEDTOActionStrategyManager {
|
|
|
32
33
|
? new ListItemInsertNewParagraphStrategy()
|
|
33
34
|
: new BlockInsertNewParagraphStrategy());
|
|
34
35
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_TEXT_TO_DECORATOR_NODE, dtoClassName, new InsertTextToDecoratorNodeStrategy());
|
|
36
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_NODE_TO_NEAREST_ROOT, dtoClassName, new InsertNodeToNearestRootStrategy());
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
export default new RTEDTOActionStrategyManager();
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { F as FeatureFlag } from './feature-flag-controller-51659753.js';
|
|
2
|
-
import { V as VegaLoader, a as VegaNotify, b as VegaThemeManager, c as VegaDialog, d as VegaEventManager, e as VegaZIndexManager, f as VegaSkeletonLoader } from './
|
|
2
|
+
import { V as VegaLoader, a as VegaNotify, b as VegaThemeManager, c as VegaDialog, d as VegaEventManager, e as VegaZIndexManager, f as VegaSkeletonLoader, g as VegaRTETokenExtension } from './token-extension-6fc5e1f5.js';
|
|
3
3
|
import { M as MapToComponentMethod, V as VegaSlimmer, s as setVegaLogLevel, G as GlobalSlimmersRegistry } from './global-slimmer-registry-17c4efd4.js';
|
|
4
4
|
import { v as vegaEnvManager } from './vega-env-manager-8f8dc473.js';
|
|
5
|
-
import { V as VegaIconManager } from './icon-manager-
|
|
5
|
+
import { V as VegaIconManager } from './internal-icon-manager-f0486245.js';
|
|
6
6
|
import './wait-for-vega-handler-c2c07ac3.js';
|
|
7
7
|
import './ui-c20be16d.js';
|
|
8
8
|
import { V as VegaInternalTranslation, a as VegaTranslation, s as staticTranslations } from './translation-833d9ef4.js';
|
|
9
|
-
import { V as VegaRTEContent } from './
|
|
9
|
+
import { V as VegaRTEContent } from './dto-renderer-manager-af66bbd9.js';
|
|
10
|
+
import { V as VegaRTEPresetToolbarItems } from './code-block-68300b47.js';
|
|
10
11
|
import { T as TypographyUrls } from './typography-396de03f.js';
|
|
11
12
|
import { V as ValidCreditCardNumberRule } from './valid-credit-card-number-rule-81443274.js';
|
|
12
|
-
import { w as waitForVega } from './index-
|
|
13
|
+
import { w as waitForVega } from './index-7fe93427.js';
|
|
14
|
+
import { V as VegaRTELanguageExtension } from './language-extension-1ada2a9d.js';
|
|
13
15
|
import { U as UPDATE_TRANSLATION } from './static-subject-title-633b3474.js';
|
|
14
16
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
15
17
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
@@ -320,15 +322,21 @@ function injectVegaTranslationIntoGlobal() {
|
|
|
320
322
|
}
|
|
321
323
|
/**
|
|
322
324
|
* Inject VegaRTEContent to global as a public api
|
|
325
|
+
* Inject VegaRTETokenExtension to global as a public api
|
|
326
|
+
* Inject VegaRTELanguageExtension to global as a public api
|
|
327
|
+
* Inject VegaRTEPresetToolbarItems to global as a variable
|
|
323
328
|
*/
|
|
324
329
|
function injectVegaRichTextEditorClassIntoGlobal() {
|
|
325
330
|
globalThis.VegaRTEContent = VegaRTEContent;
|
|
331
|
+
globalThis.VegaRTETokenExtension = VegaRTETokenExtension;
|
|
332
|
+
globalThis.VegaRTELanguageExtension = VegaRTELanguageExtension;
|
|
333
|
+
globalThis.VegaRTEPresetToolbarItems = VegaRTEPresetToolbarItems;
|
|
326
334
|
}
|
|
327
335
|
/**
|
|
328
336
|
* Inject VegaPublicValidationRules to global as a public api
|
|
329
337
|
*/
|
|
330
338
|
function injectVegaPublicValidationRules() {
|
|
331
|
-
void import('./public-rules-
|
|
339
|
+
void import('./public-rules-9f62069a.js').then((module) => {
|
|
332
340
|
Object.entries(module).forEach(([name, value]) => {
|
|
333
341
|
globalThis[name] = value;
|
|
334
342
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as MapToComponentField, M as MapToComponentMethod, V as VegaSlimmer } from './global-slimmer-registry-17c4efd4.js';
|
|
2
|
-
import { i as internalVegaEventManager, j as jqueryDelegatedStrategyController } from './internal-vega-event-manager-
|
|
2
|
+
import { i as internalVegaEventManager, j as jqueryDelegatedStrategyController } from './internal-vega-event-manager-cb06e987.js';
|
|
3
3
|
import { v as vegaEnvManager } from './vega-env-manager-8f8dc473.js';
|
|
4
4
|
import { F as FeatureFlag } from './feature-flag-controller-51659753.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
2
|
-
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-
|
|
2
|
+
import { d as domNodeSubjectFactory } from './dom-node-subject-observer-factory-c7bc3035.js';
|
|
3
3
|
import { b as VegaInternalRichTextEditorFlushChanges, c as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-5a143cd2.js';
|
|
4
4
|
import { c as camelToDashCase } from './string-a953eafc.js';
|
|
5
5
|
import { L as LogUtility } from './global-slimmer-registry-17c4efd4.js';
|
|
@@ -148,6 +148,7 @@ var ModifyContentActionType;
|
|
|
148
148
|
ModifyContentActionType["DELETE_LINK_GROUP"] = "DELETE_LINK_GROUP";
|
|
149
149
|
ModifyContentActionType["UPDATE_CURSOR_POSITION"] = "UPDATE_CURSOR_POSITION";
|
|
150
150
|
ModifyContentActionType["INSERT_TEXT_TO_DECORATOR_NODE"] = "INSERT_TEXT_TO_DECORATOR_NODE";
|
|
151
|
+
ModifyContentActionType["INSERT_NODE_TO_NEAREST_ROOT"] = "INSERT_NODE_TO_NEAREST_ROOT";
|
|
151
152
|
})(ModifyContentActionType || (ModifyContentActionType = {}));
|
|
152
153
|
/**
|
|
153
154
|
* Abstract class for update node content, delete node, insert node
|
|
@@ -436,6 +437,17 @@ class ActionHandleStrategyRegistry {
|
|
|
436
437
|
LogUtility.error(`Type ${actionType} action handle strategy is not registered in class ${RTEInstance.constructor.name}`);
|
|
437
438
|
}
|
|
438
439
|
}
|
|
440
|
+
/**
|
|
441
|
+
* Check if the action type can be handled by strategy for the specific RTE instance.
|
|
442
|
+
*
|
|
443
|
+
* @param {string} actionType - The special action type or the action class name.
|
|
444
|
+
* @param {RTENode | RTEBlock} RTEInstance - The rich text editor node.
|
|
445
|
+
* @returns {boolean} - Whether the action type can be handled by the strategy.
|
|
446
|
+
*/
|
|
447
|
+
static canHandle(actionType, RTEInstance) {
|
|
448
|
+
const strategy = ActionHandleStrategyRegistry.get(actionType, RTEInstance.constructor.name);
|
|
449
|
+
return strategy ? true : false;
|
|
450
|
+
}
|
|
439
451
|
}
|
|
440
452
|
ActionHandleStrategyRegistry.registry = new Map();
|
|
441
453
|
|
|
@@ -1483,6 +1495,16 @@ const RTE_TEXT_COLORS = [
|
|
|
1483
1495
|
},
|
|
1484
1496
|
];
|
|
1485
1497
|
const ZERO_WIDTH_SPACE = '\u200b';
|
|
1498
|
+
const VegaRTEPresetToolbarItems = [
|
|
1499
|
+
['textStyles'],
|
|
1500
|
+
['bold', 'italic', 'underline', 'strikethrough', 'code'],
|
|
1501
|
+
['textColor'],
|
|
1502
|
+
['horizontalAlignment', 'bulletsNumbers'],
|
|
1503
|
+
['moreIndent', 'lessIndent'],
|
|
1504
|
+
['link'],
|
|
1505
|
+
['image'],
|
|
1506
|
+
['clearStyle'],
|
|
1507
|
+
];
|
|
1486
1508
|
|
|
1487
1509
|
/**
|
|
1488
1510
|
* Annotation to make text with text color
|
|
@@ -1853,7 +1875,8 @@ class NodeSplitTextStrategy extends ActionHandleStrategy {
|
|
|
1853
1875
|
if (noTextRangeSelected) {
|
|
1854
1876
|
return this.insertNewNode(startOffset, target);
|
|
1855
1877
|
}
|
|
1856
|
-
if (this.shouldSplitSelection(selectionRangeAnnotation.range)
|
|
1878
|
+
if (this.shouldSplitSelection(selectionRangeAnnotation.range) &&
|
|
1879
|
+
target.isContentEditable()) {
|
|
1857
1880
|
const splittedTextNodes = this.splitTextNode(selectionRangeAnnotation.range, target);
|
|
1858
1881
|
if (item.annotationMap.has('LINK')) {
|
|
1859
1882
|
item.apply(new LinkGroupNodeSplitAction(splittedTextNodes));
|
|
@@ -1880,10 +1903,12 @@ class NodeSplitTextStrategy extends ActionHandleStrategy {
|
|
|
1880
1903
|
insertNewNode(startOffset, target) {
|
|
1881
1904
|
const newNode = target.cloneWithText('');
|
|
1882
1905
|
this.setApplyTargetNode(newNode);
|
|
1883
|
-
|
|
1906
|
+
const index = target.parent.children.findIndex((node) => node === target);
|
|
1907
|
+
if (startOffset === 0 || (!target.isContentEditable() && startOffset === index)) {
|
|
1884
1908
|
return [newNode, target];
|
|
1885
1909
|
}
|
|
1886
|
-
if (startOffset === target.text.length
|
|
1910
|
+
if (startOffset === target.text.length ||
|
|
1911
|
+
(!target.isContentEditable() && startOffset === index + 1)) {
|
|
1887
1912
|
return [target, newNode];
|
|
1888
1913
|
}
|
|
1889
1914
|
const beforeNode = target.cloneWithText(target.text.substring(0, startOffset));
|
|
@@ -2471,17 +2496,29 @@ class RTETextNode extends RTENode {
|
|
|
2471
2496
|
const textNode = new RTETextNode(richText.id, richText.text, parentBlock);
|
|
2472
2497
|
const { annotations } = richText;
|
|
2473
2498
|
if (annotations) {
|
|
2474
|
-
textNode.annotationMap =
|
|
2475
|
-
.map((type) => {
|
|
2476
|
-
if (type === 'link' && annotations.link && parentBlock) {
|
|
2477
|
-
parentBlock.apply(new LinkGroupAnnotationAction(annotations.link.groupKey, [textNode], 'link'));
|
|
2478
|
-
}
|
|
2479
|
-
return this.createAnnotationEntity(type, annotations[type], options);
|
|
2480
|
-
})
|
|
2481
|
-
.filter(isNonNullable));
|
|
2499
|
+
textNode.annotationMap = this.generateTextAnnotationMap(annotations, options, parentBlock, textNode);
|
|
2482
2500
|
}
|
|
2483
2501
|
return textNode;
|
|
2484
2502
|
}
|
|
2503
|
+
/**
|
|
2504
|
+
* Generates a map of text annotations for the given set of annotations.
|
|
2505
|
+
*
|
|
2506
|
+
* @param {VegaRTETextAnnotations} annotations - The annotations to be converted into a map.
|
|
2507
|
+
* @param {VegaRTETransformOptions} options - Optional transformation options.
|
|
2508
|
+
* @param {RTETextBlock} parentBlock - The parent text block.
|
|
2509
|
+
* @param {RTETextNode} textNode - The text node.
|
|
2510
|
+
* @returns {NodeAnnotations} The map of text annotations.
|
|
2511
|
+
*/
|
|
2512
|
+
static generateTextAnnotationMap(annotations, options, parentBlock, textNode) {
|
|
2513
|
+
return new Map(Object.keys(annotations)
|
|
2514
|
+
.map((type) => {
|
|
2515
|
+
if (type === 'link' && annotations.link && parentBlock && textNode) {
|
|
2516
|
+
parentBlock.apply(new LinkGroupAnnotationAction(annotations.link.groupKey, [textNode], 'link'));
|
|
2517
|
+
}
|
|
2518
|
+
return this.createAnnotationEntity(type, annotations[type], options);
|
|
2519
|
+
})
|
|
2520
|
+
.filter(isNonNullable));
|
|
2521
|
+
}
|
|
2485
2522
|
/**
|
|
2486
2523
|
* Creates different types of text annotations based on the provided type and value.
|
|
2487
2524
|
*
|
|
@@ -2608,9 +2645,10 @@ class RTETextNode extends RTENode {
|
|
|
2608
2645
|
if (this.isContentEditable()) {
|
|
2609
2646
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.UPDATE_TEXT, dtoClassName, new NodeUpdateTextStrategy());
|
|
2610
2647
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.REPLACE_SELECTED_TEXT, dtoClassName, new NodeReplaceSelectedTextStrategy());
|
|
2611
|
-
ActionHandleStrategyRegistry.register(
|
|
2648
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINK_GROUP_NODE_SPLIT, dtoClassName, new LinkGroupNodeSplitStrategy());
|
|
2649
|
+
ActionHandleStrategyRegistry.register(LinkAnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
2612
2650
|
}
|
|
2613
|
-
ActionHandleStrategyRegistry.register(
|
|
2651
|
+
ActionHandleStrategyRegistry.register(TextSplittableAction.name, dtoClassName, new NodeSplitTextStrategy());
|
|
2614
2652
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_LINK_GROUP, dtoClassName, new DeleteLinkGroupStrategy());
|
|
2615
2653
|
ActionHandleStrategyRegistry.register(AnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
2616
2654
|
RTETextNode.registerActionStrategyStatus[dtoClassName] = true;
|
|
@@ -2659,6 +2697,18 @@ class RTETextNode extends RTENode {
|
|
|
2659
2697
|
if (!(annotation instanceof SelectionRangeAnnotation)) {
|
|
2660
2698
|
this.syncUpSelectedNodes(node);
|
|
2661
2699
|
}
|
|
2700
|
+
/**
|
|
2701
|
+
* 1. Try to get the specific strategy for the action and node type first (e.g., LinkAnnotationAction on RTETextNode).
|
|
2702
|
+
* 2. If no specific strategy found, try to get the generic NodeUpdateAnnotationMapStrategy for AnnotationAction on RTETextNode.
|
|
2703
|
+
*
|
|
2704
|
+
* This is useful when we want to check if there is a specific strategy for an action-node combination first, we can use the specific strategy to check if the special toolbar button should be enabled or disabled.
|
|
2705
|
+
* TODO: Update the other annotation actions to follow this pattern. https://gethired.atlassian.net/browse/VD-7367
|
|
2706
|
+
*/
|
|
2707
|
+
const strategy = ActionHandleStrategyRegistry.get(action.constructor.name, node.constructor.name);
|
|
2708
|
+
if (strategy) {
|
|
2709
|
+
strategy.execute(action, node);
|
|
2710
|
+
return;
|
|
2711
|
+
}
|
|
2662
2712
|
const updateAnnotationMapStrategy = ActionHandleStrategyRegistry.get(AnnotationAction.name, RTETextNode.name);
|
|
2663
2713
|
if (updateAnnotationMapStrategy) {
|
|
2664
2714
|
updateAnnotationMapStrategy.execute(action, node);
|
|
@@ -3820,8 +3870,8 @@ class CodeBlockRemoveSelfStrategy extends BlockDeleteNodeContentStrategy {
|
|
|
3820
3870
|
* @returns {number} - The number value.
|
|
3821
3871
|
*/
|
|
3822
3872
|
getRTENodeEndOffset(node) {
|
|
3823
|
-
if (node
|
|
3824
|
-
return node
|
|
3873
|
+
if (node) {
|
|
3874
|
+
return node.getRangeEndOffset();
|
|
3825
3875
|
}
|
|
3826
3876
|
return 0;
|
|
3827
3877
|
}
|
|
@@ -4169,4 +4219,4 @@ class RTECodeBlock extends RTEBlock {
|
|
|
4169
4219
|
})();
|
|
4170
4220
|
RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME = 'code-block-placeholder-element';
|
|
4171
4221
|
|
|
4172
|
-
export {
|
|
4222
|
+
export { ItalicAnnotationAction as $, ActionHandleStrategyRegistry as A, BlockInsertLineBreakStrategy as B, CustomStyleAnnotation as C, SplitBlockWithNodeAction as D, BlockUpdateHorizontalAlignmentStrategy as E, BlockDeleteNodeContentStrategy as F, RemoveChildrenStrategy as G, HorizontalAlignmentAnnotationAction as H, InsertChildrenAfterAction as I, RTENode as J, CodeLanguage as K, LinkAnnotationAction as L, ModifyContentAction as M, NodeAnnotation as N, InternalAnnotationTypeEnum as O, CommonAnnotationTypeEnum as P, UpdateCodeBlockAction as Q, RTEDTOClassManager$1 as R, SyncUpSelectionAction as S, SelectionChangeAction as T, UpdateTextAction as U, VegaRTEPresetToolbarItems as V, TextSplittableAction as W, TextColorAnnotation as X, RTECodeBlockNode as Y, ZERO_WIDTH_SPACE as Z, BoldAnnotationAction as _, RTETextNode as a, UnderlineAnnotationAction as a0, TextStyleAnnotationAction as a1, TextStyleAnnotation as a2, BoldAnnotation as a3, ClearFormattingAnnotationAction as a4, CodeAnnotationAction as a5, StrikethroughAnnotationAction as a6, IndentAnnotationAction as a7, ModifyContentActionType as b, ActionHandleStrategy as c, RTETextBlock as d, AppendChildrenAction as e, BlockInsertLineBreakWithBlocksStrategy as f, BlockSplitWithTextNodeStrategy as g, BlockReplaceNodesStrategy as h, BlockMergeNodesStrategy as i, RemoveChildrenAction as j, InsertChildrenBeforeAction as k, BlockAnnotation as l, BlockAnnotationTypeEnum as m, RTEBlock as n, CustomClassAnnotation as o, CustomAttributeAnnotation as p, RTECodeBlock as q, RTE_TEXT_COLORS as r, stateEntityRenderingRegistry as s, RTE_DEFAULT_TEXT_COLOR as t, NodeAnnotationTypeEnum as u, RTEDecoratorNode as v, NodeTypeEnum as w, CommonAnnotation as x, AnnotationAction as y, ReplaceChildNodesAction as z };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { M as MapToComponentMethod, V as VegaSlimmer, L as LogUtility, c as MapToComponentField } from './global-slimmer-registry-17c4efd4.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Y as RTECodeBlockNode, a as RTETextNode, Z as ZERO_WIDTH_SPACE, T as SelectionChangeAction, O as InternalAnnotationTypeEnum, s as stateEntityRenderingRegistry, n as RTEBlock, J as RTENode, v as RTEDecoratorNode, q as RTECodeBlock } from './code-block-68300b47.js';
|
|
3
3
|
import { d as debounce } from './timer-9321173b.js';
|
|
4
4
|
import { g as getActiveElement } from './component-7d906393.js';
|
|
5
5
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
6
|
-
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-
|
|
6
|
+
import { d as domNodeSubjectFactory, D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-c7bc3035.js';
|
|
7
7
|
import { c as VegaInternalRichTextEditorSelectionRangeChange, a as VegaInternalUpdateRTECursorPosition } from './vega-internal-event-id-5a143cd2.js';
|
|
8
8
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
9
|
-
import {
|
|
9
|
+
import { R as RTERange } from './range-c2eeb794.js';
|
|
10
10
|
import { S as SynchronizeTaskQueue } from './synchronize-task-queue-ac8acc3b.js';
|
|
11
|
-
import {
|
|
11
|
+
import { i as isHTMLElement } from './ui-c20be16d.js';
|
|
12
12
|
import { K as KeyboardManagerSlimmer } from './keyboard-manager-slimmer-cae3a002.js';
|
|
13
13
|
|
|
14
14
|
let processing = false;
|
|
@@ -224,178 +224,6 @@ __decorate$1([
|
|
|
224
224
|
MapToComponentMethod('componentDidUpdate')
|
|
225
225
|
], AutoRunWhenReRenderTaskQueueSlimmer.prototype, "executeTaskHook", null);
|
|
226
226
|
|
|
227
|
-
/** Manages selection range for a rich text editor, providing methods to set, sync, and create native ranges based on RTENodes and Nodes. */
|
|
228
|
-
class RTERange {
|
|
229
|
-
/**
|
|
230
|
-
* Initial the rte range properties
|
|
231
|
-
*
|
|
232
|
-
* @param {Node} [startContainer] The range start element.
|
|
233
|
-
* @param {Node} [endContainer] The range end element.
|
|
234
|
-
* @param {number} [startOffset] The range start element content offset, default value is 0.
|
|
235
|
-
* @param {number} [endOffset] The range end element content offset, default value is 0.
|
|
236
|
-
* @param {RTENode} [startNode] The range start node, the start node could be null if the start element is root element.
|
|
237
|
-
* @param {RTENode} [endNode] The range start node, the start node could be null if the start element is root element.
|
|
238
|
-
* @param {Range} [nativeRange] The browser native range instance.
|
|
239
|
-
*/
|
|
240
|
-
constructor(startContainer, endContainer, startOffset = 0, endOffset = 0, startNode, endNode, nativeRange) {
|
|
241
|
-
this._startOffset = 0;
|
|
242
|
-
this._endOffset = 0;
|
|
243
|
-
this._startContainer = startContainer;
|
|
244
|
-
this._endContainer = endContainer;
|
|
245
|
-
this._startOffset = startOffset;
|
|
246
|
-
this._endOffset = endOffset;
|
|
247
|
-
this._startNode = startNode;
|
|
248
|
-
this._endNode = endNode;
|
|
249
|
-
if (nativeRange) {
|
|
250
|
-
this._oldNativeRange = nativeRange;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Returns the start container as a Node or null if it is not set.
|
|
255
|
-
* The start container could be null when the dom node should be create after re-render.
|
|
256
|
-
*
|
|
257
|
-
* @returns {Nullable<Node>} The range start element.
|
|
258
|
-
*/
|
|
259
|
-
get startContainer() {
|
|
260
|
-
return this._startContainer;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Returns the end container as a Node or null if it is not set.
|
|
264
|
-
* The end container could be null when the dom node should be create after re-render.
|
|
265
|
-
*
|
|
266
|
-
* @returns {Nullable<Node>} The range start element.
|
|
267
|
-
*/
|
|
268
|
-
get endContainer() {
|
|
269
|
-
return this._endContainer;
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Returns the range start RTE node as a RTENode or null if it is not set.
|
|
273
|
-
* The start RTENode could be null when the range start node is the root element of the rich text editor.
|
|
274
|
-
*
|
|
275
|
-
* @returns {Nullable<RTENode>} The range start element.
|
|
276
|
-
*/
|
|
277
|
-
get startNode() {
|
|
278
|
-
return this._startNode;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Returns the range end RTE node as a RTENode or null if it is not set.
|
|
282
|
-
* The end RTENode could be null when the range end node is the root element of the rich text editor.
|
|
283
|
-
*
|
|
284
|
-
* @returns {Nullable<RTENode>} The range start element.
|
|
285
|
-
*/
|
|
286
|
-
get endNode() {
|
|
287
|
-
return this._endNode;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Returns range's start offset.
|
|
291
|
-
*
|
|
292
|
-
* @returns {number} The character length in text node or the element index of parent element.
|
|
293
|
-
*/
|
|
294
|
-
get startOffset() {
|
|
295
|
-
return this._startOffset;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Returns range's start offset.
|
|
299
|
-
*
|
|
300
|
-
* @returns {number} The character length in text node or the element index of parent element.
|
|
301
|
-
*/
|
|
302
|
-
get endOffset() {
|
|
303
|
-
return this._endOffset;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Updates the range options for a Rich Text Editor.
|
|
307
|
-
* This method will called after modify the content, the start node and end node should be rte node.
|
|
308
|
-
* This method will called after selectionchange event emit, the start node and end node should be the html node.
|
|
309
|
-
*
|
|
310
|
-
* @param {RTERangeOptions} options - An object that contains the following properties:
|
|
311
|
-
* @param {Range} [nativeRange] - The native range instance
|
|
312
|
-
* @returns {RTERange} - The new RTERange instance
|
|
313
|
-
*/
|
|
314
|
-
updateRTERange(options, nativeRange) {
|
|
315
|
-
const { startOffset, endOffset } = options;
|
|
316
|
-
this._startOffset = startOffset;
|
|
317
|
-
this._endOffset = endOffset;
|
|
318
|
-
const startNode = options.startNode;
|
|
319
|
-
const endNode = options.endNode;
|
|
320
|
-
if (startNode instanceof RTENode) {
|
|
321
|
-
this._startNode = startNode;
|
|
322
|
-
this._endNode = endNode;
|
|
323
|
-
const startContainer = this._startNode.getRangeContainer();
|
|
324
|
-
const endContainer = this._startNode === this._endNode ? startContainer : this._endNode.getRangeContainer();
|
|
325
|
-
if (startContainer) {
|
|
326
|
-
this._startContainer = startContainer;
|
|
327
|
-
this._endContainer = endContainer;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
331
|
-
// The selectionchange callback has a 50 ms delay, so we need to check the next range is the same as the current ret range.
|
|
332
|
-
this._startContainer = startNode;
|
|
333
|
-
this._endContainer = endNode;
|
|
334
|
-
this._startNode = this.getRTENodeByElement(this._startContainer);
|
|
335
|
-
this._endNode =
|
|
336
|
-
this._startContainer === this._endContainer
|
|
337
|
-
? this._startNode
|
|
338
|
-
: this.getRTENodeByElement(this._endContainer);
|
|
339
|
-
if (nativeRange) {
|
|
340
|
-
this._oldNativeRange = nativeRange;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return new RTERange(this._startContainer, this._endContainer, this._startOffset, this._endOffset, this._startNode, this._endNode, this._oldNativeRange);
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Creates a new instance of the `RTERange` class with the same properties as the current instance.
|
|
347
|
-
*
|
|
348
|
-
* @returns {RTERange} A new `RTERange` instance with the same start and end containers, offsets, and nodes.
|
|
349
|
-
*/
|
|
350
|
-
clone() {
|
|
351
|
-
return new RTERange(this._startContainer, this._endContainer, this._startOffset, this._endOffset, this._startNode, this._endNode, this._oldNativeRange);
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Creates a Range object based on start and end nodes and offsets.
|
|
355
|
-
* Invoke this method to get the future range state if the range content modified.
|
|
356
|
-
* Invoke this method to get the native range instance if range start node and end node not defined
|
|
357
|
-
*
|
|
358
|
-
* @returns {Nullable<Range>} The range instance. The return value could be null if the start node or end node are not rendered.
|
|
359
|
-
*/
|
|
360
|
-
toNativeRange() {
|
|
361
|
-
let range = null;
|
|
362
|
-
if (this._startNode) {
|
|
363
|
-
const startContainer = this._startNode.getRangeContainer();
|
|
364
|
-
const endContainer = this._startNode === this._endNode
|
|
365
|
-
? startContainer
|
|
366
|
-
: this._endNode.getRangeContainer();
|
|
367
|
-
if (startContainer && endContainer) {
|
|
368
|
-
range = new Range();
|
|
369
|
-
range.setStart(startContainer, this._startOffset);
|
|
370
|
-
range.setEnd(endContainer, this._endOffset);
|
|
371
|
-
this._startContainer = startContainer;
|
|
372
|
-
this._endContainer = endContainer;
|
|
373
|
-
this._oldNativeRange = range;
|
|
374
|
-
return range;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
if (!range && this._oldNativeRange) {
|
|
378
|
-
return this._oldNativeRange;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* Retrieves an RTENode based on the given element by checking its type and parent elements.
|
|
383
|
-
*
|
|
384
|
-
* @param {Node} element - An element in the DOM (Document Object Model).
|
|
385
|
-
* @returns { Nullable<RTENode>} Returns a nullable `RTENode` object.
|
|
386
|
-
*/
|
|
387
|
-
getRTENodeByElement(element) {
|
|
388
|
-
if (element) {
|
|
389
|
-
const registerElement = element.nodeType === Node.TEXT_NODE
|
|
390
|
-
? element.parentElement
|
|
391
|
-
: isHTMLElement(element) && RTEDecoratorNode.isDecoratorNodeContainerElement(element)
|
|
392
|
-
? RTEDecoratorNode.getDecoratorNodeElement(element)
|
|
393
|
-
: element;
|
|
394
|
-
return stateEntityRenderingRegistry.getEntityByDOM(registerElement);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
227
|
/**
|
|
400
228
|
* Represents the state of the selection in the RTE.
|
|
401
229
|
*/
|
|
@@ -573,7 +401,12 @@ class SelectionController extends AutoRunWhenReRenderTaskQueueSlimmer {
|
|
|
573
401
|
this.enqueueSelectionRangeFutureState(startNode, ZERO_WIDTH_SPACE.length);
|
|
574
402
|
}
|
|
575
403
|
else {
|
|
576
|
-
|
|
404
|
+
// Don't need update the range if the selected node is a non-editable text node, such as token node.
|
|
405
|
+
if (!(startNode === endNode &&
|
|
406
|
+
startNode instanceof RTETextNode &&
|
|
407
|
+
!startNode.isContentEditable())) {
|
|
408
|
+
this.enqueueSelectionRangeFutureState(startNode, startOffset, endNode, endOffset);
|
|
409
|
+
}
|
|
577
410
|
}
|
|
578
411
|
this.selectionState = null;
|
|
579
412
|
}
|
|
@@ -584,10 +417,11 @@ class SelectionController extends AutoRunWhenReRenderTaskQueueSlimmer {
|
|
|
584
417
|
handleSelectionChange() {
|
|
585
418
|
if (this.disabled || this.sourceView)
|
|
586
419
|
return;
|
|
420
|
+
// Clear previous selection when handling new selection always
|
|
421
|
+
this.clearSelectionMap();
|
|
587
422
|
const selection = this.getSelection();
|
|
588
423
|
if (!selection || selection.rangeCount === 0)
|
|
589
424
|
return;
|
|
590
|
-
this.clearSelectionMap();
|
|
591
425
|
this.saveSelection();
|
|
592
426
|
const range = selection.getRangeAt(0);
|
|
593
427
|
const commonAncestor = range.commonAncestorContainer;
|
|
@@ -706,7 +540,7 @@ class SelectionController extends AutoRunWhenReRenderTaskQueueSlimmer {
|
|
|
706
540
|
startNode,
|
|
707
541
|
endNode,
|
|
708
542
|
startOffset: 0,
|
|
709
|
-
endOffset: endNode.
|
|
543
|
+
endOffset: endNode.getRangeEndOffset(),
|
|
710
544
|
});
|
|
711
545
|
this.selectionState = new RTESelectionState(this.currentRange);
|
|
712
546
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as isBorderColorTokenType, b as BorderColors, e as BorderColorMap, k as isShadowsTokenType, f as Shadows, g as ShadowMap, l as isBorderTokenType, m as Borders, n as BorderMap, o as isSpacingTokenType, p as isBorderRadiusTokenType, q as isBackgroundColorTokenType, r as isTextColorTokenType, s as isBreakpointsTokenType, h as Spacing, t as isBorderStyleType, B as BorderRadius, C as Colors, u as isTypographyTokenType } from './type-guard-12f7654b.js';
|
|
2
2
|
import { B as Breakpoints } from './breakpoints-d9faf11c.js';
|
|
3
3
|
import { L as LogUtility } from './global-slimmer-registry-17c4efd4.js';
|
|
4
|
-
import { R as ResponsiveFormatFacade } from './responsive-format-facade-
|
|
4
|
+
import { R as ResponsiveFormatFacade } from './responsive-format-facade-5711c77d.js';
|
|
5
5
|
import { a as TypographyKeys } from './typography-396de03f.js';
|
|
6
6
|
import { S as StateVariantFormatter, s as stateBackgroundColorFormatter } from './state-background-color-formatter-0f01d27a.js';
|
|
7
7
|
import { a as BorderStyle } from './ui-8424715a.js';
|