@heartlandone/vega 2.49.1 → 2.50.0-RTE-preview
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-65622aeb.js → app-globals-8e811cac.js} +6 -6
- package/dist/cjs/{child-nodes-event-prevent-slimmer-cc193ee1.js → child-nodes-event-prevent-slimmer-26ecfb15.js} +1 -1
- package/dist/cjs/{content-state-6a48bcb5.js → code-block-4cd8bccd.js} +1166 -1131
- package/dist/cjs/content-state-6cb98931.js +2496 -0
- package/dist/cjs/{design-token-cba4222e.js → design-token-8b48cb59.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-4a26ecb2.js → element-appender-slimmer-d6b975e6.js} +3 -3
- package/dist/cjs/{event-emit-slimmer-8247249c.js → event-emit-slimmer-ee7a8c06.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-4b0af5bc.js → form-field-controller-slimmer-88cbb139.js} +4 -4
- package/dist/cjs/{image-annotation-action-9c2b9c8e.js → image-annotation-action-f36b1a72.js} +65 -35
- package/dist/cjs/{index-c4dec3aa.js → index-4dd54e6b.js} +1 -1
- package/dist/cjs/{index-09acd3c9.js → index-7700600c.js} +9 -0
- package/dist/cjs/index.cjs.js +17 -16
- package/dist/cjs/{internal-vega-event-manager-c9948b59.js → internal-vega-event-manager-58afcde7.js} +1 -0
- package/dist/cjs/loader.cjs.js +11 -9
- package/dist/cjs/{public-rules-10ec636d.js → public-rules-555271e0.js} +8 -6
- package/dist/cjs/{responsive-format-facade-263d49f6.js → responsive-format-facade-8ce41c8a.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-5faded94.js → rich-text-editor-required-rule-d1b38bf7.js} +1 -1
- package/dist/cjs/selection-controller-828990cc.js +765 -0
- package/dist/cjs/string-39438062.js +24 -0
- package/dist/cjs/{string-input-formatter-slimmer-50322824.js → string-input-formatter-slimmer-9e7d7ce2.js} +2 -2
- package/dist/cjs/{style-formatter-ae0ef7fc.js → style-formatter-2294d77f.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-7f437b19.js → sub-state-notify-slimmer-f3ee01b7.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-e90362cd.js → sub-state-observer-slimmer-e1a00b74.js} +1 -1
- package/dist/cjs/{translation-212b1875.js → translation-e5003a00.js} +5 -0
- package/dist/cjs/{translation-slimmer-d1512c6d.js → translation-slimmer-127a0f83.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +11 -9
- package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
- package/dist/cjs/vega-app-header-button.cjs.entry.js +12 -10
- package/dist/cjs/vega-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-box.cjs.entry.js +11 -9
- package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -1
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +12 -10
- package/dist/cjs/vega-button-group_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +11 -9
- package/dist/cjs/vega-calendar_3.cjs.entry.js +9 -9
- package/dist/cjs/vega-card.cjs.entry.js +10 -8
- package/dist/cjs/vega-carousel.cjs.entry.js +10 -8
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-chip.cjs.entry.js +12 -10
- package/dist/cjs/vega-code-block.cjs.entry.js +4073 -0
- package/dist/cjs/vega-color-picker.cjs.entry.js +8 -8
- package/dist/cjs/vega-combo-box.cjs.entry.js +9 -9
- package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +17 -16
- package/dist/cjs/vega-dialog_2.cjs.entry.js +12 -10
- package/dist/cjs/vega-divider.cjs.entry.js +10 -8
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +15 -13
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +9 -9
- package/dist/cjs/vega-flag-icon.cjs.entry.js +10 -8
- package/dist/cjs/vega-flex.cjs.entry.js +11 -9
- package/dist/cjs/vega-font.cjs.entry.js +10 -8
- package/dist/cjs/vega-form.cjs.entry.js +10 -10
- package/dist/cjs/vega-grid.cjs.entry.js +10 -8
- package/dist/cjs/vega-hint.cjs.entry.js +1 -1
- package/dist/cjs/vega-icon.cjs.entry.js +10 -8
- package/dist/cjs/vega-image-uploader.cjs.entry.js +14 -13
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-numeric.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +12 -11
- package/dist/cjs/vega-input-range.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-select.cjs.entry.js +19 -18
- package/dist/cjs/vega-input.cjs.entry.js +10 -10
- package/dist/cjs/{vega-internal-event-id-bfea9b93.js → vega-internal-event-id-62371952.js} +2 -0
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +13 -11
- package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +9 -7
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination.cjs.entry.js +12 -10
- package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -9
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +311 -137
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +1225 -2502
- package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +14 -13
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +12 -10
- package/dist/cjs/vega-signature-capture.cjs.entry.js +14 -13
- package/dist/cjs/{vega-skeleton-loader-controller-db868c98.js → vega-skeleton-loader-controller-83e05b6c.js} +1 -1
- package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
- package/dist/cjs/vega-stepper.cjs.entry.js +9 -9
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_8.cjs.entry.js +14 -12
- package/dist/cjs/vega-text.cjs.entry.js +1 -1
- package/dist/cjs/vega-textarea.cjs.entry.js +9 -9
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +15 -14
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +8 -8
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +10 -8
- package/dist/cjs/vega.cjs.js +11 -9
- package/dist/collection/collection-manifest.json +7 -1
- package/dist/collection/components/vega-code-block/assets/copy.js +3 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.js +62 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.js +48 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +99 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-content-parse-controller.js +50 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-focus-controller.js +57 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.js +255 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.js +266 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.js +44 -0
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-content-renderer.js +123 -0
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +67 -0
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-renderer.js +122 -0
- package/dist/collection/components/vega-code-block/types.js +10 -0
- package/dist/collection/components/vega-code-block/vega-code-block.css +158 -0
- package/dist/collection/components/vega-code-block/vega-code-block.js +399 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +5 -5
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +2 -0
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +60 -5
- package/dist/collection/components/vega-rich-text-editor/assets/file-code.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/rectangle-code.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +24 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.js +48 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +77 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-code-block-strategy.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/remove-code-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/switch-out-from-code-block-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/transform-to-code-block-action.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/update-code-block-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +13 -5
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +14 -9
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/common-annotation.abstract.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.js +65 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-class-annotation.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/custom-style-annotation.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +26 -10
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +16 -7
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +13 -5
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +12 -9
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +89 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +9 -9
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +3 -7
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +74 -12
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +9 -9
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +69 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +106 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +15 -1
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +50 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +12 -1
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +66 -2
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +56 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +26 -9
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +81 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +15 -2
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.js +5 -22
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +9 -93
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +62 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +121 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +2 -23
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.js +81 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +47 -7
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.js +0 -27
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +3 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +19 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +155 -15
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +6 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-rte-image-block-strategy.abstract.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.js +3 -20
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.js +59 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +3 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.js +3 -20
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-not-li-child-to-rte-list-item-block.js +7 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +3 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +4 -7
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +7 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +7 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +25 -10
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.js +64 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +59 -53
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +21 -8
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +10 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +65 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +6 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +3 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.js +28 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +31 -3
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.js +21 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/content-state-strategy-registry.test.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/image-block-strategy-register.test.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.js +23 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +247 -27
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/code-block.test.js +54 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +1793 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +41 -4
- package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.js +32 -0
- package/dist/collection/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +7 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +18 -1
- package/dist/collection/helpers/code-format/code-formatter.js +108 -0
- package/dist/collection/helpers/code-format/test/code-formatter.test.js +362 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -1
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
- package/dist/collection/helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract.js +47 -0
- package/dist/collection/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.js +46 -0
- package/dist/collection/helpers/translation/locales/en.js +5 -0
- package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +5 -0
- package/dist/collection/polyfill/shadow-selection/shadow-selection-polyfill.js +17 -15
- package/dist/collection/polyfill/shadow-selection/test/shadow-selection-polyfill.test.js +1 -0
- package/dist/collection/polyfill/test-polyfill/unit/methods.js +9 -0
- package/dist/collection/utils/string.js +10 -0
- package/dist/esm/{app-globals-1f8c30e9.js → app-globals-9058ac3b.js} +6 -6
- package/dist/esm/{child-nodes-event-prevent-slimmer-5d45361e.js → child-nodes-event-prevent-slimmer-1142fb79.js} +1 -1
- package/dist/esm/{content-state-dbc9f635.js → code-block-8b5bd928.js} +1141 -1122
- package/dist/esm/content-state-8c3f862b.js +2489 -0
- package/dist/esm/{design-token-0699f0ca.js → design-token-bd436e0d.js} +1 -1
- package/dist/esm/{dom-node-subject-factory-f77cf9cc.js → dom-node-subject-factory-eb6bba5d.js} +1 -1
- package/dist/esm/{dom-node-subject-observer-factory-715dccf9.js → dom-node-subject-observer-factory-6083d518.js} +1 -1
- package/dist/esm/{element-appender-slimmer-96cb54e2.js → element-appender-slimmer-baf5e249.js} +5 -5
- package/dist/esm/{event-emit-slimmer-b7d511f6.js → event-emit-slimmer-480d3b54.js} +3 -3
- package/dist/esm/{form-field-controller-slimmer-89a72ee7.js → form-field-controller-slimmer-bfb4034d.js} +6 -6
- package/dist/esm/{image-annotation-action-1aa938ab.js → image-annotation-action-a8b860ad.js} +57 -28
- package/dist/esm/{index-187f71d1.js → index-d0a47531.js} +9 -0
- package/dist/esm/{index-4aa167d6.js → index-db0ec3ee.js} +2 -2
- package/dist/esm/index.js +12 -11
- package/dist/esm/{internal-vega-event-manager-87dc436c.js → internal-vega-event-manager-56c6469a.js} +2 -1
- package/dist/esm/loader.js +12 -10
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{public-rules-5cf6aa95.js → public-rules-90fbd41a.js} +8 -6
- package/dist/esm/{responsive-format-facade-42f3fcfa.js → responsive-format-facade-827de03a.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-6a7cd3ee.js → rich-text-editor-required-rule-0d470d82.js} +1 -1
- package/dist/esm/selection-controller-dd4f4407.js +759 -0
- package/dist/esm/string-a953eafc.js +21 -0
- package/dist/esm/{string-input-formatter-slimmer-c61f82d6.js → string-input-formatter-slimmer-0d30b976.js} +3 -3
- package/dist/esm/{style-formatter-cb00c709.js → style-formatter-232842f5.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-4e3cf09d.js → sub-state-notify-slimmer-04e06501.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-be7a6ce3.js → sub-state-observer-slimmer-b4c2ddc3.js} +2 -2
- package/dist/esm/{translation-cf7f020a.js → translation-71e0711d.js} +5 -0
- package/dist/esm/{translation-slimmer-88966d5c.js → translation-slimmer-e6b130bf.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +13 -11
- package/dist/esm/vega-app-footer.entry.js +1 -1
- package/dist/esm/vega-app-header-button.entry.js +14 -12
- package/dist/esm/vega-backdrop.entry.js +1 -1
- package/dist/esm/vega-banner.entry.js +5 -5
- package/dist/esm/vega-bar-chart.entry.js +1 -1
- package/dist/esm/vega-box.entry.js +12 -10
- package/dist/esm/vega-brand-logo.entry.js +1 -1
- package/dist/esm/vega-breadcrumb.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +14 -12
- package/dist/esm/vega-button-group_2.entry.js +9 -9
- package/dist/esm/vega-button-link.entry.js +6 -6
- package/dist/esm/vega-button.entry.js +13 -11
- package/dist/esm/vega-calendar_3.entry.js +11 -11
- package/dist/esm/vega-card.entry.js +11 -9
- package/dist/esm/vega-carousel.entry.js +12 -10
- package/dist/esm/vega-checkbox_2.entry.js +11 -11
- package/dist/esm/vega-chip.entry.js +14 -12
- package/dist/esm/vega-code-block.entry.js +4069 -0
- package/dist/esm/vega-color-picker.entry.js +10 -10
- package/dist/esm/vega-combo-box.entry.js +11 -11
- package/dist/esm/vega-counter-badge.entry.js +1 -1
- package/dist/esm/vega-date-picker_2.entry.js +19 -18
- package/dist/esm/vega-dialog_2.entry.js +14 -12
- package/dist/esm/vega-divider.entry.js +11 -9
- package/dist/esm/vega-dropdown_5.entry.js +17 -15
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-error.entry.js +1 -1
- package/dist/esm/vega-field-label.entry.js +5 -5
- package/dist/esm/vega-file-uploader.entry.js +11 -11
- package/dist/esm/vega-flag-icon.entry.js +11 -9
- package/dist/esm/vega-flex.entry.js +12 -10
- package/dist/esm/vega-font.entry.js +11 -9
- package/dist/esm/vega-form.entry.js +12 -12
- package/dist/esm/vega-grid.entry.js +11 -9
- package/dist/esm/vega-hint.entry.js +1 -1
- package/dist/esm/vega-icon.entry.js +11 -9
- package/dist/esm/vega-image-uploader.entry.js +16 -15
- package/dist/esm/vega-input-credit-card.entry.js +11 -11
- package/dist/esm/vega-input-numeric.entry.js +12 -12
- package/dist/esm/vega-input-phone-number.entry.js +14 -13
- package/dist/esm/vega-input-range.entry.js +12 -12
- package/dist/esm/vega-input-select.entry.js +21 -20
- package/dist/esm/vega-input.entry.js +12 -12
- package/dist/esm/{vega-internal-event-id-85ad403f.js → vega-internal-event-id-820393ad.js} +2 -1
- package/dist/esm/vega-item-toggle.entry.js +5 -5
- package/dist/esm/vega-left-nav_5.entry.js +15 -13
- package/dist/esm/vega-line-chart.entry.js +1 -1
- package/dist/esm/vega-loader-wrapper_2.entry.js +10 -8
- package/dist/esm/vega-page-notification_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +6 -6
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +6 -6
- package/dist/esm/vega-pagination.entry.js +14 -12
- package/dist/esm/vega-pie-chart.entry.js +1 -1
- package/dist/esm/vega-popover_2.entry.js +13 -11
- package/dist/esm/vega-progress-tracker.entry.js +5 -5
- package/dist/esm/vega-radio_2.entry.js +11 -11
- package/dist/esm/vega-rich-text-content.entry.js +305 -131
- package/dist/esm/vega-rich-text-editor_4.entry.js +1132 -2409
- package/dist/esm/vega-section-title.entry.js +1 -1
- package/dist/esm/vega-segment-control.entry.js +5 -5
- package/dist/esm/vega-selection-chip_2.entry.js +16 -15
- package/dist/esm/vega-selection-tile_2.entry.js +12 -12
- package/dist/esm/vega-sidenav_3.entry.js +14 -12
- package/dist/esm/vega-signature-capture.entry.js +16 -15
- package/dist/esm/{vega-skeleton-loader-controller-c2a8bd27.js → vega-skeleton-loader-controller-878e1b28.js} +1 -1
- package/dist/esm/vega-skeleton.entry.js +1 -1
- package/dist/esm/vega-slot-container.entry.js +1 -1
- package/dist/esm/vega-stepper.entry.js +11 -11
- package/dist/esm/vega-tab-group_2.entry.js +6 -6
- package/dist/esm/vega-table_8.entry.js +16 -14
- package/dist/esm/vega-text.entry.js +1 -1
- package/dist/esm/vega-textarea.entry.js +11 -11
- package/dist/esm/vega-time-picker_2.entry.js +17 -16
- package/dist/esm/vega-toggle-switch.entry.js +10 -10
- package/dist/esm/vega-tooltip_2.entry.js +12 -10
- package/dist/esm/vega.js +12 -10
- package/dist/types/components/vega-code-block/assets/copy.d.ts +3 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.d.ts +40 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.d.ts +19 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +43 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-content-parse-controller.d.ts +23 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-focus-controller.d.ts +21 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.d.ts +100 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.d.ts +93 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.d.ts +21 -0
- package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-content-renderer.d.ts +57 -0
- package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.d.ts +23 -0
- package/dist/types/components/vega-code-block/slimmers/renderers/vega-code-block-renderer.d.ts +50 -0
- package/dist/types/components/vega-code-block/types.d.ts +19 -0
- package/dist/types/components/vega-code-block/vega-code-block.d.ts +116 -0
- package/dist/types/components/vega-rich-text-editor/assets/file-code.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/rectangle-code.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-indent-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/code-node-set-selection-range-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.d.ts +4 -5
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.d.ts +28 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-code-block-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/custom-style-annotation-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/remove-code-block-action.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/switch-out-from-code-block-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/transform-to-code-block-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/update-code-block-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation.abstract.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +17 -4
- package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +7 -5
- package/dist/types/components/vega-rich-text-editor/dto/annotations/clear-formatting-annotation.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +5 -9
- package/dist/types/components/vega-rich-text-editor/dto/annotations/common-annotation.abstract.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-attribute-annotation.d.ts +43 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-class-annotation.d.ts +40 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/custom-style-annotation.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +5 -9
- package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +7 -5
- package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +7 -5
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +6 -4
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +48 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.d.ts +15 -3
- package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +5 -9
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +3 -7
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +7 -5
- package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +5 -9
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +39 -4
- package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +56 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +20 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +14 -4
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +46 -2
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +7 -2
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.d.ts +4 -11
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.d.ts +7 -5
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.d.ts +39 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +24 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +0 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.d.ts +37 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.d.ts +1 -15
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +65 -26
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.d.ts +64 -6
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-rte-image-block-strategy.abstract.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.d.ts +30 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.d.ts +2 -3
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.d.ts +2 -3
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.d.ts +42 -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 +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.d.ts +7 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.d.ts +45 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +17 -23
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +6 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +3 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/numbers-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/center-align-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.d.ts +4 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/justify-align-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/left-align-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/right-align-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.d.ts +3 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.d.ts +3 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.d.ts +3 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.d.ts +3 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +3 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +8 -2
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/code-block-strategy-registry.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/blocks/code-block.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/content-state.test.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/jira-code-to-rte-code-block-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +7 -0
- package/dist/types/components.d.ts +95 -0
- package/dist/types/helpers/code-format/code-formatter.d.ts +34 -0
- package/dist/types/helpers/code-format/test/code-formatter.test.d.ts +1 -0
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
- package/dist/types/helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract.d.ts +20 -0
- package/dist/types/helpers/slimmers/test/auto-run-when-re-render-task-queue-slimmer.test.d.ts +1 -0
- package/dist/types/helpers/translation/interface.d.ts +6 -1
- package/dist/types/polyfill/shadow-selection/shadow-selection-polyfill.d.ts +26 -0
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/types/utils/string.d.ts +7 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-0104207d.entry.js +1 -0
- package/dist/vega/p-010f1715.entry.js +1 -0
- package/dist/vega/p-01593f9d.js +1 -0
- package/dist/vega/p-020b04ed.js +1 -0
- package/dist/vega/p-02841589.js +1 -0
- package/dist/vega/p-03cfb331.entry.js +9 -0
- package/dist/vega/{p-b649e86e.entry.js → p-0bff8716.entry.js} +1 -1
- package/dist/vega/p-1056a049.entry.js +1 -0
- package/dist/vega/p-10e41bbe.js +1 -0
- package/dist/vega/{p-83ef9e7d.entry.js → p-12e6173c.entry.js} +1 -1
- package/dist/vega/{p-54add0d2.js → p-1397ba3f.js} +1 -1
- package/dist/vega/p-13d9a1fd.entry.js +1 -0
- package/dist/vega/p-13eae47f.entry.js +1 -0
- package/dist/vega/p-1630864e.entry.js +1 -0
- package/dist/vega/p-1b335e30.entry.js +1 -0
- package/dist/vega/{p-8ade44bf.js → p-1e194737.js} +1 -1
- package/dist/vega/{p-252e42c7.entry.js → p-1f346008.entry.js} +1 -1
- package/dist/vega/p-1f86ab76.entry.js +1 -0
- package/dist/vega/p-1fe746ab.entry.js +1 -0
- package/dist/vega/{p-8c388b58.entry.js → p-211c028f.entry.js} +1 -1
- package/dist/vega/p-21d26bb4.js +2 -0
- package/dist/vega/{p-b351ace3.entry.js → p-23e6f2b2.entry.js} +1 -1
- package/dist/vega/p-268aea63.js +1 -0
- package/dist/vega/{p-a01f149d.entry.js → p-27ccf34d.entry.js} +1 -1
- package/dist/vega/{p-913eb7f9.entry.js → p-29f9be26.entry.js} +1 -1
- package/dist/vega/{p-27003a81.entry.js → p-30dcf606.entry.js} +1 -1
- package/dist/vega/{p-89ab72e3.js → p-3c20ae84.js} +1 -1
- package/dist/vega/p-4172fb81.js +1 -0
- package/dist/vega/{p-45f696b4.js → p-419697c6.js} +1 -1
- package/dist/vega/p-427e4cee.entry.js +1 -0
- package/dist/vega/p-4604ed0e.entry.js +1 -0
- package/dist/vega/{p-8d283666.js → p-4ab3df00.js} +1 -1
- package/dist/vega/{p-72ecfd40.js → p-4e8fb53a.js} +1 -1
- package/dist/vega/p-50a3ae3d.js +1 -0
- package/dist/vega/{p-b847a143.entry.js → p-50b80d76.entry.js} +1 -1
- package/dist/vega/p-531ffb18.entry.js +1 -0
- package/dist/vega/p-53daeb45.entry.js +1 -0
- package/dist/vega/p-54fdd401.entry.js +1 -0
- package/dist/vega/{p-47ff95ba.entry.js → p-5741ecf0.entry.js} +1 -1
- package/dist/vega/{p-6cabdb36.js → p-58f8928a.js} +1 -1
- package/dist/vega/{p-4a32a6c0.entry.js → p-5c4cb804.entry.js} +1 -1
- package/dist/vega/{p-a46bc9f1.entry.js → p-5ce386c8.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-0079088b.entry.js → p-5fd5a538.entry.js} +1 -1
- package/dist/vega/{p-0969877b.entry.js → p-64f452fe.entry.js} +1 -1
- package/dist/vega/p-66759f4e.js +1 -0
- package/dist/vega/{p-bc2dd43d.js → p-6ea42854.js} +1 -1
- package/dist/vega/p-70f25341.entry.js +1 -0
- package/dist/vega/{p-ec1f2d21.entry.js → p-737bccb9.entry.js} +1 -1
- package/dist/vega/{p-bcb10ae3.entry.js → p-7503fe08.entry.js} +1 -1
- package/dist/vega/{p-46714da3.entry.js → p-7b0a4688.entry.js} +1 -1
- package/dist/vega/p-7def7b74.entry.js +1 -0
- package/dist/vega/{p-48517a5d.entry.js → p-7f5a85c6.entry.js} +1 -1
- package/dist/vega/p-825ae7c4.js +1 -0
- package/dist/vega/p-831c4144.entry.js +1 -0
- package/dist/vega/p-85dc08b4.entry.js +1 -0
- package/dist/vega/{p-a821bcf3.js → p-86782109.js} +1 -1
- package/dist/vega/p-87459914.js +1 -0
- package/dist/vega/{p-1971d980.entry.js → p-87a1fc77.entry.js} +1 -1
- package/dist/vega/p-89565247.entry.js +1 -0
- package/dist/vega/{p-7088ead9.entry.js → p-89e915e9.entry.js} +1 -1
- package/dist/vega/{p-81fbfb6d.entry.js → p-8aa7e56e.entry.js} +1 -1
- package/dist/vega/p-94263ece.entry.js +1 -0
- package/dist/vega/{p-d0007822.entry.js → p-9524e48a.entry.js} +1 -1
- package/dist/vega/{p-147e3cbd.entry.js → p-991b4717.entry.js} +1 -1
- package/dist/vega/{p-647025dd.entry.js → p-99b9b320.entry.js} +1 -1
- package/dist/vega/{p-aea89be5.entry.js → p-9ba14b7c.entry.js} +1 -1
- package/dist/vega/p-9cb79f8d.entry.js +1 -0
- package/dist/vega/p-9e3f52f0.entry.js +1 -0
- package/dist/vega/{p-6586e2a2.entry.js → p-a0e122a6.entry.js} +1 -1
- package/dist/vega/{p-9803042f.entry.js → p-b0fe6c0f.entry.js} +1 -1
- package/dist/vega/{p-b2bca332.entry.js → p-b518e1a0.entry.js} +1 -1
- package/dist/vega/p-b538e81a.entry.js +1 -0
- package/dist/vega/p-b824baf7.entry.js +1 -0
- package/dist/vega/{p-2fadef27.entry.js → p-b959b4d4.entry.js} +1 -1
- package/dist/vega/{p-54f17c2e.entry.js → p-bb4f0fa1.entry.js} +1 -1
- package/dist/vega/{p-2da83c2a.js → p-bbb39d6f.js} +1 -1
- package/dist/vega/{p-cfda64fd.entry.js → p-bc8fd0ee.entry.js} +1 -1
- package/dist/vega/p-bcaf8375.entry.js +1 -0
- package/dist/vega/{p-02d7d948.entry.js → p-bec90ff3.entry.js} +1 -1
- package/dist/vega/p-c6b94dde.entry.js +1 -0
- package/dist/vega/{p-c754b32c.js → p-ce6b62c4.js} +1 -1
- package/dist/vega/{p-5e34ea25.entry.js → p-d00fbc11.entry.js} +1 -1
- package/dist/vega/{p-10a40dfb.entry.js → p-d2a2af2c.entry.js} +1 -1
- package/dist/vega/p-d64b20c2.js +1 -0
- package/dist/vega/p-da779940.entry.js +1 -0
- package/dist/vega/{p-a7dcb2a3.js → p-db910162.js} +1 -1
- package/dist/vega/{p-6f81fe1e.js → p-e1a2a701.js} +1 -1
- package/dist/vega/p-e3694aa5.entry.js +1 -0
- package/dist/vega/p-e7318c4c.entry.js +1 -0
- package/dist/vega/{p-a5c39ba2.entry.js → p-e8fc027e.entry.js} +1 -1
- package/dist/vega/{p-6a830bc5.entry.js → p-e92ecb78.entry.js} +1 -1
- package/dist/vega/p-e969c3f4.entry.js +1 -0
- package/dist/vega/{p-61eb7f32.entry.js → p-ec8b7f01.entry.js} +1 -1
- package/dist/vega/p-eed9bda2.entry.js +1 -0
- package/dist/vega/p-f4c54c98.entry.js +1 -0
- package/dist/vega/{p-5160a6b9.entry.js → p-f5fc80bc.entry.js} +1 -1
- package/dist/vega/p-f67be7ef.js +1 -0
- package/dist/vega/{p-5e3a15a1.js → p-f9fafc55.js} +1 -1
- package/dist/vega/{p-27e56c67.entry.js → p-fc21fb2d.entry.js} +1 -1
- package/dist/vega/p-fed9220b.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -1
- package/dist/cjs/string-21427167.js +0 -13
- package/dist/esm/string-be824360.js +0 -11
- package/dist/vega/p-06adb37e.entry.js +0 -1
- package/dist/vega/p-06c5fe97.entry.js +0 -1
- package/dist/vega/p-0bb29d98.js +0 -1
- package/dist/vega/p-0ed7a098.entry.js +0 -1
- package/dist/vega/p-0f6b3a89.entry.js +0 -1
- package/dist/vega/p-136f665b.entry.js +0 -1
- package/dist/vega/p-1503f791.js +0 -1
- package/dist/vega/p-16fd7c32.js +0 -1
- package/dist/vega/p-1a263af1.entry.js +0 -1
- package/dist/vega/p-1af4771a.entry.js +0 -1
- package/dist/vega/p-1c298d5a.js +0 -2
- package/dist/vega/p-1c63afd2.entry.js +0 -1
- package/dist/vega/p-1e05b7b4.entry.js +0 -1
- package/dist/vega/p-1ea863a6.entry.js +0 -1
- package/dist/vega/p-271b30b9.entry.js +0 -1
- package/dist/vega/p-2d1d4f33.entry.js +0 -1
- package/dist/vega/p-353b3ded.entry.js +0 -1
- package/dist/vega/p-44b0a005.js +0 -1
- package/dist/vega/p-4e76904e.entry.js +0 -1
- package/dist/vega/p-4ec0d36f.entry.js +0 -1
- package/dist/vega/p-5c954088.entry.js +0 -1
- package/dist/vega/p-646a9198.entry.js +0 -1
- package/dist/vega/p-6d7d923b.js +0 -1
- package/dist/vega/p-6e898779.js +0 -1
- package/dist/vega/p-77492977.entry.js +0 -1
- package/dist/vega/p-804f71b3.js +0 -1
- package/dist/vega/p-8789d34d.entry.js +0 -1
- package/dist/vega/p-8813c0ac.entry.js +0 -1
- package/dist/vega/p-8a85c7af.entry.js +0 -1
- package/dist/vega/p-8ba43640.entry.js +0 -1
- package/dist/vega/p-98c64d77.entry.js +0 -1
- package/dist/vega/p-9f3539a4.entry.js +0 -1
- package/dist/vega/p-b42aea55.entry.js +0 -1
- package/dist/vega/p-b5d70ee0.entry.js +0 -1
- package/dist/vega/p-bf1894ec.js +0 -1
- package/dist/vega/p-bfb344e1.entry.js +0 -1
- package/dist/vega/p-c9a4e79a.entry.js +0 -1
- package/dist/vega/p-dbc82247.js +0 -1
- package/dist/vega/p-e2e36d2b.entry.js +0 -1
- package/dist/vega/p-ef8272b5.entry.js +0 -1
- package/dist/vega/p-f4c1d961.js +0 -1
- package/dist/vega/p-f5279deb.entry.js +0 -1
- package/dist/vega/p-f8033cd3.entry.js +0 -1
- package/dist/vega/p-fe63bd50.entry.js +0 -1
package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js
CHANGED
|
@@ -42,20 +42,29 @@ export class ImageAnnotation extends NodeAnnotation {
|
|
|
42
42
|
return new ImageAnnotation(this.size, this.alt);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
renderClass(options) {
|
|
48
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
49
|
+
return null;
|
|
50
|
+
return `v-rte--image-size-${this.size}`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
48
54
|
*/
|
|
49
|
-
|
|
55
|
+
renderStyle(options) {
|
|
56
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
57
|
+
return null;
|
|
58
|
+
const baseStyle = { verticalAlign: 'bottom' };
|
|
50
59
|
switch (this.size) {
|
|
51
60
|
case 'sm': {
|
|
52
|
-
return { width: '25%' };
|
|
61
|
+
return Object.assign(Object.assign({}, baseStyle), { width: '25%' });
|
|
53
62
|
}
|
|
54
63
|
case 'md': {
|
|
55
|
-
return { width: '50%' };
|
|
64
|
+
return Object.assign(Object.assign({}, baseStyle), { width: '50%' });
|
|
56
65
|
}
|
|
57
66
|
case 'lg': {
|
|
58
|
-
return { width: '100%' };
|
|
67
|
+
return Object.assign(Object.assign({}, baseStyle), { width: '100%' });
|
|
59
68
|
}
|
|
60
69
|
}
|
|
61
70
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js
CHANGED
|
@@ -31,12 +31,18 @@ export class IndentAnnotation extends BlockAnnotation {
|
|
|
31
31
|
clone() {
|
|
32
32
|
return new IndentAnnotation(this.indent);
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
renderClass() {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
34
40
|
/**
|
|
35
41
|
* Generate the style for the annotation
|
|
36
42
|
*
|
|
37
43
|
* @returns {Nullable<AnnotationStyle>} - Annotation style
|
|
38
44
|
*/
|
|
39
|
-
|
|
40
|
-
return this.indent > 0 ? {
|
|
45
|
+
renderStyle() {
|
|
46
|
+
return this.indent > 0 ? { marginLeft: `${this.indent * 16}px` } : null;
|
|
41
47
|
}
|
|
42
48
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js
CHANGED
|
@@ -34,11 +34,19 @@ export class ItalicAnnotation extends NodeAnnotation {
|
|
|
34
34
|
return new ItalicAnnotation(this.italic);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
renderClass(options) {
|
|
40
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
41
|
+
return null;
|
|
42
|
+
return this.italic ? 'v-rte--italic' : null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
40
46
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
renderStyle(options) {
|
|
48
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
49
|
+
return null;
|
|
50
|
+
return this.italic ? { fontStyle: 'italic' } : null;
|
|
43
51
|
}
|
|
44
52
|
}
|
|
@@ -15,10 +15,7 @@ export class LinkAnnotation extends NodeAnnotation {
|
|
|
15
15
|
* @returns {[NodeAnnotationTypeEnum.LINK, LinkAnnotation]} Map item for the annotation
|
|
16
16
|
*/
|
|
17
17
|
static from(link) {
|
|
18
|
-
return [
|
|
19
|
-
NodeAnnotationTypeEnum.LINK,
|
|
20
|
-
new LinkAnnotation({ href: link.href, groupKey: link.groupKey }),
|
|
21
|
-
];
|
|
18
|
+
return [NodeAnnotationTypeEnum.LINK, new LinkAnnotation(link)];
|
|
22
19
|
}
|
|
23
20
|
/**
|
|
24
21
|
* Generate the JSON representation of the annotation
|
|
@@ -26,7 +23,9 @@ export class LinkAnnotation extends NodeAnnotation {
|
|
|
26
23
|
* @returns {Record<'link', VegaRTELink>} JSON representation of the annotation
|
|
27
24
|
*/
|
|
28
25
|
toJSON() {
|
|
29
|
-
return {
|
|
26
|
+
return {
|
|
27
|
+
link: this.link,
|
|
28
|
+
};
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
32
31
|
* @inheritDoc
|
|
@@ -44,11 +43,15 @@ export class LinkAnnotation extends NodeAnnotation {
|
|
|
44
43
|
return this.link.groupKey === annotation.link.groupKey;
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
* @inheritDoc
|
|
47
|
+
*/
|
|
48
|
+
renderClass() {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @inheritDoc
|
|
50
53
|
*/
|
|
51
|
-
|
|
54
|
+
renderStyle() {
|
|
52
55
|
return null;
|
|
53
56
|
}
|
|
54
57
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Annotation, InternalAnnotationTypeEnum } from './annotation.abstract';
|
|
2
|
+
import { camelToDashCase } from '../../../../utils/string';
|
|
2
3
|
/**
|
|
3
4
|
* Annotation to represent a link of grouped nodes
|
|
4
5
|
*/
|
|
@@ -16,4 +17,92 @@ export class LinkGroupAnnotation extends Annotation {
|
|
|
16
17
|
});
|
|
17
18
|
return clonedAnnotation;
|
|
18
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Convert the custom style, class and attribute to string which html can used
|
|
22
|
+
*
|
|
23
|
+
* @param {linkAnnotation} linkAnnotation current link annotation which saved custom style, class and attribute.
|
|
24
|
+
* @param {RTERenderContext} options - options.
|
|
25
|
+
* @returns {string} - string.
|
|
26
|
+
*/
|
|
27
|
+
toString(linkAnnotation, options) {
|
|
28
|
+
const attributes = this.toJsx(linkAnnotation, options);
|
|
29
|
+
return Object.entries(attributes)
|
|
30
|
+
.map(([key, value]) => {
|
|
31
|
+
const valueString = typeof value === 'string' ? value : this.formatStyleToString(value);
|
|
32
|
+
return `${camelToDashCase(key)}="${valueString}"`;
|
|
33
|
+
})
|
|
34
|
+
.join(' ');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Convert the custom style, class and attribute to JSX attributes
|
|
38
|
+
*
|
|
39
|
+
* @param {linkAnnotation} linkAnnotation current link annotation which saved custom style, class and attribute.
|
|
40
|
+
* @param {RTERenderContext} options - options.
|
|
41
|
+
* @returns {Record<string, string | AnnotationStyle>} JSX used attributes.
|
|
42
|
+
*/
|
|
43
|
+
toJsx(linkAnnotation, options) {
|
|
44
|
+
const linkStyle = this.getStyle(linkAnnotation, options);
|
|
45
|
+
const linkClass = this.getClass(linkAnnotation, options);
|
|
46
|
+
const attributes = this.getAttribute(linkAnnotation);
|
|
47
|
+
if (linkClass.length > 0) {
|
|
48
|
+
attributes.class = linkClass.join(' ');
|
|
49
|
+
}
|
|
50
|
+
if (linkStyle && Object.keys(linkStyle).length > 0) {
|
|
51
|
+
attributes.style = linkStyle;
|
|
52
|
+
}
|
|
53
|
+
return attributes;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get the custom class for the annotation
|
|
57
|
+
*
|
|
58
|
+
* @param {linkAnnotation} linkAnnotation current link annotation which saved custom style, class and attribute.
|
|
59
|
+
* @param {RTERenderContext} options - options.
|
|
60
|
+
* @returns {string[]} Link class
|
|
61
|
+
*/
|
|
62
|
+
getClass(linkAnnotation, options) {
|
|
63
|
+
const linkClass = [];
|
|
64
|
+
if (linkAnnotation.link.customClass)
|
|
65
|
+
linkClass.push(...linkAnnotation.link.customClass);
|
|
66
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
67
|
+
linkClass.push('v-rte--link');
|
|
68
|
+
return linkClass;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get the custom style for the annotation
|
|
72
|
+
*
|
|
73
|
+
* @param {LinkAnnotation} linkAnnotation current link annotation which saved custom style, class and attribute.
|
|
74
|
+
* @param {RTERenderContext} options - options.
|
|
75
|
+
* @returns {AnnotationStyle} Link style
|
|
76
|
+
*/
|
|
77
|
+
getStyle(linkAnnotation, options) {
|
|
78
|
+
const linkStyle = {};
|
|
79
|
+
if (linkAnnotation.link.customStyle)
|
|
80
|
+
Object.assign(linkStyle, linkAnnotation.link.customStyle);
|
|
81
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
82
|
+
linkStyle.color = 'rgba(var(--v-text-link, 19, 98, 226, 1))';
|
|
83
|
+
return linkStyle;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the custom attribute for the annotation
|
|
87
|
+
*
|
|
88
|
+
* @param {LinkAnnotation} linkAnnotation current link annotation which saved custom style, class and attribute.
|
|
89
|
+
* @returns {Record<string, string>} Link attributes
|
|
90
|
+
*/
|
|
91
|
+
getAttribute(linkAnnotation) {
|
|
92
|
+
const { href, customAttribute = {} } = linkAnnotation.link;
|
|
93
|
+
customAttribute.href = href;
|
|
94
|
+
customAttribute.target = customAttribute.target || '_blank';
|
|
95
|
+
return customAttribute;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Convert style to string which can be used to html string.
|
|
99
|
+
*
|
|
100
|
+
* @param {AnnotationStyle} style Style object.
|
|
101
|
+
* @returns {string} Style string
|
|
102
|
+
*/
|
|
103
|
+
formatStyleToString(style) {
|
|
104
|
+
return Object.entries(style)
|
|
105
|
+
.map(([key, value]) => `${camelToDashCase(key)}: ${value};`)
|
|
106
|
+
.join(' ');
|
|
107
|
+
}
|
|
19
108
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BlockAnnotation, BlockAnnotationTypeEnum } from './block-annotation.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* List annotation
|
|
4
|
+
*/
|
|
5
|
+
export class ListAnnotation extends BlockAnnotation {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.type = BlockAnnotationTypeEnum.LIST;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @inheritDoc
|
|
12
|
+
*/
|
|
13
|
+
renderStyle(options) {
|
|
14
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
15
|
+
return null;
|
|
16
|
+
return {
|
|
17
|
+
paddingLeft: '8px',
|
|
18
|
+
marginLeft: '16px',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
renderClass(options) {
|
|
25
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
26
|
+
return null;
|
|
27
|
+
return 'v-rte--list';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
clone() {
|
|
33
|
+
return new ListAnnotation();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
toJSON() {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js
CHANGED
|
@@ -34,19 +34,19 @@ export class StrikethroughAnnotation extends NodeAnnotation {
|
|
|
34
34
|
return new StrikethroughAnnotation(this.strikethrough);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* @returns {Nullable<string>} - Annotation class
|
|
37
|
+
* @inheritDoc
|
|
40
38
|
*/
|
|
41
|
-
renderClass() {
|
|
39
|
+
renderClass(options) {
|
|
40
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
41
|
+
return null;
|
|
42
42
|
return this.strikethrough ? 'v-rte--strikethrough' : null;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* @returns {Nullable<AnnotationStyle>} - Annotation style
|
|
45
|
+
* @inheritDoc
|
|
48
46
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
renderStyle(options) {
|
|
48
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
49
|
+
return null;
|
|
50
|
+
return this.strikethrough ? { textDecoration: 'line-through' } : null;
|
|
51
51
|
}
|
|
52
52
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js
CHANGED
|
@@ -36,19 +36,15 @@ export class TextColorAnnotation extends NodeAnnotation {
|
|
|
36
36
|
return new TextColorAnnotation(this.textColor.key);
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @returns {Nullable<string>} - Annotation class
|
|
39
|
+
* @inheritDoc
|
|
42
40
|
*/
|
|
43
41
|
renderClass() {
|
|
44
42
|
return null;
|
|
45
43
|
}
|
|
46
44
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @returns {Nullable<AnnotationStyle>} - Annotation style
|
|
45
|
+
* @inheritDoc
|
|
50
46
|
*/
|
|
51
|
-
|
|
47
|
+
renderStyle() {
|
|
52
48
|
return {
|
|
53
49
|
color: VegaInternalThemeManager.isDarkMode() ? this.textColor.dark : this.textColor.light,
|
|
54
50
|
};
|
package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js
CHANGED
|
@@ -32,44 +32,106 @@ export class TextStyleAnnotation extends BlockAnnotation {
|
|
|
32
32
|
return new TextStyleAnnotation(this.textStyle);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
renderClass(options) {
|
|
38
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
39
|
+
return null;
|
|
40
|
+
return `v-rte--text-style-${this.textStyle}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
38
44
|
*/
|
|
39
|
-
|
|
45
|
+
renderStyle(options) {
|
|
46
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
47
|
+
return null;
|
|
40
48
|
const paragraphStyle = {
|
|
41
49
|
fontFamily: 'Inter',
|
|
42
50
|
fontSize: '16px',
|
|
43
51
|
lineHeight: '22px',
|
|
44
52
|
fontWeight: '500',
|
|
53
|
+
marginTop: '0px',
|
|
54
|
+
marginBottom: '0px',
|
|
45
55
|
};
|
|
46
56
|
switch (this.textStyle) {
|
|
47
57
|
case 'paragraph': {
|
|
48
58
|
return paragraphStyle;
|
|
49
59
|
}
|
|
50
60
|
case 'title': {
|
|
51
|
-
return {
|
|
61
|
+
return {
|
|
62
|
+
fontFamily: 'Inter',
|
|
63
|
+
fontSize: '36px',
|
|
64
|
+
lineHeight: '40px',
|
|
65
|
+
fontWeight: '500',
|
|
66
|
+
};
|
|
52
67
|
}
|
|
53
68
|
case 'subtitle': {
|
|
54
|
-
return {
|
|
69
|
+
return {
|
|
70
|
+
fontFamily: 'Inter',
|
|
71
|
+
fontSize: '28px',
|
|
72
|
+
lineHeight: '32px',
|
|
73
|
+
fontWeight: '500',
|
|
74
|
+
};
|
|
55
75
|
}
|
|
56
76
|
case 'heading-1': {
|
|
57
|
-
return {
|
|
77
|
+
return {
|
|
78
|
+
fontFamily: 'Inter',
|
|
79
|
+
fontSize: '22px',
|
|
80
|
+
lineHeight: '24px',
|
|
81
|
+
fontWeight: '500',
|
|
82
|
+
marginTop: '0px',
|
|
83
|
+
marginBottom: '0px',
|
|
84
|
+
};
|
|
58
85
|
}
|
|
59
86
|
case 'heading-2': {
|
|
60
|
-
return {
|
|
87
|
+
return {
|
|
88
|
+
fontFamily: 'Inter',
|
|
89
|
+
fontSize: '20px',
|
|
90
|
+
lineHeight: '24px',
|
|
91
|
+
fontWeight: '500',
|
|
92
|
+
marginTop: '0px',
|
|
93
|
+
marginBottom: '0px',
|
|
94
|
+
};
|
|
61
95
|
}
|
|
62
96
|
case 'heading-3': {
|
|
63
|
-
return {
|
|
97
|
+
return {
|
|
98
|
+
fontFamily: 'Inter',
|
|
99
|
+
fontSize: '18px',
|
|
100
|
+
lineHeight: '22px',
|
|
101
|
+
fontWeight: '500',
|
|
102
|
+
marginTop: '0px',
|
|
103
|
+
marginBottom: '0px',
|
|
104
|
+
};
|
|
64
105
|
}
|
|
65
106
|
case 'heading-4': {
|
|
66
|
-
return {
|
|
107
|
+
return {
|
|
108
|
+
fontFamily: 'Inter',
|
|
109
|
+
fontSize: '16px',
|
|
110
|
+
lineHeight: '22px',
|
|
111
|
+
fontWeight: '500',
|
|
112
|
+
marginTop: '0px',
|
|
113
|
+
marginBottom: '0px',
|
|
114
|
+
};
|
|
67
115
|
}
|
|
68
116
|
case 'heading-5': {
|
|
69
|
-
return {
|
|
117
|
+
return {
|
|
118
|
+
fontFamily: 'Inter',
|
|
119
|
+
fontSize: '14px',
|
|
120
|
+
lineHeight: '22px',
|
|
121
|
+
fontWeight: '500',
|
|
122
|
+
marginTop: '0px',
|
|
123
|
+
marginBottom: '0px',
|
|
124
|
+
};
|
|
70
125
|
}
|
|
71
126
|
case 'heading-6': {
|
|
72
|
-
return {
|
|
127
|
+
return {
|
|
128
|
+
fontFamily: 'Inter',
|
|
129
|
+
fontSize: '12px',
|
|
130
|
+
lineHeight: '22px',
|
|
131
|
+
fontWeight: '500',
|
|
132
|
+
marginTop: '0px',
|
|
133
|
+
marginBottom: '0px',
|
|
134
|
+
};
|
|
73
135
|
}
|
|
74
136
|
}
|
|
75
137
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js
CHANGED
|
@@ -34,19 +34,19 @@ export class UnderlineAnnotation extends NodeAnnotation {
|
|
|
34
34
|
return new UnderlineAnnotation(this.underline);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* @returns {Nullable<string>} - Annotation class
|
|
37
|
+
* @inheritDoc
|
|
40
38
|
*/
|
|
41
|
-
renderClass() {
|
|
39
|
+
renderClass(options) {
|
|
40
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
41
|
+
return null;
|
|
42
42
|
return this.underline ? 'v-rte--underline' : null;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* @returns {Nullable<AnnotationStyle>} - Annotation style
|
|
45
|
+
* @inheritDoc
|
|
48
46
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
renderStyle(options) {
|
|
48
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
49
|
+
return null;
|
|
50
|
+
return this.underline ? { textDecoration: 'underline' } : null;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -7,6 +7,12 @@ import { ModifyContentAction } from '../actions/modify-content-action.abstract';
|
|
|
7
7
|
import { HorizontalAlignmentAnnotation } from '../annotations/horizontal-alignment-annotation';
|
|
8
8
|
import { IndentAnnotation } from '../annotations/indent-annotation';
|
|
9
9
|
import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action-handle-strategy-registry';
|
|
10
|
+
import { isNonNullable } from '../../../../types/type-guard';
|
|
11
|
+
import { camelToDashCase } from '../../../../utils/string';
|
|
12
|
+
import { CustomAttributeAnnotation } from '../annotations/custom-attribute-annotation';
|
|
13
|
+
import { CustomClassAnnotation } from '../annotations/custom-class-annotation';
|
|
14
|
+
import { CommonAnnotation, CommonAnnotationTypeEnum } from '../annotations/common-annotation.abstract';
|
|
15
|
+
import { CustomStyleAnnotation } from '../annotations/custom-style-annotation';
|
|
10
16
|
/**
|
|
11
17
|
* Abstract class for block
|
|
12
18
|
*/
|
|
@@ -24,7 +30,7 @@ export class RTEBlock {
|
|
|
24
30
|
* @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
|
|
25
31
|
* that will be used to create the annotation entity. It can be of any type depending on the specific
|
|
26
32
|
* annotation being created.
|
|
27
|
-
* @returns {Nullable<
|
|
33
|
+
* @returns {Nullable<BlockAnnotationsEntity>} The `createAnnotationEntity` function returns a nullable tuple containing a
|
|
28
34
|
* `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
|
|
29
35
|
*/
|
|
30
36
|
static createAnnotationEntity(type, value) {
|
|
@@ -33,6 +39,12 @@ export class RTEBlock {
|
|
|
33
39
|
return HorizontalAlignmentAnnotation.from(value);
|
|
34
40
|
case 'indent':
|
|
35
41
|
return IndentAnnotation.from(value);
|
|
42
|
+
case 'customAttribute':
|
|
43
|
+
return CustomAttributeAnnotation.from(value);
|
|
44
|
+
case 'customClass':
|
|
45
|
+
return CustomClassAnnotation.from(value);
|
|
46
|
+
case 'customStyle':
|
|
47
|
+
return CustomStyleAnnotation.from(value);
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
/**
|
|
@@ -42,7 +54,7 @@ export class RTEBlock {
|
|
|
42
54
|
*/
|
|
43
55
|
toJSON() {
|
|
44
56
|
const annotations = Array.from(this.annotationMap.values())
|
|
45
|
-
.filter((annotation) => annotation instanceof BlockAnnotation)
|
|
57
|
+
.filter((annotation) => annotation instanceof BlockAnnotation || annotation instanceof CommonAnnotation)
|
|
46
58
|
.reduce((record, annotation) => {
|
|
47
59
|
return Object.assign(Object.assign({}, record), annotation.toJSON());
|
|
48
60
|
}, {});
|
|
@@ -75,6 +87,61 @@ export class RTEBlock {
|
|
|
75
87
|
}
|
|
76
88
|
}
|
|
77
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Get styles from annotations
|
|
92
|
+
*
|
|
93
|
+
* @param {RTERenderContext} [options={ standalone: false }] - Options to control style mode
|
|
94
|
+
* @returns {AnnotationStyle} - Annotation styles
|
|
95
|
+
*/
|
|
96
|
+
getStyles(options = { standalone: false }) {
|
|
97
|
+
return Array.from(this.annotationMap.values())
|
|
98
|
+
.filter((annotation) => annotation instanceof BlockAnnotation || annotation instanceof CustomStyleAnnotation)
|
|
99
|
+
.map((annotation) => annotation.renderStyle(options))
|
|
100
|
+
.filter(isNonNullable)
|
|
101
|
+
.reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get classes from annotations
|
|
105
|
+
*
|
|
106
|
+
* @param {RTERenderContext} [options={ standalone: false }] - Options to control standalone mode
|
|
107
|
+
* @returns {string} - Annotation style
|
|
108
|
+
*/
|
|
109
|
+
getClasses(options = { standalone: false }) {
|
|
110
|
+
return Array.from(this.annotationMap.values())
|
|
111
|
+
.filter((annotation) => annotation instanceof BlockAnnotation || annotation instanceof CustomClassAnnotation)
|
|
112
|
+
.map((annotation) => annotation.renderClass(options))
|
|
113
|
+
.filter(isNonNullable)
|
|
114
|
+
.reduce((pre, cur) => [pre, cur].join(' ').trim(), '');
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get custom attribute annotation, excluding "class" and "style"
|
|
118
|
+
*
|
|
119
|
+
* @returns {Nullable<CustomAttributeAnnotation>} - custom attribute annotation
|
|
120
|
+
*/
|
|
121
|
+
getCustomAttributesAnnotation() {
|
|
122
|
+
return this.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_ATTRIBUTE);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Generate attributes as string
|
|
126
|
+
*
|
|
127
|
+
* @param {...string} attrs - Additional attributes to include
|
|
128
|
+
* @returns {string} - Attributes as string
|
|
129
|
+
*/
|
|
130
|
+
generateAttributeString(...attrs) {
|
|
131
|
+
var _a;
|
|
132
|
+
const styles = Object.entries(Object.assign({}, this.getStyles({ standalone: true })))
|
|
133
|
+
.map(([key, value]) => `${camelToDashCase(key)}: ${value};`)
|
|
134
|
+
.join('');
|
|
135
|
+
const customClassAnnotation = this.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_CLASS);
|
|
136
|
+
const customAttributeString = ((_a = this.getCustomAttributesAnnotation()) === null || _a === void 0 ? void 0 : _a.toString(attrs)) || [];
|
|
137
|
+
const attributes = [
|
|
138
|
+
...customAttributeString,
|
|
139
|
+
customClassAnnotation === null || customClassAnnotation === void 0 ? void 0 : customClassAnnotation.toString(),
|
|
140
|
+
styles ? `style="${styles}"` : null,
|
|
141
|
+
...attrs,
|
|
142
|
+
].filter(isNonNullable);
|
|
143
|
+
return attributes.length ? ` ${attributes.join(' ')}` : '';
|
|
144
|
+
}
|
|
78
145
|
/**
|
|
79
146
|
* Apply action to block
|
|
80
147
|
*
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { RTEBlock } from './block.abstract';
|
|
2
|
+
import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action-handle-strategy-registry';
|
|
3
|
+
import { ModifyContentAction, ModifyContentActionType } from '../actions/modify-content-action.abstract';
|
|
4
|
+
import stateEntityRenderingRegistry from '../../slimmers/controllers/state-entity-rendering-registry';
|
|
5
|
+
import domNodeSubjectFactory from '../../../../helpers/change-manager/subject/dom-node-subject/dom-node-subject-factory';
|
|
6
|
+
import { VegaInternalRichTextEditorFlushChanges } from '../../../../helpers/event-manager/event-id/vega-internal-event-id';
|
|
7
|
+
import changeManager from '../../../../helpers/change-manager/change-manager';
|
|
8
|
+
import { CodeBlockRemoveSelfStrategy } from '../action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy';
|
|
9
|
+
import { SwitchOutFromCodeBlockStrategy } from '../action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy';
|
|
10
|
+
import { RTECodeBlockNode } from '../nodes/code-block-node';
|
|
11
|
+
import { InternalAnnotationTypeEnum } from '../annotations/annotation.abstract';
|
|
12
|
+
import { CodeBlockInsertImageStrategy } from '../action-handle-strategies/modify-content-strategies/code-block-insert-image-strategy';
|
|
13
|
+
import { BlockRemoveNodeStrategy } from '../action-handle-strategies/modify-content-strategies/block-remove-node-strategy';
|
|
14
|
+
import { CodeLanguage } from '../../../vega-code-block/types';
|
|
15
|
+
/**
|
|
16
|
+
* The code block DTO class.
|
|
17
|
+
*/
|
|
18
|
+
export class RTECodeBlock extends RTEBlock {
|
|
19
|
+
constructor(id, content, language) {
|
|
20
|
+
super(id);
|
|
21
|
+
this.type = 'code-block';
|
|
22
|
+
this.nodes = [new RTECodeBlockNode(`${id}-1`, content, language, this)];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Converts a VegaRTECodeBlock into an RTECodeBlock.
|
|
26
|
+
*
|
|
27
|
+
* @param {VegaRTECodeBlock} block - The block object
|
|
28
|
+
* @returns {RTECodeBlock} A RTECodeBlock class
|
|
29
|
+
*/
|
|
30
|
+
static from(block) {
|
|
31
|
+
return new RTECodeBlock(block.id, block.content, block.language);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
toJSON() {
|
|
37
|
+
const { language, text } = this.nodes[0];
|
|
38
|
+
return {
|
|
39
|
+
id: this.id,
|
|
40
|
+
type: 'code-block',
|
|
41
|
+
content: text,
|
|
42
|
+
language,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @inheritDoc
|
|
47
|
+
*/
|
|
48
|
+
toHtml() {
|
|
49
|
+
const { language = CodeLanguage['Plain Text'] } = this.nodes[0];
|
|
50
|
+
return `<pre data-language="${language}" style="background-color: rgba(var(--v-bg-secondary, 245, 247, 247, 1)); padding: 12px">${this.nodes.map((node) => node.toHtml())}</pre>`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
clone() {
|
|
56
|
+
const cloneCodeBlock = RTECodeBlock.from(this.toJSON());
|
|
57
|
+
cloneCodeBlock.parent = this.parent;
|
|
58
|
+
return cloneCodeBlock;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Apply action to block
|
|
62
|
+
*
|
|
63
|
+
* @param {ModifyContentAction} action - modify content action.
|
|
64
|
+
*/
|
|
65
|
+
apply(action) {
|
|
66
|
+
if (action instanceof ModifyContentAction) {
|
|
67
|
+
ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
68
|
+
}
|
|
69
|
+
if (action.isFlushable) {
|
|
70
|
+
const domNode = stateEntityRenderingRegistry.getDOMByEntity(this);
|
|
71
|
+
if (domNode) {
|
|
72
|
+
const nodeSubject = domNodeSubjectFactory.getSubjectFromParentNodeByEventId(domNode, VegaInternalRichTextEditorFlushChanges);
|
|
73
|
+
if (nodeSubject) {
|
|
74
|
+
changeManager.notify(nodeSubject, {});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @inheritDoc
|
|
81
|
+
*/
|
|
82
|
+
isNotEmpty() {
|
|
83
|
+
return !!this.nodes.length;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @inheritDoc
|
|
87
|
+
*/
|
|
88
|
+
getLastNode() {
|
|
89
|
+
return this.nodes[0];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The code block is selected or not.
|
|
93
|
+
*
|
|
94
|
+
* @returns {boolean} - The boolean result.
|
|
95
|
+
*/
|
|
96
|
+
isSelected() {
|
|
97
|
+
return this.nodes[0].annotationMap.has(InternalAnnotationTypeEnum.SELECTION_RANGE);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
(() => {
|
|
101
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CODE_BLOCK, RTECodeBlock.name, new CodeBlockRemoveSelfStrategy());
|
|
102
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_CHILD, RTECodeBlock.name, new BlockRemoveNodeStrategy());
|
|
103
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.SWITCH_OUT_FROM_CODE_BLOCK, RTECodeBlock.name, new SwitchOutFromCodeBlockStrategy());
|
|
104
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTECodeBlock.name, new CodeBlockInsertImageStrategy());
|
|
105
|
+
})();
|
|
106
|
+
RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME = 'code-block-placeholder-element';
|