@heartlandone/vega 2.82.0 → 2.84.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/{accessibility-bfa227f6.js → accessibility-a5ef2038.js} +3 -2
- package/dist/cjs/{app-globals-3350d580.js → app-globals-ea063074.js} +7 -7
- package/dist/cjs/{child-nodes-event-prevent-slimmer-9b7095a4.js → child-nodes-event-prevent-slimmer-58bbc5fc.js} +1 -1
- package/dist/cjs/{code-block-b1f8aded.js → code-block-6da521e6.js} +24 -40
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-99fbd1f2.js → component-value-history-controller-slimmer.abstract-f3f35f94.js} +3 -3
- package/dist/cjs/{content-state-648652b4.js → content-state-89fafb3b.js} +2 -2
- package/dist/cjs/{date-required-rule-6addf5dd.js → date-required-rule-0dd83683.js} +1 -1
- package/dist/cjs/{design-token-93070bb8.js → design-token-4b3509dd.js} +3 -3
- package/dist/cjs/{dto-renderer-manager-ae5fcbba.js → dto-renderer-manager-7eb5c5ce.js} +42 -2
- package/dist/cjs/{element-appender-slimmer-dedd3a34.js → element-appender-slimmer-2b4e0a62.js} +86 -10
- package/dist/cjs/{event-emit-slimmer-bcb458b2.js → event-emit-slimmer-ecca412d.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-0f3a028e.js → form-field-controller-slimmer-a07e3de0.js} +1 -1
- package/dist/cjs/{image-annotation-action-0339e983.js → image-annotation-action-a6e1e9ed.js} +2 -2
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/index.cjs.js +16 -16
- package/dist/cjs/{inject-keyboard-manager-2d9c4f92.js → inject-keyboard-manager-ff8735b8.js} +1 -1
- package/dist/cjs/{internal-translation-controller-fb1532f4.js → internal-translation-controller-8360a89c.js} +2 -0
- package/dist/cjs/{internal-vega-event-manager-fef893bf.js → internal-vega-event-manager-6b74b3af.js} +2 -1
- package/dist/cjs/{keyboard-manager-5ed6c472.js → keyboard-manager-cc446230.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-879ff4f3.js → keyboard-manager-slimmer-a10b7d6f.js} +1 -1
- package/dist/cjs/loader.cjs.js +11 -11
- package/dist/cjs/{month-view-generator-d262e6ce.js → month-view-generator-41b6c6b6.js} +1 -1
- package/dist/cjs/{public-rules-bce88d4e.js → public-rules-fc52d624.js} +7 -7
- package/dist/cjs/{range-5bd6d72b.js → range-93cc8ab1.js} +1 -1
- package/dist/cjs/{responsive-format-facade-2cab7344.js → responsive-format-facade-5f6cd211.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-e8a922be.js → rich-text-editor-required-rule-fd3711fb.js} +1 -1
- package/dist/cjs/{split-cell-operation-bb388de6.js → split-cell-operation-532fb9f0.js} +3 -3
- package/dist/cjs/{state-border-formatter-4e5e4ed0.js → state-border-formatter-d1c80c1d.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-9a35e3b4.js → string-format-strategy.abstract-b39da0dd.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-1018ddec.js → string-input-formatter-slimmer-127cf2b8.js} +1 -1
- package/dist/cjs/{string-mask-strategy-3aa17744.js → string-mask-strategy-524d0f69.js} +2 -2
- package/dist/cjs/{style-formatter-2226c869.js → style-formatter-c201e7d0.js} +2 -2
- package/dist/cjs/{time-required-rule-970dfdca.js → time-required-rule-ecb45905.js} +1 -1
- package/dist/cjs/{token-extension-9b213b6b.js → token-extension-39f2b886.js} +83 -26
- package/dist/cjs/{translation-slimmer-d0c77ad2.js → translation-slimmer-3cd7d3b2.js} +1 -1
- package/dist/cjs/{type-guard-3ec852d7.js → type-guard-2e97fc56.js} +14 -1
- package/dist/cjs/{valid-credit-card-number-rule-99d1bb34.js → valid-credit-card-number-rule-2d7d20ce.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +7 -7
- package/dist/cjs/vega-app-header-button.cjs.entry.js +28 -9
- package/dist/cjs/vega-banner.cjs.entry.js +16 -5
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-circle.cjs.entry.js +8 -8
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-link.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +6 -6
- package/dist/cjs/vega-calendar_4.cjs.entry.js +8 -8
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +6 -6
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +57 -10
- package/dist/cjs/vega-chip.cjs.entry.js +9 -9
- package/dist/cjs/vega-code-block.cjs.entry.js +11 -11
- package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +627 -0
- package/dist/cjs/vega-color-swatch.cjs.entry.js +7 -7
- package/dist/cjs/vega-combo-box.cjs.entry.js +9 -9
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +17 -17
- package/dist/cjs/vega-dialog_2.cjs.entry.js +217 -90
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +6 -6
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +6 -6
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-numeric.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-passcode.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +9 -9
- package/dist/cjs/vega-input.cjs.entry.js +9 -9
- package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -2
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +9 -9
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +8 -8
- package/dist/cjs/vega-popover_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +14 -15
- package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +7 -7
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +85 -25
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +11 -11
- package/dist/cjs/vega-segment-control.cjs.entry.js +2 -2
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +6 -6
- package/dist/cjs/vega-signature-capture.cjs.entry.js +9 -9
- package/dist/cjs/vega-stepper.cjs.entry.js +5 -5
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +8 -8
- package/dist/cjs/vega-text.cjs.entry.js +46 -1
- package/dist/cjs/vega-textarea.cjs.entry.js +5 -5
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +50 -19
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +11 -11
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/vega-app-header-button/slimmers/renderers/vega-app-header-button-dropdown-renderer.js +14 -1
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +46 -3
- package/dist/collection/components/vega-banner/slimmers/renderers/vega-banner-renderer.js +11 -2
- package/dist/collection/components/vega-banner/vega-banner.js +3 -1
- package/dist/collection/components/vega-checkbox/vega-checkbox.css +19 -14
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +73 -3
- package/dist/collection/components/vega-color-swatch/slimmers/renderers/vega-color-swatch-renderer.js +2 -2
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/assets/hashtag.js +3 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/slimmers/controllers/color-swatch-picker-color-format-controller.js +64 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/slimmers/controllers/color-swatch-picker-value-controller.js +65 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-grid-renderer.js +59 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-input-renderer.js +83 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-picker-renderer.js +115 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.css +67 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.js +585 -0
- package/dist/collection/components/vega-dialog/vega-dialog.css +1 -0
- package/dist/collection/components/vega-dialog/vega-dialog.js +1 -1
- package/dist/collection/components/vega-grid/vega-grid.js +2 -2
- package/dist/collection/components/vega-input/vega-input.js +1 -1
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-backdrop-controller.js +9 -3
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-padding-state-controller.js +43 -0
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-nested-modal-controller.js +17 -2
- package/dist/collection/components/vega-modal/slimmers/models/vega-modal-section-padding-state.js +56 -0
- package/dist/collection/components/vega-modal/slimmers/renderers/vega-modal-renderer.js +11 -11
- package/dist/collection/components/vega-modal/vega-modal.css +20 -21
- package/dist/collection/components/vega-modal/vega-modal.js +19 -3
- package/dist/collection/components/vega-pagination/internal/vega-pagination-go-to.js +1 -1
- package/dist/collection/components/vega-pagination/vega-pagination-page-selector-mobile/slimmers/renderers/page-selector-mobile-renderer.js +1 -1
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +12 -10
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +4 -39
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-default-styles.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +28 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-extension.js +24 -6
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +23 -8
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +18 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +23 -3
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +47 -0
- package/dist/collection/components/vega-text/slimmers/renderers/vega-text-tooltip-renderer.js +46 -1
- package/dist/collection/components/vega-time-picker/slimmers/renderers/vega-time-picker-range-clear-button-renderer.js +13 -5
- package/dist/collection/components/vega-time-picker/slimmers/renderers/vega-time-picker-single-input-renderer.js +4 -1
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +44 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +3 -2
- package/dist/collection/helpers/rte-manager/dto-renderer-manager.js +42 -2
- package/dist/collection/helpers/slimmers/element-appender/body-positioned-wrapper/third-party-dialog-wrapper.js +73 -0
- package/dist/collection/helpers/slimmers/element-appender/element-appender-container-controller.js +6 -0
- package/dist/collection/helpers/translation/locales/en.js +2 -0
- package/dist/collection/types/type-guard.js +12 -0
- package/dist/collection/utils/accessibility.js +3 -2
- package/dist/collection/value-model-adapters/angular-ng-model-accessor-adapter.js +1 -0
- package/dist/collection/value-model-adapters/vue-component-v-model-adaptor.js +1 -0
- package/dist/esm/{accessibility-e5fd0fab.js → accessibility-524cabd2.js} +3 -2
- package/dist/esm/{app-globals-0b7e8b50.js → app-globals-d06de2a5.js} +7 -7
- package/dist/esm/{child-nodes-event-prevent-slimmer-9c24d4fc.js → child-nodes-event-prevent-slimmer-f65e2452.js} +1 -1
- package/dist/esm/{code-block-b8be290a.js → code-block-65c8804b.js} +24 -40
- package/dist/esm/{component-value-history-controller-slimmer.abstract-10ccf8e6.js → component-value-history-controller-slimmer.abstract-26c154f6.js} +3 -3
- package/dist/esm/{content-state-72b513d1.js → content-state-e676bdf0.js} +2 -2
- package/dist/esm/{date-required-rule-891a6a57.js → date-required-rule-a84c21d4.js} +1 -1
- package/dist/esm/{design-token-59d07aa2.js → design-token-57de4f4f.js} +3 -3
- package/dist/esm/{dto-renderer-manager-12bc9121.js → dto-renderer-manager-abc7eb5f.js} +42 -2
- package/dist/esm/{element-appender-slimmer-5aca1bca.js → element-appender-slimmer-d4a82dc3.js} +86 -10
- package/dist/esm/{event-emit-slimmer-32da9d90.js → event-emit-slimmer-18711776.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-899864a8.js → form-field-controller-slimmer-9a0f8c54.js} +1 -1
- package/dist/esm/{image-annotation-action-ebd6c421.js → image-annotation-action-2d87b66a.js} +3 -3
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/index.js +17 -17
- package/dist/esm/{inject-keyboard-manager-dc1d7135.js → inject-keyboard-manager-1ceb9ee0.js} +1 -1
- package/dist/esm/{internal-translation-controller-4fb104b2.js → internal-translation-controller-d7dee4a0.js} +2 -0
- package/dist/esm/{internal-vega-event-manager-8a657bac.js → internal-vega-event-manager-bed71930.js} +3 -2
- package/dist/esm/{keyboard-manager-6ea9968b.js → keyboard-manager-50a1d90e.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-7eed4734.js → keyboard-manager-slimmer-3891ee20.js} +1 -1
- package/dist/esm/loader.js +12 -12
- package/dist/esm/{month-view-generator-aaa27fce.js → month-view-generator-70c597a6.js} +1 -1
- package/dist/esm/{public-rules-f2005e11.js → public-rules-a61ff09f.js} +7 -7
- package/dist/esm/{range-ed532278.js → range-d9e55d00.js} +1 -1
- package/dist/esm/{responsive-format-facade-e9926018.js → responsive-format-facade-456a9f16.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-b559cf1a.js → rich-text-editor-required-rule-6a4c853a.js} +1 -1
- package/dist/esm/{split-cell-operation-5587f594.js → split-cell-operation-2e700c5c.js} +3 -3
- package/dist/esm/{state-border-formatter-be51463d.js → state-border-formatter-afac8d33.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-0157b3c5.js → string-format-strategy.abstract-f9907969.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-33ed3478.js → string-input-formatter-slimmer-ad234bec.js} +1 -1
- package/dist/esm/{string-mask-strategy-b58891b5.js → string-mask-strategy-5f655300.js} +2 -2
- package/dist/esm/{style-formatter-9662ae88.js → style-formatter-ee52d8d0.js} +2 -2
- package/dist/esm/{time-required-rule-a9dc8473.js → time-required-rule-db873c19.js} +1 -1
- package/dist/esm/{token-extension-9d717a35.js → token-extension-d3a46c04.js} +84 -27
- package/dist/esm/{translation-slimmer-4faae5a3.js → translation-slimmer-5e2bff5f.js} +1 -1
- package/dist/esm/{type-guard-152070e9.js → type-guard-adc244fd.js} +14 -2
- package/dist/esm/{valid-credit-card-number-rule-a7907cb7.js → valid-credit-card-number-rule-a826dd49.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +8 -8
- package/dist/esm/vega-app-header-button.entry.js +29 -10
- package/dist/esm/vega-banner.entry.js +17 -6
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +9 -9
- package/dist/esm/vega-button-group_2.entry.js +4 -4
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +7 -7
- package/dist/esm/vega-calendar_4.entry.js +9 -9
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +7 -7
- package/dist/esm/vega-checkbox_2.entry.js +58 -11
- package/dist/esm/vega-chip.entry.js +10 -10
- package/dist/esm/vega-code-block.entry.js +12 -12
- package/dist/esm/vega-color-picker.entry.js +6 -6
- package/dist/esm/vega-color-swatch-picker.entry.js +623 -0
- package/dist/esm/vega-color-swatch.entry.js +8 -8
- package/dist/esm/vega-combo-box.entry.js +10 -10
- package/dist/esm/vega-date-picker_2.entry.js +18 -18
- package/dist/esm/vega-dialog_2.entry.js +218 -91
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +12 -12
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-4ede557a.js → vega-event-id-5841d1d3.js} +1 -1
- package/dist/esm/vega-field-label.entry.js +4 -4
- package/dist/esm/vega-file-uploader.entry.js +7 -7
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +7 -7
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +10 -10
- package/dist/esm/vega-input-credit-card.entry.js +10 -10
- package/dist/esm/vega-input-numeric.entry.js +9 -9
- package/dist/esm/vega-input-passcode.entry.js +9 -9
- package/dist/esm/vega-input-phone-number.entry.js +8 -8
- package/dist/esm/vega-input-range.entry.js +8 -8
- package/dist/esm/vega-input-select.entry.js +10 -10
- package/dist/esm/vega-input.entry.js +10 -10
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +10 -10
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-page-notification_2.entry.js +2 -2
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +4 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination.entry.js +9 -9
- package/dist/esm/vega-popover_2.entry.js +11 -11
- package/dist/esm/vega-progress-tracker_2.entry.js +15 -16
- package/dist/esm/vega-radio_2.entry.js +10 -10
- package/dist/esm/vega-rich-text-content.entry.js +8 -8
- package/dist/esm/vega-rich-text-editor_4.entry.js +86 -26
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +12 -12
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +9 -9
- package/dist/esm/vega-selection-tile_2.entry.js +7 -7
- package/dist/esm/vega-sidenav_3.entry.js +7 -7
- package/dist/esm/vega-signature-capture.entry.js +10 -10
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-tab-group_2.entry.js +5 -5
- package/dist/esm/vega-table_11.entry.js +9 -9
- package/dist/esm/vega-text.entry.js +46 -1
- package/dist/esm/vega-textarea.entry.js +6 -6
- package/dist/esm/vega-time-picker_2.entry.js +51 -20
- package/dist/esm/vega-toggle-switch.entry.js +6 -6
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +12 -12
- package/dist/sri/vega-sri-manifest.json +350 -346
- package/dist/types/components/vega-app-header-button/slimmers/renderers/vega-app-header-button-dropdown-renderer.d.ts +8 -0
- package/dist/types/components/vega-app-header-button/types.d.ts +2 -0
- package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +16 -0
- package/dist/types/components/vega-banner/slimmers/renderers/vega-banner-renderer.d.ts +6 -0
- package/dist/types/components/vega-banner/vega-banner.d.ts +2 -0
- package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +23 -1
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/assets/hashtag.d.ts +3 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/slimmers/controllers/color-swatch-picker-color-format-controller.d.ts +32 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/slimmers/controllers/color-swatch-picker-value-controller.d.ts +31 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-grid-renderer.d.ts +26 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-input-renderer.d.ts +25 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-picker-renderer.d.ts +43 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/types.d.ts +17 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.d.ts +149 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-backdrop-controller.d.ts +1 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-padding-state-controller.d.ts +21 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-nested-modal-controller.d.ts +3 -2
- package/dist/types/components/vega-modal/slimmers/models/vega-modal-section-padding-state.d.ts +29 -0
- package/dist/types/components/vega-modal/slimmers/renderers/vega-modal-renderer.d.ts +1 -1
- package/dist/types/components/vega-modal/types.d.ts +11 -0
- package/dist/types/components/vega-modal/vega-modal.d.ts +7 -2
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +8 -9
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-default-styles.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +20 -2
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-extension.d.ts +13 -2
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.d.ts +15 -4
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-extension.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/extension-controller.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.d.ts +4 -3
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +14 -1
- package/dist/types/components/vega-text/slimmers/renderers/vega-text-tooltip-renderer.d.ts +1 -0
- package/dist/types/components/vega-time-picker/slimmers/renderers/vega-time-picker-range-clear-button-renderer.d.ts +6 -3
- package/dist/types/components/vega-time-picker/slimmers/renderers/vega-time-picker-single-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +20 -0
- package/dist/types/components.d.ts +224 -8
- package/dist/types/helpers/rte-manager/dto-renderer-manager.d.ts +26 -1
- package/dist/types/helpers/slimmers/element-appender/body-positioned-wrapper/third-party-dialog-wrapper.d.ts +45 -0
- package/dist/types/helpers/slimmers/element-appender/element-appender-container-controller.d.ts +2 -0
- package/dist/types/helpers/translation/interface.d.ts +3 -1
- package/dist/types/types/components.type.d.ts +7 -1
- package/dist/types/types/type-guard.d.ts +8 -0
- package/dist/types/utils/accessibility.d.ts +6 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-fc7ab79d.js → p-031c0cf7.js} +1 -1
- package/dist/vega/{p-e71864ff.js → p-032183c1.js} +1 -1
- package/dist/vega/{p-246eb001.entry.js → p-03cf2df1.entry.js} +1 -1
- package/dist/vega/{p-7d85cc74.entry.js → p-096d186d.entry.js} +1 -1
- package/dist/vega/{p-ebdb489c.entry.js → p-0bb0b521.entry.js} +1 -1
- package/dist/vega/{p-19a30f98.entry.js → p-0e15fa94.entry.js} +1 -1
- package/dist/vega/p-0f31b00b.entry.js +1 -0
- package/dist/vega/{p-42141782.js → p-11a2f834.js} +1 -1
- package/dist/vega/{p-eb0ebf50.entry.js → p-19e10a87.entry.js} +1 -1
- package/dist/vega/{p-2b5cf2b3.js → p-1a869f0e.js} +1 -1
- package/dist/vega/{p-8b217c7e.entry.js → p-1df2c29b.entry.js} +1 -1
- package/dist/vega/{p-9c1a48b9.entry.js → p-20f0060f.entry.js} +1 -1
- package/dist/vega/p-220f8ee7.js +1 -0
- package/dist/vega/{p-c36afa21.entry.js → p-27b1dc0f.entry.js} +1 -1
- package/dist/vega/{p-103d20f5.js → p-34964a53.js} +1 -1
- package/dist/vega/p-39b71df9.entry.js +1 -0
- package/dist/vega/p-3ae5f50e.entry.js +1 -0
- package/dist/vega/{p-d5531d3c.js → p-3b791b5d.js} +1 -1
- package/dist/vega/p-4123559f.entry.js +1 -0
- package/dist/vega/p-43aaeb30.entry.js +1 -0
- package/dist/vega/{p-3fae8d3f.entry.js → p-45aaaef6.entry.js} +1 -1
- package/dist/vega/{p-085de8fc.js → p-4cefd7fe.js} +1 -1
- package/dist/vega/{p-8583dd34.entry.js → p-5215e1d8.entry.js} +1 -1
- package/dist/vega/{p-783531cf.entry.js → p-5409275a.entry.js} +1 -1
- package/dist/vega/{p-d7bd2470.entry.js → p-5490d499.entry.js} +1 -1
- package/dist/vega/{p-d456386a.entry.js → p-549bea2c.entry.js} +1 -1
- package/dist/vega/p-5657f768.js +1 -0
- package/dist/vega/{p-d4f1f007.js → p-56c28943.js} +1 -1
- package/dist/vega/{p-14de7ba0.entry.js → p-571a6d15.entry.js} +1 -1
- package/dist/vega/{p-6572e038.js → p-57f220b5.js} +1 -1
- package/dist/vega/{p-25ab7a33.entry.js → p-5ac4649a.entry.js} +1 -1
- package/dist/vega/{p-988401c3.entry.js → p-5bbb3e68.entry.js} +1 -1
- package/dist/vega/{p-ef59f6f0.js → p-5bf3ab33.js} +1 -1
- package/dist/vega/{p-bb46d8e6.entry.js → p-5f23c52d.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-6236f592.entry.js +1 -0
- package/dist/vega/p-68a96fbb.entry.js +1 -0
- package/dist/vega/p-6ac8e655.js +1 -0
- package/dist/vega/{p-4e95248c.entry.js → p-6ba71ec4.entry.js} +1 -1
- package/dist/vega/{p-02467b61.js → p-6cada843.js} +1 -1
- package/dist/vega/{p-f7a5746b.js → p-6f790577.js} +1 -1
- package/dist/vega/{p-597588d0.entry.js → p-74136508.entry.js} +1 -1
- package/dist/vega/p-748268e6.entry.js +1 -0
- package/dist/vega/{p-ea564928.entry.js → p-753a7832.entry.js} +1 -1
- package/dist/vega/{p-116e3963.js → p-7595ad55.js} +1 -1
- package/dist/vega/{p-475bd8bf.entry.js → p-7702a906.entry.js} +1 -1
- package/dist/vega/{p-cc18970f.entry.js → p-78099a83.entry.js} +1 -1
- package/dist/vega/{p-0915a8d3.entry.js → p-7cf1e1f7.entry.js} +1 -1
- package/dist/vega/p-7dbaed6c.entry.js +1 -0
- package/dist/vega/{p-a6dbc63d.entry.js → p-7dca19d3.entry.js} +1 -1
- package/dist/vega/p-80cb302f.entry.js +1 -0
- package/dist/vega/p-82039afd.entry.js +1 -0
- package/dist/vega/{p-e340d58c.entry.js → p-84030271.entry.js} +1 -1
- package/dist/vega/{p-88b6184c.entry.js → p-865fc90b.entry.js} +1 -1
- package/dist/vega/{p-58b6ac33.entry.js → p-88f57353.entry.js} +1 -1
- package/dist/vega/{p-30445cd9.entry.js → p-8d833b44.entry.js} +1 -1
- package/dist/vega/p-91739ed3.entry.js +1 -0
- package/dist/vega/{p-d320496e.entry.js → p-9297f4a9.entry.js} +1 -1
- package/dist/vega/{p-cab70b95.entry.js → p-9308f874.entry.js} +1 -1
- package/dist/vega/p-9375fbce.js +1 -0
- package/dist/vega/{p-7df43192.entry.js → p-99670c56.entry.js} +1 -1
- package/dist/vega/p-9de25451.js +1 -0
- package/dist/vega/{p-b9a95aca.entry.js → p-9f064488.entry.js} +1 -1
- package/dist/vega/p-9f728e0b.js +1 -0
- package/dist/vega/p-a2d6d695.entry.js +1 -0
- package/dist/vega/{p-c8435185.js → p-a5e6a3be.js} +1 -1
- package/dist/vega/{p-9751c801.js → p-a87cb7ac.js} +1 -1
- package/dist/vega/{p-5ffdea8e.js → p-aa040383.js} +1 -1
- package/dist/vega/{p-ed01657b.entry.js → p-aa4d419c.entry.js} +1 -1
- package/dist/vega/p-b48b3264.js +1 -0
- package/dist/vega/p-b6c3ce6d.js +1 -0
- package/dist/vega/{p-ab829745.js → p-b7721666.js} +1 -1
- package/dist/vega/{p-c5eb0fa6.js → p-b78eaec4.js} +1 -1
- package/dist/vega/{p-c8d41cdc.entry.js → p-b80217fa.entry.js} +1 -1
- package/dist/vega/{p-280f63fa.entry.js → p-b88eab9a.entry.js} +1 -1
- package/dist/vega/{p-8da66d41.entry.js → p-bc2786f9.entry.js} +1 -1
- package/dist/vega/{p-d32e83e7.js → p-bdddddb7.js} +1 -1
- package/dist/vega/{p-da742a7f.entry.js → p-c0323a55.entry.js} +1 -1
- package/dist/vega/{p-edda10f7.js → p-c47c37f2.js} +1 -1
- package/dist/vega/{p-3505f7cc.entry.js → p-c6837173.entry.js} +1 -1
- package/dist/vega/{p-b7624ce4.js → p-c85e743d.js} +1 -1
- package/dist/vega/{p-b9947846.js → p-c95dbf11.js} +1 -1
- package/dist/vega/p-ce975c69.entry.js +1 -0
- package/dist/vega/{p-eda7cd76.entry.js → p-d10ae46a.entry.js} +1 -1
- package/dist/vega/p-d3864b94.entry.js +1 -0
- package/dist/vega/{p-b5497af2.entry.js → p-d3ed7c27.entry.js} +1 -1
- package/dist/vega/{p-29f42c27.entry.js → p-d6c9ef6c.entry.js} +1 -1
- package/dist/vega/{p-23c840dc.entry.js → p-d76e3b3c.entry.js} +1 -1
- package/dist/vega/{p-a07c0f8c.js → p-dba16739.js} +1 -1
- package/dist/vega/{p-a30ae8a1.js → p-dec5b448.js} +1 -1
- package/dist/vega/{p-b08a70e6.entry.js → p-e1b1f5f9.entry.js} +1 -1
- package/dist/vega/{p-956b170c.js → p-e1d2c60d.js} +1 -1
- package/dist/vega/{p-b9386dd0.js → p-e4c4ea35.js} +1 -1
- package/dist/vega/{p-efc8c09e.entry.js → p-e4c5b8d1.entry.js} +1 -1
- package/dist/vega/{p-f020738c.entry.js → p-e5546af5.entry.js} +1 -1
- package/dist/vega/{p-513f51ec.entry.js → p-e5cc839a.entry.js} +1 -1
- package/dist/vega/{p-44044ed7.js → p-effa6495.js} +1 -1
- package/dist/vega/{p-0dbd7723.entry.js → p-f0e855b2.entry.js} +1 -1
- package/dist/vega/{p-f89cf75a.entry.js → p-f6414a24.entry.js} +1 -1
- package/dist/vega/{p-7faaa5e1.entry.js → p-f8c700dd.entry.js} +1 -1
- package/dist/vega/{p-51d2e0ab.entry.js → p-f986f875.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-075bb809.entry.js +0 -1
- package/dist/vega/p-1ca95601.entry.js +0 -1
- package/dist/vega/p-1dd6ba67.js +0 -1
- package/dist/vega/p-1efb47fe.entry.js +0 -1
- package/dist/vega/p-29d31c98.entry.js +0 -1
- package/dist/vega/p-318f0df5.js +0 -1
- package/dist/vega/p-337a5e76.js +0 -1
- package/dist/vega/p-47611a83.entry.js +0 -1
- package/dist/vega/p-4f938ee4.entry.js +0 -1
- package/dist/vega/p-596bc4f6.entry.js +0 -1
- package/dist/vega/p-6d95390b.entry.js +0 -1
- package/dist/vega/p-6e9f832f.js +0 -1
- package/dist/vega/p-85abe824.entry.js +0 -1
- package/dist/vega/p-86194314.js +0 -1
- package/dist/vega/p-97f36f4e.entry.js +0 -1
- package/dist/vega/p-9d854d43.js +0 -1
- package/dist/vega/p-a5bd3ecd.entry.js +0 -1
- package/dist/vega/p-c366e7f7.entry.js +0 -1
- package/dist/vega/p-d872beb1.entry.js +0 -1
- package/dist/vega/p-d9d5c693.entry.js +0 -1
- package/dist/vega/p-dd6211cd.js +0 -1
- package/dist/vega/p-fcabf0dc.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{g as t,e,c as n,h as s,A as r,T as i,q as o,H as a,r as l,l as c,t as h,u,v as d,w as m,x as w,I as T,n as p,S as g,j as E,B as f,y as k,d as R,z as B,D as x,o as I,E as b,s as O,N as L,F as y,G as N,J as C,K as A,m as H,L as j,M as v,O as S,P as $,Q as D,U as M,W as P,X as F,Y as z,Z as V,_ as U,$ as W,a0 as G,a1 as J,a2 as K,R as Y,a3 as X,p as Q,a4 as Z,a5 as _,a6 as q,b as tt,a7 as et,a8 as nt,a9 as st,aa as rt}from"./p-5ffdea8e.js";import{g as it}from"./p-8b5d3a52.js";import{i as ot}from"./p-b9386dd0.js";import{C as at}from"./p-2d0d575f.js";import{d as lt}from"./p-f28a6074.js";import{c as ct,d as ht}from"./p-aa985d73.js";import{r as ut,i as dt}from"./p-6e70d3cc.js";import{c as mt}from"./p-a841cf13.js";import{L as wt}from"./p-6e1ab235.js";class RTEListItemBlock extends e{constructor(t,e,n){super(t,"list-item",n),this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new RTEListItemBlock(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=RTEListBlock.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);ot(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(t){return[`<li${super.generateAttributeString(t)}>`,this.getChildrenHtml(t),"</li>"].join("")}cloneWithNodes(t){const e=new RTEListItemBlock(it());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new RTEListItemBlock(it())}clone(t){var e;const n=new RTEListItemBlock(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(i.name,RTEListItemBlock.name,new o),r.register(a.name,RTEListItemBlock.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEListItemBlock.name,new h),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEListItemBlock.name,new u),r.register(c.DELETE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEListItemBlock.name,new d),r.register(c.REPLACE_CHILD_NODES,RTEListItemBlock.name,new m),r.register(c.REPLACE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,RTEListItemBlock.name,new w),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.parent.apply(t)}});class Tt extends f{constructor(){super(...arguments),this.type=k.LIST}static getDefaultStyles(){return{paddingLeft:"8px",marginLeft:"16px"}}renderStyle(t){return(null==t?void 0:t.standalone)?Tt.getDefaultStyles():null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new Tt}toJSON(){}}class RTEListBlock extends R{constructor(t,e,n){super(t),this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(k.LIST,new Tt)}static from(t,e={autoMatchFormat:!0}){const n=new RTEListBlock(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);ot(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=RTEListItemBlock.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return I.from(e);case"customClass":return x.from(e);case"customStyle":return B.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag();return[`<${e}${super.generateAttributeString(t)}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new RTEListBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new T(e,r)),e.parent.apply(new p(e)),n.forEach((t=>t.children.map((t=>t.apply(new g)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new T(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new p(t))})),0===e.children.length&&e.parent.apply(new p(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const i=t.selectedBlocks,o=i.map((t=>(t.children.map((t=>t.apply(new g))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new E(e,...o));else if(r)e.parent.apply(new T(e,...o));else{const t=e.children.indexOf(i[0]),n=e.children.indexOf(i[i.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const a=e.parent.createList(e.type);a.apply(new s(e.children.slice(n+1))),e.parent.apply(new E(e,r,...o,a)),e.parent.apply(new p(e))}i.map((t=>{e.apply(new p(t))})),0===e.children.length&&e.parent.apply(new p(e))}toParagraph(t){const n=new e(it(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new T(e,t.imageBlockToBeInserted):t)}});class pt{}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(ot)),e}}const Et=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)}},ft=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 o of n)if(i=o.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),a=new gt(o,n);1===i&&o.shouldProceedToElementChildren()&&a.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(a),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 Et.getElementToBlockStrategies()}};class kt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class Rt 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 Bt extends Rt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class xt extends L{constructor(t,e){super(),this.type=y.IMAGE,this.size=t,this.alt=e}static from(t,e){return[y.IMAGE,new xt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return ot(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new xt(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=xt.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%"})}}}xt.BASE_STYLES={verticalAlign:"bottom"};class RTEImageNode extends N{constructor(t,e,n,s){super(t,s),this.type=C.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new RTEImageNode(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:o}=i,a=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({},a),{size:null!=o?o:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?xt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(ot)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof xt||t instanceof A)).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 RTEImageNode(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(y.IMAGE);return`<img${super.generateAttributeString(t,...[e&&e.alt?`alt="${e.alt}"`:null,`src="${this.url}"`,e&&e.size?`data-size="${e.size}"`:null].filter(ot))}>`}doAnnotationActionApply(t){const e=r.get(H.name,RTEImageNode.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,RTEImageNode.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(H.name,RTEImageNode.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class It extends v{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class RTEImageBlock extends R{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new RTEImageBlock(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>RTEImageNode.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 RTEImageBlock(it())}clone(t){const e=new RTEImageBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,RTEImageBlock.name,new w),r.register(c.REPLACE_CHILD_NODES,RTEImageBlock.name,new m),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEImageBlock.name,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 j(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new T(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=new It(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEImageBlock.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const i=e.from({id:it(),type:"paragraph",nodes:[{id:it(),type:"text",text:"\n"}]});r.parent.apply(new T(r,i));const o=this.concatBlocksNodes(t.slice(1));return(0===o.length||o[0]&&""===o[0].text)&&o.push(new n(it(),"\n",i)),i.apply(new s(o)),i.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new p(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(i.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new T(e,i)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new E(e,i)):(e.apply(new S(n,r)),e.parent.apply(new T(e,i)))}}),r.register(a.name,RTEImageBlock.name,new l);class RTEHtmlBlock extends R{constructor(t,e){super(t),this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new RTEHtmlBlock(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTEHtmlBlock(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return!0}toHtml(t){const e=this.htmlTag,n=super.generateAttributeString(t);return $.has(this.htmlTag)?`<${e}${n}>`:[`<${e}${n}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}class bt extends v{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Ot extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new p(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new p(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const i=n.isEmpty();if(e.children.length&&s&&s.parent!==e)i&&e.apply(new p(n)),e.type===s.parent.type&&s.parent.apply(new bt(e));else if(this.isContentFirstNode(n)&&i&&(r=this.getNextNode(n)),i&&e.apply(new p(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new p(t)),s||i||(r=n)}0===e.children.length&&e.parent.apply(new p(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),i=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(i=this.getNextNode(n)),1===t.children.length?t.parent.apply(new p(t)):t.apply(new p(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new p(e)),r||(t.nextNode=n))}r?t.previousNode=r:i&&(t.nextNode=i)}}class Lt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new T(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new S(t,e);return n.apply(s),s.newBlock}n.parent.apply(new E(n,s))}return s}}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(y.LINK),e.apply(new s([n]))),e}}}class yt extends v{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Nt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:i}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==i){const e=r.text.substring(0,i),n=r.text.substring(i),o=r.cloneWithText(e),a=r.cloneWithText(n),l=[o,s];n&&l.push(a),t.apply(new E(r,...l)),t.apply(new p(r))}else t.apply(new E(r,s));else t.apply(0!==i?new T(r,s):new E(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new yt(t))}}class Ct extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,i=this.createNewParagraph(n);if(i){const t=i.children[0];e.apply(0!==s?new T(r,t):new E(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new yt(t))}}class At extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new s([i])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new S(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new E(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],i=1===n.children.length&&n.children[0].isEmpty();if(n===r&&i){const r=n.parent.parent;if("list-item"!==r.type){const i=e.from({id:it(),type:"paragraph",nodes:[]});return i.apply(new s(t.children)),r.apply(new T(n.parent,i)),n.parent.apply(new p(n)),i}r.parent.apply(new T(r,t)),n.parent.apply(new p(n))}else n.parent.apply(new T(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(y.LINK),e}}class Ht extends v{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class jt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Ht(e):new p(e))}}class vt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let i=e;if(s===e.children[0]&&0===r)e.parent.apply(new E(e,...n));else{const t=new S(s,r);e.apply(t),e.parent.apply(new T(e,...n)),i=t.newBlock}t.futureFocusBlock=i}}}const St=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===RTEListBlock.name?new jt:new P),r.register(c.APPEND_CHILDREN,t,new kt),r.register(c.INSERT_CHILDREN_BEFORE,t,new Rt),r.register(c.INSERT_CHILDREN_AFTER,t,new Bt),r.register(c.DELETE_BLOCK_CONTENT,t,new Ot),r.register(c.INSERT_NEW_PARAGRAPH,t,t===RTEListItemBlock.name?new At:new Lt),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ct),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new Nt),r.register(c.PASTE_CONTENT,t,new vt)}};class $t{}class Dt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===F||t.style.fontWeight===z||t.classList.contains("v-rte--bold")}}class Mt extends $t{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 $t{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 $t{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=V(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class zt extends $t{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}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 Vt extends $t{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}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 Ut extends $t{canHandle(t){return"RTETextNode"===t.name}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 $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ut(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=U.filter((t=>t.key!==W.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of U)if(t.style.color.includes(e.key))return e.key;return null}}class Gt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===G||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Jt extends $t{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.name}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.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(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 $t{constructor(){super(...arguments),this.handlers=[new Mt,new Pt,new Ft]}canHandle(t){return"RTETextNode"===t.name}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:it()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Xt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(J)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Qt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(K)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Zt extends $t{canHandle(t){return"RTEImageNode"===t.name}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class _t extends $t{canHandle(t){return"RTEImageNode"===t.name}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 $t{constructor(){super(...arguments),this.customAttributeHandler=new Mt,this.customStyleAnnotationHandler=new Ft,this.customClassAnnotationHandler=new Pt}canHandle(t,e){return"RTETextNode"===t.name&&!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:s}=e;const r=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||r){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},r?{groupId:it()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});s=s?this.appendToInlineHtmlChain(s,e,t.parentNode):e}return s?Object.assign({},s):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 oe=new class{constructor(){this.handlers=[new Vt,new zt,new Dt,new Gt,new Qt,new Xt,new Wt,new Yt,new Ut,new Zt,new _t,new Mt,new Pt,new Ft,new Jt,new ie]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&Y.executeTheStrategyRefillAction(t.name,e);const s=Kt.isLinkElement(e)&&"RTETextNode"===t.name,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=Y.getStrategies(t.name);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=X.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 ae extends pt{constructor(){super(...arguments),this.annotationHandler=new Jt}generateChildNodes(t,e,s){const r=[],i=!(!s||!1!==s.autoMatchFormat),o=Object.assign({},e);return t.forEach((t=>{const a=Et.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(a&&(l=a.handle([t],s,o)),l)r.push(l);else if(dt(t)&&t.childNodes.length>0){const a=oe.generate(n,t,Object.assign({parentAnnotations:i?{inlineHtml:o.inlineHtml,link:o.link,code:o.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),a,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class le extends ae{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,n=e.dataset.language;return b.from({id:it(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ce extends ae{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return RTEImageBlock.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:t.src,annotations:oe.generate(RTEImageNode,t,e)}],annotations:Object.assign(Object.assign({},oe.generate(RTEImageBlock,t.parentElement,e)),{internalWrapper:n})},e)}}class he extends pt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:it(),type:"text",text:t,annotations:e}}}class ue extends Q{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=_.getDefaultStyles(e),super.filterAnnotations(t)):t}}class de extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return Z.isTextBlock(t.constructor.name)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return Z.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class me extends de{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class we extends de{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class Te extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=Te.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}canFilter(t){return Z.isTextNode(t.constructor.name)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return Z.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${Te.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}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(Te.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}Te.BOLD_STYLES={fontWeight:"700"},Te.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class pe extends me{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.constructor.name)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class ge extends we{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.constructor.name)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}tt.registerRTEDTOClass("paragraph",e),tt.registerRTEDTOClass("title",e),tt.registerRTEDTOClass("subtitle",e),tt.registerRTEDTOClass("heading-1",e),tt.registerRTEDTOClass("heading-2",e),tt.registerRTEDTOClass("heading-3",e),tt.registerRTEDTOClass("heading-4",e),tt.registerRTEDTOClass("heading-5",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("list-item",RTEListItemBlock),tt.registerRTEDTOClass("bullet-list",RTEListBlock),tt.registerRTEDTOClass("number-list",RTEListBlock),tt.registerRTEDTOClass("image",RTEImageBlock),tt.registerRTEDTOClass("code-block",b),tt.registerRTEDTOClass("html-block",RTEHtmlBlock),tt.registerRTEDTOClass("text",n),tt.registerRTEDTOClass("image",RTEImageNode),St.registerBlockBasicStrategies(e.name),St.registerBlockBasicStrategies(RTEListBlock.name),St.registerBlockBasicStrategies(RTEListItemBlock.name),St.registerBlockBasicStrategies(RTEImageBlock.name),St.registerBlockBasicStrategies(RTEHtmlBlock.name),Et.registerElementToBlockStrategy(new class extends ae{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,s){const r=t[0].parentElement,i=s&&s.autoMatchFormat,o=this.generateChildNodes(t,i?oe.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),a=i?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!i&&!a;return e.from(Object.assign({id:it(),type:a||"paragraph",nodes:o},l?{annotations:{internalWrapper:l}}:{annotations:oe.generate(e,r,s)}),s)}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||!!ee.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!re(t))||this.isInlineLeafOrWrapper(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}}),Et.registerElementToBlockStrategy(new class extends ce{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}}),Et.registerElementToBlockStrategy(new class extends ce{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(ot(s))return RTEImageBlock.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:s.src,annotations:oe.generate(RTEImageNode,n,e)}],annotations:oe.generate(RTEImageBlock,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ce{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{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,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:it(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:oe.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{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)?RTEListItemBlock.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)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return RTEListBlock.from({id:it(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:it(),type:"list-item",annotations:oe.generate(RTEListItemBlock,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),oe.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=ot(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return RTEListItemBlock.from({id:it(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:it(),type:"number-list",blocks:[],annotations:oe.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:it(),type:"bullet-list",blocks:[],annotations:oe.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),Et.registerElementToBlockStrategy(new class extends ae{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 RTEHtmlBlock.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(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:it(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:oe.generate(RTEHtmlBlock,t,e),children:[]}}}),
|
|
1
|
+
import{g as t,e,c as n,h as s,A as r,T as i,q as o,H as a,r as l,l as c,t as h,u,v as d,w as m,x as w,I as T,n as p,S as g,j as E,B as f,y as k,d as R,z as B,D as x,o as I,E as b,s as O,N as L,F as y,G as N,J as C,K as A,m as H,L as j,M as v,O as S,P as $,Q as D,U as M,W as P,X as F,Y as z,Z as V,_ as U,$ as W,a0 as G,a1 as J,a2 as K,R as Y,a3 as X,p as Q,a4 as Z,a5 as _,a6 as q,b as tt,a7 as et,a8 as nt,a9 as st,aa as rt}from"./p-aa040383.js";import{g as it}from"./p-8b5d3a52.js";import{i as ot}from"./p-e4c4ea35.js";import{C as at}from"./p-2d0d575f.js";import{d as lt}from"./p-f28a6074.js";import{c as ct,d as ht}from"./p-aa985d73.js";import{r as ut,i as dt}from"./p-6e70d3cc.js";import{c as mt}from"./p-a841cf13.js";import{L as wt}from"./p-6e1ab235.js";class RTEListItemBlock extends e{constructor(t,e,n){super(t,"list-item",n),this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new RTEListItemBlock(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=RTEListBlock.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);ot(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(t){return[`<li${super.generateAttributeString(t)}>`,this.getChildrenHtml(t),"</li>"].join("")}cloneWithNodes(t){const e=new RTEListItemBlock(it());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new RTEListItemBlock(it())}clone(t){var e;const n=new RTEListItemBlock(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(i.name,RTEListItemBlock.name,new o),r.register(a.name,RTEListItemBlock.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEListItemBlock.name,new h),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEListItemBlock.name,new u),r.register(c.DELETE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEListItemBlock.name,new d),r.register(c.REPLACE_CHILD_NODES,RTEListItemBlock.name,new m),r.register(c.REPLACE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,RTEListItemBlock.name,new w),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.parent.apply(t)}});class Tt extends f{constructor(){super(...arguments),this.type=k.LIST}static getDefaultStyles(){return{paddingLeft:"8px",marginLeft:"16px"}}renderStyle(t){return(null==t?void 0:t.standalone)?Tt.getDefaultStyles():null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new Tt}toJSON(){}}class RTEListBlock extends R{constructor(t,e,n){super(t),this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(k.LIST,new Tt)}static from(t,e={autoMatchFormat:!0}){const n=new RTEListBlock(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);ot(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=RTEListItemBlock.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return I.from(e);case"customClass":return x.from(e);case"customStyle":return B.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag();return[`<${e}${super.generateAttributeString(t)}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new RTEListBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new T(e,r)),e.parent.apply(new p(e)),n.forEach((t=>t.children.map((t=>t.apply(new g)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new T(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new p(t))})),0===e.children.length&&e.parent.apply(new p(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const i=t.selectedBlocks,o=i.map((t=>(t.children.map((t=>t.apply(new g))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new E(e,...o));else if(r)e.parent.apply(new T(e,...o));else{const t=e.children.indexOf(i[0]),n=e.children.indexOf(i[i.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const a=e.parent.createList(e.type);a.apply(new s(e.children.slice(n+1))),e.parent.apply(new E(e,r,...o,a)),e.parent.apply(new p(e))}i.map((t=>{e.apply(new p(t))})),0===e.children.length&&e.parent.apply(new p(e))}toParagraph(t){const n=new e(it(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new T(e,t.imageBlockToBeInserted):t)}});class pt{}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(ot)),e}}const Et=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)}},ft=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 o of n)if(i=o.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),a=new gt(o,n);1===i&&o.shouldProceedToElementChildren()&&a.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(a),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 Et.getElementToBlockStrategies()}};class kt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class Rt 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 Bt extends Rt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class xt extends L{constructor(t,e){super(),this.type=y.IMAGE,this.size=t,this.alt=e}static from(t,e){return[y.IMAGE,new xt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return ot(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new xt(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=xt.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%"})}}}xt.BASE_STYLES={verticalAlign:"bottom"};class RTEImageNode extends N{constructor(t,e,n,s){super(t,s),this.type=C.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new RTEImageNode(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:o}=i,a=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({},a),{size:null!=o?o:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?xt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(ot)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof xt||t instanceof A)).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 RTEImageNode(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(y.IMAGE);return`<img${super.generateAttributeString(t,...[e&&e.alt?`alt="${e.alt}"`:null,`src="${this.url}"`,e&&e.size?`data-size="${e.size}"`:null].filter(ot))}>`}doAnnotationActionApply(t){const e=r.get(H.name,RTEImageNode.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,RTEImageNode.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(H.name,RTEImageNode.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class It extends v{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class RTEImageBlock extends R{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new RTEImageBlock(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>RTEImageNode.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 RTEImageBlock(it())}clone(t){const e=new RTEImageBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,RTEImageBlock.name,new w),r.register(c.REPLACE_CHILD_NODES,RTEImageBlock.name,new m),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEImageBlock.name,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 j(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new T(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=new It(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEImageBlock.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const i=e.from({id:it(),type:"paragraph",nodes:[{id:it(),type:"text",text:"\n"}]});r.parent.apply(new T(r,i));const o=this.concatBlocksNodes(t.slice(1));return(0===o.length||o[0]&&""===o[0].text)&&o.push(new n(it(),"\n",i)),i.apply(new s(o)),i.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new p(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(i.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new T(e,i)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new E(e,i)):(e.apply(new S(n,r)),e.parent.apply(new T(e,i)))}}),r.register(a.name,RTEImageBlock.name,new l);class RTEHtmlBlock extends R{constructor(t,e){super(t),this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new RTEHtmlBlock(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTEHtmlBlock(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return!0}toHtml(t){const e=this.htmlTag,n=super.generateAttributeString(t);return $.has(this.htmlTag)?`<${e}${n}>`:[`<${e}${n}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}class bt extends v{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Ot extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new p(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new p(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const i=n.isEmpty();if(e.children.length&&s&&s.parent!==e)i&&e.apply(new p(n)),e.type===s.parent.type&&s.parent.apply(new bt(e));else if(this.isContentFirstNode(n)&&i&&(r=this.getNextNode(n)),i&&e.apply(new p(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new p(t)),s||i||(r=n)}0===e.children.length&&e.parent.apply(new p(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),i=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(i=this.getNextNode(n)),1===t.children.length?t.parent.apply(new p(t)):t.apply(new p(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new p(e)),r||(t.nextNode=n))}r?t.previousNode=r:i&&(t.nextNode=i)}}class Lt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new T(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new S(t,e);return n.apply(s),s.newBlock}n.parent.apply(new E(n,s))}return s}}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(y.LINK),e.apply(new s([n]))),e}}}class yt extends v{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Nt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:i}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==i){const e=r.text.substring(0,i),n=r.text.substring(i),o=r.cloneWithText(e),a=r.cloneWithText(n),l=[o,s];n&&l.push(a),t.apply(new E(r,...l)),t.apply(new p(r))}else t.apply(new E(r,s));else t.apply(0!==i?new T(r,s):new E(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new yt(t))}}class Ct extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,i=this.createNewParagraph(n);if(i){const t=i.children[0];e.apply(0!==s?new T(r,t):new E(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new yt(t))}}class At extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new s([i])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new S(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new E(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],i=1===n.children.length&&n.children[0].isEmpty();if(n===r&&i){const r=n.parent.parent;if("list-item"!==r.type){const i=e.from({id:it(),type:"paragraph",nodes:[]});return i.apply(new s(t.children)),r.apply(new T(n.parent,i)),n.parent.apply(new p(n)),i}r.parent.apply(new T(r,t)),n.parent.apply(new p(n))}else n.parent.apply(new T(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(y.LINK),e}}class Ht extends v{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class jt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Ht(e):new p(e))}}class vt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let i=e;if(s===e.children[0]&&0===r)e.parent.apply(new E(e,...n));else{const t=new S(s,r);e.apply(t),e.parent.apply(new T(e,...n)),i=t.newBlock}t.futureFocusBlock=i}}}const St=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===RTEListBlock.name?new jt:new P),r.register(c.APPEND_CHILDREN,t,new kt),r.register(c.INSERT_CHILDREN_BEFORE,t,new Rt),r.register(c.INSERT_CHILDREN_AFTER,t,new Bt),r.register(c.DELETE_BLOCK_CONTENT,t,new Ot),r.register(c.INSERT_NEW_PARAGRAPH,t,t===RTEListItemBlock.name?new At:new Lt),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ct),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new Nt),r.register(c.PASTE_CONTENT,t,new vt)}};class $t{}class Dt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===F||t.style.fontWeight===z||t.classList.contains("v-rte--bold")}}class Mt extends $t{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 $t{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 $t{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=V(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class zt extends $t{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}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 Vt extends $t{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}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 Ut extends $t{canHandle(t){return"RTETextNode"===t.name}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 $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ut(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=U.filter((t=>t.key!==W.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of U)if(t.style.color.includes(e.key))return e.key;return null}}class Gt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===G||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Jt extends $t{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.name}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.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(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 $t{constructor(){super(...arguments),this.handlers=[new Mt,new Pt,new Ft]}canHandle(t){return"RTETextNode"===t.name}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:it()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Xt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(J)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Qt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(K)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Zt extends $t{canHandle(t){return"RTEImageNode"===t.name}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class _t extends $t{canHandle(t){return"RTEImageNode"===t.name}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 $t{constructor(){super(...arguments),this.customAttributeHandler=new Mt,this.customStyleAnnotationHandler=new Ft,this.customClassAnnotationHandler=new Pt}canHandle(t,e){return"RTETextNode"===t.name&&!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:s}=e;const r=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||r){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},r?{groupId:it()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});s=s?this.appendToInlineHtmlChain(s,e,t.parentNode):e}return s?Object.assign({},s):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 oe=new class{constructor(){this.handlers=[new Vt,new zt,new Dt,new Gt,new Qt,new Xt,new Wt,new Yt,new Ut,new Zt,new _t,new Mt,new Pt,new Ft,new Jt,new ie]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&Y.executeTheStrategyRefillAction(t.name,e);const s=Kt.isLinkElement(e)&&"RTETextNode"===t.name,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=Y.getStrategies(t.name);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=X.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 ae extends pt{constructor(){super(...arguments),this.annotationHandler=new Jt}generateChildNodes(t,e,s){const r=[],i=!(!s||!1!==s.autoMatchFormat),o=Object.assign({},e);return t.forEach((t=>{const a=Et.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(a&&(l=a.handle([t],s,o)),l)r.push(l);else if(dt(t)&&t.childNodes.length>0){const a=oe.generate(n,t,Object.assign({parentAnnotations:i?{inlineHtml:o.inlineHtml,link:o.link,code:o.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),a,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class le extends ae{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,n=e.dataset.language;return b.from({id:it(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ce extends ae{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return RTEImageBlock.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:t.src,annotations:oe.generate(RTEImageNode,t,e)}],annotations:Object.assign(Object.assign({},oe.generate(RTEImageBlock,t.parentElement,e)),{internalWrapper:n})},e)}}class he extends pt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:it(),type:"text",text:t,annotations:e}}}class ue extends Q{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=_.getDefaultStyles(e),super.filterAnnotations(t)):t}}class de extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return Z.isTextBlock(t.constructor.name)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return Z.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class me extends de{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class we extends de{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class Te extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=Te.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}canFilter(t){return Z.isTextNode(t.constructor.name)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return Z.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${Te.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}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(Te.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}Te.BOLD_STYLES={fontWeight:"700"},Te.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class pe extends me{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.constructor.name)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class ge extends we{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.constructor.name)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}tt.registerRTEDTOClass("paragraph",e),tt.registerRTEDTOClass("title",e),tt.registerRTEDTOClass("subtitle",e),tt.registerRTEDTOClass("heading-1",e),tt.registerRTEDTOClass("heading-2",e),tt.registerRTEDTOClass("heading-3",e),tt.registerRTEDTOClass("heading-4",e),tt.registerRTEDTOClass("heading-5",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("list-item",RTEListItemBlock),tt.registerRTEDTOClass("bullet-list",RTEListBlock),tt.registerRTEDTOClass("number-list",RTEListBlock),tt.registerRTEDTOClass("image",RTEImageBlock),tt.registerRTEDTOClass("code-block",b),tt.registerRTEDTOClass("html-block",RTEHtmlBlock),tt.registerRTEDTOClass("text",n),tt.registerRTEDTOClass("image",RTEImageNode),St.registerBlockBasicStrategies(e.name),St.registerBlockBasicStrategies(RTEListBlock.name),St.registerBlockBasicStrategies(RTEListItemBlock.name),St.registerBlockBasicStrategies(RTEImageBlock.name),St.registerBlockBasicStrategies(RTEHtmlBlock.name),Et.registerElementToBlockStrategy(new class extends ae{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,s){const r=t[0].parentElement,i=s&&s.autoMatchFormat,o=this.generateChildNodes(t,i?oe.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),a=i?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!i&&!a;return e.from(Object.assign({id:it(),type:a||"paragraph",nodes:o},l?{annotations:{internalWrapper:l}}:{annotations:oe.generate(e,r,s)}),s)}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||!!ee.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!re(t))||this.isInlineLeafOrWrapper(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}}),Et.registerElementToBlockStrategy(new class extends ce{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}}),Et.registerElementToBlockStrategy(new class extends ce{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(ot(s))return RTEImageBlock.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:s.src,annotations:oe.generate(RTEImageNode,n,e)}],annotations:oe.generate(RTEImageBlock,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ce{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{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,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:it(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:oe.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{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)?RTEListItemBlock.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)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return RTEListBlock.from({id:it(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:it(),type:"list-item",annotations:oe.generate(RTEListItemBlock,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),oe.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=ot(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return RTEListItemBlock.from({id:it(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:it(),type:"number-list",blocks:[],annotations:oe.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:it(),type:"bullet-list",blocks:[],annotations:oe.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),Et.registerElementToBlockStrategy(new class extends ae{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 RTEHtmlBlock.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(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:it(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:oe.generate(RTEHtmlBlock,t,e),children:[]}}}),
|
|
2
2
|
//!important: Code block strategies must be registered after HtmlBlockStrategy because registerElementToBlockStrategy uses unshift, giving later registrations higher priority.
|
|
3
3
|
Et.registerElementToBlockStrategy(new le),Et.registerElementToBlockStrategy(new class extends le{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}}),Et.registerElementToNodeStrategy(new class extends he{canHandle(t,e){const n=t[e];return!dt(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,s){const r=!(!e||!1!==e.autoMatchFormat),i=Object.assign({},s),o=t[0],a=oe.generate(n,o,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:s},e));if("BR"===o.nodeName)return this.generateTextNode("\n",a);if(0===o.childNodes.length){const t=r?mt(Object.assign(Object.assign({},n.supportsHtmlTag(o.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml})):a;return Object.assign({},this.generateTextNode("",t))}}}),Et.registerElementToNodeStrategy(new class extends he{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,s){const r=Object.assign({},s),i=!(!e||!1!==e.autoMatchFormat),o=t[0],a=o.parentNode.nodeName.toLowerCase(),l=i&&!n.supportsHtmlTag(a),c=this.generateTextNode(String(o.textContent),i?mt(Object.assign(Object.assign({},"span"===a?r:{link:r.link,code:"code"===a?r.code:void 0}),{inlineHtml:r.inlineHtml,plainText:l||void 0})):r);return Object.assign({},c)}}),Y.register(e.name,new ue),Y.register(RTEListBlock.name,new ue),Y.register(RTEListItemBlock.name,new ue),Y.register(n.name,new class extends Q{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===z&&delete n.fontWeight,e.italic&&n.fontStyle===G&&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!==K&&t!==J))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(K),e.strikethrough&&n.push(J),0!==n.length&&t===n.sort().join(" ")}}),Y.register(e.name,new de),Y.register(e.name,new me(1)),Y.register(e.name,new me(2)),Y.register(e.name,new me(3)),Y.register(e.name,new me(4)),Y.register(e.name,new me(5)),Y.register(e.name,new me(6)),Y.register(e.name,new we("title")),Y.register(e.name,new we("subtitle")),Y.register(n.name,new Te),Y.register(n.name,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=q.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return Z.isCodeNode(t)}canRefill(t,e){return Z.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${Q.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),Y.register(n.name,new et),Y.register(RTEImageNode.name,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=xt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return Z.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),Y.register(b.name,new nt),Y.register(st.name,new rt),Y.register(RTEListBlock.name,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=Tt.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return Z.isListBlock(t.constructor.name)}canRefill(t,e){return Z.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){return`${this.elementTagName.split(",").map((t=>`.${Q.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t.trim()}`)).join(", ")} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} }`}}),Y.register(RTEListItemBlock.name,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.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 Z.isListItemBlock(t.constructor.name)&&e}canRefill(t,e){return Z.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())))}}),Y.register(RTEListItemBlock.name,new pe(1)),Y.register(RTEListItemBlock.name,new pe(2)),Y.register(RTEListItemBlock.name,new pe(3)),Y.register(RTEListItemBlock.name,new pe(4)),Y.register(RTEListItemBlock.name,new pe(5)),Y.register(RTEListItemBlock.name,new pe(6)),Y.register(RTEListItemBlock.name,new ge("title")),Y.register(RTEListItemBlock.name,new ge("subtitle"));class Ee{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new fe(e)}}class fe{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(dt(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 ke{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 Re{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Be{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class xe{constructor(){this.processors=[new ke,new Re,new Be]}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}}class VegaRTEContent{constructor(t){t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=tt.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new VegaRTEContent(n)}static createEmptyContent(t={autoMatchFormat:!0}){return VegaRTEContent.fromJSON([{id:it(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:it(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new xe).clean(t),s=Ee.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,o=Array.from(i.childNodes);s.restore(o);const a=ft.process(o,e).filter(ot).map((t=>t.toDto(e))).filter(ot);return new VegaRTEContent(a)}static generateContentStyles(t){return Y.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new VegaRTEContent(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(ot(t.autoMatchFormat)||ot(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){if(r.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=O.getDOMByEntity(this);t&&at.notify(lt.getSubject(t,ht),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){t.children.map((t=>t.apply(new g)));const e=new RTEListItemBlock(it());return e.apply(new s(t.children)),e.annotationMap=t.annotationMap,e}createList(t){return new RTEListBlock(it(),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 RTEListItemBlock&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof RTEListBlock&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}r.register(c.DELETE_CHILDREN,VegaRTEContent.name,new P),r.register(c.APPEND_CHILDREN,VegaRTEContent.name,new kt),r.register(c.INSERT_CHILDREN_BEFORE,VegaRTEContent.name,new Rt),r.register(c.INSERT_CHILDREN_AFTER,VegaRTEContent.name,new Bt),r.register(c.TRANSFORM_TO_CODE_BLOCK,VegaRTEContent.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,s=new b(it(),this.getCodeContent(n),"plainText");e.apply(new E(n[0],s)),t.newCodeBlock=s,this.removeSelectBlocks(n,e)}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 p(t[n]))}}),r.register(c.UPDATE_CURSOR_POSITION,VegaRTEContent.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:r}=t,i=O.getDOMByEntity(e);i&&at.notify(lt.getSubject(i,ct),{node:s,offset:n,updateDirectly:r})}});export{$t as A,ae as B,Et as E,It as I,bt as M,vt as P,St as R,Ee as S,yt as U,VegaRTEContent as V,pt as a,RTEImageBlock as b,Rt as c,RTEListItemBlock as d,RTEListBlock as e,RTEImageNode as f,xt as g,oe as h,ft as i}
|