@heartlandone/vega 2.101.0 → 2.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-275ea7c7.js → app-globals-85986306.js} +13 -12
- package/dist/cjs/{child-nodes-event-prevent-slimmer-d720d7e9.js → child-nodes-event-prevent-slimmer-574a6a1a.js} +1 -1
- package/dist/cjs/{code-block-c598832d.js → code-block-72de6c4d.js} +270 -103
- package/dist/cjs/{component-usage-runtime-metrics-389d1548.js → component-usage-runtime-metrics-77f7be9f.js} +8 -5
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-4bd47aa1.js → component-value-history-controller-slimmer.abstract-23d2b3d8.js} +3 -3
- package/dist/cjs/{content-state-da23e822.js → content-state-ff40bdc6.js} +125 -90
- package/dist/cjs/{date-required-rule-45c802d3.js → date-required-rule-608e704b.js} +1 -1
- package/dist/cjs/{design-token-9d762da0.js → design-token-a101a8d0.js} +3 -3
- package/dist/cjs/{create-public-api-runtime-metrics-slimmer-91b0cbfb.js → discriminated-3b8e72d5.js} +63 -1
- package/dist/cjs/{element-appender-slimmer-2aaf8e24.js → element-appender-slimmer-b93cc564.js} +2 -2
- package/dist/cjs/{event-emit-slimmer-67b5c186.js → event-emit-slimmer-6bc675f6.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-ac9337f4.js → form-field-controller-slimmer-124d54ea.js} +1 -1
- package/dist/cjs/{icon-manager-be358b32.js → icon-manager-7d20b0ab.js} +6 -4
- package/dist/cjs/{image-annotation-action-378838c2.js → image-annotation-action-1ee41bc7.js} +6 -5
- package/dist/cjs/image-extension-6a92c524.js +1451 -0
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/index.cjs.js +29 -27
- package/dist/cjs/{inject-keyboard-manager-540f0876.js → inject-keyboard-manager-32d7dd0e.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-b11918ee.js → internal-calendar-period-factory-c3198ea7.js} +1 -1
- package/dist/cjs/{internal-icon-manager-40bcac72.js → internal-icon-manager-b9702049.js} +1 -1
- package/dist/cjs/{internal-translation-controller-27bfc8c7.js → internal-translation-controller-0d67ca4d.js} +12 -0
- package/dist/cjs/{internal-vega-event-manager-976b9526.js → internal-vega-event-manager-0c256d63.js} +2 -1
- package/dist/cjs/{keyboard-manager-16e96b62.js → keyboard-manager-332eec89.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-0a4e556d.js → keyboard-manager-slimmer-a2872981.js} +1 -1
- package/dist/cjs/{link-extension-f493e432.js → link-extension-1b4ed437.js} +9 -8
- package/dist/cjs/loader.cjs.js +20 -19
- package/dist/cjs/{month-view-generator-0a3e04de.js → month-view-generator-b6a2b8be.js} +1 -1
- package/dist/cjs/{public-rules-bae12c47.js → public-rules-2066613c.js} +9 -7
- package/dist/cjs/{range-9f42fb40.js → range-712fe703.js} +1 -1
- package/dist/cjs/{responsive-format-facade-c6d7f0a1.js → responsive-format-facade-44d33457.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-bb232741.js → rich-text-editor-required-rule-1aa75d22.js} +1 -1
- package/dist/cjs/{split-cell-operation-0d33123e.js → split-cell-operation-afc82323.js} +16 -20
- package/dist/cjs/{state-border-formatter-dda9109a.js → state-border-formatter-49984fd6.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-3a968a59.js → string-format-strategy.abstract-bd563c01.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-2e0a838e.js → string-input-formatter-slimmer-4faebac9.js} +1 -1
- package/dist/cjs/{string-mask-strategy-d9f85c21.js → string-mask-strategy-624c4398.js} +2 -2
- package/dist/cjs/{style-formatter-d21a9784.js → style-formatter-151d89a3.js} +2 -2
- package/dist/cjs/{time-required-rule-580cbd3d.js → time-required-rule-8cd8f9b9.js} +1 -1
- package/dist/cjs/{token-extension-4badb962.js → token-extension-72d0cb08.js} +1196 -1280
- package/dist/cjs/{translation-slimmer-31cd5a57.js → translation-slimmer-1771d01f.js} +1 -1
- package/dist/cjs/{type-guard-00b8efc0.js → type-guard-cce6fe1f.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-70885128.js → valid-credit-card-number-rule-b13c2fc4.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +14 -14
- package/dist/cjs/vega-app-footer.cjs.entry.js +5 -5
- package/dist/cjs/vega-app-header-button.cjs.entry.js +14 -14
- package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/vega-banner.cjs.entry.js +8 -8
- package/dist/cjs/vega-bar-chart.cjs.entry.js +2 -2
- package/dist/cjs/vega-box.cjs.entry.js +8 -8
- package/dist/cjs/vega-brand-logo.cjs.entry.js +5 -5
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +11 -11
- package/dist/cjs/vega-button-group_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-button-link.cjs.entry.js +6 -6
- package/dist/cjs/vega-button.cjs.entry.js +9 -9
- package/dist/cjs/vega-calendar_5.cjs.entry.js +73 -32
- package/dist/cjs/vega-card.cjs.entry.js +7 -7
- package/dist/cjs/vega-carousel.cjs.entry.js +8 -8
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-chip.cjs.entry.js +11 -11
- package/dist/cjs/vega-code-block.cjs.entry.js +17 -17
- package/dist/cjs/vega-color-picker.cjs.entry.js +7 -7
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +12 -12
- package/dist/cjs/vega-color-swatch.cjs.entry.js +7 -7
- package/dist/cjs/vega-combo-box.cjs.entry.js +14 -14
- package/dist/cjs/vega-counter-badge.cjs.entry.js +2 -2
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +23 -23
- package/dist/cjs/{vega-dialog-controller-16be85d5.js → vega-dialog-controller-efc46dba.js} +6 -4
- package/dist/cjs/vega-dialog_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-divider.cjs.entry.js +7 -7
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +17 -17
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-987a170c.js → vega-event-id-b5abf7c9.js} +2 -0
- package/dist/cjs/vega-field-error.cjs.entry.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +7 -7
- package/dist/cjs/vega-file-uploader.cjs.entry.js +11 -11
- package/dist/cjs/vega-flag-icon.cjs.entry.js +10 -10
- package/dist/cjs/vega-flex.cjs.entry.js +8 -8
- package/dist/cjs/vega-font.cjs.entry.js +7 -7
- package/dist/cjs/vega-form.cjs.entry.js +8 -8
- package/dist/cjs/vega-grid.cjs.entry.js +7 -7
- package/dist/cjs/vega-hint.cjs.entry.js +2 -2
- package/dist/cjs/vega-icon.cjs.entry.js +9 -9
- package/dist/cjs/vega-image-uploader.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +15 -15
- package/dist/cjs/vega-input-numeric.cjs.entry.js +18 -20
- package/dist/cjs/vega-input-passcode.cjs.entry.js +11 -11
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-range.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-select.cjs.entry.js +14 -14
- package/dist/cjs/vega-input.cjs.entry.js +39 -35
- package/dist/cjs/vega-item-toggle.cjs.entry.js +5 -5
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +19 -19
- package/dist/cjs/vega-line-chart.cjs.entry.js +2 -2
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +5 -5
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +5 -5
- package/dist/cjs/vega-pagination.cjs.entry.js +10 -10
- package/dist/cjs/vega-pie-chart.cjs.entry.js +2 -2
- package/dist/cjs/vega-popover_2.cjs.entry.js +14 -14
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-radio_2.cjs.entry.js +12 -12
- package/dist/cjs/vega-rich-text-bookmark-editor.cjs.entry.js +445 -0
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +49 -17
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +699 -244
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +10 -10
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +18 -18
- package/dist/cjs/vega-section-title.cjs.entry.js +2 -2
- package/dist/cjs/vega-segment-control.cjs.entry.js +5 -5
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +13 -13
- package/dist/cjs/vega-signature-capture.cjs.entry.js +15 -15
- package/dist/cjs/vega-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/vega-slot-container.cjs.entry.js +2 -2
- package/dist/cjs/vega-stepper.cjs.entry.js +8 -8
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +398 -108
- package/dist/cjs/vega-table_11.cjs.entry.js +23 -23
- package/dist/cjs/vega-text.cjs.entry.js +2 -2
- package/dist/cjs/vega-textarea.cjs.entry.js +8 -8
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +16 -16
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +7 -7
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +9 -9
- package/dist/cjs/vega.cjs.js +20 -19
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/vega-accordion/vega-accordion.js +1 -1
- package/dist/collection/components/vega-app-footer/vega-app-footer.js +1 -1
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +1 -1
- package/dist/collection/components/vega-backdrop/vega-backdrop.js +1 -1
- package/dist/collection/components/vega-banner/vega-banner.js +1 -1
- package/dist/collection/components/vega-box/vega-box.js +1 -1
- package/dist/collection/components/vega-brand-logo/vega-brand-logo.js +1 -1
- package/dist/collection/components/vega-breadcrumb/vega-breadcrumb.js +1 -1
- package/dist/collection/components/vega-button/vega-button.js +1 -1
- package/dist/collection/components/vega-button-circle/vega-button-circle.js +1 -1
- package/dist/collection/components/vega-button-group/vega-button-group-item/vega-button-group-item.js +1 -1
- package/dist/collection/components/vega-button-group/vega-button-group.js +1 -1
- package/dist/collection/components/vega-button-link/vega-button-link.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-preview-actions-controller.js +33 -11
- package/dist/collection/components/vega-calendar/vega-calendar-event/vega-calendar-event.js +1 -1
- package/dist/collection/components/vega-calendar/vega-calendar-event-preview/assets/delete.js +3 -0
- package/dist/collection/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.js +5 -1
- package/dist/collection/components/vega-calendar/vega-calendar-event-preview/vega-calendar-event-preview.js +1 -1
- package/dist/collection/components/vega-calendar/vega-calendar-event-slot/vega-calendar-event-slot.js +1 -1
- package/dist/collection/components/vega-calendar/vega-calendar-period-switcher/vega-calendar-period-switcher.js +1 -1
- package/dist/collection/components/vega-calendar/vega-calendar.js +82 -2
- package/dist/collection/components/vega-card/vega-card.js +1 -1
- package/dist/collection/components/vega-carousel/vega-carousel.js +1 -1
- package/dist/collection/components/vega-chart/vega-bar-chart/vega-bar-chart.js +1 -1
- package/dist/collection/components/vega-chart/vega-line-chart/vega-line-chart.js +1 -1
- package/dist/collection/components/vega-chart/vega-pie-chart/vega-pie-chart.js +1 -1
- package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.js +1 -1
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +1 -1
- package/dist/collection/components/vega-chip/vega-chip.js +1 -1
- package/dist/collection/components/vega-code-block/vega-code-block.js +1 -1
- package/dist/collection/components/vega-color-picker/vega-color-picker.js +1 -1
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.js +1 -1
- package/dist/collection/components/vega-color-swatch/vega-color-swatch.js +1 -1
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +1 -1
- package/dist/collection/components/vega-counter-badge/vega-counter-badge.js +1 -1
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +1 -1
- package/dist/collection/components/vega-date-picker/vega-date-picker.js +1 -1
- package/dist/collection/components/vega-dialog/vega-dialog.js +1 -1
- package/dist/collection/components/vega-divider/vega-divider.js +1 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-content-box/vega-dropdown-content-box.js +1 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-group/vega-dropdown-group.js +1 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.js +1 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +1 -1
- package/dist/collection/components/vega-field-error/vega-field-error.js +1 -1
- package/dist/collection/components/vega-field-label/vega-field-label.js +1 -1
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +1 -1
- package/dist/collection/components/vega-flag-icon/vega-flag-icon.js +1 -1
- package/dist/collection/components/vega-flex/vega-flex.js +1 -1
- package/dist/collection/components/vega-font/vega-font.js +1 -1
- package/dist/collection/components/vega-form/vega-form.js +1 -1
- package/dist/collection/components/vega-grid/vega-grid.js +1 -1
- package/dist/collection/components/vega-hint/vega-hint.js +1 -1
- package/dist/collection/components/vega-icon/vega-icon.js +1 -1
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +1 -1
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-state-controller.js +0 -14
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +11 -2
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-renderer.js +11 -1
- package/dist/collection/components/vega-input/vega-input.js +53 -9
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +1 -1
- package/dist/collection/components/vega-input-numeric/slimmers/renderers/vega-input-numeric-renderer.js +7 -1
- package/dist/collection/components/vega-input-numeric/vega-input-numeric.js +1 -9
- package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +1 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +1 -1
- package/dist/collection/components/vega-input-range/vega-input-range.js +1 -1
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-item-toggle/vega-item-toggle.js +1 -1
- package/dist/collection/components/vega-loader-wrapper/vega-loader-wrapper.js +1 -1
- package/dist/collection/components/vega-loading-indicator/vega-loading-indicator.js +1 -1
- package/dist/collection/components/vega-modal/vega-modal.js +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav/vega-left-nav.js +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav-group/vega-left-nav-group.js +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.js +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav-section/vega-left-nav-section.js +1 -1
- package/dist/collection/components/vega-nav/vega-nav-card/vega-nav-card.js +1 -1
- package/dist/collection/components/vega-page-notification/vega-page-notification-list/vega-page-notification-list.js +1 -1
- package/dist/collection/components/vega-page-notification/vega-page-notification.js +1 -1
- package/dist/collection/components/vega-pagination/vega-pagination-page-selector-mobile/vega-pagination-page-selector-mobile.js +1 -1
- package/dist/collection/components/vega-pagination/vega-pagination-page-size-selector-mobile/vega-pagination-page-size-selector-mobile.js +1 -1
- package/dist/collection/components/vega-pagination/vega-pagination.js +1 -1
- package/dist/collection/components/vega-popover/vega-popover-content-box/vega-popover-content-box.js +1 -1
- package/dist/collection/components/vega-popover/vega-popover.js +1 -1
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +1 -1
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +1 -1
- package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.js +1 -1
- package/dist/collection/components/vega-radio/vega-radio.js +1 -1
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor-registry.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +4 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/paste-content-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/sequential-composition-strategy.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/annotation-action.abstract.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/dto/actions/bold-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/clear-formatting-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/code-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/delete-node-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/horizontal-alignment-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/image-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/indent-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/italic-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/link-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/link-group-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/selection-change-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/sequential-composition-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/splittable-action.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/strikethrough-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/sync-up-selection-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/text-color-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/text-style-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/underline-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation.abstract.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/plain-text-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +6 -8
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +6 -6
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +9 -9
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +7 -7
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +13 -12
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +16 -16
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +18 -13
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-heading-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-title-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/predicate.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/paragraph-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/title-heading-node-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/flush-changes-payload.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/decorator-node.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +8 -7
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +5 -7
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +30 -16
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/base-renderer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/html-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +25 -5
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/setup.js +34 -34
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/blockquote-extension.js +7 -7
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/dto/rte-blockquote-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/filter-styles-strategies/blockquote-block/blockquote-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/renderers/blockquote-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/action-handler-interceptors/delete-bookmark-before-text-interceptor.js +40 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/action-handler-strategies/insert-bookmark-node-strategy.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/action-handler-strategies/update-bookmark-name-strategy.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/actions/insert-bookmark-node-action.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/actions/update-bookmark-name-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/anchor-to-bookmark-node-strategy.js +79 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/assets/bookmark.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/bookmark-extension.js +52 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/bookmark-node.js +91 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/renderers/bookmark-node-renderer.js +316 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/renderers/bookmark-toolbar-button-renderer.js +137 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/utils.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/vega-rich-text-bookmark-editor/slimmers/controllers/bookmark-editor-controller.js +217 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/vega-rich-text-bookmark-editor/slimmers/renderers/vega-rich-text-bookmark-editor-renderer.js +116 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/vega-rich-text-bookmark-editor/vega-rich-text-bookmark-editor.css +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/bookmark/vega-rich-text-bookmark-editor/vega-rich-text-bookmark-editor.js +261 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/copy/copy-extension.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/vega-rich-text-find-replace-panel/vega-rich-text-find-replace-panel.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +31 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-block-strategy.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +15 -15
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/logic-control-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/horizontal-line/dto/horizontal-line-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/horizontal-line/dto/horizontal-line-node.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/horizontal-line/filter-styles-strategies/horizontal-line-block/horizontal-line-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/horizontal-line/horizontal-line-extension.js +6 -6
- package/dist/collection/components/vega-rich-text-editor/extensions/horizontal-line/renderers/horizontal-line-block-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-extension.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/chooser-positioner.js +107 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/paste-chooser-controller.js +91 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/paste-event-interceptor.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/selection-snapshot-service.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/image-extractor.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-extension.js +42 -355
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/data-transfer-builder.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/paste-dispatcher.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/paste-processing-pipeline.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/paste-processing-strategy.abstract.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/paste-strategy-selector.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/plain-paste-strategy.js +74 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/table-head-cell-annotations-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/actions/update-table-properties-action.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-block/table-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-caption/table-caption-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-cell/table-cell-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +38 -38
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/vega-rich-text-table-selection-widget.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/word-count/word-count-extension.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/helpers/utils.js +67 -0
- package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js +26 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/bold-annotaion-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/code-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/color-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-alt-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-size-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/indent-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/italic-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/link-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/strike-through-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-align-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/underline-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.js +67 -11
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/backward-delete-content-handler.js +4 -17
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +34 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/forward-delete-content-handler.js +13 -32
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +60 -25
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +55 -19
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +165 -59
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +55 -21
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +2 -16
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +11 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/utils/html-to-plain-text-utils.js +240 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.js +1 -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/slimmers/controllers/link-editor-controller.js +69 -5
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-type-config-controller.js +45 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +61 -2
- 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-section-title/vega-section-title.js +1 -1
- package/dist/collection/components/vega-segment-control/vega-segment-control.js +1 -1
- package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.js +1 -1
- package/dist/collection/components/vega-selection-chip/vega-selection-chip.js +1 -1
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.js +1 -1
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.js +1 -1
- package/dist/collection/components/vega-sidenav/vega-sidenav-group/vega-sidenav-group.js +1 -1
- package/dist/collection/components/vega-sidenav/vega-sidenav-link/vega-sidenav-link.js +1 -1
- package/dist/collection/components/vega-sidenav/vega-sidenav.js +1 -1
- package/dist/collection/components/vega-signature-capture/vega-signature-capture.js +1 -1
- package/dist/collection/components/vega-skeleton/vega-skeleton.js +1 -1
- package/dist/collection/components/vega-slot-container/vega-slot-container.js +1 -1
- package/dist/collection/components/vega-stepper/vega-stepper.js +1 -1
- package/dist/collection/components/vega-tab-group/helpers/vega-tab-group-width-layout-helper.js +91 -0
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.js +90 -16
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-slider-state-controller.js +16 -1
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-constrained-tab-label-renderer.js +52 -0
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.js +52 -10
- package/dist/collection/components/vega-tab-group/vega-tab-group-panel/vega-tab-group-panel.js +1 -1
- package/dist/collection/components/vega-tab-group/vega-tab-group.css +51 -1
- package/dist/collection/components/vega-tab-group/vega-tab-group.js +46 -1
- package/dist/collection/components/vega-table/vega-table-body/vega-table-body.js +1 -1
- package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.js +1 -1
- package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.js +1 -1
- package/dist/collection/components/vega-table/vega-table-foot/vega-table-foot.js +1 -1
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.js +1 -1
- package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.js +1 -1
- package/dist/collection/components/vega-table/vega-table-head/vega-table-head.js +1 -1
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +1 -1
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.js +1 -1
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.js +1 -1
- package/dist/collection/components/vega-table/vega-table.js +1 -1
- package/dist/collection/components/vega-text/vega-text.js +1 -1
- package/dist/collection/components/vega-textarea/vega-textarea.js +1 -1
- package/dist/collection/components/vega-time-picker/vega-time-picker-dropdown/vega-time-picker-dropdown.js +1 -1
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +1 -1
- package/dist/collection/components/vega-toggle-switch/vega-toggle-switch.js +1 -1
- package/dist/collection/components/vega-tooltip/vega-tooltip-content-box/vega-tooltip-content-box.js +1 -1
- package/dist/collection/components/vega-tooltip/vega-tooltip.js +1 -1
- package/dist/collection/components/vega-virtual-scroll/vega-virtual-scroll.js +1 -1
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/common/wait-for-vega-handler.js +5 -2
- package/dist/collection/helpers/dialog/vega-dialog-controller.js +5 -2
- package/dist/collection/helpers/discriminator/discriminated.js +77 -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/event-manager/vega-event-manager.js +5 -2
- package/dist/collection/helpers/icon/icon-manager.js +5 -2
- package/dist/collection/helpers/loading-indicator/vega-loader-controller.js +5 -2
- package/dist/collection/helpers/notify/vega-notify-controller.js +5 -2
- package/dist/collection/helpers/rte-manager/dto-action-strategy-manager.js +2 -2
- package/dist/collection/helpers/rte-manager/dto-renderer-manager.js +2 -4
- package/dist/collection/helpers/skeleton-loader/vega-skeleton-loader-controller.js +5 -2
- package/dist/collection/helpers/slimmers/runtime-metrics/create-public-api-runtime-metrics-slimmer.js +1 -1
- package/dist/collection/helpers/theme/theme-manager.js +5 -2
- package/dist/collection/helpers/translation/locales/en.js +12 -0
- package/dist/collection/helpers/translation/translation.js +5 -2
- package/dist/collection/helpers/zindex/vega-z-index-manager.js +5 -2
- package/dist/esm/{app-globals-ad3c7cea.js → app-globals-8cdfc5c9.js} +13 -12
- package/dist/esm/{child-nodes-event-prevent-slimmer-0ebcbf47.js → child-nodes-event-prevent-slimmer-3ae5c7db.js} +1 -1
- package/dist/esm/{code-block-1cdf7a51.js → code-block-9360c331.js} +262 -104
- package/dist/esm/{component-usage-runtime-metrics-4b1afd04.js → component-usage-runtime-metrics-adfc80c6.js} +8 -5
- package/dist/esm/{component-value-history-controller-slimmer.abstract-bdeeb43f.js → component-value-history-controller-slimmer.abstract-9ea58806.js} +3 -3
- package/dist/esm/{content-state-6eb610b8.js → content-state-67a12e74.js} +125 -90
- package/dist/esm/{date-required-rule-2ea3aec8.js → date-required-rule-66b5bf02.js} +1 -1
- package/dist/esm/{design-token-82a4e107.js → design-token-acd1efeb.js} +3 -3
- package/dist/esm/{create-public-api-runtime-metrics-slimmer-48f85199.js → discriminated-fe5bf3c8.js} +63 -2
- package/dist/esm/{element-appender-slimmer-dd4e2908.js → element-appender-slimmer-7e5bc1e9.js} +2 -2
- package/dist/esm/{event-emit-slimmer-12ee1593.js → event-emit-slimmer-aa7f4c6e.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-5c794b4d.js → form-field-controller-slimmer-d653c494.js} +1 -1
- package/dist/esm/{icon-manager-4ef3f6dd.js → icon-manager-236d6c23.js} +5 -3
- package/dist/esm/{image-annotation-action-cdd50dcc.js → image-annotation-action-9525be48.js} +6 -5
- package/dist/esm/image-extension-aea75132.js +1440 -0
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/index.js +25 -24
- package/dist/esm/{inject-keyboard-manager-6a10c9b7.js → inject-keyboard-manager-f6522d2f.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-d1a60f81.js → internal-calendar-period-factory-261df2f2.js} +1 -1
- package/dist/esm/{internal-icon-manager-e7c57096.js → internal-icon-manager-d4d534d2.js} +1 -1
- package/dist/esm/{internal-translation-controller-fff376d2.js → internal-translation-controller-3637e47e.js} +12 -0
- package/dist/esm/{internal-vega-event-manager-0c381f3b.js → internal-vega-event-manager-6eebe8f8.js} +2 -1
- package/dist/esm/{keyboard-manager-a58288df.js → keyboard-manager-53e8d8d0.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-133b86cd.js → keyboard-manager-slimmer-b3de042d.js} +1 -1
- package/dist/esm/{link-extension-bc234cf7.js → link-extension-57ba9520.js} +9 -8
- package/dist/esm/loader.js +20 -19
- package/dist/esm/{month-view-generator-20e32b22.js → month-view-generator-15215a09.js} +1 -1
- package/dist/esm/{public-rules-8dc3fb00.js → public-rules-c77a1550.js} +9 -7
- package/dist/esm/{range-d2439ba7.js → range-3c74e1c8.js} +1 -1
- package/dist/esm/{responsive-format-facade-07843ec3.js → responsive-format-facade-1b325d06.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-a0663a84.js → rich-text-editor-required-rule-cfd32ba2.js} +1 -1
- package/dist/esm/{split-cell-operation-1a889fa0.js → split-cell-operation-85a036f9.js} +14 -18
- package/dist/esm/{state-border-formatter-3b3dcfe8.js → state-border-formatter-ce3495b0.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-44381dcb.js → string-format-strategy.abstract-8ce04558.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-69887c40.js → string-input-formatter-slimmer-0d60ba7d.js} +1 -1
- package/dist/esm/{string-mask-strategy-999fba4b.js → string-mask-strategy-cabc1d50.js} +2 -2
- package/dist/esm/{style-formatter-c4192c99.js → style-formatter-00fe4f1c.js} +2 -2
- package/dist/esm/{time-required-rule-0554b114.js → time-required-rule-57ceeae9.js} +1 -1
- package/dist/esm/{token-extension-530d9bde.js → token-extension-645a9520.js} +1172 -1253
- package/dist/esm/{translation-slimmer-77022f2e.js → translation-slimmer-b69057eb.js} +1 -1
- package/dist/esm/{type-guard-26d83e7e.js → type-guard-204094c6.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-f60b6904.js → valid-credit-card-number-rule-0874e19f.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +14 -14
- package/dist/esm/vega-app-footer.entry.js +5 -5
- package/dist/esm/vega-app-header-button.entry.js +14 -14
- package/dist/esm/vega-backdrop.entry.js +2 -2
- package/dist/esm/vega-banner.entry.js +8 -8
- package/dist/esm/vega-bar-chart.entry.js +2 -2
- package/dist/esm/vega-box.entry.js +8 -8
- package/dist/esm/vega-brand-logo.entry.js +5 -5
- package/dist/esm/vega-breadcrumb.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +11 -11
- package/dist/esm/vega-button-group_2.entry.js +7 -7
- package/dist/esm/vega-button-link.entry.js +6 -6
- package/dist/esm/vega-button.entry.js +9 -9
- package/dist/esm/vega-calendar_5.entry.js +73 -32
- package/dist/esm/vega-card.entry.js +7 -7
- package/dist/esm/vega-carousel.entry.js +8 -8
- package/dist/esm/vega-checkbox_2.entry.js +9 -9
- package/dist/esm/vega-chip.entry.js +11 -11
- package/dist/esm/vega-code-block.entry.js +17 -17
- package/dist/esm/vega-color-picker.entry.js +7 -7
- package/dist/esm/vega-color-swatch-picker.entry.js +12 -12
- package/dist/esm/vega-color-swatch.entry.js +7 -7
- package/dist/esm/vega-combo-box.entry.js +14 -14
- package/dist/esm/vega-counter-badge.entry.js +2 -2
- package/dist/esm/vega-date-picker_2.entry.js +23 -23
- package/dist/esm/{vega-dialog-controller-726b74f9.js → vega-dialog-controller-f2d3b6c9.js} +5 -3
- package/dist/esm/vega-dialog_2.entry.js +10 -10
- package/dist/esm/vega-divider.entry.js +7 -7
- package/dist/esm/vega-dropdown_5.entry.js +17 -17
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-59cd9297.js → vega-event-id-6b4db259.js} +2 -1
- package/dist/esm/vega-field-error.entry.js +2 -2
- package/dist/esm/vega-field-label.entry.js +7 -7
- package/dist/esm/vega-file-uploader.entry.js +11 -11
- package/dist/esm/vega-flag-icon.entry.js +10 -10
- package/dist/esm/vega-flex.entry.js +8 -8
- package/dist/esm/vega-font.entry.js +7 -7
- package/dist/esm/vega-form.entry.js +8 -8
- package/dist/esm/vega-grid.entry.js +7 -7
- package/dist/esm/vega-hint.entry.js +2 -2
- package/dist/esm/vega-icon.entry.js +9 -9
- package/dist/esm/vega-image-uploader.entry.js +13 -13
- package/dist/esm/vega-input-credit-card.entry.js +15 -15
- package/dist/esm/vega-input-numeric.entry.js +18 -20
- package/dist/esm/vega-input-passcode.entry.js +11 -11
- package/dist/esm/vega-input-phone-number.entry.js +10 -10
- package/dist/esm/vega-input-range.entry.js +9 -9
- package/dist/esm/vega-input-select.entry.js +14 -14
- package/dist/esm/vega-input.entry.js +39 -35
- package/dist/esm/vega-item-toggle.entry.js +5 -5
- package/dist/esm/vega-left-nav_5.entry.js +19 -19
- package/dist/esm/vega-line-chart.entry.js +2 -2
- package/dist/esm/vega-loader-wrapper_2.entry.js +6 -6
- package/dist/esm/vega-page-notification_2.entry.js +4 -4
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +5 -5
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +5 -5
- package/dist/esm/vega-pagination.entry.js +10 -10
- package/dist/esm/vega-pie-chart.entry.js +2 -2
- package/dist/esm/vega-popover_2.entry.js +14 -14
- package/dist/esm/vega-progress-tracker_2.entry.js +9 -9
- package/dist/esm/vega-radio_2.entry.js +12 -12
- package/dist/esm/vega-rich-text-bookmark-editor.entry.js +441 -0
- package/dist/esm/vega-rich-text-content.entry.js +49 -17
- package/dist/esm/vega-rich-text-editor_4.entry.js +699 -244
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +9 -9
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +10 -10
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +18 -18
- package/dist/esm/vega-section-title.entry.js +2 -2
- package/dist/esm/vega-segment-control.entry.js +5 -5
- package/dist/esm/vega-selection-chip_2.entry.js +11 -11
- package/dist/esm/vega-selection-tile_2.entry.js +9 -9
- package/dist/esm/vega-sidenav_3.entry.js +13 -13
- package/dist/esm/vega-signature-capture.entry.js +15 -15
- package/dist/esm/vega-skeleton.entry.js +2 -2
- package/dist/esm/vega-slot-container.entry.js +2 -2
- package/dist/esm/vega-stepper.entry.js +8 -8
- package/dist/esm/vega-tab-group_2.entry.js +398 -108
- package/dist/esm/vega-table_11.entry.js +23 -23
- package/dist/esm/vega-text.entry.js +2 -2
- package/dist/esm/vega-textarea.entry.js +8 -8
- package/dist/esm/vega-time-picker_2.entry.js +16 -16
- package/dist/esm/vega-toggle-switch.entry.js +7 -7
- package/dist/esm/vega-tooltip_2.entry.js +9 -9
- package/dist/esm/vega.js +20 -19
- package/dist/sri/vega-sri-manifest.json +417 -413
- package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-preview-actions-controller.d.ts +2 -0
- package/dist/types/components/vega-calendar/types.d.ts +6 -0
- package/dist/types/components/vega-calendar/vega-calendar-event-preview/assets/delete.d.ts +3 -0
- package/dist/types/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.d.ts +1 -0
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +21 -1
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-state-controller.d.ts +0 -2
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.d.ts +4 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-renderer.d.ts +2 -0
- package/dist/types/components/vega-input/vega-input.d.ts +15 -3
- package/dist/types/components/vega-input-numeric/slimmers/renderers/vega-input-numeric-renderer.d.ts +2 -0
- package/dist/types/components/vega-input-numeric/vega-input-numeric.d.ts +0 -2
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/sequential-composition-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/annotation-action.abstract.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/bold-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/clear-formatting-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/code-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/delete-node-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/horizontal-alignment-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/image-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/indent-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/italic-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/link-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/link-group-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +4 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/selection-change-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/sequential-composition-action.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/splittable-action.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/strikethrough-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/sync-up-selection-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/text-color-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/text-style-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/underline-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/plain-text-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +3 -6
- package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +2 -3
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/flush-changes-payload.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/nodes/decorator-node.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +3 -6
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +9 -2
- package/dist/types/components/vega-rich-text-editor/dto/renderers/base-renderer.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/html-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-extension-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/dto/rte-blockquote-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/blockquote/renderers/blockquote-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/action-handler-interceptors/delete-bookmark-before-text-interceptor.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/action-handler-strategies/insert-bookmark-node-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/action-handler-strategies/update-bookmark-name-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/actions/insert-bookmark-node-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/actions/update-bookmark-name-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/anchor-to-bookmark-node-strategy.d.ts +52 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/assets/bookmark.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/bookmark-extension.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/bookmark-node.d.ts +62 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/renderers/bookmark-node-renderer.d.ts +128 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/renderers/bookmark-toolbar-button-renderer.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/utils.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/vega-rich-text-bookmark-editor/slimmers/controllers/bookmark-editor-controller.d.ts +86 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/vega-rich-text-bookmark-editor/slimmers/renderers/vega-rich-text-bookmark-editor-renderer.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/vega-rich-text-bookmark-editor/types.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/bookmark/vega-rich-text-bookmark-editor/vega-rich-text-bookmark-editor.d.ts +77 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +8 -2
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/function-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/logic-control-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/horizontal-line/dto/horizontal-line-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/horizontal-line/dto/horizontal-line-node.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/horizontal-line/renderers/horizontal-line-block-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/chooser-positioner.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/paste-chooser-controller.d.ts +43 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/paste-event-interceptor.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/selection-snapshot-service.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/image-extractor.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/paste-image-parser.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/pending-image-registry.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-extension.d.ts +28 -93
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/data-transfer-builder.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/paste-dispatcher.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/paste-processing-pipeline.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/paste-processing-strategy.abstract.d.ts +28 -6
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/paste-strategy-selector.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/plain-paste-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/type.d.ts +35 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-annotations-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-cell-annotations-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/table-head-cell-annotations-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/actions/update-table-properties-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-body-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-cell-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-head-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-row-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/helpers/utils.d.ts +47 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/focus-controller.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.d.ts +17 -6
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/backward-delete-content-handler.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +30 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/forward-delete-content-handler.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.d.ts +21 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.d.ts +12 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +38 -5
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.d.ts +7 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/utils/html-to-plain-text-utils.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-type-config-controller.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +8 -0
- package/dist/types/components/vega-tab-group/helpers/vega-tab-group-width-layout-helper.d.ts +63 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.d.ts +14 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-slider-state-controller.d.ts +3 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-constrained-tab-label-renderer.d.ts +17 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.d.ts +3 -0
- package/dist/types/components/vega-tab-group/types.d.ts +10 -0
- package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +22 -0
- package/dist/types/components.d.ts +135 -1
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/dialog/vega-dialog-controller.d.ts +3 -2
- package/dist/types/helpers/discriminator/discriminated.d.ts +75 -0
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
- package/dist/types/helpers/event-manager/vega-event-manager.d.ts +3 -1
- package/dist/types/helpers/icon/icon-manager.d.ts +3 -1
- package/dist/types/helpers/loading-indicator/vega-loader-controller.d.ts +3 -1
- package/dist/types/helpers/notify/vega-notify-controller.d.ts +3 -1
- package/dist/types/helpers/skeleton-loader/vega-skeleton-loader-controller.d.ts +3 -1
- package/dist/types/helpers/slimmers/runtime-metrics/create-public-api-runtime-metrics-slimmer.d.ts +1 -1
- package/dist/types/helpers/theme/theme-manager.d.ts +3 -1
- package/dist/types/helpers/translation/interface.d.ts +12 -0
- package/dist/types/helpers/translation/translation.d.ts +3 -1
- package/dist/types/helpers/zindex/vega-z-index-manager.d.ts +3 -1
- package/dist/types/types/components.type.d.ts +2 -0
- package/dist/types/types/public-api.d.ts +2 -1
- package/dist/types/vega-slimmer/src/common/helpers/global-slimmer-registry.d.ts +10 -3
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-68ca8d3c.entry.js → p-013939ea.entry.js} +1 -1
- package/dist/vega/p-0169f71c.entry.js +1 -0
- package/dist/vega/p-018bb83b.entry.js +1 -0
- package/dist/vega/p-08bf08d2.js +1 -0
- package/dist/vega/p-0b33753f.entry.js +1 -0
- package/dist/vega/p-1537b1e4.js +1 -0
- package/dist/vega/{p-cb1cd15f.entry.js → p-17f6dc94.entry.js} +1 -1
- package/dist/vega/p-1a4d1991.entry.js +1 -0
- package/dist/vega/{p-178634f3.js → p-1b2e5898.js} +1 -1
- package/dist/vega/p-1f1f93bf.entry.js +1 -0
- package/dist/vega/{p-6e9e7131.js → p-1fb953f8.js} +1 -1
- package/dist/vega/{p-6ae93679.entry.js → p-2171b571.entry.js} +1 -1
- package/dist/vega/p-255fe20b.js +1 -0
- package/dist/vega/{p-c34f4cbc.js → p-261cf764.js} +1 -1
- package/dist/vega/p-27e77ea1.entry.js +1 -0
- package/dist/vega/p-28acbe42.entry.js +1 -0
- package/dist/vega/p-29584bb5.js +1 -0
- package/dist/vega/p-2acc600a.entry.js +1 -0
- package/dist/vega/p-2fc2299f.js +1 -0
- package/dist/vega/p-2ff659a1.entry.js +1 -0
- package/dist/vega/p-322da1eb.entry.js +1 -0
- package/dist/vega/{p-0eea1ca8.js → p-3283fa2f.js} +1 -1
- package/dist/vega/p-3567dc55.entry.js +1 -0
- package/dist/vega/p-36b795c6.entry.js +1 -0
- package/dist/vega/p-372436a4.entry.js +1 -0
- package/dist/vega/{p-8ebe30a8.js → p-37714a3a.js} +1 -1
- package/dist/vega/p-38c551a9.entry.js +1 -0
- package/dist/vega/p-3b4e2ba0.js +1 -0
- package/dist/vega/{p-4ea477d5.js → p-3b6a6f08.js} +1 -1
- package/dist/vega/p-3b911043.entry.js +1 -0
- package/dist/vega/p-3bb7114b.js +1 -0
- package/dist/vega/p-3e270b65.entry.js +1 -0
- package/dist/vega/{p-58c8a4ac.js → p-4043508a.js} +1 -1
- package/dist/vega/p-4151d4a8.js +1 -0
- package/dist/vega/p-436bd1af.entry.js +1 -0
- package/dist/vega/{p-6031bed1.js → p-44245a36.js} +1 -1
- package/dist/vega/{p-306720b8.entry.js → p-44e31581.entry.js} +1 -1
- package/dist/vega/{p-3911e760.entry.js → p-4503f5b9.entry.js} +1 -1
- package/dist/vega/{p-f01bc6a2.js → p-45af801f.js} +1 -1
- package/dist/vega/{p-d6bd3ce4.entry.js → p-467e27af.entry.js} +1 -1
- package/dist/vega/p-48c2150b.entry.js +1 -0
- package/dist/vega/p-4b253f74.entry.js +1 -0
- package/dist/vega/p-4cdc064d.entry.js +1 -0
- package/dist/vega/{p-764b4e51.entry.js → p-4e4b50f3.entry.js} +1 -1
- package/dist/vega/{p-cab890be.entry.js → p-564110ba.entry.js} +1 -1
- package/dist/vega/p-5c285374.js +1 -0
- package/dist/vega/p-5c8e4e8f.js +1 -0
- package/dist/vega/p-5d427a47.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-608d3559.entry.js +1 -0
- package/dist/vega/p-64eb05d3.entry.js +1 -0
- package/dist/vega/p-66bf209b.entry.js +1 -0
- package/dist/vega/{p-45ad2d90.entry.js → p-69eadbd8.entry.js} +1 -1
- package/dist/vega/p-6c4edee8.entry.js +1 -0
- package/dist/vega/p-6d4f6031.entry.js +1 -0
- package/dist/vega/p-6e16bb3a.js +1 -0
- package/dist/vega/p-76f4fdba.entry.js +1 -0
- package/dist/vega/p-7874055b.entry.js +1 -0
- package/dist/vega/p-7d3d24f6.entry.js +1 -0
- package/dist/vega/{p-f48519d2.js → p-7f9ad7bc.js} +1 -1
- package/dist/vega/p-80321148.entry.js +1 -0
- package/dist/vega/p-8193f4ef.entry.js +1 -0
- package/dist/vega/{p-b97ed9f7.entry.js → p-8197d172.entry.js} +1 -1
- package/dist/vega/{p-60010f14.entry.js → p-82411b76.entry.js} +1 -1
- package/dist/vega/{p-65fee02f.entry.js → p-8a38746d.entry.js} +1 -1
- package/dist/vega/{p-be783294.entry.js → p-8a6e378a.entry.js} +1 -1
- package/dist/vega/p-8ac0b1b2.entry.js +1 -0
- package/dist/vega/{p-f8d13d01.entry.js → p-8bd29577.entry.js} +1 -1
- package/dist/vega/{p-942f9ea6.entry.js → p-8c61db9d.entry.js} +1 -1
- package/dist/vega/{p-5c9c0c0d.entry.js → p-8de29082.entry.js} +1 -1
- package/dist/vega/{p-d3e99d4a.entry.js → p-8e59606f.entry.js} +1 -1
- package/dist/vega/p-8ea41806.js +1 -0
- package/dist/vega/p-9153c2f5.entry.js +1 -0
- package/dist/vega/p-916da3ce.entry.js +1 -0
- package/dist/vega/p-92411f56.entry.js +1 -0
- package/dist/vega/p-94d65dcf.entry.js +1 -0
- package/dist/vega/{p-9fb3aeeb.entry.js → p-9a0e17b2.entry.js} +1 -1
- package/dist/vega/{p-e48b7a8a.entry.js → p-9a96fb05.entry.js} +1 -1
- package/dist/vega/{p-638b6a7d.js → p-9fcfd738.js} +1 -1
- package/dist/vega/p-9fd547f3.entry.js +1 -0
- package/dist/vega/{p-e14323f3.js → p-a2c7a3bc.js} +1 -1
- package/dist/vega/p-a2dcde12.js +1 -0
- package/dist/vega/p-a2fa8c93.entry.js +1 -0
- package/dist/vega/{p-c576e846.js → p-a60d75d9.js} +1 -1
- package/dist/vega/{p-6a6c1279.js → p-a83cef5a.js} +1 -1
- package/dist/vega/{p-069bbb4a.js → p-a9fc4043.js} +1 -1
- package/dist/vega/{p-5536146c.js → p-abad8ffd.js} +1 -1
- package/dist/vega/p-abe5f7f0.entry.js +1 -0
- package/dist/vega/p-ac98c189.entry.js +1 -0
- package/dist/vega/{p-32f5a6dd.entry.js → p-ade903b3.entry.js} +1 -1
- package/dist/vega/{p-f485448a.js → p-affb40e8.js} +1 -1
- package/dist/vega/{p-b2a4314a.js → p-b3a1cd22.js} +1 -1
- package/dist/vega/p-b63a90b3.entry.js +1 -0
- package/dist/vega/p-ba050d63.entry.js +1 -0
- package/dist/vega/{p-4b35c748.js → p-ba67eb96.js} +1 -1
- package/dist/vega/p-bec0e08a.entry.js +1 -0
- package/dist/vega/p-c08ac33f.entry.js +1 -0
- package/dist/vega/{p-55c2c0df.entry.js → p-c7ec97d1.entry.js} +1 -1
- package/dist/vega/p-ca1fe571.entry.js +1 -0
- package/dist/vega/{p-c04a90d8.entry.js → p-cb68a43a.entry.js} +1 -1
- package/dist/vega/p-cc9fc36a.entry.js +1 -0
- package/dist/vega/p-d044d54f.entry.js +1 -0
- package/dist/vega/p-d1d91f1a.js +1 -0
- package/dist/vega/{p-a54ed341.entry.js → p-d3a9355c.entry.js} +1 -1
- package/dist/vega/p-d5a75228.js +1 -0
- package/dist/vega/p-dc83fa6b.entry.js +1 -0
- package/dist/vega/p-dcfce26e.entry.js +1 -0
- package/dist/vega/p-df9585f6.js +3 -0
- package/dist/vega/{p-71813a9e.entry.js → p-e2c8a470.entry.js} +1 -1
- package/dist/vega/{p-60a74fb7.js → p-e33a954f.js} +1 -1
- package/dist/vega/p-e5fc6583.entry.js +1 -0
- package/dist/vega/p-e668cf11.js +1 -0
- package/dist/vega/{p-2dda5c65.entry.js → p-e6b0a292.entry.js} +1 -1
- package/dist/vega/{p-96c090c4.js → p-e84c2589.js} +1 -1
- package/dist/vega/{p-a8a246e8.entry.js → p-eb945d34.entry.js} +1 -1
- package/dist/vega/p-ebe1dd2b.entry.js +1 -0
- package/dist/vega/p-f5874834.entry.js +1 -0
- package/dist/vega/p-f818bb20.entry.js +1 -0
- package/dist/vega/p-f981cf2c.js +1 -0
- package/dist/vega/p-f9d09b0c.js +1 -0
- package/dist/vega/{p-941a83db.js → p-fdbdf12f.js} +1 -1
- package/dist/vega/{p-6d90d28d.entry.js → p-fee080b9.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/image-extension-673ebe7f.js +0 -56
- package/dist/esm/image-extension-f6dbd70c.js +0 -53
- package/dist/vega/p-022cbf8a.js +0 -1
- package/dist/vega/p-02c1284e.entry.js +0 -1
- package/dist/vega/p-08fd229c.js +0 -1
- package/dist/vega/p-0e298ee8.entry.js +0 -1
- package/dist/vega/p-131ce9df.entry.js +0 -1
- package/dist/vega/p-143ee395.entry.js +0 -1
- package/dist/vega/p-1dbf8d1f.js +0 -1
- package/dist/vega/p-2b26e182.entry.js +0 -1
- package/dist/vega/p-30010c41.entry.js +0 -1
- package/dist/vega/p-3460a1c5.entry.js +0 -1
- package/dist/vega/p-34b523da.entry.js +0 -1
- package/dist/vega/p-357c0226.entry.js +0 -1
- package/dist/vega/p-37d5c37e.entry.js +0 -1
- package/dist/vega/p-3d6a43df.entry.js +0 -1
- package/dist/vega/p-4b117bfd.entry.js +0 -1
- package/dist/vega/p-4e23e56c.entry.js +0 -1
- package/dist/vega/p-4e70836a.entry.js +0 -1
- package/dist/vega/p-50e8e24f.entry.js +0 -1
- package/dist/vega/p-522a6eec.entry.js +0 -1
- package/dist/vega/p-587130f6.entry.js +0 -1
- package/dist/vega/p-594cb986.entry.js +0 -1
- package/dist/vega/p-5c17ddda.entry.js +0 -1
- package/dist/vega/p-6098c4bb.js +0 -1
- package/dist/vega/p-61e63c0e.entry.js +0 -1
- package/dist/vega/p-62254dc7.entry.js +0 -1
- package/dist/vega/p-62ae9327.entry.js +0 -1
- package/dist/vega/p-66245bc0.entry.js +0 -1
- package/dist/vega/p-6fae6768.js +0 -1
- package/dist/vega/p-729529d6.entry.js +0 -1
- package/dist/vega/p-75bfbffe.entry.js +0 -1
- package/dist/vega/p-77bcdd35.js +0 -1
- package/dist/vega/p-853a05eb.js +0 -1
- package/dist/vega/p-8ce9e214.js +0 -1
- package/dist/vega/p-8e8b5790.entry.js +0 -1
- package/dist/vega/p-8f00dfe6.js +0 -1
- package/dist/vega/p-9236b8d9.entry.js +0 -1
- package/dist/vega/p-9402f32f.js +0 -1
- package/dist/vega/p-9fdf66a8.entry.js +0 -1
- package/dist/vega/p-a2c45173.entry.js +0 -1
- package/dist/vega/p-a6a89f09.entry.js +0 -1
- package/dist/vega/p-ab9d53e9.js +0 -1
- package/dist/vega/p-adc64ff6.entry.js +0 -1
- package/dist/vega/p-af0cfea0.entry.js +0 -1
- package/dist/vega/p-af0e9bd5.entry.js +0 -1
- package/dist/vega/p-afcd8f04.js +0 -1
- package/dist/vega/p-b21cc390.entry.js +0 -1
- package/dist/vega/p-b94f164a.entry.js +0 -1
- package/dist/vega/p-bbfffe6b.entry.js +0 -1
- package/dist/vega/p-beccc38c.entry.js +0 -1
- package/dist/vega/p-c51de680.js +0 -3
- package/dist/vega/p-c601eea6.js +0 -1
- package/dist/vega/p-c6d2513c.entry.js +0 -1
- package/dist/vega/p-ca6bd3a0.entry.js +0 -1
- package/dist/vega/p-d37d2ea4.entry.js +0 -1
- package/dist/vega/p-d7838f6e.entry.js +0 -1
- package/dist/vega/p-d8c9ea46.entry.js +0 -1
- package/dist/vega/p-d9588b3f.entry.js +0 -1
- package/dist/vega/p-db69a5c9.entry.js +0 -1
- package/dist/vega/p-de1d0284.js +0 -1
- package/dist/vega/p-de6fc52c.js +0 -1
- package/dist/vega/p-e5226de6.entry.js +0 -1
- package/dist/vega/p-e8e3bf74.entry.js +0 -1
- package/dist/vega/p-e8f50fc5.js +0 -1
- package/dist/vega/p-eadc10bc.entry.js +0 -1
- package/dist/vega/p-ee329596.entry.js +0 -1
- package/dist/vega/p-f324e90e.js +0 -1
- package/dist/vega/p-f8b2dbb9.entry.js +0 -1
- package/dist/vega/p-f902305d.entry.js +0 -1
- package/dist/vega/p-f99f054c.entry.js +0 -1
- package/dist/vega/p-fe41e3b6.entry.js +0 -1
- package/dist/vega/p-ffdc25ec.js +0 -1
|
@@ -3,32 +3,32 @@
|
|
|
3
3
|
const misc = require('./misc-3d30df91.js');
|
|
4
4
|
const ui = require('./ui-c91c37a7.js');
|
|
5
5
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
6
|
-
const
|
|
6
|
+
const discriminated = require('./discriminated-3b8e72d5.js');
|
|
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 codeBlock = require('./code-block-
|
|
14
|
-
const contentState = require('./content-state-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
10
|
+
const internalVegaEventManager = require('./internal-vega-event-manager-0c256d63.js');
|
|
11
|
+
const internalTranslationController = require('./internal-translation-controller-0d67ca4d.js');
|
|
12
|
+
const internalCalendarPeriodFactory = require('./internal-calendar-period-factory-c3198ea7.js');
|
|
13
|
+
const codeBlock = require('./code-block-72de6c4d.js');
|
|
14
|
+
const contentState = require('./content-state-ff40bdc6.js');
|
|
15
|
+
const linkExtension = require('./link-extension-1b4ed437.js');
|
|
16
|
+
const internalIconManager = require('./internal-icon-manager-b9702049.js');
|
|
17
|
+
const typeGuard = require('./type-guard-cce6fe1f.js');
|
|
18
18
|
const vegaNonceManager = require('./vega-nonce-manager-df69d3ed.js');
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const splitCellOperation = require('./split-cell-operation-0d33123e.js');
|
|
19
|
+
const imageExtension = require('./image-extension-6a92c524.js');
|
|
20
|
+
const splitCellOperation = require('./split-cell-operation-afc82323.js');
|
|
22
21
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
22
|
+
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-c82df135.js');
|
|
23
23
|
const vegaInternalEventId = require('./vega-internal-event-id-98d499d7.js');
|
|
24
24
|
const remoteInvocationRegistry = require('./remote-invocation-registry-fc22fdd0.js');
|
|
25
25
|
const darkModeStyleController = require('./dark-mode-style-controller-ec04ece9.js');
|
|
26
|
+
const vegaEventId = require('./vega-event-id-b5abf7c9.js');
|
|
26
27
|
const tryGetDocument = require('./try-get-document-c0ebd39a.js');
|
|
27
28
|
const pixel = require('./pixel-98f2a10c.js');
|
|
28
29
|
const object = require('./object-b53e9416.js');
|
|
29
30
|
const timer = require('./timer-5f33058b.js');
|
|
30
31
|
const string = require('./string-39438062.js');
|
|
31
|
-
const imageExtension = require('./image-extension-673ebe7f.js');
|
|
32
32
|
const copy = require('./copy-d021c780.js');
|
|
33
33
|
|
|
34
34
|
const VegaLoaderRuntimeMetricsPayloadDefinition = [
|
|
@@ -83,9 +83,10 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
83
83
|
/**
|
|
84
84
|
* Vega loader controller to control the loading indicator
|
|
85
85
|
*/
|
|
86
|
-
class VegaLoaderController {
|
|
86
|
+
class VegaLoaderController extends discriminated.Discriminated {
|
|
87
87
|
constructor() {
|
|
88
|
-
|
|
88
|
+
super(...arguments);
|
|
89
|
+
this.vegaPublicAPIRuntimeMetricsSlimmer = discriminated.createPublicAPIRuntimeMetricsSlimmer(VegaLoaderController, ['load', 'close'], VegaLoaderRuntimeMetricsPayloadDefinition, VegaLoaderController.typeName);
|
|
89
90
|
}
|
|
90
91
|
/**
|
|
91
92
|
* Create a loading indicator and append it to the container
|
|
@@ -195,9 +196,10 @@ class VegaLoaderController {
|
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
}
|
|
199
|
+
VegaLoaderController.typeName = 'VegaLoaderController';
|
|
198
200
|
VegaLoaderController.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY = ['VEGA-MODAL'];
|
|
199
201
|
__decorate$6([
|
|
200
|
-
|
|
202
|
+
discriminated.InjectVegaTelemetrySlimmer()
|
|
201
203
|
], VegaLoaderController.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
|
202
204
|
const VegaLoader = new VegaLoaderController();
|
|
203
205
|
|
|
@@ -273,8 +275,9 @@ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
273
275
|
/**
|
|
274
276
|
* The page notification controller
|
|
275
277
|
*/
|
|
276
|
-
class VegaNotifyController {
|
|
278
|
+
class VegaNotifyController extends discriminated.Discriminated {
|
|
277
279
|
constructor() {
|
|
280
|
+
super(...arguments);
|
|
278
281
|
this.resizeObserverSlimmer = dynamicSlimmer.createDynamicSlimmer(VegaNotifyController, pageResizeObserverSlimmer.PageResizeObserverSlimmer, [], [{ mapFrom: 'connectResizeObserver', mapTo: 'connectResizeObserver' }], [
|
|
279
282
|
{
|
|
280
283
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
@@ -291,7 +294,7 @@ class VegaNotifyController {
|
|
|
291
294
|
target: () => this.container,
|
|
292
295
|
},
|
|
293
296
|
]);
|
|
294
|
-
this.vegaPublicAPIRuntimeMetricsSlimmer =
|
|
297
|
+
this.vegaPublicAPIRuntimeMetricsSlimmer = discriminated.createPublicAPIRuntimeMetricsSlimmer(VegaNotifyController, ['open', 'close', 'closeAll'], VegaNotifyRuntimeMetricsPayloadDefinition, VegaNotifyController.typeName);
|
|
295
298
|
}
|
|
296
299
|
/**
|
|
297
300
|
* It creates a new notification element, adds it to the container, and returns the notification's ID
|
|
@@ -375,11 +378,12 @@ class VegaNotifyController {
|
|
|
375
378
|
return this.container;
|
|
376
379
|
}
|
|
377
380
|
}
|
|
381
|
+
VegaNotifyController.typeName = 'VegaNotifyController';
|
|
378
382
|
__decorate$5([
|
|
379
383
|
globalSlimmerRegistry.InjectVegaSlimmer()
|
|
380
384
|
], VegaNotifyController.prototype, "resizeObserverSlimmer", void 0);
|
|
381
385
|
__decorate$5([
|
|
382
|
-
|
|
386
|
+
discriminated.InjectVegaTelemetrySlimmer()
|
|
383
387
|
], VegaNotifyController.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
|
384
388
|
const VegaNotify = new VegaNotifyController();
|
|
385
389
|
|
|
@@ -607,9 +611,10 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
607
611
|
* The VegaEventManager class provides methods for setting and retrieving event semantics configuration,
|
|
608
612
|
* as well as getting the corresponding native event name for a given event.
|
|
609
613
|
*/
|
|
610
|
-
class VegaEventManager {
|
|
614
|
+
class VegaEventManager extends discriminated.Discriminated {
|
|
611
615
|
constructor() {
|
|
612
|
-
|
|
616
|
+
super(...arguments);
|
|
617
|
+
this.vegaPublicAPIRuntimeMetricsSlimmer = discriminated.createPublicAPIRuntimeMetricsSlimmer(VegaEventManager, ['setSemantics', 'getSemantics', 'getEnabledEventIdsByComponent'], VegaEventManagerRuntimeMetricsPayloadDefinition, VegaEventManager.typeName);
|
|
613
618
|
}
|
|
614
619
|
/**
|
|
615
620
|
* The function sets the semantics configuration for event management.
|
|
@@ -647,8 +652,9 @@ class VegaEventManager {
|
|
|
647
652
|
return internalVegaEventManager.internalVegaEventManager.getEnabledEventIdsByComponent(componentName);
|
|
648
653
|
}
|
|
649
654
|
}
|
|
655
|
+
VegaEventManager.typeName = 'VegaEventManager';
|
|
650
656
|
__decorate$4([
|
|
651
|
-
|
|
657
|
+
discriminated.InjectVegaTelemetrySlimmer()
|
|
652
658
|
], VegaEventManager.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
|
653
659
|
const VegaEventManager$1 = new VegaEventManager();
|
|
654
660
|
|
|
@@ -706,9 +712,10 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
706
712
|
* The VegaZIndexManager class calls a method in the ZIndexManager class to
|
|
707
713
|
* change z-index values based on the input.
|
|
708
714
|
*/
|
|
709
|
-
class VegaZIndexManager {
|
|
715
|
+
class VegaZIndexManager extends discriminated.Discriminated {
|
|
710
716
|
constructor() {
|
|
711
|
-
|
|
717
|
+
super(...arguments);
|
|
718
|
+
this.vegaPublicAPIRuntimeMetricsSlimmer = discriminated.createPublicAPIRuntimeMetricsSlimmer(VegaZIndexManager, ['overrideZIndexBasicValues'], ZIndexManagerRuntimeMetricsPayloadDefinition, VegaZIndexManager.typeName);
|
|
712
719
|
}
|
|
713
720
|
/**
|
|
714
721
|
* The function "overrideZIndexBasicValues" calls a method in the "ZIndexManager" class to change the
|
|
@@ -721,8 +728,9 @@ class VegaZIndexManager {
|
|
|
721
728
|
internalVegaZIndexManager.InternalVegaZIndexManager.overrideZIndexBasicValues(input);
|
|
722
729
|
}
|
|
723
730
|
}
|
|
731
|
+
VegaZIndexManager.typeName = 'VegaZIndexManager';
|
|
724
732
|
__decorate$3([
|
|
725
|
-
|
|
733
|
+
discriminated.InjectVegaTelemetrySlimmer()
|
|
726
734
|
], VegaZIndexManager.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
|
727
735
|
const VegaZIndexManager$1 = new VegaZIndexManager();
|
|
728
736
|
|
|
@@ -758,9 +766,10 @@ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
758
766
|
/**
|
|
759
767
|
* WaitForVegaHandler to check whether the vega component has been loaded.
|
|
760
768
|
*/
|
|
761
|
-
class WaitForVegaHandler {
|
|
769
|
+
class WaitForVegaHandler extends discriminated.Discriminated {
|
|
762
770
|
constructor() {
|
|
763
|
-
|
|
771
|
+
super(...arguments);
|
|
772
|
+
this.vegaPublicAPIRuntimeMetricsSlimmer = discriminated.createPublicAPIRuntimeMetricsSlimmer(WaitForVegaHandler, ['handle'], WaitForVegaPayloadDefinition, WaitForVegaHandler.typeName);
|
|
764
773
|
}
|
|
765
774
|
/* istanbul ignore next */
|
|
766
775
|
/**
|
|
@@ -778,8 +787,9 @@ class WaitForVegaHandler {
|
|
|
778
787
|
.map((item) => { var _a; return (_a = item.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(item); }));
|
|
779
788
|
}
|
|
780
789
|
}
|
|
790
|
+
WaitForVegaHandler.typeName = 'WaitForVegaHandler';
|
|
781
791
|
__decorate$2([
|
|
782
|
-
|
|
792
|
+
discriminated.InjectVegaTelemetrySlimmer()
|
|
783
793
|
], WaitForVegaHandler.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
|
784
794
|
const WaitForVega = new WaitForVegaHandler();
|
|
785
795
|
/* istanbul ignore next */
|
|
@@ -866,9 +876,10 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
866
876
|
/**
|
|
867
877
|
* Vega Skeleton Loader Controller to show skeletons in the target elements
|
|
868
878
|
*/
|
|
869
|
-
class VegaSkeletonLoaderController {
|
|
879
|
+
class VegaSkeletonLoaderController extends discriminated.Discriminated {
|
|
870
880
|
constructor() {
|
|
871
|
-
|
|
881
|
+
super(...arguments);
|
|
882
|
+
this.vegaPublicAPIRuntimeMetricsSlimmer = discriminated.createPublicAPIRuntimeMetricsSlimmer(VegaSkeletonLoaderController, ['load', 'unLoad', 'unLoadAll'], VegaSkeletonRuntimeMetricsPayloadDefinition, VegaSkeletonLoaderController.typeName);
|
|
872
883
|
this.loaderMap = new Map();
|
|
873
884
|
}
|
|
874
885
|
/**
|
|
@@ -955,9 +966,10 @@ class VegaSkeletonLoaderController {
|
|
|
955
966
|
return skeletonContainer;
|
|
956
967
|
}
|
|
957
968
|
}
|
|
969
|
+
VegaSkeletonLoaderController.typeName = 'VegaSkeletonLoaderController';
|
|
958
970
|
VegaSkeletonLoaderController.LOADER_DATA_SET_KEY = 'vegaSkeletonLoaderKey';
|
|
959
971
|
__decorate$1([
|
|
960
|
-
|
|
972
|
+
discriminated.InjectVegaTelemetrySlimmer()
|
|
961
973
|
], VegaSkeletonLoaderController.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
|
962
974
|
const VegaSkeletonLoader = new VegaSkeletonLoaderController();
|
|
963
975
|
|
|
@@ -1015,9 +1027,10 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
1015
1027
|
*
|
|
1016
1028
|
* @vegaVersion 2.27.0
|
|
1017
1029
|
*/
|
|
1018
|
-
class TranslationController {
|
|
1030
|
+
class TranslationController extends discriminated.Discriminated {
|
|
1019
1031
|
constructor() {
|
|
1020
|
-
|
|
1032
|
+
super(...arguments);
|
|
1033
|
+
this.vegaPublicAPIRuntimeMetricsSlimmer = discriminated.createPublicAPIRuntimeMetricsSlimmer(TranslationController, ['init', 'changeLanguage'], VegaTranslationRuntimeMetricsPayloadDefinition, TranslationController.typeName);
|
|
1021
1034
|
}
|
|
1022
1035
|
/**
|
|
1023
1036
|
* Get current language
|
|
@@ -1047,8 +1060,9 @@ class TranslationController {
|
|
|
1047
1060
|
internalTranslationController.VegaInternalTranslation.changeLanguage(language);
|
|
1048
1061
|
}
|
|
1049
1062
|
}
|
|
1063
|
+
TranslationController.typeName = 'TranslationController';
|
|
1050
1064
|
__decorate([
|
|
1051
|
-
|
|
1065
|
+
discriminated.InjectVegaTelemetrySlimmer()
|
|
1052
1066
|
], TranslationController.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
|
1053
1067
|
const VegaTranslation = new TranslationController();
|
|
1054
1068
|
|
|
@@ -1071,336 +1085,6 @@ class VegaCalendarPeriodFactory {
|
|
|
1071
1085
|
}
|
|
1072
1086
|
}
|
|
1073
1087
|
|
|
1074
|
-
/**
|
|
1075
|
-
* Base class for rendering extension toolbar button in the rich text editor.
|
|
1076
|
-
* The renderer provides common functionalities for rendering toolbar buttons, including:
|
|
1077
|
-
* - Rendering a button with an icon, label, and optional arrow icon.
|
|
1078
|
-
* - Rendering a dropdown with a list of items.
|
|
1079
|
-
* - Rendering dropdown items.
|
|
1080
|
-
* - Rendering template for dropdown list.
|
|
1081
|
-
* - Determining if the button should be disabled based on the editor context.
|
|
1082
|
-
* - Handling button and dropdown click events.
|
|
1083
|
-
* Override the methods to customize the rendering and behavior of the button.
|
|
1084
|
-
*/
|
|
1085
|
-
class VegaRTEToolbarButtonRenderer {
|
|
1086
|
-
constructor() {
|
|
1087
|
-
this.dropdownEl = null;
|
|
1088
|
-
this.itemsContainerEl = null;
|
|
1089
|
-
this.buttonEl = null;
|
|
1090
|
-
}
|
|
1091
|
-
/**
|
|
1092
|
-
* Checks if the button should be hidden.
|
|
1093
|
-
*
|
|
1094
|
-
* @param {VegaRTEToolbarRenderContext} editorContext The render context for the editor.
|
|
1095
|
-
* @returns {boolean} True if the button is hidden, false otherwise.
|
|
1096
|
-
*/
|
|
1097
|
-
isHidden(editorContext) {
|
|
1098
|
-
return editorContext.sourceEditMode;
|
|
1099
|
-
}
|
|
1100
|
-
/**
|
|
1101
|
-
* Get the extension context for the given rich text editor host element.
|
|
1102
|
-
*
|
|
1103
|
-
* @typedef HTMLVegaRichTextEditorElement - The type definition for the rich text editor host element.
|
|
1104
|
-
* @param {HTMLVegaRichTextEditorElement} el - The host rich text editor element.
|
|
1105
|
-
* @returns {Nullable<RTEExtensionContext>} - The extension context associated with the host.
|
|
1106
|
-
*/
|
|
1107
|
-
getExtensionContext(el) {
|
|
1108
|
-
return linkExtension.extensionContextManager.getExtensionContext(el);
|
|
1109
|
-
}
|
|
1110
|
-
/**
|
|
1111
|
-
* Renders a dropdown component with the specified properties and children.
|
|
1112
|
-
*
|
|
1113
|
-
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
1114
|
-
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
1115
|
-
* @param {RTEToolbarDropdownProps} dropdownProps - The properties for the dropdown.
|
|
1116
|
-
* @param {VegaRTERenderResult[]} children - The children elements for the dropdown.
|
|
1117
|
-
* @returns {VegaRTERenderResult} - The render result for the dropdown.
|
|
1118
|
-
*/
|
|
1119
|
-
renderDropdown(h, editorContext, dropdownProps, children) {
|
|
1120
|
-
return h('vega-dropdown', Object.assign({ trigger: 'click', searchable: false, maxWidth: '200', itemDisplayRule: 'ellipsis', isScreenPosition: true, role: 'presentation',
|
|
1121
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1122
|
-
ref: (el) => {
|
|
1123
|
-
this.dropdownEl = el;
|
|
1124
|
-
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(el, vegaEventId.VegaDropdownClick, (input) => {
|
|
1125
|
-
const payload = input;
|
|
1126
|
-
this.handleDropdownClick(payload.detail, editorContext);
|
|
1127
|
-
});
|
|
1128
|
-
} }, dropdownProps), children);
|
|
1129
|
-
}
|
|
1130
|
-
/**
|
|
1131
|
-
* Renders the dropdown list template.
|
|
1132
|
-
*
|
|
1133
|
-
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
1134
|
-
* @param {(RTEDropdownListItem | RTEDropdownListGroup)[]} itemList - The list of dropdown items.
|
|
1135
|
-
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
1136
|
-
* @returns {VegaRTERenderResult} - The render result for the dropdown list.
|
|
1137
|
-
*/
|
|
1138
|
-
renderDropdownListTemplate(h, itemList, editorContext) {
|
|
1139
|
-
return h('div', {
|
|
1140
|
-
slot: 'items',
|
|
1141
|
-
onMouseDown: this.preventDefault,
|
|
1142
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1143
|
-
onKeyDown: (e) => this.handleItemsKeyDown(e),
|
|
1144
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1145
|
-
ref: (el) => {
|
|
1146
|
-
this.itemsContainerEl = el;
|
|
1147
|
-
},
|
|
1148
|
-
class: 'rte-dropdown-list',
|
|
1149
|
-
}, [
|
|
1150
|
-
h('style', { nonce: vegaNonceManager.vegaNonceManager.nonce }, '.rte-dropdown-list vega-dropdown-group vega-dropdown-group { padding-left: 4px }'),
|
|
1151
|
-
...itemList.map((item) => {
|
|
1152
|
-
return 'children' in item
|
|
1153
|
-
? this.renderDropdownGroup(h, item, editorContext)
|
|
1154
|
-
: this.renderDropdownItem(h, item, editorContext);
|
|
1155
|
-
}),
|
|
1156
|
-
]);
|
|
1157
|
-
}
|
|
1158
|
-
/**
|
|
1159
|
-
* Renders a dropdown item for the toolbar button.
|
|
1160
|
-
*
|
|
1161
|
-
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
1162
|
-
* @param {RTEDropdownListItem} item - The dropdown item.
|
|
1163
|
-
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
1164
|
-
* @returns {VegaRTERenderResult} - The render result for the dropdown item.
|
|
1165
|
-
*/
|
|
1166
|
-
renderDropdownItem(h, item, editorContext) {
|
|
1167
|
-
return h('vega-dropdown-item', {
|
|
1168
|
-
key: item.key,
|
|
1169
|
-
itemKey: item.key,
|
|
1170
|
-
label: editorContext.translation.t(item.label),
|
|
1171
|
-
prefixIcon: item.icon,
|
|
1172
|
-
});
|
|
1173
|
-
}
|
|
1174
|
-
/**
|
|
1175
|
-
* Renders a dropdown group for the toolbar button.
|
|
1176
|
-
*
|
|
1177
|
-
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
1178
|
-
* @param {RTEDropdownListGroup} item - The dropdown group.
|
|
1179
|
-
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
1180
|
-
* @returns {VegaRTERenderResult} - The render result for the dropdown group.
|
|
1181
|
-
*/
|
|
1182
|
-
renderDropdownGroup(h, item, editorContext) {
|
|
1183
|
-
return h('vega-dropdown-group', {
|
|
1184
|
-
key: item.key,
|
|
1185
|
-
label: editorContext.translation.t(item.label),
|
|
1186
|
-
divide: false,
|
|
1187
|
-
}, item.children.map((child) => {
|
|
1188
|
-
return 'children' in child
|
|
1189
|
-
? this.renderDropdownGroup(h, child, editorContext)
|
|
1190
|
-
: this.renderDropdownItem(h, child, editorContext);
|
|
1191
|
-
}));
|
|
1192
|
-
}
|
|
1193
|
-
/**
|
|
1194
|
-
* Renders a common toolbar button with optional icon, label, and arrow icon.
|
|
1195
|
-
* When a tooltip is provided via `buttonProps.tooltip`, the button is wrapped
|
|
1196
|
-
* in a `vega-tooltip` element, matching the behavior of default toolbar buttons.
|
|
1197
|
-
*
|
|
1198
|
-
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
1199
|
-
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
1200
|
-
* @param {RTEToolbarButtonProps} buttonProps - The properties for the button.
|
|
1201
|
-
* @returns {VegaRTERenderResult} - The render result for the button.
|
|
1202
|
-
*/
|
|
1203
|
-
renderButton(h, editorContext, buttonProps) {
|
|
1204
|
-
const { icon, label, showArrowIcon, tooltip, ariaLabel } = buttonProps;
|
|
1205
|
-
const isDisabled = this.isDisabled(editorContext);
|
|
1206
|
-
const button = h('vega-rich-text-editor-toolbar-button', {
|
|
1207
|
-
'disabled': isDisabled,
|
|
1208
|
-
'icon': icon,
|
|
1209
|
-
'data-aria-label': ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label,
|
|
1210
|
-
'hidden': this.isHidden(editorContext),
|
|
1211
|
-
'selected': this.isSelected(editorContext),
|
|
1212
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1213
|
-
'ref': (el) => {
|
|
1214
|
-
this.buttonEl = el;
|
|
1215
|
-
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(el, vegaEventId.VegaClick, () => this.handleButtonClick(editorContext));
|
|
1216
|
-
},
|
|
1217
|
-
'onMouseDown': this.preventDefault,
|
|
1218
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1219
|
-
'onKeyDown': (e) => this.handleButtonKeyDown(e),
|
|
1220
|
-
}, [
|
|
1221
|
-
this.renderButtonLabel(h, editorContext, label),
|
|
1222
|
-
showArrowIcon
|
|
1223
|
-
? h('vega-icon', {
|
|
1224
|
-
'size': 'size-8',
|
|
1225
|
-
'color': isDisabled ? 'text-disabled' : 'text-secondary',
|
|
1226
|
-
'style': { marginLeft: '8px' },
|
|
1227
|
-
'aria-hidden': 'true',
|
|
1228
|
-
'icon': internalIconManager.VegaInternalIconManager.getIconKey('chevron-down'),
|
|
1229
|
-
})
|
|
1230
|
-
: null,
|
|
1231
|
-
].filter(typeGuard.isNonNullable));
|
|
1232
|
-
if (tooltip === null || tooltip === void 0 ? void 0 : tooltip.text) {
|
|
1233
|
-
return h('vega-tooltip', { text: editorContext.translation.t(tooltip.text), placement: ['bottom', 'top'] }, [button]);
|
|
1234
|
-
}
|
|
1235
|
-
return button;
|
|
1236
|
-
}
|
|
1237
|
-
/**
|
|
1238
|
-
* Renders the button label.
|
|
1239
|
-
*
|
|
1240
|
-
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
1241
|
-
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
1242
|
-
* @param {Nullable<string>} label - The button label if exist.
|
|
1243
|
-
* @returns {Nullable<VegaRTERenderResult>} - The render result for the button.
|
|
1244
|
-
*/
|
|
1245
|
-
renderButtonLabel(h, editorContext, label) {
|
|
1246
|
-
if (label) {
|
|
1247
|
-
const isDisabled = this.isDisabled(editorContext);
|
|
1248
|
-
return h('vega-font', {
|
|
1249
|
-
'variant': 'font-field-label-sm',
|
|
1250
|
-
'color': isDisabled ? 'text-disabled' : 'text-primary',
|
|
1251
|
-
'aria-hidden': 'true',
|
|
1252
|
-
}, editorContext.translation.t(label));
|
|
1253
|
-
}
|
|
1254
|
-
return null;
|
|
1255
|
-
}
|
|
1256
|
-
/**
|
|
1257
|
-
* Determines if the button should be disabled based on the editor context.
|
|
1258
|
-
*
|
|
1259
|
-
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
1260
|
-
* @returns {boolean} - True if the button should be disabled, false otherwise.
|
|
1261
|
-
*/
|
|
1262
|
-
isDisabled(editorContext) {
|
|
1263
|
-
return editorContext.host.disabled;
|
|
1264
|
-
}
|
|
1265
|
-
/**
|
|
1266
|
-
* Checks if the button should be selected.
|
|
1267
|
-
*
|
|
1268
|
-
* @param {VegaRTEToolbarRenderContext} _editorContext The render context for the editor.
|
|
1269
|
-
* @returns {boolean} True if the button is selected, false otherwise.
|
|
1270
|
-
*/
|
|
1271
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1272
|
-
isSelected(_editorContext) {
|
|
1273
|
-
return false;
|
|
1274
|
-
}
|
|
1275
|
-
/**
|
|
1276
|
-
* Prevents the default action of the click event. This is to avoid losing focus from the editor when the button is clicked.
|
|
1277
|
-
*
|
|
1278
|
-
* @param {MouseEvent} e The mouse event to prevent default action for.
|
|
1279
|
-
*/
|
|
1280
|
-
preventDefault(e) {
|
|
1281
|
-
e.preventDefault();
|
|
1282
|
-
}
|
|
1283
|
-
/**
|
|
1284
|
-
* Moves focus to the toolbar button. Targets the inner focusable `<button>`
|
|
1285
|
-
* inside the button's shadow root, falling back to the host element.
|
|
1286
|
-
*/
|
|
1287
|
-
focusToolbarButton() {
|
|
1288
|
-
var _a, _b, _c, _d;
|
|
1289
|
-
const innerButton = (_c = (_b = (_a = this.buttonEl) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('button')) !== null && _c !== void 0 ? _c : null;
|
|
1290
|
-
(_d = (innerButton !== null && innerButton !== void 0 ? innerButton : this.buttonEl)) === null || _d === void 0 ? void 0 : _d.focus();
|
|
1291
|
-
}
|
|
1292
|
-
/**
|
|
1293
|
-
* Recursively searches for a dropdown list item by its key.
|
|
1294
|
-
*
|
|
1295
|
-
* @param {(RTEDropdownListItem | RTEDropdownListGroup)[]} itemList The list of dropdown items or groups to search through.
|
|
1296
|
-
* @param {string} key The key of the item to find.
|
|
1297
|
-
* @returns {Nullable<RTEDropdownListItem>} The dropdown list item if found, otherwise null.
|
|
1298
|
-
*/
|
|
1299
|
-
getListItemByKey(itemList, key) {
|
|
1300
|
-
for (const item of itemList) {
|
|
1301
|
-
if ('children' in item) {
|
|
1302
|
-
const foundItem = this.getListItemByKey(item.children, key);
|
|
1303
|
-
if (foundItem) {
|
|
1304
|
-
return foundItem;
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
else if (item.key === key) {
|
|
1308
|
-
return item;
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
return null;
|
|
1312
|
-
}
|
|
1313
|
-
/**
|
|
1314
|
-
* Handles keyboard events on the toolbar button to support dropdown keyboard accessibility.
|
|
1315
|
-
* - Enter / Space: Toggles the dropdown open/closed.
|
|
1316
|
-
* - ArrowDown / ArrowUp: Opens the dropdown and focuses the first/last item.
|
|
1317
|
-
*
|
|
1318
|
-
* @param {KeyboardEvent} e The keyboard event.
|
|
1319
|
-
*/
|
|
1320
|
-
handleButtonKeyDown(e) {
|
|
1321
|
-
if (!this.dropdownEl) {
|
|
1322
|
-
return;
|
|
1323
|
-
}
|
|
1324
|
-
if (e.code === 'Enter' || e.code === 'Space') {
|
|
1325
|
-
e.preventDefault();
|
|
1326
|
-
e.stopPropagation();
|
|
1327
|
-
this.dropdownEl.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
1328
|
-
}
|
|
1329
|
-
else if (e.code === 'ArrowDown' || e.code === 'ArrowUp') {
|
|
1330
|
-
e.preventDefault();
|
|
1331
|
-
e.stopPropagation();
|
|
1332
|
-
void this.dropdownEl.show().then(() => {
|
|
1333
|
-
this.focusDropdownItem(e.code === 'ArrowDown' ? 'first' : 'last');
|
|
1334
|
-
});
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
/**
|
|
1338
|
-
* Handles keyboard navigation within the dropdown items container.
|
|
1339
|
-
* - ArrowDown/ArrowUp: Moves focus to the next/previous non-disabled item.
|
|
1340
|
-
* - Escape: Closes the dropdown and returns focus to the toolbar button.
|
|
1341
|
-
*
|
|
1342
|
-
* @param {KeyboardEvent} e The keyboard event.
|
|
1343
|
-
*/
|
|
1344
|
-
handleItemsKeyDown(e) {
|
|
1345
|
-
var _a, _b;
|
|
1346
|
-
if (e.code === 'Escape') {
|
|
1347
|
-
e.preventDefault();
|
|
1348
|
-
e.stopPropagation();
|
|
1349
|
-
if (this.dropdownEl) {
|
|
1350
|
-
void this.dropdownEl.hide();
|
|
1351
|
-
}
|
|
1352
|
-
this.focusToolbarButton();
|
|
1353
|
-
return;
|
|
1354
|
-
}
|
|
1355
|
-
if (e.code !== 'ArrowDown' && e.code !== 'ArrowUp') {
|
|
1356
|
-
return;
|
|
1357
|
-
}
|
|
1358
|
-
e.preventDefault();
|
|
1359
|
-
e.stopPropagation();
|
|
1360
|
-
const items = this.getDropdownItems();
|
|
1361
|
-
if (items.length === 0) {
|
|
1362
|
-
return;
|
|
1363
|
-
}
|
|
1364
|
-
const currentIndex = items.findIndex((item) => { var _a, _b; return ((_a = item.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('li')) === ((_b = item.shadowRoot) === null || _b === void 0 ? void 0 : _b.activeElement); });
|
|
1365
|
-
const direction = e.code === 'ArrowDown' ? 1 : -1;
|
|
1366
|
-
const startIndex = currentIndex === -1 ? (e.code === 'ArrowDown' ? 0 : items.length - 1) : currentIndex + direction;
|
|
1367
|
-
for (let offset = 0; offset < items.length; offset++) {
|
|
1368
|
-
const index = (startIndex + offset * direction + items.length) % items.length;
|
|
1369
|
-
if (!items[index].disabled) {
|
|
1370
|
-
(_b = (_a = items[index].shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('li')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
1371
|
-
return;
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
/**
|
|
1376
|
-
* Focuses the first or last non-disabled dropdown item.
|
|
1377
|
-
*
|
|
1378
|
-
* @param {'first' | 'last'} position Whether to focus the first or last item.
|
|
1379
|
-
*/
|
|
1380
|
-
focusDropdownItem(position) {
|
|
1381
|
-
var _a, _b;
|
|
1382
|
-
const items = this.getDropdownItems();
|
|
1383
|
-
const orderedItems = position === 'first' ? items : [...items].reverse();
|
|
1384
|
-
for (const item of orderedItems) {
|
|
1385
|
-
if (!item.disabled) {
|
|
1386
|
-
(_b = (_a = item.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('li')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
1387
|
-
return;
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
/**
|
|
1392
|
-
* Gets all dropdown items from the items container.
|
|
1393
|
-
*
|
|
1394
|
-
* @returns {HTMLVegaDropdownItemElement[]} Array of dropdown item elements.
|
|
1395
|
-
*/
|
|
1396
|
-
getDropdownItems() {
|
|
1397
|
-
if (!this.itemsContainerEl) {
|
|
1398
|
-
return [];
|
|
1399
|
-
}
|
|
1400
|
-
return Array.from(this.itemsContainerEl.querySelectorAll('vega-dropdown-item'));
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
1088
|
/**
|
|
1405
1089
|
* Action to insert a token node at a specified range in the Rich Text Editor.
|
|
1406
1090
|
*
|
|
@@ -1420,7 +1104,7 @@ class InsertTokenNodeAction extends codeBlock.ModifyContentAction {
|
|
|
1420
1104
|
/**
|
|
1421
1105
|
* Renderer for the token toolbar button in the Vega Rich Text Editor.
|
|
1422
1106
|
*/
|
|
1423
|
-
class RTETokenToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
1107
|
+
class RTETokenToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
1424
1108
|
constructor(tokenList) {
|
|
1425
1109
|
super();
|
|
1426
1110
|
this.tokenList = [];
|
|
@@ -1508,7 +1192,6 @@ class RTETokenToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
|
1508
1192
|
class RTETokenNode extends codeBlock.RTETextNode {
|
|
1509
1193
|
constructor(id, token, text, parentBlock, annotations) {
|
|
1510
1194
|
super(id, text, parentBlock, annotations);
|
|
1511
|
-
this.dtoName = RTETokenNode.dtoName;
|
|
1512
1195
|
this.type = 'token';
|
|
1513
1196
|
this.token = token;
|
|
1514
1197
|
this.text = text;
|
|
@@ -1599,7 +1282,7 @@ class RTETokenNode extends codeBlock.RTETextNode {
|
|
|
1599
1282
|
return attrs.length > 0 ? ` ${attrs.join(' ')}` : '';
|
|
1600
1283
|
}
|
|
1601
1284
|
}
|
|
1602
|
-
RTETokenNode.
|
|
1285
|
+
RTETokenNode.typeName = 'RTETokenNode';
|
|
1603
1286
|
|
|
1604
1287
|
/**
|
|
1605
1288
|
* Token node renderer for the rich text editor.
|
|
@@ -1661,13 +1344,14 @@ class RTETokenNodeRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
1661
1344
|
return result;
|
|
1662
1345
|
}
|
|
1663
1346
|
}
|
|
1347
|
+
RTETokenNodeRenderer.typeName = 'RTETokenNodeRenderer';
|
|
1664
1348
|
|
|
1665
1349
|
/**
|
|
1666
1350
|
* Toolbar button renderer for language selection in Vega Rich Text Editor.
|
|
1667
1351
|
* Each editor host gets its own instance, registered via
|
|
1668
1352
|
* {@link VegaRTEExtension#prepareBeforeLoad}, so renderer state is held in plain fields.
|
|
1669
1353
|
*/
|
|
1670
|
-
class RTELanguageToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
1354
|
+
class RTELanguageToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
1671
1355
|
constructor(languageList, languageChangeCallback, selectedLanguage = '') {
|
|
1672
1356
|
super();
|
|
1673
1357
|
this.languageList = [];
|
|
@@ -1947,98 +1631,273 @@ const FUNCTION_ELEMENT_CLASSES = [
|
|
|
1947
1631
|
];
|
|
1948
1632
|
|
|
1949
1633
|
/**
|
|
1950
|
-
*
|
|
1634
|
+
* Class representing a logic control node in the rich text editor.
|
|
1951
1635
|
*/
|
|
1952
|
-
class
|
|
1953
|
-
constructor(id) {
|
|
1636
|
+
class RTELogicControlNode extends codeBlock.RTENode {
|
|
1637
|
+
constructor(id, text, parent) {
|
|
1954
1638
|
super(id);
|
|
1955
|
-
this.
|
|
1956
|
-
this.
|
|
1957
|
-
this.
|
|
1639
|
+
this.type = 'logic-control-node';
|
|
1640
|
+
this.text = '';
|
|
1641
|
+
this.text = text;
|
|
1642
|
+
this.parent = parent;
|
|
1958
1643
|
}
|
|
1959
1644
|
/**
|
|
1960
|
-
*
|
|
1645
|
+
* Clone the current node instance.
|
|
1961
1646
|
*
|
|
1962
|
-
* @
|
|
1963
|
-
* @param {VegaRTETransformOptions} [options] - Optional transformation options.
|
|
1964
|
-
* @returns {RTEFunctionBlock} The resulting RTEFunctionBlock.
|
|
1647
|
+
* @returns {RTELogicControlNode} - A new instance of RTELogicControlNode.
|
|
1965
1648
|
*/
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
const defaultAnnotation = { customClass: [FUNCTION_BLOCK_CLASS] };
|
|
1969
|
-
let { annotations } = block;
|
|
1970
|
-
annotations = annotations
|
|
1971
|
-
? Object.assign(Object.assign({}, annotations), defaultAnnotation) : defaultAnnotation;
|
|
1972
|
-
super.convertAnnotationsToMap(functionBlock.annotationMap, annotations);
|
|
1973
|
-
functionBlock.children = this.generateBlockChildren(block.children, options, functionBlock);
|
|
1974
|
-
return functionBlock;
|
|
1649
|
+
clone() {
|
|
1650
|
+
return new RTELogicControlNode(this.id, this.text, this.parent);
|
|
1975
1651
|
}
|
|
1976
1652
|
/**
|
|
1977
|
-
*
|
|
1653
|
+
* Convert the node to its HTML representation.
|
|
1978
1654
|
*
|
|
1979
|
-
* @returns {string} The HTML string
|
|
1655
|
+
* @returns {string} - The HTML string of the logic control node.
|
|
1980
1656
|
*/
|
|
1981
1657
|
toHtml() {
|
|
1982
|
-
|
|
1983
|
-
.map((child) => {
|
|
1984
|
-
if (child instanceof codeBlock.RTETextBlock) {
|
|
1985
|
-
const attrStr = this.getFunctionContentStyle(child);
|
|
1986
|
-
return `<div class="${FUNCTION_CONTENT_CLASS}"${attrStr}>${child.getChildrenHtml()}</div>`;
|
|
1987
|
-
}
|
|
1988
|
-
else {
|
|
1989
|
-
return child.toHtml();
|
|
1990
|
-
}
|
|
1991
|
-
})
|
|
1992
|
-
.join('');
|
|
1993
|
-
return `<div class="${FUNCTION_BLOCK_CLASS}" ${codeBlock.RTE_BLOCK_BOUNDARY_ATTRIBUTE}>${childrenHtml}</div>`;
|
|
1658
|
+
return this.text;
|
|
1994
1659
|
}
|
|
1995
1660
|
/**
|
|
1996
|
-
*
|
|
1661
|
+
* Convert the node to a JSON representation.
|
|
1662
|
+
*
|
|
1663
|
+
* @returns {unknown} - The JSON object of the statement syntax node.
|
|
1997
1664
|
*/
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
});
|
|
2005
|
-
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
2006
|
-
return clonedBlock;
|
|
1665
|
+
toJSON() {
|
|
1666
|
+
return {
|
|
1667
|
+
id: this.id,
|
|
1668
|
+
type: this.type,
|
|
1669
|
+
text: this.text,
|
|
1670
|
+
};
|
|
2007
1671
|
}
|
|
2008
1672
|
/**
|
|
2009
|
-
*
|
|
1673
|
+
* Get the end offset of the node's range.
|
|
1674
|
+
*
|
|
1675
|
+
* @returns {number} - The end offset of the node's range.
|
|
2010
1676
|
*/
|
|
2011
|
-
|
|
2012
|
-
return
|
|
1677
|
+
getRangeEndOffset() {
|
|
1678
|
+
return 1;
|
|
2013
1679
|
}
|
|
2014
1680
|
/**
|
|
2015
|
-
*
|
|
2016
|
-
* `contenteditable="false"` logic-control node instead of staying anchored to the block.
|
|
1681
|
+
* Get the container element for the node's range.
|
|
2017
1682
|
*
|
|
2018
|
-
* @
|
|
1683
|
+
* @returns {Nullable<Node>} - The container node for the range.
|
|
2019
1684
|
*/
|
|
2020
|
-
|
|
2021
|
-
|
|
1685
|
+
getRangeContainer() {
|
|
1686
|
+
const element = codeBlock.stateEntityRenderingRegistry.getDOMByEntity(this);
|
|
1687
|
+
if (element) {
|
|
1688
|
+
return element.parentElement;
|
|
1689
|
+
}
|
|
2022
1690
|
}
|
|
2023
1691
|
/**
|
|
2024
|
-
*
|
|
1692
|
+
* Get the content editable state of the node.
|
|
1693
|
+
*
|
|
1694
|
+
* @returns {boolean} - The content editable state of the node.
|
|
2025
1695
|
*/
|
|
2026
|
-
|
|
2027
|
-
return
|
|
1696
|
+
isContentEditable() {
|
|
1697
|
+
return false;
|
|
2028
1698
|
}
|
|
2029
1699
|
/**
|
|
2030
1700
|
* @inheritDoc
|
|
2031
1701
|
*/
|
|
2032
|
-
|
|
2033
|
-
return
|
|
1702
|
+
getPlainText() {
|
|
1703
|
+
return this.text;
|
|
2034
1704
|
}
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
1705
|
+
}
|
|
1706
|
+
RTELogicControlNode.typeName = 'RTELogicControlNode';
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Class representing a logic control block in the rich text editor.
|
|
1710
|
+
*/
|
|
1711
|
+
class RTELogicControlBlock extends codeBlock.RTEBlock {
|
|
1712
|
+
constructor(id, statementText, parent) {
|
|
1713
|
+
super(id);
|
|
1714
|
+
this.type = 'logic-control-block';
|
|
1715
|
+
this.children = [];
|
|
1716
|
+
this.statementText = '';
|
|
1717
|
+
this.statementText = statementText;
|
|
1718
|
+
this.children = [new RTELogicControlNode(`${id}-node-1`, statementText, this)];
|
|
1719
|
+
if (parent) {
|
|
1720
|
+
this.parent = parent;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* Create a logic control block from a JSON representation.
|
|
1725
|
+
*
|
|
1726
|
+
* @param {VegaRTELogicControlBlock} json - The JSON object representing the logic control block.
|
|
1727
|
+
* @returns {RTELogicControlBlock} - The created logic control block.
|
|
1728
|
+
*/
|
|
1729
|
+
static from(json) {
|
|
1730
|
+
const block = new RTELogicControlBlock(json.id, json.statementText);
|
|
1731
|
+
return block;
|
|
1732
|
+
}
|
|
1733
|
+
/**
|
|
1734
|
+
* Check the block is not empty.
|
|
1735
|
+
*
|
|
1736
|
+
* @returns {boolean} - Always true for logic control block.
|
|
1737
|
+
*/
|
|
1738
|
+
isNotEmpty() {
|
|
1739
|
+
return true;
|
|
1740
|
+
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Get the last node of the block.
|
|
1743
|
+
*
|
|
1744
|
+
* @returns {RTELogicControlNode} - The last node in the block.
|
|
1745
|
+
*/
|
|
1746
|
+
getLastNode() {
|
|
1747
|
+
return this.children[this.children.length - 1];
|
|
1748
|
+
}
|
|
1749
|
+
/**
|
|
1750
|
+
* Convert the block to its HTML representation.
|
|
1751
|
+
*
|
|
1752
|
+
* @returns {string} - The HTML string of the logic control block.
|
|
1753
|
+
*/
|
|
1754
|
+
toHtml() {
|
|
1755
|
+
return `<div class='${FUNCTION_SYNTAX_CLASS}' contenteditable='false'>${this.statementText}</div>`;
|
|
1756
|
+
}
|
|
1757
|
+
/**
|
|
1758
|
+
* Clone the current block instance.
|
|
1759
|
+
*
|
|
1760
|
+
* @param { RTEFunctionBlock } parent - The parent function block for the cloned instance.
|
|
1761
|
+
* @returns {RTELogicControlBlock} - A new instance of RTEStatementSyntaxBlock.
|
|
1762
|
+
*/
|
|
1763
|
+
clone(parent) {
|
|
1764
|
+
return new RTELogicControlBlock(this.id, this.statementText, parent);
|
|
1765
|
+
}
|
|
1766
|
+
/**
|
|
1767
|
+
* Get the JSON representation of the block.
|
|
1768
|
+
*
|
|
1769
|
+
* @returns {VegaRTELogicControlBlock} - The JSON object of the logic control block.
|
|
1770
|
+
*/
|
|
1771
|
+
toJSON() {
|
|
1772
|
+
return {
|
|
1773
|
+
id: this.id,
|
|
1774
|
+
type: this.type,
|
|
1775
|
+
statementText: this.statementText,
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
RTELogicControlBlock.typeName = 'RTELogicControlBlock';
|
|
1780
|
+
|
|
1781
|
+
/**
|
|
1782
|
+
* RTE Function Block
|
|
1783
|
+
*/
|
|
1784
|
+
class RTEFunctionBlock extends codeBlock.RTEBlock {
|
|
1785
|
+
constructor(id) {
|
|
1786
|
+
super(id);
|
|
1787
|
+
this.type = 'function-block';
|
|
1788
|
+
this.children = [];
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Creates an RTEFunctionBlock from a VegaFunctionBlock.
|
|
1792
|
+
*
|
|
1793
|
+
* @param {VegaFunctionBlock} block - The custom block to convert.
|
|
1794
|
+
* @param {VegaRTETransformOptions} [options] - Optional transformation options.
|
|
1795
|
+
* @returns {RTEFunctionBlock} The resulting RTEFunctionBlock.
|
|
1796
|
+
*/
|
|
1797
|
+
static from(block, options) {
|
|
1798
|
+
const functionBlock = new RTEFunctionBlock(block.id);
|
|
1799
|
+
const defaultAnnotation = { customClass: [FUNCTION_BLOCK_CLASS] };
|
|
1800
|
+
let { annotations } = block;
|
|
1801
|
+
annotations = annotations
|
|
1802
|
+
? Object.assign(Object.assign({}, annotations), defaultAnnotation) : defaultAnnotation;
|
|
1803
|
+
super.convertAnnotationsToMap(functionBlock.annotationMap, annotations);
|
|
1804
|
+
functionBlock.children = this.generateBlockChildren(block.children, options, functionBlock);
|
|
1805
|
+
this.unwrapForeachContent(functionBlock.children);
|
|
1806
|
+
return functionBlock;
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* Removes a redundant div wrapper from FOREACH content so it is rendered inline
|
|
1810
|
+
* with the FOREACH control. SHOW content retains its wrapper to preserve line breaks.
|
|
1811
|
+
*
|
|
1812
|
+
* @param {RTEFunctionBlockChild[]} children - The function block children to normalize.
|
|
1813
|
+
*/
|
|
1814
|
+
static unwrapForeachContent(children) {
|
|
1815
|
+
children.forEach((logicControlBlock, index) => {
|
|
1816
|
+
const contentBlock = children[index + 1];
|
|
1817
|
+
if (!(logicControlBlock instanceof RTELogicControlBlock) ||
|
|
1818
|
+
logicControlBlock.statementText !== 'FOREACH' ||
|
|
1819
|
+
!(contentBlock instanceof codeBlock.RTETextBlock)) {
|
|
1820
|
+
return;
|
|
1821
|
+
}
|
|
1822
|
+
contentBlock.children.forEach((node) => {
|
|
1823
|
+
const inlineHtml = node.getAnnotationByType(codeBlock.NodeAnnotationTypeEnum.INLINE_HTML);
|
|
1824
|
+
if ((inlineHtml === null || inlineHtml === void 0 ? void 0 : inlineHtml.htmlTag) !== 'div')
|
|
1825
|
+
return;
|
|
1826
|
+
if (inlineHtml.child) {
|
|
1827
|
+
node.annotationMap.set(codeBlock.NodeAnnotationTypeEnum.INLINE_HTML, inlineHtml.child);
|
|
1828
|
+
}
|
|
1829
|
+
else {
|
|
1830
|
+
node.annotationMap.delete(codeBlock.NodeAnnotationTypeEnum.INLINE_HTML);
|
|
1831
|
+
}
|
|
1832
|
+
});
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* Converts the RTEFunctionBlock and its children to an HTML string.
|
|
1837
|
+
*
|
|
1838
|
+
* @returns {string} The HTML string representation of the function block.
|
|
1839
|
+
*/
|
|
1840
|
+
toHtml() {
|
|
1841
|
+
const childrenHtml = this.children
|
|
1842
|
+
.map((child) => {
|
|
1843
|
+
if (child instanceof codeBlock.RTETextBlock) {
|
|
1844
|
+
const attrStr = this.getFunctionContentStyle(child);
|
|
1845
|
+
return `<div class="${FUNCTION_CONTENT_CLASS}"${attrStr}>${child.getChildrenHtml()}</div>`;
|
|
1846
|
+
}
|
|
1847
|
+
else {
|
|
1848
|
+
return child.toHtml();
|
|
1849
|
+
}
|
|
1850
|
+
})
|
|
1851
|
+
.join('');
|
|
1852
|
+
return `<div class="${FUNCTION_BLOCK_CLASS}" ${codeBlock.RTE_BLOCK_BOUNDARY_ATTRIBUTE}>${childrenHtml}</div>`;
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* @inheritDoc
|
|
1856
|
+
*/
|
|
1857
|
+
clone(parent) {
|
|
1858
|
+
const clonedBlock = new RTEFunctionBlock(misc.generateUUID());
|
|
1859
|
+
clonedBlock.parent = parent;
|
|
1860
|
+
clonedBlock.children = this.children.map((child) => {
|
|
1861
|
+
const clonedChild = child.clone(clonedBlock);
|
|
1862
|
+
return clonedChild;
|
|
1863
|
+
});
|
|
1864
|
+
clonedBlock.annotationMap = super.cloneAnnotations();
|
|
1865
|
+
return clonedBlock;
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* @inheritDoc
|
|
1869
|
+
*/
|
|
1870
|
+
getLastNode() {
|
|
1871
|
+
return this.children[this.children.length - 1].getLastNode();
|
|
1872
|
+
}
|
|
1873
|
+
/**
|
|
1874
|
+
* The function block is an atomic caret boundary: descending would resolve the caret onto a
|
|
1875
|
+
* `contenteditable="false"` logic-control node instead of staying anchored to the block.
|
|
1876
|
+
*
|
|
1877
|
+
* @inheritDoc
|
|
1878
|
+
*/
|
|
1879
|
+
allowsCaretDescend() {
|
|
1880
|
+
return false;
|
|
1881
|
+
}
|
|
1882
|
+
/**
|
|
1883
|
+
* @inheritDoc
|
|
1884
|
+
*/
|
|
1885
|
+
isNotEmpty() {
|
|
1886
|
+
return this.children.length > 0;
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* @inheritDoc
|
|
1890
|
+
*/
|
|
1891
|
+
toJSON() {
|
|
1892
|
+
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* Get the style string for function content block, excluding default paragraph styles.
|
|
1896
|
+
*
|
|
1897
|
+
* @param {RTETextBlock} block - The text block to extract styles from
|
|
1898
|
+
* @returns {string} - The style attribute string
|
|
1899
|
+
*/
|
|
1900
|
+
getFunctionContentStyle(block) {
|
|
2042
1901
|
const blockAnnotationStyle = new codeBlock.RTEAnnotationStyle(block);
|
|
2043
1902
|
let styles = blockAnnotationStyle.toCssText({ standalone: true });
|
|
2044
1903
|
const textStyleAnnotation = block.getAnnotationByType('TEXT_STYLE');
|
|
@@ -2049,7 +1908,7 @@ class RTEFunctionBlock extends codeBlock.RTEBlock {
|
|
|
2049
1908
|
return styles ? ` style="${styles}"` : '';
|
|
2050
1909
|
}
|
|
2051
1910
|
}
|
|
2052
|
-
RTEFunctionBlock.
|
|
1911
|
+
RTEFunctionBlock.typeName = 'RTEFunctionBlock';
|
|
2053
1912
|
|
|
2054
1913
|
/**
|
|
2055
1914
|
* Strategy to handle the insertion of a function block into the rich text editor.
|
|
@@ -2146,202 +2005,52 @@ class InsertFunctionBlockStrategy extends codeBlock.ActionHandleStrategy {
|
|
|
2146
2005
|
}
|
|
2147
2006
|
|
|
2148
2007
|
/**
|
|
2149
|
-
*
|
|
2008
|
+
* Function toolbar button renderer class.
|
|
2150
2009
|
*/
|
|
2151
|
-
class
|
|
2152
|
-
constructor(id, text, parent) {
|
|
2153
|
-
super(id);
|
|
2154
|
-
this.dtoName = RTELogicControlNode.dtoName;
|
|
2155
|
-
this.type = 'logic-control-node';
|
|
2156
|
-
this.text = '';
|
|
2157
|
-
this.text = text;
|
|
2158
|
-
this.parent = parent;
|
|
2159
|
-
}
|
|
2160
|
-
/**
|
|
2161
|
-
* Clone the current node instance.
|
|
2162
|
-
*
|
|
2163
|
-
* @returns {RTELogicControlNode} - A new instance of RTELogicControlNode.
|
|
2164
|
-
*/
|
|
2165
|
-
clone() {
|
|
2166
|
-
return new RTELogicControlNode(this.id, this.text, this.parent);
|
|
2167
|
-
}
|
|
2010
|
+
class FunctionToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
2168
2011
|
/**
|
|
2169
|
-
*
|
|
2170
|
-
*
|
|
2171
|
-
* @returns {string} - The HTML string of the logic control node.
|
|
2012
|
+
* @inheritDoc
|
|
2172
2013
|
*/
|
|
2173
|
-
|
|
2174
|
-
return this.
|
|
2014
|
+
render(h, editorContext) {
|
|
2015
|
+
return this.renderDropdown(h, editorContext, {}, [
|
|
2016
|
+
this.renderButton(h, editorContext, {
|
|
2017
|
+
label: 'Functions',
|
|
2018
|
+
ariaLabel: 'Functions',
|
|
2019
|
+
showArrowIcon: true,
|
|
2020
|
+
tooltip: { text: 'Insert function' },
|
|
2021
|
+
}),
|
|
2022
|
+
this.renderDropdownListTemplate(h, FunctionToolbarButtonRenderer.FUNCTION_LIST, editorContext),
|
|
2023
|
+
]);
|
|
2175
2024
|
}
|
|
2176
2025
|
/**
|
|
2177
|
-
*
|
|
2026
|
+
* Overrides the isDisabled method to determine if the button should be disabled.
|
|
2178
2027
|
*
|
|
2179
|
-
* @
|
|
2028
|
+
* @param {VegaRTEToolbarRenderContext} editorContext The render context for the editor.
|
|
2029
|
+
* @returns {boolean} - true if the button should be disabled, false otherwise.
|
|
2180
2030
|
*/
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2031
|
+
isDisabled(editorContext) {
|
|
2032
|
+
const context = this.getExtensionContext(editorContext.host);
|
|
2033
|
+
if (context) {
|
|
2034
|
+
const { host, getSelectedNodes } = context;
|
|
2035
|
+
const focusNode = getSelectedNodes()[0];
|
|
2036
|
+
let enableInsert = true;
|
|
2037
|
+
if (focusNode) {
|
|
2038
|
+
enableInsert = codeBlock.ActionHandleStrategyRegistry.canHandle(INSERT_FUNCTION_BLOCK, focusNode.parent);
|
|
2039
|
+
}
|
|
2040
|
+
return host.disabled || !enableInsert;
|
|
2041
|
+
}
|
|
2042
|
+
return false;
|
|
2187
2043
|
}
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
*/
|
|
2193
|
-
getRangeEndOffset() {
|
|
2194
|
-
return 1;
|
|
2044
|
+
/* istanbul ignore next */
|
|
2045
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
2046
|
+
handleButtonClick() {
|
|
2047
|
+
throw new Error('Method not implemented.');
|
|
2195
2048
|
}
|
|
2196
2049
|
/**
|
|
2197
|
-
*
|
|
2050
|
+
* Handles dropdown click event
|
|
2198
2051
|
*
|
|
2199
|
-
* @
|
|
2200
|
-
|
|
2201
|
-
getRangeContainer() {
|
|
2202
|
-
const element = codeBlock.stateEntityRenderingRegistry.getDOMByEntity(this);
|
|
2203
|
-
if (element) {
|
|
2204
|
-
return element.parentElement;
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
/**
|
|
2208
|
-
* Get the content editable state of the node.
|
|
2209
|
-
*
|
|
2210
|
-
* @returns {boolean} - The content editable state of the node.
|
|
2211
|
-
*/
|
|
2212
|
-
isContentEditable() {
|
|
2213
|
-
return false;
|
|
2214
|
-
}
|
|
2215
|
-
/**
|
|
2216
|
-
* @inheritDoc
|
|
2217
|
-
*/
|
|
2218
|
-
getPlainText() {
|
|
2219
|
-
return this.text;
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
RTELogicControlNode.dtoName = 'RTELogicControlNode';
|
|
2223
|
-
|
|
2224
|
-
/**
|
|
2225
|
-
* Class representing a logic control block in the rich text editor.
|
|
2226
|
-
*/
|
|
2227
|
-
class RTELogicControlBlock extends codeBlock.RTEBlock {
|
|
2228
|
-
constructor(id, statementText, parent) {
|
|
2229
|
-
super(id);
|
|
2230
|
-
this.dtoName = RTELogicControlBlock.dtoName;
|
|
2231
|
-
this.type = 'logic-control-block';
|
|
2232
|
-
this.children = [];
|
|
2233
|
-
this.statementText = '';
|
|
2234
|
-
this.statementText = statementText;
|
|
2235
|
-
this.children = [new RTELogicControlNode(`${id}-node-1`, statementText, this)];
|
|
2236
|
-
if (parent) {
|
|
2237
|
-
this.parent = parent;
|
|
2238
|
-
}
|
|
2239
|
-
}
|
|
2240
|
-
/**
|
|
2241
|
-
* Create a logic control block from a JSON representation.
|
|
2242
|
-
*
|
|
2243
|
-
* @param {VegaRTELogicControlBlock} json - The JSON object representing the logic control block.
|
|
2244
|
-
* @returns {RTELogicControlBlock} - The created logic control block.
|
|
2245
|
-
*/
|
|
2246
|
-
static from(json) {
|
|
2247
|
-
const block = new RTELogicControlBlock(json.id, json.statementText);
|
|
2248
|
-
return block;
|
|
2249
|
-
}
|
|
2250
|
-
/**
|
|
2251
|
-
* Check the block is not empty.
|
|
2252
|
-
*
|
|
2253
|
-
* @returns {boolean} - Always true for logic control block.
|
|
2254
|
-
*/
|
|
2255
|
-
isNotEmpty() {
|
|
2256
|
-
return true;
|
|
2257
|
-
}
|
|
2258
|
-
/**
|
|
2259
|
-
* Get the last node of the block.
|
|
2260
|
-
*
|
|
2261
|
-
* @returns {RTELogicControlNode} - The last node in the block.
|
|
2262
|
-
*/
|
|
2263
|
-
getLastNode() {
|
|
2264
|
-
return this.children[this.children.length - 1];
|
|
2265
|
-
}
|
|
2266
|
-
/**
|
|
2267
|
-
* Convert the block to its HTML representation.
|
|
2268
|
-
*
|
|
2269
|
-
* @returns {string} - The HTML string of the logic control block.
|
|
2270
|
-
*/
|
|
2271
|
-
toHtml() {
|
|
2272
|
-
return `<div class='${FUNCTION_SYNTAX_CLASS}' contenteditable='false'>${this.statementText}</div>`;
|
|
2273
|
-
}
|
|
2274
|
-
/**
|
|
2275
|
-
* Clone the current block instance.
|
|
2276
|
-
*
|
|
2277
|
-
* @param { RTEFunctionBlock } parent - The parent function block for the cloned instance.
|
|
2278
|
-
* @returns {RTELogicControlBlock} - A new instance of RTEStatementSyntaxBlock.
|
|
2279
|
-
*/
|
|
2280
|
-
clone(parent) {
|
|
2281
|
-
return new RTELogicControlBlock(this.id, this.statementText, parent);
|
|
2282
|
-
}
|
|
2283
|
-
/**
|
|
2284
|
-
* Get the JSON representation of the block.
|
|
2285
|
-
*
|
|
2286
|
-
* @returns {VegaRTELogicControlBlock} - The JSON object of the logic control block.
|
|
2287
|
-
*/
|
|
2288
|
-
toJSON() {
|
|
2289
|
-
return {
|
|
2290
|
-
id: this.id,
|
|
2291
|
-
type: this.type,
|
|
2292
|
-
statementText: this.statementText,
|
|
2293
|
-
};
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
RTELogicControlBlock.dtoName = 'RTELogicControlBlock';
|
|
2297
|
-
|
|
2298
|
-
/**
|
|
2299
|
-
* Function toolbar button renderer class.
|
|
2300
|
-
*/
|
|
2301
|
-
class FunctionToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
2302
|
-
/**
|
|
2303
|
-
* @inheritDoc
|
|
2304
|
-
*/
|
|
2305
|
-
render(h, editorContext) {
|
|
2306
|
-
return this.renderDropdown(h, editorContext, {}, [
|
|
2307
|
-
this.renderButton(h, editorContext, {
|
|
2308
|
-
label: 'Functions',
|
|
2309
|
-
ariaLabel: 'Functions',
|
|
2310
|
-
showArrowIcon: true,
|
|
2311
|
-
tooltip: { text: 'Insert function' },
|
|
2312
|
-
}),
|
|
2313
|
-
this.renderDropdownListTemplate(h, FunctionToolbarButtonRenderer.FUNCTION_LIST, editorContext),
|
|
2314
|
-
]);
|
|
2315
|
-
}
|
|
2316
|
-
/**
|
|
2317
|
-
* Overrides the isDisabled method to determine if the button should be disabled.
|
|
2318
|
-
*
|
|
2319
|
-
* @param {VegaRTEToolbarRenderContext} editorContext The render context for the editor.
|
|
2320
|
-
* @returns {boolean} - true if the button should be disabled, false otherwise.
|
|
2321
|
-
*/
|
|
2322
|
-
isDisabled(editorContext) {
|
|
2323
|
-
const context = this.getExtensionContext(editorContext.host);
|
|
2324
|
-
if (context) {
|
|
2325
|
-
const { host, getSelectedNodes } = context;
|
|
2326
|
-
const focusNode = getSelectedNodes()[0];
|
|
2327
|
-
let enableInsert = true;
|
|
2328
|
-
if (focusNode) {
|
|
2329
|
-
enableInsert = codeBlock.ActionHandleStrategyRegistry.canHandle(INSERT_FUNCTION_BLOCK, focusNode.parent);
|
|
2330
|
-
}
|
|
2331
|
-
return host.disabled || !enableInsert;
|
|
2332
|
-
}
|
|
2333
|
-
return false;
|
|
2334
|
-
}
|
|
2335
|
-
/* istanbul ignore next */
|
|
2336
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
2337
|
-
handleButtonClick() {
|
|
2338
|
-
throw new Error('Method not implemented.');
|
|
2339
|
-
}
|
|
2340
|
-
/**
|
|
2341
|
-
* Handles dropdown click event
|
|
2342
|
-
*
|
|
2343
|
-
* @param {RTEExtensionFunctionType} itemKey - key of the clicked item
|
|
2344
|
-
* @param {VegaRTEToolbarRenderContext} editorContext The render context for the editor.
|
|
2052
|
+
* @param {RTEExtensionFunctionType} itemKey - key of the clicked item
|
|
2053
|
+
* @param {VegaRTEToolbarRenderContext} editorContext The render context for the editor.
|
|
2345
2054
|
*/
|
|
2346
2055
|
handleDropdownClick(itemKey, editorContext) {
|
|
2347
2056
|
if (editorContext) {
|
|
@@ -2387,6 +2096,7 @@ class RTELogicControlBlockRenderer extends linkExtension.VegaRTEExtensionRendere
|
|
|
2387
2096
|
}, renderData.statementText));
|
|
2388
2097
|
}
|
|
2389
2098
|
}
|
|
2099
|
+
RTELogicControlBlockRenderer.typeName = 'RTELogicControlBlockRenderer';
|
|
2390
2100
|
|
|
2391
2101
|
/**
|
|
2392
2102
|
* Returns true when the element belongs to function extension blocks by semantic
|
|
@@ -2512,6 +2222,7 @@ class DivToFunctionBlockStrategy extends contentState.ElementToDTOStrategy {
|
|
|
2512
2222
|
* @inheritDoc
|
|
2513
2223
|
*/
|
|
2514
2224
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
2225
|
+
RTEFunctionBlock.unwrapForeachContent(childBlocks);
|
|
2515
2226
|
currentBlock.children = childBlocks.map((block) => {
|
|
2516
2227
|
block.parent = currentBlock;
|
|
2517
2228
|
return block;
|
|
@@ -2603,17 +2314,12 @@ class RTEFunctionBlockRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
2603
2314
|
return classes.trim();
|
|
2604
2315
|
}
|
|
2605
2316
|
}
|
|
2606
|
-
|
|
2607
|
-
/**
|
|
2608
|
-
* Abstract class for action handler interceptors, which can intercept actions before they are handled.
|
|
2609
|
-
*/
|
|
2610
|
-
class ActionHandlerInterceptor {
|
|
2611
|
-
}
|
|
2317
|
+
RTEFunctionBlockRenderer.typeName = 'RTEFunctionBlockRenderer';
|
|
2612
2318
|
|
|
2613
2319
|
/**
|
|
2614
2320
|
* Prevent special type input in function block.
|
|
2615
2321
|
*/
|
|
2616
|
-
class PreventNewParagraphInterceptor extends ActionHandlerInterceptor {
|
|
2322
|
+
class PreventNewParagraphInterceptor extends imageExtension.ActionHandlerInterceptor {
|
|
2617
2323
|
/**
|
|
2618
2324
|
* Checks the target block parent whether is function block.
|
|
2619
2325
|
*
|
|
@@ -2780,8 +2486,8 @@ class VegaRTEFunctionExtension extends linkExtension.VegaRTEExtension {
|
|
|
2780
2486
|
constructor() {
|
|
2781
2487
|
super();
|
|
2782
2488
|
this.unregisterBlockBoundaryPredicate = null;
|
|
2783
|
-
this.registerBlockBasicStrategies(RTELogicControlBlock.
|
|
2784
|
-
this.registerBlockBasicStrategies(RTEFunctionBlock.
|
|
2489
|
+
this.registerBlockBasicStrategies(RTELogicControlBlock.typeName);
|
|
2490
|
+
this.registerBlockBasicStrategies(RTEFunctionBlock.typeName);
|
|
2785
2491
|
this.preventFunctionBlockDefaultInsertNewParagraph();
|
|
2786
2492
|
this.registerNode('logic-control-block', RTELogicControlBlock);
|
|
2787
2493
|
this.registerRenderer('logic-control-block', new RTELogicControlBlockRenderer());
|
|
@@ -2813,23 +2519,23 @@ class VegaRTEFunctionExtension extends linkExtension.VegaRTEExtension {
|
|
|
2813
2519
|
* Remove the appen children strategies to prevent default insert new paragraph logic in function block
|
|
2814
2520
|
*/
|
|
2815
2521
|
preventFunctionBlockDefaultInsertNewParagraph() {
|
|
2816
|
-
this.unRegisterStrategy(codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, RTELogicControlBlock.
|
|
2817
|
-
this.unRegisterStrategy(codeBlock.ModifyContentActionType.APPEND_CHILDREN, RTEFunctionBlock.
|
|
2818
|
-
this.unRegisterStrategy(codeBlock.ModifyContentActionType.INSERT_CHILDREN_AFTER, RTEFunctionBlock.
|
|
2819
|
-
this.unRegisterStrategy(codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, RTEFunctionBlock.
|
|
2820
|
-
this.unRegisterStrategy(codeBlock.ModifyContentActionType.PASTE_CONTENT, RTELogicControlBlock.
|
|
2821
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTEFunctionBlock.
|
|
2522
|
+
this.unRegisterStrategy(codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, RTELogicControlBlock.typeName);
|
|
2523
|
+
this.unRegisterStrategy(codeBlock.ModifyContentActionType.APPEND_CHILDREN, RTEFunctionBlock.typeName);
|
|
2524
|
+
this.unRegisterStrategy(codeBlock.ModifyContentActionType.INSERT_CHILDREN_AFTER, RTEFunctionBlock.typeName);
|
|
2525
|
+
this.unRegisterStrategy(codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, RTEFunctionBlock.typeName);
|
|
2526
|
+
this.unRegisterStrategy(codeBlock.ModifyContentActionType.PASTE_CONTENT, RTELogicControlBlock.typeName);
|
|
2527
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTEFunctionBlock.typeName, codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, new FunctionBlockInsertParagraphStrategy());
|
|
2822
2528
|
}
|
|
2823
2529
|
}
|
|
2824
2530
|
(() => {
|
|
2825
2531
|
const insertFunctionBlockStrategy = new InsertFunctionBlockStrategy();
|
|
2826
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.
|
|
2827
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.
|
|
2828
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageBlock.
|
|
2829
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTELogicControlBlock.
|
|
2830
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.
|
|
2831
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.
|
|
2832
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.
|
|
2532
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.typeName, INSERT_FUNCTION_BLOCK, insertFunctionBlockStrategy);
|
|
2533
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.typeName, INSERT_FUNCTION_BLOCK, insertFunctionBlockStrategy);
|
|
2534
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageBlock.typeName, INSERT_FUNCTION_BLOCK, insertFunctionBlockStrategy);
|
|
2535
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTELogicControlBlock.typeName, INSERT_FUNCTION_BLOCK, insertFunctionBlockStrategy);
|
|
2536
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.typeName, PASTE_PLAIN_TEXT, new PastePlainTextStrategy());
|
|
2537
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.typeName, codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, new PreventNewParagraphInterceptor());
|
|
2538
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.typeName, codeBlock.ModifyContentActionType.PASTE_CONTENT, new PreventPasteContentInterceptor());
|
|
2833
2539
|
})();
|
|
2834
2540
|
VegaRTEFunctionExtension.TOOLBAR_BUTTON_KEY = 'functions';
|
|
2835
2541
|
|
|
@@ -2930,7 +2636,6 @@ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2930
2636
|
class RTETableCaptionBlock extends codeBlock.RTEBlock {
|
|
2931
2637
|
constructor(id, options) {
|
|
2932
2638
|
super(id);
|
|
2933
|
-
this.dtoName = RTETableCaptionBlock.dtoName;
|
|
2934
2639
|
this.type = 'table-caption';
|
|
2935
2640
|
const { autoMatchFormat } = options || { autoMatchFormat: true };
|
|
2936
2641
|
if (autoMatchFormat) {
|
|
@@ -2989,11 +2694,12 @@ class RTETableCaptionBlock extends codeBlock.RTEBlock {
|
|
|
2989
2694
|
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, children: this.children.map((child) => child.toJSON()) });
|
|
2990
2695
|
}
|
|
2991
2696
|
}
|
|
2697
|
+
RTETableCaptionBlock.typeName = 'RTETableCaptionBlock';
|
|
2698
|
+
// eslint-disable-next-line @globalpayments/vega-eslint/vega-class-member-order-rule
|
|
2992
2699
|
(() => {
|
|
2993
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, RTETableCaptionBlock.
|
|
2994
|
-
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.PASTE_CONTENT, RTETableCaptionBlock.
|
|
2700
|
+
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, RTETableCaptionBlock.typeName, new contentState.InsertChildrenBeforeStrategy());
|
|
2701
|
+
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.PASTE_CONTENT, RTETableCaptionBlock.typeName, new contentState.PasteContentStrategy());
|
|
2995
2702
|
})();
|
|
2996
|
-
RTETableCaptionBlock.dtoName = 'RTETableCaptionBlock';
|
|
2997
2703
|
|
|
2998
2704
|
const TOGGLE_TABLE_CAPTION = 'TOGGLE_TABLE_CAPTION';
|
|
2999
2705
|
/**
|
|
@@ -3166,6 +2872,7 @@ class UpdateTablePropertiesAction extends codeBlock.AnnotationAction {
|
|
|
3166
2872
|
return new splitCellOperation.RTETableAnnotation(this.tableProperties);
|
|
3167
2873
|
}
|
|
3168
2874
|
}
|
|
2875
|
+
UpdateTablePropertiesAction.typeName = 'UpdateTablePropertiesAction';
|
|
3169
2876
|
|
|
3170
2877
|
/**
|
|
3171
2878
|
* Cancel Event handler for the table properties.
|
|
@@ -3251,6 +2958,7 @@ class RTETableCellAnnotationsAction extends codeBlock.AnnotationAction {
|
|
|
3251
2958
|
});
|
|
3252
2959
|
}
|
|
3253
2960
|
}
|
|
2961
|
+
RTETableCellAnnotationsAction.typeName = 'RTETableCellAnnotationsAction';
|
|
3254
2962
|
|
|
3255
2963
|
/**
|
|
3256
2964
|
* Action to apply annotations to a table head cell.
|
|
@@ -3268,6 +2976,7 @@ class RTETableHeadCellAnnotationsAction extends RTETableCellAnnotationsAction {
|
|
|
3268
2976
|
return this.originAnnotation;
|
|
3269
2977
|
}
|
|
3270
2978
|
}
|
|
2979
|
+
RTETableHeadCellAnnotationsAction.typeName = 'RTETableHeadCellAnnotationsAction';
|
|
3271
2980
|
|
|
3272
2981
|
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
3273
2982
|
var t = {};
|
|
@@ -4517,6 +4226,7 @@ class RTETableBlockRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
4517
4226
|
this.tableToolbar = null;
|
|
4518
4227
|
}
|
|
4519
4228
|
}
|
|
4229
|
+
RTETableBlockRenderer.typeName = 'RTETableBlockRenderer';
|
|
4520
4230
|
|
|
4521
4231
|
/**
|
|
4522
4232
|
* Renders a logic control block in the rich text editor.
|
|
@@ -4532,6 +4242,7 @@ class RTETableHeadRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
4532
4242
|
});
|
|
4533
4243
|
}
|
|
4534
4244
|
}
|
|
4245
|
+
RTETableHeadRenderer.typeName = 'RTETableHeadRenderer';
|
|
4535
4246
|
|
|
4536
4247
|
/**
|
|
4537
4248
|
* Renders a logic control block in the rich text editor.
|
|
@@ -4547,6 +4258,7 @@ class RTETableRowBlockRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
4547
4258
|
});
|
|
4548
4259
|
}
|
|
4549
4260
|
}
|
|
4261
|
+
RTETableRowBlockRenderer.typeName = 'RTETableRowBlockRenderer';
|
|
4550
4262
|
|
|
4551
4263
|
/**
|
|
4552
4264
|
* Renders a table cell block in the rich text editor.
|
|
@@ -4618,6 +4330,7 @@ class RTETableCellRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
4618
4330
|
};
|
|
4619
4331
|
}
|
|
4620
4332
|
}
|
|
4333
|
+
RTETableCellRenderer.typeName = 'RTETableCellRenderer';
|
|
4621
4334
|
|
|
4622
4335
|
/**
|
|
4623
4336
|
* Renders a table body block in the rich text editor.
|
|
@@ -4633,6 +4346,7 @@ class RTETableBodyRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
4633
4346
|
});
|
|
4634
4347
|
}
|
|
4635
4348
|
}
|
|
4349
|
+
RTETableBodyRenderer.typeName = 'RTETableBodyRenderer';
|
|
4636
4350
|
|
|
4637
4351
|
/**
|
|
4638
4352
|
* Renders a head cell block in the rich text editor.
|
|
@@ -4645,6 +4359,7 @@ class RTETableHeadCellRenderer extends RTETableCellRenderer {
|
|
|
4645
4359
|
return super.renderByCellType(h, renderData, rteContext, 'th');
|
|
4646
4360
|
}
|
|
4647
4361
|
}
|
|
4362
|
+
RTETableHeadCellRenderer.typeName = 'RTETableHeadCellRenderer';
|
|
4648
4363
|
|
|
4649
4364
|
const INSERT_TABLE_BLOCK = 'INSERT_TABLE_BLOCK';
|
|
4650
4365
|
/**
|
|
@@ -4841,7 +4556,7 @@ class RTETableToolbarPopoverRenderer extends TablePopoverBaseRenderer {
|
|
|
4841
4556
|
/**
|
|
4842
4557
|
* Function toolbar button renderer class.
|
|
4843
4558
|
*/
|
|
4844
|
-
class RTETableToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
4559
|
+
class RTETableToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
4845
4560
|
/**
|
|
4846
4561
|
* @inheritDoc
|
|
4847
4562
|
*/
|
|
@@ -4943,7 +4658,7 @@ class InsertTableBlockStrategy extends codeBlock.ActionHandleStrategy {
|
|
|
4943
4658
|
/**
|
|
4944
4659
|
* Interceptor to prevent deletion of a table cell if it is the cell with empty content.
|
|
4945
4660
|
*/
|
|
4946
|
-
class PreventCellContentDeleteInterceptor extends ActionHandlerInterceptor {
|
|
4661
|
+
class PreventCellContentDeleteInterceptor extends imageExtension.ActionHandlerInterceptor {
|
|
4947
4662
|
/**
|
|
4948
4663
|
* Prevent deletion if the target block is the only child of a table cell and is empty.
|
|
4949
4664
|
*
|
|
@@ -4988,7 +4703,7 @@ class DeleteTableBlockStrategy extends codeBlock.ActionHandleStrategy {
|
|
|
4988
4703
|
/**
|
|
4989
4704
|
* Interceptor to prevent removal of all children from a cell, ensuring at least one child remains.
|
|
4990
4705
|
*/
|
|
4991
|
-
class PreventCellChildrenRemoveInterceptor extends ActionHandlerInterceptor {
|
|
4706
|
+
class PreventCellChildrenRemoveInterceptor extends imageExtension.ActionHandlerInterceptor {
|
|
4992
4707
|
/**
|
|
4993
4708
|
* Prevent removal if the target cell would be left empty after the action.
|
|
4994
4709
|
*
|
|
@@ -5037,6 +4752,7 @@ class RTETableCaptionRenderer extends linkExtension.VegaRTEExtensionRenderer {
|
|
|
5037
4752
|
.join(' '), 'data-placeholder': TABLE_CAPTION_PLACEHOLDER_TEXT }));
|
|
5038
4753
|
}
|
|
5039
4754
|
}
|
|
4755
|
+
RTETableCaptionRenderer.typeName = 'RTETableCaptionRenderer';
|
|
5040
4756
|
|
|
5041
4757
|
/**
|
|
5042
4758
|
* Abstract base strategy for table row actions. Provides common utilities for row manipulations.
|
|
@@ -6677,7 +6393,7 @@ class SelectTableColumnStrategy extends splitCellOperation.TableColumnStrategy {
|
|
|
6677
6393
|
/**
|
|
6678
6394
|
* Interceptor to prevent insertion of non-cell blocks into a table row.
|
|
6679
6395
|
*/
|
|
6680
|
-
class PreventRowInsertInterceptor extends ActionHandlerInterceptor {
|
|
6396
|
+
class PreventRowInsertInterceptor extends imageExtension.ActionHandlerInterceptor {
|
|
6681
6397
|
/**
|
|
6682
6398
|
* Prevent insertion if any of the children to be inserted is not a table cell block.
|
|
6683
6399
|
*
|
|
@@ -7229,7 +6945,7 @@ class TableAnnotationHandler extends TableAnnotationHandlerBase {
|
|
|
7229
6945
|
* @inheritDoc
|
|
7230
6946
|
*/
|
|
7231
6947
|
canHandle(targetDto) {
|
|
7232
|
-
return targetDto.
|
|
6948
|
+
return targetDto.typeName === 'RTETableBlock';
|
|
7233
6949
|
}
|
|
7234
6950
|
/**
|
|
7235
6951
|
* Handle annotation extraction from table element.
|
|
@@ -7297,7 +7013,7 @@ class TableCellAnnotationHandler extends TableAnnotationHandlerBase {
|
|
|
7297
7013
|
* @inheritDoc
|
|
7298
7014
|
*/
|
|
7299
7015
|
canHandle(targetDto) {
|
|
7300
|
-
return targetDto.
|
|
7016
|
+
return targetDto.typeName === 'RTETableCellBlock';
|
|
7301
7017
|
}
|
|
7302
7018
|
/**
|
|
7303
7019
|
* Handle annotation extraction from table cell element.
|
|
@@ -7406,7 +7122,7 @@ class TableHeadCellAnnotationHandler extends TableCellAnnotationHandler {
|
|
|
7406
7122
|
* @inheritDoc
|
|
7407
7123
|
*/
|
|
7408
7124
|
canHandle(targetDto) {
|
|
7409
|
-
return targetDto.
|
|
7125
|
+
return targetDto.typeName === 'RTETableHeadCellBlock';
|
|
7410
7126
|
}
|
|
7411
7127
|
}
|
|
7412
7128
|
|
|
@@ -7825,7 +7541,7 @@ class InsertTableRowIntoSameSectionStrategy extends TableRowCommonUtilitiesStrat
|
|
|
7825
7541
|
/**
|
|
7826
7542
|
* Interceptor to insert a paragraph before or after a table block.
|
|
7827
7543
|
*/
|
|
7828
|
-
class PreventTableInsertParagraphInterceptor extends ActionHandlerInterceptor {
|
|
7544
|
+
class PreventTableInsertParagraphInterceptor extends imageExtension.ActionHandlerInterceptor {
|
|
7829
7545
|
/**
|
|
7830
7546
|
* Intercept insert paragraph action when table block has a parent.
|
|
7831
7547
|
*
|
|
@@ -7886,7 +7602,7 @@ class TableBlockFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
|
7886
7602
|
* @inheritDoc
|
|
7887
7603
|
*/
|
|
7888
7604
|
canFilter(blockOrNodeInstance) {
|
|
7889
|
-
return this.isTableBlock(blockOrNodeInstance.
|
|
7605
|
+
return this.isTableBlock(blockOrNodeInstance.typeName);
|
|
7890
7606
|
}
|
|
7891
7607
|
/**
|
|
7892
7608
|
* @inheritDoc
|
|
@@ -7924,7 +7640,7 @@ class TableCaptionFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy
|
|
|
7924
7640
|
* @inheritDoc
|
|
7925
7641
|
*/
|
|
7926
7642
|
canFilter(blockOrNodeInstance) {
|
|
7927
|
-
return this.isTableCaption(blockOrNodeInstance.
|
|
7643
|
+
return this.isTableCaption(blockOrNodeInstance.typeName);
|
|
7928
7644
|
}
|
|
7929
7645
|
/**
|
|
7930
7646
|
* @inheritDoc
|
|
@@ -7966,7 +7682,7 @@ class TableCellFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
|
7966
7682
|
* @inheritDoc
|
|
7967
7683
|
*/
|
|
7968
7684
|
canFilter(blockOrNodeInstance) {
|
|
7969
|
-
return this.isTableCell(blockOrNodeInstance.
|
|
7685
|
+
return this.isTableCell(blockOrNodeInstance.typeName);
|
|
7970
7686
|
}
|
|
7971
7687
|
/**
|
|
7972
7688
|
* The table cell border color can be represented in different formats (e.g., hex, rgb), so we need to ensure that we can handle both cases.
|
|
@@ -8030,12 +7746,12 @@ class VegaRTETableExtension extends linkExtension.VegaRTEExtension {
|
|
|
8030
7746
|
this.tableSelection = new RTETableSelection();
|
|
8031
7747
|
splitCellOperation.RTETableColorManager.setTableColors(colors);
|
|
8032
7748
|
this.registerToolbarButtonRenderer(VegaRTETableExtension.TOOLBAR_BUTTON_KEY, this.toolbarButtonRenderer);
|
|
8033
|
-
this.registerBlockBasicStrategies(splitCellOperation.RTETableBlock.
|
|
8034
|
-
this.registerBlockBasicStrategies(splitCellOperation.RTETableHeadBlock.
|
|
8035
|
-
this.registerBlockBasicStrategies(splitCellOperation.RTETableHeadCellBlock.
|
|
8036
|
-
this.registerBlockBasicStrategies(splitCellOperation.RTETableRowBlock.
|
|
8037
|
-
this.registerBlockBasicStrategies(splitCellOperation.RTETableCellBlock.
|
|
8038
|
-
this.registerBlockBasicStrategies(splitCellOperation.RTETableBodyBlock.
|
|
7749
|
+
this.registerBlockBasicStrategies(splitCellOperation.RTETableBlock.typeName);
|
|
7750
|
+
this.registerBlockBasicStrategies(splitCellOperation.RTETableHeadBlock.typeName);
|
|
7751
|
+
this.registerBlockBasicStrategies(splitCellOperation.RTETableHeadCellBlock.typeName);
|
|
7752
|
+
this.registerBlockBasicStrategies(splitCellOperation.RTETableRowBlock.typeName);
|
|
7753
|
+
this.registerBlockBasicStrategies(splitCellOperation.RTETableCellBlock.typeName);
|
|
7754
|
+
this.registerBlockBasicStrategies(splitCellOperation.RTETableBodyBlock.typeName);
|
|
8039
7755
|
this.registerRenderer('table-block', this.tableBlockRenderer);
|
|
8040
7756
|
this.registerRenderer('table-head', new RTETableHeadRenderer());
|
|
8041
7757
|
this.registerRenderer('table-head-cell', this.tableHeadCellRenderer);
|
|
@@ -8082,41 +7798,41 @@ class VegaRTETableExtension extends linkExtension.VegaRTEExtension {
|
|
|
8082
7798
|
(() => {
|
|
8083
7799
|
const insertTableBlockStrategy = new InsertTableBlockStrategy();
|
|
8084
7800
|
const deleteTableBlockStrategy = new DeleteTableBlockStrategy();
|
|
8085
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.
|
|
7801
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.typeName, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
8086
7802
|
// Registered on the table block itself (not its parent) so a table can always be
|
|
8087
7803
|
// deleted regardless of which block type it is nested in (root content, table cell,
|
|
8088
7804
|
// blockquote, or any future container).
|
|
8089
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8090
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.
|
|
8091
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageBlock.
|
|
8092
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8093
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8094
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8095
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8096
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8097
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8098
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8099
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableRowBlock.
|
|
8100
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableRowBlock.
|
|
8101
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableRowBlock.
|
|
8102
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.
|
|
8103
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.
|
|
8104
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.
|
|
8105
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.
|
|
8106
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8107
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8108
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.
|
|
8109
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.
|
|
8110
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.
|
|
8111
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.
|
|
8112
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableRowBlock.
|
|
8113
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableCellBlock.
|
|
8114
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableHeadCellBlock.
|
|
8115
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableBlock.
|
|
8116
|
-
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableBlock.
|
|
8117
|
-
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(RTETableCaptionBlock.
|
|
8118
|
-
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableCellBlock.
|
|
8119
|
-
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableHeadCellBlock.
|
|
7805
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, DELETE_TABLE_BLOCK, deleteTableBlockStrategy);
|
|
7806
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.typeName, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
7807
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageBlock.typeName, INSERT_TABLE_BLOCK, insertTableBlockStrategy);
|
|
7808
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION, new InsertTableRowIntoDifferentSectionStrategy());
|
|
7809
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.INSERT_TABLE_ROW_INTO_SAME_SECTION, new InsertTableRowIntoSameSectionStrategy());
|
|
7810
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.DELETE_TABLE_ROW, new DeleteTableRowStrategy());
|
|
7811
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.TOGGLE_HEADER_ROW, new ToggleHeaderRowStrategy());
|
|
7812
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.INSERT_TABLE_COLUMN, new InsertTableColumnStrategy());
|
|
7813
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.DELETE_TABLE_COLUMN, new DeleteTableColumnStrategy());
|
|
7814
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.TOGGLE_HEADER_TABLE_COLUMN, new splitCellOperation.ToggleHeaderTableColumnStrategy());
|
|
7815
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableRowBlock.typeName, splitCellOperation.SPLIT_TABLE_CELL, new SplitTableCellStrategy());
|
|
7816
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableRowBlock.typeName, CREATE_SEGMENT_TABLE_CELL, new CreateSegmentTableCellStrategy());
|
|
7817
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableRowBlock.typeName, splitCellOperation.REPLACE_TABLE_CELL, new ReplaceTableCellStrategy());
|
|
7818
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.typeName, splitCellOperation.SPLIT_CELL_HORIZONTALLY, new SplitCellHorizontallyStrategy());
|
|
7819
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.typeName, splitCellOperation.SPLIT_CELL_VERTICALLY, new SplitCellVerticallyStrategy());
|
|
7820
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.typeName, splitCellOperation.SPLIT_CELL_HORIZONTALLY, new SplitCellHorizontallyStrategy());
|
|
7821
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.typeName, splitCellOperation.SPLIT_CELL_VERTICALLY, new SplitCellVerticallyStrategy());
|
|
7822
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.SELECT_TABLE_COLUMN, new SelectTableColumnStrategy());
|
|
7823
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, splitCellOperation.MERGE_CELLS, new MergeCellsStrategy());
|
|
7824
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableBlock.typeName, UpdateTablePropertiesAction.typeName, new UpdateTablePropertiesStrategy());
|
|
7825
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.typeName, RTETableCellAnnotationsAction.typeName, new UpdateTableCellPropertiesStrategy());
|
|
7826
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.typeName, RTETableHeadCellAnnotationsAction.typeName, new UpdateTableCellPropertiesStrategy());
|
|
7827
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.typeName, codeBlock.ModifyContentActionType.DELETE_BLOCK_CONTENT, new PreventCellContentDeleteInterceptor());
|
|
7828
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableRowBlock.typeName, codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, new PreventRowInsertInterceptor());
|
|
7829
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableCellBlock.typeName, codeBlock.ModifyContentActionType.DELETE_CHILDREN, new PreventCellChildrenRemoveInterceptor());
|
|
7830
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableHeadCellBlock.typeName, codeBlock.ModifyContentActionType.DELETE_CHILDREN, new PreventCellChildrenRemoveInterceptor());
|
|
7831
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableBlock.typeName, codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, new PreventTableInsertParagraphInterceptor());
|
|
7832
|
+
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableBlock.typeName, new TableBlockFilterStylesStrategy());
|
|
7833
|
+
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(RTETableCaptionBlock.typeName, new TableCaptionFilterStylesStrategy());
|
|
7834
|
+
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableCellBlock.typeName, new TableCellFilterStylesStrategy());
|
|
7835
|
+
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableHeadCellBlock.typeName, new TableCellFilterStylesStrategy('th'));
|
|
8120
7836
|
})();
|
|
8121
7837
|
VegaRTETableExtension.TOOLBAR_BUTTON_KEY = 'table';
|
|
8122
7838
|
|
|
@@ -8151,6 +7867,7 @@ class RTEHorizontalLineNode extends codeBlock.RTEDecoratorNode {
|
|
|
8151
7867
|
return '<hr>';
|
|
8152
7868
|
}
|
|
8153
7869
|
}
|
|
7870
|
+
RTEHorizontalLineNode.typeName = 'RTEHorizontalLineNode';
|
|
8154
7871
|
|
|
8155
7872
|
/**
|
|
8156
7873
|
* Predicate class provides static methods to check specific conditions on HTML elements or dto instances.
|
|
@@ -8195,7 +7912,7 @@ class HorizontalLineFilterStylesStrategy extends codeBlock.RTEFilterStylesStrate
|
|
|
8195
7912
|
* @inheritDoc
|
|
8196
7913
|
*/
|
|
8197
7914
|
canFilter(blockOrNodeInstance) {
|
|
8198
|
-
return Predicate.isHorizontalLineBlock(blockOrNodeInstance.
|
|
7915
|
+
return Predicate.isHorizontalLineBlock(blockOrNodeInstance.typeName);
|
|
8199
7916
|
}
|
|
8200
7917
|
/**
|
|
8201
7918
|
* @inheritDoc
|
|
@@ -8279,7 +7996,6 @@ class HorizontalLineAnnotation extends codeBlock.BlockAnnotation {
|
|
|
8279
7996
|
class RTEHorizontalLineBlock extends codeBlock.RTEBlock {
|
|
8280
7997
|
constructor(id, options) {
|
|
8281
7998
|
super(id);
|
|
8282
|
-
this.dtoName = RTEHorizontalLineBlock.dtoName;
|
|
8283
7999
|
this.type = 'horizontal-line';
|
|
8284
8000
|
this.children = [];
|
|
8285
8001
|
const { autoMatchFormat = true } = options !== null && options !== void 0 ? options : {};
|
|
@@ -8357,7 +8073,7 @@ class RTEHorizontalLineBlock extends codeBlock.RTEBlock {
|
|
|
8357
8073
|
return clonedBlock;
|
|
8358
8074
|
}
|
|
8359
8075
|
}
|
|
8360
|
-
RTEHorizontalLineBlock.
|
|
8076
|
+
RTEHorizontalLineBlock.typeName = 'RTEHorizontalLineBlock';
|
|
8361
8077
|
|
|
8362
8078
|
const horizontalLineBlockStylesCss = ".v-rte-horizontal-line{padding:8px 0;overflow:hidden}.v-rte-horizontal-line .v-rte-horizontal-line-hr{display:inline-block;width:100%;height:4px;border-width:0px;background-color:rgb(222, 222, 222)}";
|
|
8363
8079
|
|
|
@@ -8395,6 +8111,7 @@ class RTEHorizontalLineBlockRenderer extends linkExtension.VegaRTEExtensionRende
|
|
|
8395
8111
|
return horizontalLineBlockStylesCss;
|
|
8396
8112
|
}
|
|
8397
8113
|
}
|
|
8114
|
+
RTEHorizontalLineBlockRenderer.typeName = 'RTEHorizontalLineBlockRenderer';
|
|
8398
8115
|
|
|
8399
8116
|
const HorizontalLine = {
|
|
8400
8117
|
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 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="M0 224H32 608h32v64H608 32 0V224z"/></svg>`,
|
|
@@ -8417,7 +8134,7 @@ class InsertHorizontalLineBlockAction extends codeBlock.ModifyContentAction {
|
|
|
8417
8134
|
/**
|
|
8418
8135
|
* Toolbar button renderer for horizontal line insertion.
|
|
8419
8136
|
*/
|
|
8420
|
-
class RTEHorizontalLineToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
8137
|
+
class RTEHorizontalLineToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
8421
8138
|
/**
|
|
8422
8139
|
* Renders the horizontal line toolbar button.
|
|
8423
8140
|
*
|
|
@@ -8611,7 +8328,7 @@ class VegaRTEHorizontalLineExtension extends linkExtension.VegaRTEExtension {
|
|
|
8611
8328
|
this.blockRenderer = new RTEHorizontalLineBlockRenderer();
|
|
8612
8329
|
this.toolbarButtonRenderer = new RTEHorizontalLineToolbarButtonRenderer();
|
|
8613
8330
|
// Register basic block strategies (delete, append, paste, etc.)
|
|
8614
|
-
this.registerBlockBasicStrategies(RTEHorizontalLineBlock.
|
|
8331
|
+
this.registerBlockBasicStrategies(RTEHorizontalLineBlock.typeName);
|
|
8615
8332
|
// Register the block DTO class
|
|
8616
8333
|
this.registerNode('horizontal-line', RTEHorizontalLineBlock);
|
|
8617
8334
|
// Register the renderer
|
|
@@ -8621,16 +8338,16 @@ class VegaRTEHorizontalLineExtension extends linkExtension.VegaRTEExtension {
|
|
|
8621
8338
|
// Register HTML → DTO conversion strategy
|
|
8622
8339
|
this.registerElementToBlockDTOClassStrategy(new HrToHorizontalLineBlockStrategy());
|
|
8623
8340
|
// Register filter styles strategy for source edit round-trip
|
|
8624
|
-
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(RTEHorizontalLineBlock.
|
|
8341
|
+
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(RTEHorizontalLineBlock.typeName, new HorizontalLineFilterStylesStrategy());
|
|
8625
8342
|
}
|
|
8626
8343
|
}
|
|
8627
8344
|
(() => {
|
|
8628
8345
|
const insertStrategy = new InsertHorizontalLineBlockStrategy();
|
|
8629
8346
|
// Register insert strategy for all block types that can be a target
|
|
8630
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.
|
|
8631
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.
|
|
8632
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageBlock.
|
|
8633
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTEHorizontalLineBlock.
|
|
8347
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.typeName, INSERT_HORIZONTAL_LINE_BLOCK, insertStrategy);
|
|
8348
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.typeName, INSERT_HORIZONTAL_LINE_BLOCK, insertStrategy);
|
|
8349
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageBlock.typeName, INSERT_HORIZONTAL_LINE_BLOCK, insertStrategy);
|
|
8350
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTEHorizontalLineBlock.typeName, INSERT_HORIZONTAL_LINE_BLOCK, insertStrategy);
|
|
8634
8351
|
})();
|
|
8635
8352
|
VegaRTEHorizontalLineExtension.TOOLBAR_BUTTON_KEY = 'horizontalLine';
|
|
8636
8353
|
|
|
@@ -8715,7 +8432,6 @@ class BlockquoteAnnotation extends codeBlock.BlockAnnotation {
|
|
|
8715
8432
|
class RTEBlockquoteBlock extends codeBlock.RTEBlock {
|
|
8716
8433
|
constructor(id, options) {
|
|
8717
8434
|
super(id);
|
|
8718
|
-
this.dtoName = RTEBlockquoteBlock.dtoName;
|
|
8719
8435
|
this.type = 'blockquote';
|
|
8720
8436
|
this.children = [];
|
|
8721
8437
|
const { autoMatchFormat = true } = options !== null && options !== void 0 ? options : {};
|
|
@@ -8776,7 +8492,7 @@ class RTEBlockquoteBlock extends codeBlock.RTEBlock {
|
|
|
8776
8492
|
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: 'blockquote', children: this.children.map((child) => child.toJSON()) });
|
|
8777
8493
|
}
|
|
8778
8494
|
}
|
|
8779
|
-
RTEBlockquoteBlock.
|
|
8495
|
+
RTEBlockquoteBlock.typeName = 'RTEBlockquoteBlock';
|
|
8780
8496
|
|
|
8781
8497
|
/**
|
|
8782
8498
|
* Wrap the selected blocks into a new `<blockquote>` block while preserving
|
|
@@ -8840,7 +8556,7 @@ class RemoveBlockquoteStrategy extends codeBlock.ActionHandleStrategy {
|
|
|
8840
8556
|
* the quote) moves that empty paragraph out to a new paragraph after the blockquote,
|
|
8841
8557
|
* instead of stacking another empty line inside the quote.
|
|
8842
8558
|
*/
|
|
8843
|
-
class BlockquoteExitOnEnterInterceptor extends ActionHandlerInterceptor {
|
|
8559
|
+
class BlockquoteExitOnEnterInterceptor extends imageExtension.ActionHandlerInterceptor {
|
|
8844
8560
|
/**
|
|
8845
8561
|
* Intercept only when the caret sits in an empty paragraph that is the last child of a blockquote.
|
|
8846
8562
|
*
|
|
@@ -8994,6 +8710,7 @@ class RTEBlockquoteBlockRenderer extends linkExtension.VegaRTEExtensionRenderer
|
|
|
8994
8710
|
return BlockquoteAnnotation.getDefaultCssText();
|
|
8995
8711
|
}
|
|
8996
8712
|
}
|
|
8713
|
+
RTEBlockquoteBlockRenderer.typeName = 'RTEBlockquoteBlockRenderer';
|
|
8997
8714
|
const RTEBlockquoteBlockRenderer$1 = new RTEBlockquoteBlockRenderer();
|
|
8998
8715
|
|
|
8999
8716
|
// FontAwesome 7.2.0 — `quote-left` (solid).
|
|
@@ -9017,7 +8734,7 @@ const QuoteLeftIcon = {
|
|
|
9017
8734
|
* selection so it can append a new blockquote.
|
|
9018
8735
|
* - Hidden in source-edit mode (inherited from {@link VegaRTEToolbarButtonRenderer}).
|
|
9019
8736
|
*/
|
|
9020
|
-
class RTEBlockquoteToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
8737
|
+
class RTEBlockquoteToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
9021
8738
|
/**
|
|
9022
8739
|
* @inheritDoc
|
|
9023
8740
|
*/
|
|
@@ -9275,7 +8992,7 @@ class BlockquoteFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
|
9275
8992
|
* @inheritDoc
|
|
9276
8993
|
*/
|
|
9277
8994
|
canFilter(blockOrNodeInstance) {
|
|
9278
|
-
return BlockquoteFilterStylesStrategy.isBlockquoteBlock(blockOrNodeInstance.
|
|
8995
|
+
return BlockquoteFilterStylesStrategy.isBlockquoteBlock(blockOrNodeInstance.typeName);
|
|
9279
8996
|
}
|
|
9280
8997
|
/**
|
|
9281
8998
|
* @inheritDoc
|
|
@@ -9298,28 +9015,28 @@ class VegaRTEBlockquoteExtension extends linkExtension.VegaRTEExtension {
|
|
|
9298
9015
|
constructor() {
|
|
9299
9016
|
super();
|
|
9300
9017
|
this.toolbarButtonRenderer = new RTEBlockquoteToolbarButtonRenderer();
|
|
9301
|
-
this.registerBlockBasicStrategies(RTEBlockquoteBlock.
|
|
9018
|
+
this.registerBlockBasicStrategies(RTEBlockquoteBlock.typeName);
|
|
9302
9019
|
this.registerNode('blockquote', RTEBlockquoteBlock);
|
|
9303
9020
|
this.registerRenderer('blockquote', RTEBlockquoteBlockRenderer$1);
|
|
9304
9021
|
this.registerToolbarButtonRenderer(VegaRTEBlockquoteExtension.TOOLBAR_BUTTON_KEY, this.toolbarButtonRenderer);
|
|
9305
9022
|
this.registerElementToBlockDTOClassStrategy(new BlockquoteToBlockquoteBlockStrategy());
|
|
9306
9023
|
// Register filter styles strategy for source edit round-trip.
|
|
9307
|
-
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(RTEBlockquoteBlock.
|
|
9024
|
+
linkExtension.VegaRTEExtension.registerFilterStylesStrategy(RTEBlockquoteBlock.typeName, new BlockquoteFilterStylesStrategy());
|
|
9308
9025
|
}
|
|
9309
9026
|
}
|
|
9310
9027
|
(() => {
|
|
9311
9028
|
const wrapStrategy = new BlockTransformToBlockquoteStrategy();
|
|
9312
9029
|
// Root container — wrap top-level blocks.
|
|
9313
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.
|
|
9030
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.VegaRTEContent.typeName, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
9314
9031
|
// Table cells (body + header) — wrap is scoped to the closest cell.
|
|
9315
9032
|
// Other container blocks (code, list item, function) are intentionally
|
|
9316
9033
|
// not registered, so the toolbar stays disabled inside them.
|
|
9317
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.
|
|
9318
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.
|
|
9319
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTEBlockquoteBlock.
|
|
9034
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableCellBlock.typeName, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
9035
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(splitCellOperation.RTETableHeadCellBlock.typeName, TRANSFORM_TO_BLOCKQUOTE, wrapStrategy);
|
|
9036
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(RTEBlockquoteBlock.typeName, REMOVE_BLOCKQUOTE, new RemoveBlockquoteStrategy());
|
|
9320
9037
|
// Enables exiting the blockquote via the keyboard: pressing Enter on an empty
|
|
9321
9038
|
// trailing paragraph breaks out to a new paragraph after the blockquote.
|
|
9322
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.
|
|
9039
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(codeBlock.RTETextBlock.typeName, codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, new BlockquoteExitOnEnterInterceptor());
|
|
9323
9040
|
})();
|
|
9324
9041
|
VegaRTEBlockquoteExtension.TOOLBAR_BUTTON_KEY = 'blockquote';
|
|
9325
9042
|
|
|
@@ -9637,7 +9354,7 @@ const specialCharactersIcon = {
|
|
|
9637
9354
|
* Renders a toolbar button with an Ω icon that opens a popover panel
|
|
9638
9355
|
* with categorized character grids.
|
|
9639
9356
|
*/
|
|
9640
|
-
class RTESpecialCharactersToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
9357
|
+
class RTESpecialCharactersToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
9641
9358
|
constructor(categories) {
|
|
9642
9359
|
super();
|
|
9643
9360
|
this.panelRef = null;
|
|
@@ -10858,7 +10575,7 @@ class ReplaceController extends FindReplaceControllerAbstract {
|
|
|
10858
10575
|
* Both controllers share a single {@link FindReplaceControllerContext} so they
|
|
10859
10576
|
* operate on the same search state and highlight overlays.
|
|
10860
10577
|
*/
|
|
10861
|
-
class FindReplaceToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
10578
|
+
class FindReplaceToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
10862
10579
|
constructor() {
|
|
10863
10580
|
super(...arguments);
|
|
10864
10581
|
this.sharedContext = createFindReplaceControllerContext();
|
|
@@ -11202,6 +10919,7 @@ class LineHeightAnnotationAction extends codeBlock.AnnotationAction {
|
|
|
11202
10919
|
return new LineHeightAnnotation(this.lineHeight);
|
|
11203
10920
|
}
|
|
11204
10921
|
}
|
|
10922
|
+
LineHeightAnnotationAction.typeName = 'LineHeightAnnotationAction';
|
|
11205
10923
|
|
|
11206
10924
|
/**
|
|
11207
10925
|
* Update the block line height strategy.
|
|
@@ -11228,7 +10946,7 @@ const lineHeight = {
|
|
|
11228
10946
|
/**
|
|
11229
10947
|
* Renderer for the line-height toolbar button in the Vega Rich Text Editor.
|
|
11230
10948
|
*/
|
|
11231
|
-
class RTELineHeightToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
10949
|
+
class RTELineHeightToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
11232
10950
|
constructor(options) {
|
|
11233
10951
|
super();
|
|
11234
10952
|
this.options = options;
|
|
@@ -11298,7 +11016,7 @@ class RTELineHeightToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
|
11298
11016
|
const selectedBlocks = this.getSelectedBlocks(editorContext);
|
|
11299
11017
|
return selectedBlocks.some((block) => block instanceof codeBlock.RTECodeBlock ||
|
|
11300
11018
|
block instanceof contentState.RTEImageBlock ||
|
|
11301
|
-
!codeBlock.ActionHandleStrategyRegistry.canHandle(LineHeightAnnotationAction.
|
|
11019
|
+
!codeBlock.ActionHandleStrategyRegistry.canHandle(LineHeightAnnotationAction.typeName, block));
|
|
11302
11020
|
}
|
|
11303
11021
|
/**
|
|
11304
11022
|
* @inheritDoc
|
|
@@ -11363,8 +11081,8 @@ class RTELineHeightToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
|
11363
11081
|
})();
|
|
11364
11082
|
|
|
11365
11083
|
const LINE_HEIGHT_AWARE_BLOCK_NAMES = new Set([
|
|
11366
|
-
codeBlock.RTETextBlock.
|
|
11367
|
-
codeBlock.RTEListItemBlock.
|
|
11084
|
+
codeBlock.RTETextBlock.typeName,
|
|
11085
|
+
codeBlock.RTEListItemBlock.typeName,
|
|
11368
11086
|
]);
|
|
11369
11087
|
/** Handle line height annotation. */
|
|
11370
11088
|
class LineHeightAnnotationHandler extends contentState.AnnotationGeneratorStrategyAbstract {
|
|
@@ -11379,7 +11097,7 @@ class LineHeightAnnotationHandler extends contentState.AnnotationGeneratorStrate
|
|
|
11379
11097
|
* @returns {boolean} Whether the target DTO supports line-height annotations.
|
|
11380
11098
|
*/
|
|
11381
11099
|
canHandle(targetDto) {
|
|
11382
|
-
return LINE_HEIGHT_AWARE_BLOCK_NAMES.has(targetDto.
|
|
11100
|
+
return LINE_HEIGHT_AWARE_BLOCK_NAMES.has(targetDto.typeName);
|
|
11383
11101
|
}
|
|
11384
11102
|
/**
|
|
11385
11103
|
* Extract inline `line-height` as a semantic `lineHeight` annotation.
|
|
@@ -11531,8 +11249,8 @@ class VegaRTELineHeightExtension extends linkExtension.VegaRTEExtension {
|
|
|
11531
11249
|
}
|
|
11532
11250
|
(() => {
|
|
11533
11251
|
[codeBlock.RTETextBlock, codeBlock.RTEListItemBlock].forEach((BlockClass) => {
|
|
11534
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(BlockClass.
|
|
11535
|
-
codeBlock.RTEFilterStylesStrategyRegistry.register(BlockClass.
|
|
11252
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(BlockClass.typeName, LineHeightAnnotationAction.typeName, new BlockUpdateLineHeightStrategy());
|
|
11253
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(BlockClass.typeName, new LineHeightFilterStylesStrategy());
|
|
11536
11254
|
attachLineHeightFromJson(BlockClass);
|
|
11537
11255
|
});
|
|
11538
11256
|
})();
|
|
@@ -11549,7 +11267,7 @@ const fullscreenExit = {
|
|
|
11549
11267
|
/**
|
|
11550
11268
|
* Toolbar button renderer for fullscreen toggle.
|
|
11551
11269
|
*/
|
|
11552
|
-
class RTEFullscreenToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
11270
|
+
class RTEFullscreenToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
11553
11271
|
constructor(controller) {
|
|
11554
11272
|
super();
|
|
11555
11273
|
this.controller = controller;
|
|
@@ -11805,6 +11523,7 @@ VegaRTEFullscreenExtension.controllerStore = VegaRTEFullscreenExtension.createSt
|
|
|
11805
11523
|
var RTEPasteMode;
|
|
11806
11524
|
(function (RTEPasteMode) {
|
|
11807
11525
|
RTEPasteMode["RICH"] = "rich";
|
|
11526
|
+
RTEPasteMode["PLAIN"] = "plain";
|
|
11808
11527
|
RTEPasteMode["WORD"] = "word";
|
|
11809
11528
|
})(RTEPasteMode || (RTEPasteMode = {}));
|
|
11810
11529
|
/**
|
|
@@ -11856,185 +11575,63 @@ class AbstractPasteProcessingStrategy {
|
|
|
11856
11575
|
get supportsImageProcessing() {
|
|
11857
11576
|
return false;
|
|
11858
11577
|
}
|
|
11859
|
-
}
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
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>`,
|
|
11863
|
-
};
|
|
11864
|
-
|
|
11865
|
-
/**
|
|
11866
|
-
* Renders and manages the paste format chooser UI.
|
|
11867
|
-
*/
|
|
11868
|
-
class RTEPasteChooserUI {
|
|
11869
|
-
constructor(hostRoot, callbacks, options = {}) {
|
|
11870
|
-
this.hostRoot = hostRoot;
|
|
11871
|
-
this.callbacks = callbacks;
|
|
11872
|
-
this.options = options;
|
|
11873
|
-
this.chooserEl = null;
|
|
11874
|
-
this.dropdownEl = null;
|
|
11875
|
-
this.triggerButtonEl = null;
|
|
11578
|
+
/** @returns {boolean} Whether this strategy consumes `text/plain` instead of `text/html` (default: false). */
|
|
11579
|
+
get consumesPlainText() {
|
|
11580
|
+
return false;
|
|
11876
11581
|
}
|
|
11877
11582
|
/**
|
|
11878
|
-
*
|
|
11583
|
+
* Owns the complete content policy for this paste mode. Subclasses that
|
|
11584
|
+
* only need a different source string should override {@link getSourceContent}
|
|
11585
|
+
* instead of re-implementing this method.
|
|
11879
11586
|
*
|
|
11880
|
-
* @param {
|
|
11587
|
+
* @param {PasteInput} input Complete clipboard payload.
|
|
11588
|
+
* @returns {PasteOutput} Complete downstream paste contract.
|
|
11881
11589
|
*/
|
|
11882
|
-
|
|
11883
|
-
this.
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
dropdownEl.placement = position.placement;
|
|
11893
|
-
chooser.append(dropdownEl);
|
|
11894
|
-
this.hostRoot.appendChild(chooser);
|
|
11895
|
-
this.chooserEl = chooser;
|
|
11896
|
-
this.dropdownEl = dropdownEl;
|
|
11897
|
-
dropdownEl.addEventListener('vegaShow', () => {
|
|
11898
|
-
if (this.triggerButtonEl) {
|
|
11899
|
-
this.triggerButtonEl.selected = true;
|
|
11900
|
-
}
|
|
11901
|
-
});
|
|
11902
|
-
dropdownEl.addEventListener('vegaHide', () => {
|
|
11903
|
-
if (this.triggerButtonEl) {
|
|
11904
|
-
this.triggerButtonEl.selected = false;
|
|
11905
|
-
}
|
|
11906
|
-
});
|
|
11590
|
+
transform(input) {
|
|
11591
|
+
const content = this.getSourceContent(input);
|
|
11592
|
+
return {
|
|
11593
|
+
html: this.process(content),
|
|
11594
|
+
text: this.consumesPlainText ? content : input.text,
|
|
11595
|
+
mode: this.type,
|
|
11596
|
+
markers: {},
|
|
11597
|
+
extractImages: this.supportsImageProcessing,
|
|
11598
|
+
imagesToExtract: this.supportsImageProcessing ? input.files : [],
|
|
11599
|
+
};
|
|
11907
11600
|
}
|
|
11908
11601
|
/**
|
|
11909
|
-
*
|
|
11602
|
+
* Resolves the source string passed to {@link process}. Defaults to
|
|
11603
|
+
* `input.text` when {@link consumesPlainText} is true, otherwise `input.html`.
|
|
11604
|
+
*
|
|
11605
|
+
* @param {PasteInput} input Complete clipboard payload.
|
|
11606
|
+
* @returns {string} Content to feed into `process`.
|
|
11910
11607
|
*/
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
if (this.dropdownEl && typeof this.dropdownEl.hide === 'function') {
|
|
11914
|
-
void this.dropdownEl.hide();
|
|
11915
|
-
}
|
|
11916
|
-
if ((_a = this.chooserEl) === null || _a === void 0 ? void 0 : _a.parentNode) {
|
|
11917
|
-
this.chooserEl.parentNode.removeChild(this.chooserEl);
|
|
11918
|
-
}
|
|
11919
|
-
if (this.triggerButtonEl) {
|
|
11920
|
-
this.triggerButtonEl.selected = false;
|
|
11921
|
-
}
|
|
11922
|
-
this.dropdownEl = null;
|
|
11923
|
-
this.chooserEl = null;
|
|
11924
|
-
this.triggerButtonEl = null;
|
|
11608
|
+
getSourceContent(input) {
|
|
11609
|
+
return this.consumesPlainText ? input.text : input.html;
|
|
11925
11610
|
}
|
|
11611
|
+
}
|
|
11612
|
+
|
|
11613
|
+
/**
|
|
11614
|
+
* Default paste processing strategy that acts as a fallback when no other
|
|
11615
|
+
* strategy matches. This strategy always accepts the content and passes it
|
|
11616
|
+
* through unchanged — the normal RTE paste pipeline (DOMParser +
|
|
11617
|
+
* ElementToDtoStrategyProcessor) handles the rest.
|
|
11618
|
+
*/
|
|
11619
|
+
class DefaultPasteProcessingStrategy extends AbstractPasteProcessingStrategy {
|
|
11926
11620
|
/**
|
|
11927
|
-
*
|
|
11621
|
+
* Always matches as the terminal fallback strategy.
|
|
11928
11622
|
*
|
|
11929
|
-
* @param {
|
|
11930
|
-
* @returns {boolean} `true
|
|
11623
|
+
* @param {string} html Raw clipboard HTML.
|
|
11624
|
+
* @returns {boolean} Always `true`.
|
|
11931
11625
|
*/
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
}
|
|
11936
|
-
const isDropdownContentClick = eventPath.some((target) => {
|
|
11937
|
-
return 'tagName' in target && target.tagName === 'VEGA-DROPDOWN-CONTENT-BOX';
|
|
11938
|
-
});
|
|
11939
|
-
return eventPath.includes(this.chooserEl) || isDropdownContentClick;
|
|
11626
|
+
canHandle(html) {
|
|
11627
|
+
// Default strategy is the fallback — always returns true.
|
|
11628
|
+
return html !== undefined;
|
|
11940
11629
|
}
|
|
11941
11630
|
/**
|
|
11942
|
-
*
|
|
11631
|
+
* Returns the original HTML unchanged.
|
|
11943
11632
|
*
|
|
11944
|
-
* @param {
|
|
11945
|
-
* @
|
|
11946
|
-
* @returns {HTMLElement} Configured dropdown element.
|
|
11947
|
-
*/
|
|
11948
|
-
createPasteChooserDropdown(doc, placement) {
|
|
11949
|
-
const dropdownEl = doc.createElement('vega-dropdown');
|
|
11950
|
-
dropdownEl.trigger = 'click';
|
|
11951
|
-
dropdownEl.selectType = 'single';
|
|
11952
|
-
dropdownEl.selectedSourceKey = 'rich';
|
|
11953
|
-
dropdownEl.maxWidth = 220;
|
|
11954
|
-
dropdownEl.alignment = 'start';
|
|
11955
|
-
dropdownEl.itemDisplayRule = 'ellipsis';
|
|
11956
|
-
dropdownEl.isScreenPosition = true;
|
|
11957
|
-
const triggerButton = doc.createElement('vega-rich-text-editor-toolbar-button');
|
|
11958
|
-
const arrowIcon = placement[0] === 'top' ? 'chevron-up' : 'chevron-down';
|
|
11959
|
-
triggerButton.setAttribute(RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR, 'true');
|
|
11960
|
-
triggerButton.setAttribute('aria-label', internalTranslationController.VegaInternalTranslation.t('Paste options'));
|
|
11961
|
-
triggerButton.setAttribute('arrow-icon', arrowIcon);
|
|
11962
|
-
triggerButton.icon = 'rte-paste';
|
|
11963
|
-
triggerButton.showArrowIcon = true;
|
|
11964
|
-
triggerButton.selected = false;
|
|
11965
|
-
this.triggerButtonEl = triggerButton;
|
|
11966
|
-
const tooltipEl = doc.createElement('vega-tooltip');
|
|
11967
|
-
tooltipEl.text = internalTranslationController.VegaInternalTranslation.t('Paste options');
|
|
11968
|
-
tooltipEl.placement = ['bottom', 'top'];
|
|
11969
|
-
tooltipEl.append(triggerButton);
|
|
11970
|
-
dropdownEl.append(tooltipEl);
|
|
11971
|
-
const itemsContainer = doc.createElement('div');
|
|
11972
|
-
itemsContainer.setAttribute('slot', 'items');
|
|
11973
|
-
const dropdownItems = [
|
|
11974
|
-
this.createDropdownItem(doc, RTEPasteMode.RICH, internalTranslationController.VegaInternalTranslation.t('Use rich text'), RTEPasteChooserUI.CHOOSER_RICH_ATTR),
|
|
11975
|
-
];
|
|
11976
|
-
if (this.options.showWordOption) {
|
|
11977
|
-
dropdownItems.push(this.createDropdownItem(doc, RTEPasteMode.WORD, internalTranslationController.VegaInternalTranslation.t('Use Word'), RTEPasteChooserUI.CHOOSER_WORD_ATTR));
|
|
11978
|
-
}
|
|
11979
|
-
itemsContainer.append(...dropdownItems);
|
|
11980
|
-
dropdownEl.append(itemsContainer);
|
|
11981
|
-
dropdownEl.addEventListener('vegaDropdownClick', (event) => {
|
|
11982
|
-
const mode = event.detail;
|
|
11983
|
-
if (mode === RTEPasteMode.RICH || mode === RTEPasteMode.WORD) {
|
|
11984
|
-
this.callbacks.onModeSelect(mode);
|
|
11985
|
-
}
|
|
11986
|
-
});
|
|
11987
|
-
return dropdownEl;
|
|
11988
|
-
}
|
|
11989
|
-
/**
|
|
11990
|
-
* Creates a single dropdown item element for a paste mode.
|
|
11991
|
-
*
|
|
11992
|
-
* @param {Document} doc Document used to create the element.
|
|
11993
|
-
* @param {RTEPasteMode} key Paste mode key for the item.
|
|
11994
|
-
* @param {string} label Display label for the item.
|
|
11995
|
-
* @param {string} dataAttrName Data attribute marker for the item.
|
|
11996
|
-
* @returns {HTMLVegaDropdownItemElement} Configured dropdown item element.
|
|
11997
|
-
*/
|
|
11998
|
-
createDropdownItem(doc, key, label, dataAttrName) {
|
|
11999
|
-
const itemEl = doc.createElement('vega-dropdown-item');
|
|
12000
|
-
itemEl.itemKey = key;
|
|
12001
|
-
itemEl.label = label;
|
|
12002
|
-
itemEl.setAttribute(dataAttrName, 'true');
|
|
12003
|
-
return itemEl;
|
|
12004
|
-
}
|
|
12005
|
-
}
|
|
12006
|
-
(() => {
|
|
12007
|
-
internalIconManager.VegaInternalIconManager.register({
|
|
12008
|
-
'rte-paste': paste,
|
|
12009
|
-
});
|
|
12010
|
-
})();
|
|
12011
|
-
RTEPasteChooserUI.CHOOSER_ATTR = 'data-rte-paste-chooser';
|
|
12012
|
-
RTEPasteChooserUI.CHOOSER_RICH_ATTR = 'data-rte-paste-type-rich';
|
|
12013
|
-
RTEPasteChooserUI.CHOOSER_WORD_ATTR = 'data-rte-paste-type-word';
|
|
12014
|
-
RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR = 'data-rte-paste-trigger';
|
|
12015
|
-
|
|
12016
|
-
/**
|
|
12017
|
-
* Default paste processing strategy that acts as a fallback when no other
|
|
12018
|
-
* strategy matches. This strategy always accepts the content and passes it
|
|
12019
|
-
* through unchanged — the normal RTE paste pipeline (DOMParser +
|
|
12020
|
-
* ElementToDtoStrategyProcessor) handles the rest.
|
|
12021
|
-
*/
|
|
12022
|
-
class DefaultPasteProcessingStrategy extends AbstractPasteProcessingStrategy {
|
|
12023
|
-
/**
|
|
12024
|
-
* Always matches as the terminal fallback strategy.
|
|
12025
|
-
*
|
|
12026
|
-
* @param {string} html Raw clipboard HTML.
|
|
12027
|
-
* @returns {boolean} Always `true`.
|
|
12028
|
-
*/
|
|
12029
|
-
canHandle(html) {
|
|
12030
|
-
// Default strategy is the fallback — always returns true.
|
|
12031
|
-
return html !== undefined;
|
|
12032
|
-
}
|
|
12033
|
-
/**
|
|
12034
|
-
* Returns the original HTML unchanged.
|
|
12035
|
-
*
|
|
12036
|
-
* @param {string} html Raw clipboard HTML.
|
|
12037
|
-
* @returns {string} Unchanged HTML.
|
|
11633
|
+
* @param {string} html Raw clipboard HTML.
|
|
11634
|
+
* @returns {string} Unchanged HTML.
|
|
12038
11635
|
*/
|
|
12039
11636
|
process(html) {
|
|
12040
11637
|
// Current default behavior: pass through unchanged
|
|
@@ -14030,6 +13627,76 @@ WordPasteProcessingStrategy.WORD_SIGNATURE_PATTERNS = [
|
|
|
14030
13627
|
/<\/?o:p>/i,
|
|
14031
13628
|
];
|
|
14032
13629
|
|
|
13630
|
+
/** Converts plain-text clipboard to paragraph-per-line HTML. */
|
|
13631
|
+
class PlainPasteProcessingStrategy extends AbstractPasteProcessingStrategy {
|
|
13632
|
+
/** @returns {RTEPasteMode} Plain-text paste mode. */
|
|
13633
|
+
get type() {
|
|
13634
|
+
return RTEPasteMode.PLAIN;
|
|
13635
|
+
}
|
|
13636
|
+
/** @returns {boolean} Always `true`; consumes `text/plain` instead of `text/html`. */
|
|
13637
|
+
get consumesPlainText() {
|
|
13638
|
+
return true;
|
|
13639
|
+
}
|
|
13640
|
+
/** @returns {boolean} Always `false`; never auto-selected. */
|
|
13641
|
+
canHandle() {
|
|
13642
|
+
return false;
|
|
13643
|
+
}
|
|
13644
|
+
/**
|
|
13645
|
+
* Converts plain text to paragraph HTML; every `\n` starts a new paragraph.
|
|
13646
|
+
*
|
|
13647
|
+
* @param {string} text - Clipboard `text/plain` payload.
|
|
13648
|
+
* @param {boolean} decodeEncodedWhitespace - Decode markers emitted by HTML conversion.
|
|
13649
|
+
* @returns {string} Paragraph HTML.
|
|
13650
|
+
*/
|
|
13651
|
+
process(text, decodeEncodedWhitespace = false) {
|
|
13652
|
+
if (!text) {
|
|
13653
|
+
return '';
|
|
13654
|
+
}
|
|
13655
|
+
const safeDocument = tryGetDocument.tryGetDocument();
|
|
13656
|
+
if (!safeDocument) {
|
|
13657
|
+
return '';
|
|
13658
|
+
}
|
|
13659
|
+
// Line splitting and boundary whitespace handling live in `toPlainPasteLines` so the
|
|
13660
|
+
// emitted HTML and the RTE nodes built by `InsertPasteHandler` share one conversion.
|
|
13661
|
+
return codeBlock.plainPasteLinesToHtml(codeBlock.toPlainPasteLines(text, decodeEncodedWhitespace));
|
|
13662
|
+
}
|
|
13663
|
+
/**
|
|
13664
|
+
* @param {PasteInput} input Complete clipboard payload.
|
|
13665
|
+
* @returns {PasteOutput} Plain HTML, canonical text, and whitespace marker contract.
|
|
13666
|
+
*/
|
|
13667
|
+
transform(input) {
|
|
13668
|
+
const source = this.getPlainTextSource(input);
|
|
13669
|
+
return {
|
|
13670
|
+
html: this.process(source.text, source.hasEncodedWhitespace),
|
|
13671
|
+
text: source.text,
|
|
13672
|
+
mode: this.type,
|
|
13673
|
+
markers: source.hasEncodedWhitespace ? { [codeBlock.RTE_PRESERVED_WHITESPACE_DATA_TYPE]: 'true' } : {},
|
|
13674
|
+
extractImages: false,
|
|
13675
|
+
imagesToExtract: [],
|
|
13676
|
+
};
|
|
13677
|
+
}
|
|
13678
|
+
/**
|
|
13679
|
+
* @param {PasteInput} input Clipboard content used to derive canonical plain text.
|
|
13680
|
+
* @returns {PlainTextSource} Canonical text and whether it contains whitespace sentinels.
|
|
13681
|
+
*/
|
|
13682
|
+
getPlainTextSource(input) {
|
|
13683
|
+
if (!input.html) {
|
|
13684
|
+
return { text: input.text || '', hasEncodedWhitespace: false };
|
|
13685
|
+
}
|
|
13686
|
+
const containsTable = imageExtension.htmlContainsTable(input.html);
|
|
13687
|
+
if (input.text && input.text.includes('\t') && containsTable) {
|
|
13688
|
+
return { text: input.text, hasEncodedWhitespace: false };
|
|
13689
|
+
}
|
|
13690
|
+
const derived = imageExtension.htmlToPlainText(input.html, {
|
|
13691
|
+
preserveBoundaryBlankLines: !containsTable,
|
|
13692
|
+
keepPreservedWhitespaceMarkers: true,
|
|
13693
|
+
});
|
|
13694
|
+
return derived
|
|
13695
|
+
? { text: derived, hasEncodedWhitespace: true }
|
|
13696
|
+
: { text: input.text || '', hasEncodedWhitespace: false };
|
|
13697
|
+
}
|
|
13698
|
+
}
|
|
13699
|
+
|
|
14033
13700
|
/**
|
|
14034
13701
|
* Centralized selector for paste processing strategies.
|
|
14035
13702
|
*
|
|
@@ -14042,10 +13709,27 @@ class PasteStrategySelector {
|
|
|
14042
13709
|
constructor() {
|
|
14043
13710
|
this.defaultStrategy = new DefaultPasteProcessingStrategy();
|
|
14044
13711
|
this.strategies = [
|
|
13712
|
+
new PlainPasteProcessingStrategy(),
|
|
14045
13713
|
new WordPasteProcessingStrategy(),
|
|
14046
13714
|
this.defaultStrategy, // Fallback
|
|
14047
13715
|
];
|
|
14048
13716
|
}
|
|
13717
|
+
/**
|
|
13718
|
+
* Selects the strategy that will process this paste.
|
|
13719
|
+
*
|
|
13720
|
+
* When `explicitMode` is provided and not `rich`, the strategy registered for that mode
|
|
13721
|
+
* is used. Otherwise the highest-priority strategy whose `canHandle` matches the HTML
|
|
13722
|
+
* wins, falling back to the default pass-through strategy.
|
|
13723
|
+
*
|
|
13724
|
+
* @param {PasteInput} input Captured clipboard payload used for auto-detection.
|
|
13725
|
+
* @param {RTEPasteMode} [explicitMode] Paste mode the user picked from the chooser.
|
|
13726
|
+
* @returns {AbstractPasteProcessingStrategy} Strategy to run for this paste.
|
|
13727
|
+
*/
|
|
13728
|
+
select(input, explicitMode) {
|
|
13729
|
+
return explicitMode && explicitMode !== RTEPasteMode.RICH
|
|
13730
|
+
? this.selectStrategyByType(explicitMode)
|
|
13731
|
+
: this.selectStrategy(input.html);
|
|
13732
|
+
}
|
|
14049
13733
|
/**
|
|
14050
13734
|
* Select the appropriate strategy for the given HTML content.
|
|
14051
13735
|
* Returns the highest-priority strategy that can handle the content.
|
|
@@ -14513,24 +14197,591 @@ class PendingImageRegistry {
|
|
|
14513
14197
|
imageNode && imageNode.apply(new ImageReplaceSrcAction(imageElement, url));
|
|
14514
14198
|
}
|
|
14515
14199
|
}
|
|
14516
|
-
const pending = PendingImageRegistry.pendingImages.get(imageId);
|
|
14517
|
-
if (pending) {
|
|
14518
|
-
if (pending.objectUrl.startsWith('blob:')) {
|
|
14519
|
-
URL.revokeObjectURL(pending.objectUrl);
|
|
14520
|
-
}
|
|
14521
|
-
PendingImageRegistry.pendingImages.delete(imageId);
|
|
14522
|
-
this.ownedImageIds.delete(imageId);
|
|
14200
|
+
const pending = PendingImageRegistry.pendingImages.get(imageId);
|
|
14201
|
+
if (pending) {
|
|
14202
|
+
if (pending.objectUrl.startsWith('blob:')) {
|
|
14203
|
+
URL.revokeObjectURL(pending.objectUrl);
|
|
14204
|
+
}
|
|
14205
|
+
PendingImageRegistry.pendingImages.delete(imageId);
|
|
14206
|
+
this.ownedImageIds.delete(imageId);
|
|
14207
|
+
}
|
|
14208
|
+
}
|
|
14209
|
+
}
|
|
14210
|
+
/**
|
|
14211
|
+
* Pasted images awaiting upload, keyed by their {@link VegaRTEPasteImage.id}.
|
|
14212
|
+
*
|
|
14213
|
+
* Shared statically across instances so previews survive a paste-extension
|
|
14214
|
+
* re-instantiation: the consumer may resolve `replaceUrl` after the editor
|
|
14215
|
+
* has re-mounted and created a new extension/registry instance.
|
|
14216
|
+
*/
|
|
14217
|
+
PendingImageRegistry.pendingImages = new Map();
|
|
14218
|
+
|
|
14219
|
+
/** Computes paste chooser placement from the paste pointer or saved caret range. */
|
|
14220
|
+
class ChooserPositioner {
|
|
14221
|
+
constructor(getHostElement, getSelectionRange) {
|
|
14222
|
+
this.getHostElement = getHostElement;
|
|
14223
|
+
this.getSelectionRange = getSelectionRange;
|
|
14224
|
+
}
|
|
14225
|
+
/**
|
|
14226
|
+
* @param {ClipboardEvent} event Originating paste event.
|
|
14227
|
+
* @returns {ChooserPosition} Position in viewport coordinates.
|
|
14228
|
+
*/
|
|
14229
|
+
compute(event) {
|
|
14230
|
+
var _a, _b, _c;
|
|
14231
|
+
const hostEl = this.getHostElement();
|
|
14232
|
+
if (!hostEl) {
|
|
14233
|
+
return { left: 0, top: 0, placement: ['bottom', 'top'] };
|
|
14234
|
+
}
|
|
14235
|
+
const hostRect = hostEl.getBoundingClientRect();
|
|
14236
|
+
const viewportHeight = (_b = (_a = hostEl.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.innerHeight) !== null && _b !== void 0 ? _b : window.innerHeight;
|
|
14237
|
+
const pointerEvent = event;
|
|
14238
|
+
const hasPointer = typeof pointerEvent.clientX === 'number' &&
|
|
14239
|
+
pointerEvent.clientX > 0 &&
|
|
14240
|
+
typeof pointerEvent.clientY === 'number' &&
|
|
14241
|
+
pointerEvent.clientY > 0;
|
|
14242
|
+
const caretRect = hasPointer ? null : this.getCaretRect();
|
|
14243
|
+
const CHOOSER_GAP_PX = 8;
|
|
14244
|
+
const CHOOSER_MIN_MARGIN_PX = 12;
|
|
14245
|
+
const CHOOSER_WIDTH_PX = 220;
|
|
14246
|
+
const CHOOSER_FALLBACK_OFFSET_PX = 40;
|
|
14247
|
+
const CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX = 88;
|
|
14248
|
+
const baseLeft = hasPointer
|
|
14249
|
+
? pointerEvent.clientX
|
|
14250
|
+
: (_c = caretRect === null || caretRect === void 0 ? void 0 : caretRect.left) !== null && _c !== void 0 ? _c : hostRect.left + CHOOSER_MIN_MARGIN_PX;
|
|
14251
|
+
const baseTop = hasPointer
|
|
14252
|
+
? pointerEvent.clientY
|
|
14253
|
+
: caretRect
|
|
14254
|
+
? caretRect.bottom
|
|
14255
|
+
: hostRect.top + CHOOSER_FALLBACK_OFFSET_PX;
|
|
14256
|
+
const maxLeft = Math.max(hostRect.left + CHOOSER_MIN_MARGIN_PX, hostRect.right - CHOOSER_WIDTH_PX);
|
|
14257
|
+
const left = Math.min(Math.max(baseLeft, hostRect.left + CHOOSER_MIN_MARGIN_PX), maxLeft);
|
|
14258
|
+
const top = Math.max(baseTop + CHOOSER_GAP_PX, hostRect.top + CHOOSER_MIN_MARGIN_PX);
|
|
14259
|
+
const availableBelow = viewportHeight - top - CHOOSER_MIN_MARGIN_PX;
|
|
14260
|
+
const availableAbove = top - CHOOSER_MIN_MARGIN_PX;
|
|
14261
|
+
const placement = availableBelow >= CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX || availableBelow >= availableAbove
|
|
14262
|
+
? ['bottom', 'top']
|
|
14263
|
+
: ['top', 'bottom'];
|
|
14264
|
+
return { left, top, placement };
|
|
14265
|
+
}
|
|
14266
|
+
/** @returns {DOMRect | null} Best available caret rectangle. */
|
|
14267
|
+
getCaretRect() {
|
|
14268
|
+
const range = this.getSelectionRange();
|
|
14269
|
+
if (!range) {
|
|
14270
|
+
return null;
|
|
14271
|
+
}
|
|
14272
|
+
const rect = range.getBoundingClientRect();
|
|
14273
|
+
if (!this.isUnavailableRect(rect)) {
|
|
14274
|
+
return rect;
|
|
14275
|
+
}
|
|
14276
|
+
const domRectList = range.getClientRects();
|
|
14277
|
+
if (domRectList.length > 0) {
|
|
14278
|
+
return domRectList[0];
|
|
14279
|
+
}
|
|
14280
|
+
return this.getRangeContainerRect(range);
|
|
14281
|
+
}
|
|
14282
|
+
/**
|
|
14283
|
+
* @param {DOMRect} rect Rectangle to inspect.
|
|
14284
|
+
* @returns {boolean} Whether the rectangle has no usable position or dimensions.
|
|
14285
|
+
*/
|
|
14286
|
+
isUnavailableRect(rect) {
|
|
14287
|
+
return rect.width === 0 && rect.height === 0 && rect.left === 0 && rect.top === 0;
|
|
14288
|
+
}
|
|
14289
|
+
/**
|
|
14290
|
+
* @param {Range} range Selection range whose container should be measured.
|
|
14291
|
+
* @returns {DOMRect | null} Best available rectangle for the range container.
|
|
14292
|
+
*/
|
|
14293
|
+
getRangeContainerRect(range) {
|
|
14294
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14295
|
+
const containerNode = (_a = range.startContainer) !== null && _a !== void 0 ? _a : null;
|
|
14296
|
+
if (!containerNode) {
|
|
14297
|
+
return null;
|
|
14298
|
+
}
|
|
14299
|
+
if (containerNode.nodeType === Node.ELEMENT_NODE) {
|
|
14300
|
+
const containerElement = containerNode;
|
|
14301
|
+
const previousNode = (_b = containerElement.childNodes[range.startOffset - 1]) !== null && _b !== void 0 ? _b : null;
|
|
14302
|
+
const currentNode = (_c = containerElement.childNodes[range.startOffset]) !== null && _c !== void 0 ? _c : null;
|
|
14303
|
+
return ((_e = (_d = this.getNodeRect(previousNode)) !== null && _d !== void 0 ? _d : this.getNodeRect(currentNode)) !== null && _e !== void 0 ? _e : this.getNodeRect(containerElement));
|
|
14304
|
+
}
|
|
14305
|
+
return (_f = this.getNodeRect(containerNode)) !== null && _f !== void 0 ? _f : this.getNodeRect(containerNode.parentNode);
|
|
14306
|
+
}
|
|
14307
|
+
/**
|
|
14308
|
+
* @param {Node | null} node DOM node to measure.
|
|
14309
|
+
* @returns {DOMRect | null} Element-backed rectangle for the node.
|
|
14310
|
+
*/
|
|
14311
|
+
getNodeRect(node) {
|
|
14312
|
+
var _a, _b;
|
|
14313
|
+
if (!node) {
|
|
14314
|
+
return null;
|
|
14315
|
+
}
|
|
14316
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
14317
|
+
return (_b = (_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : null;
|
|
14318
|
+
}
|
|
14319
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
14320
|
+
const rect = node.getBoundingClientRect();
|
|
14321
|
+
return this.isUnavailableRect(rect) ? null : rect;
|
|
14322
|
+
}
|
|
14323
|
+
return null;
|
|
14324
|
+
}
|
|
14325
|
+
}
|
|
14326
|
+
|
|
14327
|
+
/** Extracts local image previews from strategy output. */
|
|
14328
|
+
class ImageExtractor {
|
|
14329
|
+
constructor(parser = new PasteImageParser()) {
|
|
14330
|
+
this.parser = parser;
|
|
14331
|
+
}
|
|
14332
|
+
/**
|
|
14333
|
+
* @param {string} html HTML content containing local image references.
|
|
14334
|
+
* @param {File[]} files Clipboard image files.
|
|
14335
|
+
* @param {string} rtf Rich text clipboard content used to resolve images.
|
|
14336
|
+
* @returns {ParseLocalImagesResult} HTML and extracted local image previews.
|
|
14337
|
+
*/
|
|
14338
|
+
extract(html, files, rtf) {
|
|
14339
|
+
const clipboardFileContent = { files, rtf };
|
|
14340
|
+
return this.parser.parseLocalImages(html, clipboardFileContent);
|
|
14341
|
+
}
|
|
14342
|
+
}
|
|
14343
|
+
|
|
14344
|
+
/** Selects and executes one paste strategy, then performs declared post-processing. */
|
|
14345
|
+
class PasteProcessingPipeline {
|
|
14346
|
+
constructor(selector, imageExtractor, pendingImageRegistry) {
|
|
14347
|
+
this.selector = selector;
|
|
14348
|
+
this.imageExtractor = imageExtractor;
|
|
14349
|
+
this.pendingImageRegistry = pendingImageRegistry;
|
|
14350
|
+
}
|
|
14351
|
+
/**
|
|
14352
|
+
* @param {PendingPastePayload} payload Captured clipboard and selection data.
|
|
14353
|
+
* @param {RTEPasteMode} explicitMode Paste mode selected by the user.
|
|
14354
|
+
* @returns {PasteOutput} Processed paste output and image extraction metadata.
|
|
14355
|
+
*/
|
|
14356
|
+
process(payload, explicitMode) {
|
|
14357
|
+
const input = {
|
|
14358
|
+
html: payload.html,
|
|
14359
|
+
text: payload.text,
|
|
14360
|
+
files: payload.files,
|
|
14361
|
+
rtf: payload.rtf,
|
|
14362
|
+
};
|
|
14363
|
+
const output = this.selector.select(input, explicitMode).transform(input);
|
|
14364
|
+
if (!output.extractImages) {
|
|
14365
|
+
return output;
|
|
14366
|
+
}
|
|
14367
|
+
const extraction = this.imageExtractor.extract(output.html, output.imagesToExtract, input.rtf);
|
|
14368
|
+
if (extraction.previews.length > 0) {
|
|
14369
|
+
this.pendingImageRegistry.register(extraction.previews);
|
|
14370
|
+
}
|
|
14371
|
+
return Object.assign(Object.assign({}, output), { html: extraction.html });
|
|
14372
|
+
}
|
|
14373
|
+
}
|
|
14374
|
+
|
|
14375
|
+
/** Builds the DataTransfer contract consumed by InsertPasteHandler. */
|
|
14376
|
+
class PasteDataTransferBuilder {
|
|
14377
|
+
/**
|
|
14378
|
+
* @param {PasteOutput} output Processed paste output to serialize.
|
|
14379
|
+
* @returns {DataTransfer} Data transfer payload consumed by the paste handler.
|
|
14380
|
+
*/
|
|
14381
|
+
build(output) {
|
|
14382
|
+
// Reserved keys always win over `markers` so a strategy cannot clobber the base contract.
|
|
14383
|
+
const safeMarkers = Object.assign({}, output.markers);
|
|
14384
|
+
PasteDataTransferBuilder.RESERVED_KEYS.forEach((key) => delete safeMarkers[key]);
|
|
14385
|
+
const values = Object.assign(Object.assign({}, safeMarkers), { 'text/html': output.html, 'text/plain': output.text, [codeBlock.RTE_PASTE_MODE_DATA_TYPE]: output.mode });
|
|
14386
|
+
if (typeof DataTransfer !== 'undefined') {
|
|
14387
|
+
const dataTransfer = new DataTransfer();
|
|
14388
|
+
Object.keys(values).forEach((type) => {
|
|
14389
|
+
const value = values[type];
|
|
14390
|
+
if (value) {
|
|
14391
|
+
dataTransfer.setData(type, value);
|
|
14392
|
+
}
|
|
14393
|
+
});
|
|
14394
|
+
return dataTransfer;
|
|
14395
|
+
}
|
|
14396
|
+
return {
|
|
14397
|
+
/**
|
|
14398
|
+
* @param {string} type Clipboard data type to read.
|
|
14399
|
+
* @returns {string} Clipboard value for the requested type.
|
|
14400
|
+
*/
|
|
14401
|
+
getData: (type) => { var _a; return (_a = values[type]) !== null && _a !== void 0 ? _a : ''; },
|
|
14402
|
+
};
|
|
14403
|
+
}
|
|
14404
|
+
}
|
|
14405
|
+
PasteDataTransferBuilder.RESERVED_KEYS = [
|
|
14406
|
+
'text/html',
|
|
14407
|
+
'text/plain',
|
|
14408
|
+
codeBlock.RTE_PASTE_MODE_DATA_TYPE,
|
|
14409
|
+
];
|
|
14410
|
+
|
|
14411
|
+
/** Dispatches processed paste data through the editor's existing beforeinput pipeline. */
|
|
14412
|
+
class PasteDispatcher {
|
|
14413
|
+
/**
|
|
14414
|
+
* @param {HTMLDivElement} editableEl Editable content element receiving the event.
|
|
14415
|
+
* @param {DataTransfer} dataTransfer Processed clipboard payload.
|
|
14416
|
+
*/
|
|
14417
|
+
dispatch(editableEl, dataTransfer) {
|
|
14418
|
+
const beforeInputEvent = new CustomEvent('beforeinput', {
|
|
14419
|
+
bubbles: true,
|
|
14420
|
+
cancelable: true,
|
|
14421
|
+
});
|
|
14422
|
+
try {
|
|
14423
|
+
Object.defineProperties(beforeInputEvent, {
|
|
14424
|
+
inputType: { value: 'insertFromPaste', configurable: true },
|
|
14425
|
+
dataTransfer: { value: dataTransfer, configurable: true },
|
|
14426
|
+
});
|
|
14427
|
+
}
|
|
14428
|
+
catch (_a) {
|
|
14429
|
+
Object.assign(beforeInputEvent, { inputType: 'insertFromPaste', dataTransfer });
|
|
14430
|
+
}
|
|
14431
|
+
editableEl.dispatchEvent(beforeInputEvent);
|
|
14432
|
+
}
|
|
14433
|
+
}
|
|
14434
|
+
|
|
14435
|
+
/** Captures and restores native and editor selection state around chooser interaction. */
|
|
14436
|
+
class SelectionSnapshotService {
|
|
14437
|
+
constructor(getContext) {
|
|
14438
|
+
this.getContext = getContext;
|
|
14439
|
+
}
|
|
14440
|
+
/**
|
|
14441
|
+
* @returns {SelectionSnapshot} Captured native and editor selection state.
|
|
14442
|
+
*/
|
|
14443
|
+
capture() {
|
|
14444
|
+
var _a;
|
|
14445
|
+
const context = this.getContext();
|
|
14446
|
+
const selection = context === null || context === void 0 ? void 0 : context.getSelection();
|
|
14447
|
+
const range = selection && selection.rangeCount > 0 ? selection.getRangeAt(0).cloneRange() : null;
|
|
14448
|
+
const selectedNodes = ((_a = context === null || context === void 0 ? void 0 : context.getSelectedNodes) === null || _a === void 0 ? void 0 : _a.call(context)) || [];
|
|
14449
|
+
return { range, selectedNodes: [...selectedNodes] };
|
|
14450
|
+
}
|
|
14451
|
+
/**
|
|
14452
|
+
* @param {PendingPastePayload} payload Paste payload containing captured selection state.
|
|
14453
|
+
*/
|
|
14454
|
+
restore(payload) {
|
|
14455
|
+
this.restoreRange(payload.range);
|
|
14456
|
+
this.restoreControllerState(payload);
|
|
14457
|
+
}
|
|
14458
|
+
/**
|
|
14459
|
+
* @param {PendingPastePayload} payload Paste payload containing editor selection state.
|
|
14460
|
+
*/
|
|
14461
|
+
restoreControllerState(payload) {
|
|
14462
|
+
const context = this.getContext();
|
|
14463
|
+
if (!payload.range || !context) {
|
|
14464
|
+
return;
|
|
14465
|
+
}
|
|
14466
|
+
const rangeOptions = {
|
|
14467
|
+
startNode: payload.range.startContainer,
|
|
14468
|
+
endNode: payload.range.endContainer,
|
|
14469
|
+
startOffset: payload.range.startOffset,
|
|
14470
|
+
endOffset: payload.range.endOffset,
|
|
14471
|
+
};
|
|
14472
|
+
context.setSelectedNodes(payload.selectedNodes || [], rangeOptions);
|
|
14473
|
+
}
|
|
14474
|
+
/**
|
|
14475
|
+
* @param {Range | null} range Native selection range to restore.
|
|
14476
|
+
*/
|
|
14477
|
+
restoreRange(range) {
|
|
14478
|
+
var _a;
|
|
14479
|
+
if (!range) {
|
|
14480
|
+
return;
|
|
14481
|
+
}
|
|
14482
|
+
const selection = (_a = this.getContext()) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
14483
|
+
if (selection) {
|
|
14484
|
+
selection.removeAllRanges();
|
|
14485
|
+
selection.addRange(range);
|
|
14486
|
+
}
|
|
14487
|
+
}
|
|
14488
|
+
}
|
|
14489
|
+
|
|
14490
|
+
/** Owns the native paste listener and synchronous clipboard payload capture. */
|
|
14491
|
+
class PasteEventInterceptor {
|
|
14492
|
+
constructor(selectionSnapshotService, onPasteCaptured) {
|
|
14493
|
+
this.selectionSnapshotService = selectionSnapshotService;
|
|
14494
|
+
this.onPasteCaptured = onPasteCaptured;
|
|
14495
|
+
this.editableEl = null;
|
|
14496
|
+
/**
|
|
14497
|
+
* @param {ClipboardEvent} event Native paste event to capture.
|
|
14498
|
+
*/
|
|
14499
|
+
this.handlePasteEvent = (event) => {
|
|
14500
|
+
const clipboardData = event.clipboardData;
|
|
14501
|
+
if (!clipboardData) {
|
|
14502
|
+
return;
|
|
14503
|
+
}
|
|
14504
|
+
const html = clipboardData.getData('text/html') || '';
|
|
14505
|
+
const text = clipboardData.getData('text/plain') || '';
|
|
14506
|
+
const rtf = clipboardData.getData('text/rtf') || '';
|
|
14507
|
+
if (!html && !text) {
|
|
14508
|
+
event.preventDefault();
|
|
14509
|
+
event.stopPropagation();
|
|
14510
|
+
return;
|
|
14511
|
+
}
|
|
14512
|
+
event.preventDefault();
|
|
14513
|
+
event.stopPropagation();
|
|
14514
|
+
const snapshot = this.selectionSnapshotService.capture();
|
|
14515
|
+
const files = clipboardData.files ? Array.from(clipboardData.files) : [];
|
|
14516
|
+
this.onPasteCaptured({ html, text, range: snapshot.range, selectedNodes: snapshot.selectedNodes, files, rtf }, event);
|
|
14517
|
+
};
|
|
14518
|
+
}
|
|
14519
|
+
/**
|
|
14520
|
+
* @param {HTMLDivElement | null} editableEl Editable content element to observe.
|
|
14521
|
+
*/
|
|
14522
|
+
attach(editableEl) {
|
|
14523
|
+
var _a;
|
|
14524
|
+
this.detach();
|
|
14525
|
+
this.editableEl = editableEl;
|
|
14526
|
+
(_a = this.editableEl) === null || _a === void 0 ? void 0 : _a.addEventListener('paste', this.handlePasteEvent);
|
|
14527
|
+
}
|
|
14528
|
+
/**
|
|
14529
|
+
* Detaches the current native paste listener.
|
|
14530
|
+
*/
|
|
14531
|
+
detach() {
|
|
14532
|
+
var _a;
|
|
14533
|
+
(_a = this.editableEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('paste', this.handlePasteEvent);
|
|
14534
|
+
this.editableEl = null;
|
|
14535
|
+
}
|
|
14536
|
+
}
|
|
14537
|
+
|
|
14538
|
+
const paste = {
|
|
14539
|
+
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>`,
|
|
14540
|
+
};
|
|
14541
|
+
|
|
14542
|
+
/**
|
|
14543
|
+
* Renders and manages the paste format chooser UI.
|
|
14544
|
+
*/
|
|
14545
|
+
class RTEPasteChooserUI {
|
|
14546
|
+
constructor(hostRoot, callbacks, options = {}) {
|
|
14547
|
+
this.hostRoot = hostRoot;
|
|
14548
|
+
this.callbacks = callbacks;
|
|
14549
|
+
this.options = options;
|
|
14550
|
+
this.chooserEl = null;
|
|
14551
|
+
this.dropdownEl = null;
|
|
14552
|
+
this.triggerButtonEl = null;
|
|
14553
|
+
}
|
|
14554
|
+
/**
|
|
14555
|
+
* Opens the paste-mode chooser at the given position.
|
|
14556
|
+
*
|
|
14557
|
+
* @param {PasteChooserPosition} position Viewport position for the chooser.
|
|
14558
|
+
*/
|
|
14559
|
+
open(position) {
|
|
14560
|
+
this.destroy();
|
|
14561
|
+
const doc = this.hostRoot.ownerDocument;
|
|
14562
|
+
const chooser = doc.createElement('div');
|
|
14563
|
+
chooser.setAttribute(RTEPasteChooserUI.CHOOSER_ATTR, 'true');
|
|
14564
|
+
chooser.style.position = 'fixed';
|
|
14565
|
+
chooser.style.zIndex = '1000';
|
|
14566
|
+
chooser.style.left = `${position.left}px`;
|
|
14567
|
+
chooser.style.top = `${position.top}px`;
|
|
14568
|
+
const dropdownEl = this.createPasteChooserDropdown(doc, position.placement);
|
|
14569
|
+
dropdownEl.placement = position.placement;
|
|
14570
|
+
chooser.append(dropdownEl);
|
|
14571
|
+
this.hostRoot.appendChild(chooser);
|
|
14572
|
+
this.chooserEl = chooser;
|
|
14573
|
+
this.dropdownEl = dropdownEl;
|
|
14574
|
+
dropdownEl.addEventListener('vegaShow', () => {
|
|
14575
|
+
if (this.triggerButtonEl) {
|
|
14576
|
+
this.triggerButtonEl.selected = true;
|
|
14577
|
+
}
|
|
14578
|
+
});
|
|
14579
|
+
dropdownEl.addEventListener('vegaHide', () => {
|
|
14580
|
+
if (this.triggerButtonEl) {
|
|
14581
|
+
this.triggerButtonEl.selected = false;
|
|
14582
|
+
}
|
|
14583
|
+
});
|
|
14584
|
+
}
|
|
14585
|
+
/**
|
|
14586
|
+
* Removes the chooser from the DOM.
|
|
14587
|
+
*/
|
|
14588
|
+
destroy() {
|
|
14589
|
+
var _a;
|
|
14590
|
+
if (this.dropdownEl && typeof this.dropdownEl.hide === 'function') {
|
|
14591
|
+
void this.dropdownEl.hide();
|
|
14592
|
+
}
|
|
14593
|
+
if ((_a = this.chooserEl) === null || _a === void 0 ? void 0 : _a.parentNode) {
|
|
14594
|
+
this.chooserEl.parentNode.removeChild(this.chooserEl);
|
|
14595
|
+
}
|
|
14596
|
+
if (this.triggerButtonEl) {
|
|
14597
|
+
this.triggerButtonEl.selected = false;
|
|
14598
|
+
}
|
|
14599
|
+
this.dropdownEl = null;
|
|
14600
|
+
this.chooserEl = null;
|
|
14601
|
+
this.triggerButtonEl = null;
|
|
14602
|
+
}
|
|
14603
|
+
/**
|
|
14604
|
+
* Determines whether the given event path targets the chooser.
|
|
14605
|
+
*
|
|
14606
|
+
* @param {EventTarget[]} eventPath Composed path of an event.
|
|
14607
|
+
* @returns {boolean} `true` when the path includes the chooser.
|
|
14608
|
+
*/
|
|
14609
|
+
includesEventPath(eventPath) {
|
|
14610
|
+
if (!this.chooserEl) {
|
|
14611
|
+
return false;
|
|
14612
|
+
}
|
|
14613
|
+
const isDropdownContentClick = eventPath.some((target) => {
|
|
14614
|
+
return 'tagName' in target && target.tagName === 'VEGA-DROPDOWN-CONTENT-BOX';
|
|
14615
|
+
});
|
|
14616
|
+
return eventPath.includes(this.chooserEl) || isDropdownContentClick;
|
|
14617
|
+
}
|
|
14618
|
+
/**
|
|
14619
|
+
* Builds the dropdown element with the rich text paste option.
|
|
14620
|
+
*
|
|
14621
|
+
* @param {Document} doc Document used to create elements.
|
|
14622
|
+
* @param {['bottom', 'top'] | ['top', 'bottom']} placement Preferred placement order.
|
|
14623
|
+
* @returns {HTMLElement} Configured dropdown element.
|
|
14624
|
+
*/
|
|
14625
|
+
createPasteChooserDropdown(doc, placement) {
|
|
14626
|
+
const dropdownEl = doc.createElement('vega-dropdown');
|
|
14627
|
+
dropdownEl.trigger = 'click';
|
|
14628
|
+
dropdownEl.selectType = 'single';
|
|
14629
|
+
dropdownEl.selectedSourceKey = 'rich';
|
|
14630
|
+
dropdownEl.maxWidth = 220;
|
|
14631
|
+
dropdownEl.alignment = 'start';
|
|
14632
|
+
dropdownEl.itemDisplayRule = 'ellipsis';
|
|
14633
|
+
dropdownEl.isScreenPosition = true;
|
|
14634
|
+
const triggerButton = doc.createElement('vega-rich-text-editor-toolbar-button');
|
|
14635
|
+
const arrowIcon = placement[0] === 'top' ? 'chevron-up' : 'chevron-down';
|
|
14636
|
+
triggerButton.setAttribute(RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR, 'true');
|
|
14637
|
+
triggerButton.setAttribute('aria-label', internalTranslationController.VegaInternalTranslation.t('Paste options'));
|
|
14638
|
+
triggerButton.setAttribute('arrow-icon', arrowIcon);
|
|
14639
|
+
triggerButton.icon = 'rte-paste';
|
|
14640
|
+
triggerButton.showArrowIcon = true;
|
|
14641
|
+
triggerButton.selected = false;
|
|
14642
|
+
this.triggerButtonEl = triggerButton;
|
|
14643
|
+
const tooltipEl = doc.createElement('vega-tooltip');
|
|
14644
|
+
tooltipEl.text = internalTranslationController.VegaInternalTranslation.t('Paste options');
|
|
14645
|
+
tooltipEl.placement = ['bottom', 'top'];
|
|
14646
|
+
tooltipEl.append(triggerButton);
|
|
14647
|
+
dropdownEl.append(tooltipEl);
|
|
14648
|
+
const itemsContainer = doc.createElement('div');
|
|
14649
|
+
itemsContainer.setAttribute('slot', 'items');
|
|
14650
|
+
const dropdownItems = [
|
|
14651
|
+
this.createDropdownItem(doc, RTEPasteMode.RICH, internalTranslationController.VegaInternalTranslation.t('Use rich text'), RTEPasteChooserUI.CHOOSER_RICH_ATTR),
|
|
14652
|
+
this.createDropdownItem(doc, RTEPasteMode.PLAIN, internalTranslationController.VegaInternalTranslation.t('Use plain text'), RTEPasteChooserUI.CHOOSER_PLAIN_ATTR),
|
|
14653
|
+
];
|
|
14654
|
+
if (this.options.showWordOption) {
|
|
14655
|
+
dropdownItems.push(this.createDropdownItem(doc, RTEPasteMode.WORD, internalTranslationController.VegaInternalTranslation.t('Use Word'), RTEPasteChooserUI.CHOOSER_WORD_ATTR));
|
|
14656
|
+
}
|
|
14657
|
+
itemsContainer.append(...dropdownItems);
|
|
14658
|
+
dropdownEl.append(itemsContainer);
|
|
14659
|
+
dropdownEl.addEventListener('vegaDropdownClick', (event) => {
|
|
14660
|
+
const mode = event.detail;
|
|
14661
|
+
if (mode === RTEPasteMode.RICH || mode === RTEPasteMode.PLAIN || mode === RTEPasteMode.WORD) {
|
|
14662
|
+
this.callbacks.onModeSelect(mode);
|
|
14663
|
+
}
|
|
14664
|
+
});
|
|
14665
|
+
return dropdownEl;
|
|
14666
|
+
}
|
|
14667
|
+
/**
|
|
14668
|
+
* Creates a single dropdown item element for a paste mode.
|
|
14669
|
+
*
|
|
14670
|
+
* @param {Document} doc Document used to create the element.
|
|
14671
|
+
* @param {RTEPasteMode} key Paste mode key for the item.
|
|
14672
|
+
* @param {string} label Display label for the item.
|
|
14673
|
+
* @param {string} dataAttrName Data attribute marker for the item.
|
|
14674
|
+
* @returns {HTMLVegaDropdownItemElement} Configured dropdown item element.
|
|
14675
|
+
*/
|
|
14676
|
+
createDropdownItem(doc, key, label, dataAttrName) {
|
|
14677
|
+
const itemEl = doc.createElement('vega-dropdown-item');
|
|
14678
|
+
itemEl.itemKey = key;
|
|
14679
|
+
itemEl.label = label;
|
|
14680
|
+
itemEl.setAttribute(dataAttrName, 'true');
|
|
14681
|
+
return itemEl;
|
|
14682
|
+
}
|
|
14683
|
+
}
|
|
14684
|
+
(() => {
|
|
14685
|
+
internalIconManager.VegaInternalIconManager.register({
|
|
14686
|
+
'rte-paste': paste,
|
|
14687
|
+
});
|
|
14688
|
+
})();
|
|
14689
|
+
RTEPasteChooserUI.CHOOSER_ATTR = 'data-rte-paste-chooser';
|
|
14690
|
+
RTEPasteChooserUI.CHOOSER_RICH_ATTR = 'data-rte-paste-type-rich';
|
|
14691
|
+
RTEPasteChooserUI.CHOOSER_PLAIN_ATTR = 'data-rte-paste-type-plain';
|
|
14692
|
+
RTEPasteChooserUI.CHOOSER_WORD_ATTR = 'data-rte-paste-type-word';
|
|
14693
|
+
RTEPasteChooserUI.CHOOSER_TRIGGER_ATTR = 'data-rte-paste-trigger';
|
|
14694
|
+
|
|
14695
|
+
/** Owns chooser rendering and all listener bookkeeping used to dismiss it. */
|
|
14696
|
+
class PasteChooserController {
|
|
14697
|
+
constructor(positioner, onModeSelect, onClearPayload) {
|
|
14698
|
+
this.positioner = positioner;
|
|
14699
|
+
this.onModeSelect = onModeSelect;
|
|
14700
|
+
this.onClearPayload = onClearPayload;
|
|
14701
|
+
this.chooserUI = null;
|
|
14702
|
+
this.listenerDocument = null;
|
|
14703
|
+
this.listenerWindow = null;
|
|
14704
|
+
this.contentHostEl = null;
|
|
14705
|
+
/**
|
|
14706
|
+
* @param {Event} event Pointer event captured on the document.
|
|
14707
|
+
*/
|
|
14708
|
+
this.handleOutsidePointerDown = (event) => {
|
|
14709
|
+
if (!this.chooserUI) {
|
|
14710
|
+
return;
|
|
14711
|
+
}
|
|
14712
|
+
const eventPath = typeof event.composedPath === 'function' ? event.composedPath() : [];
|
|
14713
|
+
if (!this.chooserUI.includesEventPath(eventPath)) {
|
|
14714
|
+
this.clear();
|
|
14715
|
+
}
|
|
14716
|
+
};
|
|
14717
|
+
/**
|
|
14718
|
+
* @param {KeyboardEvent} event Keyboard event captured on the document.
|
|
14719
|
+
*/
|
|
14720
|
+
this.handleOutsideKeyDown = (event) => {
|
|
14721
|
+
if (event.key === 'Escape') {
|
|
14722
|
+
this.clear();
|
|
14723
|
+
}
|
|
14724
|
+
};
|
|
14725
|
+
/**
|
|
14726
|
+
* Clears the chooser when a relevant scroll container scrolls.
|
|
14727
|
+
*
|
|
14728
|
+
* @returns {void}
|
|
14729
|
+
*/
|
|
14730
|
+
this.handleOutsideScroll = () => this.clear();
|
|
14731
|
+
}
|
|
14732
|
+
/**
|
|
14733
|
+
* @returns {RTEPasteChooserUI | null} Current chooser UI, or `null` when closed.
|
|
14734
|
+
*/
|
|
14735
|
+
get ui() {
|
|
14736
|
+
return this.chooserUI;
|
|
14737
|
+
}
|
|
14738
|
+
/**
|
|
14739
|
+
* @param {HTMLElement | null} hostEl Rich text editor host element.
|
|
14740
|
+
* @param {HTMLElement | null} contentHostEl Scrollable content host element.
|
|
14741
|
+
* @param {ClipboardEvent} pasteEvent Originating paste event used for positioning.
|
|
14742
|
+
* @param {boolean} showWordOption Whether to display the Word paste option.
|
|
14743
|
+
*/
|
|
14744
|
+
open(hostEl, contentHostEl, pasteEvent, showWordOption) {
|
|
14745
|
+
var _a, _b, _c;
|
|
14746
|
+
const hostRoot = (_a = hostEl === null || hostEl === void 0 ? void 0 : hostEl.shadowRoot) !== null && _a !== void 0 ? _a : null;
|
|
14747
|
+
if (!hostRoot || !hostEl) {
|
|
14748
|
+
return;
|
|
14749
|
+
}
|
|
14750
|
+
this.clear(false);
|
|
14751
|
+
const position = this.positioner.compute(pasteEvent);
|
|
14752
|
+
this.chooserUI = new RTEPasteChooserUI(hostRoot, { onModeSelect: this.onModeSelect }, { showWordOption });
|
|
14753
|
+
this.chooserUI.open(position);
|
|
14754
|
+
this.contentHostEl = contentHostEl;
|
|
14755
|
+
this.listenerDocument = hostEl.ownerDocument;
|
|
14756
|
+
this.listenerWindow = this.listenerDocument.defaultView;
|
|
14757
|
+
this.listenerDocument.addEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
14758
|
+
this.listenerDocument.addEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
14759
|
+
this.listenerDocument.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
14760
|
+
(_b = this.listenerWindow) === null || _b === void 0 ? void 0 : _b.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
14761
|
+
(_c = this.contentHostEl) === null || _c === void 0 ? void 0 : _c.addEventListener('scroll', this.handleOutsideScroll);
|
|
14762
|
+
}
|
|
14763
|
+
/**
|
|
14764
|
+
* @param {boolean} [clearPayload] Whether to also clear the pending paste payload.
|
|
14765
|
+
*/
|
|
14766
|
+
clear(clearPayload = true) {
|
|
14767
|
+
var _a, _b, _c;
|
|
14768
|
+
(_a = this.contentHostEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', this.handleOutsideScroll);
|
|
14769
|
+
this.contentHostEl = null;
|
|
14770
|
+
(_b = this.listenerWindow) === null || _b === void 0 ? void 0 : _b.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
14771
|
+
this.listenerWindow = null;
|
|
14772
|
+
if (this.listenerDocument) {
|
|
14773
|
+
this.listenerDocument.removeEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
14774
|
+
this.listenerDocument.removeEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
14775
|
+
this.listenerDocument.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
14776
|
+
this.listenerDocument = null;
|
|
14777
|
+
}
|
|
14778
|
+
(_c = this.chooserUI) === null || _c === void 0 ? void 0 : _c.destroy();
|
|
14779
|
+
this.chooserUI = null;
|
|
14780
|
+
if (clearPayload) {
|
|
14781
|
+
this.onClearPayload();
|
|
14523
14782
|
}
|
|
14524
14783
|
}
|
|
14525
14784
|
}
|
|
14526
|
-
/**
|
|
14527
|
-
* Pasted images awaiting upload, keyed by their {@link VegaRTEPasteImage.id}.
|
|
14528
|
-
*
|
|
14529
|
-
* Shared statically across instances so previews survive a paste-extension
|
|
14530
|
-
* re-instantiation: the consumer may resolve `replaceUrl` after the editor
|
|
14531
|
-
* has re-mounted and created a new extension/registry instance.
|
|
14532
|
-
*/
|
|
14533
|
-
PendingImageRegistry.pendingImages = new Map();
|
|
14534
14785
|
|
|
14535
14786
|
/**
|
|
14536
14787
|
* Vega Rich Text Editor paste extension.
|
|
@@ -14541,16 +14792,7 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14541
14792
|
super();
|
|
14542
14793
|
this.editableEl = null;
|
|
14543
14794
|
this.contentHostEl = null;
|
|
14544
|
-
this.chooserUI = null;
|
|
14545
14795
|
this.pendingPastePayload = null;
|
|
14546
|
-
this.listenerDocument = null;
|
|
14547
|
-
this.listenerWindow = null;
|
|
14548
|
-
this.options = {};
|
|
14549
|
-
this.strategySelector = new PasteStrategySelector();
|
|
14550
|
-
this.clipboardFileContent = null;
|
|
14551
|
-
this.imageParser = new PasteImageParser();
|
|
14552
|
-
/** Owns pending pasted-image previews awaiting upload and their URL replacement. */
|
|
14553
|
-
this.pendingImageRegistry = new PendingImageRegistry();
|
|
14554
14796
|
/**
|
|
14555
14797
|
* Handles a native paste event by capturing the clipboard payload and
|
|
14556
14798
|
* rendering the paste-mode chooser.
|
|
@@ -14558,33 +14800,7 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14558
14800
|
* @param {ClipboardEvent} event Native clipboard paste event.
|
|
14559
14801
|
*/
|
|
14560
14802
|
this.handlePasteEvent = (event) => {
|
|
14561
|
-
|
|
14562
|
-
const clipboardData = event.clipboardData;
|
|
14563
|
-
if (!clipboardData) {
|
|
14564
|
-
return;
|
|
14565
|
-
}
|
|
14566
|
-
// HTML is sanitized via DOMParser and ElementToDtoStrategyProcessor pipeline
|
|
14567
|
-
const html = clipboardData.getData('text/html') || '';
|
|
14568
|
-
const text = clipboardData.getData('text/plain') || '';
|
|
14569
|
-
// RTF must be read synchronously here: the paste event's DataTransfer is only
|
|
14570
|
-
// readable during event dispatch, so reading it later (after the chooser) returns ''.
|
|
14571
|
-
const rtf = clipboardData.getData('text/rtf') || '';
|
|
14572
|
-
if (!html && !text) {
|
|
14573
|
-
// Empty clipboard paste should not mutate editor content.
|
|
14574
|
-
event.preventDefault();
|
|
14575
|
-
event.stopPropagation();
|
|
14576
|
-
return;
|
|
14577
|
-
}
|
|
14578
|
-
event.preventDefault();
|
|
14579
|
-
event.stopPropagation();
|
|
14580
|
-
const range = this.cloneCurrentSelectionRange();
|
|
14581
|
-
const selectedNodes = ((_b = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelectedNodes) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
|
|
14582
|
-
this.pendingPastePayload = { html, text, range, selectedNodes: [...selectedNodes] };
|
|
14583
|
-
this.clipboardFileContent = {
|
|
14584
|
-
files: clipboardData.files ? Array.from(clipboardData.files) : [],
|
|
14585
|
-
rtf,
|
|
14586
|
-
};
|
|
14587
|
-
this.renderPasteChooser(event);
|
|
14803
|
+
this.pasteEventInterceptor.handlePasteEvent(event);
|
|
14588
14804
|
};
|
|
14589
14805
|
/**
|
|
14590
14806
|
* Dismisses the chooser when a pointer interaction occurs outside of it.
|
|
@@ -14592,14 +14808,7 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14592
14808
|
* @param {Event} event Pointer event captured on the document.
|
|
14593
14809
|
*/
|
|
14594
14810
|
this.handleOutsidePointerDown = (event) => {
|
|
14595
|
-
|
|
14596
|
-
return;
|
|
14597
|
-
}
|
|
14598
|
-
const eventPath = typeof event.composedPath === 'function' ? event.composedPath() : [];
|
|
14599
|
-
if (this.chooserUI.includesEventPath(eventPath)) {
|
|
14600
|
-
return;
|
|
14601
|
-
}
|
|
14602
|
-
this.clearPasteChooser();
|
|
14811
|
+
this.pasteChooserController.handleOutsidePointerDown(event);
|
|
14603
14812
|
};
|
|
14604
14813
|
/**
|
|
14605
14814
|
* Dismisses the chooser when the Escape key is pressed.
|
|
@@ -14607,17 +14816,30 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14607
14816
|
* @param {KeyboardEvent} event Keyboard event captured on the document.
|
|
14608
14817
|
*/
|
|
14609
14818
|
this.handleOutsideKeyDown = (event) => {
|
|
14610
|
-
|
|
14611
|
-
this.clearPasteChooser();
|
|
14612
|
-
}
|
|
14819
|
+
this.pasteChooserController.handleOutsideKeyDown(event);
|
|
14613
14820
|
};
|
|
14614
14821
|
/**
|
|
14615
14822
|
* Dismisses the chooser when any relevant scroll container scrolls.
|
|
14616
14823
|
*/
|
|
14617
14824
|
this.handleOutsideScroll = () => {
|
|
14618
|
-
this.
|
|
14825
|
+
this.pasteChooserController.handleOutsideScroll();
|
|
14619
14826
|
};
|
|
14620
14827
|
this.options = options;
|
|
14828
|
+
this.strategySelector = new PasteStrategySelector();
|
|
14829
|
+
this.imageParser = new PasteImageParser();
|
|
14830
|
+
this.pendingImageRegistry = new PendingImageRegistry();
|
|
14831
|
+
this.chooserPositioner = new ChooserPositioner(() => this.hostEl, () => { var _a, _b; return (_b = (_a = this.pendingPastePayload) === null || _a === void 0 ? void 0 : _a.range) !== null && _b !== void 0 ? _b : this.cloneCurrentSelectionRange(); });
|
|
14832
|
+
this.processingPipeline = new PasteProcessingPipeline(this.strategySelector, new ImageExtractor(this.imageParser), this.pendingImageRegistry);
|
|
14833
|
+
this.dataTransferBuilder = new PasteDataTransferBuilder();
|
|
14834
|
+
this.pasteDispatcher = new PasteDispatcher();
|
|
14835
|
+
this.selectionSnapshotService = new SelectionSnapshotService(() => this.extensionContext);
|
|
14836
|
+
this.pasteEventInterceptor = new PasteEventInterceptor(this.selectionSnapshotService, (payload, event) => {
|
|
14837
|
+
this.pendingPastePayload = payload;
|
|
14838
|
+
this.renderPasteChooser(event);
|
|
14839
|
+
});
|
|
14840
|
+
this.pasteChooserController = new PasteChooserController(this.chooserPositioner, (mode) => this.applyPasteMode(mode), () => {
|
|
14841
|
+
this.pendingPastePayload = null;
|
|
14842
|
+
});
|
|
14621
14843
|
}
|
|
14622
14844
|
/** @inheritDoc */
|
|
14623
14845
|
initialExtensionAfterLoad(context) {
|
|
@@ -14631,6 +14853,10 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14631
14853
|
this.clearPasteChooser();
|
|
14632
14854
|
this.pendingImageRegistry.discardUnsentPreviews();
|
|
14633
14855
|
}
|
|
14856
|
+
/** @returns {RTEPasteChooserUI | null} Currently open chooser UI, or `null` when closed. */
|
|
14857
|
+
get chooserUI() {
|
|
14858
|
+
return this.pasteChooserController.ui;
|
|
14859
|
+
}
|
|
14634
14860
|
/**
|
|
14635
14861
|
* Attaches the paste listener to the editable element.
|
|
14636
14862
|
*/
|
|
@@ -14638,17 +14864,13 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14638
14864
|
const { editableEl, contentHostEl, } = this.getEditorElements();
|
|
14639
14865
|
this.editableEl = editableEl;
|
|
14640
14866
|
this.contentHostEl = contentHostEl;
|
|
14641
|
-
|
|
14642
|
-
this.editableEl.addEventListener('paste', this.handlePasteEvent);
|
|
14643
|
-
}
|
|
14867
|
+
this.pasteEventInterceptor.attach(this.editableEl);
|
|
14644
14868
|
}
|
|
14645
14869
|
/**
|
|
14646
14870
|
* Detaches the paste listener from the editable element.
|
|
14647
14871
|
*/
|
|
14648
14872
|
detachPasteListener() {
|
|
14649
|
-
|
|
14650
|
-
this.editableEl.removeEventListener('paste', this.handlePasteEvent);
|
|
14651
|
-
}
|
|
14873
|
+
this.pasteEventInterceptor.detach();
|
|
14652
14874
|
this.editableEl = null;
|
|
14653
14875
|
this.contentHostEl = null;
|
|
14654
14876
|
}
|
|
@@ -14679,12 +14901,7 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14679
14901
|
* @returns {Range | null} Cloned range or `null` when there is no selection.
|
|
14680
14902
|
*/
|
|
14681
14903
|
cloneCurrentSelectionRange() {
|
|
14682
|
-
|
|
14683
|
-
const selection = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
14684
|
-
if (selection && selection.rangeCount > 0) {
|
|
14685
|
-
return selection.getRangeAt(0).cloneRange();
|
|
14686
|
-
}
|
|
14687
|
-
return null;
|
|
14904
|
+
return this.selectionSnapshotService.capture().range;
|
|
14688
14905
|
}
|
|
14689
14906
|
/**
|
|
14690
14907
|
* Renders the paste-mode chooser and wires up dismissal listeners.
|
|
@@ -14692,145 +14909,8 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14692
14909
|
* @param {ClipboardEvent} pasteEvent Originating paste event used for positioning.
|
|
14693
14910
|
*/
|
|
14694
14911
|
renderPasteChooser(pasteEvent) {
|
|
14695
|
-
var _a
|
|
14696
|
-
|
|
14697
|
-
if (!hostRoot) {
|
|
14698
|
-
return;
|
|
14699
|
-
}
|
|
14700
|
-
this.clearPasteChooser(false);
|
|
14701
|
-
const position = this.computeChooserPosition(pasteEvent);
|
|
14702
|
-
this.chooserUI = new RTEPasteChooserUI(hostRoot, {
|
|
14703
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
14704
|
-
onModeSelect: (mode) => {
|
|
14705
|
-
this.applyPasteMode(mode);
|
|
14706
|
-
},
|
|
14707
|
-
}, {
|
|
14708
|
-
showWordOption: ((_c = this.options) === null || _c === void 0 ? void 0 : _c.enableWordPaste) === true,
|
|
14709
|
-
});
|
|
14710
|
-
this.chooserUI.open(position);
|
|
14711
|
-
this.listenerDocument = this.hostEl.ownerDocument;
|
|
14712
|
-
this.listenerWindow = this.listenerDocument.defaultView;
|
|
14713
|
-
this.listenerDocument.addEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
14714
|
-
this.listenerDocument.addEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
14715
|
-
this.listenerDocument.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
14716
|
-
if (this.listenerWindow) {
|
|
14717
|
-
this.listenerWindow.addEventListener('scroll', this.handleOutsideScroll, true);
|
|
14718
|
-
}
|
|
14719
|
-
if (this.contentHostEl) {
|
|
14720
|
-
this.contentHostEl.addEventListener('scroll', this.handleOutsideScroll);
|
|
14721
|
-
}
|
|
14722
|
-
}
|
|
14723
|
-
/**
|
|
14724
|
-
* Computes the on-screen position for the chooser based on pointer or caret.
|
|
14725
|
-
*
|
|
14726
|
-
* @param {ClipboardEvent} event Originating paste event.
|
|
14727
|
-
* @returns {ChooserPosition} Position in viewport coordinates.
|
|
14728
|
-
*/
|
|
14729
|
-
computeChooserPosition(event) {
|
|
14730
|
-
var _a, _b, _c;
|
|
14731
|
-
const hostRect = this.hostEl.getBoundingClientRect();
|
|
14732
|
-
const viewportHeight = (_b = (_a = this.hostEl.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.innerHeight) !== null && _b !== void 0 ? _b : window.innerHeight;
|
|
14733
|
-
const pointerEvent = event;
|
|
14734
|
-
const hasPointer = typeof pointerEvent.clientX === 'number' &&
|
|
14735
|
-
pointerEvent.clientX > 0 &&
|
|
14736
|
-
typeof pointerEvent.clientY === 'number' &&
|
|
14737
|
-
pointerEvent.clientY > 0;
|
|
14738
|
-
// For keyboard-initiated paste (Command/Control+V) clientX/Y are 0, so anchor
|
|
14739
|
-
// the chooser to the current caret instead of a fixed host-relative spot.
|
|
14740
|
-
const caretRect = hasPointer ? null : this.getCaretRect();
|
|
14741
|
-
const CHOOSER_GAP_PX = 8;
|
|
14742
|
-
const CHOOSER_MIN_MARGIN_PX = 12;
|
|
14743
|
-
const CHOOSER_WIDTH_PX = 220;
|
|
14744
|
-
const CHOOSER_FALLBACK_OFFSET_PX = 40;
|
|
14745
|
-
const CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX = 88;
|
|
14746
|
-
const baseLeft = hasPointer
|
|
14747
|
-
? pointerEvent.clientX
|
|
14748
|
-
: (_c = caretRect === null || caretRect === void 0 ? void 0 : caretRect.left) !== null && _c !== void 0 ? _c : hostRect.left + CHOOSER_MIN_MARGIN_PX;
|
|
14749
|
-
const baseTop = hasPointer
|
|
14750
|
-
? pointerEvent.clientY
|
|
14751
|
-
: caretRect
|
|
14752
|
-
? caretRect.bottom
|
|
14753
|
-
: hostRect.top + CHOOSER_FALLBACK_OFFSET_PX;
|
|
14754
|
-
const maxLeft = Math.max(hostRect.left + CHOOSER_MIN_MARGIN_PX, hostRect.right - CHOOSER_WIDTH_PX);
|
|
14755
|
-
const left = Math.min(Math.max(baseLeft, hostRect.left + CHOOSER_MIN_MARGIN_PX), maxLeft);
|
|
14756
|
-
const top = Math.max(baseTop + CHOOSER_GAP_PX, hostRect.top + CHOOSER_MIN_MARGIN_PX);
|
|
14757
|
-
const availableBelow = viewportHeight - top - CHOOSER_MIN_MARGIN_PX;
|
|
14758
|
-
const availableAbove = top - CHOOSER_MIN_MARGIN_PX;
|
|
14759
|
-
const placement = availableBelow >= CHOOSER_MIN_VISIBLE_BELOW_SPACE_PX || availableBelow >= availableAbove
|
|
14760
|
-
? ['bottom', 'top']
|
|
14761
|
-
: ['top', 'bottom'];
|
|
14762
|
-
return { left, top, placement };
|
|
14763
|
-
}
|
|
14764
|
-
/**
|
|
14765
|
-
* Resolves the bounding rect of the pending caret position.
|
|
14766
|
-
*
|
|
14767
|
-
* @returns {DOMRect | null} Caret rect or `null` when it cannot be determined.
|
|
14768
|
-
*/
|
|
14769
|
-
getCaretRect() {
|
|
14770
|
-
var _a, _b;
|
|
14771
|
-
const range = (_b = (_a = this.pendingPastePayload) === null || _a === void 0 ? void 0 : _a.range) !== null && _b !== void 0 ? _b : this.cloneCurrentSelectionRange();
|
|
14772
|
-
if (!range) {
|
|
14773
|
-
return null;
|
|
14774
|
-
}
|
|
14775
|
-
const rect = range.getBoundingClientRect();
|
|
14776
|
-
if (this.isUnavailableRect(rect)) {
|
|
14777
|
-
// eslint-disable-next-line spellcheck/spell-checker
|
|
14778
|
-
const domRectList = range.getClientRects();
|
|
14779
|
-
if (domRectList.length > 0) {
|
|
14780
|
-
return domRectList[0];
|
|
14781
|
-
}
|
|
14782
|
-
return this.getRangeContainerRect(range);
|
|
14783
|
-
}
|
|
14784
|
-
return rect;
|
|
14785
|
-
}
|
|
14786
|
-
/**
|
|
14787
|
-
* Returns whether the browser could not resolve a meaningful caret rectangle.
|
|
14788
|
-
*
|
|
14789
|
-
* @param {DOMRect} rect Candidate caret rect.
|
|
14790
|
-
* @returns {boolean} Whether the rect is unusable.
|
|
14791
|
-
*/
|
|
14792
|
-
isUnavailableRect(rect) {
|
|
14793
|
-
return rect.width === 0 && rect.height === 0 && rect.left === 0 && rect.top === 0;
|
|
14794
|
-
}
|
|
14795
|
-
/**
|
|
14796
|
-
* Falls back to the range container or neighbor child node bounds.
|
|
14797
|
-
*
|
|
14798
|
-
* @param {Range} range Caret/selection range.
|
|
14799
|
-
* @returns {DOMRect | null} Best-effort caret anchor rectangle.
|
|
14800
|
-
*/
|
|
14801
|
-
getRangeContainerRect(range) {
|
|
14802
|
-
var _a, _b, _c, _d, _e, _f;
|
|
14803
|
-
const containerNode = (_a = range.startContainer) !== null && _a !== void 0 ? _a : null;
|
|
14804
|
-
if (!containerNode) {
|
|
14805
|
-
return null;
|
|
14806
|
-
}
|
|
14807
|
-
if (containerNode.nodeType === Node.ELEMENT_NODE) {
|
|
14808
|
-
const containerElement = containerNode;
|
|
14809
|
-
const previousNode = (_b = containerElement.childNodes[range.startOffset - 1]) !== null && _b !== void 0 ? _b : null;
|
|
14810
|
-
const currentNode = (_c = containerElement.childNodes[range.startOffset]) !== null && _c !== void 0 ? _c : null;
|
|
14811
|
-
return ((_e = (_d = this.getNodeRect(previousNode)) !== null && _d !== void 0 ? _d : this.getNodeRect(currentNode)) !== null && _e !== void 0 ? _e : this.getNodeRect(containerElement));
|
|
14812
|
-
}
|
|
14813
|
-
return (_f = this.getNodeRect(containerNode)) !== null && _f !== void 0 ? _f : this.getNodeRect(containerNode.parentNode);
|
|
14814
|
-
}
|
|
14815
|
-
/**
|
|
14816
|
-
* Returns an element-backed rectangle from a DOM node.
|
|
14817
|
-
*
|
|
14818
|
-
* @param {Node | null} node Candidate node.
|
|
14819
|
-
* @returns {DOMRect | null} Node rectangle when resolvable.
|
|
14820
|
-
*/
|
|
14821
|
-
getNodeRect(node) {
|
|
14822
|
-
var _a, _b;
|
|
14823
|
-
if (!node) {
|
|
14824
|
-
return null;
|
|
14825
|
-
}
|
|
14826
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
14827
|
-
return (_b = (_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : null;
|
|
14828
|
-
}
|
|
14829
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
14830
|
-
const rect = node.getBoundingClientRect();
|
|
14831
|
-
return this.isUnavailableRect(rect) ? null : rect;
|
|
14832
|
-
}
|
|
14833
|
-
return null;
|
|
14912
|
+
var _a;
|
|
14913
|
+
this.pasteChooserController.open(this.hostEl, this.contentHostEl, pasteEvent, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.enableWordPaste) === true);
|
|
14834
14914
|
}
|
|
14835
14915
|
/**
|
|
14836
14916
|
* Applies the chosen paste mode by dispatching a synthetic paste input event.
|
|
@@ -14852,36 +14932,13 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14852
14932
|
return;
|
|
14853
14933
|
}
|
|
14854
14934
|
editableEl.focus();
|
|
14855
|
-
this.
|
|
14856
|
-
this.
|
|
14857
|
-
const
|
|
14858
|
-
|
|
14859
|
-
: this.strategySelector.selectStrategyByType(mode);
|
|
14860
|
-
let processedHtml = strategy.process(this.pendingPastePayload.html);
|
|
14861
|
-
// If the strategy supports image processing and there is clipboard file content, parse local images.
|
|
14862
|
-
if (strategy.supportsImageProcessing && this.clipboardFileContent) {
|
|
14863
|
-
processedHtml = this.parseLocalImages(processedHtml, this.clipboardFileContent);
|
|
14864
|
-
}
|
|
14865
|
-
this.clipboardFileContent = null;
|
|
14866
|
-
const dataTransfer = this.createDataTransfer(processedHtml, this.pendingPastePayload.text, strategy.type);
|
|
14867
|
-
this.dispatchBeforeInputPaste(editableEl, dataTransfer);
|
|
14935
|
+
this.selectionSnapshotService.restore(this.pendingPastePayload);
|
|
14936
|
+
const output = this.processingPipeline.process(this.pendingPastePayload, mode);
|
|
14937
|
+
const dataTransfer = this.dataTransferBuilder.build(output);
|
|
14938
|
+
this.pasteDispatcher.dispatch(editableEl, dataTransfer);
|
|
14868
14939
|
this.clearPasteChooser();
|
|
14869
14940
|
this.emitLocalImageInsertedEvent();
|
|
14870
14941
|
}
|
|
14871
|
-
/**
|
|
14872
|
-
* Parses local images from the HTML and emits events for further processing.
|
|
14873
|
-
*
|
|
14874
|
-
* @param {string} html HTML content to parse.
|
|
14875
|
-
* @param {ClipboardFileContent} clipboardFileContent Clipboard file content for image extraction.
|
|
14876
|
-
* @returns {string} Processed HTML with local image references replaced.
|
|
14877
|
-
*/
|
|
14878
|
-
parseLocalImages(html, clipboardFileContent) {
|
|
14879
|
-
const { html: result, previews } = this.imageParser.parseLocalImages(html, clipboardFileContent);
|
|
14880
|
-
if (previews.length > 0) {
|
|
14881
|
-
this.pendingImageRegistry.register(previews);
|
|
14882
|
-
}
|
|
14883
|
-
return result;
|
|
14884
|
-
}
|
|
14885
14942
|
/**
|
|
14886
14943
|
* Emits the `imageInsertedCallback` for any pending previews, allowing the
|
|
14887
14944
|
* consumer to upload them and resolve their URLs.
|
|
@@ -14891,141 +14948,17 @@ class VegaRTEPasteExtension extends linkExtension.VegaRTEExtension {
|
|
|
14891
14948
|
this.pendingImageRegistry.notifyInserted(this.options.imageInsertedCallback, () => { var _a; return (_a = this.editableEl) !== null && _a !== void 0 ? _a : this.getEditableElement(); }, (imageElement) => this.getDTOEntityByDom(imageElement));
|
|
14892
14949
|
}
|
|
14893
14950
|
}
|
|
14894
|
-
/**
|
|
14895
|
-
* Restores SelectionController state from the captured selection so synthetic
|
|
14896
|
-
* beforeinput paste can replace the selected content instead of appending.
|
|
14897
|
-
*
|
|
14898
|
-
* @param {PendingPastePayload} payload Pending paste payload.
|
|
14899
|
-
*/
|
|
14900
|
-
restoreSelectionControllerState(payload) {
|
|
14901
|
-
if (!payload.range || !this.extensionContext) {
|
|
14902
|
-
return;
|
|
14903
|
-
}
|
|
14904
|
-
const rangeOptions = {
|
|
14905
|
-
startNode: payload.range.startContainer,
|
|
14906
|
-
endNode: payload.range.endContainer,
|
|
14907
|
-
startOffset: payload.range.startOffset,
|
|
14908
|
-
endOffset: payload.range.endOffset,
|
|
14909
|
-
};
|
|
14910
|
-
this.extensionContext.setSelectedNodes(payload.selectedNodes || [], rangeOptions);
|
|
14911
|
-
}
|
|
14912
|
-
/**
|
|
14913
|
-
* Restores a previously cloned selection range.
|
|
14914
|
-
*
|
|
14915
|
-
* @param {Range | null} range Range to restore.
|
|
14916
|
-
*/
|
|
14917
|
-
restoreSelectionRange(range) {
|
|
14918
|
-
var _a;
|
|
14919
|
-
if (!range) {
|
|
14920
|
-
return;
|
|
14921
|
-
}
|
|
14922
|
-
const selection = (_a = this.extensionContext) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
14923
|
-
if (selection) {
|
|
14924
|
-
selection.removeAllRanges();
|
|
14925
|
-
selection.addRange(range);
|
|
14926
|
-
}
|
|
14927
|
-
}
|
|
14928
|
-
/**
|
|
14929
|
-
* Dispatches a synthetic `beforeinput` paste event into the editor pipeline.
|
|
14930
|
-
*
|
|
14931
|
-
* @param {HTMLDivElement} editableEl Editable content element.
|
|
14932
|
-
* @param {DataTransfer} dataTransfer Clipboard payload for the paste.
|
|
14933
|
-
*/
|
|
14934
|
-
dispatchBeforeInputPaste(editableEl, dataTransfer) {
|
|
14935
|
-
// This synthetic beforeinput event intentionally reuses the existing
|
|
14936
|
-
// UserInputController -> insertFromPaste -> InsertPasteHandler pipeline.
|
|
14937
|
-
const beforeInputEvent = new CustomEvent('beforeinput', {
|
|
14938
|
-
bubbles: true,
|
|
14939
|
-
cancelable: true,
|
|
14940
|
-
});
|
|
14941
|
-
try {
|
|
14942
|
-
Object.defineProperties(beforeInputEvent, {
|
|
14943
|
-
inputType: {
|
|
14944
|
-
value: 'insertFromPaste',
|
|
14945
|
-
configurable: true,
|
|
14946
|
-
},
|
|
14947
|
-
dataTransfer: {
|
|
14948
|
-
value: dataTransfer,
|
|
14949
|
-
configurable: true,
|
|
14950
|
-
},
|
|
14951
|
-
});
|
|
14952
|
-
}
|
|
14953
|
-
catch (_a) {
|
|
14954
|
-
Object.assign(beforeInputEvent, {
|
|
14955
|
-
inputType: 'insertFromPaste',
|
|
14956
|
-
dataTransfer,
|
|
14957
|
-
});
|
|
14958
|
-
}
|
|
14959
|
-
editableEl.dispatchEvent(beforeInputEvent);
|
|
14960
|
-
}
|
|
14961
|
-
/**
|
|
14962
|
-
* Builds a `DataTransfer` payload carrying the paste content and mode marker.
|
|
14963
|
-
*
|
|
14964
|
-
* @param {string} html HTML clipboard content.
|
|
14965
|
-
* @param {string} text Plain text clipboard content.
|
|
14966
|
-
* @param {RTEPasteMode} [mode] Selected paste mode marker.
|
|
14967
|
-
* @returns {DataTransfer} Populated data transfer payload.
|
|
14968
|
-
*/
|
|
14969
|
-
createDataTransfer(html, text, mode) {
|
|
14970
|
-
if (typeof DataTransfer !== 'undefined') {
|
|
14971
|
-
const dataTransfer = new DataTransfer();
|
|
14972
|
-
if (html) {
|
|
14973
|
-
dataTransfer.setData('text/html', html);
|
|
14974
|
-
}
|
|
14975
|
-
if (text) {
|
|
14976
|
-
dataTransfer.setData('text/plain', text);
|
|
14977
|
-
}
|
|
14978
|
-
if (mode) {
|
|
14979
|
-
dataTransfer.setData(codeBlock.RTE_PASTE_MODE_DATA_TYPE, mode);
|
|
14980
|
-
}
|
|
14981
|
-
return dataTransfer;
|
|
14982
|
-
}
|
|
14983
|
-
return {
|
|
14984
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
14985
|
-
getData: (type) => {
|
|
14986
|
-
if (type === 'text/html') {
|
|
14987
|
-
return html;
|
|
14988
|
-
}
|
|
14989
|
-
if (type === 'text/plain') {
|
|
14990
|
-
return text;
|
|
14991
|
-
}
|
|
14992
|
-
if (type === codeBlock.RTE_PASTE_MODE_DATA_TYPE) {
|
|
14993
|
-
return mode !== null && mode !== void 0 ? mode : '';
|
|
14994
|
-
}
|
|
14995
|
-
return '';
|
|
14996
|
-
},
|
|
14997
|
-
};
|
|
14998
|
-
}
|
|
14999
14951
|
/**
|
|
15000
14952
|
* Tears down the chooser UI and removes dismissal listeners.
|
|
15001
14953
|
*
|
|
15002
14954
|
* @param {boolean} [clearPayload] Whether to also clear the pending payload.
|
|
15003
14955
|
*/
|
|
15004
14956
|
clearPasteChooser(clearPayload = true) {
|
|
15005
|
-
|
|
15006
|
-
this.contentHostEl.removeEventListener('scroll', this.handleOutsideScroll);
|
|
15007
|
-
}
|
|
15008
|
-
if (this.listenerWindow) {
|
|
15009
|
-
this.listenerWindow.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
15010
|
-
this.listenerWindow = null;
|
|
15011
|
-
}
|
|
15012
|
-
if (this.listenerDocument) {
|
|
15013
|
-
this.listenerDocument.removeEventListener('mousedown', this.handleOutsidePointerDown, true);
|
|
15014
|
-
this.listenerDocument.removeEventListener('keydown', this.handleOutsideKeyDown, true);
|
|
15015
|
-
this.listenerDocument.removeEventListener('scroll', this.handleOutsideScroll, true);
|
|
15016
|
-
this.listenerDocument = null;
|
|
15017
|
-
}
|
|
15018
|
-
if (this.chooserUI) {
|
|
15019
|
-
this.chooserUI.destroy();
|
|
15020
|
-
}
|
|
15021
|
-
this.chooserUI = null;
|
|
15022
|
-
if (clearPayload) {
|
|
15023
|
-
this.pendingPastePayload = null;
|
|
15024
|
-
}
|
|
14957
|
+
this.pasteChooserController.clear(clearPayload);
|
|
15025
14958
|
}
|
|
15026
14959
|
}
|
|
15027
14960
|
(() => {
|
|
15028
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageNode.
|
|
14961
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(contentState.RTEImageNode.typeName, REPLACE_IMAGE_SRC, new ImageReplaceSrcStrategy());
|
|
15029
14962
|
})();
|
|
15030
14963
|
|
|
15031
14964
|
/**
|
|
@@ -15053,7 +14986,7 @@ class CopySelectedContentAction extends codeBlock.ModifyContentAction {
|
|
|
15053
14986
|
* Toolbar button renderer for the Copy extension.
|
|
15054
14987
|
* Renders a toolbar button that copies the currently selected editor text to the clipboard.
|
|
15055
14988
|
*/
|
|
15056
|
-
class RTECopyToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
14989
|
+
class RTECopyToolbarButtonRenderer extends imageExtension.VegaRTEToolbarButtonRenderer {
|
|
15057
14990
|
/**
|
|
15058
14991
|
* Renders the copy toolbar button.
|
|
15059
14992
|
*
|
|
@@ -15338,7 +15271,7 @@ class VegaRTECopyExtension extends linkExtension.VegaRTEExtension {
|
|
|
15338
15271
|
}
|
|
15339
15272
|
}
|
|
15340
15273
|
(() => {
|
|
15341
|
-
codeBlock.ActionHandleStrategyRegistry.register('COPY_SELECTED_CONTENT_ACTION', contentState.VegaRTEContent.
|
|
15274
|
+
codeBlock.ActionHandleStrategyRegistry.register('COPY_SELECTED_CONTENT_ACTION', contentState.VegaRTEContent.typeName, new CopySelectedContentStrategy());
|
|
15342
15275
|
})();
|
|
15343
15276
|
// The unique key for the copy toolbar button, used for registration and retrieval.
|
|
15344
15277
|
VegaRTECopyExtension.TOOLBAR_BUTTON_KEY = 'copy';
|
|
@@ -15423,7 +15356,7 @@ VegaRTECutExtension.TOOLBAR_BUTTON_KEY = 'cut';
|
|
|
15423
15356
|
* Vetoes a commit that would push the character count past the hard limit, while
|
|
15424
15357
|
* still allowing deletions and formatting that keep or reduce the count.
|
|
15425
15358
|
*/
|
|
15426
|
-
class PreventHardLimitExceedInterceptor extends ActionHandlerInterceptor {
|
|
15359
|
+
class PreventHardLimitExceedInterceptor extends imageExtension.ActionHandlerInterceptor {
|
|
15427
15360
|
/**
|
|
15428
15361
|
* Intercept when the candidate exceeds the configured maximum. Hard-limit
|
|
15429
15362
|
* commits are vetoed only when they increase the count.
|
|
@@ -15540,23 +15473,9 @@ class VegaRTEWordCountExtension extends linkExtension.VegaRTEExtension {
|
|
|
15540
15473
|
}
|
|
15541
15474
|
(() => {
|
|
15542
15475
|
// Gate over-limit commits through the shared action-interceptor pipeline.
|
|
15543
|
-
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(contentState.VegaRTEContent.
|
|
15476
|
+
linkExtension.VegaRTEExtension.registerActionHandlerInterceptor(contentState.VegaRTEContent.typeName, contentState.COMMIT_VALUE, new PreventHardLimitExceedInterceptor());
|
|
15544
15477
|
})();
|
|
15545
15478
|
|
|
15546
|
-
/**
|
|
15547
|
-
* Insert a new children to the nearest position of the parent container
|
|
15548
|
-
*
|
|
15549
|
-
* @example parent.apply(new InsertNodeToNearestRoot(rteRange, nodeToBeInserted))
|
|
15550
|
-
*/
|
|
15551
|
-
class InsertNodeToNearestRootAction extends codeBlock.ModifyContentAction {
|
|
15552
|
-
constructor(rteRange, nodeToBeInserted) {
|
|
15553
|
-
super();
|
|
15554
|
-
this.type = codeBlock.ModifyContentActionType.INSERT_NODE_TO_NEAREST_ROOT;
|
|
15555
|
-
this.rteRange = rteRange;
|
|
15556
|
-
this.nodeToBeInserted = nodeToBeInserted;
|
|
15557
|
-
}
|
|
15558
|
-
}
|
|
15559
|
-
|
|
15560
15479
|
/**
|
|
15561
15480
|
* Strategy to handle the insertion of a token node into the nearest root block.
|
|
15562
15481
|
*/
|
|
@@ -15571,7 +15490,7 @@ class InsertTokenNodeStrategy extends codeBlock.ActionHandleStrategy {
|
|
|
15571
15490
|
const { key, label, customAttrs = { wrapped: 'true' } } = token;
|
|
15572
15491
|
const tokenNode = new RTETokenNode(misc.generateUUID(), key, label, block);
|
|
15573
15492
|
tokenNode.annotationMap.set('CUSTOM_ATTRIBUTE', new codeBlock.CustomAttributeAnnotation(customAttrs));
|
|
15574
|
-
block.apply(new InsertNodeToNearestRootAction(rteRange, tokenNode));
|
|
15493
|
+
block.apply(new imageExtension.InsertNodeToNearestRootAction(rteRange, tokenNode));
|
|
15575
15494
|
action.actionHandleResult = true;
|
|
15576
15495
|
}
|
|
15577
15496
|
}
|
|
@@ -15668,14 +15587,12 @@ class VegaRTETokenExtension extends linkExtension.VegaRTEExtension {
|
|
|
15668
15587
|
}
|
|
15669
15588
|
(() => {
|
|
15670
15589
|
const insertTokenNodeStrategy = new InsertTokenNodeStrategy();
|
|
15671
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.
|
|
15672
|
-
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTEListItemBlock.
|
|
15590
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTETextBlock.typeName, 'INSERT_TOKEN_NODE', insertTokenNodeStrategy);
|
|
15591
|
+
linkExtension.VegaRTEExtension.registerActionHandleStrategy(codeBlock.RTEListItemBlock.typeName, 'INSERT_TOKEN_NODE', insertTokenNodeStrategy);
|
|
15673
15592
|
})();
|
|
15674
15593
|
VegaRTETokenExtension.TOOLBAR_BUTTON_KEY = 'token';
|
|
15675
15594
|
|
|
15676
|
-
exports.ActionHandlerInterceptor = ActionHandlerInterceptor;
|
|
15677
15595
|
exports.DeleteSelectedContentAction = DeleteSelectedContentAction;
|
|
15678
|
-
exports.InsertNodeToNearestRootAction = InsertNodeToNearestRootAction;
|
|
15679
15596
|
exports.RTEBlockquoteBlock = RTEBlockquoteBlock;
|
|
15680
15597
|
exports.RTELanguageToolbarButtonRenderer = RTELanguageToolbarButtonRenderer;
|
|
15681
15598
|
exports.RTETokenNode = RTETokenNode;
|
|
@@ -15705,7 +15622,6 @@ exports.VegaRTESpecialCharactersMathematical = VegaRTESpecialCharactersMathemati
|
|
|
15705
15622
|
exports.VegaRTESpecialCharactersText = VegaRTESpecialCharactersText;
|
|
15706
15623
|
exports.VegaRTETableExtension = VegaRTETableExtension;
|
|
15707
15624
|
exports.VegaRTETokenExtension = VegaRTETokenExtension;
|
|
15708
|
-
exports.VegaRTEToolbarButtonRenderer = VegaRTEToolbarButtonRenderer;
|
|
15709
15625
|
exports.VegaRTEWordCountExtension = VegaRTEWordCountExtension;
|
|
15710
15626
|
exports.VegaSkeletonLoader = VegaSkeletonLoader;
|
|
15711
15627
|
exports.VegaTranslation = VegaTranslation;
|