@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
|
@@ -7,18 +7,18 @@ const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtim
|
|
|
7
7
|
const internalVegaZIndexManager = require('./internal-vega-z-index-manager-f03ddb37.js');
|
|
8
8
|
const dynamicSlimmer = require('./dynamic-slimmer-f31fdfd7.js');
|
|
9
9
|
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-273d62ef.js');
|
|
10
|
-
const internalVegaEventManager = require('./internal-vega-event-manager-
|
|
11
|
-
const internalTranslationController = require('./internal-translation-controller-
|
|
12
|
-
const internalCalendarPeriodFactory = require('./internal-calendar-period-factory-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
10
|
+
const internalVegaEventManager = require('./internal-vega-event-manager-13c4012b.js');
|
|
11
|
+
const internalTranslationController = require('./internal-translation-controller-31f2b057.js');
|
|
12
|
+
const internalCalendarPeriodFactory = require('./internal-calendar-period-factory-7a0ecdb1.js');
|
|
13
|
+
const linkExtension = require('./link-extension-455c02b3.js');
|
|
14
|
+
const contentState = require('./content-state-13daf87a.js');
|
|
15
|
+
const codeBlock = require('./code-block-2f3d0f38.js');
|
|
16
|
+
const typeGuard = require('./type-guard-1c3770d4.js');
|
|
17
17
|
const internalIconManager = require('./internal-icon-manager-40bcac72.js');
|
|
18
18
|
const vegaNonceManager = require('./vega-nonce-manager-df69d3ed.js');
|
|
19
19
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-c82df135.js');
|
|
20
|
-
const vegaEventId = require('./vega-event-id-
|
|
21
|
-
const splitCellOperation = require('./split-cell-operation-
|
|
20
|
+
const vegaEventId = require('./vega-event-id-58afed7a.js');
|
|
21
|
+
const splitCellOperation = require('./split-cell-operation-2fa5c9e4.js');
|
|
22
22
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
23
23
|
const vegaInternalEventId = require('./vega-internal-event-id-ecc5b87a.js');
|
|
24
24
|
const remoteInvocationRegistry = require('./remote-invocation-registry-fc22fdd0.js');
|
|
@@ -27,7 +27,8 @@ const tryGetDocument = require('./try-get-document-c0ebd39a.js');
|
|
|
27
27
|
const pixel = require('./pixel-98f2a10c.js');
|
|
28
28
|
const object = require('./object-b53e9416.js');
|
|
29
29
|
const timer = require('./timer-5f33058b.js');
|
|
30
|
-
const
|
|
30
|
+
const string = require('./string-39438062.js');
|
|
31
|
+
const replaceSelectedTextAction = require('./replace-selected-text-action-a80f5a6a.js');
|
|
31
32
|
const copy = require('./copy-d021c780.js');
|
|
32
33
|
|
|
33
34
|
const VegaLoaderRuntimeMetricsPayloadDefinition = [
|
|
@@ -3806,7 +3807,7 @@ class RTETableBlockRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
3806
3807
|
* @param {HTMLElement} tableRef - The element that can triggered the table popover open.
|
|
3807
3808
|
*/
|
|
3808
3809
|
handleTableRemove(renderData, tableRef) {
|
|
3809
|
-
renderData.
|
|
3810
|
+
renderData.apply(new DeleteTableBlockAction(renderData));
|
|
3810
3811
|
this.destroySelectionAnchor(tableRef);
|
|
3811
3812
|
}
|
|
3812
3813
|
/**
|
|
@@ -7370,9 +7371,10 @@ class VegaRTETableExtension extends linkExtension.VegaRTEExtension {
|
|
|
7370
7371
|
const insertTableBlockStrategy = new InsertTableBlockStrategy();
|
|
7371
7372
|
const deleteTableBlockStrategy = new DeleteTableBlockStrategy();
|
|
7372
7373
|
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.name, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7374
|
+
// Registered on the table block itself (not its parent) so a table can always be
|
|
7375
|
+
// deleted regardless of which block type it is nested in (root content, table cell,
|
|
7376
|
+
// blockquote, or any future container).
|
|
7377
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.name, DELETE_TABLE_BLOCK, deleteTableBlockStrategy);
|
|
7376
7378
|
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.name, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
7377
7379
|
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageBlock.name, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
7378
7380
|
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.name, splitCellOperation.INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION, new InsertTableRowIntoDifferentSectionStrategy());
|
|
@@ -7919,6 +7921,694 @@ class VegaRTEHorizontalLineExtension extends linkExtension.VegaRTEExtension {
|
|
|
7919
7921
|
})();
|
|
7920
7922
|
VegaRTEHorizontalLineExtension.TOOLBAR_BUTTON_KEY = 'horizontalLine';
|
|
7921
7923
|
|
|
7924
|
+
var RTEBlockquoteExtensionAnnotationTypeEnum;
|
|
7925
|
+
(function (RTEBlockquoteExtensionAnnotationTypeEnum) {
|
|
7926
|
+
RTEBlockquoteExtensionAnnotationTypeEnum["BLOCKQUOTE"] = "BLOCKQUOTE";
|
|
7927
|
+
})(RTEBlockquoteExtensionAnnotationTypeEnum || (RTEBlockquoteExtensionAnnotationTypeEnum = {}));
|
|
7928
|
+
/**
|
|
7929
|
+
* CSS class applied to `<blockquote>` elements rendered inside the editor.
|
|
7930
|
+
*/
|
|
7931
|
+
const BLOCKQUOTE_CLASS_NAME = 'v-rte-blockquote';
|
|
7932
|
+
/**
|
|
7933
|
+
* Default visual styles for the `<blockquote>` element in the RTE.
|
|
7934
|
+
*/
|
|
7935
|
+
const BLOCKQUOTE_DEFAULT_STYLES = {
|
|
7936
|
+
overflow: 'hidden',
|
|
7937
|
+
marginInline: '0',
|
|
7938
|
+
paddingInline: '24px',
|
|
7939
|
+
borderInlineStart: 'solid 5px hsl(0, 0%, 80%)',
|
|
7940
|
+
};
|
|
7941
|
+
/**
|
|
7942
|
+
* Blockquote annotation.
|
|
7943
|
+
*/
|
|
7944
|
+
class BlockquoteAnnotation extends codeBlock.BlockAnnotation {
|
|
7945
|
+
constructor() {
|
|
7946
|
+
super(...arguments);
|
|
7947
|
+
this.type = RTEBlockquoteExtensionAnnotationTypeEnum.BLOCKQUOTE;
|
|
7948
|
+
}
|
|
7949
|
+
/**
|
|
7950
|
+
* Generate the map item for the annotation.
|
|
7951
|
+
*
|
|
7952
|
+
* @returns {[RTEBlockquoteExtensionAnnotationTypeEnum.BLOCKQUOTE, BlockquoteAnnotation]} Map item.
|
|
7953
|
+
*/
|
|
7954
|
+
static from() {
|
|
7955
|
+
return [RTEBlockquoteExtensionAnnotationTypeEnum.BLOCKQUOTE, new BlockquoteAnnotation()];
|
|
7956
|
+
}
|
|
7957
|
+
/**
|
|
7958
|
+
* Get the default CSS rule for the blockquote element.
|
|
7959
|
+
*
|
|
7960
|
+
* @returns {string} The default CSS rule.
|
|
7961
|
+
*/
|
|
7962
|
+
static getDefaultCssText() {
|
|
7963
|
+
const declarations = Object.entries(BLOCKQUOTE_DEFAULT_STYLES)
|
|
7964
|
+
.map(([key, value]) => `\t${string.camelToDashCase(key)}: ${value};`)
|
|
7965
|
+
.join('\n');
|
|
7966
|
+
return `.${BLOCKQUOTE_CLASS_NAME} {\n${declarations}\n}`;
|
|
7967
|
+
}
|
|
7968
|
+
/**
|
|
7969
|
+
* @inheritDoc
|
|
7970
|
+
*/
|
|
7971
|
+
toJSON() {
|
|
7972
|
+
// Blockquote identity is captured by the block type; nothing to serialize.
|
|
7973
|
+
return null;
|
|
7974
|
+
}
|
|
7975
|
+
/**
|
|
7976
|
+
* @inheritDoc
|
|
7977
|
+
*/
|
|
7978
|
+
clone() {
|
|
7979
|
+
return new BlockquoteAnnotation();
|
|
7980
|
+
}
|
|
7981
|
+
/**
|
|
7982
|
+
* @inheritDoc
|
|
7983
|
+
*/
|
|
7984
|
+
renderClass(options) {
|
|
7985
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
7986
|
+
return null;
|
|
7987
|
+
return BLOCKQUOTE_CLASS_NAME;
|
|
7988
|
+
}
|
|
7989
|
+
/**
|
|
7990
|
+
* @inheritDoc
|
|
7991
|
+
*/
|
|
7992
|
+
renderStyle(options) {
|
|
7993
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
7994
|
+
return null;
|
|
7995
|
+
return BLOCKQUOTE_DEFAULT_STYLES;
|
|
7996
|
+
}
|
|
7997
|
+
}
|
|
7998
|
+
|
|
7999
|
+
/**
|
|
8000
|
+
* DTO representing a `<blockquote>` block.
|
|
8001
|
+
*/
|
|
8002
|
+
class RTEBlockquoteBlock extends codeBlock.RTEBlock {
|
|
8003
|
+
constructor(id, options) {
|
|
8004
|
+
super(id);
|
|
8005
|
+
this.dtoName = RTEBlockquoteBlock.dtoName;
|
|
8006
|
+
this.type = 'blockquote';
|
|
8007
|
+
this.children = [];
|
|
8008
|
+
const { autoMatchFormat = true } = options !== null && options !== void 0 ? options : {};
|
|
8009
|
+
if (autoMatchFormat) {
|
|
8010
|
+
this.annotationMap = new Map([BlockquoteAnnotation.from()]);
|
|
8011
|
+
}
|
|
8012
|
+
}
|
|
8013
|
+
/**
|
|
8014
|
+
* Convert a JSON block payload into an `RTEBlockquoteBlock` instance.
|
|
8015
|
+
*
|
|
8016
|
+
* @param {VegaRTEBlockquoteBlock} block - JSON payload.
|
|
8017
|
+
* @param {VegaRTETransformOptions} [options] - Transform options.
|
|
8018
|
+
* @returns {RTEBlockquoteBlock} The created blockquote block.
|
|
8019
|
+
*/
|
|
8020
|
+
static from(block, options) {
|
|
8021
|
+
const blockquote = new RTEBlockquoteBlock(block.id, options);
|
|
8022
|
+
if (block.annotations) {
|
|
8023
|
+
codeBlock.RTEBlock.convertAnnotationsToMap(blockquote.annotationMap, block.annotations);
|
|
8024
|
+
}
|
|
8025
|
+
blockquote.children = codeBlock.RTEBlock.generateBlockChildren(block.children, options, blockquote);
|
|
8026
|
+
return blockquote;
|
|
8027
|
+
}
|
|
8028
|
+
/**
|
|
8029
|
+
* @inheritDoc
|
|
8030
|
+
*/
|
|
8031
|
+
clone(parent) {
|
|
8032
|
+
const cloned = new RTEBlockquoteBlock(this.id);
|
|
8033
|
+
const clonedAsChildParent = cloned;
|
|
8034
|
+
cloned.children = this.children.map((child) => child.clone(clonedAsChildParent));
|
|
8035
|
+
cloned.annotationMap = this.cloneAnnotations();
|
|
8036
|
+
cloned.parent = parent;
|
|
8037
|
+
return cloned;
|
|
8038
|
+
}
|
|
8039
|
+
/**
|
|
8040
|
+
* @inheritDoc
|
|
8041
|
+
*/
|
|
8042
|
+
getLastNode() {
|
|
8043
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
8044
|
+
}
|
|
8045
|
+
/**
|
|
8046
|
+
* @inheritDoc
|
|
8047
|
+
*/
|
|
8048
|
+
isNotEmpty() {
|
|
8049
|
+
return this.children.length > 0;
|
|
8050
|
+
}
|
|
8051
|
+
/**
|
|
8052
|
+
* @inheritDoc
|
|
8053
|
+
*/
|
|
8054
|
+
toHtml(options) {
|
|
8055
|
+
const attrStr = this.generateAttributeString(options);
|
|
8056
|
+
const inner = this.children.map((child) => child.toHtml(options)).join('');
|
|
8057
|
+
return `<blockquote${attrStr}>${inner}</blockquote>`;
|
|
8058
|
+
}
|
|
8059
|
+
/**
|
|
8060
|
+
* @inheritDoc
|
|
8061
|
+
*/
|
|
8062
|
+
toJSON() {
|
|
8063
|
+
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: 'blockquote', children: this.children.map((child) => child.toJSON()) });
|
|
8064
|
+
}
|
|
8065
|
+
}
|
|
8066
|
+
RTEBlockquoteBlock.dtoName = 'RTEBlockquoteBlock';
|
|
8067
|
+
|
|
8068
|
+
/**
|
|
8069
|
+
* Wrap the selected blocks into a new `<blockquote>` block while preserving
|
|
8070
|
+
* their order.
|
|
8071
|
+
*/
|
|
8072
|
+
class BlockTransformToBlockquoteStrategy extends codeBlock.ActionHandleStrategy {
|
|
8073
|
+
/**
|
|
8074
|
+
* @inheritDoc
|
|
8075
|
+
*/
|
|
8076
|
+
handleAction(action, target) {
|
|
8077
|
+
const selectedBlocks = action.selectedBlocks;
|
|
8078
|
+
const children = target.children;
|
|
8079
|
+
const selectedSet = new Set(selectedBlocks);
|
|
8080
|
+
const firstIndex = children.indexOf(selectedBlocks[0]);
|
|
8081
|
+
// The selected blocks may not be contiguous in `children` (e.g. a table
|
|
8082
|
+
// sitting between two selected paragraphs must stay untouched), so the
|
|
8083
|
+
// insert position is the first selected block's index, adjusted for any
|
|
8084
|
+
// non-selected siblings that come before it.
|
|
8085
|
+
const insertIndex = children
|
|
8086
|
+
.slice(0, firstIndex)
|
|
8087
|
+
.filter((block) => !selectedSet.has(block)).length;
|
|
8088
|
+
const blockquote = new RTEBlockquoteBlock(misc.generateUUID());
|
|
8089
|
+
blockquote.parent = target;
|
|
8090
|
+
blockquote.children = selectedBlocks;
|
|
8091
|
+
selectedBlocks.forEach((block) => {
|
|
8092
|
+
block.parent = blockquote;
|
|
8093
|
+
});
|
|
8094
|
+
// Remove selected blocks individually rather than assuming a single
|
|
8095
|
+
// contiguous run, so non-selected siblings interleaved with the
|
|
8096
|
+
// selection (e.g. a table) are preserved instead of being spliced away.
|
|
8097
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
8098
|
+
if (selectedSet.has(children[i])) {
|
|
8099
|
+
children.splice(i, 1);
|
|
8100
|
+
}
|
|
8101
|
+
}
|
|
8102
|
+
children.splice(insertIndex, 0, blockquote);
|
|
8103
|
+
}
|
|
8104
|
+
}
|
|
8105
|
+
|
|
8106
|
+
/**
|
|
8107
|
+
* Unwrap a `<blockquote>` — lift its children to the parent in their original
|
|
8108
|
+
* order and remove the blockquote.
|
|
8109
|
+
*/
|
|
8110
|
+
class RemoveBlockquoteStrategy extends codeBlock.ActionHandleStrategy {
|
|
8111
|
+
/**
|
|
8112
|
+
* @inheritDoc
|
|
8113
|
+
*/
|
|
8114
|
+
handleAction(_action, target) {
|
|
8115
|
+
const parent = target.parent;
|
|
8116
|
+
const childrenToLift = [...target.children];
|
|
8117
|
+
if (childrenToLift.length > 0) {
|
|
8118
|
+
parent.apply(new codeBlock.InsertChildrenBeforeAction(target, ...childrenToLift));
|
|
8119
|
+
}
|
|
8120
|
+
parent.apply(new codeBlock.RemoveChildrenAction(target));
|
|
8121
|
+
}
|
|
8122
|
+
}
|
|
8123
|
+
|
|
8124
|
+
/**
|
|
8125
|
+
* Lets the caret exit the blockquote via the keyboard. Pressing Enter on an empty
|
|
8126
|
+
* trailing paragraph inside a blockquote (i.e. the second Enter press at the end of
|
|
8127
|
+
* the quote) moves that empty paragraph out to a new paragraph after the blockquote,
|
|
8128
|
+
* instead of stacking another empty line inside the quote.
|
|
8129
|
+
*/
|
|
8130
|
+
class BlockquoteExitOnEnterInterceptor extends ActionHandlerInterceptor {
|
|
8131
|
+
/**
|
|
8132
|
+
* Intercept only when the caret sits in an empty paragraph that is the last child of a blockquote.
|
|
8133
|
+
*
|
|
8134
|
+
* @param {InsertNewParagraphAction} _action - the action to be intercepted
|
|
8135
|
+
* @param {RTETextBlock} target - the paragraph block receiving the Enter key press
|
|
8136
|
+
* @returns {boolean} - whether the action should be intercepted
|
|
8137
|
+
*/
|
|
8138
|
+
canIntercept(_action, target) {
|
|
8139
|
+
const parent = target.parent;
|
|
8140
|
+
return (parent instanceof RTEBlockquoteBlock &&
|
|
8141
|
+
!target.isNotEmpty() &&
|
|
8142
|
+
parent.children[parent.children.length - 1] === target);
|
|
8143
|
+
}
|
|
8144
|
+
/**
|
|
8145
|
+
* Move the empty paragraph out of the blockquote and place a new paragraph after it.
|
|
8146
|
+
*
|
|
8147
|
+
* @param {ActionHandlerExecution} _execution - the original execution function
|
|
8148
|
+
* @param {InsertNewParagraphAction} action - the action containing insert metadata
|
|
8149
|
+
* @param {RTETextBlock} target - the empty paragraph block to move out of the blockquote
|
|
8150
|
+
*/
|
|
8151
|
+
intercept(_execution, action, target) {
|
|
8152
|
+
const blockquote = target.parent;
|
|
8153
|
+
const newParagraph = this.createNewParagraph('');
|
|
8154
|
+
if (newParagraph) {
|
|
8155
|
+
// Insert the replacement paragraph after the blockquote before removing the
|
|
8156
|
+
// empty one so the blockquote is still present as an anchor for the insert.
|
|
8157
|
+
blockquote.parent.apply(new codeBlock.InsertChildrenAfterAction(blockquote, newParagraph));
|
|
8158
|
+
blockquote.apply(new codeBlock.RemoveChildrenAction(target));
|
|
8159
|
+
action.newBlock = newParagraph;
|
|
8160
|
+
}
|
|
8161
|
+
}
|
|
8162
|
+
/**
|
|
8163
|
+
* Create a new empty paragraph block.
|
|
8164
|
+
*
|
|
8165
|
+
* @param {string} text - paragraph text
|
|
8166
|
+
* @returns {Nullable<RTETextBlock>} - paragraph block when paragraph dto class is available
|
|
8167
|
+
*/
|
|
8168
|
+
createNewParagraph(text) {
|
|
8169
|
+
const dtoClass = codeBlock.RTEDTOClassManager.getRTEBlockClass('paragraph');
|
|
8170
|
+
if (dtoClass) {
|
|
8171
|
+
return dtoClass.from({
|
|
8172
|
+
id: misc.generateUUID(),
|
|
8173
|
+
type: 'paragraph',
|
|
8174
|
+
nodes: [{ id: misc.generateUUID(), type: 'text', text }],
|
|
8175
|
+
});
|
|
8176
|
+
}
|
|
8177
|
+
}
|
|
8178
|
+
}
|
|
8179
|
+
|
|
8180
|
+
/**
|
|
8181
|
+
* Action type discriminator. Plain string constant — intentionally NOT added
|
|
8182
|
+
* to {@link ModifyContentActionType} enum to keep the extension self-contained.
|
|
8183
|
+
*/
|
|
8184
|
+
const TRANSFORM_TO_BLOCKQUOTE = 'TRANSFORM_TO_BLOCKQUOTE';
|
|
8185
|
+
/**
|
|
8186
|
+
* Wrap the supplied blocks into a new `<blockquote>` block while preserving
|
|
8187
|
+
* their order. Strategy reads `selectedBlocks` and replaces them in-place
|
|
8188
|
+
* with a single `RTEBlockquoteBlock` that adopts them as children.
|
|
8189
|
+
*/
|
|
8190
|
+
class TransformToBlockquoteAction extends codeBlock.ModifyContentAction {
|
|
8191
|
+
constructor(selectedBlocks) {
|
|
8192
|
+
super();
|
|
8193
|
+
this.isFlushable = true;
|
|
8194
|
+
this.type = TRANSFORM_TO_BLOCKQUOTE;
|
|
8195
|
+
this.selectedBlocks = selectedBlocks;
|
|
8196
|
+
}
|
|
8197
|
+
}
|
|
8198
|
+
|
|
8199
|
+
/**
|
|
8200
|
+
* Action type discriminator. Plain string constant — intentionally NOT added
|
|
8201
|
+
* to {@link ModifyContentActionType} enum to keep the extension self-contained.
|
|
8202
|
+
*/
|
|
8203
|
+
const REMOVE_BLOCKQUOTE = 'REMOVE_BLOCKQUOTE';
|
|
8204
|
+
/**
|
|
8205
|
+
* Unwrap a `<blockquote>` block — lift its children into the parent in place
|
|
8206
|
+
* and remove the blockquote wrapper. Targets the blockquote block itself.
|
|
8207
|
+
*/
|
|
8208
|
+
class RemoveBlockquoteAction extends codeBlock.ModifyContentAction {
|
|
8209
|
+
constructor() {
|
|
8210
|
+
super(...arguments);
|
|
8211
|
+
this.isFlushable = true;
|
|
8212
|
+
this.type = REMOVE_BLOCKQUOTE;
|
|
8213
|
+
}
|
|
8214
|
+
}
|
|
8215
|
+
|
|
8216
|
+
/**
|
|
8217
|
+
* Claim every `<blockquote>` element encountered during HTML → DTO conversion
|
|
8218
|
+
* and produce an {@link RTEBlockquoteBlock}.
|
|
8219
|
+
*
|
|
8220
|
+
* Nested `<blockquote>` elements are flattened to a single level in
|
|
8221
|
+
* {@link appendChildBlocks}: any direct child that arrives as another
|
|
8222
|
+
* `<blockquote>` is replaced by its own children, lifting them one level up.
|
|
8223
|
+
*/
|
|
8224
|
+
class BlockquoteToBlockquoteBlockStrategy extends contentState.ElementToDTOStrategy {
|
|
8225
|
+
/**
|
|
8226
|
+
* @inheritDoc
|
|
8227
|
+
*/
|
|
8228
|
+
canHandle(elementsArray, currentIndex) {
|
|
8229
|
+
return elementsArray[currentIndex].tagName === 'BLOCKQUOTE' ? 1 : 0;
|
|
8230
|
+
}
|
|
8231
|
+
/**
|
|
8232
|
+
* @inheritDoc
|
|
8233
|
+
*/
|
|
8234
|
+
handle(elementsArray, options) {
|
|
8235
|
+
const element = elementsArray[0];
|
|
8236
|
+
const annotations = contentState.htmlElementToAnnotationGenerator.generate(RTEBlockquoteBlock, element, options);
|
|
8237
|
+
return RTEBlockquoteBlock.from({
|
|
8238
|
+
id: misc.generateUUID(),
|
|
8239
|
+
type: 'blockquote',
|
|
8240
|
+
annotations,
|
|
8241
|
+
children: [],
|
|
8242
|
+
}, options);
|
|
8243
|
+
}
|
|
8244
|
+
/**
|
|
8245
|
+
* Flatten nested `<blockquote>` elements: any direct child that is itself
|
|
8246
|
+
* an {@link RTEBlockquoteBlock} is replaced by its own children, lifting
|
|
8247
|
+
* them one level up.
|
|
8248
|
+
*
|
|
8249
|
+
* @inheritDoc
|
|
8250
|
+
*/
|
|
8251
|
+
appendChildBlocks(currentBlock, childBlocks) {
|
|
8252
|
+
const flattened = childBlocks.flatMap((child) => child instanceof RTEBlockquoteBlock ? child.children : [child]);
|
|
8253
|
+
currentBlock.children = flattened.map((block) => {
|
|
8254
|
+
block.parent = currentBlock;
|
|
8255
|
+
return block;
|
|
8256
|
+
});
|
|
8257
|
+
}
|
|
8258
|
+
/**
|
|
8259
|
+
* @inheritDoc
|
|
8260
|
+
*/
|
|
8261
|
+
shouldProceedToElementChildren() {
|
|
8262
|
+
return true;
|
|
8263
|
+
}
|
|
8264
|
+
}
|
|
8265
|
+
|
|
8266
|
+
/**
|
|
8267
|
+
* Renderer for blockquote blocks in the rich text editor.
|
|
8268
|
+
*/
|
|
8269
|
+
class RTEBlockquoteBlockRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
8270
|
+
/**
|
|
8271
|
+
* @inheritDoc
|
|
8272
|
+
*/
|
|
8273
|
+
doRender(createElement, block, rteContext) {
|
|
8274
|
+
var _a;
|
|
8275
|
+
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()));
|
|
8276
|
+
}
|
|
8277
|
+
/**
|
|
8278
|
+
* @inheritDoc
|
|
8279
|
+
*/
|
|
8280
|
+
injectRTEScopeStyles() {
|
|
8281
|
+
return BlockquoteAnnotation.getDefaultCssText();
|
|
8282
|
+
}
|
|
8283
|
+
}
|
|
8284
|
+
const RTEBlockquoteBlockRenderer$1 = new RTEBlockquoteBlockRenderer();
|
|
8285
|
+
|
|
8286
|
+
// FontAwesome 7.2.0 — `quote-left` (solid).
|
|
8287
|
+
const QuoteLeftIcon = {
|
|
8288
|
+
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>`,
|
|
8289
|
+
};
|
|
8290
|
+
|
|
8291
|
+
/**
|
|
8292
|
+
* Toolbar button renderer for the blockquote extension.
|
|
8293
|
+
*
|
|
8294
|
+
* Behaviors implemented:
|
|
8295
|
+
* - Active (`selected`) when the caret/selection is inside any blockquote
|
|
8296
|
+
* ancestor.
|
|
8297
|
+
* - Click wraps the current block(s) into a new `<blockquote>`, or unwraps
|
|
8298
|
+
* the nearest blockquote ancestor when active. Inside a list, the entire
|
|
8299
|
+
* list is wrapped (escalating to the outermost list block). With no
|
|
8300
|
+
* selection, a new empty blockquote is appended at the end and focused.
|
|
8301
|
+
* - Disabled when the wrap container does not support the wrap strategy
|
|
8302
|
+
* (e.g. inside a code block or function block); the button remains
|
|
8303
|
+
* enabled inside a blockquote so it can be toggled off, and with no
|
|
8304
|
+
* selection so it can append a new blockquote.
|
|
8305
|
+
* - Hidden in source-edit mode (inherited from {@link VegaRTEToolbarButtonRenderer}).
|
|
8306
|
+
*/
|
|
8307
|
+
class RTEBlockquoteToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
8308
|
+
/**
|
|
8309
|
+
* @inheritDoc
|
|
8310
|
+
*/
|
|
8311
|
+
render(createElement, editorContext) {
|
|
8312
|
+
return this.renderButton(createElement, editorContext, {
|
|
8313
|
+
icon: 'quote-left',
|
|
8314
|
+
tooltip: { text: 'Block quote' },
|
|
8315
|
+
});
|
|
8316
|
+
}
|
|
8317
|
+
/**
|
|
8318
|
+
* @inheritDoc
|
|
8319
|
+
*/
|
|
8320
|
+
isSelected(editorContext) {
|
|
8321
|
+
const startNode = this.getStartNode(editorContext);
|
|
8322
|
+
return startNode ? this.findBlockquoteAncestor(startNode) !== null : false;
|
|
8323
|
+
}
|
|
8324
|
+
/**
|
|
8325
|
+
* @inheritDoc
|
|
8326
|
+
*/
|
|
8327
|
+
isDisabled(editorContext) {
|
|
8328
|
+
if (editorContext.host.disabled) {
|
|
8329
|
+
return true;
|
|
8330
|
+
}
|
|
8331
|
+
const startNode = this.getStartNode(editorContext);
|
|
8332
|
+
// No selection — click appends a new blockquote at the end.
|
|
8333
|
+
// Inside a blockquote — click toggles it off.
|
|
8334
|
+
// Either way, the button stays enabled.
|
|
8335
|
+
if (!startNode || this.findBlockquoteAncestor(startNode) !== null) {
|
|
8336
|
+
return false;
|
|
8337
|
+
}
|
|
8338
|
+
const { container } = this.resolveWrapAnchor(startNode.parent);
|
|
8339
|
+
return !codeBlock.ActionHandleStrategyRegistry.canHandle(TRANSFORM_TO_BLOCKQUOTE, container);
|
|
8340
|
+
}
|
|
8341
|
+
/**
|
|
8342
|
+
* @inheritDoc
|
|
8343
|
+
*/
|
|
8344
|
+
handleButtonClick(editorContext) {
|
|
8345
|
+
const context = this.getExtensionContext(editorContext.host);
|
|
8346
|
+
if (context) {
|
|
8347
|
+
const { host, getSelectedNodes } = context;
|
|
8348
|
+
const selectedNodes = getSelectedNodes();
|
|
8349
|
+
const startNode = selectedNodes[0];
|
|
8350
|
+
if (!startNode) {
|
|
8351
|
+
// No active selection → append a new empty blockquote at the end (mirrors text-style toolbar).
|
|
8352
|
+
this.appendEmptyBlockquote(host.value);
|
|
8353
|
+
return;
|
|
8354
|
+
}
|
|
8355
|
+
// Direction is decided by the first selected block only.
|
|
8356
|
+
if (this.findBlockquoteAncestor(startNode)) {
|
|
8357
|
+
const blockquoteAncestors = this.collectBlockquoteAncestors(selectedNodes);
|
|
8358
|
+
blockquoteAncestors.forEach((blockquote) => {
|
|
8359
|
+
blockquote.apply(new RemoveBlockquoteAction());
|
|
8360
|
+
});
|
|
8361
|
+
}
|
|
8362
|
+
else {
|
|
8363
|
+
this.wrapSelectedBlocks(selectedNodes);
|
|
8364
|
+
}
|
|
8365
|
+
host.value.apply(new contentState.UpdateCursorPositionAction(startNode, editorContext.rteRange.startOffset));
|
|
8366
|
+
}
|
|
8367
|
+
}
|
|
8368
|
+
/* istanbul ignore next */
|
|
8369
|
+
/**
|
|
8370
|
+
* @inheritDoc
|
|
8371
|
+
*/
|
|
8372
|
+
handleDropdownClick() {
|
|
8373
|
+
// No dropdown — single toggle button.
|
|
8374
|
+
}
|
|
8375
|
+
/**
|
|
8376
|
+
* Append an empty paragraph wrapped in a new blockquote to the end of the
|
|
8377
|
+
* content and place the caret inside it.
|
|
8378
|
+
*
|
|
8379
|
+
* @param {VegaRTEContent} content - Editor content to append to.
|
|
8380
|
+
*/
|
|
8381
|
+
appendEmptyBlockquote(content) {
|
|
8382
|
+
if (content.children.length > 0) {
|
|
8383
|
+
const lastBlock = content.children[content.children.length - 1];
|
|
8384
|
+
const newBlock = codeBlock.RTETextBlock.from({
|
|
8385
|
+
id: misc.generateUUID(),
|
|
8386
|
+
type: 'paragraph',
|
|
8387
|
+
nodes: [{ id: misc.generateUUID(), type: 'text', text: '' }],
|
|
8388
|
+
});
|
|
8389
|
+
content.apply(new codeBlock.InsertChildrenAfterAction(lastBlock, newBlock));
|
|
8390
|
+
content.apply(new TransformToBlockquoteAction([newBlock]));
|
|
8391
|
+
content.apply(new contentState.UpdateCursorPositionAction(newBlock.getLastNode(), 0));
|
|
8392
|
+
}
|
|
8393
|
+
}
|
|
8394
|
+
/**
|
|
8395
|
+
* Wrap the selection's unique parent blocks into a new blockquote. Blocks
|
|
8396
|
+
* inside a list or other nested container escalate to the top-level block.
|
|
8397
|
+
* When the selection spans multiple top-level (root) blocks, any scoped
|
|
8398
|
+
* container touched along the way (e.g. a table cell) is treated as an
|
|
8399
|
+
* opaque block instead of an independent wrap target — the whole
|
|
8400
|
+
* selection wraps as one, and any blockquote nested deeper than the
|
|
8401
|
+
* top-level block (e.g. inside a table cell) is left untouched. Existing
|
|
8402
|
+
* top-level blockquote blocks in the selection are merged (flattened)
|
|
8403
|
+
* into the new one rather than nested.
|
|
8404
|
+
*
|
|
8405
|
+
* @param {RTENode[]} selectedNodes - Currently selected nodes.
|
|
8406
|
+
*/
|
|
8407
|
+
wrapSelectedBlocks(selectedNodes) {
|
|
8408
|
+
var _a, _b;
|
|
8409
|
+
const uniqueBlocks = this.getUniqueBlocks(selectedNodes);
|
|
8410
|
+
// If the selection spans more than one top-level block, force every
|
|
8411
|
+
// anchor resolution to escalate all the way to the root, ignoring any
|
|
8412
|
+
// scoped container (e.g. a table cell) it passes through.
|
|
8413
|
+
const rootAncestors = new Set(uniqueBlocks.map((block) => { var _a; return (_a = this.resolveWrapAnchor(block, true).wrapBlock) !== null && _a !== void 0 ? _a : block; }));
|
|
8414
|
+
const forceRootScope = rootAncestors.size > 1;
|
|
8415
|
+
// Pass 1: unwrap any existing blockquote reachable from the selection so it merges instead of nesting.
|
|
8416
|
+
const alreadyUnwrapped = new Set();
|
|
8417
|
+
for (const block of uniqueBlocks) {
|
|
8418
|
+
const { wrapBlock } = this.resolveWrapAnchor(block, forceRootScope);
|
|
8419
|
+
if (wrapBlock instanceof RTEBlockquoteBlock && !alreadyUnwrapped.has(wrapBlock)) {
|
|
8420
|
+
alreadyUnwrapped.add(wrapBlock);
|
|
8421
|
+
wrapBlock.apply(new RemoveBlockquoteAction());
|
|
8422
|
+
}
|
|
8423
|
+
}
|
|
8424
|
+
// Pass 2: group targets by their resolved container so each container is wrapped independently.
|
|
8425
|
+
const containerMap = new Map();
|
|
8426
|
+
for (const block of uniqueBlocks) {
|
|
8427
|
+
const anchor = this.resolveWrapAnchor(block, forceRootScope);
|
|
8428
|
+
const { container } = anchor;
|
|
8429
|
+
if (container) {
|
|
8430
|
+
const target = (_a = anchor.wrapBlock) !== null && _a !== void 0 ? _a : block;
|
|
8431
|
+
const targets = (_b = containerMap.get(container)) !== null && _b !== void 0 ? _b : new Set();
|
|
8432
|
+
targets.add(target);
|
|
8433
|
+
containerMap.set(container, targets);
|
|
8434
|
+
}
|
|
8435
|
+
}
|
|
8436
|
+
for (const [container, targets] of containerMap) {
|
|
8437
|
+
container.apply(new TransformToBlockquoteAction([...targets]));
|
|
8438
|
+
}
|
|
8439
|
+
}
|
|
8440
|
+
/**
|
|
8441
|
+
* Resolve the starting node of the current toolbar selection, if any.
|
|
8442
|
+
*
|
|
8443
|
+
* @param {VegaRTEToolbarRenderContext} editorContext - Render context.
|
|
8444
|
+
* @returns {Nullable<RTENode>} The first selected node, or null.
|
|
8445
|
+
*/
|
|
8446
|
+
getStartNode(editorContext) {
|
|
8447
|
+
const context = this.getExtensionContext(editorContext.host);
|
|
8448
|
+
return context === null || context === void 0 ? void 0 : context.getSelectedNodes()[0];
|
|
8449
|
+
}
|
|
8450
|
+
/**
|
|
8451
|
+
* Collect the unique closest blockquote ancestors of every selected node.
|
|
8452
|
+
* Multiple selected nodes that share the same blockquote ancestor collapse
|
|
8453
|
+
* into a single entry, so applying {@link RemoveBlockquoteAction} to each
|
|
8454
|
+
* result unwraps every distinct blockquote in the selection exactly once.
|
|
8455
|
+
*
|
|
8456
|
+
* @param {RTENode[]} nodes - Selected nodes.
|
|
8457
|
+
* @returns {Set<RTEBlockquoteBlock>} Unique blockquote ancestors, preserving insertion order.
|
|
8458
|
+
*/
|
|
8459
|
+
collectBlockquoteAncestors(nodes) {
|
|
8460
|
+
const ancestors = new Set();
|
|
8461
|
+
nodes.forEach((node) => {
|
|
8462
|
+
const ancestor = this.findBlockquoteAncestor(node);
|
|
8463
|
+
if (ancestor) {
|
|
8464
|
+
ancestors.add(ancestor);
|
|
8465
|
+
}
|
|
8466
|
+
});
|
|
8467
|
+
return ancestors;
|
|
8468
|
+
}
|
|
8469
|
+
/**
|
|
8470
|
+
* Walk up the block ancestors of the supplied node looking for an
|
|
8471
|
+
* {@link RTEBlockquoteBlock}.
|
|
8472
|
+
*
|
|
8473
|
+
* @param {RTENode} node - Starting node.
|
|
8474
|
+
* @returns {Nullable<RTEBlockquoteBlock>} The closest blockquote ancestor, or null.
|
|
8475
|
+
*/
|
|
8476
|
+
findBlockquoteAncestor(node) {
|
|
8477
|
+
let current = node.parent;
|
|
8478
|
+
while (current && !(current instanceof contentState.VegaRTEContent)) {
|
|
8479
|
+
if (current instanceof RTEBlockquoteBlock) {
|
|
8480
|
+
return current;
|
|
8481
|
+
}
|
|
8482
|
+
current = current.parent;
|
|
8483
|
+
}
|
|
8484
|
+
return null;
|
|
8485
|
+
}
|
|
8486
|
+
/**
|
|
8487
|
+
* Collect unique block ancestors (immediate parent blocks) from a list of
|
|
8488
|
+
* selected nodes, preserving order of first appearance.
|
|
8489
|
+
*
|
|
8490
|
+
* @param {RTENode[]} nodes - Selected nodes.
|
|
8491
|
+
* @returns {RTEBlock[]} Unique parent blocks.
|
|
8492
|
+
*/
|
|
8493
|
+
getUniqueBlocks(nodes) {
|
|
8494
|
+
const seen = new Set();
|
|
8495
|
+
const result = [];
|
|
8496
|
+
nodes.forEach((node) => {
|
|
8497
|
+
const block = node.parent;
|
|
8498
|
+
if (block && !seen.has(block)) {
|
|
8499
|
+
seen.add(block);
|
|
8500
|
+
result.push(block);
|
|
8501
|
+
}
|
|
8502
|
+
});
|
|
8503
|
+
return result;
|
|
8504
|
+
}
|
|
8505
|
+
/**
|
|
8506
|
+
* Walk up from `block` to find the nearest ancestor that is a direct child
|
|
8507
|
+
* of a container registered to handle {@link TRANSFORM_TO_BLOCKQUOTE}
|
|
8508
|
+
* (e.g. {@link VegaRTEContent}, {@link RTETableCellBlock}).
|
|
8509
|
+
*
|
|
8510
|
+
* Stops as soon as the parent can handle the wrap action, so that blocks
|
|
8511
|
+
* inside a table cell are scoped to the cell (not escalated to the root)
|
|
8512
|
+
* while blocks inside a list are still escalated to the top-level list.
|
|
8513
|
+
* Pass `forceRootScope` to ignore scoped containers and always escalate
|
|
8514
|
+
* to the root — used when the overall selection spans multiple top-level
|
|
8515
|
+
* blocks, so a table (or any other scoped container) is wrapped as a
|
|
8516
|
+
* single opaque block alongside its siblings instead of independently.
|
|
8517
|
+
*
|
|
8518
|
+
* @param {RTEBlock} block - Immediate parent block of the selected node.
|
|
8519
|
+
* @param {boolean} [forceRootScope] - Ignore scoped containers and escalate to the root.
|
|
8520
|
+
* @returns {WrapAnchor} `wrapBlock` is the top-level ancestor when the block
|
|
8521
|
+
* is nested (otherwise null); `container` is the nearest wrap-capable parent.
|
|
8522
|
+
*/
|
|
8523
|
+
resolveWrapAnchor(block, forceRootScope = false) {
|
|
8524
|
+
let current = block;
|
|
8525
|
+
while (current.parent &&
|
|
8526
|
+
!(current.parent instanceof contentState.VegaRTEContent) &&
|
|
8527
|
+
(forceRootScope ||
|
|
8528
|
+
!codeBlock.ActionHandleStrategyRegistry.canHandle(TRANSFORM_TO_BLOCKQUOTE, current.parent))) {
|
|
8529
|
+
current = current.parent;
|
|
8530
|
+
}
|
|
8531
|
+
const wrapBlock = current !== block ? current : null;
|
|
8532
|
+
const container = current.parent;
|
|
8533
|
+
return { wrapBlock, container };
|
|
8534
|
+
}
|
|
8535
|
+
}
|
|
8536
|
+
(() => {
|
|
8537
|
+
internalIconManager.VegaInternalIconManager.register({ 'quote-left': QuoteLeftIcon });
|
|
8538
|
+
})();
|
|
8539
|
+
|
|
8540
|
+
/**
|
|
8541
|
+
* Filter styles strategy for blockquote blocks.
|
|
8542
|
+
* Strips default blockquote visual styles during output and refills them during input,
|
|
8543
|
+
* ensuring source edit round-trips do not lose information.
|
|
8544
|
+
*/
|
|
8545
|
+
class BlockquoteFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
8546
|
+
constructor() {
|
|
8547
|
+
super(...arguments);
|
|
8548
|
+
this.stylesToBeFiltered = BLOCKQUOTE_DEFAULT_STYLES;
|
|
8549
|
+
this.elementTagName = 'blockquote';
|
|
8550
|
+
}
|
|
8551
|
+
/**
|
|
8552
|
+
* Checks if the given block dto class name corresponds to a blockquote block.
|
|
8553
|
+
*
|
|
8554
|
+
* @param {string} className The class name to check.
|
|
8555
|
+
* @returns {boolean} True if the class name corresponds to a blockquote block, false otherwise.
|
|
8556
|
+
*/
|
|
8557
|
+
static isBlockquoteBlock(className) {
|
|
8558
|
+
return className === 'RTEBlockquoteBlock';
|
|
8559
|
+
}
|
|
8560
|
+
/**
|
|
8561
|
+
* @inheritDoc
|
|
8562
|
+
*/
|
|
8563
|
+
canFilter(blockOrNodeInstance) {
|
|
8564
|
+
return BlockquoteFilterStylesStrategy.isBlockquoteBlock(blockOrNodeInstance.dtoName);
|
|
8565
|
+
}
|
|
8566
|
+
/**
|
|
8567
|
+
* @inheritDoc
|
|
8568
|
+
*/
|
|
8569
|
+
canRefill(_blockOrNodeClassName, element) {
|
|
8570
|
+
return element.tagName.toLowerCase() === this.elementTagName;
|
|
8571
|
+
}
|
|
8572
|
+
/**
|
|
8573
|
+
* @inheritDoc
|
|
8574
|
+
*/
|
|
8575
|
+
toCssText() {
|
|
8576
|
+
return this.buildCssTextForStyles(this.elementTagName, this.classNameToBeAdded);
|
|
8577
|
+
}
|
|
8578
|
+
}
|
|
8579
|
+
|
|
8580
|
+
/**
|
|
8581
|
+
* Adds `<blockquote>` support to the Vega Rich Text Editor.
|
|
8582
|
+
*/
|
|
8583
|
+
class VegaRTEBlockquoteExtension extends linkExtension.VegaRTEExtension {
|
|
8584
|
+
constructor() {
|
|
8585
|
+
super();
|
|
8586
|
+
this.toolbarButtonRenderer = new RTEBlockquoteToolbarButtonRenderer();
|
|
8587
|
+
this.registerBlockBasicStrategies(RTEBlockquoteBlock.name);
|
|
8588
|
+
this.registerNode('blockquote', RTEBlockquoteBlock);
|
|
8589
|
+
this.registerRenderer('blockquote', RTEBlockquoteBlockRenderer$1);
|
|
8590
|
+
this.registerToolbarButtonRenderer(VegaRTEBlockquoteExtension.TOOLBAR_BUTTON_KEY, this.toolbarButtonRenderer);
|
|
8591
|
+
this.registerElementToBlockDTOClassStrategy(new BlockquoteToBlockquoteBlockStrategy());
|
|
8592
|
+
// Register filter styles strategy for source edit round-trip.
|
|
8593
|
+
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(RTEBlockquoteBlock.dtoName, new BlockquoteFilterStylesStrategy());
|
|
8594
|
+
}
|
|
8595
|
+
}
|
|
8596
|
+
(() => {
|
|
8597
|
+
const wrapStrategy = new BlockTransformToBlockquoteStrategy();
|
|
8598
|
+
// Root container — wrap top-level blocks.
|
|
8599
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.name, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
8600
|
+
// Table cells (body + header) — wrap is scoped to the closest cell.
|
|
8601
|
+
// Other container blocks (code, list item, function) are intentionally
|
|
8602
|
+
// not registered, so the toolbar stays disabled inside them.
|
|
8603
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.name, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
8604
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.name, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
8605
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTEBlockquoteBlock.name, REMOVE_BLOCKQUOTE, new RemoveBlockquoteStrategy());
|
|
8606
|
+
// Enables exiting the blockquote via the keyboard: pressing Enter on an empty
|
|
8607
|
+
// trailing paragraph breaks out to a new paragraph after the blockquote.
|
|
8608
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.name, codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, new BlockquoteExitOnEnterInterceptor());
|
|
8609
|
+
})();
|
|
8610
|
+
VegaRTEBlockquoteExtension.TOOLBAR_BUTTON_KEY = 'blockquote';
|
|
8611
|
+
|
|
7922
8612
|
const ARROW_CHARACTERS = [
|
|
7923
8613
|
{ character: '←', title: 'leftwards simple arrow' },
|
|
7924
8614
|
{ character: '→', title: 'rightwards simple arrow' },
|
|
@@ -10040,6 +10730,599 @@ class VegaRTELineHeightExtension extends linkExtension.VegaRTEExtension {
|
|
|
10040
10730
|
})();
|
|
10041
10731
|
VegaRTELineHeightExtension.TOOLBAR_BUTTON_KEY = 'lineHeight';
|
|
10042
10732
|
|
|
10733
|
+
const paste = {
|
|
10734
|
+
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>`,
|
|
10735
|
+
};
|
|
10736
|
+
|
|
10737
|
+
/**
|
|
10738
|
+
* Renders and manages the paste format chooser UI.
|
|
10739
|
+
*/
|
|
10740
|
+
class RTEPasteChooserUI {
|
|
10741
|
+
constructor(hostRoot, callbacks) {
|
|
10742
|
+
this.hostRoot = hostRoot;
|
|
10743
|
+
this.callbacks = callbacks;
|
|
10744
|
+
this.chooserEl = null;
|
|
10745
|
+
this.dropdownEl = null;
|
|
10746
|
+
this.triggerButtonEl = null;
|
|
10747
|
+
}
|
|
10748
|
+
/**
|
|
10749
|
+
* Opens the paste-mode chooser at the given position.
|
|
10750
|
+
*
|
|
10751
|
+
* @param {PasteChooserPosition} position Viewport position for the chooser.
|
|
10752
|
+
*/
|
|
10753
|
+
open(position) {
|
|
10754
|
+
this.destroy();
|
|
10755
|
+
const doc = this.hostRoot.ownerDocument;
|
|
10756
|
+
const chooser = doc.createElement('div');
|
|
10757
|
+
chooser.setAttribute(RTEPasteChooserUI.CHOOSER_ATTR, 'true');
|
|
10758
|
+
chooser.style.position = 'fixed';
|
|
10759
|
+
chooser.style.zIndex = '1000';
|
|
10760
|
+
chooser.style.left = `${position.left}px`;
|
|
10761
|
+
chooser.style.top = `${position.top}px`;
|
|
10762
|
+
const dropdownEl = this.createPasteChooserDropdown(doc, position.placement);
|
|
10763
|
+
dropdownEl.placement = position.placement;
|
|
10764
|
+
chooser.append(dropdownEl);
|
|
10765
|
+
this.hostRoot.appendChild(chooser);
|
|
10766
|
+
this.chooserEl = chooser;
|
|
10767
|
+
this.dropdownEl = dropdownEl;
|
|
10768
|
+
dropdownEl.addEventListener('vegaShow', () => {
|
|
10769
|
+
if (this.triggerButtonEl) {
|
|
10770
|
+
this.triggerButtonEl.selected = true;
|
|
10771
|
+
}
|
|
10772
|
+
});
|
|
10773
|
+
dropdownEl.addEventListener('vegaHide', () => {
|
|
10774
|
+
if (this.triggerButtonEl) {
|
|
10775
|
+
this.triggerButtonEl.selected = false;
|
|
10776
|
+
}
|
|
10777
|
+
});
|
|
10778
|
+
}
|
|
10779
|
+
/**
|
|
10780
|
+
* Removes the chooser from the DOM.
|
|
10781
|
+
*/
|
|
10782
|
+
destroy() {
|
|
10783
|
+
var _a;
|
|
10784
|
+
if (this.dropdownEl && typeof this.dropdownEl.hide === 'function') {
|
|
10785
|
+
void this.dropdownEl.hide();
|
|
10786
|
+
}
|
|
10787
|
+
if ((_a = this.chooserEl) === null || _a === void 0 ? void 0 : _a.parentNode) {
|
|
10788
|
+
this.chooserEl.parentNode.removeChild(this.chooserEl);
|
|
10789
|
+
}
|
|
10790
|
+
if (this.triggerButtonEl) {
|
|
10791
|
+
this.triggerButtonEl.selected = false;
|
|
10792
|
+
}
|
|
10793
|
+
this.dropdownEl = null;
|
|
10794
|
+
this.chooserEl = null;
|
|
10795
|
+
this.triggerButtonEl = null;
|
|
10796
|
+
}
|
|
10797
|
+
/**
|
|
10798
|
+
* Determines whether the given event path targets the chooser.
|
|
10799
|
+
*
|
|
10800
|
+
* @param {EventTarget[]} eventPath Composed path of an event.
|
|
10801
|
+
* @returns {boolean} `true` when the path includes the chooser.
|
|
10802
|
+
*/
|
|
10803
|
+
includesEventPath(eventPath) {
|
|
10804
|
+
if (!this.chooserEl) {
|
|
10805
|
+
return false;
|
|
10806
|
+
}
|
|
10807
|
+
const isDropdownContentClick = eventPath.some((target) => {
|
|
10808
|
+
return 'tagName' in target && target.tagName === 'VEGA-DROPDOWN-CONTENT-BOX';
|
|
10809
|
+
});
|
|
10810
|
+
return eventPath.includes(this.chooserEl) || isDropdownContentClick;
|
|
10811
|
+
}
|
|
10812
|
+
/**
|
|
10813
|
+
* Builds the dropdown element with the rich text paste option.
|
|
10814
|
+
*
|
|
10815
|
+
* @param {Document} doc Document used to create elements.
|
|
10816
|
+
* @param {['bottom', 'top'] | ['top', 'bottom']} placement Preferred placement order.
|
|
10817
|
+
* @returns {HTMLElement} Configured dropdown element.
|
|
10818
|
+
*/
|
|
10819
|
+
createPasteChooserDropdown(doc, placement) {
|
|
10820
|
+
const dropdownEl = doc.createElement('vega-dropdown');
|
|
10821
|
+
dropdownEl.trigger = 'click';
|
|
10822
|
+
dropdownEl.selectType = 'single';
|
|
10823
|
+
dropdownEl.selectedSourceKey = 'rich';
|
|
10824
|
+
dropdownEl.maxWidth = 220;
|
|
10825
|
+
dropdownEl.alignment = 'start';
|
|
10826
|
+
dropdownEl.itemDisplayRule = 'ellipsis';
|
|
10827
|
+
const triggerButton = doc.createElement('vega-rich-text-editor-toolbar-button');
|
|
10828
|
+
const arrowIcon = placement[0] === 'top' ? 'chevron-up' : 'chevron-down';
|
|
10829
|
+
triggerButton.setAttribute(RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR, 'true');
|
|
10830
|
+
triggerButton.setAttribute('aria-label', internalTranslationController.VegaInternalTranslation.t('Paste options'));
|
|
10831
|
+
triggerButton.setAttribute('arrow-icon', arrowIcon);
|
|
10832
|
+
triggerButton.icon = 'rte-paste';
|
|
10833
|
+
triggerButton.showArrowIcon = true;
|
|
10834
|
+
triggerButton.selected = false;
|
|
10835
|
+
this.triggerButtonEl = triggerButton;
|
|
10836
|
+
const tooltipEl = doc.createElement('vega-tooltip');
|
|
10837
|
+
tooltipEl.text = internalTranslationController.VegaInternalTranslation.t('Paste options');
|
|
10838
|
+
tooltipEl.placement = ['bottom', 'top'];
|
|
10839
|
+
tooltipEl.append(triggerButton);
|
|
10840
|
+
dropdownEl.append(tooltipEl);
|
|
10841
|
+
const itemsContainer = doc.createElement('div');
|
|
10842
|
+
itemsContainer.setAttribute('slot', 'items');
|
|
10843
|
+
itemsContainer.append(this.createDropdownItem(doc, 'rich', internalTranslationController.VegaInternalTranslation.t('Use rich text'), RTEPasteChooserUI.CHOOSER_RICH_ATTR));
|
|
10844
|
+
dropdownEl.append(itemsContainer);
|
|
10845
|
+
dropdownEl.addEventListener('vegaDropdownClick', (event) => {
|
|
10846
|
+
const mode = event.detail;
|
|
10847
|
+
if (mode === 'rich') {
|
|
10848
|
+
this.callbacks.onModeSelect(mode);
|
|
10849
|
+
}
|
|
10850
|
+
});
|
|
10851
|
+
return dropdownEl;
|
|
10852
|
+
}
|
|
10853
|
+
/**
|
|
10854
|
+
* Creates a single dropdown item element for a paste mode.
|
|
10855
|
+
*
|
|
10856
|
+
* @param {Document} doc Document used to create the element.
|
|
10857
|
+
* @param {PasteMode} key Paste mode key for the item.
|
|
10858
|
+
* @param {string} label Display label for the item.
|
|
10859
|
+
* @param {string} dataAttrName Data attribute marker for the item.
|
|
10860
|
+
* @returns {HTMLVegaDropdownItemElement} Configured dropdown item element.
|
|
10861
|
+
*/
|
|
10862
|
+
createDropdownItem(doc, key, label, dataAttrName) {
|
|
10863
|
+
const itemEl = doc.createElement('vega-dropdown-item');
|
|
10864
|
+
itemEl.itemKey = key;
|
|
10865
|
+
itemEl.label = label;
|
|
10866
|
+
itemEl.setAttribute(dataAttrName, 'true');
|
|
10867
|
+
return itemEl;
|
|
10868
|
+
}
|
|
10869
|
+
}
|
|
10870
|
+
(() => {
|
|
10871
|
+
internalIconManager.VegaInternalIconManager.register({
|
|
10872
|
+
'rte-paste': paste,
|
|
10873
|
+
});
|
|
10874
|
+
})();
|
|
10875
|
+
RTEPasteChooserUI.CHOOSER_ATTR = 'data-rte-paste-chooser';
|
|
10876
|
+
RTEPasteChooserUI.CHOOSER_RICH_ATTR = 'data-rte-paste-type-rich';
|
|
10877
|
+
RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR = 'data-rte-paste-trigger';
|
|
10878
|
+
|
|
10879
|
+
/**
|
|
10880
|
+
* Custom DataTransfer MIME type used to tag a synthetic paste with the chosen
|
|
10881
|
+
* paste mode (e.g. 'rich' or 'plain'), so downstream paste handling can decide
|
|
10882
|
+
* whether to preserve the original inline styles.
|
|
10883
|
+
*/
|
|
10884
|
+
const RTE_PASTE_MODE_DATA_TYPE = 'application/x-vega-rte-paste-mode';
|
|
10885
|
+
|
|
10886
|
+
/**
|
|
10887
|
+
* Vega Rich Text Editor paste extension.
|
|
10888
|
+
* Intercepts keyboard paste and allows users to choose paste mode.
|
|
10889
|
+
*/
|
|
10890
|
+
class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
10891
|
+
constructor() {
|
|
10892
|
+
super(...arguments);
|
|
10893
|
+
this.editableEl = null;
|
|
10894
|
+
this.contentHostEl = null;
|
|
10895
|
+
this.chooserUI = null;
|
|
10896
|
+
this.pendingPastePayload = null;
|
|
10897
|
+
this.listenerDocument = null;
|
|
10898
|
+
this.listenerWindow = null;
|
|
10899
|
+
/**
|
|
10900
|
+
* Handles a native paste event by capturing the clipboard payload and
|
|
10901
|
+
* rendering the paste-mode chooser.
|
|
10902
|
+
*
|
|
10903
|
+
* @param {ClipboardEvent} event Native clipboard paste event.
|
|
10904
|
+
*/
|
|
10905
|
+
this.handlePasteEvent = (event) => {
|
|
10906
|
+
var _a, _b;
|
|
10907
|
+
const clipboardData = event.clipboardData;
|
|
10908
|
+
if (!clipboardData) {
|
|
10909
|
+
return;
|
|
10910
|
+
}
|
|
10911
|
+
// HTML is sanitized via DOMParser and ElementToDtoStrategyProcessor pipeline
|
|
10912
|
+
const html = clipboardData.getData('text/html') || '';
|
|
10913
|
+
const text = clipboardData.getData('text/plain') || '';
|
|
10914
|
+
if (!html && !text) {
|
|
10915
|
+
// Empty clipboard paste should not mutate editor content.
|
|
10916
|
+
event.preventDefault();
|
|
10917
|
+
event.stopPropagation();
|
|
10918
|
+
return;
|
|
10919
|
+
}
|
|
10920
|
+
event.preventDefault();
|
|
10921
|
+
event.stopPropagation();
|
|
10922
|
+
const range = this.cloneCurrentSelectionRange();
|
|
10923
|
+
const selectedNodes = ((_b = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelectedNodes) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
|
|
10924
|
+
this.pendingPastePayload = { html, text, range, selectedNodes: [...selectedNodes] };
|
|
10925
|
+
this.renderPasteChooser(event);
|
|
10926
|
+
};
|
|
10927
|
+
/**
|
|
10928
|
+
* Dismisses the chooser when a pointer interaction occurs outside of it.
|
|
10929
|
+
*
|
|
10930
|
+
* @param {Event} event Pointer event captured on the document.
|
|
10931
|
+
*/
|
|
10932
|
+
this.handleOutsidePointerDown = (event) => {
|
|
10933
|
+
if (!this.chooserUI) {
|
|
10934
|
+
return;
|
|
10935
|
+
}
|
|
10936
|
+
const eventPath = typeof event.composedPath === 'function' ? event.composedPath() : [];
|
|
10937
|
+
if (this.chooserUI.includesEventPath(eventPath)) {
|
|
10938
|
+
return;
|
|
10939
|
+
}
|
|
10940
|
+
this.clearPasteChooser();
|
|
10941
|
+
};
|
|
10942
|
+
/**
|
|
10943
|
+
* Dismisses the chooser when the Escape key is pressed.
|
|
10944
|
+
*
|
|
10945
|
+
* @param {KeyboardEvent} event Keyboard event captured on the document.
|
|
10946
|
+
*/
|
|
10947
|
+
this.handleOutsideKeyDown = (event) => {
|
|
10948
|
+
if (event.key === 'Escape') {
|
|
10949
|
+
this.clearPasteChooser();
|
|
10950
|
+
}
|
|
10951
|
+
};
|
|
10952
|
+
/**
|
|
10953
|
+
* Dismisses the chooser when any relevant scroll container scrolls.
|
|
10954
|
+
*/
|
|
10955
|
+
this.handleOutsideScroll = () => {
|
|
10956
|
+
this.clearPasteChooser();
|
|
10957
|
+
};
|
|
10958
|
+
}
|
|
10959
|
+
/** @inheritDoc */
|
|
10960
|
+
initialExtensionAfterLoad(context) {
|
|
10961
|
+
super.initialExtensionAfterLoad(context);
|
|
10962
|
+
this.hostEl = context.host;
|
|
10963
|
+
this.attachPasteListener();
|
|
10964
|
+
}
|
|
10965
|
+
/** @inheritDoc */
|
|
10966
|
+
destroyExtension() {
|
|
10967
|
+
this.detachPasteListener();
|
|
10968
|
+
this.clearPasteChooser();
|
|
10969
|
+
}
|
|
10970
|
+
/**
|
|
10971
|
+
* Attaches the paste listener to the editable element.
|
|
10972
|
+
*/
|
|
10973
|
+
attachPasteListener() {
|
|
10974
|
+
const { editableEl, contentHostEl, } = this.getEditorElements();
|
|
10975
|
+
this.editableEl = editableEl;
|
|
10976
|
+
this.contentHostEl = contentHostEl;
|
|
10977
|
+
if (this.editableEl) {
|
|
10978
|
+
this.editableEl.addEventListener('paste', this.handlePasteEvent);
|
|
10979
|
+
}
|
|
10980
|
+
}
|
|
10981
|
+
/**
|
|
10982
|
+
* Detaches the paste listener from the editable element.
|
|
10983
|
+
*/
|
|
10984
|
+
detachPasteListener() {
|
|
10985
|
+
if (this.editableEl) {
|
|
10986
|
+
this.editableEl.removeEventListener('paste', this.handlePasteEvent);
|
|
10987
|
+
}
|
|
10988
|
+
this.editableEl = null;
|
|
10989
|
+
this.contentHostEl = null;
|
|
10990
|
+
}
|
|
10991
|
+
/**
|
|
10992
|
+
* Resolves the content host and editable element from the host shadow tree.
|
|
10993
|
+
*
|
|
10994
|
+
* @returns {EditorElements} Editor elements.
|
|
10995
|
+
*/
|
|
10996
|
+
getEditorElements() {
|
|
10997
|
+
var _a, _b, _c, _d, _e;
|
|
10998
|
+
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;
|
|
10999
|
+
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;
|
|
11000
|
+
return { editableEl, contentHostEl };
|
|
11001
|
+
}
|
|
11002
|
+
/**
|
|
11003
|
+
* Resolves the editable content element from the host shadow tree.
|
|
11004
|
+
*
|
|
11005
|
+
* @returns {HTMLDivElement | null} Editable element or `null` when unavailable.
|
|
11006
|
+
*/
|
|
11007
|
+
getEditableElement() {
|
|
11008
|
+
const { editableEl } = this.getEditorElements();
|
|
11009
|
+
return editableEl;
|
|
11010
|
+
}
|
|
11011
|
+
/**
|
|
11012
|
+
* Clones the current selection range so it can be restored after the user
|
|
11013
|
+
* chooses a paste mode.
|
|
11014
|
+
*
|
|
11015
|
+
* @returns {Range | null} Cloned range or `null` when there is no selection.
|
|
11016
|
+
*/
|
|
11017
|
+
cloneCurrentSelectionRange() {
|
|
11018
|
+
var _a;
|
|
11019
|
+
const selection = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
11020
|
+
if (selection && selection.rangeCount > 0) {
|
|
11021
|
+
return selection.getRangeAt(0).cloneRange();
|
|
11022
|
+
}
|
|
11023
|
+
return null;
|
|
11024
|
+
}
|
|
11025
|
+
/**
|
|
11026
|
+
* Renders the paste-mode chooser and wires up dismissal listeners.
|
|
11027
|
+
*
|
|
11028
|
+
* @param {ClipboardEvent} pasteEvent Originating paste event used for positioning.
|
|
11029
|
+
*/
|
|
11030
|
+
renderPasteChooser(pasteEvent) {
|
|
11031
|
+
var _a, _b;
|
|
11032
|
+
const hostRoot = (_b = (_a = this.hostEl) === null || _a === void 0 ? void 0 : _a.shadowRoot) !== null && _b !== void 0 ? _b : null;
|
|
11033
|
+
if (!hostRoot) {
|
|
11034
|
+
return;
|
|
11035
|
+
}
|
|
11036
|
+
this.clearPasteChooser(false);
|
|
11037
|
+
const position = this.computeChooserPosition(pasteEvent);
|
|
11038
|
+
this.chooserUI = new RTEPasteChooserUI(hostRoot, {
|
|
11039
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
11040
|
+
onModeSelect: (mode) => {
|
|
11041
|
+
this.applyPasteMode(mode);
|
|
11042
|
+
},
|
|
11043
|
+
});
|
|
11044
|
+
this.chooserUI.open(position);
|
|
11045
|
+
this.listenerDocument = this.hostEl.ownerDocument;
|
|
11046
|
+
this.listenerWindow = this.listenerDocument.defaultView;
|
|
11047
|
+
this.listenerDocument.addEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
11048
|
+
this.listenerDocument.addEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
11049
|
+
this.listenerDocument.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
11050
|
+
if (this.listenerWindow) {
|
|
11051
|
+
this.listenerWindow.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
11052
|
+
}
|
|
11053
|
+
if (this.contentHostEl) {
|
|
11054
|
+
this.contentHostEl.addEventListener('scroll', this.handleOutsideScroll);
|
|
11055
|
+
}
|
|
11056
|
+
}
|
|
11057
|
+
/**
|
|
11058
|
+
* Computes the on-screen position for the chooser based on pointer or caret.
|
|
11059
|
+
*
|
|
11060
|
+
* @param {ClipboardEvent} event Originating paste event.
|
|
11061
|
+
* @returns {ChooserPosition} Position in viewport coordinates.
|
|
11062
|
+
*/
|
|
11063
|
+
computeChooserPosition(event) {
|
|
11064
|
+
var _a, _b, _c;
|
|
11065
|
+
const hostRect = this.hostEl.getBoundingClientRect();
|
|
11066
|
+
const viewportHeight = (_b = (_a = this.hostEl.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.innerHeight) !== null && _b !== void 0 ? _b : window.innerHeight;
|
|
11067
|
+
const pointerEvent = event;
|
|
11068
|
+
const hasPointer = typeof pointerEvent.clientX === 'number' &&
|
|
11069
|
+
pointerEvent.clientX > 0 &&
|
|
11070
|
+
typeof pointerEvent.clientY === 'number' &&
|
|
11071
|
+
pointerEvent.clientY > 0;
|
|
11072
|
+
// For keyboard-initiated paste (Command/Control+V) clientX/Y are 0, so anchor
|
|
11073
|
+
// the chooser to the current caret instead of a fixed host-relative spot.
|
|
11074
|
+
const caretRect = hasPointer ? null : this.getCaretRect();
|
|
11075
|
+
const CHOOSER_GAP_PX = 8;
|
|
11076
|
+
const CHOOSER_MIN_MARGIN_PX = 12;
|
|
11077
|
+
const CHOOSER_WIDTH_PX = 220;
|
|
11078
|
+
const CHOOSER_FALLBACK_OFFSET_PX = 40;
|
|
11079
|
+
const CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX = 88;
|
|
11080
|
+
const baseLeft = hasPointer
|
|
11081
|
+
? pointerEvent.clientX
|
|
11082
|
+
: (_c = caretRect === null || caretRect === void 0 ? void 0 : caretRect.left) !== null && _c !== void 0 ? _c : hostRect.left + CHOOSER_MIN_MARGIN_PX;
|
|
11083
|
+
const baseTop = hasPointer
|
|
11084
|
+
? pointerEvent.clientY
|
|
11085
|
+
: caretRect
|
|
11086
|
+
? caretRect.bottom
|
|
11087
|
+
: hostRect.top + CHOOSER_FALLBACK_OFFSET_PX;
|
|
11088
|
+
const maxLeft = Math.max(hostRect.left + CHOOSER_MIN_MARGIN_PX, hostRect.right - CHOOSER_WIDTH_PX);
|
|
11089
|
+
const left = Math.min(Math.max(baseLeft, hostRect.left + CHOOSER_MIN_MARGIN_PX), maxLeft);
|
|
11090
|
+
const top = Math.max(baseTop + CHOOSER_GAP_PX, hostRect.top + CHOOSER_MIN_MARGIN_PX);
|
|
11091
|
+
const availableBelow = viewportHeight - top - CHOOSER_MIN_MARGIN_PX;
|
|
11092
|
+
const availableAbove = top - CHOOSER_MIN_MARGIN_PX;
|
|
11093
|
+
const placement = availableBelow >= CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX || availableBelow >= availableAbove
|
|
11094
|
+
? ['bottom', 'top']
|
|
11095
|
+
: ['top', 'bottom'];
|
|
11096
|
+
return { left, top, placement };
|
|
11097
|
+
}
|
|
11098
|
+
/**
|
|
11099
|
+
* Resolves the bounding rect of the pending caret position.
|
|
11100
|
+
*
|
|
11101
|
+
* @returns {DOMRect | null} Caret rect or `null` when it cannot be determined.
|
|
11102
|
+
*/
|
|
11103
|
+
getCaretRect() {
|
|
11104
|
+
var _a, _b;
|
|
11105
|
+
const range = (_b = (_a = this.pendingPastePayload) === null || _a === void 0 ? void 0 : _a.range) !== null && _b !== void 0 ? _b : this.cloneCurrentSelectionRange();
|
|
11106
|
+
if (!range) {
|
|
11107
|
+
return null;
|
|
11108
|
+
}
|
|
11109
|
+
const rect = range.getBoundingClientRect();
|
|
11110
|
+
if (this.isUnavailableRect(rect)) {
|
|
11111
|
+
// eslint-disable-next-line spellcheck/spell-checker
|
|
11112
|
+
const domRectList = range.getClientRects();
|
|
11113
|
+
if (domRectList.length > 0) {
|
|
11114
|
+
return domRectList[0];
|
|
11115
|
+
}
|
|
11116
|
+
return this.getRangeContainerRect(range);
|
|
11117
|
+
}
|
|
11118
|
+
return rect;
|
|
11119
|
+
}
|
|
11120
|
+
/**
|
|
11121
|
+
* Returns whether the browser could not resolve a meaningful caret rectangle.
|
|
11122
|
+
*
|
|
11123
|
+
* @param {DOMRect} rect Candidate caret rect.
|
|
11124
|
+
* @returns {boolean} Whether the rect is unusable.
|
|
11125
|
+
*/
|
|
11126
|
+
isUnavailableRect(rect) {
|
|
11127
|
+
return rect.width === 0 && rect.height === 0 && rect.left === 0 && rect.top === 0;
|
|
11128
|
+
}
|
|
11129
|
+
/**
|
|
11130
|
+
* Falls back to the range container or neighbor child node bounds.
|
|
11131
|
+
*
|
|
11132
|
+
* @param {Range} range Caret/selection range.
|
|
11133
|
+
* @returns {DOMRect | null} Best-effort caret anchor rectangle.
|
|
11134
|
+
*/
|
|
11135
|
+
getRangeContainerRect(range) {
|
|
11136
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11137
|
+
const containerNode = (_a = range.startContainer) !== null && _a !== void 0 ? _a : null;
|
|
11138
|
+
if (!containerNode) {
|
|
11139
|
+
return null;
|
|
11140
|
+
}
|
|
11141
|
+
if (containerNode.nodeType === Node.ELEMENT_NODE) {
|
|
11142
|
+
const containerElement = containerNode;
|
|
11143
|
+
const previousNode = (_b = containerElement.childNodes[range.startOffset - 1]) !== null && _b !== void 0 ? _b : null;
|
|
11144
|
+
const currentNode = (_c = containerElement.childNodes[range.startOffset]) !== null && _c !== void 0 ? _c : null;
|
|
11145
|
+
return ((_e = (_d = this.getNodeRect(previousNode)) !== null && _d !== void 0 ? _d : this.getNodeRect(currentNode)) !== null && _e !== void 0 ? _e : this.getNodeRect(containerElement));
|
|
11146
|
+
}
|
|
11147
|
+
return (_f = this.getNodeRect(containerNode)) !== null && _f !== void 0 ? _f : this.getNodeRect(containerNode.parentNode);
|
|
11148
|
+
}
|
|
11149
|
+
/**
|
|
11150
|
+
* Returns an element-backed rectangle from a DOM node.
|
|
11151
|
+
*
|
|
11152
|
+
* @param {Node | null} node Candidate node.
|
|
11153
|
+
* @returns {DOMRect | null} Node rectangle when resolvable.
|
|
11154
|
+
*/
|
|
11155
|
+
getNodeRect(node) {
|
|
11156
|
+
var _a, _b;
|
|
11157
|
+
if (!node) {
|
|
11158
|
+
return null;
|
|
11159
|
+
}
|
|
11160
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
11161
|
+
return (_b = (_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : null;
|
|
11162
|
+
}
|
|
11163
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
11164
|
+
const rect = node.getBoundingClientRect();
|
|
11165
|
+
return this.isUnavailableRect(rect) ? null : rect;
|
|
11166
|
+
}
|
|
11167
|
+
return null;
|
|
11168
|
+
}
|
|
11169
|
+
/**
|
|
11170
|
+
* Applies the chosen paste mode by dispatching a synthetic paste input event.
|
|
11171
|
+
*
|
|
11172
|
+
* @param {PasteMode} mode Selected paste mode.
|
|
11173
|
+
*/
|
|
11174
|
+
applyPasteMode(mode) {
|
|
11175
|
+
var _a;
|
|
11176
|
+
if (!this.pendingPastePayload) {
|
|
11177
|
+
this.clearPasteChooser();
|
|
11178
|
+
return;
|
|
11179
|
+
}
|
|
11180
|
+
const editableEl = (_a = this.editableEl) !== null && _a !== void 0 ? _a : this.getEditableElement();
|
|
11181
|
+
if (!editableEl) {
|
|
11182
|
+
this.clearPasteChooser();
|
|
11183
|
+
return;
|
|
11184
|
+
}
|
|
11185
|
+
editableEl.focus();
|
|
11186
|
+
this.restoreSelectionRange(this.pendingPastePayload.range);
|
|
11187
|
+
this.restoreSelectionControllerState(this.pendingPastePayload);
|
|
11188
|
+
const dataTransfer = this.createDataTransfer(this.pendingPastePayload.html, this.pendingPastePayload.text, mode);
|
|
11189
|
+
this.dispatchBeforeInputPaste(editableEl, dataTransfer);
|
|
11190
|
+
this.clearPasteChooser();
|
|
11191
|
+
}
|
|
11192
|
+
/**
|
|
11193
|
+
* Restores SelectionController state from the captured selection so synthetic
|
|
11194
|
+
* beforeinput paste can replace the selected content instead of appending.
|
|
11195
|
+
*
|
|
11196
|
+
* @param {PendingPastePayload} payload Pending paste payload.
|
|
11197
|
+
*/
|
|
11198
|
+
restoreSelectionControllerState(payload) {
|
|
11199
|
+
if (!payload.range || !this.extensionContext) {
|
|
11200
|
+
return;
|
|
11201
|
+
}
|
|
11202
|
+
const rangeOptions = {
|
|
11203
|
+
startNode: payload.range.startContainer,
|
|
11204
|
+
endNode: payload.range.endContainer,
|
|
11205
|
+
startOffset: payload.range.startOffset,
|
|
11206
|
+
endOffset: payload.range.endOffset,
|
|
11207
|
+
};
|
|
11208
|
+
this.extensionContext.setSelectedNodes(payload.selectedNodes || [], rangeOptions);
|
|
11209
|
+
}
|
|
11210
|
+
/**
|
|
11211
|
+
* Restores a previously cloned selection range.
|
|
11212
|
+
*
|
|
11213
|
+
* @param {Range | null} range Range to restore.
|
|
11214
|
+
*/
|
|
11215
|
+
restoreSelectionRange(range) {
|
|
11216
|
+
var _a;
|
|
11217
|
+
if (!range) {
|
|
11218
|
+
return;
|
|
11219
|
+
}
|
|
11220
|
+
const selection = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
11221
|
+
if (selection) {
|
|
11222
|
+
selection.removeAllRanges();
|
|
11223
|
+
selection.addRange(range);
|
|
11224
|
+
}
|
|
11225
|
+
}
|
|
11226
|
+
/**
|
|
11227
|
+
* Dispatches a synthetic `beforeinput` paste event into the editor pipeline.
|
|
11228
|
+
*
|
|
11229
|
+
* @param {HTMLDivElement} editableEl Editable content element.
|
|
11230
|
+
* @param {DataTransfer} dataTransfer Clipboard payload for the paste.
|
|
11231
|
+
*/
|
|
11232
|
+
dispatchBeforeInputPaste(editableEl, dataTransfer) {
|
|
11233
|
+
// This synthetic beforeinput event intentionally reuses the existing
|
|
11234
|
+
// UserInputController -> insertFromPaste -> InsertPasteHandler pipeline.
|
|
11235
|
+
const beforeInputEvent = new CustomEvent('beforeinput', {
|
|
11236
|
+
bubbles: true,
|
|
11237
|
+
cancelable: true,
|
|
11238
|
+
});
|
|
11239
|
+
try {
|
|
11240
|
+
Object.defineProperties(beforeInputEvent, {
|
|
11241
|
+
inputType: {
|
|
11242
|
+
value: 'insertFromPaste',
|
|
11243
|
+
configurable: true,
|
|
11244
|
+
},
|
|
11245
|
+
dataTransfer: {
|
|
11246
|
+
value: dataTransfer,
|
|
11247
|
+
configurable: true,
|
|
11248
|
+
},
|
|
11249
|
+
});
|
|
11250
|
+
}
|
|
11251
|
+
catch (_a) {
|
|
11252
|
+
Object.assign(beforeInputEvent, {
|
|
11253
|
+
inputType: 'insertFromPaste',
|
|
11254
|
+
dataTransfer,
|
|
11255
|
+
});
|
|
11256
|
+
}
|
|
11257
|
+
editableEl.dispatchEvent(beforeInputEvent);
|
|
11258
|
+
}
|
|
11259
|
+
/**
|
|
11260
|
+
* Builds a `DataTransfer` payload carrying the paste content and mode marker.
|
|
11261
|
+
*
|
|
11262
|
+
* @param {string} html HTML clipboard content.
|
|
11263
|
+
* @param {string} text Plain text clipboard content.
|
|
11264
|
+
* @param {PasteMode} [mode] Selected paste mode marker.
|
|
11265
|
+
* @returns {DataTransfer} Populated data transfer payload.
|
|
11266
|
+
*/
|
|
11267
|
+
createDataTransfer(html, text, mode) {
|
|
11268
|
+
if (typeof DataTransfer !== 'undefined') {
|
|
11269
|
+
const dataTransfer = new DataTransfer();
|
|
11270
|
+
if (html) {
|
|
11271
|
+
dataTransfer.setData('text/html', html);
|
|
11272
|
+
}
|
|
11273
|
+
if (text) {
|
|
11274
|
+
dataTransfer.setData('text/plain', text);
|
|
11275
|
+
}
|
|
11276
|
+
if (mode) {
|
|
11277
|
+
dataTransfer.setData(RTE_PASTE_MODE_DATA_TYPE, mode);
|
|
11278
|
+
}
|
|
11279
|
+
return dataTransfer;
|
|
11280
|
+
}
|
|
11281
|
+
return {
|
|
11282
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
11283
|
+
getData: (type) => {
|
|
11284
|
+
if (type === 'text/html') {
|
|
11285
|
+
return html;
|
|
11286
|
+
}
|
|
11287
|
+
if (type === 'text/plain') {
|
|
11288
|
+
return text;
|
|
11289
|
+
}
|
|
11290
|
+
if (type === RTE_PASTE_MODE_DATA_TYPE) {
|
|
11291
|
+
return mode !== null && mode !== void 0 ? mode : '';
|
|
11292
|
+
}
|
|
11293
|
+
return '';
|
|
11294
|
+
},
|
|
11295
|
+
};
|
|
11296
|
+
}
|
|
11297
|
+
/**
|
|
11298
|
+
* Tears down the chooser UI and removes dismissal listeners.
|
|
11299
|
+
*
|
|
11300
|
+
* @param {boolean} [clearPayload] Whether to also clear the pending payload.
|
|
11301
|
+
*/
|
|
11302
|
+
clearPasteChooser(clearPayload = true) {
|
|
11303
|
+
if (this.contentHostEl) {
|
|
11304
|
+
this.contentHostEl.removeEventListener('scroll', this.handleOutsideScroll);
|
|
11305
|
+
}
|
|
11306
|
+
if (this.listenerWindow) {
|
|
11307
|
+
this.listenerWindow.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
11308
|
+
this.listenerWindow = null;
|
|
11309
|
+
}
|
|
11310
|
+
if (this.listenerDocument) {
|
|
11311
|
+
this.listenerDocument.removeEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
11312
|
+
this.listenerDocument.removeEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
11313
|
+
this.listenerDocument.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
11314
|
+
this.listenerDocument = null;
|
|
11315
|
+
}
|
|
11316
|
+
if (this.chooserUI) {
|
|
11317
|
+
this.chooserUI.destroy();
|
|
11318
|
+
}
|
|
11319
|
+
this.chooserUI = null;
|
|
11320
|
+
if (clearPayload) {
|
|
11321
|
+
this.pendingPastePayload = null;
|
|
11322
|
+
}
|
|
11323
|
+
}
|
|
11324
|
+
}
|
|
11325
|
+
|
|
10043
11326
|
/**
|
|
10044
11327
|
* Action to extract the currently selected content (HTML and plain text) from the editor.
|
|
10045
11328
|
*
|
|
@@ -10560,6 +11843,7 @@ VegaRTETokenExtension.TOOLBAR_BUTTON_KEY = 'token';
|
|
|
10560
11843
|
exports.ActionHandlerInterceptor = ActionHandlerInterceptor;
|
|
10561
11844
|
exports.DeleteSelectedContentAction = DeleteSelectedContentAction;
|
|
10562
11845
|
exports.InsertNodeToNearestRootAction = InsertNodeToNearestRootAction;
|
|
11846
|
+
exports.RTEBlockquoteBlock = RTEBlockquoteBlock;
|
|
10563
11847
|
exports.RTELanguageToolbarButtonRenderer = RTELanguageToolbarButtonRenderer;
|
|
10564
11848
|
exports.RTETokenNode = RTETokenNode;
|
|
10565
11849
|
exports.RTETokenNodeRenderer = RTETokenNodeRenderer;
|
|
@@ -10568,6 +11852,7 @@ exports.VegaCalendarPeriodFactory = VegaCalendarPeriodFactory;
|
|
|
10568
11852
|
exports.VegaEventManager = VegaEventManager$1;
|
|
10569
11853
|
exports.VegaLoader = VegaLoader;
|
|
10570
11854
|
exports.VegaNotify = VegaNotify;
|
|
11855
|
+
exports.VegaRTEBlockquoteExtension = VegaRTEBlockquoteExtension;
|
|
10571
11856
|
exports.VegaRTECopyExtension = VegaRTECopyExtension;
|
|
10572
11857
|
exports.VegaRTECutExtension = VegaRTECutExtension;
|
|
10573
11858
|
exports.VegaRTEDefaultLineHeightOptions = VegaRTEDefaultLineHeightOptions;
|
|
@@ -10576,6 +11861,7 @@ exports.VegaRTEFunctionExtension = VegaRTEFunctionExtension;
|
|
|
10576
11861
|
exports.VegaRTEHorizontalLineExtension = VegaRTEHorizontalLineExtension;
|
|
10577
11862
|
exports.VegaRTELanguageExtension = VegaRTELanguageExtension;
|
|
10578
11863
|
exports.VegaRTELineHeightExtension = VegaRTELineHeightExtension;
|
|
11864
|
+
exports.VegaRTEPasteExtension = VegaRTEPasteExtension;
|
|
10579
11865
|
exports.VegaRTESpecialCharactersArrows = VegaRTESpecialCharactersArrows;
|
|
10580
11866
|
exports.VegaRTESpecialCharactersCurrency = VegaRTESpecialCharactersCurrency;
|
|
10581
11867
|
exports.VegaRTESpecialCharactersEssentials = VegaRTESpecialCharactersEssentials;
|