@heartlandone/vega 2.34.0 → 2.35.0-RTE-preview
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-4e819773.js → app-globals-fb3693cc.js} +22 -21
- package/dist/cjs/{change-manager-bda1d107.js → change-manager-a297e4d2.js} +1 -1
- package/dist/cjs/{child-nodes-event-prevent-slimmer-e1a6e5ad.js → child-nodes-event-prevent-slimmer-96c3c4ae.js} +3 -3
- package/dist/cjs/{child-nodes-notify-observer-slimmer-03a3f79e.js → child-nodes-notify-observer-slimmer-be92f366.js} +5 -5
- package/dist/cjs/{component-63af66ea.js → component-73a88c4e.js} +1 -1
- package/dist/cjs/{component-global-style-slimmer-6b64a26c.js → component-global-style-slimmer-6749808c.js} +1 -1
- package/dist/cjs/{component-usage-runtime-metrics-019d3c00.js → component-usage-runtime-metrics-dcb32c24.js} +1 -1
- package/dist/cjs/content-state-3e4467a3.js +134 -0
- package/dist/cjs/{create-public-api-runtime-metrics-slimmer-8c6a8fb7.js → create-public-api-runtime-metrics-slimmer-54c3f73b.js} +2 -2
- package/dist/cjs/{date-ffe382a4.js → date-0a6bb035.js} +1 -1
- package/dist/cjs/{deprecated-property-slimmer-f36e3779.js → deprecated-property-slimmer-fc729fd9.js} +2 -2
- package/dist/cjs/{design-token-908e3f69.js → design-token-30c069c1.js} +3 -3
- package/dist/cjs/{dom-node-subject-observer-factory-093462f1.js → dom-node-subject-factory-3ec114b8.js} +1 -41
- package/dist/cjs/dom-node-subject-observer-factory-5f0eae19.js +44 -0
- package/dist/cjs/{dynamic-slimmer-dc30600a.js → dynamic-slimmer-f31fdfd7.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-0dd70e61.js → element-appender-slimmer-700b7004.js} +6 -6
- package/dist/cjs/{event-emit-slimmer-a46bb411.js → event-emit-slimmer-9c223f73.js} +7 -6
- package/dist/cjs/{feature-flag-controller-e97b5f29.js → feature-flag-controller-7b22e598.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-9aeabcdc.js → form-field-controller-slimmer-7ef32059.js} +16 -15
- package/dist/cjs/global-slimmer-registry-b3bce7e0.js +297 -0
- package/dist/cjs/{icon-manager-36dcfb65.js → icon-manager-edc2400b.js} +2 -2
- package/dist/cjs/{text-color-toolbar-button-slimmer-b1c9f40e.js → image-annotation-action-d3e1699c.js} +78 -27
- package/dist/cjs/{global-slimmer-registry-dd2691b8.js → index-09acd3c9.js} +282 -296
- package/dist/cjs/index.cjs.js +27 -28
- package/dist/cjs/{inject-keyboard-manager-af37c861.js → inject-keyboard-manager-4a5c27a2.js} +1 -1
- package/dist/cjs/{internal-icon-manager-2282a62f.js → internal-icon-manager-5ccb9443.js} +1 -1
- package/dist/cjs/{internal-vega-event-manager-d7643ec6.js → internal-vega-event-manager-e5e4bcf4.js} +72 -72
- package/dist/cjs/{internal-vega-z-index-manager-e24e4309.js → internal-vega-z-index-manager-f03ddb37.js} +1 -1
- package/dist/cjs/{keyboard-manager-5afbc8f1.js → keyboard-manager-2df53b2f.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-9be2a880.js → keyboard-manager-slimmer-feba3a83.js} +2 -2
- package/dist/cjs/{content-state-3a2724f6.js → list-block-91116257.js} +1393 -679
- package/dist/cjs/loader.cjs.js +21 -21
- package/dist/cjs/{mutation-observer-slimmer-98bbbdf0.js → mutation-observer-slimmer-895b3d3e.js} +1 -1
- package/dist/cjs/{node.abstract-f8075f84.js → node-annotation.abstract-e5d3a859.js} +37 -48
- package/dist/cjs/{page-resize-observer-slimmer-e54fa9d4.js → page-resize-observer-slimmer-bb1eaebe.js} +1 -1
- package/dist/cjs/{remote-invocation-registry-71a45468.js → remote-invocation-registry-ff9af278.js} +3 -3
- package/dist/cjs/{responsive-format-facade-74079f1b.js → responsive-format-facade-4363a00d.js} +1 -1
- package/dist/cjs/{state-background-color-formatter-d32a1098.js → state-background-color-formatter-e585a027.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-297765c0.js → string-input-formatter-slimmer-6155c9f5.js} +1 -1
- package/dist/cjs/{style-formatter-5deb065f.js → style-formatter-63218b76.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-73201c53.js → sub-state-notify-slimmer-c2e08e06.js} +8 -8
- package/dist/cjs/{sub-state-observer-slimmer-10c0d402.js → sub-state-observer-slimmer-b97e46b5.js} +8 -8
- package/dist/cjs/{translation-f6b7ee84.js → translation-b9be41e0.js} +3 -3
- package/dist/cjs/{translation-slimmer-90f9f71f.js → translation-slimmer-ec76c5a2.js} +2 -2
- package/dist/cjs/{ui-b5906704.js → ui-5fd9b267.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +41 -39
- package/dist/cjs/vega-app-footer.cjs.entry.js +13 -12
- package/dist/cjs/vega-app-header-button.cjs.entry.js +42 -40
- package/dist/cjs/vega-backdrop.cjs.entry.js +9 -8
- package/dist/cjs/vega-banner.cjs.entry.js +36 -34
- package/dist/cjs/vega-bar-chart.cjs.entry.js +6 -5
- package/dist/cjs/vega-box.cjs.entry.js +13 -12
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +34 -32
- package/dist/cjs/vega-button-circle.cjs.entry.js +25 -23
- package/dist/cjs/vega-button-group_2.cjs.entry.js +32 -30
- package/dist/cjs/vega-button-link.cjs.entry.js +26 -24
- package/dist/cjs/vega-button.cjs.entry.js +26 -24
- package/dist/cjs/vega-calendar_3.cjs.entry.js +135 -133
- package/dist/cjs/vega-card.cjs.entry.js +11 -10
- package/dist/cjs/vega-carousel.cjs.entry.js +25 -23
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +46 -44
- package/dist/cjs/vega-chip.cjs.entry.js +36 -34
- package/dist/cjs/vega-color-picker.cjs.entry.js +26 -24
- package/dist/cjs/vega-combo-box.cjs.entry.js +46 -44
- package/dist/cjs/vega-counter-badge.cjs.entry.js +10 -9
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +56 -54
- package/dist/cjs/{vega-dialog-controller-aaf1f43e.js → vega-dialog-controller-fe610705.js} +2 -2
- package/dist/cjs/vega-dialog_2.cjs.entry.js +47 -45
- package/dist/cjs/vega-divider.cjs.entry.js +11 -10
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +132 -130
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-error.cjs.entry.js +8 -7
- package/dist/cjs/vega-field-label.cjs.entry.js +22 -20
- package/dist/cjs/vega-file-uploader.cjs.entry.js +67 -65
- package/dist/cjs/vega-flex.cjs.entry.js +14 -13
- package/dist/cjs/vega-font.cjs.entry.js +14 -13
- package/dist/cjs/vega-form.cjs.entry.js +38 -36
- package/dist/cjs/vega-grid.cjs.entry.js +11 -10
- package/dist/cjs/vega-hint.cjs.entry.js +7 -6
- package/dist/cjs/vega-icon.cjs.entry.js +16 -15
- package/dist/cjs/vega-image-uploader.cjs.entry.js +51 -49
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +37 -35
- package/dist/cjs/vega-input-numeric.cjs.entry.js +30 -28
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +49 -47
- package/dist/cjs/vega-input-range.cjs.entry.js +40 -38
- package/dist/cjs/vega-input-select.cjs.entry.js +62 -60
- package/dist/cjs/vega-input.cjs.entry.js +46 -44
- package/dist/cjs/vega-item-toggle.cjs.entry.js +21 -19
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +102 -100
- package/dist/cjs/vega-line-chart.cjs.entry.js +7 -6
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +16 -15
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +20 -18
- package/dist/cjs/vega-pagination.cjs.entry.js +57 -52
- package/dist/cjs/vega-pie-chart.cjs.entry.js +7 -6
- package/dist/cjs/vega-popover_2.cjs.entry.js +34 -32
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +29 -27
- package/dist/cjs/vega-radio_2.cjs.entry.js +50 -48
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +321 -23
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +952 -737
- package/dist/cjs/vega-section-title.cjs.entry.js +15 -14
- package/dist/cjs/vega-segment-control.cjs.entry.js +24 -22
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +49 -47
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +61 -59
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +46 -44
- package/dist/cjs/vega-signature-capture.cjs.entry.js +40 -38
- package/dist/cjs/{block-annotation.abstract-4d88b939.js → vega-skeleton-loader-controller-7dac484f.js} +7 -21
- package/dist/cjs/vega-skeleton.cjs.entry.js +26 -25
- package/dist/cjs/vega-slot-container.cjs.entry.js +6 -5
- package/dist/cjs/vega-stepper.cjs.entry.js +34 -32
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +54 -52
- package/dist/cjs/vega-table_8.cjs.entry.js +185 -183
- package/dist/cjs/vega-text.cjs.entry.js +9 -8
- package/dist/cjs/vega-textarea.cjs.entry.js +34 -32
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +83 -81
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +23 -21
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +20 -19
- package/dist/cjs/vega.cjs.js +21 -21
- package/dist/collection/components/vega-pagination/vega-pagination.js +5 -2
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +22 -1
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +0 -10
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +0 -9
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +0 -44
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +0 -10
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +0 -42
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +0 -9
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +0 -14
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +0 -90
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +0 -11
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +0 -26
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +0 -44
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +0 -11
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +0 -42
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +67 -26
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +45 -31
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +68 -35
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +113 -50
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +23 -60
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +0 -25
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +95 -51
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +123 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +48 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +258 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +71 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +70 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.js +85 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +49 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +56 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +7 -3
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/image-block.test.js +0 -10
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-block.test.js +0 -48
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-item.test.js +0 -40
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +0 -39
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +0 -14
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +0 -34
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +3 -0
- package/dist/esm/{app-globals-9971ccfd.js → app-globals-5b154b6d.js} +13 -12
- package/dist/esm/{change-manager-8f5b72c2.js → change-manager-6a7eb88c.js} +1 -1
- package/dist/esm/{child-nodes-event-prevent-slimmer-8ceabe63.js → child-nodes-event-prevent-slimmer-97aae8a8.js} +3 -3
- package/dist/esm/{child-nodes-notify-observer-slimmer-afc15e00.js → child-nodes-notify-observer-slimmer-289caacc.js} +4 -4
- package/dist/esm/{component-051a594c.js → component-cae24190.js} +1 -1
- package/dist/esm/{component-global-style-slimmer-631f956f.js → component-global-style-slimmer-000e0c11.js} +1 -1
- package/dist/esm/{component-usage-runtime-metrics-21813c36.js → component-usage-runtime-metrics-385c7124.js} +1 -1
- package/dist/esm/content-state-f39c4bbf.js +132 -0
- package/dist/esm/{create-public-api-runtime-metrics-slimmer-14cb4599.js → create-public-api-runtime-metrics-slimmer-9ab05523.js} +2 -2
- package/dist/esm/{date-655c0af8.js → date-732bc749.js} +1 -1
- package/dist/esm/{deprecated-property-slimmer-9ea5019c.js → deprecated-property-slimmer-43d184b3.js} +2 -2
- package/dist/esm/{design-token-20fdba82.js → design-token-d06bc718.js} +3 -3
- package/dist/esm/{dom-node-subject-observer-factory-80358591.js → dom-node-subject-factory-5831cdd4.js} +2 -41
- package/dist/esm/dom-node-subject-observer-factory-dc486a8b.js +42 -0
- package/dist/esm/{dynamic-slimmer-85746483.js → dynamic-slimmer-90b8af32.js} +1 -1
- package/dist/esm/{element-appender-slimmer-4dfa326d.js → element-appender-slimmer-d71e3109.js} +6 -6
- package/dist/esm/{event-emit-slimmer-c03cf145.js → event-emit-slimmer-f285e3ac.js} +6 -5
- package/dist/esm/{feature-flag-controller-dfde0cfa.js → feature-flag-controller-4b3fe6f8.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-de5fe574.js → form-field-controller-slimmer-af969d03.js} +10 -9
- package/dist/esm/global-slimmer-registry-17c4efd4.js +283 -0
- package/dist/esm/{icon-manager-3cef32e7.js → icon-manager-b889176b.js} +2 -2
- package/dist/esm/{text-color-toolbar-button-slimmer-d0255b98.js → image-annotation-action-a8e00f28.js} +55 -6
- package/dist/esm/{global-slimmer-registry-6887a59f.js → index-187f71d1.js} +283 -284
- package/dist/esm/index.js +20 -21
- package/dist/esm/{inject-keyboard-manager-45309420.js → inject-keyboard-manager-b0135018.js} +1 -1
- package/dist/esm/{internal-icon-manager-7fc7535a.js → internal-icon-manager-900a5bb4.js} +1 -1
- package/dist/esm/{internal-vega-event-manager-3a3815d3.js → internal-vega-event-manager-07e1b3d9.js} +2 -2
- package/dist/esm/{internal-vega-z-index-manager-89e8b6f5.js → internal-vega-z-index-manager-7d2b54c3.js} +1 -1
- package/dist/esm/{keyboard-manager-2c06eafe.js → keyboard-manager-4c898a0d.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-fd177285.js → keyboard-manager-slimmer-f80d6835.js} +2 -2
- package/dist/esm/{content-state-acf55eb0.js → list-block-ba82c846.js} +1273 -577
- package/dist/esm/loader.js +19 -19
- package/dist/esm/{mutation-observer-slimmer-ca2cb2e8.js → mutation-observer-slimmer-6cef9549.js} +1 -1
- package/dist/esm/{node.abstract-93746055.js → node-annotation.abstract-d7d52bce.js} +35 -47
- package/dist/esm/{page-resize-observer-slimmer-8589ebc8.js → page-resize-observer-slimmer-beb7b0bd.js} +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{remote-invocation-registry-2ec6936d.js → remote-invocation-registry-d97fa3bc.js} +2 -2
- package/dist/esm/{responsive-format-facade-559ec469.js → responsive-format-facade-c2ab9c87.js} +1 -1
- package/dist/esm/{state-background-color-formatter-16031a43.js → state-background-color-formatter-121ae7d3.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-c9fb1fa1.js → string-input-formatter-slimmer-73fa06e6.js} +1 -1
- package/dist/esm/{style-formatter-51845b6d.js → style-formatter-f91471e8.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-6e97a58a.js → sub-state-notify-slimmer-48bad548.js} +4 -4
- package/dist/esm/{sub-state-observer-slimmer-0968ce04.js → sub-state-observer-slimmer-403cc4e7.js} +4 -4
- package/dist/esm/{translation-b3fe8e74.js → translation-a98970d8.js} +3 -3
- package/dist/esm/{translation-slimmer-860cd766.js → translation-slimmer-5ee9912b.js} +2 -2
- package/dist/esm/{ui-5600b48f.js → ui-62e4be97.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +17 -15
- package/dist/esm/vega-app-footer.entry.js +4 -3
- package/dist/esm/vega-app-header-button.entry.js +20 -18
- package/dist/esm/vega-backdrop.entry.js +5 -4
- package/dist/esm/vega-banner.entry.js +15 -13
- package/dist/esm/vega-bar-chart.entry.js +3 -2
- package/dist/esm/vega-box.entry.js +10 -9
- package/dist/esm/vega-breadcrumb.entry.js +13 -11
- package/dist/esm/vega-button-circle.entry.js +16 -14
- package/dist/esm/vega-button-group_2.entry.js +15 -13
- package/dist/esm/vega-button-link.entry.js +13 -11
- package/dist/esm/vega-button.entry.js +15 -13
- package/dist/esm/vega-calendar_3.entry.js +23 -21
- package/dist/esm/vega-card.entry.js +8 -7
- package/dist/esm/vega-carousel.entry.js +14 -12
- package/dist/esm/vega-checkbox_2.entry.js +19 -17
- package/dist/esm/vega-chip.entry.js +17 -15
- package/dist/esm/vega-color-picker.entry.js +16 -14
- package/dist/esm/vega-combo-box.entry.js +20 -18
- package/dist/esm/vega-counter-badge.entry.js +4 -3
- package/dist/esm/vega-date-picker_2.entry.js +31 -29
- package/dist/esm/{vega-dialog-controller-5b23f68c.js → vega-dialog-controller-34eb8967.js} +2 -2
- package/dist/esm/vega-dialog_2.entry.js +20 -18
- package/dist/esm/vega-divider.entry.js +8 -7
- package/dist/esm/vega-dropdown_5.entry.js +27 -25
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-error.entry.js +5 -4
- package/dist/esm/vega-field-label.entry.js +11 -9
- package/dist/esm/vega-file-uploader.entry.js +19 -17
- package/dist/esm/vega-flex.entry.js +11 -10
- package/dist/esm/vega-font.entry.js +9 -8
- package/dist/esm/vega-form.entry.js +19 -17
- package/dist/esm/vega-grid.entry.js +8 -7
- package/dist/esm/vega-hint.entry.js +4 -3
- package/dist/esm/vega-icon.entry.js +11 -10
- package/dist/esm/vega-image-uploader.entry.js +21 -19
- package/dist/esm/vega-input-credit-card.entry.js +20 -18
- package/dist/esm/vega-input-numeric.entry.js +21 -19
- package/dist/esm/vega-input-phone-number.entry.js +21 -19
- package/dist/esm/vega-input-range.entry.js +19 -17
- package/dist/esm/vega-input-select.entry.js +22 -20
- package/dist/esm/vega-input.entry.js +18 -16
- package/dist/esm/vega-item-toggle.entry.js +12 -10
- package/dist/esm/vega-left-nav_5.entry.js +24 -22
- package/dist/esm/vega-line-chart.entry.js +4 -3
- package/dist/esm/vega-loader-wrapper_2.entry.js +7 -6
- package/dist/esm/vega-page-notification_2.entry.js +8 -6
- package/dist/esm/vega-pagination.entry.js +21 -16
- package/dist/esm/vega-pie-chart.entry.js +4 -3
- package/dist/esm/vega-popover_2.entry.js +18 -16
- package/dist/esm/vega-progress-tracker.entry.js +12 -10
- package/dist/esm/vega-radio_2.entry.js +21 -19
- package/dist/esm/vega-rich-text-content.entry.js +315 -17
- package/dist/esm/vega-rich-text-editor_4.entry.js +657 -442
- package/dist/esm/vega-section-title.entry.js +4 -3
- package/dist/esm/vega-segment-control.entry.js +12 -10
- package/dist/esm/vega-selection-chip_2.entry.js +21 -19
- package/dist/esm/vega-selection-tile_2.entry.js +21 -19
- package/dist/esm/vega-sidenav_3.entry.js +19 -17
- package/dist/esm/vega-signature-capture.entry.js +22 -20
- package/dist/esm/{block-annotation.abstract-b0554e2b.js → vega-skeleton-loader-controller-0aaaf1fa.js} +8 -21
- package/dist/esm/vega-skeleton.entry.js +4 -3
- package/dist/esm/vega-slot-container.entry.js +3 -2
- package/dist/esm/vega-stepper.entry.js +18 -16
- package/dist/esm/vega-tab-group_2.entry.js +14 -12
- package/dist/esm/vega-table_8.entry.js +26 -24
- package/dist/esm/vega-text.entry.js +5 -4
- package/dist/esm/vega-textarea.entry.js +18 -16
- package/dist/esm/vega-time-picker_2.entry.js +25 -23
- package/dist/esm/vega-toggle-switch.entry.js +16 -14
- package/dist/esm/vega-tooltip_2.entry.js +13 -12
- package/dist/esm/vega.js +19 -19
- package/dist/types/components/vega-pagination/vega-pagination.d.ts +1 -0
- package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +0 -14
- package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +0 -8
- package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +0 -14
- package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +0 -6
- package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +0 -14
- package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +2 -23
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +68 -5
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +45 -4
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +68 -4
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +110 -6
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +21 -6
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +1 -14
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +86 -4
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.d.ts +111 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.d.ts +32 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +32 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.d.ts +38 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.d.ts +35 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.d.ts +31 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-000b3ab0.js +1 -0
- package/dist/vega/p-00738ae9.entry.js +1 -0
- package/dist/vega/p-01d0dbe6.entry.js +1 -0
- package/dist/vega/{p-b3f9cc3a.entry.js → p-0283712e.entry.js} +2 -2
- package/dist/vega/p-032df16f.js +1 -0
- package/dist/vega/p-05f5e22b.entry.js +1 -0
- package/dist/vega/p-0945a58d.entry.js +1 -0
- package/dist/vega/p-09c5de7f.entry.js +1 -0
- package/dist/vega/p-0a8b91f5.entry.js +1 -0
- package/dist/vega/{p-f763e2eb.js → p-0af4bda9.js} +1 -1
- package/dist/vega/p-0bd9b1d9.entry.js +1 -0
- package/dist/vega/p-0c2eb135.entry.js +1 -0
- package/dist/vega/p-0da2de05.entry.js +1 -0
- package/dist/vega/p-0ee10fd7.js +1 -0
- package/dist/vega/p-12ad8ada.entry.js +1 -0
- package/dist/vega/p-14514252.entry.js +1 -0
- package/dist/vega/{p-11a19ca0.js → p-149d2801.js} +1 -1
- package/dist/vega/p-14f85e30.entry.js +1 -0
- package/dist/vega/p-19556584.entry.js +1 -0
- package/dist/vega/p-1b3e0a9f.entry.js +1 -0
- package/dist/vega/p-1c298d5a.js +2 -0
- package/dist/vega/p-1d805cc0.entry.js +1 -0
- package/dist/vega/p-1dd9f841.entry.js +1 -0
- package/dist/vega/p-211df22a.entry.js +1 -0
- package/dist/vega/p-2205ee4c.js +1 -0
- package/dist/vega/p-29b09aad.js +1 -0
- package/dist/vega/{p-443ad3b3.js → p-2d0d575f.js} +1 -1
- package/dist/vega/p-2f32a9ba.js +1 -0
- package/dist/vega/{p-368d0060.js → p-2fbda931.js} +1 -1
- package/dist/vega/p-33b62194.js +1 -0
- package/dist/vega/p-36db2554.entry.js +1 -0
- package/dist/vega/p-3a6c9b9d.entry.js +1 -0
- package/dist/vega/p-42df8a42.js +1 -0
- package/dist/vega/{p-8f93242a.js → p-4387d550.js} +1 -1
- package/dist/vega/p-45c88f7f.entry.js +1 -0
- package/dist/vega/p-45dd4698.entry.js +1 -0
- package/dist/vega/p-465fa96d.entry.js +1 -0
- package/dist/vega/{p-3b4bde3e.js → p-4b500240.js} +1 -1
- package/dist/vega/{p-e0b25eaf.js → p-4f0b56fc.js} +1 -1
- package/dist/vega/p-5298fd92.entry.js +1 -0
- package/dist/vega/p-5915634b.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-70151c27.js → p-5f589974.js} +1 -1
- package/dist/vega/p-61116634.entry.js +1 -0
- package/dist/vega/p-618b35e4.entry.js +1 -0
- package/dist/vega/p-625771d7.entry.js +1 -0
- package/dist/vega/p-6661a462.entry.js +1 -0
- package/dist/vega/{p-62774231.js → p-6705c68a.js} +1 -1
- package/dist/vega/p-68f0aa72.entry.js +1 -0
- package/dist/vega/{p-59bdf9b8.js → p-6a334573.js} +1 -1
- package/dist/vega/p-6a3989dd.js +1 -0
- package/dist/vega/{p-0e0c47ad.js → p-6a5a5c7b.js} +1 -1
- package/dist/vega/p-6c09b79a.entry.js +1 -0
- package/dist/vega/p-6d23c08b.entry.js +1 -0
- package/dist/vega/p-6d43b123.entry.js +1 -0
- package/dist/vega/p-6e1ab235.js +1 -0
- package/dist/vega/p-71eeb279.entry.js +1 -0
- package/dist/vega/p-72eee5e2.js +1 -0
- package/dist/vega/{p-eac38d87.js → p-781fd6e0.js} +1 -1
- package/dist/vega/{p-1995e98e.js → p-79ec5d69.js} +1 -1
- package/dist/vega/p-8067bd31.entry.js +1 -0
- package/dist/vega/{p-3f1b542a.js → p-81dbada7.js} +1 -1
- package/dist/vega/{p-a6a7d0c9.js → p-8284a445.js} +1 -1
- package/dist/vega/p-84113217.entry.js +1 -0
- package/dist/vega/p-843b13e6.entry.js +1 -0
- package/dist/vega/p-84f2f342.js +1 -0
- package/dist/vega/p-85365f8b.js +1 -0
- package/dist/vega/p-8ab356e8.entry.js +1 -0
- package/dist/vega/p-8ba43640.entry.js +1 -0
- package/dist/vega/p-8be7b62c.entry.js +1 -0
- package/dist/vega/p-8d69f9ef.entry.js +1 -0
- package/dist/vega/p-91aa058f.entry.js +1 -0
- package/dist/vega/{p-8c26227e.js → p-926596cc.js} +1 -1
- package/dist/vega/p-92707b74.entry.js +1 -0
- package/dist/vega/p-96f0ef53.entry.js +1 -0
- package/dist/vega/p-97453cd8.entry.js +1 -0
- package/dist/vega/{p-843a0c1c.js → p-987fbbd0.js} +1 -1
- package/dist/vega/{p-296cc56b.js → p-9b797118.js} +1 -1
- package/dist/vega/p-a01f149d.entry.js +1 -0
- package/dist/vega/p-a0e90d5d.entry.js +1 -0
- package/dist/vega/{p-3953c705.js → p-af7a3154.js} +1 -1
- package/dist/vega/p-b2bca332.entry.js +1 -0
- package/dist/vega/p-b450bf46.entry.js +1 -0
- package/dist/vega/p-b5990090.js +1 -0
- package/dist/vega/p-b64981de.entry.js +1 -0
- package/dist/vega/p-b6815874.js +1 -0
- package/dist/vega/p-b688a71b.js +1 -0
- package/dist/vega/p-b9a09a76.js +1 -0
- package/dist/vega/p-bcb10ae3.entry.js +1 -0
- package/dist/vega/{p-39836361.js → p-be12fa36.js} +1 -1
- package/dist/vega/p-c02f650e.entry.js +1 -0
- package/dist/vega/p-c2b276f7.entry.js +1 -0
- package/dist/vega/p-c51a3e3c.entry.js +1 -0
- package/dist/vega/p-c88acd87.entry.js +1 -0
- package/dist/vega/p-cb8f8458.entry.js +1 -0
- package/dist/vega/p-cda26bdf.entry.js +1 -0
- package/dist/vega/p-d09d153f.entry.js +1 -0
- package/dist/vega/p-d994874a.entry.js +1 -0
- package/dist/vega/p-dbec03ed.entry.js +1 -0
- package/dist/vega/p-dcdac4d0.entry.js +1 -0
- package/dist/vega/p-de13b747.entry.js +1 -0
- package/dist/vega/p-de25326f.js +1 -0
- package/dist/vega/{p-e1e1fcf0.js → p-de664bdd.js} +1 -1
- package/dist/vega/p-e04d4ba3.entry.js +1 -0
- package/dist/vega/p-e8f540d8.js +1 -0
- package/dist/vega/p-e923637d.entry.js +1 -0
- package/dist/vega/p-efbea85a.entry.js +1 -0
- package/dist/vega/{p-81ead59a.js → p-f31bb1fd.js} +1 -1
- package/dist/vega/p-f690539e.entry.js +1 -0
- package/dist/vega/p-f6b89936.entry.js +1 -0
- package/dist/vega/p-f84fd31c.js +1 -0
- package/dist/vega/p-fe388812.entry.js +1 -0
- package/dist/vega/{p-acf7f903.js → p-ff4bafa3.js} +1 -1
- package/dist/vega/p-ff50c204.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -2
- package/dist/cjs/text-node-0d12da5a.js +0 -1077
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/element-to-dto-handler.abstract.js +0 -135
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/element-to-dto-processor.js +0 -74
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/image-to-dto-handler.js +0 -47
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/inline-block-to-dto-handler.js +0 -39
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/link-to-dto-handler.js +0 -50
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/list-item-to-dto-handler.js +0 -41
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/list-to-dto-handler.js +0 -57
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/paragraph-to-dto-handler.js +0 -56
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/text-block-to-dto-handler.js +0 -77
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/text-to-dto-handler.js +0 -44
- package/dist/esm/text-node-6f7d736c.js +0 -1055
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/element-to-dto-handler.abstract.d.ts +0 -67
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/element-to-dto-processor.d.ts +0 -29
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/image-to-dto-handler.d.ts +0 -37
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/inline-block-to-dto-handler.d.ts +0 -35
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/link-to-dto-handler.d.ts +0 -37
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/list-item-to-dto-handler.d.ts +0 -36
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/list-to-dto-handler.d.ts +0 -39
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/paragraph-to-dto-handler.d.ts +0 -39
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/text-block-to-dto-handler.d.ts +0 -46
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/text-to-dto-handler.d.ts +0 -37
- package/dist/vega/p-034e6348.entry.js +0 -1
- package/dist/vega/p-0cd2b50f.entry.js +0 -1
- package/dist/vega/p-109a00cf.entry.js +0 -1
- package/dist/vega/p-11cb477b.js +0 -1
- package/dist/vega/p-1564cc4d.entry.js +0 -1
- package/dist/vega/p-18886765.entry.js +0 -1
- package/dist/vega/p-19b26168.entry.js +0 -1
- package/dist/vega/p-21992602.entry.js +0 -1
- package/dist/vega/p-22563151.entry.js +0 -1
- package/dist/vega/p-23795da1.entry.js +0 -1
- package/dist/vega/p-29277e41.entry.js +0 -1
- package/dist/vega/p-2a7e9422.entry.js +0 -1
- package/dist/vega/p-2ca6d977.entry.js +0 -1
- package/dist/vega/p-2e419309.entry.js +0 -1
- package/dist/vega/p-2fc3af2f.js +0 -1
- package/dist/vega/p-3039bef8.js +0 -1
- package/dist/vega/p-315667f1.js +0 -1
- package/dist/vega/p-34939c97.entry.js +0 -1
- package/dist/vega/p-3897bb2d.entry.js +0 -1
- package/dist/vega/p-390c5236.entry.js +0 -1
- package/dist/vega/p-3ce31dc3.js +0 -1
- package/dist/vega/p-452e284a.js +0 -1
- package/dist/vega/p-49f4a666.js +0 -1
- package/dist/vega/p-4c41dd64.js +0 -1
- package/dist/vega/p-55beac7f.entry.js +0 -1
- package/dist/vega/p-57405834.entry.js +0 -1
- package/dist/vega/p-589e6041.entry.js +0 -1
- package/dist/vega/p-5e95402a.entry.js +0 -1
- package/dist/vega/p-5eee21b4.entry.js +0 -1
- package/dist/vega/p-62cea2e7.entry.js +0 -1
- package/dist/vega/p-65b79fd7.js +0 -1
- package/dist/vega/p-6741e2b9.entry.js +0 -1
- package/dist/vega/p-6a084fe1.entry.js +0 -1
- package/dist/vega/p-6b286226.entry.js +0 -1
- package/dist/vega/p-6b722905.entry.js +0 -1
- package/dist/vega/p-6e4b2752.entry.js +0 -1
- package/dist/vega/p-7209d03b.js +0 -1
- package/dist/vega/p-728b029a.entry.js +0 -1
- package/dist/vega/p-76fc408e.entry.js +0 -1
- package/dist/vega/p-7a9f453e.entry.js +0 -1
- package/dist/vega/p-80ccd894.entry.js +0 -1
- package/dist/vega/p-84c597c8.entry.js +0 -1
- package/dist/vega/p-8b78c6a3.entry.js +0 -1
- package/dist/vega/p-8be45a45.entry.js +0 -1
- package/dist/vega/p-8d7b45f7.entry.js +0 -1
- package/dist/vega/p-8e17b9dd.entry.js +0 -1
- package/dist/vega/p-925a2137.js +0 -1
- package/dist/vega/p-92f88033.entry.js +0 -1
- package/dist/vega/p-94de7a02.entry.js +0 -1
- package/dist/vega/p-9968e71d.entry.js +0 -1
- package/dist/vega/p-9c1eeff2.js +0 -2
- package/dist/vega/p-9d1b9e70.entry.js +0 -1
- package/dist/vega/p-a5ffe912.js +0 -1
- package/dist/vega/p-a6104aa7.js +0 -1
- package/dist/vega/p-a6169ad6.entry.js +0 -1
- package/dist/vega/p-a8bf559a.js +0 -1
- package/dist/vega/p-afec17ad.entry.js +0 -1
- package/dist/vega/p-b693c1ac.entry.js +0 -1
- package/dist/vega/p-b6af0fc1.entry.js +0 -1
- package/dist/vega/p-b9e2add4.entry.js +0 -1
- package/dist/vega/p-bd894860.entry.js +0 -1
- package/dist/vega/p-c0d6a587.entry.js +0 -1
- package/dist/vega/p-c1d97d12.entry.js +0 -1
- package/dist/vega/p-c26e6820.entry.js +0 -1
- package/dist/vega/p-c34487e1.entry.js +0 -1
- package/dist/vega/p-c532b132.entry.js +0 -1
- package/dist/vega/p-ca2fb711.js +0 -1
- package/dist/vega/p-cebf93f1.entry.js +0 -1
- package/dist/vega/p-cfdc148a.entry.js +0 -1
- package/dist/vega/p-d0351d71.entry.js +0 -1
- package/dist/vega/p-d2ab6096.entry.js +0 -1
- package/dist/vega/p-d302f052.entry.js +0 -1
- package/dist/vega/p-d35643c5.entry.js +0 -1
- package/dist/vega/p-d400a1d9.entry.js +0 -1
- package/dist/vega/p-d6732a72.entry.js +0 -1
- package/dist/vega/p-d720b06a.entry.js +0 -1
- package/dist/vega/p-d987e404.entry.js +0 -1
- package/dist/vega/p-d9b86108.entry.js +0 -1
- package/dist/vega/p-e27e115d.entry.js +0 -1
- package/dist/vega/p-e43c2a27.js +0 -1
- package/dist/vega/p-e65c8ac7.entry.js +0 -1
- package/dist/vega/p-e79057cc.js +0 -1
- package/dist/vega/p-e89e9769.entry.js +0 -1
- package/dist/vega/p-ecd64c7f.entry.js +0 -1
- package/dist/vega/p-f5b2e72a.entry.js +0 -1
- package/dist/vega/p-f6af3749.js +0 -1
- package/dist/vega/p-fc622a75.js +0 -1
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { V as
|
|
3
|
-
import {
|
|
1
|
+
import { h, H as Host, F as Fragment, r as registerInstance, c as createEvent, g as getElement } from './index-187f71d1.js';
|
|
2
|
+
import { c as MapToComponentField, M as MapToComponentMethod, V as VegaSlimmer, I as InjectVegaSlimmer, L as LogUtility } from './global-slimmer-registry-17c4efd4.js';
|
|
3
|
+
import { V as VegaComponentUsageRuntimeMetricsSlimmer, I as InjectVegaGlobalSlimmer } from './component-usage-runtime-metrics-385c7124.js';
|
|
4
|
+
import { g as getActiveElement, s as sanitizeVegaComponent } from './component-cae24190.js';
|
|
4
5
|
import { c as createEnterKeyHandlerToTriggerClick } from './accessibility-e5fd0fab.js';
|
|
5
|
-
import { C as ChangeManager } from './change-manager-
|
|
6
|
-
import { d as domNodeSubjectFactory,
|
|
6
|
+
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
7
|
+
import { d as domNodeSubjectFactory, b as VegaDropdownClick, f as VegaChange, O as Observer, P as VegaImageInserted, a as VegaClick, L as VegaPopoverShow, M as VegaPopoverHide } from './dom-node-subject-factory-5831cdd4.js';
|
|
7
8
|
import { a as VegaInternalComponentDidRender, b as VegaInternalRichTextEditorSelectionRangeChange, V as VegaInternalRichTextEditorFlushChanges, o as VegaInternalRichTextImageClick, p as VegaInternalRichTextImageDeleteButtonClicked, k as VegaInternalPopoverUpdateTarget } from './vega-internal-event-id-4af5c6e9.js';
|
|
8
|
-
import {
|
|
9
|
-
import { V as VegaInternalIconManager } from './internal-icon-manager-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { c as
|
|
17
|
-
import { c as createSubStateNotifySlimmer } from './sub-state-notify-slimmer-6e97a58a.js';
|
|
9
|
+
import { b as ToolbarButtonSlimmer, I as ImageAnnotationAction, T as TextNodeRenderingRegistry, a as TextColorToolbarButtonSlimmer } from './image-annotation-action-a8e00f28.js';
|
|
10
|
+
import { V as VegaInternalIconManager } from './internal-icon-manager-900a5bb4.js';
|
|
11
|
+
import { g as RTETextNode, i as BoldAnnotationAction, T as TextSplittableAction, j as ItalicAnnotation, U as UnderlineAnnotation, b as RTETextBlock, k as TextStyleAnnotationAction, l as TextStyleAnnotation, m as BoldAnnotation, C as ClearFormattingAnnotationAction, n as CodeAnnotationAction, o as StrikethroughAnnotation, h as AnnotationAction, p as SelectionRangeAnnotation, L as LinkAnnotationAction, d as waitForComponentDidRender, q as IndentAnnotation, r as RTEImageNode, c as RTEListItemBlock, H as HorizontalAlignmentAnnotation, Z as ZERO_WIDTH_SPACE, s as UpdateTextAction, t as RemoveChildAction, A as AppendChildNodesAction, u as InsertBlocksBeforeAction, M as MergeTwoBlocksNodesAction, v as SplitBlockWithNodeAction, x as ReplaceChildNodesAction, f as RTE_TEXT_COLORS, R as RTEListBlock, a as RTEImageBlock, y as InsertBlocksAfterAction } from './list-block-ba82c846.js';
|
|
12
|
+
import { c as NodeAnnotationTypeEnum, a as BlockAnnotationTypeEnum, M as ModifyContentAction, b as ModifyContentActionType, R as RTENode, s as stateEntityRenderingRegistry, I as InternalAnnotationTypeEnum, V as VegaThemeManager } from './node-annotation.abstract-d7d52bce.js';
|
|
13
|
+
import { D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-dc486a8b.js';
|
|
14
|
+
import { g as generateUUID } from './create-public-api-runtime-metrics-slimmer-9ab05523.js';
|
|
15
|
+
import { F as FormFieldControllerSlimmer } from './form-field-controller-slimmer-af969d03.js';
|
|
16
|
+
import { c as createEventEmitSlimmer } from './event-emit-slimmer-f285e3ac.js';
|
|
17
|
+
import { c as createSubStateNotifySlimmer } from './sub-state-notify-slimmer-48bad548.js';
|
|
18
18
|
import { d as debounce } from './timer-9321173b.js';
|
|
19
19
|
import { S as SynchronizeTaskQueue } from './synchronize-task-queue-ac8acc3b.js';
|
|
20
|
-
import { f as findParent } from './ui-
|
|
20
|
+
import { f as findParent, r as rgbToHex } from './ui-62e4be97.js';
|
|
21
21
|
import { b as FORM_ELEMENT_VALUE_CHANGE, D as DARK_MODE_CHANGE } from './static-subject-title-e06a3840.js';
|
|
22
|
+
import { V as VegaRTEContent } from './content-state-f39c4bbf.js';
|
|
22
23
|
import './vega-env-manager-8f8dc473.js';
|
|
23
|
-
import './
|
|
24
|
-
import './
|
|
25
|
-
import './
|
|
26
|
-
import './
|
|
27
|
-
import
|
|
24
|
+
import './vega-skeleton-loader-controller-0aaaf1fa.js';
|
|
25
|
+
import './feature-flag-controller-4b3fe6f8.js';
|
|
26
|
+
import './vega-dialog-controller-34eb8967.js';
|
|
27
|
+
import './icon-manager-b889176b.js';
|
|
28
|
+
import './translation-a98970d8.js';
|
|
29
|
+
import { C as ChildNodesEventPreventSlimmer } from './child-nodes-event-prevent-slimmer-97aae8a8.js';
|
|
28
30
|
import { c as chevronDown } from './chevron-down-4a75d28e.js';
|
|
29
31
|
import { t as trashCan } from './trash-can-8819a939.js';
|
|
30
|
-
import { r as remoteInvocationRegistry } from './remote-invocation-registry-
|
|
32
|
+
import { r as remoteInvocationRegistry } from './remote-invocation-registry-d97fa3bc.js';
|
|
31
33
|
import './type-guard-158f6d7a.js';
|
|
32
34
|
import './breakpoints-d9faf11c.js';
|
|
33
35
|
import './ui-8424715a.js';
|
|
34
36
|
import './regex-dfe11abf.js';
|
|
35
37
|
import './typography-396de03f.js';
|
|
36
38
|
import './_commonjsHelpers-9943807e.js';
|
|
37
|
-
import './
|
|
38
|
-
import './number-4398f2e1.js';
|
|
39
|
-
import './dynamic-slimmer-85746483.js';
|
|
40
|
-
import './page-resize-observer-slimmer-8589ebc8.js';
|
|
41
|
-
import './breakpoints-91116111.js';
|
|
42
|
-
import './internal-vega-event-manager-3a3815d3.js';
|
|
39
|
+
import './dynamic-slimmer-90b8af32.js';
|
|
43
40
|
import './string-be824360.js';
|
|
44
|
-
import './
|
|
41
|
+
import './page-resize-observer-slimmer-beb7b0bd.js';
|
|
42
|
+
import './breakpoints-91116111.js';
|
|
43
|
+
import './mutation-observer-slimmer-6cef9549.js';
|
|
45
44
|
import './mutation-observer-filters-1035b064.js';
|
|
46
45
|
import './array-b668466e.js';
|
|
46
|
+
import './number-4398f2e1.js';
|
|
47
|
+
import './internal-vega-event-manager-07e1b3d9.js';
|
|
48
|
+
import './internal-vega-z-index-manager-7d2b54c3.js';
|
|
47
49
|
import './index-44c794b4.js';
|
|
48
50
|
|
|
49
51
|
var __decorate$y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -2906,446 +2908,530 @@ class DeleteContentHandler extends BaseHandler {
|
|
|
2906
2908
|
}
|
|
2907
2909
|
|
|
2908
2910
|
/**
|
|
2909
|
-
* Abstract class
|
|
2911
|
+
* Abstract class to define strategies for processing HTML elements
|
|
2910
2912
|
*/
|
|
2911
|
-
class
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
this.
|
|
2920
|
-
this.
|
|
2913
|
+
class ElementToDTOStrategy {
|
|
2914
|
+
}
|
|
2915
|
+
/**
|
|
2916
|
+
* Class to represent the output of a strategy applied to HTML elements
|
|
2917
|
+
*/
|
|
2918
|
+
class ElementToDTOStrategyOutput {
|
|
2919
|
+
constructor(currentStrategy, currentElements) {
|
|
2920
|
+
this.childrenOutput = [];
|
|
2921
|
+
this.currentStrategy = currentStrategy;
|
|
2922
|
+
this.currentElements = currentElements;
|
|
2921
2923
|
}
|
|
2922
|
-
/* istanbul ignore next */
|
|
2923
|
-
// eslint-disable-next-line jsdoc/require-returns-check
|
|
2924
2924
|
/**
|
|
2925
|
-
*
|
|
2925
|
+
* Set children output.
|
|
2926
2926
|
*
|
|
2927
|
-
* @param {
|
|
2928
|
-
* @returns {boolean} Can be handle.
|
|
2927
|
+
* @param {ElementToDTOStrategyOutput[]} childrenOutput - children outputs.
|
|
2929
2928
|
*/
|
|
2930
|
-
|
|
2931
|
-
|
|
2929
|
+
setChildrenOutput(childrenOutput) {
|
|
2930
|
+
this.childrenOutput = childrenOutput;
|
|
2932
2931
|
}
|
|
2933
2932
|
/**
|
|
2934
|
-
* Transform current
|
|
2933
|
+
* Transform current output and children output to DTO
|
|
2935
2934
|
*
|
|
2936
|
-
* @returns {
|
|
2937
|
-
*/
|
|
2938
|
-
|
|
2939
|
-
const
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
if (element.childNodes.length > 0) {
|
|
2945
|
-
const block = RTETextBlock.fromHTML(element, 'paragraph');
|
|
2946
|
-
element.innerHTML = '';
|
|
2947
|
-
return block;
|
|
2935
|
+
* @returns {RTEContentBlock} - DTO.
|
|
2936
|
+
*/
|
|
2937
|
+
toDto() {
|
|
2938
|
+
const currentBlock = this.currentStrategy.handle(this.currentElements);
|
|
2939
|
+
if (this.childrenOutput.length > 0 && currentBlock) {
|
|
2940
|
+
this.currentStrategy.appendChildBlocks(currentBlock, this.childrenOutput
|
|
2941
|
+
.map((childOutput) => childOutput.toDto())
|
|
2942
|
+
.filter(Boolean));
|
|
2948
2943
|
}
|
|
2949
|
-
return
|
|
2944
|
+
return currentBlock;
|
|
2950
2945
|
}
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
/** Abstract class for block html element to RTE block dto */
|
|
2949
|
+
class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
2951
2950
|
/**
|
|
2952
|
-
*
|
|
2951
|
+
* Generate child nodes of block element, this will inherit all annotations from parent to text node and
|
|
2952
|
+
* flat the child nodes.
|
|
2953
2953
|
*
|
|
2954
|
-
*
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2954
|
+
* Example:
|
|
2955
|
+
* <li>
|
|
2956
|
+
* <u><i>text1</i></u>
|
|
2957
|
+
* <span style='font-weight: bold;'><span>text2</span></span>
|
|
2958
|
+
* text3
|
|
2959
|
+
* </li>
|
|
2960
|
+
* will tranform to:
|
|
2961
|
+
* <li>
|
|
2962
|
+
* <span>text1</span> // with underline and italic annotations
|
|
2963
|
+
* <span>text2</span> // with bold annotations
|
|
2964
|
+
* <span>text3</span> // no annotations
|
|
2965
|
+
* </li>
|
|
2966
|
+
*
|
|
2967
|
+
* @param {HTMLElement[]} elements - Child elements.
|
|
2968
|
+
* @param {HTMLElement[]} annotations - Parent annotations.
|
|
2969
|
+
* @returns {VegaRTETextNode[]} - Text node DTO.
|
|
2970
|
+
*/
|
|
2971
|
+
generateChildNodes(elements, annotations = {}) {
|
|
2972
|
+
const childNodes = [];
|
|
2973
|
+
elements.forEach((child) => {
|
|
2974
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
2975
|
+
if (this.isInvalidTextNode(child))
|
|
2976
|
+
return;
|
|
2977
|
+
childNodes.push({
|
|
2978
|
+
id: generateUUID(),
|
|
2979
|
+
type: 'text',
|
|
2980
|
+
text: child.textContent,
|
|
2981
|
+
annotations: annotations,
|
|
2982
|
+
});
|
|
2983
|
+
}
|
|
2984
|
+
else {
|
|
2985
|
+
childNodes.push(...this.generateChildNodes(Array.from(child.childNodes), Object.assign({}, annotations, this.generateTextNodeAnnotations(child))));
|
|
2986
|
+
}
|
|
2987
|
+
});
|
|
2988
|
+
return childNodes;
|
|
2958
2989
|
}
|
|
2959
2990
|
/**
|
|
2960
|
-
*
|
|
2991
|
+
* Generate annotations map for block element.
|
|
2961
2992
|
*
|
|
2962
|
-
* @param {HTMLElement}
|
|
2963
|
-
* @returns {
|
|
2993
|
+
* @param {HTMLElement} element - current element.
|
|
2994
|
+
* @returns {VegaRTEBlockAnnotations} - Text block annotations.
|
|
2964
2995
|
*/
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2996
|
+
generateBlockAnnotations(element) {
|
|
2997
|
+
const annotations = {};
|
|
2998
|
+
const textAlign = this.getTextAlign(element);
|
|
2999
|
+
const indent = this.getIndent(element);
|
|
3000
|
+
if (textAlign)
|
|
3001
|
+
annotations.textAlign = textAlign;
|
|
3002
|
+
if (indent)
|
|
3003
|
+
annotations.indent = indent;
|
|
3004
|
+
return annotations;
|
|
2971
3005
|
}
|
|
2972
3006
|
/**
|
|
2973
|
-
*
|
|
3007
|
+
* Check is a invalid text node.
|
|
2974
3008
|
*
|
|
2975
|
-
* @param {HTMLElement} element - Current element.
|
|
3009
|
+
* @param {HTMLElement} element - Current node element.
|
|
3010
|
+
* @returns {boolean} - boolean.
|
|
2976
3011
|
*/
|
|
2977
|
-
|
|
2978
|
-
if (element.
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
const parent = element.parentElement;
|
|
2983
|
-
const parentStyle = parent.getAttribute('style') || '';
|
|
2984
|
-
const parentClass = parent.classList;
|
|
2985
|
-
switch (element.nodeName) {
|
|
2986
|
-
case 'CODE':
|
|
2987
|
-
currentClass.add('v-rte--code');
|
|
2988
|
-
break;
|
|
2989
|
-
case 'STRONG':
|
|
2990
|
-
currentStyle += 'font-weight: bold; ';
|
|
2991
|
-
break;
|
|
2992
|
-
case 'I':
|
|
2993
|
-
case 'EM':
|
|
2994
|
-
currentStyle += 'font-style: italic; ';
|
|
2995
|
-
break;
|
|
2996
|
-
case 'S':
|
|
2997
|
-
currentClass.add('v-rte--strikethrough');
|
|
2998
|
-
break;
|
|
2999
|
-
case 'U':
|
|
3000
|
-
currentClass.add('v-rte--underline');
|
|
3001
|
-
break;
|
|
3012
|
+
isInvalidTextNode(element) {
|
|
3013
|
+
if (element.nodeValue.includes('\t')) {
|
|
3014
|
+
const value = element.nodeValue.replace(/\n|\t/gm, '');
|
|
3015
|
+
if (value.length === 0)
|
|
3016
|
+
return true;
|
|
3002
3017
|
}
|
|
3003
|
-
|
|
3004
|
-
element.classList.add(...Array.from(parentClass));
|
|
3018
|
+
return false;
|
|
3005
3019
|
}
|
|
3006
3020
|
/**
|
|
3007
|
-
*
|
|
3008
|
-
* while element is a text node, we should wrap it and inherit it style
|
|
3009
|
-
* otherwise, we should clone it and clear content.
|
|
3021
|
+
* Generate annotations map for text node element.
|
|
3010
3022
|
*
|
|
3011
|
-
* @param {HTMLElement} element -
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
if (element
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
this.
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3023
|
+
* @param {HTMLElement} element - current element.
|
|
3024
|
+
* @returns {VegaRTETextAnnotations | VegaRTECodeAnnotations} - Text node annotations.
|
|
3025
|
+
*/
|
|
3026
|
+
generateTextNodeAnnotations(element) {
|
|
3027
|
+
if (this.isCode(element))
|
|
3028
|
+
return { code: true };
|
|
3029
|
+
const annotations = {
|
|
3030
|
+
bold: this.isBold(element),
|
|
3031
|
+
italic: this.isItalic(element),
|
|
3032
|
+
underline: this.isUnderline(element),
|
|
3033
|
+
strikethrough: this.isStrikethrough(element),
|
|
3034
|
+
};
|
|
3035
|
+
const color = this.getColor(element);
|
|
3036
|
+
const link = this.getLink(element);
|
|
3037
|
+
if (color)
|
|
3038
|
+
annotations.textColor = color;
|
|
3039
|
+
if (link)
|
|
3040
|
+
annotations.link = link;
|
|
3041
|
+
return annotations;
|
|
3027
3042
|
}
|
|
3028
3043
|
/**
|
|
3029
|
-
*
|
|
3044
|
+
* Is code element.
|
|
3030
3045
|
*
|
|
3031
|
-
* @
|
|
3046
|
+
* @param {HTMLElement} element - current element.
|
|
3047
|
+
* @returns {boolean} - boolean.
|
|
3032
3048
|
*/
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
span.append('\n');
|
|
3036
|
-
return span;
|
|
3049
|
+
isCode(element) {
|
|
3050
|
+
return element.classList.contains('v-rte--code') || element.nodeName === 'CODE';
|
|
3037
3051
|
}
|
|
3038
|
-
}
|
|
3039
|
-
ElementToDTOHandlerAbstract.currentTextBlockElement = document.createElement('div');
|
|
3040
|
-
|
|
3041
|
-
/**
|
|
3042
|
-
* Transform image element to DTO.
|
|
3043
|
-
*/
|
|
3044
|
-
class ImageToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
3045
3052
|
/**
|
|
3046
|
-
*
|
|
3053
|
+
* Is bold element.
|
|
3047
3054
|
*
|
|
3048
|
-
* @param {HTMLElement} element -
|
|
3049
|
-
* @returns {boolean}
|
|
3055
|
+
* @param {HTMLElement} element - current element.
|
|
3056
|
+
* @returns {boolean} - boolean.
|
|
3050
3057
|
*/
|
|
3051
|
-
|
|
3052
|
-
return (element.
|
|
3053
|
-
|
|
3058
|
+
isBold(element) {
|
|
3059
|
+
return (element.nodeName === 'STRONG' ||
|
|
3060
|
+
element.style.fontWeight === 'bold' ||
|
|
3061
|
+
element.style.fontWeight === '700');
|
|
3054
3062
|
}
|
|
3055
3063
|
/**
|
|
3056
|
-
*
|
|
3064
|
+
* Is italic element.
|
|
3057
3065
|
*
|
|
3058
|
-
* @
|
|
3066
|
+
* @param {HTMLElement} element - current element.
|
|
3067
|
+
* @returns {boolean} - boolean.
|
|
3059
3068
|
*/
|
|
3060
|
-
|
|
3061
|
-
return
|
|
3069
|
+
isItalic(element) {
|
|
3070
|
+
return element.nodeName === 'I' || element.style.fontStyle === 'italic' || element.nodeName === 'EM';
|
|
3062
3071
|
}
|
|
3063
3072
|
/**
|
|
3064
|
-
*
|
|
3065
|
-
* When blockElement is exist, it means that the current element is a child node,
|
|
3066
|
-
* and we need to wait for its root block to be converted into a dto.
|
|
3067
|
-
* Otherwise, the current node is the root node, and we can directly convert it.
|
|
3073
|
+
* Is underline element.
|
|
3068
3074
|
*
|
|
3069
|
-
* @
|
|
3075
|
+
* @param {HTMLElement} element - current element.
|
|
3076
|
+
* @returns {boolean} - boolean.
|
|
3070
3077
|
*/
|
|
3071
|
-
|
|
3072
|
-
return
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
];
|
|
3078
|
+
isUnderline(element) {
|
|
3079
|
+
return (element.style.textDecoration.includes('underline') ||
|
|
3080
|
+
element.nodeName === 'U' ||
|
|
3081
|
+
element.classList.contains('v-rte--underline'));
|
|
3076
3082
|
}
|
|
3077
3083
|
/**
|
|
3078
|
-
*
|
|
3084
|
+
* Is strikethrough element.
|
|
3079
3085
|
*
|
|
3080
|
-
* @
|
|
3086
|
+
* @param {HTMLElement} element - current element.
|
|
3087
|
+
* @returns {boolean} - boolean.
|
|
3081
3088
|
*/
|
|
3082
|
-
|
|
3083
|
-
return
|
|
3089
|
+
isStrikethrough(element) {
|
|
3090
|
+
return (element.style.textDecoration.includes('line-through') ||
|
|
3091
|
+
element.nodeName === 'S' ||
|
|
3092
|
+
element.classList.contains('v-rte--strikethrough'));
|
|
3084
3093
|
}
|
|
3085
|
-
}
|
|
3086
|
-
|
|
3087
|
-
/**
|
|
3088
|
-
* Transform link element to DTO.
|
|
3089
|
-
*/
|
|
3090
|
-
class InlineBlockToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
3091
3094
|
/**
|
|
3092
|
-
*
|
|
3095
|
+
* Get current color of element.
|
|
3093
3096
|
*
|
|
3094
|
-
* @
|
|
3097
|
+
* @param {HTMLElement} element - current element.
|
|
3098
|
+
* @returns {Nullable<string>} - color.
|
|
3095
3099
|
*/
|
|
3096
|
-
|
|
3097
|
-
|
|
3100
|
+
getColor(element) {
|
|
3101
|
+
var _a;
|
|
3102
|
+
const color = element.style.color;
|
|
3103
|
+
const hexColor = (_a = rgbToHex(color)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
3104
|
+
if (hexColor) {
|
|
3105
|
+
const colorSchema = RTE_TEXT_COLORS.find((schema) => schema.light === hexColor || schema.dark === hexColor);
|
|
3106
|
+
if (colorSchema)
|
|
3107
|
+
return colorSchema.key;
|
|
3108
|
+
return null;
|
|
3109
|
+
}
|
|
3110
|
+
else {
|
|
3111
|
+
for (const color of RTE_TEXT_COLORS) {
|
|
3112
|
+
if (element.style.color.includes(color.key)) {
|
|
3113
|
+
return color.key;
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3116
|
+
return null;
|
|
3117
|
+
}
|
|
3098
3118
|
}
|
|
3099
3119
|
/**
|
|
3100
|
-
*
|
|
3120
|
+
* Get current link of element.
|
|
3101
3121
|
*
|
|
3102
|
-
* @
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3122
|
+
* @param {HTMLElement} element - current element.
|
|
3123
|
+
* @returns {Nullable<VegaRTELink>} - link.
|
|
3124
|
+
*/
|
|
3125
|
+
getLink(element) {
|
|
3126
|
+
if (element.nodeName === 'A') {
|
|
3127
|
+
return {
|
|
3128
|
+
href: element.href,
|
|
3129
|
+
groupKey: generateUUID(),
|
|
3130
|
+
};
|
|
3131
|
+
}
|
|
3132
|
+
return null;
|
|
3106
3133
|
}
|
|
3107
3134
|
/**
|
|
3108
|
-
*
|
|
3135
|
+
* Get text align of current element.
|
|
3109
3136
|
*
|
|
3110
|
-
* @
|
|
3137
|
+
* @param {HTMLElement} element - current element.
|
|
3138
|
+
* @returns {Nullable<VegaRTEBlockAlignment>} - Text align.
|
|
3111
3139
|
*/
|
|
3112
|
-
|
|
3113
|
-
|
|
3140
|
+
getTextAlign(element) {
|
|
3141
|
+
const classList = element.classList;
|
|
3142
|
+
if (classList.contains(`v-rte--horizontal-alignment-left`)) {
|
|
3143
|
+
return 'left';
|
|
3144
|
+
}
|
|
3145
|
+
else if (classList.contains(`v-rte--horizontal-alignment-center`)) {
|
|
3146
|
+
return 'center';
|
|
3147
|
+
}
|
|
3148
|
+
else if (classList.contains(`v-rte--horizontal-alignment-right`)) {
|
|
3149
|
+
return 'right';
|
|
3150
|
+
}
|
|
3151
|
+
else if (classList.contains(`v-rte--horizontal-alignment-justify`)) {
|
|
3152
|
+
return 'justify';
|
|
3153
|
+
}
|
|
3154
|
+
const style = element.style;
|
|
3155
|
+
switch (style.textAlign) {
|
|
3156
|
+
case 'center':
|
|
3157
|
+
return 'center';
|
|
3158
|
+
case 'right':
|
|
3159
|
+
return 'right';
|
|
3160
|
+
case 'justify':
|
|
3161
|
+
return 'justify';
|
|
3162
|
+
case 'left':
|
|
3163
|
+
return 'left';
|
|
3164
|
+
default:
|
|
3165
|
+
return null;
|
|
3166
|
+
}
|
|
3114
3167
|
}
|
|
3115
3168
|
/**
|
|
3116
|
-
* Get
|
|
3169
|
+
* Get indent of current element.
|
|
3117
3170
|
*
|
|
3118
|
-
* @param {
|
|
3119
|
-
* @returns {Nullable<
|
|
3120
|
-
*/
|
|
3121
|
-
|
|
3122
|
-
|
|
3171
|
+
* @param {HTMLElement} element - current element.
|
|
3172
|
+
* @returns {Nullable<number>} - Indent.
|
|
3173
|
+
*/
|
|
3174
|
+
getIndent(element) {
|
|
3175
|
+
const style = element.style;
|
|
3176
|
+
let marginLeft;
|
|
3177
|
+
if (style.marginLeft) {
|
|
3178
|
+
marginLeft = style.marginLeft;
|
|
3179
|
+
}
|
|
3180
|
+
else if (style.margin) {
|
|
3181
|
+
const margins = style.margin.split(' ');
|
|
3182
|
+
switch (margins.length) {
|
|
3183
|
+
case 4:
|
|
3184
|
+
marginLeft = margins[3];
|
|
3185
|
+
break;
|
|
3186
|
+
case 2:
|
|
3187
|
+
case 3:
|
|
3188
|
+
marginLeft = margins[1];
|
|
3189
|
+
break;
|
|
3190
|
+
default:
|
|
3191
|
+
marginLeft = margins[0];
|
|
3192
|
+
break;
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
else {
|
|
3196
|
+
return null;
|
|
3197
|
+
}
|
|
3198
|
+
const marginLeftNumber = Number(marginLeft.replace('px', ''));
|
|
3199
|
+
return marginLeftNumber && marginLeftNumber >= 0 ? Math.floor(marginLeftNumber / 16) : null;
|
|
3123
3200
|
}
|
|
3124
3201
|
}
|
|
3125
3202
|
|
|
3126
|
-
/**
|
|
3127
|
-
|
|
3128
|
-
*/
|
|
3129
|
-
class LinkToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
3130
|
-
constructor(element) {
|
|
3131
|
-
super(element);
|
|
3132
|
-
}
|
|
3203
|
+
/** Transform continue inline block elements to text block DTO */
|
|
3204
|
+
class ContinueInlineToRTETextBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3133
3205
|
/**
|
|
3134
|
-
* Can be
|
|
3206
|
+
* Can be handle.
|
|
3135
3207
|
*
|
|
3136
|
-
* @param {HTMLElement}
|
|
3137
|
-
* @
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3208
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3209
|
+
* @param {number} currentIndex - Current element index.
|
|
3210
|
+
* @returns {number} - can be handled element count.
|
|
3211
|
+
*/
|
|
3212
|
+
canHandle(elementsArray, currentIndex) {
|
|
3213
|
+
let count = 0;
|
|
3214
|
+
for (let i = currentIndex; i < elementsArray.length; i++) {
|
|
3215
|
+
const element = elementsArray[i];
|
|
3216
|
+
if (element.nodeType === Node.TEXT_NODE ||
|
|
3217
|
+
(ContinueInlineToRTETextBlockStrategy.canHandleTags.includes(element.nodeName) &&
|
|
3218
|
+
!(element.textContent === '' && element.querySelector('IMG')))) {
|
|
3219
|
+
count++;
|
|
3220
|
+
}
|
|
3221
|
+
else {
|
|
3222
|
+
break;
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
return count;
|
|
3149
3226
|
}
|
|
3150
3227
|
/**
|
|
3151
|
-
*
|
|
3228
|
+
* Parse to a text block.
|
|
3152
3229
|
*
|
|
3153
|
-
* @param {
|
|
3154
|
-
* @returns {RTEContentBlock
|
|
3155
|
-
*/
|
|
3156
|
-
handle(
|
|
3157
|
-
const
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3230
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3231
|
+
* @returns {Nullable<RTEContentBlock>} - Text block.
|
|
3232
|
+
*/
|
|
3233
|
+
handle(elementsArray) {
|
|
3234
|
+
const parent = elementsArray[0].parentElement;
|
|
3235
|
+
const nodes = this.generateChildNodes(elementsArray);
|
|
3236
|
+
if (nodes.length === 0)
|
|
3237
|
+
return null;
|
|
3238
|
+
return RTETextBlock.from({
|
|
3239
|
+
id: generateUUID(),
|
|
3240
|
+
type: 'paragraph',
|
|
3241
|
+
nodes: nodes,
|
|
3242
|
+
annotations: this.generateBlockAnnotations(parent),
|
|
3162
3243
|
});
|
|
3163
|
-
return [];
|
|
3164
3244
|
}
|
|
3245
|
+
/* istanbul ignore next */
|
|
3246
|
+
/**
|
|
3247
|
+
* Append child blocks.
|
|
3248
|
+
*/
|
|
3249
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3250
|
+
appendChildBlocks() { }
|
|
3165
3251
|
/**
|
|
3166
|
-
*
|
|
3252
|
+
* Should continue process to child elements.
|
|
3167
3253
|
*
|
|
3168
|
-
* @returns {
|
|
3254
|
+
* @returns {boolean} - boolean.
|
|
3169
3255
|
*/
|
|
3170
|
-
|
|
3171
|
-
return
|
|
3256
|
+
shouldProceedToElementChildren() {
|
|
3257
|
+
return false;
|
|
3172
3258
|
}
|
|
3173
3259
|
}
|
|
3260
|
+
ContinueInlineToRTETextBlockStrategy.canHandleTags = [
|
|
3261
|
+
'SPAN',
|
|
3262
|
+
'STRONG',
|
|
3263
|
+
'CODE',
|
|
3264
|
+
'I',
|
|
3265
|
+
'EM',
|
|
3266
|
+
'S',
|
|
3267
|
+
'U',
|
|
3268
|
+
'A',
|
|
3269
|
+
'VEGA-RICH-TEXT-LINK-EDITOR',
|
|
3270
|
+
];
|
|
3174
3271
|
|
|
3175
|
-
/**
|
|
3176
|
-
|
|
3177
|
-
*/
|
|
3178
|
-
class ListItemToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
3272
|
+
/** Transform ul element to list block DTO */
|
|
3273
|
+
class UlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3179
3274
|
/**
|
|
3180
|
-
* Can be
|
|
3275
|
+
* Can be handle.
|
|
3181
3276
|
*
|
|
3182
|
-
* @param {HTMLElement}
|
|
3183
|
-
* @
|
|
3277
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3278
|
+
* @param {number} currentIndex - Current element index.
|
|
3279
|
+
* @returns {number} - can be handled element count.
|
|
3184
3280
|
*/
|
|
3185
|
-
|
|
3186
|
-
return ['
|
|
3281
|
+
canHandle(elementsArray, currentIndex) {
|
|
3282
|
+
return elementsArray[currentIndex].tagName === 'UL' ? 1 : 0;
|
|
3187
3283
|
}
|
|
3188
3284
|
/**
|
|
3189
|
-
*
|
|
3285
|
+
* Parse to a block.
|
|
3190
3286
|
*
|
|
3191
|
-
* @
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3287
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3288
|
+
* @returns {Nullable<RTEContentBlock>} - Bullet list block.
|
|
3289
|
+
*/
|
|
3290
|
+
handle(elementsArray) {
|
|
3291
|
+
if (elementsArray[0].childNodes.length === 0)
|
|
3292
|
+
return null;
|
|
3293
|
+
return RTEListBlock.from({
|
|
3294
|
+
id: generateUUID(),
|
|
3295
|
+
type: 'bullet-list',
|
|
3296
|
+
blocks: [],
|
|
3297
|
+
annotations: this.generateBlockAnnotations(elementsArray[0]),
|
|
3298
|
+
});
|
|
3195
3299
|
}
|
|
3196
3300
|
/**
|
|
3197
|
-
* Append list item
|
|
3301
|
+
* Append child list item blocks to current list block.
|
|
3198
3302
|
*
|
|
3199
|
-
* @param {
|
|
3200
|
-
* @
|
|
3303
|
+
* @param {RTEListBlock} currentBlock - Current list block.
|
|
3304
|
+
* @param {RTEListItemBlock[]} childBlocks - Current list item blocks.
|
|
3201
3305
|
*/
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3306
|
+
appendChildBlocks(currentBlock, childBlocks) {
|
|
3307
|
+
currentBlock.blocks = childBlocks;
|
|
3308
|
+
childBlocks.forEach((block) => (block.parent = currentBlock));
|
|
3205
3309
|
}
|
|
3206
3310
|
/**
|
|
3207
|
-
*
|
|
3311
|
+
* Should continue process to child elements.
|
|
3208
3312
|
*
|
|
3209
|
-
* @returns {
|
|
3313
|
+
* @returns {boolean} - boolean.
|
|
3210
3314
|
*/
|
|
3211
|
-
|
|
3212
|
-
return
|
|
3315
|
+
shouldProceedToElementChildren() {
|
|
3316
|
+
return true;
|
|
3213
3317
|
}
|
|
3214
3318
|
}
|
|
3215
3319
|
|
|
3216
|
-
/**
|
|
3217
|
-
|
|
3218
|
-
*/
|
|
3219
|
-
class ListToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
3320
|
+
/** Transform li element to list item block DTO */
|
|
3321
|
+
class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3220
3322
|
/**
|
|
3221
|
-
* Can be
|
|
3323
|
+
* Can be handle.
|
|
3222
3324
|
*
|
|
3223
|
-
* @param {HTMLElement}
|
|
3224
|
-
* @
|
|
3325
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3326
|
+
* @param {number} currentIndex - Current element index.
|
|
3327
|
+
* @returns {number} - can be handled element count.
|
|
3225
3328
|
*/
|
|
3226
|
-
|
|
3227
|
-
return ['
|
|
3329
|
+
canHandle(elementsArray, currentIndex) {
|
|
3330
|
+
return elementsArray[currentIndex].tagName === 'LI' ? 1 : 0;
|
|
3228
3331
|
}
|
|
3229
3332
|
/**
|
|
3230
|
-
*
|
|
3333
|
+
* Parse to a list item block.
|
|
3231
3334
|
*
|
|
3232
|
-
* @
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3335
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3336
|
+
* @returns {Nullable<RTEContentBlock>} - List item block.
|
|
3337
|
+
*/
|
|
3338
|
+
handle(elementsArray) {
|
|
3339
|
+
if (elementsArray[0].childNodes.length === 0)
|
|
3340
|
+
return null;
|
|
3341
|
+
return RTEListItemBlock.from({
|
|
3342
|
+
id: generateUUID(),
|
|
3343
|
+
type: 'list-item',
|
|
3344
|
+
nodes: this.generateChildNodes(Array.from(elementsArray[0].childNodes).filter((item) => !['UL', 'OL'].includes(item.nodeName))),
|
|
3345
|
+
annotations: this.generateBlockAnnotations(elementsArray[0]),
|
|
3346
|
+
});
|
|
3236
3347
|
}
|
|
3237
3348
|
/**
|
|
3238
|
-
*
|
|
3239
|
-
* When blockElement is exist, it means that the current element is a child node,
|
|
3240
|
-
* and we need to append and wait for its root block to be converted into a dto.
|
|
3241
|
-
* Otherwise, the current node is the root node, and we can directly convert it.
|
|
3349
|
+
* Append child list blocks to current list item block.
|
|
3242
3350
|
*
|
|
3243
|
-
* @param {
|
|
3244
|
-
* @
|
|
3351
|
+
* @param {RTEListBlock} currentBlock - Current list item block.
|
|
3352
|
+
* @param {RTEListItemBlock[]} childBlocks - Current list blocks.
|
|
3245
3353
|
*/
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
return [];
|
|
3249
|
-
}
|
|
3250
|
-
if (blockElement && ListItemToDTOHandler.canHandle(blockElement)) {
|
|
3251
|
-
blockElement.append(this.currentVirtualElement);
|
|
3252
|
-
return [];
|
|
3253
|
-
}
|
|
3254
|
-
else {
|
|
3255
|
-
return [
|
|
3256
|
-
ElementToDTOHandlerAbstract.currentTextBlockElementToDTO(),
|
|
3257
|
-
RTEListBlock.fromHTML(this.currentVirtualElement),
|
|
3258
|
-
];
|
|
3259
|
-
}
|
|
3354
|
+
appendChildBlocks(currentBlock, childBlocks) {
|
|
3355
|
+
currentBlock.children = childBlocks.filter((block) => ['bullet-list', 'number-list'].includes(block.type));
|
|
3260
3356
|
}
|
|
3261
3357
|
/**
|
|
3262
|
-
*
|
|
3358
|
+
* Should continue process to child elements.
|
|
3263
3359
|
*
|
|
3264
|
-
* @returns {
|
|
3360
|
+
* @returns {boolean} - boolean.
|
|
3265
3361
|
*/
|
|
3266
|
-
|
|
3267
|
-
return
|
|
3362
|
+
shouldProceedToElementChildren() {
|
|
3363
|
+
return true;
|
|
3268
3364
|
}
|
|
3269
3365
|
}
|
|
3270
3366
|
|
|
3271
|
-
/**
|
|
3272
|
-
|
|
3273
|
-
*/
|
|
3274
|
-
class ParagraphToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
3367
|
+
/** Transform inline block element to text block DTO */
|
|
3368
|
+
class InlineBlockToRTETextBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3275
3369
|
/**
|
|
3276
|
-
* Can be
|
|
3370
|
+
* Can be handle.
|
|
3277
3371
|
*
|
|
3278
|
-
* @param {HTMLElement}
|
|
3279
|
-
* @
|
|
3372
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3373
|
+
* @param {number} currentIndex - Current element index.
|
|
3374
|
+
* @returns {number} - can be handled element count.
|
|
3280
3375
|
*/
|
|
3281
|
-
|
|
3282
|
-
return ['
|
|
3376
|
+
canHandle(elementsArray, currentIndex) {
|
|
3377
|
+
return ['heading-1', 'heading-2', 'heading-3', 'title', 'subtitle'].includes(this.getElementType(elementsArray[currentIndex]))
|
|
3378
|
+
? 1
|
|
3379
|
+
: 0;
|
|
3283
3380
|
}
|
|
3284
3381
|
/**
|
|
3285
|
-
*
|
|
3382
|
+
* Parse to a text block.
|
|
3286
3383
|
*
|
|
3287
|
-
* @
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
*/
|
|
3301
|
-
handle(blockElement) {
|
|
3302
|
-
if (this.handleEmptyBlock(blockElement)) {
|
|
3303
|
-
return [];
|
|
3304
|
-
}
|
|
3305
|
-
if (blockElement && !ParagraphToDTOHandler.canHandle(blockElement)) {
|
|
3306
|
-
blockElement.append(...Array.from(this.currentVirtualElement.childNodes));
|
|
3307
|
-
return [];
|
|
3308
|
-
}
|
|
3309
|
-
else {
|
|
3310
|
-
return [
|
|
3311
|
-
ElementToDTOHandlerAbstract.currentTextBlockElementToDTO(),
|
|
3312
|
-
RTETextBlock.fromHTML(this.currentVirtualElement, 'paragraph'),
|
|
3313
|
-
];
|
|
3314
|
-
}
|
|
3384
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3385
|
+
* @returns {Nullable<RTEContentBlock>} - Text block.
|
|
3386
|
+
*/
|
|
3387
|
+
handle(elementsArray) {
|
|
3388
|
+
const nodes = this.generateChildNodes(elementsArray);
|
|
3389
|
+
if (nodes.length === 0)
|
|
3390
|
+
return null;
|
|
3391
|
+
return RTETextBlock.from({
|
|
3392
|
+
id: generateUUID(),
|
|
3393
|
+
type: this.getElementType(elementsArray[0]),
|
|
3394
|
+
nodes: nodes,
|
|
3395
|
+
annotations: Object.assign(Object.assign({}, this.generateBlockAnnotations(elementsArray[0])), { textStyle: this.getElementType(elementsArray[0]) }),
|
|
3396
|
+
});
|
|
3315
3397
|
}
|
|
3398
|
+
/* istanbul ignore next */
|
|
3316
3399
|
/**
|
|
3317
|
-
*
|
|
3318
|
-
*
|
|
3319
|
-
* @returns {HTMLElement} - Block element for child nodes.
|
|
3400
|
+
* Append child blocks.
|
|
3320
3401
|
*/
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
|
-
|
|
3326
|
-
/**
|
|
3327
|
-
* Transform text block element to DTO.
|
|
3328
|
-
*/
|
|
3329
|
-
class TextBlockToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
3402
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3403
|
+
appendChildBlocks() { }
|
|
3330
3404
|
/**
|
|
3331
|
-
*
|
|
3405
|
+
* Should continue process to child elements.
|
|
3332
3406
|
*
|
|
3333
|
-
* @
|
|
3334
|
-
* @returns {boolean} Result.
|
|
3407
|
+
* @returns {boolean} - boolean.
|
|
3335
3408
|
*/
|
|
3336
|
-
|
|
3337
|
-
return
|
|
3409
|
+
shouldProceedToElementChildren() {
|
|
3410
|
+
return false;
|
|
3338
3411
|
}
|
|
3339
3412
|
/**
|
|
3340
|
-
* Get type of element.
|
|
3413
|
+
* Get node type of element.
|
|
3341
3414
|
*
|
|
3342
|
-
* @param {HTMLElement} element -
|
|
3343
|
-
* @returns {string} type.
|
|
3415
|
+
* @param {HTMLElement} element - element.
|
|
3416
|
+
* @returns {string} - node type.
|
|
3344
3417
|
*/
|
|
3345
|
-
|
|
3418
|
+
getElementType(element) {
|
|
3419
|
+
var _a;
|
|
3346
3420
|
if (element.nodeType !== Node.TEXT_NODE && element.hasAttribute('data-type')) {
|
|
3347
3421
|
return element.getAttribute('data-type');
|
|
3348
3422
|
}
|
|
3423
|
+
switch ((_a = element.style) === null || _a === void 0 ? void 0 : _a.fontSize) {
|
|
3424
|
+
case '36px':
|
|
3425
|
+
return 'title';
|
|
3426
|
+
case '28px':
|
|
3427
|
+
return 'subtitle';
|
|
3428
|
+
case '22px':
|
|
3429
|
+
return 'heading-1';
|
|
3430
|
+
case '20px':
|
|
3431
|
+
return 'heading-2';
|
|
3432
|
+
case '18px':
|
|
3433
|
+
return 'heading-3';
|
|
3434
|
+
}
|
|
3349
3435
|
switch (element.nodeName) {
|
|
3350
3436
|
case 'H1':
|
|
3351
3437
|
return 'heading-1';
|
|
@@ -3357,139 +3443,269 @@ class TextBlockToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
|
3357
3443
|
return '';
|
|
3358
3444
|
}
|
|
3359
3445
|
}
|
|
3446
|
+
}
|
|
3447
|
+
|
|
3448
|
+
/** Transform img element to image block DTO */
|
|
3449
|
+
class ImgToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3360
3450
|
/**
|
|
3361
|
-
*
|
|
3451
|
+
* Can be handle.
|
|
3362
3452
|
*
|
|
3363
|
-
* @
|
|
3453
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3454
|
+
* @param {number} currentIndex - Current element index.
|
|
3455
|
+
* @returns {number} - can be handled element count.
|
|
3364
3456
|
*/
|
|
3365
|
-
|
|
3366
|
-
return
|
|
3457
|
+
canHandle(elementsArray, currentIndex) {
|
|
3458
|
+
return elementsArray[currentIndex].tagName === 'IMG' ? 1 : 0;
|
|
3367
3459
|
}
|
|
3368
3460
|
/**
|
|
3369
|
-
*
|
|
3370
|
-
* When blockElement is exist, it means that the current element is a child node,
|
|
3371
|
-
* and we need to wait for its root block to be converted into a dto.
|
|
3372
|
-
* Otherwise, the current node is the root node, and we can directly convert it.
|
|
3461
|
+
* Parse to a image block.
|
|
3373
3462
|
*
|
|
3374
|
-
* @param {
|
|
3375
|
-
* @returns {RTEContentBlock
|
|
3376
|
-
*/
|
|
3377
|
-
handle(
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3463
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3464
|
+
* @returns {Nullable<RTEContentBlock>} - Image block.
|
|
3465
|
+
*/
|
|
3466
|
+
handle(elementsArray) {
|
|
3467
|
+
const element = elementsArray[0];
|
|
3468
|
+
return RTEImageBlock.from({
|
|
3469
|
+
id: generateUUID(),
|
|
3470
|
+
type: 'image',
|
|
3471
|
+
nodes: [
|
|
3472
|
+
{
|
|
3473
|
+
id: generateUUID(),
|
|
3474
|
+
type: 'image',
|
|
3475
|
+
url: element.src,
|
|
3476
|
+
annotations: {
|
|
3477
|
+
size: 'md',
|
|
3478
|
+
alt: element.alt,
|
|
3479
|
+
},
|
|
3480
|
+
},
|
|
3481
|
+
],
|
|
3482
|
+
annotations: this.generateBlockAnnotations(element),
|
|
3483
|
+
});
|
|
3391
3484
|
}
|
|
3485
|
+
/* istanbul ignore next */
|
|
3392
3486
|
/**
|
|
3393
|
-
*
|
|
3487
|
+
* Append child blocks.
|
|
3488
|
+
*/
|
|
3489
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3490
|
+
appendChildBlocks() { }
|
|
3491
|
+
/**
|
|
3492
|
+
* Should continue process to child elements.
|
|
3394
3493
|
*
|
|
3395
|
-
* @returns {
|
|
3494
|
+
* @returns {boolean} - boolean.
|
|
3396
3495
|
*/
|
|
3397
|
-
|
|
3398
|
-
return
|
|
3496
|
+
shouldProceedToElementChildren() {
|
|
3497
|
+
return false;
|
|
3399
3498
|
}
|
|
3400
3499
|
}
|
|
3401
3500
|
|
|
3402
|
-
/**
|
|
3403
|
-
|
|
3404
|
-
*/
|
|
3405
|
-
class TextToDTOHandler extends ElementToDTOHandlerAbstract {
|
|
3501
|
+
/** Transform vega-rich-text-image-editor element to image block DTO */
|
|
3502
|
+
class VegaImageToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3406
3503
|
/**
|
|
3407
|
-
* Can be
|
|
3504
|
+
* Can be handle.
|
|
3408
3505
|
*
|
|
3409
|
-
* @param {HTMLElement}
|
|
3410
|
-
* @
|
|
3506
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3507
|
+
* @param {number} currentIndex - Current element index.
|
|
3508
|
+
* @returns {number} - can be handled element count.
|
|
3411
3509
|
*/
|
|
3412
|
-
|
|
3413
|
-
return
|
|
3510
|
+
canHandle(elementsArray, currentIndex) {
|
|
3511
|
+
return elementsArray[currentIndex].tagName === 'VEGA-RICH-TEXT-IMAGE-EDITOR' ? 1 : 0;
|
|
3512
|
+
}
|
|
3513
|
+
/**
|
|
3514
|
+
* Parse to a image block.
|
|
3515
|
+
*
|
|
3516
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3517
|
+
* @returns {Nullable<RTEContentBlock>} - Image block.
|
|
3518
|
+
*/
|
|
3519
|
+
handle(elementsArray) {
|
|
3520
|
+
const element = elementsArray[0];
|
|
3521
|
+
const image = element.querySelector('img');
|
|
3522
|
+
return RTEImageBlock.from({
|
|
3523
|
+
id: generateUUID(),
|
|
3524
|
+
type: 'image',
|
|
3525
|
+
nodes: [
|
|
3526
|
+
{
|
|
3527
|
+
id: generateUUID(),
|
|
3528
|
+
type: 'image',
|
|
3529
|
+
url: image.src,
|
|
3530
|
+
annotations: {
|
|
3531
|
+
size: element.size || 'md',
|
|
3532
|
+
alt: element.alt,
|
|
3533
|
+
},
|
|
3534
|
+
},
|
|
3535
|
+
],
|
|
3536
|
+
annotations: this.generateBlockAnnotations(element),
|
|
3537
|
+
});
|
|
3414
3538
|
}
|
|
3415
3539
|
/* istanbul ignore next */
|
|
3416
3540
|
/**
|
|
3417
|
-
*
|
|
3541
|
+
* Append child blocks.
|
|
3542
|
+
*/
|
|
3543
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3544
|
+
appendChildBlocks() { }
|
|
3545
|
+
/**
|
|
3546
|
+
* Should continue process to child elements.
|
|
3418
3547
|
*
|
|
3419
|
-
* @returns {
|
|
3548
|
+
* @returns {boolean} - boolean.
|
|
3420
3549
|
*/
|
|
3421
|
-
|
|
3422
|
-
return
|
|
3550
|
+
shouldProceedToElementChildren() {
|
|
3551
|
+
return false;
|
|
3423
3552
|
}
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3555
|
+
/** Transform ol element to list block DTO */
|
|
3556
|
+
class OlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3424
3557
|
/**
|
|
3425
|
-
*
|
|
3558
|
+
* Can be handle.
|
|
3426
3559
|
*
|
|
3427
|
-
* @param {
|
|
3428
|
-
* @
|
|
3560
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3561
|
+
* @param {number} currentIndex - Current element index.
|
|
3562
|
+
* @returns {number} - can be handled element count.
|
|
3429
3563
|
*/
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
return [];
|
|
3564
|
+
canHandle(elementsArray, currentIndex) {
|
|
3565
|
+
return elementsArray[currentIndex].tagName === 'OL' ? 1 : 0;
|
|
3433
3566
|
}
|
|
3434
|
-
/* istanbul ignore next */
|
|
3435
3567
|
/**
|
|
3436
|
-
*
|
|
3568
|
+
* Parse to a number list block.
|
|
3437
3569
|
*
|
|
3438
|
-
* @param {
|
|
3439
|
-
* @returns {Nullable<
|
|
3570
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3571
|
+
* @returns {Nullable<RTEContentBlock>} - Number list block.
|
|
3572
|
+
*/
|
|
3573
|
+
handle(elementsArray) {
|
|
3574
|
+
if (elementsArray[0].childNodes.length === 0)
|
|
3575
|
+
return null;
|
|
3576
|
+
return RTEListBlock.from({
|
|
3577
|
+
id: generateUUID(),
|
|
3578
|
+
type: 'number-list',
|
|
3579
|
+
blocks: [],
|
|
3580
|
+
annotations: this.generateBlockAnnotations(elementsArray[0]),
|
|
3581
|
+
});
|
|
3582
|
+
}
|
|
3583
|
+
/**
|
|
3584
|
+
* Append child list item blocks to current list block.
|
|
3585
|
+
*
|
|
3586
|
+
* @param {RTEListBlock} currentBlock - Current list block.
|
|
3587
|
+
* @param {RTEListItemBlock[]} childBlocks - Current list item blocks.
|
|
3440
3588
|
*/
|
|
3441
|
-
|
|
3442
|
-
|
|
3589
|
+
appendChildBlocks(currentBlock, childBlocks) {
|
|
3590
|
+
currentBlock.blocks = childBlocks;
|
|
3591
|
+
childBlocks.forEach((block) => (block.parent = currentBlock));
|
|
3592
|
+
}
|
|
3593
|
+
/**
|
|
3594
|
+
* Should continue process to child elements.
|
|
3595
|
+
*
|
|
3596
|
+
* @returns {boolean} - boolean.
|
|
3597
|
+
*/
|
|
3598
|
+
shouldProceedToElementChildren() {
|
|
3599
|
+
return true;
|
|
3443
3600
|
}
|
|
3444
3601
|
}
|
|
3445
3602
|
|
|
3446
|
-
/**
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3603
|
+
/** Transform img in span or other inline element to image block DTO */
|
|
3604
|
+
class SpanImageToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3605
|
+
/**
|
|
3606
|
+
* Can be handle.
|
|
3607
|
+
*
|
|
3608
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3609
|
+
* @param {number} currentIndex - Current element index.
|
|
3610
|
+
* @returns {number} - can be handled element count.
|
|
3611
|
+
*/
|
|
3612
|
+
canHandle(elementsArray, currentIndex) {
|
|
3613
|
+
const element = elementsArray[currentIndex];
|
|
3614
|
+
return element.nodeType === Node.ELEMENT_NODE &&
|
|
3615
|
+
element.textContent === '' &&
|
|
3616
|
+
element.querySelector('img')
|
|
3617
|
+
? 1
|
|
3618
|
+
: 0;
|
|
3461
3619
|
}
|
|
3462
3620
|
/**
|
|
3463
|
-
*
|
|
3621
|
+
* Parse to a image block.
|
|
3464
3622
|
*
|
|
3465
|
-
* @param {HTMLElement}
|
|
3466
|
-
* @returns {RTEContentBlock
|
|
3623
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3624
|
+
* @returns {Nullable<RTEContentBlock>} - Image block.
|
|
3625
|
+
*/
|
|
3626
|
+
handle(elementsArray) {
|
|
3627
|
+
const element = elementsArray[0].querySelector('img');
|
|
3628
|
+
return RTEImageBlock.from({
|
|
3629
|
+
id: generateUUID(),
|
|
3630
|
+
type: 'image',
|
|
3631
|
+
nodes: [
|
|
3632
|
+
{
|
|
3633
|
+
id: generateUUID(),
|
|
3634
|
+
type: 'image',
|
|
3635
|
+
url: element.src,
|
|
3636
|
+
annotations: {
|
|
3637
|
+
size: 'md',
|
|
3638
|
+
alt: element.alt,
|
|
3639
|
+
},
|
|
3640
|
+
},
|
|
3641
|
+
],
|
|
3642
|
+
annotations: this.generateBlockAnnotations(element),
|
|
3643
|
+
});
|
|
3644
|
+
}
|
|
3645
|
+
/* istanbul ignore next */
|
|
3646
|
+
/**
|
|
3647
|
+
* Append child blocks.
|
|
3467
3648
|
*/
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3649
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3650
|
+
appendChildBlocks() { }
|
|
3651
|
+
/**
|
|
3652
|
+
* Should continue process to child elements.
|
|
3653
|
+
*
|
|
3654
|
+
* @returns {boolean} - boolean.
|
|
3655
|
+
*/
|
|
3656
|
+
shouldProceedToElementChildren() {
|
|
3657
|
+
return false;
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
/** Element to DTO processor */
|
|
3662
|
+
class ElementToDtoStrategyProcessor {
|
|
3663
|
+
constructor() {
|
|
3664
|
+
this.elementStrategies = [
|
|
3665
|
+
new UlToRTEListBlockStrategy(),
|
|
3666
|
+
new OlToRTEListBlockStrategy(),
|
|
3667
|
+
new LiToRTEListItemBlockStrategy(),
|
|
3668
|
+
new InlineBlockToRTETextBlockStrategy(),
|
|
3669
|
+
new ImgToRTEImageBlockStrategy(),
|
|
3670
|
+
new VegaImageToRTEImageBlockStrategy(),
|
|
3671
|
+
new SpanImageToRTEImageBlockStrategy(),
|
|
3672
|
+
new ContinueInlineToRTETextBlockStrategy(),
|
|
3673
|
+
];
|
|
3472
3674
|
}
|
|
3473
3675
|
/**
|
|
3474
|
-
* Transform
|
|
3676
|
+
* Transform process.
|
|
3475
3677
|
*
|
|
3476
|
-
* @param {HTMLElement[]} elements -
|
|
3477
|
-
* @
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
const
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3678
|
+
* @param {HTMLElement[]} elements - Current elements.
|
|
3679
|
+
* @returns {ElementToDTOStrategyOutput[]} - outputs.
|
|
3680
|
+
*/
|
|
3681
|
+
process(elements) {
|
|
3682
|
+
const outputs = [];
|
|
3683
|
+
for (let i = 0; i < elements.length; i++) {
|
|
3684
|
+
if (this.isInvalidElement(elements[i]))
|
|
3685
|
+
continue;
|
|
3686
|
+
let canHandledCount = 0;
|
|
3687
|
+
for (const strategy of this.elementStrategies) {
|
|
3688
|
+
canHandledCount = strategy.canHandle(elements, i);
|
|
3689
|
+
if (canHandledCount > 0) {
|
|
3690
|
+
const handledElements = elements.slice(i, i + canHandledCount);
|
|
3691
|
+
const output = new ElementToDTOStrategyOutput(strategy, handledElements);
|
|
3692
|
+
if (canHandledCount === 1 && strategy.shouldProceedToElementChildren()) {
|
|
3693
|
+
output.setChildrenOutput(this.process(Array.from(handledElements[0].childNodes)));
|
|
3694
|
+
}
|
|
3695
|
+
outputs.push(output);
|
|
3696
|
+
i += canHandledCount - 1;
|
|
3697
|
+
break;
|
|
3698
|
+
}
|
|
3489
3699
|
}
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3700
|
+
if (canHandledCount === 0 && i < elements.length) {
|
|
3701
|
+
const elementChildren = Array.from(elements[i].childNodes);
|
|
3702
|
+
const childrenOutputs = this.process(Array.from(elementChildren));
|
|
3703
|
+
if (childrenOutputs.length > 0) {
|
|
3704
|
+
outputs.push(...childrenOutputs);
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
}
|
|
3708
|
+
return outputs;
|
|
3493
3709
|
}
|
|
3494
3710
|
/**
|
|
3495
3711
|
* Checks if the given element is valid to parse.
|
|
@@ -3500,11 +3716,6 @@ class ElementToDTOProcessor {
|
|
|
3500
3716
|
isInvalidElement(element) {
|
|
3501
3717
|
if (element.nodeType === Node.COMMENT_NODE)
|
|
3502
3718
|
return true;
|
|
3503
|
-
if (element.nodeType === Node.TEXT_NODE && element.nodeValue.includes('\t')) {
|
|
3504
|
-
const value = element.nodeValue.replace(/\n|\t/gm, '');
|
|
3505
|
-
if (value.length === 0)
|
|
3506
|
-
return true;
|
|
3507
|
-
}
|
|
3508
3719
|
return ['META', 'BUTTON', 'STYLE'].includes(element.nodeName);
|
|
3509
3720
|
}
|
|
3510
3721
|
}
|
|
@@ -3515,7 +3726,7 @@ class ElementToDTOProcessor {
|
|
|
3515
3726
|
class InsertPasteHandler extends BaseHandler {
|
|
3516
3727
|
constructor() {
|
|
3517
3728
|
super(...arguments);
|
|
3518
|
-
this.elementToDTOProcessor = new
|
|
3729
|
+
this.elementToDTOProcessor = new ElementToDtoStrategyProcessor();
|
|
3519
3730
|
}
|
|
3520
3731
|
/**
|
|
3521
3732
|
* Update the state value when user paste html elements.
|
|
@@ -3581,7 +3792,11 @@ class InsertPasteHandler extends BaseHandler {
|
|
|
3581
3792
|
const pastedHTML = event.dataTransfer.getData('text/html');
|
|
3582
3793
|
const tempContainer = document.createElement('div');
|
|
3583
3794
|
tempContainer.innerHTML = pastedHTML;
|
|
3584
|
-
return this.elementToDTOProcessor
|
|
3795
|
+
return this.elementToDTOProcessor
|
|
3796
|
+
.process(Array.from(tempContainer.childNodes))
|
|
3797
|
+
.filter(Boolean)
|
|
3798
|
+
.map((output) => output.toDto())
|
|
3799
|
+
.filter(Boolean);
|
|
3585
3800
|
}
|
|
3586
3801
|
/**
|
|
3587
3802
|
* Moves the caret to the next block element in a rich text editor.
|