@globalpayments/vega 2.91.0 → 2.92.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-7bb10088.js → app-globals-2f326662.js} +13 -10
- package/dist/cjs/{child-nodes-event-prevent-slimmer-76d19d56.js → child-nodes-event-prevent-slimmer-b9a5b3e2.js} +1 -1
- package/dist/cjs/{code-block-c1039791.js → code-block-6435d641.js} +24 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-1d36641d.js → component-value-history-controller-slimmer.abstract-e4c9a5ba.js} +3 -3
- package/dist/cjs/{content-state-a6105949.js → content-state-96ec9114.js} +32 -3
- package/dist/cjs/copy-d021c780.js +7 -0
- package/dist/cjs/{date-required-rule-c4997459.js → date-required-rule-8c9e312b.js} +1 -1
- package/dist/cjs/{design-token-f65eab4a.js → design-token-3548af29.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-316668d0.js → element-appender-slimmer-3bf69990.js} +3 -3
- package/dist/cjs/{file-uploader-required-rule-cc51d4ab.js → file-uploader-required-rule-5520bbec.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-b0c35330.js → form-field-controller-slimmer-e0efac05.js} +1 -1
- package/dist/cjs/{image-annotation-action-e4596726.js → image-annotation-action-853f72c8.js} +2 -2
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/index.cjs.js +25 -20
- package/dist/cjs/{inject-keyboard-manager-1f5bbb19.js → inject-keyboard-manager-0dccff1a.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-9c66cf36.js → internal-calendar-period-factory-6187ec4c.js} +1 -1
- package/dist/cjs/{internal-translation-controller-5905469e.js → internal-translation-controller-48ebfd0f.js} +14 -0
- package/dist/cjs/{keyboard-manager-61e8ce38.js → keyboard-manager-dfe8d924.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-079a7e87.js → keyboard-manager-slimmer-4a2560a1.js} +1 -1
- package/dist/cjs/{link-extension-a7ac28f3.js → link-extension-28d95849.js} +3 -3
- package/dist/cjs/loader.cjs.js +14 -13
- package/dist/cjs/{month-view-generator-48215a05.js → month-view-generator-2e59b188.js} +1 -1
- package/dist/cjs/{public-rules-66540638.js → public-rules-8727c42c.js} +10 -10
- package/dist/cjs/{range-dea19a90.js → range-5cb3d1e4.js} +25 -3
- package/dist/cjs/{replace-selected-text-action-6d1ebbf9.js → replace-selected-text-action-a31563ed.js} +1 -1
- package/dist/cjs/{required-field-rule-b12a29e1.js → required-field-rule-400690c3.js} +1 -1
- package/dist/cjs/{responsive-format-facade-10ff730e.js → responsive-format-facade-98b89142.js} +2 -2
- package/dist/cjs/{rich-text-editor-required-rule-63492ca3.js → rich-text-editor-required-rule-8e4d577d.js} +1 -1
- package/dist/cjs/{split-cell-operation-30e5dd4a.js → split-cell-operation-9e3ab88d.js} +3 -3
- package/dist/cjs/{state-border-formatter-e7779964.js → state-border-formatter-626b0a14.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-a22f0cb1.js → string-format-strategy.abstract-981f43e1.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-8179eb40.js → string-input-formatter-slimmer-fc4a0ba5.js} +1 -1
- package/dist/cjs/{string-mask-strategy-8b9bb0c1.js → string-mask-strategy-b47fa159.js} +2 -2
- package/dist/cjs/{style-formatter-380b9a86.js → style-formatter-baf18624.js} +2 -2
- package/dist/cjs/{time-required-rule-080d975b.js → time-required-rule-e77d174f.js} +1 -1
- package/dist/cjs/{token-extension-619379a3.js → token-extension-3aec039f.js} +1609 -15
- package/dist/cjs/{translation-slimmer-2af6f141.js → translation-slimmer-1e05769e.js} +1 -1
- package/dist/cjs/{type-guard-0171e779.js → type-guard-7ab48d6c.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-fdfca83e.js → valid-credit-card-number-rule-52ba9c67.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +18 -10
- package/dist/cjs/vega-app-header-button.cjs.entry.js +7 -7
- package/dist/cjs/vega-banner.cjs.entry.js +3 -6
- package/dist/cjs/vega-box.cjs.entry.js +7 -7
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/vega-button-circle.cjs.entry.js +7 -7
- package/dist/cjs/vega-button-group_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-button-link.cjs.entry.js +2 -2
- package/dist/cjs/vega-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-calendar_5.cjs.entry.js +9 -9
- package/dist/cjs/vega-card.cjs.entry.js +6 -6
- package/dist/cjs/vega-carousel.cjs.entry.js +4 -4
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-chip.cjs.entry.js +7 -7
- package/dist/cjs/vega-code-block.cjs.entry.js +12 -15
- package/dist/cjs/vega-color-picker.cjs.entry.js +4 -4
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +6 -6
- package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +11 -11
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +15 -15
- package/dist/cjs/vega-dialog_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-divider.cjs.entry.js +6 -6
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +9 -9
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +13 -9
- package/dist/cjs/vega-file-uploader.cjs.entry.js +6 -6
- package/dist/cjs/vega-flag-icon.cjs.entry.js +6 -6
- package/dist/cjs/vega-flex.cjs.entry.js +7 -7
- package/dist/cjs/vega-font.cjs.entry.js +6 -6
- package/dist/cjs/vega-form.cjs.entry.js +5 -5
- package/dist/cjs/vega-grid.cjs.entry.js +6 -6
- package/dist/cjs/vega-icon.cjs.entry.js +6 -6
- package/dist/cjs/vega-image-uploader.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-numeric.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-passcode.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-range.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-select.cjs.entry.js +8 -8
- package/dist/cjs/vega-input.cjs.entry.js +9 -9
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +8 -8
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +6 -6
- package/dist/cjs/vega-popover_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-radio_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +220 -48
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +233 -0
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +11 -11
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +4 -4
- package/dist/cjs/vega-signature-capture.cjs.entry.js +9 -9
- package/dist/cjs/vega-stepper.cjs.entry.js +4 -4
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-table_11.cjs.entry.js +6 -6
- package/dist/cjs/vega-textarea.cjs.entry.js +5 -5
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +7 -7
- package/dist/cjs/vega.cjs.js +14 -13
- package/dist/cjs/xmark-large-faae5a80.js +7 -0
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +11 -3
- package/dist/collection/components/vega-box/vega-box.js +3 -3
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +1 -1
- package/dist/collection/components/vega-field-label/slimmers/renderers/vega-field-label-suffix-element-renderer.js +5 -4
- package/dist/collection/components/vega-field-label/vega-field-label.css +20 -0
- package/dist/collection/components/vega-field-label/vega-field-label.js +6 -3
- package/dist/collection/components/vega-input/vega-input.css +1 -0
- package/dist/collection/components/vega-input/vega-input.js +1 -1
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/assets/cut.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.js +16 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy.js +25 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/delete-selected-content-strategy.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/delete-selected-content-action.js +17 -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/content-state.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/range.js +24 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/copy/action-handler-strategies/copy-selected-content-strategy.js +226 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/copy/actions/copy-selected-content-action.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/copy/copy-extension.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/copy/copy-toolbar-button-renderer.js +58 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/cut/cut-extension.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/cut/cut-toolbar-button-renderer.js +44 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/assets/find-and-replace.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/find-replace-extension.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/find-controller.js +105 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/find-replace-controller.abstract.js +68 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/block-search-strategy.abstract.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/code-block-search-strategy.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/container-block-search-strategy.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/list-item-block-search-strategy.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/text-block-search-strategy.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/find-replace-highlight-manager.js +266 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/find-replace-state.js +346 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/replace-controller.js +113 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/renderers/find-replace-toolbar-button-renderer.js +194 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/vega-rich-text-find-replace-panel/slimmers/renderers/find-replace-panel-renderer.js +153 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/vega-rich-text-find-replace-panel/vega-rich-text-find-replace-panel.css +50 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/vega-rich-text-find-replace-panel/vega-rich-text-find-replace-panel.js +156 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/horizontal-line/horizontal-line-extension.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-extension.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-extension.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-selection-widget/slimmers/controllers/selection-widget-keyboard-controller.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/public-api.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.js +133 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/backward-delete-content-handler.js +35 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/forward-delete-content-handler.js +93 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +9 -3
- package/dist/collection/components/vega-textarea/vega-textarea.js +1 -1
- package/dist/collection/global/scripts/before-vega-load.js +6 -0
- package/dist/collection/helpers/translation/locales/en.js +14 -0
- package/dist/esm/{app-globals-6041f52f.js → app-globals-5e0d319a.js} +13 -10
- package/dist/esm/{aria-dialog-focusable-trap-slimmer-1332c071.js → aria-dialog-focusable-trap-slimmer-9eae86c6.js} +1 -1
- package/dist/esm/{child-nodes-event-prevent-slimmer-50022584.js → child-nodes-event-prevent-slimmer-f24618c5.js} +2 -2
- package/dist/esm/{code-block-37294847.js → code-block-b71b2aa4.js} +26 -3
- package/dist/esm/{component-value-history-controller-slimmer.abstract-45ccddc9.js → component-value-history-controller-slimmer.abstract-282df6e5.js} +4 -4
- package/dist/esm/{content-state-67950b80.js → content-state-909099f8.js} +33 -4
- package/dist/esm/copy-54e45e2d.js +5 -0
- package/dist/esm/{date-required-rule-958cf380.js → date-required-rule-15edb04a.js} +1 -1
- package/dist/esm/{design-token-e7e78f18.js → design-token-cb5ed6b9.js} +3 -3
- package/dist/esm/{element-appender-slimmer-ebda526d.js → element-appender-slimmer-e41120ee.js} +4 -4
- package/dist/esm/{event-emit-slimmer-b94cec83.js → event-emit-slimmer-03deba18.js} +1 -1
- package/dist/esm/{file-uploader-required-rule-82188a61.js → file-uploader-required-rule-96952e1a.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-0a2ba886.js → form-field-controller-slimmer-cfe1d8a7.js} +3 -3
- package/dist/esm/{image-annotation-action-7f7a5678.js → image-annotation-action-98232dc4.js} +3 -3
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/index.js +24 -23
- package/dist/esm/{inject-keyboard-manager-2b19c121.js → inject-keyboard-manager-13cc77ab.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-fff8aaee.js → internal-calendar-period-factory-c3d70f3b.js} +1 -1
- package/dist/esm/{internal-translation-controller-aa09ca87.js → internal-translation-controller-8e8a514a.js} +14 -0
- package/dist/esm/{internal-vega-event-manager-956cf128.js → internal-vega-event-manager-75e5e3bb.js} +1 -1
- package/dist/esm/{keyboard-manager-3e5b157f.js → keyboard-manager-fe885db1.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-ba5cc767.js → keyboard-manager-slimmer-61d4c79b.js} +1 -1
- package/dist/esm/{link-extension-afb404fb.js → link-extension-f1a3bea7.js} +3 -3
- package/dist/esm/loader.js +17 -16
- package/dist/esm/{month-view-generator-7a0c869c.js → month-view-generator-85eecb95.js} +1 -1
- package/dist/esm/{public-rules-f64b0b78.js → public-rules-323bea4b.js} +11 -11
- package/dist/esm/{range-4d09a305.js → range-e63068d1.js} +25 -3
- package/dist/esm/{replace-selected-text-action-12bc8b82.js → replace-selected-text-action-c0817b2b.js} +1 -1
- package/dist/esm/{required-field-rule-a4634842.js → required-field-rule-897fe8d1.js} +1 -1
- package/dist/esm/{responsive-format-facade-844c5e09.js → responsive-format-facade-fb424f5b.js} +2 -2
- package/dist/esm/{rich-text-editor-required-rule-d62d418e.js → rich-text-editor-required-rule-0edb8ba7.js} +1 -1
- package/dist/esm/{split-cell-operation-c515669e.js → split-cell-operation-93b4d775.js} +3 -3
- package/dist/esm/{state-border-formatter-f53847a5.js → state-border-formatter-1a528ca4.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-a0327405.js → string-format-strategy.abstract-72fc98aa.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-12de4a25.js → string-input-formatter-slimmer-b0c480d8.js} +3 -3
- package/dist/esm/{string-mask-strategy-3bb03155.js → string-mask-strategy-4e00c173.js} +2 -2
- package/dist/esm/{style-formatter-df7bf8ec.js → style-formatter-5c1bea8d.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-7ef94141.js → sub-state-notify-slimmer-0f72ce74.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-d9ad2bdd.js → sub-state-observer-slimmer-64532d94.js} +1 -1
- package/dist/esm/{time-required-rule-db0dee53.js → time-required-rule-df500b14.js} +1 -1
- package/dist/esm/{token-extension-8ff92d14.js → token-extension-32d1fa56.js} +1610 -20
- package/dist/esm/{translation-slimmer-4904e7fe.js → translation-slimmer-60408f13.js} +1 -1
- package/dist/esm/{type-guard-a2cbaae9.js → type-guard-91087018.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-a3f9858d.js → valid-credit-card-number-rule-681ecb75.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +21 -13
- package/dist/esm/vega-app-footer.entry.js +3 -3
- package/dist/esm/vega-app-header-button.entry.js +10 -10
- package/dist/esm/vega-banner.entry.js +5 -8
- package/dist/esm/vega-box.entry.js +7 -7
- package/dist/esm/vega-breadcrumb.entry.js +5 -5
- package/dist/esm/vega-button-circle.entry.js +11 -11
- package/dist/esm/vega-button-group_2.entry.js +8 -8
- package/dist/esm/vega-button-link.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +9 -9
- package/dist/esm/vega-calendar_5.entry.js +15 -15
- package/dist/esm/vega-card.entry.js +6 -6
- package/dist/esm/vega-carousel.entry.js +7 -7
- package/dist/esm/vega-checkbox_2.entry.js +10 -10
- package/dist/esm/vega-chip.entry.js +10 -10
- package/dist/esm/vega-code-block.entry.js +15 -18
- package/dist/esm/vega-color-picker.entry.js +9 -9
- package/dist/esm/vega-color-swatch-picker.entry.js +11 -11
- package/dist/esm/vega-color-swatch.entry.js +5 -5
- package/dist/esm/vega-combo-box.entry.js +16 -16
- package/dist/esm/vega-date-picker_2.entry.js +22 -22
- package/dist/esm/vega-dialog_2.entry.js +10 -10
- package/dist/esm/vega-divider.entry.js +6 -6
- package/dist/esm/vega-dropdown_5.entry.js +16 -16
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-268f8def.js → vega-event-id-d3017041.js} +1 -1
- package/dist/esm/vega-field-label.entry.js +16 -12
- package/dist/esm/vega-file-uploader.entry.js +11 -11
- package/dist/esm/vega-flag-icon.entry.js +6 -6
- package/dist/esm/vega-flex.entry.js +7 -7
- package/dist/esm/vega-font.entry.js +6 -6
- package/dist/esm/vega-form.entry.js +11 -11
- package/dist/esm/vega-grid.entry.js +6 -6
- package/dist/esm/vega-icon.entry.js +6 -6
- package/dist/esm/vega-image-uploader.entry.js +13 -13
- package/dist/esm/vega-input-credit-card.entry.js +14 -14
- package/dist/esm/vega-input-numeric.entry.js +14 -14
- package/dist/esm/vega-input-passcode.entry.js +13 -13
- package/dist/esm/vega-input-phone-number.entry.js +11 -11
- package/dist/esm/vega-input-range.entry.js +10 -10
- package/dist/esm/vega-input-select.entry.js +13 -13
- package/dist/esm/vega-input.entry.js +15 -15
- package/dist/esm/{vega-internal-event-id-22151a4d.js → vega-internal-event-id-827eb1ce.js} +1 -1
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +14 -14
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +5 -5
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +4 -4
- package/dist/esm/vega-pagination.entry.js +10 -10
- package/dist/esm/vega-popover_2.entry.js +14 -14
- package/dist/esm/vega-progress-tracker_2.entry.js +10 -10
- package/dist/esm/vega-radio_2.entry.js +13 -13
- package/dist/esm/vega-rich-text-content.entry.js +10 -10
- package/dist/esm/vega-rich-text-editor_4.entry.js +227 -55
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +229 -0
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +8 -8
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +14 -14
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +13 -13
- package/dist/esm/vega-selection-tile_2.entry.js +11 -11
- package/dist/esm/vega-sidenav_3.entry.js +10 -10
- package/dist/esm/vega-signature-capture.entry.js +14 -14
- package/dist/esm/vega-stepper.entry.js +9 -9
- package/dist/esm/vega-tab-group_2.entry.js +5 -5
- package/dist/esm/vega-table_11.entry.js +12 -12
- package/dist/esm/vega-textarea.entry.js +10 -10
- 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 +8 -8
- package/dist/esm/vega.js +17 -16
- package/dist/esm/{wait-for-component-did-render-0488922a.js → wait-for-component-did-render-0c237cb8.js} +1 -1
- package/dist/esm/xmark-large-c5ae7944.js +5 -0
- package/dist/sri/vega-sri-manifest.json +387 -375
- package/dist/types/components/vega-accordion/slimmers/vega-accordion-renderer.d.ts +2 -0
- package/dist/types/components/vega-field-label/slimmers/renderers/vega-field-label-suffix-element-renderer.d.ts +1 -0
- package/dist/types/components/vega-field-label/types.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/delete-selected-content-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/delete-selected-content-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/range.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/copy/action-handler-strategies/copy-selected-content-strategy.d.ts +79 -0
- package/dist/types/components/vega-rich-text-editor/extensions/copy/actions/copy-selected-content-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/copy/copy-extension.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/extensions/copy/copy-toolbar-button-renderer.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/extensions/cut/cut-extension.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/cut/cut-toolbar-button-renderer.d.ts +24 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/assets/find-and-replace.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/find-replace-extension.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/find-controller.d.ts +65 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/find-replace-controller.abstract.d.ts +65 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/block-search-strategy.abstract.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/code-block-search-strategy.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/container-block-search-strategy.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/list-item-block-search-strategy.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/block-search-strategies/text-block-search-strategy.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/find-replace-highlight-manager.d.ts +88 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/helper/find-replace-state.d.ts +200 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/controllers/replace-controller.d.ts +73 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/renderers/find-replace-toolbar-button-renderer.d.ts +64 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/vega-rich-text-find-replace-panel/slimmers/renderers/find-replace-panel-renderer.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/vega-rich-text-find-replace-panel/vega-rich-text-find-replace-panel.d.ts +56 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/horizontal-line/horizontal-line-extension.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-extension.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-extension.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-extension.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.d.ts +60 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/backward-delete-content-handler.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/forward-delete-content-handler.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +2 -1
- package/dist/types/components.d.ts +34 -0
- package/dist/types/global/icons/copy.d.ts +3 -0
- package/dist/types/helpers/translation/interface.d.ts +15 -1
- package/dist/types/types/ui.type.d.ts +1 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-cb4033ef.js → p-0179f55d.js} +1 -1
- package/dist/vega/{p-8bc23bcf.entry.js → p-06c2ce2c.entry.js} +1 -1
- package/dist/vega/{p-fb1ef3e6.entry.js → p-07b56f2b.entry.js} +1 -1
- package/dist/vega/{p-141f74ff.js → p-136226f8.js} +1 -1
- package/dist/vega/{p-e9a82603.entry.js → p-18413b62.entry.js} +1 -1
- package/dist/vega/p-209e0166.js +1 -0
- package/dist/vega/{p-014e2cf9.js → p-228c5de8.js} +1 -1
- package/dist/vega/{p-cc8bf6e7.entry.js → p-22f73e6e.entry.js} +1 -1
- package/dist/vega/p-2314494a.entry.js +1 -0
- package/dist/vega/p-2353b64f.entry.js +1 -0
- package/dist/vega/p-29e3eb12.js +1 -0
- package/dist/vega/p-2da12975.entry.js +1 -0
- package/dist/vega/{p-8019c156.js → p-2def8e3e.js} +1 -1
- package/dist/vega/{p-5bed3fd2.entry.js → p-2e58d99e.entry.js} +1 -1
- package/dist/vega/{p-bb0040d4.entry.js → p-30561e1d.entry.js} +1 -1
- package/dist/vega/{p-fc103347.entry.js → p-35df0f0a.entry.js} +1 -1
- package/dist/vega/{p-15da9d58.entry.js → p-37dffdf6.entry.js} +1 -1
- package/dist/vega/{p-5ffc7cb8.js → p-3a68b729.js} +1 -1
- package/dist/vega/{p-507612f6.entry.js → p-3cf4339a.entry.js} +1 -1
- package/dist/vega/{p-4cef4812.js → p-3f183b52.js} +1 -1
- package/dist/vega/{p-42ed76ee.entry.js → p-40501057.entry.js} +1 -1
- package/dist/vega/{p-12b5c5e3.entry.js → p-438b7404.entry.js} +1 -1
- package/dist/vega/{p-8982796b.entry.js → p-43c3848f.entry.js} +1 -1
- package/dist/vega/{p-9756c6b9.entry.js → p-450bf94d.entry.js} +1 -1
- package/dist/vega/{p-0e03daa6.js → p-45ab490c.js} +1 -1
- package/dist/vega/{p-94845302.entry.js → p-481601c0.entry.js} +1 -1
- package/dist/vega/{p-0707aa21.js → p-4953bb1a.js} +1 -1
- package/dist/vega/{p-2b22091e.js → p-4d9061fb.js} +1 -1
- package/dist/vega/{p-b2f9698a.entry.js → p-4e39adf5.entry.js} +1 -1
- package/dist/vega/{p-316a1e5c.entry.js → p-5038b6d7.entry.js} +1 -1
- package/dist/vega/{p-3cf298a4.entry.js → p-5319da71.entry.js} +1 -1
- package/dist/vega/p-53c76d9d.entry.js +1 -0
- package/dist/vega/{p-64b5fe2a.entry.js → p-5545a235.entry.js} +1 -1
- package/dist/vega/{p-c75872a4.entry.js → p-56cf1a65.entry.js} +1 -1
- package/dist/vega/{p-216ef41e.entry.js → p-5829a66d.entry.js} +1 -1
- package/dist/vega/p-590c8720.entry.js +1 -0
- package/dist/vega/{p-5e282e41.js → p-5946fadf.js} +1 -1
- package/dist/vega/{p-822f70b0.js → p-5beec481.js} +1 -1
- package/dist/vega/p-5de1acdb.js +1 -0
- package/dist/vega/p-5df9047c.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-aaa6e976.entry.js → p-625351a3.entry.js} +1 -1
- package/dist/vega/p-683cfe24.js +1 -0
- package/dist/vega/p-68e16c70.entry.js +1 -0
- package/dist/vega/{p-ef44d516.js → p-70817cf5.js} +1 -1
- package/dist/vega/{p-a14d8767.js → p-71e2a3ec.js} +1 -1
- package/dist/vega/{p-a4826f3f.entry.js → p-7798254d.entry.js} +1 -1
- package/dist/vega/p-7be548a7.js +1 -0
- package/dist/vega/{p-4037126d.js → p-802bf369.js} +1 -1
- package/dist/vega/{p-b77e85e0.entry.js → p-82279b03.entry.js} +1 -1
- package/dist/vega/{p-f362c07b.entry.js → p-8509c140.entry.js} +1 -1
- package/dist/vega/p-88a6c89a.js +1 -0
- package/dist/vega/p-890a5254.js +1 -0
- package/dist/vega/p-8aa07ed0.js +1 -0
- package/dist/vega/{p-da2b1fd0.entry.js → p-8b9a8603.entry.js} +1 -1
- package/dist/vega/{p-14bfc113.js → p-8bc15ed0.js} +1 -1
- package/dist/vega/{p-aea912ac.js → p-8d69b201.js} +1 -1
- package/dist/vega/p-8da860f6.js +1 -0
- package/dist/vega/{p-329c808e.entry.js → p-8f078d0d.entry.js} +1 -1
- package/dist/vega/p-916dfa7e.entry.js +1 -0
- package/dist/vega/{p-42a1d300.entry.js → p-9219201a.entry.js} +1 -1
- package/dist/vega/{p-cd2a1ffb.js → p-92823583.js} +1 -1
- package/dist/vega/{p-cec8ffdc.js → p-93dfab05.js} +1 -1
- package/dist/vega/{p-7f086e54.entry.js → p-9440a8a5.entry.js} +1 -1
- package/dist/vega/p-970115d6.js +1 -0
- package/dist/vega/{p-da067259.entry.js → p-9b1d718c.entry.js} +1 -1
- package/dist/vega/{p-c65a5778.entry.js → p-9cdedcfb.entry.js} +1 -1
- package/dist/vega/{p-6e7c1b19.entry.js → p-9fafc956.entry.js} +1 -1
- package/dist/vega/{p-70352240.entry.js → p-a268a4fb.entry.js} +1 -1
- package/dist/vega/{p-cd21adb8.js → p-a2bd621e.js} +1 -1
- package/dist/vega/p-a361456d.js +1 -0
- package/dist/vega/{p-73b9868f.js → p-aa32f2f3.js} +1 -1
- package/dist/vega/p-b6225d01.js +1 -0
- package/dist/vega/{p-58a00869.entry.js → p-b6ebfd5c.entry.js} +1 -1
- package/dist/vega/{p-fea33425.js → p-b730bf6e.js} +1 -1
- package/dist/vega/{p-81591449.entry.js → p-b799fc1f.entry.js} +1 -1
- package/dist/vega/{p-4644ccf9.entry.js → p-c0629528.entry.js} +1 -1
- package/dist/vega/{p-50d7a1c4.entry.js → p-c2e0f8b7.entry.js} +1 -1
- package/dist/vega/{p-522dd15f.entry.js → p-c67ce78c.entry.js} +1 -1
- package/dist/vega/{p-6ecb3c7d.entry.js → p-c78aeaf3.entry.js} +1 -1
- package/dist/vega/{p-5df53125.entry.js → p-c78e8081.entry.js} +1 -1
- package/dist/vega/{p-1acd5f04.entry.js → p-c8eaf91c.entry.js} +1 -1
- package/dist/vega/p-ca9852bb.js +1 -0
- package/dist/vega/{p-ce27c273.entry.js → p-cd1844ad.entry.js} +1 -1
- package/dist/vega/{p-a04b95aa.entry.js → p-cd9fb2ca.entry.js} +1 -1
- package/dist/vega/p-ce7e9515.entry.js +1 -0
- package/dist/vega/p-d0ce752f.entry.js +1 -0
- package/dist/vega/{p-044496e0.entry.js → p-d20587b4.entry.js} +1 -1
- package/dist/vega/{p-ae728041.entry.js → p-d3c8b871.entry.js} +1 -1
- package/dist/vega/{p-c87c7ef4.js → p-d7369441.js} +1 -1
- package/dist/vega/p-de885ef2.js +1 -0
- package/dist/vega/{p-b7b0930a.entry.js → p-dee38163.entry.js} +1 -1
- package/dist/vega/{p-6820b488.entry.js → p-e160a727.entry.js} +1 -1
- package/dist/vega/{p-49b4ab2b.js → p-e371738b.js} +1 -1
- package/dist/vega/{p-4979fd7d.js → p-e3803943.js} +1 -1
- package/dist/vega/p-e41d9d0e.entry.js +1 -0
- package/dist/vega/p-e5502873.entry.js +1 -0
- package/dist/vega/{p-5fcb825c.entry.js → p-e9cee498.entry.js} +1 -1
- package/dist/vega/p-ea22cba0.js +1 -0
- package/dist/vega/p-ea54ce0a.js +3 -0
- package/dist/vega/p-ee3155bd.js +1 -0
- package/dist/vega/{p-0605c656.entry.js → p-eee01ba7.entry.js} +1 -1
- package/dist/vega/{p-3fe43f7a.entry.js → p-ef2b9846.entry.js} +1 -1
- package/dist/vega/p-f0bc2bbb.js +1 -0
- package/dist/vega/{p-3863187f.entry.js → p-f365601c.entry.js} +1 -1
- package/dist/vega/p-f4a01959.js +1 -0
- package/dist/vega/{p-9e327397.entry.js → p-f515d189.entry.js} +1 -1
- package/dist/vega/{p-b504a8b4.entry.js → p-f5aefb2f.entry.js} +1 -1
- package/dist/vega/{p-2f48162f.entry.js → p-f6bccb06.entry.js} +1 -1
- package/dist/vega/{p-e75e75c9.entry.js → p-f70f7ad8.entry.js} +1 -1
- package/dist/vega/{p-42f3c0b1.entry.js → p-f7739cbb.entry.js} +1 -1
- package/dist/vega/{p-335e3237.entry.js → p-fc5dfb52.entry.js} +1 -1
- package/dist/vega/p-fd70418f.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.js +0 -92
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.d.ts +0 -26
- package/dist/vega/p-144d4b30.js +0 -1
- package/dist/vega/p-21775cc7.js +0 -1
- package/dist/vega/p-2944c76e.entry.js +0 -1
- package/dist/vega/p-3372f34a.entry.js +0 -1
- package/dist/vega/p-53ed3b1f.js +0 -1
- package/dist/vega/p-57f7c257.js +0 -1
- package/dist/vega/p-5a4e598f.js +0 -1
- package/dist/vega/p-5e1cd1cc.js +0 -1
- package/dist/vega/p-5e1ec2b8.entry.js +0 -1
- package/dist/vega/p-61d42e9b.entry.js +0 -1
- package/dist/vega/p-63ae5ada.entry.js +0 -1
- package/dist/vega/p-66905cbf.js +0 -1
- package/dist/vega/p-689070f9.entry.js +0 -1
- package/dist/vega/p-74fa0f5b.entry.js +0 -1
- package/dist/vega/p-7bb39b97.js +0 -1
- package/dist/vega/p-7f139b74.js +0 -1
- package/dist/vega/p-85d78ac1.js +0 -1
- package/dist/vega/p-92a144bc.js +0 -1
- package/dist/vega/p-9f608b97.js +0 -1
- package/dist/vega/p-aca134a3.entry.js +0 -1
- package/dist/vega/p-b2f89dbd.js +0 -1
- package/dist/vega/p-bd94b904.entry.js +0 -1
- package/dist/vega/p-c0c2a917.js +0 -3
- package/dist/vega/p-c40555c4.entry.js +0 -1
- package/dist/vega/p-d0060bdb.js +0 -1
- package/dist/vega/p-d00b3910.js +0 -1
- package/dist/vega/p-d14ddf80.js +0 -1
- package/dist/vega/p-dc78e8d6.js +0 -1
- package/dist/vega/p-ddc2d219.js +0 -1
- /package/dist/cjs/{feature-flag-controller-438a1510.js → feature-flag-controller-c19d0b58.js} +0 -0
- /package/dist/collection/{components/vega-code-block/assets → global/icons}/copy.js +0 -0
- /package/dist/esm/{feature-flag-controller-2a89f20c.js → feature-flag-controller-3fd04ea9.js} +0 -0
- /package/dist/types/components/{vega-code-block/assets/copy.d.ts → vega-rich-text-editor/assets/cut.d.ts} +0 -0
- /package/dist/vega/{p-bc73ce30.js → p-87a4d75f.js} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { VegaInternalIconManager } from '../../../../helpers/icon/internal-icon-manager';
|
|
2
|
+
import { RTECopyToolbarButtonRenderer } from '../copy/copy-toolbar-button-renderer';
|
|
3
|
+
import cutIcon from '../../assets/cut';
|
|
4
|
+
import { CopySelectedContentAction } from '../copy/actions/copy-selected-content-action';
|
|
5
|
+
import { DeleteSelectedContentAction } from '../../dto/actions/delete-selected-content-action';
|
|
6
|
+
/**
|
|
7
|
+
* Toolbar button renderer for the Cut extension.
|
|
8
|
+
* Reuses the Copy renderer to write the selected editor content to the clipboard,
|
|
9
|
+
* then removes the selected content from the editor.
|
|
10
|
+
*/
|
|
11
|
+
export class RTECutToolbarButtonRenderer extends RTECopyToolbarButtonRenderer {
|
|
12
|
+
/**
|
|
13
|
+
* Renders the cut toolbar button.
|
|
14
|
+
*
|
|
15
|
+
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
16
|
+
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
17
|
+
* @returns {VegaRTERenderResult} - The toolbar button render result.
|
|
18
|
+
*/
|
|
19
|
+
render(h, editorContext) {
|
|
20
|
+
return this.renderButton(h, editorContext, {
|
|
21
|
+
icon: 'rte-cut',
|
|
22
|
+
tooltip: { text: 'Cut' },
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Handles the cut button click event.
|
|
27
|
+
* Copies the current editor selection to the clipboard and then deletes it from the editor.
|
|
28
|
+
*
|
|
29
|
+
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
30
|
+
*/
|
|
31
|
+
async handleButtonClick(editorContext) {
|
|
32
|
+
const context = this.getExtensionContext(editorContext.host);
|
|
33
|
+
if (context && context.host) {
|
|
34
|
+
const { host } = context;
|
|
35
|
+
const copySelectedContentAction = new CopySelectedContentAction(context.getSelection(), context.getSelectedNodes());
|
|
36
|
+
host.value.apply(copySelectedContentAction);
|
|
37
|
+
const isCopySuccessful = await copySelectedContentAction.copyResult;
|
|
38
|
+
isCopySuccessful && host.value.apply(new DeleteSelectedContentAction(host, true, true));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
(() => {
|
|
43
|
+
VegaInternalIconManager.register({ 'rte-cut': cutIcon });
|
|
44
|
+
})();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2026 Fonticons, Inc. --><path fill="currentColor" d="M208 48c39.6 0 75.9 14.4 103.8 38.2L279 119c-6.9 6.9-8.9 17.2-5.2 26.2S286.3 160 296 160l96 0c13.3 0 24-10.7 24-24l0-96c0-9.7-5.8-18.5-14.8-22.2S381.9 16.2 375 23L345.8 52.2c-36.7-32.5-85-52.2-137.8-52.2-99.4 0-182.4 69.7-203.1 162.8-2.9 12.9 5.3 25.8 18.2 28.6 1.4 .3 2.7 .5 4.1 .5l2.3 0C40.1 191.5 49.4 184 51.8 173.2 67.7 101.6 131.6 48 208 48zM386 224c-10.4 .7-19.4 8.1-21.8 18.8-15.9 71.7-79.8 125.2-156.2 125.2-39.6 0-75.9-14.4-103.8-38.2L137 297c6.9-6.9 8.9-17.2 5.2-26.2S129.7 256 120 256l-96 0c-13.3 0-24 10.7-24 24l0 96c0 9.7 5.8 18.5 14.8 22.2S34.1 399.8 41 393l29.2-29.2c36.7 32.5 85 52.2 137.8 52.2 48.8 0 93.7-16.8 129.1-44.9L471 505c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L371.1 337.1c19.2-24.2 33.1-52.8 40-84 2.9-12.9-5.3-25.8-18.2-28.6-1.2-.3-2.4-.4-3.6-.5l-3.2 0z"/></svg>`,
|
|
3
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VegaRTEExtension } from '../extension.abstract';
|
|
2
|
+
import { FindReplaceToolbarButtonRenderer } from './slimmer/renderers/find-replace-toolbar-button-renderer';
|
|
3
|
+
/**
|
|
4
|
+
* Find & Replace extension for Vega Rich Text Editor.
|
|
5
|
+
*
|
|
6
|
+
* Registers a toolbar button (magnifying-glass icon) that toggles the find-replace panel.
|
|
7
|
+
* Each editor host gets its own isolated FindReplaceState and toolbar renderer instance,
|
|
8
|
+
* created during the per-host prepareBeforeLoad lifecycle hook.
|
|
9
|
+
*
|
|
10
|
+
* Toolbar key: 'findReplace'
|
|
11
|
+
*/
|
|
12
|
+
export class VegaRTEFindReplaceExtension extends VegaRTEExtension {
|
|
13
|
+
/** @inheritDoc */
|
|
14
|
+
prepareBeforeLoad(host) {
|
|
15
|
+
this.registerToolbarButtonRenderer(VegaRTEFindReplaceExtension.TOOLBAR_BUTTON_KEY, new FindReplaceToolbarButtonRenderer(), host);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
VegaRTEFindReplaceExtension.TOOLBAR_BUTTON_KEY = 'findReplace';
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { FindReplaceControllerAbstract, } from './find-replace-controller.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Concrete find controller.
|
|
4
|
+
*
|
|
5
|
+
* Provides search, navigation, highlight, and lifecycle capabilities.
|
|
6
|
+
* Shares state with {@link ReplaceController} via the injected
|
|
7
|
+
* {@link FindReplaceControllerContext}.
|
|
8
|
+
*/
|
|
9
|
+
export class FindController extends FindReplaceControllerAbstract {
|
|
10
|
+
constructor(context) {
|
|
11
|
+
super(context);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Runs a search with the current keyword on the host's content.
|
|
15
|
+
* Applies highlights and returns the result for panel display.
|
|
16
|
+
*
|
|
17
|
+
* @returns {FindReplaceResult} The match count and current position.
|
|
18
|
+
*/
|
|
19
|
+
find() {
|
|
20
|
+
if (!this.context.hostRef) {
|
|
21
|
+
return { current: 0, total: 0 };
|
|
22
|
+
}
|
|
23
|
+
this.context.state.search(this.context.hostRef.value, this.context.keyword);
|
|
24
|
+
return this.applyAndGetResult();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Navigates to the next match.
|
|
28
|
+
*
|
|
29
|
+
* @returns {FindReplaceResult} Updated position.
|
|
30
|
+
*/
|
|
31
|
+
next() {
|
|
32
|
+
this.context.state.next();
|
|
33
|
+
return this.applyAndGetResult();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Navigates to the previous match.
|
|
37
|
+
*
|
|
38
|
+
* @returns {FindReplaceResult} Updated position.
|
|
39
|
+
*/
|
|
40
|
+
prev() {
|
|
41
|
+
this.context.state.prev();
|
|
42
|
+
return this.applyAndGetResult();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Clears all search state and removes highlight overlays.
|
|
46
|
+
*/
|
|
47
|
+
clear() {
|
|
48
|
+
this.context.state.clear();
|
|
49
|
+
if (this.context.hostRef) {
|
|
50
|
+
this.context.highlightManager.clear();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Re-runs the search after content has changed (e.g. user typed while
|
|
55
|
+
* panel is open). Attempts to preserve the previous navigation position.
|
|
56
|
+
*
|
|
57
|
+
* @param {boolean} scrollToActive - Whether to scroll the active highlight into view.
|
|
58
|
+
* @returns {FindReplaceResult | null} Updated result, or null if no search is active.
|
|
59
|
+
*/
|
|
60
|
+
refresh(scrollToActive = true) {
|
|
61
|
+
if (!this.context.keyword || !this.context.hostRef) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const prevIndex = this.context.state.getCurrentIndex();
|
|
65
|
+
this.context.state.search(this.context.hostRef.value, this.context.keyword);
|
|
66
|
+
this.context.state.setCurrentIndex(prevIndex);
|
|
67
|
+
return this.applyAndGetResult(scrollToActive);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Toggles the match-case search option, clears previous results,
|
|
71
|
+
* and re-runs the search if a keyword is set.
|
|
72
|
+
*
|
|
73
|
+
* @param {boolean} enabled - Whether match-case should be enabled.
|
|
74
|
+
* @returns {FindReplaceResult} The updated search result.
|
|
75
|
+
*/
|
|
76
|
+
setMatchCase(enabled) {
|
|
77
|
+
this.context.state.setMatchCase(enabled);
|
|
78
|
+
return this.updateFindResults();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Toggles the whole-words search option, clears previous results,
|
|
82
|
+
* and re-runs the search if a keyword is set.
|
|
83
|
+
*
|
|
84
|
+
* @param {boolean} enabled - Whether whole-words should be enabled.
|
|
85
|
+
* @returns {FindReplaceResult} The updated search result.
|
|
86
|
+
*/
|
|
87
|
+
setWholeWords(enabled) {
|
|
88
|
+
this.context.state.setWholeWords(enabled);
|
|
89
|
+
return this.updateFindResults();
|
|
90
|
+
}
|
|
91
|
+
// ─── Private helpers ──────────────────────────────────────────────────────────
|
|
92
|
+
/**
|
|
93
|
+
* Clears previous results and re-runs the search with the current keyword and options.
|
|
94
|
+
*
|
|
95
|
+
* @returns {FindReplaceResult} The updated search result.
|
|
96
|
+
*/
|
|
97
|
+
updateFindResults() {
|
|
98
|
+
this.context.state.clearResults();
|
|
99
|
+
if (this.context.keyword && this.context.hostRef) {
|
|
100
|
+
this.context.state.search(this.context.hostRef.value, this.context.keyword);
|
|
101
|
+
return this.applyAndGetResult();
|
|
102
|
+
}
|
|
103
|
+
return { current: 0, total: 0 };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { FindReplaceState } from './helper/find-replace-state';
|
|
2
|
+
import { FindReplaceHighlightManager } from './helper/find-replace-highlight-manager';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new shared controller context with default (empty) state.
|
|
5
|
+
*
|
|
6
|
+
* @returns {FindReplaceControllerContext} A fresh context instance.
|
|
7
|
+
*/
|
|
8
|
+
export function createFindReplaceControllerContext() {
|
|
9
|
+
return {
|
|
10
|
+
state: new FindReplaceState(),
|
|
11
|
+
highlightManager: new FindReplaceHighlightManager(),
|
|
12
|
+
hostRef: null,
|
|
13
|
+
keyword: '',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Abstract base controller for the Find & Replace extension.
|
|
18
|
+
*
|
|
19
|
+
* Holds shared operations ({@link setHost}, {@link setKeyword}) and the
|
|
20
|
+
* common helper {@link applyAndGetResult}. Concrete implementations
|
|
21
|
+
* ({@link FindController}, {@link ReplaceController}) add the respective
|
|
22
|
+
* search/navigation and mutation capabilities.
|
|
23
|
+
*/
|
|
24
|
+
export class FindReplaceControllerAbstract {
|
|
25
|
+
constructor(context) {
|
|
26
|
+
this.context = context;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Updates the cached host reference. Called on each render cycle.
|
|
30
|
+
*
|
|
31
|
+
* @typedef HTMLVegaRichTextEditorElement - The type of the host rich text editor element.
|
|
32
|
+
* @param {HTMLVegaRichTextEditorElement} host - The RTE host element.
|
|
33
|
+
*/
|
|
34
|
+
setHost(host) {
|
|
35
|
+
this.context.hostRef = host;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Updates the keyword. Clears previous match results and highlights,
|
|
39
|
+
* but preserves the flat-text cache so the next find() on the same
|
|
40
|
+
* document does not re-flatten every block.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} keyword - The new search keyword.
|
|
43
|
+
* @returns {FindReplaceResult} Reset result (0/0).
|
|
44
|
+
*/
|
|
45
|
+
setKeyword(keyword) {
|
|
46
|
+
this.context.keyword = keyword;
|
|
47
|
+
this.context.state.clearResults();
|
|
48
|
+
if (this.context.hostRef) {
|
|
49
|
+
this.context.highlightManager.clear();
|
|
50
|
+
}
|
|
51
|
+
return { current: 0, total: 0 };
|
|
52
|
+
}
|
|
53
|
+
// ─── Protected ────────────────────────────────────────────────────────────────
|
|
54
|
+
/**
|
|
55
|
+
* Applies highlight overlays and returns the current result for the panel.
|
|
56
|
+
*
|
|
57
|
+
* @param {boolean} scrollToActive - Whether to scroll the active highlight into view.
|
|
58
|
+
* @returns {FindReplaceResult} The current match position and total count.
|
|
59
|
+
*/
|
|
60
|
+
applyAndGetResult(scrollToActive = true) {
|
|
61
|
+
const total = this.context.state.getTotal();
|
|
62
|
+
const current = total > 0 ? this.context.state.getCurrentIndex() + 1 : 0;
|
|
63
|
+
if (this.context.hostRef) {
|
|
64
|
+
this.context.highlightManager.apply(this.context.state.getMatches(), this.context.state.getCurrentIndex(), this.context.hostRef, scrollToActive);
|
|
65
|
+
}
|
|
66
|
+
return { current, total };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines how a specific type of RTEBlock contributes searchable leaf blocks.
|
|
3
|
+
*
|
|
4
|
+
* Implementations are registered on FindReplaceState in priority order.
|
|
5
|
+
* The first strategy whose `canHandle` returns true is used.
|
|
6
|
+
*/
|
|
7
|
+
export class BlockSearchStrategy {
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RTECodeBlock } from '../../../../../../dto/blocks/code-block';
|
|
2
|
+
import { BlockSearchStrategy } from './block-search-strategy.abstract';
|
|
3
|
+
/**
|
|
4
|
+
* Handles RTECodeBlock — a searchable leaf block whose text lives in children[0].text.
|
|
5
|
+
*/
|
|
6
|
+
export class CodeBlockSearchStrategy extends BlockSearchStrategy {
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
*/
|
|
10
|
+
canHandle(block) {
|
|
11
|
+
return block instanceof RTECodeBlock;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
collect(block) {
|
|
17
|
+
return [block];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RTETextNode } from '../../../../../../dto/nodes/text-node';
|
|
2
|
+
import { BlockSearchStrategy } from './block-search-strategy.abstract';
|
|
3
|
+
/**
|
|
4
|
+
* Fallback strategy for generic container blocks whose concrete type is not
|
|
5
|
+
* known at compile time (RTEHtmlBlock, table blocks, extension-defined blocks, …).
|
|
6
|
+
*
|
|
7
|
+
* A block is treated as a container when its children array is non-empty and
|
|
8
|
+
* the first child is not an RTETextNode (i.e. children are blocks, not nodes).
|
|
9
|
+
*/
|
|
10
|
+
export class ContainerBlockSearchStrategy extends BlockSearchStrategy {
|
|
11
|
+
/**
|
|
12
|
+
* @inheritDoc
|
|
13
|
+
*/
|
|
14
|
+
canHandle(block) {
|
|
15
|
+
return (block.children != null && block.children.length > 0 && !(block.children[0] instanceof RTETextNode));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
collect(block, recurse) {
|
|
21
|
+
return recurse(block.children);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RTEListItemBlock } from '../../../../../../dto/blocks/list-item-block';
|
|
2
|
+
import { BlockSearchStrategy } from './block-search-strategy.abstract';
|
|
3
|
+
/**
|
|
4
|
+
* Handles RTEListItemBlock — a searchable leaf block that may also carry
|
|
5
|
+
* nested RTEListBlocks via its `nestList` property.
|
|
6
|
+
*
|
|
7
|
+
* Must be registered before TextBlockSearchStrategy because RTEListItemBlock
|
|
8
|
+
* extends RTETextBlock and would otherwise be matched by the parent class check.
|
|
9
|
+
*/
|
|
10
|
+
export class ListItemBlockSearchStrategy extends BlockSearchStrategy {
|
|
11
|
+
/**
|
|
12
|
+
* @inheritDoc
|
|
13
|
+
*/
|
|
14
|
+
canHandle(block) {
|
|
15
|
+
return block instanceof RTEListItemBlock;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
collect(block, recurse) {
|
|
21
|
+
const listItemBlock = block;
|
|
22
|
+
const result = [listItemBlock];
|
|
23
|
+
if (listItemBlock.nestList && listItemBlock.nestList.length > 0) {
|
|
24
|
+
for (const nestedList of listItemBlock.nestList) {
|
|
25
|
+
result.push(...recurse(nestedList.children));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RTETextBlock } from '../../../../../../dto/blocks/text-block';
|
|
2
|
+
import { BlockSearchStrategy } from './block-search-strategy.abstract';
|
|
3
|
+
/**
|
|
4
|
+
* Handles plain RTETextBlock (paragraph, heading, etc.) — a searchable leaf
|
|
5
|
+
* block whose text lives in its RTETextNode children.
|
|
6
|
+
*/
|
|
7
|
+
export class TextBlockSearchStrategy extends BlockSearchStrategy {
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
canHandle(block) {
|
|
12
|
+
return block instanceof RTETextBlock;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
collect(block) {
|
|
18
|
+
return [block];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import stateEntityRenderingRegistry from '../../../../../slimmers/controllers/state-entity-rendering-registry';
|
|
2
|
+
import { tryGetDocument } from '../../../../../../../utils/try-get-document';
|
|
3
|
+
import { RTECodeBlockNode } from '../../../../../dto/nodes/code-block-node';
|
|
4
|
+
import { VegaDarkModeStyleController } from '../../../../../../../helpers/theme/controllers/dark-mode-style-controller';
|
|
5
|
+
// Light-mode values (used as CSS var() fall-backs).
|
|
6
|
+
// Dark-mode values are registered via VegaDarkModeStyleController below.
|
|
7
|
+
const HIGHLIGHT_BG_LIGHT = '255, 220, 0, 0.35';
|
|
8
|
+
const HIGHLIGHT_ACTIVE_BG_LIGHT = '255, 150, 0, 0.5';
|
|
9
|
+
// Dark-mode: brighter yellow/orange tones stand out on dark backgrounds.
|
|
10
|
+
const HIGHLIGHT_BG_DARK = '255, 235, 0, 0.55';
|
|
11
|
+
const HIGHLIGHT_ACTIVE_BG_DARK = '255, 190, 0, 0.7';
|
|
12
|
+
// CSS var() expressions that auto-switch between light and dark.
|
|
13
|
+
const HIGHLIGHT_BG = `rgba(var(--v-rte-find-highlight-bg, ${HIGHLIGHT_BG_LIGHT}))`;
|
|
14
|
+
const HIGHLIGHT_ACTIVE_BG = `rgba(var(--v-rte-find-highlight-active-bg, ${HIGHLIGHT_ACTIVE_BG_LIGHT}))`;
|
|
15
|
+
/**
|
|
16
|
+
* Manages highlights for the Find & Replace extension using a DOM overlay.
|
|
17
|
+
*
|
|
18
|
+
* Instead of modifying the RTE content tree (which causes re-renders, cursor
|
|
19
|
+
* jumping, and VegaChange events), this manager renders semi-transparent
|
|
20
|
+
* highlight rectangles in an absolutely-positioned overlay container.
|
|
21
|
+
*
|
|
22
|
+
* The overlay lives inside `.rich-text-editor-container` (the RTE's scroll
|
|
23
|
+
* container) so highlight divs scroll naturally with the text content.
|
|
24
|
+
* `pointer-events: none` ensures highlights don't interfere with user
|
|
25
|
+
* interaction (selection, typing, clicking).
|
|
26
|
+
*
|
|
27
|
+
* Position computation uses `Range.getClientRects()` on the actual text DOM
|
|
28
|
+
* nodes (resolved via `stateEntityRenderingRegistry.getDOMByEntity`).
|
|
29
|
+
*/
|
|
30
|
+
export class FindReplaceHighlightManager {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.overlayContainer = null;
|
|
33
|
+
// Register dark-mode overrides so `html.dark { --v-rte-find-highlight-*: ... }` is generated.
|
|
34
|
+
// CSS variables cascade into shadow DOM and update automatically when html.dark is toggled.
|
|
35
|
+
VegaDarkModeStyleController.registerCustomDarkModeColor({
|
|
36
|
+
'rte-find-highlight-bg': HIGHLIGHT_BG_DARK,
|
|
37
|
+
'rte-find-highlight-active-bg': HIGHLIGHT_ACTIVE_BG_DARK,
|
|
38
|
+
'rte-find-highlight-blend': 'lighten',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Renders highlight overlays for all matches, with the active match
|
|
43
|
+
* visually distinct. Clears any existing highlights before applying.
|
|
44
|
+
*
|
|
45
|
+
* @typedef HTMLVegaRichTextEditorElement - The type of the host rich text editor element.
|
|
46
|
+
* @param {ReadonlyArray<FindMatch>} matches - All search results.
|
|
47
|
+
* @param {number} currentIndex - 0-based index of the active match (-1 = none).
|
|
48
|
+
* @param {HTMLVegaRichTextEditorElement} host - The RTE host element.
|
|
49
|
+
* @param {boolean} scrollToActive - Whether to scroll the active highlight into view.
|
|
50
|
+
*/
|
|
51
|
+
apply(matches, currentIndex, host, scrollToActive = true) {
|
|
52
|
+
this.clear();
|
|
53
|
+
if (matches.length === 0) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const overlay = this.getOrCreateOverlay(host);
|
|
57
|
+
if (overlay) {
|
|
58
|
+
const overlayRect = overlay.getBoundingClientRect();
|
|
59
|
+
let activeHighlightDiv = null;
|
|
60
|
+
matches.forEach((match, matchIndex) => {
|
|
61
|
+
const isActive = matchIndex === currentIndex;
|
|
62
|
+
const bg = isActive ? HIGHLIGHT_ACTIVE_BG : HIGHLIGHT_BG;
|
|
63
|
+
match.nodes.forEach((nodePosition) => {
|
|
64
|
+
const highlightDiv = this.createHighlightRectangles(overlay, overlayRect, nodePosition, bg);
|
|
65
|
+
if (isActive && !activeHighlightDiv && highlightDiv) {
|
|
66
|
+
activeHighlightDiv = highlightDiv;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
if (scrollToActive && activeHighlightDiv) {
|
|
71
|
+
activeHighlightDiv.scrollIntoView({ block: 'center', inline: 'nearest' });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Removes all highlight overlay elements.
|
|
77
|
+
* Safe to call multiple times or when no highlights are active.
|
|
78
|
+
*/
|
|
79
|
+
clear() {
|
|
80
|
+
if (this.overlayContainer) {
|
|
81
|
+
this.overlayContainer.innerHTML = '';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// ─── Private helpers ──────────────────────────────────────────────────────────
|
|
85
|
+
/**
|
|
86
|
+
* Gets the existing overlay container or creates one inside the RTE's
|
|
87
|
+
* scroll container (`.rich-text-editor-container`).
|
|
88
|
+
*
|
|
89
|
+
* @typedef HTMLVegaRichTextEditorElement - The type of the host rich text editor element.
|
|
90
|
+
* @param {HTMLVegaRichTextEditorElement} host - The RTE host element.
|
|
91
|
+
* @returns {HTMLDivElement | null} The overlay container, or null in SSR environments.
|
|
92
|
+
*/
|
|
93
|
+
getOrCreateOverlay(host) {
|
|
94
|
+
if (this.overlayContainer && this.overlayContainer.isConnected) {
|
|
95
|
+
return this.overlayContainer;
|
|
96
|
+
}
|
|
97
|
+
const safeDocument = tryGetDocument();
|
|
98
|
+
if (safeDocument) {
|
|
99
|
+
const scrollContainer = host.shadowRoot.querySelector('.rich-text-editor-container');
|
|
100
|
+
if (scrollContainer) {
|
|
101
|
+
// The overlay is appended as the last child (paints above content).
|
|
102
|
+
// Blend mode is controlled via CSS variable --v-rte-find-highlight-blend:
|
|
103
|
+
// - Light (default): multiply (yellow darkens white bg, text readable)
|
|
104
|
+
// - Dark (via html.dark override): lighten (yellow visible on dark bg,
|
|
105
|
+
// white text unaffected since lighten(255, x) = 255)
|
|
106
|
+
// CSS vars cascade into shadow DOM and react to theme switches instantly.
|
|
107
|
+
const overlay = safeDocument.createElement('div');
|
|
108
|
+
overlay.style.position = 'absolute';
|
|
109
|
+
overlay.style.top = '0';
|
|
110
|
+
overlay.style.left = '0';
|
|
111
|
+
overlay.style.width = '100%';
|
|
112
|
+
overlay.style.height = '100%';
|
|
113
|
+
overlay.style.pointerEvents = 'none';
|
|
114
|
+
overlay.style.overflow = 'visible';
|
|
115
|
+
overlay.style.setProperty('mix-blend-mode', 'var(--v-rte-find-highlight-blend, multiply)');
|
|
116
|
+
scrollContainer.appendChild(overlay);
|
|
117
|
+
this.overlayContainer = overlay;
|
|
118
|
+
return overlay;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Creates absolutely-positioned highlight rectangles for a single node
|
|
125
|
+
* position within a match.
|
|
126
|
+
*
|
|
127
|
+
* Uses client rectangle extraction from `Range` to handle multi-line matches (where a
|
|
128
|
+
* single text range may produce multiple rectangles due to line wrapping).
|
|
129
|
+
*
|
|
130
|
+
* @param {HTMLDivElement} overlay - The overlay container.
|
|
131
|
+
* @param {DOMRect} overlayRect - The overlay's bounding client rect (for coordinate conversion).
|
|
132
|
+
* @param {NodePosition} nodePosition - The node and character offsets for this segment.
|
|
133
|
+
* @param {string} bg - The background color to apply.
|
|
134
|
+
* @returns {Nullable<HTMLDivElement>} The first created highlight div for this node segment.
|
|
135
|
+
*/
|
|
136
|
+
createHighlightRectangles(overlay, overlayRect, nodePosition, bg) {
|
|
137
|
+
const domElement = stateEntityRenderingRegistry.getDOMByEntity(nodePosition.node);
|
|
138
|
+
if (!domElement) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
const range = this.buildRange(domElement, nodePosition);
|
|
142
|
+
if (!range) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
// eslint-disable-next-line spellcheck/spell-checker -- DOM API method name is fixed by platform.
|
|
146
|
+
const clientRectList = range.getClientRects();
|
|
147
|
+
const safeDocument = tryGetDocument();
|
|
148
|
+
let firstHighlightDiv = null;
|
|
149
|
+
if (safeDocument) {
|
|
150
|
+
for (let i = 0; i < clientRectList.length; i++) {
|
|
151
|
+
const rect = clientRectList[i];
|
|
152
|
+
if (rect.width === 0 || rect.height === 0) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
const div = safeDocument.createElement('div');
|
|
156
|
+
div.style.position = 'absolute';
|
|
157
|
+
div.style.top = `${rect.top - overlayRect.top}px`;
|
|
158
|
+
div.style.left = `${rect.left - overlayRect.left}px`;
|
|
159
|
+
div.style.width = `${rect.width}px`;
|
|
160
|
+
div.style.height = `${rect.height}px`;
|
|
161
|
+
div.style.backgroundColor = bg;
|
|
162
|
+
div.style.pointerEvents = 'none';
|
|
163
|
+
div.style.borderRadius = '2px';
|
|
164
|
+
overlay.appendChild(div);
|
|
165
|
+
if (!firstHighlightDiv) {
|
|
166
|
+
firstHighlightDiv = div;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return firstHighlightDiv;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Builds a DOM Range for the given node position.
|
|
174
|
+
*
|
|
175
|
+
* For standard text nodes (RTETextNode rendered as `<span>`), the first
|
|
176
|
+
* child is a Text node and offsets apply directly.
|
|
177
|
+
*
|
|
178
|
+
* For code block nodes (`<vega-code-block>` with shadow DOM), we traverse
|
|
179
|
+
* the shadow root's `<code>` element child spans to locate the correct
|
|
180
|
+
* text positions by accumulated character offset.
|
|
181
|
+
*
|
|
182
|
+
* @param {HTMLElement} domElement - The registered DOM element for the node.
|
|
183
|
+
* @param {NodePosition} nodePosition - The character offsets within the node.
|
|
184
|
+
* @returns {Nullable<Range>} A Range if successfully built, or null on failure.
|
|
185
|
+
*/
|
|
186
|
+
buildRange(domElement, nodePosition) {
|
|
187
|
+
// <vega-code-block> wraps syntax-highlighted tokens inside a shadow root <code> element.
|
|
188
|
+
if (nodePosition.node instanceof RTECodeBlockNode) {
|
|
189
|
+
return this.buildCodeBlockRange(domElement, nodePosition);
|
|
190
|
+
}
|
|
191
|
+
// Standard text node: <span> with a direct Text child.
|
|
192
|
+
const textNode = domElement.firstChild;
|
|
193
|
+
if (!textNode) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
const safeDocument = tryGetDocument();
|
|
197
|
+
if (safeDocument) {
|
|
198
|
+
const range = safeDocument.createRange();
|
|
199
|
+
try {
|
|
200
|
+
range.setStart(textNode, nodePosition.startOffset);
|
|
201
|
+
range.setEnd(textNode, nodePosition.endOffset);
|
|
202
|
+
return range;
|
|
203
|
+
}
|
|
204
|
+
catch (_a) {
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Builds a Range inside a `<vega-code-block>` shadow DOM element.
|
|
212
|
+
*
|
|
213
|
+
* `<vega-code-block>` renders its content inside a shadow root with a `<code>`
|
|
214
|
+
* element containing multiple child `<span>` nodes (one per syntax token).
|
|
215
|
+
* This method walks all Text nodes within that `<code>` element, accumulating
|
|
216
|
+
* character length until the positions corresponding to startOffset / endOffset
|
|
217
|
+
* are found.
|
|
218
|
+
*
|
|
219
|
+
* @param {HTMLElement} domElement - The `<vega-code-block>` host element.
|
|
220
|
+
* @param {NodePosition} nodePosition - The character offsets within the node.
|
|
221
|
+
* @returns {Range | null} A Range if successfully built, or null on failure.
|
|
222
|
+
*/
|
|
223
|
+
buildCodeBlockRange(domElement, nodePosition) {
|
|
224
|
+
const shadowRoot = domElement.shadowRoot;
|
|
225
|
+
const codeEl = shadowRoot.querySelector('code');
|
|
226
|
+
if (!codeEl) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const safeDocument = tryGetDocument();
|
|
230
|
+
if (safeDocument) {
|
|
231
|
+
const walker = safeDocument.createTreeWalker(codeEl, NodeFilter.SHOW_TEXT);
|
|
232
|
+
let accumulated = 0;
|
|
233
|
+
let startNode = null;
|
|
234
|
+
let startLocal = 0;
|
|
235
|
+
let endNode = null;
|
|
236
|
+
let endLocal = 0;
|
|
237
|
+
let current = walker.nextNode();
|
|
238
|
+
while (current) {
|
|
239
|
+
const len = current.textContent.length;
|
|
240
|
+
if (!startNode && accumulated + len > nodePosition.startOffset) {
|
|
241
|
+
startNode = current;
|
|
242
|
+
startLocal = nodePosition.startOffset - accumulated;
|
|
243
|
+
}
|
|
244
|
+
if (accumulated + len >= nodePosition.endOffset) {
|
|
245
|
+
endNode = current;
|
|
246
|
+
endLocal = nodePosition.endOffset - accumulated;
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
accumulated += len;
|
|
250
|
+
current = walker.nextNode();
|
|
251
|
+
}
|
|
252
|
+
if (startNode && endNode) {
|
|
253
|
+
const range = safeDocument.createRange();
|
|
254
|
+
try {
|
|
255
|
+
range.setStart(startNode, startLocal);
|
|
256
|
+
range.setEnd(endNode, endLocal);
|
|
257
|
+
return range;
|
|
258
|
+
}
|
|
259
|
+
catch (_a) {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
}
|