@heartlandone/vega 2.80.0 → 2.82.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-7a48292d.js → app-globals-3350d580.js} +7 -7
- package/dist/cjs/{aria-dialog-focusable-trap-slimmer-5a0a78fe.js → aria-dialog-focusable-trap-slimmer-5507f917.js} +15 -70
- package/dist/cjs/{child-nodes-event-prevent-slimmer-dd0bb8b6.js → child-nodes-event-prevent-slimmer-9b7095a4.js} +1 -1
- package/dist/cjs/{child-nodes-notify-observer-slimmer-a8d13f4c.js → child-nodes-notify-observer-slimmer-2631c381.js} +1 -1
- package/dist/cjs/{code-block-71a330a1.js → code-block-b1f8aded.js} +804 -63
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-fd077a6c.js → component-value-history-controller-slimmer.abstract-99fbd1f2.js} +6 -6
- package/dist/cjs/{content-state-afa26456.js → content-state-648652b4.js} +970 -467
- package/dist/cjs/{dark-mode-style-controller-3a04af3d.js → dark-mode-style-controller-bd765afb.js} +2 -322
- package/dist/cjs/{date-required-rule-9f0e3e99.js → date-required-rule-6addf5dd.js} +1 -1
- package/dist/cjs/{design-token-3f9589eb.js → design-token-93070bb8.js} +6 -130
- package/dist/cjs/{dom-node-subject-observer-factory-a3a60da4.js → dom-node-subject-observer-factory-9110cb94.js} +1 -1
- package/dist/cjs/drop-file-accept-filter-slimmer-cd619cc7.js +64 -0
- package/dist/cjs/{element-appender-slimmer-7a66229b.js → element-appender-slimmer-dedd3a34.js} +5 -5
- package/dist/cjs/{event-emit-slimmer-024e26bb.js → event-emit-slimmer-bcb458b2.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-c487cf2b.js → form-field-controller-slimmer-0f3a028e.js} +5 -5
- package/dist/cjs/{image-annotation-action-4e72af4b.js → image-annotation-action-0339e983.js} +4 -4
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/index.cjs.js +21 -18
- package/dist/cjs/{inject-keyboard-manager-d1a82089.js → inject-keyboard-manager-2d9c4f92.js} +1 -1
- package/dist/cjs/{internal-translation-controller-9f58a4e4.js → internal-translation-controller-fb1532f4.js} +3 -0
- package/dist/cjs/{internal-vega-event-manager-cc0f511c.js → internal-vega-event-manager-fef893bf.js} +1 -0
- package/dist/cjs/{keyboard-manager-9dbbb0d4.js → keyboard-manager-5ed6c472.js} +2 -2
- package/dist/cjs/{keyboard-manager-slimmer-68cff676.js → keyboard-manager-slimmer-879ff4f3.js} +1 -1
- package/dist/cjs/loader.cjs.js +15 -14
- package/dist/cjs/{month-view-generator-65a2f883.js → month-view-generator-d262e6ce.js} +1 -1
- package/dist/cjs/page-size-option-utils-d038dd3a.js +68 -0
- package/dist/cjs/{public-rules-36f202b3.js → public-rules-bce88d4e.js} +12 -11
- package/dist/cjs/{range-fa15d524.js → range-5bd6d72b.js} +2 -2
- package/dist/cjs/{responsive-format-facade-4419b4ae.js → responsive-format-facade-2cab7344.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-7d4c2973.js → rich-text-editor-required-rule-e8a922be.js} +1 -1
- package/dist/cjs/{split-cell-operation-19f98afb.js → split-cell-operation-bb388de6.js} +59 -24
- package/dist/cjs/state-border-formatter-4e5e4ed0.js +133 -0
- package/dist/cjs/{string-format-strategy.abstract-c65d9861.js → string-format-strategy.abstract-9a35e3b4.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-c2e04acc.js → string-input-formatter-slimmer-1018ddec.js} +4 -4
- package/dist/cjs/{string-mask-strategy-418fc0b8.js → string-mask-strategy-3aa17744.js} +2 -2
- package/dist/cjs/{style-formatter-3c9ce0e5.js → style-formatter-2226c869.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-7a4c6061.js → sub-state-notify-slimmer-b33171b0.js} +2 -2
- package/dist/cjs/{sub-state-observer-slimmer-f728e068.js → sub-state-observer-slimmer-b8f6f27b.js} +3 -3
- package/dist/cjs/{time-required-rule-ad091302.js → time-required-rule-970dfdca.js} +1 -1
- package/dist/cjs/tinycolor-polyfill-502efaa8.js +325 -0
- package/dist/cjs/{token-extension-90396de7.js → token-extension-9b213b6b.js} +212 -38
- package/dist/cjs/{translation-slimmer-c069ca84.js → translation-slimmer-d0c77ad2.js} +1 -1
- package/dist/cjs/{type-guard-d760850a.js → type-guard-3ec852d7.js} +51 -1
- package/dist/cjs/{ui-9e8c9732.js → ui-ae4ee13d.js} +69 -0
- package/dist/cjs/{valid-credit-card-number-rule-5ce8e973.js → valid-credit-card-number-rule-99d1bb34.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +9 -8
- package/dist/cjs/vega-app-footer.cjs.entry.js +2 -1
- package/dist/cjs/vega-app-header-button.cjs.entry.js +10 -9
- package/dist/cjs/vega-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/vega-banner.cjs.entry.js +6 -5
- package/dist/cjs/vega-box.cjs.entry.js +7 -6
- package/dist/cjs/vega-brand-logo.cjs.entry.js +2 -1
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +29 -12
- package/dist/cjs/vega-button-circle.cjs.entry.js +11 -10
- package/dist/cjs/vega-button-group_2.cjs.entry.js +104 -15
- package/dist/cjs/vega-button-link.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +10 -10
- package/dist/cjs/vega-calendar_4.cjs.entry.js +12 -12
- package/dist/cjs/vega-card.cjs.entry.js +7 -6
- package/dist/cjs/vega-carousel.cjs.entry.js +7 -7
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-chip.cjs.entry.js +11 -10
- package/dist/cjs/vega-code-block.cjs.entry.js +16 -15
- package/dist/cjs/vega-color-picker.cjs.entry.js +28 -10
- package/dist/cjs/vega-color-swatch.cjs.entry.js +245 -0
- package/dist/cjs/vega-combo-box.cjs.entry.js +12 -12
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +342 -284
- package/dist/cjs/vega-dialog_2.cjs.entry.js +76 -202
- package/dist/cjs/vega-divider.cjs.entry.js +7 -6
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +75 -19
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +4 -4
- package/dist/cjs/vega-file-uploader.cjs.entry.js +42 -92
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -4
- package/dist/cjs/vega-flex.cjs.entry.js +8 -7
- package/dist/cjs/vega-font.cjs.entry.js +6 -5
- package/dist/cjs/vega-form.cjs.entry.js +12 -12
- package/dist/cjs/vega-grid.cjs.entry.js +6 -5
- package/dist/cjs/vega-icon.cjs.entry.js +6 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +80 -15
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-numeric.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-passcode.cjs.entry.js +12 -12
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +11 -11
- package/dist/cjs/vega-input-range.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-select.cjs.entry.js +52 -17
- package/dist/cjs/vega-input.cjs.entry.js +17 -14
- package/dist/cjs/{vega-internal-event-id-a1837fa2.js → vega-internal-event-id-87014e4f.js} +2 -0
- package/dist/cjs/vega-item-toggle.cjs.entry.js +4 -4
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +122 -15
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +5 -5
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +26 -10
- package/dist/cjs/vega-pagination.cjs.entry.js +48 -24
- package/dist/cjs/vega-popover_2.cjs.entry.js +14 -13
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +72 -17
- package/dist/cjs/vega-radio_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +104 -22
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +36 -24
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +15 -14
- package/dist/cjs/vega-section-title.cjs.entry.js +21 -3
- package/dist/cjs/vega-segment-control.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +12 -12
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +10 -10
- package/dist/cjs/vega-signature-capture.cjs.entry.js +13 -12
- package/dist/cjs/vega-stepper.cjs.entry.js +11 -11
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-table_11.cjs.entry.js +436 -289
- package/dist/cjs/vega-text.cjs.entry.js +7 -3
- package/dist/cjs/vega-textarea.cjs.entry.js +9 -9
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +16 -16
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +8 -8
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +11 -10
- package/dist/cjs/vega.cjs.js +15 -14
- package/dist/cjs/{wait-for-component-did-render-b6aba2de.js → wait-for-component-did-render-16863a21.js} +2 -2
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/vega-banner/slimmers/renderers/vega-banner-renderer.js +1 -0
- package/dist/collection/components/vega-banner/vega-banner.css +36 -0
- package/dist/collection/components/vega-box/vega-box.js +1 -1
- package/dist/collection/components/vega-breadcrumb/slimmers/renderers/vega-breadcrumb-item-renderer.js +9 -6
- package/dist/collection/components/vega-breadcrumb/slimmers/renderers/vega-breadcrumb-renderer.js +4 -0
- package/dist/collection/components/vega-breadcrumb/vega-breadcrumb.css +6 -0
- package/dist/collection/components/vega-breadcrumb/vega-breadcrumb.js +31 -0
- package/dist/collection/components/vega-button/vega-button.css +4 -0
- package/dist/collection/components/vega-button-group/slimmers/controllers/vega-button-group-all-items-disabled-controller.js +64 -0
- package/dist/collection/components/vega-button-group/vega-button-group-item/slimmers/controllers/vega-button-group-item-sub-state-controller.js +7 -0
- package/dist/collection/components/vega-button-group/vega-button-group-item/slimmers/renderers/vega-button-group-item-renderer.js +6 -2
- package/dist/collection/components/vega-button-group/vega-button-group-item/vega-button-group-item.js +4 -2
- package/dist/collection/components/vega-button-group/vega-button-group.js +20 -1
- package/dist/collection/components/vega-card/vega-card.css +157 -0
- package/dist/collection/components/vega-card/vega-card.js +1 -1
- package/dist/collection/components/vega-chip/vega-chip.js +26 -1
- package/dist/collection/components/vega-color-picker/vega-color-picker.css +0 -1
- package/dist/collection/components/vega-color-picker/vega-color-picker.js +40 -1
- package/dist/collection/components/vega-color-swatch/slimmers/renderers/vega-color-swatch-renderer.js +127 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch.css +155 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch.js +314 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-current-period-controller.js +5 -10
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-is-dual-months-controller.js +64 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.js +3 -6
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-renderer.js +3 -11
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.js +2 -2
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +4 -5
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +13 -15
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +41 -2
- package/dist/collection/components/vega-dialog/vega-dialog.js +1 -1
- package/dist/collection/components/vega-divider/slimmers/controllers/vega-divider-size-controller.js +1 -1
- package/dist/collection/components/vega-divider/vega-divider.css +157 -0
- package/dist/collection/components/vega-divider/vega-divider.js +1 -1
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.js +37 -1
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-renderer.js +4 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/controllers/vega-dropdown-item-state-controller.js +7 -0
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +5 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.js +2 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +38 -0
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +2 -2
- package/dist/collection/components/vega-flex/vega-flex.css +157 -0
- package/dist/collection/components/vega-flex/vega-flex.js +1 -1
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-default-content-renderer.js +45 -1
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-preview-content-renderer.js +16 -1
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +5 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-renderer.js +4 -1
- package/dist/collection/components/vega-input/vega-input.js +25 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +17 -4
- package/dist/collection/components/vega-input-select/vega-input-select.js +76 -0
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.js +0 -4
- package/dist/collection/components/vega-modal/slimmers/renderers/vega-modal-renderer.js +31 -21
- package/dist/collection/components/vega-modal/vega-modal.css +2685 -9
- package/dist/collection/components/vega-modal/vega-modal.js +75 -5
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.js +85 -2
- package/dist/collection/components/vega-nav/vega-left-nav/vega-left-nav.js +23 -0
- package/dist/collection/components/vega-pagination/constants/page-size.js +2 -0
- package/dist/collection/components/vega-pagination/internal/vega-pagination-page-size-selector.js +11 -7
- package/dist/collection/components/vega-pagination/slimmers/controllers/vega-pagination-page-size-observer-controller.js +11 -1
- package/dist/collection/components/vega-pagination/utils/page-size-option-utils.js +57 -0
- package/dist/collection/components/vega-pagination/vega-pagination-page-size-selector-mobile/slimmers/renderers/page-size-selector-mobile-dropdown-renderer.js +15 -5
- package/dist/collection/components/vega-pagination/vega-pagination-page-size-selector-mobile/vega-pagination-page-size-selector-mobile.js +39 -3
- package/dist/collection/components/vega-pagination/vega-pagination.js +32 -11
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-direction-controller.js +34 -3
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.js +10 -2
- package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +4 -3
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/inline-html-annotation.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +15 -4
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +6 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +9 -15
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +3 -7
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +50 -9
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +25 -6
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-block-filter-styles-strategy.js +39 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-node-filter-styles-strategy.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.js +64 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy.abstract.js +147 -14
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/image-node/image-filter-styles-strategy.js +26 -3
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +24 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-heading-item-block-filter-styles-strategy.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.js +39 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-title-item-block-filter-styles-strategy.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/predicate.js +94 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/heading-filter-styles-strategy.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/paragraph-filter-styles-strategy.js +48 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/title-filter-styles-strategy.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/code-filter-styles-strategy.js +32 -3
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/link-filter-styles-strategy.js +42 -3
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/title-heading-node-filter-styles-strategy.js +108 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +7 -2
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +15 -4
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +84 -14
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +61 -6
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +14 -3
- package/dist/collection/components/vega-rich-text-editor/dto/setup.js +36 -6
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +10 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-extension.js +9 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.js +17 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.js +17 -18
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +21 -4
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/caption-to-caption-block-strategy.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/element-to-dto-strategies/td-to-table-cell-block-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-block/table-block-filter-styles-strategy.js +39 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-caption/table-caption-filter-styles-strategy.js +39 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-cell/table-cell-filter-styles-strategy.js +63 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +7 -0
- package/dist/collection/components/vega-rich-text-editor/helpers/utils.js +24 -0
- package/dist/collection/components/vega-rich-text-editor/public-api.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/custom-style-annotation-handler.js +2 -25
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.js +30 -53
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/link-annotation-handler.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +85 -17
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +12 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/html-block-strategy.js +95 -43
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-element-to-text-node-strategy.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/predicate.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/strategy-tags.js +142 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-source-view-renderer.js +12 -2
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +1 -1
- package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +8 -2
- package/dist/collection/components/vega-section-title/vega-section-title.css +35 -0
- package/dist/collection/components/vega-section-title/vega-section-title.js +64 -0
- package/dist/collection/components/vega-stepper/vega-stepper.css +15 -0
- package/dist/collection/components/vega-stepper/vega-stepper.js +2 -1
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-render-input-controller.js +25 -2
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +28 -1
- package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.js +12 -10
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +14 -12
- package/dist/collection/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.js +5 -4
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.js +8 -1
- package/dist/collection/components/vega-text/slimmers/renderers/vega-text-tooltip-renderer.js +6 -2
- package/dist/collection/components/vega-text/vega-text.js +1 -1
- package/dist/collection/components/vega-tooltip/slimmers/controllers/vega-tooltip-element-appender-controller.js +1 -0
- package/dist/collection/components/vega-tooltip/vega-tooltip-content-box/vega-tooltip-content-box.css +1 -0
- package/dist/collection/components/vega-tooltip/vega-tooltip-content-box/vega-tooltip-content-box.js +1 -1
- package/dist/collection/components/vega-tooltip/vega-tooltip.js +1 -1
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +1 -0
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
- package/dist/collection/helpers/formatter/responsive-map-formatter/responsive-margin-formatter.js +3 -3
- package/dist/collection/helpers/slimmers/aria-dialog-focusable-trap-slimmer.js +13 -68
- package/dist/collection/{components/vega-file-uploader/slimmers/controllers/vega-file-uploader-drop-file-filter-controller.js → helpers/slimmers/drop-file-accept-filter-slimmer.js} +13 -5
- package/dist/collection/helpers/slimmers/vega-table-child-render-input-consumer-slimmer.js +96 -0
- package/dist/collection/helpers/translation/locales/en.js +3 -0
- package/dist/collection/types/type-guard.js +47 -0
- package/dist/collection/utils/ui.js +68 -0
- package/dist/esm/{app-globals-e77015e3.js → app-globals-0b7e8b50.js} +7 -7
- package/dist/esm/{aria-dialog-focusable-trap-slimmer-5a2f92be.js → aria-dialog-focusable-trap-slimmer-853a91de.js} +15 -70
- package/dist/esm/{child-nodes-event-prevent-slimmer-2ecc3e1f.js → child-nodes-event-prevent-slimmer-9c24d4fc.js} +1 -1
- package/dist/esm/{child-nodes-notify-observer-slimmer-b7f0e419.js → child-nodes-notify-observer-slimmer-a8cb19cf.js} +1 -1
- package/dist/esm/{code-block-7d6f231b.js → code-block-b8be290a.js} +798 -64
- package/dist/esm/{component-value-history-controller-slimmer.abstract-acf65b17.js → component-value-history-controller-slimmer.abstract-10ccf8e6.js} +6 -6
- package/dist/esm/{content-state-084cd705.js → content-state-72b513d1.js} +959 -456
- package/dist/esm/{dark-mode-style-controller-82e5c1c6.js → dark-mode-style-controller-e9a6b097.js} +1 -321
- package/dist/esm/{date-required-rule-29608215.js → date-required-rule-891a6a57.js} +1 -1
- package/dist/esm/{design-token-edcd787b.js → design-token-59d07aa2.js} +6 -130
- package/dist/esm/{dom-node-subject-observer-factory-cea9248d.js → dom-node-subject-observer-factory-aca0116e.js} +1 -1
- package/dist/esm/drop-file-accept-filter-slimmer-ad759e4a.js +62 -0
- package/dist/esm/{element-appender-slimmer-08ec429b.js → element-appender-slimmer-5aca1bca.js} +5 -5
- package/dist/esm/{event-emit-slimmer-4fba1b35.js → event-emit-slimmer-32da9d90.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-8dd39707.js → form-field-controller-slimmer-899864a8.js} +5 -5
- package/dist/esm/{image-annotation-action-a6b33a81.js → image-annotation-action-ebd6c421.js} +4 -4
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/index.js +20 -18
- package/dist/esm/{inject-keyboard-manager-7557816f.js → inject-keyboard-manager-dc1d7135.js} +1 -1
- package/dist/esm/{internal-translation-controller-b08aa9ab.js → internal-translation-controller-4fb104b2.js} +3 -0
- package/dist/esm/{internal-vega-event-manager-59f5bd47.js → internal-vega-event-manager-8a657bac.js} +1 -0
- package/dist/esm/{keyboard-manager-1846c6a5.js → keyboard-manager-6ea9968b.js} +2 -2
- package/dist/esm/{keyboard-manager-slimmer-1ae0aa4d.js → keyboard-manager-slimmer-7eed4734.js} +1 -1
- package/dist/esm/loader.js +15 -14
- package/dist/esm/{month-view-generator-b700ed08.js → month-view-generator-aaa27fce.js} +1 -1
- package/dist/esm/page-size-option-utils-50afc81a.js +61 -0
- package/dist/esm/{public-rules-fe2c7934.js → public-rules-f2005e11.js} +12 -11
- package/dist/esm/{range-00afe462.js → range-ed532278.js} +2 -2
- package/dist/esm/{responsive-format-facade-37d4d850.js → responsive-format-facade-e9926018.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-6487ec94.js → rich-text-editor-required-rule-b559cf1a.js} +1 -1
- package/dist/esm/{split-cell-operation-9445e642.js → split-cell-operation-5587f594.js} +59 -24
- package/dist/esm/state-border-formatter-be51463d.js +129 -0
- package/dist/esm/{string-format-strategy.abstract-ec6d627b.js → string-format-strategy.abstract-0157b3c5.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-959dff7a.js → string-input-formatter-slimmer-33ed3478.js} +4 -4
- package/dist/esm/{string-mask-strategy-49be41f0.js → string-mask-strategy-b58891b5.js} +2 -2
- package/dist/esm/{style-formatter-ad0b2bac.js → style-formatter-9662ae88.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-ee8c417b.js → sub-state-notify-slimmer-1f907173.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-4d30fa5c.js → sub-state-observer-slimmer-090c500a.js} +3 -3
- package/dist/esm/{time-required-rule-414b1590.js → time-required-rule-a9dc8473.js} +1 -1
- package/dist/esm/tinycolor-polyfill-7be0eb93.js +322 -0
- package/dist/esm/{token-extension-600b1c88.js → token-extension-9d717a35.js} +212 -38
- package/dist/esm/{translation-slimmer-35b1d0fa.js → translation-slimmer-4faae5a3.js} +1 -1
- package/dist/esm/{type-guard-23a08026.js → type-guard-152070e9.js} +49 -2
- package/dist/esm/{ui-ba5a4758.js → ui-b7600a48.js} +69 -1
- package/dist/esm/{valid-credit-card-number-rule-60abddac.js → valid-credit-card-number-rule-a7907cb7.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +9 -8
- package/dist/esm/vega-app-footer.entry.js +2 -1
- package/dist/esm/vega-app-header-button.entry.js +10 -9
- package/dist/esm/vega-backdrop.entry.js +1 -1
- package/dist/esm/vega-banner.entry.js +6 -5
- package/dist/esm/vega-box.entry.js +7 -6
- package/dist/esm/vega-brand-logo.entry.js +2 -1
- package/dist/esm/vega-breadcrumb.entry.js +29 -12
- package/dist/esm/vega-button-circle.entry.js +11 -10
- package/dist/esm/vega-button-group_2.entry.js +104 -15
- package/dist/esm/vega-button-link.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +10 -10
- package/dist/esm/vega-calendar_4.entry.js +12 -12
- package/dist/esm/vega-card.entry.js +7 -6
- package/dist/esm/vega-carousel.entry.js +7 -7
- package/dist/esm/vega-checkbox_2.entry.js +10 -10
- package/dist/esm/vega-chip.entry.js +11 -10
- package/dist/esm/vega-code-block.entry.js +16 -15
- package/dist/esm/vega-color-picker.entry.js +28 -10
- package/dist/esm/vega-color-swatch.entry.js +241 -0
- package/dist/esm/vega-combo-box.entry.js +12 -12
- package/dist/esm/vega-date-picker_2.entry.js +342 -284
- package/dist/esm/vega-dialog_2.entry.js +76 -202
- package/dist/esm/vega-divider.entry.js +7 -6
- package/dist/esm/vega-dropdown_5.entry.js +76 -20
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +4 -4
- package/dist/esm/vega-file-uploader.entry.js +42 -92
- package/dist/esm/vega-flag-icon.entry.js +5 -4
- package/dist/esm/vega-flex.entry.js +8 -7
- package/dist/esm/vega-font.entry.js +6 -5
- package/dist/esm/vega-form.entry.js +12 -12
- package/dist/esm/vega-grid.entry.js +6 -5
- package/dist/esm/vega-icon.entry.js +6 -5
- package/dist/esm/vega-image-uploader.entry.js +80 -15
- package/dist/esm/vega-input-credit-card.entry.js +13 -13
- package/dist/esm/vega-input-numeric.entry.js +13 -13
- package/dist/esm/vega-input-passcode.entry.js +12 -12
- package/dist/esm/vega-input-phone-number.entry.js +11 -11
- package/dist/esm/vega-input-range.entry.js +10 -10
- package/dist/esm/vega-input-select.entry.js +52 -17
- package/dist/esm/vega-input.entry.js +17 -14
- package/dist/esm/{vega-internal-event-id-70bd893d.js → vega-internal-event-id-194bac82.js} +2 -1
- package/dist/esm/vega-item-toggle.entry.js +4 -4
- package/dist/esm/vega-left-nav_5.entry.js +122 -15
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
- package/dist/esm/vega-page-notification_2.entry.js +2 -2
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +5 -5
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +26 -10
- package/dist/esm/vega-pagination.entry.js +48 -24
- package/dist/esm/vega-popover_2.entry.js +14 -13
- package/dist/esm/vega-progress-tracker_2.entry.js +72 -17
- package/dist/esm/vega-radio_2.entry.js +13 -13
- package/dist/esm/vega-rich-text-content.entry.js +104 -22
- package/dist/esm/vega-rich-text-editor_4.entry.js +36 -24
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +15 -14
- package/dist/esm/vega-section-title.entry.js +21 -3
- package/dist/esm/vega-segment-control.entry.js +4 -4
- package/dist/esm/vega-selection-chip_2.entry.js +12 -12
- package/dist/esm/vega-selection-tile_2.entry.js +11 -11
- package/dist/esm/vega-sidenav_3.entry.js +10 -10
- package/dist/esm/vega-signature-capture.entry.js +13 -12
- package/dist/esm/vega-stepper.entry.js +11 -11
- package/dist/esm/vega-tab-group_2.entry.js +5 -5
- package/dist/esm/vega-table_11.entry.js +436 -289
- package/dist/esm/vega-text.entry.js +7 -3
- package/dist/esm/vega-textarea.entry.js +9 -9
- package/dist/esm/vega-time-picker_2.entry.js +16 -16
- package/dist/esm/vega-toggle-switch.entry.js +8 -8
- package/dist/esm/vega-tooltip_2.entry.js +11 -10
- package/dist/esm/vega.js +15 -14
- package/dist/esm/{wait-for-component-did-render-03e7ccb2.js → wait-for-component-did-render-30cde59c.js} +2 -2
- package/dist/sri/vega-sri-manifest.json +389 -369
- package/dist/types/components/vega-breadcrumb/slimmers/renderers/vega-breadcrumb-item-renderer.d.ts +1 -0
- package/dist/types/components/vega-breadcrumb/slimmers/renderers/vega-breadcrumb-renderer.d.ts +1 -0
- package/dist/types/components/vega-breadcrumb/vega-breadcrumb.d.ts +10 -0
- package/dist/types/components/vega-button-group/slimmers/controllers/vega-button-group-all-items-disabled-controller.d.ts +21 -0
- package/dist/types/components/vega-button-group/vega-button-group-item/slimmers/controllers/vega-button-group-item-sub-state-controller.d.ts +1 -0
- package/dist/types/components/vega-button-group/vega-button-group-item/slimmers/renderers/vega-button-group-item-renderer.d.ts +1 -0
- package/dist/types/components/vega-button-group/vega-button-group-item/vega-button-group-item.d.ts +1 -0
- package/dist/types/components/vega-button-group/vega-button-group.d.ts +5 -0
- package/dist/types/components/vega-chip/vega-chip.d.ts +9 -0
- package/dist/types/components/vega-color-picker/vega-color-picker.d.ts +14 -0
- package/dist/types/components/vega-color-swatch/slimmers/renderers/vega-color-swatch-renderer.d.ts +48 -0
- package/dist/types/components/vega-color-swatch/types.d.ts +5 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch.d.ts +86 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-current-period-controller.d.ts +1 -6
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-is-dual-months-controller.d.ts +28 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.d.ts +1 -2
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +1 -2
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.d.ts +1 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +1 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +12 -0
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.d.ts +12 -0
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown-item/slimmers/controllers/vega-dropdown-item-state-controller.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.d.ts +4 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +10 -0
- package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +2 -2
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-default-content-renderer.d.ts +25 -0
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-preview-content-renderer.d.ts +10 -0
- package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +2 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-input/types.d.ts +5 -0
- package/dist/types/components/vega-input/vega-input.d.ts +17 -1
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +3 -0
- package/dist/types/components/vega-input-select/types.d.ts +14 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +19 -1
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.d.ts +0 -1
- package/dist/types/components/vega-modal/slimmers/renderers/vega-modal-renderer.d.ts +4 -0
- package/dist/types/components/vega-modal/vega-modal.d.ts +24 -3
- 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-pagination/constants/page-size.d.ts +2 -0
- package/dist/types/components/vega-pagination/internal/vega-pagination-page-size-selector.d.ts +3 -2
- package/dist/types/components/vega-pagination/slimmers/controllers/vega-pagination-page-size-observer-controller.d.ts +2 -0
- package/dist/types/components/vega-pagination/types.d.ts +15 -0
- package/dist/types/components/vega-pagination/utils/page-size-option-utils.d.ts +42 -0
- package/dist/types/components/vega-pagination/vega-pagination-page-size-selector-mobile/slimmers/renderers/page-size-selector-mobile-dropdown-renderer.d.ts +2 -0
- package/dist/types/components/vega-pagination/vega-pagination-page-size-selector-mobile/vega-pagination-page-size-selector-mobile.d.ts +9 -2
- package/dist/types/components/vega-pagination/vega-pagination.d.ts +8 -3
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-direction-controller.d.ts +14 -2
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-step-controller.d.ts +1 -0
- package/dist/types/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.d.ts +1 -1
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/inline-html-annotation.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +8 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +4 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +1 -11
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +15 -2
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +9 -3
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-block-filter-styles-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-node-filter-styles-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.d.ts +27 -1
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy.abstract.d.ts +92 -8
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/image-node/image-filter-styles-strategy.d.ts +21 -3
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-heading-item-block-filter-styles-strategy.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-title-item-block-filter-styles-strategy.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/predicate.d.ts +72 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/heading-filter-styles-strategy.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/paragraph-filter-styles-strategy.d.ts +34 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/title-filter-styles-strategy.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/code-filter-styles-strategy.d.ts +25 -2
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/link-filter-styles-strategy.d.ts +24 -4
- package/dist/types/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/title-heading-node-filter-styles-strategy.d.ts +62 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +7 -3
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +5 -3
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +43 -4
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-annotation.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-caption-annotation.d.ts +7 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotations/table-cell-annotation.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +5 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-block/table-block-filter-styles-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-caption/table-caption-filter-styles-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-cell/table-cell-filter-styles-strategy.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/helpers/utils.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +27 -5
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/custom-style-annotation-handler.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.d.ts +11 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.d.ts +43 -7
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.d.ts +8 -3
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/html-block-strategy.d.ts +34 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/predicate.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/strategy-tags.d.ts +83 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-source-view-renderer.d.ts +6 -0
- package/dist/types/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.d.ts +2 -0
- package/dist/types/components/vega-section-title/types.d.ts +1 -0
- package/dist/types/components/vega-section-title/vega-section-title.d.ts +14 -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 +5 -1
- package/dist/types/components/vega-table/vega-table-cell/vega-table-cell.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-head-cell/vega-table-head-cell.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-head-row/vega-table-head-row.d.ts +4 -0
- package/dist/types/components/vega-text/types.d.ts +5 -3
- package/dist/types/components/vega-tooltip/vega-tooltip-content-box/vega-tooltip-content-box.d.ts +4 -0
- package/dist/types/components/vega-tooltip/vega-tooltip.d.ts +4 -0
- package/dist/types/components.d.ts +247 -13
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
- package/dist/types/helpers/formatter/string-formatter/string-mask-strategy.d.ts +56 -3
- package/dist/types/helpers/slimmers/aria-dialog-focusable-trap-slimmer.d.ts +4 -12
- package/dist/types/helpers/slimmers/drop-file-accept-filter-slimmer.d.ts +29 -0
- package/dist/types/helpers/slimmers/vega-table-child-render-input-consumer-slimmer.d.ts +48 -0
- package/dist/types/helpers/translation/interface.d.ts +4 -1
- package/dist/types/types/components.type.d.ts +10 -0
- package/dist/types/types/public-api.d.ts +3 -1
- package/dist/types/types/type-guard.d.ts +29 -1
- package/dist/types/types/ui.type.d.ts +11 -1
- package/dist/types/utils/ui.d.ts +14 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-7618dde4.js → p-02467b61.js} +1 -1
- package/dist/vega/p-075bb809.entry.js +1 -0
- package/dist/vega/p-085de8fc.js +1 -0
- package/dist/vega/p-0915a8d3.entry.js +1 -0
- package/dist/vega/p-0caf52e0.js +1 -0
- package/dist/vega/{p-19ad4f15.entry.js → p-0dbd7723.entry.js} +1 -1
- package/dist/vega/{p-cf70c57d.js → p-103d20f5.js} +1 -1
- package/dist/vega/p-115d6053.entry.js +1 -0
- package/dist/vega/p-116e3963.js +1 -0
- package/dist/vega/p-14de7ba0.entry.js +1 -0
- package/dist/vega/p-19a30f98.entry.js +1 -0
- package/dist/vega/{p-90137c68.entry.js → p-1ca95601.entry.js} +1 -1
- package/dist/vega/p-1dd6ba67.js +1 -0
- package/dist/vega/p-1efb47fe.entry.js +1 -0
- package/dist/vega/p-23c840dc.entry.js +1 -0
- package/dist/vega/p-246eb001.entry.js +1 -0
- package/dist/vega/p-25ab7a33.entry.js +1 -0
- package/dist/vega/p-264b3309.entry.js +1 -0
- package/dist/vega/{p-c045e4c1.entry.js → p-280f63fa.entry.js} +1 -1
- package/dist/vega/p-295326ca.entry.js +1 -0
- package/dist/vega/p-29d31c98.entry.js +1 -0
- package/dist/vega/{p-382b71a3.entry.js → p-29f42c27.entry.js} +1 -1
- package/dist/vega/p-2b5cf2b3.js +1 -0
- package/dist/vega/{p-0313393d.entry.js → p-30445cd9.entry.js} +1 -1
- package/dist/vega/p-318f0df5.js +1 -0
- package/dist/vega/p-337a5e76.js +1 -0
- package/dist/vega/p-3505f7cc.entry.js +1 -0
- package/dist/vega/p-38af89b9.js +1 -0
- package/dist/vega/p-3fae8d3f.entry.js +1 -0
- package/dist/vega/{p-b696a861.js → p-42141782.js} +1 -1
- package/dist/vega/{p-d1ca70a1.js → p-44044ed7.js} +1 -1
- package/dist/vega/p-475bd8bf.entry.js +1 -0
- package/dist/vega/{p-df5bfbc4.entry.js → p-47611a83.entry.js} +1 -1
- package/dist/vega/p-4e95248c.entry.js +1 -0
- package/dist/vega/p-4f938ee4.entry.js +1 -0
- package/dist/vega/{p-f3456993.entry.js → p-513f51ec.entry.js} +1 -1
- package/dist/vega/{p-ba415db6.entry.js → p-51d2e0ab.entry.js} +1 -1
- package/dist/vega/{p-ab21fdf6.entry.js → p-58b6ac33.entry.js} +1 -1
- package/dist/vega/{p-7362723e.entry.js → p-596bc4f6.entry.js} +1 -1
- package/dist/vega/{p-70f1cf4e.entry.js → p-597588d0.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-5ffdea8e.js +1 -0
- package/dist/vega/{p-3224e47c.js → p-6572e038.js} +1 -1
- package/dist/vega/{p-b5c2fff3.entry.js → p-6d95390b.entry.js} +1 -1
- package/dist/vega/p-6e70d3cc.js +1 -0
- package/dist/vega/p-6e9f832f.js +1 -0
- package/dist/vega/{p-c9201bf4.js → p-76063dcb.js} +1 -1
- package/dist/vega/p-783531cf.entry.js +1 -0
- package/dist/vega/{p-35386999.entry.js → p-7d85cc74.entry.js} +1 -1
- package/dist/vega/p-7df43192.entry.js +1 -0
- package/dist/vega/p-7faaa5e1.entry.js +1 -0
- package/dist/vega/{p-517434d4.entry.js → p-8583dd34.entry.js} +1 -1
- package/dist/vega/p-85abe824.entry.js +1 -0
- package/dist/vega/p-874bf8b2.js +1 -0
- package/dist/vega/p-88b6184c.entry.js +1 -0
- package/dist/vega/p-8aee6b74.js +1 -0
- package/dist/vega/{p-1557ed92.entry.js → p-8b217c7e.entry.js} +1 -1
- package/dist/vega/p-8da66d41.entry.js +1 -0
- package/dist/vega/{p-b3e40faf.js → p-956b170c.js} +1 -1
- package/dist/vega/{p-1c45565d.js → p-9751c801.js} +1 -1
- package/dist/vega/{p-7ceab8c7.entry.js → p-97f36f4e.entry.js} +1 -1
- package/dist/vega/p-988401c3.entry.js +1 -0
- package/dist/vega/{p-47ca1f69.entry.js → p-9c1a48b9.entry.js} +1 -1
- package/dist/vega/p-9d854d43.js +1 -0
- package/dist/vega/p-9dcecdd3.js +1 -0
- package/dist/vega/{p-612e3ded.js → p-a07c0f8c.js} +1 -1
- package/dist/vega/{p-576fe408.js → p-a0c3968b.js} +1 -1
- package/dist/vega/p-a30ae8a1.js +1 -0
- package/dist/vega/p-a5bd3ecd.entry.js +1 -0
- package/dist/vega/p-a6dbc63d.entry.js +1 -0
- package/dist/vega/p-aa985d73.js +1 -0
- package/dist/vega/{p-44c5cbb7.js → p-ab829745.js} +1 -1
- package/dist/vega/p-b08a70e6.entry.js +1 -0
- package/dist/vega/p-b19b1c08.js +1 -0
- package/dist/vega/p-b5497af2.entry.js +1 -0
- package/dist/vega/p-b7624ce4.js +1 -0
- package/dist/vega/p-b9386dd0.js +1 -0
- package/dist/vega/{p-e84b95d4.js → p-b9947846.js} +1 -1
- package/dist/vega/p-b9a95aca.entry.js +1 -0
- package/dist/vega/{p-dc9b5063.entry.js → p-bb46d8e6.entry.js} +1 -1
- package/dist/vega/{p-ec1d76c6.entry.js → p-c366e7f7.entry.js} +1 -1
- package/dist/vega/p-c36afa21.entry.js +1 -0
- package/dist/vega/{p-60cf2a68.js → p-c8435185.js} +1 -1
- package/dist/vega/{p-04e56b0c.entry.js → p-c8d41cdc.entry.js} +1 -1
- package/dist/vega/p-cab70b95.entry.js +1 -0
- package/dist/vega/p-cc18970f.entry.js +1 -0
- package/dist/vega/p-d320496e.entry.js +1 -0
- package/dist/vega/{p-89e56502.js → p-d32e83e7.js} +1 -1
- package/dist/vega/{p-65900dbf.entry.js → p-d456386a.entry.js} +1 -1
- package/dist/vega/p-d4f1f007.js +3 -0
- package/dist/vega/{p-82016096.js → p-d5531d3c.js} +1 -1
- package/dist/vega/{p-4eb282ef.entry.js → p-d7bd2470.entry.js} +1 -1
- package/dist/vega/p-d872beb1.entry.js +1 -0
- package/dist/vega/p-d9d5c693.entry.js +1 -0
- package/dist/vega/{p-be3517be.entry.js → p-da742a7f.entry.js} +1 -1
- package/dist/vega/{p-204c7d41.js → p-dd6211cd.js} +1 -1
- package/dist/vega/{p-f48c43f4.entry.js → p-e340d58c.entry.js} +1 -1
- package/dist/vega/p-e71864ff.js +1 -0
- package/dist/vega/{p-7912741f.entry.js → p-e7a4b760.entry.js} +1 -1
- package/dist/vega/{p-ffa2e3a6.entry.js → p-ea564928.entry.js} +1 -1
- package/dist/vega/p-eb0ebf50.entry.js +1 -0
- package/dist/vega/p-ebdb489c.entry.js +1 -0
- package/dist/vega/{p-7c2fecfd.entry.js → p-ed01657b.entry.js} +1 -1
- package/dist/vega/p-eda7cd76.entry.js +1 -0
- package/dist/vega/{p-68a531cf.js → p-edda10f7.js} +1 -1
- package/dist/vega/{p-2c2df248.js → p-ef59f6f0.js} +1 -1
- package/dist/vega/{p-1a2f92a3.entry.js → p-efc8c09e.entry.js} +1 -1
- package/dist/vega/p-f020738c.entry.js +1 -0
- package/dist/vega/{p-878851f6.js → p-f28a6074.js} +1 -1
- package/dist/vega/{p-07a2b42a.js → p-f7a5746b.js} +1 -1
- package/dist/vega/{p-9dc23325.entry.js → p-f89cf75a.entry.js} +1 -1
- package/dist/vega/p-fb5ea4b2.js +1 -0
- package/dist/vega/p-fc7ab79d.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-layout-controller.js +0 -146
- package/dist/types/components/vega-file-uploader/slimmers/controllers/vega-file-uploader-drop-file-filter-controller.d.ts +0 -22
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-layout-controller.d.ts +0 -42
- package/dist/vega/p-010b5e74.js +0 -1
- package/dist/vega/p-01883ffc.entry.js +0 -1
- package/dist/vega/p-02578a59.js +0 -1
- package/dist/vega/p-043e685a.entry.js +0 -1
- package/dist/vega/p-08780df0.entry.js +0 -1
- package/dist/vega/p-10fa4eac.js +0 -1
- package/dist/vega/p-18619467.js +0 -1
- package/dist/vega/p-1feb4f2a.entry.js +0 -1
- package/dist/vega/p-203bc4db.entry.js +0 -1
- package/dist/vega/p-21c9e1ca.entry.js +0 -1
- package/dist/vega/p-22336063.js +0 -1
- package/dist/vega/p-224b67ff.entry.js +0 -1
- package/dist/vega/p-2d917e2d.entry.js +0 -1
- package/dist/vega/p-2e73582d.entry.js +0 -1
- package/dist/vega/p-334e3b02.entry.js +0 -1
- package/dist/vega/p-33860e54.js +0 -1
- package/dist/vega/p-365d21ac.entry.js +0 -1
- package/dist/vega/p-367d44d9.entry.js +0 -1
- package/dist/vega/p-3d2d267d.js +0 -1
- package/dist/vega/p-3f3c771a.entry.js +0 -1
- package/dist/vega/p-434fc427.entry.js +0 -1
- package/dist/vega/p-559197f8.js +0 -1
- package/dist/vega/p-5ae4ea20.entry.js +0 -1
- package/dist/vega/p-68124bc5.js +0 -1
- package/dist/vega/p-6af55f1c.entry.js +0 -1
- package/dist/vega/p-6c5250b3.js +0 -1
- package/dist/vega/p-6f2e5bc6.js +0 -1
- package/dist/vega/p-716c71e6.js +0 -1
- package/dist/vega/p-76b80a0c.js +0 -1
- package/dist/vega/p-7942c042.entry.js +0 -1
- package/dist/vega/p-8327635d.js +0 -1
- package/dist/vega/p-840ad046.entry.js +0 -1
- package/dist/vega/p-8ac2d165.js +0 -1
- package/dist/vega/p-8adf9732.entry.js +0 -1
- package/dist/vega/p-8b891f36.entry.js +0 -1
- package/dist/vega/p-9341c1a9.js +0 -1
- package/dist/vega/p-9390a94b.entry.js +0 -1
- package/dist/vega/p-9551da9c.entry.js +0 -1
- package/dist/vega/p-9862d1a8.entry.js +0 -1
- package/dist/vega/p-a4dbf2cc.js +0 -1
- package/dist/vega/p-a99e75a1.entry.js +0 -1
- package/dist/vega/p-b5a6bd0f.entry.js +0 -1
- package/dist/vega/p-c4e32125.entry.js +0 -1
- package/dist/vega/p-c5b698f6.entry.js +0 -1
- package/dist/vega/p-c61279a7.entry.js +0 -1
- package/dist/vega/p-c6d62f0d.js +0 -1
- package/dist/vega/p-c8feb644.entry.js +0 -1
- package/dist/vega/p-cc055723.entry.js +0 -1
- package/dist/vega/p-cca5042b.entry.js +0 -1
- package/dist/vega/p-cda45d2a.entry.js +0 -1
- package/dist/vega/p-cdf5b2f0.entry.js +0 -1
- package/dist/vega/p-d1494c7c.entry.js +0 -1
- package/dist/vega/p-d202e69d.entry.js +0 -1
- package/dist/vega/p-dcd18ab1.js +0 -1
- package/dist/vega/p-e4726dcd.entry.js +0 -1
- package/dist/vega/p-ea21462f.js +0 -1
- package/dist/vega/p-f4190826.entry.js +0 -1
- package/dist/vega/p-fdac91c4.entry.js +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
2
|
-
import { d as domNodeSubjectFactory } from './dom-node-subject-observer-factory-
|
|
3
|
-
import { d as VegaInternalRichTextEditorFlushChanges, e as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-
|
|
4
|
-
import { c as camelToDashCase } from './string-a953eafc.js';
|
|
2
|
+
import { d as domNodeSubjectFactory } from './dom-node-subject-observer-factory-aca0116e.js';
|
|
3
|
+
import { d as VegaInternalRichTextEditorFlushChanges, e as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-194bac82.js';
|
|
4
|
+
import { d as dashCaseToCamel, c as camelToDashCase } from './string-a953eafc.js';
|
|
5
5
|
import { L as LogUtility } from './global-slimmer-registry-17c4efd4.js';
|
|
6
|
-
import { i as isNonNullable } from './type-guard-
|
|
6
|
+
import { i as isNonNullable } from './type-guard-152070e9.js';
|
|
7
|
+
import { T as TypographyUrls } from './typography-396de03f.js';
|
|
7
8
|
import { g as generateUUID } from './misc-9fdbcfbb.js';
|
|
8
|
-
import { V as VegaInternalThemeManager } from './dark-mode-style-controller-
|
|
9
|
+
import { V as VegaInternalThemeManager } from './dark-mode-style-controller-e9a6b097.js';
|
|
9
10
|
import { c as cleanObject } from './object-0c277f57.js';
|
|
10
|
-
import { f as findParent } from './ui-
|
|
11
|
+
import { f as findParent } from './ui-b7600a48.js';
|
|
11
12
|
|
|
12
13
|
var InternalAnnotationTypeEnum;
|
|
13
14
|
(function (InternalAnnotationTypeEnum) {
|
|
@@ -160,6 +161,405 @@ class ModifyContentAction {
|
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Creates a style map from the inline styles of an HTML element. This function extracts the 'style' attribute from the given element.
|
|
166
|
+
*
|
|
167
|
+
* @param {HTMLElement} element The HTML element from which to extract inline styles.
|
|
168
|
+
* @returns {AnnotationStyle} An object representing the custom style annotations.
|
|
169
|
+
*/
|
|
170
|
+
function createStyleMapFromElement(element) {
|
|
171
|
+
const customStyle = element.getAttribute('style');
|
|
172
|
+
if (!customStyle)
|
|
173
|
+
return {};
|
|
174
|
+
const styleValue = customStyle.split(';').filter(Boolean);
|
|
175
|
+
return styleValue
|
|
176
|
+
.filter((key) => key !== ' ')
|
|
177
|
+
.map((key) => {
|
|
178
|
+
// to remove redundant quote pairs if needed, for example: ['fontFamily: "Roboto Mono"'] will be updated to ['fontFamily: Roboto Mono']
|
|
179
|
+
const styleObject = key.replace(/(['"])(.*?)\1/g, '$2').split(':');
|
|
180
|
+
const styleKey = dashCaseToCamel(styleObject[0].trim());
|
|
181
|
+
return {
|
|
182
|
+
[styleKey]: styleObject[1].trim().replace(';', ''),
|
|
183
|
+
};
|
|
184
|
+
})
|
|
185
|
+
.reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Abstract strategy class for filtering default styles in the rich text editor.
|
|
190
|
+
* Concrete strategies define which styles to strip via `stylesToBeFiltered`.
|
|
191
|
+
*
|
|
192
|
+
* This base is shared by two kinds of concrete strategies:
|
|
193
|
+
* 1. Block/node output strategies – filter inline styles when converting DTO → HTML.
|
|
194
|
+
* 2. Annotation parsing strategies – strip redundant defaults when converting HTML → DTO.
|
|
195
|
+
*/
|
|
196
|
+
class RTEFilterStylesStrategy {
|
|
197
|
+
constructor() {
|
|
198
|
+
/**
|
|
199
|
+
* The class name to be added to the element if the styles are successfully filtered. This should be defined in the concrete implementation of the strategy if needed.
|
|
200
|
+
* After the class name is added to the element, it will be removed in the next refill process to avoid redundant class names.
|
|
201
|
+
* The class name will only be added when the styles are successfully extracted, which means the expected styles are present in the full styles object and have been deleted from it.
|
|
202
|
+
*/
|
|
203
|
+
this.classNameToBeAdded = '';
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Removes matched default styles from the `customStyle` property of the given annotations object.
|
|
207
|
+
* If all custom styles are defaults, the `customStyle` key is deleted entirely.
|
|
208
|
+
*
|
|
209
|
+
* @param {VegaRTEAnnotations} annotations - The annotations object (mutated in place).
|
|
210
|
+
* @returns {VegaRTEAnnotations} The same annotations reference.
|
|
211
|
+
*/
|
|
212
|
+
filterAnnotations(annotations) {
|
|
213
|
+
const customStyle = annotations.customStyle;
|
|
214
|
+
if (!customStyle) {
|
|
215
|
+
return annotations;
|
|
216
|
+
}
|
|
217
|
+
this.extractAndDeleteMatchedStyles(customStyle);
|
|
218
|
+
if (Object.keys(customStyle).length === 0) {
|
|
219
|
+
delete annotations.customStyle;
|
|
220
|
+
}
|
|
221
|
+
return annotations;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Filters and deletes the matched styles from the full styles object, add the corresponding class name if necessary, and returns the result.
|
|
225
|
+
*
|
|
226
|
+
* @param {RTEFilterStyles} fullStyles - The full set of styles to filter.
|
|
227
|
+
* @param {string[]} classNames - The class names to consider.
|
|
228
|
+
* @returns {RTEFilterInlineStylesResult} The filtered styles and class names.
|
|
229
|
+
*/
|
|
230
|
+
filterAndDeleteStyles(fullStyles, classNames) {
|
|
231
|
+
const classSet = new Set(classNames);
|
|
232
|
+
const shouldAddClass = this.extractAndDeleteMatchedStyles(fullStyles);
|
|
233
|
+
if (shouldAddClass && this.classNameToBeAdded) {
|
|
234
|
+
classSet.add(this.classNameToBeAdded);
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
styles: fullStyles,
|
|
238
|
+
classNames: Array.from(classSet),
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Refills the external styles for a given HTML element based on a matched external style rule.
|
|
243
|
+
*
|
|
244
|
+
* @param {HTMLElement} element - The HTML element to apply the styles to. The element's existing styles will be merged with the matched rule's styles, and the matched class name will be removed from the element.
|
|
245
|
+
*/
|
|
246
|
+
refillStyles(element) {
|
|
247
|
+
if (this.classNameToBeAdded) {
|
|
248
|
+
element.classList.remove(this.classNameToBeAdded);
|
|
249
|
+
}
|
|
250
|
+
const existingStyles = createStyleMapFromElement(element);
|
|
251
|
+
const mergedStyles = Object.assign(Object.assign({}, this.stylesToBeFiltered), existingStyles);
|
|
252
|
+
const cssText = Object.entries(Object.assign({}, mergedStyles))
|
|
253
|
+
.map(([key, value]) => `${camelToDashCase(key)}: ${value};`)
|
|
254
|
+
.join('');
|
|
255
|
+
element.setAttribute('style', cssText);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Determines if the strategy can filter the given block or node instance.
|
|
259
|
+
* Return false by default, concrete strategies should override this method to specify the filtering logic based on the block or node instance's properties, such as its type or annotations.
|
|
260
|
+
*
|
|
261
|
+
* @param {RTEBlock | RTENode} _blockOrNodeInstance - The block or node instance to check.
|
|
262
|
+
* @returns {boolean} True if the strategy can filter the instance, false otherwise.
|
|
263
|
+
*/
|
|
264
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
265
|
+
canFilter(_blockOrNodeInstance) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Determines if the strategy can refill styles for the given block or node class name and element.
|
|
270
|
+
* Return false by default to avoid unnecessary refill attempts, concrete strategies should override this method to specify the refilling logic based on the class name and element properties, such as the presence of certain attributes or existing styles.
|
|
271
|
+
*
|
|
272
|
+
* @param {string} _blockOrNodeClassName - The class name of the block or node.
|
|
273
|
+
* @param {HTMLElement} _element - The HTML element to apply the styles to.
|
|
274
|
+
* @returns {boolean} True if the strategy can refill styles, false otherwise.
|
|
275
|
+
*/
|
|
276
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
277
|
+
canRefill(_blockOrNodeClassName, _element) {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Generates the CSS text to be applied to the element based on the strategy's styles to filter. This method should be implemented in the concrete strategy class to return the appropriate CSS text for the styles it handles.
|
|
282
|
+
* Return an empty string by default to avoid applying any styles when the method is not implemented in a concrete strategy.
|
|
283
|
+
*
|
|
284
|
+
* @returns {string} The CSS text to be applied to the element.
|
|
285
|
+
*/
|
|
286
|
+
toCssText() {
|
|
287
|
+
return '';
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Whether this strategy should always filter, regardless of `autoMatchFormat`.
|
|
291
|
+
* Override to `true` when the filtered styles are always emitted as inline
|
|
292
|
+
* styles by the DTO (e.g. image `vertical-align`), so stripping them from
|
|
293
|
+
* `customStyle` is always safe.
|
|
294
|
+
*
|
|
295
|
+
* Defaults to `false` – the strategy only runs when `autoMatchFormat` is enabled.
|
|
296
|
+
* Used before invoke the filterAnnotations method.
|
|
297
|
+
*
|
|
298
|
+
* @returns {boolean} Whether filtering should always apply.
|
|
299
|
+
*/
|
|
300
|
+
get alwaysFilter() {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Removes configured default style properties from the target styles object.
|
|
305
|
+
* Only properties whose value matches the configured default exactly are deleted.
|
|
306
|
+
*
|
|
307
|
+
* @param {Nullable<RTEFilterStyles>} styles - The styles object to mutate.
|
|
308
|
+
* @returns {boolean} `true` if at least one style was extracted.
|
|
309
|
+
*/
|
|
310
|
+
extractAndDeleteMatchedStyles(styles) {
|
|
311
|
+
let wasExtracted = false;
|
|
312
|
+
const defaults = this.stylesToBeFiltered;
|
|
313
|
+
if (styles && defaults) {
|
|
314
|
+
const styleKeys = Object.keys(defaults);
|
|
315
|
+
for (const key of styleKeys) {
|
|
316
|
+
if (styles[key] === defaults[key]) {
|
|
317
|
+
delete styles[key];
|
|
318
|
+
wasExtracted = true;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return wasExtracted;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Converts the styles map to a CSS text string.
|
|
326
|
+
*
|
|
327
|
+
* @param {string} tagName The HTML tag name.
|
|
328
|
+
* @param {string} [className] The optional class name.
|
|
329
|
+
* @returns {string} The CSS text string.
|
|
330
|
+
*/
|
|
331
|
+
buildCssTextForStyles(tagName, className) {
|
|
332
|
+
const selector = `.${RTEFilterStylesStrategy.RTE_CONTENT_CONTAINER_CLASS_NAME}` +
|
|
333
|
+
(className ? ` .${className}` : ` ${tagName}`);
|
|
334
|
+
const styles = Object.entries(this.stylesToBeFiltered)
|
|
335
|
+
.map(([key, value]) => `${camelToDashCase(key)}: ${value};`)
|
|
336
|
+
.join(' ');
|
|
337
|
+
return `${selector} { ${styles} }`;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Converts the styles map to a CSS text string.
|
|
341
|
+
*
|
|
342
|
+
* @param {RTEFilterStyles} [styles] The styles to convert. If not provided, the strategy's stylesToBeFiltered will be used.
|
|
343
|
+
* @returns {string} The CSS text string.
|
|
344
|
+
*/
|
|
345
|
+
convertStylesMapToCssText(styles) {
|
|
346
|
+
const stylesToConvert = styles || this.stylesToBeFiltered;
|
|
347
|
+
return Object.entries(stylesToConvert)
|
|
348
|
+
.map(([key, value]) => `${camelToDashCase(key)}: ${value};`)
|
|
349
|
+
.join(' ');
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Check if the styles of the block or node instance match the default paragraph styles.
|
|
353
|
+
*
|
|
354
|
+
* @param {RTEBlock | RTENode} blockOrNodeInstance - The block or node instance to check.
|
|
355
|
+
* @param {string[]} [checkedKeys] - Optional array of style keys to check. If not provided, all keys in stylesToBeFiltered will be checked.
|
|
356
|
+
* @returns {boolean} - True if the styles match the default paragraph styles, false otherwise.
|
|
357
|
+
*/
|
|
358
|
+
isBlockOrNodeStylesMatchFilterStyles(blockOrNodeInstance, checkedKeys) {
|
|
359
|
+
const styles = blockOrNodeInstance.getStyles({ standalone: true });
|
|
360
|
+
return this.isMatchFilterStyles(styles, checkedKeys);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Checks if the given itemStyles match the default paragraph styles.
|
|
364
|
+
*
|
|
365
|
+
* @param {RTEFilterStyles} itemStyles - The styles to check against the default paragraph styles.
|
|
366
|
+
* @param {string[]} [checkedKeys] - Optional array of style keys to check. If not provided, all keys in stylesToBeFiltered will be checked.
|
|
367
|
+
* @returns {boolean} - True if the itemStyles match the default paragraph styles, false otherwise.
|
|
368
|
+
*/
|
|
369
|
+
isMatchFilterStyles(itemStyles, checkedKeys) {
|
|
370
|
+
const keysToCheck = checkedKeys && checkedKeys.length > 0 ? checkedKeys : Object.keys(this.stylesToBeFiltered);
|
|
371
|
+
return keysToCheck.every((key) => {
|
|
372
|
+
return itemStyles[key] === this.stylesToBeFiltered[key];
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Used for generate the style text, all styles should inside the content container.
|
|
378
|
+
* For example, if the style text is .v-rte-title {font-size: 24px;} the final generated style text should be .vega-rte-content .v-rte-title {font-size: 24px;} to make sure the styles are only applied to the elements inside the content container.
|
|
379
|
+
*/
|
|
380
|
+
RTEFilterStylesStrategy.RTE_CONTENT_CONTAINER_CLASS_NAME = 'vega-rte-content';
|
|
381
|
+
|
|
382
|
+
var NodeAnnotationTypeEnum;
|
|
383
|
+
(function (NodeAnnotationTypeEnum) {
|
|
384
|
+
NodeAnnotationTypeEnum["BOLD"] = "BOLD";
|
|
385
|
+
NodeAnnotationTypeEnum["ITALIC"] = "ITALIC";
|
|
386
|
+
NodeAnnotationTypeEnum["UNDERLINE"] = "UNDERLINE";
|
|
387
|
+
NodeAnnotationTypeEnum["STRIKETHROUGH"] = "STRIKETHROUGH";
|
|
388
|
+
NodeAnnotationTypeEnum["SELECTION_RANGE"] = "SELECTION_RANGE";
|
|
389
|
+
NodeAnnotationTypeEnum["IMAGE"] = "IMAGE";
|
|
390
|
+
NodeAnnotationTypeEnum["CODE"] = "CODE";
|
|
391
|
+
NodeAnnotationTypeEnum["TEXT_COLOR"] = "TEXT_COLOR";
|
|
392
|
+
NodeAnnotationTypeEnum["LINK"] = "LINK";
|
|
393
|
+
NodeAnnotationTypeEnum["INLINE_HTML"] = "INLINE_HTML";
|
|
394
|
+
NodeAnnotationTypeEnum["PLAIN_TEXT"] = "PLAIN_TEXT";
|
|
395
|
+
})(NodeAnnotationTypeEnum || (NodeAnnotationTypeEnum = {}));
|
|
396
|
+
/**
|
|
397
|
+
* Abstract class for all annotations
|
|
398
|
+
*/
|
|
399
|
+
class NodeAnnotation extends Annotation {
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Predicate class provides static methods to check specific conditions on HTML elements or dto instances.
|
|
404
|
+
*/
|
|
405
|
+
class Predicate {
|
|
406
|
+
/**
|
|
407
|
+
* Checks if the given class name corresponds to a text block.
|
|
408
|
+
*
|
|
409
|
+
* @param {string} className The class name to check.
|
|
410
|
+
* @returns {boolean} True if the class name corresponds to a text block, false otherwise.
|
|
411
|
+
*/
|
|
412
|
+
static isTextBlock(className) {
|
|
413
|
+
return className === this.RTE_TEXT_BLOCK_CLASS_NAME;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Checks if the given class name corresponds to a code block.
|
|
417
|
+
*
|
|
418
|
+
* @param {string} className The class name to check.
|
|
419
|
+
* @returns {boolean} True if the class name corresponds to a code block, false otherwise.
|
|
420
|
+
*/
|
|
421
|
+
static isCodeBlock(className) {
|
|
422
|
+
return className === 'RTECodeBlock';
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Checks if the given class name corresponds to a list block.
|
|
426
|
+
*
|
|
427
|
+
* @param {string} className The class name to check.
|
|
428
|
+
* @returns {boolean} True if the class name corresponds to a list block, false otherwise.
|
|
429
|
+
*/
|
|
430
|
+
static isListBlock(className) {
|
|
431
|
+
return className === 'RTEListBlock';
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Checks if the given class name corresponds to a list item block.
|
|
435
|
+
*
|
|
436
|
+
* @param {string} className The class name to check.
|
|
437
|
+
* @returns {boolean} True if the class name corresponds to a list item block, false otherwise.
|
|
438
|
+
*/
|
|
439
|
+
static isListItemBlock(className) {
|
|
440
|
+
return className === 'RTEListItemBlock';
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Checks if the given class name corresponds to a text node.
|
|
444
|
+
*
|
|
445
|
+
* @param {string} className The class name to check.
|
|
446
|
+
* @returns {boolean} True if the class name corresponds to a text node, false otherwise.
|
|
447
|
+
*/
|
|
448
|
+
static isTextNode(className) {
|
|
449
|
+
return className === this.RTE_TEXT_NODE_CLASS_NAME;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Checks if the given block or node instance is a text node and has a link annotation.
|
|
453
|
+
*
|
|
454
|
+
* @param {RTEBlock | RTENode} blockOrNodeInstance The block or node instance to check.
|
|
455
|
+
* @returns {boolean} True if the block or node instance is a text node and has a link annotation, false otherwise.
|
|
456
|
+
*/
|
|
457
|
+
static isLinkNode(blockOrNodeInstance) {
|
|
458
|
+
return (this.isTextNode(blockOrNodeInstance.constructor.name) &&
|
|
459
|
+
!!blockOrNodeInstance.getAnnotationByType(NodeAnnotationTypeEnum.LINK));
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Checks if the given block or node instance is a code node, which is defined as a text node that has a code annotation.
|
|
463
|
+
*
|
|
464
|
+
* @param {RTEBlock | RTENode} blockOrNodeInstance The block or node instance to check.
|
|
465
|
+
* @returns {boolean} True if the block or node instance is a code node, false otherwise.
|
|
466
|
+
*/
|
|
467
|
+
static isCodeNode(blockOrNodeInstance) {
|
|
468
|
+
if (this.isTextNode(blockOrNodeInstance.constructor.name)) {
|
|
469
|
+
const codeAnnotation = blockOrNodeInstance.getAnnotationByType(NodeAnnotationTypeEnum.CODE);
|
|
470
|
+
return !!codeAnnotation && codeAnnotation.code;
|
|
471
|
+
}
|
|
472
|
+
return false;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Check if the given block or node instance is an image node, which is defined as an instance of RTEImageNode.
|
|
476
|
+
*
|
|
477
|
+
* @param {RTEBlock | RTENode} blockOrNodeInstance The block or node instance to check.
|
|
478
|
+
* @returns {boolean} True if the block or node instance is an image node, false otherwise.
|
|
479
|
+
*/
|
|
480
|
+
static isImageNode(blockOrNodeInstance) {
|
|
481
|
+
return blockOrNodeInstance.constructor.name === 'RTEImageNode';
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Check if the given block or node instance is a code block node, which is defined as an instance of RTECodeBlockNode.
|
|
485
|
+
*
|
|
486
|
+
* @param {RTEBlock | RTENode} blockOrNodeInstance The block or node instance to check.
|
|
487
|
+
* @returns {boolean} True if the block or node instance is a code block node, false otherwise.
|
|
488
|
+
*/
|
|
489
|
+
static isCodeBlockNode(blockOrNodeInstance) {
|
|
490
|
+
return blockOrNodeInstance.constructor.name === 'RTECodeBlockNode';
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
Predicate.RTE_TEXT_NODE_CLASS_NAME = 'RTETextNode';
|
|
494
|
+
Predicate.RTE_TEXT_BLOCK_CLASS_NAME = 'RTETextBlock';
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* The LinkFilterStylesStrategy is responsible for filtering link styles from text nodes that are annotated as links.
|
|
498
|
+
*/
|
|
499
|
+
class LinkFilterStylesStrategy extends RTEFilterStylesStrategy {
|
|
500
|
+
constructor() {
|
|
501
|
+
super(...arguments);
|
|
502
|
+
this.stylesToBeFiltered = LinkGroupAnnotation.getDefaultStyles();
|
|
503
|
+
this.elementTagName = 'a';
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Filter default link styles from `link.customStyle` in annotations.
|
|
507
|
+
*
|
|
508
|
+
* @param {VegaRTEAnnotations} annotations - The annotations to filter.
|
|
509
|
+
* @returns {VegaRTEAnnotations} The same annotations reference with link.customStyle cleaned up.
|
|
510
|
+
*/
|
|
511
|
+
filterAnnotations(annotations) {
|
|
512
|
+
const link = annotations.link;
|
|
513
|
+
if (!(link === null || link === void 0 ? void 0 : link.customStyle)) {
|
|
514
|
+
return annotations;
|
|
515
|
+
}
|
|
516
|
+
this.extractAndDeleteMatchedStyles(link.customStyle);
|
|
517
|
+
if (Object.keys(link.customStyle).length === 0) {
|
|
518
|
+
delete link.customStyle;
|
|
519
|
+
}
|
|
520
|
+
return annotations;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* @inheritDoc
|
|
524
|
+
*/
|
|
525
|
+
canFilter(blockOrNodeInstance) {
|
|
526
|
+
return Predicate.isLinkNode(blockOrNodeInstance);
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* @inheritDoc
|
|
530
|
+
*/
|
|
531
|
+
canRefill(blockOrNodeClassName, element) {
|
|
532
|
+
return blockOrNodeClassName === 'RTETextNode' && element.matches(this.elementTagName);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* @inheritDoc
|
|
536
|
+
*/
|
|
537
|
+
toCssText() {
|
|
538
|
+
return this.buildCssTextForStyles(this.elementTagName, this.classNameToBeAdded);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Filters the inline styles for a link group annotation and updates the attributes accordingly.
|
|
542
|
+
*
|
|
543
|
+
* @param {Record<string, string | AnnotationStyle>} attributes The attributes of the link group annotation.
|
|
544
|
+
* @returns {Record<string, string | AnnotationStyle>} The updated attributes after filtering.
|
|
545
|
+
*/
|
|
546
|
+
filterLinkGroupInlineStyles(attributes) {
|
|
547
|
+
const fullStyles = attributes.style;
|
|
548
|
+
const classNames = attributes.class ? attributes.class.split(' ') : [];
|
|
549
|
+
const filterResult = this.filterAndDeleteStyles(fullStyles, classNames);
|
|
550
|
+
filterResult.styles &&
|
|
551
|
+
Object.keys(filterResult.styles).length > 0 &&
|
|
552
|
+
(attributes.style = filterResult.styles);
|
|
553
|
+
filterResult.classNames &&
|
|
554
|
+
filterResult.classNames.length > 0 &&
|
|
555
|
+
(attributes.class = filterResult.classNames.join(' '));
|
|
556
|
+
if (attributes.style && Object.keys(attributes.style).length === 0) {
|
|
557
|
+
delete attributes.style;
|
|
558
|
+
}
|
|
559
|
+
return attributes;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
163
563
|
/**
|
|
164
564
|
* Annotation to represent a link of grouped nodes
|
|
165
565
|
*/
|
|
@@ -192,11 +592,15 @@ class LinkGroupAnnotation extends Annotation {
|
|
|
192
592
|
* Convert the custom style, class and attribute to string which html can used
|
|
193
593
|
*
|
|
194
594
|
* @param {linkAnnotation} linkAnnotation current link annotation which saved custom style, class and attribute.
|
|
195
|
-
* @param {
|
|
595
|
+
* @param {LinkGroupConversionOptions} options - options.
|
|
196
596
|
* @returns {string} - string.
|
|
197
597
|
*/
|
|
198
598
|
toString(linkAnnotation, options) {
|
|
199
|
-
|
|
599
|
+
let attributes = this.toJsx(linkAnnotation, options);
|
|
600
|
+
if (options === null || options === void 0 ? void 0 : options.filterInlineStyles) {
|
|
601
|
+
attributes =
|
|
602
|
+
LinkGroupAnnotation.linkGroupFilterStylesStrategy.filterLinkGroupInlineStyles(attributes);
|
|
603
|
+
}
|
|
200
604
|
return Object.entries(attributes)
|
|
201
605
|
.map(([key, value]) => {
|
|
202
606
|
const valueString = typeof value === 'string' ? value : this.formatStyleToString(value);
|
|
@@ -278,6 +682,7 @@ class LinkGroupAnnotation extends Annotation {
|
|
|
278
682
|
.join(' ');
|
|
279
683
|
}
|
|
280
684
|
}
|
|
685
|
+
LinkGroupAnnotation.linkGroupFilterStylesStrategy = new LinkFilterStylesStrategy();
|
|
281
686
|
|
|
282
687
|
/**
|
|
283
688
|
* Annotation to make block with horizontal alignment
|
|
@@ -807,26 +1212,6 @@ class InternalWrapperAnnotation extends BlockAnnotation {
|
|
|
807
1212
|
}
|
|
808
1213
|
}
|
|
809
1214
|
|
|
810
|
-
var NodeAnnotationTypeEnum;
|
|
811
|
-
(function (NodeAnnotationTypeEnum) {
|
|
812
|
-
NodeAnnotationTypeEnum["BOLD"] = "BOLD";
|
|
813
|
-
NodeAnnotationTypeEnum["ITALIC"] = "ITALIC";
|
|
814
|
-
NodeAnnotationTypeEnum["UNDERLINE"] = "UNDERLINE";
|
|
815
|
-
NodeAnnotationTypeEnum["STRIKETHROUGH"] = "STRIKETHROUGH";
|
|
816
|
-
NodeAnnotationTypeEnum["SELECTION_RANGE"] = "SELECTION_RANGE";
|
|
817
|
-
NodeAnnotationTypeEnum["IMAGE"] = "IMAGE";
|
|
818
|
-
NodeAnnotationTypeEnum["CODE"] = "CODE";
|
|
819
|
-
NodeAnnotationTypeEnum["TEXT_COLOR"] = "TEXT_COLOR";
|
|
820
|
-
NodeAnnotationTypeEnum["LINK"] = "LINK";
|
|
821
|
-
NodeAnnotationTypeEnum["INLINE_HTML"] = "INLINE_HTML";
|
|
822
|
-
NodeAnnotationTypeEnum["PLAIN_TEXT"] = "PLAIN_TEXT";
|
|
823
|
-
})(NodeAnnotationTypeEnum || (NodeAnnotationTypeEnum = {}));
|
|
824
|
-
/**
|
|
825
|
-
* Abstract class for all annotations
|
|
826
|
-
*/
|
|
827
|
-
class NodeAnnotation extends Annotation {
|
|
828
|
-
}
|
|
829
|
-
|
|
830
1215
|
/**
|
|
831
1216
|
* Class to handle the style representation of annotations for RTE blocks and nodes.
|
|
832
1217
|
*/
|
|
@@ -909,6 +1294,105 @@ class RTEAnnotationStyle {
|
|
|
909
1294
|
}
|
|
910
1295
|
}
|
|
911
1296
|
|
|
1297
|
+
/**
|
|
1298
|
+
* Registry for managing filter styles strategies keyed by DTO class name.
|
|
1299
|
+
*
|
|
1300
|
+
* Provides common `register` / `getStrategies` primitives that both output-
|
|
1301
|
+
* filtering strategies (DTO → HTML) and annotation-parsing strategies
|
|
1302
|
+
* (HTML → DTO) build upon.
|
|
1303
|
+
*
|
|
1304
|
+
* TODO: Currently, the filter styles strategies are applied for all rich text editors. We need to apply the strategies with a specific rich text editor instance when we have multiple rich text editors in the future.
|
|
1305
|
+
*/
|
|
1306
|
+
class RTEFilterStylesStrategyRegistry {
|
|
1307
|
+
/**
|
|
1308
|
+
* Registers a filter styles strategy for a specific DTO class name.
|
|
1309
|
+
* Duplicate strategy instances are ignored.
|
|
1310
|
+
*
|
|
1311
|
+
* @param {string} dtoClassName - The DTO class name (e.g. `RTEListBlock.name`).
|
|
1312
|
+
* @param {RTEFilterStylesStrategy} strategy - The strategy instance to register.
|
|
1313
|
+
*/
|
|
1314
|
+
static register(dtoClassName, strategy) {
|
|
1315
|
+
var _a;
|
|
1316
|
+
const set = (_a = this.registry.get(dtoClassName)) !== null && _a !== void 0 ? _a : new Set();
|
|
1317
|
+
set.add(strategy);
|
|
1318
|
+
this.registry.set(dtoClassName, set);
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Retrieves all strategies registered for a given DTO class name.
|
|
1322
|
+
*
|
|
1323
|
+
* @param {string} dtoClassName - The DTO class name to look up.
|
|
1324
|
+
* @returns {RTEFilterStylesStrategy[]} Registered strategies (empty array if none).
|
|
1325
|
+
*/
|
|
1326
|
+
static getStrategies(dtoClassName) {
|
|
1327
|
+
var _a;
|
|
1328
|
+
return Array.from((_a = this.registry.get(dtoClassName)) !== null && _a !== void 0 ? _a : []);
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Executes the appropriate filter styles strategy for a given block or node instance.
|
|
1332
|
+
*
|
|
1333
|
+
* @param {RTEBlock | RTENode} blockOrNodeInstance - The block or node instance to filter styles for.
|
|
1334
|
+
* @param {RTEFilterStyles} styles - The full set of styles to filter.
|
|
1335
|
+
* @param {string[]} classNames - The class names to consider.
|
|
1336
|
+
* @returns {RTEFilterInlineStylesResult} The result of filtering, including the remaining styles and class names.
|
|
1337
|
+
*/
|
|
1338
|
+
static executeTheStrategyFilterAction(blockOrNodeInstance, styles, classNames) {
|
|
1339
|
+
const dtoClassName = blockOrNodeInstance.constructor.name;
|
|
1340
|
+
const strategies = this.getStrategies(dtoClassName);
|
|
1341
|
+
const matchedStrategies = strategies.filter((strategy) => {
|
|
1342
|
+
return strategy.canFilter(blockOrNodeInstance);
|
|
1343
|
+
});
|
|
1344
|
+
return matchedStrategies.reduce((result, strategy) => {
|
|
1345
|
+
return strategy.filterAndDeleteStyles(result.styles, result.classNames);
|
|
1346
|
+
}, {
|
|
1347
|
+
styles,
|
|
1348
|
+
classNames,
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Executes the appropriate filter styles strategy for refilling styles on a given element.
|
|
1353
|
+
*
|
|
1354
|
+
* @param {string} dtoClassName The class name of the DTO.
|
|
1355
|
+
* @param {HTMLElement} element The HTML element to refill styles on.
|
|
1356
|
+
*/
|
|
1357
|
+
static executeTheStrategyRefillAction(dtoClassName, element) {
|
|
1358
|
+
const strategies = this.getStrategies(dtoClassName);
|
|
1359
|
+
const matchedStrategies = strategies.filter((strategy) => {
|
|
1360
|
+
return strategy.canRefill(dtoClassName, element);
|
|
1361
|
+
});
|
|
1362
|
+
matchedStrategies.forEach((strategy) => {
|
|
1363
|
+
strategy.refillStyles(element);
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Based on the registered strategies, generates the CSS text for all strategies in the registry. The generated CSS text is grouped by DTO class names for better organization.
|
|
1368
|
+
*
|
|
1369
|
+
* @param {boolean} enableFontFaceImports - A flag indicating whether to include font-face declarations for typography styles.
|
|
1370
|
+
* @returns {string} The content of style file.
|
|
1371
|
+
*/
|
|
1372
|
+
static generateAllStylesContent(enableFontFaceImports = false) {
|
|
1373
|
+
const styleBlocks = [];
|
|
1374
|
+
if (enableFontFaceImports) {
|
|
1375
|
+
styleBlocks.push('/* Font-face imports begin */\n');
|
|
1376
|
+
styleBlocks.push(Object.keys(TypographyUrls)
|
|
1377
|
+
.map((key) => {
|
|
1378
|
+
return `@import url('${TypographyUrls[key].url}');\n`;
|
|
1379
|
+
})
|
|
1380
|
+
.join(' '));
|
|
1381
|
+
styleBlocks.push('/* Font-face imports end */\n');
|
|
1382
|
+
}
|
|
1383
|
+
this.registry.forEach((strategies) => {
|
|
1384
|
+
strategies.forEach((strategy) => {
|
|
1385
|
+
const cssText = strategy.toCssText();
|
|
1386
|
+
if (cssText && !styleBlocks.includes(cssText)) {
|
|
1387
|
+
styleBlocks.push(cssText);
|
|
1388
|
+
}
|
|
1389
|
+
});
|
|
1390
|
+
});
|
|
1391
|
+
return styleBlocks.join(' ');
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
RTEFilterStylesStrategyRegistry.registry = new Map();
|
|
1395
|
+
|
|
912
1396
|
var NodeTypeEnum;
|
|
913
1397
|
(function (NodeTypeEnum) {
|
|
914
1398
|
NodeTypeEnum["TEXT"] = "TEXT";
|
|
@@ -1036,21 +1520,31 @@ class RTENode {
|
|
|
1036
1520
|
/**
|
|
1037
1521
|
* Generate attributes as string
|
|
1038
1522
|
*
|
|
1523
|
+
* @param {VegaRTETransformOptions} [options] - Options for converting the node to HTML.
|
|
1039
1524
|
* @param {...string} attrs - Additional attributes to include
|
|
1040
1525
|
* @returns {string} - Attributes as string
|
|
1041
1526
|
*/
|
|
1042
|
-
generateAttributeString(...attrs) {
|
|
1527
|
+
generateAttributeString(options, ...attrs) {
|
|
1043
1528
|
var _a;
|
|
1044
1529
|
const nodeAnnotationStyle = new RTEAnnotationStyle(this);
|
|
1045
|
-
const
|
|
1530
|
+
const fullStyles = nodeAnnotationStyle.toJSON({ standalone: true }, [
|
|
1046
1531
|
'textDecoration',
|
|
1047
1532
|
]);
|
|
1048
1533
|
const customClassAnnotation = this.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_CLASS);
|
|
1534
|
+
let styles = fullStyles;
|
|
1535
|
+
let classNames = customClassAnnotation === null || customClassAnnotation === void 0 ? void 0 : customClassAnnotation.renderClass();
|
|
1536
|
+
if (options && options.filterInlineStyles) {
|
|
1537
|
+
const filterResult = RTEFilterStylesStrategyRegistry.executeTheStrategyFilterAction(this, fullStyles, classNames);
|
|
1538
|
+
styles = filterResult.styles;
|
|
1539
|
+
classNames = filterResult.classNames;
|
|
1540
|
+
}
|
|
1049
1541
|
const customAttributeString = ((_a = this.getCustomAttributesAnnotation()) === null || _a === void 0 ? void 0 : _a.toString(attrs)) || [];
|
|
1050
1542
|
const attributes = [
|
|
1051
1543
|
...customAttributeString,
|
|
1052
|
-
|
|
1053
|
-
styles
|
|
1544
|
+
classNames && classNames.length > 0 ? `class="${classNames.join(' ')}"` : null,
|
|
1545
|
+
styles && Object.keys(styles).length > 0
|
|
1546
|
+
? `style="${nodeAnnotationStyle.toCssText({ standalone: true }, undefined, styles)}"`
|
|
1547
|
+
: null,
|
|
1054
1548
|
...attrs,
|
|
1055
1549
|
].filter(isNonNullable);
|
|
1056
1550
|
return attributes.length ? ` ${attributes.join(' ')}` : '';
|
|
@@ -1348,19 +1842,29 @@ class RTEBlock {
|
|
|
1348
1842
|
/**
|
|
1349
1843
|
* Generate attributes as string
|
|
1350
1844
|
*
|
|
1845
|
+
* @param {VegaRTETransformOptions} options - Options to control the generation of the attribute string, such as whether to filter inline styles.
|
|
1351
1846
|
* @param {...string} attrs - Additional attributes to include
|
|
1352
1847
|
* @returns {string} - Attributes as string
|
|
1353
1848
|
*/
|
|
1354
|
-
generateAttributeString(...attrs) {
|
|
1849
|
+
generateAttributeString(options, ...attrs) {
|
|
1355
1850
|
var _a;
|
|
1356
1851
|
const blockAnnotationStyle = new RTEAnnotationStyle(this);
|
|
1357
|
-
const
|
|
1852
|
+
const fullStyles = blockAnnotationStyle.toJSON({ standalone: true });
|
|
1358
1853
|
const customClassAnnotation = this.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_CLASS);
|
|
1854
|
+
let styles = fullStyles;
|
|
1855
|
+
let classNames = customClassAnnotation === null || customClassAnnotation === void 0 ? void 0 : customClassAnnotation.renderClass();
|
|
1856
|
+
if (options && options.filterInlineStyles) {
|
|
1857
|
+
const filterResult = RTEFilterStylesStrategyRegistry.executeTheStrategyFilterAction(this, fullStyles, classNames);
|
|
1858
|
+
styles = filterResult.styles;
|
|
1859
|
+
classNames = filterResult.classNames;
|
|
1860
|
+
}
|
|
1359
1861
|
const customAttributeString = ((_a = this.getCustomAttributesAnnotation()) === null || _a === void 0 ? void 0 : _a.toString(attrs)) || [];
|
|
1360
1862
|
const attributes = [
|
|
1361
1863
|
...customAttributeString,
|
|
1362
|
-
|
|
1363
|
-
styles
|
|
1864
|
+
classNames && classNames.length > 0 ? `class="${classNames.join(' ')}"` : null,
|
|
1865
|
+
styles && Object.keys(styles).length > 0
|
|
1866
|
+
? `style="${blockAnnotationStyle.toCssText({ standalone: true }, undefined, styles)}"`
|
|
1867
|
+
: null,
|
|
1364
1868
|
...attrs,
|
|
1365
1869
|
].filter(isNonNullable);
|
|
1366
1870
|
return attributes.length ? ` ${attributes.join(' ')}` : '';
|
|
@@ -1786,6 +2290,26 @@ const VegaRTEPresetToolbarItems = [
|
|
|
1786
2290
|
['image'],
|
|
1787
2291
|
['clearStyle'],
|
|
1788
2292
|
];
|
|
2293
|
+
/**
|
|
2294
|
+
* Void/self-closing HTML elements that have no closing tag and cannot contain children.
|
|
2295
|
+
* Source: https://html.spec.whatwg.org/multipage/syntax.html#void-elements
|
|
2296
|
+
*/
|
|
2297
|
+
const HTML_VOID_TAGS = new Set([
|
|
2298
|
+
'area',
|
|
2299
|
+
'base',
|
|
2300
|
+
'br',
|
|
2301
|
+
'col',
|
|
2302
|
+
'embed',
|
|
2303
|
+
'hr',
|
|
2304
|
+
'img',
|
|
2305
|
+
'input',
|
|
2306
|
+
'link',
|
|
2307
|
+
'meta',
|
|
2308
|
+
'param',
|
|
2309
|
+
'source',
|
|
2310
|
+
'track',
|
|
2311
|
+
'wbr',
|
|
2312
|
+
]);
|
|
1789
2313
|
|
|
1790
2314
|
/**
|
|
1791
2315
|
* Annotation to make text with text color
|
|
@@ -2555,6 +3079,7 @@ class InlineHtmlAnnotation extends Annotation {
|
|
|
2555
3079
|
static from(inlineHtml) {
|
|
2556
3080
|
const { htmlTag, child, customStyle, customClass, customAttribute } = inlineHtml;
|
|
2557
3081
|
const inlineHtmlAnnotation = new InlineHtmlAnnotation(htmlTag);
|
|
3082
|
+
inlineHtmlAnnotation.groupId = inlineHtml.groupId;
|
|
2558
3083
|
inlineHtmlAnnotation.child = child ? InlineHtmlAnnotation.from(child)[1] : undefined;
|
|
2559
3084
|
inlineHtmlAnnotation.customAttribute = customAttribute
|
|
2560
3085
|
? CustomAttributeAnnotation.from(customAttribute)[1]
|
|
@@ -2575,12 +3100,22 @@ class InlineHtmlAnnotation extends Annotation {
|
|
|
2575
3100
|
clone() {
|
|
2576
3101
|
var _a, _b, _c, _d;
|
|
2577
3102
|
const inlineHtmlAnnotation = new InlineHtmlAnnotation(this.htmlTag);
|
|
3103
|
+
inlineHtmlAnnotation.groupId = this.groupId;
|
|
2578
3104
|
inlineHtmlAnnotation.child = (_a = this.child) === null || _a === void 0 ? void 0 : _a.clone();
|
|
2579
3105
|
inlineHtmlAnnotation.customAttribute = (_b = this.customAttribute) === null || _b === void 0 ? void 0 : _b.clone();
|
|
2580
3106
|
inlineHtmlAnnotation.customClass = (_c = this.customClass) === null || _c === void 0 ? void 0 : _c.clone();
|
|
2581
3107
|
inlineHtmlAnnotation.customStyle = (_d = this.customStyle) === null || _d === void 0 ? void 0 : _d.clone();
|
|
2582
3108
|
return inlineHtmlAnnotation;
|
|
2583
3109
|
}
|
|
3110
|
+
/**
|
|
3111
|
+
* Build the props object used when rendering this annotation.
|
|
3112
|
+
*
|
|
3113
|
+
* @returns {Record<string, unknown>} Props for h(tag, props, children).
|
|
3114
|
+
*/
|
|
3115
|
+
renderProps() {
|
|
3116
|
+
var _a, _b, _c;
|
|
3117
|
+
return Object.assign(Object.assign({}, (_a = this.customAttribute) === null || _a === void 0 ? void 0 : _a.render()), { style: (_b = this.customStyle) === null || _b === void 0 ? void 0 : _b.renderStyle(), class: (_c = this.customClass) === null || _c === void 0 ? void 0 : _c.renderClass().join(' ') });
|
|
3118
|
+
}
|
|
2584
3119
|
/**
|
|
2585
3120
|
* Generate the JSON representation of the annotation
|
|
2586
3121
|
*
|
|
@@ -2591,6 +3126,7 @@ class InlineHtmlAnnotation extends Annotation {
|
|
|
2591
3126
|
return {
|
|
2592
3127
|
inlineHtml: cleanObject({
|
|
2593
3128
|
htmlTag: this.htmlTag,
|
|
3129
|
+
groupId: this.groupId,
|
|
2594
3130
|
child: (_a = this.child) === null || _a === void 0 ? void 0 : _a.toJSON().inlineHtml,
|
|
2595
3131
|
customAttribute: (_b = this.customAttribute) === null || _b === void 0 ? void 0 : _b.toJSON().customAttribute,
|
|
2596
3132
|
customClass: (_c = this.customClass) === null || _c === void 0 ? void 0 : _c.toJSON().customClass,
|
|
@@ -2829,9 +3365,11 @@ class RTETextNode extends RTENode {
|
|
|
2829
3365
|
/**
|
|
2830
3366
|
* @inheritDoc
|
|
2831
3367
|
*/
|
|
2832
|
-
toHtml() {
|
|
3368
|
+
toHtml(options) {
|
|
2833
3369
|
const inlineHtmlAnnotation = this.getAnnotationByType(NodeAnnotationTypeEnum.INLINE_HTML);
|
|
2834
|
-
return inlineHtmlAnnotation
|
|
3370
|
+
return inlineHtmlAnnotation
|
|
3371
|
+
? this.renderWithWrapperStr(inlineHtmlAnnotation, options)
|
|
3372
|
+
: this.renderTextStr(options);
|
|
2835
3373
|
}
|
|
2836
3374
|
/**
|
|
2837
3375
|
* Creates a new RTETextNode with the specified text and copies the parent block and annotation map from the original node.
|
|
@@ -2856,6 +3394,9 @@ class RTETextNode extends RTENode {
|
|
|
2856
3394
|
* @returns {boolean} It returns `true` if the node is empty
|
|
2857
3395
|
*/
|
|
2858
3396
|
isEmpty() {
|
|
3397
|
+
// Inline HTML annotations (e.g., <br>) are considered non-empty even with empty text content.
|
|
3398
|
+
if (this.getAnnotationByType(NodeAnnotationTypeEnum.INLINE_HTML))
|
|
3399
|
+
return false;
|
|
2859
3400
|
return !this.text || this.text === ZERO_WIDTH_SPACE || this.text === '\n';
|
|
2860
3401
|
}
|
|
2861
3402
|
/**
|
|
@@ -2895,6 +3436,54 @@ class RTETextNode extends RTENode {
|
|
|
2895
3436
|
isContentEditable() {
|
|
2896
3437
|
return true;
|
|
2897
3438
|
}
|
|
3439
|
+
/**
|
|
3440
|
+
* Returns the inline HTML wrapper descriptor at the given depth in the
|
|
3441
|
+
* annotation chain. Depth 0 is the outermost wrapper, depth 1 is its child, etc.
|
|
3442
|
+
*
|
|
3443
|
+
* @param {number} depth - Zero-based depth in the inline HTML chain.
|
|
3444
|
+
* @returns {InlineHtmlTagDescriptor | null} The wrapper descriptor at that depth, or `null`.
|
|
3445
|
+
*/
|
|
3446
|
+
getInlineHtmlTagAtDepth(depth) {
|
|
3447
|
+
const annotation = this.getInlineHtmlAnnotationAtDepth(depth);
|
|
3448
|
+
if (!annotation)
|
|
3449
|
+
return null;
|
|
3450
|
+
if (HTML_VOID_TAGS.has(annotation.htmlTag))
|
|
3451
|
+
return null;
|
|
3452
|
+
return {
|
|
3453
|
+
htmlTag: annotation.htmlTag,
|
|
3454
|
+
attrStr: this.annotationAttrStr(annotation),
|
|
3455
|
+
groupId: annotation.groupId,
|
|
3456
|
+
annotation,
|
|
3457
|
+
};
|
|
3458
|
+
}
|
|
3459
|
+
/**
|
|
3460
|
+
* Renders the node starting from the given depth in the inline HTML chain.
|
|
3461
|
+
* Depth 0 renders the full chain (equivalent to {@link toHtml} for inline HTML nodes).
|
|
3462
|
+
*
|
|
3463
|
+
* @param {number} depth - Zero-based depth to start rendering from.
|
|
3464
|
+
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
|
|
3465
|
+
* @returns {string} HTML string from that depth onward.
|
|
3466
|
+
*/
|
|
3467
|
+
renderHtmlFromDepth(depth, options) {
|
|
3468
|
+
const annotation = this.getInlineHtmlAnnotationAtDepth(depth);
|
|
3469
|
+
if (!annotation)
|
|
3470
|
+
return this.renderTextStr(options);
|
|
3471
|
+
return this.renderWithWrapperStr(annotation, options);
|
|
3472
|
+
}
|
|
3473
|
+
/**
|
|
3474
|
+
* Traverses the inline HTML annotation chain to the given depth and returns
|
|
3475
|
+
* the annotation at that level, or `null` if the chain is shorter.
|
|
3476
|
+
*
|
|
3477
|
+
* @param {number} depth - Zero-based depth (0 = outermost annotation).
|
|
3478
|
+
* @returns {Nullable<InlineHtmlAnnotation>} The annotation at that depth, or `null`.
|
|
3479
|
+
*/
|
|
3480
|
+
getInlineHtmlAnnotationAtDepth(depth) {
|
|
3481
|
+
let current = this.getAnnotationByType(NodeAnnotationTypeEnum.INLINE_HTML);
|
|
3482
|
+
for (let i = 0; i < depth && current; i++) {
|
|
3483
|
+
current = current.child;
|
|
3484
|
+
}
|
|
3485
|
+
return current;
|
|
3486
|
+
}
|
|
2898
3487
|
/**
|
|
2899
3488
|
* Registers the action strategies for the RTETextNode.
|
|
2900
3489
|
*/
|
|
@@ -2993,35 +3582,51 @@ class RTETextNode extends RTENode {
|
|
|
2993
3582
|
}
|
|
2994
3583
|
}
|
|
2995
3584
|
/**
|
|
2996
|
-
*
|
|
2997
|
-
*
|
|
2998
|
-
* @param {VegaInlineHtmlSchema} inlineHtmlNode - The inline HTML schema to wrap the text node.
|
|
3585
|
+
* @param {InlineHtmlAnnotation} inlineHtmlNode - The inline HTML annotation to wrap the text node.
|
|
3586
|
+
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
|
|
2999
3587
|
* @returns {string} The HTML string representation of the text node wrapped with the inline HTML.
|
|
3000
3588
|
*/
|
|
3001
|
-
renderWithWrapperStr(inlineHtmlNode) {
|
|
3002
|
-
const { htmlTag,
|
|
3589
|
+
renderWithWrapperStr(inlineHtmlNode, options) {
|
|
3590
|
+
const { htmlTag, child } = inlineHtmlNode;
|
|
3591
|
+
const attrStr = this.annotationAttrStr(inlineHtmlNode);
|
|
3592
|
+
if (!child) {
|
|
3593
|
+
if (HTML_VOID_TAGS.has(htmlTag)) {
|
|
3594
|
+
return `<${htmlTag}${attrStr}>`;
|
|
3595
|
+
}
|
|
3596
|
+
if (!this.text) {
|
|
3597
|
+
return `<${htmlTag}${attrStr}></${htmlTag}>`;
|
|
3598
|
+
}
|
|
3599
|
+
return `<${htmlTag}${attrStr}>${this.renderTextStr(options)}</${htmlTag}>`;
|
|
3600
|
+
}
|
|
3601
|
+
return `<${htmlTag}${attrStr}>${this.renderWithWrapperStr(child, options)}</${htmlTag}>`;
|
|
3602
|
+
}
|
|
3603
|
+
/**
|
|
3604
|
+
* Generate the attribute string for the inline HTML annotation
|
|
3605
|
+
*
|
|
3606
|
+
* @param {InlineHtmlAnnotation} annotation - The inline HTML annotation
|
|
3607
|
+
* @returns {string} The attribute string for the inline HTML annotation
|
|
3608
|
+
*/
|
|
3609
|
+
annotationAttrStr(annotation) {
|
|
3610
|
+
const { customAttribute, customClass, customStyle } = annotation;
|
|
3003
3611
|
const attrs = [
|
|
3004
3612
|
...((customAttribute === null || customAttribute === void 0 ? void 0 : customAttribute.toString()) || []),
|
|
3005
3613
|
customClass === null || customClass === void 0 ? void 0 : customClass.toString(),
|
|
3006
3614
|
customStyle === null || customStyle === void 0 ? void 0 : customStyle.toString(),
|
|
3007
3615
|
].filter(isNonNullable);
|
|
3008
|
-
|
|
3009
|
-
if (!child) {
|
|
3010
|
-
return `<${htmlTag}${attrStr}>${this.renderTextStr()}</${htmlTag}>`;
|
|
3011
|
-
}
|
|
3012
|
-
return `<${htmlTag}${attrStr}>${this.renderWithWrapperStr(child)}</${htmlTag}>`;
|
|
3616
|
+
return attrs.length > 0 ? ` ${attrs.join(' ')}` : '';
|
|
3013
3617
|
}
|
|
3014
3618
|
/**
|
|
3015
3619
|
* Generates the HTML representation of the text node.
|
|
3016
3620
|
*
|
|
3621
|
+
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
|
|
3017
3622
|
* @returns {string} The HTML string representation of the text node.
|
|
3018
3623
|
*/
|
|
3019
|
-
renderTextStr() {
|
|
3624
|
+
renderTextStr(options) {
|
|
3020
3625
|
var _a;
|
|
3021
3626
|
const NodeTag = ((_a = this.getAnnotationByType(NodeAnnotationTypeEnum.CODE)) === null || _a === void 0 ? void 0 : _a.code)
|
|
3022
3627
|
? 'code'
|
|
3023
3628
|
: 'span';
|
|
3024
|
-
const attrStr = super.generateAttributeString();
|
|
3629
|
+
const attrStr = super.generateAttributeString(options);
|
|
3025
3630
|
// If the text contains a newline character, we need to replace it with a <br> tag.
|
|
3026
3631
|
if (this.text === '\n') {
|
|
3027
3632
|
return `<br>`;
|
|
@@ -3757,10 +4362,10 @@ class RTETextBlock extends RTEBlock {
|
|
|
3757
4362
|
/**
|
|
3758
4363
|
* @inheritDoc
|
|
3759
4364
|
*/
|
|
3760
|
-
toHtml() {
|
|
4365
|
+
toHtml(options) {
|
|
3761
4366
|
const BlockTag = this.getBlockTag();
|
|
3762
|
-
const attrStr = super.generateAttributeString();
|
|
3763
|
-
const nodesHtml = this.getChildrenHtml();
|
|
4367
|
+
const attrStr = super.generateAttributeString(options);
|
|
4368
|
+
const nodesHtml = this.getChildrenHtml(options);
|
|
3764
4369
|
return super.shouldRenderAsInternalWrapper()
|
|
3765
4370
|
? nodesHtml
|
|
3766
4371
|
: [`<${BlockTag}${attrStr}>`, nodesHtml, `</${BlockTag}>`].join('');
|
|
@@ -3829,13 +4434,14 @@ class RTETextBlock extends RTEBlock {
|
|
|
3829
4434
|
/**
|
|
3830
4435
|
* Get the HTML string for the children nodes, including handling link group annotations.
|
|
3831
4436
|
*
|
|
4437
|
+
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the children nodes are rendered as HTML.
|
|
3832
4438
|
* @returns {string} The HTML string representing the children nodes.
|
|
3833
4439
|
*/
|
|
3834
|
-
getChildrenHtml() {
|
|
4440
|
+
getChildrenHtml(options) {
|
|
3835
4441
|
const linkGroupAnnotation = this.getAnnotationByType(InternalAnnotationTypeEnum.LINK_GROUP);
|
|
3836
|
-
let nodesHtml = this.children
|
|
4442
|
+
let nodesHtml = this.renderGroupedNodesAtDepth(this.children, 0, options);
|
|
3837
4443
|
if (linkGroupAnnotation && this.children.length > 0) {
|
|
3838
|
-
nodesHtml = this.generateLinkHtml(linkGroupAnnotation, nodesHtml);
|
|
4444
|
+
nodesHtml = this.generateLinkHtml(linkGroupAnnotation, nodesHtml, options);
|
|
3839
4445
|
}
|
|
3840
4446
|
return nodesHtml;
|
|
3841
4447
|
}
|
|
@@ -3848,14 +4454,53 @@ class RTETextBlock extends RTEBlock {
|
|
|
3848
4454
|
strategy.execute(action, this);
|
|
3849
4455
|
}
|
|
3850
4456
|
}
|
|
4457
|
+
/**
|
|
4458
|
+
* Recursively groups `nodes` by their inline HTML wrapper at the given
|
|
4459
|
+
* `depth`, emitting shared wrappers for adjacent siblings with the same
|
|
4460
|
+
* `groupId` and descending into the next depth for each group.
|
|
4461
|
+
*
|
|
4462
|
+
* @param {RTETextNode[]} nodes - The nodes to render.
|
|
4463
|
+
* @param {number} depth - Current depth in the inline HTML chain (0 = outermost).
|
|
4464
|
+
* @param {VegaRTETransformOptions} [options] - Optional conversion options.
|
|
4465
|
+
* @returns {string} HTML string with grouped wrappers at this depth.
|
|
4466
|
+
*/
|
|
4467
|
+
renderGroupedNodesAtDepth(nodes, depth, options) {
|
|
4468
|
+
var _a;
|
|
4469
|
+
let result = '';
|
|
4470
|
+
let i = 0;
|
|
4471
|
+
while (i < nodes.length) {
|
|
4472
|
+
const tag = nodes[i].getInlineHtmlTagAtDepth(depth);
|
|
4473
|
+
if (!(tag === null || tag === void 0 ? void 0 : tag.groupId)) {
|
|
4474
|
+
result += nodes[i].renderHtmlFromDepth(depth, options);
|
|
4475
|
+
i++;
|
|
4476
|
+
continue;
|
|
4477
|
+
}
|
|
4478
|
+
let groupEnd = i + 1;
|
|
4479
|
+
while (groupEnd < nodes.length &&
|
|
4480
|
+
((_a = nodes[groupEnd].getInlineHtmlTagAtDepth(depth)) === null || _a === void 0 ? void 0 : _a.groupId) === tag.groupId) {
|
|
4481
|
+
groupEnd++;
|
|
4482
|
+
}
|
|
4483
|
+
if (groupEnd === i + 1) {
|
|
4484
|
+
// Single node in group — render normally.
|
|
4485
|
+
result += nodes[i].renderHtmlFromDepth(depth, options);
|
|
4486
|
+
}
|
|
4487
|
+
else {
|
|
4488
|
+
const innerHtml = this.renderGroupedNodesAtDepth(nodes.slice(i, groupEnd), depth + 1, options);
|
|
4489
|
+
result += `<${tag.htmlTag}${tag.attrStr}>${innerHtml}</${tag.htmlTag}>`;
|
|
4490
|
+
}
|
|
4491
|
+
i = groupEnd;
|
|
4492
|
+
}
|
|
4493
|
+
return result;
|
|
4494
|
+
}
|
|
3851
4495
|
/**
|
|
3852
4496
|
* Generate Link Html
|
|
3853
4497
|
*
|
|
3854
4498
|
* @param {LinkGroupAnnotation} linkGroupAnnotation - linkGroupAnnotation
|
|
3855
4499
|
* @param {string} nodesHtml - The nodes html
|
|
4500
|
+
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the children nodes are rendered as HTML.
|
|
3856
4501
|
* @returns {string} link html
|
|
3857
4502
|
*/
|
|
3858
|
-
generateLinkHtml(linkGroupAnnotation, nodesHtml) {
|
|
4503
|
+
generateLinkHtml(linkGroupAnnotation, nodesHtml, options) {
|
|
3859
4504
|
nodesHtml = '';
|
|
3860
4505
|
let linkGroupNodes = [];
|
|
3861
4506
|
for (let i = 0; i < this.children.length; i++) {
|
|
@@ -3869,17 +4514,18 @@ class RTETextBlock extends RTEBlock {
|
|
|
3869
4514
|
currentLinkAnnotation.link.groupKey !== nextLinkAnnotation.link.groupKey) {
|
|
3870
4515
|
const linkAttributes = linkGroupAnnotation.toString(currentLinkAnnotation, {
|
|
3871
4516
|
standalone: true,
|
|
4517
|
+
filterInlineStyles: options === null || options === void 0 ? void 0 : options.filterInlineStyles,
|
|
3872
4518
|
});
|
|
3873
4519
|
nodesHtml += [
|
|
3874
4520
|
`<a${linkAttributes ? ` ${linkAttributes}` : ''}>`,
|
|
3875
|
-
|
|
4521
|
+
this.renderGroupedNodesAtDepth(linkGroupNodes, 0, options),
|
|
3876
4522
|
`</a>`,
|
|
3877
4523
|
].join('');
|
|
3878
4524
|
linkGroupNodes = [];
|
|
3879
4525
|
}
|
|
3880
4526
|
}
|
|
3881
4527
|
else {
|
|
3882
|
-
nodesHtml += this.children[i].toHtml();
|
|
4528
|
+
nodesHtml += this.children[i].toHtml(options);
|
|
3883
4529
|
}
|
|
3884
4530
|
}
|
|
3885
4531
|
return nodesHtml;
|
|
@@ -4255,6 +4901,52 @@ RTEDecoratorNode.DECORATOR_CONTAINER_CLASS = 'v-internal-decorator-container';
|
|
|
4255
4901
|
// CSS class names for the decorator node element
|
|
4256
4902
|
RTEDecoratorNode.DECORATOR_NODE_CLASS = 'v-internal-decorator-node';
|
|
4257
4903
|
|
|
4904
|
+
/**
|
|
4905
|
+
* Filter styles strategy for code block node, which defines the styles to be filtered and the conditions for filtering and refilling styles for code block nodes.
|
|
4906
|
+
*/
|
|
4907
|
+
class CodeBlockNodeFilterStylesStrategy extends RTEFilterStylesStrategy {
|
|
4908
|
+
constructor() {
|
|
4909
|
+
super(...arguments);
|
|
4910
|
+
this.stylesToBeFiltered = CodeBlockNodeFilterStylesStrategy.STYLES;
|
|
4911
|
+
this.elementTagName = 'pre code';
|
|
4912
|
+
}
|
|
4913
|
+
/**
|
|
4914
|
+
* @inheritDoc
|
|
4915
|
+
*/
|
|
4916
|
+
canFilter(blockOrNodeInstance) {
|
|
4917
|
+
return Predicate.isCodeBlockNode(blockOrNodeInstance);
|
|
4918
|
+
}
|
|
4919
|
+
/**
|
|
4920
|
+
* The code node styles is preset and will convert to vega-code-block element so we don't need to to refill styles back to element.
|
|
4921
|
+
*
|
|
4922
|
+
* @param {string} _blockOrNodeClassName The class name of the block or node.
|
|
4923
|
+
* @param {HTMLElement} _element The HTML element to check.
|
|
4924
|
+
* @returns {boolean} False, as we don't need to refill styles for code nodes.
|
|
4925
|
+
*/
|
|
4926
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4927
|
+
canRefill(_blockOrNodeClassName, _element) {
|
|
4928
|
+
return false;
|
|
4929
|
+
}
|
|
4930
|
+
/**
|
|
4931
|
+
* @inheritDoc
|
|
4932
|
+
*/
|
|
4933
|
+
toCssText() {
|
|
4934
|
+
return this.buildCssTextForStyles(this.elementTagName, this.classNameToBeAdded);
|
|
4935
|
+
}
|
|
4936
|
+
}
|
|
4937
|
+
CodeBlockNodeFilterStylesStrategy.STYLES = {
|
|
4938
|
+
boxSizing: 'border-box',
|
|
4939
|
+
color: 'rgba(var(--v-text-primary, 32, 54, 69, 1))',
|
|
4940
|
+
textAlign: 'left',
|
|
4941
|
+
fontFamily: '"Roboto Mono"',
|
|
4942
|
+
fontWeight: '400',
|
|
4943
|
+
lineHeight: '22px',
|
|
4944
|
+
fontSize: '16px',
|
|
4945
|
+
whiteSpace: 'pre-wrap',
|
|
4946
|
+
minHeight: '22px',
|
|
4947
|
+
tabSize: '2px',
|
|
4948
|
+
};
|
|
4949
|
+
|
|
4258
4950
|
/**
|
|
4259
4951
|
* RTE code node DTO class.
|
|
4260
4952
|
*/
|
|
@@ -4267,6 +4959,7 @@ class RTECodeBlockNode extends RTEDecoratorNode {
|
|
|
4267
4959
|
this.text = content;
|
|
4268
4960
|
this.parent = parentBlock;
|
|
4269
4961
|
this.language = language;
|
|
4962
|
+
this.annotationMap.set(CommonAnnotationTypeEnum.CUSTOM_STYLE, new CustomStyleAnnotation(CodeBlockNodeFilterStylesStrategy.STYLES));
|
|
4270
4963
|
}
|
|
4271
4964
|
/**
|
|
4272
4965
|
* The code node toJSON method will called internal.
|
|
@@ -4279,8 +4972,9 @@ class RTECodeBlockNode extends RTEDecoratorNode {
|
|
|
4279
4972
|
/**
|
|
4280
4973
|
* @inheritDoc
|
|
4281
4974
|
*/
|
|
4282
|
-
toHtml() {
|
|
4283
|
-
|
|
4975
|
+
toHtml(options) {
|
|
4976
|
+
const attrs = this.generateAttributeString(options);
|
|
4977
|
+
return `<code${attrs}>${this.text}</code>`;
|
|
4284
4978
|
}
|
|
4285
4979
|
/**
|
|
4286
4980
|
* @inheritDoc
|
|
@@ -4359,6 +5053,44 @@ class RemoveChildrenStrategy extends ActionHandleStrategy {
|
|
|
4359
5053
|
}
|
|
4360
5054
|
}
|
|
4361
5055
|
|
|
5056
|
+
/**
|
|
5057
|
+
* Filter styles strategy for code block, which defines the styles to be filtered and the conditions for filtering and refilling styles for code blocks.
|
|
5058
|
+
*/
|
|
5059
|
+
class CodeBlockFilterStylesStrategy extends RTEFilterStylesStrategy {
|
|
5060
|
+
constructor() {
|
|
5061
|
+
super(...arguments);
|
|
5062
|
+
this.stylesToBeFiltered = CodeBlockFilterStylesStrategy.STYLES;
|
|
5063
|
+
this.elementTagName = 'pre';
|
|
5064
|
+
}
|
|
5065
|
+
/**
|
|
5066
|
+
* @inheritDoc
|
|
5067
|
+
*/
|
|
5068
|
+
canFilter(blockOrNodeInstance) {
|
|
5069
|
+
return Predicate.isCodeBlock(blockOrNodeInstance.constructor.name);
|
|
5070
|
+
}
|
|
5071
|
+
/**
|
|
5072
|
+
* The code block styles is preset and will convert to vega-code-block element so we don't need to to refill styles back to element.
|
|
5073
|
+
*
|
|
5074
|
+
* @param {string} _blockOrNodeClassName The class name of the block or node.
|
|
5075
|
+
* @param {HTMLElement} _element The HTML element to check.
|
|
5076
|
+
* @returns {boolean} False, as we don't need to refill styles for code blocks.
|
|
5077
|
+
*/
|
|
5078
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5079
|
+
canRefill(_blockOrNodeClassName, _element) {
|
|
5080
|
+
return false;
|
|
5081
|
+
}
|
|
5082
|
+
/**
|
|
5083
|
+
* @inheritDoc
|
|
5084
|
+
*/
|
|
5085
|
+
toCssText() {
|
|
5086
|
+
return this.buildCssTextForStyles(this.elementTagName, this.classNameToBeAdded);
|
|
5087
|
+
}
|
|
5088
|
+
}
|
|
5089
|
+
CodeBlockFilterStylesStrategy.STYLES = {
|
|
5090
|
+
backgroundColor: 'rgba(var(--v-bg-secondary, 245, 247, 247, 1))',
|
|
5091
|
+
padding: '12px',
|
|
5092
|
+
};
|
|
5093
|
+
|
|
4362
5094
|
/**
|
|
4363
5095
|
* The code block DTO class.
|
|
4364
5096
|
*/
|
|
@@ -4366,6 +5098,7 @@ class RTECodeBlock extends RTEBlock {
|
|
|
4366
5098
|
constructor(id, content, language) {
|
|
4367
5099
|
super(id);
|
|
4368
5100
|
this.type = 'code-block';
|
|
5101
|
+
this.annotationMap = new Map([CustomStyleAnnotation.from(CodeBlockFilterStylesStrategy.STYLES)]);
|
|
4369
5102
|
this.children = [new RTECodeBlockNode(`${id}-1`, content, language, this)];
|
|
4370
5103
|
}
|
|
4371
5104
|
/**
|
|
@@ -4392,9 +5125,10 @@ class RTECodeBlock extends RTEBlock {
|
|
|
4392
5125
|
/**
|
|
4393
5126
|
* @inheritDoc
|
|
4394
5127
|
*/
|
|
4395
|
-
toHtml() {
|
|
5128
|
+
toHtml(options) {
|
|
4396
5129
|
const { language = CodeLanguage['Plain Text'] } = this.children[0];
|
|
4397
|
-
|
|
5130
|
+
const attrStr = super.generateAttributeString(options);
|
|
5131
|
+
return `<pre data-language="${language}"${attrStr}>${this.children.map((node) => node.toHtml(options))}</pre>`;
|
|
4398
5132
|
}
|
|
4399
5133
|
/**
|
|
4400
5134
|
* @inheritDoc
|
|
@@ -4452,4 +5186,4 @@ class RTECodeBlock extends RTEBlock {
|
|
|
4452
5186
|
})();
|
|
4453
5187
|
RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME = 'code-block-placeholder-element';
|
|
4454
5188
|
|
|
4455
|
-
export {
|
|
5189
|
+
export { RTE_DEFAULT_TEXT_COLOR as $, ActionHandleStrategyRegistry as A, BlockAnnotation as B, CommonAnnotationTypeEnum as C, CustomClassAnnotation as D, RTECodeBlock as E, NodeAnnotationTypeEnum as F, RTEDecoratorNode as G, HorizontalAlignmentAnnotationAction as H, InsertChildrenAfterAction as I, NodeTypeEnum as J, CommonAnnotation as K, ReplaceChildNodesAction as L, ModifyContentAction as M, NodeAnnotation as N, SplitBlockWithNodeAction as O, HTML_VOID_TAGS as P, BlockDeleteNodeContentStrategy as Q, RTEFilterStylesStrategyRegistry as R, SyncUpSelectionAction as S, TextStyleAnnotationAction as T, UpdateTextAction as U, VegaRTEPresetToolbarItems as V, RemoveChildrenStrategy as W, BOLD_FONT_WEIGHT_KEYWORD as X, BOLD_FONT_WEIGHT as Y, createStyleMapFromElement as Z, RTE_TEXT_COLORS as _, ActionHandlerInterceptorRegistry as a, ITALIC_FONT_STYLE as a0, STRIKETHROUGH_TEXT_DECORATION as a1, UNDERLINE_TEXT_DECORATION as a2, TextStyleAnnotation as a3, Predicate as a4, HorizontalAlignmentAnnotation as a5, CodeAnnotation as a6, LinkFilterStylesStrategy as a7, CodeBlockFilterStylesStrategy as a8, RTECodeBlockNode as a9, CodeBlockNodeFilterStylesStrategy as aa, CodeLanguage as ab, ZERO_WIDTH_SPACE as ac, LinkAnnotationAction as ad, UpdateCodeBlockAction as ae, SelectionChangeAction as af, TextColorAnnotationAction as ag, BoldAnnotationAction as ah, ItalicAnnotationAction as ai, UnderlineAnnotationAction as aj, BoldAnnotation as ak, ClearFormattingAnnotationAction as al, CodeAnnotationAction as am, StrikethroughAnnotationAction as an, IndentAnnotationAction as ao, RTEDTOClassManager$1 as b, RTETextNode as c, RTEBlock as d, RTETextBlock as e, RTEAnnotationStyle as f, ActionHandleStrategy as g, AppendChildrenAction as h, RTENode as i, InsertChildrenBeforeAction as j, InternalAnnotationTypeEnum as k, ModifyContentActionType as l, AnnotationAction as m, RemoveChildrenAction as n, CustomAttributeAnnotation as o, RTEFilterStylesStrategy as p, BlockUpdateTextStyleStrategy as q, BlockUpdateHorizontalAlignmentStrategy as r, stateEntityRenderingRegistry as s, BlockInsertLineBreakStrategy as t, BlockInsertLineBreakWithBlocksStrategy as u, BlockSplitWithTextNodeStrategy as v, BlockReplaceNodesStrategy as w, BlockMergeNodesStrategy as x, BlockAnnotationTypeEnum as y, CustomStyleAnnotation as z };
|