@globalpayments/vega 2.38.0 → 2.40.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-7087f121.js → app-globals-cdd0972c.js} +14 -4
- package/dist/cjs/check-box-required-rule-1ee54b9a.js +70 -0
- package/dist/cjs/content-state-c5b47ca1.js +6644 -0
- package/dist/cjs/date-required-rule-4e1f84fd.js +92 -0
- package/dist/cjs/{element-appender-slimmer-c6e0f4ca.js → element-appender-slimmer-4f0dc8c6.js} +9 -5
- package/dist/cjs/file-uploader-required-rule-313ec9e3.js +21 -0
- package/dist/cjs/{form-field-controller-slimmer-48c0ad0b.js → form-field-controller-slimmer-d92e8212.js} +28 -1
- package/dist/cjs/{image-annotation-action-7d82f7e1.js → image-annotation-action-75b9c0d3.js} +5 -6
- package/dist/cjs/index.cjs.js +35 -15
- package/dist/cjs/input-phone-number-required-rule-2668fdf1.js +65 -0
- package/dist/cjs/input-range-required-rule-5b9c2a95.js +63 -0
- package/dist/cjs/internal-form-field-validation-rule.abstract-07cdff46.js +15 -0
- package/dist/cjs/loader.cjs.js +10 -10
- package/dist/cjs/{min-number-rule-115c5a3b.js → min-number-rule-5bcccc8f.js} +7 -4
- package/dist/cjs/{min-string-length-rule-75f24a48.js → min-string-length-rule-af215976.js} +8 -4
- package/dist/cjs/public-rules-90b972e5.js +42 -0
- package/dist/cjs/{required-field-rule-7f9945fa.js → required-field-rule-d73c1d8c.js} +6 -3
- package/dist/cjs/rich-text-editor-required-rule-cacc5fe0.js +64 -0
- package/dist/cjs/time-required-rule-ccf178e7.js +141 -0
- package/dist/cjs/toggle-switch-required-rule-88a51b36.js +66 -0
- package/dist/cjs/{valid-credit-card-number-rule-4a9ae5d9.js → valid-credit-card-number-rule-4a1b00b8.js} +3 -2
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +11 -79
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +3 -2
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +9 -91
- package/dist/cjs/vega-dialog_2.cjs.entry.js +29 -1
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +1 -1
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +5 -19
- package/dist/cjs/vega-form.cjs.entry.js +2 -1
- package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -2
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +4 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -2
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +38 -70
- package/dist/cjs/vega-input-range.cjs.entry.js +6 -61
- package/dist/cjs/vega-input-select.cjs.entry.js +3 -2
- package/dist/cjs/vega-input.cjs.entry.js +7 -6
- package/dist/cjs/vega-popover_2.cjs.entry.js +15 -1
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +18 -19
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +79 -139
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +3 -2
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +3 -2
- package/dist/cjs/vega-signature-capture.cjs.entry.js +3 -2
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -2
- package/dist/cjs/vega-textarea.cjs.entry.js +4 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +11 -140
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +4 -63
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +53 -12
- package/dist/cjs/vega.cjs.js +10 -10
- package/dist/collection/components/vega-checkbox/vega-checkbox.css +82 -33
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +8 -13
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +2 -2
- package/dist/collection/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.js +18 -2
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +7 -4
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-layout-controller.js +9 -0
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-scroll-controller.js +16 -0
- package/dist/collection/components/vega-modal/vega-modal.js +6 -0
- package/dist/collection/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.js +4 -0
- package/dist/collection/components/vega-popover/vega-popover.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.js +52 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +63 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-link-group-strategy.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy.js +32 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/image-set-annotation-map-strategy.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-split-text-strategy.js +134 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-blocks-strategy.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-nodes-strategy.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-image-strategy.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +152 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-after-strategy.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-before-strategy.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-image-into-text-strategy.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-with-blocks-strategy.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-new-paragraph-strategy.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-nodes-after-node-strategy.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-nodes-before-node-strategy.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy.js +25 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-child-block-strategy.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-node-with-nodes-strategy.js +28 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-nodes-strategy.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-image-node-strategy.js +48 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-text-node-strategy.js +43 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-block-insert-image-strategy.js +32 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-strategy.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-with-blocks-strategy.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-new-paragraph-strategy.js +44 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-update-url-strategy.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-insert-image-strategy.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-delete-text-content-strategy.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-image-strategy.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-new-paragraph-strategy.js +92 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-nest-list-strategy.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-node-strategy.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +63 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/node-replace-selected-text-strategy.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/node-update-text-strategy.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/image-update-url-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +3 -215
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +31 -244
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +17 -155
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +33 -184
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +40 -352
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +13 -23
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +14 -6
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +23 -182
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/action-handle-strategy-registry.test.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-insert-line-break-with-blocks-strategy.test.js +24 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-set-annotation-map-strategy.test.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-update-url-strategy.test.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-block-strategy-register.test.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-item-strategy-register.test.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-split-text-strategy.test.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-update-annotation-map-strategy.test.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/update-selected-text-strategy.test.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +2 -2
- package/dist/collection/components/vega-tooltip/slimmers/controllers/vega-tooltip-element-appender-controller.js +45 -11
- package/dist/collection/components/vega-tooltip/vega-tooltip.js +12 -0
- package/dist/collection/global/scripts/before-vega-load.js +11 -0
- package/dist/collection/helpers/slimmers/element-appender-slimmer.js +8 -5
- package/dist/collection/helpers/slimmers/test/element-appender-slimmer.test.js +2 -0
- package/dist/collection/helpers/ui/element-appender.js +1 -0
- package/dist/collection/helpers/ui/test/element-appender.test.js +1 -0
- package/dist/collection/helpers/validator/form-field-controller.js +28 -1
- package/dist/collection/helpers/validator/public-rules.js +10 -0
- package/dist/collection/helpers/validator/rules/check-box-required-rule.js +4 -3
- package/dist/collection/helpers/validator/rules/date-range-rule.js +2 -1
- package/dist/collection/helpers/validator/rules/date-required-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/email-field-rule.js +3 -2
- package/dist/collection/helpers/validator/rules/{object-array-required-rule.js → file-uploader-required-rule.js} +1 -1
- package/dist/collection/helpers/validator/rules/input-phone-number-required-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/input-range-min-and-max-rule.js +3 -1
- package/dist/collection/helpers/validator/rules/input-range-required-rule.js +5 -4
- package/dist/collection/helpers/validator/rules/internal-form-field-validation-rule.abstract.js +11 -0
- package/dist/collection/helpers/validator/rules/max-number-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/max-string-length-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/min-and-max-date-rule.js +3 -1
- package/dist/collection/helpers/validator/rules/min-number-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/min-string-length-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/required-field-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/rich-text-editor-required-rule.js +4 -3
- package/dist/collection/helpers/validator/rules/time-range-required-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/time-range-rule.js +3 -1
- package/dist/collection/helpers/validator/rules/time-required-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/toggle-switch-required-rule.js +4 -3
- package/dist/collection/helpers/validator/rules/valid-credit-card-number-rule.js +3 -2
- package/dist/collection/helpers/validator/rules/valid-phone-number-rule.js +11 -4
- package/dist/collection/helpers/validator/test/rules/file-uploader-required-rule.test.js +7 -0
- package/dist/collection/helpers/validator/test/rules/public-rules.test.js +80 -0
- package/dist/collection/helpers/validator/test/rules/valid-phone-number-rule.test.js +8 -0
- package/dist/collection/index.js +1 -0
- package/dist/esm/{app-globals-4cca4a96.js → app-globals-88fa3549.js} +14 -4
- package/dist/esm/check-box-required-rule-cb0aa339.js +68 -0
- package/dist/esm/content-state-2edba4ec.js +6600 -0
- package/dist/esm/{date-732bc749.js → date-c55b97f0.js} +1 -1
- package/dist/esm/date-required-rule-8944f3bf.js +90 -0
- package/dist/esm/{element-appender-slimmer-f5e703f3.js → element-appender-slimmer-d9155ee0.js} +9 -5
- package/dist/esm/file-uploader-required-rule-ad886d01.js +19 -0
- package/dist/esm/{form-field-controller-slimmer-3535e76a.js → form-field-controller-slimmer-bb64dec7.js} +29 -2
- package/dist/esm/{image-annotation-action-3da42221.js → image-annotation-action-b6668f48.js} +1 -2
- package/dist/esm/{index-6e05b241.js → index-d172bafa.js} +1 -1
- package/dist/esm/index.js +17 -7
- package/dist/esm/input-phone-number-required-rule-be6a5572.js +63 -0
- package/dist/esm/input-range-required-rule-3ad74776.js +61 -0
- package/dist/esm/internal-form-field-validation-rule.abstract-f5b6bdbf.js +13 -0
- package/dist/esm/loader.js +11 -11
- package/dist/esm/{min-number-rule-31d48b22.js → min-number-rule-a6082418.js} +7 -4
- package/dist/esm/{min-string-length-rule-c6a69eeb.js → min-string-length-rule-c31c89f4.js} +8 -4
- package/dist/esm/public-rules-413f6a17.js +27 -0
- package/dist/esm/{required-field-rule-368b31fa.js → required-field-rule-ab4bdc47.js} +6 -3
- package/dist/esm/rich-text-editor-required-rule-75cc2db0.js +62 -0
- package/dist/esm/{string-input-formatter-slimmer-d4132497.js → string-input-formatter-slimmer-418b54f0.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-51151fc3.js → sub-state-notify-slimmer-b36fd081.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-d77a1c46.js → sub-state-observer-slimmer-09452523.js} +1 -1
- package/dist/esm/time-required-rule-a01163b5.js +138 -0
- package/dist/esm/toggle-switch-required-rule-b3cf4302.js +64 -0
- package/dist/esm/{valid-credit-card-number-rule-2aef3ad5.js → valid-credit-card-number-rule-cc497bec.js} +3 -2
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-calendar_3.entry.js +4 -4
- package/dist/esm/vega-checkbox_2.entry.js +12 -80
- package/dist/esm/vega-color-picker.entry.js +4 -3
- package/dist/esm/vega-combo-box.entry.js +4 -3
- package/dist/esm/vega-date-picker_2.entry.js +12 -94
- package/dist/esm/vega-dialog_2.entry.js +29 -1
- package/dist/esm/vega-dropdown_5.entry.js +4 -4
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +6 -20
- package/dist/esm/vega-form.entry.js +3 -2
- package/dist/esm/vega-image-uploader.entry.js +4 -3
- package/dist/esm/vega-input-credit-card.entry.js +5 -4
- package/dist/esm/vega-input-numeric.entry.js +5 -4
- package/dist/esm/vega-input-phone-number.entry.js +38 -70
- package/dist/esm/vega-input-range.entry.js +6 -61
- package/dist/esm/vega-input-select.entry.js +4 -3
- package/dist/esm/vega-input.entry.js +11 -10
- package/dist/esm/{vega-internal-event-id-d0690d0d.js → vega-internal-event-id-f269c42f.js} +1 -1
- package/dist/esm/vega-left-nav_5.entry.js +3 -3
- package/dist/esm/vega-popover_2.entry.js +16 -2
- package/dist/esm/vega-radio_2.entry.js +4 -3
- package/dist/esm/vega-rich-text-content.entry.js +6 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +23 -83
- package/dist/esm/vega-selection-chip_2.entry.js +6 -5
- package/dist/esm/vega-selection-tile_2.entry.js +6 -5
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +4 -3
- package/dist/esm/vega-stepper.entry.js +4 -3
- package/dist/esm/vega-table_8.entry.js +3 -3
- package/dist/esm/vega-textarea.entry.js +5 -4
- package/dist/esm/vega-time-picker_2.entry.js +8 -137
- package/dist/esm/vega-toggle-switch.entry.js +4 -63
- package/dist/esm/vega-tooltip_2.entry.js +53 -12
- package/dist/esm/vega.js +11 -11
- package/dist/types/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.d.ts +7 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-layout-controller.d.ts +4 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-scroll-controller.d.ts +5 -0
- package/dist/types/components/vega-modal/vega-modal.d.ts +1 -0
- package/dist/types/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.d.ts +1 -0
- package/dist/types/components/vega-popover/vega-popover.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.d.ts +37 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.d.ts +66 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-link-group-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/image-set-annotation-map-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-split-text-strategy.d.ts +47 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-blocks-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-nodes-strategy.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-image-strategy.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.d.ts +61 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-after-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-before-strategy.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-image-into-text-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-strategy.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-with-blocks-strategy.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-new-paragraph-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-nodes-after-node-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-nodes-before-node-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-child-block-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-node-with-nodes-strategy.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-nodes-strategy.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-image-node-strategy.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-text-node-strategy.d.ts +24 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-block-insert-image-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-with-blocks-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-new-paragraph-strategy.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-update-url-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-insert-image-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-delete-text-content-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-image-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-new-paragraph-strategy.d.ts +38 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-nest-list-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-node-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/node-replace-selected-text-strategy.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/node-update-text-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/image-update-url-action.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +1 -79
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +3 -77
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +0 -38
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +3 -58
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +5 -93
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +0 -43
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-insert-line-break-with-blocks-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-set-annotation-map-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-update-url-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-block-strategy-register.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-item-strategy-register.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-split-text-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-update-annotation-map-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/update-selected-text-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-tooltip/slimmers/controllers/vega-tooltip-element-appender-controller.d.ts +18 -0
- package/dist/types/components/vega-tooltip/vega-tooltip.d.ts +4 -0
- package/dist/types/components.d.ts +14 -0
- package/dist/types/helpers/slimmers/element-appender-slimmer.d.ts +1 -0
- package/dist/types/helpers/slimmers/form-field-controller-slimmer.d.ts +2 -1
- package/dist/types/helpers/validator/form-field-controller.d.ts +10 -0
- package/dist/types/helpers/validator/public-rules.d.ts +10 -0
- package/dist/types/helpers/validator/rules/check-box-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/date-range-rule.d.ts +3 -2
- package/dist/types/helpers/validator/rules/date-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/email-field-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/{object-array-required-rule.d.ts → file-uploader-required-rule.d.ts} +1 -1
- package/dist/types/helpers/validator/rules/input-phone-number-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/input-range-min-and-max-rule.d.ts +3 -2
- package/dist/types/helpers/validator/rules/input-range-required-rule.d.ts +8 -7
- package/dist/types/helpers/validator/rules/internal-form-field-validation-rule.abstract.d.ts +19 -0
- package/dist/types/helpers/validator/rules/max-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/max-string-length-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/min-and-max-date-rule.d.ts +3 -2
- package/dist/types/helpers/validator/rules/min-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/min-string-length-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/required-field-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/rich-text-editor-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/time-range-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/time-range-rule.d.ts +3 -2
- package/dist/types/helpers/validator/rules/time-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/toggle-switch-required-rule.d.ts +5 -4
- package/dist/types/helpers/validator/rules/valid-credit-card-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/valid-phone-number-rule.d.ts +7 -4
- package/dist/types/helpers/validator/test/rules/file-uploader-required-rule.test.d.ts +1 -0
- package/dist/types/helpers/validator/test/rules/public-rules.test.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/public-api.d.ts +1 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-04c72f30.entry.js +1 -0
- package/dist/vega/{p-ba077ca8.entry.js → p-073beb31.entry.js} +1 -1
- package/dist/vega/p-07c2725a.js +1 -0
- package/dist/vega/{p-b5990090.js → p-08835909.js} +1 -1
- package/dist/vega/p-0b6d4561.entry.js +1 -0
- package/dist/vega/p-0bb860cc.js +1 -0
- package/dist/vega/p-0cc1ad76.js +1 -0
- package/dist/vega/p-113cd659.entry.js +1 -0
- package/dist/vega/{p-b9a0f136.entry.js → p-154d262e.entry.js} +1 -1
- package/dist/vega/p-17598aac.entry.js +1 -0
- package/dist/vega/p-23130825.entry.js +1 -0
- package/dist/vega/{p-29d6ec6c.js → p-239bae84.js} +1 -1
- package/dist/vega/{p-7198d675.entry.js → p-24ac5151.entry.js} +1 -1
- package/dist/vega/p-280cbcdb.js +1 -0
- package/dist/vega/p-3299c30b.entry.js +1 -0
- package/dist/vega/p-3fd9d39f.entry.js +1 -0
- package/dist/vega/p-42a949f5.entry.js +1 -0
- package/dist/vega/p-4bd1b877.entry.js +1 -0
- package/dist/vega/p-590fd123.js +1 -0
- package/dist/vega/p-5a7eabcc.js +1 -0
- package/dist/vega/p-5e56f3bd.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-612c9374.entry.js +1 -0
- package/dist/vega/p-6408d3dc.entry.js +1 -0
- package/dist/vega/{p-a2a34239.entry.js → p-6585bddc.entry.js} +2 -2
- package/dist/vega/p-6603081a.entry.js +1 -0
- package/dist/vega/p-6e5db02b.js +1 -0
- package/dist/vega/p-6f90d444.js +1 -0
- package/dist/vega/p-7303fff2.entry.js +1 -0
- package/dist/vega/p-7b648a05.entry.js +1 -0
- package/dist/vega/p-7c0b4c36.js +1 -0
- package/dist/vega/p-81b21503.entry.js +1 -0
- package/dist/vega/p-8fae8f9e.js +1 -0
- package/dist/vega/p-924b4e24.js +1 -0
- package/dist/vega/{p-ee2e4bff.entry.js → p-94459733.entry.js} +1 -1
- package/dist/vega/p-a05ca459.entry.js +1 -0
- package/dist/vega/p-a3e80fb2.entry.js +1 -0
- package/dist/vega/p-a7a46358.entry.js +1 -0
- package/dist/vega/{p-34bd9204.js → p-a9e1123a.js} +1 -1
- package/dist/vega/p-abd7aeaa.js +1 -0
- package/dist/vega/{p-267cde46.entry.js → p-b071be5c.entry.js} +1 -1
- package/dist/vega/p-b24da503.entry.js +1 -0
- package/dist/vega/p-b44f3309.js +1 -0
- package/dist/vega/p-b9051ad2.js +1 -0
- package/dist/vega/{p-20326c64.js → p-bd0116f9.js} +1 -1
- package/dist/vega/{p-4ab0d645.js → p-c253d09c.js} +1 -1
- package/dist/vega/p-c56acdd5.entry.js +1 -0
- package/dist/vega/p-cdbbdcc2.js +1 -0
- package/dist/vega/p-d1a06058.entry.js +1 -0
- package/dist/vega/{p-348e95ba.js → p-d2ff56d8.js} +1 -1
- package/dist/vega/p-d51b04ce.entry.js +1 -0
- package/dist/vega/p-e0446879.js +1 -0
- package/dist/vega/p-e08b6542.entry.js +1 -0
- package/dist/vega/p-e0d3ca2d.js +1 -0
- package/dist/vega/{p-e9a5bd12.entry.js → p-f1ebe86b.entry.js} +1 -1
- package/dist/vega/p-f396c69a.js +1 -0
- package/dist/vega/p-fda6c178.entry.js +1 -0
- package/dist/vega/p-ffac4b8c.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/content-state-f97d3278.js +0 -2990
- package/dist/cjs/node-annotation.abstract-4f6df9cf.js +0 -3223
- package/dist/collection/components/vega-rich-text-editor/dto/actions/clear-child-nodes-action.js +0 -12
- package/dist/collection/components/vega-rich-text-editor/dto/helper/block-base-operator.js +0 -47
- package/dist/collection/helpers/validator/test/rules/object-array-required-rule.test.js +0 -7
- package/dist/esm/content-state-ccf5f960.js +0 -2954
- package/dist/esm/node-annotation.abstract-b2e36bc4.js +0 -3214
- package/dist/types/components/vega-rich-text-editor/dto/actions/clear-child-nodes-action.d.ts +0 -9
- package/dist/types/components/vega-rich-text-editor/dto/helper/block-base-operator.d.ts +0 -24
- package/dist/vega/p-0461e318.js +0 -1
- package/dist/vega/p-12fe63c1.entry.js +0 -1
- package/dist/vega/p-1b67c443.entry.js +0 -1
- package/dist/vega/p-1d93b3a9.js +0 -1
- package/dist/vega/p-23fd9401.entry.js +0 -1
- package/dist/vega/p-2fecbcf9.entry.js +0 -1
- package/dist/vega/p-3152031c.js +0 -1
- package/dist/vega/p-3cb90bdf.entry.js +0 -1
- package/dist/vega/p-3e8f9fcf.entry.js +0 -1
- package/dist/vega/p-497f2f86.entry.js +0 -1
- package/dist/vega/p-50eabdca.entry.js +0 -1
- package/dist/vega/p-52a8a4f8.js +0 -1
- package/dist/vega/p-6419e13e.entry.js +0 -1
- package/dist/vega/p-66b9e86d.entry.js +0 -1
- package/dist/vega/p-74958b1a.js +0 -1
- package/dist/vega/p-7baa4fae.entry.js +0 -1
- package/dist/vega/p-7edcb8d0.entry.js +0 -1
- package/dist/vega/p-904b489a.entry.js +0 -1
- package/dist/vega/p-9689ad99.entry.js +0 -1
- package/dist/vega/p-9728d571.entry.js +0 -1
- package/dist/vega/p-a7e078ac.entry.js +0 -1
- package/dist/vega/p-a7f40a65.entry.js +0 -1
- package/dist/vega/p-a8a809e1.entry.js +0 -1
- package/dist/vega/p-a8b16ff2.js +0 -1
- package/dist/vega/p-aed80794.entry.js +0 -1
- package/dist/vega/p-b517ed15.js +0 -1
- package/dist/vega/p-b809f3d7.entry.js +0 -1
- package/dist/vega/p-ba2833c0.entry.js +0 -1
- package/dist/vega/p-bf4996d5.entry.js +0 -1
- package/dist/vega/p-cb4fd6e1.entry.js +0 -1
- package/dist/vega/p-e9785742.entry.js +0 -1
- package/dist/vega/p-ecaf4cfa.entry.js +0 -1
- package/dist/vega/p-f41102cd.js +0 -1
- package/dist/vega/p-f5b0ce61.js +0 -1
- package/dist/vega/p-f86ec91b.js +0 -1
- /package/dist/types/{helpers/validator/test/rules/object-array-required-rule.test.d.ts → components/vega-rich-text-editor/test/dto/action-handle-strategies/action-handle-strategy-registry.test.d.ts} +0 -0
|
@@ -2,23 +2,28 @@ import { RTETextNode } from '../nodes/text-node';
|
|
|
2
2
|
import { isNonNullable } from '../../../../types/type-guard';
|
|
3
3
|
import { TextStyleAnnotation } from '../annotations/text-style-annotation';
|
|
4
4
|
import { ModifyContentActionType } from '../actions/modify-content-action.abstract';
|
|
5
|
-
import { RemoveChildAction } from '../actions/remove-child-action';
|
|
6
5
|
import { AppendChildNodesAction } from '../actions/append-child-nodes-action';
|
|
7
6
|
import { RTEBlock } from './block.abstract';
|
|
8
|
-
import { InternalAnnotationTypeEnum } from '../annotations/annotation.abstract';
|
|
9
7
|
import { TextStyleAnnotationAction } from '../actions/text-style-annotation-action';
|
|
10
|
-
import { BoldAnnotationAction } from '../actions/bold-annotation-action';
|
|
11
8
|
import { NodeAnnotationTypeEnum } from '../annotations/node-annotation.abstract';
|
|
12
9
|
import { LinkAnnotationAction } from '../actions/link-annotation-action';
|
|
13
10
|
import { LinkGroupAnnotationAction } from '../actions/link-group-annotation-action';
|
|
14
|
-
import { SplitBlockWithNodeAction } from '../actions/split-block-with-node-action';
|
|
15
11
|
import { generateUUID } from '../../../../utils/misc';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
12
|
+
import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action-handle-strategy-registry';
|
|
13
|
+
import { BlockUpdateTextStyleStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy';
|
|
14
|
+
import { BlockUpdateLinkGroupStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-link-group-strategy';
|
|
15
|
+
import { BlockRemoveNodeStrategy } from '../action-handle-strategies/modify-content-strategies/block-remove-node-strategy';
|
|
16
|
+
import { BlockAppendNodesStrategy } from '../action-handle-strategies/modify-content-strategies/block-append-nodes-strategy';
|
|
17
|
+
import { BlockSplitWithTextNodeStrategy } from '../action-handle-strategies/modify-content-strategies/block-split-with-text-node-strategy';
|
|
18
|
+
import { BlockReplaceNodesStrategy } from '../action-handle-strategies/modify-content-strategies/block-replace-nodes-strategy';
|
|
19
|
+
import { BlockMergeNodesStrategy } from '../action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy';
|
|
20
|
+
import { BlockInsertNewParagraphStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-new-paragraph-strategy';
|
|
21
|
+
import { BlockInsertLineBreakStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-line-break-strategy';
|
|
22
|
+
import { BlockInsertLineBreakWithBlocksStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-line-break-with-blocks-strategy';
|
|
23
|
+
import { BlockDeleteTextContentStrategy } from '../action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy';
|
|
24
|
+
import { BlockInsertImageIntoTextStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-image-into-text-strategy';
|
|
25
|
+
import { BlockInsertNodesBeforeNodeStrategy } from '../action-handle-strategies/modify-content-strategies/block-insert-nodes-before-node-strategy';
|
|
26
|
+
import { BlockTransformToListStrategy } from '../action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy';
|
|
22
27
|
/**
|
|
23
28
|
* Text block
|
|
24
29
|
*/
|
|
@@ -135,353 +140,36 @@ export class RTETextBlock extends RTEBlock {
|
|
|
135
140
|
return this.nodes[this.nodes.length - 1];
|
|
136
141
|
}
|
|
137
142
|
/**
|
|
138
|
-
*
|
|
139
|
-
*/
|
|
140
|
-
doAnnotationActionApply(action) {
|
|
141
|
-
if (action instanceof TextStyleAnnotationAction) {
|
|
142
|
-
if (this.type !== 'list-item') {
|
|
143
|
-
this.type = action.textStyle;
|
|
144
|
-
}
|
|
145
|
-
if (action.bold) {
|
|
146
|
-
this.nodes.forEach((node) => {
|
|
147
|
-
const boldAnnotationAction = new BoldAnnotationAction(true);
|
|
148
|
-
boldAnnotationAction.doSplit = false;
|
|
149
|
-
node.apply(boldAnnotationAction);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
this.nodes.forEach((node) => {
|
|
154
|
-
node.apply(new DeleteNodeAnnotationAction(NodeAnnotationTypeEnum.BOLD));
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
if (action instanceof LinkGroupAnnotationAction) {
|
|
160
|
-
const linkGroupAnnotation = this.getAnnotationByType(InternalAnnotationTypeEnum.LINK_GROUP);
|
|
161
|
-
if (linkGroupAnnotation) {
|
|
162
|
-
const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey);
|
|
163
|
-
linkGroupAnnotation.linkGroups.set(action.groupKey, [...linkGroup, ...action.nodes]);
|
|
164
|
-
this.annotationMap.set(InternalAnnotationTypeEnum.LINK_GROUP, linkGroupAnnotation);
|
|
165
|
-
}
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Apply a modify action to block
|
|
171
|
-
*
|
|
172
|
-
* @param {ModifyContentAction} action - Modify action
|
|
173
|
-
*/
|
|
174
|
-
doModifyActionApply(action) {
|
|
175
|
-
switch (action.type) {
|
|
176
|
-
case ModifyContentActionType.DELETE_CHILD:
|
|
177
|
-
this.removeChildNode(action);
|
|
178
|
-
break;
|
|
179
|
-
case ModifyContentActionType.APPEND_CHILD_NODES:
|
|
180
|
-
this.appendChildNodes(action.entityToBeAppended);
|
|
181
|
-
break;
|
|
182
|
-
case ModifyContentActionType.CLEAR_CHILD_NODES:
|
|
183
|
-
this.nodes = [];
|
|
184
|
-
break;
|
|
185
|
-
case ModifyContentActionType.SPLIT_BLOCK_WITH_NODE:
|
|
186
|
-
action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode);
|
|
187
|
-
break;
|
|
188
|
-
case ModifyContentActionType.REPLACE_CHILD_NODES:
|
|
189
|
-
this.nodes = [];
|
|
190
|
-
this.appendChildNodes(action.newChildNodes);
|
|
191
|
-
break;
|
|
192
|
-
case ModifyContentActionType.MERGE_TWO_BLOCKS_NODES:
|
|
193
|
-
this.mergeTwoBlocksNodes(action.blockNeedToBeMerged);
|
|
194
|
-
break;
|
|
195
|
-
case ModifyContentActionType.BREAK_SINGLE_BLOCK:
|
|
196
|
-
action.newBlock = this.breakSingleTextBlock(action.startContainerNode, action.startOffset);
|
|
197
|
-
break;
|
|
198
|
-
case ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK:
|
|
199
|
-
action.lineBreakNode = this.lineBreakSingleBlock(action.startContainerNode, action.startOffset);
|
|
200
|
-
break;
|
|
201
|
-
case ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS:
|
|
202
|
-
action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks);
|
|
203
|
-
break;
|
|
204
|
-
case ModifyContentActionType.TRANSFORM_LIST_BLOCK:
|
|
205
|
-
this.convertParagraphToList(action);
|
|
206
|
-
break;
|
|
207
|
-
case ModifyContentActionType.DELETE_BLOCK_CONTENT:
|
|
208
|
-
this.deleteNodeContent(action);
|
|
209
|
-
break;
|
|
210
|
-
case ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
|
|
211
|
-
this.insertImage(action);
|
|
212
|
-
break;
|
|
213
|
-
case ModifyContentActionType.INSERT_NODES_BEFORE:
|
|
214
|
-
this.replaceNodeWithNodes(action.referNode, [
|
|
215
|
-
...action.nodesToBeInserted,
|
|
216
|
-
action.referNode,
|
|
217
|
-
]);
|
|
218
|
-
break;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Splits a text node at a specified offset within a block of nodes and returns a new block with the split nodes.
|
|
223
|
-
*
|
|
224
|
-
* @param {RTETextNode} splitNode - The text node that will be split
|
|
225
|
-
* @param {number} startOffsetOfNode - The index at which will split the text content of the `splitNode`.
|
|
226
|
-
* @returns {Nullable<RTEBlock>} return either an RTEBlock object or null.
|
|
227
|
-
*/
|
|
228
|
-
splitTextNodeBlock(splitNode, startOffsetOfNode) {
|
|
229
|
-
if (splitNode) {
|
|
230
|
-
const beforeText = splitNode.text.slice(0, startOffsetOfNode);
|
|
231
|
-
const afterText = splitNode.text.slice(startOffsetOfNode);
|
|
232
|
-
const nodesSplitIndex = this.nodes.indexOf(splitNode);
|
|
233
|
-
if (nodesSplitIndex > -1) {
|
|
234
|
-
const beforeNodes = this.nodes.slice(0, nodesSplitIndex);
|
|
235
|
-
const afterNodes = this.nodes.slice(nodesSplitIndex + 1);
|
|
236
|
-
if (beforeText) {
|
|
237
|
-
beforeNodes.push(splitNode.cloneWithText(beforeText));
|
|
238
|
-
}
|
|
239
|
-
if (afterText) {
|
|
240
|
-
afterNodes.unshift(splitNode.cloneWithText(afterText));
|
|
241
|
-
}
|
|
242
|
-
this.apply(new ReplaceChildNodesAction(beforeNodes));
|
|
243
|
-
const newBlock = this.cloneWithNodes(afterNodes);
|
|
244
|
-
this.parent.apply(new InsertBlocksAfterAction(this, newBlock));
|
|
245
|
-
return newBlock;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Checks if the caret position is at the start of a specified RTETextNode.
|
|
251
|
-
*
|
|
252
|
-
* @param {RTETextNode} node - `RTETextNode` - a node representing an image in a rich text editor.
|
|
253
|
-
* @param {number} startOffset - The position within the text node where the caret is located.
|
|
254
|
-
* @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTETextNode.
|
|
255
|
-
*/
|
|
256
|
-
isCaretPositionAtStart(node, startOffset) {
|
|
257
|
-
return node === this.nodes[0] && startOffset === 0;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Checks if the caret position is at the end of a specified RTETextNode.
|
|
261
|
-
*
|
|
262
|
-
* @param {RTETextNode} node - `RTETextNode` - a node representing an image in a rich text editor.
|
|
263
|
-
* @param {number} startOffset - The position within the text node where the caret is located.
|
|
264
|
-
* @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTETextNode.
|
|
265
|
-
*/
|
|
266
|
-
isCaretPositionAtEnd(node, startOffset) {
|
|
267
|
-
const lastNode = this.nodes[this.nodes.length - 1];
|
|
268
|
-
return node === lastNode && (node.isEmpty() || startOffset === lastNode.text.length);
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* lineBreakSingleBlock
|
|
272
|
-
*
|
|
273
|
-
* @param {RTETextNode} splitNode -
|
|
274
|
-
* @param {number} startOffsetOfNode -
|
|
275
|
-
* @returns {Nullable<RTETextNode>} Nullable<RTETextNode>
|
|
276
|
-
*/
|
|
277
|
-
lineBreakSingleBlock(splitNode, startOffsetOfNode) {
|
|
278
|
-
if (splitNode) {
|
|
279
|
-
const lineBreakNode = new RTETextNode(generateUUID(), '\n', this);
|
|
280
|
-
const beforeText = splitNode.text.slice(0, startOffsetOfNode);
|
|
281
|
-
const afterText = splitNode.text.slice(startOffsetOfNode);
|
|
282
|
-
const nodesSplitIndex = this.nodes.indexOf(splitNode);
|
|
283
|
-
if (nodesSplitIndex > -1) {
|
|
284
|
-
const beforeNodes = this.nodes.slice(0, nodesSplitIndex);
|
|
285
|
-
const afterNodes = this.nodes.slice(nodesSplitIndex + 1);
|
|
286
|
-
if (beforeText) {
|
|
287
|
-
beforeNodes.push(splitNode.cloneWithText(beforeText));
|
|
288
|
-
}
|
|
289
|
-
if (afterText) {
|
|
290
|
-
afterNodes.unshift(splitNode.cloneWithText(afterText));
|
|
291
|
-
}
|
|
292
|
-
this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes);
|
|
293
|
-
}
|
|
294
|
-
return lineBreakNode;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* lineBreakMultipleBlocks
|
|
299
|
-
*
|
|
300
|
-
* @param {RTEBlock[]} selectedBlocks -
|
|
301
|
-
* @returns {Nullable<RTETextNode>} Nullable<RTETextNode>
|
|
302
|
-
*/
|
|
303
|
-
lineBreakMultipleBlocks(selectedBlocks) {
|
|
304
|
-
const beforeNodes = this['nodes'];
|
|
305
|
-
const lineBreakNode = new RTETextNode(generateUUID(), '\n', this);
|
|
306
|
-
const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
|
|
307
|
-
this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes);
|
|
308
|
-
return lineBreakNode;
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* deleteNodeContent
|
|
312
|
-
*
|
|
313
|
-
* @param {DeleteBlockContentAction} action - ModifyContentAction
|
|
314
|
-
*/
|
|
315
|
-
deleteNodeContent(action) {
|
|
316
|
-
const startContainerNode = action.startContainerNode;
|
|
317
|
-
const startOffset = action.startOffset;
|
|
318
|
-
if (startOffset !== 0 && !startContainerNode.isEmpty()) {
|
|
319
|
-
const newText = startContainerNode.text.slice(0, startOffset - 1) +
|
|
320
|
-
startContainerNode.text.slice(startOffset);
|
|
321
|
-
startContainerNode.apply(new UpdateTextAction(newText));
|
|
322
|
-
if (newText) {
|
|
323
|
-
action.previousNode = startContainerNode;
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
const previousNode = this.getPreviousNode(startContainerNode);
|
|
328
|
-
// Remove the last character will not delete paragraph, the paragraph will removed after press delete again
|
|
329
|
-
if ((previousNode && previousNode.parentBlock === this && previousNode['text'] === '\n') ||
|
|
330
|
-
this.nodes.length === 1) {
|
|
331
|
-
action.previousNode = startContainerNode;
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
this.apply(new RemoveChildAction(startContainerNode));
|
|
336
|
-
action.previousNode = previousNode;
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
let previousNode = this.getPreviousNode(startContainerNode);
|
|
343
|
-
let nextNode = null;
|
|
344
|
-
if (this.nodes.length && previousNode && previousNode.parentBlock !== this) {
|
|
345
|
-
if (startContainerNode.isEmpty()) {
|
|
346
|
-
this.apply(new RemoveChildAction(startContainerNode));
|
|
347
|
-
}
|
|
348
|
-
previousNode.parentBlock.apply(new MergeTwoBlocksNodesAction(this));
|
|
349
|
-
}
|
|
350
|
-
else {
|
|
351
|
-
if (this.isContentFirstNode(startContainerNode) && startContainerNode.isEmpty()) {
|
|
352
|
-
nextNode = this.getNextNode(startContainerNode);
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Remove line break
|
|
356
|
-
*
|
|
357
|
-
* @example caret at the first line
|
|
358
|
-
* \n
|
|
359
|
-
* test
|
|
360
|
-
*/
|
|
361
|
-
if (startContainerNode.isEmpty()) {
|
|
362
|
-
this.apply(new RemoveChildAction(startContainerNode));
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* Remove line break
|
|
366
|
-
*
|
|
367
|
-
* @example caret at the begin of second line
|
|
368
|
-
* \n
|
|
369
|
-
* test
|
|
370
|
-
*/
|
|
371
|
-
if (previousNode instanceof RTETextNode && previousNode.isEmpty()) {
|
|
372
|
-
const shouldRemoveNode = previousNode;
|
|
373
|
-
previousNode = this.getPreviousNode(previousNode);
|
|
374
|
-
shouldRemoveNode.parentBlock.apply(new RemoveChildAction(shouldRemoveNode));
|
|
375
|
-
if (!previousNode) {
|
|
376
|
-
nextNode = startContainerNode;
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
//Remove the paragraph block if the content is empty
|
|
381
|
-
if (this.nodes.length === 0) {
|
|
382
|
-
this.parent.apply(new RemoveChildAction(this));
|
|
383
|
-
}
|
|
384
|
-
if (previousNode) {
|
|
385
|
-
action.previousNode = previousNode;
|
|
386
|
-
}
|
|
387
|
-
else if (nextNode) {
|
|
388
|
-
action.nextNode = nextNode;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Remove the child node
|
|
394
|
-
*
|
|
395
|
-
* @param {RemoveChildAction} action - Modify action
|
|
396
|
-
*/
|
|
397
|
-
removeChildNode(action) {
|
|
398
|
-
this.nodes = this.nodes.filter((node) => node !== action.entityToBeRemoved);
|
|
399
|
-
if (this.nodes.length === 0) {
|
|
400
|
-
this.parent.apply(new RemoveChildAction(this));
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* mergeLineBreakNodes
|
|
143
|
+
* Create new empty paragraph.
|
|
405
144
|
*
|
|
406
|
-
* @
|
|
407
|
-
* @param {RTETextNode} lineBreakNode -
|
|
408
|
-
* @param {RTENode[]} afterNodes -
|
|
145
|
+
* @returns {RTETextBlock} Paragraph.
|
|
409
146
|
*/
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
afterNodes.push(new RTETextNode(generateUUID(), '\n', this, beforeNodes[beforeNodes.length - 1] && beforeNodes[beforeNodes.length - 1].annotationMap));
|
|
413
|
-
}
|
|
414
|
-
this.apply(new ReplaceChildNodesAction([...beforeNodes, lineBreakNode, ...afterNodes]));
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* breakSingleTextBlock
|
|
418
|
-
*
|
|
419
|
-
* @param {RTETextNode} splitNode -
|
|
420
|
-
* @param {number} startOffsetOfNode -
|
|
421
|
-
* @returns {Nullable<RTEBlock>} Nullable<RTEBlock>
|
|
422
|
-
*/
|
|
423
|
-
breakSingleTextBlock(splitNode, startOffsetOfNode) {
|
|
424
|
-
const newParagraph = this.copyInlineStyleToNewParagraph(splitNode);
|
|
425
|
-
if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
|
|
426
|
-
this.parent.apply(new InsertBlocksAfterAction(this, newParagraph));
|
|
427
|
-
}
|
|
428
|
-
else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
|
|
429
|
-
this.parent.apply(new InsertBlocksBeforeAction(this, newParagraph));
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
432
|
-
const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
|
|
433
|
-
this.apply(splitBlockAction);
|
|
434
|
-
return splitBlockAction.newBlock;
|
|
435
|
-
}
|
|
436
|
-
return newParagraph;
|
|
147
|
+
createNewParagraph() {
|
|
148
|
+
return new RTETextBlock(generateUUID(), 'paragraph');
|
|
437
149
|
}
|
|
438
150
|
/**
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
* @param {TransformListAction} action - ModifyContentAction
|
|
442
|
-
*/
|
|
443
|
-
convertParagraphToList(action) {
|
|
444
|
-
const bulletList = this.parent.createList(action.listType);
|
|
445
|
-
const listItems = action.selectedBlocks.map((node) => this.parent.toListItem(node));
|
|
446
|
-
bulletList.apply(new AppendChildNodesAction(listItems));
|
|
447
|
-
this.parent.apply(new InsertBlocksAfterAction(action.selectedBlocks[0], bulletList));
|
|
448
|
-
action.selectedBlocks.forEach((node) => {
|
|
449
|
-
node.parent.apply(new RemoveChildAction(node));
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* insertImage
|
|
454
|
-
*
|
|
455
|
-
* @param {InsertImageToBlockAction} action - ModifyContentAction
|
|
151
|
+
* @inheritDoc
|
|
456
152
|
*/
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
|
|
462
|
-
this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
|
|
463
|
-
}
|
|
464
|
-
else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
|
|
465
|
-
this.parent.apply(new InsertBlocksBeforeAction(this, newImageBlock));
|
|
466
|
-
}
|
|
467
|
-
else {
|
|
468
|
-
const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
|
|
469
|
-
this.apply(splitBlockAction);
|
|
470
|
-
this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
|
|
153
|
+
doAnnotationActionApply(action) {
|
|
154
|
+
const strategy = ActionHandleStrategyRegistry.get(action.constructor.name, RTETextBlock.name);
|
|
155
|
+
if (strategy) {
|
|
156
|
+
strategy.execute(action, this);
|
|
471
157
|
}
|
|
472
158
|
}
|
|
473
|
-
/**
|
|
474
|
-
* copyInlineStyleToNewParagraph
|
|
475
|
-
*
|
|
476
|
-
* @param {RTETextNode} needCopedNode -
|
|
477
|
-
* @returns {RTETextBlock} RTETextBlock
|
|
478
|
-
*/
|
|
479
|
-
copyInlineStyleToNewParagraph(needCopedNode) {
|
|
480
|
-
const textNode = needCopedNode.cloneWithText('');
|
|
481
|
-
// The link annotation don't need inherited
|
|
482
|
-
textNode.annotationMap.delete(NodeAnnotationTypeEnum.LINK);
|
|
483
|
-
const newParagraph = new RTETextBlock(generateUUID(), 'paragraph');
|
|
484
|
-
newParagraph.apply(new AppendChildNodesAction([textNode]));
|
|
485
|
-
return newParagraph;
|
|
486
|
-
}
|
|
487
159
|
}
|
|
160
|
+
(() => {
|
|
161
|
+
ActionHandleStrategyRegistry.register(TextStyleAnnotationAction.name, RTETextBlock.name, new BlockUpdateTextStyleStrategy());
|
|
162
|
+
ActionHandleStrategyRegistry.register(LinkGroupAnnotationAction.name, RTETextBlock.name, new BlockUpdateLinkGroupStrategy());
|
|
163
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, RTETextBlock.name, new BlockRemoveNodeStrategy());
|
|
164
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.APPEND_CHILD_NODES, RTETextBlock.name, new BlockAppendNodesStrategy());
|
|
165
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTETextBlock.name, new BlockSplitWithTextNodeStrategy());
|
|
166
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.REPLACE_CHILD_NODES, RTETextBlock.name, new BlockReplaceNodesStrategy());
|
|
167
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTETextBlock.name, new BlockMergeNodesStrategy());
|
|
168
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.BREAK_SINGLE_BLOCK, RTETextBlock.name, new BlockInsertNewParagraphStrategy());
|
|
169
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTETextBlock.name, new BlockInsertLineBreakStrategy());
|
|
170
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTETextBlock.name, new BlockInsertLineBreakWithBlocksStrategy());
|
|
171
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_BLOCK_CONTENT, RTETextBlock.name, new BlockDeleteTextContentStrategy());
|
|
172
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTETextBlock.name, new BlockInsertImageIntoTextStrategy());
|
|
173
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_NODES_BEFORE, RTETextBlock.name, new BlockInsertNodesBeforeNodeStrategy());
|
|
174
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTETextBlock.name, new BlockTransformToListStrategy());
|
|
175
|
+
})();
|
|
@@ -4,15 +4,18 @@ import { RTETextBlock } from './blocks/text-block';
|
|
|
4
4
|
import { ModifyContentActionType } from './actions/modify-content-action.abstract';
|
|
5
5
|
import { AppendChildNodesAction } from './actions/append-child-nodes-action';
|
|
6
6
|
import { generateUUID } from '../../../utils/misc';
|
|
7
|
-
import { BlockBaseOperator } from './helper/block-base-operator';
|
|
8
7
|
import { RTEListItemBlock } from './blocks/list-item-block';
|
|
9
8
|
import { SyncUpSelectionAction } from './actions/sync-up-selection-action';
|
|
9
|
+
import { ActionHandleStrategyRegistry } from './action-handle-strategies/action-handle-strategy-registry';
|
|
10
|
+
import { BlockRemoveChildBlockStrategy } from './action-handle-strategies/modify-content-strategies/block-remove-child-block-strategy';
|
|
11
|
+
import { BlockAppendBlocksStrategy } from './action-handle-strategies/modify-content-strategies/block-append-blocks-strategy';
|
|
12
|
+
import { BlockInsertBlocksBeforeStrategy } from './action-handle-strategies/modify-content-strategies/block-insert-blocks-before-strategy';
|
|
13
|
+
import { BlockInsertBlocksAfterStrategy } from './action-handle-strategies/modify-content-strategies/block-insert-blocks-after-strategy';
|
|
10
14
|
/**
|
|
11
15
|
* Class representing the content state of the rich text editor.
|
|
12
16
|
*/
|
|
13
|
-
export class VegaRTEContent
|
|
17
|
+
export class VegaRTEContent {
|
|
14
18
|
constructor(blocks) {
|
|
15
|
-
super();
|
|
16
19
|
blocks.forEach((block) => {
|
|
17
20
|
block.parent = this;
|
|
18
21
|
});
|
|
@@ -89,26 +92,7 @@ export class VegaRTEContent extends BlockBaseOperator {
|
|
|
89
92
|
* @param {ModifyContentAction} action - Modify content action
|
|
90
93
|
*/
|
|
91
94
|
apply(action) {
|
|
92
|
-
|
|
93
|
-
case ModifyContentActionType.DELETE_CHILD:
|
|
94
|
-
this.removeChildBlock(action.entityToBeRemoved);
|
|
95
|
-
break;
|
|
96
|
-
case ModifyContentActionType.APPEND_CHILD_NODES:
|
|
97
|
-
this.appendChildBlocks(action.entityToBeAppended);
|
|
98
|
-
break;
|
|
99
|
-
case ModifyContentActionType.INSERT_BLOCKS_AFTER:
|
|
100
|
-
this.replaceBlockWithBlocks(action.referBlock, [
|
|
101
|
-
action.referBlock,
|
|
102
|
-
...action.blocksToBeInserted,
|
|
103
|
-
]);
|
|
104
|
-
break;
|
|
105
|
-
case ModifyContentActionType.INSERT_BLOCKS_BEFORE:
|
|
106
|
-
this.replaceBlockWithBlocks(action.referBlock, [
|
|
107
|
-
...action.blocksToBeInserted,
|
|
108
|
-
action.referBlock,
|
|
109
|
-
]);
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
95
|
+
ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
112
96
|
}
|
|
113
97
|
/**
|
|
114
98
|
* Convert text to list.
|
|
@@ -133,3 +117,9 @@ export class VegaRTEContent extends BlockBaseOperator {
|
|
|
133
117
|
return new RTEListBlock(generateUUID(), type);
|
|
134
118
|
}
|
|
135
119
|
}
|
|
120
|
+
(() => {
|
|
121
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, VegaRTEContent.name, new BlockRemoveChildBlockStrategy());
|
|
122
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.APPEND_CHILD_NODES, VegaRTEContent.name, new BlockAppendBlocksStrategy());
|
|
123
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_BLOCKS_BEFORE, VegaRTEContent.name, new BlockInsertBlocksBeforeStrategy());
|
|
124
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_BLOCKS_AFTER, VegaRTEContent.name, new BlockInsertBlocksAfterStrategy());
|
|
125
|
+
})();
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { NodeTypeEnum, RTENode } from './node.abstract';
|
|
2
2
|
import { ImageAnnotation } from '../annotations/image-annotation';
|
|
3
|
-
import {
|
|
3
|
+
import { ModifyContentActionType } from '../actions/modify-content-action.abstract';
|
|
4
4
|
import { NodeAnnotationTypeEnum } from '../annotations/node-annotation.abstract';
|
|
5
5
|
import { isNonNullable } from '../../../../types/type-guard';
|
|
6
|
+
import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action-handle-strategy-registry';
|
|
7
|
+
import { ImageSetAnnotationMapStrategy } from '../action-handle-strategies/apply-annotation-strategies/image-set-annotation-map-strategy';
|
|
8
|
+
import { ImageUpdateUrlStrategy } from '../action-handle-strategies/modify-content-strategies/image-update-url-strategy';
|
|
9
|
+
import { AnnotationAction } from '../actions/annotation-action.abstract';
|
|
6
10
|
/**
|
|
7
11
|
* Image node
|
|
8
12
|
*/
|
|
@@ -52,15 +56,19 @@ export class RTEImageNode extends RTENode {
|
|
|
52
56
|
* @inheritDoc
|
|
53
57
|
*/
|
|
54
58
|
doAnnotationActionApply(action) {
|
|
55
|
-
const
|
|
56
|
-
|
|
59
|
+
const strategy = ActionHandleStrategyRegistry.get(AnnotationAction.name, RTEImageNode.name);
|
|
60
|
+
if (strategy) {
|
|
61
|
+
strategy.execute(action, this);
|
|
62
|
+
}
|
|
57
63
|
}
|
|
58
|
-
// placeholder method
|
|
59
|
-
/* istanbul ignore next */
|
|
60
64
|
/**
|
|
61
65
|
* @inheritDoc
|
|
62
66
|
*/
|
|
63
67
|
doModifyActionApply(action) {
|
|
64
|
-
|
|
68
|
+
ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
65
69
|
}
|
|
66
70
|
}
|
|
71
|
+
(() => {
|
|
72
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.UPDATE_IMAGE_NODE_URL, RTEImageNode.name, new ImageUpdateUrlStrategy());
|
|
73
|
+
ActionHandleStrategyRegistry.register(AnnotationAction.name, RTEImageNode.name, new ImageSetAnnotationMapStrategy());
|
|
74
|
+
})();
|