@heartlandone/vega 2.67.0 → 2.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-ab28f910.js → app-globals-f7106a22.js} +15 -14
- package/dist/cjs/{child-nodes-event-prevent-slimmer-eb803b14.js → child-nodes-event-prevent-slimmer-f8840f1b.js} +1 -1
- package/dist/cjs/{code-block-ab97a0a0.js → code-block-39074880.js} +514 -319
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-5630341e.js → component-value-history-controller-slimmer.abstract-ddedf543.js} +2 -2
- package/dist/cjs/{design-token-847739f1.js → design-token-e14a4e66.js} +1 -1
- package/dist/cjs/{dto-renderer-manager-d0f0f2c0.js → dto-renderer-manager-b7969d6c.js} +1587 -1563
- package/dist/cjs/{element-appender-slimmer-aead9bbb.js → element-appender-slimmer-7ee27ab3.js} +5 -5
- package/dist/cjs/{event-emit-slimmer-d21a0935.js → event-emit-slimmer-7afe8d78.js} +1 -1
- package/dist/cjs/{token-extension-aa8d5cce.js → function-extension-f0e845f2.js} +1019 -96
- package/dist/cjs/{image-annotation-action-d84de785.js → image-annotation-action-7f0626c8.js} +15 -25
- package/dist/cjs/index.cjs.js +36 -24
- package/dist/cjs/{internal-vega-event-manager-4d1ce667.js → internal-vega-event-manager-45d451de.js} +5 -2
- package/dist/cjs/{language-extension-d257e65d.js → language-extension-d0103d1a.js} +5 -5
- package/dist/cjs/loader.cjs.js +8 -8
- package/dist/cjs/{public-rules-d2b9b8f0.js → public-rules-8b67eaba.js} +3 -3
- package/dist/cjs/{range-d610028e.js → range-002671b6.js} +1 -1
- package/dist/cjs/{responsive-format-facade-71e7b74c.js → responsive-format-facade-347db035.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-a8fe5f50.js → rich-text-editor-required-rule-5392bd8a.js} +1 -1
- package/dist/cjs/{style-formatter-6facb42b.js → style-formatter-0a09f0dd.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +7 -7
- package/dist/cjs/vega-app-header-button.cjs.entry.js +8 -8
- package/dist/cjs/vega-banner.cjs.entry.js +2 -2
- package/dist/cjs/vega-box.cjs.entry.js +8 -8
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-circle.cjs.entry.js +9 -9
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-link.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +8 -8
- package/dist/cjs/vega-calendar_4.cjs.entry.js +307 -269
- package/dist/cjs/vega-card.cjs.entry.js +7 -7
- package/dist/cjs/vega-carousel.cjs.entry.js +7 -7
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-chip.cjs.entry.js +9 -9
- package/dist/cjs/vega-code-block.cjs.entry.js +6 -6
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +12 -12
- package/dist/cjs/vega-dialog_2.cjs.entry.js +15 -15
- package/dist/cjs/vega-divider.cjs.entry.js +7 -7
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +9 -9
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +24 -5
- package/dist/cjs/vega-file-uploader.cjs.entry.js +2 -2
- package/dist/cjs/vega-flag-icon.cjs.entry.js +6 -6
- package/dist/cjs/vega-flex.cjs.entry.js +8 -8
- package/dist/cjs/vega-font.cjs.entry.js +7 -7
- package/dist/cjs/vega-form.cjs.entry.js +3 -3
- package/dist/cjs/vega-grid.cjs.entry.js +7 -7
- package/dist/cjs/vega-icon.cjs.entry.js +6 -6
- package/dist/cjs/vega-image-uploader.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-passcode.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +38 -14
- package/dist/cjs/vega-input.cjs.entry.js +14 -3
- package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -2
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +7 -7
- package/dist/cjs/vega-popover_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +2 -2
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +93 -16
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +107 -54
- package/dist/cjs/vega-segment-control.cjs.entry.js +2 -2
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +10 -10
- package/dist/cjs/vega-signature-capture.cjs.entry.js +7 -7
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -3
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-table_8.cjs.entry.js +11 -11
- package/dist/cjs/vega-textarea.cjs.entry.js +24 -4
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +7 -7
- package/dist/cjs/vega.cjs.js +8 -8
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/calendar-event-sorter.js +3 -3
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/timed-event/layout/day-view-timed-event-layout-column.js +1 -1
- package/dist/collection/components/vega-calendar/vega-calendar-event/slimmers/renderers/vega-calendar-event-renderer.js +3 -4
- package/dist/collection/components/vega-field-label/slimmers/renderers/vega-field-label-suffix-element-renderer.js +11 -3
- package/dist/collection/components/vega-field-label/vega-field-label.js +42 -0
- package/dist/collection/components/vega-input/vega-input.js +48 -2
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-renderer.js +16 -5
- package/dist/collection/components/vega-input-select/vega-input-select.css +2 -44
- package/dist/collection/components/vega-input-select/vega-input-select.js +81 -1
- package/dist/collection/components/vega-rich-text-content/slimmers/controllers/vega-rich-text-content-extensions-styles-controller.js +60 -0
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +7 -1
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +17 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor-registry.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.js +30 -6
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +10 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/paste-content-strategy.js +28 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/paste-content-action.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation-style.js +87 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +27 -9
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +1 -12
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +14 -5
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +7 -37
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +14 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +19 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +44 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +51 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-interceptor/prevent-new-paragraph-interceptor.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-interceptor/prevent-paste-content-interceptor.js +25 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/function-block-insert-paragraph-strategy.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/insert-function-block-strategy.js +99 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/paste-plain-text-strategy.js +68 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/actions/insert-function-block-action.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/actions/paste-plain-text-action.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.js +73 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-block-strategy.js +49 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-content-strategy.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-logic-control-block-strategy.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +75 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-block-renderer.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +71 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/logic-control-block-renderer.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +5 -6
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/public-api.js +8 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +9 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +0 -12
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +12 -10
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bold-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +30 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/clear-style-toolbar-button-slimmer.js +1 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +10 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/horizontal-alignment/horizontal-alignment-toolbar-button-slimmer.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/image-toolbar-button-slimmer.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/italic-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/less-indent-toolbar-button-slimmer.js +1 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +1 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/more-indent-toolbar-button-slimmer.js +1 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/strikethrough-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +2 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/underline-toolbar-button-slimmer.js +2 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/action-handle-strategy-registry.test.js +32 -2
- package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-delete-node-content-strategy.test.js +69 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotation-style.test.js +70 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.css +3 -0
- package/dist/collection/components/vega-selection-chip/vega-selection-chip.js +1 -1
- package/dist/collection/components/vega-table/vega-table.css +2 -1
- package/dist/collection/components/vega-textarea/vega-textarea.js +88 -2
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/calendar/calendar-date-time.js +136 -0
- package/dist/collection/helpers/calendar/calendar-date.js +10 -4
- package/dist/collection/helpers/calendar/calendar-event.js +38 -193
- package/dist/collection/helpers/calendar/calendar-time.js +120 -0
- package/dist/collection/helpers/calendar/index.js +2 -0
- package/dist/collection/helpers/calendar/test/calendar-date-time.test.js +27 -0
- package/dist/collection/helpers/calendar/test/calendar-event.test.js +24 -22
- package/dist/collection/helpers/calendar/test/calendar-period/day-period.test.js +2 -2
- package/dist/collection/helpers/calendar/test/calendar-period/month-period.test.js +2 -2
- package/dist/collection/helpers/calendar/test/calendar-period/week-period.test.js +6 -6
- package/dist/collection/helpers/calendar/test/calendar-time.test.js +45 -0
- package/dist/collection/helpers/calendar/test/utils.test.js +1 -29
- package/dist/collection/helpers/calendar/utils.js +0 -66
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +5 -2
- package/dist/collection/helpers/rte-manager/dto-action-strategy-manager.js +2 -0
- package/dist/esm/{app-globals-37a60cc1.js → app-globals-2f689986.js} +6 -5
- package/dist/esm/{child-nodes-event-prevent-slimmer-735cb880.js → child-nodes-event-prevent-slimmer-76331524.js} +1 -1
- package/dist/esm/{code-block-11b2bc1c.js → code-block-e8839202.js} +511 -318
- package/dist/esm/{component-value-history-controller-slimmer.abstract-16c5cb96.js → component-value-history-controller-slimmer.abstract-c6f94113.js} +2 -2
- package/dist/esm/{design-token-297dc528.js → design-token-e9e6b011.js} +1 -1
- package/dist/esm/{dto-renderer-manager-a1a3b6d2.js → dto-renderer-manager-7abc53bf.js} +1587 -1565
- package/dist/esm/{element-appender-slimmer-f7233708.js → element-appender-slimmer-8dbc8387.js} +2 -2
- package/dist/esm/{event-emit-slimmer-28fd360c.js → event-emit-slimmer-4e28e9f8.js} +1 -1
- package/dist/esm/{token-extension-b690953f.js → function-extension-eb1d062f.js} +1018 -97
- package/dist/esm/{image-annotation-action-fc46c920.js → image-annotation-action-7957653a.js} +14 -24
- package/dist/esm/index.js +9 -9
- package/dist/esm/{internal-vega-event-manager-a5a5938d.js → internal-vega-event-manager-516aa721.js} +5 -2
- package/dist/esm/{language-extension-314a2b18.js → language-extension-3331131f.js} +3 -3
- package/dist/esm/loader.js +8 -8
- package/dist/esm/{public-rules-c6a6946d.js → public-rules-e613dead.js} +3 -3
- package/dist/esm/{range-b78254de.js → range-adf206fd.js} +1 -1
- package/dist/esm/{responsive-format-facade-a41e1be7.js → responsive-format-facade-b0712993.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-d50c24da.js → rich-text-editor-required-rule-43857573.js} +1 -1
- package/dist/esm/{style-formatter-f7effaac.js → style-formatter-a20a1ef4.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +7 -7
- package/dist/esm/vega-app-header-button.entry.js +8 -8
- package/dist/esm/vega-banner.entry.js +2 -2
- package/dist/esm/vega-box.entry.js +8 -8
- package/dist/esm/vega-breadcrumb.entry.js +3 -3
- package/dist/esm/vega-button-circle.entry.js +9 -9
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button-link.entry.js +3 -3
- package/dist/esm/vega-button.entry.js +8 -8
- package/dist/esm/vega-calendar_4.entry.js +307 -269
- package/dist/esm/vega-card.entry.js +7 -7
- package/dist/esm/vega-carousel.entry.js +7 -7
- package/dist/esm/vega-checkbox_2.entry.js +3 -3
- package/dist/esm/vega-chip.entry.js +9 -9
- package/dist/esm/vega-code-block.entry.js +6 -6
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +8 -8
- package/dist/esm/vega-dialog_2.entry.js +9 -9
- package/dist/esm/vega-divider.entry.js +7 -7
- package/dist/esm/vega-dropdown_5.entry.js +9 -9
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +24 -5
- package/dist/esm/vega-file-uploader.entry.js +2 -2
- package/dist/esm/vega-flag-icon.entry.js +6 -6
- package/dist/esm/vega-flex.entry.js +8 -8
- package/dist/esm/vega-font.entry.js +7 -7
- package/dist/esm/vega-form.entry.js +3 -3
- package/dist/esm/vega-grid.entry.js +7 -7
- package/dist/esm/vega-icon.entry.js +6 -6
- package/dist/esm/vega-image-uploader.entry.js +7 -7
- package/dist/esm/vega-input-credit-card.entry.js +3 -3
- package/dist/esm/vega-input-numeric.entry.js +3 -3
- package/dist/esm/vega-input-passcode.entry.js +3 -3
- package/dist/esm/vega-input-phone-number.entry.js +6 -6
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +38 -14
- package/dist/esm/vega-input.entry.js +14 -3
- package/dist/esm/vega-item-toggle.entry.js +2 -2
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +6 -6
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +7 -7
- package/dist/esm/vega-popover_2.entry.js +9 -9
- package/dist/esm/vega-progress-tracker.entry.js +2 -2
- package/dist/esm/vega-radio_2.entry.js +3 -3
- package/dist/esm/vega-rich-text-content.entry.js +93 -16
- package/dist/esm/vega-rich-text-editor_4.entry.js +107 -54
- package/dist/esm/vega-segment-control.entry.js +2 -2
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +3 -3
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +3 -3
- package/dist/esm/vega-tab-group_2.entry.js +3 -3
- package/dist/esm/vega-table_8.entry.js +8 -8
- package/dist/esm/vega-textarea.entry.js +25 -5
- package/dist/esm/vega-time-picker_2.entry.js +9 -9
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +7 -7
- package/dist/esm/vega.js +8 -8
- package/dist/sri/vega-sri-manifest.json +273 -273
- package/dist/types/components/vega-field-label/slimmers/renderers/vega-field-label-suffix-element-renderer.d.ts +1 -0
- package/dist/types/components/vega-field-label/types.d.ts +12 -0
- package/dist/types/components/vega-field-label/vega-field-label.d.ts +13 -1
- package/dist/types/components/vega-input/vega-input.d.ts +14 -2
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-renderer.d.ts +3 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +25 -0
- package/dist/types/components/vega-rich-text-content/slimmers/controllers/vega-rich-text-content-extensions-styles-controller.d.ts +26 -0
- package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor-registry.d.ts +42 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-interceptor.abstract.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.d.ts +9 -2
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/paste-content-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/paste-content-action.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation-style.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +10 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +0 -11
- package/dist/types/components/vega-rich-text-editor/extensions/base-extension-renderer.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +19 -3
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +36 -3
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-interceptor/prevent-new-paragraph-interceptor.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-interceptor/prevent-paste-content-interceptor.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/function-block-insert-paragraph-strategy.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/insert-function-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/action-handler-strategies/paste-plain-text-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/actions/insert-function-block-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/actions/paste-plain-text-action.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +58 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.d.ts +55 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +48 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-block-strategy.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-function-content-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/element-to-dto-strategies/div-to-logic-control-block-strategy.d.ts +32 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/function-block-renderer.d.ts +25 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.d.ts +33 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/logic-control-block-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-extension.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +3 -4
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +8 -2
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +8 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +2 -11
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-delete-node-content-strategy.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/test/dto/annotation-style.test.d.ts +1 -0
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +26 -0
- package/dist/types/components.d.ts +65 -3
- package/dist/types/helpers/calendar/calendar-date-time.d.ts +76 -0
- package/dist/types/helpers/calendar/calendar-event.d.ts +18 -57
- package/dist/types/helpers/calendar/calendar-time.d.ts +64 -0
- package/dist/types/helpers/calendar/index.d.ts +2 -0
- package/dist/types/helpers/calendar/test/calendar-date-time.test.d.ts +1 -0
- package/dist/types/helpers/calendar/test/calendar-time.test.d.ts +1 -0
- package/dist/types/helpers/calendar/utils.d.ts +0 -25
- package/dist/types/types/components.type.d.ts +1 -1
- package/dist/types/types/public-api.d.ts +2 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-6f7d42a0.entry.js → p-00376f71.entry.js} +1 -1
- package/dist/vega/p-018d70a5.js +1 -0
- package/dist/vega/p-0849f85e.js +1 -0
- package/dist/vega/{p-b431f9d5.entry.js → p-0a55f984.entry.js} +1 -1
- package/dist/vega/p-0f7dec29.entry.js +1 -0
- package/dist/vega/{p-47cae62d.entry.js → p-113d305b.entry.js} +1 -1
- package/dist/vega/{p-015cdbe7.entry.js → p-115b42e6.entry.js} +1 -1
- package/dist/vega/p-16358fec.entry.js +1 -0
- package/dist/vega/{p-af5bfe34.js → p-16d68187.js} +1 -1
- package/dist/vega/{p-92a22562.entry.js → p-18e8c54a.entry.js} +1 -1
- package/dist/vega/{p-6f6ccf67.entry.js → p-1922303e.entry.js} +1 -1
- package/dist/vega/{p-74d61782.entry.js → p-19256107.entry.js} +1 -1
- package/dist/vega/{p-59298f5e.entry.js → p-1dcb1fcd.entry.js} +2 -2
- package/dist/vega/{p-7f69081b.entry.js → p-1dd7f8b2.entry.js} +1 -1
- package/dist/vega/{p-d006e732.entry.js → p-22fe8c61.entry.js} +1 -1
- package/dist/vega/{p-524693d8.entry.js → p-238afe1b.entry.js} +1 -1
- package/dist/vega/p-240d9d35.entry.js +1 -0
- package/dist/vega/{p-b82d3915.entry.js → p-24419ebe.entry.js} +1 -1
- package/dist/vega/p-2478f65e.js +1 -0
- package/dist/vega/{p-358e9800.entry.js → p-2c945862.entry.js} +1 -1
- package/dist/vega/{p-5f58d1da.entry.js → p-2e32fbe6.entry.js} +1 -1
- package/dist/vega/p-2f04d2ac.js +1 -0
- package/dist/vega/{p-a73dc4b3.entry.js → p-30a8d9d6.entry.js} +1 -1
- package/dist/vega/{p-e6cccee4.js → p-369810ae.js} +1 -1
- package/dist/vega/p-3ad87199.entry.js +1 -0
- package/dist/vega/{p-fe2e859f.entry.js → p-3b800f1b.entry.js} +1 -1
- package/dist/vega/p-437f865f.js +1 -0
- package/dist/vega/{p-de624f7d.entry.js → p-48bc03fa.entry.js} +1 -1
- package/dist/vega/{p-46830028.entry.js → p-54ddd06f.entry.js} +1 -1
- package/dist/vega/{p-5a0524ab.entry.js → p-56636a58.entry.js} +1 -1
- package/dist/vega/{p-fc8c5869.entry.js → p-56f77466.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-ab1001f5.entry.js → p-61d9cdf9.entry.js} +1 -1
- package/dist/vega/{p-39b9c57b.entry.js → p-626246b4.entry.js} +1 -1
- package/dist/vega/{p-ff3bb4e2.entry.js → p-634499cb.entry.js} +1 -1
- package/dist/vega/p-6609d87e.entry.js +1 -0
- package/dist/vega/p-69d27eaf.entry.js +1 -0
- package/dist/vega/{p-7efb5ebe.entry.js → p-705dad87.entry.js} +1 -1
- package/dist/vega/{p-8d574fbd.entry.js → p-75b5894f.entry.js} +1 -1
- package/dist/vega/{p-00071542.entry.js → p-76b1dae4.entry.js} +1 -1
- package/dist/vega/{p-54b62ecf.js → p-7747c163.js} +1 -1
- package/dist/vega/{p-0ed53cce.entry.js → p-787caad3.entry.js} +1 -1
- package/dist/vega/{p-129c0ce1.js → p-79e6e12c.js} +1 -1
- package/dist/vega/{p-cc519f53.entry.js → p-7dde3be9.entry.js} +1 -1
- package/dist/vega/p-8233d814.entry.js +1 -0
- package/dist/vega/{p-5e32866d.entry.js → p-83a50ac2.entry.js} +1 -1
- package/dist/vega/p-8506e8c3.js +1 -0
- package/dist/vega/{p-47fa359b.js → p-85407fb9.js} +1 -1
- package/dist/vega/{p-892cbe7c.entry.js → p-880569ec.entry.js} +1 -1
- package/dist/vega/{p-0113a83c.entry.js → p-8dba59a6.entry.js} +1 -1
- package/dist/vega/p-94e167b8.entry.js +1 -0
- package/dist/vega/{p-b2aaab66.entry.js → p-98fb9eaa.entry.js} +1 -1
- package/dist/vega/{p-3288a65b.entry.js → p-99bf5993.entry.js} +1 -1
- package/dist/vega/p-a211ae63.js +1 -0
- package/dist/vega/{p-fef846d5.entry.js → p-a2506cb5.entry.js} +1 -1
- package/dist/vega/{p-4e33fff6.entry.js → p-a6fb5a40.entry.js} +1 -1
- package/dist/vega/{p-bee1cc34.entry.js → p-b5060e84.entry.js} +1 -1
- package/dist/vega/{p-616cd622.entry.js → p-b78670c9.entry.js} +1 -1
- package/dist/vega/{p-d5761532.entry.js → p-b8558278.entry.js} +1 -1
- package/dist/vega/{p-8d655fd2.entry.js → p-bb0f2b5f.entry.js} +1 -1
- package/dist/vega/{p-a7631c6b.js → p-bb37a401.js} +1 -1
- package/dist/vega/p-bccee21e.js +1 -0
- package/dist/vega/{p-2553031f.entry.js → p-bd0e55a2.entry.js} +1 -1
- package/dist/vega/{p-65693321.entry.js → p-c0223a17.entry.js} +1 -1
- package/dist/vega/{p-2d430dc4.entry.js → p-c26332ae.entry.js} +1 -1
- package/dist/vega/{p-7f9ec104.entry.js → p-c54148fb.entry.js} +1 -1
- package/dist/vega/{p-276b1163.entry.js → p-d3905af1.entry.js} +2 -2
- package/dist/vega/p-d4893487.js +1 -0
- package/dist/vega/{p-d1dacaeb.entry.js → p-d67200e8.entry.js} +1 -1
- package/dist/vega/{p-725f0a2c.js → p-db57dddc.js} +1 -1
- package/dist/vega/{p-ed8bc4f0.entry.js → p-de02f404.entry.js} +1 -1
- package/dist/vega/{p-d4452dbc.entry.js → p-de8c5fae.entry.js} +1 -1
- package/dist/vega/{p-7b145620.js → p-de97c6d9.js} +1 -1
- package/dist/vega/{p-34800282.entry.js → p-e0979451.entry.js} +1 -1
- package/dist/vega/{p-1a3cb65e.entry.js → p-e6351dab.entry.js} +1 -1
- package/dist/vega/{p-8d096fea.entry.js → p-f0fb3fdd.entry.js} +1 -1
- package/dist/vega/{p-ea05a2fc.entry.js → p-f3399ef1.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-019f7f95.js +0 -1
- package/dist/vega/p-03a1e82e.entry.js +0 -1
- package/dist/vega/p-0d1eca78.entry.js +0 -1
- package/dist/vega/p-16370cfb.js +0 -1
- package/dist/vega/p-3a7f177a.entry.js +0 -1
- package/dist/vega/p-41c3fcb4.js +0 -1
- package/dist/vega/p-81105691.entry.js +0 -1
- package/dist/vega/p-822c6092.js +0 -1
- package/dist/vega/p-8edf3513.js +0 -1
- package/dist/vega/p-a1b7a179.entry.js +0 -1
- package/dist/vega/p-ab8f99e9.entry.js +0 -1
- package/dist/vega/p-bf7f755b.js +0 -1
- package/dist/vega/p-bf9476cd.entry.js +0 -1
- package/dist/vega/p-c6ce2869.js +0 -1
- package/dist/vega/p-d0e6454e.entry.js +0 -1
- package/dist/vega/p-d88e88a7.js +0 -1
- package/dist/vega/p-f360c9ba.js +0 -1
|
@@ -77,9 +77,7 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
77
77
|
if (currentBlockIndex > 0) {
|
|
78
78
|
return currentBlock.parent.children[currentBlockIndex - 1];
|
|
79
79
|
}
|
|
80
|
-
else if ((currentBlock.parent
|
|
81
|
-
currentBlock.parent['type'] === 'bullet-list') &&
|
|
82
|
-
currentBlockIndex === 0) {
|
|
80
|
+
else if (this.isRTEBlock(currentBlock.parent) && currentBlockIndex === 0) {
|
|
83
81
|
return this.getPreviousBlock(currentBlock.parent);
|
|
84
82
|
}
|
|
85
83
|
}
|
|
@@ -130,4 +128,13 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
130
128
|
}
|
|
131
129
|
}
|
|
132
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Checks if the given instance is not the root content block.
|
|
133
|
+
*
|
|
134
|
+
* @param {RTEBlock | VegaRTEContent} block - The instance to check.
|
|
135
|
+
* @returns {boolean} True if the block is not the root content block, false otherwise.
|
|
136
|
+
*/
|
|
137
|
+
isRTEBlock(block) {
|
|
138
|
+
return block && block.constructor.name !== 'VegaRTEContent';
|
|
139
|
+
}
|
|
133
140
|
}
|
|
@@ -101,7 +101,8 @@ export class BlockDeleteTextOrDecoratorNodeStrategy extends BlockDeleteNodeConte
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
//Remove the paragraph block if the content is empty
|
|
104
|
+
// Remove the paragraph block if the content is empty
|
|
105
|
+
// TODO: Check whether need to remove below logic because already handled the same logic in remove node strategy
|
|
105
106
|
if (target.children.length === 0) {
|
|
106
107
|
target.parent.apply(new RemoveChildrenAction(target));
|
|
107
108
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InsertChildrenAfterAction } from '../../actions/insert-children-after-block';
|
|
2
|
+
import { InsertChildrenBeforeAction } from '../../actions/insert-children-before-block';
|
|
3
|
+
import { SplitBlockWithNodeAction } from '../../actions/split-block-with-node-action';
|
|
4
|
+
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
5
|
+
/**
|
|
6
|
+
* Strategy to handle the paste content into function block.
|
|
7
|
+
*/
|
|
8
|
+
export class PasteContentStrategy extends ActionHandleStrategy {
|
|
9
|
+
/**
|
|
10
|
+
* @inheritDoc
|
|
11
|
+
*/
|
|
12
|
+
handleAction(action, target) {
|
|
13
|
+
if (target.parent) {
|
|
14
|
+
const { blocksToBeInserted, startNode, startOffset } = action;
|
|
15
|
+
let futureFocusBlock = target;
|
|
16
|
+
if (startNode === target.children[0] && startOffset === 0) {
|
|
17
|
+
target.parent.apply(new InsertChildrenBeforeAction(target, ...blocksToBeInserted));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const breakAction = new SplitBlockWithNodeAction(startNode, startOffset);
|
|
21
|
+
target.apply(breakAction);
|
|
22
|
+
target.parent.apply(new InsertChildrenAfterAction(target, ...blocksToBeInserted));
|
|
23
|
+
futureFocusBlock = breakAction.newBlock;
|
|
24
|
+
}
|
|
25
|
+
action.futureFocusBlock = futureFocusBlock;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -29,6 +29,7 @@ export var ModifyContentActionType;
|
|
|
29
29
|
ModifyContentActionType["UPDATE_CURSOR_POSITION"] = "UPDATE_CURSOR_POSITION";
|
|
30
30
|
ModifyContentActionType["INSERT_TEXT_TO_DECORATOR_NODE"] = "INSERT_TEXT_TO_DECORATOR_NODE";
|
|
31
31
|
ModifyContentActionType["INSERT_NODE_TO_NEAREST_ROOT"] = "INSERT_NODE_TO_NEAREST_ROOT";
|
|
32
|
+
ModifyContentActionType["PASTE_CONTENT"] = "PASTE_CONTENT";
|
|
32
33
|
})(ModifyContentActionType || (ModifyContentActionType = {}));
|
|
33
34
|
/**
|
|
34
35
|
* Abstract class for update node content, delete node, insert node
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ModifyContentAction, ModifyContentActionType } from './modify-content-action.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Action to paste new content into current block.
|
|
4
|
+
*
|
|
5
|
+
* @example functionBlock.apply(new PasteContentAction(blocksToBeInserted, startNode, startOffset))
|
|
6
|
+
* @example host.value.apply(new PasteContentAction(blocksToBeInserted, startNode, startOffset))
|
|
7
|
+
*/
|
|
8
|
+
export class PasteContentAction extends ModifyContentAction {
|
|
9
|
+
constructor(blocksToBeInserted, startNode, startOffset, rteRange) {
|
|
10
|
+
super();
|
|
11
|
+
this.type = ModifyContentActionType.PASTE_CONTENT;
|
|
12
|
+
this.blocksToBeInserted = blocksToBeInserted;
|
|
13
|
+
this.startNode = startNode;
|
|
14
|
+
this.startOffset = startOffset;
|
|
15
|
+
this.rteRange = rteRange;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -14,10 +14,15 @@ export class UpdateCursorPositionAction extends ModifyContentAction {
|
|
|
14
14
|
*/
|
|
15
15
|
constructor(nextFocusNode, offset, immediatelyRun = false) {
|
|
16
16
|
super();
|
|
17
|
+
this.isFlushable = true;
|
|
17
18
|
this.type = ModifyContentActionType.UPDATE_CURSOR_POSITION;
|
|
18
19
|
this.immediatelyRun = false;
|
|
19
20
|
this.nextFocusNode = nextFocusNode;
|
|
20
21
|
this.offset = offset;
|
|
21
22
|
this.immediatelyRun = immediatelyRun;
|
|
23
|
+
// Don't flush changes if we want to immediately run the cursor update. Usually the current value is the latest value.
|
|
24
|
+
if (this.immediatelyRun) {
|
|
25
|
+
this.isFlushable = false;
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { isNonNullable } from '../../../../types/type-guard';
|
|
2
|
+
import { camelToDashCase } from '../../../../utils/string';
|
|
3
|
+
import { RTEBlock } from '../blocks/block.abstract';
|
|
4
|
+
import { BlockAnnotation } from './block-annotation.abstract';
|
|
5
|
+
import { CustomStyleAnnotation } from './custom-style-annotation';
|
|
6
|
+
import { NodeAnnotation } from './node-annotation.abstract';
|
|
7
|
+
/**
|
|
8
|
+
* Class to handle the style representation of annotations for RTE blocks and nodes.
|
|
9
|
+
*/
|
|
10
|
+
export class RTEAnnotationStyle {
|
|
11
|
+
constructor(dto) {
|
|
12
|
+
this.dtoType = dto instanceof RTEBlock ? 'block' : 'node';
|
|
13
|
+
this.annotationMap = dto.annotationMap;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Convert an AnnotationStyle object to a CSS text string.
|
|
17
|
+
*
|
|
18
|
+
* @param {RTERenderContext} options - Rendering context options.
|
|
19
|
+
* @param {string[]} canMergeKeyList - List of style keys that can be merged by concatenation.
|
|
20
|
+
* @param {Nullable<AnnotationStyle>} annotationStyle - The annotation style object, if null, get from toJSON().
|
|
21
|
+
* @returns {string} A string representing the CSS text.
|
|
22
|
+
*/
|
|
23
|
+
toCssText(options = { standalone: false }, canMergeKeyList, annotationStyle) {
|
|
24
|
+
annotationStyle = annotationStyle ? annotationStyle : this.toJSON(options, canMergeKeyList);
|
|
25
|
+
return Object.entries(Object.assign({}, annotationStyle))
|
|
26
|
+
.map(([key, value]) => `${camelToDashCase(key)}: ${value};`)
|
|
27
|
+
.join('');
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Convert the annotation map to a JSON representation.
|
|
31
|
+
*
|
|
32
|
+
* @param {RTERenderContext} options - Rendering context options.
|
|
33
|
+
* @param {string[]} canMergeKeyList - List of style keys that can be merged by concatenation.
|
|
34
|
+
* @returns {AnnotationStyle} - The JSON representation of the annotation styles.
|
|
35
|
+
*/
|
|
36
|
+
toJSON(options = { standalone: false }, canMergeKeyList) {
|
|
37
|
+
const styles = Array.from(this.annotationMap.values())
|
|
38
|
+
.filter((annotation) => this.filterAnnotation(annotation) || annotation instanceof CustomStyleAnnotation)
|
|
39
|
+
.map((annotation) => annotation.renderStyle(options))
|
|
40
|
+
.filter(isNonNullable);
|
|
41
|
+
if (canMergeKeyList && canMergeKeyList.length > 0) {
|
|
42
|
+
return this.mergeAnnotationStyles(styles, canMergeKeyList);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return styles.reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Filter annotations based on whether they are block or node annotations.
|
|
50
|
+
*
|
|
51
|
+
* @param {RTENodeAnnotationMapValue | RTEBlockAnnotationMapValue} annotation - The annotation to filter.
|
|
52
|
+
* @returns {boolean} - True if the annotation matches the DTO type, false otherwise.
|
|
53
|
+
*/
|
|
54
|
+
filterAnnotation(annotation) {
|
|
55
|
+
return this.dtoType === 'block'
|
|
56
|
+
? annotation instanceof BlockAnnotation
|
|
57
|
+
: annotation instanceof NodeAnnotation;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Merge an array of annotation styles into a single style object.
|
|
61
|
+
* e.g.,
|
|
62
|
+
* { textDecoration: 'underline', textDecoration: 'line-through' }
|
|
63
|
+
* -> { textDecoration: 'underline line-through' }
|
|
64
|
+
*
|
|
65
|
+
* @param {AnnotationStyle[]} styles - Array of annotation style objects to merge.
|
|
66
|
+
* @param {string[]} canMergeKeyList - List of style keys that can be merged by concatenation.
|
|
67
|
+
* @returns {AnnotationStyle} - The merged annotation style object.
|
|
68
|
+
*/
|
|
69
|
+
mergeAnnotationStyles(styles, canMergeKeyList) {
|
|
70
|
+
const merged = {};
|
|
71
|
+
for (const style of styles) {
|
|
72
|
+
for (const key in style) {
|
|
73
|
+
const value = style[key];
|
|
74
|
+
const existing = merged[key];
|
|
75
|
+
if (typeof existing === 'string' &&
|
|
76
|
+
typeof value === 'string' &&
|
|
77
|
+
canMergeKeyList.includes(key)) {
|
|
78
|
+
merged[key] = Array.from(new Set(`${existing} ${value}`.split(/\s+/).filter(Boolean))).join(' ');
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
merged[key] = value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return merged;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -9,12 +9,13 @@ import { HorizontalAlignmentAnnotation } from '../annotations/horizontal-alignme
|
|
|
9
9
|
import { IndentAnnotation } from '../annotations/indent-annotation';
|
|
10
10
|
import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action-handle-strategy-registry';
|
|
11
11
|
import { isNonNullable } from '../../../../types/type-guard';
|
|
12
|
-
import { camelToDashCase } from '../../../../utils/string';
|
|
13
12
|
import { CustomAttributeAnnotation } from '../annotations/custom-attribute-annotation';
|
|
14
13
|
import { CustomClassAnnotation } from '../annotations/custom-class-annotation';
|
|
15
14
|
import { CommonAnnotation, CommonAnnotationTypeEnum } from '../annotations/common-annotation.abstract';
|
|
16
15
|
import { CustomStyleAnnotation } from '../annotations/custom-style-annotation';
|
|
17
16
|
import { InternalWrapperAnnotation } from '../annotations/internal-wrapper-annotation';
|
|
17
|
+
import RTEDTOClassManager from '../../../../helpers/rte-manager/dto-class-manager';
|
|
18
|
+
import { RTEAnnotationStyle } from '../annotations/annotation-style';
|
|
18
19
|
/**
|
|
19
20
|
* Abstract class for block
|
|
20
21
|
*/
|
|
@@ -32,6 +33,26 @@ export class RTEBlock {
|
|
|
32
33
|
static from(json, options) {
|
|
33
34
|
throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(json)}, ${options}) is not implemented. Please implement this method in the subclass.`);
|
|
34
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Generates block children from an array of VegaRTEContentBlock.
|
|
38
|
+
*
|
|
39
|
+
* @param {VegaRTEContentBlock[]} blockArray - The array of VegaRTEContentBlock to generate children from.
|
|
40
|
+
* @param {VegaRTETransformOptions} [options] - Optional transformation options.
|
|
41
|
+
* @param {VegaRTEContent | RTEBlock} [parentBlock] - Optional parent block.
|
|
42
|
+
* @returns {RTEBlock[]} An array of generated RTEBlock children.
|
|
43
|
+
*/
|
|
44
|
+
static generateBlockChildren(blockArray, options, parentBlock) {
|
|
45
|
+
return blockArray
|
|
46
|
+
.map((child) => {
|
|
47
|
+
const BlockClass = RTEDTOClassManager.getRTEBlockClass(child.type);
|
|
48
|
+
if (BlockClass) {
|
|
49
|
+
const block = BlockClass.from(child, options);
|
|
50
|
+
block.parent = parentBlock;
|
|
51
|
+
return block;
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
.filter(isNonNullable);
|
|
55
|
+
}
|
|
35
56
|
/**
|
|
36
57
|
* The function `createAnnotationEntity` creates a block annotation entity based on the provided type
|
|
37
58
|
* and value.
|
|
@@ -145,11 +166,9 @@ export class RTEBlock {
|
|
|
145
166
|
* @returns {AnnotationStyle} - Annotation styles
|
|
146
167
|
*/
|
|
147
168
|
getStyles(options = { standalone: false }) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.filter(isNonNullable)
|
|
152
|
-
.reduce((current, obj) => (Object.assign(Object.assign({}, current), obj)), {})), (this.shouldRenderAsInternalWrapper() ? { display: 'contents' } : {}));
|
|
169
|
+
const rteAnnotationStyle = new RTEAnnotationStyle(this);
|
|
170
|
+
const blockAnnotationStyle = rteAnnotationStyle.toJSON(options);
|
|
171
|
+
return Object.assign(Object.assign({}, blockAnnotationStyle), (this.shouldRenderAsInternalWrapper() ? { display: 'contents' } : {}));
|
|
153
172
|
}
|
|
154
173
|
/**
|
|
155
174
|
* Get classes from annotations
|
|
@@ -180,9 +199,8 @@ export class RTEBlock {
|
|
|
180
199
|
*/
|
|
181
200
|
generateAttributeString(...attrs) {
|
|
182
201
|
var _a;
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
.join('');
|
|
202
|
+
const blockAnnotationStyle = new RTEAnnotationStyle(this);
|
|
203
|
+
const styles = blockAnnotationStyle.toCssText({ standalone: true });
|
|
186
204
|
const customClassAnnotation = this.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_CLASS);
|
|
187
205
|
const customAttributeString = ((_a = this.getCustomAttributesAnnotation()) === null || _a === void 0 ? void 0 : _a.toString(attrs)) || [];
|
|
188
206
|
const attributes = [
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { RTEBlock } from './block.abstract';
|
|
2
|
-
import RTEDTOClassManager from '../../../../helpers/rte-manager/dto-class-manager';
|
|
3
|
-
import { isNonNullable } from '../../../../types/type-guard';
|
|
4
2
|
/**
|
|
5
3
|
* HTML Block
|
|
6
4
|
*/
|
|
@@ -24,16 +22,7 @@ export class RTEHtmlBlock extends RTEBlock {
|
|
|
24
22
|
if (annotations) {
|
|
25
23
|
super.convertAnnotationsToMap(htmlBlock.annotationMap, annotations);
|
|
26
24
|
}
|
|
27
|
-
htmlBlock.children = block.children
|
|
28
|
-
.map((child) => {
|
|
29
|
-
const BlockClass = RTEDTOClassManager.getRTEBlockClass(child.type);
|
|
30
|
-
if (BlockClass) {
|
|
31
|
-
const block = BlockClass.from(child, options);
|
|
32
|
-
block.parent = htmlBlock;
|
|
33
|
-
return block;
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
.filter(isNonNullable);
|
|
25
|
+
htmlBlock.children = this.generateBlockChildren(block.children, options, htmlBlock);
|
|
37
26
|
return htmlBlock;
|
|
38
27
|
}
|
|
39
28
|
/**
|
|
@@ -14,6 +14,10 @@ import { ListItemReplaceNestListStrategy } from '../action-handle-strategies/mod
|
|
|
14
14
|
import { BlockMergeNodesStrategy } from '../action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy';
|
|
15
15
|
import { ListItemInsertImageStrategy } from '../action-handle-strategies/modify-content-strategies/list-item-insert-image-strategy';
|
|
16
16
|
import { isNonNullable } from '../../../../types/type-guard';
|
|
17
|
+
import { TextStyleAnnotationAction } from '../actions/text-style-annotation-action';
|
|
18
|
+
import { BlockUpdateTextStyleStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy';
|
|
19
|
+
import { HorizontalAlignmentAnnotationAction } from '../actions/horizontal-alignment-annotation-action';
|
|
20
|
+
import { BlockUpdateHorizontalAlignmentStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy';
|
|
17
21
|
/**
|
|
18
22
|
* List item block
|
|
19
23
|
*/
|
|
@@ -116,6 +120,8 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
(() => {
|
|
123
|
+
ActionHandleStrategyRegistry.register(TextStyleAnnotationAction.name, RTEListItemBlock.name, new BlockUpdateTextStyleStrategy());
|
|
124
|
+
ActionHandleStrategyRegistry.register(HorizontalAlignmentAnnotationAction.name, RTEListItemBlock.name, new BlockUpdateHorizontalAlignmentStrategy());
|
|
119
125
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEListItemBlock.name, new BlockInsertLineBreakStrategy());
|
|
120
126
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEListItemBlock.name, new BlockInsertLineBreakWithBlocksStrategy());
|
|
121
127
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_NEST_LIST, RTEListItemBlock.name, new ListItemRemoveNestListStrategy());
|
|
@@ -140,11 +140,7 @@ export class RTETextBlock extends RTEBlock {
|
|
|
140
140
|
toHtml() {
|
|
141
141
|
const BlockTag = this.getBlockTag();
|
|
142
142
|
const attrStr = super.generateAttributeString();
|
|
143
|
-
const
|
|
144
|
-
let nodesHtml = this.children.map((node) => node.toHtml()).join('');
|
|
145
|
-
if (linkGroupAnnotation && this.children.length > 0) {
|
|
146
|
-
nodesHtml = this.generateLinkHtml(linkGroupAnnotation, nodesHtml);
|
|
147
|
-
}
|
|
143
|
+
const nodesHtml = this.getChildrenHtml();
|
|
148
144
|
return super.shouldRenderAsInternalWrapper()
|
|
149
145
|
? nodesHtml
|
|
150
146
|
: [`<${BlockTag}${attrStr}>`, nodesHtml, `</${BlockTag}>`].join('');
|
|
@@ -210,6 +206,19 @@ export class RTETextBlock extends RTEBlock {
|
|
|
210
206
|
return 'p';
|
|
211
207
|
}
|
|
212
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Get the HTML string for the children nodes, including handling link group annotations.
|
|
211
|
+
*
|
|
212
|
+
* @returns {string} The HTML string representing the children nodes.
|
|
213
|
+
*/
|
|
214
|
+
getChildrenHtml() {
|
|
215
|
+
const linkGroupAnnotation = this.getAnnotationByType(InternalAnnotationTypeEnum.LINK_GROUP);
|
|
216
|
+
let nodesHtml = this.children.map((node) => node.toHtml()).join('');
|
|
217
|
+
if (linkGroupAnnotation && this.children.length > 0) {
|
|
218
|
+
nodesHtml = this.generateLinkHtml(linkGroupAnnotation, nodesHtml);
|
|
219
|
+
}
|
|
220
|
+
return nodesHtml;
|
|
221
|
+
}
|
|
213
222
|
/**
|
|
214
223
|
* @inheritDoc
|
|
215
224
|
*/
|
|
@@ -14,6 +14,10 @@ import { RemoveChildrenStrategy } from './action-handle-strategies/modify-conten
|
|
|
14
14
|
import { AppendChildrenStrategy } from './action-handle-strategies/modify-content-strategies/append-children-strategy';
|
|
15
15
|
import { InsertChildrenBeforeStrategy } from './action-handle-strategies/modify-content-strategies/insert-children-before-strategy';
|
|
16
16
|
import { InsertChildrenAfterStrategy } from './action-handle-strategies/modify-content-strategies/insert-children-after-strategy';
|
|
17
|
+
import stateEntityRenderingRegistry from '../slimmers/controllers/state-entity-rendering-registry';
|
|
18
|
+
import changeManager from '../../../helpers/change-manager/change-manager';
|
|
19
|
+
import domNodeSubjectFactory from '../../../helpers/change-manager/subject/dom-node-subject/dom-node-subject-factory';
|
|
20
|
+
import { VegaInternalRichTextEditorFlushChanges } from '../../../helpers/event-manager/event-id/vega-internal-event-id';
|
|
17
21
|
import './setup';
|
|
18
22
|
import { StylePreservator } from '../../../helpers/csp/styles-preservator';
|
|
19
23
|
import { LogUtility } from '../../../utils/log';
|
|
@@ -146,6 +150,13 @@ export class VegaRTEContent {
|
|
|
146
150
|
*/
|
|
147
151
|
apply(action) {
|
|
148
152
|
ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
153
|
+
// Check if the action has been executed and is flushable
|
|
154
|
+
if (action['executedFlag'] && action.isFlushable) {
|
|
155
|
+
const host = stateEntityRenderingRegistry.getDOMByEntity(this);
|
|
156
|
+
if (host) {
|
|
157
|
+
changeManager.notify(domNodeSubjectFactory.getSubject(host, VegaInternalRichTextEditorFlushChanges), {});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
149
160
|
}
|
|
150
161
|
/**
|
|
151
162
|
* Get the last node in the content.
|
|
@@ -4,13 +4,13 @@ import domNodeSubjectFactory from '../../../../helpers/change-manager/subject/do
|
|
|
4
4
|
import { VegaInternalRichTextEditorFlushChanges } from '../../../../helpers/event-manager/event-id/vega-internal-event-id';
|
|
5
5
|
import { ModifyContentAction } from '../actions/modify-content-action.abstract';
|
|
6
6
|
import { NodeAnnotation } from '../annotations/node-annotation.abstract';
|
|
7
|
-
import { camelToDashCase } from '../../../../utils/string';
|
|
8
7
|
import { isNonNullable } from '../../../../types/type-guard';
|
|
9
8
|
import { CustomAttributeAnnotation } from '../annotations/custom-attribute-annotation';
|
|
10
9
|
import { CustomClassAnnotation } from '../annotations/custom-class-annotation';
|
|
11
10
|
import { CommonAnnotationTypeEnum } from '../annotations/common-annotation.abstract';
|
|
12
11
|
import { CustomStyleAnnotation } from '../annotations/custom-style-annotation';
|
|
13
12
|
import { methodPlaceholder } from 'vega-slimmer/core';
|
|
13
|
+
import { RTEAnnotationStyle } from '../annotations/annotation-style';
|
|
14
14
|
export var NodeTypeEnum;
|
|
15
15
|
(function (NodeTypeEnum) {
|
|
16
16
|
NodeTypeEnum["TEXT"] = "TEXT";
|
|
@@ -95,11 +95,8 @@ export class RTENode {
|
|
|
95
95
|
* @returns {AnnotationStyle} - Annotation styles
|
|
96
96
|
*/
|
|
97
97
|
getStyles(options = { standalone: false }) {
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
.map((annotation) => annotation.renderStyle(options))
|
|
101
|
-
.filter(Boolean);
|
|
102
|
-
return this.mergeAnnotationStyles(styles, ['textDecoration']);
|
|
98
|
+
const rteAnnotationStyle = new RTEAnnotationStyle(this);
|
|
99
|
+
return rteAnnotationStyle.toJSON(options, ['textDecoration']);
|
|
103
100
|
}
|
|
104
101
|
/**
|
|
105
102
|
* Get classes from annotations
|
|
@@ -146,9 +143,10 @@ export class RTENode {
|
|
|
146
143
|
*/
|
|
147
144
|
generateAttributeString(...attrs) {
|
|
148
145
|
var _a;
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
const nodeAnnotationStyle = new RTEAnnotationStyle(this);
|
|
147
|
+
const styles = nodeAnnotationStyle.toCssText({ standalone: true }, [
|
|
148
|
+
'textDecoration',
|
|
149
|
+
]);
|
|
152
150
|
const customClassAnnotation = this.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_CLASS);
|
|
153
151
|
const customAttributeString = ((_a = this.getCustomAttributesAnnotation()) === null || _a === void 0 ? void 0 : _a.toString(attrs)) || [];
|
|
154
152
|
const attributes = [
|
|
@@ -210,32 +208,4 @@ export class RTENode {
|
|
|
210
208
|
doModifyActionApply(action) {
|
|
211
209
|
methodPlaceholder(action);
|
|
212
210
|
}
|
|
213
|
-
/**
|
|
214
|
-
* Merge an array of annotation styles into a single style object.
|
|
215
|
-
* e.g.,
|
|
216
|
-
* { textDecoration: 'underline', textDecoration: 'line-through' }
|
|
217
|
-
* -> { textDecoration: 'underline line-through' }
|
|
218
|
-
*
|
|
219
|
-
* @param {AnnotationStyle[]} styles - Array of annotation style objects to merge.
|
|
220
|
-
* @param {string[]} canMergeKeyList - List of style keys that can be merged by concatenation.
|
|
221
|
-
* @returns {AnnotationStyle} - The merged annotation style object.
|
|
222
|
-
*/
|
|
223
|
-
mergeAnnotationStyles(styles, canMergeKeyList) {
|
|
224
|
-
const merged = {};
|
|
225
|
-
for (const style of styles) {
|
|
226
|
-
for (const key in style) {
|
|
227
|
-
const value = style[key];
|
|
228
|
-
const existing = merged[key];
|
|
229
|
-
if (typeof existing === 'string' &&
|
|
230
|
-
typeof value === 'string' &&
|
|
231
|
-
canMergeKeyList.includes(key)) {
|
|
232
|
-
merged[key] = Array.from(new Set(`${existing} ${value}`.split(/\s+/).filter(Boolean))).join(' ');
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
merged[key] = value;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return merged;
|
|
240
|
-
}
|
|
241
211
|
}
|
|
@@ -31,6 +31,13 @@ import { LinkGroupNodeSplitStrategy } from '../action-handle-strategies/modify-c
|
|
|
31
31
|
import { DeleteLinkGroupStrategy } from '../action-handle-strategies/modify-content-strategies/delete-link-group-strategy';
|
|
32
32
|
import { PlainTextAnnotation } from '../annotations/plain-text-annotation';
|
|
33
33
|
import { LinkAnnotationAction } from '../actions/link-annotation-action';
|
|
34
|
+
import { BoldAnnotationAction } from '../actions/bold-annotation-action';
|
|
35
|
+
import { ClearFormattingAnnotationAction } from '../actions/clear-formatting-annotation-action';
|
|
36
|
+
import { ItalicAnnotationAction } from '../actions/italic-annotation-action';
|
|
37
|
+
import { UnderlineAnnotationAction } from '../actions/underline-annotation-action';
|
|
38
|
+
import { TextColorAnnotationAction } from '../actions/text-color-annotation-action';
|
|
39
|
+
import { StrikethroughAnnotationAction } from '../actions/strikethrough-annotation-action';
|
|
40
|
+
import { CodeAnnotationAction } from '../actions/code-annotation-action';
|
|
34
41
|
/**
|
|
35
42
|
* Text node
|
|
36
43
|
*/
|
|
@@ -217,6 +224,13 @@ export class RTETextNode extends RTENode {
|
|
|
217
224
|
}
|
|
218
225
|
ActionHandleStrategyRegistry.register(TextSplittableAction.name, dtoClassName, new NodeSplitTextStrategy());
|
|
219
226
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.DELETE_LINK_GROUP, dtoClassName, new DeleteLinkGroupStrategy());
|
|
227
|
+
ActionHandleStrategyRegistry.register(BoldAnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
228
|
+
ActionHandleStrategyRegistry.register(ClearFormattingAnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
229
|
+
ActionHandleStrategyRegistry.register(ItalicAnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
230
|
+
ActionHandleStrategyRegistry.register(UnderlineAnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
231
|
+
ActionHandleStrategyRegistry.register(TextColorAnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
232
|
+
ActionHandleStrategyRegistry.register(StrikethroughAnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
233
|
+
ActionHandleStrategyRegistry.register(CodeAnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
220
234
|
ActionHandleStrategyRegistry.register(AnnotationAction.name, dtoClassName, new NodeUpdateAnnotationMapStrategy());
|
|
221
235
|
RTETextNode.registerActionStrategyStatus[dtoClassName] = true;
|
|
222
236
|
}
|
|
@@ -267,9 +281,6 @@ export class RTETextNode extends RTENode {
|
|
|
267
281
|
/**
|
|
268
282
|
* 1. Try to get the specific strategy for the action and node type first (e.g., LinkAnnotationAction on RTETextNode).
|
|
269
283
|
* 2. If no specific strategy found, try to get the generic NodeUpdateAnnotationMapStrategy for AnnotationAction on RTETextNode.
|
|
270
|
-
*
|
|
271
|
-
* This is useful when we want to check if there is a specific strategy for an action-node combination first, we can use the specific strategy to check if the special toolbar button should be enabled or disabled.
|
|
272
|
-
* TODO: Update the other annotation actions to follow this pattern. https://gethired.atlassian.net/browse/VD-7367
|
|
273
284
|
*/
|
|
274
285
|
const strategy = ActionHandleStrategyRegistry.get(action.constructor.name, node.constructor.name);
|
|
275
286
|
if (strategy) {
|
package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js
CHANGED
|
@@ -6,6 +6,15 @@ import stateEntityRenderingRegistry from '../slimmers/controllers/state-entity-r
|
|
|
6
6
|
* Base renderer for Vega Rich Text Editor.
|
|
7
7
|
*/
|
|
8
8
|
export class VegaRTEExtensionRenderer extends VegaRTEBaseRenderer {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the styles to be injected into the RTE scope.
|
|
11
|
+
* Override this method to provide custom styles for the custom blocks or nodes.
|
|
12
|
+
*
|
|
13
|
+
* @returns {string} - The styles as a string.
|
|
14
|
+
*/
|
|
15
|
+
injectRTEScopeStyles() {
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
9
18
|
/**
|
|
10
19
|
* Renders the given data as a DOM element.
|
|
11
20
|
*
|
|
@@ -34,6 +43,15 @@ export class VegaRTEExtensionRenderer extends VegaRTEBaseRenderer {
|
|
|
34
43
|
}
|
|
35
44
|
};
|
|
36
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Get a registered renderer by its key.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} key - The key of the renderer.
|
|
50
|
+
* @returns {Nullable<BaseRenderer>} - The registered renderer or null if not found.
|
|
51
|
+
*/
|
|
52
|
+
getDTORenderer(key) {
|
|
53
|
+
return RTEDTORendererManager.getRTERenderer(key);
|
|
54
|
+
}
|
|
37
55
|
/**
|
|
38
56
|
* Auto render the block children if the block element is not exist
|
|
39
57
|
*
|
|
@@ -62,7 +80,7 @@ export class VegaRTEExtensionRenderer extends VegaRTEBaseRenderer {
|
|
|
62
80
|
* @returns {Nullable<VegaRTERenderResult>} - The rendered DOM element.
|
|
63
81
|
*/
|
|
64
82
|
renderChildren(renderData, rteContext, createElement) {
|
|
65
|
-
const renderer =
|
|
83
|
+
const renderer = this.getDTORenderer(renderData.type);
|
|
66
84
|
if (renderer) {
|
|
67
85
|
return renderer.render(renderData, rteContext, createElement);
|
|
68
86
|
}
|
package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js
CHANGED
|
@@ -33,7 +33,7 @@ export class VegaRTEToolbarButtonRenderer {
|
|
|
33
33
|
* @returns {VegaRTERenderResult} - The render result for the dropdown.
|
|
34
34
|
*/
|
|
35
35
|
renderDropdown(h, editorContext, dropdownProps, children) {
|
|
36
|
-
return h('vega-dropdown', Object.assign({ trigger: 'click', searchable: false,
|
|
36
|
+
return h('vega-dropdown', Object.assign({ trigger: 'click', searchable: false, maxWidth: '200', itemDisplayRule: 'ellipsis',
|
|
37
37
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
38
38
|
ref: (el) => {
|
|
39
39
|
DomNodeSubjectObserverFactory.addUniqueObserverToNode(el, VegaDropdownClick, (input) => this.handleDropdownClick(input.detail, editorContext));
|
|
@@ -43,7 +43,7 @@ export class VegaRTEToolbarButtonRenderer {
|
|
|
43
43
|
* Renders the dropdown list template.
|
|
44
44
|
*
|
|
45
45
|
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
46
|
-
* @param {RTEDropdownListItem[]} itemList - The list of dropdown items.
|
|
46
|
+
* @param {(RTEDropdownListItem | RTEDropdownListGroup)[]} itemList - The list of dropdown items.
|
|
47
47
|
* @returns {VegaRTERenderResult} - The render result for the dropdown list.
|
|
48
48
|
*/
|
|
49
49
|
renderDropdownListTemplate(h, itemList) {
|
|
@@ -51,7 +51,9 @@ export class VegaRTEToolbarButtonRenderer {
|
|
|
51
51
|
slot: 'items',
|
|
52
52
|
onMouseDown: this.preventDefault,
|
|
53
53
|
}, itemList.map((item) => {
|
|
54
|
-
return
|
|
54
|
+
return 'children' in item
|
|
55
|
+
? this.renderDropdownGroup(h, item)
|
|
56
|
+
: this.renderDropdownItem(h, item);
|
|
55
57
|
}));
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
@@ -69,6 +71,24 @@ export class VegaRTEToolbarButtonRenderer {
|
|
|
69
71
|
prefixIcon: item.icon,
|
|
70
72
|
});
|
|
71
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Renders a dropdown item for the toolbar button.
|
|
76
|
+
*
|
|
77
|
+
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
78
|
+
* @param {RTEDropdownListGroup} item - The dropdown group.
|
|
79
|
+
* @returns {VegaRTERenderResult} - The render result for the dropdown item.
|
|
80
|
+
*/
|
|
81
|
+
renderDropdownGroup(h, item) {
|
|
82
|
+
return h('vega-dropdown-group', {
|
|
83
|
+
key: item.key,
|
|
84
|
+
label: item.label,
|
|
85
|
+
divide: false,
|
|
86
|
+
}, item.children.map((child) => {
|
|
87
|
+
return 'children' in child
|
|
88
|
+
? this.renderDropdownGroup(h, child)
|
|
89
|
+
: this.renderDropdownItem(h, child);
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
72
92
|
/**
|
|
73
93
|
* Renders a common toolbar button with optional icon, label, and arrow icon.
|
|
74
94
|
*
|
|
@@ -147,4 +167,25 @@ export class VegaRTEToolbarButtonRenderer {
|
|
|
147
167
|
preventDefault(e) {
|
|
148
168
|
e.preventDefault();
|
|
149
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Recursively searches for a dropdown list item by its key.
|
|
172
|
+
*
|
|
173
|
+
* @param {(RTEDropdownListItem | RTEDropdownListGroup)[]} itemList The list of dropdown items or groups to search through.
|
|
174
|
+
* @param {string} key The key of the item to find.
|
|
175
|
+
* @returns {Nullable<RTEDropdownListItem>} The dropdown list item if found, otherwise null.
|
|
176
|
+
*/
|
|
177
|
+
getListItemByKey(itemList, key) {
|
|
178
|
+
for (const item of itemList) {
|
|
179
|
+
if ('children' in item) {
|
|
180
|
+
const foundItem = this.getListItemByKey(item.children, key);
|
|
181
|
+
if (foundItem) {
|
|
182
|
+
return foundItem;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else if (item.key === key) {
|
|
186
|
+
return item;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
150
191
|
}
|