@globalpayments/vega 2.102.0 → 2.104.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-49c2a999.js → app-globals-bc84b09b.js} +10 -10
- package/dist/cjs/{code-block-06e6591f.js → code-block-7340d2b7.js} +80 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-f29908f8.js → component-value-history-controller-slimmer.abstract-dd834f8d.js} +3 -3
- package/dist/cjs/{content-state-8c862e5e.js → content-state-dde1253f.js} +38 -5
- package/dist/cjs/{date-required-rule-b672c432.js → date-required-rule-5e6777cf.js} +1 -1
- package/dist/cjs/{design-token-351ffd2c.js → design-token-b28d222d.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-f932b166.js → element-appender-slimmer-a87bc0ce.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-5adb86ae.js → form-field-controller-slimmer-007d10db.js} +1 -1
- package/dist/cjs/{image-annotation-action-25907d6b.js → image-annotation-action-715bece3.js} +2 -2
- package/dist/cjs/{image-extension-1cf84f27.js → image-extension-cc8f36a1.js} +247 -5
- package/dist/cjs/index.cjs.js +17 -17
- package/dist/cjs/{inject-keyboard-manager-84d33920.js → inject-keyboard-manager-1a113d04.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-3c5236be.js → internal-calendar-period-factory-bf5e8294.js} +1 -1
- package/dist/cjs/{internal-translation-controller-eae8a8de.js → internal-translation-controller-b5bbefc9.js} +5 -0
- package/dist/cjs/{keyboard-manager-baa83a61.js → keyboard-manager-d0271450.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-d1974b28.js → keyboard-manager-slimmer-5a4c0e4c.js} +1 -1
- package/dist/cjs/{legend-input-processor-ce9b38f8.js → legend-input-processor-bd36a794.js} +28 -0
- package/dist/cjs/{link-extension-2a6133b7.js → link-extension-953fb2a0.js} +3 -3
- package/dist/cjs/loader.cjs.js +12 -12
- package/dist/cjs/{month-view-generator-a6827548.js → month-view-generator-b68bcf4b.js} +1 -1
- package/dist/cjs/{public-rules-7f26e0ae.js → public-rules-8bfc6de7.js} +7 -7
- package/dist/cjs/{range-518b95a2.js → range-4060b238.js} +1 -1
- package/dist/cjs/{responsive-format-facade-95c54444.js → responsive-format-facade-fed434ed.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-5d0c76ec.js → rich-text-editor-required-rule-16e74e91.js} +1 -1
- package/dist/cjs/{split-cell-operation-28f6f8d9.js → split-cell-operation-430e9f27.js} +3 -3
- package/dist/cjs/{state-border-formatter-6c284859.js → state-border-formatter-b469de2f.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-f15b6196.js → string-format-strategy.abstract-b3174863.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-5a3f1b55.js → string-input-formatter-slimmer-ceb678e9.js} +1 -1
- package/dist/cjs/{string-mask-strategy-af6f3ba0.js → string-mask-strategy-5f84e2f6.js} +2 -2
- package/dist/cjs/{style-formatter-324211fd.js → style-formatter-e98caf3c.js} +2 -2
- package/dist/cjs/{time-required-rule-9e714442.js → time-required-rule-249cb6b6.js} +1 -1
- package/dist/cjs/{token-extension-86723cad.js → token-extension-f074902b.js} +1011 -767
- package/dist/cjs/{translation-slimmer-0227ee24.js → translation-slimmer-b60d598e.js} +1 -1
- package/dist/cjs/{type-guard-29e01bd4.js → type-guard-8eb40609.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-4ec364af.js → valid-credit-card-number-rule-f5d2b2c6.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
- package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-bar-chart.cjs.entry.js +2 -2
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +8 -8
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-dialog_2.cjs.entry.js +10 -5
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +2 -2
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +21 -12
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-numeric.cjs.entry.js +12 -14
- package/dist/cjs/vega-input-passcode.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
- package/dist/cjs/vega-input.cjs.entry.js +31 -27
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-line-chart.cjs.entry.js +2 -2
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-bookmark-editor.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +474 -207
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +1 -1
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +7 -7
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +12 -12
- package/dist/cjs/{y-axis-input-processor-d3a3839c.js → y-axis-input-processor-9ba96716.js} +1 -1
- package/dist/collection/components/vega-dialog/vega-dialog.js +7 -2
- package/dist/collection/components/vega-image-uploader/slimmers/controllers/vega-image-uploader-remove-controller.js +6 -3
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-actions-renderer.js +6 -3
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-uploading-content-renderer.js +4 -1
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-state-controller.js +0 -14
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +11 -2
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-renderer.js +11 -1
- package/dist/collection/components/vega-input/vega-input.js +52 -8
- package/dist/collection/components/vega-input-numeric/slimmers/renderers/vega-input-numeric-renderer.js +7 -1
- package/dist/collection/components/vega-input-numeric/vega-input-numeric.js +0 -8
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/sequential-composition-strategy.js +31 -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/sequential-composition-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/dto/flush-changes-payload.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +3 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-block-strategy.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/chooser-positioner.js +107 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/paste-chooser-controller.js +91 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/paste-event-interceptor.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/selection-snapshot-service.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/image-extractor.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-extension.js +41 -354
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/data-transfer-builder.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/paste-dispatcher.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/paste-processing-pipeline.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/paste-processing-strategy.abstract.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/paste-strategy-selector.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/plain-paste-strategy.js +74 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/helpers/utils.js +67 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.js +67 -11
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/backward-delete-content-handler.js +4 -17
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +34 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/forward-delete-content-handler.js +13 -32
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +60 -25
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +55 -19
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +165 -59
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +55 -21
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +2 -16
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +11 -1
- package/dist/collection/components/vega-rich-text-editor/utils/html-to-plain-text-utils.js +240 -0
- package/dist/collection/helpers/translation/locales/en.js +5 -0
- package/dist/collection/polyfill/d3/d3-shape-polyfill.js +28 -0
- package/dist/esm/{app-globals-da5c83c2.js → app-globals-8541b3dc.js} +10 -10
- package/dist/esm/{code-block-d8f83d85.js → code-block-c16c69a5.js} +74 -2
- package/dist/esm/{component-value-history-controller-slimmer.abstract-642e7147.js → component-value-history-controller-slimmer.abstract-1cea9add.js} +3 -3
- package/dist/esm/{content-state-486eae1d.js → content-state-73664d93.js} +38 -5
- package/dist/esm/{date-required-rule-08695d25.js → date-required-rule-14131e09.js} +1 -1
- package/dist/esm/{design-token-df3331d9.js → design-token-4b81bae7.js} +3 -3
- package/dist/esm/{element-appender-slimmer-f02a227f.js → element-appender-slimmer-9094aa07.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-a7c0a0f8.js → form-field-controller-slimmer-aaea8aaf.js} +1 -1
- package/dist/esm/{image-annotation-action-df744ba5.js → image-annotation-action-86052c2e.js} +2 -2
- package/dist/esm/{image-extension-20b39140.js → image-extension-04843995.js} +246 -6
- package/dist/esm/index.js +17 -17
- package/dist/esm/{inject-keyboard-manager-399ed867.js → inject-keyboard-manager-1a950408.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-7b866c3b.js → internal-calendar-period-factory-14c000cf.js} +1 -1
- package/dist/esm/{internal-translation-controller-4a7ee4d5.js → internal-translation-controller-6eb30c39.js} +5 -0
- package/dist/esm/{keyboard-manager-f5d13a34.js → keyboard-manager-e7add1f3.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-f40dcb54.js → keyboard-manager-slimmer-ffe6588a.js} +1 -1
- package/dist/esm/{legend-input-processor-3b2de4b7.js → legend-input-processor-bd91524a.js} +28 -0
- package/dist/esm/{link-extension-3f93d70d.js → link-extension-caabb7d8.js} +3 -3
- package/dist/esm/loader.js +12 -12
- package/dist/esm/{month-view-generator-0c665987.js → month-view-generator-0dad54d9.js} +1 -1
- package/dist/esm/{public-rules-470a1dac.js → public-rules-76247d91.js} +7 -7
- package/dist/esm/{range-8e89fb54.js → range-c0aec697.js} +1 -1
- package/dist/esm/{responsive-format-facade-55131a33.js → responsive-format-facade-1a9177b9.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-06caf383.js → rich-text-editor-required-rule-65e18ef0.js} +1 -1
- package/dist/esm/{split-cell-operation-e158366a.js → split-cell-operation-814641f5.js} +3 -3
- package/dist/esm/{state-border-formatter-2b73fa08.js → state-border-formatter-31f3145a.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-8c7937e3.js → string-format-strategy.abstract-a8612297.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-681c6b71.js → string-input-formatter-slimmer-8f2aa95a.js} +1 -1
- package/dist/esm/{string-mask-strategy-b8cceee6.js → string-mask-strategy-e8bad1c6.js} +2 -2
- package/dist/esm/{style-formatter-fcd70869.js → style-formatter-42e87858.js} +2 -2
- package/dist/esm/{time-required-rule-ce50859b.js → time-required-rule-fcab062e.js} +1 -1
- package/dist/esm/{token-extension-2401e753.js → token-extension-f001f08e.js} +1011 -767
- package/dist/esm/{translation-slimmer-b3f3cf65.js → translation-slimmer-5fa762dc.js} +1 -1
- package/dist/esm/{type-guard-08c82e08.js → type-guard-87bdc930.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-66bad519.js → valid-credit-card-number-rule-5dc557f1.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +6 -6
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-bar-chart.entry.js +2 -2
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_5.entry.js +7 -7
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +2 -2
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-color-swatch-picker.entry.js +3 -3
- package/dist/esm/vega-color-swatch.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +8 -8
- package/dist/esm/vega-date-picker_2.entry.js +13 -13
- package/dist/esm/vega-dialog_2.entry.js +10 -5
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +7 -7
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +2 -2
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +21 -12
- package/dist/esm/vega-input-credit-card.entry.js +6 -6
- package/dist/esm/vega-input-numeric.entry.js +12 -14
- package/dist/esm/vega-input-passcode.entry.js +5 -5
- package/dist/esm/vega-input-phone-number.entry.js +4 -4
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +5 -5
- package/dist/esm/vega-input.entry.js +31 -27
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-line-chart.entry.js +2 -2
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-pie-chart.entry.js +1 -1
- package/dist/esm/vega-popover_2.entry.js +8 -8
- package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
- package/dist/esm/vega-radio_2.entry.js +5 -5
- package/dist/esm/vega-rich-text-bookmark-editor.entry.js +2 -2
- package/dist/esm/vega-rich-text-content.entry.js +6 -6
- package/dist/esm/vega-rich-text-editor_4.entry.js +474 -207
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +1 -1
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-selection-tile_2.entry.js +2 -2
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +6 -6
- package/dist/esm/vega-table_11.entry.js +4 -4
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +9 -9
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +12 -12
- package/dist/esm/{y-axis-input-processor-c6b2a914.js → y-axis-input-processor-dd574c2e.js} +1 -1
- package/dist/sri/vega-sri-manifest.json +338 -338
- package/dist/types/components/vega-dialog/vega-dialog.d.ts +2 -0
- package/dist/types/components/vega-image-uploader/slimmers/controllers/vega-image-uploader-remove-controller.d.ts +1 -0
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-actions-renderer.d.ts +1 -0
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-uploading-content-renderer.d.ts +1 -0
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-state-controller.d.ts +0 -2
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.d.ts +4 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-renderer.d.ts +2 -0
- package/dist/types/components/vega-input/vega-input.d.ts +15 -3
- package/dist/types/components/vega-input-numeric/slimmers/renderers/vega-input-numeric-renderer.d.ts +2 -0
- package/dist/types/components/vega-input-numeric/vega-input-numeric.d.ts +0 -2
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/sequential-composition-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +4 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/sequential-composition-action.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/flush-changes-payload.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/chooser-positioner.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/paste-chooser-controller.d.ts +43 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/paste-event-interceptor.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/selection-snapshot-service.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/image-extractor.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/paste-image-parser.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/pending-image-registry.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-extension.d.ts +28 -93
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/data-transfer-builder.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/paste-dispatcher.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/paste-processing-pipeline.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/paste-processing-strategy.abstract.d.ts +28 -6
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/paste-strategy-selector.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/plain-paste-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/type.d.ts +35 -0
- package/dist/types/components/vega-rich-text-editor/helpers/utils.d.ts +47 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.d.ts +17 -6
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/backward-delete-content-handler.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +30 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/forward-delete-content-handler.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.d.ts +21 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.d.ts +12 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +38 -5
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.d.ts +7 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/utils/html-to-plain-text-utils.d.ts +31 -0
- package/dist/types/components.d.ts +24 -0
- package/dist/types/helpers/translation/interface.d.ts +5 -0
- package/dist/types/types/public-api.d.ts +2 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-3ce7521e.entry.js → p-017f0314.entry.js} +1 -1
- package/dist/vega/{p-1b97e751.entry.js → p-06a0c795.entry.js} +1 -1
- package/dist/vega/p-09ed519b.entry.js +1 -0
- package/dist/vega/p-0a8e82f1.js +1 -0
- package/dist/vega/{p-7d748545.entry.js → p-0c8f8d88.entry.js} +1 -1
- package/dist/vega/{p-b48caf90.entry.js → p-0cd81963.entry.js} +1 -1
- package/dist/vega/{p-8a4cc7c2.entry.js → p-0cda0b10.entry.js} +1 -1
- package/dist/vega/{p-b68f55e2.js → p-146abbc7.js} +1 -1
- package/dist/vega/{p-7044bb48.js → p-1c7dc9c6.js} +1 -1
- package/dist/vega/{p-d8a0e3e0.entry.js → p-1ccf0a96.entry.js} +1 -1
- package/dist/vega/{p-85a940c0.entry.js → p-1f0b99ac.entry.js} +1 -1
- package/dist/vega/p-24b6f3ee.js +1 -0
- package/dist/vega/{p-85695819.js → p-25d8b416.js} +1 -1
- package/dist/vega/{p-197388a5.entry.js → p-26fdf04e.entry.js} +1 -1
- package/dist/vega/{p-dffe47db.js → p-2a501c55.js} +1 -1
- package/dist/vega/p-2e847194.js +1 -0
- package/dist/vega/p-3040c091.js +1 -0
- package/dist/vega/{p-7dfb1481.entry.js → p-3437ff39.entry.js} +1 -1
- package/dist/vega/p-347d664e.js +1 -0
- package/dist/vega/{p-4c6989ae.entry.js → p-35de277a.entry.js} +1 -1
- package/dist/vega/{p-527c3211.entry.js → p-377a5330.entry.js} +1 -1
- package/dist/vega/{p-25e51acb.js → p-37eb020f.js} +1 -1
- package/dist/vega/{p-2256eb09.entry.js → p-3a153581.entry.js} +1 -1
- package/dist/vega/p-46d34326.js +1 -0
- package/dist/vega/{p-effbfc50.entry.js → p-48470109.entry.js} +1 -1
- package/dist/vega/p-4a2e040f.entry.js +1 -0
- package/dist/vega/p-4ad6da8f.js +1 -0
- package/dist/vega/{p-277aab9b.js → p-4cd198b9.js} +1 -1
- package/dist/vega/{p-bf0b46c1.js → p-4f24f262.js} +1 -1
- package/dist/vega/{p-48100d38.entry.js → p-5025f7b6.entry.js} +1 -1
- package/dist/vega/p-53838cd1.entry.js +1 -0
- package/dist/vega/{p-557b64bd.js → p-53c1b195.js} +1 -1
- package/dist/vega/{p-cb68a43a.entry.js → p-54c21aa8.entry.js} +1 -1
- package/dist/vega/{p-408c3ad4.entry.js → p-568d4da6.entry.js} +1 -1
- package/dist/vega/{p-109f0e33.entry.js → p-5bdc1ff3.entry.js} +1 -1
- package/dist/vega/{p-a0c87e88.entry.js → p-5ccdfd46.entry.js} +1 -1
- package/dist/vega/{p-03efc67a.entry.js → p-5cd6b840.entry.js} +1 -1
- package/dist/vega/p-5cfe82e7.js +1 -0
- package/dist/vega/{p-e577dda8.entry.js → p-5f04fb23.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-68e70f75.js +3 -0
- package/dist/vega/{p-bec31ffc.entry.js → p-6902bcaf.entry.js} +1 -1
- package/dist/vega/{p-dd673eb4.entry.js → p-6a13ba24.entry.js} +1 -1
- package/dist/vega/{p-83f5ef3a.entry.js → p-6c0d4f69.entry.js} +1 -1
- package/dist/vega/{p-3bfb53e3.js → p-6c46ea86.js} +1 -1
- package/dist/vega/{p-6096ffc3.js → p-6d0947e2.js} +1 -1
- package/dist/vega/{p-c6419eb3.entry.js → p-6ec65f72.entry.js} +1 -1
- package/dist/vega/{p-049e64b1.entry.js → p-701ac71a.entry.js} +1 -1
- package/dist/vega/{p-efef0dfe.entry.js → p-70659d97.entry.js} +1 -1
- package/dist/vega/p-7157dd20.entry.js +1 -0
- package/dist/vega/{p-3d060d2f.entry.js → p-74b54dcc.entry.js} +1 -1
- package/dist/vega/{p-f9f96030.entry.js → p-776123f8.entry.js} +1 -1
- package/dist/vega/{p-cf5c5515.js → p-78a2802f.js} +1 -1
- package/dist/vega/{p-46be74fc.entry.js → p-7e262cb3.entry.js} +1 -1
- package/dist/vega/{p-f0b49ae4.entry.js → p-88ada88b.entry.js} +1 -1
- package/dist/vega/{p-0338f621.entry.js → p-892f3e98.entry.js} +1 -1
- package/dist/vega/{p-92efdbf0.entry.js → p-8a9e80ac.entry.js} +1 -1
- package/dist/vega/{p-4d20a56f.js → p-8e3c1c81.js} +1 -1
- package/dist/vega/{p-ca60a74b.entry.js → p-8e59892d.entry.js} +1 -1
- package/dist/vega/{p-d8fa2f19.entry.js → p-9960ffde.entry.js} +1 -1
- package/dist/vega/{p-381d8781.js → p-9b571551.js} +1 -1
- package/dist/vega/{p-c66c6fd2.entry.js → p-a50b8c9f.entry.js} +1 -1
- package/dist/vega/{p-553510d8.entry.js → p-a54a2def.entry.js} +1 -1
- package/dist/vega/{p-23781e76.js → p-a6346186.js} +1 -1
- package/dist/vega/{p-7f711049.js → p-a7ed55d8.js} +1 -1
- package/dist/vega/{p-f0c6e9c5.entry.js → p-ab6c13d9.entry.js} +1 -1
- package/dist/vega/p-afa8a9af.entry.js +1 -0
- package/dist/vega/{p-30cc31dd.entry.js → p-b4e4b938.entry.js} +1 -1
- package/dist/vega/{p-f5f26b44.entry.js → p-b63af0ae.entry.js} +1 -1
- package/dist/vega/{p-dd273d89.entry.js → p-ba971f6a.entry.js} +1 -1
- package/dist/vega/{p-d7e59f31.js → p-c0eddde0.js} +1 -1
- package/dist/vega/{p-76135e80.entry.js → p-c11b20c0.entry.js} +1 -1
- package/dist/vega/{p-75c7f8ea.entry.js → p-c3532738.entry.js} +1 -1
- package/dist/vega/{p-d86e0b01.js → p-c576f76b.js} +1 -1
- package/dist/vega/{p-18ddc6a4.entry.js → p-c6cfaa2f.entry.js} +1 -1
- package/dist/vega/{p-be0eb72f.js → p-c73cce9b.js} +1 -1
- package/dist/vega/{p-816064f2.entry.js → p-c8c2e940.entry.js} +1 -1
- package/dist/vega/{p-6beaf1c8.entry.js → p-c968f8cf.entry.js} +1 -1
- package/dist/vega/p-cef58d27.js +1 -0
- package/dist/vega/p-d5ab92a5.entry.js +1 -0
- package/dist/vega/{p-741e064e.entry.js → p-d9c2aa77.entry.js} +1 -1
- package/dist/vega/{p-a5fa260b.js → p-da94bcda.js} +1 -1
- package/dist/vega/{p-634b138c.entry.js → p-dcdd7098.entry.js} +1 -1
- package/dist/vega/{p-2f5c4b61.entry.js → p-dcf4f31f.entry.js} +1 -1
- package/dist/vega/{p-4503f5b9.entry.js → p-e11987d3.entry.js} +1 -1
- package/dist/vega/p-e1aa78db.js +1 -0
- package/dist/vega/p-e2168481.js +1 -0
- package/dist/vega/{p-1d8a8507.entry.js → p-e67ef7a1.entry.js} +1 -1
- package/dist/vega/{p-061a76c3.entry.js → p-ea97ec60.entry.js} +1 -1
- package/dist/vega/{p-325b804d.entry.js → p-ebc1e0da.entry.js} +1 -1
- package/dist/vega/{p-c6b6987e.js → p-f2193656.js} +1 -1
- package/dist/vega/{p-a261a675.entry.js → p-f5f78884.entry.js} +1 -1
- package/dist/vega/p-f839e009.entry.js +1 -0
- package/dist/vega/{p-ff9090af.entry.js → p-fa970e96.entry.js} +1 -1
- package/dist/vega/{p-b1e1c7d0.js → p-fc07ed1e.js} +1 -1
- package/dist/vega/{p-5c6d36ef.entry.js → p-fdb6f4f0.entry.js} +1 -1
- package/dist/vega/{p-5a347a15.js → p-fffc1f47.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-040bd9ca.js +0 -1
- package/dist/vega/p-087240db.js +0 -1
- package/dist/vega/p-0e0e66c9.entry.js +0 -1
- package/dist/vega/p-15052b2e.entry.js +0 -1
- package/dist/vega/p-27c9c2a5.entry.js +0 -1
- package/dist/vega/p-28c16885.js +0 -1
- package/dist/vega/p-3ec4d710.js +0 -1
- package/dist/vega/p-43ea1e86.js +0 -1
- package/dist/vega/p-7228088b.entry.js +0 -1
- package/dist/vega/p-7b9ed949.js +0 -1
- package/dist/vega/p-7fd15dd1.js +0 -1
- package/dist/vega/p-8e1f30ec.entry.js +0 -1
- package/dist/vega/p-9680dfe6.js +0 -1
- package/dist/vega/p-9a0e17b2.entry.js +0 -1
- package/dist/vega/p-ae12cc3f.js +0 -3
- package/dist/vega/p-c0823f32.js +0 -1
- package/dist/vega/p-c0eb8c58.js +0 -1
- package/dist/vega/p-c5af2ecc.entry.js +0 -1
- package/dist/vega/p-fa43272c.js +0 -1
|
@@ -47,7 +47,7 @@ export class VegaInputNumericRenderer extends VegaSlimmer {
|
|
|
47
47
|
if (this.integerOnly) {
|
|
48
48
|
maskOptions.precision = 0;
|
|
49
49
|
}
|
|
50
|
-
return (h("vega-input", { value: this.value || '', showClearIcon: this.showClearIcon, disabled: this.disabled, label: this.label, hint: this.hint, required: this.required, optional: this.optional, type: "number", placeholder: this.placeholder, size: this.size === 'small' ? 'small' : 'default', prefixIcon: this.prefixIcon, ref: (ref) => {
|
|
50
|
+
return (h("vega-input", { value: this.value || '', showClearIcon: this.showClearIcon, disabled: this.disabled, label: this.label, hint: this.hint, required: this.required, optional: this.optional, type: "number", placeholder: this.placeholder, size: this.size === 'small' ? 'small' : 'default', prefixIcon: this.prefixIcon, prefixText: this.prefixText, suffixText: this.suffixText, ref: (ref) => {
|
|
51
51
|
this.vegaInputRef = ref;
|
|
52
52
|
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaChange, (payload) => this.onInputChange(payload));
|
|
53
53
|
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaBlur, (payload) => this.onInputBlur(payload));
|
|
@@ -60,6 +60,12 @@ export class VegaInputNumericRenderer extends VegaSlimmer {
|
|
|
60
60
|
__decorate([
|
|
61
61
|
MapToComponentField()
|
|
62
62
|
], VegaInputNumericRenderer.prototype, "prefixIcon", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
MapToComponentField()
|
|
65
|
+
], VegaInputNumericRenderer.prototype, "prefixText", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
MapToComponentField()
|
|
68
|
+
], VegaInputNumericRenderer.prototype, "suffixText", void 0);
|
|
63
69
|
__decorate([
|
|
64
70
|
MapToComponentField()
|
|
65
71
|
], VegaInputNumericRenderer.prototype, "showClearIcon", void 0);
|
|
@@ -53,8 +53,6 @@ export class VegaInputNumeric {
|
|
|
53
53
|
defaultValue: '',
|
|
54
54
|
attributeGetter: (propertyName) => this[propertyName],
|
|
55
55
|
});
|
|
56
|
-
this.prefixTextNotifySlimmer = createSubStateNotifySlimmer(VegaInputNumeric, 'prefixText', 'watchPrefixText');
|
|
57
|
-
this.suffixTextNotifySlimmer = createSubStateNotifySlimmer(VegaInputNumeric, 'suffixText', 'watchSuffixText');
|
|
58
56
|
this.isCompactInputWidthNotifySlimmer = createSubStateNotifySlimmer(VegaInputNumeric, 'isCompactInputWidth');
|
|
59
57
|
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
|
|
60
58
|
this.isCompactInputWidth = true;
|
|
@@ -877,12 +875,6 @@ __decorate([
|
|
|
877
875
|
__decorate([
|
|
878
876
|
InjectVegaSlimmer()
|
|
879
877
|
], VegaInputNumeric.prototype, "formFieldController", void 0);
|
|
880
|
-
__decorate([
|
|
881
|
-
InjectVegaSlimmer()
|
|
882
|
-
], VegaInputNumeric.prototype, "prefixTextNotifySlimmer", void 0);
|
|
883
|
-
__decorate([
|
|
884
|
-
InjectVegaSlimmer()
|
|
885
|
-
], VegaInputNumeric.prototype, "suffixTextNotifySlimmer", void 0);
|
|
886
878
|
__decorate([
|
|
887
879
|
InjectVegaSlimmer()
|
|
888
880
|
], VegaInputNumeric.prototype, "isCompactInputWidthNotifySlimmer", void 0);
|
|
@@ -97,9 +97,13 @@ export const RTE_BLOCK_BOUNDARY_ATTRIBUTE = 'data-vega-rte-block-boundary';
|
|
|
97
97
|
* whether to preserve the original inline styles.
|
|
98
98
|
*/
|
|
99
99
|
export const RTE_PASTE_MODE_DATA_TYPE = 'application/x-vega-rte-paste-mode';
|
|
100
|
+
/** Marks synthetic plain-paste text whose preserved-whitespace sentinels require decoding. */
|
|
101
|
+
export const RTE_PRESERVED_WHITESPACE_DATA_TYPE = 'application/x-vega-rte-preserved-whitespace';
|
|
100
102
|
/**
|
|
101
103
|
* Custom DataTransfer MIME type value used to indicate that the paste content
|
|
102
104
|
* originated from Microsoft Word.
|
|
103
105
|
*/
|
|
104
106
|
export const RTE_PASTE_MODE_WORD = 'word';
|
|
105
107
|
export const RTE_WORD_COUNT_KEY = 'rte-word-count';
|
|
108
|
+
/** Custom paste mode value used to insert clipboard content without formatting. */
|
|
109
|
+
export const RTE_PASTE_MODE_PLAIN = 'plain';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Runs each step of a `SequentialCompositionAction` against its own target. Inner leaf actions stay
|
|
4
|
+
* non-flushable, so only the outer composition emits the single flush notification. A step can be a
|
|
5
|
+
* factory that builds its operation(s) at apply time, reading earlier applied actions by their type.
|
|
6
|
+
*/
|
|
7
|
+
export class SequentialCompositionStrategy extends ActionHandleStrategy {
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
handleAction(action) {
|
|
12
|
+
const results = new Map();
|
|
13
|
+
const context = {
|
|
14
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
15
|
+
getAction: (type) => results.get(type),
|
|
16
|
+
};
|
|
17
|
+
action.steps.forEach((step) => {
|
|
18
|
+
const produced = typeof step === 'function' ? step(context) : step;
|
|
19
|
+
if (!produced) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const operations = Array.isArray(produced) ? produced : [produced];
|
|
23
|
+
operations.forEach((operation) => {
|
|
24
|
+
// Avoid multiple flush value
|
|
25
|
+
operation.action.isFlushable = false;
|
|
26
|
+
operation.target.apply(operation.action);
|
|
27
|
+
results.set(operation.action.type, operation.action);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -33,6 +33,7 @@ export var ModifyContentActionType;
|
|
|
33
33
|
ModifyContentActionType["INSERT_NODE_TO_NEAREST_ROOT"] = "INSERT_NODE_TO_NEAREST_ROOT";
|
|
34
34
|
ModifyContentActionType["PASTE_CONTENT"] = "PASTE_CONTENT";
|
|
35
35
|
ModifyContentActionType["DELETE_SELECTED_CONTENT"] = "DELETE_SELECTED_CONTENT";
|
|
36
|
+
ModifyContentActionType["SEQUENTIAL_COMPOSITION"] = "SEQUENTIAL_COMPOSITION";
|
|
36
37
|
})(ModifyContentActionType || (ModifyContentActionType = {}));
|
|
37
38
|
/**
|
|
38
39
|
* Abstract class for update node content, delete node, insert node
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModifyContentAction, ModifyContentActionType } from './modify-content-action.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Applies an ordered list of leaf content actions as one flushable unit, so a `beforeinput` handler
|
|
4
|
+
* emits a single flush through the shared action pipeline instead of marking each leaf action flushable.
|
|
5
|
+
*/
|
|
6
|
+
export class SequentialCompositionAction extends ModifyContentAction {
|
|
7
|
+
constructor(steps, flushPayload = {}) {
|
|
8
|
+
super();
|
|
9
|
+
this.steps = steps;
|
|
10
|
+
this.isFlushable = true;
|
|
11
|
+
this.type = ModifyContentActionType.SEQUENTIAL_COMPOSITION;
|
|
12
|
+
this.flushPayload = flushPayload;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -24,6 +24,7 @@ import { LogUtility } from '../../../utils/log';
|
|
|
24
24
|
import { HTMLContentCleaner } from '../slimmers/controllers/html-cleaner';
|
|
25
25
|
import { RTEFilterStylesStrategyRegistry } from './filter-styles-strategies/filter-styles-strategy-registry';
|
|
26
26
|
import { DeleteSelectedContentStrategy } from './action-handle-strategies/modify-content-strategies/delete-selected-content-strategy';
|
|
27
|
+
import { SequentialCompositionStrategy } from './action-handle-strategies/modify-content-strategies/sequential-composition-strategy';
|
|
27
28
|
import { CommitValueStrategy } from './action-handle-strategies/modify-content-strategies/commit-value-strategy';
|
|
28
29
|
import { COMMIT_VALUE } from './actions/commit-value-action';
|
|
29
30
|
import { ReplaceNestListAction } from './actions/replace-nest-list-action';
|
|
@@ -171,12 +172,13 @@ export class VegaRTEContent extends Discriminated {
|
|
|
171
172
|
* @param {ModifyContentAction} action - Modify content action
|
|
172
173
|
*/
|
|
173
174
|
apply(action) {
|
|
175
|
+
var _a;
|
|
174
176
|
ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
175
177
|
// Check if the action has been executed and is flushable
|
|
176
178
|
if (action['executedFlag'] && action.isFlushable) {
|
|
177
179
|
const host = stateEntityRenderingRegistry.getDOMByEntity(this);
|
|
178
180
|
if (host) {
|
|
179
|
-
changeManager.notify(domNodeSubjectFactory.getSubject(host, VegaInternalRichTextEditorFlushChanges), {});
|
|
181
|
+
changeManager.notify(domNodeSubjectFactory.getSubject(host, VegaInternalRichTextEditorFlushChanges), (_a = action.flushPayload) !== null && _a !== void 0 ? _a : {});
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
184
|
}
|
|
@@ -282,4 +284,5 @@ VegaRTEContent.typeName = 'VegaRTEContent';
|
|
|
282
284
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.UPDATE_CURSOR_POSITION, VegaRTEContent.typeName, new UpdateCursorPositionStrategy());
|
|
283
285
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_SELECTED_CONTENT, VegaRTEContent.typeName, new DeleteSelectedContentStrategy());
|
|
284
286
|
ActionHandleStrategyRegistry.register(COMMIT_VALUE, VegaRTEContent.typeName, new CommitValueStrategy());
|
|
287
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.SEQUENTIAL_COMPOSITION, VegaRTEContent.typeName, new SequentialCompositionStrategy());
|
|
285
288
|
})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -20,6 +20,7 @@ import { ImageUpdateUrlStrategy } from '../action-handle-strategies/modify-conte
|
|
|
20
20
|
import { AnnotationAction } from '../actions/annotation-action.abstract';
|
|
21
21
|
import { CommonAnnotation } from '../annotations/common-annotation.abstract';
|
|
22
22
|
import { RTEDecoratorNode } from './decorator-node';
|
|
23
|
+
import { escapeHtml } from '../../helpers/utils';
|
|
23
24
|
/**
|
|
24
25
|
* Image node
|
|
25
26
|
*/
|
|
@@ -78,8 +79,8 @@ export class RTEImageNode extends RTEDecoratorNode {
|
|
|
78
79
|
toHtml(options) {
|
|
79
80
|
const imageAnnotation = this.getAnnotationByType(NodeAnnotationTypeEnum.IMAGE);
|
|
80
81
|
const attrStr = super.generateAttributeString(options, ...[
|
|
81
|
-
imageAnnotation && imageAnnotation.alt ? `alt="${imageAnnotation.alt}"` : null,
|
|
82
|
-
`src="${this.url}"`,
|
|
82
|
+
imageAnnotation && imageAnnotation.alt ? `alt="${escapeHtml(imageAnnotation.alt)}"` : null,
|
|
83
|
+
`src="${escapeHtml(this.url)}"`,
|
|
83
84
|
imageAnnotation && imageAnnotation.size ? `data-size="${imageAnnotation.size}"` : null,
|
|
84
85
|
].filter(isNonNullable));
|
|
85
86
|
return `<img${attrStr}>`;
|
package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js
CHANGED
|
@@ -2,6 +2,8 @@ import { generateUUID } from '../../../../../utils/misc';
|
|
|
2
2
|
import { RTEAnnotationStyle } from '../../../dto/annotations/annotation-style';
|
|
3
3
|
import { RTEBlock } from '../../../dto/blocks/block.abstract';
|
|
4
4
|
import { RTETextBlock } from '../../../dto/blocks/text-block';
|
|
5
|
+
import { NodeAnnotationTypeEnum } from '../../../dto/annotations/node-annotation.abstract';
|
|
6
|
+
import { RTELogicControlBlock } from '../dto/logic-control-block';
|
|
5
7
|
import { FUNCTION_BLOCK_CLASS, FUNCTION_CONTENT_CLASS } from '../constants';
|
|
6
8
|
import { RTE_BLOCK_BOUNDARY_ATTRIBUTE } from '../../../constants/constant';
|
|
7
9
|
/**
|
|
@@ -28,8 +30,36 @@ export class RTEFunctionBlock extends RTEBlock {
|
|
|
28
30
|
? Object.assign(Object.assign({}, annotations), defaultAnnotation) : defaultAnnotation;
|
|
29
31
|
super.convertAnnotationsToMap(functionBlock.annotationMap, annotations);
|
|
30
32
|
functionBlock.children = this.generateBlockChildren(block.children, options, functionBlock);
|
|
33
|
+
this.unwrapForeachContent(functionBlock.children);
|
|
31
34
|
return functionBlock;
|
|
32
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Removes a redundant div wrapper from FOREACH content so it is rendered inline
|
|
38
|
+
* with the FOREACH control. SHOW content retains its wrapper to preserve line breaks.
|
|
39
|
+
*
|
|
40
|
+
* @param {RTEFunctionBlockChild[]} children - The function block children to normalize.
|
|
41
|
+
*/
|
|
42
|
+
static unwrapForeachContent(children) {
|
|
43
|
+
children.forEach((logicControlBlock, index) => {
|
|
44
|
+
const contentBlock = children[index + 1];
|
|
45
|
+
if (!(logicControlBlock instanceof RTELogicControlBlock) ||
|
|
46
|
+
logicControlBlock.statementText !== 'FOREACH' ||
|
|
47
|
+
!(contentBlock instanceof RTETextBlock)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
contentBlock.children.forEach((node) => {
|
|
51
|
+
const inlineHtml = node.getAnnotationByType(NodeAnnotationTypeEnum.INLINE_HTML);
|
|
52
|
+
if ((inlineHtml === null || inlineHtml === void 0 ? void 0 : inlineHtml.htmlTag) !== 'div')
|
|
53
|
+
return;
|
|
54
|
+
if (inlineHtml.child) {
|
|
55
|
+
node.annotationMap.set(NodeAnnotationTypeEnum.INLINE_HTML, inlineHtml.child);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
node.annotationMap.delete(NodeAnnotationTypeEnum.INLINE_HTML);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
33
63
|
/**
|
|
34
64
|
* Converts the RTEFunctionBlock and its children to an HTML string.
|
|
35
65
|
*
|
|
@@ -39,6 +39,7 @@ export class DivToFunctionBlockStrategy extends ElementToDTOStrategy {
|
|
|
39
39
|
* @inheritDoc
|
|
40
40
|
*/
|
|
41
41
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
42
|
+
RTEFunctionBlock.unwrapForeachContent(childBlocks);
|
|
42
43
|
currentBlock.children = childBlocks.map((block) => {
|
|
43
44
|
block.parent = currentBlock;
|
|
44
45
|
return block;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/** Computes paste chooser placement from the paste pointer or saved caret range. */
|
|
2
|
+
export class ChooserPositioner {
|
|
3
|
+
constructor(getHostElement, getSelectionRange) {
|
|
4
|
+
this.getHostElement = getHostElement;
|
|
5
|
+
this.getSelectionRange = getSelectionRange;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @param {ClipboardEvent} event Originating paste event.
|
|
9
|
+
* @returns {ChooserPosition} Position in viewport coordinates.
|
|
10
|
+
*/
|
|
11
|
+
compute(event) {
|
|
12
|
+
var _a, _b, _c;
|
|
13
|
+
const hostEl = this.getHostElement();
|
|
14
|
+
if (!hostEl) {
|
|
15
|
+
return { left: 0, top: 0, placement: ['bottom', 'top'] };
|
|
16
|
+
}
|
|
17
|
+
const hostRect = hostEl.getBoundingClientRect();
|
|
18
|
+
const viewportHeight = (_b = (_a = hostEl.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.innerHeight) !== null && _b !== void 0 ? _b : window.innerHeight;
|
|
19
|
+
const pointerEvent = event;
|
|
20
|
+
const hasPointer = typeof pointerEvent.clientX === 'number' &&
|
|
21
|
+
pointerEvent.clientX > 0 &&
|
|
22
|
+
typeof pointerEvent.clientY === 'number' &&
|
|
23
|
+
pointerEvent.clientY > 0;
|
|
24
|
+
const caretRect = hasPointer ? null : this.getCaretRect();
|
|
25
|
+
const CHOOSER_GAP_PX = 8;
|
|
26
|
+
const CHOOSER_MIN_MARGIN_PX = 12;
|
|
27
|
+
const CHOOSER_WIDTH_PX = 220;
|
|
28
|
+
const CHOOSER_FALLBACK_OFFSET_PX = 40;
|
|
29
|
+
const CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX = 88;
|
|
30
|
+
const baseLeft = hasPointer
|
|
31
|
+
? pointerEvent.clientX
|
|
32
|
+
: (_c = caretRect === null || caretRect === void 0 ? void 0 : caretRect.left) !== null && _c !== void 0 ? _c : hostRect.left + CHOOSER_MIN_MARGIN_PX;
|
|
33
|
+
const baseTop = hasPointer
|
|
34
|
+
? pointerEvent.clientY
|
|
35
|
+
: caretRect
|
|
36
|
+
? caretRect.bottom
|
|
37
|
+
: hostRect.top + CHOOSER_FALLBACK_OFFSET_PX;
|
|
38
|
+
const maxLeft = Math.max(hostRect.left + CHOOSER_MIN_MARGIN_PX, hostRect.right - CHOOSER_WIDTH_PX);
|
|
39
|
+
const left = Math.min(Math.max(baseLeft, hostRect.left + CHOOSER_MIN_MARGIN_PX), maxLeft);
|
|
40
|
+
const top = Math.max(baseTop + CHOOSER_GAP_PX, hostRect.top + CHOOSER_MIN_MARGIN_PX);
|
|
41
|
+
const availableBelow = viewportHeight - top - CHOOSER_MIN_MARGIN_PX;
|
|
42
|
+
const availableAbove = top - CHOOSER_MIN_MARGIN_PX;
|
|
43
|
+
const placement = availableBelow >= CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX || availableBelow >= availableAbove
|
|
44
|
+
? ['bottom', 'top']
|
|
45
|
+
: ['top', 'bottom'];
|
|
46
|
+
return { left, top, placement };
|
|
47
|
+
}
|
|
48
|
+
/** @returns {DOMRect | null} Best available caret rectangle. */
|
|
49
|
+
getCaretRect() {
|
|
50
|
+
const range = this.getSelectionRange();
|
|
51
|
+
if (!range) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const rect = range.getBoundingClientRect();
|
|
55
|
+
if (!this.isUnavailableRect(rect)) {
|
|
56
|
+
return rect;
|
|
57
|
+
}
|
|
58
|
+
const domRectList = range.getClientRects();
|
|
59
|
+
if (domRectList.length > 0) {
|
|
60
|
+
return domRectList[0];
|
|
61
|
+
}
|
|
62
|
+
return this.getRangeContainerRect(range);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @param {DOMRect} rect Rectangle to inspect.
|
|
66
|
+
* @returns {boolean} Whether the rectangle has no usable position or dimensions.
|
|
67
|
+
*/
|
|
68
|
+
isUnavailableRect(rect) {
|
|
69
|
+
return rect.width === 0 && rect.height === 0 && rect.left === 0 && rect.top === 0;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @param {Range} range Selection range whose container should be measured.
|
|
73
|
+
* @returns {DOMRect | null} Best available rectangle for the range container.
|
|
74
|
+
*/
|
|
75
|
+
getRangeContainerRect(range) {
|
|
76
|
+
var _a, _b, _c, _d, _e, _f;
|
|
77
|
+
const containerNode = (_a = range.startContainer) !== null && _a !== void 0 ? _a : null;
|
|
78
|
+
if (!containerNode) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
if (containerNode.nodeType === Node.ELEMENT_NODE) {
|
|
82
|
+
const containerElement = containerNode;
|
|
83
|
+
const previousNode = (_b = containerElement.childNodes[range.startOffset - 1]) !== null && _b !== void 0 ? _b : null;
|
|
84
|
+
const currentNode = (_c = containerElement.childNodes[range.startOffset]) !== null && _c !== void 0 ? _c : null;
|
|
85
|
+
return ((_e = (_d = this.getNodeRect(previousNode)) !== null && _d !== void 0 ? _d : this.getNodeRect(currentNode)) !== null && _e !== void 0 ? _e : this.getNodeRect(containerElement));
|
|
86
|
+
}
|
|
87
|
+
return (_f = this.getNodeRect(containerNode)) !== null && _f !== void 0 ? _f : this.getNodeRect(containerNode.parentNode);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @param {Node | null} node DOM node to measure.
|
|
91
|
+
* @returns {DOMRect | null} Element-backed rectangle for the node.
|
|
92
|
+
*/
|
|
93
|
+
getNodeRect(node) {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
if (!node) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
99
|
+
return (_b = (_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : null;
|
|
100
|
+
}
|
|
101
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
102
|
+
const rect = node.getBoundingClientRect();
|
|
103
|
+
return this.isUnavailableRect(rect) ? null : rect;
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { RTEPasteChooserUI } from '../paste-chooser-ui';
|
|
2
|
+
/** Owns chooser rendering and all listener bookkeeping used to dismiss it. */
|
|
3
|
+
export class PasteChooserController {
|
|
4
|
+
constructor(positioner, onModeSelect, onClearPayload) {
|
|
5
|
+
this.positioner = positioner;
|
|
6
|
+
this.onModeSelect = onModeSelect;
|
|
7
|
+
this.onClearPayload = onClearPayload;
|
|
8
|
+
this.chooserUI = null;
|
|
9
|
+
this.listenerDocument = null;
|
|
10
|
+
this.listenerWindow = null;
|
|
11
|
+
this.contentHostEl = null;
|
|
12
|
+
/**
|
|
13
|
+
* @param {Event} event Pointer event captured on the document.
|
|
14
|
+
*/
|
|
15
|
+
this.handleOutsidePointerDown = (event) => {
|
|
16
|
+
if (!this.chooserUI) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const eventPath = typeof event.composedPath === 'function' ? event.composedPath() : [];
|
|
20
|
+
if (!this.chooserUI.includesEventPath(eventPath)) {
|
|
21
|
+
this.clear();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @param {KeyboardEvent} event Keyboard event captured on the document.
|
|
26
|
+
*/
|
|
27
|
+
this.handleOutsideKeyDown = (event) => {
|
|
28
|
+
if (event.key === 'Escape') {
|
|
29
|
+
this.clear();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Clears the chooser when a relevant scroll container scrolls.
|
|
34
|
+
*
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
this.handleOutsideScroll = () => this.clear();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @returns {RTEPasteChooserUI | null} Current chooser UI, or `null` when closed.
|
|
41
|
+
*/
|
|
42
|
+
get ui() {
|
|
43
|
+
return this.chooserUI;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @param {HTMLElement | null} hostEl Rich text editor host element.
|
|
47
|
+
* @param {HTMLElement | null} contentHostEl Scrollable content host element.
|
|
48
|
+
* @param {ClipboardEvent} pasteEvent Originating paste event used for positioning.
|
|
49
|
+
* @param {boolean} showWordOption Whether to display the Word paste option.
|
|
50
|
+
*/
|
|
51
|
+
open(hostEl, contentHostEl, pasteEvent, showWordOption) {
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
const hostRoot = (_a = hostEl === null || hostEl === void 0 ? void 0 : hostEl.shadowRoot) !== null && _a !== void 0 ? _a : null;
|
|
54
|
+
if (!hostRoot || !hostEl) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.clear(false);
|
|
58
|
+
const position = this.positioner.compute(pasteEvent);
|
|
59
|
+
this.chooserUI = new RTEPasteChooserUI(hostRoot, { onModeSelect: this.onModeSelect }, { showWordOption });
|
|
60
|
+
this.chooserUI.open(position);
|
|
61
|
+
this.contentHostEl = contentHostEl;
|
|
62
|
+
this.listenerDocument = hostEl.ownerDocument;
|
|
63
|
+
this.listenerWindow = this.listenerDocument.defaultView;
|
|
64
|
+
this.listenerDocument.addEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
65
|
+
this.listenerDocument.addEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
66
|
+
this.listenerDocument.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
67
|
+
(_b = this.listenerWindow) === null || _b === void 0 ? void 0 : _b.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
68
|
+
(_c = this.contentHostEl) === null || _c === void 0 ? void 0 : _c.addEventListener('scroll', this.handleOutsideScroll);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @param {boolean} [clearPayload] Whether to also clear the pending paste payload.
|
|
72
|
+
*/
|
|
73
|
+
clear(clearPayload = true) {
|
|
74
|
+
var _a, _b, _c;
|
|
75
|
+
(_a = this.contentHostEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', this.handleOutsideScroll);
|
|
76
|
+
this.contentHostEl = null;
|
|
77
|
+
(_b = this.listenerWindow) === null || _b === void 0 ? void 0 : _b.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
78
|
+
this.listenerWindow = null;
|
|
79
|
+
if (this.listenerDocument) {
|
|
80
|
+
this.listenerDocument.removeEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
81
|
+
this.listenerDocument.removeEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
82
|
+
this.listenerDocument.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
83
|
+
this.listenerDocument = null;
|
|
84
|
+
}
|
|
85
|
+
(_c = this.chooserUI) === null || _c === void 0 ? void 0 : _c.destroy();
|
|
86
|
+
this.chooserUI = null;
|
|
87
|
+
if (clearPayload) {
|
|
88
|
+
this.onClearPayload();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Owns the native paste listener and synchronous clipboard payload capture. */
|
|
2
|
+
export class PasteEventInterceptor {
|
|
3
|
+
constructor(selectionSnapshotService, onPasteCaptured) {
|
|
4
|
+
this.selectionSnapshotService = selectionSnapshotService;
|
|
5
|
+
this.onPasteCaptured = onPasteCaptured;
|
|
6
|
+
this.editableEl = null;
|
|
7
|
+
/**
|
|
8
|
+
* @param {ClipboardEvent} event Native paste event to capture.
|
|
9
|
+
*/
|
|
10
|
+
this.handlePasteEvent = (event) => {
|
|
11
|
+
const clipboardData = event.clipboardData;
|
|
12
|
+
if (!clipboardData) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const html = clipboardData.getData('text/html') || '';
|
|
16
|
+
const text = clipboardData.getData('text/plain') || '';
|
|
17
|
+
const rtf = clipboardData.getData('text/rtf') || '';
|
|
18
|
+
if (!html && !text) {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
event.stopPropagation();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
const snapshot = this.selectionSnapshotService.capture();
|
|
26
|
+
const files = clipboardData.files ? Array.from(clipboardData.files) : [];
|
|
27
|
+
this.onPasteCaptured({ html, text, range: snapshot.range, selectedNodes: snapshot.selectedNodes, files, rtf }, event);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @param {HTMLDivElement | null} editableEl Editable content element to observe.
|
|
32
|
+
*/
|
|
33
|
+
attach(editableEl) {
|
|
34
|
+
var _a;
|
|
35
|
+
this.detach();
|
|
36
|
+
this.editableEl = editableEl;
|
|
37
|
+
(_a = this.editableEl) === null || _a === void 0 ? void 0 : _a.addEventListener('paste', this.handlePasteEvent);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Detaches the current native paste listener.
|
|
41
|
+
*/
|
|
42
|
+
detach() {
|
|
43
|
+
var _a;
|
|
44
|
+
(_a = this.editableEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('paste', this.handlePasteEvent);
|
|
45
|
+
this.editableEl = null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Captures and restores native and editor selection state around chooser interaction. */
|
|
2
|
+
export class SelectionSnapshotService {
|
|
3
|
+
constructor(getContext) {
|
|
4
|
+
this.getContext = getContext;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @returns {SelectionSnapshot} Captured native and editor selection state.
|
|
8
|
+
*/
|
|
9
|
+
capture() {
|
|
10
|
+
var _a;
|
|
11
|
+
const context = this.getContext();
|
|
12
|
+
const selection = context === null || context === void 0 ? void 0 : context.getSelection();
|
|
13
|
+
const range = selection && selection.rangeCount > 0 ? selection.getRangeAt(0).cloneRange() : null;
|
|
14
|
+
const selectedNodes = ((_a = context === null || context === void 0 ? void 0 : context.getSelectedNodes) === null || _a === void 0 ? void 0 : _a.call(context)) || [];
|
|
15
|
+
return { range, selectedNodes: [...selectedNodes] };
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @param {PendingPastePayload} payload Paste payload containing captured selection state.
|
|
19
|
+
*/
|
|
20
|
+
restore(payload) {
|
|
21
|
+
this.restoreRange(payload.range);
|
|
22
|
+
this.restoreControllerState(payload);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @param {PendingPastePayload} payload Paste payload containing editor selection state.
|
|
26
|
+
*/
|
|
27
|
+
restoreControllerState(payload) {
|
|
28
|
+
const context = this.getContext();
|
|
29
|
+
if (!payload.range || !context) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const rangeOptions = {
|
|
33
|
+
startNode: payload.range.startContainer,
|
|
34
|
+
endNode: payload.range.endContainer,
|
|
35
|
+
startOffset: payload.range.startOffset,
|
|
36
|
+
endOffset: payload.range.endOffset,
|
|
37
|
+
};
|
|
38
|
+
context.setSelectedNodes(payload.selectedNodes || [], rangeOptions);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @param {Range | null} range Native selection range to restore.
|
|
42
|
+
*/
|
|
43
|
+
restoreRange(range) {
|
|
44
|
+
var _a;
|
|
45
|
+
if (!range) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const selection = (_a = this.getContext()) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
49
|
+
if (selection) {
|
|
50
|
+
selection.removeAllRanges();
|
|
51
|
+
selection.addRange(range);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PasteImageParser } from './paste-image-parser';
|
|
2
|
+
/** Extracts local image previews from strategy output. */
|
|
3
|
+
export class ImageExtractor {
|
|
4
|
+
constructor(parser = new PasteImageParser()) {
|
|
5
|
+
this.parser = parser;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} html HTML content containing local image references.
|
|
9
|
+
* @param {File[]} files Clipboard image files.
|
|
10
|
+
* @param {string} rtf Rich text clipboard content used to resolve images.
|
|
11
|
+
* @returns {ParseLocalImagesResult} HTML and extracted local image previews.
|
|
12
|
+
*/
|
|
13
|
+
extract(html, files, rtf) {
|
|
14
|
+
const clipboardFileContent = { files, rtf };
|
|
15
|
+
return this.parser.parseLocalImages(html, clipboardFileContent);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.js
CHANGED
|
@@ -112,6 +112,7 @@ export class RTEPasteChooserUI {
|
|
|
112
112
|
itemsContainer.setAttribute('slot', 'items');
|
|
113
113
|
const dropdownItems = [
|
|
114
114
|
this.createDropdownItem(doc, RTEPasteMode.RICH, VegaInternalTranslation.t('Use rich text'), RTEPasteChooserUI.CHOOSER_RICH_ATTR),
|
|
115
|
+
this.createDropdownItem(doc, RTEPasteMode.PLAIN, VegaInternalTranslation.t('Use plain text'), RTEPasteChooserUI.CHOOSER_PLAIN_ATTR),
|
|
115
116
|
];
|
|
116
117
|
if (this.options.showWordOption) {
|
|
117
118
|
dropdownItems.push(this.createDropdownItem(doc, RTEPasteMode.WORD, VegaInternalTranslation.t('Use Word'), RTEPasteChooserUI.CHOOSER_WORD_ATTR));
|
|
@@ -120,7 +121,7 @@ export class RTEPasteChooserUI {
|
|
|
120
121
|
dropdownEl.append(itemsContainer);
|
|
121
122
|
dropdownEl.addEventListener('vegaDropdownClick', (event) => {
|
|
122
123
|
const mode = event.detail;
|
|
123
|
-
if (mode === RTEPasteMode.RICH || mode === RTEPasteMode.WORD) {
|
|
124
|
+
if (mode === RTEPasteMode.RICH || mode === RTEPasteMode.PLAIN || mode === RTEPasteMode.WORD) {
|
|
124
125
|
this.callbacks.onModeSelect(mode);
|
|
125
126
|
}
|
|
126
127
|
});
|
|
@@ -150,5 +151,6 @@ export class RTEPasteChooserUI {
|
|
|
150
151
|
})();
|
|
151
152
|
RTEPasteChooserUI.CHOOSER_ATTR = 'data-rte-paste-chooser';
|
|
152
153
|
RTEPasteChooserUI.CHOOSER_RICH_ATTR = 'data-rte-paste-type-rich';
|
|
154
|
+
RTEPasteChooserUI.CHOOSER_PLAIN_ATTR = 'data-rte-paste-type-plain';
|
|
153
155
|
RTEPasteChooserUI.CHOOSER_WORD_ATTR = 'data-rte-paste-type-word';
|
|
154
156
|
RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR = 'data-rte-paste-trigger';
|