@heartlandone/vega 2.102.0 → 2.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-49c2a999.js → app-globals-85986306.js} +10 -10
- package/dist/cjs/{code-block-06e6591f.js → code-block-72de6c4d.js} +80 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-f29908f8.js → component-value-history-controller-slimmer.abstract-23d2b3d8.js} +3 -3
- package/dist/cjs/{content-state-8c862e5e.js → content-state-ff40bdc6.js} +38 -5
- package/dist/cjs/{date-required-rule-b672c432.js → date-required-rule-608e704b.js} +1 -1
- package/dist/cjs/{design-token-351ffd2c.js → design-token-a101a8d0.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-f932b166.js → element-appender-slimmer-b93cc564.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-5adb86ae.js → form-field-controller-slimmer-124d54ea.js} +1 -1
- package/dist/cjs/{image-annotation-action-25907d6b.js → image-annotation-action-1ee41bc7.js} +2 -2
- package/dist/cjs/{image-extension-1cf84f27.js → image-extension-6a92c524.js} +247 -5
- package/dist/cjs/index.cjs.js +17 -17
- package/dist/cjs/{inject-keyboard-manager-84d33920.js → inject-keyboard-manager-32d7dd0e.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-3c5236be.js → internal-calendar-period-factory-c3198ea7.js} +1 -1
- package/dist/cjs/{internal-translation-controller-eae8a8de.js → internal-translation-controller-0d67ca4d.js} +1 -0
- package/dist/cjs/{keyboard-manager-baa83a61.js → keyboard-manager-332eec89.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-d1974b28.js → keyboard-manager-slimmer-a2872981.js} +1 -1
- package/dist/cjs/{link-extension-2a6133b7.js → link-extension-1b4ed437.js} +3 -3
- package/dist/cjs/loader.cjs.js +12 -12
- package/dist/cjs/{month-view-generator-a6827548.js → month-view-generator-b6a2b8be.js} +1 -1
- package/dist/cjs/{public-rules-7f26e0ae.js → public-rules-2066613c.js} +7 -7
- package/dist/cjs/{range-518b95a2.js → range-712fe703.js} +1 -1
- package/dist/cjs/{responsive-format-facade-95c54444.js → responsive-format-facade-44d33457.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-5d0c76ec.js → rich-text-editor-required-rule-1aa75d22.js} +1 -1
- package/dist/cjs/{split-cell-operation-28f6f8d9.js → split-cell-operation-afc82323.js} +3 -3
- package/dist/cjs/{state-border-formatter-6c284859.js → state-border-formatter-49984fd6.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-f15b6196.js → string-format-strategy.abstract-bd563c01.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-5a3f1b55.js → string-input-formatter-slimmer-4faebac9.js} +1 -1
- package/dist/cjs/{string-mask-strategy-af6f3ba0.js → string-mask-strategy-624c4398.js} +2 -2
- package/dist/cjs/{style-formatter-324211fd.js → style-formatter-151d89a3.js} +2 -2
- package/dist/cjs/{time-required-rule-9e714442.js → time-required-rule-8cd8f9b9.js} +1 -1
- package/dist/cjs/{token-extension-86723cad.js → token-extension-72d0cb08.js} +1011 -767
- package/dist/cjs/{translation-slimmer-0227ee24.js → translation-slimmer-1771d01f.js} +1 -1
- package/dist/cjs/{type-guard-29e01bd4.js → type-guard-cce6fe1f.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-4ec364af.js → valid-credit-card-number-rule-b13c2fc4.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
- package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +8 -8
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-dialog_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +2 -2
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-numeric.cjs.entry.js +12 -14
- package/dist/cjs/vega-input-passcode.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
- package/dist/cjs/vega-input.cjs.entry.js +31 -27
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-popover_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-bookmark-editor.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +474 -207
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +1 -1
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +7 -7
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +12 -12
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-state-controller.js +0 -14
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +11 -2
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-renderer.js +11 -1
- package/dist/collection/components/vega-input/vega-input.js +52 -8
- package/dist/collection/components/vega-input-numeric/slimmers/renderers/vega-input-numeric-renderer.js +7 -1
- package/dist/collection/components/vega-input-numeric/vega-input-numeric.js +0 -8
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/sequential-composition-strategy.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/sequential-composition-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/dto/flush-changes-payload.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +3 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-block-strategy.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/chooser-positioner.js +107 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/paste-chooser-controller.js +91 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/paste-event-interceptor.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/controllers/selection-snapshot-service.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/image-extractor.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/paste-extension.js +41 -354
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/data-transfer-builder.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/paste-dispatcher.js +23 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/pipeline/paste-processing-pipeline.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/paste-processing-strategy.abstract.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/paste-strategy-selector.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/strategies/plain-paste-strategy.js +74 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/paste/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/helpers/utils.js +67 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.js +67 -11
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/backward-delete-content-handler.js +4 -17
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +34 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/forward-delete-content-handler.js +13 -32
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +60 -25
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +55 -19
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +165 -59
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +55 -21
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +2 -16
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +11 -1
- package/dist/collection/components/vega-rich-text-editor/utils/html-to-plain-text-utils.js +240 -0
- package/dist/collection/helpers/translation/locales/en.js +1 -0
- package/dist/esm/{app-globals-da5c83c2.js → app-globals-8cdfc5c9.js} +10 -10
- package/dist/esm/{code-block-d8f83d85.js → code-block-9360c331.js} +74 -2
- package/dist/esm/{component-value-history-controller-slimmer.abstract-642e7147.js → component-value-history-controller-slimmer.abstract-9ea58806.js} +3 -3
- package/dist/esm/{content-state-486eae1d.js → content-state-67a12e74.js} +38 -5
- package/dist/esm/{date-required-rule-08695d25.js → date-required-rule-66b5bf02.js} +1 -1
- package/dist/esm/{design-token-df3331d9.js → design-token-acd1efeb.js} +3 -3
- package/dist/esm/{element-appender-slimmer-f02a227f.js → element-appender-slimmer-7e5bc1e9.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-a7c0a0f8.js → form-field-controller-slimmer-d653c494.js} +1 -1
- package/dist/esm/{image-annotation-action-df744ba5.js → image-annotation-action-9525be48.js} +2 -2
- package/dist/esm/{image-extension-20b39140.js → image-extension-aea75132.js} +246 -6
- package/dist/esm/index.js +17 -17
- package/dist/esm/{inject-keyboard-manager-399ed867.js → inject-keyboard-manager-f6522d2f.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-7b866c3b.js → internal-calendar-period-factory-261df2f2.js} +1 -1
- package/dist/esm/{internal-translation-controller-4a7ee4d5.js → internal-translation-controller-3637e47e.js} +1 -0
- package/dist/esm/{keyboard-manager-f5d13a34.js → keyboard-manager-53e8d8d0.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-f40dcb54.js → keyboard-manager-slimmer-b3de042d.js} +1 -1
- package/dist/esm/{link-extension-3f93d70d.js → link-extension-57ba9520.js} +3 -3
- package/dist/esm/loader.js +12 -12
- package/dist/esm/{month-view-generator-0c665987.js → month-view-generator-15215a09.js} +1 -1
- package/dist/esm/{public-rules-470a1dac.js → public-rules-c77a1550.js} +7 -7
- package/dist/esm/{range-8e89fb54.js → range-3c74e1c8.js} +1 -1
- package/dist/esm/{responsive-format-facade-55131a33.js → responsive-format-facade-1b325d06.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-06caf383.js → rich-text-editor-required-rule-cfd32ba2.js} +1 -1
- package/dist/esm/{split-cell-operation-e158366a.js → split-cell-operation-85a036f9.js} +3 -3
- package/dist/esm/{state-border-formatter-2b73fa08.js → state-border-formatter-ce3495b0.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-8c7937e3.js → string-format-strategy.abstract-8ce04558.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-681c6b71.js → string-input-formatter-slimmer-0d60ba7d.js} +1 -1
- package/dist/esm/{string-mask-strategy-b8cceee6.js → string-mask-strategy-cabc1d50.js} +2 -2
- package/dist/esm/{style-formatter-fcd70869.js → style-formatter-00fe4f1c.js} +2 -2
- package/dist/esm/{time-required-rule-ce50859b.js → time-required-rule-57ceeae9.js} +1 -1
- package/dist/esm/{token-extension-2401e753.js → token-extension-645a9520.js} +1011 -767
- package/dist/esm/{translation-slimmer-b3f3cf65.js → translation-slimmer-b69057eb.js} +1 -1
- package/dist/esm/{type-guard-08c82e08.js → type-guard-204094c6.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-66bad519.js → valid-credit-card-number-rule-0874e19f.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +6 -6
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_5.entry.js +7 -7
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +2 -2
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-color-swatch-picker.entry.js +3 -3
- package/dist/esm/vega-color-swatch.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +8 -8
- package/dist/esm/vega-date-picker_2.entry.js +13 -13
- package/dist/esm/vega-dialog_2.entry.js +3 -3
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +7 -7
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +2 -2
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +5 -5
- package/dist/esm/vega-input-credit-card.entry.js +6 -6
- package/dist/esm/vega-input-numeric.entry.js +12 -14
- package/dist/esm/vega-input-passcode.entry.js +5 -5
- package/dist/esm/vega-input-phone-number.entry.js +4 -4
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +5 -5
- package/dist/esm/vega-input.entry.js +31 -27
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +8 -8
- package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
- package/dist/esm/vega-radio_2.entry.js +5 -5
- package/dist/esm/vega-rich-text-bookmark-editor.entry.js +2 -2
- package/dist/esm/vega-rich-text-content.entry.js +6 -6
- package/dist/esm/vega-rich-text-editor_4.entry.js +474 -207
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +1 -1
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-selection-tile_2.entry.js +2 -2
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +6 -6
- package/dist/esm/vega-table_11.entry.js +4 -4
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +9 -9
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +12 -12
- package/dist/sri/vega-sri-manifest.json +321 -321
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-state-controller.d.ts +0 -2
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.d.ts +4 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-renderer.d.ts +2 -0
- package/dist/types/components/vega-input/vega-input.d.ts +15 -3
- package/dist/types/components/vega-input-numeric/slimmers/renderers/vega-input-numeric-renderer.d.ts +2 -0
- package/dist/types/components/vega-input-numeric/vega-input-numeric.d.ts +0 -2
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/sequential-composition-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +4 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/sequential-composition-action.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/flush-changes-payload.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/chooser-positioner.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/paste-chooser-controller.d.ts +43 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/paste-event-interceptor.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/controllers/selection-snapshot-service.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/image-extractor.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/paste-image-parser.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/paste/parse-local-images-helper/pending-image-registry.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-chooser-ui.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/paste-extension.d.ts +28 -93
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/data-transfer-builder.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/paste-dispatcher.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/pipeline/paste-processing-pipeline.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/paste-processing-strategy.abstract.d.ts +28 -6
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/paste-strategy-selector.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/strategies/plain-paste-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/paste/type.d.ts +35 -0
- package/dist/types/components/vega-rich-text-editor/helpers/utils.d.ts +47 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.d.ts +17 -6
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/backward-delete-content-handler.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +30 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/forward-delete-content-handler.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.d.ts +21 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.d.ts +12 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +38 -5
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.d.ts +7 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/utils/html-to-plain-text-utils.d.ts +31 -0
- package/dist/types/components.d.ts +24 -0
- package/dist/types/helpers/translation/interface.d.ts +1 -0
- package/dist/types/types/public-api.d.ts +2 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-8a4cc7c2.entry.js → p-0169f71c.entry.js} +1 -1
- package/dist/vega/p-018bb83b.entry.js +1 -0
- package/dist/vega/{p-25e51acb.js → p-08bf08d2.js} +1 -1
- package/dist/vega/{p-85a940c0.entry.js → p-0b33753f.entry.js} +1 -1
- package/dist/vega/{p-a5fa260b.js → p-1537b1e4.js} +1 -1
- package/dist/vega/{p-7dfb1481.entry.js → p-17f6dc94.entry.js} +1 -1
- package/dist/vega/{p-dd673eb4.entry.js → p-1a4d1991.entry.js} +1 -1
- package/dist/vega/{p-557b64bd.js → p-1b2e5898.js} +1 -1
- package/dist/vega/{p-2256eb09.entry.js → p-1f1f93bf.entry.js} +1 -1
- package/dist/vega/{p-d86e0b01.js → p-1fb953f8.js} +1 -1
- package/dist/vega/{p-03efc67a.entry.js → p-2171b571.entry.js} +1 -1
- package/dist/vega/p-255fe20b.js +1 -0
- package/dist/vega/{p-cf5c5515.js → p-261cf764.js} +1 -1
- package/dist/vega/{p-f0b49ae4.entry.js → p-27e77ea1.entry.js} +1 -1
- package/dist/vega/{p-109f0e33.entry.js → p-28acbe42.entry.js} +1 -1
- package/dist/vega/{p-27c9c2a5.entry.js → p-2acc600a.entry.js} +1 -1
- package/dist/vega/p-2fc2299f.js +1 -0
- package/dist/vega/{p-b48caf90.entry.js → p-2ff659a1.entry.js} +1 -1
- package/dist/vega/{p-527c3211.entry.js → p-322da1eb.entry.js} +1 -1
- package/dist/vega/{p-dffe47db.js → p-3283fa2f.js} +1 -1
- package/dist/vega/p-3567dc55.entry.js +1 -0
- package/dist/vega/{p-c6419eb3.entry.js → p-36b795c6.entry.js} +1 -1
- package/dist/vega/p-37714a3a.js +1 -0
- package/dist/vega/{p-d7e59f31.js → p-3b4e2ba0.js} +1 -1
- package/dist/vega/{p-3d060d2f.entry.js → p-3b911043.entry.js} +1 -1
- package/dist/vega/{p-5c6d36ef.entry.js → p-3e270b65.entry.js} +1 -1
- package/dist/vega/{p-b68f55e2.js → p-4043508a.js} +1 -1
- package/dist/vega/p-4151d4a8.js +1 -0
- package/dist/vega/{p-c6b6987e.js → p-45af801f.js} +1 -1
- package/dist/vega/p-48c2150b.entry.js +1 -0
- package/dist/vega/p-4b253f74.entry.js +1 -0
- package/dist/vega/{p-75c7f8ea.entry.js → p-4cdc064d.entry.js} +1 -1
- package/dist/vega/{p-1d8a8507.entry.js → p-4e4b50f3.entry.js} +1 -1
- package/dist/vega/{p-d8fa2f19.entry.js → p-564110ba.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-bec31ffc.entry.js → p-608d3559.entry.js} +1 -1
- package/dist/vega/{p-3ce7521e.entry.js → p-64eb05d3.entry.js} +1 -1
- package/dist/vega/{p-2f5c4b61.entry.js → p-66bf209b.entry.js} +1 -1
- package/dist/vega/{p-83f5ef3a.entry.js → p-69eadbd8.entry.js} +1 -1
- package/dist/vega/{p-c66c6fd2.entry.js → p-6c4edee8.entry.js} +1 -1
- package/dist/vega/p-6e16bb3a.js +1 -0
- package/dist/vega/{p-7d748545.entry.js → p-76f4fdba.entry.js} +1 -1
- package/dist/vega/{p-4c6989ae.entry.js → p-7874055b.entry.js} +1 -1
- package/dist/vega/{p-ca60a74b.entry.js → p-7d3d24f6.entry.js} +1 -1
- package/dist/vega/{p-3bfb53e3.js → p-7f9ad7bc.js} +1 -1
- package/dist/vega/{p-18ddc6a4.entry.js → p-8193f4ef.entry.js} +1 -1
- package/dist/vega/{p-816064f2.entry.js → p-8197d172.entry.js} +1 -1
- package/dist/vega/{p-634b138c.entry.js → p-8ac0b1b2.entry.js} +1 -1
- package/dist/vega/{p-553510d8.entry.js → p-8c61db9d.entry.js} +1 -1
- package/dist/vega/{p-061a76c3.entry.js → p-8de29082.entry.js} +1 -1
- package/dist/vega/{p-325b804d.entry.js → p-8e59606f.entry.js} +1 -1
- package/dist/vega/p-8ea41806.js +1 -0
- package/dist/vega/{p-ff9090af.entry.js → p-9153c2f5.entry.js} +1 -1
- package/dist/vega/{p-a0c87e88.entry.js → p-92411f56.entry.js} +1 -1
- package/dist/vega/{p-049e64b1.entry.js → p-94d65dcf.entry.js} +1 -1
- package/dist/vega/{p-a261a675.entry.js → p-9a96fb05.entry.js} +1 -1
- package/dist/vega/{p-7044bb48.js → p-9fcfd738.js} +1 -1
- package/dist/vega/{p-b1e1c7d0.js → p-a2c7a3bc.js} +1 -1
- package/dist/vega/p-a2dcde12.js +1 -0
- package/dist/vega/{p-be0eb72f.js → p-a60d75d9.js} +1 -1
- package/dist/vega/{p-5a347a15.js → p-a9fc4043.js} +1 -1
- package/dist/vega/{p-efef0dfe.entry.js → p-abe5f7f0.entry.js} +1 -1
- package/dist/vega/{p-197388a5.entry.js → p-ac98c189.entry.js} +1 -1
- package/dist/vega/{p-dd273d89.entry.js → p-ade903b3.entry.js} +1 -1
- package/dist/vega/{p-c0eb8c58.js → p-affb40e8.js} +1 -1
- package/dist/vega/{p-277aab9b.js → p-b3a1cd22.js} +1 -1
- package/dist/vega/p-b63a90b3.entry.js +1 -0
- package/dist/vega/{p-f9f96030.entry.js → p-ba050d63.entry.js} +1 -1
- package/dist/vega/{p-bf0b46c1.js → p-ba67eb96.js} +1 -1
- package/dist/vega/{p-f0c6e9c5.entry.js → p-c08ac33f.entry.js} +1 -1
- package/dist/vega/{p-46be74fc.entry.js → p-c7ec97d1.entry.js} +1 -1
- package/dist/vega/{p-effbfc50.entry.js → p-ca1fe571.entry.js} +1 -1
- package/dist/vega/{p-408c3ad4.entry.js → p-cc9fc36a.entry.js} +1 -1
- package/dist/vega/{p-741e064e.entry.js → p-d044d54f.entry.js} +1 -1
- package/dist/vega/{p-0e0e66c9.entry.js → p-d3a9355c.entry.js} +1 -1
- package/dist/vega/p-d5a75228.js +1 -0
- package/dist/vega/{p-76135e80.entry.js → p-dc83fa6b.entry.js} +1 -1
- package/dist/vega/{p-92efdbf0.entry.js → p-dcfce26e.entry.js} +1 -1
- package/dist/vega/p-df9585f6.js +3 -0
- package/dist/vega/{p-f5f26b44.entry.js → p-e2c8a470.entry.js} +1 -1
- package/dist/vega/{p-23781e76.js → p-e33a954f.js} +1 -1
- package/dist/vega/{p-e577dda8.entry.js → p-e5fc6583.entry.js} +1 -1
- package/dist/vega/p-e668cf11.js +1 -0
- package/dist/vega/{p-0338f621.entry.js → p-e6b0a292.entry.js} +1 -1
- package/dist/vega/{p-381d8781.js → p-e84c2589.js} +1 -1
- package/dist/vega/{p-1b97e751.entry.js → p-eb945d34.entry.js} +1 -1
- package/dist/vega/{p-d8a0e3e0.entry.js → p-ebe1dd2b.entry.js} +1 -1
- package/dist/vega/{p-6beaf1c8.entry.js → p-f818bb20.entry.js} +1 -1
- package/dist/vega/p-f981cf2c.js +1 -0
- package/dist/vega/p-f9d09b0c.js +1 -0
- package/dist/vega/{p-4d20a56f.js → p-fdbdf12f.js} +1 -1
- package/dist/vega/{p-48100d38.entry.js → p-fee080b9.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-040bd9ca.js +0 -1
- package/dist/vega/p-087240db.js +0 -1
- package/dist/vega/p-15052b2e.entry.js +0 -1
- package/dist/vega/p-28c16885.js +0 -1
- package/dist/vega/p-30cc31dd.entry.js +0 -1
- package/dist/vega/p-3ec4d710.js +0 -1
- package/dist/vega/p-43ea1e86.js +0 -1
- package/dist/vega/p-7228088b.entry.js +0 -1
- package/dist/vega/p-7f711049.js +0 -1
- package/dist/vega/p-7fd15dd1.js +0 -1
- package/dist/vega/p-85695819.js +0 -1
- package/dist/vega/p-8e1f30ec.entry.js +0 -1
- package/dist/vega/p-9680dfe6.js +0 -1
- package/dist/vega/p-ae12cc3f.js +0 -3
- package/dist/vega/p-c0823f32.js +0 -1
- package/dist/vega/p-c5af2ecc.entry.js +0 -1
- package/dist/vega/p-fa43272c.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{f as t,q as e,h as n,l as s,s as r,E as i,N as a,p as o,F as l,G as c,J as h,A as u,k as d,j as w,K as p,I as f,g,M as m,c as T,R as x,S as b,b as O,L as y,O as E,P as A,Q as v,T as k,U as C,W as B,X as H,r as j,Y as N,Z as I,_ as S,$ as R,a0 as L,a1 as D,a2 as M,a3 as $,a4 as P,a5 as F,v as z,a6 as U,a7 as V,d as W,o as G,a8 as J,a9 as K,aa as Y,ab as _,ac as X,n as Q,ad as Z,ae as q,t as tt,af as et,ag as nt}from"./p-f9d09b0c.js";import{g as st}from"./p-8b5d3a52.js";import{i as rt}from"./p-fdbdf12f.js";import{C as it}from"./p-2d0d575f.js";import{d as at}from"./p-36a57431.js";import{c as ot,d as lt,e as ct}from"./p-53e3f259.js";import{r as ht,i as ut}from"./p-aa135628.js";import{c as dt}from"./p-a841cf13.js";import{L as wt}from"./p-6e1ab235.js";import{D as pt}from"./p-5c285374.js";class ft{}class gt{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter(rt)),e}}const mt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},Tt=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r],e))continue;let i=0;for(const a of n)if(i=a.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),o=new gt(a,n);1===i&&a.shouldProceedToElementChildren()&&o.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(o),r+=i-1;break}if(0===i&&r<t.length){const n=Array.from(t[r].childNodes),i=this.process(Array.from(n),e);i.length>0&&s.push(...i)}}return s}isInvalidElement(t,e){return t.nodeType===Node.COMMENT_NODE||!1!==e.autoMatchFormat&&["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return mt.getElementToBlockStrategies()}};class xt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class bt extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class Ot extends bt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class yt extends i{constructor(t,e){super(),this.type=a.IMAGE,this.size=t,this.alt=e}static from(t,e){return[a.IMAGE,new yt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return rt(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new yt(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e=yt.getDefaultStyles();switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}yt.BASE_STYLES={verticalAlign:"bottom"};class Et extends o{constructor(t,e,n,s){super(t,s),this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new Et(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:a}=i,o=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(i,["size"]),l=Object.assign(Object.assign({},o),{size:null!=a?a:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?yt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(rt)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof yt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new Et(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(a.IMAGE);return`<img${super.generateAttributeString(t,...[e&&e.alt?`alt="${h(e.alt)}"`:null,`src="${h(this.url)}"`,e&&e.size?`data-size="${e.size}"`:null].filter(rt))}>`}doAnnotationActionApply(t){const e=u.get(d.typeName,Et.typeName);e&&e.execute(t,this)}doModifyActionApply(t){u.executeTheStrategy(t,this)}}Et.typeName="RTEImageNode",u.register(w.UPDATE_IMAGE_NODE_URL,Et.typeName,new class extends t{handleAction(t,e){e.url=t.url}}),u.register(d.typeName,Et.typeName,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class At extends m{constructor(t,e){super(),this.type=w.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class vt extends O{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new vt(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>Et.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=super.generateAttributeString(t),n=this.children.map((e=>e.toHtml(t))).join("");return super.shouldRenderAsInternalWrapper()?n:[`<div${e}>`,n,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new vt(st())}clone(t){const e=new vt(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}vt.typeName="RTEImageBlock",u.register(w.MERGE_TWO_BLOCKS_NODES,vt.typeName,new y),u.register(w.REPLACE_CHILD_NODES,vt.typeName,new E),u.register(w.SPLIT_BLOCK_WITH_NODE,vt.typeName,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new p(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new f(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new g(t)),n}}),u.register(w.LINE_BREAK_SINGLE_BLOCK,vt.typeName,new class extends t{handleAction(t,e){const n=new At(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),u.register(w.LINE_BREAK_MULTIPLE_BLOCKS,vt.typeName,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=T.from({id:st(),type:"paragraph",nodes:[{id:st(),type:"text",text:"\n"}]});e.parent.apply(new f(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new x(st(),"\n",n)),n.apply(new g(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),u.register(w.INSERT_IMAGE_TO_BLOCK,vt.typeName,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new g(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new f(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new b(s,r)),e.parent.apply(new f(e,i)))}}),u.register(A.typeName,vt.typeName,new v);class kt extends m{constructor(t){super(),this.type=w.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Ct extends k{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new C(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],a=this.getPreviousNode(n);return a&&a.parent===e&&"\n"===a.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==a?void 0:a.parent)!==e?t.nextNode=i:t.previousNode=a))}}{let r=this.getPreviousNode(n),i=null;const a=n.isEmpty();if(e.children.length&&r&&r.parent!==e)a&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new kt(e));else if(this.isContentFirstNode(n)&&a&&(i=this.getNextNode(n)),a&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||a||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),a=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(a=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new kt(e))}i?t.previousNode=i:a&&(t.nextNode=a)}}class Bt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new f(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new b(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(a.LINK),e.apply(new g([n]))),e}}}class Ht extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=w.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class jt extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:a,startOffset:o}=r;if(a){const t=e;if(a.isContentEditable()&&a.isTextNode())if("\n"!==a.text&&a.text&&0!==o){const e=a.text.substring(0,o),r=a.text.substring(o),l=a.cloneWithText(e),c=a.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(a,...h)),t.apply(new s(a))}else t.apply(new n(a,i));else t.apply(0!==o?new f(a,i):new n(a,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ht(t))}}class Nt extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,a=this.createNewParagraph(s);if(a){const t=a.children[0];e.apply(0!==r?new f(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ht(t))}}class It extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new g([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new b(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=T.from({id:st(),type:"paragraph",nodes:[]});return r.apply(new g(t.children)),n.apply(new f(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new f(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new f(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(a.LINK),e}}class St extends B{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof j?t.entityToBeRemoved:null,a=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&a>=0&&this.promoteNestListsToUpperLevel(i,e,a),super.handleAction(t,e);const o=e.parent;if(0===e.children.length&&o)if("list-item"===o.type){const t=o;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new H(e))}else o.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const a=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let o=s+1;const l=[];a.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(o,0,...n),o+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof j){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new N(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new f(e,...l));t.apply(new N([]))}}class Rt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let a=e;const o=s[0],l=1===s.length&&r instanceof x&&!["RTEListBlock","RTEHtmlBlock"].includes(o.typeName)&&o.children.length>0&&o.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new b(r,i);e.apply(n),e.parent.apply(new f(e,...s)),a=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=a}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],a=i.children,o=s,l=e.children.indexOf(o);if(-1===l){const a=new b(s,r);return e.apply(a),e.parent.apply(new f(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=o.text.slice(0,r),h=o.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(o.cloneWithText(c)),h&&d.unshift(o.cloneWithText(h)),e.apply(new p([...u,...a,...d]));const w=a[a.length-1];t.futureFocusBlock=e,t.futureFocusNode=w,w.isTextNode()&&(t.futureFocusNodeOffset=w.text.length)}}const Lt=new class{registerBlockBasicStrategies(t){u.register(w.DELETE_CHILDREN,t,t===I.typeName?new St:new B),u.register(w.APPEND_CHILDREN,t,new xt),u.register(w.INSERT_CHILDREN_BEFORE,t,new bt),u.register(w.INSERT_CHILDREN_AFTER,t,new Ot),u.register(w.DELETE_BLOCK_CONTENT,t,new Ct),u.register(w.INSERT_NEW_PARAGRAPH,t,t===j.typeName?new It:new Bt),u.register(w.INSERT_TEXT_TO_DECORATOR_NODE,t,new Nt),u.register(w.INSERT_NODE_TO_NEAREST_ROOT,t,new jt),u.register(w.PASTE_CONTENT,t,new Rt)}};class Dt{}class Mt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===S||t.style.fontWeight===R||t.classList.contains("v-rte--bold")}}class $t extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class Pt extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class Ft extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=L(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class zt extends Dt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.typeName)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Ut extends Dt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.typeName)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class Vt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Wt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ht(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=D.filter((t=>t.key!==M.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of D)if(t.style.color.includes(e.key))return e.key;return null}}class Gt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Jt extends Dt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.typeName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByClassName(t);if(n)return n;const s=this.getElementTypeByNodeName(t);if(s)return s;return this.getElementTypeByFontSize(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"P":return"paragraph";case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte-(?:-text-style-)?(title|subtitle|heading-1|heading-2|heading-3|heading-4|heading-5|heading-6|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class Kt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Kt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Kt.textStyleHandler=new Jt;class Yt extends Dt{constructor(){super(...arguments),this.handlers=[new $t,new Pt,new Ft]}canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return e.link?{link:e.link}:Kt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:st()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class _t extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(P)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Xt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(F)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Qt extends Dt{canHandle(t){return"RTEImageNode"===t.typeName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Zt extends Dt{canHandle(t){return"RTEImageNode"===t.typeName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),te=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),ee=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),ne=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),se=new Set(["ABBR","B","BDI","BDO","CITE","DEL","DFN","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]);function re(t){return qt.has(t.parentElement.nodeName)}class ie extends Dt{constructor(){super(...arguments),this.customAttributeHandler=new $t,this.customStyleAnnotationHandler=new Ft,this.customClassAnnotationHandler=new Pt}canHandle(t,e){return"RTETextNode"===t.typeName&&!1===e.autoMatchFormat}handle(t,e){if(te.has(t.nodeName)&&!ee.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!x.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:st()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ae=new class{constructor(){this.handlers=[new Ut,new zt,new Mt,new Gt,new Xt,new _t,new Wt,new Yt,new Vt,new Qt,new Zt,new $t,new Pt,new Ft,new Jt,new ie]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&z.executeTheStrategyRefillAction(t.typeName,e);const s=Kt.isLinkElement(e)&&"RTETextNode"===t.typeName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Yt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=z.getStrategies(t.typeName);for(const t of i)(n.autoMatchFormat||t.alwaysFilter)&&t.filterAnnotations(r);return r}removeTextStyleDefaultsFromCustomStyle(t){const e="textStyle"in t?t.textStyle:void 0,n=t.customStyle;if(!e||!n)return t;const s=U.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class oe extends ft{constructor(){super(...arguments),this.annotationHandler=new Jt}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const a=mt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let o=null;if(a&&(o=a.handle([t],n,i)),o)s.push(o);else if(ut(t)&&t.childNodes.length>0){const a=ae.generate(x,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),a,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class le extends oe{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||te.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Kt.isTitleOrSubtitle(s)?0:1}handle(t,e){return V.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}isInlineTagWithoutBlockChildren(t,e){if(ee.has(t.nodeName)&&0===t.childNodes.length)return!0;if(re(t))return!(0===t.childNodes.length&&""===t.textContent&&!ee.has(t.nodeName)&&!se.has(t.nodeName));const n=Array.from(t.childNodes);return!(n.some((t=>t.nodeType===Node.ELEMENT_NODE))||!n.some((t=>t.nodeType===Node.TEXT_NODE)))&&(!1!==e.autoMatchFormat||!ne.has(t.parentElement.nodeName)&&(se.has(t.nodeName)||ee.has(t.nodeName)))}shouldFallBackToHtmlBlock(t){const e=Array.from(t.childNodes);if(0===e.length)return!1;const n=t.parentElement.nodeName;return"UL"!==n&&"OL"!==n&&e.every((t=>t.nodeType===Node.ELEMENT_NODE&&""===t.textContent&&!ee.has(t.nodeName)&&!se.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:st(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ae.generate(V,t,e),children:[]}}}class ce extends oe{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:st(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class he extends oe{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return vt.from({id:st(),type:"image",nodes:[{id:st(),type:"image",url:t.src,annotations:ae.generate(Et,t,e)}],annotations:Object.assign(Object.assign({},ae.generate(vt,t.parentElement,e)),{internalWrapper:n})},e)}}class ue extends ft{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:st(),type:"text",text:t,annotations:e}}}class de extends G{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=Y.getDefaultStyles(e),super.filterAnnotations(t)):t}}class we extends G{constructor(){super(...arguments),this.stylesToBeFiltered=U.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return J.isTextBlock(t.typeName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return J.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class pe extends we{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=U.getDefaultStyles(this.type)}}class fe extends we{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=U.getDefaultStyles(this.type)}}class ge extends G{constructor(){super(...arguments),this.stylesToBeFiltered=ge.BOLD_STYLES,this.elementTagName="span",this.parentBlockTypes=["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title"],this.parentElementSelectors=["h1","h2","h3","h4","h5","h6",".v-rte-title"],this.toBeCheckedSelector=this.parentElementSelectors.join(",")}filterAnnotations(t){return t}filterAndDeleteStyles(t,e,n){var s;const r=super.filterAndDeleteStyles(t,e);return this.isExplicitlyNonBold(n)&&void 0===(null===(s=r.styles)||void 0===s?void 0:s.fontWeight)&&(r.styles=Object.assign(Object.assign({},r.styles),{fontWeight:ge.NON_BOLD_FONT_WEIGHT})),r}canFilter(t){return J.isTextNode(t.typeName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return J.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${ge.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}isExplicitlyNonBold(t){var e;const n=null===(e=t)||void 0===e?void 0:e.getAnnotationByType(a.BOLD);return!1===(null==n?void 0:n.bold)}parentBlockIsHeadingOrTitle(t){const e=t.parent;return!!e&&this.parentBlockTypes.includes(e.type)}isHeadingOrTitleChild(t){let e=t.parentElement;for(;e;){if(e.matches(this.toBeCheckedSelector))return!0;if(ge.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}ge.BOLD_STYLES={fontWeight:"700"},ge.NON_BOLD_FONT_WEIGHT=X,ge.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class me extends pe{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return J.isListItemBlock(t.typeName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return J.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class Te extends fe{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return J.isListItemBlock(t.typeName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return J.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}Q.registerRTEDTOClass("paragraph",T),Q.registerRTEDTOClass("title",T),Q.registerRTEDTOClass("subtitle",T),Q.registerRTEDTOClass("heading-1",T),Q.registerRTEDTOClass("heading-2",T),Q.registerRTEDTOClass("heading-3",T),Q.registerRTEDTOClass("heading-4",T),Q.registerRTEDTOClass("heading-5",T),Q.registerRTEDTOClass("heading-6",T),Q.registerRTEDTOClass("heading-6",T),Q.registerRTEDTOClass("list-item",j),Q.registerRTEDTOClass("bullet-list",I),Q.registerRTEDTOClass("number-list",I),Q.registerRTEDTOClass("image",vt),Q.registerRTEDTOClass("code-block",e),Q.registerRTEDTOClass("html-block",V),Q.registerRTEDTOClass("text",x),Q.registerRTEDTOClass("image",Et),Lt.registerBlockBasicStrategies(T.typeName),Lt.registerBlockBasicStrategies(I.typeName),Lt.registerBlockBasicStrategies(j.typeName),Lt.registerBlockBasicStrategies(vt.typeName),Lt.registerBlockBasicStrategies(V.typeName),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?ae.generate(x,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),a=!s&&!i;return T.from(Object.assign({id:st(),type:i||"paragraph",nodes:r},a?{annotations:{internalWrapper:a}}:{annotations:ae.generate(T,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!this.isBlockBoundaryElement(t,e)&&(!!ee.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!re(t))||this.isInlineLeafOrWrapper(t)))}isBlockBoundaryElement(t,e){var n;return!!t.hasAttribute(W)||!!(null===(n=e.blockBoundaryRegistry)||void 0===n?void 0:n.isBoundary(t))}isDedicatedBlockTag(t){return te.has(t)&&!ee.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?se.has(t.nodeName):this.isTextOnlyElement(t)?se.has(t.nodeName)||ee.has(t.nodeName):this.hasOnlyInlineDescendants(t)}isTextOnlyElement(t){const e=Array.from(t.childNodes);return!e.some((t=>t.nodeType===Node.ELEMENT_NODE))&&e.some((t=>t.nodeType===Node.TEXT_NODE))}hasOnlyInlineDescendants(t){for(let e=0;e<t.children.length;e++){const n=t.children[e];if(this.isDedicatedBlockTag(n.nodeName))return!1;if(!n.hasChildNodes())return!1;if(!this.hasOnlyInlineDescendants(n))return!1}return!0}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if(rt(s))return vt.from({id:st(),type:"image",nodes:[{id:st(),type:"image",url:s.src,annotations:ae.generate(Et,n,e)}],annotations:ae.generate(vt,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:T.from({id:st(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:ae.generate(T,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?j.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return I.from({id:st(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:st(),type:"list-item",annotations:ae.generate(j,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ae.generate(x,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),a=rt(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&a?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return j.from({id:st(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:I.from({id:st(),type:"number-list",blocks:[],annotations:ae.generate(I,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof j)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:I.from({id:st(),type:"bullet-list",blocks:[],annotations:ae.generate(I,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof j)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),mt.registerElementToBlockStrategy(new le),
|
|
2
|
+
//!important: Code block strategies must be registered after HtmlBlockStrategy because registerElementToBlockStrategy uses unshift, giving later registrations higher priority.
|
|
3
|
+
mt.registerElementToBlockStrategy(new ce),mt.registerElementToBlockStrategy(new class extends ce{canHandle(t,e){return"VEGA-CODE-BLOCK"===t[e].tagName&&0==!!t[e].querySelector("vega-code-block")||this.isCodeBlockContainer(t[e])?1:0}handle(t){const e=this.isCodeBlockContainer(t[0])?t[0].querySelector("vega-code-block"):t[0],n=e.querySelector("code");if(n)return super.handle([n]);if(e.hasAttribute("data-content")){const t=document.createElement("code");return t.textContent=e.dataset.content,t.dataset.language=e.dataset.language,super.handle([t])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(t){return"PRE"===t.tagName&&t.classList.contains("code-block-container")&&1===t.querySelectorAll("vega-code-block").length}}),mt.registerElementToNodeStrategy(new class extends ue{canHandle(t,e){const n=t[e];return!ut(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,n){const s=!(!e||!1!==e.autoMatchFormat),r=Object.assign({},n),i=t[0],a=ae.generate(x,i,Object.assign({parentAnnotations:s?{inlineHtml:r.inlineHtml,link:r.link,code:r.code}:n},e));if("BR"===i.nodeName){const{inlineHtml:t}=a,e=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(a,["inlineHtml"]);return this.generateTextNode("\n",t&&"br"===t.htmlTag?e:a)}if(0===i.childNodes.length){const t=s?dt(Object.assign(Object.assign({},x.supportsHtmlTag(i.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml})):a;return Object.assign({},this.generateTextNode("",t))}}}),mt.registerElementToNodeStrategy(new class extends ue{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,n){const s=Object.assign({},n),r=!(!e||!1!==e.autoMatchFormat),i=t[0],a=i.parentNode.nodeName.toLowerCase(),o=r&&!x.supportsHtmlTag(a),l=this.generateTextNode(String(i.textContent),r?dt(Object.assign(Object.assign({},"span"===a?s:{link:s.link,code:"code"===a?s.code:void 0}),{inlineHtml:s.inlineHtml,plainText:o||void 0})):s);return Object.assign({},l)}}),z.register(T.typeName,new de),z.register(I.typeName,new de),z.register(j.typeName,new de),z.register(x.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const e=t,n=e.customStyle;if(!n)return t;e.bold&&n.fontWeight===R&&delete n.fontWeight,e.italic&&n.fontStyle===$&&delete n.fontStyle;const s=this.normalizeTextDecoration(n.textDecoration);return s&&this.shouldRemoveTextDecoration(s,e)&&delete n.textDecoration,0===Object.keys(n).length&&delete e.customStyle,t}normalizeTextDecoration(t){if(!t)return;const e=t.trim().toLowerCase().split(/\s+/);return e.some((t=>t!==F&&t!==P))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(F),e.strikethrough&&n.push(P),0!==n.length&&t===n.sort().join(" ")}}),z.register(T.typeName,new we),z.register(T.typeName,new pe(1)),z.register(T.typeName,new pe(2)),z.register(T.typeName,new pe(3)),z.register(T.typeName,new pe(4)),z.register(T.typeName,new pe(5)),z.register(T.typeName,new pe(6)),z.register(T.typeName,new fe("title")),z.register(T.typeName,new fe("subtitle")),z.register(x.typeName,new ge),z.register(x.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered=_.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return J.isCodeNode(t)}canRefill(t,e){return J.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${G.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),z.register(x.typeName,new Z),z.register(Et.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered=yt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return J.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),z.register(e.typeName,new q),z.register(tt.typeName,new et),z.register(I.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered=K.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return J.isListBlock(t.typeName)}canRefill(t,e){return J.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){const t=G.RTE_CONTENT_CONTAINER_CLASS_NAME,e=this.elementTagName.split(",").map((t=>t.trim())),n=e.map((e=>`.${t} ${e}`)).join(", "),s=e.map((e=>`.${t} ${e} > li::marker`)).join(", "),r=this.convertStylesMapToCssText(K.getDefaultMarkerStyles());return`${n} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} } ${s} { ${r} }`}}),z.register(j.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered=U.getDefaultStyles("paragraph"),this.elementTagName="li",this.headingOrTitleClassNamePattern=/^v-rte-(h[1-6]|title|subtitle)$/}canFilter(t){const e=!t.getStyles().fontSize||this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"]);return J.isListItemBlock(t.typeName)&&e}canRefill(t,e){return J.isListItemBlock(t)&&e.matches(this.elementTagName)&&this.isElementNotHeadingOrTitle(e)}toCssText(){return this.buildCssTextForStyles(this.elementTagName)}isElementNotHeadingOrTitle(t){return!t.className.split(" ").some((t=>this.headingOrTitleClassNamePattern.test(t.trim())))}}),z.register(j.typeName,new me(1)),z.register(j.typeName,new me(2)),z.register(j.typeName,new me(3)),z.register(j.typeName,new me(4)),z.register(j.typeName,new me(5)),z.register(j.typeName,new me(6)),z.register(j.typeName,new Te("title")),z.register(j.typeName,new Te("subtitle"));class xe{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new be(e)}}class be{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(ut(t)){const e=t.getAttribute("data-style");e&&(t.style.cssText=e,t.removeAttribute("data-style")),t.children.length>0&&this.walkNodes(Array.from(t.children))}}))}}class Oe{process(t){return t.replace(/(<[^>]+>)(\s+)(<[^>]+>)/g,((t,e,n,s)=>{const r=this.extractOpeningTagName(e),i=this.extractClosingTagName(s);return r&&i&&r===i?`${e}${n}${s}`:`${e}${s}`}))}extractOpeningTagName(t){const e=t.match(/<(\w[\w-]*)/);return e?e[1]:null}extractClosingTagName(t){const e=t.match(/<\/(\w[\w-]*)/);return e?e[1]:null}}class ye{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Ee{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class Ae{constructor(){this.processors=[new Oe,new ye,new Ee]}clean(t){if(!t||0===t.trim().length)return t;let e,n=t;do{e=n;for(const t of this.processors)n=t.process(n)}while(n!==e);return n}}const ve="COMMIT_VALUE";class ke extends m{constructor(t,e,n){super(),this.candidate=t,this.previous=e,this.host=n,this.isFlushable=!1,this.type="COMMIT_VALUE"}}class Ce extends pt{constructor(t){super(),t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=Q.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new Ce(n)}static createEmptyContent(t={autoMatchFormat:!0}){return Ce.fromJSON([{id:st(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:st(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new Ae).clean(t),s=xe.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,a=Array.from(i.childNodes);s.restore(a);const o=Tt.process(a,e).filter(rt).map((t=>t.toDto(e))).filter(rt);return new Ce(o)}static generateContentStyles(t){return z.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new Ce(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(rt(t.autoMatchFormat)||rt(t.skipCustomAnnotations))&&wt.warn("The 'options' parameter's properties 'autoMatchFormat' and 'skipCustomAnnotations' in toHtml method are deprecated and will be removed in the future."),this.isEmpty()?"":this.children.map((e=>e.toHtml({filterInlineStyles:null==t?void 0:t.filterInlineStyles}))).join("")}isEmpty(){return 0===this.children.length||1===this.children.length&&!this.children[0].isNotEmpty()}apply(t){var e;if(u.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const n=r.getDOMByEntity(this);n&&it.notify(at.getSubject(n,ct),null!==(e=t.flushPayload)&&void 0!==e?e:{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}getPlainText(){return this.children.map((t=>t.getPlainText())).join("")}toListItem(t){var e;t.children.map((t=>t.apply(new nt)));const n=new j(st());return n.apply(new g(t.children)),n.annotationMap=t.annotationMap,t instanceof j&&(null===(e=t.nestList)||void 0===e?void 0:e.length)&&(n.apply(new N([...t.nestList])),t.apply(new N([]))),n}createList(t){return new I(st(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.children)}findNodeInBlocksById(t,e){for(const n of e){if("children"in n)for(const e of n.children)if(e.id===t)return e;if(n instanceof j&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof I&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}Ce.typeName="VegaRTEContent",u.register(w.DELETE_CHILDREN,Ce.typeName,new B),u.register(w.APPEND_CHILDREN,Ce.typeName,new xt),u.register(w.INSERT_CHILDREN_BEFORE,Ce.typeName,new bt),u.register(w.INSERT_CHILDREN_AFTER,Ce.typeName,new Ot),u.register(w.TRANSFORM_TO_CODE_BLOCK,Ce.typeName,new class extends t{handleAction(t,s){const r=t.selectedBlocks,i=new e(st(),this.getCodeContent(r),"plainText");s.apply(new n(r[0],i)),t.newCodeBlock=i,this.removeSelectBlocks(r,s)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new s(t[n]))}}),u.register(w.UPDATE_CURSOR_POSITION,Ce.typeName,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:i}=t,a=r.getDOMByEntity(e);a&&it.notify(at.getSubject(a,ot),{node:s,offset:n,updateDirectly:i})}}),u.register(w.DELETE_SELECTED_CONTENT,Ce.typeName,new class extends t{handleAction(t){const{host:e,mergeFlag:n}=t;it.notify(at.getSubject(e,lt),{host:e,detail:n})}}),u.register("COMMIT_VALUE",Ce.typeName,new class extends t{handleAction(t){return t.candidate}}),u.register(w.SEQUENTIAL_COMPOSITION,Ce.typeName,new class extends t{handleAction(t){const e=new Map,n={getAction:t=>e.get(t)};t.steps.forEach((t=>{const s="function"==typeof t?t(n):t;s&&(Array.isArray(s)?s:[s]).forEach((t=>{t.action.isFlushable=!1,t.target.apply(t.action),e.set(t.action.type,t.action)}))}))}});export{Dt as A,oe as B,ve as C,ft as E,le as H,At as I,kt as M,Rt as P,vt as R,xe as S,Ht as U,Ce as V,bt as a,Et as b,Lt as c,mt as d,yt as e,ke as f,Tt as g,ae as h}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as a,H as i,g as s}from"./p-6b2342e0.js";import{c as n,V as l,I as r}from"./p-6e1ab235.js";import{V as o,I as p}from"./p-5c8e4e8f.js";import{s as c}from"./p-519a7d55.js";import{c as d}from"./p-3b6a6f08.js";import{c as f,b as h}from"./p-a83cef5a.js";import{V as m}from"./p-44245a36.js";import{c as v}from"./p-1ec763ab.js";import{c as g}from"./p-613ddaab.js";import{x as b}from"./p-b6225d01.js";import{D as _}from"./p-36a57431.js";import{V as u}from"./p-
|
|
1
|
+
import{h as e,r as t,c as a,H as i,g as s}from"./p-6b2342e0.js";import{c as n,V as l,I as r}from"./p-6e1ab235.js";import{V as o,I as p}from"./p-5c8e4e8f.js";import{s as c}from"./p-519a7d55.js";import{c as d}from"./p-3b6a6f08.js";import{c as f,b as h}from"./p-a83cef5a.js";import{V as m}from"./p-44245a36.js";import{c as v}from"./p-1ec763ab.js";import{c as g}from"./p-613ddaab.js";import{x as b}from"./p-b6225d01.js";import{D as _}from"./p-36a57431.js";import{V as u}from"./p-affb40e8.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-29584bb5.js";import"./p-b75ee3ba.js";import"./p-d1d91f1a.js";import"./p-5c285374.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-aa135628.js";import"./p-cb378636.js";var x=function(e,t,a,i){var s,n=arguments.length,l=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,a,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(l=(n<3?s(l):n>3?s(t,a,l):s(t,a))||l);return n>3&&l&&Object.defineProperty(t,a,l),l};class j extends l{render(){const t=this.total>0;return e("div",{class:"find-replace-panel",role:"presentation"},this.renderHeader(),e("vega-divider",{direction:"horizontal"}),e("div",{class:"find-replace-panel__field"},e("vega-field-label",{label:u.t("Find in text")}),e("div",{class:"find-replace-panel__body"},e("vega-input",{size:"small",label:"","data-aria-label":u.t("Find in text"),class:"find-replace-panel__input",ref:e=>{e&&_.addUniqueObserverToNode(e,f,(e=>{this.onKeywordChange(e.detail)}))}}),e("vega-flex",{alignItems:"center",gap:"size-4",class:"find-replace-panel__nav"},e("vega-font",{variant:"font-field-label-sm",color:"text-secondary",class:"find-replace-panel__counter"},t?`${this.currentIndex}/${this.total}`:"-/-"),this.renderNavButton("prev","rte-find-replace-prev",u.t("Previous match")),this.renderNavButton("next","rte-find-replace-next",u.t("Next match"))))),e("div",{class:"find-replace-panel__field"},e("vega-field-label",{label:u.t("Replace with")}),e("div",{class:"find-replace-panel__body"},e("vega-input",{disabled:!t,size:"small",label:"","data-aria-label":u.t("Replace with"),class:"find-replace-panel__input",ref:e=>{e&&_.addUniqueObserverToNode(e,f,(e=>{this.onReplacementChange(e.detail)}))}}))),e("vega-accordion",{class:"find-replace-panel__field",expand:!1,drawsBackground:!1},e("div",{class:"find-replace-panel__accordion-title",slot:"title"},u.t("Advanced options")),e("vega-flex",{slot:"content",gap:"size-16",class:"advanced-options-content"},this.renderSearchOptionToggle("match-case",u.t("Match case"),this.matchCase),this.renderSearchOptionToggle("whole-words",u.t("Whole words"),this.wholeWords))),e("div",{class:"find-replace-panel__footer"},this.renderActionButtons()))}renderHeader(){return e("div",{class:"find-replace-panel__header"},e("vega-font",null,u.t("Find and replace")),this.renderNavButton("close","rte-find-replace-close",u.t("Close"),"extra-small"))}renderNavButton(t,a,i,s){return e("vega-button-circle",{ref:e=>{e&&_.addUniqueObserverToNode(e,h,(()=>{this.emitAction(t)}))},variant:"icon-only",size:s||"small",icon:m.getIconKey(a),label:i})}renderSearchOptionToggle(t,a,i){return e("vega-toggle-switch",{size:"small",label:a,checked:i,ref:e=>{e&&_.addUniqueObserverToNode(e,f,(()=>{this.onToggleSearchOption(t)}))}})}renderFindButton(){return e("vega-button",{size:"small",variant:"secondary",ref:e=>{e&&_.addUniqueObserverToNode(e,h,(()=>{this.emitAction("find")}))}},u.t("Find"))}renderActionButtons(){const t=0===this.total;return e("vega-flex",{alignItems:"center",gap:"size-16"},e("vega-button-link",{size:"small",disabled:t,ref:e=>{e&&_.addUniqueObserverToNode(e,h,(()=>{this.emitAction("replace-all")}))}},u.t("Replace All")),e("vega-button-link",{size:"small",disabled:t,ref:e=>{e&&_.addUniqueObserverToNode(e,h,(()=>{this.emitAction("replace")}))}},u.t("Replace")),this.renderFindButton())}onKeywordChange(e){this.changeEventEmitter.emit({type:"keyword",value:e})}onReplacementChange(e){this.changeEventEmitter.emit({type:"replace",value:e})}onToggleSearchOption(e){"match-case"===e?(this.matchCase=!this.matchCase,this.emitAction(e,this.matchCase)):"whole-words"===e&&(this.wholeWords=!this.wholeWords,this.emitAction(e,this.wholeWords))}emitAction(e,t){this.clickEventEmitter.emit(void 0!==t?{action:e,data:t}:{action:e})}}m.register({"rte-find-replace-prev":v,"rte-find-replace-next":g,"rte-find-replace-close":b}),x([n()],j.prototype,"changeEventEmitter",void 0),x([n()],j.prototype,"clickEventEmitter",void 0),x([n()],j.prototype,"currentIndex",void 0),x([n()],j.prototype,"total",void 0),x([n({writable:!0})],j.prototype,"matchCase",void 0),x([n({writable:!0})],j.prototype,"wholeWords",void 0);var w=function(e,t,a,i){var s,n=arguments.length,l=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,a,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(l=(n<3?s(l):n>3?s(t,a,l):s(t,a))||l);return n>3&&l&&Object.defineProperty(t,a,l),l};const y=class{constructor(e){t(this,e),this.vegaChange=a(this,"vegaChange",7),this.vegaClick=a(this,"vegaClick",7),this.globalSlimmers=new Map,this.vegaComponentUsageRuntimeMetricsSlimmer=new o,this.changeEventEmitter=d(y,f),this.clickEventEmitter=d(y,h),this.renderer=new j,this.currentIndex=0,this.total=0,this.matchCase=!1,this.wholeWords=!1}async updateResult(e,t){this.currentIndex=e,this.total=t}render(){return c(e(i,null,this.renderer.render()),this.host)}get host(){return s(this)}};w([p()],y.prototype,"globalSlimmers",void 0),w([r()],y.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),w([r()],y.prototype,"changeEventEmitter",void 0),w([r()],y.prototype,"clickEventEmitter",void 0),w([r()],y.prototype,"renderer",void 0),y.style=":host .find-replace-panel{box-sizing:border-box;width:360px}:host .find-replace-panel__header{display:flex;align-items:center;justify-content:space-between;padding-bottom:12px}:host .find-replace-panel__field{padding-top:12px}:host .find-replace-panel__body{display:flex;align-items:center;gap:8px;margin-top:8px}:host .find-replace-panel__input{flex:1}:host .find-replace-panel__nav{flex-shrink:0}:host .find-replace-panel__counter{white-space:nowrap;min-width:36px;text-align:center}:host .find-replace-panel__footer{display:flex;justify-content:flex-end;padding-top:20px}:host .advanced-options-content{margin-top:-12px}:host .find-replace-panel__accordion-title{font-size:16px;font-weight:500;color:rgba(var(--v-text-primary, 32, 54, 69, 1));line-height:22px;padding:0}";export{y as vega_rich_text_find_replace_panel}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as e,V as t}from"./p-6e1ab235.js";import{K as c}from"./p-
|
|
1
|
+
import{M as e,V as t}from"./p-6e1ab235.js";import{K as c}from"./p-1fb953f8.js";var n=function(e,t,c,n){var o,l=arguments.length,a=l<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,c):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,c,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(l<3?o(a):l>3?o(t,c,a):o(t,c))||a);return l>3&&a&&Object.defineProperty(t,c,a),a};class o extends t{constructor(e){super(),this.keyboardEventListeners=[],this.listenersRetriever=e}connectedCallback(){c.register(this.keyboardEventListeners)}disconnectedCallback(){c.deregister(this.keyboardEventListeners)}componentDidLoad(){this.keyboardEventListeners=this.listenersRetriever(this),c.register(this.keyboardEventListeners)}}n([e("connectedCallback")],o.prototype,"connectedCallback",null),n([e("disconnectedCallback")],o.prototype,"disconnectedCallback",null),n([e("componentDidLoad")],o.prototype,"componentDidLoad",null);export{o as K}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as r,r as e,c as t,H as o,g as s}from"./p-6b2342e0.js";import{V as a,I as i}from"./p-5c8e4e8f.js";import{c as l,V as c,I as h}from"./p-6e1ab235.js";import{s as d}from"./p-519a7d55.js";import{T as n}from"./p-fb5ea4b2.js";import{c as b}from"./p-8387896e.js";import{i as p}from"./p-29584bb5.js";import{c as v}from"./p-3b6a6f08.js";import{b as w}from"./p-a83cef5a.js";import{T as f}from"./p-
|
|
1
|
+
import{h as r,r as e,c as t,H as o,g as s}from"./p-6b2342e0.js";import{V as a,I as i}from"./p-5c8e4e8f.js";import{c as l,V as c,I as h}from"./p-6e1ab235.js";import{s as d}from"./p-519a7d55.js";import{T as n}from"./p-fb5ea4b2.js";import{c as b}from"./p-8387896e.js";import{i as p}from"./p-29584bb5.js";import{c as v}from"./p-3b6a6f08.js";import{b as w}from"./p-a83cef5a.js";import{T as f}from"./p-37714a3a.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-36a57431.js";import"./p-331a62d5.js";import"./p-aa135628.js";import"./p-b75ee3ba.js";import"./p-affb40e8.js";import"./p-cb378636.js";var m=function(r,e,t,o){var s,a=arguments.length,i=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};class g extends c{constructor(){super(...arguments),this.handleClick=r=>{this.disabled?r.stopPropagation():("vega"!==p.getSemantics(this.host).namespace&&r.stopPropagation(),this.clickEventEmitter.emit())}}render(){const e="clear"===this.variant,t=!e&&!!this.color;return r("div",{class:{"vega-color-swatch-container":!0,[`size-${this.size}`]:!0,[`shape-${this.shape}`]:!0,"swatch-clear":e},role:"button",part:"swatch-container","aria-label":this.getAriaLabel(),"aria-disabled":this.disabled?"true":"false",tabIndex:this.disabled?-1:0,onClick:this.handleClick,onKeyDown:b({composed:!0})},r("div",{class:"swatch",part:"swatch"},t&&r("span",{class:"color-fill",style:this.getFillColorStyles()}),e&&r("span",{class:"clear-line"}),this.selected&&!e&&r("vega-icon",{class:"check-icon",icon:"checkmark",size:"size-16",color:this.getCheckMarkColor()})),this.label&&this.renderLabel())}renderLabel(){return r("vega-font",{class:"swatch-label",variant:"font-field-value",color:this.disabled?"text-disabled":"text-primary"},this.label)}getAriaLabel(){return this.label?this.label:"clear"===this.variant?this.translationSlimmer.t("Clear color"):this.color?this.translationSlimmer.t("Color {0}",this.color):this.translationSlimmer.t("Color swatch")}getFillColorStyles(){const r={};return this.color&&(r.backgroundColor=this.color),r}getCheckMarkColor(){return this.color?new n(this.color).isDark()?"text-white":"text-black":"text-primary"}}m([l()],g.prototype,"host",void 0),m([l()],g.prototype,"variant",void 0),m([l()],g.prototype,"label",void 0),m([l()],g.prototype,"color",void 0),m([l()],g.prototype,"selected",void 0),m([l()],g.prototype,"size",void 0),m([l()],g.prototype,"disabled",void 0),m([l()],g.prototype,"shape",void 0),m([l()],g.prototype,"clickEventEmitter",void 0),m([l()],g.prototype,"translationSlimmer",void 0);var u=function(r,e,t,o){var s,a=arguments.length,i=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};const x=class{constructor(r){e(this,r),this.vegaClick=t(this,"vegaClick",7),this.click=t(this,"click",7),this.globalSlimmers=new Map,this.vegaComponentUsageRuntimeMetricsSlimmer=new a,this.translationSlimmer=new f,this.vegaColorSwatchRenderer=new g,this.clickEventEmitter=v(x,w),this.color="",this.selected=!1,this.label="",this.size="small",this.disabled=!1,this.variant="swatch",this.shape="basket"}render(){return d(r(o,{class:{disabled:this.disabled}},this.vegaColorSwatchRenderer.render()),this.host)}get host(){return s(this)}};u([i()],x.prototype,"globalSlimmers",void 0),u([h()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u([h()],x.prototype,"translationSlimmer",void 0),u([h()],x.prototype,"vegaColorSwatchRenderer",void 0),u([h()],x.prototype,"clickEventEmitter",void 0),x.style=":host{display:inline-block;vertical-align:middle}.vega-color-swatch-container{display:flex;flex-direction:row;align-items:center;border-radius:4px}.swatch{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:relative;flex-shrink:0;overflow:hidden}.shape-basket .swatch{border-radius:8px}.shape-block .swatch{border-radius:0px}.check-icon{position:relative;z-index:1}.swatch-clear .swatch{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}.swatch-clear .swatch .clear-line{position:absolute;width:141%;height:0;border-top-width:1px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1));transform:rotate(-45deg);transform-origin:center}.color-fill{position:absolute;display:block;top:0;left:0;width:100%;height:100%}.size-extra-small .swatch{width:24px;height:24px;min-width:24px}.size-extra-small.shape-basket .swatch{border-radius:4px}.size-small .swatch{width:40px;height:40px;min-width:40px}.size-small.shape-basket{border-radius:8px}.size-medium .swatch{width:48px;height:48px;min-width:48px}.size-medium.shape-basket{border-radius:8px}@media (hover: hover){:host(:not(.disabled)) .swatch:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}}.vega-color-swatch-container:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible .swatch{border-width:1px;border-style:solid;border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-color-swatch-container:focus-visible.swatch-clear{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible.swatch-clear .swatch{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}.vega-color-swatch-container:focus-visible.swatch-clear .swatch .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .vega-color-swatch-container{cursor:pointer}:host(.disabled) .vega-color-swatch-container{cursor:not-allowed}:host(.disabled) .swatch{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));pointer-events:none}:host(.disabled) .swatch .color-fill,:host(.disabled) .swatch .check-icon{opacity:0.5}:host(.disabled) .swatch .label-container{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host(.disabled) .swatch .clear-line{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.swatch-label{margin-left:8px}";export{x as vega_color_swatch}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as f}from"./p-fdbdf12f.js";import{R as o}from"./p-a2c7a3bc.js";function i(i,r,s,a){return f(i)?{flex:`${o.formatCustom(i)}`}:{flexGrow:f(r)?`${o.formatCustom(r)}`:void 0,flexShrink:f(s)?`${o.formatCustom(s)}`:void 0,flexBasis:f(a)?`${o.formatCustom(a)}`:void 0}}export{i as f}
|