@heartlandone/vega 2.102.0 → 2.103.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-85986306.js} +10 -10
- package/dist/cjs/{code-block-06e6591f.js → code-block-72de6c4d.js} +80 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-f29908f8.js → component-value-history-controller-slimmer.abstract-23d2b3d8.js} +3 -3
- package/dist/cjs/{content-state-8c862e5e.js → content-state-ff40bdc6.js} +38 -5
- package/dist/cjs/{date-required-rule-b672c432.js → date-required-rule-608e704b.js} +1 -1
- package/dist/cjs/{design-token-351ffd2c.js → design-token-a101a8d0.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-f932b166.js → element-appender-slimmer-b93cc564.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-5adb86ae.js → form-field-controller-slimmer-124d54ea.js} +1 -1
- package/dist/cjs/{image-annotation-action-25907d6b.js → image-annotation-action-1ee41bc7.js} +2 -2
- package/dist/cjs/{image-extension-1cf84f27.js → image-extension-6a92c524.js} +247 -5
- package/dist/cjs/index.cjs.js +17 -17
- package/dist/cjs/{inject-keyboard-manager-84d33920.js → inject-keyboard-manager-32d7dd0e.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-3c5236be.js → internal-calendar-period-factory-c3198ea7.js} +1 -1
- package/dist/cjs/{internal-translation-controller-eae8a8de.js → internal-translation-controller-0d67ca4d.js} +1 -0
- package/dist/cjs/{keyboard-manager-baa83a61.js → keyboard-manager-332eec89.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-d1974b28.js → keyboard-manager-slimmer-a2872981.js} +1 -1
- package/dist/cjs/{link-extension-2a6133b7.js → link-extension-1b4ed437.js} +3 -3
- package/dist/cjs/loader.cjs.js +12 -12
- package/dist/cjs/{month-view-generator-a6827548.js → month-view-generator-b6a2b8be.js} +1 -1
- package/dist/cjs/{public-rules-7f26e0ae.js → public-rules-2066613c.js} +7 -7
- package/dist/cjs/{range-518b95a2.js → range-712fe703.js} +1 -1
- package/dist/cjs/{responsive-format-facade-95c54444.js → responsive-format-facade-44d33457.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-5d0c76ec.js → rich-text-editor-required-rule-1aa75d22.js} +1 -1
- package/dist/cjs/{split-cell-operation-28f6f8d9.js → split-cell-operation-afc82323.js} +3 -3
- package/dist/cjs/{state-border-formatter-6c284859.js → state-border-formatter-49984fd6.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-f15b6196.js → string-format-strategy.abstract-bd563c01.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-5a3f1b55.js → string-input-formatter-slimmer-4faebac9.js} +1 -1
- package/dist/cjs/{string-mask-strategy-af6f3ba0.js → string-mask-strategy-624c4398.js} +2 -2
- package/dist/cjs/{style-formatter-324211fd.js → style-formatter-151d89a3.js} +2 -2
- package/dist/cjs/{time-required-rule-9e714442.js → time-required-rule-8cd8f9b9.js} +1 -1
- package/dist/cjs/{token-extension-86723cad.js → token-extension-72d0cb08.js} +1011 -767
- package/dist/cjs/{translation-slimmer-0227ee24.js → translation-slimmer-1771d01f.js} +1 -1
- package/dist/cjs/{type-guard-29e01bd4.js → type-guard-cce6fe1f.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-4ec364af.js → valid-credit-card-number-rule-b13c2fc4.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-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 +3 -3
- 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 +5 -5
- 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-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-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/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 +1 -0
- package/dist/esm/{app-globals-da5c83c2.js → app-globals-8cdfc5c9.js} +10 -10
- package/dist/esm/{code-block-d8f83d85.js → code-block-9360c331.js} +74 -2
- package/dist/esm/{component-value-history-controller-slimmer.abstract-642e7147.js → component-value-history-controller-slimmer.abstract-9ea58806.js} +3 -3
- package/dist/esm/{content-state-486eae1d.js → content-state-67a12e74.js} +38 -5
- package/dist/esm/{date-required-rule-08695d25.js → date-required-rule-66b5bf02.js} +1 -1
- package/dist/esm/{design-token-df3331d9.js → design-token-acd1efeb.js} +3 -3
- package/dist/esm/{element-appender-slimmer-f02a227f.js → element-appender-slimmer-7e5bc1e9.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-a7c0a0f8.js → form-field-controller-slimmer-d653c494.js} +1 -1
- package/dist/esm/{image-annotation-action-df744ba5.js → image-annotation-action-9525be48.js} +2 -2
- package/dist/esm/{image-extension-20b39140.js → image-extension-aea75132.js} +246 -6
- package/dist/esm/index.js +17 -17
- package/dist/esm/{inject-keyboard-manager-399ed867.js → inject-keyboard-manager-f6522d2f.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-7b866c3b.js → internal-calendar-period-factory-261df2f2.js} +1 -1
- package/dist/esm/{internal-translation-controller-4a7ee4d5.js → internal-translation-controller-3637e47e.js} +1 -0
- package/dist/esm/{keyboard-manager-f5d13a34.js → keyboard-manager-53e8d8d0.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-f40dcb54.js → keyboard-manager-slimmer-b3de042d.js} +1 -1
- package/dist/esm/{link-extension-3f93d70d.js → link-extension-57ba9520.js} +3 -3
- package/dist/esm/loader.js +12 -12
- package/dist/esm/{month-view-generator-0c665987.js → month-view-generator-15215a09.js} +1 -1
- package/dist/esm/{public-rules-470a1dac.js → public-rules-c77a1550.js} +7 -7
- package/dist/esm/{range-8e89fb54.js → range-3c74e1c8.js} +1 -1
- package/dist/esm/{responsive-format-facade-55131a33.js → responsive-format-facade-1b325d06.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-06caf383.js → rich-text-editor-required-rule-cfd32ba2.js} +1 -1
- package/dist/esm/{split-cell-operation-e158366a.js → split-cell-operation-85a036f9.js} +3 -3
- package/dist/esm/{state-border-formatter-2b73fa08.js → state-border-formatter-ce3495b0.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-8c7937e3.js → string-format-strategy.abstract-8ce04558.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-681c6b71.js → string-input-formatter-slimmer-0d60ba7d.js} +1 -1
- package/dist/esm/{string-mask-strategy-b8cceee6.js → string-mask-strategy-cabc1d50.js} +2 -2
- package/dist/esm/{style-formatter-fcd70869.js → style-formatter-00fe4f1c.js} +2 -2
- package/dist/esm/{time-required-rule-ce50859b.js → time-required-rule-57ceeae9.js} +1 -1
- package/dist/esm/{token-extension-2401e753.js → token-extension-645a9520.js} +1011 -767
- package/dist/esm/{translation-slimmer-b3f3cf65.js → translation-slimmer-b69057eb.js} +1 -1
- package/dist/esm/{type-guard-08c82e08.js → type-guard-204094c6.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-66bad519.js → valid-credit-card-number-rule-0874e19f.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-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 +3 -3
- 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 +5 -5
- 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-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-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/sri/vega-sri-manifest.json +321 -321
- 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 +1 -0
- package/dist/types/types/public-api.d.ts +2 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-8a4cc7c2.entry.js → p-0169f71c.entry.js} +1 -1
- package/dist/vega/p-018bb83b.entry.js +1 -0
- package/dist/vega/{p-25e51acb.js → p-08bf08d2.js} +1 -1
- package/dist/vega/{p-85a940c0.entry.js → p-0b33753f.entry.js} +1 -1
- package/dist/vega/{p-a5fa260b.js → p-1537b1e4.js} +1 -1
- package/dist/vega/{p-7dfb1481.entry.js → p-17f6dc94.entry.js} +1 -1
- package/dist/vega/{p-dd673eb4.entry.js → p-1a4d1991.entry.js} +1 -1
- package/dist/vega/{p-557b64bd.js → p-1b2e5898.js} +1 -1
- package/dist/vega/{p-2256eb09.entry.js → p-1f1f93bf.entry.js} +1 -1
- package/dist/vega/{p-d86e0b01.js → p-1fb953f8.js} +1 -1
- package/dist/vega/{p-03efc67a.entry.js → p-2171b571.entry.js} +1 -1
- package/dist/vega/p-255fe20b.js +1 -0
- package/dist/vega/{p-cf5c5515.js → p-261cf764.js} +1 -1
- package/dist/vega/{p-f0b49ae4.entry.js → p-27e77ea1.entry.js} +1 -1
- package/dist/vega/{p-109f0e33.entry.js → p-28acbe42.entry.js} +1 -1
- package/dist/vega/{p-27c9c2a5.entry.js → p-2acc600a.entry.js} +1 -1
- package/dist/vega/p-2fc2299f.js +1 -0
- package/dist/vega/{p-b48caf90.entry.js → p-2ff659a1.entry.js} +1 -1
- package/dist/vega/{p-527c3211.entry.js → p-322da1eb.entry.js} +1 -1
- package/dist/vega/{p-dffe47db.js → p-3283fa2f.js} +1 -1
- package/dist/vega/p-3567dc55.entry.js +1 -0
- package/dist/vega/{p-c6419eb3.entry.js → p-36b795c6.entry.js} +1 -1
- package/dist/vega/p-37714a3a.js +1 -0
- package/dist/vega/{p-d7e59f31.js → p-3b4e2ba0.js} +1 -1
- package/dist/vega/{p-3d060d2f.entry.js → p-3b911043.entry.js} +1 -1
- package/dist/vega/{p-5c6d36ef.entry.js → p-3e270b65.entry.js} +1 -1
- package/dist/vega/{p-b68f55e2.js → p-4043508a.js} +1 -1
- package/dist/vega/p-4151d4a8.js +1 -0
- package/dist/vega/{p-c6b6987e.js → p-45af801f.js} +1 -1
- package/dist/vega/p-48c2150b.entry.js +1 -0
- package/dist/vega/p-4b253f74.entry.js +1 -0
- package/dist/vega/{p-75c7f8ea.entry.js → p-4cdc064d.entry.js} +1 -1
- package/dist/vega/{p-1d8a8507.entry.js → p-4e4b50f3.entry.js} +1 -1
- package/dist/vega/{p-d8fa2f19.entry.js → p-564110ba.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-bec31ffc.entry.js → p-608d3559.entry.js} +1 -1
- package/dist/vega/{p-3ce7521e.entry.js → p-64eb05d3.entry.js} +1 -1
- package/dist/vega/{p-2f5c4b61.entry.js → p-66bf209b.entry.js} +1 -1
- package/dist/vega/{p-83f5ef3a.entry.js → p-69eadbd8.entry.js} +1 -1
- package/dist/vega/{p-c66c6fd2.entry.js → p-6c4edee8.entry.js} +1 -1
- package/dist/vega/p-6e16bb3a.js +1 -0
- package/dist/vega/{p-7d748545.entry.js → p-76f4fdba.entry.js} +1 -1
- package/dist/vega/{p-4c6989ae.entry.js → p-7874055b.entry.js} +1 -1
- package/dist/vega/{p-ca60a74b.entry.js → p-7d3d24f6.entry.js} +1 -1
- package/dist/vega/{p-3bfb53e3.js → p-7f9ad7bc.js} +1 -1
- package/dist/vega/{p-18ddc6a4.entry.js → p-8193f4ef.entry.js} +1 -1
- package/dist/vega/{p-816064f2.entry.js → p-8197d172.entry.js} +1 -1
- package/dist/vega/{p-634b138c.entry.js → p-8ac0b1b2.entry.js} +1 -1
- package/dist/vega/{p-553510d8.entry.js → p-8c61db9d.entry.js} +1 -1
- package/dist/vega/{p-061a76c3.entry.js → p-8de29082.entry.js} +1 -1
- package/dist/vega/{p-325b804d.entry.js → p-8e59606f.entry.js} +1 -1
- package/dist/vega/p-8ea41806.js +1 -0
- package/dist/vega/{p-ff9090af.entry.js → p-9153c2f5.entry.js} +1 -1
- package/dist/vega/{p-a0c87e88.entry.js → p-92411f56.entry.js} +1 -1
- package/dist/vega/{p-049e64b1.entry.js → p-94d65dcf.entry.js} +1 -1
- package/dist/vega/{p-a261a675.entry.js → p-9a96fb05.entry.js} +1 -1
- package/dist/vega/{p-7044bb48.js → p-9fcfd738.js} +1 -1
- package/dist/vega/{p-b1e1c7d0.js → p-a2c7a3bc.js} +1 -1
- package/dist/vega/p-a2dcde12.js +1 -0
- package/dist/vega/{p-be0eb72f.js → p-a60d75d9.js} +1 -1
- package/dist/vega/{p-5a347a15.js → p-a9fc4043.js} +1 -1
- package/dist/vega/{p-efef0dfe.entry.js → p-abe5f7f0.entry.js} +1 -1
- package/dist/vega/{p-197388a5.entry.js → p-ac98c189.entry.js} +1 -1
- package/dist/vega/{p-dd273d89.entry.js → p-ade903b3.entry.js} +1 -1
- package/dist/vega/{p-c0eb8c58.js → p-affb40e8.js} +1 -1
- package/dist/vega/{p-277aab9b.js → p-b3a1cd22.js} +1 -1
- package/dist/vega/p-b63a90b3.entry.js +1 -0
- package/dist/vega/{p-f9f96030.entry.js → p-ba050d63.entry.js} +1 -1
- package/dist/vega/{p-bf0b46c1.js → p-ba67eb96.js} +1 -1
- package/dist/vega/{p-f0c6e9c5.entry.js → p-c08ac33f.entry.js} +1 -1
- package/dist/vega/{p-46be74fc.entry.js → p-c7ec97d1.entry.js} +1 -1
- package/dist/vega/{p-effbfc50.entry.js → p-ca1fe571.entry.js} +1 -1
- package/dist/vega/{p-408c3ad4.entry.js → p-cc9fc36a.entry.js} +1 -1
- package/dist/vega/{p-741e064e.entry.js → p-d044d54f.entry.js} +1 -1
- package/dist/vega/{p-0e0e66c9.entry.js → p-d3a9355c.entry.js} +1 -1
- package/dist/vega/p-d5a75228.js +1 -0
- package/dist/vega/{p-76135e80.entry.js → p-dc83fa6b.entry.js} +1 -1
- package/dist/vega/{p-92efdbf0.entry.js → p-dcfce26e.entry.js} +1 -1
- package/dist/vega/p-df9585f6.js +3 -0
- package/dist/vega/{p-f5f26b44.entry.js → p-e2c8a470.entry.js} +1 -1
- package/dist/vega/{p-23781e76.js → p-e33a954f.js} +1 -1
- package/dist/vega/{p-e577dda8.entry.js → p-e5fc6583.entry.js} +1 -1
- package/dist/vega/p-e668cf11.js +1 -0
- package/dist/vega/{p-0338f621.entry.js → p-e6b0a292.entry.js} +1 -1
- package/dist/vega/{p-381d8781.js → p-e84c2589.js} +1 -1
- package/dist/vega/{p-1b97e751.entry.js → p-eb945d34.entry.js} +1 -1
- package/dist/vega/{p-d8a0e3e0.entry.js → p-ebe1dd2b.entry.js} +1 -1
- package/dist/vega/{p-6beaf1c8.entry.js → p-f818bb20.entry.js} +1 -1
- package/dist/vega/p-f981cf2c.js +1 -0
- package/dist/vega/p-f9d09b0c.js +1 -0
- package/dist/vega/{p-4d20a56f.js → p-fdbdf12f.js} +1 -1
- package/dist/vega/{p-48100d38.entry.js → p-fee080b9.entry.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-15052b2e.entry.js +0 -1
- package/dist/vega/p-28c16885.js +0 -1
- package/dist/vega/p-30cc31dd.entry.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-7f711049.js +0 -1
- package/dist/vega/p-7fd15dd1.js +0 -1
- package/dist/vega/p-85695819.js +0 -1
- package/dist/vega/p-8e1f30ec.entry.js +0 -1
- package/dist/vega/p-9680dfe6.js +0 -1
- package/dist/vega/p-ae12cc3f.js +0 -3
- package/dist/vega/p-c0823f32.js +0 -1
- package/dist/vega/p-c5af2ecc.entry.js +0 -1
- package/dist/vega/p-fa43272c.js +0 -1
|
@@ -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';
|