@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
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Component, Element, Host, h, Prop, Event, Method, Watch } from '@stencil/core';
|
|
8
|
+
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, methodPlaceholder, } from 'vega-slimmer/core';
|
|
9
|
+
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
|
|
10
|
+
import { sanitizeVegaComponent } from '../../utils/component';
|
|
11
|
+
import { VegaCodeBlockRenderer } from './slimmers/renderers/vega-code-block-renderer';
|
|
12
|
+
import { arrayToClassString } from '../../utils/ui';
|
|
13
|
+
import { VegaCodeBlockContentRenderer } from './slimmers/renderers/vega-code-block-content-renderer';
|
|
14
|
+
import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/event-emit-slimmer';
|
|
15
|
+
import { VegaChange, VegaRemove } from '../../helpers/event-manager/event-id/vega-event-id';
|
|
16
|
+
import { VegaCodeBlockValueController } from './slimmers/controllers/vega-code-block-value-controller';
|
|
17
|
+
import { deepEqual } from '../../utils/object';
|
|
18
|
+
import { TranslationSlimmer } from '../../helpers/slimmers/translation';
|
|
19
|
+
import { CodeContentParseController } from './slimmers/controllers/vega-code-block-content-parse-controller';
|
|
20
|
+
import { VegaCodeBlockSelectionController } from './slimmers/controllers/vega-code-block-selection-controller';
|
|
21
|
+
import { CodeBlockInputController } from './slimmers/controllers/vega-code-block-input-controller';
|
|
22
|
+
import { ChildNodesEventPreventSlimmer } from '../../helpers/event-manager/slimmers/child-nodes-event-prevent-slimmer';
|
|
23
|
+
import { VegaCodeBlockFocusController } from './slimmers/controllers/vega-code-block-focus-controller';
|
|
24
|
+
import { VegaCodeBlockCopyButtonRenderer } from './slimmers/renderers/vega-code-block-copy-button-renderer';
|
|
25
|
+
import { PrismCodeHighlightParseController } from './slimmers/controllers/prism-code-highlight-parse-controller';
|
|
26
|
+
import { DefaultCodeHighlightParseController } from './slimmers/controllers/default-code-highlight-parse-controller';
|
|
27
|
+
import { ComponentGlobalStyleSlimmer } from '../../helpers/slimmers/component-global-style-slimmer';
|
|
28
|
+
import codeColorVariable from './code-color-variable.css';
|
|
29
|
+
/**
|
|
30
|
+
* A component for capturing and displaying syntax-highlighted code blocks with copy-to-clipboard functionality.
|
|
31
|
+
*
|
|
32
|
+
* @vegaVersion 2.50.0-RTE-preview
|
|
33
|
+
*/
|
|
34
|
+
export class VegaCodeBlock {
|
|
35
|
+
constructor() {
|
|
36
|
+
this.globalSlimmers = {};
|
|
37
|
+
//TODO: The global style should be removed after the code color change to the color token.
|
|
38
|
+
this.componentGlobalStyleSlimmer = new ComponentGlobalStyleSlimmer(codeColorVariable);
|
|
39
|
+
this.translationSlimmer = new TranslationSlimmer();
|
|
40
|
+
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
|
|
41
|
+
this.codeBlockRenderer = new VegaCodeBlockRenderer();
|
|
42
|
+
this.contentRenderer = new VegaCodeBlockContentRenderer();
|
|
43
|
+
this.copyButtonRenderer = new VegaCodeBlockCopyButtonRenderer();
|
|
44
|
+
this.valueController = new VegaCodeBlockValueController();
|
|
45
|
+
this.contentParseController = new CodeContentParseController();
|
|
46
|
+
this.prismCodeHighlightParser = new PrismCodeHighlightParseController();
|
|
47
|
+
this.defaultCodeHighlightParser = new DefaultCodeHighlightParseController();
|
|
48
|
+
this.selectionController = new VegaCodeBlockSelectionController();
|
|
49
|
+
this.inputController = new CodeBlockInputController();
|
|
50
|
+
this.focusController = new VegaCodeBlockFocusController();
|
|
51
|
+
this.changeEventEmitter = createEventEmitSlimmer(VegaCodeBlock, VegaChange);
|
|
52
|
+
this.removeEventEmitter = createEventEmitSlimmer(VegaCodeBlock, VegaRemove);
|
|
53
|
+
this.eventPreventSlimmer = new ChildNodesEventPreventSlimmer([VegaChange], () => this.codeBlockRenderer.getToolbarContainerRef());
|
|
54
|
+
/**
|
|
55
|
+
* Specifies whether the code block editor is in read-only mode.
|
|
56
|
+
*
|
|
57
|
+
* @vegaVersion 2.50.0-RTE-preview
|
|
58
|
+
*/
|
|
59
|
+
this.readOnly = false;
|
|
60
|
+
/**
|
|
61
|
+
* Specifies whether the code block editor is disabled.
|
|
62
|
+
*
|
|
63
|
+
* @vegaVersion 2.50.0-RTE-preview
|
|
64
|
+
*/
|
|
65
|
+
this.disabled = false;
|
|
66
|
+
/**
|
|
67
|
+
* Specifies whether to display the copy button in the code block.
|
|
68
|
+
*
|
|
69
|
+
* @vegaVersion 2.50.0-RTE-preview
|
|
70
|
+
*/
|
|
71
|
+
this.showCopyButton = true;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies whether to display the code line number in the code block.
|
|
74
|
+
*
|
|
75
|
+
* @vegaVersion 2.50.0-RTE-preview
|
|
76
|
+
*/
|
|
77
|
+
this.showLineNumber = true;
|
|
78
|
+
}
|
|
79
|
+
watchEditableChange() {
|
|
80
|
+
methodPlaceholder();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Check the props value to avoid unnecessary updates.
|
|
84
|
+
*
|
|
85
|
+
* @param {unknown} newValue - The new props value.
|
|
86
|
+
* @param {unknown} oldValue - The old props value.
|
|
87
|
+
* @param {string} name - The property name.
|
|
88
|
+
* @returns {boolean} Return false to skip the current update flow.
|
|
89
|
+
*/
|
|
90
|
+
componentShouldUpdate(newValue, oldValue, name) {
|
|
91
|
+
if (name === 'value' && deepEqual(newValue, oldValue)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Invoke this method to focus the current code block.
|
|
98
|
+
*
|
|
99
|
+
* @vegaVersion 2.50.0-RTE-preview
|
|
100
|
+
*/
|
|
101
|
+
async doFocus() {
|
|
102
|
+
methodPlaceholder();
|
|
103
|
+
}
|
|
104
|
+
render() {
|
|
105
|
+
const classNames = arrayToClassString([
|
|
106
|
+
this.readOnly ? 'readonly' : '',
|
|
107
|
+
this.disabled ? 'disabled' : '',
|
|
108
|
+
this.showLineNumber ? 'show-line-number' : '',
|
|
109
|
+
this.prismCodeHighlightParser.canParse() ? 'highlight' : '',
|
|
110
|
+
]);
|
|
111
|
+
return sanitizeVegaComponent(h(Host, { contenteditable: false, class: classNames }, this.codeBlockRenderer.render()), this.host);
|
|
112
|
+
}
|
|
113
|
+
static get is() { return "vega-code-block"; }
|
|
114
|
+
static get encapsulation() { return "shadow"; }
|
|
115
|
+
static get originalStyleUrls() { return {
|
|
116
|
+
"$": ["vega-code-block.scss"]
|
|
117
|
+
}; }
|
|
118
|
+
static get styleUrls() { return {
|
|
119
|
+
"$": ["vega-code-block.css"]
|
|
120
|
+
}; }
|
|
121
|
+
static get properties() { return {
|
|
122
|
+
"readOnly": {
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "boolean",
|
|
127
|
+
"resolved": "boolean",
|
|
128
|
+
"references": {}
|
|
129
|
+
},
|
|
130
|
+
"required": false,
|
|
131
|
+
"optional": false,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [{
|
|
134
|
+
"name": "vegaVersion",
|
|
135
|
+
"text": "2.50.0-RTE-preview"
|
|
136
|
+
}],
|
|
137
|
+
"text": "Specifies whether the code block editor is in read-only mode."
|
|
138
|
+
},
|
|
139
|
+
"attribute": "read-only",
|
|
140
|
+
"reflect": false,
|
|
141
|
+
"defaultValue": "false"
|
|
142
|
+
},
|
|
143
|
+
"disabled": {
|
|
144
|
+
"type": "boolean",
|
|
145
|
+
"mutable": false,
|
|
146
|
+
"complexType": {
|
|
147
|
+
"original": "boolean",
|
|
148
|
+
"resolved": "boolean",
|
|
149
|
+
"references": {}
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"optional": false,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [{
|
|
155
|
+
"name": "vegaVersion",
|
|
156
|
+
"text": "2.50.0-RTE-preview"
|
|
157
|
+
}],
|
|
158
|
+
"text": "Specifies whether the code block editor is disabled."
|
|
159
|
+
},
|
|
160
|
+
"attribute": "disabled",
|
|
161
|
+
"reflect": false,
|
|
162
|
+
"defaultValue": "false"
|
|
163
|
+
},
|
|
164
|
+
"showCopyButton": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "boolean",
|
|
169
|
+
"resolved": "boolean",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [{
|
|
176
|
+
"name": "vegaVersion",
|
|
177
|
+
"text": "2.50.0-RTE-preview"
|
|
178
|
+
}],
|
|
179
|
+
"text": "Specifies whether to display the copy button in the code block."
|
|
180
|
+
},
|
|
181
|
+
"attribute": "show-copy-button",
|
|
182
|
+
"reflect": false,
|
|
183
|
+
"defaultValue": "true"
|
|
184
|
+
},
|
|
185
|
+
"showLineNumber": {
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"complexType": {
|
|
189
|
+
"original": "boolean",
|
|
190
|
+
"resolved": "boolean",
|
|
191
|
+
"references": {}
|
|
192
|
+
},
|
|
193
|
+
"required": false,
|
|
194
|
+
"optional": false,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [{
|
|
197
|
+
"name": "vegaVersion",
|
|
198
|
+
"text": "2.50.0-RTE-preview"
|
|
199
|
+
}],
|
|
200
|
+
"text": "Specifies whether to display the code line number in the code block."
|
|
201
|
+
},
|
|
202
|
+
"attribute": "show-line-number",
|
|
203
|
+
"reflect": false,
|
|
204
|
+
"defaultValue": "true"
|
|
205
|
+
},
|
|
206
|
+
"value": {
|
|
207
|
+
"type": "unknown",
|
|
208
|
+
"mutable": true,
|
|
209
|
+
"complexType": {
|
|
210
|
+
"original": "VegaCodeBlockValue",
|
|
211
|
+
"resolved": "{ language?: \"css\" | \"html\" | \"js\" | \"jsx\" | \"plainText\" | \"ts\" | \"tsx\"; code: string; }",
|
|
212
|
+
"references": {
|
|
213
|
+
"VegaCodeBlockValue": {
|
|
214
|
+
"location": "import",
|
|
215
|
+
"path": "./types"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"required": false,
|
|
220
|
+
"optional": false,
|
|
221
|
+
"docs": {
|
|
222
|
+
"tags": [{
|
|
223
|
+
"name": "vegaVersion",
|
|
224
|
+
"text": "2.50.0-RTE-preview"
|
|
225
|
+
}],
|
|
226
|
+
"text": "Specifies the content or value to be displayed in the code block."
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}; }
|
|
230
|
+
static get events() { return [{
|
|
231
|
+
"method": "vegaChange",
|
|
232
|
+
"name": "vegaChange",
|
|
233
|
+
"bubbles": true,
|
|
234
|
+
"cancelable": true,
|
|
235
|
+
"composed": true,
|
|
236
|
+
"docs": {
|
|
237
|
+
"tags": [{
|
|
238
|
+
"name": "vegaVersion",
|
|
239
|
+
"text": "2.50.0-RTE-preview"
|
|
240
|
+
}],
|
|
241
|
+
"text": "An event emitter notifying a value change."
|
|
242
|
+
},
|
|
243
|
+
"complexType": {
|
|
244
|
+
"original": "VegaCodeBlockValue",
|
|
245
|
+
"resolved": "{ language?: \"css\" | \"html\" | \"js\" | \"jsx\" | \"plainText\" | \"ts\" | \"tsx\"; code: string; }",
|
|
246
|
+
"references": {
|
|
247
|
+
"VegaCodeBlockValue": {
|
|
248
|
+
"location": "import",
|
|
249
|
+
"path": "./types"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}, {
|
|
254
|
+
"method": "change",
|
|
255
|
+
"name": "change",
|
|
256
|
+
"bubbles": true,
|
|
257
|
+
"cancelable": true,
|
|
258
|
+
"composed": true,
|
|
259
|
+
"docs": {
|
|
260
|
+
"tags": [{
|
|
261
|
+
"name": "vegaVersion",
|
|
262
|
+
"text": "2.50.0-RTE-preview"
|
|
263
|
+
}, {
|
|
264
|
+
"name": "eventSemantics",
|
|
265
|
+
"text": "namespace:native"
|
|
266
|
+
}],
|
|
267
|
+
"text": "An event emitter notifying a value change."
|
|
268
|
+
},
|
|
269
|
+
"complexType": {
|
|
270
|
+
"original": "VegaCodeBlockValue",
|
|
271
|
+
"resolved": "{ language?: \"css\" | \"html\" | \"js\" | \"jsx\" | \"plainText\" | \"ts\" | \"tsx\"; code: string; }",
|
|
272
|
+
"references": {
|
|
273
|
+
"VegaCodeBlockValue": {
|
|
274
|
+
"location": "import",
|
|
275
|
+
"path": "./types"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
"method": "vegaRemove",
|
|
281
|
+
"name": "vegaRemove",
|
|
282
|
+
"bubbles": true,
|
|
283
|
+
"cancelable": true,
|
|
284
|
+
"composed": true,
|
|
285
|
+
"docs": {
|
|
286
|
+
"tags": [{
|
|
287
|
+
"name": "vegaVersion",
|
|
288
|
+
"text": "2.50.0-RTE-preview"
|
|
289
|
+
}],
|
|
290
|
+
"text": "An event emitter notifying the deletion of the code block. By default, the element is removed from the page, but this behavior can be prevented."
|
|
291
|
+
},
|
|
292
|
+
"complexType": {
|
|
293
|
+
"original": "any",
|
|
294
|
+
"resolved": "any",
|
|
295
|
+
"references": {}
|
|
296
|
+
}
|
|
297
|
+
}, {
|
|
298
|
+
"method": "remove",
|
|
299
|
+
"name": "remove",
|
|
300
|
+
"bubbles": true,
|
|
301
|
+
"cancelable": true,
|
|
302
|
+
"composed": true,
|
|
303
|
+
"docs": {
|
|
304
|
+
"tags": [{
|
|
305
|
+
"name": "vegaVersion",
|
|
306
|
+
"text": "2.50.0-RTE-preview"
|
|
307
|
+
}, {
|
|
308
|
+
"name": "eventSemantics",
|
|
309
|
+
"text": "namespace:native"
|
|
310
|
+
}],
|
|
311
|
+
"text": "An event emitter notifying the deletion of the code block. By default, the element is removed from the page, but this behavior can be prevented."
|
|
312
|
+
},
|
|
313
|
+
"complexType": {
|
|
314
|
+
"original": "any",
|
|
315
|
+
"resolved": "any",
|
|
316
|
+
"references": {}
|
|
317
|
+
}
|
|
318
|
+
}]; }
|
|
319
|
+
static get methods() { return {
|
|
320
|
+
"doFocus": {
|
|
321
|
+
"complexType": {
|
|
322
|
+
"signature": "() => Promise<void>",
|
|
323
|
+
"parameters": [],
|
|
324
|
+
"references": {
|
|
325
|
+
"Promise": {
|
|
326
|
+
"location": "global"
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"return": "Promise<void>"
|
|
330
|
+
},
|
|
331
|
+
"docs": {
|
|
332
|
+
"text": "Invoke this method to focus the current code block.",
|
|
333
|
+
"tags": [{
|
|
334
|
+
"name": "vegaVersion",
|
|
335
|
+
"text": "2.50.0-RTE-preview"
|
|
336
|
+
}]
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}; }
|
|
340
|
+
static get elementRef() { return "host"; }
|
|
341
|
+
static get watchers() { return [{
|
|
342
|
+
"propName": "readOnly",
|
|
343
|
+
"methodName": "watchEditableChange"
|
|
344
|
+
}, {
|
|
345
|
+
"propName": "disabled",
|
|
346
|
+
"methodName": "watchEditableChange"
|
|
347
|
+
}]; }
|
|
348
|
+
}
|
|
349
|
+
__decorate([
|
|
350
|
+
InjectVegaGlobalSlimmer()
|
|
351
|
+
], VegaCodeBlock.prototype, "globalSlimmers", void 0);
|
|
352
|
+
__decorate([
|
|
353
|
+
InjectVegaSlimmer()
|
|
354
|
+
], VegaCodeBlock.prototype, "componentGlobalStyleSlimmer", void 0);
|
|
355
|
+
__decorate([
|
|
356
|
+
InjectVegaSlimmer()
|
|
357
|
+
], VegaCodeBlock.prototype, "translationSlimmer", void 0);
|
|
358
|
+
__decorate([
|
|
359
|
+
InjectVegaSlimmer()
|
|
360
|
+
], VegaCodeBlock.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
|
|
361
|
+
__decorate([
|
|
362
|
+
InjectVegaSlimmer()
|
|
363
|
+
], VegaCodeBlock.prototype, "codeBlockRenderer", void 0);
|
|
364
|
+
__decorate([
|
|
365
|
+
InjectVegaSlimmer()
|
|
366
|
+
], VegaCodeBlock.prototype, "contentRenderer", void 0);
|
|
367
|
+
__decorate([
|
|
368
|
+
InjectVegaSlimmer()
|
|
369
|
+
], VegaCodeBlock.prototype, "copyButtonRenderer", void 0);
|
|
370
|
+
__decorate([
|
|
371
|
+
InjectVegaSlimmer()
|
|
372
|
+
], VegaCodeBlock.prototype, "valueController", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
InjectVegaSlimmer()
|
|
375
|
+
], VegaCodeBlock.prototype, "contentParseController", void 0);
|
|
376
|
+
__decorate([
|
|
377
|
+
InjectVegaSlimmer()
|
|
378
|
+
], VegaCodeBlock.prototype, "prismCodeHighlightParser", void 0);
|
|
379
|
+
__decorate([
|
|
380
|
+
InjectVegaSlimmer()
|
|
381
|
+
], VegaCodeBlock.prototype, "defaultCodeHighlightParser", void 0);
|
|
382
|
+
__decorate([
|
|
383
|
+
InjectVegaSlimmer()
|
|
384
|
+
], VegaCodeBlock.prototype, "selectionController", void 0);
|
|
385
|
+
__decorate([
|
|
386
|
+
InjectVegaSlimmer()
|
|
387
|
+
], VegaCodeBlock.prototype, "inputController", void 0);
|
|
388
|
+
__decorate([
|
|
389
|
+
InjectVegaSlimmer()
|
|
390
|
+
], VegaCodeBlock.prototype, "focusController", void 0);
|
|
391
|
+
__decorate([
|
|
392
|
+
InjectVegaSlimmer()
|
|
393
|
+
], VegaCodeBlock.prototype, "changeEventEmitter", void 0);
|
|
394
|
+
__decorate([
|
|
395
|
+
InjectVegaSlimmer()
|
|
396
|
+
], VegaCodeBlock.prototype, "removeEventEmitter", void 0);
|
|
397
|
+
__decorate([
|
|
398
|
+
InjectVegaSlimmer()
|
|
399
|
+
], VegaCodeBlock.prototype, "eventPreventSlimmer", void 0);
|
|
@@ -15,7 +15,7 @@ export class VegaInputSelectDropdownRenderer extends VegaSlimmer {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
this.renderContainer = () => {
|
|
18
|
-
return (h("div", { role: 'button', class: "vega-input-select-container", ref: (ref) => (this.inputSelectContainer = ref), tabIndex: 0, "aria-disabled": `${this.disabled}`, onKeyDown: createEnterKeyHandlerToTriggerClick(), onBlur: this.preventBlur },
|
|
18
|
+
return (h("div", { role: 'button', class: "vega-input-select-container", ref: (ref) => (this.inputSelectContainer = ref), tabIndex: 0, "aria-disabled": `${this.disabled}`, onKeyDown: createEnterKeyHandlerToTriggerClick(), onBlur: this.preventBlur, part: "select-container" },
|
|
19
19
|
this.renderPrefixIcon(),
|
|
20
20
|
this.renderSelectContainer(),
|
|
21
21
|
this.renderToggleIcon()));
|
|
@@ -24,8 +24,8 @@ export class VegaInputSelectDropdownRenderer extends VegaSlimmer {
|
|
|
24
24
|
return this.vegaInputSelectPrefixIconRenderer.render();
|
|
25
25
|
};
|
|
26
26
|
this.renderToggleIcon = () => {
|
|
27
|
-
return (h("div", { class: "vega-input-select-toggle-icon" },
|
|
28
|
-
h("vega-icon", { icon: VegaInternalIconManager.getIconKey(this.isDropdownShow ? 'chevron-up' : 'chevron-down') })));
|
|
27
|
+
return (h("div", { class: "vega-input-select-toggle-icon", part: "toggle-icon-container" },
|
|
28
|
+
h("vega-icon", { part: "toggle-icon", icon: VegaInternalIconManager.getIconKey(this.isDropdownShow ? 'chevron-up' : 'chevron-down') })));
|
|
29
29
|
};
|
|
30
30
|
this.renderSelectContainer = () => {
|
|
31
31
|
return (h("div", { class: "vega-input-select-select-container" },
|
|
@@ -44,10 +44,10 @@ export class VegaInputSelectDropdownRenderer extends VegaSlimmer {
|
|
|
44
44
|
this.renderSingleSelected = () => {
|
|
45
45
|
const item = this.sourceController.getItem(this.value);
|
|
46
46
|
if (item) {
|
|
47
|
-
return h("span", { class: "vega-input-select-selected" }, item.displayName);
|
|
47
|
+
return (h("span", { class: "vega-input-select-selected", part: "selected-box" }, item.displayName));
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
return (h("div", { class: "vega-input-select-placeholder" }, this.translationSlimmer.t(this.placeholder)));
|
|
50
|
+
return (h("div", { class: "vega-input-select-placeholder", part: "placeholder" }, this.translationSlimmer.t(this.placeholder)));
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
this.getVegaDropdownProperties = () => {
|
|
@@ -12,10 +12,12 @@ import RTETextBlockRenderer from '../../../vega-rich-text-editor/dto/renderers/b
|
|
|
12
12
|
import RTEImageBlockRenderer from '../../../vega-rich-text-editor/dto/renderers/blocks/image-block-renderer';
|
|
13
13
|
import RTEListBlockRenderer from '../../../vega-rich-text-editor/dto/renderers/blocks/list-block-renderer';
|
|
14
14
|
import { VegaRTEContent } from '../../../vega-rich-text-editor/dto/content-state';
|
|
15
|
+
import RTECodeBlockRenderer from '../../../vega-rich-text-editor/dto/renderers/blocks/code-block-renderer';
|
|
15
16
|
export class VegaRichTextContentRenderer extends VegaSlimmer {
|
|
16
17
|
constructor() {
|
|
17
18
|
super();
|
|
18
19
|
this.blockRenderers = [
|
|
20
|
+
RTECodeBlockRenderer,
|
|
19
21
|
RTETextBlockRenderer,
|
|
20
22
|
RTEImageBlockRenderer,
|
|
21
23
|
RTEListBlockRenderer,
|
|
@@ -115,14 +115,11 @@
|
|
|
115
115
|
vertical-align: bottom;
|
|
116
116
|
cursor: pointer;
|
|
117
117
|
}
|
|
118
|
-
:host .rich-text-content ul
|
|
118
|
+
:host .rich-text-content ul.v-rte--list,
|
|
119
|
+
:host .rich-text-content ol.v-rte--list {
|
|
119
120
|
padding-left: 8px;
|
|
120
121
|
margin-left: 16px;
|
|
121
122
|
}
|
|
122
|
-
:host .rich-text-content ol {
|
|
123
|
-
padding-left: 8px;
|
|
124
|
-
list-style-position: inside;
|
|
125
|
-
}
|
|
126
123
|
:host .rich-text-content .link-editor-wrapper {
|
|
127
124
|
position: relative;
|
|
128
125
|
outline: 2px solid transparent;
|
|
@@ -133,4 +130,62 @@
|
|
|
133
130
|
bottom: 0;
|
|
134
131
|
left: 0;
|
|
135
132
|
right: 0;
|
|
133
|
+
}
|
|
134
|
+
:host .rich-text-content .code-block-container {
|
|
135
|
+
margin-top: 22px;
|
|
136
|
+
margin-bottom: 22px;
|
|
137
|
+
}
|
|
138
|
+
:host .rich-text-content vega-code-block.focus {
|
|
139
|
+
outline: none;
|
|
140
|
+
}
|
|
141
|
+
:host .rich-text-content .v-rte--bold {
|
|
142
|
+
font-weight: 700;
|
|
143
|
+
}
|
|
144
|
+
:host .rich-text-content .v-rte--italic {
|
|
145
|
+
font-style: italic;
|
|
146
|
+
}
|
|
147
|
+
:host .rich-text-content .v-rte--image-size-sm {
|
|
148
|
+
width: 25%;
|
|
149
|
+
}
|
|
150
|
+
:host .rich-text-content .v-rte--image-size-md {
|
|
151
|
+
width: 50%;
|
|
152
|
+
}
|
|
153
|
+
:host .rich-text-content .v-rte--image-size-lg {
|
|
154
|
+
width: 100%;
|
|
155
|
+
}
|
|
156
|
+
:host .rich-text-content .v-rte--text-style-paragraph {
|
|
157
|
+
font-family: "Inter";
|
|
158
|
+
font-size: 16px;
|
|
159
|
+
line-height: 22px;
|
|
160
|
+
font-weight: 500;
|
|
161
|
+
}
|
|
162
|
+
:host .rich-text-content .v-rte--text-style-title {
|
|
163
|
+
font-family: "Inter";
|
|
164
|
+
font-size: 36px;
|
|
165
|
+
line-height: 40px;
|
|
166
|
+
font-weight: 500;
|
|
167
|
+
}
|
|
168
|
+
:host .rich-text-content .v-rte--text-style-subtitle {
|
|
169
|
+
font-family: "Inter";
|
|
170
|
+
font-size: 28px;
|
|
171
|
+
line-height: 32px;
|
|
172
|
+
font-weight: 500;
|
|
173
|
+
}
|
|
174
|
+
:host .rich-text-content .v-rte--text-style-heading-1 {
|
|
175
|
+
font-family: "Inter";
|
|
176
|
+
font-size: 22px;
|
|
177
|
+
line-height: 24px;
|
|
178
|
+
font-weight: 500;
|
|
179
|
+
}
|
|
180
|
+
:host .rich-text-content .v-rte--text-style-heading-2 {
|
|
181
|
+
font-family: "Inter";
|
|
182
|
+
font-size: 20px;
|
|
183
|
+
line-height: 24px;
|
|
184
|
+
font-weight: 500;
|
|
185
|
+
}
|
|
186
|
+
:host .rich-text-content .v-rte--text-style-heading-3 {
|
|
187
|
+
font-family: "Inter";
|
|
188
|
+
font-size: 18px;
|
|
189
|
+
line-height: 22px;
|
|
190
|
+
font-weight: 500;
|
|
136
191
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M64 464c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H224v80c0 17.7 14.3 32 32 32h80V448c0 8.8-7.2 16-16 16H64zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V154.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0H64zm97 289c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L79 303c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-31-31 31-31zM257 255c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9l-48-48z"/></svg>`,
|
|
3
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill='currentColor' d="M320.1 175L384.1 239C394.3 248.4 394.3 263.6 384.1 272.1L320.1 336.1C311.6 346.3 296.4 346.3 287 336.1C277.7 327.6 277.7 312.4 287 303L334.1 256L287 208.1C277.7 199.6 277.7 184.4 287 175C296.4 165.7 311.6 165.7 320.1 175V175zM177.9 256L224.1 303C234.3 312.4 234.3 327.6 224.1 336.1C215.6 346.3 200.4 346.3 191 336.1L127 272.1C117.7 263.6 117.7 248.4 127 239L191 175C200.4 165.7 215.6 165.7 224.1 175C234.3 184.4 234.3 199.6 224.1 208.1L177.9 256zM448 32C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H448zM448 80H64C55.16 80 48 87.16 48 96V416C48 424.8 55.16 432 64 432H448C456.8 432 464 424.8 464 416V96C464 87.16 456.8 80 448 80z"/></svg>`,
|
|
3
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { LogUtility } from '../../../../utils/log';
|
|
2
|
+
import { CommonAnnotationTypeEnum } from '../annotations/common-annotation.abstract';
|
|
3
|
+
import { CustomStyleAnnotation } from '../annotations/custom-style-annotation';
|
|
2
4
|
/**
|
|
3
5
|
* The base action handle strategy class, use to modify the rich text node content or modify the annotation.
|
|
4
6
|
*/
|
|
@@ -61,4 +63,26 @@ export class ActionHandleStrategy {
|
|
|
61
63
|
const lastNode = target.nodes[target.nodes.length - 1];
|
|
62
64
|
return node === lastNode && startOffset === 1;
|
|
63
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Update the custom style annotation of a block or node
|
|
68
|
+
*
|
|
69
|
+
* @param {RTEBlock | RTETextNode} item - block or node
|
|
70
|
+
* @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
|
|
71
|
+
*/
|
|
72
|
+
updateCustomStyleAnnotation(item, styleKeys) {
|
|
73
|
+
const customStyleAnnotation = item.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_STYLE);
|
|
74
|
+
if (customStyleAnnotation && this.isCustomStyle(customStyleAnnotation, styleKeys)) {
|
|
75
|
+
item.annotationMap.set(customStyleAnnotation.type, new CustomStyleAnnotation(customStyleAnnotation.removeStyles(styleKeys)));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Determines if the custom style annotation includes any the custom style.
|
|
80
|
+
*
|
|
81
|
+
* @param {CustomStyleAnnotation} customStyleAnnotation - custom style annotation
|
|
82
|
+
* @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
|
|
83
|
+
* @returns {boolean} - True if the custom key includes the custom style, false otherwise.
|
|
84
|
+
*/
|
|
85
|
+
isCustomStyle(customStyleAnnotation, styleKeys) {
|
|
86
|
+
return styleKeys.some((item) => Object.keys(customStyleAnnotation.customStyle).includes(item));
|
|
87
|
+
}
|
|
64
88
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Update the text block and image block horizontal alignment strategy.
|
|
4
|
+
*/
|
|
5
|
+
export class BlockUpdateHorizontalAlignmentStrategy extends ActionHandleStrategy {
|
|
6
|
+
/**
|
|
7
|
+
* Updating the horizontal alignment of a block requires cascading updates to the custom style.
|
|
8
|
+
*
|
|
9
|
+
* @param {HorizontalAlignmentAnnotationAction} _action - The horizontal alignment annotation action.
|
|
10
|
+
* @param {RTETextBlock} target - The current text block.
|
|
11
|
+
*/
|
|
12
|
+
handleAction(_action, target) {
|
|
13
|
+
this.updateCustomStyleAnnotation(target, ['textAlign']);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Update the text block and image block horizontal alignment strategy.
|
|
4
|
+
*/
|
|
5
|
+
export class BlockUpdateIndentStrategy extends ActionHandleStrategy {
|
|
6
|
+
/**
|
|
7
|
+
* Updating the indent of a block requires cascading updates to the custom style.
|
|
8
|
+
*
|
|
9
|
+
* @param {IndentAnnotationAction} _action - The indent annotation action.
|
|
10
|
+
* @param {RTETextBlock} target - The current text block.
|
|
11
|
+
*/
|
|
12
|
+
handleAction(_action, target) {
|
|
13
|
+
this.updateCustomStyleAnnotation(target, ['marginLeft']);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -28,5 +28,6 @@ export class BlockUpdateTextStyleStrategy extends ActionHandleStrategy {
|
|
|
28
28
|
node.apply(new DeleteNodeAnnotationAction(NodeAnnotationTypeEnum.BOLD));
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
+
this.updateCustomStyleAnnotation(target, ['fontFamily', 'lineHeight', 'fontWeight', 'fontSize']);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InternalAnnotationTypeEnum } from '../../annotations/annotation.abstract';
|
|
2
|
+
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
3
|
+
/**
|
|
4
|
+
* Update the code block node annotation map strategy.
|
|
5
|
+
*/
|
|
6
|
+
export class CodeNodeSetSelectionRangeAnnotationStrategy extends ActionHandleStrategy {
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
*/
|
|
10
|
+
handleAction(action, target) {
|
|
11
|
+
target.annotationMap.set(InternalAnnotationTypeEnum.SELECTION_RANGE, action.toAnnotation());
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { isNonNullable } from '../../../../../types/type-guard';
|
|
2
|
+
import { BoldAnnotationAction } from '../../actions/bold-annotation-action';
|
|
2
3
|
import { ClearFormattingAnnotationAction } from '../../actions/clear-formatting-annotation-action';
|
|
3
4
|
import { CodeAnnotationAction } from '../../actions/code-annotation-action';
|
|
4
5
|
import { DeleteNodeAnnotationAction } from '../../actions/delete-node-annotation-action';
|
|
6
|
+
import { ItalicAnnotationAction } from '../../actions/italic-annotation-action';
|
|
5
7
|
import { LinkAnnotationAction } from '../../actions/link-annotation-action';
|
|
6
8
|
import { LinkGroupAnnotationAction } from '../../actions/link-group-annotation-action';
|
|
9
|
+
import { StrikethroughAnnotationAction } from '../../actions/strikethrough-annotation-action';
|
|
10
|
+
import { UnderlineAnnotationAction } from '../../actions/underline-annotation-action';
|
|
7
11
|
import { ClearFormattingAnnotation } from '../../annotations/clear-formatting-annotation';
|
|
8
12
|
import { NodeAnnotation } from '../../annotations/node-annotation.abstract';
|
|
9
13
|
import { SelectionRangeAnnotation } from '../../annotations/selection-range-annotation';
|
|
@@ -40,6 +44,16 @@ export class NodeUpdateAnnotationMapStrategy extends ActionHandleStrategy {
|
|
|
40
44
|
if (action instanceof CodeAnnotationAction) {
|
|
41
45
|
this.handleAction(new ClearFormattingAnnotationAction(), target);
|
|
42
46
|
}
|
|
47
|
+
if (action instanceof BoldAnnotationAction) {
|
|
48
|
+
this.updateCustomStyleAnnotation(target, ['fontWeight']);
|
|
49
|
+
}
|
|
50
|
+
if (action instanceof ItalicAnnotationAction) {
|
|
51
|
+
this.updateCustomStyleAnnotation(target, ['fontStyle']);
|
|
52
|
+
}
|
|
53
|
+
if (action instanceof UnderlineAnnotationAction ||
|
|
54
|
+
action instanceof StrikethroughAnnotationAction) {
|
|
55
|
+
this.updateCustomStyleAnnotation(target, ['textDecoration']);
|
|
56
|
+
}
|
|
43
57
|
target.annotationMap.set(annotation.type, annotation);
|
|
44
58
|
return;
|
|
45
59
|
}
|
|
@@ -52,7 +52,9 @@ export class BlockDeleteTextContentStrategy extends BlockDeleteNodeContentStrate
|
|
|
52
52
|
if (startContainerNode.isEmpty()) {
|
|
53
53
|
target.apply(new RemoveChildAction(startContainerNode));
|
|
54
54
|
}
|
|
55
|
-
previousNode.parentBlock.
|
|
55
|
+
if (target.type === previousNode.parentBlock.type) {
|
|
56
|
+
previousNode.parentBlock.apply(new MergeTwoBlocksNodesAction(target));
|
|
57
|
+
}
|
|
56
58
|
}
|
|
57
59
|
else {
|
|
58
60
|
if (this.isContentFirstNode(startContainerNode) && startContainerNode.isEmpty()) {
|