@globalpayments/vega 2.33.0 → 2.34.1
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/_commonjsHelpers-537d719a.js +20 -0
- package/dist/cjs/{app-globals-d28dd560.js → app-globals-48582633.js} +31 -22
- package/dist/cjs/block-annotation.abstract-4d88b939.js +875 -0
- package/dist/cjs/{breakpoints-7e2dff90.js → breakpoints-17d6c4c7.js} +2 -13
- package/dist/cjs/breakpoints-ebde4837.js +14 -0
- package/dist/cjs/{change-manager-a297e4d2.js → change-manager-bda1d107.js} +1 -1
- package/dist/cjs/{chevron-down-ca2fa88e.js → chevron-down-9847bf78.js} +0 -5
- package/dist/cjs/chevron-up-21465cf7.js +7 -0
- package/dist/cjs/{child-nodes-event-prevent-slimmer-f07a8fe9.js → child-nodes-event-prevent-slimmer-e1a6e5ad.js} +3 -3
- package/dist/cjs/{child-nodes-notify-observer-slimmer-79f2f5a7.js → child-nodes-notify-observer-slimmer-03a3f79e.js} +5 -5
- package/dist/cjs/{component-73a88c4e.js → component-63af66ea.js} +1 -1
- package/dist/cjs/{component-global-style-slimmer-6749808c.js → component-global-style-slimmer-6b64a26c.js} +1 -1
- package/dist/cjs/{component-usage-runtime-metrics-1ee24991.js → component-usage-runtime-metrics-019d3c00.js} +2 -2
- package/dist/cjs/content-state-6a5b9736.js +1954 -0
- package/dist/cjs/{create-public-api-runtime-metrics-slimmer-5cc88124.js → create-public-api-runtime-metrics-slimmer-8c6a8fb7.js} +3 -3
- package/dist/cjs/{date-0a6bb035.js → date-ffe382a4.js} +1 -1
- package/dist/cjs/{deprecated-property-slimmer-fc729fd9.js → deprecated-property-slimmer-f36e3779.js} +2 -2
- package/dist/cjs/{design-token-92906579.js → design-token-908e3f69.js} +5 -5
- package/dist/cjs/{vega-event-id-81270f6a.js → dom-node-subject-observer-factory-093462f1.js} +170 -0
- package/dist/cjs/{dynamic-slimmer-f31fdfd7.js → dynamic-slimmer-dc30600a.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-415d261a.js → element-appender-slimmer-0dd70e61.js} +17 -10
- package/dist/cjs/{event-emit-slimmer-83278943.js → event-emit-slimmer-a46bb411.js} +5 -5
- package/dist/cjs/{feature-flag-controller-0d1015fa.js → feature-flag-controller-e97b5f29.js} +3 -3
- package/dist/cjs/{form-field-controller-slimmer-2a982ead.js → form-field-controller-slimmer-9aeabcdc.js} +16 -17
- package/dist/cjs/{index-09acd3c9.js → global-slimmer-registry-dd2691b8.js} +296 -274
- package/dist/cjs/{icon-manager-3787af39.js → icon-manager-36dcfb65.js} +2 -2
- package/dist/cjs/index-8b247c17.js +325 -0
- package/dist/cjs/index.cjs.js +37 -30
- package/dist/cjs/{inject-keyboard-manager-e79a1ade.js → inject-keyboard-manager-af37c861.js} +1 -1
- package/dist/cjs/{internal-icon-manager-2ff58050.js → internal-icon-manager-2282a62f.js} +1 -1
- package/dist/cjs/{internal-vega-event-manager-5fe83465.js → internal-vega-event-manager-d7643ec6.js} +72 -68
- package/dist/cjs/{internal-vega-z-index-manager-f03ddb37.js → internal-vega-z-index-manager-e24e4309.js} +1 -1
- package/dist/cjs/{keyboard-manager-34b78600.js → keyboard-manager-5afbc8f1.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-8e2d4b5d.js → keyboard-manager-slimmer-9be2a880.js} +2 -2
- package/dist/cjs/loader.cjs.js +28 -23
- package/dist/cjs/{mutation-observer-slimmer-895b3d3e.js → mutation-observer-slimmer-98bbbdf0.js} +1 -1
- package/dist/cjs/{vega-skeleton-loader-controller-4a1eedcd.js → node.abstract-f8075f84.js} +234 -840
- package/dist/cjs/{page-resize-observer-slimmer-a8cf1874.js → page-resize-observer-slimmer-e54fa9d4.js} +2 -2
- package/dist/cjs/{remote-invocation-registry-32aaf6c2.js → remote-invocation-registry-71a45468.js} +4 -4
- package/dist/cjs/{required-field-rule-9a57b1a0.js → required-field-rule-7f9945fa.js} +2 -1
- package/dist/cjs/{responsive-format-facade-ad2f67bf.js → responsive-format-facade-74079f1b.js} +3 -3
- package/dist/cjs/{state-background-color-formatter-418b84e6.js → state-background-color-formatter-d32a1098.js} +2 -2
- package/dist/cjs/{static-subject-title-471e1793.js → static-subject-title-d66b88fb.js} +2 -0
- package/dist/cjs/{string-input-formatter-slimmer-79272527.js → string-input-formatter-slimmer-297765c0.js} +2 -2
- package/dist/cjs/{style-formatter-68f3a5f8.js → style-formatter-5deb065f.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-13f1892b.js → sub-state-notify-slimmer-73201c53.js} +6 -7
- package/dist/cjs/{sub-state-observer-slimmer-6c0b635d.js → sub-state-observer-slimmer-10c0d402.js} +6 -7
- package/dist/cjs/{synchronize-task-queue-8977cf10.js → synchronize-task-queue-1ee80e94.js} +10 -1
- package/dist/cjs/text-color-toolbar-button-slimmer-21a166e4.js +210 -0
- package/dist/cjs/text-node-494856f3.js +955 -0
- package/dist/cjs/{translation-42c1b2c8.js → translation-f6b7ee84.js} +4 -4
- package/dist/cjs/{translation-slimmer-32aa13e7.js → translation-slimmer-90f9f71f.js} +2 -2
- package/dist/cjs/trash-can-46a5e19a.js +7 -0
- package/dist/cjs/{type-guard-a07b353b.js → type-guard-4ba85fdc.js} +18 -18
- package/dist/cjs/{ui-08f33116.js → ui-b5906704.js} +20 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +46 -47
- package/dist/cjs/vega-app-footer.cjs.entry.js +12 -13
- package/dist/cjs/vega-app-header-button.cjs.entry.js +48 -48
- package/dist/cjs/vega-backdrop.cjs.entry.js +8 -9
- package/dist/cjs/vega-banner.cjs.entry.js +36 -38
- package/dist/cjs/vega-bar-chart.cjs.entry.js +5 -6
- package/dist/cjs/vega-box.cjs.entry.js +15 -15
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +34 -36
- package/dist/cjs/vega-button-circle.cjs.entry.js +29 -30
- package/dist/cjs/vega-button-group_2.cjs.entry.js +32 -34
- package/dist/cjs/vega-button-link.cjs.entry.js +26 -28
- package/dist/cjs/vega-button.cjs.entry.js +30 -31
- package/dist/cjs/vega-calendar_3.cjs.entry.js +139 -140
- package/dist/cjs/vega-card.cjs.entry.js +13 -13
- package/dist/cjs/vega-carousel.cjs.entry.js +27 -29
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +49 -50
- package/dist/cjs/vega-chip.cjs.entry.js +39 -40
- package/dist/cjs/vega-color-picker.cjs.entry.js +29 -31
- package/dist/cjs/vega-combo-box.cjs.entry.js +52 -53
- package/dist/cjs/vega-counter-badge.cjs.entry.js +9 -10
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +62 -62
- package/dist/cjs/{vega-dialog-controller-dce8cdaf.js → vega-dialog-controller-aaf1f43e.js} +2 -2
- package/dist/cjs/vega-dialog_2.cjs.entry.js +50 -51
- package/dist/cjs/vega-divider.cjs.entry.js +13 -13
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +133 -134
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-error.cjs.entry.js +8 -9
- package/dist/cjs/vega-field-label.cjs.entry.js +20 -23
- package/dist/cjs/vega-file-uploader.cjs.entry.js +76 -81
- package/dist/cjs/vega-flex.cjs.entry.js +18 -17
- package/dist/cjs/vega-font.cjs.entry.js +16 -16
- package/dist/cjs/vega-form.cjs.entry.js +41 -42
- package/dist/cjs/vega-grid.cjs.entry.js +13 -13
- package/dist/cjs/vega-hint.cjs.entry.js +6 -7
- package/dist/cjs/vega-icon.cjs.entry.js +18 -18
- package/dist/cjs/vega-image-uploader.cjs.entry.js +57 -58
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +42 -43
- package/dist/cjs/vega-input-numeric.cjs.entry.js +35 -36
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +51 -52
- package/dist/cjs/vega-input-range.cjs.entry.js +44 -45
- package/dist/cjs/vega-input-select.cjs.entry.js +71 -71
- package/dist/cjs/vega-input.cjs.entry.js +50 -52
- package/dist/cjs/{vega-internal-event-id-79be9bc5.js → vega-internal-event-id-85b68849.js} +12 -0
- package/dist/cjs/vega-item-toggle.cjs.entry.js +19 -22
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +107 -107
- package/dist/cjs/vega-line-chart.cjs.entry.js +6 -7
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +18 -18
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +18 -21
- package/dist/cjs/vega-pagination.cjs.entry.js +58 -57
- package/dist/cjs/vega-pie-chart.cjs.entry.js +6 -7
- package/dist/cjs/vega-popover_2.cjs.entry.js +72 -37
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +27 -30
- package/dist/cjs/vega-radio_2.cjs.entry.js +53 -54
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +179 -0
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +5107 -0
- package/dist/cjs/vega-section-title.cjs.entry.js +14 -15
- package/dist/cjs/vega-segment-control.cjs.entry.js +24 -26
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +53 -54
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +64 -65
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +48 -50
- package/dist/cjs/vega-signature-capture.cjs.entry.js +44 -46
- package/dist/cjs/vega-skeleton.cjs.entry.js +25 -26
- package/dist/cjs/vega-slot-container.cjs.entry.js +5 -6
- package/dist/cjs/vega-stepper.cjs.entry.js +38 -39
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +58 -59
- package/dist/cjs/vega-table_8.cjs.entry.js +184 -184
- package/dist/cjs/vega-text.cjs.entry.js +10 -10
- package/dist/cjs/vega-textarea.cjs.entry.js +39 -40
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +88 -89
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +25 -27
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +22 -22
- package/dist/cjs/vega.cjs.js +28 -23
- package/dist/collection/collection-manifest.json +18 -0
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +2 -2
- package/dist/collection/components/vega-pagination/vega-pagination.js +5 -2
- package/dist/collection/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.js +42 -4
- package/dist/collection/components/vega-rich-text-content/slimmers/controllers/vega-rich-text-content-state-controller.js +38 -0
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +59 -0
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +132 -0
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +124 -0
- package/dist/collection/components/vega-rich-text-editor/assets/align-center.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/align-justify.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/align-left.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/align-right.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/bold.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/code-simple.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/image.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/indent.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/italic.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/link.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/list-ol.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/list-ul.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/outdent.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/strikethrough.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/text-size.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/text-slash.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/text.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/underline.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +33 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/annotation-action.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/append-child-nodes-action.js +9 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/bold-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/break-single-block-action.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/clear-child-nodes-action.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/clear-formatting-annotation-action.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/code-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/delete-block-content-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/delete-node-annotation-action.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/horizontal-alignment-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/image-annotation-action.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/indent-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-blocks-after-block.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-blocks-before-block.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-image-to-block-action.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-nodes-after-node-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-nodes-before-node-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/italic-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/line-break-multiple-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/line-break-single-block-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/link-annotation-action.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/link-group-annotation-action.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/merge-two-blocks-nodes-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +32 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-child-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-nest-list-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/replace-child-nodes-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/replace-nest-list-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/replace-selected-text-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/selection-change-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/split-block-with-node-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/splittable-action.abstract.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/strikethrough-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/sync-up-selection-action.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/text-color-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/text-style-annotation-action.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/transform-list-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/transform-paragraph-action.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/underline-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/update-text-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation.abstract.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +56 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +48 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +102 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +59 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +336 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +247 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +170 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +209 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +412 -0
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +135 -0
- package/dist/collection/components/vega-rich-text-editor/dto/helper/block-base-operator.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +93 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +103 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +265 -0
- package/dist/collection/components/vega-rich-text-editor/dto/range.js +178 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js +73 -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/base-handler.js +191 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.js +108 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +100 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +90 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +95 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +93 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-image-controller.js +117 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/rich-text-content-controller.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +294 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/text-node-color-controller.js +51 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/text-node-rendering-registry.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +201 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +91 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +51 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +70 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.js +70 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.js +68 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +77 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.js +47 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +72 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +49 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +45 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +52 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +129 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +128 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +62 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +52 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +126 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-actions.test.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +134 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/image-block.test.js +90 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-block.test.js +224 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-item.test.js +228 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +173 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +172 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +93 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +433 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/range.test.js +53 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.css +50 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.js +246 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +264 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +676 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/slimmers/renderers/vega-rich-text-image-editor-renderer.js +133 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.css +13 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.js +165 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +144 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.css +11 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.js +247 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +3 -0
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/scripts/before-vega-load.js +9 -1
- package/dist/collection/helpers/change-manager/subject/static-subject/static-subject-title.js +1 -0
- package/dist/collection/helpers/common/index.js +27 -0
- package/dist/collection/helpers/common/test/wait-for-vega-handler.test.js +1 -1
- package/dist/collection/helpers/dialog/test/vega-dialog-controller.test.js +1 -1
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +5 -1
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +6 -0
- package/dist/collection/helpers/event-manager/test/vega-event-manager.test.js +1 -1
- package/dist/collection/helpers/feature-control/feature-flag-controller.js +1 -1
- package/dist/collection/helpers/feature-control/tests/feature-flag-controller.test.js +1 -1
- package/dist/collection/helpers/icon/test/icon-manager-controller.test.js +1 -1
- package/dist/collection/helpers/loading-indicator/tests/vega-loader-controller.test.js +1 -1
- package/dist/collection/helpers/notify/tests/vega-notify-controller.test.js +1 -1
- package/dist/collection/helpers/public-api.js +1 -0
- package/dist/collection/helpers/queue/synchronize-task-queue.js +10 -1
- package/dist/collection/helpers/queue/test/synchronize-task-queue.test.js +28 -0
- package/dist/collection/helpers/skeleton-loader/tests/vega-skeleton-loader-controller.test.js +1 -1
- package/dist/collection/helpers/slimmers/component-usage-runtime-metrics.js +1 -1
- package/dist/collection/helpers/slimmers/dark-mode-state-controller-slimmer.js +46 -0
- package/dist/collection/helpers/slimmers/element-appender-slimmer.js +10 -3
- package/dist/collection/helpers/slimmers/runtime-metrics/public-api-runtime-metrics-slimmer-base.js +1 -1
- package/dist/collection/helpers/slimmers/runtime-metrics/test/public-api-runtime-metrics-slimmer-base.test.js +1 -1
- package/dist/collection/helpers/slimmers/test/component-usage-runtime-metrics.test.js +1 -1
- package/dist/collection/helpers/slimmers/test/dark-mode-state-controller.test.js +65 -0
- package/dist/collection/helpers/theme/controllers/dark-mode-style-controller.js +45 -3
- package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +2 -2
- package/dist/collection/helpers/theme/theme-manager.js +3 -0
- package/dist/collection/helpers/validator/rules/{file-uploader-required-rule.js → object-array-required-rule.js} +3 -3
- package/dist/collection/helpers/validator/rules/required-field-rule.js +2 -1
- package/dist/collection/helpers/validator/rules/rich-text-editor-required-rule.js +57 -0
- package/dist/collection/helpers/validator/test/rules/object-array-required-rule.test.js +7 -0
- package/dist/collection/helpers/validator/test/rules/required-field-rule.test.js +11 -0
- package/dist/collection/helpers/validator/test/rules/rich-text-editor-required-rule.test.js +317 -0
- package/dist/collection/helpers/zindex/test/vega-z-index-manager.test.js +1 -1
- package/dist/collection/polyfill/shadow-selection/shadow-selection-polyfill.js +164 -0
- package/dist/collection/polyfill/shadow-selection/test/shadow-selection-polyfill.test.js +233 -0
- package/dist/collection/polyfill/test-polyfill/unit/index.js +1 -0
- package/dist/collection/polyfill/test-polyfill/unit/methods.js +9 -0
- package/dist/collection/polyfill/test-polyfill/unit/range.js +15 -0
- package/dist/collection/polyfill/test-polyfill/unit/shadow-selection.js +17 -0
- package/dist/collection/utils/spec-utils.js +2 -1
- package/dist/collection/utils/test/ui.test.js +6 -1
- package/dist/collection/utils/ui.js +18 -0
- package/dist/collection/value-model-adapters/angular-ng-model-accessor-adapter.js +1 -0
- package/dist/collection/value-model-adapters/vue-component-v-model-adaptor.js +1 -0
- package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
- package/dist/esm/{app-globals-c018477a.js → app-globals-48531a04.js} +22 -13
- package/dist/esm/block-annotation.abstract-b0554e2b.js +868 -0
- package/dist/esm/{breakpoints-36a3ed69.js → breakpoints-91116111.js} +2 -12
- package/dist/esm/breakpoints-d9faf11c.js +12 -0
- package/dist/esm/{change-manager-6a7eb88c.js → change-manager-8f5b72c2.js} +1 -1
- package/dist/esm/chevron-down-4a75d28e.js +5 -0
- package/dist/esm/chevron-up-b1989751.js +5 -0
- package/dist/esm/{child-nodes-event-prevent-slimmer-8de7e3bb.js → child-nodes-event-prevent-slimmer-8ceabe63.js} +3 -3
- package/dist/esm/{child-nodes-notify-observer-slimmer-3d52b843.js → child-nodes-notify-observer-slimmer-afc15e00.js} +4 -4
- package/dist/esm/{component-cae24190.js → component-051a594c.js} +1 -1
- package/dist/esm/{component-global-style-slimmer-000e0c11.js → component-global-style-slimmer-631f956f.js} +1 -1
- package/dist/esm/{component-usage-runtime-metrics-b3f6ac79.js → component-usage-runtime-metrics-21813c36.js} +2 -2
- package/dist/esm/content-state-4b036bf1.js +1934 -0
- package/dist/esm/{create-public-api-runtime-metrics-slimmer-cc1164bb.js → create-public-api-runtime-metrics-slimmer-14cb4599.js} +3 -3
- package/dist/esm/{date-732bc749.js → date-655c0af8.js} +1 -1
- package/dist/esm/{deprecated-property-slimmer-43d184b3.js → deprecated-property-slimmer-9ea5019c.js} +2 -2
- package/dist/esm/{design-token-2a527af3.js → design-token-20fdba82.js} +6 -6
- package/dist/esm/dom-node-subject-observer-factory-80358591.js +269 -0
- package/dist/esm/{dynamic-slimmer-90b8af32.js → dynamic-slimmer-85746483.js} +1 -1
- package/dist/esm/{element-appender-slimmer-48d826b2.js → element-appender-slimmer-4dfa326d.js} +17 -10
- package/dist/esm/{event-emit-slimmer-493e6b9d.js → event-emit-slimmer-c03cf145.js} +5 -5
- package/dist/esm/{feature-flag-controller-6bbf53c1.js → feature-flag-controller-dfde0cfa.js} +3 -3
- package/dist/esm/{form-field-controller-slimmer-88492678.js → form-field-controller-slimmer-de5fe574.js} +11 -12
- package/dist/esm/{index-187f71d1.js → global-slimmer-registry-6887a59f.js} +284 -275
- package/dist/esm/{icon-manager-1ee2c968.js → icon-manager-3cef32e7.js} +2 -2
- package/dist/esm/index-44c794b4.js +323 -0
- package/dist/esm/index.js +29 -23
- package/dist/esm/{inject-keyboard-manager-8a82e8c9.js → inject-keyboard-manager-45309420.js} +1 -1
- package/dist/esm/{internal-icon-manager-7004584d.js → internal-icon-manager-7fc7535a.js} +1 -1
- package/dist/esm/{internal-vega-event-manager-48ac30f1.js → internal-vega-event-manager-3a3815d3.js} +6 -2
- package/dist/esm/{internal-vega-z-index-manager-7d2b54c3.js → internal-vega-z-index-manager-89e8b6f5.js} +1 -1
- package/dist/esm/{keyboard-manager-d1f9ddc1.js → keyboard-manager-2c06eafe.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-8723f20f.js → keyboard-manager-slimmer-fd177285.js} +2 -2
- package/dist/esm/{legend-input-processor-0cef3ebe.js → legend-input-processor-15939912.js} +1 -1
- package/dist/esm/loader.js +28 -23
- package/dist/esm/{mutation-observer-slimmer-6cef9549.js → mutation-observer-slimmer-ca2cb2e8.js} +1 -1
- package/dist/esm/{vega-skeleton-loader-controller-1911558d.js → node.abstract-93746055.js} +226 -833
- package/dist/esm/{page-resize-observer-slimmer-994c1e1b.js → page-resize-observer-slimmer-8589ebc8.js} +2 -2
- package/dist/esm/{remote-invocation-registry-1682b34e.js → remote-invocation-registry-2ec6936d.js} +2 -2
- package/dist/esm/{required-field-rule-5da360cc.js → required-field-rule-368b31fa.js} +2 -1
- package/dist/esm/{responsive-format-facade-3dc84e41.js → responsive-format-facade-559ec469.js} +3 -3
- package/dist/esm/{state-background-color-formatter-0540d006.js → state-background-color-formatter-16031a43.js} +2 -2
- package/dist/esm/{static-subject-title-500cf2a3.js → static-subject-title-e06a3840.js} +2 -1
- package/dist/esm/{string-input-formatter-slimmer-fc23bc9f.js → string-input-formatter-slimmer-c9fb1fa1.js} +2 -2
- package/dist/esm/{style-formatter-ccb2da0d.js → style-formatter-51845b6d.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-21b1c646.js → sub-state-notify-slimmer-6e97a58a.js} +5 -6
- package/dist/esm/{sub-state-observer-slimmer-8c80d874.js → sub-state-observer-slimmer-0968ce04.js} +5 -6
- package/dist/esm/{synchronize-task-queue-8f5fbbd9.js → synchronize-task-queue-ac8acc3b.js} +10 -1
- package/dist/esm/text-color-toolbar-button-slimmer-b2270b64.js +207 -0
- package/dist/esm/text-node-a652ca87.js +933 -0
- package/dist/esm/{translation-4eb3cf85.js → translation-b3fe8e74.js} +4 -4
- package/dist/esm/{translation-slimmer-9d07a0ff.js → translation-slimmer-860cd766.js} +2 -2
- package/dist/esm/trash-can-8819a939.js +5 -0
- package/dist/esm/{type-guard-63caf78b.js → type-guard-158f6d7a.js} +20 -20
- package/dist/esm/{typography-a8fc4764.js → typography-396de03f.js} +1 -1
- package/dist/esm/{ui-0132dbb5.js → ui-5600b48f.js} +20 -2
- package/dist/esm/vega-accordion.entry.js +22 -23
- package/dist/esm/vega-app-footer.entry.js +3 -4
- package/dist/esm/vega-app-header-button.entry.js +26 -26
- package/dist/esm/vega-backdrop.entry.js +4 -5
- package/dist/esm/vega-banner.entry.js +15 -17
- package/dist/esm/vega-bar-chart.entry.js +5 -6
- package/dist/esm/vega-box.entry.js +13 -13
- package/dist/esm/vega-breadcrumb.entry.js +13 -15
- package/dist/esm/vega-button-circle.entry.js +21 -22
- package/dist/esm/vega-button-group_2.entry.js +16 -18
- package/dist/esm/vega-button-link.entry.js +13 -15
- package/dist/esm/vega-button.entry.js +20 -21
- package/dist/esm/vega-calendar_3.entry.js +29 -30
- package/dist/esm/vega-card.entry.js +11 -11
- package/dist/esm/vega-carousel.entry.js +17 -19
- package/dist/esm/vega-checkbox_2.entry.js +24 -25
- package/dist/esm/vega-chip.entry.js +21 -22
- package/dist/esm/vega-color-picker.entry.js +19 -21
- package/dist/esm/vega-combo-box.entry.js +27 -28
- package/dist/esm/vega-counter-badge.entry.js +3 -4
- package/dist/esm/vega-date-picker_2.entry.js +37 -37
- package/dist/esm/{vega-dialog-controller-8b343a17.js → vega-dialog-controller-5b23f68c.js} +2 -2
- package/dist/esm/vega-dialog_2.entry.js +24 -25
- package/dist/esm/vega-divider.entry.js +11 -11
- package/dist/esm/vega-dropdown_5.entry.js +33 -34
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-error.entry.js +5 -6
- package/dist/esm/vega-field-label.entry.js +9 -12
- package/dist/esm/vega-file-uploader.entry.js +27 -32
- package/dist/esm/vega-flex.entry.js +16 -15
- package/dist/esm/vega-font.entry.js +12 -12
- package/dist/esm/vega-form.entry.js +23 -24
- package/dist/esm/vega-grid.entry.js +11 -11
- package/dist/esm/vega-hint.entry.js +3 -4
- package/dist/esm/vega-icon.entry.js +14 -14
- package/dist/esm/vega-image-uploader.entry.js +28 -29
- package/dist/esm/vega-input-credit-card.entry.js +25 -26
- package/dist/esm/vega-input-numeric.entry.js +26 -27
- package/dist/esm/vega-input-phone-number.entry.js +25 -26
- package/dist/esm/vega-input-range.entry.js +23 -24
- package/dist/esm/vega-input-select.entry.js +31 -31
- package/dist/esm/vega-input.entry.js +23 -25
- package/dist/esm/{vega-internal-event-id-770faa12.js → vega-internal-event-id-4af5c6e9.js} +7 -1
- package/dist/esm/vega-item-toggle.entry.js +10 -13
- package/dist/esm/vega-left-nav_5.entry.js +32 -32
- package/dist/esm/vega-line-chart.entry.js +6 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +10 -10
- package/dist/esm/vega-page-notification_2.entry.js +6 -9
- package/dist/esm/vega-pagination.entry.js +22 -21
- package/dist/esm/vega-pie-chart.entry.js +5 -6
- package/dist/esm/vega-popover_2.entry.js +59 -24
- package/dist/esm/vega-progress-tracker.entry.js +10 -13
- package/dist/esm/vega-radio_2.entry.js +26 -27
- package/dist/esm/vega-rich-text-content.entry.js +175 -0
- package/dist/esm/vega-rich-text-editor_4.entry.js +5100 -0
- package/dist/esm/vega-section-title.entry.js +3 -4
- package/dist/esm/vega-segment-control.entry.js +12 -14
- package/dist/esm/vega-selection-chip_2.entry.js +28 -29
- package/dist/esm/vega-selection-tile_2.entry.js +26 -27
- package/dist/esm/vega-sidenav_3.entry.js +23 -25
- package/dist/esm/vega-signature-capture.entry.js +27 -29
- package/dist/esm/vega-skeleton.entry.js +3 -4
- package/dist/esm/vega-slot-container.entry.js +2 -3
- package/dist/esm/vega-stepper.entry.js +22 -23
- package/dist/esm/vega-tab-group_2.entry.js +18 -19
- package/dist/esm/vega-table_8.entry.js +34 -34
- package/dist/esm/vega-text.entry.js +6 -6
- package/dist/esm/vega-textarea.entry.js +23 -24
- package/dist/esm/vega-time-picker_2.entry.js +31 -32
- package/dist/esm/vega-toggle-switch.entry.js +18 -20
- package/dist/esm/vega-tooltip_2.entry.js +16 -16
- package/dist/esm/vega.js +28 -23
- package/dist/esm/{y-axis-input-processor-a4d6aa50.js → y-axis-input-processor-a26a57e5.js} +1 -1
- package/dist/types/components/vega-pagination/vega-pagination.d.ts +1 -0
- package/dist/types/components/vega-popover/slimmers/controllers/vega-popover-appender-controller.d.ts +19 -0
- package/dist/types/components/vega-rich-text-content/slimmers/controllers/vega-rich-text-content-state-controller.d.ts +11 -0
- package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +20 -0
- package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/assets/align-center.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/align-justify.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/align-left.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/align-right.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/bold.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/code-simple.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/image.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/indent.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/italic.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/link.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/list-ol.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/list-ul.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/outdent.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/strikethrough.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/text-size.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/text-slash.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/text.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/underline.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/annotation-action.abstract.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/append-child-nodes-action.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/bold-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/break-single-block-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/clear-child-nodes-action.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/clear-formatting-annotation-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/code-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/delete-block-content-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/delete-node-annotation-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/horizontal-alignment-annotation-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/image-annotation-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/indent-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/insert-blocks-after-block.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/insert-blocks-before-block.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/insert-image-to-block-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/insert-nodes-after-node-action.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/insert-nodes-before-node-action.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/italic-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/line-break-multiple-block-action.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/line-break-single-block-action.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/link-annotation-action.d.ts +24 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/link-group-annotation-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/merge-two-blocks-nodes-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/remove-child-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/remove-nest-list-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/replace-child-nodes-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/replace-nest-list-action.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/replace-selected-text-action.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/selection-change-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/split-block-with-node-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/splittable-action.abstract.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/strikethrough-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/sync-up-selection-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/text-color-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/text-style-annotation-action.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/transform-list-action.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/transform-paragraph-action.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/underline-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/update-text-action.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +37 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +43 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +167 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +48 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +32 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +62 -0
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +58 -0
- package/dist/types/components/vega-rich-text-editor/dto/helper/block-base-operator.d.ts +24 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +65 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/dto/range.d.ts +102 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +175 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/focus-controller.d.ts +33 -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/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +78 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.d.ts +53 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/insert-image-controller.d.ts +39 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/rich-text-content-controller.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +123 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/text-node-color-controller.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/text-node-rendering-registry.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +70 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +38 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +49 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +53 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/annotations.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/blocks/image-block.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/blocks/list-block.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/blocks/list-item.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/blocks/text-block.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/content-state.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/nodes/image-node.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/nodes/text-node.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/range.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.d.ts +62 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +186 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/slimmers/renderers/vega-rich-text-image-editor-renderer.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/types.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.d.ts +64 -0
- package/dist/types/components.d.ts +378 -0
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/change-manager/subject/static-subject/static-subject-title.d.ts +2 -1
- package/dist/types/helpers/common/index.d.ts +8 -0
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +6 -0
- package/dist/types/helpers/public-api.d.ts +1 -0
- package/dist/types/helpers/queue/synchronize-task-queue.d.ts +7 -0
- package/dist/types/helpers/slimmers/dark-mode-state-controller-slimmer.d.ts +21 -0
- package/dist/types/helpers/slimmers/element-appender-slimmer.d.ts +2 -0
- package/dist/types/helpers/slimmers/test/dark-mode-state-controller.test.d.ts +1 -0
- package/dist/types/helpers/theme/controllers/dark-mode-style-controller.d.ts +20 -0
- package/dist/types/helpers/validator/rules/form-field-validation-rule.d.ts +7 -1
- package/dist/types/helpers/validator/rules/{file-uploader-required-rule.d.ts → object-array-required-rule.d.ts} +3 -3
- package/dist/types/helpers/validator/rules/rich-text-editor-required-rule.d.ts +39 -0
- package/dist/types/helpers/validator/test/rules/object-array-required-rule.test.d.ts +1 -0
- package/dist/types/helpers/validator/test/rules/rich-text-editor-required-rule.test.d.ts +1 -0
- package/dist/types/polyfill/shadow-selection/shadow-selection-polyfill.d.ts +64 -0
- package/dist/types/polyfill/shadow-selection/test/shadow-selection-polyfill.test.d.ts +0 -0
- package/dist/types/polyfill/test-polyfill/unit/index.d.ts +1 -0
- package/dist/types/polyfill/test-polyfill/unit/range.d.ts +7 -0
- package/dist/types/polyfill/test-polyfill/unit/shadow-selection.d.ts +0 -0
- package/dist/types/types/components.type.d.ts +15 -0
- package/dist/types/utils/ui.d.ts +7 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-0190095c.entry.js +1 -0
- package/dist/vega/p-034e6348.entry.js +1 -0
- package/dist/vega/p-0cd2b50f.entry.js +1 -0
- package/dist/vega/{p-5453f591.js → p-0e0c47ad.js} +1 -1
- package/dist/vega/p-10393104.js +1 -0
- package/dist/vega/p-109a00cf.entry.js +1 -0
- package/dist/vega/p-112455b1.js +1 -0
- package/dist/vega/{p-bdb94242.js → p-11a19ca0.js} +1 -1
- package/dist/vega/{p-a04632d0.js → p-11cb477b.js} +1 -1
- package/dist/vega/p-1564cc4d.entry.js +1 -0
- package/dist/vega/p-18886765.entry.js +1 -0
- package/dist/vega/p-1995e98e.js +1 -0
- package/dist/vega/p-19b26168.entry.js +1 -0
- package/dist/vega/{p-b62f0454.js → p-1ec4b319.js} +1 -1
- package/dist/vega/p-1ec763ab.js +1 -0
- package/dist/vega/p-1fb56e14.js +1 -0
- package/dist/vega/p-21992602.entry.js +1 -0
- package/dist/vega/p-22563151.entry.js +1 -0
- package/dist/vega/p-23795da1.entry.js +1 -0
- package/dist/vega/p-29277e41.entry.js +1 -0
- package/dist/vega/{p-9b797118.js → p-296cc56b.js} +1 -1
- package/dist/vega/p-2a7e9422.entry.js +1 -0
- package/dist/vega/p-2ca6d977.entry.js +1 -0
- package/dist/vega/p-2e419309.entry.js +1 -0
- package/dist/vega/p-3039bef8.js +1 -0
- package/dist/vega/{p-e2acbc60.js → p-3152031c.js} +1 -1
- package/dist/vega/p-34939c97.entry.js +1 -0
- package/dist/vega/{p-a46329bb.js → p-368d0060.js} +1 -1
- package/dist/vega/p-3897bb2d.entry.js +1 -0
- package/dist/vega/{p-69e63d21.entry.js → p-390c5236.entry.js} +1 -1
- package/dist/vega/{p-af7a3154.js → p-3953c705.js} +1 -1
- package/dist/vega/{p-c4a52c83.js → p-39836361.js} +1 -1
- package/dist/vega/{p-a190c86a.js → p-3b4bde3e.js} +1 -1
- package/dist/vega/p-3ce31dc3.js +1 -0
- package/dist/vega/{p-04215e74.js → p-3f1b542a.js} +1 -1
- package/dist/vega/{p-2d0d575f.js → p-443ad3b3.js} +1 -1
- package/dist/vega/p-452e284a.js +1 -0
- package/dist/vega/p-4bcd6612.js +1 -0
- package/dist/vega/p-4c41dd64.js +1 -0
- package/dist/vega/p-55beac7f.entry.js +1 -0
- package/dist/vega/p-57405834.entry.js +1 -0
- package/dist/vega/p-584dcd9b.js +1 -0
- package/dist/vega/p-589e6041.entry.js +1 -0
- package/dist/vega/{p-6a334573.js → p-59bdf9b8.js} +1 -1
- package/dist/vega/p-5e95402a.entry.js +1 -0
- package/dist/vega/p-5eee21b4.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-613ddaab.js +1 -0
- package/dist/vega/{p-2d5a9f66.js → p-62774231.js} +1 -1
- package/dist/vega/p-62cea2e7.entry.js +1 -0
- package/dist/vega/p-65b79fd7.js +1 -0
- package/dist/vega/p-6741e2b9.entry.js +1 -0
- package/dist/vega/p-6a084fe1.entry.js +1 -0
- package/dist/vega/{p-760283d1.entry.js → p-6b286226.entry.js} +1 -1
- package/dist/vega/p-6b722905.entry.js +1 -0
- package/dist/vega/p-6e4b2752.entry.js +1 -0
- package/dist/vega/{p-47c87634.js → p-70151c27.js} +1 -1
- package/dist/vega/p-7209d03b.js +1 -0
- package/dist/vega/p-734ea281.entry.js +1 -0
- package/dist/vega/p-76fc408e.entry.js +1 -0
- package/dist/vega/p-7a40e033.js +1 -0
- package/dist/vega/p-7a9f453e.entry.js +1 -0
- package/dist/vega/p-80ccd894.entry.js +1 -0
- package/dist/vega/{p-ed237efc.js → p-81ead59a.js} +1 -1
- package/dist/vega/{p-987fbbd0.js → p-843a0c1c.js} +1 -1
- package/dist/vega/p-84c597c8.entry.js +1 -0
- package/dist/vega/p-8836c1b9.js +1 -0
- package/dist/vega/p-8b78c6a3.entry.js +1 -0
- package/dist/vega/p-8be45a45.entry.js +1 -0
- package/dist/vega/p-8c26227e.js +1 -0
- package/dist/vega/p-8d7b45f7.entry.js +1 -0
- package/dist/vega/p-8e17b9dd.entry.js +1 -0
- package/dist/vega/p-8f004647.entry.js +1 -0
- package/dist/vega/p-8f93242a.js +1 -0
- package/dist/vega/p-925a2137.js +1 -0
- package/dist/vega/p-92f88033.entry.js +1 -0
- package/dist/vega/p-94de7a02.entry.js +1 -0
- package/dist/vega/p-9968e71d.entry.js +1 -0
- package/dist/vega/p-9c1eeff2.js +2 -0
- package/dist/vega/p-9d1b9e70.entry.js +1 -0
- package/dist/vega/p-9e732a26.entry.js +1 -0
- package/dist/vega/p-9f39dd10.js +1 -0
- package/dist/vega/p-a5ffe912.js +1 -0
- package/dist/vega/p-a6104aa7.js +1 -0
- package/dist/vega/p-a6169ad6.entry.js +1 -0
- package/dist/vega/{p-6a8f1251.js → p-a6a7d0c9.js} +1 -1
- package/dist/vega/p-a8bf559a.js +1 -0
- package/dist/vega/p-aacf6920.js +1 -0
- package/dist/vega/p-acf7f903.js +1 -0
- package/dist/vega/p-afec17ad.entry.js +1 -0
- package/dist/vega/p-b1f65b13.js +1 -0
- package/dist/vega/{p-0c051d2a.entry.js → p-b3f9cc3a.entry.js} +2 -2
- package/dist/vega/p-b693c1ac.entry.js +1 -0
- package/dist/vega/p-b9e2add4.entry.js +1 -0
- package/dist/vega/p-bd894860.entry.js +1 -0
- package/dist/vega/p-c0d6a587.entry.js +1 -0
- package/dist/vega/p-c26e6820.entry.js +1 -0
- package/dist/vega/p-c34487e1.entry.js +1 -0
- package/dist/vega/p-c532b132.entry.js +1 -0
- package/dist/vega/p-ca2fb711.js +1 -0
- package/dist/vega/p-cebf93f1.entry.js +1 -0
- package/dist/vega/p-cfdc148a.entry.js +1 -0
- package/dist/vega/p-d0351d71.entry.js +1 -0
- package/dist/vega/p-d057999f.js +1 -0
- package/dist/vega/{p-c7d70786.js → p-d171cf44.js} +1 -1
- package/dist/vega/p-d2ab6096.entry.js +1 -0
- package/dist/vega/p-d35643c5.entry.js +1 -0
- package/dist/vega/p-d400a1d9.entry.js +1 -0
- package/dist/vega/p-d6732a72.entry.js +1 -0
- package/dist/vega/p-d720b06a.entry.js +1 -0
- package/dist/vega/{p-c59042c0.js → p-d884c644.js} +1 -1
- package/dist/vega/p-d987e404.entry.js +1 -0
- package/dist/vega/p-d9b86108.entry.js +1 -0
- package/dist/vega/p-e0b25eaf.js +1 -0
- package/dist/vega/{p-9f3b1d77.js → p-e1e1fcf0.js} +1 -1
- package/dist/vega/p-e27e115d.entry.js +1 -0
- package/dist/vega/p-e65c8ac7.entry.js +1 -0
- package/dist/vega/p-e79057cc.js +1 -0
- package/dist/vega/p-e89e9769.entry.js +1 -0
- package/dist/vega/{p-781fd6e0.js → p-eac38d87.js} +1 -1
- package/dist/vega/p-ecd64c7f.entry.js +1 -0
- package/dist/vega/p-ed45b3b6.js +1 -0
- package/dist/vega/p-f357cf46.js +1 -0
- package/dist/vega/p-f5b2e72a.entry.js +1 -0
- package/dist/vega/p-f6af3749.js +1 -0
- package/dist/vega/p-f763e2eb.js +1 -0
- package/dist/vega/p-fc622a75.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -4
- package/dist/cjs/dom-node-subject-observer-factory-2e41340d.js +0 -141
- package/dist/cjs/global-slimmer-registry-b3bce7e0.js +0 -297
- package/dist/cjs/index-40a1cd3a.js +0 -15
- package/dist/cjs/index-5792390b.js +0 -1024
- package/dist/cjs/observer-f49483e8.js +0 -32
- package/dist/collection/helpers/validator/test/rules/file-uploader-required-rule.test.js +0 -7
- package/dist/esm/chevron-down-4303bddb.js +0 -9
- package/dist/esm/dom-node-subject-observer-factory-9461cd67.js +0 -138
- package/dist/esm/global-slimmer-registry-17c4efd4.js +0 -283
- package/dist/esm/index-0830dd1d.js +0 -13
- package/dist/esm/index-0863eec6.js +0 -1019
- package/dist/esm/observer-3959f9dd.js +0 -30
- package/dist/esm/vega-event-id-0f8fc134.js +0 -103
- package/dist/vega/p-07a8cf89.entry.js +0 -1
- package/dist/vega/p-07af8ee4.entry.js +0 -1
- package/dist/vega/p-0916da7a.entry.js +0 -1
- package/dist/vega/p-0abae6cc.entry.js +0 -1
- package/dist/vega/p-0e59c3b7.entry.js +0 -1
- package/dist/vega/p-0fe89d42.js +0 -1
- package/dist/vega/p-0fecf145.js +0 -1
- package/dist/vega/p-11786565.entry.js +0 -1
- package/dist/vega/p-13d34a23.entry.js +0 -1
- package/dist/vega/p-14fc5aed.entry.js +0 -1
- package/dist/vega/p-16bb355d.js +0 -1
- package/dist/vega/p-17233d94.entry.js +0 -1
- package/dist/vega/p-1a8dd528.entry.js +0 -1
- package/dist/vega/p-1c298d5a.js +0 -2
- package/dist/vega/p-2b5ab7f9.entry.js +0 -1
- package/dist/vega/p-32f651f7.js +0 -1
- package/dist/vega/p-331a62d5.js +0 -1
- package/dist/vega/p-36395deb.entry.js +0 -1
- package/dist/vega/p-38b93319.entry.js +0 -1
- package/dist/vega/p-4022f395.entry.js +0 -1
- package/dist/vega/p-4163c2c2.js +0 -1
- package/dist/vega/p-4625a2b4.js +0 -1
- package/dist/vega/p-483d0916.entry.js +0 -1
- package/dist/vega/p-4921c38c.entry.js +0 -1
- package/dist/vega/p-4963e445.entry.js +0 -1
- package/dist/vega/p-497eba8c.entry.js +0 -1
- package/dist/vega/p-49db0660.entry.js +0 -1
- package/dist/vega/p-4d25df7d.js +0 -1
- package/dist/vega/p-535f0758.js +0 -1
- package/dist/vega/p-53702f16.js +0 -1
- package/dist/vega/p-53d34f58.entry.js +0 -1
- package/dist/vega/p-5440344e.js +0 -1
- package/dist/vega/p-576fe8cf.entry.js +0 -1
- package/dist/vega/p-590870e4.js +0 -1
- package/dist/vega/p-5915634b.js +0 -1
- package/dist/vega/p-597871ab.entry.js +0 -1
- package/dist/vega/p-5fbac513.js +0 -1
- package/dist/vega/p-603f7aa3.entry.js +0 -1
- package/dist/vega/p-61f6167c.js +0 -1
- package/dist/vega/p-66ffdfdf.entry.js +0 -1
- package/dist/vega/p-6758dc5e.entry.js +0 -1
- package/dist/vega/p-68ad953c.js +0 -1
- package/dist/vega/p-6c6d86da.js +0 -1
- package/dist/vega/p-6e1ab235.js +0 -1
- package/dist/vega/p-6f027906.entry.js +0 -1
- package/dist/vega/p-6f788b49.entry.js +0 -1
- package/dist/vega/p-7372cd79.entry.js +0 -1
- package/dist/vega/p-7df3aa44.entry.js +0 -1
- package/dist/vega/p-810ba5c3.entry.js +0 -1
- package/dist/vega/p-84118b6d.entry.js +0 -1
- package/dist/vega/p-848825ff.entry.js +0 -1
- package/dist/vega/p-84fa8466.js +0 -1
- package/dist/vega/p-87640a4d.entry.js +0 -1
- package/dist/vega/p-8a091eb7.js +0 -1
- package/dist/vega/p-8b084bf9.entry.js +0 -1
- package/dist/vega/p-8f5ffac5.entry.js +0 -1
- package/dist/vega/p-910410ad.entry.js +0 -1
- package/dist/vega/p-943e89b4.js +0 -1
- package/dist/vega/p-99a35465.entry.js +0 -1
- package/dist/vega/p-99cf17e3.entry.js +0 -1
- package/dist/vega/p-9ba085c1.entry.js +0 -1
- package/dist/vega/p-9e9ec748.js +0 -1
- package/dist/vega/p-9f984c33.entry.js +0 -1
- package/dist/vega/p-9fbdeada.js +0 -1
- package/dist/vega/p-a7fdb16a.js +0 -1
- package/dist/vega/p-a828eeef.entry.js +0 -1
- package/dist/vega/p-acc14aa2.js +0 -1
- package/dist/vega/p-ae5751fb.entry.js +0 -1
- package/dist/vega/p-b3e754da.entry.js +0 -1
- package/dist/vega/p-b4e92130.entry.js +0 -1
- package/dist/vega/p-b5990090.js +0 -1
- package/dist/vega/p-b8e42c11.entry.js +0 -1
- package/dist/vega/p-bb6f8b70.entry.js +0 -1
- package/dist/vega/p-c1dfdc13.js +0 -1
- package/dist/vega/p-c51a48d6.entry.js +0 -1
- package/dist/vega/p-d6d10fb3.entry.js +0 -1
- package/dist/vega/p-d7df87b4.entry.js +0 -1
- package/dist/vega/p-daaf3ee3.entry.js +0 -1
- package/dist/vega/p-dadd7db4.entry.js +0 -1
- package/dist/vega/p-db94558e.entry.js +0 -1
- package/dist/vega/p-dba59bd7.entry.js +0 -1
- package/dist/vega/p-e5cd92f0.entry.js +0 -1
- package/dist/vega/p-e5e0394a.entry.js +0 -1
- package/dist/vega/p-ec157238.js +0 -1
- package/dist/vega/p-eddcb385.entry.js +0 -1
- package/dist/vega/p-f2685ec5.entry.js +0 -1
- package/dist/vega/p-f404aa83.js +0 -1
- package/dist/vega/p-f46c930f.js +0 -1
- package/dist/vega/p-f556c3cd.entry.js +0 -1
- package/dist/vega/p-f5876e05.entry.js +0 -1
- package/dist/vega/p-f64fb740.entry.js +0 -1
- package/dist/vega/p-f76e9940.entry.js +0 -1
- package/dist/vega/p-f7728ead.entry.js +0 -1
- package/dist/vega/p-fae41be0.entry.js +0 -1
- package/dist/vega/p-faea1620.js +0 -1
- /package/dist/types/{helpers/validator/test/rules/file-uploader-required-rule.test.d.ts → components/vega-rich-text-editor/test/dto/annotation-actions.test.d.ts} +0 -0
|
@@ -0,0 +1,1934 @@
|
|
|
1
|
+
import { h } from './global-slimmer-registry-6887a59f.js';
|
|
2
|
+
import { B as BlockAnnotation, e as BlockAnnotationTypeEnum } from './block-annotation.abstract-b0554e2b.js';
|
|
3
|
+
import { C as ChangeManager } from './change-manager-8f5b72c2.js';
|
|
4
|
+
import { d as domNodeSubjectFactory, D as DomNodeSubjectObserverFactory, V as VegaChange } from './dom-node-subject-observer-factory-80358591.js';
|
|
5
|
+
import { M as ModifyContentAction, b as ModifyContentActionType, s as stateEntityRenderingRegistry, N as NodeAnnotation, a as NodeAnnotationTypeEnum, R as RTENode, c as NodeTypeEnum, I as InternalAnnotationTypeEnum } from './node.abstract-93746055.js';
|
|
6
|
+
import { V as VegaInternalRichTextEditorFlushChanges } from './vega-internal-event-id-4af5c6e9.js';
|
|
7
|
+
import { i as isNonNullable } from './type-guard-158f6d7a.js';
|
|
8
|
+
import { Z as ZERO_WIDTH_SPACE, A as AnnotationAction, T as TextSplittableAction, B as BoldAnnotation, R as RTETextNode, L as LinkAnnotationAction, D as DeleteNodeAnnotationAction, a as LinkGroupAnnotationAction, U as UpdateTextAction, S as SyncUpSelectionAction } from './text-node-a652ca87.js';
|
|
9
|
+
import { g as generateUUID } from './create-public-api-runtime-metrics-slimmer-14cb4599.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Annotation to make block with horizontal alignment
|
|
13
|
+
*/
|
|
14
|
+
class HorizontalAlignmentAnnotation extends BlockAnnotation {
|
|
15
|
+
constructor(textAlign) {
|
|
16
|
+
super();
|
|
17
|
+
this.type = BlockAnnotationTypeEnum.ALIGNMENT;
|
|
18
|
+
this.textAlign = textAlign;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Generate the map item for the annotation
|
|
22
|
+
*
|
|
23
|
+
* @param {VegaRTEBlockAlignment} textAlign - Text alignment
|
|
24
|
+
* @returns {[BlockAnnotationTypeEnum.ALIGNMENT, HorizontalAlignmentAnnotation]} Map item for the annotation
|
|
25
|
+
*/
|
|
26
|
+
static from(textAlign) {
|
|
27
|
+
return [BlockAnnotationTypeEnum.ALIGNMENT, new HorizontalAlignmentAnnotation(textAlign)];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Generate the JSON item of the annotation
|
|
31
|
+
*
|
|
32
|
+
* @returns {Record<string, unknown>} JSON representation of the annotation
|
|
33
|
+
*/
|
|
34
|
+
toJSON() {
|
|
35
|
+
return {
|
|
36
|
+
textAlign: this.textAlign,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Generate the class for the annotation
|
|
41
|
+
*
|
|
42
|
+
* @returns {string} - Annotation class
|
|
43
|
+
*/
|
|
44
|
+
renderClass() {
|
|
45
|
+
return `v-rte--horizontal-alignment-${this.textAlign}`;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generate the style for the annotation
|
|
49
|
+
*
|
|
50
|
+
* @returns {Nullable<AnnotationStyle>} - Annotation style
|
|
51
|
+
*/
|
|
52
|
+
render() {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Annotation for block indentation
|
|
59
|
+
*/
|
|
60
|
+
class IndentAnnotation extends BlockAnnotation {
|
|
61
|
+
constructor(indent) {
|
|
62
|
+
super();
|
|
63
|
+
this.type = BlockAnnotationTypeEnum.INDENT;
|
|
64
|
+
this.indent = Math.max(0, indent);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Generate the map item for the annotation
|
|
68
|
+
*
|
|
69
|
+
* @param {number} indent - Text alignment
|
|
70
|
+
* @returns {[BlockAnnotationTypeEnum.INDENT, IndentAnnotation]} Map item for the annotation
|
|
71
|
+
*/
|
|
72
|
+
static from(indent) {
|
|
73
|
+
return [BlockAnnotationTypeEnum.INDENT, new IndentAnnotation(indent)];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Generate the JSON item of the annotation
|
|
77
|
+
*
|
|
78
|
+
* @returns {Record<string, unknown>} JSON representation of the annotation
|
|
79
|
+
*/
|
|
80
|
+
toJSON() {
|
|
81
|
+
return this.indent > 0 ? { indent: this.indent } : null;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Generate the style for the annotation
|
|
85
|
+
*
|
|
86
|
+
* @returns {Nullable<AnnotationStyle>} - Annotation style
|
|
87
|
+
*/
|
|
88
|
+
render() {
|
|
89
|
+
return this.indent > 0 ? { 'margin-left': `${this.indent * 16}px` } : null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The class contains some common method to modify the blocks property */
|
|
94
|
+
class BlockBaseOperator {
|
|
95
|
+
/**
|
|
96
|
+
* Replaces a specific block with an array of blocks within a RTEContentBlock array.
|
|
97
|
+
*
|
|
98
|
+
* @param {RTEBlock} referBlock - Used as a reference block to identify the block that needs to be replaced in the `blocks` array.
|
|
99
|
+
* @param {RTEBlock[]} blocks - An array of RTEBlock objects that you want to replace the `referBlock` with in the `blocks` array.
|
|
100
|
+
*/
|
|
101
|
+
replaceBlockWithBlocks(referBlock, blocks) {
|
|
102
|
+
if (this.blocks) {
|
|
103
|
+
blocks.forEach((block) => {
|
|
104
|
+
block.parent = this;
|
|
105
|
+
});
|
|
106
|
+
this.blocks = this.blocks.flatMap((block) => {
|
|
107
|
+
if (block === referBlock) {
|
|
108
|
+
return blocks;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return block;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Appends new blocks to an array and sets their parent property to a specific type.
|
|
118
|
+
*
|
|
119
|
+
* @param {RTEBlock[]} newBlocks - An array of `RTEBlock` objects that are being passed to the `appendChildBlocks` method.
|
|
120
|
+
*/
|
|
121
|
+
appendChildBlocks(newBlocks) {
|
|
122
|
+
if (this.blocks) {
|
|
123
|
+
newBlocks.forEach((block) => {
|
|
124
|
+
block.parent = this;
|
|
125
|
+
});
|
|
126
|
+
this.blocks = this.blocks.concat(newBlocks);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Removes a specified RTEBlock from an array of blocks.
|
|
131
|
+
*
|
|
132
|
+
* @param {RTEBlock} blockToBeRemoved - The block that needs to be removed from the `blocks` array.
|
|
133
|
+
*/
|
|
134
|
+
removeChildBlock(blockToBeRemoved) {
|
|
135
|
+
if (this.blocks) {
|
|
136
|
+
this.blocks = this.blocks.filter((block) => block !== blockToBeRemoved);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Append blocks or nodes to a block */
|
|
142
|
+
class AppendChildNodesAction extends ModifyContentAction {
|
|
143
|
+
constructor(childNodes) {
|
|
144
|
+
super();
|
|
145
|
+
this.type = ModifyContentActionType.APPEND_CHILD_NODES;
|
|
146
|
+
this.entityToBeAppended = childNodes;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Delete child node or child block from the current list action
|
|
152
|
+
*
|
|
153
|
+
* @example needRemovedNode.parentBlock.apply(new RemoveChildAction(needRemovedNode))
|
|
154
|
+
* @example needRemovedBlock.parent.apply(new RemoveChildAction(needRemovedBlock))
|
|
155
|
+
*/
|
|
156
|
+
class RemoveChildAction extends ModifyContentAction {
|
|
157
|
+
constructor(childNode) {
|
|
158
|
+
super();
|
|
159
|
+
this.type = ModifyContentActionType.DELETE_CHILD;
|
|
160
|
+
this.entityToBeRemoved = childNode;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Abstract class for block
|
|
166
|
+
*/
|
|
167
|
+
class RTEBlock extends BlockBaseOperator {
|
|
168
|
+
constructor(id) {
|
|
169
|
+
super();
|
|
170
|
+
this.annotationMap = new Map();
|
|
171
|
+
this.id = id;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The function `createAnnotationEntity` creates a block annotation entity based on the provided type
|
|
175
|
+
* and value.
|
|
176
|
+
*
|
|
177
|
+
* @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
|
|
178
|
+
* the type of annotation entity to create.
|
|
179
|
+
* @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
|
|
180
|
+
* that will be used to create the annotation entity. It can be of any type depending on the specific
|
|
181
|
+
* annotation being created.
|
|
182
|
+
* @returns {Nullable<[BlockAnnotationTypeEnum, BlockAnnotation]>} The `createAnnotationEntity` function returns a nullable tuple containing a
|
|
183
|
+
* `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
|
|
184
|
+
*/
|
|
185
|
+
static createAnnotationEntity(type, value) {
|
|
186
|
+
switch (type) {
|
|
187
|
+
case 'textAlign':
|
|
188
|
+
return HorizontalAlignmentAnnotation.from(value);
|
|
189
|
+
case 'indent':
|
|
190
|
+
return IndentAnnotation.from(value);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Class to JSON object
|
|
195
|
+
*
|
|
196
|
+
* @returns {VegaRTEBlockBase} - JSON object
|
|
197
|
+
*/
|
|
198
|
+
toJSON() {
|
|
199
|
+
const annotations = Array.from(this.annotationMap.values())
|
|
200
|
+
.filter((annotation) => annotation instanceof BlockAnnotation)
|
|
201
|
+
.reduce((record, annotation) => {
|
|
202
|
+
return Object.assign(Object.assign({}, record), annotation.toJSON());
|
|
203
|
+
}, {});
|
|
204
|
+
return Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {}));
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Get annotation by type
|
|
208
|
+
*
|
|
209
|
+
* @param {keyof typeof BlockAnnotationTypeEnum} type - Annotation type
|
|
210
|
+
* @returns {Nullable<BlockAnnotation> | Nullable<LinkGroupAnnotation>} - Annotation
|
|
211
|
+
*/
|
|
212
|
+
getAnnotationByType(type) {
|
|
213
|
+
return this.annotationMap.get(type);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Apply action to block
|
|
217
|
+
*
|
|
218
|
+
* @param {AnnotationAction} action - Annotation action
|
|
219
|
+
*/
|
|
220
|
+
apply(action) {
|
|
221
|
+
this.doApply(action);
|
|
222
|
+
if (action.isFlushable) {
|
|
223
|
+
const domNode = stateEntityRenderingRegistry.getDOMByEntity(this);
|
|
224
|
+
if (domNode) {
|
|
225
|
+
const nodeSubject = domNodeSubjectFactory.getSubjectFromParentNodeByEventId(domNode, VegaInternalRichTextEditorFlushChanges);
|
|
226
|
+
if (nodeSubject) {
|
|
227
|
+
ChangeManager.notify(nodeSubject, {});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Apply action to block
|
|
234
|
+
*
|
|
235
|
+
* @param {AnnotationAction|ModifyContentAction} action - Annotation action
|
|
236
|
+
*/
|
|
237
|
+
doApply(action) {
|
|
238
|
+
if (action instanceof ModifyContentAction) {
|
|
239
|
+
this.doModifyActionApply(action);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
this.applyAnnotationAction(action);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Apply annotation action to block
|
|
247
|
+
*
|
|
248
|
+
* @param {AnnotationAction} action - Annotation action
|
|
249
|
+
*/
|
|
250
|
+
applyAnnotationAction(action) {
|
|
251
|
+
const annotation = action.toAnnotation();
|
|
252
|
+
this.annotationMap.set(annotation.type, annotation);
|
|
253
|
+
typeof this.doAnnotationActionApply === 'function' && this.doAnnotationActionApply(action);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get styles from annotations
|
|
257
|
+
*
|
|
258
|
+
* @returns {AnnotationStyle} - Annotation style
|
|
259
|
+
*/
|
|
260
|
+
getStyles() {
|
|
261
|
+
return Array.from(this.annotationMap.values())
|
|
262
|
+
.filter((annotation) => annotation instanceof BlockAnnotation)
|
|
263
|
+
.map((annotation) => annotation.render())
|
|
264
|
+
.filter(isNonNullable)
|
|
265
|
+
.reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {});
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Get classes from annotations
|
|
269
|
+
*
|
|
270
|
+
* @returns {AnnotationStyle} - Annotation style
|
|
271
|
+
*/
|
|
272
|
+
getClasses() {
|
|
273
|
+
return Array.from(this.annotationMap.values())
|
|
274
|
+
.map((annotation) => { var _a; return (_a = annotation.renderClass) === null || _a === void 0 ? void 0 : _a.call(annotation); })
|
|
275
|
+
.filter(isNonNullable)
|
|
276
|
+
.reduce((pre, cur) => [pre, cur].join(' '), '');
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Appends a list of RTENode objects to the current node's child nodes and sets the parent block of each node to the current node.
|
|
280
|
+
*
|
|
281
|
+
* @param {RTENode[]} nodesToBeAppended - An array of `RTENode` objects that you want to append to the current block.
|
|
282
|
+
*/
|
|
283
|
+
appendChildNodes(nodesToBeAppended) {
|
|
284
|
+
nodesToBeAppended.forEach((node) => {
|
|
285
|
+
node.parentBlock = this;
|
|
286
|
+
});
|
|
287
|
+
this['nodes'] = this['nodes'].concat(nodesToBeAppended);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Merges the child nodes of two RTEBlocks if they have the same type or both are not images.
|
|
291
|
+
*
|
|
292
|
+
* @param {RTEBlock} secondBlock - A block of content in a rich text editor, such as a paragraph, heading, image, etc.
|
|
293
|
+
*/
|
|
294
|
+
mergeTwoBlocksNodes(secondBlock) {
|
|
295
|
+
if (this.type === secondBlock.type || (this.type !== 'image' && secondBlock.type !== 'image')) {
|
|
296
|
+
let shouldMergeNodes = secondBlock['nodes'];
|
|
297
|
+
if (this.type !== 'image') {
|
|
298
|
+
shouldMergeNodes = secondBlock['nodes'].filter((node) => node['text'] && node['text'] !== ZERO_WIDTH_SPACE);
|
|
299
|
+
}
|
|
300
|
+
this.apply(new AppendChildNodesAction(shouldMergeNodes));
|
|
301
|
+
secondBlock.parent.apply(new RemoveChildAction(secondBlock));
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Concat the child nodes of multiple RTEBlocks if both are not images.
|
|
306
|
+
*
|
|
307
|
+
* @param {RTEBlock[]} blocks - multiple block of content in a rich text editor, such as a paragraph, heading, image, etc.
|
|
308
|
+
* @returns {RTENode[]} Array of connected block nodes
|
|
309
|
+
*/
|
|
310
|
+
concatBlocksNodes(blocks) {
|
|
311
|
+
const nodes = [];
|
|
312
|
+
blocks.map((block) => {
|
|
313
|
+
if (block.type !== 'image') {
|
|
314
|
+
nodes.push(...block['nodes']);
|
|
315
|
+
block.parent.apply(new RemoveChildAction(block));
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
return nodes;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Returns the previous node relative to the current node in a rich text editor structure.
|
|
322
|
+
*
|
|
323
|
+
* @param {RTENode} currentNode - An object of type `RTENode`.
|
|
324
|
+
* @returns {Nullable<RTENode>} the previous block last node
|
|
325
|
+
*/
|
|
326
|
+
getPreviousNode(currentNode) {
|
|
327
|
+
const currentBlock = currentNode.parentBlock;
|
|
328
|
+
const currentIndex = currentBlock['nodes'].indexOf(currentNode);
|
|
329
|
+
if (currentIndex > 0) {
|
|
330
|
+
return currentBlock['nodes'][currentIndex - 1];
|
|
331
|
+
}
|
|
332
|
+
else if (currentBlock.parent) {
|
|
333
|
+
const previousBlock = this.getPreviousBlock(currentBlock);
|
|
334
|
+
if (previousBlock) {
|
|
335
|
+
return this.getBlockLastNode(previousBlock);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Returns the next node relative to the current node in a rich text editor structure.
|
|
341
|
+
*
|
|
342
|
+
* @param {RTENode} currentNode - An object of type `RTENode`.
|
|
343
|
+
* @returns {Nullable<RTENode>} the next block first node
|
|
344
|
+
*/
|
|
345
|
+
getNextNode(currentNode) {
|
|
346
|
+
const currentBlock = currentNode.parentBlock;
|
|
347
|
+
const currentIndex = currentBlock['nodes'].indexOf(currentNode);
|
|
348
|
+
if (currentBlock['nodes'][currentIndex + 1]) {
|
|
349
|
+
return currentBlock['nodes'][currentIndex + 1];
|
|
350
|
+
}
|
|
351
|
+
else if (currentBlock.parent) {
|
|
352
|
+
const nextBlock = this.getNextBlock(currentBlock);
|
|
353
|
+
if (nextBlock) {
|
|
354
|
+
return this.getBlockFirstNode(nextBlock);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Determines if a given node is the first node within the current state.
|
|
360
|
+
*
|
|
361
|
+
* @param {RTENode} currentNode - An object representing a node in a rich text editor (RTE).
|
|
362
|
+
* @returns {boolean} True or false;
|
|
363
|
+
*/
|
|
364
|
+
isContentFirstNode(currentNode) {
|
|
365
|
+
const currentBlock = currentNode.parentBlock;
|
|
366
|
+
const currentIndex = currentBlock['nodes'].indexOf(currentNode);
|
|
367
|
+
const parent = currentBlock.parent;
|
|
368
|
+
if (currentBlock.type === 'list-item') {
|
|
369
|
+
const listParent = parent.parent;
|
|
370
|
+
return (currentIndex === 0 &&
|
|
371
|
+
Array.isArray(parent.blocks) &&
|
|
372
|
+
parent.blocks[0] === currentBlock &&
|
|
373
|
+
listParent['type'] !== 'list-item' &&
|
|
374
|
+
Array.isArray(listParent.blocks) &&
|
|
375
|
+
listParent.blocks[0] === parent);
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
return currentIndex === 0 && Array.isArray(parent.blocks) && parent.blocks[0] === currentBlock;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Returns the last node within a given RTE block, handling different block types accordingly.
|
|
383
|
+
*
|
|
384
|
+
* @param {RTEBlock} currentBlock - Returns the last node within that block.
|
|
385
|
+
* @returns {Nullable<RTENode>} Returns the last node of the given `currentBlock` object.
|
|
386
|
+
*/
|
|
387
|
+
getBlockLastNode(currentBlock) {
|
|
388
|
+
if (currentBlock.type === 'list-item') {
|
|
389
|
+
if (currentBlock['children'] && currentBlock['children'].length > 0) {
|
|
390
|
+
return this.getBlockLastNode(currentBlock['children'][currentBlock['children'].length - 1]);
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
return currentBlock['nodes'][currentBlock['nodes'].length - 1];
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
else if (currentBlock.type === 'number-list' || currentBlock.type === 'bullet-list') {
|
|
397
|
+
if (currentBlock.blocks) {
|
|
398
|
+
const lastListItem = currentBlock.blocks[currentBlock.blocks.length - 1];
|
|
399
|
+
return this.getBlockLastNode(lastListItem);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
if (currentBlock['nodes']) {
|
|
404
|
+
return currentBlock['nodes'][currentBlock['nodes'].length - 1];
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Returns the first node within a given RTE block, handling different block types accordingly.
|
|
410
|
+
*
|
|
411
|
+
* @param {RTEBlock} currentBlock - Returns the first node within that block.
|
|
412
|
+
* @returns {Nullable<RTENode>} Returns the first node of the given `currentBlock` object.
|
|
413
|
+
*/
|
|
414
|
+
getBlockFirstNode(currentBlock) {
|
|
415
|
+
if (currentBlock.type === 'number-list' || currentBlock.type === 'bullet-list') {
|
|
416
|
+
if (currentBlock.blocks) {
|
|
417
|
+
const firstListItem = currentBlock.blocks[0];
|
|
418
|
+
return this.getBlockFirstNode(firstListItem);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
if (currentBlock['nodes']) {
|
|
423
|
+
return currentBlock['nodes'][0];
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* TODO: The getPreviousBlock add nest list support
|
|
429
|
+
* This function retrieves the previous block in a rich text editor, considering different scenarios such as being in a bullet list.
|
|
430
|
+
*
|
|
431
|
+
* @param {RTEBlock} currentBlock - Used to retrieve the previous block relative to the given `currentBlock` within a rich text editor context.
|
|
432
|
+
* @returns {Nullable<RTEBlock>} The previous block if existing
|
|
433
|
+
*/
|
|
434
|
+
getPreviousBlock(currentBlock) {
|
|
435
|
+
if (currentBlock && currentBlock.parent && currentBlock.parent.blocks) {
|
|
436
|
+
const currentBlockIndex = currentBlock.parent.blocks.indexOf(currentBlock);
|
|
437
|
+
if (currentBlockIndex > 0) {
|
|
438
|
+
return currentBlock.parent.blocks[currentBlockIndex - 1];
|
|
439
|
+
}
|
|
440
|
+
else if ((currentBlock.parent['type'] === 'number-list' ||
|
|
441
|
+
currentBlock.parent['type'] === 'bullet-list') &&
|
|
442
|
+
currentBlockIndex === 0) {
|
|
443
|
+
return this.getPreviousBlock(currentBlock.parent);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* This function retrieves the next block in a rich text editor, considering different scenarios such as being in a bullet list.
|
|
449
|
+
*
|
|
450
|
+
* @param {RTEBlock} currentBlock - Used to retrieve the next block relative to the given `currentBlock` within a rich text editor context.
|
|
451
|
+
* @returns {Nullable<RTEBlock>} The next block if existing
|
|
452
|
+
*/
|
|
453
|
+
getNextBlock(currentBlock) {
|
|
454
|
+
if (currentBlock && currentBlock.parent && currentBlock.parent.blocks) {
|
|
455
|
+
const currentBlockIndex = currentBlock.parent.blocks.indexOf(currentBlock);
|
|
456
|
+
if (currentBlock.parent.blocks[currentBlockIndex + 1]) {
|
|
457
|
+
return currentBlock.parent.blocks[currentBlockIndex + 1];
|
|
458
|
+
}
|
|
459
|
+
else if (currentBlock.type === 'list-item' &&
|
|
460
|
+
currentBlock.parent.blocks.length === currentBlockIndex + 1) {
|
|
461
|
+
return this.getNextBlock(currentBlock.parent);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Replaces a specific node with an array of nodes within a RTENode array.
|
|
467
|
+
*
|
|
468
|
+
* @param {RTENode} referNode - Used as a reference node to identify the node that needs to be replaced in the `nodes` array.
|
|
469
|
+
* @param {RTENode[]} nodes - An array of RTENode objects that you want to replace the `referNode` with in the `nodes` array.
|
|
470
|
+
*/
|
|
471
|
+
replaceNodeWithNodes(referNode, nodes) {
|
|
472
|
+
if (this['nodes']) {
|
|
473
|
+
nodes.forEach((node) => {
|
|
474
|
+
node.parentBlock = this;
|
|
475
|
+
});
|
|
476
|
+
this['nodes'] = this['nodes'].flatMap((node) => {
|
|
477
|
+
if (node === referNode) {
|
|
478
|
+
return nodes;
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
return node;
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Annotation for image
|
|
490
|
+
*/
|
|
491
|
+
class ImageAnnotation extends NodeAnnotation {
|
|
492
|
+
constructor(size = 'md', alt) {
|
|
493
|
+
super();
|
|
494
|
+
this.type = NodeAnnotationTypeEnum.IMAGE;
|
|
495
|
+
this.size = size;
|
|
496
|
+
this.alt = alt;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Generate the map item for the annotation
|
|
500
|
+
*
|
|
501
|
+
* @param {string} size - Image size
|
|
502
|
+
* @param {string} alt - Image alt
|
|
503
|
+
* @returns {[NodeAnnotationTypeEnum.IMAGE, ImageAnnotation]} Map item for the annotation
|
|
504
|
+
*/
|
|
505
|
+
static from(size, alt) {
|
|
506
|
+
return [NodeAnnotationTypeEnum.IMAGE, new ImageAnnotation(size, alt)];
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Generate the JSON representation of the annotation
|
|
510
|
+
*
|
|
511
|
+
* @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
|
|
512
|
+
*/
|
|
513
|
+
toJSON() {
|
|
514
|
+
return isNonNullable(this.alt)
|
|
515
|
+
? {
|
|
516
|
+
size: this.size,
|
|
517
|
+
alt: this.alt,
|
|
518
|
+
}
|
|
519
|
+
: {
|
|
520
|
+
size: this.size,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Generate the style for the image
|
|
525
|
+
*
|
|
526
|
+
* @returns {Nullable<AnnotationStyle>} image style
|
|
527
|
+
*/
|
|
528
|
+
render() {
|
|
529
|
+
switch (this.size) {
|
|
530
|
+
case 'sm': {
|
|
531
|
+
return { width: '25%' };
|
|
532
|
+
}
|
|
533
|
+
case 'md': {
|
|
534
|
+
return { width: '50%' };
|
|
535
|
+
}
|
|
536
|
+
case 'lg': {
|
|
537
|
+
return { width: '100%' };
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Action to add an image annotation to the editor
|
|
545
|
+
*/
|
|
546
|
+
class ImageAnnotationAction extends AnnotationAction {
|
|
547
|
+
constructor(size, alt) {
|
|
548
|
+
super();
|
|
549
|
+
this.isFlushable = true;
|
|
550
|
+
this.size = size;
|
|
551
|
+
this.alt = alt;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Converts the action to an annotation
|
|
555
|
+
*
|
|
556
|
+
* @returns {ImageAnnotation} The annotation
|
|
557
|
+
*/
|
|
558
|
+
toAnnotation() {
|
|
559
|
+
return new ImageAnnotation(this.size, this.alt);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
class RTEImageNode extends RTENode {
|
|
564
|
+
constructor(id, url, parentBlock, annotationMap) {
|
|
565
|
+
super(id, annotationMap);
|
|
566
|
+
this.type = NodeTypeEnum.IMAGE;
|
|
567
|
+
this.url = url;
|
|
568
|
+
this.parentBlock = parentBlock;
|
|
569
|
+
}
|
|
570
|
+
static from(image, parentBlock) {
|
|
571
|
+
const imageNode = new RTEImageNode(image.id, image.url, parentBlock);
|
|
572
|
+
let annotations;
|
|
573
|
+
if (!image.annotations || Object.keys(image.annotations).length === 0) {
|
|
574
|
+
annotations = { size: 'md' };
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
annotations = image.annotations;
|
|
578
|
+
}
|
|
579
|
+
imageNode.annotationMap = new Map(Object.keys(annotations)
|
|
580
|
+
.map(() => ImageAnnotation.from(annotations.size, annotations.alt))
|
|
581
|
+
.filter(isNonNullable));
|
|
582
|
+
return imageNode;
|
|
583
|
+
}
|
|
584
|
+
toJSON() {
|
|
585
|
+
const imageAnnotation = this.annotationMap.get(NodeAnnotationTypeEnum.IMAGE);
|
|
586
|
+
const annotations = {};
|
|
587
|
+
if (imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.size) {
|
|
588
|
+
annotations.size = imageAnnotation.size;
|
|
589
|
+
}
|
|
590
|
+
if (imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.alt) {
|
|
591
|
+
annotations.alt = imageAnnotation.alt;
|
|
592
|
+
}
|
|
593
|
+
return Object.assign(Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {})), { type: 'image', url: this.url });
|
|
594
|
+
}
|
|
595
|
+
render({ editable } = {}) {
|
|
596
|
+
const imageAnnotation = this.annotationMap.get(NodeAnnotationTypeEnum.IMAGE);
|
|
597
|
+
const size = imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.size;
|
|
598
|
+
const alt = imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.alt;
|
|
599
|
+
const handleChange = ({ detail, }) => {
|
|
600
|
+
switch (detail.action) {
|
|
601
|
+
case 'edit': {
|
|
602
|
+
const size = detail.payload.size;
|
|
603
|
+
const alt = detail.payload.alt;
|
|
604
|
+
this.apply(new ImageAnnotationAction(size, alt));
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
/*
|
|
608
|
+
* The below method is e2e-test covered in
|
|
609
|
+
* @see{module:vega-rich-text-editor-image-click-delete-button}
|
|
610
|
+
*/
|
|
611
|
+
/* istanbul ignore next */
|
|
612
|
+
case 'delete': {
|
|
613
|
+
const event = new InputEvent('beforeinput', {
|
|
614
|
+
inputType: 'deleteContentBackward',
|
|
615
|
+
bubbles: true,
|
|
616
|
+
});
|
|
617
|
+
setTimeout(() => {
|
|
618
|
+
stateEntityRenderingRegistry.getDOMByEntity(this).dispatchEvent(event);
|
|
619
|
+
}, 50);
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
return editable ? (h("vega-rich-text-image-editor", { style: this.getStyles(), size: size, alt: alt, ref: (ref) => {
|
|
625
|
+
DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, VegaChange, handleChange);
|
|
626
|
+
} }, this.renderImage(editable, alt))) : (this.renderImage(editable, alt));
|
|
627
|
+
}
|
|
628
|
+
doAnnotationActionApply(action) {
|
|
629
|
+
const annotation = action.toAnnotation();
|
|
630
|
+
this.annotationMap.set(annotation.type, annotation);
|
|
631
|
+
}
|
|
632
|
+
// placeholder method
|
|
633
|
+
/* istanbul ignore next */
|
|
634
|
+
doModifyActionApply(action) {
|
|
635
|
+
}
|
|
636
|
+
registerRef(ref) {
|
|
637
|
+
if (ref) {
|
|
638
|
+
stateEntityRenderingRegistry.register(ref, this);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
renderImage(editable, alt) {
|
|
642
|
+
return (h("img", { style: editable ? { width: '100%' } : this.getStyles(), alt: alt, src: this.url, ref: this.registerRef.bind(this) }));
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Clear the current block nodes and append new nodes
|
|
648
|
+
*
|
|
649
|
+
* @example block.apply(new ReplaceChildNodesAction(newNodes))
|
|
650
|
+
*/
|
|
651
|
+
class ReplaceChildNodesAction extends ModifyContentAction {
|
|
652
|
+
constructor(newChildNodes) {
|
|
653
|
+
super();
|
|
654
|
+
this.type = ModifyContentActionType.REPLACE_CHILD_NODES;
|
|
655
|
+
this.newChildNodes = newChildNodes;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Insert a new block after a existing block
|
|
661
|
+
*
|
|
662
|
+
* @example currentBlock.parent.apply(new InsertBlocksAfterAction(currentBlock, newBlock, ...))
|
|
663
|
+
*/
|
|
664
|
+
class InsertBlocksAfterAction extends ModifyContentAction {
|
|
665
|
+
constructor(referBlock, ...blocksToBeInserted) {
|
|
666
|
+
super();
|
|
667
|
+
this.type = ModifyContentActionType.INSERT_BLOCKS_AFTER;
|
|
668
|
+
this.referBlock = referBlock;
|
|
669
|
+
this.blocksToBeInserted = blocksToBeInserted;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Split the block with a split point node.
|
|
675
|
+
* The property `newBlock` use to store the new create block if need.
|
|
676
|
+
*
|
|
677
|
+
* @example block.apply(new SplitBlockWithNodeAction(node, offset))
|
|
678
|
+
*/
|
|
679
|
+
class SplitBlockWithNodeAction extends ModifyContentAction {
|
|
680
|
+
constructor(splitPointNode, startOffsetOfNode) {
|
|
681
|
+
super();
|
|
682
|
+
this.type = ModifyContentActionType.SPLIT_BLOCK_WITH_NODE;
|
|
683
|
+
this.splitPointNode = splitPointNode;
|
|
684
|
+
this.startOffsetOfNode = startOffsetOfNode;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Text style annotation
|
|
690
|
+
*/
|
|
691
|
+
class TextStyleAnnotation extends BlockAnnotation {
|
|
692
|
+
constructor(textStyle) {
|
|
693
|
+
super();
|
|
694
|
+
this.type = BlockAnnotationTypeEnum.TEXT_STYLE;
|
|
695
|
+
this.textStyle = textStyle;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* Generate the map item for the annotations
|
|
699
|
+
*
|
|
700
|
+
* @param {VegaRTETextStyleType} textStyle - the text style type
|
|
701
|
+
* @returns {[BlockAnnotationTypeEnum.TEXT_STYLE, TextStyleAnnotation]} Map item for the annotation
|
|
702
|
+
*/
|
|
703
|
+
static from(textStyle) {
|
|
704
|
+
return [BlockAnnotationTypeEnum.TEXT_STYLE, new TextStyleAnnotation(textStyle)];
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Generate the JSON representation of the annotation
|
|
708
|
+
*
|
|
709
|
+
* @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
|
|
710
|
+
*/
|
|
711
|
+
toJSON() {
|
|
712
|
+
return { textStyle: this.textStyle };
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Render the styles by block type
|
|
716
|
+
*
|
|
717
|
+
* @returns {AnnotationStyle} the styles to apply
|
|
718
|
+
*/
|
|
719
|
+
render() {
|
|
720
|
+
const paragraphStyle = {
|
|
721
|
+
fontFamily: 'Inter',
|
|
722
|
+
fontSize: '16px',
|
|
723
|
+
lineHeight: '22px',
|
|
724
|
+
fontWeight: '500',
|
|
725
|
+
};
|
|
726
|
+
switch (this.textStyle) {
|
|
727
|
+
case 'paragraph': {
|
|
728
|
+
return paragraphStyle;
|
|
729
|
+
}
|
|
730
|
+
case 'title': {
|
|
731
|
+
return { fontFamily: 'Inter', fontSize: '36px', lineHeight: '40px', fontWeight: '500' };
|
|
732
|
+
}
|
|
733
|
+
case 'subtitle': {
|
|
734
|
+
return { fontFamily: 'Inter', fontSize: '28px', lineHeight: '32px', fontWeight: '500' };
|
|
735
|
+
}
|
|
736
|
+
case 'heading-1': {
|
|
737
|
+
return { fontFamily: 'Inter', fontSize: '22px', lineHeight: '24px', fontWeight: '500' };
|
|
738
|
+
}
|
|
739
|
+
case 'heading-2': {
|
|
740
|
+
return { fontFamily: 'Inter', fontSize: '20px', lineHeight: '24px', fontWeight: '500' };
|
|
741
|
+
}
|
|
742
|
+
case 'heading-3': {
|
|
743
|
+
return { fontFamily: 'Inter', fontSize: '18px', lineHeight: '22px', fontWeight: '500' };
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Action to change the text style of a block
|
|
751
|
+
*/
|
|
752
|
+
class TextStyleAnnotationAction extends AnnotationAction {
|
|
753
|
+
constructor(textStyle, bold) {
|
|
754
|
+
super();
|
|
755
|
+
this.isFlushable = true;
|
|
756
|
+
this.textStyle = textStyle;
|
|
757
|
+
this.bold = bold;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Converts the action to a block annotation
|
|
761
|
+
*
|
|
762
|
+
* @returns {BlockAnnotation} the block annotation
|
|
763
|
+
*/
|
|
764
|
+
toAnnotation() {
|
|
765
|
+
return new TextStyleAnnotation(this.textStyle);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Action to toggle bold annotation
|
|
771
|
+
*/
|
|
772
|
+
class BoldAnnotationAction extends TextSplittableAction {
|
|
773
|
+
constructor(bold) {
|
|
774
|
+
super();
|
|
775
|
+
this.isFlushable = true;
|
|
776
|
+
this.bold = bold;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Converts the action to an annotation
|
|
780
|
+
*
|
|
781
|
+
* @returns {BoldAnnotation} the annotation
|
|
782
|
+
*/
|
|
783
|
+
toAnnotation() {
|
|
784
|
+
return new BoldAnnotation(this.bold);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Merge the two blocks node into first block if the two blocks nodes type is same(text node or image node)
|
|
790
|
+
*
|
|
791
|
+
* @example firstBlock.apply(new MergeTwoBlocksNodesAction(secondBlock))
|
|
792
|
+
*/
|
|
793
|
+
class MergeTwoBlocksNodesAction extends ModifyContentAction {
|
|
794
|
+
constructor(blockNeedToBeMerged) {
|
|
795
|
+
super();
|
|
796
|
+
this.type = ModifyContentActionType.MERGE_TWO_BLOCKS_NODES;
|
|
797
|
+
this.blockNeedToBeMerged = blockNeedToBeMerged;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Insert a new block before a existing block
|
|
803
|
+
*
|
|
804
|
+
* @example currentBlock.parent.apply(new InsertBlocksBeforeAction(currentBlock, newBlock, ...))
|
|
805
|
+
*/
|
|
806
|
+
class InsertBlocksBeforeAction extends ModifyContentAction {
|
|
807
|
+
constructor(referBlock, ...blocksToBeInserted) {
|
|
808
|
+
super();
|
|
809
|
+
this.type = ModifyContentActionType.INSERT_BLOCKS_BEFORE;
|
|
810
|
+
this.referBlock = referBlock;
|
|
811
|
+
this.blocksToBeInserted = blocksToBeInserted;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* Text block
|
|
817
|
+
*/
|
|
818
|
+
class RTETextBlock extends RTEBlock {
|
|
819
|
+
constructor(id, type) {
|
|
820
|
+
super(id);
|
|
821
|
+
this.nodes = [];
|
|
822
|
+
this.type = type;
|
|
823
|
+
if (RTETextBlock.isAcceptableTextStyle(type)) {
|
|
824
|
+
this.annotationMap = new Map([TextStyleAnnotation.from(type)]);
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
this.annotationMap = new Map([TextStyleAnnotation.from('paragraph')]);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
static from(block) {
|
|
831
|
+
const textBlock = new RTETextBlock(block.id, block.type);
|
|
832
|
+
const { annotations } = block;
|
|
833
|
+
textBlock.nodes = block.nodes.map((richText) => RTETextNode.from(richText, textBlock));
|
|
834
|
+
if (annotations) {
|
|
835
|
+
Object.entries(annotations).forEach(([type, value]) => {
|
|
836
|
+
const item = this.createAnnotationEntity(type, value);
|
|
837
|
+
if (isNonNullable(item)) {
|
|
838
|
+
textBlock.annotationMap.set(...item);
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
return textBlock;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* The function `createAnnotationEntity` creates a block annotation entity based on the provided type
|
|
846
|
+
* and value.
|
|
847
|
+
*
|
|
848
|
+
* @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
|
|
849
|
+
* the type of annotation entity to create.
|
|
850
|
+
* @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
|
|
851
|
+
* that will be used to create the annotation entity. It can be of any type depending on the specific
|
|
852
|
+
* annotation being created.
|
|
853
|
+
* @returns {Nullable<[BlockAnnotationTypeEnum, BlockAnnotation]>} The `createAnnotationEntity` function returns a nullable tuple containing a
|
|
854
|
+
* `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
|
|
855
|
+
*/
|
|
856
|
+
static createAnnotationEntity(type, value) {
|
|
857
|
+
if (type === 'textStyle') {
|
|
858
|
+
return TextStyleAnnotation.from(value);
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
return super.createAnnotationEntity(type, value);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
static isAcceptableTextStyle(type) {
|
|
865
|
+
return ['title', 'subtitle', 'paragraph', 'heading-1', 'heading-2', 'heading-3'].includes(type);
|
|
866
|
+
}
|
|
867
|
+
mergeNodes(action) {
|
|
868
|
+
this.nodes = this.nodes.reduce((prev, cur) => {
|
|
869
|
+
const lastNode = prev.at(-1);
|
|
870
|
+
if (action instanceof LinkAnnotationAction && action.needMergeNode) {
|
|
871
|
+
const lastNodeLinkAnnotation = lastNode === null || lastNode === void 0 ? void 0 : lastNode.getAnnotationByType(NodeAnnotationTypeEnum.LINK);
|
|
872
|
+
const curNodeLinkAnnotation = cur.getAnnotationByType(NodeAnnotationTypeEnum.LINK);
|
|
873
|
+
if (lastNodeLinkAnnotation &&
|
|
874
|
+
curNodeLinkAnnotation &&
|
|
875
|
+
lastNodeLinkAnnotation.toEqual(curNodeLinkAnnotation)) {
|
|
876
|
+
return prev;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
// TODO: handle other cases like merge bold nodes
|
|
880
|
+
return [...prev, cur];
|
|
881
|
+
}, []);
|
|
882
|
+
}
|
|
883
|
+
toJSON() {
|
|
884
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, nodes: this.nodes.map((node) => node.toJSON()) });
|
|
885
|
+
}
|
|
886
|
+
cloneWithNodes(nodes) {
|
|
887
|
+
const block = new RTETextBlock(generateUUID(), this.type);
|
|
888
|
+
block.nodes = [];
|
|
889
|
+
block.apply(new AppendChildNodesAction(nodes));
|
|
890
|
+
return block;
|
|
891
|
+
}
|
|
892
|
+
isNotEmpty() {
|
|
893
|
+
return this.nodes.length > 0 && this.nodes.some((node) => !node.isEmpty());
|
|
894
|
+
}
|
|
895
|
+
getLastNode() {
|
|
896
|
+
return this.nodes[this.nodes.length - 1];
|
|
897
|
+
}
|
|
898
|
+
render(renderContext, children) {
|
|
899
|
+
const BlockTag = this.getBlockTagByType(this.type);
|
|
900
|
+
return (h(BlockTag, { ref: this.registerRef.bind(this), style: this.getStyles(), class: super.getClasses() },
|
|
901
|
+
this.renderNodes(renderContext),
|
|
902
|
+
children));
|
|
903
|
+
}
|
|
904
|
+
registerRef(ref) {
|
|
905
|
+
if (ref) {
|
|
906
|
+
stateEntityRenderingRegistry.register(ref, this);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
renderNodes(renderConfig = {}) {
|
|
910
|
+
const linkGroupAnnotation = this.getAnnotationByType(InternalAnnotationTypeEnum.LINK_GROUP);
|
|
911
|
+
return linkGroupAnnotation
|
|
912
|
+
? linkGroupAnnotation.renderNodes(this.nodes, renderConfig)
|
|
913
|
+
: this.nodes.map((node) => node.render());
|
|
914
|
+
}
|
|
915
|
+
doAnnotationActionApply(action) {
|
|
916
|
+
if (action instanceof TextStyleAnnotationAction) {
|
|
917
|
+
if (this.type !== 'list-item') {
|
|
918
|
+
this.type = action.textStyle;
|
|
919
|
+
}
|
|
920
|
+
if (action.bold) {
|
|
921
|
+
this.nodes.forEach((node) => {
|
|
922
|
+
const boldAnnotationAction = new BoldAnnotationAction(true);
|
|
923
|
+
boldAnnotationAction.doSplit = false;
|
|
924
|
+
node.apply(boldAnnotationAction);
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
this.nodes.forEach((node) => {
|
|
929
|
+
node.apply(new DeleteNodeAnnotationAction(NodeAnnotationTypeEnum.BOLD));
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
if (action instanceof LinkGroupAnnotationAction) {
|
|
935
|
+
const linkGroupAnnotation = this.getAnnotationByType(InternalAnnotationTypeEnum.LINK_GROUP);
|
|
936
|
+
if (linkGroupAnnotation) {
|
|
937
|
+
const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey);
|
|
938
|
+
linkGroupAnnotation.linkGroups.set(action.groupKey, [...linkGroup, ...action.nodes]);
|
|
939
|
+
this.annotationMap.set(InternalAnnotationTypeEnum.LINK_GROUP, linkGroupAnnotation);
|
|
940
|
+
}
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Apply a modify action to block
|
|
946
|
+
*
|
|
947
|
+
* @param {ModifyContentAction} action - Modify action
|
|
948
|
+
*/
|
|
949
|
+
doModifyActionApply(action) {
|
|
950
|
+
switch (action.type) {
|
|
951
|
+
case ModifyContentActionType.DELETE_CHILD:
|
|
952
|
+
this.removeChildNode(action);
|
|
953
|
+
break;
|
|
954
|
+
case ModifyContentActionType.APPEND_CHILD_NODES:
|
|
955
|
+
this.appendChildNodes(action.entityToBeAppended);
|
|
956
|
+
break;
|
|
957
|
+
case ModifyContentActionType.CLEAR_CHILD_NODES:
|
|
958
|
+
this.nodes = [];
|
|
959
|
+
break;
|
|
960
|
+
case ModifyContentActionType.SPLIT_BLOCK_WITH_NODE:
|
|
961
|
+
action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode);
|
|
962
|
+
break;
|
|
963
|
+
case ModifyContentActionType.REPLACE_CHILD_NODES:
|
|
964
|
+
this.nodes = [];
|
|
965
|
+
this.appendChildNodes(action.newChildNodes);
|
|
966
|
+
break;
|
|
967
|
+
case ModifyContentActionType.MERGE_TWO_BLOCKS_NODES:
|
|
968
|
+
this.mergeTwoBlocksNodes(action.blockNeedToBeMerged);
|
|
969
|
+
break;
|
|
970
|
+
case ModifyContentActionType.BREAK_SINGLE_BLOCK:
|
|
971
|
+
action.newBlock = this.breakSingleTextBlock(action.startContainerNode, action.startOffset);
|
|
972
|
+
break;
|
|
973
|
+
case ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK:
|
|
974
|
+
action.lineBreakNode = this.lineBreakSingleBlock(action.startContainerNode, action.startOffset);
|
|
975
|
+
break;
|
|
976
|
+
case ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS:
|
|
977
|
+
action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks);
|
|
978
|
+
break;
|
|
979
|
+
case ModifyContentActionType.TRANSFORM_LIST_BLOCK:
|
|
980
|
+
this.convertParagraphToList(action);
|
|
981
|
+
break;
|
|
982
|
+
case ModifyContentActionType.DELETE_BLOCK_CONTENT:
|
|
983
|
+
this.deleteNodeContent(action);
|
|
984
|
+
break;
|
|
985
|
+
case ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
|
|
986
|
+
this.insertImage(action);
|
|
987
|
+
break;
|
|
988
|
+
case ModifyContentActionType.INSERT_NODES_BEFORE:
|
|
989
|
+
this.replaceNodeWithNodes(action.referNode, [
|
|
990
|
+
...action.nodesToBeInserted,
|
|
991
|
+
action.referNode,
|
|
992
|
+
]);
|
|
993
|
+
break;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
splitTextNodeBlock(splitNode, startOffsetOfNode) {
|
|
997
|
+
if (splitNode) {
|
|
998
|
+
const beforeText = splitNode.text.slice(0, startOffsetOfNode);
|
|
999
|
+
const afterText = splitNode.text.slice(startOffsetOfNode);
|
|
1000
|
+
const nodesSplitIndex = this.nodes.indexOf(splitNode);
|
|
1001
|
+
if (nodesSplitIndex > -1) {
|
|
1002
|
+
const beforeNodes = this.nodes.slice(0, nodesSplitIndex);
|
|
1003
|
+
const afterNodes = this.nodes.slice(nodesSplitIndex + 1);
|
|
1004
|
+
if (beforeText) {
|
|
1005
|
+
beforeNodes.push(splitNode.cloneWithText(beforeText));
|
|
1006
|
+
}
|
|
1007
|
+
if (afterText) {
|
|
1008
|
+
afterNodes.unshift(splitNode.cloneWithText(afterText));
|
|
1009
|
+
}
|
|
1010
|
+
this.apply(new ReplaceChildNodesAction(beforeNodes));
|
|
1011
|
+
const newBlock = this.cloneWithNodes(afterNodes);
|
|
1012
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newBlock));
|
|
1013
|
+
return newBlock;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
isCaretPositionAtStart(node, startOffset) {
|
|
1018
|
+
return node === this.nodes[0] && startOffset === 0;
|
|
1019
|
+
}
|
|
1020
|
+
isCaretPositionAtEnd(node, startOffset) {
|
|
1021
|
+
const lastNode = this.nodes[this.nodes.length - 1];
|
|
1022
|
+
return node === lastNode && (node.isEmpty() || startOffset === lastNode.text.length);
|
|
1023
|
+
}
|
|
1024
|
+
lineBreakSingleBlock(splitNode, startOffsetOfNode) {
|
|
1025
|
+
if (splitNode) {
|
|
1026
|
+
const lineBreakNode = new RTETextNode(generateUUID(), '\n', this);
|
|
1027
|
+
const beforeText = splitNode.text.slice(0, startOffsetOfNode);
|
|
1028
|
+
const afterText = splitNode.text.slice(startOffsetOfNode);
|
|
1029
|
+
const nodesSplitIndex = this.nodes.indexOf(splitNode);
|
|
1030
|
+
if (nodesSplitIndex > -1) {
|
|
1031
|
+
const beforeNodes = this.nodes.slice(0, nodesSplitIndex);
|
|
1032
|
+
const afterNodes = this.nodes.slice(nodesSplitIndex + 1);
|
|
1033
|
+
if (beforeText) {
|
|
1034
|
+
beforeNodes.push(splitNode.cloneWithText(beforeText));
|
|
1035
|
+
}
|
|
1036
|
+
if (afterText) {
|
|
1037
|
+
afterNodes.unshift(splitNode.cloneWithText(afterText));
|
|
1038
|
+
}
|
|
1039
|
+
this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes);
|
|
1040
|
+
}
|
|
1041
|
+
return lineBreakNode;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
lineBreakMultipleBlocks(selectedBlocks) {
|
|
1045
|
+
const beforeNodes = this['nodes'];
|
|
1046
|
+
const lineBreakNode = new RTETextNode(generateUUID(), '\n', this);
|
|
1047
|
+
const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
|
|
1048
|
+
this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes);
|
|
1049
|
+
return lineBreakNode;
|
|
1050
|
+
}
|
|
1051
|
+
deleteNodeContent(action) {
|
|
1052
|
+
const startContainerNode = action.startContainerNode;
|
|
1053
|
+
const startOffset = action.startOffset;
|
|
1054
|
+
if (startOffset !== 0 && !startContainerNode.isEmpty()) {
|
|
1055
|
+
const newText = startContainerNode.text.slice(0, startOffset - 1) +
|
|
1056
|
+
startContainerNode.text.slice(startOffset);
|
|
1057
|
+
startContainerNode.apply(new UpdateTextAction(newText));
|
|
1058
|
+
if (newText) {
|
|
1059
|
+
action.previousNode = startContainerNode;
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
else {
|
|
1063
|
+
const previousNode = this.getPreviousNode(startContainerNode);
|
|
1064
|
+
// Remove the last character will not delete paragraph, the paragraph will removed after press delete again
|
|
1065
|
+
if ((previousNode && previousNode.parentBlock === this && previousNode['text'] === '\n') ||
|
|
1066
|
+
this.nodes.length === 1) {
|
|
1067
|
+
action.previousNode = startContainerNode;
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
else {
|
|
1071
|
+
this.apply(new RemoveChildAction(startContainerNode));
|
|
1072
|
+
action.previousNode = previousNode;
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
let previousNode = this.getPreviousNode(startContainerNode);
|
|
1079
|
+
let nextNode = null;
|
|
1080
|
+
if (this.nodes.length && previousNode && previousNode.parentBlock !== this) {
|
|
1081
|
+
if (startContainerNode.isEmpty()) {
|
|
1082
|
+
this.apply(new RemoveChildAction(startContainerNode));
|
|
1083
|
+
}
|
|
1084
|
+
previousNode.parentBlock.apply(new MergeTwoBlocksNodesAction(this));
|
|
1085
|
+
}
|
|
1086
|
+
else {
|
|
1087
|
+
if (this.isContentFirstNode(startContainerNode) && startContainerNode.isEmpty()) {
|
|
1088
|
+
nextNode = this.getNextNode(startContainerNode);
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Remove line break
|
|
1092
|
+
* @example caret at the first line
|
|
1093
|
+
* \n
|
|
1094
|
+
* test
|
|
1095
|
+
*/
|
|
1096
|
+
if (startContainerNode.isEmpty()) {
|
|
1097
|
+
this.apply(new RemoveChildAction(startContainerNode));
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Remove line break
|
|
1101
|
+
* @example caret at the begin of second line
|
|
1102
|
+
* \n
|
|
1103
|
+
* test
|
|
1104
|
+
*/
|
|
1105
|
+
if (previousNode instanceof RTETextNode && previousNode.isEmpty()) {
|
|
1106
|
+
const shouldRemoveNode = previousNode;
|
|
1107
|
+
previousNode = this.getPreviousNode(previousNode);
|
|
1108
|
+
shouldRemoveNode.parentBlock.apply(new RemoveChildAction(shouldRemoveNode));
|
|
1109
|
+
if (!previousNode) {
|
|
1110
|
+
nextNode = startContainerNode;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
//Remove the paragraph block if the content is empty
|
|
1115
|
+
if (this.nodes.length === 0) {
|
|
1116
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1117
|
+
}
|
|
1118
|
+
if (previousNode) {
|
|
1119
|
+
action.previousNode = previousNode;
|
|
1120
|
+
}
|
|
1121
|
+
else if (nextNode) {
|
|
1122
|
+
action.nextNode = nextNode;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
removeChildNode(action) {
|
|
1127
|
+
this.nodes = this.nodes.filter((node) => node !== action.entityToBeRemoved);
|
|
1128
|
+
if (this.nodes.length === 0) {
|
|
1129
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes) {
|
|
1133
|
+
if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
|
|
1134
|
+
afterNodes.push(new RTETextNode(generateUUID(), '\n', this, beforeNodes[beforeNodes.length - 1] && beforeNodes[beforeNodes.length - 1].annotationMap));
|
|
1135
|
+
}
|
|
1136
|
+
this.apply(new ReplaceChildNodesAction([...beforeNodes, lineBreakNode, ...afterNodes]));
|
|
1137
|
+
}
|
|
1138
|
+
getBlockTagByType(type) {
|
|
1139
|
+
switch (type) {
|
|
1140
|
+
case 'title':
|
|
1141
|
+
case 'subtitle':
|
|
1142
|
+
return `div`;
|
|
1143
|
+
case 'heading-1':
|
|
1144
|
+
return `h1`;
|
|
1145
|
+
case 'heading-2':
|
|
1146
|
+
return `h2`;
|
|
1147
|
+
case 'heading-3':
|
|
1148
|
+
return `h3`;
|
|
1149
|
+
case 'paragraph':
|
|
1150
|
+
return 'p';
|
|
1151
|
+
case 'list-item':
|
|
1152
|
+
return 'li';
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
breakSingleTextBlock(splitNode, startOffsetOfNode) {
|
|
1156
|
+
const newParagraph = this.copyInlineStyleToNewParagraph(splitNode);
|
|
1157
|
+
if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
|
|
1158
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newParagraph));
|
|
1159
|
+
}
|
|
1160
|
+
else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
|
|
1161
|
+
this.parent.apply(new InsertBlocksBeforeAction(this, newParagraph));
|
|
1162
|
+
}
|
|
1163
|
+
else {
|
|
1164
|
+
const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
|
|
1165
|
+
this.apply(splitBlockAction);
|
|
1166
|
+
return splitBlockAction.newBlock;
|
|
1167
|
+
}
|
|
1168
|
+
return newParagraph;
|
|
1169
|
+
}
|
|
1170
|
+
convertParagraphToList(action) {
|
|
1171
|
+
const bulletList = this.parent.createList(action.listType);
|
|
1172
|
+
const listItems = action.selectedBlocks.map((node) => this.parent.toListItem(node));
|
|
1173
|
+
bulletList.apply(new AppendChildNodesAction(listItems));
|
|
1174
|
+
this.parent.apply(new InsertBlocksAfterAction(action.selectedBlocks[0], bulletList));
|
|
1175
|
+
action.selectedBlocks.forEach((node) => {
|
|
1176
|
+
node.parent.apply(new RemoveChildAction(node));
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
insertImage(action) {
|
|
1180
|
+
const splitNode = action.splitPointNode;
|
|
1181
|
+
const startOffsetOfNode = action.startOffsetOfNode;
|
|
1182
|
+
const newImageBlock = action.imageBlockToBeInserted;
|
|
1183
|
+
if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
|
|
1184
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
|
|
1185
|
+
}
|
|
1186
|
+
else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
|
|
1187
|
+
this.parent.apply(new InsertBlocksBeforeAction(this, newImageBlock));
|
|
1188
|
+
}
|
|
1189
|
+
else {
|
|
1190
|
+
const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
|
|
1191
|
+
this.apply(splitBlockAction);
|
|
1192
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
copyInlineStyleToNewParagraph(needCopedNode) {
|
|
1196
|
+
const textNode = needCopedNode.cloneWithText('');
|
|
1197
|
+
// The link annotation don't need inherited
|
|
1198
|
+
textNode.annotationMap.delete(NodeAnnotationTypeEnum.LINK);
|
|
1199
|
+
const newParagraph = new RTETextBlock(generateUUID(), 'paragraph');
|
|
1200
|
+
newParagraph.apply(new AppendChildNodesAction([textNode]));
|
|
1201
|
+
return newParagraph;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* Image block
|
|
1207
|
+
*/
|
|
1208
|
+
class RTEImageBlock extends RTEBlock {
|
|
1209
|
+
constructor(id) {
|
|
1210
|
+
super(id);
|
|
1211
|
+
this.type = 'image';
|
|
1212
|
+
this.nodes = [];
|
|
1213
|
+
}
|
|
1214
|
+
static from(block) {
|
|
1215
|
+
const imageBlock = new RTEImageBlock(block.id);
|
|
1216
|
+
const { annotations } = block;
|
|
1217
|
+
imageBlock.nodes = block.nodes.map((image) => RTEImageNode.from(image, imageBlock));
|
|
1218
|
+
if (annotations) {
|
|
1219
|
+
Object.entries(annotations).forEach(([type, value]) => {
|
|
1220
|
+
const item = this.createAnnotationEntity(type, value);
|
|
1221
|
+
if (isNonNullable(item)) {
|
|
1222
|
+
imageBlock.annotationMap.set(...item);
|
|
1223
|
+
}
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
return imageBlock;
|
|
1227
|
+
}
|
|
1228
|
+
toJSON() {
|
|
1229
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.nodes.map((node) => node.toJSON()) });
|
|
1230
|
+
}
|
|
1231
|
+
isNotEmpty() {
|
|
1232
|
+
return this.nodes.length > 0 && this.nodes.some((node) => node.url.length > 0);
|
|
1233
|
+
}
|
|
1234
|
+
getLastNode() {
|
|
1235
|
+
return this.nodes[this.nodes.length - 1];
|
|
1236
|
+
}
|
|
1237
|
+
render(renderContext) {
|
|
1238
|
+
return (h("div", { style: Object.assign({}, this.getStyles()), ref: this.registerRef.bind(this), class: super.getClasses() }, this.nodes.map((node) => {
|
|
1239
|
+
return node.render(renderContext);
|
|
1240
|
+
})));
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* Apply modify action to block
|
|
1244
|
+
*
|
|
1245
|
+
* @param {ModifyContentAction} action - Modify action
|
|
1246
|
+
*/
|
|
1247
|
+
doModifyActionApply(action) {
|
|
1248
|
+
switch (action.type) {
|
|
1249
|
+
case ModifyContentActionType.DELETE_CHILD:
|
|
1250
|
+
this.removeChildNode(action);
|
|
1251
|
+
break;
|
|
1252
|
+
case ModifyContentActionType.CLEAR_CHILD_NODES:
|
|
1253
|
+
this.nodes = [];
|
|
1254
|
+
break;
|
|
1255
|
+
case ModifyContentActionType.APPEND_CHILD_NODES:
|
|
1256
|
+
this.appendChildNodes(action.entityToBeAppended);
|
|
1257
|
+
break;
|
|
1258
|
+
case ModifyContentActionType.REPLACE_CHILD_NODES:
|
|
1259
|
+
this.nodes = [];
|
|
1260
|
+
this.appendChildNodes(action.newChildNodes);
|
|
1261
|
+
break;
|
|
1262
|
+
case ModifyContentActionType.SPLIT_BLOCK_WITH_NODE:
|
|
1263
|
+
action.newBlock = this.splitImageNodes(action.splitPointNode, action.startOffsetOfNode);
|
|
1264
|
+
break;
|
|
1265
|
+
case ModifyContentActionType.MERGE_TWO_BLOCKS_NODES:
|
|
1266
|
+
this.mergeTwoBlocksNodes(action.blockNeedToBeMerged);
|
|
1267
|
+
break;
|
|
1268
|
+
case ModifyContentActionType.BREAK_SINGLE_BLOCK:
|
|
1269
|
+
action.newBlock = this.breakSingleBlock(action.startContainerNode, action.startOffset);
|
|
1270
|
+
break;
|
|
1271
|
+
case ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK:
|
|
1272
|
+
action.lineBreakNode = this.lineBreakSingleBlock(action.startContainerNode, action.startOffset);
|
|
1273
|
+
break;
|
|
1274
|
+
case ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS:
|
|
1275
|
+
action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks);
|
|
1276
|
+
break;
|
|
1277
|
+
case ModifyContentActionType.DELETE_BLOCK_CONTENT:
|
|
1278
|
+
this.deleteNodeContent(action);
|
|
1279
|
+
break;
|
|
1280
|
+
case ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
|
|
1281
|
+
this.insertImage(action);
|
|
1282
|
+
break;
|
|
1283
|
+
case ModifyContentActionType.INSERT_NODES_AFTER:
|
|
1284
|
+
this.replaceNodeWithNodes(action.referNode, [
|
|
1285
|
+
action.referNode,
|
|
1286
|
+
...action.nodesToBeInserted,
|
|
1287
|
+
]);
|
|
1288
|
+
break;
|
|
1289
|
+
case ModifyContentActionType.INSERT_NODES_BEFORE:
|
|
1290
|
+
this.replaceNodeWithNodes(action.referNode, [
|
|
1291
|
+
...action.nodesToBeInserted,
|
|
1292
|
+
action.referNode,
|
|
1293
|
+
]);
|
|
1294
|
+
break;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
registerRef(ref) {
|
|
1298
|
+
if (ref) {
|
|
1299
|
+
stateEntityRenderingRegistry.register(ref, this);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
removeChildNode(action) {
|
|
1303
|
+
this.nodes = this.nodes.filter((node) => node !== action.entityToBeRemoved);
|
|
1304
|
+
if (this.nodes.length === 0) {
|
|
1305
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* The image offset should be 0 or 1
|
|
1310
|
+
* <vega-rich-text-image-editor><img /></vega-rich-text-image-editor>
|
|
1311
|
+
*
|
|
1312
|
+
* @param {RTEImageNode} imageNode The split point image node
|
|
1313
|
+
* @param {number} imageOffset The cursor point 0 | 1
|
|
1314
|
+
*/
|
|
1315
|
+
splitImageNodes(imageNode, imageOffset) {
|
|
1316
|
+
const nodesSplitIndex = this.nodes.indexOf(imageNode);
|
|
1317
|
+
if (nodesSplitIndex > -1) {
|
|
1318
|
+
const beforeNodes = this.nodes.slice(0, nodesSplitIndex + imageOffset);
|
|
1319
|
+
const afterNodes = this.nodes.slice(nodesSplitIndex + imageOffset);
|
|
1320
|
+
this.apply(new ReplaceChildNodesAction(beforeNodes));
|
|
1321
|
+
const newBlock = this.cloneWithNodes(afterNodes);
|
|
1322
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newBlock));
|
|
1323
|
+
return newBlock;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
cloneWithNodes(nodes) {
|
|
1327
|
+
const block = new RTEImageBlock(generateUUID());
|
|
1328
|
+
block.nodes = [];
|
|
1329
|
+
block.apply(new AppendChildNodesAction(nodes));
|
|
1330
|
+
return block;
|
|
1331
|
+
}
|
|
1332
|
+
breakSingleBlock(splitNode, startOffsetOfNode) {
|
|
1333
|
+
const newParagraph = RTETextBlock.from({
|
|
1334
|
+
id: generateUUID(),
|
|
1335
|
+
type: 'paragraph',
|
|
1336
|
+
nodes: [{ id: generateUUID(), type: 'text', text: '' }],
|
|
1337
|
+
});
|
|
1338
|
+
if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
|
|
1339
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newParagraph));
|
|
1340
|
+
}
|
|
1341
|
+
else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
|
|
1342
|
+
this.parent.apply(new InsertBlocksBeforeAction(this, newParagraph));
|
|
1343
|
+
}
|
|
1344
|
+
else {
|
|
1345
|
+
const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
|
|
1346
|
+
this.apply(splitBlockAction);
|
|
1347
|
+
return splitBlockAction.newBlock;
|
|
1348
|
+
}
|
|
1349
|
+
return newParagraph;
|
|
1350
|
+
}
|
|
1351
|
+
lineBreakSingleBlock(splitNode, startOffset) {
|
|
1352
|
+
const newParagraph = this.breakSingleBlock(splitNode, startOffset);
|
|
1353
|
+
if (newParagraph) {
|
|
1354
|
+
return newParagraph['nodes'][0];
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
isCaretPositionAtStart(node, startOffset) {
|
|
1358
|
+
return node === this.nodes[0] && startOffset === 0;
|
|
1359
|
+
}
|
|
1360
|
+
isCaretPositionAtEnd(node, startOffset) {
|
|
1361
|
+
const lastNode = this.nodes[this.nodes.length - 1];
|
|
1362
|
+
return node === lastNode && startOffset === 1;
|
|
1363
|
+
}
|
|
1364
|
+
lineBreakMultipleBlocks(selectedBlocks) {
|
|
1365
|
+
const newParagraph = RTETextBlock.from({
|
|
1366
|
+
id: generateUUID(),
|
|
1367
|
+
type: 'paragraph',
|
|
1368
|
+
nodes: [{ id: generateUUID(), type: 'text', text: '\n' }],
|
|
1369
|
+
});
|
|
1370
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newParagraph));
|
|
1371
|
+
const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
|
|
1372
|
+
if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
|
|
1373
|
+
afterNodes.push(new RTETextNode(generateUUID(), '\n', newParagraph));
|
|
1374
|
+
}
|
|
1375
|
+
newParagraph.apply(new AppendChildNodesAction(afterNodes));
|
|
1376
|
+
return newParagraph['nodes'][0];
|
|
1377
|
+
}
|
|
1378
|
+
deleteNodeContent(action) {
|
|
1379
|
+
const startContainerNode = action
|
|
1380
|
+
.startContainerNode, startOffset = action.startOffset;
|
|
1381
|
+
let previousNode = this.getPreviousNode(startContainerNode);
|
|
1382
|
+
let nextNode = null;
|
|
1383
|
+
if (startOffset === 1) {
|
|
1384
|
+
const parentBlock = startContainerNode.parentBlock;
|
|
1385
|
+
if (this.isContentFirstNode(startContainerNode)) {
|
|
1386
|
+
nextNode = this.getNextNode(startContainerNode);
|
|
1387
|
+
}
|
|
1388
|
+
if (parentBlock.nodes.length === 1) {
|
|
1389
|
+
parentBlock.parent.apply(new RemoveChildAction(parentBlock));
|
|
1390
|
+
}
|
|
1391
|
+
else {
|
|
1392
|
+
startContainerNode.parentBlock.apply(new RemoveChildAction(startContainerNode));
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
else {
|
|
1396
|
+
const shouldRemoveNode = previousNode;
|
|
1397
|
+
if (shouldRemoveNode && shouldRemoveNode instanceof RTEImageNode) {
|
|
1398
|
+
previousNode = this.getPreviousNode(shouldRemoveNode);
|
|
1399
|
+
shouldRemoveNode.parentBlock.apply(new RemoveChildAction(shouldRemoveNode));
|
|
1400
|
+
if (!previousNode) {
|
|
1401
|
+
action.nextNode = startContainerNode;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
if (previousNode) {
|
|
1406
|
+
action.previousNode = previousNode;
|
|
1407
|
+
}
|
|
1408
|
+
else if (nextNode) {
|
|
1409
|
+
action.nextNode = nextNode;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Image will always create new image block
|
|
1414
|
+
*
|
|
1415
|
+
* @param {InsertImageToBlockAction} action insert image to current block
|
|
1416
|
+
*/
|
|
1417
|
+
insertImage(action) {
|
|
1418
|
+
const splitNode = action.splitPointNode;
|
|
1419
|
+
const startOffsetOfNode = action.startOffsetOfNode;
|
|
1420
|
+
const newImageNodes = action.imageBlockToBeInserted.nodes;
|
|
1421
|
+
const newImageBlock = action.imageBlockToBeInserted;
|
|
1422
|
+
if (this.nodes.length < 1) {
|
|
1423
|
+
this.apply(new AppendChildNodesAction(newImageNodes));
|
|
1424
|
+
}
|
|
1425
|
+
else if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
|
|
1426
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
|
|
1427
|
+
}
|
|
1428
|
+
else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
|
|
1429
|
+
this.parent.apply(new InsertBlocksBeforeAction(this, newImageBlock));
|
|
1430
|
+
}
|
|
1431
|
+
else {
|
|
1432
|
+
this.apply(new SplitBlockWithNodeAction(splitNode, startOffsetOfNode));
|
|
1433
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newImageBlock));
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
class RTEListItemBlock extends RTETextBlock {
|
|
1439
|
+
constructor(id, children) {
|
|
1440
|
+
super(id, 'list-item');
|
|
1441
|
+
this.children = [];
|
|
1442
|
+
this.children = children;
|
|
1443
|
+
}
|
|
1444
|
+
static from(block) {
|
|
1445
|
+
const listItemBlock = new RTEListItemBlock(block.id);
|
|
1446
|
+
listItemBlock.nodes = block.nodes.map((richText) => RTETextNode.from(richText, listItemBlock));
|
|
1447
|
+
if (block.children) {
|
|
1448
|
+
listItemBlock.children = block.children.map((child) => {
|
|
1449
|
+
const listBlock = RTEListBlock.from(child);
|
|
1450
|
+
listBlock.parent = listItemBlock;
|
|
1451
|
+
return listBlock;
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
const { annotations } = block;
|
|
1455
|
+
if (annotations) {
|
|
1456
|
+
Object.entries(annotations).forEach(([type, value]) => {
|
|
1457
|
+
const item = this.createAnnotationEntity(type, value);
|
|
1458
|
+
if (isNonNullable(item)) {
|
|
1459
|
+
listItemBlock.annotationMap.set(...item);
|
|
1460
|
+
}
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
return listItemBlock;
|
|
1464
|
+
}
|
|
1465
|
+
toJSON() {
|
|
1466
|
+
var _a;
|
|
1467
|
+
return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((block) => block.toJSON()) });
|
|
1468
|
+
}
|
|
1469
|
+
cloneWithNodes(nodes) {
|
|
1470
|
+
const block = new RTEListItemBlock(generateUUID());
|
|
1471
|
+
block.nodes = [];
|
|
1472
|
+
block.apply(new AppendChildNodesAction(nodes));
|
|
1473
|
+
return block;
|
|
1474
|
+
}
|
|
1475
|
+
isNotEmpty() {
|
|
1476
|
+
if (this.children) {
|
|
1477
|
+
return super.isNotEmpty() || this.children.some((block) => block.isNotEmpty());
|
|
1478
|
+
}
|
|
1479
|
+
else {
|
|
1480
|
+
return super.isNotEmpty();
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
getLastNode() {
|
|
1484
|
+
if (this.children && this.children.length > 0) {
|
|
1485
|
+
const childListBlock = this.children[this.children.length - 1];
|
|
1486
|
+
return childListBlock.getLastNode();
|
|
1487
|
+
}
|
|
1488
|
+
return super.getLastNode();
|
|
1489
|
+
}
|
|
1490
|
+
render(renderContext) {
|
|
1491
|
+
return super.render(renderContext, this.renderChildren(renderContext));
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Apply a modify action to block
|
|
1495
|
+
*
|
|
1496
|
+
* @param {ModifyContentAction} action - Modify action
|
|
1497
|
+
*/
|
|
1498
|
+
doModifyActionApply(action) {
|
|
1499
|
+
switch (action.type) {
|
|
1500
|
+
case ModifyContentActionType.DELETE_CHILD:
|
|
1501
|
+
this.removeListChildNode(action);
|
|
1502
|
+
break;
|
|
1503
|
+
case ModifyContentActionType.DELETE_NEST_LIST:
|
|
1504
|
+
this.removeNestList(action);
|
|
1505
|
+
break;
|
|
1506
|
+
case ModifyContentActionType.APPEND_CHILD_NODES:
|
|
1507
|
+
this.appendChildNodes(action.entityToBeAppended);
|
|
1508
|
+
break;
|
|
1509
|
+
case ModifyContentActionType.CLEAR_CHILD_NODES:
|
|
1510
|
+
this.nodes = [];
|
|
1511
|
+
break;
|
|
1512
|
+
case ModifyContentActionType.SPLIT_BLOCK_WITH_NODE:
|
|
1513
|
+
this.splitListItemBlock(action);
|
|
1514
|
+
break;
|
|
1515
|
+
case ModifyContentActionType.REPLACE_CHILD_NODES:
|
|
1516
|
+
this.nodes = [];
|
|
1517
|
+
this.appendChildNodes(action.newChildNodes);
|
|
1518
|
+
break;
|
|
1519
|
+
case ModifyContentActionType.REPLACE_NEST_LIST:
|
|
1520
|
+
this.replaceNestList(action.newList);
|
|
1521
|
+
break;
|
|
1522
|
+
case ModifyContentActionType.MERGE_TWO_BLOCKS_NODES:
|
|
1523
|
+
this.mergeTwoBlocksNodes(action.blockNeedToBeMerged);
|
|
1524
|
+
break;
|
|
1525
|
+
case ModifyContentActionType.BREAK_SINGLE_BLOCK:
|
|
1526
|
+
action.newBlock = this.breakSingleListItemBlock(action.startContainerNode, action.startOffset);
|
|
1527
|
+
break;
|
|
1528
|
+
case ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK:
|
|
1529
|
+
action.lineBreakNode = this.lineBreakSingleBlock(action.startContainerNode, action.startOffset);
|
|
1530
|
+
break;
|
|
1531
|
+
case ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS:
|
|
1532
|
+
action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks);
|
|
1533
|
+
break;
|
|
1534
|
+
case ModifyContentActionType.DELETE_BLOCK_CONTENT:
|
|
1535
|
+
this.deleteListNodeContent(action);
|
|
1536
|
+
break;
|
|
1537
|
+
case ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
|
|
1538
|
+
this.parent.apply(action);
|
|
1539
|
+
break;
|
|
1540
|
+
case ModifyContentActionType.INSERT_NODES_BEFORE:
|
|
1541
|
+
this.replaceNodeWithNodes(action.referNode, [
|
|
1542
|
+
...action.nodesToBeInserted,
|
|
1543
|
+
action.referNode,
|
|
1544
|
+
]);
|
|
1545
|
+
break;
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
renderChildren(renderContext) {
|
|
1549
|
+
var _a;
|
|
1550
|
+
return (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((block) => block.render(renderContext));
|
|
1551
|
+
}
|
|
1552
|
+
removeListChildNode(action) {
|
|
1553
|
+
this.nodes = this.nodes.filter((node) => node !== action.entityToBeRemoved);
|
|
1554
|
+
if (this.nodes.length === 0 && (!this.children || !this.children.length)) {
|
|
1555
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
removeNestList(action) {
|
|
1559
|
+
if (this.children) {
|
|
1560
|
+
if (this.children.length > 1) {
|
|
1561
|
+
this.children = this.children.filter((child) => child !== action.nestListBlockToBeRemoved);
|
|
1562
|
+
}
|
|
1563
|
+
else {
|
|
1564
|
+
this.children = undefined;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
replaceNestList(newList) {
|
|
1569
|
+
newList.forEach((listBlock) => {
|
|
1570
|
+
listBlock.parent = this;
|
|
1571
|
+
});
|
|
1572
|
+
this.children = newList;
|
|
1573
|
+
}
|
|
1574
|
+
splitListItemBlock(action) {
|
|
1575
|
+
action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode);
|
|
1576
|
+
}
|
|
1577
|
+
breakSingleListItemBlock(splitNode, startOffsetOfNode) {
|
|
1578
|
+
const newListItem = new RTEListItemBlock(generateUUID());
|
|
1579
|
+
const newBreakNode = this.copyInlineStyleToNewNode(splitNode);
|
|
1580
|
+
newListItem.apply(new AppendChildNodesAction([newBreakNode]));
|
|
1581
|
+
if (this.isCaretPositionAtEnd(splitNode, startOffsetOfNode)) {
|
|
1582
|
+
return this.breakListItemAtEnd(newListItem);
|
|
1583
|
+
}
|
|
1584
|
+
else if (this.isCaretPositionAtStart(splitNode, startOffsetOfNode)) {
|
|
1585
|
+
this.parent.apply(new InsertBlocksBeforeAction(this, newListItem));
|
|
1586
|
+
}
|
|
1587
|
+
else {
|
|
1588
|
+
const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
|
|
1589
|
+
this.apply(splitBlockAction);
|
|
1590
|
+
return splitBlockAction.newBlock;
|
|
1591
|
+
}
|
|
1592
|
+
return newListItem;
|
|
1593
|
+
}
|
|
1594
|
+
breakListItemAtEnd(newListItem) {
|
|
1595
|
+
const lastItem = this.parent.blocks[this.parent.blocks.length - 1];
|
|
1596
|
+
const currentItemIsEmpty = this.nodes.length === 1 && this.nodes[0].isEmpty();
|
|
1597
|
+
if (this === lastItem && currentItemIsEmpty) {
|
|
1598
|
+
const parentParent = this.parent.parent;
|
|
1599
|
+
if (parentParent['type'] !== 'list-item') {
|
|
1600
|
+
const newParagraph = RTETextBlock.from({
|
|
1601
|
+
id: generateUUID(),
|
|
1602
|
+
type: 'paragraph',
|
|
1603
|
+
nodes: [],
|
|
1604
|
+
});
|
|
1605
|
+
newParagraph.apply(new AppendChildNodesAction(newListItem.nodes));
|
|
1606
|
+
parentParent.apply(new InsertBlocksAfterAction(this.parent, newParagraph));
|
|
1607
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1608
|
+
return newParagraph;
|
|
1609
|
+
}
|
|
1610
|
+
else {
|
|
1611
|
+
parentParent.parent.apply(new InsertBlocksAfterAction(parentParent, newListItem));
|
|
1612
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
else {
|
|
1616
|
+
this.parent.apply(new InsertBlocksAfterAction(this, newListItem));
|
|
1617
|
+
}
|
|
1618
|
+
return newListItem;
|
|
1619
|
+
}
|
|
1620
|
+
deleteListNodeContent(action) {
|
|
1621
|
+
const startContainerNode = action.startContainerNode;
|
|
1622
|
+
const listBlock = startContainerNode.parentBlock.parent;
|
|
1623
|
+
this.deleteNodeContent(action);
|
|
1624
|
+
if (listBlock.blocks.length === 0) {
|
|
1625
|
+
listBlock.parent.apply(new RemoveChildAction(listBlock));
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
copyInlineStyleToNewNode(needCopedNode) {
|
|
1629
|
+
const textNode = needCopedNode.cloneWithText('');
|
|
1630
|
+
// The link annotation don't need inherited
|
|
1631
|
+
textNode.annotationMap.delete(NodeAnnotationTypeEnum.LINK);
|
|
1632
|
+
return textNode;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
/**
|
|
1637
|
+
* Delete the nest list block action
|
|
1638
|
+
*
|
|
1639
|
+
* @example needRemovedNestList.parent.apply(new RemoveNestListAction(needRemovedNestList))
|
|
1640
|
+
*/
|
|
1641
|
+
class RemoveNestListAction extends ModifyContentAction {
|
|
1642
|
+
constructor(childList) {
|
|
1643
|
+
super();
|
|
1644
|
+
this.type = ModifyContentActionType.DELETE_NEST_LIST;
|
|
1645
|
+
this.nestListBlockToBeRemoved = childList;
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
class RTEListBlock extends RTEBlock {
|
|
1650
|
+
constructor(id, type) {
|
|
1651
|
+
super(id);
|
|
1652
|
+
this.type = 'bullet-list';
|
|
1653
|
+
this.blocks = [];
|
|
1654
|
+
this.type = type;
|
|
1655
|
+
}
|
|
1656
|
+
static from(block) {
|
|
1657
|
+
const listBlock = new RTEListBlock(block.id, block.type);
|
|
1658
|
+
listBlock.blocks = block.blocks.map((item) => {
|
|
1659
|
+
const listItemBlock = RTEListItemBlock.from(item);
|
|
1660
|
+
listItemBlock.parent = listBlock;
|
|
1661
|
+
return listItemBlock;
|
|
1662
|
+
});
|
|
1663
|
+
return listBlock;
|
|
1664
|
+
}
|
|
1665
|
+
toJSON() {
|
|
1666
|
+
return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.blocks.map((block) => block.toJSON()) });
|
|
1667
|
+
}
|
|
1668
|
+
isNotEmpty() {
|
|
1669
|
+
return (this.blocks.length > 0 &&
|
|
1670
|
+
this.blocks.some((listItemBlock) => listItemBlock.isNotEmpty()));
|
|
1671
|
+
}
|
|
1672
|
+
getLastNode() {
|
|
1673
|
+
return this.blocks[this.blocks.length - 1].getLastNode();
|
|
1674
|
+
}
|
|
1675
|
+
render(renderContext) {
|
|
1676
|
+
const BlockTag = this.type === 'number-list' ? 'ol' : 'ul';
|
|
1677
|
+
return (h(BlockTag, { ref: this.registerRef.bind(this) }, this.blocks.map((block) => block.render(renderContext))));
|
|
1678
|
+
}
|
|
1679
|
+
/**
|
|
1680
|
+
* Apply a modify action to block
|
|
1681
|
+
*
|
|
1682
|
+
* @param {ModifyContentAction} action - Modify action
|
|
1683
|
+
*/
|
|
1684
|
+
doModifyActionApply(action) {
|
|
1685
|
+
switch (action.type) {
|
|
1686
|
+
case ModifyContentActionType.DELETE_CHILD:
|
|
1687
|
+
this.removeListItemBlock(action.entityToBeRemoved);
|
|
1688
|
+
break;
|
|
1689
|
+
case ModifyContentActionType.INSERT_BLOCKS_AFTER:
|
|
1690
|
+
this.replaceBlockWithBlocks(action.referBlock, [
|
|
1691
|
+
action.referBlock,
|
|
1692
|
+
...action.blocksToBeInserted,
|
|
1693
|
+
]);
|
|
1694
|
+
break;
|
|
1695
|
+
case ModifyContentActionType.INSERT_BLOCKS_BEFORE:
|
|
1696
|
+
this.replaceBlockWithBlocks(action.referBlock, [
|
|
1697
|
+
...action.blocksToBeInserted,
|
|
1698
|
+
action.referBlock,
|
|
1699
|
+
]);
|
|
1700
|
+
break;
|
|
1701
|
+
case ModifyContentActionType.APPEND_CHILD_NODES:
|
|
1702
|
+
this.appendChildBlocks(action.entityToBeAppended);
|
|
1703
|
+
break;
|
|
1704
|
+
case ModifyContentActionType.TRANSFORM_LIST_BLOCK:
|
|
1705
|
+
this.convertToList(action);
|
|
1706
|
+
break;
|
|
1707
|
+
case ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK:
|
|
1708
|
+
this.convertToParagraph(action);
|
|
1709
|
+
break;
|
|
1710
|
+
case ModifyContentActionType.INSERT_IMAGE_TO_BLOCK:
|
|
1711
|
+
this.insertImage(action);
|
|
1712
|
+
break;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
toParagraph(block) {
|
|
1716
|
+
const textBlock = new RTETextBlock(generateUUID(), 'paragraph');
|
|
1717
|
+
textBlock.apply(new AppendChildNodesAction(block['nodes']));
|
|
1718
|
+
textBlock['annotationMap'] = block['annotationMap'];
|
|
1719
|
+
return textBlock;
|
|
1720
|
+
}
|
|
1721
|
+
registerRef(ref) {
|
|
1722
|
+
if (ref) {
|
|
1723
|
+
stateEntityRenderingRegistry.register(ref, this);
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
convertToList(action) {
|
|
1727
|
+
const selectedBlocks = action.selectedBlocks;
|
|
1728
|
+
const bulletList = this.parent.createList(action.listType);
|
|
1729
|
+
const isSameList = selectedBlocks.every((block) => block.parent === this);
|
|
1730
|
+
if (isSameList) {
|
|
1731
|
+
// Select one or more list items belonging to the same list, and all items in this list should be updated
|
|
1732
|
+
bulletList.apply(new AppendChildNodesAction(this.blocks));
|
|
1733
|
+
this.parent.apply(new InsertBlocksAfterAction(this, bulletList));
|
|
1734
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1735
|
+
selectedBlocks.forEach((block) => block.nodes.map((node) => node.apply(new SyncUpSelectionAction())));
|
|
1736
|
+
}
|
|
1737
|
+
else {
|
|
1738
|
+
const listItems = action.selectedBlocks.map((block) => this.parent.toListItem(block));
|
|
1739
|
+
bulletList.apply(new AppendChildNodesAction(listItems));
|
|
1740
|
+
this.parent.apply(new InsertBlocksAfterAction(this, bulletList));
|
|
1741
|
+
action.selectedBlocks.forEach((block) => {
|
|
1742
|
+
block.parent.apply(new RemoveChildAction(block));
|
|
1743
|
+
});
|
|
1744
|
+
if (this.blocks.length === 0) {
|
|
1745
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
convertToParagraph(action) {
|
|
1750
|
+
let isSelectedFirstBlock = false;
|
|
1751
|
+
let isSelectedLastBlock = false;
|
|
1752
|
+
const selectedBlocks = action.selectedBlocks;
|
|
1753
|
+
const currentParagraph = selectedBlocks.map((block) => {
|
|
1754
|
+
block.nodes.map((node) => node.apply(new SyncUpSelectionAction()));
|
|
1755
|
+
if (block === this.blocks[0])
|
|
1756
|
+
isSelectedFirstBlock = true;
|
|
1757
|
+
if (block === this.blocks[this.blocks.length - 1])
|
|
1758
|
+
isSelectedLastBlock = true;
|
|
1759
|
+
return this.toParagraph(block);
|
|
1760
|
+
});
|
|
1761
|
+
if (isSelectedFirstBlock) {
|
|
1762
|
+
this.parent.apply(new InsertBlocksBeforeAction(this, ...currentParagraph));
|
|
1763
|
+
}
|
|
1764
|
+
else if (isSelectedLastBlock) {
|
|
1765
|
+
this.parent.apply(new InsertBlocksAfterAction(this, ...currentParagraph));
|
|
1766
|
+
}
|
|
1767
|
+
else {
|
|
1768
|
+
const startIndex = this.blocks.indexOf(selectedBlocks[0]);
|
|
1769
|
+
const lastIndex = this.blocks.indexOf(selectedBlocks[selectedBlocks.length - 1]);
|
|
1770
|
+
const firstBulletList = this.parent.createList(this.type);
|
|
1771
|
+
firstBulletList.apply(new AppendChildNodesAction(this.blocks.slice(0, startIndex)));
|
|
1772
|
+
const lastBulletList = this.parent.createList(this.type);
|
|
1773
|
+
lastBulletList.apply(new AppendChildNodesAction(this.blocks.slice(lastIndex + 1)));
|
|
1774
|
+
this.parent.apply(new InsertBlocksBeforeAction(this, firstBulletList, ...currentParagraph, lastBulletList));
|
|
1775
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1776
|
+
}
|
|
1777
|
+
selectedBlocks.map((block) => {
|
|
1778
|
+
this.apply(new RemoveChildAction(block));
|
|
1779
|
+
});
|
|
1780
|
+
if (this.blocks.length === 0) {
|
|
1781
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
insertImage(action) {
|
|
1785
|
+
const imageBlock = action.imageBlockToBeInserted;
|
|
1786
|
+
if (this.parent['type'] !== 'list-item') {
|
|
1787
|
+
this.parent.apply(new InsertBlocksAfterAction(this, imageBlock));
|
|
1788
|
+
}
|
|
1789
|
+
else {
|
|
1790
|
+
this.parent.apply(action);
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
removeListItemBlock(blockToBeRemoved) {
|
|
1794
|
+
super.removeChildBlock(blockToBeRemoved);
|
|
1795
|
+
if (this.blocks.length === 0 && this.parent) {
|
|
1796
|
+
// The parent is a list item mean the current block is a nest list, so we need use RemoveNestListAction to remove the item
|
|
1797
|
+
if (this.parent instanceof RTEListItemBlock) {
|
|
1798
|
+
this.parent.apply(new RemoveNestListAction(this));
|
|
1799
|
+
}
|
|
1800
|
+
else {
|
|
1801
|
+
this.parent.apply(new RemoveChildAction(this));
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* Class representing the content state of the rich text editor.
|
|
1809
|
+
*/
|
|
1810
|
+
class VegaRTEContent extends BlockBaseOperator {
|
|
1811
|
+
constructor(blocks) {
|
|
1812
|
+
super();
|
|
1813
|
+
blocks.forEach((block) => {
|
|
1814
|
+
block.parent = this;
|
|
1815
|
+
});
|
|
1816
|
+
this.blocks = blocks;
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* Converts a JSON array of blocks to a class array of RTEContentBlock.
|
|
1820
|
+
*
|
|
1821
|
+
* @param {VegaRTEContentBlock[]} value The JSON array of blocks to convert.
|
|
1822
|
+
* @returns {RTEContentBlock[]} The converted array of RTEContentBlock.
|
|
1823
|
+
*/
|
|
1824
|
+
static fromJSON(value) {
|
|
1825
|
+
const blocks = value.map((block) => {
|
|
1826
|
+
switch (block.type) {
|
|
1827
|
+
case 'paragraph':
|
|
1828
|
+
case 'title':
|
|
1829
|
+
case 'subtitle':
|
|
1830
|
+
case 'heading-1':
|
|
1831
|
+
case 'heading-2':
|
|
1832
|
+
case 'heading-3': {
|
|
1833
|
+
return RTETextBlock.from(block);
|
|
1834
|
+
}
|
|
1835
|
+
case 'image':
|
|
1836
|
+
return RTEImageBlock.from(block);
|
|
1837
|
+
case 'bullet-list':
|
|
1838
|
+
case 'number-list':
|
|
1839
|
+
return RTEListBlock.from(block);
|
|
1840
|
+
default: {
|
|
1841
|
+
throw new Error(`[Vega] Unknown block type: ${block.type}`);
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1845
|
+
return new VegaRTEContent(blocks);
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* Create an empty content state
|
|
1849
|
+
*
|
|
1850
|
+
* @returns {VegaRTEContent} An empty content state
|
|
1851
|
+
*/
|
|
1852
|
+
static createEmptyContent() {
|
|
1853
|
+
return VegaRTEContent.fromJSON([
|
|
1854
|
+
{
|
|
1855
|
+
id: generateUUID(),
|
|
1856
|
+
type: 'paragraph',
|
|
1857
|
+
nodes: [
|
|
1858
|
+
{
|
|
1859
|
+
id: generateUUID(),
|
|
1860
|
+
type: 'text',
|
|
1861
|
+
text: '',
|
|
1862
|
+
},
|
|
1863
|
+
],
|
|
1864
|
+
},
|
|
1865
|
+
]);
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* Clones the content state.
|
|
1869
|
+
*
|
|
1870
|
+
* @returns {VegaRTEContent} The cloned content state.
|
|
1871
|
+
*/
|
|
1872
|
+
clone() {
|
|
1873
|
+
return new VegaRTEContent([...this.blocks]);
|
|
1874
|
+
}
|
|
1875
|
+
/**
|
|
1876
|
+
* Converts the content state to a JSON array of blocks.
|
|
1877
|
+
*
|
|
1878
|
+
* @returns {VegaRTEContentBlock[]} The JSON array of blocks.
|
|
1879
|
+
*/
|
|
1880
|
+
toJSON() {
|
|
1881
|
+
return this.blocks.map((block) => block.toJSON());
|
|
1882
|
+
}
|
|
1883
|
+
/**
|
|
1884
|
+
* Internal method to add the block item, remove the block item
|
|
1885
|
+
*
|
|
1886
|
+
* @param {ModifyContentAction} action - Modify content action
|
|
1887
|
+
*/
|
|
1888
|
+
apply(action) {
|
|
1889
|
+
switch (action.type) {
|
|
1890
|
+
case ModifyContentActionType.DELETE_CHILD:
|
|
1891
|
+
this.removeChildBlock(action.entityToBeRemoved);
|
|
1892
|
+
break;
|
|
1893
|
+
case ModifyContentActionType.APPEND_CHILD_NODES:
|
|
1894
|
+
this.appendChildBlocks(action.entityToBeAppended);
|
|
1895
|
+
break;
|
|
1896
|
+
case ModifyContentActionType.INSERT_BLOCKS_AFTER:
|
|
1897
|
+
this.replaceBlockWithBlocks(action.referBlock, [
|
|
1898
|
+
action.referBlock,
|
|
1899
|
+
...action.blocksToBeInserted,
|
|
1900
|
+
]);
|
|
1901
|
+
break;
|
|
1902
|
+
case ModifyContentActionType.INSERT_BLOCKS_BEFORE:
|
|
1903
|
+
this.replaceBlockWithBlocks(action.referBlock, [
|
|
1904
|
+
...action.blocksToBeInserted,
|
|
1905
|
+
action.referBlock,
|
|
1906
|
+
]);
|
|
1907
|
+
break;
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
/**
|
|
1911
|
+
* Convert text to list.
|
|
1912
|
+
*
|
|
1913
|
+
* @param {RTETextBlock} block - block
|
|
1914
|
+
* @returns {RTEListItemBlock} list item block dto.
|
|
1915
|
+
*/
|
|
1916
|
+
toListItem(block) {
|
|
1917
|
+
block.nodes.map((node) => node.apply(new SyncUpSelectionAction()));
|
|
1918
|
+
const listItemBlock = new RTEListItemBlock(generateUUID());
|
|
1919
|
+
listItemBlock.apply(new AppendChildNodesAction(block['nodes']));
|
|
1920
|
+
listItemBlock['annotationMap'] = block['annotationMap'];
|
|
1921
|
+
return listItemBlock;
|
|
1922
|
+
}
|
|
1923
|
+
/**
|
|
1924
|
+
* create list.
|
|
1925
|
+
*
|
|
1926
|
+
* @param {ListType} type - type
|
|
1927
|
+
* @returns {RTEListBlock} list block dto.
|
|
1928
|
+
*/
|
|
1929
|
+
createList(type) {
|
|
1930
|
+
return new RTEListBlock(generateUUID(), type);
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
export { AppendChildNodesAction as A, BoldAnnotationAction as B, HorizontalAlignmentAnnotation as H, IndentAnnotation as I, MergeTwoBlocksNodesAction as M, RTETextBlock as R, SplitBlockWithNodeAction as S, TextStyleAnnotationAction as T, VegaRTEContent as V, TextStyleAnnotation as a, RTEImageNode as b, RTEListItemBlock as c, RemoveChildAction as d, InsertBlocksBeforeAction as e, ReplaceChildNodesAction as f, RTEListBlock as g, RTEImageBlock as h, InsertBlocksAfterAction as i, ImageAnnotationAction as j };
|