@globalpayments/vega 2.92.0 → 2.93.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-2f326662.js → app-globals-f7ad9275.js} +13 -9
- package/dist/cjs/{child-nodes-event-prevent-slimmer-b9a5b3e2.js → child-nodes-event-prevent-slimmer-e67ee84c.js} +1 -1
- package/dist/cjs/{code-block-6435d641.js → code-block-2f3d0f38.js} +41 -11
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-e4c9a5ba.js → component-value-history-controller-slimmer.abstract-31d2c7aa.js} +72 -39
- package/dist/cjs/{content-state-96ec9114.js → content-state-13daf87a.js} +61 -7
- package/dist/cjs/{date-required-rule-8c9e312b.js → date-required-rule-e65ddd7d.js} +1 -1
- package/dist/cjs/{design-token-3548af29.js → design-token-47393cbb.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-3bf69990.js → element-appender-slimmer-29c4ac60.js} +17 -8
- package/dist/cjs/{event-emit-slimmer-5bab10c2.js → event-emit-slimmer-d234a619.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-e0efac05.js → form-field-controller-slimmer-3bfcf88c.js} +1 -1
- package/dist/cjs/{image-annotation-action-853f72c8.js → image-annotation-action-c2b163bb.js} +3 -3
- package/dist/cjs/image-extension-4e99b620.js +39 -0
- package/dist/cjs/index.cjs.js +22 -19
- package/dist/cjs/{inject-keyboard-manager-0dccff1a.js → inject-keyboard-manager-4b2ebbe4.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-6187ec4c.js → internal-calendar-period-factory-7a0ecdb1.js} +1 -1
- package/dist/cjs/{internal-translation-controller-48ebfd0f.js → internal-translation-controller-31f2b057.js} +4 -0
- package/dist/cjs/{internal-vega-event-manager-7196a847.js → internal-vega-event-manager-13c4012b.js} +2 -1
- package/dist/cjs/{keyboard-manager-dfe8d924.js → keyboard-manager-c78b46bd.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-4a2560a1.js → keyboard-manager-slimmer-d350c931.js} +1 -1
- package/dist/cjs/{link-extension-28d95849.js → link-extension-455c02b3.js} +3 -3
- package/dist/cjs/loader.cjs.js +15 -14
- package/dist/cjs/{month-view-generator-2e59b188.js → month-view-generator-006562dc.js} +1 -1
- package/dist/cjs/{public-rules-8727c42c.js → public-rules-c59eba88.js} +7 -7
- package/dist/cjs/{range-5cb3d1e4.js → range-bf80fa40.js} +1 -1
- package/dist/cjs/{replace-selected-text-action-a31563ed.js → replace-selected-text-action-a80f5a6a.js} +1 -1
- package/dist/cjs/{responsive-format-facade-98b89142.js → responsive-format-facade-1af54330.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-8e4d577d.js → rich-text-editor-required-rule-1085c71a.js} +1 -1
- package/dist/cjs/{split-cell-operation-9e3ab88d.js → split-cell-operation-2fa5c9e4.js} +3 -3
- package/dist/cjs/{state-border-formatter-626b0a14.js → state-border-formatter-501f6645.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-981f43e1.js → string-format-strategy.abstract-a02bf002.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-fc4a0ba5.js → string-input-formatter-slimmer-9cca6151.js} +1 -1
- package/dist/cjs/{string-mask-strategy-b47fa159.js → string-mask-strategy-4c174ebf.js} +2 -2
- package/dist/cjs/{style-formatter-baf18624.js → style-formatter-2c749500.js} +2 -2
- package/dist/cjs/{time-required-rule-e77d174f.js → time-required-rule-04994a5e.js} +1 -1
- package/dist/cjs/{token-extension-3aec039f.js → token-extension-d217914d.js} +1300 -14
- package/dist/cjs/{translation-slimmer-1e05769e.js → translation-slimmer-7fb6e94c.js} +1 -1
- package/dist/cjs/{type-guard-7ab48d6c.js → type-guard-1c3770d4.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-52ba9c67.js → valid-credit-card-number-rule-f719a8c6.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +9 -9
- package/dist/cjs/vega-app-footer.cjs.entry.js +3 -3
- package/dist/cjs/vega-app-header-button.cjs.entry.js +9 -9
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +9 -9
- package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +7 -7
- package/dist/cjs/vega-calendar_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +6 -6
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-chip.cjs.entry.js +9 -9
- package/dist/cjs/vega-code-block.cjs.entry.js +12 -12
- package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +7 -7
- package/dist/cjs/vega-color-swatch.cjs.entry.js +5 -5
- package/dist/cjs/vega-combo-box.cjs.entry.js +19 -13
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +17 -17
- package/dist/cjs/vega-dialog_2.cjs.entry.js +20 -9
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +693 -195
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-df22d80e.js → vega-event-id-58afed7a.js} +2 -0
- package/dist/cjs/vega-field-label.cjs.entry.js +5 -5
- package/dist/cjs/vega-file-uploader.cjs.entry.js +6 -6
- 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 +7 -7
- 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 +9 -9
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-numeric.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-passcode.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +9 -9
- package/dist/cjs/vega-input.cjs.entry.js +9 -9
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +10 -10
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +8 -8
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +7 -7
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +472 -62
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +4 -4
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +8 -8
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +11 -11
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +6 -6
- package/dist/cjs/vega-signature-capture.cjs.entry.js +10 -10
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +911 -428
- package/dist/cjs/vega-textarea.cjs.entry.js +7 -9
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +34 -14
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +15 -14
- package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +4 -1
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +7 -1
- package/dist/collection/components/vega-dialog/vega-dialog.js +1 -1
- package/dist/collection/components/vega-dropdown/constants.js +1 -0
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.js +9 -0
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-children-controller.js +97 -4
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-select-all-controller.js +219 -0
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-selected-controller.js +78 -13
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-source-controller.js +13 -1
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +7 -0
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/controllers/vega-dropdown-item-state-controller.js +52 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +4 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.js +5 -0
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +126 -1
- package/dist/collection/components/vega-field-label/vega-field-label.js +1 -1
- package/dist/collection/components/vega-hint/vega-hint.js +1 -1
- package/dist/collection/components/vega-modal/slimmers/renderers/vega-modal-renderer.js +4 -1
- package/dist/collection/components/vega-modal/vega-modal.css +0 -1
- package/dist/collection/components/vega-modal/vega-modal.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/assets/redo.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/assets/undo.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-strategy.js +11 -5
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-text-node-strategy.js +9 -4
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/paste-content-strategy.js +61 -5
- package/dist/collection/components/vega-rich-text-editor/dto/actions/paste-content-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +6 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/action-handler-interceptors/blockquote-exit-on-enter-interceptor.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/action-handler-strategies/block-transform-to-blockquote-strategy.js +40 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/action-handler-strategies/remove-blockquote-strategy.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/actions/remove-blockquote-action.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/actions/transform-to-blockquote-action.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/assets/quote-left.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/blockquote-extension.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/dto/blockquote-annotation.js +76 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/dto/rte-blockquote-block.js +70 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/element-to-dto-strategies/blockquote-to-blockquote-block-strategy.js +53 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/filter-styles-strategies/blockquote-block/blockquote-filter-styles-strategy.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/renderers/blockquote-block-renderer.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/renderers/blockquote-toolbar-button-renderer.js +260 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/image/image-extension.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/image/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/assets/paste.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.js +144 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-constants.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-extension.js +442 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +4 -3
- package/dist/collection/components/vega-rich-text-editor/helpers/utils.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/public-api.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +385 -25
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +69 -36
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +59 -14
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.js +6 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.js +28 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.js +1 -1
- package/dist/collection/components/vega-table/slimmers/controllers/dto/column-render-input-model.js +32 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-body-col-span-controller.js +77 -0
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-body-col-span-resolver.js +121 -0
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-cell-renderer.js +39 -14
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +207 -7
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-row-renderer.js +16 -3
- package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.js +24 -4
- package/dist/collection/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-col-span-controller.js +11 -2
- package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +5 -1
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.js +22 -1
- package/dist/collection/components/vega-table/vega-table.css +5 -0
- package/dist/collection/components/vega-table/vega-table.js +5 -0
- package/dist/collection/components/vega-text/vega-text.js +1 -1
- package/dist/collection/components/vega-textarea/vega-textarea.js +1 -3
- package/dist/collection/components/vega-time-picker/slimmers/controllers/vega-time-picker-range-dropdown-controller.js +4 -0
- package/dist/collection/components/vega-time-picker/slimmers/controllers/vega-time-picker-single-dropdown-controller.js +4 -0
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +39 -0
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/scripts/before-vega-load.js +6 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -1
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +11 -4
- package/dist/collection/helpers/translation/locales/en.js +4 -0
- package/dist/collection/helpers/ui/element-appender.js +5 -2
- package/dist/esm/{app-globals-5e0d319a.js → app-globals-9950d055.js} +13 -9
- package/dist/esm/{child-nodes-event-prevent-slimmer-f24618c5.js → child-nodes-event-prevent-slimmer-96c14f5a.js} +1 -1
- package/dist/esm/{code-block-b71b2aa4.js → code-block-ae2337c2.js} +41 -12
- package/dist/esm/{component-value-history-controller-slimmer.abstract-282df6e5.js → component-value-history-controller-slimmer.abstract-b1ee1b8e.js} +72 -39
- package/dist/esm/{content-state-909099f8.js → content-state-c3b85ae6.js} +61 -7
- package/dist/esm/{date-required-rule-15edb04a.js → date-required-rule-e06115f8.js} +1 -1
- package/dist/esm/{design-token-cb5ed6b9.js → design-token-4e682056.js} +3 -3
- package/dist/esm/{element-appender-slimmer-e41120ee.js → element-appender-slimmer-a4485ef6.js} +17 -8
- package/dist/esm/{event-emit-slimmer-03deba18.js → event-emit-slimmer-db4a82e0.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-cfe1d8a7.js → form-field-controller-slimmer-a1c7b28c.js} +1 -1
- package/dist/esm/{image-annotation-action-98232dc4.js → image-annotation-action-4c77d314.js} +3 -3
- package/dist/esm/image-extension-7108c27d.js +37 -0
- package/dist/esm/index.js +19 -19
- package/dist/esm/{inject-keyboard-manager-13cc77ab.js → inject-keyboard-manager-e8ddb78d.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-c3d70f3b.js → internal-calendar-period-factory-6f19d767.js} +1 -1
- package/dist/esm/{internal-translation-controller-8e8a514a.js → internal-translation-controller-09b8bd13.js} +4 -0
- package/dist/esm/{internal-vega-event-manager-75e5e3bb.js → internal-vega-event-manager-48690e5b.js} +2 -1
- package/dist/esm/{keyboard-manager-fe885db1.js → keyboard-manager-ec18721b.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-61d4c79b.js → keyboard-manager-slimmer-531ddb0e.js} +1 -1
- package/dist/esm/{link-extension-f1a3bea7.js → link-extension-74eaa826.js} +3 -3
- package/dist/esm/loader.js +15 -14
- package/dist/esm/{month-view-generator-85eecb95.js → month-view-generator-afd78ff8.js} +1 -1
- package/dist/esm/{public-rules-323bea4b.js → public-rules-5fce32a5.js} +7 -7
- package/dist/esm/{range-e63068d1.js → range-8f877dbf.js} +1 -1
- package/dist/esm/{replace-selected-text-action-c0817b2b.js → replace-selected-text-action-c9278a0f.js} +1 -1
- package/dist/esm/{responsive-format-facade-fb424f5b.js → responsive-format-facade-299e6304.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-0edb8ba7.js → rich-text-editor-required-rule-3047bab0.js} +1 -1
- package/dist/esm/{split-cell-operation-93b4d775.js → split-cell-operation-98d58410.js} +3 -3
- package/dist/esm/{state-border-formatter-1a528ca4.js → state-border-formatter-da52b626.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-72fc98aa.js → string-format-strategy.abstract-a45b5ff7.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-b0c480d8.js → string-input-formatter-slimmer-4a032fed.js} +1 -1
- package/dist/esm/{string-mask-strategy-4e00c173.js → string-mask-strategy-37e53e48.js} +2 -2
- package/dist/esm/{style-formatter-5c1bea8d.js → style-formatter-3d5ddfb1.js} +2 -2
- package/dist/esm/{time-required-rule-df500b14.js → time-required-rule-355b73d2.js} +1 -1
- package/dist/esm/{token-extension-32d1fa56.js → token-extension-ecfafe94.js} +1298 -15
- package/dist/esm/{translation-slimmer-60408f13.js → translation-slimmer-3ea56354.js} +1 -1
- package/dist/esm/{type-guard-91087018.js → type-guard-2bfb2c7b.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-681ecb75.js → valid-credit-card-number-rule-52c6b029.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +9 -9
- package/dist/esm/vega-app-footer.entry.js +3 -3
- package/dist/esm/vega-app-header-button.entry.js +9 -9
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +9 -9
- package/dist/esm/vega-button-group_2.entry.js +4 -4
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +7 -7
- package/dist/esm/vega-calendar_5.entry.js +11 -11
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +6 -6
- package/dist/esm/vega-checkbox_2.entry.js +6 -6
- package/dist/esm/vega-chip.entry.js +9 -9
- package/dist/esm/vega-code-block.entry.js +12 -12
- package/dist/esm/vega-color-picker.entry.js +5 -5
- package/dist/esm/vega-color-swatch-picker.entry.js +7 -7
- package/dist/esm/vega-color-swatch.entry.js +5 -5
- package/dist/esm/vega-combo-box.entry.js +19 -13
- package/dist/esm/vega-date-picker_2.entry.js +17 -17
- package/dist/esm/vega-dialog_2.entry.js +20 -9
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +695 -197
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-d3017041.js → vega-event-id-270fe47e.js} +2 -1
- package/dist/esm/vega-field-label.entry.js +5 -5
- package/dist/esm/vega-file-uploader.entry.js +6 -6
- 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 +7 -7
- 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 +9 -9
- package/dist/esm/vega-input-credit-card.entry.js +10 -10
- package/dist/esm/vega-input-numeric.entry.js +9 -9
- package/dist/esm/vega-input-passcode.entry.js +9 -9
- package/dist/esm/vega-input-phone-number.entry.js +8 -8
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +9 -9
- package/dist/esm/vega-input.entry.js +9 -9
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +10 -10
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination.entry.js +8 -8
- package/dist/esm/vega-popover_2.entry.js +11 -11
- package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +9 -9
- package/dist/esm/vega-rich-text-content.entry.js +7 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +472 -62
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +4 -4
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +8 -8
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +11 -11
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +6 -6
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +10 -10
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +911 -428
- package/dist/esm/vega-textarea.entry.js +7 -9
- package/dist/esm/vega-time-picker_2.entry.js +34 -14
- package/dist/esm/vega-toggle-switch.entry.js +5 -5
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +15 -14
- package/dist/sri/vega-sri-manifest.json +362 -358
- package/dist/types/components/vega-combo-box/types.d.ts +6 -1
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +1 -0
- package/dist/types/components/vega-dropdown/constants.d.ts +1 -0
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.d.ts +2 -0
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-children-controller.d.ts +36 -0
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-select-all-controller.d.ts +107 -0
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-selected-controller.d.ts +17 -0
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-source-controller.d.ts +5 -0
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.d.ts +2 -0
- package/dist/types/components/vega-dropdown/types.d.ts +8 -0
- package/dist/types/components/vega-dropdown/vega-dropdown-item/slimmers/controllers/vega-dropdown-item-state-controller.d.ts +25 -0
- package/dist/types/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.d.ts +4 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +48 -0
- package/dist/types/components/vega-modal/slimmers/renderers/vega-modal-renderer.d.ts +2 -1
- package/dist/types/components/vega-modal/vega-modal.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/paste-content-strategy.d.ts +14 -4
- package/dist/types/components/vega-rich-text-editor/dto/actions/paste-content-action.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/action-handler-interceptors/blockquote-exit-on-enter-interceptor.d.ts +34 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/action-handler-strategies/block-transform-to-blockquote-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/action-handler-strategies/remove-blockquote-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/actions/remove-blockquote-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/actions/transform-to-blockquote-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/assets/quote-left.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/blockquote-extension.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/dto/blockquote-annotation.d.ts +48 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/dto/rte-blockquote-block.d.ts +56 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/element-to-dto-strategies/blockquote-to-blockquote-block-strategy.d.ts +35 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/filter-styles-strategies/blockquote-block/blockquote-filter-styles-strategy.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/renderers/blockquote-block-renderer.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/renderers/blockquote-toolbar-button-renderer.d.ts +113 -0
- package/dist/types/components/vega-rich-text-editor/extensions/image/image-extension.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/image/type.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/assets/paste.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.d.ts +58 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-constants.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-extension.d.ts +150 -0
- package/dist/types/components/vega-rich-text-editor/helpers/utils.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +114 -3
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +22 -13
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.d.ts +10 -2
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +4 -4
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.d.ts +1 -1
- package/dist/types/components/vega-table/interface.d.ts +18 -0
- package/dist/types/components/vega-table/slimmers/controllers/dto/column-render-input-model.d.ts +13 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-body-col-span-controller.d.ts +43 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-body-col-span-resolver.d.ts +38 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-cell-renderer.d.ts +11 -2
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.d.ts +4 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-row-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-cell/slimmers/controllers/vega-table-row-state-subscriber.d.ts +1 -1
- package/dist/types/components/vega-table/vega-table-cell/vega-table-cell.d.ts +9 -0
- package/dist/types/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.d.ts +9 -0
- package/dist/types/components/vega-table/vega-table.d.ts +2 -0
- package/dist/types/components/vega-time-picker/slimmers/controllers/vega-time-picker-range-dropdown-controller.d.ts +1 -0
- package/dist/types/components/vega-time-picker/slimmers/controllers/vega-time-picker-single-dropdown-controller.d.ts +1 -0
- package/dist/types/components/vega-time-picker/types.d.ts +7 -0
- package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +11 -1
- package/dist/types/components.d.ts +80 -3
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
- package/dist/types/helpers/translation/interface.d.ts +5 -0
- package/dist/types/helpers/ui/element-appender.d.ts +4 -1
- package/dist/types/types/components.type.d.ts +5 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-481601c0.entry.js → p-05f937c5.entry.js} +1 -1
- package/dist/vega/{p-970115d6.js → p-07562b9c.js} +1 -1
- package/dist/vega/{p-d0ce752f.entry.js → p-09d50f59.entry.js} +1 -1
- package/dist/vega/{p-22f73e6e.entry.js → p-0cb78838.entry.js} +1 -1
- package/dist/vega/p-0e607b44.js +1 -0
- package/dist/vega/{p-c8eaf91c.entry.js → p-0f1d6ceb.entry.js} +1 -1
- package/dist/vega/{p-70817cf5.js → p-140616fe.js} +1 -1
- package/dist/vega/{p-f70f7ad8.entry.js → p-1818f399.entry.js} +1 -1
- package/dist/vega/{p-802bf369.js → p-18a5e8bc.js} +1 -1
- package/dist/vega/{p-4d9061fb.js → p-19c42e30.js} +1 -1
- package/dist/vega/{p-d7369441.js → p-1efab41b.js} +1 -1
- package/dist/vega/{p-92823583.js → p-21e21f51.js} +1 -1
- package/dist/vega/{p-c0629528.entry.js → p-26c7fe8b.entry.js} +1 -1
- package/dist/vega/p-282b37cb.js +1 -0
- package/dist/vega/{p-c78aeaf3.entry.js → p-2dc5edd0.entry.js} +1 -1
- package/dist/vega/{p-228c5de8.js → p-2de61f1b.js} +1 -1
- package/dist/vega/{p-82279b03.entry.js → p-2de88b4a.entry.js} +1 -1
- package/dist/vega/{p-438b7404.entry.js → p-2fcc604c.entry.js} +1 -1
- package/dist/vega/{p-aa32f2f3.js → p-32a67ba1.js} +1 -1
- package/dist/vega/p-392e049c.entry.js +1 -0
- package/dist/vega/{p-a268a4fb.entry.js → p-3932f964.entry.js} +1 -1
- package/dist/vega/{p-f515d189.entry.js → p-3c9da3cd.entry.js} +1 -1
- package/dist/vega/{p-5829a66d.entry.js → p-3f7b10b9.entry.js} +1 -1
- package/dist/vega/{p-5545a235.entry.js → p-422d88ae.entry.js} +1 -1
- package/dist/vega/p-4256252c.js +3 -0
- package/dist/vega/{p-8f078d0d.entry.js → p-44439ecc.entry.js} +1 -1
- package/dist/vega/{p-68e16c70.entry.js → p-45e8424a.entry.js} +1 -1
- package/dist/vega/p-4c49b2e3.js +1 -0
- package/dist/vega/{p-71e2a3ec.js → p-4d9562bc.js} +1 -1
- package/dist/vega/p-4e1aa86f.js +1 -0
- package/dist/vega/p-4ef5c4a7.entry.js +1 -0
- package/dist/vega/{p-9440a8a5.entry.js → p-4f327808.entry.js} +1 -1
- package/dist/vega/{p-2def8e3e.js → p-5139e516.js} +1 -1
- package/dist/vega/{p-2e58d99e.entry.js → p-56c4e349.entry.js} +1 -1
- package/dist/vega/{p-b730bf6e.js → p-5dbfffcd.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-916dfa7e.entry.js → p-615a2b8c.entry.js} +1 -1
- package/dist/vega/{p-625351a3.entry.js → p-63101cb4.entry.js} +1 -1
- package/dist/vega/{p-7798254d.entry.js → p-653a6dd8.entry.js} +1 -1
- package/dist/vega/{p-d20587b4.entry.js → p-66b7d1c7.entry.js} +1 -1
- package/dist/vega/{p-9219201a.entry.js → p-6712a9c7.entry.js} +1 -1
- package/dist/vega/p-698fbd73.js +1 -0
- package/dist/vega/p-6ad7144a.entry.js +1 -0
- package/dist/vega/{p-9fafc956.entry.js → p-6b1893f6.entry.js} +1 -1
- package/dist/vega/{p-93dfab05.js → p-6d40635e.js} +1 -1
- package/dist/vega/{p-b799fc1f.entry.js → p-73fd18d9.entry.js} +1 -1
- package/dist/vega/p-751a5cd6.entry.js +1 -0
- package/dist/vega/{p-f7739cbb.entry.js → p-7b93a756.entry.js} +1 -1
- package/dist/vega/{p-2314494a.entry.js → p-7c8e579e.entry.js} +1 -1
- package/dist/vega/{p-4953bb1a.js → p-7d54e9c1.js} +1 -1
- package/dist/vega/{p-590c8720.entry.js → p-832d1a72.entry.js} +1 -1
- package/dist/vega/p-846b1ab9.entry.js +1 -0
- package/dist/vega/p-88863658.js +1 -0
- package/dist/vega/{p-c2e0f8b7.entry.js → p-8c1a5fa4.entry.js} +1 -1
- package/dist/vega/{p-f0bc2bbb.js → p-8d27b9cc.js} +1 -1
- package/dist/vega/{p-f365601c.entry.js → p-944b43ce.entry.js} +1 -1
- package/dist/vega/{p-8d69b201.js → p-95d6c85f.js} +1 -1
- package/dist/vega/{p-9b1d718c.entry.js → p-99b699be.entry.js} +1 -1
- package/dist/vega/p-9a01be93.js +1 -0
- package/dist/vega/{p-53c76d9d.entry.js → p-9a472a04.entry.js} +1 -1
- package/dist/vega/{p-18413b62.entry.js → p-9cafbc26.entry.js} +1 -1
- package/dist/vega/p-a359e53c.js +1 -0
- package/dist/vega/p-a9a87b9a.js +1 -0
- package/dist/vega/p-acbba6da.entry.js +1 -0
- package/dist/vega/{p-56cf1a65.entry.js → p-ad35dea4.entry.js} +1 -1
- package/dist/vega/{p-06c2ce2c.entry.js → p-af98539f.entry.js} +1 -1
- package/dist/vega/{p-136226f8.js → p-afb96938.js} +1 -1
- package/dist/vega/{p-e160a727.entry.js → p-b042e3b4.entry.js} +1 -1
- package/dist/vega/{p-5beec481.js → p-b1ff70bf.js} +1 -1
- package/dist/vega/{p-9cdedcfb.entry.js → p-b39d4a88.entry.js} +1 -1
- package/dist/vega/{p-c78e8081.entry.js → p-b5bee669.entry.js} +1 -1
- package/dist/vega/p-b5f308ee.entry.js +1 -0
- package/dist/vega/{p-43c3848f.entry.js → p-bbabb1c8.entry.js} +1 -1
- package/dist/vega/p-bbf1f988.entry.js +1 -0
- package/dist/vega/{p-e9cee498.entry.js → p-c2d28797.entry.js} +1 -1
- package/dist/vega/{p-40501057.entry.js → p-c3c0e415.entry.js} +1 -1
- package/dist/vega/{p-5946fadf.js → p-c553d37e.js} +1 -1
- package/dist/vega/{p-f6bccb06.entry.js → p-c5ecbc53.entry.js} +1 -1
- package/dist/vega/{p-2353b64f.entry.js → p-c9c6daa6.entry.js} +1 -1
- package/dist/vega/p-cb81fc2a.entry.js +1 -0
- package/dist/vega/p-ccb9bf86.js +1 -0
- package/dist/vega/{p-e371738b.js → p-ccf7518b.js} +1 -1
- package/dist/vega/{p-8b9a8603.entry.js → p-cf8d5b3f.entry.js} +1 -1
- package/dist/vega/{p-30561e1d.entry.js → p-d3a36d19.entry.js} +1 -1
- package/dist/vega/{p-cd1844ad.entry.js → p-d44943e2.entry.js} +1 -1
- package/dist/vega/{p-d3c8b871.entry.js → p-d4bb6f93.entry.js} +1 -1
- package/dist/vega/p-d62b85ff.entry.js +1 -0
- package/dist/vega/{p-ce7e9515.entry.js → p-d7f32ccf.entry.js} +1 -1
- package/dist/vega/p-dca3278f.js +1 -0
- package/dist/vega/{p-37dffdf6.entry.js → p-ddd28a8e.entry.js} +1 -1
- package/dist/vega/{p-2da12975.entry.js → p-ddf03de1.entry.js} +1 -1
- package/dist/vega/p-e0ecafca.js +1 -0
- package/dist/vega/p-e33e1e90.js +1 -0
- package/dist/vega/{p-5038b6d7.entry.js → p-e410c4ad.entry.js} +1 -1
- package/dist/vega/{p-a361456d.js → p-e4309574.js} +1 -1
- package/dist/vega/p-e5187a86.entry.js +1 -0
- package/dist/vega/{p-fc5dfb52.entry.js → p-e86c6802.entry.js} +1 -1
- package/dist/vega/{p-e3803943.js → p-ef605271.js} +1 -1
- package/dist/vega/{p-45ab490c.js → p-f0d4c78c.js} +1 -1
- package/dist/vega/{p-e41d9d0e.entry.js → p-f2f22b5d.entry.js} +1 -1
- package/dist/vega/{p-b6ebfd5c.entry.js → p-f8a29127.entry.js} +1 -1
- package/dist/vega/{p-cd9fb2ca.entry.js → p-fbd3be00.entry.js} +1 -1
- package/dist/vega/{p-450bf94d.entry.js → p-fda6e2cc.entry.js} +1 -1
- package/dist/vega/p-ff8dd200.js +1 -0
- package/dist/vega/{p-c67ce78c.entry.js → p-ffdacaf9.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -16
- package/readme.md +0 -5
- package/dist/vega/p-0179f55d.js +0 -1
- package/dist/vega/p-07b56f2b.entry.js +0 -1
- package/dist/vega/p-209e0166.js +0 -1
- package/dist/vega/p-35df0f0a.entry.js +0 -1
- package/dist/vega/p-3cf4339a.entry.js +0 -1
- package/dist/vega/p-4e39adf5.entry.js +0 -1
- package/dist/vega/p-5319da71.entry.js +0 -1
- package/dist/vega/p-5de1acdb.js +0 -1
- package/dist/vega/p-5df9047c.js +0 -1
- package/dist/vega/p-683cfe24.js +0 -1
- package/dist/vega/p-7be548a7.js +0 -1
- package/dist/vega/p-8509c140.entry.js +0 -1
- package/dist/vega/p-8aa07ed0.js +0 -1
- package/dist/vega/p-8da860f6.js +0 -1
- package/dist/vega/p-ca9852bb.js +0 -1
- package/dist/vega/p-de885ef2.js +0 -1
- package/dist/vega/p-dee38163.entry.js +0 -1
- package/dist/vega/p-e5502873.entry.js +0 -1
- package/dist/vega/p-ea22cba0.js +0 -1
- package/dist/vega/p-ea54ce0a.js +0 -3
- package/dist/vega/p-ee3155bd.js +0 -1
- package/dist/vega/p-eee01ba7.entry.js +0 -1
- package/dist/vega/p-ef2b9846.entry.js +0 -1
- package/dist/vega/p-f4a01959.js +0 -1
- package/dist/vega/p-f5aefb2f.entry.js +0 -1
|
@@ -5,18 +5,18 @@ import { I as InjectVegaTelemetrySlimmer, c as createPublicAPIRuntimeMetricsSlim
|
|
|
5
5
|
import { I as InternalVegaZIndexManager } from './internal-vega-z-index-manager-7d2b54c3.js';
|
|
6
6
|
import { c as createDynamicSlimmer } from './dynamic-slimmer-90b8af32.js';
|
|
7
7
|
import { P as PageResizeObserverSlimmer } from './page-resize-observer-slimmer-e24d36c5.js';
|
|
8
|
-
import { i as internalVegaEventManager } from './internal-vega-event-manager-
|
|
9
|
-
import { V as VegaInternalTranslation } from './internal-translation-controller-
|
|
10
|
-
import { I as InternalCalendarPeriodConverter } from './internal-calendar-period-factory-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { i as
|
|
14
|
-
import {
|
|
8
|
+
import { i as internalVegaEventManager } from './internal-vega-event-manager-48690e5b.js';
|
|
9
|
+
import { V as VegaInternalTranslation } from './internal-translation-controller-09b8bd13.js';
|
|
10
|
+
import { I as InternalCalendarPeriodConverter } from './internal-calendar-period-factory-6f19d767.js';
|
|
11
|
+
import { R as RTEExtensionContextManager, a as VegaRTEExtensionRenderer, b as VegaRTEExtension } from './link-extension-74eaa826.js';
|
|
12
|
+
import { U as UpdateCursorPositionAction, V as VegaRTEContent, B as BlockToRTEBlockStrategyAbstract, E as ElementToDTOStrategy, h as htmlElementToAnnotationGenerator, I as InsertNewParagraphAction, R as RTEImageBlock, a as InsertChildrenBeforeStrategy, P as PasteContentStrategy, A as AnnotationGeneratorStrategyAbstract, b as RTEListItemBlock } from './content-state-c3b85ae6.js';
|
|
13
|
+
import { M as ModifyContentAction, A as ActionHandleStrategyRegistry, R as RTETextNode, a as RTEBlock, b as RTETextBlock, c as RTEAnnotationStyle, d as ActionHandleStrategy, I as InsertChildrenAfterAction, e as AppendChildrenAction, f as RTENode, s as stateEntityRenderingRegistry, g as InsertChildrenBeforeAction, h as InternalAnnotationTypeEnum, i as ModifyContentActionType, B as BlockAnnotation, j as AnnotationAction, k as RemoveChildrenAction, C as CommonAnnotationTypeEnum, l as CustomAttributeAnnotation, m as RTEDTOClassManager, n as RTEFilterStylesStrategy, o as RTEDecoratorNode, S as SplitBlockWithNodeAction, U as UpdateTextAction, p as RTECodeBlock, q as RTECodeBlockNode, N as NodeAnnotationTypeEnum, r as CustomStyleAnnotation, t as RTEFilterStylesStrategyRegistry } from './code-block-ae2337c2.js';
|
|
14
|
+
import { i as isNonNullable } from './type-guard-2bfb2c7b.js';
|
|
15
15
|
import { V as VegaInternalIconManager } from './internal-icon-manager-e7c57096.js';
|
|
16
16
|
import { v as vegaNonceManager } from './vega-nonce-manager-497e5eb5.js';
|
|
17
17
|
import { D as DomNodeSubjectObserverFactory, d as domNodeSubjectFactory } from './dom-node-subject-observer-factory-ddff8662.js';
|
|
18
|
-
import { V as VegaDropdownClick, a as VegaClick, b as VegaPopoverHide, c as VegaPopoverShow, d as VegaChange } from './vega-event-id-
|
|
19
|
-
import { R as RTETableExtensionAnnotationTypeEnum, a as RTE_TABLE_HEAD_DEFAULT_BACKGROUND_COLOR, S as SettingEventHandler, T as TableSettingType, b as RTETableAnnotation, c as RTETableCellAnnotation, d as RTETableHeadCellBlock, e as RowOperationEventHandler, C as ColumnOperationEventHandler, M as MergeCellsOperationEventHandler, f as SplitCellOperationEventHandler, g as RTETableColorManager, h as RTETableBlock, i as generateTableBody, j as RTETableCellBlock, k as RTETableHeadBlock, l as RTETableBodyBlock, m as getParentBlockByType, n as RTETableHeadCellAnnotation, o as TableColumnStrategy, p as getAllTableRows, q as buildTableGrid, s as setSpanAttributes, r as findCellBlockById, t as getDefaultCellBlockTemplate, I as InsertTableColumnDirection, u as buildCellStartColumnMap, v as getTableColumnCount, w as getFirstNode, x as getCellSpan, y as createNewCell, z as MergeCellsOperationType, A as RTETableRowBlock, B as getActualColumnPosition, D as InsertTableRowDirection, E as RTE_TABLE_DEFAULT_COLORS, F as INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION, G as INSERT_TABLE_ROW_INTO_SAME_SECTION, H as DELETE_TABLE_ROW, J as TOGGLE_HEADER_ROW, K as INSERT_TABLE_COLUMN, L as DELETE_TABLE_COLUMN, N as TOGGLE_HEADER_TABLE_COLUMN, O as ToggleHeaderTableColumnStrategy, P as SPLIT_TABLE_CELL, Q as REPLACE_TABLE_CELL, U as SPLIT_CELL_HORIZONTALLY, W as SPLIT_CELL_VERTICALLY, X as SELECT_TABLE_COLUMN, Y as MERGE_CELLS } from './split-cell-operation-
|
|
18
|
+
import { V as VegaDropdownClick, a as VegaClick, b as VegaPopoverHide, c as VegaPopoverShow, d as VegaChange } from './vega-event-id-270fe47e.js';
|
|
19
|
+
import { R as RTETableExtensionAnnotationTypeEnum, a as RTE_TABLE_HEAD_DEFAULT_BACKGROUND_COLOR, S as SettingEventHandler, T as TableSettingType, b as RTETableAnnotation, c as RTETableCellAnnotation, d as RTETableHeadCellBlock, e as RowOperationEventHandler, C as ColumnOperationEventHandler, M as MergeCellsOperationEventHandler, f as SplitCellOperationEventHandler, g as RTETableColorManager, h as RTETableBlock, i as generateTableBody, j as RTETableCellBlock, k as RTETableHeadBlock, l as RTETableBodyBlock, m as getParentBlockByType, n as RTETableHeadCellAnnotation, o as TableColumnStrategy, p as getAllTableRows, q as buildTableGrid, s as setSpanAttributes, r as findCellBlockById, t as getDefaultCellBlockTemplate, I as InsertTableColumnDirection, u as buildCellStartColumnMap, v as getTableColumnCount, w as getFirstNode, x as getCellSpan, y as createNewCell, z as MergeCellsOperationType, A as RTETableRowBlock, B as getActualColumnPosition, D as InsertTableRowDirection, E as RTE_TABLE_DEFAULT_COLORS, F as INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION, G as INSERT_TABLE_ROW_INTO_SAME_SECTION, H as DELETE_TABLE_ROW, J as TOGGLE_HEADER_ROW, K as INSERT_TABLE_COLUMN, L as DELETE_TABLE_COLUMN, N as TOGGLE_HEADER_TABLE_COLUMN, O as ToggleHeaderTableColumnStrategy, P as SPLIT_TABLE_CELL, Q as REPLACE_TABLE_CELL, U as SPLIT_CELL_HORIZONTALLY, W as SPLIT_CELL_VERTICALLY, X as SELECT_TABLE_COLUMN, Y as MERGE_CELLS } from './split-cell-operation-98d58410.js';
|
|
20
20
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
21
21
|
import { V as VegaInternalRTEExtensionTableCellsSelectionAnchor, a as VegaInternalPopoverUpdateTarget, b as VegaInternalRTEExtensionTableCellSelectionChange } from './vega-internal-event-id-827eb1ce.js';
|
|
22
22
|
import { r as remoteInvocationRegistry } from './remote-invocation-registry-d69245c2.js';
|
|
@@ -25,7 +25,8 @@ import { t as tryGetDocument } from './try-get-document-bef0f526.js';
|
|
|
25
25
|
import { p as parseToPixelString } from './pixel-f32c07ce.js';
|
|
26
26
|
import { c as cleanObject } from './object-0c277f57.js';
|
|
27
27
|
import { d as debounce } from './timer-9321173b.js';
|
|
28
|
-
import {
|
|
28
|
+
import { c as camelToDashCase } from './string-a953eafc.js';
|
|
29
|
+
import { R as ReplaceSelectedTextAction } from './replace-selected-text-action-c9278a0f.js';
|
|
29
30
|
import { c as copy } from './copy-54e45e2d.js';
|
|
30
31
|
|
|
31
32
|
const VegaLoaderRuntimeMetricsPayloadDefinition = [
|
|
@@ -3804,7 +3805,7 @@ class RTETableBlockRenderer extends VegaRTEExtensionRenderer {
|
|
|
3804
3805
|
* @param {HTMLElement} tableRef - The element that can triggered the table popover open.
|
|
3805
3806
|
*/
|
|
3806
3807
|
handleTableRemove(renderData, tableRef) {
|
|
3807
|
-
renderData.
|
|
3808
|
+
renderData.apply(new DeleteTableBlockAction(renderData));
|
|
3808
3809
|
this.destroySelectionAnchor(tableRef);
|
|
3809
3810
|
}
|
|
3810
3811
|
/**
|
|
@@ -7368,9 +7369,10 @@ class VegaRTETableExtension extends VegaRTEExtension {
|
|
|
7368
7369
|
const insertTableBlockStrategy = new InsertTableBlockStrategy();
|
|
7369
7370
|
const deleteTableBlockStrategy = new DeleteTableBlockStrategy();
|
|
7370
7371
|
VegaRTEExtension.registerActionHandleStrategy(VegaRTEContent.name, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7372
|
+
// Registered on the table block itself (not its parent) so a table can always be
|
|
7373
|
+
// deleted regardless of which block type it is nested in (root content, table cell,
|
|
7374
|
+
// blockquote, or any future container).
|
|
7375
|
+
VegaRTEExtension.registerActionHandleStrategy(RTETableBlock.name, DELETE_TABLE_BLOCK, deleteTableBlockStrategy);
|
|
7374
7376
|
VegaRTEExtension.registerActionHandleStrategy(RTETextBlock.name, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
7375
7377
|
VegaRTEExtension.registerActionHandleStrategy(RTEImageBlock.name, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
7376
7378
|
VegaRTEExtension.registerActionHandleStrategy(RTETableBlock.name, INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION, new InsertTableRowIntoDifferentSectionStrategy());
|
|
@@ -7917,6 +7919,694 @@ class VegaRTEHorizontalLineExtension extends VegaRTEExtension {
|
|
|
7917
7919
|
})();
|
|
7918
7920
|
VegaRTEHorizontalLineExtension.TOOLBAR_BUTTON_KEY = 'horizontalLine';
|
|
7919
7921
|
|
|
7922
|
+
var RTEBlockquoteExtensionAnnotationTypeEnum;
|
|
7923
|
+
(function (RTEBlockquoteExtensionAnnotationTypeEnum) {
|
|
7924
|
+
RTEBlockquoteExtensionAnnotationTypeEnum["BLOCKQUOTE"] = "BLOCKQUOTE";
|
|
7925
|
+
})(RTEBlockquoteExtensionAnnotationTypeEnum || (RTEBlockquoteExtensionAnnotationTypeEnum = {}));
|
|
7926
|
+
/**
|
|
7927
|
+
* CSS class applied to `<blockquote>` elements rendered inside the editor.
|
|
7928
|
+
*/
|
|
7929
|
+
const BLOCKQUOTE_CLASS_NAME = 'v-rte-blockquote';
|
|
7930
|
+
/**
|
|
7931
|
+
* Default visual styles for the `<blockquote>` element in the RTE.
|
|
7932
|
+
*/
|
|
7933
|
+
const BLOCKQUOTE_DEFAULT_STYLES = {
|
|
7934
|
+
overflow: 'hidden',
|
|
7935
|
+
marginInline: '0',
|
|
7936
|
+
paddingInline: '24px',
|
|
7937
|
+
borderInlineStart: 'solid 5px hsl(0, 0%, 80%)',
|
|
7938
|
+
};
|
|
7939
|
+
/**
|
|
7940
|
+
* Blockquote annotation.
|
|
7941
|
+
*/
|
|
7942
|
+
class BlockquoteAnnotation extends BlockAnnotation {
|
|
7943
|
+
constructor() {
|
|
7944
|
+
super(...arguments);
|
|
7945
|
+
this.type = RTEBlockquoteExtensionAnnotationTypeEnum.BLOCKQUOTE;
|
|
7946
|
+
}
|
|
7947
|
+
/**
|
|
7948
|
+
* Generate the map item for the annotation.
|
|
7949
|
+
*
|
|
7950
|
+
* @returns {[RTEBlockquoteExtensionAnnotationTypeEnum.BLOCKQUOTE, BlockquoteAnnotation]} Map item.
|
|
7951
|
+
*/
|
|
7952
|
+
static from() {
|
|
7953
|
+
return [RTEBlockquoteExtensionAnnotationTypeEnum.BLOCKQUOTE, new BlockquoteAnnotation()];
|
|
7954
|
+
}
|
|
7955
|
+
/**
|
|
7956
|
+
* Get the default CSS rule for the blockquote element.
|
|
7957
|
+
*
|
|
7958
|
+
* @returns {string} The default CSS rule.
|
|
7959
|
+
*/
|
|
7960
|
+
static getDefaultCssText() {
|
|
7961
|
+
const declarations = Object.entries(BLOCKQUOTE_DEFAULT_STYLES)
|
|
7962
|
+
.map(([key, value]) => `\t${camelToDashCase(key)}: ${value};`)
|
|
7963
|
+
.join('\n');
|
|
7964
|
+
return `.${BLOCKQUOTE_CLASS_NAME} {\n${declarations}\n}`;
|
|
7965
|
+
}
|
|
7966
|
+
/**
|
|
7967
|
+
* @inheritDoc
|
|
7968
|
+
*/
|
|
7969
|
+
toJSON() {
|
|
7970
|
+
// Blockquote identity is captured by the block type; nothing to serialize.
|
|
7971
|
+
return null;
|
|
7972
|
+
}
|
|
7973
|
+
/**
|
|
7974
|
+
* @inheritDoc
|
|
7975
|
+
*/
|
|
7976
|
+
clone() {
|
|
7977
|
+
return new BlockquoteAnnotation();
|
|
7978
|
+
}
|
|
7979
|
+
/**
|
|
7980
|
+
* @inheritDoc
|
|
7981
|
+
*/
|
|
7982
|
+
renderClass(options) {
|
|
7983
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
7984
|
+
return null;
|
|
7985
|
+
return BLOCKQUOTE_CLASS_NAME;
|
|
7986
|
+
}
|
|
7987
|
+
/**
|
|
7988
|
+
* @inheritDoc
|
|
7989
|
+
*/
|
|
7990
|
+
renderStyle(options) {
|
|
7991
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
7992
|
+
return null;
|
|
7993
|
+
return BLOCKQUOTE_DEFAULT_STYLES;
|
|
7994
|
+
}
|
|
7995
|
+
}
|
|
7996
|
+
|
|
7997
|
+
/**
|
|
7998
|
+
* DTO representing a `<blockquote>` block.
|
|
7999
|
+
*/
|
|
8000
|
+
class RTEBlockquoteBlock extends RTEBlock {
|
|
8001
|
+
constructor(id, options) {
|
|
8002
|
+
super(id);
|
|
8003
|
+
this.dtoName = RTEBlockquoteBlock.dtoName;
|
|
8004
|
+
this.type = 'blockquote';
|
|
8005
|
+
this.children = [];
|
|
8006
|
+
const { autoMatchFormat = true } = options !== null && options !== void 0 ? options : {};
|
|
8007
|
+
if (autoMatchFormat) {
|
|
8008
|
+
this.annotationMap = new Map([BlockquoteAnnotation.from()]);
|
|
8009
|
+
}
|
|
8010
|
+
}
|
|
8011
|
+
/**
|
|
8012
|
+
* Convert a JSON block payload into an `RTEBlockquoteBlock` instance.
|
|
8013
|
+
*
|
|
8014
|
+
* @param {VegaRTEBlockquoteBlock} block - JSON payload.
|
|
8015
|
+
* @param {VegaRTETransformOptions} [options] - Transform options.
|
|
8016
|
+
* @returns {RTEBlockquoteBlock} The created blockquote block.
|
|
8017
|
+
*/
|
|
8018
|
+
static from(block, options) {
|
|
8019
|
+
const blockquote = new RTEBlockquoteBlock(block.id, options);
|
|
8020
|
+
if (block.annotations) {
|
|
8021
|
+
RTEBlock.convertAnnotationsToMap(blockquote.annotationMap, block.annotations);
|
|
8022
|
+
}
|
|
8023
|
+
blockquote.children = RTEBlock.generateBlockChildren(block.children, options, blockquote);
|
|
8024
|
+
return blockquote;
|
|
8025
|
+
}
|
|
8026
|
+
/**
|
|
8027
|
+
* @inheritDoc
|
|
8028
|
+
*/
|
|
8029
|
+
clone(parent) {
|
|
8030
|
+
const cloned = new RTEBlockquoteBlock(this.id);
|
|
8031
|
+
const clonedAsChildParent = cloned;
|
|
8032
|
+
cloned.children = this.children.map((child) => child.clone(clonedAsChildParent));
|
|
8033
|
+
cloned.annotationMap = this.cloneAnnotations();
|
|
8034
|
+
cloned.parent = parent;
|
|
8035
|
+
return cloned;
|
|
8036
|
+
}
|
|
8037
|
+
/**
|
|
8038
|
+
* @inheritDoc
|
|
8039
|
+
*/
|
|
8040
|
+
getLastNode() {
|
|
8041
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
8042
|
+
}
|
|
8043
|
+
/**
|
|
8044
|
+
* @inheritDoc
|
|
8045
|
+
*/
|
|
8046
|
+
isNotEmpty() {
|
|
8047
|
+
return this.children.length > 0;
|
|
8048
|
+
}
|
|
8049
|
+
/**
|
|
8050
|
+
* @inheritDoc
|
|
8051
|
+
*/
|
|
8052
|
+
toHtml(options) {
|
|
8053
|
+
const attrStr = this.generateAttributeString(options);
|
|
8054
|
+
const inner = this.children.map((child) => child.toHtml(options)).join('');
|
|
8055
|
+
return `<blockquote${attrStr}>${inner}</blockquote>`;
|
|
8056
|
+
}
|
|
8057
|
+
/**
|
|
8058
|
+
* @inheritDoc
|
|
8059
|
+
*/
|
|
8060
|
+
toJSON() {
|
|
8061
|
+
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: 'blockquote', children: this.children.map((child) => child.toJSON()) });
|
|
8062
|
+
}
|
|
8063
|
+
}
|
|
8064
|
+
RTEBlockquoteBlock.dtoName = 'RTEBlockquoteBlock';
|
|
8065
|
+
|
|
8066
|
+
/**
|
|
8067
|
+
* Wrap the selected blocks into a new `<blockquote>` block while preserving
|
|
8068
|
+
* their order.
|
|
8069
|
+
*/
|
|
8070
|
+
class BlockTransformToBlockquoteStrategy extends ActionHandleStrategy {
|
|
8071
|
+
/**
|
|
8072
|
+
* @inheritDoc
|
|
8073
|
+
*/
|
|
8074
|
+
handleAction(action, target) {
|
|
8075
|
+
const selectedBlocks = action.selectedBlocks;
|
|
8076
|
+
const children = target.children;
|
|
8077
|
+
const selectedSet = new Set(selectedBlocks);
|
|
8078
|
+
const firstIndex = children.indexOf(selectedBlocks[0]);
|
|
8079
|
+
// The selected blocks may not be contiguous in `children` (e.g. a table
|
|
8080
|
+
// sitting between two selected paragraphs must stay untouched), so the
|
|
8081
|
+
// insert position is the first selected block's index, adjusted for any
|
|
8082
|
+
// non-selected siblings that come before it.
|
|
8083
|
+
const insertIndex = children
|
|
8084
|
+
.slice(0, firstIndex)
|
|
8085
|
+
.filter((block) => !selectedSet.has(block)).length;
|
|
8086
|
+
const blockquote = new RTEBlockquoteBlock(generateUUID());
|
|
8087
|
+
blockquote.parent = target;
|
|
8088
|
+
blockquote.children = selectedBlocks;
|
|
8089
|
+
selectedBlocks.forEach((block) => {
|
|
8090
|
+
block.parent = blockquote;
|
|
8091
|
+
});
|
|
8092
|
+
// Remove selected blocks individually rather than assuming a single
|
|
8093
|
+
// contiguous run, so non-selected siblings interleaved with the
|
|
8094
|
+
// selection (e.g. a table) are preserved instead of being spliced away.
|
|
8095
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
8096
|
+
if (selectedSet.has(children[i])) {
|
|
8097
|
+
children.splice(i, 1);
|
|
8098
|
+
}
|
|
8099
|
+
}
|
|
8100
|
+
children.splice(insertIndex, 0, blockquote);
|
|
8101
|
+
}
|
|
8102
|
+
}
|
|
8103
|
+
|
|
8104
|
+
/**
|
|
8105
|
+
* Unwrap a `<blockquote>` — lift its children to the parent in their original
|
|
8106
|
+
* order and remove the blockquote.
|
|
8107
|
+
*/
|
|
8108
|
+
class RemoveBlockquoteStrategy extends ActionHandleStrategy {
|
|
8109
|
+
/**
|
|
8110
|
+
* @inheritDoc
|
|
8111
|
+
*/
|
|
8112
|
+
handleAction(_action, target) {
|
|
8113
|
+
const parent = target.parent;
|
|
8114
|
+
const childrenToLift = [...target.children];
|
|
8115
|
+
if (childrenToLift.length > 0) {
|
|
8116
|
+
parent.apply(new InsertChildrenBeforeAction(target, ...childrenToLift));
|
|
8117
|
+
}
|
|
8118
|
+
parent.apply(new RemoveChildrenAction(target));
|
|
8119
|
+
}
|
|
8120
|
+
}
|
|
8121
|
+
|
|
8122
|
+
/**
|
|
8123
|
+
* Lets the caret exit the blockquote via the keyboard. Pressing Enter on an empty
|
|
8124
|
+
* trailing paragraph inside a blockquote (i.e. the second Enter press at the end of
|
|
8125
|
+
* the quote) moves that empty paragraph out to a new paragraph after the blockquote,
|
|
8126
|
+
* instead of stacking another empty line inside the quote.
|
|
8127
|
+
*/
|
|
8128
|
+
class BlockquoteExitOnEnterInterceptor extends ActionHandlerInterceptor {
|
|
8129
|
+
/**
|
|
8130
|
+
* Intercept only when the caret sits in an empty paragraph that is the last child of a blockquote.
|
|
8131
|
+
*
|
|
8132
|
+
* @param {InsertNewParagraphAction} _action - the action to be intercepted
|
|
8133
|
+
* @param {RTETextBlock} target - the paragraph block receiving the Enter key press
|
|
8134
|
+
* @returns {boolean} - whether the action should be intercepted
|
|
8135
|
+
*/
|
|
8136
|
+
canIntercept(_action, target) {
|
|
8137
|
+
const parent = target.parent;
|
|
8138
|
+
return (parent instanceof RTEBlockquoteBlock &&
|
|
8139
|
+
!target.isNotEmpty() &&
|
|
8140
|
+
parent.children[parent.children.length - 1] === target);
|
|
8141
|
+
}
|
|
8142
|
+
/**
|
|
8143
|
+
* Move the empty paragraph out of the blockquote and place a new paragraph after it.
|
|
8144
|
+
*
|
|
8145
|
+
* @param {ActionHandlerExecution} _execution - the original execution function
|
|
8146
|
+
* @param {InsertNewParagraphAction} action - the action containing insert metadata
|
|
8147
|
+
* @param {RTETextBlock} target - the empty paragraph block to move out of the blockquote
|
|
8148
|
+
*/
|
|
8149
|
+
intercept(_execution, action, target) {
|
|
8150
|
+
const blockquote = target.parent;
|
|
8151
|
+
const newParagraph = this.createNewParagraph('');
|
|
8152
|
+
if (newParagraph) {
|
|
8153
|
+
// Insert the replacement paragraph after the blockquote before removing the
|
|
8154
|
+
// empty one so the blockquote is still present as an anchor for the insert.
|
|
8155
|
+
blockquote.parent.apply(new InsertChildrenAfterAction(blockquote, newParagraph));
|
|
8156
|
+
blockquote.apply(new RemoveChildrenAction(target));
|
|
8157
|
+
action.newBlock = newParagraph;
|
|
8158
|
+
}
|
|
8159
|
+
}
|
|
8160
|
+
/**
|
|
8161
|
+
* Create a new empty paragraph block.
|
|
8162
|
+
*
|
|
8163
|
+
* @param {string} text - paragraph text
|
|
8164
|
+
* @returns {Nullable<RTETextBlock>} - paragraph block when paragraph dto class is available
|
|
8165
|
+
*/
|
|
8166
|
+
createNewParagraph(text) {
|
|
8167
|
+
const dtoClass = RTEDTOClassManager.getRTEBlockClass('paragraph');
|
|
8168
|
+
if (dtoClass) {
|
|
8169
|
+
return dtoClass.from({
|
|
8170
|
+
id: generateUUID(),
|
|
8171
|
+
type: 'paragraph',
|
|
8172
|
+
nodes: [{ id: generateUUID(), type: 'text', text }],
|
|
8173
|
+
});
|
|
8174
|
+
}
|
|
8175
|
+
}
|
|
8176
|
+
}
|
|
8177
|
+
|
|
8178
|
+
/**
|
|
8179
|
+
* Action type discriminator. Plain string constant — intentionally NOT added
|
|
8180
|
+
* to {@link ModifyContentActionType} enum to keep the extension self-contained.
|
|
8181
|
+
*/
|
|
8182
|
+
const TRANSFORM_TO_BLOCKQUOTE = 'TRANSFORM_TO_BLOCKQUOTE';
|
|
8183
|
+
/**
|
|
8184
|
+
* Wrap the supplied blocks into a new `<blockquote>` block while preserving
|
|
8185
|
+
* their order. Strategy reads `selectedBlocks` and replaces them in-place
|
|
8186
|
+
* with a single `RTEBlockquoteBlock` that adopts them as children.
|
|
8187
|
+
*/
|
|
8188
|
+
class TransformToBlockquoteAction extends ModifyContentAction {
|
|
8189
|
+
constructor(selectedBlocks) {
|
|
8190
|
+
super();
|
|
8191
|
+
this.isFlushable = true;
|
|
8192
|
+
this.type = TRANSFORM_TO_BLOCKQUOTE;
|
|
8193
|
+
this.selectedBlocks = selectedBlocks;
|
|
8194
|
+
}
|
|
8195
|
+
}
|
|
8196
|
+
|
|
8197
|
+
/**
|
|
8198
|
+
* Action type discriminator. Plain string constant — intentionally NOT added
|
|
8199
|
+
* to {@link ModifyContentActionType} enum to keep the extension self-contained.
|
|
8200
|
+
*/
|
|
8201
|
+
const REMOVE_BLOCKQUOTE = 'REMOVE_BLOCKQUOTE';
|
|
8202
|
+
/**
|
|
8203
|
+
* Unwrap a `<blockquote>` block — lift its children into the parent in place
|
|
8204
|
+
* and remove the blockquote wrapper. Targets the blockquote block itself.
|
|
8205
|
+
*/
|
|
8206
|
+
class RemoveBlockquoteAction extends ModifyContentAction {
|
|
8207
|
+
constructor() {
|
|
8208
|
+
super(...arguments);
|
|
8209
|
+
this.isFlushable = true;
|
|
8210
|
+
this.type = REMOVE_BLOCKQUOTE;
|
|
8211
|
+
}
|
|
8212
|
+
}
|
|
8213
|
+
|
|
8214
|
+
/**
|
|
8215
|
+
* Claim every `<blockquote>` element encountered during HTML → DTO conversion
|
|
8216
|
+
* and produce an {@link RTEBlockquoteBlock}.
|
|
8217
|
+
*
|
|
8218
|
+
* Nested `<blockquote>` elements are flattened to a single level in
|
|
8219
|
+
* {@link appendChildBlocks}: any direct child that arrives as another
|
|
8220
|
+
* `<blockquote>` is replaced by its own children, lifting them one level up.
|
|
8221
|
+
*/
|
|
8222
|
+
class BlockquoteToBlockquoteBlockStrategy extends ElementToDTOStrategy {
|
|
8223
|
+
/**
|
|
8224
|
+
* @inheritDoc
|
|
8225
|
+
*/
|
|
8226
|
+
canHandle(elementsArray, currentIndex) {
|
|
8227
|
+
return elementsArray[currentIndex].tagName === 'BLOCKQUOTE' ? 1 : 0;
|
|
8228
|
+
}
|
|
8229
|
+
/**
|
|
8230
|
+
* @inheritDoc
|
|
8231
|
+
*/
|
|
8232
|
+
handle(elementsArray, options) {
|
|
8233
|
+
const element = elementsArray[0];
|
|
8234
|
+
const annotations = htmlElementToAnnotationGenerator.generate(RTEBlockquoteBlock, element, options);
|
|
8235
|
+
return RTEBlockquoteBlock.from({
|
|
8236
|
+
id: generateUUID(),
|
|
8237
|
+
type: 'blockquote',
|
|
8238
|
+
annotations,
|
|
8239
|
+
children: [],
|
|
8240
|
+
}, options);
|
|
8241
|
+
}
|
|
8242
|
+
/**
|
|
8243
|
+
* Flatten nested `<blockquote>` elements: any direct child that is itself
|
|
8244
|
+
* an {@link RTEBlockquoteBlock} is replaced by its own children, lifting
|
|
8245
|
+
* them one level up.
|
|
8246
|
+
*
|
|
8247
|
+
* @inheritDoc
|
|
8248
|
+
*/
|
|
8249
|
+
appendChildBlocks(currentBlock, childBlocks) {
|
|
8250
|
+
const flattened = childBlocks.flatMap((child) => child instanceof RTEBlockquoteBlock ? child.children : [child]);
|
|
8251
|
+
currentBlock.children = flattened.map((block) => {
|
|
8252
|
+
block.parent = currentBlock;
|
|
8253
|
+
return block;
|
|
8254
|
+
});
|
|
8255
|
+
}
|
|
8256
|
+
/**
|
|
8257
|
+
* @inheritDoc
|
|
8258
|
+
*/
|
|
8259
|
+
shouldProceedToElementChildren() {
|
|
8260
|
+
return true;
|
|
8261
|
+
}
|
|
8262
|
+
}
|
|
8263
|
+
|
|
8264
|
+
/**
|
|
8265
|
+
* Renderer for blockquote blocks in the rich text editor.
|
|
8266
|
+
*/
|
|
8267
|
+
class RTEBlockquoteBlockRenderer extends VegaRTEExtensionRenderer {
|
|
8268
|
+
/**
|
|
8269
|
+
* @inheritDoc
|
|
8270
|
+
*/
|
|
8271
|
+
doRender(createElement, block, rteContext) {
|
|
8272
|
+
var _a;
|
|
8273
|
+
return createElement('blockquote', Object.assign({ key: block.id, class: block.getClasses(rteContext), style: block.getStyles(rteContext), ref: this.useRef(block) }, (_a = block.getCustomAttributesAnnotation()) === null || _a === void 0 ? void 0 : _a.render()));
|
|
8274
|
+
}
|
|
8275
|
+
/**
|
|
8276
|
+
* @inheritDoc
|
|
8277
|
+
*/
|
|
8278
|
+
injectRTEScopeStyles() {
|
|
8279
|
+
return BlockquoteAnnotation.getDefaultCssText();
|
|
8280
|
+
}
|
|
8281
|
+
}
|
|
8282
|
+
const RTEBlockquoteBlockRenderer$1 = new RTEBlockquoteBlockRenderer();
|
|
8283
|
+
|
|
8284
|
+
// FontAwesome 7.2.0 — `quote-left` (solid).
|
|
8285
|
+
const QuoteLeftIcon = {
|
|
8286
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M0 216C0 149.7 53.7 96 120 96l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64L0 216zm256 0c0-66.3 53.7-120 120-120l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-136z"/></svg>`,
|
|
8287
|
+
};
|
|
8288
|
+
|
|
8289
|
+
/**
|
|
8290
|
+
* Toolbar button renderer for the blockquote extension.
|
|
8291
|
+
*
|
|
8292
|
+
* Behaviors implemented:
|
|
8293
|
+
* - Active (`selected`) when the caret/selection is inside any blockquote
|
|
8294
|
+
* ancestor.
|
|
8295
|
+
* - Click wraps the current block(s) into a new `<blockquote>`, or unwraps
|
|
8296
|
+
* the nearest blockquote ancestor when active. Inside a list, the entire
|
|
8297
|
+
* list is wrapped (escalating to the outermost list block). With no
|
|
8298
|
+
* selection, a new empty blockquote is appended at the end and focused.
|
|
8299
|
+
* - Disabled when the wrap container does not support the wrap strategy
|
|
8300
|
+
* (e.g. inside a code block or function block); the button remains
|
|
8301
|
+
* enabled inside a blockquote so it can be toggled off, and with no
|
|
8302
|
+
* selection so it can append a new blockquote.
|
|
8303
|
+
* - Hidden in source-edit mode (inherited from {@link VegaRTEToolbarButtonRenderer}).
|
|
8304
|
+
*/
|
|
8305
|
+
class RTEBlockquoteToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
8306
|
+
/**
|
|
8307
|
+
* @inheritDoc
|
|
8308
|
+
*/
|
|
8309
|
+
render(createElement, editorContext) {
|
|
8310
|
+
return this.renderButton(createElement, editorContext, {
|
|
8311
|
+
icon: 'quote-left',
|
|
8312
|
+
tooltip: { text: 'Block quote' },
|
|
8313
|
+
});
|
|
8314
|
+
}
|
|
8315
|
+
/**
|
|
8316
|
+
* @inheritDoc
|
|
8317
|
+
*/
|
|
8318
|
+
isSelected(editorContext) {
|
|
8319
|
+
const startNode = this.getStartNode(editorContext);
|
|
8320
|
+
return startNode ? this.findBlockquoteAncestor(startNode) !== null : false;
|
|
8321
|
+
}
|
|
8322
|
+
/**
|
|
8323
|
+
* @inheritDoc
|
|
8324
|
+
*/
|
|
8325
|
+
isDisabled(editorContext) {
|
|
8326
|
+
if (editorContext.host.disabled) {
|
|
8327
|
+
return true;
|
|
8328
|
+
}
|
|
8329
|
+
const startNode = this.getStartNode(editorContext);
|
|
8330
|
+
// No selection — click appends a new blockquote at the end.
|
|
8331
|
+
// Inside a blockquote — click toggles it off.
|
|
8332
|
+
// Either way, the button stays enabled.
|
|
8333
|
+
if (!startNode || this.findBlockquoteAncestor(startNode) !== null) {
|
|
8334
|
+
return false;
|
|
8335
|
+
}
|
|
8336
|
+
const { container } = this.resolveWrapAnchor(startNode.parent);
|
|
8337
|
+
return !ActionHandleStrategyRegistry.canHandle(TRANSFORM_TO_BLOCKQUOTE, container);
|
|
8338
|
+
}
|
|
8339
|
+
/**
|
|
8340
|
+
* @inheritDoc
|
|
8341
|
+
*/
|
|
8342
|
+
handleButtonClick(editorContext) {
|
|
8343
|
+
const context = this.getExtensionContext(editorContext.host);
|
|
8344
|
+
if (context) {
|
|
8345
|
+
const { host, getSelectedNodes } = context;
|
|
8346
|
+
const selectedNodes = getSelectedNodes();
|
|
8347
|
+
const startNode = selectedNodes[0];
|
|
8348
|
+
if (!startNode) {
|
|
8349
|
+
// No active selection → append a new empty blockquote at the end (mirrors text-style toolbar).
|
|
8350
|
+
this.appendEmptyBlockquote(host.value);
|
|
8351
|
+
return;
|
|
8352
|
+
}
|
|
8353
|
+
// Direction is decided by the first selected block only.
|
|
8354
|
+
if (this.findBlockquoteAncestor(startNode)) {
|
|
8355
|
+
const blockquoteAncestors = this.collectBlockquoteAncestors(selectedNodes);
|
|
8356
|
+
blockquoteAncestors.forEach((blockquote) => {
|
|
8357
|
+
blockquote.apply(new RemoveBlockquoteAction());
|
|
8358
|
+
});
|
|
8359
|
+
}
|
|
8360
|
+
else {
|
|
8361
|
+
this.wrapSelectedBlocks(selectedNodes);
|
|
8362
|
+
}
|
|
8363
|
+
host.value.apply(new UpdateCursorPositionAction(startNode, editorContext.rteRange.startOffset));
|
|
8364
|
+
}
|
|
8365
|
+
}
|
|
8366
|
+
/* istanbul ignore next */
|
|
8367
|
+
/**
|
|
8368
|
+
* @inheritDoc
|
|
8369
|
+
*/
|
|
8370
|
+
handleDropdownClick() {
|
|
8371
|
+
// No dropdown — single toggle button.
|
|
8372
|
+
}
|
|
8373
|
+
/**
|
|
8374
|
+
* Append an empty paragraph wrapped in a new blockquote to the end of the
|
|
8375
|
+
* content and place the caret inside it.
|
|
8376
|
+
*
|
|
8377
|
+
* @param {VegaRTEContent} content - Editor content to append to.
|
|
8378
|
+
*/
|
|
8379
|
+
appendEmptyBlockquote(content) {
|
|
8380
|
+
if (content.children.length > 0) {
|
|
8381
|
+
const lastBlock = content.children[content.children.length - 1];
|
|
8382
|
+
const newBlock = RTETextBlock.from({
|
|
8383
|
+
id: generateUUID(),
|
|
8384
|
+
type: 'paragraph',
|
|
8385
|
+
nodes: [{ id: generateUUID(), type: 'text', text: '' }],
|
|
8386
|
+
});
|
|
8387
|
+
content.apply(new InsertChildrenAfterAction(lastBlock, newBlock));
|
|
8388
|
+
content.apply(new TransformToBlockquoteAction([newBlock]));
|
|
8389
|
+
content.apply(new UpdateCursorPositionAction(newBlock.getLastNode(), 0));
|
|
8390
|
+
}
|
|
8391
|
+
}
|
|
8392
|
+
/**
|
|
8393
|
+
* Wrap the selection's unique parent blocks into a new blockquote. Blocks
|
|
8394
|
+
* inside a list or other nested container escalate to the top-level block.
|
|
8395
|
+
* When the selection spans multiple top-level (root) blocks, any scoped
|
|
8396
|
+
* container touched along the way (e.g. a table cell) is treated as an
|
|
8397
|
+
* opaque block instead of an independent wrap target — the whole
|
|
8398
|
+
* selection wraps as one, and any blockquote nested deeper than the
|
|
8399
|
+
* top-level block (e.g. inside a table cell) is left untouched. Existing
|
|
8400
|
+
* top-level blockquote blocks in the selection are merged (flattened)
|
|
8401
|
+
* into the new one rather than nested.
|
|
8402
|
+
*
|
|
8403
|
+
* @param {RTENode[]} selectedNodes - Currently selected nodes.
|
|
8404
|
+
*/
|
|
8405
|
+
wrapSelectedBlocks(selectedNodes) {
|
|
8406
|
+
var _a, _b;
|
|
8407
|
+
const uniqueBlocks = this.getUniqueBlocks(selectedNodes);
|
|
8408
|
+
// If the selection spans more than one top-level block, force every
|
|
8409
|
+
// anchor resolution to escalate all the way to the root, ignoring any
|
|
8410
|
+
// scoped container (e.g. a table cell) it passes through.
|
|
8411
|
+
const rootAncestors = new Set(uniqueBlocks.map((block) => { var _a; return (_a = this.resolveWrapAnchor(block, true).wrapBlock) !== null && _a !== void 0 ? _a : block; }));
|
|
8412
|
+
const forceRootScope = rootAncestors.size > 1;
|
|
8413
|
+
// Pass 1: unwrap any existing blockquote reachable from the selection so it merges instead of nesting.
|
|
8414
|
+
const alreadyUnwrapped = new Set();
|
|
8415
|
+
for (const block of uniqueBlocks) {
|
|
8416
|
+
const { wrapBlock } = this.resolveWrapAnchor(block, forceRootScope);
|
|
8417
|
+
if (wrapBlock instanceof RTEBlockquoteBlock && !alreadyUnwrapped.has(wrapBlock)) {
|
|
8418
|
+
alreadyUnwrapped.add(wrapBlock);
|
|
8419
|
+
wrapBlock.apply(new RemoveBlockquoteAction());
|
|
8420
|
+
}
|
|
8421
|
+
}
|
|
8422
|
+
// Pass 2: group targets by their resolved container so each container is wrapped independently.
|
|
8423
|
+
const containerMap = new Map();
|
|
8424
|
+
for (const block of uniqueBlocks) {
|
|
8425
|
+
const anchor = this.resolveWrapAnchor(block, forceRootScope);
|
|
8426
|
+
const { container } = anchor;
|
|
8427
|
+
if (container) {
|
|
8428
|
+
const target = (_a = anchor.wrapBlock) !== null && _a !== void 0 ? _a : block;
|
|
8429
|
+
const targets = (_b = containerMap.get(container)) !== null && _b !== void 0 ? _b : new Set();
|
|
8430
|
+
targets.add(target);
|
|
8431
|
+
containerMap.set(container, targets);
|
|
8432
|
+
}
|
|
8433
|
+
}
|
|
8434
|
+
for (const [container, targets] of containerMap) {
|
|
8435
|
+
container.apply(new TransformToBlockquoteAction([...targets]));
|
|
8436
|
+
}
|
|
8437
|
+
}
|
|
8438
|
+
/**
|
|
8439
|
+
* Resolve the starting node of the current toolbar selection, if any.
|
|
8440
|
+
*
|
|
8441
|
+
* @param {VegaRTEToolbarRenderContext} editorContext - Render context.
|
|
8442
|
+
* @returns {Nullable<RTENode>} The first selected node, or null.
|
|
8443
|
+
*/
|
|
8444
|
+
getStartNode(editorContext) {
|
|
8445
|
+
const context = this.getExtensionContext(editorContext.host);
|
|
8446
|
+
return context === null || context === void 0 ? void 0 : context.getSelectedNodes()[0];
|
|
8447
|
+
}
|
|
8448
|
+
/**
|
|
8449
|
+
* Collect the unique closest blockquote ancestors of every selected node.
|
|
8450
|
+
* Multiple selected nodes that share the same blockquote ancestor collapse
|
|
8451
|
+
* into a single entry, so applying {@link RemoveBlockquoteAction} to each
|
|
8452
|
+
* result unwraps every distinct blockquote in the selection exactly once.
|
|
8453
|
+
*
|
|
8454
|
+
* @param {RTENode[]} nodes - Selected nodes.
|
|
8455
|
+
* @returns {Set<RTEBlockquoteBlock>} Unique blockquote ancestors, preserving insertion order.
|
|
8456
|
+
*/
|
|
8457
|
+
collectBlockquoteAncestors(nodes) {
|
|
8458
|
+
const ancestors = new Set();
|
|
8459
|
+
nodes.forEach((node) => {
|
|
8460
|
+
const ancestor = this.findBlockquoteAncestor(node);
|
|
8461
|
+
if (ancestor) {
|
|
8462
|
+
ancestors.add(ancestor);
|
|
8463
|
+
}
|
|
8464
|
+
});
|
|
8465
|
+
return ancestors;
|
|
8466
|
+
}
|
|
8467
|
+
/**
|
|
8468
|
+
* Walk up the block ancestors of the supplied node looking for an
|
|
8469
|
+
* {@link RTEBlockquoteBlock}.
|
|
8470
|
+
*
|
|
8471
|
+
* @param {RTENode} node - Starting node.
|
|
8472
|
+
* @returns {Nullable<RTEBlockquoteBlock>} The closest blockquote ancestor, or null.
|
|
8473
|
+
*/
|
|
8474
|
+
findBlockquoteAncestor(node) {
|
|
8475
|
+
let current = node.parent;
|
|
8476
|
+
while (current && !(current instanceof VegaRTEContent)) {
|
|
8477
|
+
if (current instanceof RTEBlockquoteBlock) {
|
|
8478
|
+
return current;
|
|
8479
|
+
}
|
|
8480
|
+
current = current.parent;
|
|
8481
|
+
}
|
|
8482
|
+
return null;
|
|
8483
|
+
}
|
|
8484
|
+
/**
|
|
8485
|
+
* Collect unique block ancestors (immediate parent blocks) from a list of
|
|
8486
|
+
* selected nodes, preserving order of first appearance.
|
|
8487
|
+
*
|
|
8488
|
+
* @param {RTENode[]} nodes - Selected nodes.
|
|
8489
|
+
* @returns {RTEBlock[]} Unique parent blocks.
|
|
8490
|
+
*/
|
|
8491
|
+
getUniqueBlocks(nodes) {
|
|
8492
|
+
const seen = new Set();
|
|
8493
|
+
const result = [];
|
|
8494
|
+
nodes.forEach((node) => {
|
|
8495
|
+
const block = node.parent;
|
|
8496
|
+
if (block && !seen.has(block)) {
|
|
8497
|
+
seen.add(block);
|
|
8498
|
+
result.push(block);
|
|
8499
|
+
}
|
|
8500
|
+
});
|
|
8501
|
+
return result;
|
|
8502
|
+
}
|
|
8503
|
+
/**
|
|
8504
|
+
* Walk up from `block` to find the nearest ancestor that is a direct child
|
|
8505
|
+
* of a container registered to handle {@link TRANSFORM_TO_BLOCKQUOTE}
|
|
8506
|
+
* (e.g. {@link VegaRTEContent}, {@link RTETableCellBlock}).
|
|
8507
|
+
*
|
|
8508
|
+
* Stops as soon as the parent can handle the wrap action, so that blocks
|
|
8509
|
+
* inside a table cell are scoped to the cell (not escalated to the root)
|
|
8510
|
+
* while blocks inside a list are still escalated to the top-level list.
|
|
8511
|
+
* Pass `forceRootScope` to ignore scoped containers and always escalate
|
|
8512
|
+
* to the root — used when the overall selection spans multiple top-level
|
|
8513
|
+
* blocks, so a table (or any other scoped container) is wrapped as a
|
|
8514
|
+
* single opaque block alongside its siblings instead of independently.
|
|
8515
|
+
*
|
|
8516
|
+
* @param {RTEBlock} block - Immediate parent block of the selected node.
|
|
8517
|
+
* @param {boolean} [forceRootScope] - Ignore scoped containers and escalate to the root.
|
|
8518
|
+
* @returns {WrapAnchor} `wrapBlock` is the top-level ancestor when the block
|
|
8519
|
+
* is nested (otherwise null); `container` is the nearest wrap-capable parent.
|
|
8520
|
+
*/
|
|
8521
|
+
resolveWrapAnchor(block, forceRootScope = false) {
|
|
8522
|
+
let current = block;
|
|
8523
|
+
while (current.parent &&
|
|
8524
|
+
!(current.parent instanceof VegaRTEContent) &&
|
|
8525
|
+
(forceRootScope ||
|
|
8526
|
+
!ActionHandleStrategyRegistry.canHandle(TRANSFORM_TO_BLOCKQUOTE, current.parent))) {
|
|
8527
|
+
current = current.parent;
|
|
8528
|
+
}
|
|
8529
|
+
const wrapBlock = current !== block ? current : null;
|
|
8530
|
+
const container = current.parent;
|
|
8531
|
+
return { wrapBlock, container };
|
|
8532
|
+
}
|
|
8533
|
+
}
|
|
8534
|
+
(() => {
|
|
8535
|
+
VegaInternalIconManager.register({ 'quote-left': QuoteLeftIcon });
|
|
8536
|
+
})();
|
|
8537
|
+
|
|
8538
|
+
/**
|
|
8539
|
+
* Filter styles strategy for blockquote blocks.
|
|
8540
|
+
* Strips default blockquote visual styles during output and refills them during input,
|
|
8541
|
+
* ensuring source edit round-trips do not lose information.
|
|
8542
|
+
*/
|
|
8543
|
+
class BlockquoteFilterStylesStrategy extends RTEFilterStylesStrategy {
|
|
8544
|
+
constructor() {
|
|
8545
|
+
super(...arguments);
|
|
8546
|
+
this.stylesToBeFiltered = BLOCKQUOTE_DEFAULT_STYLES;
|
|
8547
|
+
this.elementTagName = 'blockquote';
|
|
8548
|
+
}
|
|
8549
|
+
/**
|
|
8550
|
+
* Checks if the given block dto class name corresponds to a blockquote block.
|
|
8551
|
+
*
|
|
8552
|
+
* @param {string} className The class name to check.
|
|
8553
|
+
* @returns {boolean} True if the class name corresponds to a blockquote block, false otherwise.
|
|
8554
|
+
*/
|
|
8555
|
+
static isBlockquoteBlock(className) {
|
|
8556
|
+
return className === 'RTEBlockquoteBlock';
|
|
8557
|
+
}
|
|
8558
|
+
/**
|
|
8559
|
+
* @inheritDoc
|
|
8560
|
+
*/
|
|
8561
|
+
canFilter(blockOrNodeInstance) {
|
|
8562
|
+
return BlockquoteFilterStylesStrategy.isBlockquoteBlock(blockOrNodeInstance.dtoName);
|
|
8563
|
+
}
|
|
8564
|
+
/**
|
|
8565
|
+
* @inheritDoc
|
|
8566
|
+
*/
|
|
8567
|
+
canRefill(_blockOrNodeClassName, element) {
|
|
8568
|
+
return element.tagName.toLowerCase() === this.elementTagName;
|
|
8569
|
+
}
|
|
8570
|
+
/**
|
|
8571
|
+
* @inheritDoc
|
|
8572
|
+
*/
|
|
8573
|
+
toCssText() {
|
|
8574
|
+
return this.buildCssTextForStyles(this.elementTagName, this.classNameToBeAdded);
|
|
8575
|
+
}
|
|
8576
|
+
}
|
|
8577
|
+
|
|
8578
|
+
/**
|
|
8579
|
+
* Adds `<blockquote>` support to the Vega Rich Text Editor.
|
|
8580
|
+
*/
|
|
8581
|
+
class VegaRTEBlockquoteExtension extends VegaRTEExtension {
|
|
8582
|
+
constructor() {
|
|
8583
|
+
super();
|
|
8584
|
+
this.toolbarButtonRenderer = new RTEBlockquoteToolbarButtonRenderer();
|
|
8585
|
+
this.registerBlockBasicStrategies(RTEBlockquoteBlock.name);
|
|
8586
|
+
this.registerNode('blockquote', RTEBlockquoteBlock);
|
|
8587
|
+
this.registerRenderer('blockquote', RTEBlockquoteBlockRenderer$1);
|
|
8588
|
+
this.registerToolbarButtonRenderer(VegaRTEBlockquoteExtension.TOOLBAR_BUTTON_KEY, this.toolbarButtonRenderer);
|
|
8589
|
+
this.registerElementToBlockDTOClassStrategy(new BlockquoteToBlockquoteBlockStrategy());
|
|
8590
|
+
// Register filter styles strategy for source edit round-trip.
|
|
8591
|
+
VegaRTEExtension.registerFilterStylesStrategy(RTEBlockquoteBlock.dtoName, new BlockquoteFilterStylesStrategy());
|
|
8592
|
+
}
|
|
8593
|
+
}
|
|
8594
|
+
(() => {
|
|
8595
|
+
const wrapStrategy = new BlockTransformToBlockquoteStrategy();
|
|
8596
|
+
// Root container — wrap top-level blocks.
|
|
8597
|
+
VegaRTEExtension.registerActionHandleStrategy(VegaRTEContent.name, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
8598
|
+
// Table cells (body + header) — wrap is scoped to the closest cell.
|
|
8599
|
+
// Other container blocks (code, list item, function) are intentionally
|
|
8600
|
+
// not registered, so the toolbar stays disabled inside them.
|
|
8601
|
+
VegaRTEExtension.registerActionHandleStrategy(RTETableCellBlock.name, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
8602
|
+
VegaRTEExtension.registerActionHandleStrategy(RTETableHeadCellBlock.name, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
8603
|
+
VegaRTEExtension.registerActionHandleStrategy(RTEBlockquoteBlock.name, REMOVE_BLOCKQUOTE, new RemoveBlockquoteStrategy());
|
|
8604
|
+
// Enables exiting the blockquote via the keyboard: pressing Enter on an empty
|
|
8605
|
+
// trailing paragraph breaks out to a new paragraph after the blockquote.
|
|
8606
|
+
VegaRTEExtension.registerActionHandlerInterceptor(RTETextBlock.name, ModifyContentActionType.INSERT_NEW_PARAGRAPH, new BlockquoteExitOnEnterInterceptor());
|
|
8607
|
+
})();
|
|
8608
|
+
VegaRTEBlockquoteExtension.TOOLBAR_BUTTON_KEY = 'blockquote';
|
|
8609
|
+
|
|
7920
8610
|
const ARROW_CHARACTERS = [
|
|
7921
8611
|
{ character: '←', title: 'leftwards simple arrow' },
|
|
7922
8612
|
{ character: '→', title: 'rightwards simple arrow' },
|
|
@@ -10038,6 +10728,599 @@ class VegaRTELineHeightExtension extends VegaRTEExtension {
|
|
|
10038
10728
|
})();
|
|
10039
10729
|
VegaRTELineHeightExtension.TOOLBAR_BUTTON_KEY = 'lineHeight';
|
|
10040
10730
|
|
|
10731
|
+
const paste = {
|
|
10732
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 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="M80 96v16c0 17.7 14.3 32 32 32h60.8c16.6-28.7 47.6-48 83.2-48h62c-7.1-27.6-32.2-48-62-48H215.4C211.6 20.9 188.2 0 160 0s-51.6 20.9-55.4 48H64C28.7 48 0 76.7 0 112V384c0 35.3 28.7 64 64 64h96V400H64c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H80zm64-40a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM256 464c-8.8 0-16-7.2-16-16V192c0-8.8 7.2-16 16-16H384v48c0 17.7 14.3 32 32 32h48V448c0 8.8-7.2 16-16 16H256zm192 48c35.3 0 64-28.7 64-64V227.9c0-12.7-5.1-24.9-14.1-33.9l-51.9-51.9c-9-9-21.2-14.1-33.9-14.1H256c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></svg>`,
|
|
10733
|
+
};
|
|
10734
|
+
|
|
10735
|
+
/**
|
|
10736
|
+
* Renders and manages the paste format chooser UI.
|
|
10737
|
+
*/
|
|
10738
|
+
class RTEPasteChooserUI {
|
|
10739
|
+
constructor(hostRoot, callbacks) {
|
|
10740
|
+
this.hostRoot = hostRoot;
|
|
10741
|
+
this.callbacks = callbacks;
|
|
10742
|
+
this.chooserEl = null;
|
|
10743
|
+
this.dropdownEl = null;
|
|
10744
|
+
this.triggerButtonEl = null;
|
|
10745
|
+
}
|
|
10746
|
+
/**
|
|
10747
|
+
* Opens the paste-mode chooser at the given position.
|
|
10748
|
+
*
|
|
10749
|
+
* @param {PasteChooserPosition} position Viewport position for the chooser.
|
|
10750
|
+
*/
|
|
10751
|
+
open(position) {
|
|
10752
|
+
this.destroy();
|
|
10753
|
+
const doc = this.hostRoot.ownerDocument;
|
|
10754
|
+
const chooser = doc.createElement('div');
|
|
10755
|
+
chooser.setAttribute(RTEPasteChooserUI.CHOOSER_ATTR, 'true');
|
|
10756
|
+
chooser.style.position = 'fixed';
|
|
10757
|
+
chooser.style.zIndex = '1000';
|
|
10758
|
+
chooser.style.left = `${position.left}px`;
|
|
10759
|
+
chooser.style.top = `${position.top}px`;
|
|
10760
|
+
const dropdownEl = this.createPasteChooserDropdown(doc, position.placement);
|
|
10761
|
+
dropdownEl.placement = position.placement;
|
|
10762
|
+
chooser.append(dropdownEl);
|
|
10763
|
+
this.hostRoot.appendChild(chooser);
|
|
10764
|
+
this.chooserEl = chooser;
|
|
10765
|
+
this.dropdownEl = dropdownEl;
|
|
10766
|
+
dropdownEl.addEventListener('vegaShow', () => {
|
|
10767
|
+
if (this.triggerButtonEl) {
|
|
10768
|
+
this.triggerButtonEl.selected = true;
|
|
10769
|
+
}
|
|
10770
|
+
});
|
|
10771
|
+
dropdownEl.addEventListener('vegaHide', () => {
|
|
10772
|
+
if (this.triggerButtonEl) {
|
|
10773
|
+
this.triggerButtonEl.selected = false;
|
|
10774
|
+
}
|
|
10775
|
+
});
|
|
10776
|
+
}
|
|
10777
|
+
/**
|
|
10778
|
+
* Removes the chooser from the DOM.
|
|
10779
|
+
*/
|
|
10780
|
+
destroy() {
|
|
10781
|
+
var _a;
|
|
10782
|
+
if (this.dropdownEl && typeof this.dropdownEl.hide === 'function') {
|
|
10783
|
+
void this.dropdownEl.hide();
|
|
10784
|
+
}
|
|
10785
|
+
if ((_a = this.chooserEl) === null || _a === void 0 ? void 0 : _a.parentNode) {
|
|
10786
|
+
this.chooserEl.parentNode.removeChild(this.chooserEl);
|
|
10787
|
+
}
|
|
10788
|
+
if (this.triggerButtonEl) {
|
|
10789
|
+
this.triggerButtonEl.selected = false;
|
|
10790
|
+
}
|
|
10791
|
+
this.dropdownEl = null;
|
|
10792
|
+
this.chooserEl = null;
|
|
10793
|
+
this.triggerButtonEl = null;
|
|
10794
|
+
}
|
|
10795
|
+
/**
|
|
10796
|
+
* Determines whether the given event path targets the chooser.
|
|
10797
|
+
*
|
|
10798
|
+
* @param {EventTarget[]} eventPath Composed path of an event.
|
|
10799
|
+
* @returns {boolean} `true` when the path includes the chooser.
|
|
10800
|
+
*/
|
|
10801
|
+
includesEventPath(eventPath) {
|
|
10802
|
+
if (!this.chooserEl) {
|
|
10803
|
+
return false;
|
|
10804
|
+
}
|
|
10805
|
+
const isDropdownContentClick = eventPath.some((target) => {
|
|
10806
|
+
return 'tagName' in target && target.tagName === 'VEGA-DROPDOWN-CONTENT-BOX';
|
|
10807
|
+
});
|
|
10808
|
+
return eventPath.includes(this.chooserEl) || isDropdownContentClick;
|
|
10809
|
+
}
|
|
10810
|
+
/**
|
|
10811
|
+
* Builds the dropdown element with the rich text paste option.
|
|
10812
|
+
*
|
|
10813
|
+
* @param {Document} doc Document used to create elements.
|
|
10814
|
+
* @param {['bottom', 'top'] | ['top', 'bottom']} placement Preferred placement order.
|
|
10815
|
+
* @returns {HTMLElement} Configured dropdown element.
|
|
10816
|
+
*/
|
|
10817
|
+
createPasteChooserDropdown(doc, placement) {
|
|
10818
|
+
const dropdownEl = doc.createElement('vega-dropdown');
|
|
10819
|
+
dropdownEl.trigger = 'click';
|
|
10820
|
+
dropdownEl.selectType = 'single';
|
|
10821
|
+
dropdownEl.selectedSourceKey = 'rich';
|
|
10822
|
+
dropdownEl.maxWidth = 220;
|
|
10823
|
+
dropdownEl.alignment = 'start';
|
|
10824
|
+
dropdownEl.itemDisplayRule = 'ellipsis';
|
|
10825
|
+
const triggerButton = doc.createElement('vega-rich-text-editor-toolbar-button');
|
|
10826
|
+
const arrowIcon = placement[0] === 'top' ? 'chevron-up' : 'chevron-down';
|
|
10827
|
+
triggerButton.setAttribute(RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR, 'true');
|
|
10828
|
+
triggerButton.setAttribute('aria-label', VegaInternalTranslation.t('Paste options'));
|
|
10829
|
+
triggerButton.setAttribute('arrow-icon', arrowIcon);
|
|
10830
|
+
triggerButton.icon = 'rte-paste';
|
|
10831
|
+
triggerButton.showArrowIcon = true;
|
|
10832
|
+
triggerButton.selected = false;
|
|
10833
|
+
this.triggerButtonEl = triggerButton;
|
|
10834
|
+
const tooltipEl = doc.createElement('vega-tooltip');
|
|
10835
|
+
tooltipEl.text = VegaInternalTranslation.t('Paste options');
|
|
10836
|
+
tooltipEl.placement = ['bottom', 'top'];
|
|
10837
|
+
tooltipEl.append(triggerButton);
|
|
10838
|
+
dropdownEl.append(tooltipEl);
|
|
10839
|
+
const itemsContainer = doc.createElement('div');
|
|
10840
|
+
itemsContainer.setAttribute('slot', 'items');
|
|
10841
|
+
itemsContainer.append(this.createDropdownItem(doc, 'rich', VegaInternalTranslation.t('Use rich text'), RTEPasteChooserUI.CHOOSER_RICH_ATTR));
|
|
10842
|
+
dropdownEl.append(itemsContainer);
|
|
10843
|
+
dropdownEl.addEventListener('vegaDropdownClick', (event) => {
|
|
10844
|
+
const mode = event.detail;
|
|
10845
|
+
if (mode === 'rich') {
|
|
10846
|
+
this.callbacks.onModeSelect(mode);
|
|
10847
|
+
}
|
|
10848
|
+
});
|
|
10849
|
+
return dropdownEl;
|
|
10850
|
+
}
|
|
10851
|
+
/**
|
|
10852
|
+
* Creates a single dropdown item element for a paste mode.
|
|
10853
|
+
*
|
|
10854
|
+
* @param {Document} doc Document used to create the element.
|
|
10855
|
+
* @param {PasteMode} key Paste mode key for the item.
|
|
10856
|
+
* @param {string} label Display label for the item.
|
|
10857
|
+
* @param {string} dataAttrName Data attribute marker for the item.
|
|
10858
|
+
* @returns {HTMLVegaDropdownItemElement} Configured dropdown item element.
|
|
10859
|
+
*/
|
|
10860
|
+
createDropdownItem(doc, key, label, dataAttrName) {
|
|
10861
|
+
const itemEl = doc.createElement('vega-dropdown-item');
|
|
10862
|
+
itemEl.itemKey = key;
|
|
10863
|
+
itemEl.label = label;
|
|
10864
|
+
itemEl.setAttribute(dataAttrName, 'true');
|
|
10865
|
+
return itemEl;
|
|
10866
|
+
}
|
|
10867
|
+
}
|
|
10868
|
+
(() => {
|
|
10869
|
+
VegaInternalIconManager.register({
|
|
10870
|
+
'rte-paste': paste,
|
|
10871
|
+
});
|
|
10872
|
+
})();
|
|
10873
|
+
RTEPasteChooserUI.CHOOSER_ATTR = 'data-rte-paste-chooser';
|
|
10874
|
+
RTEPasteChooserUI.CHOOSER_RICH_ATTR = 'data-rte-paste-type-rich';
|
|
10875
|
+
RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR = 'data-rte-paste-trigger';
|
|
10876
|
+
|
|
10877
|
+
/**
|
|
10878
|
+
* Custom DataTransfer MIME type used to tag a synthetic paste with the chosen
|
|
10879
|
+
* paste mode (e.g. 'rich' or 'plain'), so downstream paste handling can decide
|
|
10880
|
+
* whether to preserve the original inline styles.
|
|
10881
|
+
*/
|
|
10882
|
+
const RTE_PASTE_MODE_DATA_TYPE = 'application/x-vega-rte-paste-mode';
|
|
10883
|
+
|
|
10884
|
+
/**
|
|
10885
|
+
* Vega Rich Text Editor paste extension.
|
|
10886
|
+
* Intercepts keyboard paste and allows users to choose paste mode.
|
|
10887
|
+
*/
|
|
10888
|
+
class VegaRTEPasteExtension extends VegaRTEExtension {
|
|
10889
|
+
constructor() {
|
|
10890
|
+
super(...arguments);
|
|
10891
|
+
this.editableEl = null;
|
|
10892
|
+
this.contentHostEl = null;
|
|
10893
|
+
this.chooserUI = null;
|
|
10894
|
+
this.pendingPastePayload = null;
|
|
10895
|
+
this.listenerDocument = null;
|
|
10896
|
+
this.listenerWindow = null;
|
|
10897
|
+
/**
|
|
10898
|
+
* Handles a native paste event by capturing the clipboard payload and
|
|
10899
|
+
* rendering the paste-mode chooser.
|
|
10900
|
+
*
|
|
10901
|
+
* @param {ClipboardEvent} event Native clipboard paste event.
|
|
10902
|
+
*/
|
|
10903
|
+
this.handlePasteEvent = (event) => {
|
|
10904
|
+
var _a, _b;
|
|
10905
|
+
const clipboardData = event.clipboardData;
|
|
10906
|
+
if (!clipboardData) {
|
|
10907
|
+
return;
|
|
10908
|
+
}
|
|
10909
|
+
// HTML is sanitized via DOMParser and ElementToDtoStrategyProcessor pipeline
|
|
10910
|
+
const html = clipboardData.getData('text/html') || '';
|
|
10911
|
+
const text = clipboardData.getData('text/plain') || '';
|
|
10912
|
+
if (!html && !text) {
|
|
10913
|
+
// Empty clipboard paste should not mutate editor content.
|
|
10914
|
+
event.preventDefault();
|
|
10915
|
+
event.stopPropagation();
|
|
10916
|
+
return;
|
|
10917
|
+
}
|
|
10918
|
+
event.preventDefault();
|
|
10919
|
+
event.stopPropagation();
|
|
10920
|
+
const range = this.cloneCurrentSelectionRange();
|
|
10921
|
+
const selectedNodes = ((_b = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelectedNodes) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
|
|
10922
|
+
this.pendingPastePayload = { html, text, range, selectedNodes: [...selectedNodes] };
|
|
10923
|
+
this.renderPasteChooser(event);
|
|
10924
|
+
};
|
|
10925
|
+
/**
|
|
10926
|
+
* Dismisses the chooser when a pointer interaction occurs outside of it.
|
|
10927
|
+
*
|
|
10928
|
+
* @param {Event} event Pointer event captured on the document.
|
|
10929
|
+
*/
|
|
10930
|
+
this.handleOutsidePointerDown = (event) => {
|
|
10931
|
+
if (!this.chooserUI) {
|
|
10932
|
+
return;
|
|
10933
|
+
}
|
|
10934
|
+
const eventPath = typeof event.composedPath === 'function' ? event.composedPath() : [];
|
|
10935
|
+
if (this.chooserUI.includesEventPath(eventPath)) {
|
|
10936
|
+
return;
|
|
10937
|
+
}
|
|
10938
|
+
this.clearPasteChooser();
|
|
10939
|
+
};
|
|
10940
|
+
/**
|
|
10941
|
+
* Dismisses the chooser when the Escape key is pressed.
|
|
10942
|
+
*
|
|
10943
|
+
* @param {KeyboardEvent} event Keyboard event captured on the document.
|
|
10944
|
+
*/
|
|
10945
|
+
this.handleOutsideKeyDown = (event) => {
|
|
10946
|
+
if (event.key === 'Escape') {
|
|
10947
|
+
this.clearPasteChooser();
|
|
10948
|
+
}
|
|
10949
|
+
};
|
|
10950
|
+
/**
|
|
10951
|
+
* Dismisses the chooser when any relevant scroll container scrolls.
|
|
10952
|
+
*/
|
|
10953
|
+
this.handleOutsideScroll = () => {
|
|
10954
|
+
this.clearPasteChooser();
|
|
10955
|
+
};
|
|
10956
|
+
}
|
|
10957
|
+
/** @inheritDoc */
|
|
10958
|
+
initialExtensionAfterLoad(context) {
|
|
10959
|
+
super.initialExtensionAfterLoad(context);
|
|
10960
|
+
this.hostEl = context.host;
|
|
10961
|
+
this.attachPasteListener();
|
|
10962
|
+
}
|
|
10963
|
+
/** @inheritDoc */
|
|
10964
|
+
destroyExtension() {
|
|
10965
|
+
this.detachPasteListener();
|
|
10966
|
+
this.clearPasteChooser();
|
|
10967
|
+
}
|
|
10968
|
+
/**
|
|
10969
|
+
* Attaches the paste listener to the editable element.
|
|
10970
|
+
*/
|
|
10971
|
+
attachPasteListener() {
|
|
10972
|
+
const { editableEl, contentHostEl, } = this.getEditorElements();
|
|
10973
|
+
this.editableEl = editableEl;
|
|
10974
|
+
this.contentHostEl = contentHostEl;
|
|
10975
|
+
if (this.editableEl) {
|
|
10976
|
+
this.editableEl.addEventListener('paste', this.handlePasteEvent);
|
|
10977
|
+
}
|
|
10978
|
+
}
|
|
10979
|
+
/**
|
|
10980
|
+
* Detaches the paste listener from the editable element.
|
|
10981
|
+
*/
|
|
10982
|
+
detachPasteListener() {
|
|
10983
|
+
if (this.editableEl) {
|
|
10984
|
+
this.editableEl.removeEventListener('paste', this.handlePasteEvent);
|
|
10985
|
+
}
|
|
10986
|
+
this.editableEl = null;
|
|
10987
|
+
this.contentHostEl = null;
|
|
10988
|
+
}
|
|
10989
|
+
/**
|
|
10990
|
+
* Resolves the content host and editable element from the host shadow tree.
|
|
10991
|
+
*
|
|
10992
|
+
* @returns {EditorElements} Editor elements.
|
|
10993
|
+
*/
|
|
10994
|
+
getEditorElements() {
|
|
10995
|
+
var _a, _b, _c, _d, _e;
|
|
10996
|
+
const contentHostEl = (_c = (_b = (_a = this.hostEl) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('vega-rich-text-content')) !== null && _c !== void 0 ? _c : null;
|
|
10997
|
+
const editableEl = (_e = (_d = contentHostEl === null || contentHostEl === void 0 ? void 0 : contentHostEl.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector('.rich-text-content')) !== null && _e !== void 0 ? _e : null;
|
|
10998
|
+
return { editableEl, contentHostEl };
|
|
10999
|
+
}
|
|
11000
|
+
/**
|
|
11001
|
+
* Resolves the editable content element from the host shadow tree.
|
|
11002
|
+
*
|
|
11003
|
+
* @returns {HTMLDivElement | null} Editable element or `null` when unavailable.
|
|
11004
|
+
*/
|
|
11005
|
+
getEditableElement() {
|
|
11006
|
+
const { editableEl } = this.getEditorElements();
|
|
11007
|
+
return editableEl;
|
|
11008
|
+
}
|
|
11009
|
+
/**
|
|
11010
|
+
* Clones the current selection range so it can be restored after the user
|
|
11011
|
+
* chooses a paste mode.
|
|
11012
|
+
*
|
|
11013
|
+
* @returns {Range | null} Cloned range or `null` when there is no selection.
|
|
11014
|
+
*/
|
|
11015
|
+
cloneCurrentSelectionRange() {
|
|
11016
|
+
var _a;
|
|
11017
|
+
const selection = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
11018
|
+
if (selection && selection.rangeCount > 0) {
|
|
11019
|
+
return selection.getRangeAt(0).cloneRange();
|
|
11020
|
+
}
|
|
11021
|
+
return null;
|
|
11022
|
+
}
|
|
11023
|
+
/**
|
|
11024
|
+
* Renders the paste-mode chooser and wires up dismissal listeners.
|
|
11025
|
+
*
|
|
11026
|
+
* @param {ClipboardEvent} pasteEvent Originating paste event used for positioning.
|
|
11027
|
+
*/
|
|
11028
|
+
renderPasteChooser(pasteEvent) {
|
|
11029
|
+
var _a, _b;
|
|
11030
|
+
const hostRoot = (_b = (_a = this.hostEl) === null || _a === void 0 ? void 0 : _a.shadowRoot) !== null && _b !== void 0 ? _b : null;
|
|
11031
|
+
if (!hostRoot) {
|
|
11032
|
+
return;
|
|
11033
|
+
}
|
|
11034
|
+
this.clearPasteChooser(false);
|
|
11035
|
+
const position = this.computeChooserPosition(pasteEvent);
|
|
11036
|
+
this.chooserUI = new RTEPasteChooserUI(hostRoot, {
|
|
11037
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
11038
|
+
onModeSelect: (mode) => {
|
|
11039
|
+
this.applyPasteMode(mode);
|
|
11040
|
+
},
|
|
11041
|
+
});
|
|
11042
|
+
this.chooserUI.open(position);
|
|
11043
|
+
this.listenerDocument = this.hostEl.ownerDocument;
|
|
11044
|
+
this.listenerWindow = this.listenerDocument.defaultView;
|
|
11045
|
+
this.listenerDocument.addEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
11046
|
+
this.listenerDocument.addEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
11047
|
+
this.listenerDocument.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
11048
|
+
if (this.listenerWindow) {
|
|
11049
|
+
this.listenerWindow.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
11050
|
+
}
|
|
11051
|
+
if (this.contentHostEl) {
|
|
11052
|
+
this.contentHostEl.addEventListener('scroll', this.handleOutsideScroll);
|
|
11053
|
+
}
|
|
11054
|
+
}
|
|
11055
|
+
/**
|
|
11056
|
+
* Computes the on-screen position for the chooser based on pointer or caret.
|
|
11057
|
+
*
|
|
11058
|
+
* @param {ClipboardEvent} event Originating paste event.
|
|
11059
|
+
* @returns {ChooserPosition} Position in viewport coordinates.
|
|
11060
|
+
*/
|
|
11061
|
+
computeChooserPosition(event) {
|
|
11062
|
+
var _a, _b, _c;
|
|
11063
|
+
const hostRect = this.hostEl.getBoundingClientRect();
|
|
11064
|
+
const viewportHeight = (_b = (_a = this.hostEl.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.innerHeight) !== null && _b !== void 0 ? _b : window.innerHeight;
|
|
11065
|
+
const pointerEvent = event;
|
|
11066
|
+
const hasPointer = typeof pointerEvent.clientX === 'number' &&
|
|
11067
|
+
pointerEvent.clientX > 0 &&
|
|
11068
|
+
typeof pointerEvent.clientY === 'number' &&
|
|
11069
|
+
pointerEvent.clientY > 0;
|
|
11070
|
+
// For keyboard-initiated paste (Command/Control+V) clientX/Y are 0, so anchor
|
|
11071
|
+
// the chooser to the current caret instead of a fixed host-relative spot.
|
|
11072
|
+
const caretRect = hasPointer ? null : this.getCaretRect();
|
|
11073
|
+
const CHOOSER_GAP_PX = 8;
|
|
11074
|
+
const CHOOSER_MIN_MARGIN_PX = 12;
|
|
11075
|
+
const CHOOSER_WIDTH_PX = 220;
|
|
11076
|
+
const CHOOSER_FALLBACK_OFFSET_PX = 40;
|
|
11077
|
+
const CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX = 88;
|
|
11078
|
+
const baseLeft = hasPointer
|
|
11079
|
+
? pointerEvent.clientX
|
|
11080
|
+
: (_c = caretRect === null || caretRect === void 0 ? void 0 : caretRect.left) !== null && _c !== void 0 ? _c : hostRect.left + CHOOSER_MIN_MARGIN_PX;
|
|
11081
|
+
const baseTop = hasPointer
|
|
11082
|
+
? pointerEvent.clientY
|
|
11083
|
+
: caretRect
|
|
11084
|
+
? caretRect.bottom
|
|
11085
|
+
: hostRect.top + CHOOSER_FALLBACK_OFFSET_PX;
|
|
11086
|
+
const maxLeft = Math.max(hostRect.left + CHOOSER_MIN_MARGIN_PX, hostRect.right - CHOOSER_WIDTH_PX);
|
|
11087
|
+
const left = Math.min(Math.max(baseLeft, hostRect.left + CHOOSER_MIN_MARGIN_PX), maxLeft);
|
|
11088
|
+
const top = Math.max(baseTop + CHOOSER_GAP_PX, hostRect.top + CHOOSER_MIN_MARGIN_PX);
|
|
11089
|
+
const availableBelow = viewportHeight - top - CHOOSER_MIN_MARGIN_PX;
|
|
11090
|
+
const availableAbove = top - CHOOSER_MIN_MARGIN_PX;
|
|
11091
|
+
const placement = availableBelow >= CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX || availableBelow >= availableAbove
|
|
11092
|
+
? ['bottom', 'top']
|
|
11093
|
+
: ['top', 'bottom'];
|
|
11094
|
+
return { left, top, placement };
|
|
11095
|
+
}
|
|
11096
|
+
/**
|
|
11097
|
+
* Resolves the bounding rect of the pending caret position.
|
|
11098
|
+
*
|
|
11099
|
+
* @returns {DOMRect | null} Caret rect or `null` when it cannot be determined.
|
|
11100
|
+
*/
|
|
11101
|
+
getCaretRect() {
|
|
11102
|
+
var _a, _b;
|
|
11103
|
+
const range = (_b = (_a = this.pendingPastePayload) === null || _a === void 0 ? void 0 : _a.range) !== null && _b !== void 0 ? _b : this.cloneCurrentSelectionRange();
|
|
11104
|
+
if (!range) {
|
|
11105
|
+
return null;
|
|
11106
|
+
}
|
|
11107
|
+
const rect = range.getBoundingClientRect();
|
|
11108
|
+
if (this.isUnavailableRect(rect)) {
|
|
11109
|
+
// eslint-disable-next-line spellcheck/spell-checker
|
|
11110
|
+
const domRectList = range.getClientRects();
|
|
11111
|
+
if (domRectList.length > 0) {
|
|
11112
|
+
return domRectList[0];
|
|
11113
|
+
}
|
|
11114
|
+
return this.getRangeContainerRect(range);
|
|
11115
|
+
}
|
|
11116
|
+
return rect;
|
|
11117
|
+
}
|
|
11118
|
+
/**
|
|
11119
|
+
* Returns whether the browser could not resolve a meaningful caret rectangle.
|
|
11120
|
+
*
|
|
11121
|
+
* @param {DOMRect} rect Candidate caret rect.
|
|
11122
|
+
* @returns {boolean} Whether the rect is unusable.
|
|
11123
|
+
*/
|
|
11124
|
+
isUnavailableRect(rect) {
|
|
11125
|
+
return rect.width === 0 && rect.height === 0 && rect.left === 0 && rect.top === 0;
|
|
11126
|
+
}
|
|
11127
|
+
/**
|
|
11128
|
+
* Falls back to the range container or neighbor child node bounds.
|
|
11129
|
+
*
|
|
11130
|
+
* @param {Range} range Caret/selection range.
|
|
11131
|
+
* @returns {DOMRect | null} Best-effort caret anchor rectangle.
|
|
11132
|
+
*/
|
|
11133
|
+
getRangeContainerRect(range) {
|
|
11134
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11135
|
+
const containerNode = (_a = range.startContainer) !== null && _a !== void 0 ? _a : null;
|
|
11136
|
+
if (!containerNode) {
|
|
11137
|
+
return null;
|
|
11138
|
+
}
|
|
11139
|
+
if (containerNode.nodeType === Node.ELEMENT_NODE) {
|
|
11140
|
+
const containerElement = containerNode;
|
|
11141
|
+
const previousNode = (_b = containerElement.childNodes[range.startOffset - 1]) !== null && _b !== void 0 ? _b : null;
|
|
11142
|
+
const currentNode = (_c = containerElement.childNodes[range.startOffset]) !== null && _c !== void 0 ? _c : null;
|
|
11143
|
+
return ((_e = (_d = this.getNodeRect(previousNode)) !== null && _d !== void 0 ? _d : this.getNodeRect(currentNode)) !== null && _e !== void 0 ? _e : this.getNodeRect(containerElement));
|
|
11144
|
+
}
|
|
11145
|
+
return (_f = this.getNodeRect(containerNode)) !== null && _f !== void 0 ? _f : this.getNodeRect(containerNode.parentNode);
|
|
11146
|
+
}
|
|
11147
|
+
/**
|
|
11148
|
+
* Returns an element-backed rectangle from a DOM node.
|
|
11149
|
+
*
|
|
11150
|
+
* @param {Node | null} node Candidate node.
|
|
11151
|
+
* @returns {DOMRect | null} Node rectangle when resolvable.
|
|
11152
|
+
*/
|
|
11153
|
+
getNodeRect(node) {
|
|
11154
|
+
var _a, _b;
|
|
11155
|
+
if (!node) {
|
|
11156
|
+
return null;
|
|
11157
|
+
}
|
|
11158
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
11159
|
+
return (_b = (_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : null;
|
|
11160
|
+
}
|
|
11161
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
11162
|
+
const rect = node.getBoundingClientRect();
|
|
11163
|
+
return this.isUnavailableRect(rect) ? null : rect;
|
|
11164
|
+
}
|
|
11165
|
+
return null;
|
|
11166
|
+
}
|
|
11167
|
+
/**
|
|
11168
|
+
* Applies the chosen paste mode by dispatching a synthetic paste input event.
|
|
11169
|
+
*
|
|
11170
|
+
* @param {PasteMode} mode Selected paste mode.
|
|
11171
|
+
*/
|
|
11172
|
+
applyPasteMode(mode) {
|
|
11173
|
+
var _a;
|
|
11174
|
+
if (!this.pendingPastePayload) {
|
|
11175
|
+
this.clearPasteChooser();
|
|
11176
|
+
return;
|
|
11177
|
+
}
|
|
11178
|
+
const editableEl = (_a = this.editableEl) !== null && _a !== void 0 ? _a : this.getEditableElement();
|
|
11179
|
+
if (!editableEl) {
|
|
11180
|
+
this.clearPasteChooser();
|
|
11181
|
+
return;
|
|
11182
|
+
}
|
|
11183
|
+
editableEl.focus();
|
|
11184
|
+
this.restoreSelectionRange(this.pendingPastePayload.range);
|
|
11185
|
+
this.restoreSelectionControllerState(this.pendingPastePayload);
|
|
11186
|
+
const dataTransfer = this.createDataTransfer(this.pendingPastePayload.html, this.pendingPastePayload.text, mode);
|
|
11187
|
+
this.dispatchBeforeInputPaste(editableEl, dataTransfer);
|
|
11188
|
+
this.clearPasteChooser();
|
|
11189
|
+
}
|
|
11190
|
+
/**
|
|
11191
|
+
* Restores SelectionController state from the captured selection so synthetic
|
|
11192
|
+
* beforeinput paste can replace the selected content instead of appending.
|
|
11193
|
+
*
|
|
11194
|
+
* @param {PendingPastePayload} payload Pending paste payload.
|
|
11195
|
+
*/
|
|
11196
|
+
restoreSelectionControllerState(payload) {
|
|
11197
|
+
if (!payload.range || !this.extensionContext) {
|
|
11198
|
+
return;
|
|
11199
|
+
}
|
|
11200
|
+
const rangeOptions = {
|
|
11201
|
+
startNode: payload.range.startContainer,
|
|
11202
|
+
endNode: payload.range.endContainer,
|
|
11203
|
+
startOffset: payload.range.startOffset,
|
|
11204
|
+
endOffset: payload.range.endOffset,
|
|
11205
|
+
};
|
|
11206
|
+
this.extensionContext.setSelectedNodes(payload.selectedNodes || [], rangeOptions);
|
|
11207
|
+
}
|
|
11208
|
+
/**
|
|
11209
|
+
* Restores a previously cloned selection range.
|
|
11210
|
+
*
|
|
11211
|
+
* @param {Range | null} range Range to restore.
|
|
11212
|
+
*/
|
|
11213
|
+
restoreSelectionRange(range) {
|
|
11214
|
+
var _a;
|
|
11215
|
+
if (!range) {
|
|
11216
|
+
return;
|
|
11217
|
+
}
|
|
11218
|
+
const selection = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
11219
|
+
if (selection) {
|
|
11220
|
+
selection.removeAllRanges();
|
|
11221
|
+
selection.addRange(range);
|
|
11222
|
+
}
|
|
11223
|
+
}
|
|
11224
|
+
/**
|
|
11225
|
+
* Dispatches a synthetic `beforeinput` paste event into the editor pipeline.
|
|
11226
|
+
*
|
|
11227
|
+
* @param {HTMLDivElement} editableEl Editable content element.
|
|
11228
|
+
* @param {DataTransfer} dataTransfer Clipboard payload for the paste.
|
|
11229
|
+
*/
|
|
11230
|
+
dispatchBeforeInputPaste(editableEl, dataTransfer) {
|
|
11231
|
+
// This synthetic beforeinput event intentionally reuses the existing
|
|
11232
|
+
// UserInputController -> insertFromPaste -> InsertPasteHandler pipeline.
|
|
11233
|
+
const beforeInputEvent = new CustomEvent('beforeinput', {
|
|
11234
|
+
bubbles: true,
|
|
11235
|
+
cancelable: true,
|
|
11236
|
+
});
|
|
11237
|
+
try {
|
|
11238
|
+
Object.defineProperties(beforeInputEvent, {
|
|
11239
|
+
inputType: {
|
|
11240
|
+
value: 'insertFromPaste',
|
|
11241
|
+
configurable: true,
|
|
11242
|
+
},
|
|
11243
|
+
dataTransfer: {
|
|
11244
|
+
value: dataTransfer,
|
|
11245
|
+
configurable: true,
|
|
11246
|
+
},
|
|
11247
|
+
});
|
|
11248
|
+
}
|
|
11249
|
+
catch (_a) {
|
|
11250
|
+
Object.assign(beforeInputEvent, {
|
|
11251
|
+
inputType: 'insertFromPaste',
|
|
11252
|
+
dataTransfer,
|
|
11253
|
+
});
|
|
11254
|
+
}
|
|
11255
|
+
editableEl.dispatchEvent(beforeInputEvent);
|
|
11256
|
+
}
|
|
11257
|
+
/**
|
|
11258
|
+
* Builds a `DataTransfer` payload carrying the paste content and mode marker.
|
|
11259
|
+
*
|
|
11260
|
+
* @param {string} html HTML clipboard content.
|
|
11261
|
+
* @param {string} text Plain text clipboard content.
|
|
11262
|
+
* @param {PasteMode} [mode] Selected paste mode marker.
|
|
11263
|
+
* @returns {DataTransfer} Populated data transfer payload.
|
|
11264
|
+
*/
|
|
11265
|
+
createDataTransfer(html, text, mode) {
|
|
11266
|
+
if (typeof DataTransfer !== 'undefined') {
|
|
11267
|
+
const dataTransfer = new DataTransfer();
|
|
11268
|
+
if (html) {
|
|
11269
|
+
dataTransfer.setData('text/html', html);
|
|
11270
|
+
}
|
|
11271
|
+
if (text) {
|
|
11272
|
+
dataTransfer.setData('text/plain', text);
|
|
11273
|
+
}
|
|
11274
|
+
if (mode) {
|
|
11275
|
+
dataTransfer.setData(RTE_PASTE_MODE_DATA_TYPE, mode);
|
|
11276
|
+
}
|
|
11277
|
+
return dataTransfer;
|
|
11278
|
+
}
|
|
11279
|
+
return {
|
|
11280
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
11281
|
+
getData: (type) => {
|
|
11282
|
+
if (type === 'text/html') {
|
|
11283
|
+
return html;
|
|
11284
|
+
}
|
|
11285
|
+
if (type === 'text/plain') {
|
|
11286
|
+
return text;
|
|
11287
|
+
}
|
|
11288
|
+
if (type === RTE_PASTE_MODE_DATA_TYPE) {
|
|
11289
|
+
return mode !== null && mode !== void 0 ? mode : '';
|
|
11290
|
+
}
|
|
11291
|
+
return '';
|
|
11292
|
+
},
|
|
11293
|
+
};
|
|
11294
|
+
}
|
|
11295
|
+
/**
|
|
11296
|
+
* Tears down the chooser UI and removes dismissal listeners.
|
|
11297
|
+
*
|
|
11298
|
+
* @param {boolean} [clearPayload] Whether to also clear the pending payload.
|
|
11299
|
+
*/
|
|
11300
|
+
clearPasteChooser(clearPayload = true) {
|
|
11301
|
+
if (this.contentHostEl) {
|
|
11302
|
+
this.contentHostEl.removeEventListener('scroll', this.handleOutsideScroll);
|
|
11303
|
+
}
|
|
11304
|
+
if (this.listenerWindow) {
|
|
11305
|
+
this.listenerWindow.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
11306
|
+
this.listenerWindow = null;
|
|
11307
|
+
}
|
|
11308
|
+
if (this.listenerDocument) {
|
|
11309
|
+
this.listenerDocument.removeEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
11310
|
+
this.listenerDocument.removeEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
11311
|
+
this.listenerDocument.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
11312
|
+
this.listenerDocument = null;
|
|
11313
|
+
}
|
|
11314
|
+
if (this.chooserUI) {
|
|
11315
|
+
this.chooserUI.destroy();
|
|
11316
|
+
}
|
|
11317
|
+
this.chooserUI = null;
|
|
11318
|
+
if (clearPayload) {
|
|
11319
|
+
this.pendingPastePayload = null;
|
|
11320
|
+
}
|
|
11321
|
+
}
|
|
11322
|
+
}
|
|
11323
|
+
|
|
10041
11324
|
/**
|
|
10042
11325
|
* Action to extract the currently selected content (HTML and plain text) from the editor.
|
|
10043
11326
|
*
|
|
@@ -10555,4 +11838,4 @@ class VegaRTETokenExtension extends VegaRTEExtension {
|
|
|
10555
11838
|
})();
|
|
10556
11839
|
VegaRTETokenExtension.TOOLBAR_BUTTON_KEY = 'token';
|
|
10557
11840
|
|
|
10558
|
-
export {
|
|
11841
|
+
export { VegaRTEToolbarButtonRenderer as A, RTETokenNode as B, RTETokenNodeRenderer as C, RTELanguageToolbarButtonRenderer as D, RTEBlockquoteBlock as E, DeleteSelectedContentAction as F, ActionHandlerInterceptor as G, InsertNodeToNearestRootAction as I, RTETokenToolbarButtonRenderer as R, VegaLoader as V, VegaNotify as a, VegaEventManager$1 as b, VegaZIndexManager$1 as c, VegaSkeletonLoader as d, VegaTranslation as e, VegaRTETokenExtension as f, VegaRTELanguageExtension as g, VegaRTEDefaultLineHeightOptions as h, VegaRTEFunctionExtension as i, VegaRTETableExtension as j, VegaRTEHorizontalLineExtension as k, VegaRTEBlockquoteExtension as l, VegaRTESpecialCharactersExtension as m, VegaRTEFindReplaceExtension as n, VegaRTESpecialCharactersEssentials as o, VegaRTESpecialCharactersLatin as p, VegaRTESpecialCharactersMathematical as q, VegaRTESpecialCharactersArrows as r, VegaRTESpecialCharactersCurrency as s, VegaRTESpecialCharactersText as t, VegaRTELineHeightExtension as u, VegaRTEPasteExtension as v, waitForVega as w, VegaRTECopyExtension as x, VegaRTECutExtension as y, VegaCalendarPeriodFactory as z };
|