@globalpayments/vega 2.96.0 → 2.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-38afea36.js → app-globals-b3f05631.js} +10 -10
- package/dist/cjs/{aria-dialog-focusable-trap-slimmer-73b4c0cb.js → aria-dialog-focusable-trap-slimmer-62147489.js} +1 -1
- package/dist/cjs/{code-block-4126dc3b.js → code-block-d78c2b2c.js} +22 -9
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-38ba956e.js → component-value-history-controller-slimmer.abstract-beb00fea.js} +4 -4
- package/dist/cjs/constants-907d7d89.js +16 -0
- package/dist/cjs/{content-state-50e8a03c.js → content-state-78a620a9.js} +3 -3
- package/dist/cjs/{date-required-rule-4ab06a82.js → date-required-rule-5250f26d.js} +1 -1
- package/dist/cjs/{design-token-d3d12fa0.js → design-token-74674ee7.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-7773fdab.js → element-appender-slimmer-597e9e48.js} +3 -3
- package/dist/cjs/{form-field-controller-slimmer-d638ba12.js → form-field-controller-slimmer-a743be34.js} +7 -16
- package/dist/cjs/form-field-key-8d5edf75.js +25 -0
- package/dist/cjs/{image-annotation-action-89363de8.js → image-annotation-action-85c4bd83.js} +2 -2
- package/dist/cjs/{image-extension-c881c454.js → image-extension-260fa69c.js} +2 -2
- package/dist/cjs/index.cjs.js +18 -18
- package/dist/cjs/{inject-keyboard-manager-5a105612.js → inject-keyboard-manager-6a6f5c9f.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-b76006f7.js → internal-calendar-period-factory-dfcdd3f6.js} +1 -1
- package/dist/cjs/{internal-translation-controller-eb02c3b1.js → internal-translation-controller-1dac2df8.js} +7 -0
- package/dist/cjs/{keyboard-manager-ca76d4dc.js → keyboard-manager-c56033b1.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-a1223714.js → keyboard-manager-slimmer-7043a106.js} +1 -1
- package/dist/cjs/{link-extension-b7f99a52.js → link-extension-220ff6a9.js} +3 -3
- package/dist/cjs/loader.cjs.js +13 -13
- package/dist/cjs/{month-view-generator-876c50d4.js → month-view-generator-7b704a80.js} +1 -1
- package/dist/cjs/{public-rules-72894208.js → public-rules-5657bce4.js} +8 -8
- package/dist/cjs/{range-95d41dea.js → range-c5afd53a.js} +1 -1
- package/dist/cjs/{responsive-format-facade-25e9f30d.js → responsive-format-facade-493d1763.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-4d6d2493.js → rich-text-editor-required-rule-385c1b61.js} +1 -1
- package/dist/cjs/{split-cell-operation-70be116d.js → split-cell-operation-873d5db7.js} +3 -3
- package/dist/cjs/{state-border-formatter-f1ce0f3b.js → state-border-formatter-711c7aaa.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-b22f7754.js → string-format-strategy.abstract-b61bdcbd.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-d2c248f7.js → string-input-formatter-slimmer-ef65cca7.js} +3 -3
- package/dist/cjs/{string-mask-strategy-fc01a500.js → string-mask-strategy-ad3fa0ac.js} +2 -2
- package/dist/cjs/{style-formatter-73205450.js → style-formatter-8f711cb0.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-18891389.js → sub-state-notify-slimmer-e264a120.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-eee2f0ae.js → sub-state-observer-slimmer-6033b824.js} +1 -1
- package/dist/cjs/{time-required-rule-12d2f394.js → time-required-rule-87417359.js} +1 -1
- package/dist/cjs/{token-extension-eb828948.js → token-extension-78b5a026.js} +9 -9
- package/dist/cjs/{translation-slimmer-9099f56c.js → translation-slimmer-77c7f37d.js} +1 -1
- package/dist/cjs/{type-guard-f354af8b.js → type-guard-a57ef3ac.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-8d370163.js → valid-credit-card-number-rule-4c0a3040.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
- package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-backdrop.cjs.entry.js +63 -8
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-calendar_5.cjs.entry.js +10 -10
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +22 -5
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +13 -26
- package/dist/cjs/vega-color-picker.cjs.entry.js +13 -4
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +14 -5
- package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +19 -10
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +26 -17
- package/dist/cjs/vega-dialog_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +30 -24
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +49 -7
- 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 +31 -28
- 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 +16 -7
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +18 -9
- package/dist/cjs/vega-input-numeric.cjs.entry.js +17 -8
- package/dist/cjs/vega-input-passcode.cjs.entry.js +16 -7
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +15 -6
- package/dist/cjs/vega-input-range.cjs.entry.js +14 -5
- package/dist/cjs/vega-input-select.cjs.entry.js +16 -7
- package/dist/cjs/vega-input.cjs.entry.js +19 -12
- package/dist/cjs/{vega-internal-event-id-ecc5b87a.js → vega-internal-event-id-f4d33037.js} +2 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +74 -14
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +5 -5
- package/dist/cjs/vega-popover_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +19 -7
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +35 -12
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +1585 -432
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +1 -1
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +9 -9
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +16 -7
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +14 -5
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +6 -6
- package/dist/cjs/vega-signature-capture.cjs.entry.js +18 -9
- package/dist/cjs/vega-stepper.cjs.entry.js +14 -5
- package/dist/cjs/vega-table_11.cjs.entry.js +1144 -450
- package/dist/cjs/vega-textarea.cjs.entry.js +14 -5
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +20 -11
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +14 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +7 -7
- package/dist/cjs/vega.cjs.js +13 -13
- package/dist/cjs/{wait-for-component-did-render-02ca4bee.js → wait-for-component-did-render-44d006ee.js} +1 -1
- package/dist/collection/components/vega-accordion/vega-accordion.js +2 -0
- package/dist/collection/components/vega-app-footer/vega-app-footer.js +2 -0
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +2 -0
- package/dist/collection/components/vega-backdrop/slimmers/controller/vega-backdrop-visible-controller.js +63 -8
- package/dist/collection/components/vega-banner/vega-banner.js +2 -0
- package/dist/collection/components/vega-box/vega-box.js +2 -0
- package/dist/collection/components/vega-brand-logo/vega-brand-logo.js +2 -0
- package/dist/collection/components/vega-breadcrumb/vega-breadcrumb.js +2 -0
- package/dist/collection/components/vega-button/vega-button.js +2 -0
- package/dist/collection/components/vega-button-circle/vega-button-circle.js +2 -0
- package/dist/collection/components/vega-button-group/vega-button-group.js +2 -0
- package/dist/collection/components/vega-button-link/vega-button-link.js +2 -0
- package/dist/collection/components/vega-calendar/vega-calendar.js +2 -0
- package/dist/collection/components/vega-card/vega-card.js +2 -0
- package/dist/collection/components/vega-carousel/vega-carousel.js +2 -0
- package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.js +33 -1
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +36 -2
- package/dist/collection/components/vega-chip/vega-chip.js +2 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.js +4 -17
- package/dist/collection/components/vega-color-picker/vega-color-picker.js +35 -1
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.js +33 -1
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +35 -1
- package/dist/collection/components/vega-counter-badge/vega-counter-badge.js +2 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker.js +35 -1
- package/dist/collection/components/vega-divider/vega-divider.js +2 -0
- package/dist/collection/components/vega-dropdown/constants.js +10 -0
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +45 -14
- package/dist/collection/components/vega-field-error/vega-field-error.js +2 -0
- package/dist/collection/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-file-list-renderer.js +22 -2
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +96 -7
- package/dist/collection/components/vega-flag-icon/vega-flag-icon.js +2 -0
- package/dist/collection/components/vega-flex/vega-flex.js +2 -0
- package/dist/collection/components/vega-font/vega-font.js +2 -0
- package/dist/collection/components/vega-form/slimmers/controllers/vega-form-field-controller.js +9 -9
- package/dist/collection/components/vega-form/slimmers/controllers/vega-form-field-validation-state-controller.js +5 -5
- package/dist/collection/components/vega-form/slimmers/renderers/native-form-renderer.js +4 -1
- package/dist/collection/components/vega-form/vega-form.js +34 -0
- package/dist/collection/components/vega-grid/vega-grid.js +2 -0
- package/dist/collection/components/vega-icon/vega-icon.js +2 -0
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +35 -1
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-suggestions-renderer.js +7 -2
- package/dist/collection/components/vega-input/vega-input.js +7 -4
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +36 -2
- package/dist/collection/components/vega-input-numeric/vega-input-numeric.js +35 -1
- package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +35 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +35 -1
- package/dist/collection/components/vega-input-range/vega-input-range.js +35 -1
- package/dist/collection/components/vega-input-select/vega-input-select.js +35 -1
- package/dist/collection/components/vega-item-toggle/vega-item-toggle.js +2 -0
- package/dist/collection/components/vega-loading-indicator/vega-loading-indicator.js +2 -0
- package/dist/collection/components/vega-modal/vega-modal.js +2 -0
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-manager.js +17 -1
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.js +48 -5
- package/dist/collection/components/vega-page-notification/vega-page-notification.js +2 -0
- package/dist/collection/components/vega-pagination/vega-pagination.js +2 -0
- package/dist/collection/components/vega-popover/vega-popover.js +2 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +2 -0
- package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.js +18 -3
- package/dist/collection/components/vega-radio/vega-radio.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +26 -3
- package/dist/collection/components/vega-rich-text-editor/helpers/utils.js +10 -6
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/keyboard-link-handler.js +297 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +35 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.js +398 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-state-manager.js +111 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-type-config-controller.js +173 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/link-type-handler.js +49 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +114 -106
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/utils/link-url-normalizer.js +80 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.js +44 -1
- package/dist/collection/components/vega-section-title/vega-section-title.js +2 -0
- package/dist/collection/components/vega-segment-control/vega-segment-control.js +2 -0
- package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.js +33 -1
- package/dist/collection/components/vega-selection-chip/vega-selection-chip.js +2 -0
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.js +33 -1
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.js +2 -0
- package/dist/collection/components/vega-sidenav/vega-sidenav.js +2 -0
- package/dist/collection/components/vega-signature-capture/vega-signature-capture.js +35 -1
- package/dist/collection/components/vega-skeleton/vega-skeleton.js +2 -0
- package/dist/collection/components/vega-stepper/vega-stepper.js +36 -2
- package/dist/collection/components/vega-tab-group/vega-tab-group.js +2 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-column-structure-model-controller.js +17 -7
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-head-template-structure-controller.js +440 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-render-input-controller.js +11 -3
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +207 -17
- package/dist/collection/components/vega-table/vega-table-foot/vega-table-foot.css +1 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +4 -1
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.css +15 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.js +1 -1
- package/dist/collection/components/vega-table/vega-table-head-cell/slimmers/controllers/vega-table-head-cell-template-structure-controller.js +28 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +1 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +68 -4
- package/dist/collection/components/vega-table/vega-table.js +15 -0
- package/dist/collection/components/vega-textarea/vega-textarea.js +36 -2
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +35 -1
- package/dist/collection/components/vega-toggle-switch/vega-toggle-switch.js +36 -2
- package/dist/collection/components/vega-tooltip/vega-tooltip.js +2 -0
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
- package/dist/collection/helpers/slimmers/{field-error-controller-silmmer.js → form/field-error-controller-silmmer.js} +3 -3
- package/dist/collection/helpers/slimmers/{field-error-ui-controller-slimmer.js → form/field-error-ui-controller-slimmer.js} +9 -9
- package/dist/collection/helpers/slimmers/{form-field-controller-slimmer.js → form/form-field-controller-slimmer.js} +9 -18
- package/dist/collection/helpers/slimmers/{form-field-message-translator.js → form/form-field-message-translator.js} +1 -1
- package/dist/collection/helpers/slimmers/{form-field-state-controller-slimmer.js → form/form-field-state-controller-slimmer.js} +1 -1
- package/dist/collection/helpers/slimmers/{form-field-valid-invoke-slimmer.js → form/form-field-valid-invoke-slimmer.js} +2 -2
- package/dist/collection/helpers/slimmers/form/utils/form-field-key.js +20 -0
- package/dist/collection/helpers/translation/locales/en.js +7 -0
- package/dist/collection/helpers/validator/form-field-controller.js +5 -4
- package/dist/esm/{app-globals-d7b651c1.js → app-globals-95c7110a.js} +10 -10
- package/dist/esm/{aria-dialog-focusable-trap-slimmer-9eae86c6.js → aria-dialog-focusable-trap-slimmer-f069f54d.js} +1 -1
- package/dist/esm/{code-block-0a88b481.js → code-block-9c513169.js} +20 -10
- package/dist/esm/{component-value-history-controller-slimmer.abstract-6846edfa.js → component-value-history-controller-slimmer.abstract-9cef2a2a.js} +4 -4
- package/dist/esm/constants-4725f97f.js +13 -0
- package/dist/esm/{content-state-79ca99e5.js → content-state-25c81c08.js} +3 -3
- package/dist/esm/{date-required-rule-b88e1650.js → date-required-rule-85334d0c.js} +1 -1
- package/dist/esm/{design-token-76bd217c.js → design-token-10ff79b5.js} +3 -3
- package/dist/esm/{element-appender-slimmer-73ad10ae.js → element-appender-slimmer-8a06ecdd.js} +3 -3
- package/dist/esm/{form-field-controller-slimmer-395c23e3.js → form-field-controller-slimmer-68fc5380.js} +7 -16
- package/dist/esm/form-field-key-44ab39d0.js +22 -0
- package/dist/esm/{image-annotation-action-bb299ef1.js → image-annotation-action-d7f2aecc.js} +2 -2
- package/dist/esm/{image-extension-48a96f98.js → image-extension-fbd1ed6e.js} +2 -2
- package/dist/esm/index.js +18 -18
- package/dist/esm/{inject-keyboard-manager-86126b5b.js → inject-keyboard-manager-ea1aad5b.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-3a07dba0.js → internal-calendar-period-factory-7b294fb6.js} +1 -1
- package/dist/esm/{internal-translation-controller-16709132.js → internal-translation-controller-fac22598.js} +7 -0
- package/dist/esm/{keyboard-manager-a0c3e1cf.js → keyboard-manager-50da85d7.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-f3f66c15.js → keyboard-manager-slimmer-1f7c8bfb.js} +1 -1
- package/dist/esm/{link-extension-09534514.js → link-extension-e8ee103e.js} +3 -3
- package/dist/esm/loader.js +13 -13
- package/dist/esm/{month-view-generator-fd0e1856.js → month-view-generator-a1a9a4ec.js} +1 -1
- package/dist/esm/{public-rules-5eb03ef0.js → public-rules-49de79c7.js} +8 -8
- package/dist/esm/{range-d4deb7df.js → range-b678c693.js} +1 -1
- package/dist/esm/{responsive-format-facade-ced96b0b.js → responsive-format-facade-f19b601c.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-5bbbce23.js → rich-text-editor-required-rule-578e0958.js} +1 -1
- package/dist/esm/{split-cell-operation-7f3058ad.js → split-cell-operation-1c8e7585.js} +3 -3
- package/dist/esm/{state-border-formatter-b680e922.js → state-border-formatter-bfda33aa.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-23faab71.js → string-format-strategy.abstract-1f4ff1b3.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-4b4866a6.js → string-input-formatter-slimmer-0006a107.js} +3 -3
- package/dist/esm/{string-mask-strategy-66586cd8.js → string-mask-strategy-bbbcdbef.js} +2 -2
- package/dist/esm/{style-formatter-f4e16af5.js → style-formatter-e9adc8f4.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-0f72ce74.js → sub-state-notify-slimmer-23b7d0e8.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-64532d94.js → sub-state-observer-slimmer-722f6b92.js} +1 -1
- package/dist/esm/{time-required-rule-6e80a9ab.js → time-required-rule-1ce2d0a0.js} +1 -1
- package/dist/esm/{token-extension-40c32bcc.js → token-extension-f2d009e3.js} +9 -9
- package/dist/esm/{translation-slimmer-21748a0e.js → translation-slimmer-ee0f0e76.js} +1 -1
- package/dist/esm/{type-guard-ec5e8628.js → type-guard-f2624334.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-ca5a47d6.js → valid-credit-card-number-rule-60212b1d.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +6 -6
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-backdrop.entry.js +63 -8
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +6 -6
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button.entry.js +4 -4
- package/dist/esm/vega-calendar_5.entry.js +10 -10
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +22 -5
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +13 -26
- package/dist/esm/vega-color-picker.entry.js +13 -4
- package/dist/esm/vega-color-swatch-picker.entry.js +14 -5
- package/dist/esm/vega-color-swatch.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +19 -10
- package/dist/esm/vega-date-picker_2.entry.js +26 -17
- package/dist/esm/vega-dialog_2.entry.js +5 -5
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +26 -20
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +49 -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 +31 -28
- 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 +16 -7
- package/dist/esm/vega-input-credit-card.entry.js +18 -9
- package/dist/esm/vega-input-numeric.entry.js +17 -8
- package/dist/esm/vega-input-passcode.entry.js +16 -7
- package/dist/esm/vega-input-phone-number.entry.js +15 -6
- package/dist/esm/vega-input-range.entry.js +14 -5
- package/dist/esm/vega-input-select.entry.js +16 -7
- package/dist/esm/vega-input.entry.js +19 -12
- package/dist/esm/{vega-internal-event-id-827eb1ce.js → vega-internal-event-id-86fce049.js} +2 -1
- package/dist/esm/vega-left-nav_5.entry.js +74 -14
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination.entry.js +5 -5
- package/dist/esm/vega-popover_2.entry.js +10 -10
- package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +19 -7
- package/dist/esm/vega-rich-text-content.entry.js +35 -12
- package/dist/esm/vega-rich-text-editor_4.entry.js +1585 -432
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +1 -1
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +9 -9
- package/dist/esm/vega-selection-chip_2.entry.js +16 -7
- package/dist/esm/vega-selection-tile_2.entry.js +14 -5
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +18 -9
- package/dist/esm/vega-stepper.entry.js +14 -5
- package/dist/esm/vega-table_11.entry.js +1145 -451
- package/dist/esm/vega-textarea.entry.js +14 -5
- package/dist/esm/vega-time-picker_2.entry.js +20 -11
- package/dist/esm/vega-toggle-switch.entry.js +14 -5
- package/dist/esm/vega-tooltip_2.entry.js +7 -7
- package/dist/esm/vega.js +13 -13
- package/dist/esm/{wait-for-component-did-render-0c237cb8.js → wait-for-component-did-render-ff7062aa.js} +1 -1
- package/dist/sri/vega-sri-manifest.json +346 -338
- package/dist/types/components/vega-accordion/vega-accordion.d.ts +2 -0
- package/dist/types/components/vega-app-footer/vega-app-footer.d.ts +2 -0
- package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +2 -0
- package/dist/types/components/vega-backdrop/slimmers/controller/vega-backdrop-visible-controller.d.ts +21 -0
- package/dist/types/components/vega-banner/vega-banner.d.ts +2 -0
- package/dist/types/components/vega-box/vega-box.d.ts +2 -0
- package/dist/types/components/vega-brand-logo/vega-brand-logo.d.ts +2 -0
- package/dist/types/components/vega-breadcrumb/vega-breadcrumb.d.ts +2 -0
- package/dist/types/components/vega-button/vega-button.d.ts +2 -0
- package/dist/types/components/vega-button-circle/vega-button-circle.d.ts +2 -0
- package/dist/types/components/vega-button-group/vega-button-group.d.ts +2 -0
- package/dist/types/components/vega-button-link/vega-button-link.d.ts +2 -0
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +2 -0
- package/dist/types/components/vega-card/vega-card.d.ts +2 -0
- package/dist/types/components/vega-carousel/vega-carousel.d.ts +2 -0
- package/dist/types/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.d.ts +9 -1
- package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +11 -1
- package/dist/types/components/vega-chip/vega-chip.d.ts +2 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.d.ts +2 -1
- package/dist/types/components/vega-color-picker/vega-color-picker.d.ts +11 -1
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.d.ts +9 -1
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +11 -1
- package/dist/types/components/vega-counter-badge/vega-counter-badge.d.ts +2 -0
- package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +11 -1
- package/dist/types/components/vega-divider/vega-divider.d.ts +2 -0
- package/dist/types/components/vega-dropdown/constants.d.ts +12 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +9 -0
- package/dist/types/components/vega-field-error/vega-field-error.d.ts +2 -0
- package/dist/types/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-file-list-renderer.d.ts +10 -0
- package/dist/types/components/vega-file-uploader/types.d.ts +4 -0
- package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +24 -1
- package/dist/types/components/vega-flag-icon/vega-flag-icon.d.ts +2 -0
- package/dist/types/components/vega-flex/vega-flex.d.ts +2 -0
- package/dist/types/components/vega-font/vega-font.d.ts +2 -0
- package/dist/types/components/vega-form/slimmers/controllers/vega-form-field-controller.d.ts +3 -2
- package/dist/types/components/vega-form/slimmers/renderers/native-form-renderer.d.ts +1 -0
- package/dist/types/components/vega-form/vega-form.d.ts +10 -0
- package/dist/types/components/vega-grid/vega-grid.d.ts +2 -0
- package/dist/types/components/vega-icon/vega-icon.d.ts +2 -0
- package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +11 -1
- package/dist/types/components/vega-input/types.d.ts +11 -1
- package/dist/types/components/vega-input/vega-input.d.ts +5 -2
- package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +11 -1
- package/dist/types/components/vega-input-numeric/vega-input-numeric.d.ts +11 -1
- package/dist/types/components/vega-input-passcode/vega-input-passcode.d.ts +11 -1
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +11 -1
- package/dist/types/components/vega-input-range/vega-input-range.d.ts +11 -1
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +11 -1
- package/dist/types/components/vega-item-toggle/vega-item-toggle.d.ts +2 -0
- package/dist/types/components/vega-loading-indicator/vega-loading-indicator.d.ts +2 -0
- package/dist/types/components/vega-modal/vega-modal.d.ts +2 -0
- package/dist/types/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-manager.d.ts +7 -0
- package/dist/types/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.d.ts +17 -0
- package/dist/types/components/vega-page-notification/vega-page-notification.d.ts +2 -0
- package/dist/types/components/vega-pagination/vega-pagination.d.ts +2 -0
- package/dist/types/components/vega-popover/vega-popover.d.ts +2 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +2 -0
- package/dist/types/components/vega-radio/vega-radio-group/vega-radio-group.d.ts +5 -1
- package/dist/types/components/vega-radio/vega-radio.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/link/type.d.ts +34 -0
- package/dist/types/components/vega-rich-text-editor/helpers/utils.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +4 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/keyboard-link-handler.d.ts +111 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +11 -1
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.d.ts +149 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-state-manager.d.ts +84 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-type-config-controller.d.ts +82 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/link-type-handler.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +24 -17
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/utils/link-url-normalizer.d.ts +37 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.d.ts +12 -0
- package/dist/types/components/vega-section-title/vega-section-title.d.ts +2 -0
- package/dist/types/components/vega-segment-control/vega-segment-control.d.ts +2 -0
- package/dist/types/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.d.ts +9 -1
- package/dist/types/components/vega-selection-chip/vega-selection-chip.d.ts +2 -0
- package/dist/types/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.d.ts +9 -1
- package/dist/types/components/vega-selection-tile/vega-selection-tile.d.ts +2 -0
- package/dist/types/components/vega-sidenav/vega-sidenav.d.ts +2 -0
- package/dist/types/components/vega-signature-capture/vega-signature-capture.d.ts +11 -1
- package/dist/types/components/vega-skeleton/vega-skeleton.d.ts +2 -0
- package/dist/types/components/vega-stepper/vega-stepper.d.ts +11 -1
- package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +2 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-column-structure-model-controller.d.ts +8 -4
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-head-template-structure-controller.d.ts +168 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-render-input-controller.d.ts +8 -1
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.d.ts +76 -0
- package/dist/types/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-head-cell/slimmers/controllers/vega-table-head-cell-template-structure-controller.d.ts +12 -0
- package/dist/types/components/vega-table/vega-table-head-cell/vega-table-head-cell.d.ts +19 -0
- package/dist/types/components/vega-table/vega-table.d.ts +6 -0
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +11 -1
- package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +11 -1
- package/dist/types/components/vega-toggle-switch/vega-toggle-switch.d.ts +11 -1
- package/dist/types/components/vega-tooltip/vega-tooltip.d.ts +2 -0
- package/dist/types/components.d.ts +341 -4
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
- package/dist/types/helpers/slimmers/{field-error-controller-silmmer.d.ts → form/field-error-controller-silmmer.d.ts} +1 -1
- package/dist/types/helpers/slimmers/{field-error-ui-controller-slimmer.d.ts → form/field-error-ui-controller-slimmer.d.ts} +2 -2
- package/dist/types/helpers/slimmers/{form-field-controller-slimmer.d.ts → form/form-field-controller-slimmer.d.ts} +6 -14
- package/dist/types/helpers/slimmers/{form-field-message-translator.d.ts → form/form-field-message-translator.d.ts} +2 -2
- package/dist/types/helpers/slimmers/{form-field-state-controller-slimmer.d.ts → form/form-field-state-controller-slimmer.d.ts} +2 -2
- package/dist/types/helpers/slimmers/{form-field-valid-invoke-slimmer.d.ts → form/form-field-valid-invoke-slimmer.d.ts} +3 -3
- package/dist/types/helpers/slimmers/form/utils/form-field-key.d.ts +17 -0
- package/dist/types/helpers/translation/interface.d.ts +7 -0
- package/dist/types/helpers/validator/form-field-controller.d.ts +3 -3
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-b3a2ce06.entry.js → p-02d3ce79.entry.js} +1 -1
- package/dist/vega/p-035e2f05.entry.js +1 -0
- package/dist/vega/p-03eeadc1.entry.js +1 -0
- package/dist/vega/{p-5924adae.entry.js → p-085d1647.entry.js} +1 -1
- package/dist/vega/p-0cbf09f7.entry.js +1 -0
- package/dist/vega/{p-74f86ff9.entry.js → p-0cf3b5c1.entry.js} +1 -1
- package/dist/vega/{p-55e0014a.js → p-0eb29065.js} +1 -1
- package/dist/vega/{p-6a51d720.js → p-10d30c03.js} +1 -1
- package/dist/vega/{p-ba662fe5.js → p-12e8a1b2.js} +1 -1
- package/dist/vega/p-17c69503.entry.js +1 -0
- package/dist/vega/p-1abd3c17.js +1 -0
- package/dist/vega/p-1aedbfd2.entry.js +1 -0
- package/dist/vega/p-1cff027b.entry.js +1 -0
- package/dist/vega/{p-3dee1e55.js → p-1e0a8fd3.js} +1 -1
- package/dist/vega/{p-919cddc3.js → p-1ea9ad9a.js} +1 -1
- package/dist/vega/{p-22cc174e.entry.js → p-2a245138.entry.js} +1 -1
- package/dist/vega/{p-892edf88.entry.js → p-2acf9b42.entry.js} +1 -1
- package/dist/vega/{p-b1eb9ff0.js → p-2c2e8615.js} +1 -1
- package/dist/vega/p-2d158cbd.js +1 -0
- package/dist/vega/{p-8354cff0.entry.js → p-2f07d719.entry.js} +1 -1
- package/dist/vega/p-36d9e782.entry.js +1 -0
- package/dist/vega/{p-9d3f69cb.js → p-373541fa.js} +1 -1
- package/dist/vega/p-3737b9e2.entry.js +1 -0
- package/dist/vega/{p-14baa886.js → p-39c5054b.js} +1 -1
- package/dist/vega/{p-312d8205.js → p-3d0b4074.js} +1 -1
- package/dist/vega/{p-8db904dc.js → p-456f678b.js} +1 -1
- package/dist/vega/{p-6c9c2f8c.entry.js → p-461100b8.entry.js} +1 -1
- package/dist/vega/p-4a2fe3a4.js +1 -0
- package/dist/vega/p-4bfe3258.entry.js +1 -0
- package/dist/vega/p-4cbfc01e.entry.js +1 -0
- package/dist/vega/p-4e065ef7.entry.js +1 -0
- package/dist/vega/{p-ec5dee32.js → p-4fd0cf01.js} +1 -1
- package/dist/vega/p-52c69f9e.entry.js +1 -0
- package/dist/vega/p-544ce391.entry.js +1 -0
- package/dist/vega/{p-6fcec7c7.entry.js → p-56417ec5.entry.js} +1 -1
- package/dist/vega/{p-c4564904.js → p-56493601.js} +1 -1
- package/dist/vega/p-56598858.entry.js +1 -0
- package/dist/vega/p-56db3323.js +1 -0
- package/dist/vega/p-571ec00b.js +1 -0
- package/dist/vega/{p-2df5d59b.entry.js → p-585e4f1c.entry.js} +1 -1
- package/dist/vega/p-5b1f5e4a.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-a0a58295.entry.js → p-5f96e741.entry.js} +1 -1
- package/dist/vega/p-6234852e.entry.js +1 -0
- package/dist/vega/p-67eaf77e.js +1 -0
- package/dist/vega/{p-75e33859.js → p-6c95a6a3.js} +1 -1
- package/dist/vega/p-6d4518d7.entry.js +1 -0
- package/dist/vega/p-6db1b9ac.js +1 -0
- package/dist/vega/p-6f537797.entry.js +1 -0
- package/dist/vega/p-6fd4f2c6.js +1 -0
- package/dist/vega/p-71909102.js +1 -0
- package/dist/vega/{p-e1b57e8f.entry.js → p-72ab5cd5.entry.js} +1 -1
- package/dist/vega/p-72fd17a1.entry.js +1 -0
- package/dist/vega/{p-8720816e.js → p-781b7a54.js} +1 -1
- package/dist/vega/p-7dcd2850.entry.js +1 -0
- package/dist/vega/{p-9f11b579.js → p-7e8fdac4.js} +1 -1
- package/dist/vega/{p-84b7a775.js → p-810c9c29.js} +1 -1
- package/dist/vega/{p-a2bd621e.js → p-83ad8988.js} +1 -1
- package/dist/vega/{p-0d18368b.js → p-874e5624.js} +1 -1
- package/dist/vega/{p-9f201152.entry.js → p-8c56d74d.entry.js} +1 -1
- package/dist/vega/{p-3c23ec90.js → p-8d2501b2.js} +1 -1
- package/dist/vega/{p-9bdc6e11.entry.js → p-92528dc9.entry.js} +1 -1
- package/dist/vega/{p-3d6f761a.entry.js → p-94975537.entry.js} +1 -1
- package/dist/vega/p-95c18f79.entry.js +1 -0
- package/dist/vega/p-9834d5d4.entry.js +1 -0
- package/dist/vega/{p-3345d903.js → p-a090b2be.js} +1 -1
- package/dist/vega/{p-e48a870f.entry.js → p-a484e32d.entry.js} +1 -1
- package/dist/vega/{p-b9e72de2.entry.js → p-a8174ad8.entry.js} +1 -1
- package/dist/vega/{p-3c309a38.js → p-a81ad3bd.js} +1 -1
- package/dist/vega/{p-49e1cf4d.entry.js → p-a91927eb.entry.js} +1 -1
- package/dist/vega/{p-e4266b45.entry.js → p-ac94ba1b.entry.js} +1 -1
- package/dist/vega/{p-b775e51f.js → p-ae2abdfa.js} +1 -1
- package/dist/vega/{p-a890d60b.entry.js → p-b00ec194.entry.js} +1 -1
- package/dist/vega/{p-f78944d7.entry.js → p-b3733762.entry.js} +1 -1
- package/dist/vega/{p-b4e7c967.js → p-b622c455.js} +1 -1
- package/dist/vega/{p-1232b553.entry.js → p-b98ead05.entry.js} +1 -1
- package/dist/vega/{p-e5ff77f7.entry.js → p-c2277448.entry.js} +1 -1
- package/dist/vega/{p-29e3eb12.js → p-c41a2d4a.js} +1 -1
- package/dist/vega/p-c5fb8a69.entry.js +1 -0
- package/dist/vega/{p-96da7d30.entry.js → p-c6d775b8.entry.js} +1 -1
- package/dist/vega/p-c70748f7.entry.js +1 -0
- package/dist/vega/p-c98c2f5f.entry.js +1 -0
- package/dist/vega/{p-bb60e381.entry.js → p-ca3c1317.entry.js} +1 -1
- package/dist/vega/p-cb81126a.entry.js +1 -0
- package/dist/vega/{p-b4c26035.entry.js → p-ccbe3f1b.entry.js} +1 -1
- package/dist/vega/{p-6cde45fc.js → p-cd69aeae.js} +1 -1
- package/dist/vega/{p-775ecfad.entry.js → p-cf4b3d40.entry.js} +1 -1
- package/dist/vega/{p-e1737c8e.entry.js → p-cfe268a8.entry.js} +1 -1
- package/dist/vega/p-d470fce2.entry.js +1 -0
- package/dist/vega/{p-f1974321.js → p-d609c3fd.js} +1 -1
- package/dist/vega/{p-1dfbc542.entry.js → p-da867019.entry.js} +1 -1
- package/dist/vega/{p-3f183b52.js → p-daba4af1.js} +1 -1
- package/dist/vega/{p-61ce8029.js → p-dbb4b1d1.js} +1 -1
- package/dist/vega/p-dcd3e3a7.js +1 -0
- package/dist/vega/p-de8f0d98.js +1 -0
- package/dist/vega/p-e18c0656.entry.js +1 -0
- package/dist/vega/{p-595998d9.entry.js → p-f29ea345.entry.js} +1 -1
- package/dist/vega/p-f62c5a20.entry.js +1 -0
- package/dist/vega/p-f6c0e9e7.entry.js +1 -0
- package/dist/vega/{p-56d19601.entry.js → p-fb9475ab.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-0512308f.entry.js +0 -1
- package/dist/vega/p-1d8312d3.entry.js +0 -1
- package/dist/vega/p-2d77ae73.entry.js +0 -1
- package/dist/vega/p-2d8d4d5b.entry.js +0 -1
- package/dist/vega/p-320091b7.js +0 -1
- package/dist/vega/p-36949349.js +0 -1
- package/dist/vega/p-3a68b729.js +0 -1
- package/dist/vega/p-4151f53a.entry.js +0 -1
- package/dist/vega/p-4ff48b84.js +0 -1
- package/dist/vega/p-5e4517eb.entry.js +0 -1
- package/dist/vega/p-6680ba17.entry.js +0 -1
- package/dist/vega/p-6c7b6d45.js +0 -1
- package/dist/vega/p-7950f3e2.entry.js +0 -1
- package/dist/vega/p-80b7945a.entry.js +0 -1
- package/dist/vega/p-841b3281.entry.js +0 -1
- package/dist/vega/p-87e5cb56.entry.js +0 -1
- package/dist/vega/p-88a6c89a.js +0 -1
- package/dist/vega/p-91303402.entry.js +0 -1
- package/dist/vega/p-97215133.js +0 -1
- package/dist/vega/p-9d96d83f.entry.js +0 -1
- package/dist/vega/p-a05a2f1e.entry.js +0 -1
- package/dist/vega/p-a775825e.entry.js +0 -1
- package/dist/vega/p-acaff62d.entry.js +0 -1
- package/dist/vega/p-ae146458.entry.js +0 -1
- package/dist/vega/p-b63319e9.entry.js +0 -1
- package/dist/vega/p-b660f38c.entry.js +0 -1
- package/dist/vega/p-b8c13ac9.entry.js +0 -1
- package/dist/vega/p-b8ffa42f.entry.js +0 -1
- package/dist/vega/p-bbad318e.entry.js +0 -1
- package/dist/vega/p-c0e42c03.entry.js +0 -1
- package/dist/vega/p-c41f5684.entry.js +0 -1
- package/dist/vega/p-c54b5a8f.entry.js +0 -1
- package/dist/vega/p-cd1e976c.entry.js +0 -1
- package/dist/vega/p-d9158512.js +0 -1
- package/dist/vega/p-e62d41ee.js +0 -1
- package/dist/vega/p-ebe32b25.entry.js +0 -1
- package/dist/vega/p-ec162599.entry.js +0 -1
- package/dist/vega/p-f29d9707.entry.js +0 -1
- package/dist/vega/p-fc7e4c8a.entry.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as t,p as e,g as n,k as s,s as r,v as i,N as o,o as a,w as l,x as c,A as h,j as u,i as d,y as w,I as p,e as f,M as m,b as g,R as T,S as x,a as b,z as O,D as y,H as E,E as k,F as A,U as C,G as H,J as v,q as B,K as j,L as N,O as I,P as S,Q as R,T as L,W as D,X as $,Y as P,Z as M,u as F,_ as z,$ as U,n as V,a0 as G,a1 as W,a2 as J,a3 as K,m as Y,a4 as X,a5 as Q,r as Z,a6 as _,a7 as q}from"./p-e62d41ee.js";import{g as tt}from"./p-8b5d3a52.js";import{i as et}from"./p-8db904dc.js";import{C as nt}from"./p-2d0d575f.js";import{d as st}from"./p-526e3634.js";import{c as rt,d as it,e as ot}from"./p-3a68b729.js";import{r as at,i as lt}from"./p-528748fa.js";import{c as ct}from"./p-a841cf13.js";import{L as ht}from"./p-6e1ab235.js";class ut{}class dt{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(et)),e}}const wt=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)}},pt=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 dt(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 wt.getElementToBlockStrategies()}};class ft extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class mt 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 gt extends mt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class Tt extends i{constructor(t,e){super(),this.type=o.IMAGE,this.size=t,this.alt=e}static from(t,e){return[o.IMAGE,new Tt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return et(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new Tt(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=Tt.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%"})}}}Tt.BASE_STYLES={verticalAlign:"bottom"};class xt extends a{constructor(t,e,n,s){super(t,s),this.dtoName=xt.dtoName,this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new xt(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?Tt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(et)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof Tt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new xt(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(o.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(et))}>`}doAnnotationActionApply(t){const e=h.get(u.name,xt.name);e&&e.execute(t,this)}doModifyActionApply(t){h.executeTheStrategy(t,this)}}h.register(d.UPDATE_IMAGE_NODE_URL,xt.name,new class extends t{handleAction(t,e){e.url=t.url}}),h.register(u.name,xt.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}}),xt.dtoName="RTEImageNode";class bt extends m{constructor(t,e){super(),this.type=d.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class Ot extends b{constructor(t){super(t),this.dtoName=Ot.dtoName,this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new Ot(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>xt.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 Ot(tt())}clone(t){const e=new Ot(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}h.register(d.MERGE_TWO_BLOCKS_NODES,Ot.name,new O),h.register(d.REPLACE_CHILD_NODES,Ot.name,new y),h.register(d.SPLIT_BLOCK_WITH_NODE,Ot.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 w(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new p(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new f(t)),n}}),h.register(d.LINE_BREAK_SINGLE_BLOCK,Ot.name,new class extends t{handleAction(t,e){const n=new bt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),h.register(d.LINE_BREAK_MULTIPLE_BLOCKS,Ot.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=g.from({id:tt(),type:"paragraph",nodes:[{id:tt(),type:"text",text:"\n"}]});e.parent.apply(new p(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new T(tt(),"\n",n)),n.apply(new f(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),h.register(d.INSERT_IMAGE_TO_BLOCK,Ot.name,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new f(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new p(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new x(s,r)),e.parent.apply(new p(e,i)))}}),h.register(E.name,Ot.name,new k),Ot.dtoName="RTEImageBlock";class yt extends m{constructor(t){super(),this.type=d.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Et extends A{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new C(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],o=this.getPreviousNode(n);return o&&o.parent===e&&"\n"===o.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==o?void 0:o.parent)!==e?t.nextNode=i:t.previousNode=o))}}{let r=this.getPreviousNode(n),i=null;const o=n.isEmpty();if(e.children.length&&r&&r.parent!==e)o&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new yt(e));else if(this.isContentFirstNode(n)&&o&&(i=this.getNextNode(n)),o&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||o||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),o=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(o=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new yt(e))}i?t.previousNode=i:o&&(t.nextNode=o)}}class kt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new p(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(o.LINK),e.apply(new f([n]))),e}}}class At extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=d.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Ct extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:o,startOffset:a}=r;if(o){const t=e;if(o.isContentEditable()&&o.isTextNode())if("\n"!==o.text&&o.text&&0!==a){const e=o.text.substring(0,a),r=o.text.substring(a),l=o.cloneWithText(e),c=o.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(o,...h)),t.apply(new s(o))}else t.apply(new n(o,i));else t.apply(0!==a?new p(o,i):new n(o,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new At(t))}}class Ht extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,o=this.createNewParagraph(s);if(o){const t=o.children[0];e.apply(0!==r?new p(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new At(t))}}class vt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new f([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=g.from({id:tt(),type:"paragraph",nodes:[]});return r.apply(new f(t.children)),n.apply(new p(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new p(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new p(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(o.LINK),e}}class Bt extends H{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof B?t.entityToBeRemoved:null,o=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&o>=0&&this.promoteNestListsToUpperLevel(i,e,o),super.handleAction(t,e);const a=e.parent;if(0===e.children.length&&a)if("list-item"===a.type){const t=a;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new v(e))}else a.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const o=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let a=s+1;const l=[];o.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(a,0,...n),a+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof B){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new j(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new p(e,...l));t.apply(new j([]))}}class jt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let o=e;const a=s[0],l=1===s.length&&r instanceof T&&!["RTEListBlock","RTEHtmlBlock"].includes(a.constructor.name)&&a.children.length>0&&a.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new x(r,i);e.apply(n),e.parent.apply(new p(e,...s)),o=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=o}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],o=i.children,a=s,l=e.children.indexOf(a);if(-1===l){const o=new x(s,r);return e.apply(o),e.parent.apply(new p(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=a.text.slice(0,r),h=a.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(a.cloneWithText(c)),h&&d.unshift(a.cloneWithText(h)),e.apply(new w([...u,...o,...d]));const f=o[o.length-1];t.futureFocusBlock=e,t.futureFocusNode=f,f.isTextNode()&&(t.futureFocusNodeOffset=f.text.length)}}const Nt=new class{registerBlockBasicStrategies(t){h.register(d.DELETE_CHILDREN,t,t===N.name?new Bt:new H),h.register(d.APPEND_CHILDREN,t,new ft),h.register(d.INSERT_CHILDREN_BEFORE,t,new mt),h.register(d.INSERT_CHILDREN_AFTER,t,new gt),h.register(d.DELETE_BLOCK_CONTENT,t,new Et),h.register(d.INSERT_NEW_PARAGRAPH,t,t===B.name?new vt:new kt),h.register(d.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ht),h.register(d.INSERT_NODE_TO_NEAREST_ROOT,t,new Ct),h.register(d.PASTE_CONTENT,t,new jt)}};class It{}class St extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===I||t.style.fontWeight===S||t.classList.contains("v-rte--bold")}}class Rt extends It{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 Lt extends It{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 Dt extends It{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=R(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class $t extends It{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}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 Pt extends It{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}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 Mt extends It{canHandle(t){return"RTETextNode"===t.dtoName}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 Ft extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=at(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=L.filter((t=>t.key!==D.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of L)if(t.style.color.includes(e.key))return e.key;return null}}class zt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Ut extends It{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.dtoName}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 Vt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Vt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Vt.textStyleHandler=new Ut;class Gt extends It{constructor(){super(...arguments),this.handlers=[new Rt,new Lt,new Dt]}canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return e.link?{link:e.link}:Vt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:tt()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Wt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(P)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Jt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(M)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Kt extends It{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Yt extends It{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const Xt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),Qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),Zt=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),_t=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),qt=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 te(t){return Xt.has(t.parentElement.nodeName)}class ee extends It{constructor(){super(...arguments),this.customAttributeHandler=new Rt,this.customStyleAnnotationHandler=new Dt,this.customClassAnnotationHandler=new Lt}canHandle(t,e){return"RTETextNode"===t.dtoName&&!1===e.autoMatchFormat}handle(t,e){if(Qt.has(t.nodeName)&&!Zt.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!T.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:tt()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ne=new class{constructor(){this.handlers=[new Pt,new $t,new St,new zt,new Jt,new Wt,new Ft,new Gt,new Mt,new Kt,new Yt,new Rt,new Lt,new Dt,new Ut,new ee]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&F.executeTheStrategyRefillAction(t.dtoName,e);const s=Vt.isLinkElement(e)&&"RTETextNode"===t.dtoName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Gt)).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=F.getStrategies(t.dtoName);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=z.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 se extends ut{constructor(){super(...arguments),this.annotationHandler=new Ut}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const o=wt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let a=null;if(o&&(a=o.handle([t],n,i)),a)s.push(a);else if(lt(t)&&t.childNodes.length>0){const o=ne.generate(T,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),o,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class re extends se{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:tt(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ie extends se{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return Ot.from({id:tt(),type:"image",nodes:[{id:tt(),type:"image",url:t.src,annotations:ne.generate(xt,t,e)}],annotations:Object.assign(Object.assign({},ne.generate(Ot,t.parentElement,e)),{internalWrapper:n})},e)}}class oe extends ut{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:tt(),type:"text",text:t,annotations:e}}}class ae extends V{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=J.getDefaultStyles(e),super.filterAnnotations(t)):t}}class le extends V{constructor(){super(...arguments),this.stylesToBeFiltered=z.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return G.isTextBlock(t.dtoName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return G.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class ce extends le{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class he extends le{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class ue extends V{constructor(){super(...arguments),this.stylesToBeFiltered=ue.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 G.isTextNode(t.dtoName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return G.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${ue.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(ue.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}ue.BOLD_STYLES={fontWeight:"700"},ue.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class de extends ce{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class we extends he{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}Y.registerRTEDTOClass("paragraph",g),Y.registerRTEDTOClass("title",g),Y.registerRTEDTOClass("subtitle",g),Y.registerRTEDTOClass("heading-1",g),Y.registerRTEDTOClass("heading-2",g),Y.registerRTEDTOClass("heading-3",g),Y.registerRTEDTOClass("heading-4",g),Y.registerRTEDTOClass("heading-5",g),Y.registerRTEDTOClass("heading-6",g),Y.registerRTEDTOClass("heading-6",g),Y.registerRTEDTOClass("list-item",B),Y.registerRTEDTOClass("bullet-list",N),Y.registerRTEDTOClass("number-list",N),Y.registerRTEDTOClass("image",Ot),Y.registerRTEDTOClass("code-block",e),Y.registerRTEDTOClass("html-block",U),Y.registerRTEDTOClass("text",T),Y.registerRTEDTOClass("image",xt),Nt.registerBlockBasicStrategies(g.name),Nt.registerBlockBasicStrategies(N.name),Nt.registerBlockBasicStrategies(B.name),Nt.registerBlockBasicStrategies(Ot.name),Nt.registerBlockBasicStrategies(U.name),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?ne.generate(T,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),o=!s&&!i;return g.from(Object.assign({id:tt(),type:i||"paragraph",nodes:r},o?{annotations:{internalWrapper:o}}:{annotations:ne.generate(g,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!!Zt.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!te(t))||this.isInlineLeafOrWrapper(t))}isDedicatedBlockTag(t){return Qt.has(t)&&!Zt.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?qt.has(t.nodeName):this.isTextOnlyElement(t)?qt.has(t.nodeName)||Zt.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}}),wt.registerElementToBlockStrategy(new class extends ie{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}}),wt.registerElementToBlockStrategy(new class extends ie{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(et(s))return Ot.from({id:tt(),type:"image",nodes:[{id:tt(),type:"image",url:s.src,annotations:ne.generate(xt,n,e)}],annotations:ne.generate(Ot,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:g.from({id:tt(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:ne.generate(g,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{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)?B.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return N.from({id:tt(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:tt(),type:"list-item",annotations:ne.generate(B,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ne.generate(T,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=et(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return B.from({id:tt(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:tt(),type:"number-list",blocks:[],annotations:ne.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof B)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:tt(),type:"bullet-list",blocks:[],annotations:ne.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof B)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||Qt.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Vt.isTitleOrSubtitle(s)?0:1}handle(t,e){return U.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(Zt.has(t.nodeName)&&0===t.childNodes.length)return!0;if(te(t))return!(0===t.childNodes.length&&""===t.textContent&&!Zt.has(t.nodeName)&&!qt.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||!_t.has(t.parentElement.nodeName)&&(qt.has(t.nodeName)||Zt.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&&!Zt.has(t.nodeName)&&!qt.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:tt(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ne.generate(U,t,e),children:[]}}}),
|
|
1
|
+
import{d as t,p as e,g as n,k as s,s as r,v as i,N as o,o as a,w as l,x as c,A as h,j as u,i as d,y as w,I as p,e as f,M as m,b as g,R as T,S as x,a as b,z as O,D as y,H as E,E as k,F as A,U as C,G as H,J as v,q as B,K as j,L as N,O as I,P as S,Q as R,T as L,W as D,X as $,Y as P,Z as M,u as F,_ as z,$ as U,n as V,a0 as G,a1 as W,a2 as J,a3 as K,m as Y,a4 as X,a5 as Q,r as Z,a6 as _,a7 as q}from"./p-571ec00b.js";import{g as tt}from"./p-8b5d3a52.js";import{i as et}from"./p-456f678b.js";import{C as nt}from"./p-2d0d575f.js";import{d as st}from"./p-526e3634.js";import{c as rt,d as it,e as ot}from"./p-4a2fe3a4.js";import{r as at,i as lt}from"./p-528748fa.js";import{c as ct}from"./p-a841cf13.js";import{L as ht}from"./p-6e1ab235.js";class ut{}class dt{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(et)),e}}const wt=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)}},pt=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 dt(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 wt.getElementToBlockStrategies()}};class ft extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class mt 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 gt extends mt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class Tt extends i{constructor(t,e){super(),this.type=o.IMAGE,this.size=t,this.alt=e}static from(t,e){return[o.IMAGE,new Tt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return et(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new Tt(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=Tt.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%"})}}}Tt.BASE_STYLES={verticalAlign:"bottom"};class xt extends a{constructor(t,e,n,s){super(t,s),this.dtoName=xt.dtoName,this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new xt(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?Tt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(et)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof Tt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new xt(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(o.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(et))}>`}doAnnotationActionApply(t){const e=h.get(u.name,xt.name);e&&e.execute(t,this)}doModifyActionApply(t){h.executeTheStrategy(t,this)}}h.register(d.UPDATE_IMAGE_NODE_URL,xt.name,new class extends t{handleAction(t,e){e.url=t.url}}),h.register(u.name,xt.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}}),xt.dtoName="RTEImageNode";class bt extends m{constructor(t,e){super(),this.type=d.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class Ot extends b{constructor(t){super(t),this.dtoName=Ot.dtoName,this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new Ot(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>xt.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 Ot(tt())}clone(t){const e=new Ot(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}h.register(d.MERGE_TWO_BLOCKS_NODES,Ot.name,new O),h.register(d.REPLACE_CHILD_NODES,Ot.name,new y),h.register(d.SPLIT_BLOCK_WITH_NODE,Ot.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 w(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new p(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new f(t)),n}}),h.register(d.LINE_BREAK_SINGLE_BLOCK,Ot.name,new class extends t{handleAction(t,e){const n=new bt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),h.register(d.LINE_BREAK_MULTIPLE_BLOCKS,Ot.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=g.from({id:tt(),type:"paragraph",nodes:[{id:tt(),type:"text",text:"\n"}]});e.parent.apply(new p(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new T(tt(),"\n",n)),n.apply(new f(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),h.register(d.INSERT_IMAGE_TO_BLOCK,Ot.name,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new f(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new p(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new x(s,r)),e.parent.apply(new p(e,i)))}}),h.register(E.name,Ot.name,new k),Ot.dtoName="RTEImageBlock";class yt extends m{constructor(t){super(),this.type=d.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Et extends A{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new C(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],o=this.getPreviousNode(n);return o&&o.parent===e&&"\n"===o.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==o?void 0:o.parent)!==e?t.nextNode=i:t.previousNode=o))}}{let r=this.getPreviousNode(n),i=null;const o=n.isEmpty();if(e.children.length&&r&&r.parent!==e)o&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new yt(e));else if(this.isContentFirstNode(n)&&o&&(i=this.getNextNode(n)),o&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||o||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),o=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(o=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new yt(e))}i?t.previousNode=i:o&&(t.nextNode=o)}}class kt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new p(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(o.LINK),e.apply(new f([n]))),e}}}class At extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=d.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Ct extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:o,startOffset:a}=r;if(o){const t=e;if(o.isContentEditable()&&o.isTextNode())if("\n"!==o.text&&o.text&&0!==a){const e=o.text.substring(0,a),r=o.text.substring(a),l=o.cloneWithText(e),c=o.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(o,...h)),t.apply(new s(o))}else t.apply(new n(o,i));else t.apply(0!==a?new p(o,i):new n(o,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new At(t))}}class Ht extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,o=this.createNewParagraph(s);if(o){const t=o.children[0];e.apply(0!==r?new p(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new At(t))}}class vt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new f([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=g.from({id:tt(),type:"paragraph",nodes:[]});return r.apply(new f(t.children)),n.apply(new p(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new p(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new p(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(o.LINK),e}}class Bt extends H{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof B?t.entityToBeRemoved:null,o=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&o>=0&&this.promoteNestListsToUpperLevel(i,e,o),super.handleAction(t,e);const a=e.parent;if(0===e.children.length&&a)if("list-item"===a.type){const t=a;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new v(e))}else a.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const o=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let a=s+1;const l=[];o.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(a,0,...n),a+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof B){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new j(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new p(e,...l));t.apply(new j([]))}}class jt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let o=e;const a=s[0],l=1===s.length&&r instanceof T&&!["RTEListBlock","RTEHtmlBlock"].includes(a.constructor.name)&&a.children.length>0&&a.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new x(r,i);e.apply(n),e.parent.apply(new p(e,...s)),o=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=o}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],o=i.children,a=s,l=e.children.indexOf(a);if(-1===l){const o=new x(s,r);return e.apply(o),e.parent.apply(new p(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=a.text.slice(0,r),h=a.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(a.cloneWithText(c)),h&&d.unshift(a.cloneWithText(h)),e.apply(new w([...u,...o,...d]));const f=o[o.length-1];t.futureFocusBlock=e,t.futureFocusNode=f,f.isTextNode()&&(t.futureFocusNodeOffset=f.text.length)}}const Nt=new class{registerBlockBasicStrategies(t){h.register(d.DELETE_CHILDREN,t,t===N.name?new Bt:new H),h.register(d.APPEND_CHILDREN,t,new ft),h.register(d.INSERT_CHILDREN_BEFORE,t,new mt),h.register(d.INSERT_CHILDREN_AFTER,t,new gt),h.register(d.DELETE_BLOCK_CONTENT,t,new Et),h.register(d.INSERT_NEW_PARAGRAPH,t,t===B.name?new vt:new kt),h.register(d.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ht),h.register(d.INSERT_NODE_TO_NEAREST_ROOT,t,new Ct),h.register(d.PASTE_CONTENT,t,new jt)}};class It{}class St extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===I||t.style.fontWeight===S||t.classList.contains("v-rte--bold")}}class Rt extends It{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 Lt extends It{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 Dt extends It{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=R(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class $t extends It{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}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 Pt extends It{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}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 Mt extends It{canHandle(t){return"RTETextNode"===t.dtoName}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 Ft extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=at(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=L.filter((t=>t.key!==D.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of L)if(t.style.color.includes(e.key))return e.key;return null}}class zt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Ut extends It{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.dtoName}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 Vt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Vt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Vt.textStyleHandler=new Ut;class Gt extends It{constructor(){super(...arguments),this.handlers=[new Rt,new Lt,new Dt]}canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return e.link?{link:e.link}:Vt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:tt()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Wt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(P)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Jt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(M)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Kt extends It{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Yt extends It{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const Xt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),Qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),Zt=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),_t=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),qt=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 te(t){return Xt.has(t.parentElement.nodeName)}class ee extends It{constructor(){super(...arguments),this.customAttributeHandler=new Rt,this.customStyleAnnotationHandler=new Dt,this.customClassAnnotationHandler=new Lt}canHandle(t,e){return"RTETextNode"===t.dtoName&&!1===e.autoMatchFormat}handle(t,e){if(Qt.has(t.nodeName)&&!Zt.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!T.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:tt()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ne=new class{constructor(){this.handlers=[new Pt,new $t,new St,new zt,new Jt,new Wt,new Ft,new Gt,new Mt,new Kt,new Yt,new Rt,new Lt,new Dt,new Ut,new ee]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&F.executeTheStrategyRefillAction(t.dtoName,e);const s=Vt.isLinkElement(e)&&"RTETextNode"===t.dtoName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Gt)).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=F.getStrategies(t.dtoName);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=z.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 se extends ut{constructor(){super(...arguments),this.annotationHandler=new Ut}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const o=wt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let a=null;if(o&&(a=o.handle([t],n,i)),a)s.push(a);else if(lt(t)&&t.childNodes.length>0){const o=ne.generate(T,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),o,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class re extends se{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:tt(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ie extends se{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return Ot.from({id:tt(),type:"image",nodes:[{id:tt(),type:"image",url:t.src,annotations:ne.generate(xt,t,e)}],annotations:Object.assign(Object.assign({},ne.generate(Ot,t.parentElement,e)),{internalWrapper:n})},e)}}class oe extends ut{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:tt(),type:"text",text:t,annotations:e}}}class ae extends V{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=J.getDefaultStyles(e),super.filterAnnotations(t)):t}}class le extends V{constructor(){super(...arguments),this.stylesToBeFiltered=z.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return G.isTextBlock(t.dtoName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return G.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class ce extends le{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class he extends le{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class ue extends V{constructor(){super(...arguments),this.stylesToBeFiltered=ue.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 G.isTextNode(t.dtoName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return G.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${ue.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(ue.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}ue.BOLD_STYLES={fontWeight:"700"},ue.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class de extends ce{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class we extends he{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}Y.registerRTEDTOClass("paragraph",g),Y.registerRTEDTOClass("title",g),Y.registerRTEDTOClass("subtitle",g),Y.registerRTEDTOClass("heading-1",g),Y.registerRTEDTOClass("heading-2",g),Y.registerRTEDTOClass("heading-3",g),Y.registerRTEDTOClass("heading-4",g),Y.registerRTEDTOClass("heading-5",g),Y.registerRTEDTOClass("heading-6",g),Y.registerRTEDTOClass("heading-6",g),Y.registerRTEDTOClass("list-item",B),Y.registerRTEDTOClass("bullet-list",N),Y.registerRTEDTOClass("number-list",N),Y.registerRTEDTOClass("image",Ot),Y.registerRTEDTOClass("code-block",e),Y.registerRTEDTOClass("html-block",U),Y.registerRTEDTOClass("text",T),Y.registerRTEDTOClass("image",xt),Nt.registerBlockBasicStrategies(g.name),Nt.registerBlockBasicStrategies(N.name),Nt.registerBlockBasicStrategies(B.name),Nt.registerBlockBasicStrategies(Ot.name),Nt.registerBlockBasicStrategies(U.name),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?ne.generate(T,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),o=!s&&!i;return g.from(Object.assign({id:tt(),type:i||"paragraph",nodes:r},o?{annotations:{internalWrapper:o}}:{annotations:ne.generate(g,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!!Zt.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!te(t))||this.isInlineLeafOrWrapper(t))}isDedicatedBlockTag(t){return Qt.has(t)&&!Zt.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?qt.has(t.nodeName):this.isTextOnlyElement(t)?qt.has(t.nodeName)||Zt.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}}),wt.registerElementToBlockStrategy(new class extends ie{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}}),wt.registerElementToBlockStrategy(new class extends ie{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(et(s))return Ot.from({id:tt(),type:"image",nodes:[{id:tt(),type:"image",url:s.src,annotations:ne.generate(xt,n,e)}],annotations:ne.generate(Ot,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:g.from({id:tt(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:ne.generate(g,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{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)?B.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return N.from({id:tt(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:tt(),type:"list-item",annotations:ne.generate(B,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ne.generate(T,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=et(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return B.from({id:tt(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:tt(),type:"number-list",blocks:[],annotations:ne.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof B)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:tt(),type:"bullet-list",blocks:[],annotations:ne.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof B)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||Qt.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Vt.isTitleOrSubtitle(s)?0:1}handle(t,e){return U.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(Zt.has(t.nodeName)&&0===t.childNodes.length)return!0;if(te(t))return!(0===t.childNodes.length&&""===t.textContent&&!Zt.has(t.nodeName)&&!qt.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||!_t.has(t.parentElement.nodeName)&&(qt.has(t.nodeName)||Zt.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&&!Zt.has(t.nodeName)&&!qt.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:tt(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ne.generate(U,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
|
wt.registerElementToBlockStrategy(new re),wt.registerElementToBlockStrategy(new class extends re{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}}),wt.registerElementToNodeStrategy(new class extends oe{canHandle(t,e){const n=t[e];return!lt(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,n){const s=!(!e||!1!==e.autoMatchFormat),r=Object.assign({},n),i=t[0],o=ne.generate(T,i,Object.assign({parentAnnotations:s?{inlineHtml:r.inlineHtml,link:r.link,code:r.code}:n},e));if("BR"===i.nodeName){const{inlineHtml:t}=o,e=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(o,["inlineHtml"]);return this.generateTextNode("\n",t&&"br"===t.htmlTag?e:o)}if(0===i.childNodes.length){const t=s?ct(Object.assign(Object.assign({},T.supportsHtmlTag(i.nodeName.toLowerCase())?o:{}),{inlineHtml:o.inlineHtml})):o;return Object.assign({},this.generateTextNode("",t))}}}),wt.registerElementToNodeStrategy(new class extends oe{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,n){const s=Object.assign({},n),r=!(!e||!1!==e.autoMatchFormat),i=t[0],o=i.parentNode.nodeName.toLowerCase(),a=r&&!T.supportsHtmlTag(o),l=this.generateTextNode(String(i.textContent),r?ct(Object.assign(Object.assign({},"span"===o?s:{link:s.link,code:"code"===o?s.code:void 0}),{inlineHtml:s.inlineHtml,plainText:a||void 0})):s);return Object.assign({},l)}}),F.register(g.dtoName,new ae),F.register(N.dtoName,new ae),F.register(B.dtoName,new ae),F.register(T.dtoName,new class extends V{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===S&&delete n.fontWeight,e.italic&&n.fontStyle===$&&delete n.fontStyle;const s=this.normalizeTextDecoration(n.textDecoration);return s&&this.shouldRemoveTextDecoration(s,e)&&delete n.textDecoration,0===Object.keys(n).length&&delete e.customStyle,t}normalizeTextDecoration(t){if(!t)return;const e=t.trim().toLowerCase().split(/\s+/);return e.some((t=>t!==M&&t!==P))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(M),e.strikethrough&&n.push(P),0!==n.length&&t===n.sort().join(" ")}}),F.register(g.dtoName,new le),F.register(g.dtoName,new ce(1)),F.register(g.dtoName,new ce(2)),F.register(g.dtoName,new ce(3)),F.register(g.dtoName,new ce(4)),F.register(g.dtoName,new ce(5)),F.register(g.dtoName,new ce(6)),F.register(g.dtoName,new he("title")),F.register(g.dtoName,new he("subtitle")),F.register(T.dtoName,new ue),F.register(T.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered=K.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return G.isCodeNode(t)}canRefill(t,e){return G.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${V.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),F.register(T.dtoName,new X),F.register(xt.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered=Tt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return G.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),F.register(e.dtoName,new Q),F.register(Z.dtoName,new _),F.register(N.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered=W.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return G.isListBlock(t.dtoName)}canRefill(t,e){return G.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){const t=V.RTE_CONTENT_CONTAINER_CLASS_NAME,e=this.elementTagName.split(",").map((t=>t.trim())),n=e.map((e=>`.${t} ${e}`)).join(", "),s=e.map((e=>`.${t} ${e} > li::marker`)).join(", "),r=this.convertStylesMapToCssText(W.getDefaultMarkerStyles());return`${n} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} } ${s} { ${r} }`}}),F.register(B.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered=z.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 G.isListItemBlock(t.dtoName)&&e}canRefill(t,e){return G.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())))}}),F.register(B.dtoName,new de(1)),F.register(B.dtoName,new de(2)),F.register(B.dtoName,new de(3)),F.register(B.dtoName,new de(4)),F.register(B.dtoName,new de(5)),F.register(B.dtoName,new de(6)),F.register(B.dtoName,new we("title")),F.register(B.dtoName,new we("subtitle"));class pe{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(lt(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 me{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 ge{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Te{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class xe{constructor(){this.processors=[new me,new ge,new Te]}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 be{constructor(t){this.dtoName=be.dtoName,t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=Y.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new be(n)}static createEmptyContent(t={autoMatchFormat:!0}){return be.fromJSON([{id:tt(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:tt(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new xe).clean(t),s=pe.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,o=Array.from(i.childNodes);s.restore(o);const a=pt.process(o,e).filter(et).map((t=>t.toDto(e))).filter(et);return new be(a)}static generateContentStyles(t){return F.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new be(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(et(t.autoMatchFormat)||et(t.skipCustomAnnotations))&&ht.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(h.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=r.getDOMByEntity(this);t&&nt.notify(st.getSubject(t,ot),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){var e;t.children.map((t=>t.apply(new q)));const n=new B(tt());return n.apply(new f(t.children)),n.annotationMap=t.annotationMap,t instanceof B&&(null===(e=t.nestList)||void 0===e?void 0:e.length)&&(n.apply(new j([...t.nestList])),t.apply(new j([]))),n}createList(t){return new N(tt(),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 B&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof N&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}h.register(d.DELETE_CHILDREN,be.name,new H),h.register(d.APPEND_CHILDREN,be.name,new ft),h.register(d.INSERT_CHILDREN_BEFORE,be.name,new mt),h.register(d.INSERT_CHILDREN_AFTER,be.name,new gt),h.register(d.TRANSFORM_TO_CODE_BLOCK,be.name,new class extends t{handleAction(t,s){const r=t.selectedBlocks,i=new e(tt(),this.getCodeContent(r),"plainText");s.apply(new n(r[0],i)),t.newCodeBlock=i,this.removeSelectBlocks(r,s)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new s(t[n]))}}),h.register(d.UPDATE_CURSOR_POSITION,be.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:i}=t,o=r.getDOMByEntity(e);o&&nt.notify(st.getSubject(o,rt),{node:s,offset:n,updateDirectly:i})}}),h.register(d.DELETE_SELECTED_CONTENT,be.name,new class extends t{handleAction(t){const{host:e,mergeFlag:n}=t;nt.notify(st.getSubject(e,it),{host:e,detail:n})}}),be.dtoName="VegaRTEContent";export{It as A,se as B,ut as E,bt as I,yt as M,jt as P,Ot as R,pe as S,At as U,be as V,mt as a,Nt as b,wt as c,xt as d,Tt as e,pt as f,ne as h}
|