@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
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const featureFlagController = require('./feature-flag-controller-c19d0b58.js');
|
|
4
|
-
const tokenExtension = require('./token-extension-
|
|
5
|
-
const splitCellOperation = require('./split-cell-operation-
|
|
4
|
+
const tokenExtension = require('./token-extension-72d0cb08.js');
|
|
5
|
+
const splitCellOperation = require('./split-cell-operation-afc82323.js');
|
|
6
6
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
7
7
|
const vegaDialogController = require('./vega-dialog-controller-efc46dba.js');
|
|
8
8
|
const typography = require('./typography-3ea4fe41.js');
|
|
9
9
|
const iconManager = require('./icon-manager-7d20b0ab.js');
|
|
10
|
-
const internalTranslationController = require('./internal-translation-controller-
|
|
11
|
-
const validCreditCardNumberRule = require('./valid-credit-card-number-rule-
|
|
10
|
+
const internalTranslationController = require('./internal-translation-controller-0d67ca4d.js');
|
|
11
|
+
const validCreditCardNumberRule = require('./valid-credit-card-number-rule-b13c2fc4.js');
|
|
12
12
|
const vegaEnvManager = require('./vega-env-manager-23b8b23c.js');
|
|
13
13
|
const staticSubjectTitle = require('./static-subject-title-70c73b16.js');
|
|
14
14
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
15
15
|
const observer = require('./observer-f49483e8.js');
|
|
16
16
|
const index = require('./index-58ea899e.js');
|
|
17
|
-
const contentState = require('./content-state-
|
|
17
|
+
const contentState = require('./content-state-ff40bdc6.js');
|
|
18
18
|
const vegaNonceManager = require('./vega-nonce-manager-df69d3ed.js');
|
|
19
|
-
const codeBlock = require('./code-block-
|
|
20
|
-
const imageExtension = require('./image-extension-
|
|
21
|
-
const linkExtension = require('./link-extension-
|
|
22
|
-
require('./type-guard-
|
|
19
|
+
const codeBlock = require('./code-block-72de6c4d.js');
|
|
20
|
+
const imageExtension = require('./image-extension-6a92c524.js');
|
|
21
|
+
const linkExtension = require('./link-extension-1b4ed437.js');
|
|
22
|
+
require('./type-guard-cce6fe1f.js');
|
|
23
23
|
const countries = require('./countries-a8e3812a.js');
|
|
24
24
|
|
|
25
25
|
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -436,7 +436,7 @@ function injectVegaCountryNamesIntoGlobal() {
|
|
|
436
436
|
* Inject VegaPublicValidationRules to global as a public api
|
|
437
437
|
*/
|
|
438
438
|
function injectVegaPublicValidationRules() {
|
|
439
|
-
void Promise.resolve().then(function () { return require('./public-rules-
|
|
439
|
+
void Promise.resolve().then(function () { return require('./public-rules-2066613c.js'); }).then((module) => {
|
|
440
440
|
Object.entries(module).forEach(([name, value]) => {
|
|
441
441
|
globalThis[name] = value;
|
|
442
442
|
});
|
|
@@ -5,7 +5,7 @@ const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-facto
|
|
|
5
5
|
const vegaInternalEventId = require('./vega-internal-event-id-98d499d7.js');
|
|
6
6
|
const string = require('./string-39438062.js');
|
|
7
7
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
8
|
-
const typeGuard = require('./type-guard-
|
|
8
|
+
const typeGuard = require('./type-guard-cce6fe1f.js');
|
|
9
9
|
const typography = require('./typography-3ea4fe41.js');
|
|
10
10
|
const discriminated = require('./discriminated-3b8e72d5.js');
|
|
11
11
|
const misc = require('./misc-3d30df91.js');
|
|
@@ -165,6 +165,7 @@ exports.ModifyContentActionType = void 0;
|
|
|
165
165
|
ModifyContentActionType["INSERT_NODE_TO_NEAREST_ROOT"] = "INSERT_NODE_TO_NEAREST_ROOT";
|
|
166
166
|
ModifyContentActionType["PASTE_CONTENT"] = "PASTE_CONTENT";
|
|
167
167
|
ModifyContentActionType["DELETE_SELECTED_CONTENT"] = "DELETE_SELECTED_CONTENT";
|
|
168
|
+
ModifyContentActionType["SEQUENTIAL_COMPOSITION"] = "SEQUENTIAL_COMPOSITION";
|
|
168
169
|
})(exports.ModifyContentActionType || (exports.ModifyContentActionType = {}));
|
|
169
170
|
/**
|
|
170
171
|
* Abstract class for update node content, delete node, insert node
|
|
@@ -272,6 +273,73 @@ function escapeHtmlAttribute(value) {
|
|
|
272
273
|
.replace(/>/g, '>')
|
|
273
274
|
.replace(/"/g, '"'));
|
|
274
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* Normalizes clipboard line endings and splits into lines. Low-level primitive behind
|
|
278
|
+
* `toPlainPasteLines`, which layers boundary-whitespace handling on top and is the single
|
|
279
|
+
* conversion source used by plain-mode paste.
|
|
280
|
+
*
|
|
281
|
+
* @param {string} text Raw clipboard plain text.
|
|
282
|
+
* @returns {string[]} Lines with `\r\n`/`\r` normalized to `\n` and split on `\n`.
|
|
283
|
+
*/
|
|
284
|
+
function normalizePlainTextLines(text) {
|
|
285
|
+
return text.replace(/\r\n?/g, '\n').split('\n');
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Sentinels for whitespace that must survive plain-mode boundary collapsing (e.g. code-block
|
|
289
|
+
* indentation derived from HTML). `htmlToPlainText` can emit these in place of real spaces/tabs so
|
|
290
|
+
* that `toPlainPasteLines` leaves them untouched — they are not matched by `\s` — and decodes them
|
|
291
|
+
* back to real characters after collapsing the paste's insignificant leading/trailing whitespace.
|
|
292
|
+
*/
|
|
293
|
+
const PRESERVED_SPACE = '\u0001';
|
|
294
|
+
const PRESERVED_TAB = '\u0002';
|
|
295
|
+
/**
|
|
296
|
+
* Restores {@link PRESERVED_SPACE}/{@link PRESERVED_TAB} sentinels back to real spaces/tabs.
|
|
297
|
+
*
|
|
298
|
+
* @param {string} text Text that may contain preserved-whitespace sentinels.
|
|
299
|
+
* @returns {string} Text with sentinels decoded to real whitespace.
|
|
300
|
+
*/
|
|
301
|
+
function decodePreservedWhitespace(text) {
|
|
302
|
+
return text.split(PRESERVED_SPACE).join(' ').split(PRESERVED_TAB).join('\t');
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Single source of truth for plain-mode paste conversion: turns raw clipboard text into
|
|
306
|
+
* the canonical list of lines used by both representations of the pasted content — the
|
|
307
|
+
* `text/html` payload emitted by `PlainPasteProcessingStrategy` and the RTE text/newline
|
|
308
|
+
* nodes built by `InsertPasteHandler`. Both must derive from this helper so whitespace and
|
|
309
|
+
* boundary handling cannot drift apart.
|
|
310
|
+
*
|
|
311
|
+
* Per-paragraph handling: lines carrying {@link PRESERVED_SPACE}/{@link PRESERVED_TAB}
|
|
312
|
+
* sentinels come from code-block sources (via the preservation branch of
|
|
313
|
+
* `extractBlockAwareText`) and are kept verbatim so significant indentation survives;
|
|
314
|
+
* all other lines get a normal `String.prototype.trim()` (including NBSP) so
|
|
315
|
+
* paragraph-boundary whitespace from non-code sources is treated as noise.
|
|
316
|
+
* When `decodeEncodedWhitespace` is enabled, sentinels are decoded back to real
|
|
317
|
+
* space/tab characters after the per-line pass.
|
|
318
|
+
*
|
|
319
|
+
* @param {string} text Raw clipboard plain text.
|
|
320
|
+
* @param {boolean} decodeEncodedWhitespace Whether HTML-derived sentinels should be decoded.
|
|
321
|
+
* @returns {string[]} Canonical plain-mode lines.
|
|
322
|
+
*/
|
|
323
|
+
function toPlainPasteLines(text, decodeEncodedWhitespace = false) {
|
|
324
|
+
const lines = normalizePlainTextLines(text);
|
|
325
|
+
return lines.map((line) => {
|
|
326
|
+
const hasSentinel = line.includes(PRESERVED_SPACE) || line.includes(PRESERVED_TAB);
|
|
327
|
+
const normalized = hasSentinel ? line : line.trim();
|
|
328
|
+
return decodeEncodedWhitespace ? decodePreservedWhitespace(normalized) : normalized;
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Serializes canonical plain-mode lines into paragraph-per-line HTML.
|
|
333
|
+
*
|
|
334
|
+
* Built as a string rather than via DOM `outerHTML` serialization, which collapses
|
|
335
|
+
* consecutive spaces in non-`<pre>` text nodes and would lose intentional whitespace.
|
|
336
|
+
*
|
|
337
|
+
* @param {string[]} lines Canonical plain-mode lines from {@link toPlainPasteLines}.
|
|
338
|
+
* @returns {string} Paragraph HTML where each line is an individual paragraph.
|
|
339
|
+
*/
|
|
340
|
+
function plainPasteLinesToHtml(lines) {
|
|
341
|
+
return lines.map((line) => `<p>${escapeHtml(line)}</p>`).join('');
|
|
342
|
+
}
|
|
275
343
|
|
|
276
344
|
/**
|
|
277
345
|
* Abstract strategy class for filtering default styles in the rich text editor.
|
|
@@ -3074,12 +3142,16 @@ const RTE_BLOCK_BOUNDARY_ATTRIBUTE = 'data-vega-rte-block-boundary';
|
|
|
3074
3142
|
* whether to preserve the original inline styles.
|
|
3075
3143
|
*/
|
|
3076
3144
|
const RTE_PASTE_MODE_DATA_TYPE = 'application/x-vega-rte-paste-mode';
|
|
3145
|
+
/** Marks synthetic plain-paste text whose preserved-whitespace sentinels require decoding. */
|
|
3146
|
+
const RTE_PRESERVED_WHITESPACE_DATA_TYPE = 'application/x-vega-rte-preserved-whitespace';
|
|
3077
3147
|
/**
|
|
3078
3148
|
* Custom DataTransfer MIME type value used to indicate that the paste content
|
|
3079
3149
|
* originated from Microsoft Word.
|
|
3080
3150
|
*/
|
|
3081
3151
|
const RTE_PASTE_MODE_WORD = 'word';
|
|
3082
3152
|
const RTE_WORD_COUNT_KEY = 'rte-word-count';
|
|
3153
|
+
/** Custom paste mode value used to insert clipboard content without formatting. */
|
|
3154
|
+
const RTE_PASTE_MODE_PLAIN = 'plain';
|
|
3083
3155
|
|
|
3084
3156
|
/**
|
|
3085
3157
|
* Annotation to make text with text color
|
|
@@ -6988,6 +7060,8 @@ exports.LinkFilterStylesStrategy = LinkFilterStylesStrategy;
|
|
|
6988
7060
|
exports.ListAnnotation = ListAnnotation;
|
|
6989
7061
|
exports.ModifyContentAction = ModifyContentAction;
|
|
6990
7062
|
exports.NodeAnnotation = NodeAnnotation;
|
|
7063
|
+
exports.PRESERVED_SPACE = PRESERVED_SPACE;
|
|
7064
|
+
exports.PRESERVED_TAB = PRESERVED_TAB;
|
|
6991
7065
|
exports.Predicate = Predicate;
|
|
6992
7066
|
exports.RTEAnnotationStyle = RTEAnnotationStyle;
|
|
6993
7067
|
exports.RTEBlock = RTEBlock;
|
|
@@ -7008,7 +7082,9 @@ exports.RTE_DEFAULT_LINK_TYPE_KEY = RTE_DEFAULT_LINK_TYPE_KEY;
|
|
|
7008
7082
|
exports.RTE_DEFAULT_TEXT_COLOR = RTE_DEFAULT_TEXT_COLOR;
|
|
7009
7083
|
exports.RTE_EMAIL_LINK_TYPE_KEY = RTE_EMAIL_LINK_TYPE_KEY;
|
|
7010
7084
|
exports.RTE_PASTE_MODE_DATA_TYPE = RTE_PASTE_MODE_DATA_TYPE;
|
|
7085
|
+
exports.RTE_PASTE_MODE_PLAIN = RTE_PASTE_MODE_PLAIN;
|
|
7011
7086
|
exports.RTE_PASTE_MODE_WORD = RTE_PASTE_MODE_WORD;
|
|
7087
|
+
exports.RTE_PRESERVED_WHITESPACE_DATA_TYPE = RTE_PRESERVED_WHITESPACE_DATA_TYPE;
|
|
7012
7088
|
exports.RTE_SUPPORTED_LINK_TYPE_KEYS = RTE_SUPPORTED_LINK_TYPE_KEYS;
|
|
7013
7089
|
exports.RTE_TEXT_COLORS = RTE_TEXT_COLORS;
|
|
7014
7090
|
exports.RTE_UPDATE_SOURCE_KEY = RTE_UPDATE_SOURCE_KEY;
|
|
@@ -7039,4 +7115,7 @@ exports.ZERO_WIDTH_SPACE = ZERO_WIDTH_SPACE;
|
|
|
7039
7115
|
exports.createStyleMapFromElement = createStyleMapFromElement;
|
|
7040
7116
|
exports.escapeHtml = escapeHtml;
|
|
7041
7117
|
exports.escapeHtmlAttribute = escapeHtmlAttribute;
|
|
7118
|
+
exports.normalizePlainTextLines = normalizePlainTextLines;
|
|
7119
|
+
exports.plainPasteLinesToHtml = plainPasteLinesToHtml;
|
|
7042
7120
|
exports.stateEntityRenderingRegistry = stateEntityRenderingRegistry;
|
|
7121
|
+
exports.toPlainPasteLines = toPlainPasteLines;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
4
|
-
const codeBlock = require('./code-block-
|
|
4
|
+
const codeBlock = require('./code-block-72de6c4d.js');
|
|
5
5
|
const timer = require('./timer-5f33058b.js');
|
|
6
6
|
const component = require('./component-1e352960.js');
|
|
7
7
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
8
8
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-c82df135.js');
|
|
9
9
|
const vegaInternalEventId = require('./vega-internal-event-id-98d499d7.js');
|
|
10
10
|
const observer = require('./observer-f49483e8.js');
|
|
11
|
-
const range = require('./range-
|
|
11
|
+
const range = require('./range-712fe703.js');
|
|
12
12
|
const autoRunWhenReRenderTaskQueueSlimmer_abstract = require('./auto-run-when-re-render-task-queue-slimmer.abstract-5734634d.js');
|
|
13
13
|
const ui = require('./ui-c91c37a7.js');
|
|
14
|
-
const keyboardManagerSlimmer = require('./keyboard-manager-slimmer-
|
|
14
|
+
const keyboardManagerSlimmer = require('./keyboard-manager-slimmer-a2872981.js');
|
|
15
15
|
|
|
16
16
|
let processing = false;
|
|
17
17
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const codeBlock = require('./code-block-
|
|
3
|
+
const codeBlock = require('./code-block-72de6c4d.js');
|
|
4
4
|
const misc = require('./misc-3d30df91.js');
|
|
5
|
-
const typeGuard = require('./type-guard-
|
|
5
|
+
const typeGuard = require('./type-guard-cce6fe1f.js');
|
|
6
6
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
7
7
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-c82df135.js');
|
|
8
8
|
const vegaInternalEventId = require('./vega-internal-event-id-98d499d7.js');
|
|
@@ -487,8 +487,8 @@ class RTEImageNode extends codeBlock.RTEDecoratorNode {
|
|
|
487
487
|
toHtml(options) {
|
|
488
488
|
const imageAnnotation = this.getAnnotationByType(codeBlock.NodeAnnotationTypeEnum.IMAGE);
|
|
489
489
|
const attrStr = super.generateAttributeString(options, ...[
|
|
490
|
-
imageAnnotation && imageAnnotation.alt ? `alt="${imageAnnotation.alt}"` : null,
|
|
491
|
-
`src="${this.url}"`,
|
|
490
|
+
imageAnnotation && imageAnnotation.alt ? `alt="${codeBlock.escapeHtml(imageAnnotation.alt)}"` : null,
|
|
491
|
+
`src="${codeBlock.escapeHtml(this.url)}"`,
|
|
492
492
|
imageAnnotation && imageAnnotation.size ? `data-size="${imageAnnotation.size}"` : null,
|
|
493
493
|
].filter(typeGuard.isNonNullable));
|
|
494
494
|
return `<img${attrStr}>`;
|
|
@@ -4431,6 +4431,37 @@ class DeleteSelectedContentStrategy extends codeBlock.ActionHandleStrategy {
|
|
|
4431
4431
|
}
|
|
4432
4432
|
}
|
|
4433
4433
|
|
|
4434
|
+
/**
|
|
4435
|
+
* Runs each step of a `SequentialCompositionAction` against its own target. Inner leaf actions stay
|
|
4436
|
+
* non-flushable, so only the outer composition emits the single flush notification. A step can be a
|
|
4437
|
+
* factory that builds its operation(s) at apply time, reading earlier applied actions by their type.
|
|
4438
|
+
*/
|
|
4439
|
+
class SequentialCompositionStrategy extends codeBlock.ActionHandleStrategy {
|
|
4440
|
+
/**
|
|
4441
|
+
* @inheritDoc
|
|
4442
|
+
*/
|
|
4443
|
+
handleAction(action) {
|
|
4444
|
+
const results = new Map();
|
|
4445
|
+
const context = {
|
|
4446
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
4447
|
+
getAction: (type) => results.get(type),
|
|
4448
|
+
};
|
|
4449
|
+
action.steps.forEach((step) => {
|
|
4450
|
+
const produced = typeof step === 'function' ? step(context) : step;
|
|
4451
|
+
if (!produced) {
|
|
4452
|
+
return;
|
|
4453
|
+
}
|
|
4454
|
+
const operations = Array.isArray(produced) ? produced : [produced];
|
|
4455
|
+
operations.forEach((operation) => {
|
|
4456
|
+
// Avoid multiple flush value
|
|
4457
|
+
operation.action.isFlushable = false;
|
|
4458
|
+
operation.target.apply(operation.action);
|
|
4459
|
+
results.set(operation.action.type, operation.action);
|
|
4460
|
+
});
|
|
4461
|
+
});
|
|
4462
|
+
}
|
|
4463
|
+
}
|
|
4464
|
+
|
|
4434
4465
|
/**
|
|
4435
4466
|
* Default commit strategy — the candidate becomes the committed value. Rejection
|
|
4436
4467
|
* is handled exclusively by interceptors that veto the commit by not executing.
|
|
@@ -4607,12 +4638,13 @@ class VegaRTEContent extends discriminated.Discriminated {
|
|
|
4607
4638
|
* @param {ModifyContentAction} action - Modify content action
|
|
4608
4639
|
*/
|
|
4609
4640
|
apply(action) {
|
|
4641
|
+
var _a;
|
|
4610
4642
|
codeBlock.ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
4611
4643
|
// Check if the action has been executed and is flushable
|
|
4612
4644
|
if (action['executedFlag'] && action.isFlushable) {
|
|
4613
4645
|
const host = codeBlock.stateEntityRenderingRegistry.getDOMByEntity(this);
|
|
4614
4646
|
if (host) {
|
|
4615
|
-
changeManager.ChangeManager.notify(domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubject(host, vegaInternalEventId.VegaInternalRichTextEditorFlushChanges), {});
|
|
4647
|
+
changeManager.ChangeManager.notify(domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubject(host, vegaInternalEventId.VegaInternalRichTextEditorFlushChanges), (_a = action.flushPayload) !== null && _a !== void 0 ? _a : {});
|
|
4616
4648
|
}
|
|
4617
4649
|
}
|
|
4618
4650
|
}
|
|
@@ -4718,6 +4750,7 @@ VegaRTEContent.typeName = 'VegaRTEContent';
|
|
|
4718
4750
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.UPDATE_CURSOR_POSITION, VegaRTEContent.typeName, new UpdateCursorPositionStrategy());
|
|
4719
4751
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.DELETE_SELECTED_CONTENT, VegaRTEContent.typeName, new DeleteSelectedContentStrategy());
|
|
4720
4752
|
codeBlock.ActionHandleStrategyRegistry.register(COMMIT_VALUE, VegaRTEContent.typeName, new CommitValueStrategy());
|
|
4753
|
+
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.SEQUENTIAL_COMPOSITION, VegaRTEContent.typeName, new SequentialCompositionStrategy());
|
|
4721
4754
|
})();
|
|
4722
4755
|
|
|
4723
4756
|
exports.AnnotationGeneratorStrategyAbstract = AnnotationGeneratorStrategyAbstract;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const typeGuard = require('./type-guard-
|
|
3
|
+
const typeGuard = require('./type-guard-cce6fe1f.js');
|
|
4
4
|
const breakpoints = require('./breakpoints-ebde4837.js');
|
|
5
5
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
6
|
-
const responsiveFormatFacade = require('./responsive-format-facade-
|
|
6
|
+
const responsiveFormatFacade = require('./responsive-format-facade-44d33457.js');
|
|
7
7
|
const typography = require('./typography-3ea4fe41.js');
|
|
8
|
-
const stateBorderFormatter = require('./state-border-formatter-
|
|
8
|
+
const stateBorderFormatter = require('./state-border-formatter-49984fd6.js');
|
|
9
9
|
const ui = require('./ui-32120990.js');
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/cjs/{element-appender-slimmer-f932b166.js → element-appender-slimmer-b93cc564.js}
RENAMED
|
@@ -6,8 +6,8 @@ const internalVegaZIndexManager = require('./internal-vega-z-index-manager-f03dd
|
|
|
6
6
|
const dynamicSlimmer = require('./dynamic-slimmer-f31fdfd7.js');
|
|
7
7
|
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-273d62ef.js');
|
|
8
8
|
const ui$1 = require('./ui-32120990.js');
|
|
9
|
-
const typeGuard = require('./type-guard-
|
|
10
|
-
const responsiveFormatFacade = require('./responsive-format-facade-
|
|
9
|
+
const typeGuard = require('./type-guard-cce6fe1f.js');
|
|
10
|
+
const responsiveFormatFacade = require('./responsive-format-facade-44d33457.js');
|
|
11
11
|
const tryGetDocument = require('./try-get-document-c0ebd39a.js');
|
|
12
12
|
const featureFlagController = require('./feature-flag-controller-c19d0b58.js');
|
|
13
13
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
@@ -10,7 +10,7 @@ const misc = require('./misc-3d30df91.js');
|
|
|
10
10
|
const dynamicSlimmer = require('./dynamic-slimmer-f31fdfd7.js');
|
|
11
11
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-c82df135.js');
|
|
12
12
|
const vegaInternalEventId = require('./vega-internal-event-id-98d499d7.js');
|
|
13
|
-
const internalTranslationController = require('./internal-translation-controller-
|
|
13
|
+
const internalTranslationController = require('./internal-translation-controller-0d67ca4d.js');
|
|
14
14
|
const index = require('./index-5d1adcd1.js');
|
|
15
15
|
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-273d62ef.js');
|
|
16
16
|
const internalFormFieldValidationRule_abstract = require('./internal-form-field-validation-rule.abstract-07cdff46.js');
|
package/dist/cjs/{image-annotation-action-25907d6b.js → image-annotation-action-1ee41bc7.js}
RENAMED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
const index = require('./index-58ea899e.js');
|
|
4
4
|
const internalIconManager = require('./internal-icon-manager-b9702049.js');
|
|
5
5
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
6
|
-
const codeBlock = require('./code-block-
|
|
6
|
+
const codeBlock = require('./code-block-72de6c4d.js');
|
|
7
7
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-c82df135.js');
|
|
8
8
|
const vegaEventId = require('./vega-event-id-b5abf7c9.js');
|
|
9
9
|
const darkModeStyleController = require('./dark-mode-style-controller-ec04ece9.js');
|
|
10
|
-
const contentState = require('./content-state-
|
|
10
|
+
const contentState = require('./content-state-ff40bdc6.js');
|
|
11
11
|
|
|
12
12
|
const text = {
|
|
13
13
|
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M64 96v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V80C0 53.5 21.5 32 48 32H224 400c26.5 0 48 21.5 48 48v48c0 17.7-14.3 32-32 32s-32-14.3-32-32V96H256l0 320h48c17.7 0 32 14.3 32 32s-14.3 32-32 32H144c-17.7 0-32-14.3-32-32s14.3-32 32-32h48l0-320H64z"/></svg>`,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const codeBlock = require('./code-block-
|
|
4
|
-
const linkExtension = require('./link-extension-
|
|
3
|
+
const codeBlock = require('./code-block-72de6c4d.js');
|
|
4
|
+
const linkExtension = require('./link-extension-1b4ed437.js');
|
|
5
5
|
const misc = require('./misc-3d30df91.js');
|
|
6
|
-
const contentState = require('./content-state-
|
|
6
|
+
const contentState = require('./content-state-ff40bdc6.js');
|
|
7
7
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-c82df135.js');
|
|
8
8
|
const vegaEventId = require('./vega-event-id-b5abf7c9.js');
|
|
9
|
-
const internalTranslationController = require('./internal-translation-controller-
|
|
9
|
+
const internalTranslationController = require('./internal-translation-controller-0d67ca4d.js');
|
|
10
10
|
const accessibility = require('./accessibility-6ca2a237.js');
|
|
11
11
|
const timer = require('./timer-5f33058b.js');
|
|
12
12
|
const tryGetDocument = require('./try-get-document-c0ebd39a.js');
|
|
13
13
|
const internalIconManager = require('./internal-icon-manager-b9702049.js');
|
|
14
|
-
const typeGuard = require('./type-guard-
|
|
14
|
+
const typeGuard = require('./type-guard-cce6fe1f.js');
|
|
15
15
|
const vegaNonceManager = require('./vega-nonce-manager-df69d3ed.js');
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -1165,6 +1165,246 @@ class ReplaceSelectedTextAction extends codeBlock.ModifyContentAction {
|
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
1167
|
|
|
1168
|
+
/**
|
|
1169
|
+
* Block-level HTML tags that introduce a visible line break when converting
|
|
1170
|
+
* HTML to plain text. Hard-coded because this is HTML spec knowledge that
|
|
1171
|
+
* cannot be derived at runtime and must be kept in sync with the spec.
|
|
1172
|
+
*
|
|
1173
|
+
* Trade-off: this is a blocklist, so unknown/custom elements default to inline.
|
|
1174
|
+
* That is acceptable for this plain-text fallback (clipboard HTML rarely
|
|
1175
|
+
* contains custom block elements); an inline allowlist would be more robust
|
|
1176
|
+
* but is unnecessary here.
|
|
1177
|
+
*
|
|
1178
|
+
* @see https://developer.mozilla.org/docs/Glossary/Block-level_content
|
|
1179
|
+
*/
|
|
1180
|
+
const BLOCK_LEVEL_TAGS = new Set([
|
|
1181
|
+
'address',
|
|
1182
|
+
'article',
|
|
1183
|
+
'aside',
|
|
1184
|
+
'blockquote',
|
|
1185
|
+
'dd',
|
|
1186
|
+
'details',
|
|
1187
|
+
'dialog',
|
|
1188
|
+
'div',
|
|
1189
|
+
'dl',
|
|
1190
|
+
'dt',
|
|
1191
|
+
'figure',
|
|
1192
|
+
'footer',
|
|
1193
|
+
'form',
|
|
1194
|
+
'h1',
|
|
1195
|
+
'h2',
|
|
1196
|
+
'h3',
|
|
1197
|
+
'h4',
|
|
1198
|
+
'h5',
|
|
1199
|
+
'h6',
|
|
1200
|
+
'header',
|
|
1201
|
+
'hr',
|
|
1202
|
+
'li',
|
|
1203
|
+
'main',
|
|
1204
|
+
'nav',
|
|
1205
|
+
'ol',
|
|
1206
|
+
'p',
|
|
1207
|
+
'pre',
|
|
1208
|
+
'section',
|
|
1209
|
+
'table',
|
|
1210
|
+
'tbody',
|
|
1211
|
+
'tfoot',
|
|
1212
|
+
'thead',
|
|
1213
|
+
'tr',
|
|
1214
|
+
'ul',
|
|
1215
|
+
]);
|
|
1216
|
+
/**
|
|
1217
|
+
* Inline `display` values that turn a nominally inline tag into a visual block-level box
|
|
1218
|
+
* (e.g. Jira/Confluence code lines: `<span style="display: flex; white-space: pre-wrap;">`).
|
|
1219
|
+
*/
|
|
1220
|
+
const BLOCK_LIKE_DISPLAY_VALUES = new Set([
|
|
1221
|
+
'block',
|
|
1222
|
+
'flex',
|
|
1223
|
+
'grid',
|
|
1224
|
+
'table',
|
|
1225
|
+
'list-item',
|
|
1226
|
+
'flow-root',
|
|
1227
|
+
]);
|
|
1228
|
+
/**
|
|
1229
|
+
* @param {Element} el Candidate element.
|
|
1230
|
+
* @returns {boolean} Whether the element's inline `style="display: ..."` puts it in the block flow.
|
|
1231
|
+
*/
|
|
1232
|
+
function hasBlockLikeInlineDisplay(el) {
|
|
1233
|
+
const inlineStyle = el.style;
|
|
1234
|
+
if (!inlineStyle) {
|
|
1235
|
+
return false;
|
|
1236
|
+
}
|
|
1237
|
+
return BLOCK_LIKE_DISPLAY_VALUES.has(inlineStyle.display);
|
|
1238
|
+
}
|
|
1239
|
+
// `pre-line` intentionally excluded: it keeps `\n` but collapses spaces/tabs.
|
|
1240
|
+
const WHITESPACE_PRESERVING_VALUES = new Set(['pre', 'pre-wrap', 'break-spaces']);
|
|
1241
|
+
/**
|
|
1242
|
+
* @param {Element} el Candidate element.
|
|
1243
|
+
* @returns {boolean} Whether the element's inline `style="white-space: ..."` preserves source whitespace.
|
|
1244
|
+
*/
|
|
1245
|
+
function preservesWhitespaceInlineStyle(el) {
|
|
1246
|
+
const inlineStyle = el.style;
|
|
1247
|
+
if (!inlineStyle) {
|
|
1248
|
+
return false;
|
|
1249
|
+
}
|
|
1250
|
+
return WHITESPACE_PRESERVING_VALUES.has(inlineStyle.whiteSpace);
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Resolves the preformatted text of a code-block element, or `null` when the element is not a
|
|
1254
|
+
* code block. A Vega code block serializes to `<vega-code-block data-content data-language>` whose
|
|
1255
|
+
* `data-content` attribute is the authoritative source (its shadow-DOM `<code>` may be empty in some
|
|
1256
|
+
* browsers); external editors emit `<pre>`/`<code data-language>` whose `textContent` carries the
|
|
1257
|
+
* code. Both keep their newlines/indentation so plain paste renders one paragraph per line.
|
|
1258
|
+
*
|
|
1259
|
+
* @param {Element} el Candidate element.
|
|
1260
|
+
* @returns {string | null} Code text with line breaks preserved, or `null` when not a code block.
|
|
1261
|
+
*/
|
|
1262
|
+
function resolveCodeBlockText(el) {
|
|
1263
|
+
var _a, _b, _c;
|
|
1264
|
+
const tagName = el.tagName.toLowerCase();
|
|
1265
|
+
if (tagName === 'vega-code-block') {
|
|
1266
|
+
return (_b = (_a = el.getAttribute('data-content')) !== null && _a !== void 0 ? _a : el.textContent) !== null && _b !== void 0 ? _b : '';
|
|
1267
|
+
}
|
|
1268
|
+
if ((tagName === 'pre' || tagName === 'code') && el.hasAttribute('data-language')) {
|
|
1269
|
+
return (_c = el.textContent) !== null && _c !== void 0 ? _c : '';
|
|
1270
|
+
}
|
|
1271
|
+
return null;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Recursively builds text content, inserting `\n` at block-level element and `<br>` boundaries.
|
|
1275
|
+
*
|
|
1276
|
+
* @param {Node} node DOM node to extract text from.
|
|
1277
|
+
* @param {boolean} preserveWhitespace Whether whitespace should be retained for preformatted content.
|
|
1278
|
+
* @param {boolean} preserveNewlines Keep literal `\n` in text nodes as line breaks (used inside table
|
|
1279
|
+
* cells, where a Vega line break is a text node rendered as `<span>\n</span>` rather than a `<br>`).
|
|
1280
|
+
* @returns {string} Extracted text with line breaks preserved.
|
|
1281
|
+
*/
|
|
1282
|
+
function extractBlockAwareText(node, preserveWhitespace, preserveNewlines = false) {
|
|
1283
|
+
let text = '';
|
|
1284
|
+
node.childNodes.forEach((child) => {
|
|
1285
|
+
var _a, _b, _c;
|
|
1286
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
1287
|
+
const textContent = (_a = child.textContent) !== null && _a !== void 0 ? _a : '';
|
|
1288
|
+
if (preserveWhitespace) {
|
|
1289
|
+
text += textContent.replace(/ /g, codeBlock.PRESERVED_SPACE).replace(/\t/g, codeBlock.PRESERVED_TAB);
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
const parentElement = child.parentElement;
|
|
1293
|
+
const hasBlockChild = Array.from((_b = parentElement === null || parentElement === void 0 ? void 0 : parentElement.children) !== null && _b !== void 0 ? _b : []).some((element) => BLOCK_LEVEL_TAGS.has(element.tagName.toLowerCase()));
|
|
1294
|
+
if (!/\S/.test(textContent) && hasBlockChild) {
|
|
1295
|
+
return;
|
|
1296
|
+
}
|
|
1297
|
+
// Collapse only whitespace runs that cross a markup newline (source-format indentation
|
|
1298
|
+
// between tags); real space/tab runs inside a text node are user content and stay verbatim.
|
|
1299
|
+
// Inside a cell (preserveNewlines) the collapse keeps the newline as-is.
|
|
1300
|
+
text += textContent.replace(preserveNewlines ? /[^\S\u00A0\n]*\n[^\S\u00A0\n]*/g : /[^\S\u00A0]*\n[^\S\u00A0]*/g, preserveNewlines ? '\n' : ' ');
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
if (child.nodeType !== Node.ELEMENT_NODE) {
|
|
1304
|
+
return;
|
|
1305
|
+
}
|
|
1306
|
+
const el = child;
|
|
1307
|
+
const tagName = el.tagName.toLowerCase();
|
|
1308
|
+
if (tagName === 'br') {
|
|
1309
|
+
text += '\n';
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1312
|
+
if (tagName === 'img') {
|
|
1313
|
+
text += (_c = el.getAttribute('alt')) !== null && _c !== void 0 ? _c : '';
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
// Code blocks keep their newlines/indentation verbatim so each line becomes its own
|
|
1317
|
+
// paragraph on plain paste, instead of collapsing to a single line.
|
|
1318
|
+
const codeBlockText = resolveCodeBlockText(el);
|
|
1319
|
+
if (codeBlockText !== null) {
|
|
1320
|
+
const preservedCode = codeBlockText
|
|
1321
|
+
.replace(/ /g, codeBlock.PRESERVED_SPACE)
|
|
1322
|
+
.replace(/\t/g, codeBlock.PRESERVED_TAB);
|
|
1323
|
+
if (text !== '' && !text.endsWith('\n')) {
|
|
1324
|
+
text += '\n';
|
|
1325
|
+
}
|
|
1326
|
+
text += preservedCode;
|
|
1327
|
+
if (preservedCode === '' || !text.endsWith('\n')) {
|
|
1328
|
+
text += '\n';
|
|
1329
|
+
}
|
|
1330
|
+
return;
|
|
1331
|
+
}
|
|
1332
|
+
if (BLOCK_LEVEL_TAGS.has(tagName) || hasBlockLikeInlineDisplay(el)) {
|
|
1333
|
+
const blockText = extractBlockAwareText(el, preserveWhitespace || tagName === 'pre', preserveNewlines);
|
|
1334
|
+
// Empty list items and empty structural `div`s (ProseMirror table scaffolding: sticky
|
|
1335
|
+
// sentinels, row-control wrappers, borders) are artifacts, not intentional blank lines, so
|
|
1336
|
+
// skip them. Keep meaningful empty blocks: break-only div and div containing an image but
|
|
1337
|
+
// no extractable text. Empty `<p>`/headings still keep their blank line via the logic below.
|
|
1338
|
+
if ((tagName === 'li' && blockText.trim() === '') ||
|
|
1339
|
+
(tagName === 'div' && blockText === '' && el.querySelector('img') === null)) {
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
if (text !== '' && !text.endsWith('\n')) {
|
|
1343
|
+
text += '\n';
|
|
1344
|
+
}
|
|
1345
|
+
text += blockText;
|
|
1346
|
+
if (blockText === '' || !text.endsWith('\n')) {
|
|
1347
|
+
text += '\n';
|
|
1348
|
+
}
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1351
|
+
// Put each cell on its own line while keeping the cell's own blank lines (empty
|
|
1352
|
+
// paragraphs and Vega text-node line breaks); tabs inside a cell collapse to a space so
|
|
1353
|
+
// they don't look like columns.
|
|
1354
|
+
if (tagName === 'td' || tagName === 'th') {
|
|
1355
|
+
const cellText = extractBlockAwareText(el, preserveWhitespace, true)
|
|
1356
|
+
.replace(/\t+/g, ' ')
|
|
1357
|
+
.replace(/^\n+|\n+$/g, '');
|
|
1358
|
+
text += `${cellText}\n`;
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1361
|
+
text += extractBlockAwareText(el, preserveWhitespace || tagName === 'pre', preserveNewlines || preservesWhitespaceInlineStyle(el));
|
|
1362
|
+
});
|
|
1363
|
+
return text;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Converts HTML to plain text, preserving line breaks introduced by block-level elements and `<br>`.
|
|
1367
|
+
* Used as a fallback when clipboard data lacks a `text/plain` payload, so structural breaks
|
|
1368
|
+
* (e.g. `<h1>Heading</h1><p>Body</p>`) survive as `Heading\nBody` instead of being flattened.
|
|
1369
|
+
*
|
|
1370
|
+
* @param {string} html HTML content to convert.
|
|
1371
|
+
* @param {HtmlToPlainTextOptions} options Plain-text conversion options.
|
|
1372
|
+
* @returns {string} Block-aware plain text with normalized `\n` line endings.
|
|
1373
|
+
*/
|
|
1374
|
+
function htmlToPlainText(html, options = {}) {
|
|
1375
|
+
if (!html) {
|
|
1376
|
+
return '';
|
|
1377
|
+
}
|
|
1378
|
+
const parsed = new DOMParser().parseFromString(html, 'text/html');
|
|
1379
|
+
if (!parsed.body) {
|
|
1380
|
+
return '';
|
|
1381
|
+
}
|
|
1382
|
+
// Per-paragraph trim: sentinels (`\u0001`/`\u0002`) are not in `\s`, so code-block indentation
|
|
1383
|
+
// emitted by the preservation branch survives; NBSP is in `\s`, so noise from non-code sources is dropped.
|
|
1384
|
+
const normalizedText = codeBlock.normalizePlainTextLines(extractBlockAwareText(parsed.body, false))
|
|
1385
|
+
.map((line) => line.trim())
|
|
1386
|
+
.join('\n');
|
|
1387
|
+
const textWithoutStructuralBreak = options.preserveBoundaryBlankLines
|
|
1388
|
+
? normalizedText.replace(/\n$/, '')
|
|
1389
|
+
: normalizedText.replace(/^\n+|\n+$/g, '');
|
|
1390
|
+
if (options.keepPreservedWhitespaceMarkers) {
|
|
1391
|
+
return textWithoutStructuralBreak;
|
|
1392
|
+
}
|
|
1393
|
+
return textWithoutStructuralBreak.split(codeBlock.PRESERVED_SPACE).join(' ').split(codeBlock.PRESERVED_TAB).join('\t');
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Detects whether the clipboard HTML contains a table anywhere. Plain paste uses this together
|
|
1397
|
+
* with a tab check on `text/plain`: a tab-separated `text/plain` only reflects a table's row/
|
|
1398
|
+
* column layout when the clipboard actually has a table, so that combination is pasted from
|
|
1399
|
+
* `text/plain` verbatim (its line breaks are trusted as-is), regardless of any surrounding content.
|
|
1400
|
+
*
|
|
1401
|
+
* @param {string} html HTML content to inspect.
|
|
1402
|
+
* @returns {boolean} Whether the HTML contains a table.
|
|
1403
|
+
*/
|
|
1404
|
+
function htmlContainsTable(html) {
|
|
1405
|
+
return /<table[\s/>]/i.test(html);
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1168
1408
|
/**
|
|
1169
1409
|
* Rich Text Editor extension that configures built-in image behavior.
|
|
1170
1410
|
*/
|
|
@@ -1207,3 +1447,5 @@ exports.VegaRTEImageExtension = VegaRTEImageExtension;
|
|
|
1207
1447
|
exports.VegaRTEToolbarButtonRenderer = VegaRTEToolbarButtonRenderer;
|
|
1208
1448
|
exports.bookmarkIcon = bookmarkIcon;
|
|
1209
1449
|
exports.collectBookmarkNames = collectBookmarkNames;
|
|
1450
|
+
exports.htmlContainsTable = htmlContainsTable;
|
|
1451
|
+
exports.htmlToPlainText = htmlToPlainText;
|