@globalpayments/vega 2.99.0 → 2.101.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/{accessibility-88f8af84.js → accessibility-6ca2a237.js} +21 -0
- package/dist/cjs/{action-color-accessibility-validator-b8a9ef0f.js → action-color-accessibility-validator-61af71ae.js} +1 -1
- package/dist/cjs/{app-globals-a306dce6.js → app-globals-275ea7c7.js} +19 -10
- package/dist/cjs/{aria-attributes-value-mapper-9a41b9cf.js → aria-attributes-value-mapper-e8c6b0e0.js} +1 -1
- package/dist/cjs/{aria-dialog-focusable-trap-slimmer-62147489.js → aria-dialog-focusable-trap-slimmer-c79cc3f8.js} +1 -1
- package/dist/cjs/{child-nodes-event-prevent-slimmer-e0ac8467.js → child-nodes-event-prevent-slimmer-d720d7e9.js} +1 -1
- package/dist/cjs/{code-block-ea1f5eb3.js → code-block-c598832d.js} +815 -751
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-7071b064.js → component-value-history-controller-slimmer.abstract-4bd47aa1.js} +4 -4
- package/dist/cjs/{content-state-8d07d530.js → content-state-da23e822.js} +47 -3
- package/dist/cjs/countries-a8e3812a.js +251 -0
- package/dist/cjs/{dark-mode-style-controller-f3da3342.js → dark-mode-style-controller-ec04ece9.js} +45 -45
- package/dist/cjs/{date-required-rule-c0c498ad.js → date-required-rule-45c802d3.js} +1 -1
- package/dist/cjs/{design-token-58bf7fe8.js → design-token-9d762da0.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-a0269315.js → element-appender-slimmer-2aaf8e24.js} +22 -3
- package/dist/cjs/{event-emit-slimmer-34aa195e.js → event-emit-slimmer-67b5c186.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-f73f200e.js → form-field-controller-slimmer-ac9337f4.js} +3 -3
- package/dist/cjs/{image-annotation-action-2a28038e.js → image-annotation-action-378838c2.js} +8 -7
- package/dist/cjs/{image-extension-9659708b.js → image-extension-673ebe7f.js} +2 -2
- package/dist/cjs/index.cjs.js +24 -21
- package/dist/cjs/{inject-keyboard-manager-4fa45f9c.js → inject-keyboard-manager-540f0876.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-6196bc80.js → internal-calendar-period-factory-b11918ee.js} +1 -1
- package/dist/cjs/{internal-translation-controller-51f7f865.js → internal-translation-controller-27bfc8c7.js} +15 -0
- package/dist/cjs/{internal-vega-event-manager-7003c84a.js → internal-vega-event-manager-976b9526.js} +10 -2
- package/dist/cjs/{keyboard-manager-482fe257.js → keyboard-manager-16e96b62.js} +12 -5
- package/dist/cjs/{keyboard-manager-slimmer-a19430dd.js → keyboard-manager-slimmer-0a4e556d.js} +1 -1
- package/dist/cjs/{link-extension-11340e1c.js → link-extension-f493e432.js} +3 -3
- package/dist/cjs/loader.cjs.js +17 -16
- package/dist/cjs/{month-view-generator-1a534451.js → month-view-generator-0a3e04de.js} +1 -1
- package/dist/cjs/overlay-escape-coordination-901d8942.js +38 -0
- package/dist/cjs/{public-rules-6c77b545.js → public-rules-bae12c47.js} +9 -9
- package/dist/cjs/{range-22ddd452.js → range-9f42fb40.js} +1 -1
- package/dist/cjs/{responsive-format-facade-74e6d791.js → responsive-format-facade-c6d7f0a1.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-09d1093a.js → rich-text-editor-required-rule-bb232741.js} +1 -1
- package/dist/cjs/{split-cell-operation-11bfb305.js → split-cell-operation-0d33123e.js} +4 -4
- package/dist/cjs/{state-border-formatter-bf4f9f1c.js → state-border-formatter-dda9109a.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-bf37b14c.js → string-format-strategy.abstract-3a968a59.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-ffeb18a6.js → string-input-formatter-slimmer-2e0a838e.js} +3 -3
- package/dist/cjs/{string-mask-strategy-7f394726.js → string-mask-strategy-d9f85c21.js} +2 -2
- package/dist/cjs/{style-formatter-4ac63910.js → style-formatter-d21a9784.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-e264a120.js → sub-state-notify-slimmer-3b33e31c.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-6033b824.js → sub-state-observer-slimmer-5b68ba3f.js} +1 -1
- package/dist/cjs/{time-required-rule-e2a50003.js → time-required-rule-580cbd3d.js} +1 -1
- package/dist/cjs/{token-extension-4686cb3b.js → token-extension-4badb962.js} +811 -53
- package/dist/cjs/{translation-slimmer-e4997f8f.js → translation-slimmer-31cd5a57.js} +1 -1
- package/dist/cjs/{type-guard-b8d7bb3f.js → type-guard-00b8efc0.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-f5a6f009.js → valid-credit-card-number-rule-70885128.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +9 -9
- package/dist/cjs/vega-app-footer.cjs.entry.js +4 -4
- package/dist/cjs/vega-app-header-button.cjs.entry.js +10 -10
- package/dist/cjs/vega-banner.cjs.entry.js +4 -4
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- 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 -12
- package/dist/cjs/vega-button-group_2.cjs.entry.js +20 -13
- package/dist/cjs/vega-button-link.cjs.entry.js +8 -8
- package/dist/cjs/vega-button.cjs.entry.js +27 -11
- package/dist/cjs/vega-calendar_5.cjs.entry.js +130 -24
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +7 -7
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-chip.cjs.entry.js +10 -10
- package/dist/cjs/vega-code-block.cjs.entry.js +15 -15
- package/dist/cjs/vega-color-picker.cjs.entry.js +8 -8
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +9 -9
- package/dist/cjs/vega-color-swatch.cjs.entry.js +6 -6
- package/dist/cjs/vega-combo-box.cjs.entry.js +15 -15
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +22 -22
- package/dist/cjs/vega-dialog_2.cjs.entry.js +76 -10
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +108 -25
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-58afed7a.js → vega-event-id-987a170c.js} +2 -0
- package/dist/cjs/vega-field-label.cjs.entry.js +29 -36
- package/dist/cjs/vega-file-uploader.cjs.entry.js +9 -9
- package/dist/cjs/vega-flag-icon.cjs.entry.js +11 -11
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +9 -9
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +12 -12
- package/dist/cjs/vega-input-numeric.cjs.entry.js +12 -12
- package/dist/cjs/vega-input-passcode.cjs.entry.js +11 -11
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +56 -275
- package/dist/cjs/vega-input-range.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-select.cjs.entry.js +39 -39
- package/dist/cjs/vega-input.cjs.entry.js +14 -14
- package/dist/cjs/{vega-internal-event-id-f4d33037.js → vega-internal-event-id-98d499d7.js} +6 -2
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +14 -14
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +2 -2
- 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 +9 -9
- package/dist/cjs/vega-popover_2.cjs.entry.js +63 -14
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-radio_2.cjs.entry.js +12 -12
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +16 -13
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +712 -250
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +8 -8
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +161 -108
- package/dist/cjs/vega-segment-control.cjs.entry.js +11 -4
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +12 -12
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +10 -10
- package/dist/cjs/vega-signature-capture.cjs.entry.js +12 -12
- package/dist/cjs/vega-stepper.cjs.entry.js +8 -8
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-table_11.cjs.entry.js +625 -666
- package/dist/cjs/vega-textarea.cjs.entry.js +8 -8
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +16 -16
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +8 -8
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +7 -7
- package/dist/cjs/vega.cjs.js +17 -16
- package/dist/cjs/{wait-for-component-did-render-44d006ee.js → wait-for-component-did-render-90edbc1a.js} +1 -1
- package/dist/collection/components/vega-button/vega-button.css +3 -3
- package/dist/collection/components/vega-button/vega-button.js +17 -2
- package/dist/collection/components/vega-button-circle/vega-button-circle.css +3 -3
- package/dist/collection/components/vega-button-group/vega-button-group-item/slimmers/renderers/vega-button-group-item-renderer.js +13 -6
- package/dist/collection/components/vega-button-link/vega-button-link.css +4 -4
- package/dist/collection/components/vega-button-link/vega-button-link.js +2 -2
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.js +45 -5
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.js +43 -1
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.js +23 -4
- package/dist/collection/components/vega-calendar/vega-calendar.js +77 -1
- package/dist/collection/components/vega-code-block/vega-code-block.css +4 -4
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-keyboard-controller.js +148 -0
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-scrollable-controller.js +5 -2
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-renderer.js +17 -0
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +2 -2
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.css +2 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +1 -1
- package/dist/collection/components/vega-field-label/slimmers/renderers/vega-field-label-label-announcement-renderer.js +21 -30
- package/dist/collection/components/vega-field-label/vega-field-label.js +7 -5
- package/dist/collection/components/vega-flag-icon/slimmers/controllers/vega-flag-icon-controller.js +6 -6
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +4 -8
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +19 -2
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-prefix-icon-renderer.js +8 -28
- package/dist/collection/components/vega-input-select/vega-input-select.js +3 -1
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.js +66 -0
- package/dist/collection/components/vega-popover/slimmers/renderers/vega-popover-appender-renderer.js +17 -0
- package/dist/collection/components/vega-popover/vega-popover.js +33 -1
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +9 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/commit-value-strategy.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/commit-value-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +11 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +18 -6
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +30 -18
- package/dist/collection/components/vega-rich-text-editor/extensions/blockquote/renderers/blockquote-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/copy/copy-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/cut/cut-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/slimmer/renderers/find-replace-toolbar-button-renderer.js +51 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/find-replace/vega-rich-text-find-replace-panel/slimmers/renderers/find-replace-panel-renderer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/fullscreen/fullscreen-toolbar-button-renderer.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/horizontal-line/renderers/horizontal-line-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.js +3 -9
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-cell-renderer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.js +81 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-popover-base-renderer.js +148 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +151 -5
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +144 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-selection.js +26 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-cell-properties-form-field-renderer.js +11 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-basic-form-field-renderer.abstract.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-form-field-renderer.js +5 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.css +5 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.js +16 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/caption-button-slimmer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/cell-properties-button-slimmer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/column-button-slimmer.js +10 -9
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/merge-cells-button-slimmer.js +9 -8
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.js +25 -10
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-properties-button-slimmer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.js +5 -4
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/vega-rich-text-table-setting-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.css +10 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/word-count/action-handler-interceptors/prevent-hard-limit-exceed-interceptor.js +70 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/word-count/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/word-count/word-count-extension.js +62 -0
- package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +7 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +52 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/word-count-controller.js +79 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +6 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +2 -1
- 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 +3 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +111 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +17 -6
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-color-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/text-styles-toolbar-button-slimmer.js +1 -1
- 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/vega-rich-text-editor-renderer.js +59 -8
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/slimmers/renderers/vega-rich-text-editor-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.js +13 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.js +124 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +9 -1
- package/dist/collection/components/vega-segment-control/slimmers/renderers/vega-segment-renderer.js +8 -1
- package/dist/collection/components/vega-segment-control/vega-segment-control.js +23 -0
- package/dist/collection/components/vega-table/slimmers/controllers/dto/column-render-input-model.js +25 -8
- package/dist/collection/components/vega-table/slimmers/controllers/dto/row-render-input-model.js +41 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-head-template-structure-controller.js +1 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-render-input-controller.js +316 -18
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-body-renderer.js +6 -1
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-header-renderer.js +1 -0
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +33 -530
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-row-renderer.js +1 -0
- package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.css +10 -0
- package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.js +25 -8
- package/dist/collection/components/vega-table/vega-table-expand-row/slimmers/renderers/vega-table-expand-row-renderer.js +14 -6
- package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.css +20 -0
- package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.js +7 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +21 -2
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.css +10 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.js +12 -1
- package/dist/collection/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.js +20 -13
- package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.css +26 -0
- package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.js +12 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +10 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +19 -6
- package/dist/collection/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.js +21 -46
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.css +16 -7
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.js +9 -2
- package/dist/collection/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.js +28 -13
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.css +26 -0
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.js +11 -0
- package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-border-tokens.js +1 -1
- package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-color-tokens.js +20 -20
- package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-ring-tokens.js +1 -1
- package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-shadow-tokens.js +1 -1
- package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-border-tokens.js +1 -1
- package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-color-tokens.js +19 -19
- package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-shadow-tokens.js +1 -1
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/scripts/before-vega-load.js +10 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +10 -2
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +3 -1
- package/dist/collection/helpers/keyboard/keyboard-manager.js +11 -4
- package/dist/collection/helpers/keyboard/overlay-escape-coordination.js +33 -0
- package/dist/collection/helpers/public-api.js +1 -0
- package/dist/collection/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.js +1 -1
- package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +8 -0
- package/dist/collection/helpers/slimmers/position-calculation/screen-position-calculation-strategy.js +10 -0
- package/dist/collection/helpers/slimmers/vega-table-child-render-input-consumer-slimmer.js +2 -0
- package/dist/collection/helpers/translation/locales/en.js +15 -0
- package/dist/collection/helpers/ui/element-appender.js +1 -0
- package/dist/collection/polyfill/libphonenumber/as-you-type.js +21 -3
- package/dist/collection/polyfill/libphonenumber/metadata.js +16 -0
- package/dist/collection/utils/accessibility.js +20 -0
- package/dist/esm/{accessibility-6af5cf2e.js → accessibility-c899a968.js} +21 -1
- package/dist/esm/{action-color-accessibility-validator-08877515.js → action-color-accessibility-validator-3e824a59.js} +1 -1
- package/dist/esm/{app-globals-c59364c2.js → app-globals-ad3c7cea.js} +19 -10
- package/dist/esm/{aria-attributes-value-mapper-2c632641.js → aria-attributes-value-mapper-a5c7478e.js} +1 -1
- package/dist/esm/{aria-dialog-focusable-trap-slimmer-f069f54d.js → aria-dialog-focusable-trap-slimmer-27a6aa19.js} +3 -3
- package/dist/esm/{child-nodes-event-prevent-slimmer-82626871.js → child-nodes-event-prevent-slimmer-0ebcbf47.js} +1 -1
- package/dist/esm/{child-nodes-notify-observer-slimmer-499a3aa7.js → child-nodes-notify-observer-slimmer-034bc78c.js} +1 -1
- package/dist/esm/{code-block-e6443949.js → code-block-1cdf7a51.js} +816 -754
- package/dist/esm/{component-value-history-controller-slimmer.abstract-ee393213.js → component-value-history-controller-slimmer.abstract-bdeeb43f.js} +6 -6
- package/dist/esm/{content-state-43cdacff.js → content-state-6eb610b8.js} +48 -6
- package/dist/esm/countries-50d3339b.js +249 -0
- package/dist/esm/{dark-mode-style-controller-352f15ff.js → dark-mode-style-controller-4e04a2d3.js} +45 -45
- package/dist/esm/{date-required-rule-b5b67498.js → date-required-rule-2ea3aec8.js} +1 -1
- package/dist/esm/{design-token-8319bb59.js → design-token-82a4e107.js} +3 -3
- package/dist/esm/{dom-node-subject-observer-factory-ddff8662.js → dom-node-subject-observer-factory-bb7e68a0.js} +1 -1
- package/dist/esm/{element-appender-slimmer-c81d1fe3.js → element-appender-slimmer-dd4e2908.js} +24 -5
- package/dist/esm/{event-emit-slimmer-2452278f.js → event-emit-slimmer-12ee1593.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-511b7ac5.js → form-field-controller-slimmer-5c794b4d.js} +5 -5
- package/dist/esm/{image-annotation-action-d7cb80aa.js → image-annotation-action-cdd50dcc.js} +9 -8
- package/dist/esm/{image-extension-9b8abd0d.js → image-extension-f6dbd70c.js} +2 -2
- package/dist/esm/index.js +24 -23
- package/dist/esm/{inject-keyboard-manager-dd368d56.js → inject-keyboard-manager-6a10c9b7.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-d58f35c6.js → internal-calendar-period-factory-d1a60f81.js} +1 -1
- package/dist/esm/{internal-translation-controller-b33430c6.js → internal-translation-controller-fff376d2.js} +15 -0
- package/dist/esm/{internal-vega-event-manager-2ecc9186.js → internal-vega-event-manager-0c381f3b.js} +10 -2
- package/dist/esm/{keyboard-manager-b4a0d97d.js → keyboard-manager-a58288df.js} +13 -6
- package/dist/esm/{keyboard-manager-slimmer-0517fc70.js → keyboard-manager-slimmer-133b86cd.js} +1 -1
- package/dist/esm/{link-extension-230bae8d.js → link-extension-bc234cf7.js} +3 -3
- package/dist/esm/loader.js +19 -18
- package/dist/esm/{month-view-generator-f470caac.js → month-view-generator-20e32b22.js} +1 -1
- package/dist/esm/overlay-escape-coordination-439f7d6f.js +35 -0
- package/dist/esm/{public-rules-28ef32d3.js → public-rules-8dc3fb00.js} +11 -11
- package/dist/esm/{range-efad2578.js → range-d2439ba7.js} +2 -2
- package/dist/esm/{responsive-format-facade-dec87e46.js → responsive-format-facade-07843ec3.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-a697e5bd.js → rich-text-editor-required-rule-a0663a84.js} +1 -1
- package/dist/esm/{split-cell-operation-89b91a38.js → split-cell-operation-1a889fa0.js} +5 -5
- package/dist/esm/{state-border-formatter-1e900a2f.js → state-border-formatter-3b3dcfe8.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-d0ce3f65.js → string-format-strategy.abstract-44381dcb.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-6546cfc7.js → string-input-formatter-slimmer-69887c40.js} +4 -4
- package/dist/esm/{string-mask-strategy-dd13ae21.js → string-mask-strategy-999fba4b.js} +2 -2
- package/dist/esm/{style-formatter-057d7120.js → style-formatter-c4192c99.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-23b7d0e8.js → sub-state-notify-slimmer-ba72f30b.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-722f6b92.js → sub-state-observer-slimmer-bee1c7fa.js} +3 -3
- package/dist/esm/{time-required-rule-73753a54.js → time-required-rule-0554b114.js} +1 -1
- package/dist/esm/{token-extension-74a0eeb1.js → token-extension-530d9bde.js} +813 -56
- package/dist/esm/{translation-slimmer-ef970ffc.js → translation-slimmer-77022f2e.js} +1 -1
- package/dist/esm/{type-guard-6fc96870.js → type-guard-26d83e7e.js} +1 -1
- package/dist/esm/{ui-d73f756a.js → ui-80e610f4.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-b54a31e7.js → valid-credit-card-number-rule-f60b6904.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +11 -11
- package/dist/esm/vega-app-footer.entry.js +6 -6
- package/dist/esm/vega-app-header-button.entry.js +12 -12
- package/dist/esm/vega-backdrop.entry.js +1 -1
- package/dist/esm/vega-banner.entry.js +6 -6
- package/dist/esm/vega-box.entry.js +7 -7
- 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 -14
- package/dist/esm/vega-button-group_2.entry.js +22 -15
- package/dist/esm/vega-button-link.entry.js +10 -10
- package/dist/esm/vega-button.entry.js +29 -13
- package/dist/esm/vega-calendar_5.entry.js +132 -26
- package/dist/esm/vega-card.entry.js +6 -6
- package/dist/esm/vega-carousel.entry.js +9 -9
- package/dist/esm/vega-checkbox_2.entry.js +12 -12
- package/dist/esm/vega-chip.entry.js +12 -12
- package/dist/esm/vega-code-block.entry.js +17 -17
- package/dist/esm/vega-color-picker.entry.js +10 -10
- package/dist/esm/vega-color-swatch-picker.entry.js +11 -11
- package/dist/esm/vega-color-swatch.entry.js +8 -8
- package/dist/esm/vega-combo-box.entry.js +17 -17
- package/dist/esm/vega-date-picker_2.entry.js +24 -24
- package/dist/esm/vega-dialog_2.entry.js +78 -12
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +111 -28
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-f55f6977.js → vega-event-id-59cd9297.js} +2 -1
- package/dist/esm/vega-field-label.entry.js +31 -38
- package/dist/esm/vega-file-uploader.entry.js +11 -11
- package/dist/esm/vega-flag-icon.entry.js +11 -11
- package/dist/esm/vega-flex.entry.js +7 -7
- package/dist/esm/vega-font.entry.js +6 -6
- package/dist/esm/vega-form.entry.js +12 -12
- package/dist/esm/vega-grid.entry.js +6 -6
- package/dist/esm/vega-icon.entry.js +6 -6
- package/dist/esm/vega-image-uploader.entry.js +15 -15
- package/dist/esm/vega-input-credit-card.entry.js +14 -14
- package/dist/esm/vega-input-numeric.entry.js +14 -14
- package/dist/esm/vega-input-passcode.entry.js +13 -13
- package/dist/esm/vega-input-phone-number.entry.js +55 -274
- package/dist/esm/vega-input-range.entry.js +12 -12
- package/dist/esm/vega-input-select.entry.js +41 -41
- package/dist/esm/vega-input.entry.js +16 -16
- package/dist/esm/{vega-internal-event-id-86fce049.js → vega-internal-event-id-02093067.js} +4 -2
- package/dist/esm/vega-item-toggle.entry.js +5 -5
- package/dist/esm/vega-left-nav_5.entry.js +16 -16
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
- package/dist/esm/vega-page-notification_2.entry.js +4 -4
- 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 +11 -11
- package/dist/esm/vega-popover_2.entry.js +65 -16
- package/dist/esm/vega-progress-tracker_2.entry.js +12 -12
- package/dist/esm/vega-radio_2.entry.js +15 -15
- package/dist/esm/vega-rich-text-content.entry.js +18 -15
- package/dist/esm/vega-rich-text-editor_4.entry.js +715 -253
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +8 -8
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +10 -10
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +163 -110
- package/dist/esm/vega-segment-control.entry.js +13 -6
- package/dist/esm/vega-selection-chip_2.entry.js +14 -14
- package/dist/esm/vega-selection-tile_2.entry.js +12 -12
- package/dist/esm/vega-sidenav_3.entry.js +12 -12
- package/dist/esm/vega-signature-capture.entry.js +14 -14
- package/dist/esm/vega-stepper.entry.js +10 -10
- package/dist/esm/vega-tab-group_2.entry.js +9 -9
- package/dist/esm/vega-table_11.entry.js +627 -668
- package/dist/esm/vega-textarea.entry.js +10 -10
- package/dist/esm/vega-time-picker_2.entry.js +18 -18
- package/dist/esm/vega-toggle-switch.entry.js +10 -10
- package/dist/esm/vega-tooltip_2.entry.js +9 -9
- package/dist/esm/vega.js +19 -18
- package/dist/esm/{wait-for-component-did-render-ff7062aa.js → wait-for-component-did-render-9e84d92d.js} +2 -2
- package/dist/sri/vega-sri-manifest.json +415 -407
- package/dist/types/components/vega-button/vega-button.d.ts +2 -0
- package/dist/types/components/vega-button-group/types.d.ts +12 -6
- package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.d.ts +18 -0
- package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.d.ts +9 -0
- package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.d.ts +9 -1
- package/dist/types/components/vega-calendar/types.d.ts +22 -0
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +23 -1
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +1 -1
- package/dist/types/components/vega-field-label/slimmers/renderers/vega-field-label-label-announcement-renderer.d.ts +3 -10
- package/dist/types/components/vega-flag-icon/slimmers/controllers/vega-flag-icon-controller.d.ts +2 -2
- package/dist/types/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.d.ts +0 -1
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +8 -0
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-prefix-icon-renderer.d.ts +2 -14
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +1 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.d.ts +33 -0
- package/dist/types/components/vega-modal/types.d.ts +2 -1
- package/dist/types/components/vega-popover/slimmers/renderers/vega-popover-appender-renderer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/commit-value-strategy.d.ts +13 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/commit-value-action.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +6 -0
- 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 +11 -1
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/extensions/find-replace/slimmer/renderers/find-replace-toolbar-button-renderer.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.d.ts +14 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-caption-renderer.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +31 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-popover-base-renderer.d.ts +91 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.d.ts +58 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/table-selection.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/slimmers/renderers/vega-rich-text-table-properties-basic-form-field-renderer.abstract.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-properties/vega-rich-text-table-properties.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/row-button-slimmer.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/slimmers/renderers/table-setting-button-slimmer.abstract.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/extensions/table/vega-rich-text-table-setting/vega-rich-text-table-setting.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/extensions/word-count/action-handler-interceptors/prevent-hard-limit-exceed-interceptor.d.ts +38 -0
- package/dist/types/components/vega-rich-text-editor/extensions/word-count/type.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/word-count/word-count-extension.d.ts +38 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +11 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/word-count-controller.d.ts +40 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +3 -1
- 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/vega-rich-text-editor-renderer.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor-toolbar-button/vega-rich-text-editor-toolbar-button.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.d.ts +68 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +3 -0
- package/dist/types/components/vega-segment-control/slimmers/renderers/vega-segment-renderer.d.ts +1 -0
- package/dist/types/components/vega-segment-control/types.d.ts +2 -0
- package/dist/types/components/vega-segment-control/vega-segment-control.d.ts +7 -1
- package/dist/types/components/vega-table/slimmers/controllers/dto/column-render-input-model.d.ts +17 -0
- package/dist/types/components/vega-table/slimmers/controllers/dto/row-render-input-model.d.ts +39 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-render-input-controller.d.ts +71 -7
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-body-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.d.ts +3 -88
- package/dist/types/components/vega-table/vega-table-expand-row/slimmers/renderers/vega-table-expand-row-renderer.d.ts +1 -1
- package/dist/types/components/vega-table/vega-table-expand-row/vega-table-expand-row.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.d.ts +1 -3
- package/dist/types/components/vega-table/vega-table-foot-row/vega-table-foot-row.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.d.ts +0 -4
- package/dist/types/components/vega-table/vega-table-head-row/vega-table-head-row.d.ts +2 -2
- package/dist/types/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.d.ts +2 -3
- package/dist/types/components/vega-table/vega-table-row/vega-table-row.d.ts +4 -0
- package/dist/types/components.d.ts +33 -2
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +3 -1
- package/dist/types/helpers/keyboard/keyboard-manager.d.ts +9 -0
- package/dist/types/helpers/keyboard/overlay-escape-coordination.d.ts +28 -0
- package/dist/types/helpers/public-api.d.ts +1 -0
- package/dist/types/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.d.ts +1 -1
- package/dist/types/helpers/slimmers/position-calculation/position-calculation-controller.d.ts +6 -0
- package/dist/types/helpers/slimmers/position-calculation/screen-position-calculation-strategy.d.ts +6 -0
- package/dist/types/helpers/slimmers/position-calculation/screen-scroll-position-update.d.ts +2 -1
- package/dist/types/helpers/slimmers/vega-table-child-render-input-consumer-slimmer.d.ts +2 -1
- package/dist/types/helpers/translation/interface.d.ts +16 -1
- package/dist/types/polyfill/libphonenumber/as-you-type.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/metadata.d.ts +10 -0
- package/dist/types/types/components.type.d.ts +7 -1
- package/dist/types/types/public-api.d.ts +2 -0
- package/dist/types/utils/accessibility.d.ts +9 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-022cbf8a.js +1 -0
- package/dist/vega/{p-c8ad7207.entry.js → p-02c1284e.entry.js} +1 -1
- package/dist/vega/{p-22edd3cc.js → p-069bbb4a.js} +1 -1
- package/dist/vega/p-08fd229c.js +1 -0
- package/dist/vega/{p-fcb6b499.js → p-0eea1ca8.js} +1 -1
- package/dist/vega/{p-ba6881da.entry.js → p-131ce9df.entry.js} +1 -1
- package/dist/vega/{p-024db952.entry.js → p-143ee395.entry.js} +1 -1
- package/dist/vega/p-178634f3.js +1 -0
- package/dist/vega/{p-9e9f49f4.js → p-1836a6a5.js} +1 -1
- package/dist/vega/p-1dbf8d1f.js +1 -0
- package/dist/vega/{p-d4d90ce2.entry.js → p-2b26e182.entry.js} +1 -1
- package/dist/vega/p-2dda5c65.entry.js +1 -0
- package/dist/vega/{p-df63c2fb.entry.js → p-30010c41.entry.js} +1 -1
- package/dist/vega/p-32f5a6dd.entry.js +1 -0
- package/dist/vega/{p-3c8421d5.entry.js → p-3460a1c5.entry.js} +1 -1
- package/dist/vega/p-34b523da.entry.js +1 -0
- package/dist/vega/p-357c0226.entry.js +1 -0
- package/dist/vega/p-361f8996.js +1 -0
- package/dist/vega/{p-526e3634.js → p-36a57431.js} +1 -1
- package/dist/vega/p-36ee9d54.js +1 -0
- package/dist/vega/{p-6659c910.entry.js → p-37d5c37e.entry.js} +1 -1
- package/dist/vega/{p-47a48329.entry.js → p-3d6a43df.entry.js} +1 -1
- package/dist/vega/{p-0ca3b4bf.entry.js → p-45ad2d90.entry.js} +1 -1
- package/dist/vega/{p-fb9475ab.entry.js → p-4b117bfd.entry.js} +1 -1
- package/dist/vega/p-4b35c748.js +1 -0
- package/dist/vega/{p-55dc3053.entry.js → p-4e23e56c.entry.js} +1 -1
- package/dist/vega/p-4e70836a.entry.js +1 -0
- package/dist/vega/{p-66647244.js → p-4ea477d5.js} +1 -1
- package/dist/vega/{p-5147c30d.entry.js → p-50e8e24f.entry.js} +1 -1
- package/dist/vega/{p-9c5289dc.entry.js → p-522a6eec.entry.js} +1 -1
- package/dist/vega/p-53e3f259.js +1 -0
- package/dist/vega/{p-2c737fc8.js → p-5536146c.js} +1 -1
- package/dist/vega/{p-944e284d.entry.js → p-55c2c0df.entry.js} +1 -1
- package/dist/vega/p-587130f6.entry.js +1 -0
- package/dist/vega/{p-9c9b0629.js → p-58c8a4ac.js} +1 -1
- package/dist/vega/{p-4f6aaac5.entry.js → p-594cb986.entry.js} +1 -1
- package/dist/vega/{p-b12de1bf.entry.js → p-5c17ddda.entry.js} +1 -1
- package/dist/vega/{p-7977352b.entry.js → p-5c9c0c0d.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-60010f14.entry.js +1 -0
- package/dist/vega/p-6098c4bb.js +1 -0
- package/dist/vega/{p-2044eba9.js → p-60a74fb7.js} +1 -1
- package/dist/vega/p-61e63c0e.entry.js +1 -0
- package/dist/vega/{p-49d7cfed.entry.js → p-62254dc7.entry.js} +1 -1
- package/dist/vega/{p-2af1d8b8.entry.js → p-62ae9327.entry.js} +1 -1
- package/dist/vega/{p-b3c4943b.js → p-638b6a7d.js} +1 -1
- package/dist/vega/p-66245bc0.entry.js +1 -0
- package/dist/vega/{p-bdb5180c.js → p-68744e7e.js} +1 -1
- package/dist/vega/{p-f0a0fc77.entry.js → p-68ca8d3c.entry.js} +1 -1
- package/dist/vega/p-6a6c1279.js +1 -0
- package/dist/vega/{p-5e9e04f3.entry.js → p-6ae93679.entry.js} +1 -1
- package/dist/vega/{p-433b1395.entry.js → p-6d90d28d.entry.js} +1 -1
- package/dist/vega/p-6e9e7131.js +1 -0
- package/dist/vega/{p-014cd411.js → p-6eedbc4f.js} +1 -1
- package/dist/vega/{p-c348eaf5.js → p-6fae6768.js} +1 -1
- package/dist/vega/p-71813a9e.entry.js +1 -0
- package/dist/vega/{p-860e76f5.entry.js → p-729529d6.entry.js} +1 -1
- package/dist/vega/{p-aa433430.entry.js → p-75bfbffe.entry.js} +1 -1
- package/dist/vega/{p-d6023dc0.entry.js → p-764b4e51.entry.js} +1 -1
- package/dist/vega/p-77bcdd35.js +1 -0
- package/dist/vega/{p-c41a2d4a.js → p-7d3419c7.js} +1 -1
- package/dist/vega/p-8387896e.js +1 -0
- package/dist/vega/p-853a05eb.js +1 -0
- package/dist/vega/{p-db11134b.entry.js → p-8e8b5790.entry.js} +1 -1
- package/dist/vega/{p-444e24c6.js → p-8ebe30a8.js} +1 -1
- package/dist/vega/p-8f00dfe6.js +1 -0
- package/dist/vega/{p-4022412e.entry.js → p-9236b8d9.entry.js} +1 -1
- package/dist/vega/p-9402f32f.js +1 -0
- package/dist/vega/{p-691bdc20.js → p-941a83db.js} +1 -1
- package/dist/vega/{p-840444c9.entry.js → p-942f9ea6.entry.js} +1 -1
- package/dist/vega/{p-5110c84f.js → p-96c090c4.js} +1 -1
- package/dist/vega/{p-328ebbdb.entry.js → p-9fdf66a8.entry.js} +1 -1
- package/dist/vega/{p-867cc602.entry.js → p-a2c45173.entry.js} +1 -1
- package/dist/vega/{p-66fe8b4e.entry.js → p-a54ed341.entry.js} +1 -1
- package/dist/vega/{p-44999c88.entry.js → p-a6a89f09.entry.js} +1 -1
- package/dist/vega/{p-ccbed811.entry.js → p-a8a246e8.entry.js} +1 -1
- package/dist/vega/p-a93b3aed.js +1 -0
- package/dist/vega/{p-528748fa.js → p-aa135628.js} +1 -1
- package/dist/vega/{p-a1f220ca.js → p-ab9d53e9.js} +1 -1
- package/dist/vega/{p-e18c0656.entry.js → p-af0cfea0.entry.js} +1 -1
- package/dist/vega/p-af0e9bd5.entry.js +1 -0
- package/dist/vega/{p-daba4af1.js → p-b1557bbe.js} +1 -1
- package/dist/vega/{p-f13b39d8.js → p-b2a4314a.js} +1 -1
- package/dist/vega/p-b94f164a.entry.js +1 -0
- package/dist/vega/{p-23c1f378.entry.js → p-b97ed9f7.entry.js} +1 -1
- package/dist/vega/{p-1a37d63c.entry.js → p-bbfffe6b.entry.js} +1 -1
- package/dist/vega/{p-aa914dbd.entry.js → p-beccc38c.entry.js} +1 -1
- package/dist/vega/{p-dd0bd78b.js → p-c34f4cbc.js} +1 -1
- package/dist/vega/p-c51de680.js +3 -0
- package/dist/vega/{p-e1c82ca9.js → p-c576e846.js} +1 -1
- package/dist/vega/p-c601eea6.js +1 -0
- package/dist/vega/{p-200c8914.entry.js → p-c6d2513c.entry.js} +1 -1
- package/dist/vega/{p-d62e618a.entry.js → p-ca6bd3a0.entry.js} +1 -1
- package/dist/vega/{p-ce82d6bb.entry.js → p-cab890be.entry.js} +1 -1
- package/dist/vega/p-cb1cd15f.entry.js +1 -0
- package/dist/vega/p-d1f47512.js +1 -0
- package/dist/vega/{p-66a785d0.entry.js → p-d37d2ea4.entry.js} +1 -1
- package/dist/vega/{p-2f89ee14.entry.js → p-d3e99d4a.entry.js} +1 -1
- package/dist/vega/{p-f9bfee81.entry.js → p-d6bd3ce4.entry.js} +1 -1
- package/dist/vega/{p-f2384411.entry.js → p-d7838f6e.entry.js} +1 -1
- package/dist/vega/{p-a4360b7e.entry.js → p-d8c9ea46.entry.js} +1 -1
- package/dist/vega/p-d9588b3f.entry.js +1 -0
- package/dist/vega/p-db69a5c9.entry.js +1 -0
- package/dist/vega/{p-50eda925.js → p-de1d0284.js} +1 -1
- package/dist/vega/{p-3c559c8b.js → p-de6fc52c.js} +1 -1
- package/dist/vega/{p-fa5cd8b1.js → p-e14323f3.js} +1 -1
- package/dist/vega/{p-bd7725f7.entry.js → p-e48b7a8a.entry.js} +1 -1
- package/dist/vega/p-e6f67a44.js +1 -0
- package/dist/vega/{p-7754b10f.entry.js → p-e8e3bf74.entry.js} +1 -1
- package/dist/vega/p-eadc10bc.entry.js +1 -0
- package/dist/vega/p-ee329596.entry.js +1 -0
- package/dist/vega/p-f01bc6a2.js +1 -0
- package/dist/vega/{p-94b54a95.js → p-f324e90e.js} +1 -1
- package/dist/vega/{p-f9a3805d.js → p-f48519d2.js} +1 -1
- package/dist/vega/{p-52878ea9.js → p-f485448a.js} +1 -1
- package/dist/vega/{p-4afd6715.entry.js → p-f8b2dbb9.entry.js} +1 -1
- package/dist/vega/{p-35d37477.entry.js → p-f8d13d01.entry.js} +1 -1
- package/dist/vega/{p-4370b954.entry.js → p-f902305d.entry.js} +1 -1
- package/dist/vega/{p-3c152bad.entry.js → p-f99f054c.entry.js} +1 -1
- package/dist/vega/{p-77fb3971.entry.js → p-fe41e3b6.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-keyboard-conttroller.js +0 -85
- package/dist/vega/p-0b2c4c0b.js +0 -1
- package/dist/vega/p-1fa22fda.js +0 -1
- package/dist/vega/p-2529820e.js +0 -1
- package/dist/vega/p-35628af4.js +0 -1
- package/dist/vega/p-3a230d4b.entry.js +0 -1
- package/dist/vega/p-3a620268.js +0 -1
- package/dist/vega/p-4473d8b1.js +0 -3
- package/dist/vega/p-4a2fe3a4.js +0 -1
- package/dist/vega/p-5447a8e8.js +0 -1
- package/dist/vega/p-5af312f8.js +0 -1
- package/dist/vega/p-5b3c8a56.js +0 -1
- package/dist/vega/p-6493f13a.entry.js +0 -1
- package/dist/vega/p-66728dd4.entry.js +0 -1
- package/dist/vega/p-67e88cd7.entry.js +0 -1
- package/dist/vega/p-67eaf77e.js +0 -1
- package/dist/vega/p-6d6b4495.entry.js +0 -1
- package/dist/vega/p-7b133734.entry.js +0 -1
- package/dist/vega/p-7b84a943.entry.js +0 -1
- package/dist/vega/p-83ad8988.js +0 -1
- package/dist/vega/p-8c30a60d.js +0 -1
- package/dist/vega/p-8d2a9012.js +0 -1
- package/dist/vega/p-8d4be607.js +0 -1
- package/dist/vega/p-8d77c7cf.js +0 -1
- package/dist/vega/p-8f3b93db.js +0 -1
- package/dist/vega/p-9c2b3279.js +0 -1
- package/dist/vega/p-9c9ff871.entry.js +0 -1
- package/dist/vega/p-9d90e271.entry.js +0 -1
- package/dist/vega/p-a7517760.entry.js +0 -1
- package/dist/vega/p-c8fb3aac.entry.js +0 -1
- package/dist/vega/p-cede3535.js +0 -1
- package/dist/vega/p-cf4b3d40.entry.js +0 -1
- package/dist/vega/p-d35a31a5.entry.js +0 -1
- package/dist/vega/p-ded1ecc1.entry.js +0 -1
- package/dist/vega/p-e1a65e06.entry.js +0 -1
- package/dist/vega/p-e469ba27.entry.js +0 -1
- package/dist/vega/p-e4c5cb4f.js +0 -1
- package/dist/vega/p-fd23c365.entry.js +0 -1
- /package/dist/types/components/vega-dropdown/slimmers/controllers/{vega-dropdown-keyboard-conttroller.d.ts → vega-dropdown-keyboard-controller.d.ts} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
2
|
-
import { d as domNodeSubjectFactory } from './dom-node-subject-observer-factory-
|
|
3
|
-
import { e as VegaInternalRichTextEditorFlushChanges, f as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-
|
|
2
|
+
import { d as domNodeSubjectFactory } from './dom-node-subject-observer-factory-bb7e68a0.js';
|
|
3
|
+
import { e as VegaInternalRichTextEditorFlushChanges, f as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-02093067.js';
|
|
4
4
|
import { d as dashCaseToCamel, c as camelToDashCase } from './string-a953eafc.js';
|
|
5
5
|
import { L as LogUtility } from './global-slimmer-registry-17c4efd4.js';
|
|
6
|
-
import { i as isNonNullable } from './type-guard-
|
|
6
|
+
import { i as isNonNullable } from './type-guard-26d83e7e.js';
|
|
7
7
|
import { T as TypographyUrls } from './typography-19c3b9be.js';
|
|
8
8
|
import { g as generateUUID } from './misc-9fdbcfbb.js';
|
|
9
|
-
import { V as VegaInternalThemeManager } from './dark-mode-style-controller-
|
|
9
|
+
import { V as VegaInternalThemeManager } from './dark-mode-style-controller-4e04a2d3.js';
|
|
10
10
|
import { c as cleanObject } from './object-0c277f57.js';
|
|
11
|
-
import { f as findParent } from './ui-
|
|
11
|
+
import { f as findParent } from './ui-80e610f4.js';
|
|
12
12
|
|
|
13
13
|
var InternalAnnotationTypeEnum;
|
|
14
14
|
(function (InternalAnnotationTypeEnum) {
|
|
@@ -1595,6 +1595,14 @@ class RTENode {
|
|
|
1595
1595
|
isTextNode() {
|
|
1596
1596
|
return false;
|
|
1597
1597
|
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Get the plain text content of the node, used for character counting. Default implementation returns an empty string, subclasses should override this method to provide the actual plain text content.
|
|
1600
|
+
*
|
|
1601
|
+
* @returns {string} The plain text content of the node.
|
|
1602
|
+
*/
|
|
1603
|
+
getPlainText() {
|
|
1604
|
+
return '';
|
|
1605
|
+
}
|
|
1598
1606
|
/**
|
|
1599
1607
|
* Get the HTMLElement reference associated with this node.
|
|
1600
1608
|
*
|
|
@@ -1901,6 +1909,17 @@ class RTEBlock {
|
|
|
1901
1909
|
}
|
|
1902
1910
|
return firstItem;
|
|
1903
1911
|
}
|
|
1912
|
+
/**
|
|
1913
|
+
* Get the plain text content of the block, used for character counting.
|
|
1914
|
+
*
|
|
1915
|
+
* @returns {string} The concatenated plain text of all child nodes and blocks.
|
|
1916
|
+
*/
|
|
1917
|
+
getPlainText() {
|
|
1918
|
+
var _a;
|
|
1919
|
+
return ((_a = this.children) !== null && _a !== void 0 ? _a : [])
|
|
1920
|
+
.map((child) => child.getPlainText())
|
|
1921
|
+
.join('');
|
|
1922
|
+
}
|
|
1904
1923
|
/**
|
|
1905
1924
|
* Check if the block is a list item block
|
|
1906
1925
|
*
|
|
@@ -2014,12 +2033,186 @@ class RTEBlock {
|
|
|
2014
2033
|
}
|
|
2015
2034
|
}
|
|
2016
2035
|
|
|
2036
|
+
/**
|
|
2037
|
+
* Append children to a block or rte content
|
|
2038
|
+
*
|
|
2039
|
+
* @example parent.apply(new AppendChildrenAction([newChildren]))
|
|
2040
|
+
*/
|
|
2041
|
+
class AppendChildrenAction extends ModifyContentAction {
|
|
2042
|
+
constructor(childNodes) {
|
|
2043
|
+
super();
|
|
2044
|
+
this.type = ModifyContentActionType.APPEND_CHILDREN;
|
|
2045
|
+
this.entityToBeAppended = childNodes;
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
const TEXT_STYLE_DEFAULT_FONT_WEIGHT = '500';
|
|
2050
|
+
const TEXT_STYLE_BASE = {
|
|
2051
|
+
fontFamily: 'Inter',
|
|
2052
|
+
fontSize: '16px',
|
|
2053
|
+
lineHeight: '22px',
|
|
2054
|
+
minHeight: '22px',
|
|
2055
|
+
fontWeight: TEXT_STYLE_DEFAULT_FONT_WEIGHT,
|
|
2056
|
+
};
|
|
2057
|
+
const PARAGRAPH_TEXT_STYLE = Object.assign(Object.assign({}, TEXT_STYLE_BASE), { marginTop: '0px', marginBottom: '0px' });
|
|
2058
|
+
const TEXT_STYLE_DEFAULTS = {
|
|
2059
|
+
'paragraph': PARAGRAPH_TEXT_STYLE,
|
|
2060
|
+
'title': Object.assign(Object.assign({}, TEXT_STYLE_BASE), { fontSize: '36px', lineHeight: '40px', minHeight: '40px' }),
|
|
2061
|
+
'subtitle': Object.assign(Object.assign({}, TEXT_STYLE_BASE), { fontSize: '28px', lineHeight: '32px', minHeight: '32px' }),
|
|
2062
|
+
'heading-1': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '22px', lineHeight: '24px', minHeight: '24px' }),
|
|
2063
|
+
'heading-2': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '20px', lineHeight: '24px', minHeight: '24px' }),
|
|
2064
|
+
'heading-3': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '18px' }),
|
|
2065
|
+
'heading-4': Object.assign({}, PARAGRAPH_TEXT_STYLE),
|
|
2066
|
+
'heading-5': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '14px' }),
|
|
2067
|
+
'heading-6': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '12px' }),
|
|
2068
|
+
};
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* Text style annotation
|
|
2072
|
+
*/
|
|
2073
|
+
class TextStyleAnnotation extends BlockAnnotation {
|
|
2074
|
+
constructor(textStyle) {
|
|
2075
|
+
super();
|
|
2076
|
+
this.type = BlockAnnotationTypeEnum.TEXT_STYLE;
|
|
2077
|
+
this.textStyle = textStyle;
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Generate the map item for the annotations
|
|
2081
|
+
*
|
|
2082
|
+
* @param {VegaRTETextStyleType} textStyle - the text style type
|
|
2083
|
+
* @returns {[BlockAnnotationTypeEnum.TEXT_STYLE, TextStyleAnnotation]} Map item for the annotation
|
|
2084
|
+
*/
|
|
2085
|
+
static from(textStyle) {
|
|
2086
|
+
return [BlockAnnotationTypeEnum.TEXT_STYLE, new TextStyleAnnotation(textStyle)];
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Get the default styles for a given text style type.
|
|
2090
|
+
*
|
|
2091
|
+
* @param {VegaRTETextStyleType} textStyle - The text style type.
|
|
2092
|
+
* @returns {Nullable<AnnotationStyle>} The default styles for the given text style type.
|
|
2093
|
+
*/
|
|
2094
|
+
static getDefaultStyles(textStyle) {
|
|
2095
|
+
if (!textStyle)
|
|
2096
|
+
return null;
|
|
2097
|
+
return TEXT_STYLE_DEFAULTS[textStyle];
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* Generate the JSON representation of the annotation
|
|
2101
|
+
*
|
|
2102
|
+
* @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
|
|
2103
|
+
*/
|
|
2104
|
+
toJSON() {
|
|
2105
|
+
return { textStyle: this.textStyle };
|
|
2106
|
+
}
|
|
2107
|
+
/**
|
|
2108
|
+
* @inheritDoc
|
|
2109
|
+
*/
|
|
2110
|
+
clone() {
|
|
2111
|
+
return new TextStyleAnnotation(this.textStyle);
|
|
2112
|
+
}
|
|
2113
|
+
/**
|
|
2114
|
+
* @inheritDoc
|
|
2115
|
+
*/
|
|
2116
|
+
renderClass(options) {
|
|
2117
|
+
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
2118
|
+
return null;
|
|
2119
|
+
return this.textStyle ? `v-rte--text-style-${this.textStyle}` : null;
|
|
2120
|
+
}
|
|
2121
|
+
/**
|
|
2122
|
+
* @inheritDoc
|
|
2123
|
+
*/
|
|
2124
|
+
renderStyle(options) {
|
|
2125
|
+
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
2126
|
+
return null;
|
|
2127
|
+
return this.textStyle ? TextStyleAnnotation.getDefaultStyles(this.textStyle) : null;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2017
2131
|
/**
|
|
2018
2132
|
* Abstract class for annotation actions
|
|
2019
2133
|
*/
|
|
2020
2134
|
class AnnotationAction {
|
|
2021
2135
|
}
|
|
2022
2136
|
|
|
2137
|
+
/**
|
|
2138
|
+
* Action to change the text style of a block
|
|
2139
|
+
*/
|
|
2140
|
+
class TextStyleAnnotationAction extends AnnotationAction {
|
|
2141
|
+
constructor(textStyle, bold) {
|
|
2142
|
+
super();
|
|
2143
|
+
this.isFlushable = true;
|
|
2144
|
+
this.textStyle = textStyle;
|
|
2145
|
+
this.bold = bold;
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Converts the action to a block annotation
|
|
2149
|
+
*
|
|
2150
|
+
* @returns {BlockAnnotation} the block annotation
|
|
2151
|
+
*/
|
|
2152
|
+
toAnnotation() {
|
|
2153
|
+
return new TextStyleAnnotation(this.textStyle);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
/**
|
|
2158
|
+
* Annotation to make text a link
|
|
2159
|
+
*/
|
|
2160
|
+
class LinkAnnotation extends NodeAnnotation {
|
|
2161
|
+
constructor(link, useInternalStyle = true) {
|
|
2162
|
+
super();
|
|
2163
|
+
this.type = NodeAnnotationTypeEnum.LINK;
|
|
2164
|
+
this.link = link;
|
|
2165
|
+
this.useInternalStyle = useInternalStyle;
|
|
2166
|
+
}
|
|
2167
|
+
/**
|
|
2168
|
+
* Generate the map item for the annotation
|
|
2169
|
+
*
|
|
2170
|
+
* @param {VegaRTELink} link - Bold annotation
|
|
2171
|
+
* @param {boolean} useInternalStyle - Whether to use default style for the link
|
|
2172
|
+
* @returns {[NodeAnnotationTypeEnum.LINK, LinkAnnotation]} Map item for the annotation
|
|
2173
|
+
*/
|
|
2174
|
+
static from(link, useInternalStyle = true) {
|
|
2175
|
+
return [NodeAnnotationTypeEnum.LINK, new LinkAnnotation(link, useInternalStyle)];
|
|
2176
|
+
}
|
|
2177
|
+
/**
|
|
2178
|
+
* Generate the JSON representation of the annotation
|
|
2179
|
+
*
|
|
2180
|
+
* @returns {Record<'link', VegaRTELink>} JSON representation of the annotation
|
|
2181
|
+
*/
|
|
2182
|
+
toJSON() {
|
|
2183
|
+
return {
|
|
2184
|
+
link: this.link,
|
|
2185
|
+
};
|
|
2186
|
+
}
|
|
2187
|
+
/**
|
|
2188
|
+
* @inheritDoc
|
|
2189
|
+
*/
|
|
2190
|
+
clone() {
|
|
2191
|
+
return new LinkAnnotation(this.link, this.useInternalStyle);
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Verify whether two link annotation is same or not
|
|
2195
|
+
*
|
|
2196
|
+
* @param {LinkAnnotation} annotation - Compared annotation
|
|
2197
|
+
* @returns {boolean} Whether two link annotation is same or not
|
|
2198
|
+
*/
|
|
2199
|
+
toEqual(annotation) {
|
|
2200
|
+
return this.link.groupKey === annotation.link.groupKey;
|
|
2201
|
+
}
|
|
2202
|
+
/**
|
|
2203
|
+
* @inheritDoc
|
|
2204
|
+
*/
|
|
2205
|
+
renderClass() {
|
|
2206
|
+
return null;
|
|
2207
|
+
}
|
|
2208
|
+
/**
|
|
2209
|
+
* @inheritDoc
|
|
2210
|
+
*/
|
|
2211
|
+
renderStyle() {
|
|
2212
|
+
return null;
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2023
2216
|
/**
|
|
2024
2217
|
* Abstract class for which can be splittable
|
|
2025
2218
|
*/
|
|
@@ -2034,21 +2227,48 @@ class TextSplittableAction extends AnnotationAction {
|
|
|
2034
2227
|
}
|
|
2035
2228
|
|
|
2036
2229
|
/**
|
|
2037
|
-
*
|
|
2230
|
+
* Action to toggle link annotation
|
|
2038
2231
|
*/
|
|
2039
|
-
class
|
|
2040
|
-
constructor(
|
|
2232
|
+
class LinkAnnotationAction extends TextSplittableAction {
|
|
2233
|
+
constructor({ link, newText, needMergeNode, doSplit, type, }) {
|
|
2041
2234
|
super();
|
|
2042
|
-
this.
|
|
2043
|
-
this.
|
|
2235
|
+
this.isFlushable = true;
|
|
2236
|
+
this.link = link;
|
|
2237
|
+
this.needMergeNode = needMergeNode;
|
|
2238
|
+
this.newText = newText;
|
|
2239
|
+
this.type = type;
|
|
2240
|
+
if (isNonNullable(doSplit)) {
|
|
2241
|
+
this.doSplit = doSplit;
|
|
2242
|
+
}
|
|
2044
2243
|
}
|
|
2045
2244
|
/**
|
|
2046
|
-
*
|
|
2245
|
+
* Converts the action to an annotation
|
|
2047
2246
|
*
|
|
2048
|
-
* @returns {
|
|
2247
|
+
* @returns {LinkAnnotation} the annotation
|
|
2049
2248
|
*/
|
|
2050
|
-
|
|
2051
|
-
return new
|
|
2249
|
+
toAnnotation() {
|
|
2250
|
+
return new LinkAnnotation(this.link);
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
/**
|
|
2255
|
+
* Action to link a group of nodes
|
|
2256
|
+
*/
|
|
2257
|
+
class LinkGroupAnnotationAction extends AnnotationAction {
|
|
2258
|
+
constructor(groupKey, nodes, type) {
|
|
2259
|
+
super();
|
|
2260
|
+
this.isFlushable = false;
|
|
2261
|
+
this.groupKey = groupKey;
|
|
2262
|
+
this.nodes = nodes;
|
|
2263
|
+
this.type = type;
|
|
2264
|
+
}
|
|
2265
|
+
/**
|
|
2266
|
+
* Converts the action to an annotation
|
|
2267
|
+
*
|
|
2268
|
+
* @returns {Annotation} The annotation
|
|
2269
|
+
*/
|
|
2270
|
+
toAnnotation() {
|
|
2271
|
+
return new LinkGroupAnnotation(this.groupKey);
|
|
2052
2272
|
}
|
|
2053
2273
|
}
|
|
2054
2274
|
|
|
@@ -2076,22 +2296,22 @@ const CODE_FONT_FAMILY = 'Roboto Mono';
|
|
|
2076
2296
|
const CODE_WHITE_SPACE = 'pre-wrap';
|
|
2077
2297
|
|
|
2078
2298
|
/**
|
|
2079
|
-
* Annotation to make text
|
|
2299
|
+
* Annotation to make text bold
|
|
2080
2300
|
*/
|
|
2081
|
-
class
|
|
2082
|
-
constructor(
|
|
2301
|
+
class BoldAnnotation extends NodeAnnotation {
|
|
2302
|
+
constructor(bold) {
|
|
2083
2303
|
super();
|
|
2084
|
-
this.type = NodeAnnotationTypeEnum.
|
|
2085
|
-
this.
|
|
2304
|
+
this.type = NodeAnnotationTypeEnum.BOLD;
|
|
2305
|
+
this.bold = bold;
|
|
2086
2306
|
}
|
|
2087
2307
|
/**
|
|
2088
2308
|
* Generate the map item for the annotation
|
|
2089
2309
|
*
|
|
2090
|
-
* @param {
|
|
2091
|
-
* @returns {[NodeAnnotationTypeEnum.
|
|
2310
|
+
* @param {boolean} bold - Bold annotation
|
|
2311
|
+
* @returns {[NodeAnnotationTypeEnum.BOLD, BoldAnnotation]} Map item for the annotation
|
|
2092
2312
|
*/
|
|
2093
|
-
static from(
|
|
2094
|
-
return [NodeAnnotationTypeEnum.
|
|
2313
|
+
static from(bold) {
|
|
2314
|
+
return [NodeAnnotationTypeEnum.BOLD, new BoldAnnotation(bold)];
|
|
2095
2315
|
}
|
|
2096
2316
|
/**
|
|
2097
2317
|
* Generate the JSON representation of the annotation
|
|
@@ -2100,14 +2320,14 @@ class StrikethroughAnnotation extends NodeAnnotation {
|
|
|
2100
2320
|
*/
|
|
2101
2321
|
toJSON() {
|
|
2102
2322
|
return {
|
|
2103
|
-
|
|
2323
|
+
bold: this.bold,
|
|
2104
2324
|
};
|
|
2105
2325
|
}
|
|
2106
2326
|
/**
|
|
2107
2327
|
* @inheritDoc
|
|
2108
2328
|
*/
|
|
2109
2329
|
clone() {
|
|
2110
|
-
return new
|
|
2330
|
+
return new BoldAnnotation(this.bold);
|
|
2111
2331
|
}
|
|
2112
2332
|
/**
|
|
2113
2333
|
* @inheritDoc
|
|
@@ -2115,7 +2335,7 @@ class StrikethroughAnnotation extends NodeAnnotation {
|
|
|
2115
2335
|
renderClass(options) {
|
|
2116
2336
|
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
2117
2337
|
return null;
|
|
2118
|
-
return this.
|
|
2338
|
+
return this.bold ? 'v-rte--bold' : null;
|
|
2119
2339
|
}
|
|
2120
2340
|
/**
|
|
2121
2341
|
* @inheritDoc
|
|
@@ -2123,27 +2343,383 @@ class StrikethroughAnnotation extends NodeAnnotation {
|
|
|
2123
2343
|
renderStyle(options) {
|
|
2124
2344
|
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
2125
2345
|
return null;
|
|
2126
|
-
return this.
|
|
2346
|
+
return this.bold ? { fontWeight: BOLD_FONT_WEIGHT } : null;
|
|
2127
2347
|
}
|
|
2128
2348
|
}
|
|
2129
2349
|
|
|
2130
2350
|
/**
|
|
2131
|
-
*
|
|
2351
|
+
* Action to toggle bold annotation
|
|
2132
2352
|
*/
|
|
2133
|
-
class
|
|
2353
|
+
class BoldAnnotationAction extends TextSplittableAction {
|
|
2354
|
+
constructor(bold) {
|
|
2355
|
+
super();
|
|
2356
|
+
this.isFlushable = true;
|
|
2357
|
+
this.bold = bold;
|
|
2358
|
+
}
|
|
2359
|
+
/**
|
|
2360
|
+
* Converts the action to an annotation
|
|
2361
|
+
*
|
|
2362
|
+
* @returns {BoldAnnotation} the annotation
|
|
2363
|
+
*/
|
|
2364
|
+
toAnnotation() {
|
|
2365
|
+
return new BoldAnnotation(this.bold);
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
/**
|
|
2370
|
+
* Delete the node annotation by type
|
|
2371
|
+
*/
|
|
2372
|
+
class DeleteNodeAnnotationAction extends AnnotationAction {
|
|
2373
|
+
constructor(annotationType) {
|
|
2374
|
+
super();
|
|
2375
|
+
this.isFlushable = true;
|
|
2376
|
+
this.annotationType = annotationType;
|
|
2377
|
+
}
|
|
2378
|
+
/**
|
|
2379
|
+
* Don't need this for this action
|
|
2380
|
+
*
|
|
2381
|
+
* @returns {Nullable<Annotation>} undefined
|
|
2382
|
+
*/
|
|
2383
|
+
toAnnotation() {
|
|
2384
|
+
return undefined;
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
/**
|
|
2389
|
+
* The base action handle strategy class, use to modify the rich text node content or modify the annotation.
|
|
2390
|
+
*/
|
|
2391
|
+
class ActionHandleStrategy {
|
|
2392
|
+
/**
|
|
2393
|
+
* Public method to invoke the handle logic.
|
|
2394
|
+
*
|
|
2395
|
+
* @typedef R generic type
|
|
2396
|
+
* @param {ModifyContentAction | AnnotationAction} action - The action instance. Contains the action type and necessary params.
|
|
2397
|
+
* @param {RTENode | RTEBlock | VegaRTEContent} target - The rich text node instance that will be modified.
|
|
2398
|
+
* @returns {R} - The invoke result in special strategy.
|
|
2399
|
+
*/
|
|
2400
|
+
execute(action, target) {
|
|
2401
|
+
LogUtility.log(`Executing action ${action.constructor.name} on ${target.constructor.name} ${target['id']}`);
|
|
2402
|
+
return this.handleAction(action, target);
|
|
2403
|
+
}
|
|
2404
|
+
/**
|
|
2405
|
+
* Update the custom style annotation of a block or node
|
|
2406
|
+
*
|
|
2407
|
+
* @param {RTEBlock | RTETextNode} item - block or node
|
|
2408
|
+
* @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
|
|
2409
|
+
*/
|
|
2410
|
+
updateCustomStyleAnnotation(item, styleKeys) {
|
|
2411
|
+
const customStyleAnnotation = item.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_STYLE);
|
|
2412
|
+
if (customStyleAnnotation && this.isCustomStyle(customStyleAnnotation, styleKeys)) {
|
|
2413
|
+
item.annotationMap.set(customStyleAnnotation.type, new CustomStyleAnnotation(customStyleAnnotation.removeStyles(styleKeys)));
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* Create a new paragraph block with the given text.
|
|
2418
|
+
*
|
|
2419
|
+
* @param {string} text - The text content for the new paragraph.
|
|
2420
|
+
* @returns {Nullable<RTETextBlock>} - The newly created paragraph block, or null if creation failed.
|
|
2421
|
+
*/
|
|
2422
|
+
createNewParagraph(text) {
|
|
2423
|
+
const dtoClass = RTEDTOClassManager$1.getRTEBlockClass('paragraph');
|
|
2424
|
+
if (dtoClass) {
|
|
2425
|
+
const newParagraph = dtoClass.from({
|
|
2426
|
+
id: generateUUID(),
|
|
2427
|
+
type: 'paragraph',
|
|
2428
|
+
nodes: [{ id: generateUUID(), type: 'text', text }],
|
|
2429
|
+
});
|
|
2430
|
+
return newParagraph;
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
/**
|
|
2434
|
+
* Get the root content from a child block or node.
|
|
2435
|
+
*
|
|
2436
|
+
* @param {RTEBlock | RTENode} child - The child block or node.
|
|
2437
|
+
* @returns {Nullable<VegaRTEContent>} The root content, if found.
|
|
2438
|
+
*/
|
|
2439
|
+
getRootContent(child) {
|
|
2440
|
+
const parent = child.parent;
|
|
2441
|
+
if (parent) {
|
|
2442
|
+
if (parent.dtoName === 'VegaRTEContent') {
|
|
2443
|
+
return parent;
|
|
2444
|
+
}
|
|
2445
|
+
else {
|
|
2446
|
+
return this.getRootContent(parent);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
/**
|
|
2451
|
+
* Check the caret position at the start of a block.
|
|
2452
|
+
*
|
|
2453
|
+
* @param {RTEBlock} block - The RTE Block.
|
|
2454
|
+
* @param {RTENode} node - The RTE Node.
|
|
2455
|
+
* @param {number} offset - The offset position.
|
|
2456
|
+
* @returns {boolean} - Whether the caret is at the start of the block.
|
|
2457
|
+
*/
|
|
2458
|
+
isCaretPositionAtBlockStart(block, node, offset) {
|
|
2459
|
+
return node === block.children[0] && offset === 0;
|
|
2460
|
+
}
|
|
2461
|
+
/**
|
|
2462
|
+
* Check the caret position at the end of a block.
|
|
2463
|
+
*
|
|
2464
|
+
* @param {RTEBlock} block - The RTE Block.
|
|
2465
|
+
* @param {RTENode} node - The RTE Node.
|
|
2466
|
+
* @param {number} offset - The offset position.
|
|
2467
|
+
* @returns {boolean} - Whether the caret is at the end of the block.
|
|
2468
|
+
*/
|
|
2469
|
+
isCaretPositionAtBlockEnd(block, node, offset) {
|
|
2470
|
+
if (!node.isContentEditable()) {
|
|
2471
|
+
return this.isCaretPositionAtDecoratorBlockEnd(block, node, offset);
|
|
2472
|
+
}
|
|
2473
|
+
else {
|
|
2474
|
+
return this.isCaretPositionAtTextBlockEnd(block, node, offset);
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
/**
|
|
2478
|
+
* Get the registered DOM element by the RTE entity.
|
|
2479
|
+
*
|
|
2480
|
+
* @param {RTEBlock | RTENode} instance - The RTE block or node instance.
|
|
2481
|
+
* @returns {Nullable<HTMLElement>} The registered DOM element.
|
|
2482
|
+
*/
|
|
2483
|
+
getDOMByEntity(instance) {
|
|
2484
|
+
return stateEntityRenderingRegistry.getDOMByEntity(instance);
|
|
2485
|
+
}
|
|
2486
|
+
/**
|
|
2487
|
+
* Checks if the caret position is at the end of a specified RTETextNode.
|
|
2488
|
+
*
|
|
2489
|
+
* @param {RTETextBlock} textBlock - `RTETextBlock` - a text block.
|
|
2490
|
+
* @param {RTETextNode} node - `RTETextNode` - a node representing an image in a rich text editor.
|
|
2491
|
+
* @param {number} startOffset - The position within the text node where the caret is located.
|
|
2492
|
+
* @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTETextNode.
|
|
2493
|
+
*/
|
|
2494
|
+
isCaretPositionAtTextBlockEnd(textBlock, node, startOffset) {
|
|
2495
|
+
const lastNode = textBlock.children[textBlock.children.length - 1];
|
|
2496
|
+
return node === lastNode && (node.isEmpty() || startOffset === lastNode.text.length);
|
|
2497
|
+
}
|
|
2498
|
+
/**
|
|
2499
|
+
* Checks if the caret position is at the end of a given decorator node.
|
|
2500
|
+
*
|
|
2501
|
+
* @param {RTEBlock} target - The image block.
|
|
2502
|
+
* @param {RTENode} node - `node` is a RTEDecoratorNode or non-editable text node.
|
|
2503
|
+
* @param {number} startOffset - The position within the `RTEDecoratorNode` where the caret is located.
|
|
2504
|
+
* @returns {boolean}Returns a boolean value indicating whether the caret position is at the end of the `RTEDecoratorNode`.
|
|
2505
|
+
*/
|
|
2506
|
+
isCaretPositionAtDecoratorBlockEnd(target, node, startOffset) {
|
|
2507
|
+
return node === target.children[target.children.length - 1] && startOffset !== 0;
|
|
2508
|
+
}
|
|
2509
|
+
/**
|
|
2510
|
+
* Determines if the custom style annotation includes any the custom style.
|
|
2511
|
+
*
|
|
2512
|
+
* @param {CustomStyleAnnotation} customStyleAnnotation - custom style annotation
|
|
2513
|
+
* @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
|
|
2514
|
+
* @returns {boolean} - True if the custom key includes the custom style, false otherwise.
|
|
2515
|
+
*/
|
|
2516
|
+
isCustomStyle(customStyleAnnotation, styleKeys) {
|
|
2517
|
+
return styleKeys.some((item) => Object.keys(customStyleAnnotation.customStyle).includes(item));
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
/**
|
|
2522
|
+
* Update the text block text style strategy.
|
|
2523
|
+
*/
|
|
2524
|
+
class BlockUpdateTextStyleStrategy extends ActionHandleStrategy {
|
|
2525
|
+
/**
|
|
2526
|
+
* Update the text block type and add or remove the bold style from child nodes.
|
|
2527
|
+
*
|
|
2528
|
+
* @param {TextStyleAnnotationAction} action - The text style annotation action.
|
|
2529
|
+
* @param {RTETextBlock} target - The current text block.
|
|
2530
|
+
*/
|
|
2531
|
+
handleAction(action, target) {
|
|
2532
|
+
if (target.type !== 'list-item') {
|
|
2533
|
+
target.type = action.textStyle;
|
|
2534
|
+
}
|
|
2535
|
+
if (action.bold) {
|
|
2536
|
+
target.children.forEach((node) => {
|
|
2537
|
+
const boldAnnotationAction = new BoldAnnotationAction(true);
|
|
2538
|
+
boldAnnotationAction.doSplit = false;
|
|
2539
|
+
node.apply(boldAnnotationAction);
|
|
2540
|
+
});
|
|
2541
|
+
}
|
|
2542
|
+
else {
|
|
2543
|
+
target.children.forEach((node) => {
|
|
2544
|
+
node.apply(new DeleteNodeAnnotationAction(NodeAnnotationTypeEnum.BOLD));
|
|
2545
|
+
});
|
|
2546
|
+
}
|
|
2547
|
+
this.updateCustomStyleAnnotation(target, ['fontFamily', 'lineHeight', 'fontWeight', 'fontSize']);
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
/**
|
|
2552
|
+
* Update the text block link group annotation strategy.
|
|
2553
|
+
*/
|
|
2554
|
+
class BlockUpdateLinkGroupStrategy extends ActionHandleStrategy {
|
|
2555
|
+
/**
|
|
2556
|
+
* Update link group after the child link node update.
|
|
2557
|
+
*
|
|
2558
|
+
* @param {LinkGroupAnnotationAction} action - The link group annotation action instance.
|
|
2559
|
+
* @param {RTETextBlock} target - The current text block.
|
|
2560
|
+
*/
|
|
2561
|
+
handleAction(action, target) {
|
|
2562
|
+
let linkGroupAnnotation = target.getAnnotationByType(InternalAnnotationTypeEnum.LINK_GROUP);
|
|
2563
|
+
if (action.type === 'update_link') {
|
|
2564
|
+
if (linkGroupAnnotation) {
|
|
2565
|
+
const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey);
|
|
2566
|
+
if (linkGroup) {
|
|
2567
|
+
linkGroupAnnotation.linkGroups.set(action.groupKey, [linkGroup[0]]);
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
else {
|
|
2572
|
+
if (linkGroupAnnotation) {
|
|
2573
|
+
const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey) || [];
|
|
2574
|
+
linkGroupAnnotation.linkGroups.set(action.groupKey, [...linkGroup, ...action.nodes]);
|
|
2575
|
+
}
|
|
2576
|
+
else {
|
|
2577
|
+
linkGroupAnnotation = action.toAnnotation();
|
|
2578
|
+
linkGroupAnnotation.linkGroups.set(action.groupKey, [...action.nodes]);
|
|
2579
|
+
}
|
|
2580
|
+
target.annotationMap.set(InternalAnnotationTypeEnum.LINK_GROUP, linkGroupAnnotation);
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
/**
|
|
2586
|
+
* Insert a new children after a existing children
|
|
2587
|
+
*
|
|
2588
|
+
* @example parent.apply(new InsertChildrenAfterAction(existingChildren, newChildren, ...))
|
|
2589
|
+
*/
|
|
2590
|
+
class InsertChildrenAfterAction extends ModifyContentAction {
|
|
2591
|
+
constructor(referBlock, ...blocksToBeInserted) {
|
|
2592
|
+
super();
|
|
2593
|
+
this.type = ModifyContentActionType.INSERT_CHILDREN_AFTER;
|
|
2594
|
+
this.referChildren = referBlock;
|
|
2595
|
+
this.childrenToBeInserted = blocksToBeInserted;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
/**
|
|
2600
|
+
* Clear the current block nodes and append new nodes
|
|
2601
|
+
*
|
|
2602
|
+
* @example block.apply(new ReplaceChildNodesAction(newNodes))
|
|
2603
|
+
*/
|
|
2604
|
+
class ReplaceChildNodesAction extends ModifyContentAction {
|
|
2605
|
+
constructor(newChildNodes) {
|
|
2606
|
+
super();
|
|
2607
|
+
this.type = ModifyContentActionType.REPLACE_CHILD_NODES;
|
|
2608
|
+
this.newChildNodes = newChildNodes;
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
/**
|
|
2613
|
+
* Split the current node with a special position strategy.
|
|
2614
|
+
*/
|
|
2615
|
+
class BlockSplitWithTextNodeStrategy extends ActionHandleStrategy {
|
|
2616
|
+
/**
|
|
2617
|
+
* @inheritDoc
|
|
2618
|
+
*/
|
|
2619
|
+
handleAction(action, target) {
|
|
2620
|
+
action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode, target);
|
|
2621
|
+
}
|
|
2622
|
+
/**
|
|
2623
|
+
* Splits a text node at a specified offset within a block of nodes and returns a new block with the split nodes.
|
|
2624
|
+
*
|
|
2625
|
+
* @param {RTETextNode} splitNode - The text node that will be split
|
|
2626
|
+
* @param {number} startOffsetOfNode - The index at which will split the text content of the `splitNode`.
|
|
2627
|
+
* @param {RTETextBlock} textBlock - The text block need to be splited.
|
|
2628
|
+
* @returns {Nullable<RTEBlock>} return either an RTEBlock object or null.
|
|
2629
|
+
*/
|
|
2630
|
+
splitTextNodeBlock(splitNode, startOffsetOfNode, textBlock) {
|
|
2631
|
+
if (splitNode) {
|
|
2632
|
+
const beforeText = splitNode.text.slice(0, startOffsetOfNode);
|
|
2633
|
+
const afterText = splitNode.text.slice(startOffsetOfNode);
|
|
2634
|
+
const nodesSplitIndex = textBlock.children.indexOf(splitNode);
|
|
2635
|
+
if (nodesSplitIndex > -1) {
|
|
2636
|
+
const beforeNodes = textBlock.children.slice(0, nodesSplitIndex);
|
|
2637
|
+
const afterNodes = textBlock.children.slice(nodesSplitIndex + 1);
|
|
2638
|
+
if (splitNode.isContentEditable()) {
|
|
2639
|
+
if (beforeText) {
|
|
2640
|
+
beforeNodes.push(splitNode.cloneWithText(beforeText));
|
|
2641
|
+
}
|
|
2642
|
+
if (afterText) {
|
|
2643
|
+
afterNodes.unshift(splitNode.cloneWithText(afterText));
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
else {
|
|
2647
|
+
startOffsetOfNode > 0 ? beforeNodes.push(splitNode) : afterNodes.unshift(splitNode);
|
|
2648
|
+
}
|
|
2649
|
+
textBlock.apply(new ReplaceChildNodesAction(beforeNodes));
|
|
2650
|
+
const newBlock = textBlock.cloneWithNodes(afterNodes);
|
|
2651
|
+
textBlock.parent.apply(new InsertChildrenAfterAction(textBlock, newBlock));
|
|
2652
|
+
return newBlock;
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
/**
|
|
2659
|
+
* Remove all nodes and append new nodes strategy.
|
|
2660
|
+
*/
|
|
2661
|
+
class BlockReplaceNodesStrategy extends ActionHandleStrategy {
|
|
2662
|
+
/**
|
|
2663
|
+
* Empty the text block or image block nodes and add new nodes.
|
|
2664
|
+
*
|
|
2665
|
+
* @param {ReplaceChildNodesAction} action - The replace child nodes action instance.
|
|
2666
|
+
* @param {RTETextBlock | RTEImageBlock} target - The text block or the image block.
|
|
2667
|
+
*/
|
|
2668
|
+
handleAction(action, target) {
|
|
2669
|
+
target.children = [];
|
|
2670
|
+
target.apply(new AppendChildrenAction(action.newChildNodes));
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* Remove a children from the current block
|
|
2676
|
+
*
|
|
2677
|
+
* @example needRemovedChildren.parent.apply(new RemoveChildrenAction(needRemovedChildren))
|
|
2678
|
+
*/
|
|
2679
|
+
class RemoveChildrenAction extends ModifyContentAction {
|
|
2680
|
+
constructor(childNode) {
|
|
2681
|
+
super();
|
|
2682
|
+
this.type = ModifyContentActionType.DELETE_CHILDREN;
|
|
2683
|
+
this.entityToBeRemoved = childNode;
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
/**
|
|
2688
|
+
* Annotation to represent a selection range
|
|
2689
|
+
*/
|
|
2690
|
+
class SelectionRangeAnnotation extends Annotation {
|
|
2691
|
+
constructor(range) {
|
|
2692
|
+
super();
|
|
2693
|
+
this.type = InternalAnnotationTypeEnum.SELECTION_RANGE;
|
|
2694
|
+
this.range = range;
|
|
2695
|
+
}
|
|
2696
|
+
/**
|
|
2697
|
+
* Clone the selection range annotation
|
|
2698
|
+
*
|
|
2699
|
+
* @returns {SelectionRangeAnnotation} A cloned instance of the selection range annotation
|
|
2700
|
+
*/
|
|
2701
|
+
clone() {
|
|
2702
|
+
return new SelectionRangeAnnotation(this.range);
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
/**
|
|
2707
|
+
* Annotation to make text with strikethrough
|
|
2708
|
+
*/
|
|
2709
|
+
class StrikethroughAnnotation extends NodeAnnotation {
|
|
2134
2710
|
constructor(underline) {
|
|
2135
2711
|
super();
|
|
2136
|
-
this.type = NodeAnnotationTypeEnum.
|
|
2137
|
-
this.
|
|
2712
|
+
this.type = NodeAnnotationTypeEnum.STRIKETHROUGH;
|
|
2713
|
+
this.strikethrough = underline;
|
|
2138
2714
|
}
|
|
2139
2715
|
/**
|
|
2140
2716
|
* Generate the map item for the annotation
|
|
2141
2717
|
*
|
|
2142
|
-
* @param {boolean}
|
|
2143
|
-
* @returns {[NodeAnnotationTypeEnum.
|
|
2718
|
+
* @param {Nullable<boolean>} strikethrough - Strikethrough annotation
|
|
2719
|
+
* @returns {[NodeAnnotationTypeEnum.STRIKETHROUGH, StrikethroughAnnotation]} Map item for the annotation
|
|
2144
2720
|
*/
|
|
2145
|
-
static from(
|
|
2146
|
-
return [NodeAnnotationTypeEnum.
|
|
2721
|
+
static from(strikethrough) {
|
|
2722
|
+
return [NodeAnnotationTypeEnum.STRIKETHROUGH, new StrikethroughAnnotation(strikethrough)];
|
|
2147
2723
|
}
|
|
2148
2724
|
/**
|
|
2149
2725
|
* Generate the JSON representation of the annotation
|
|
@@ -2152,14 +2728,14 @@ class UnderlineAnnotation extends NodeAnnotation {
|
|
|
2152
2728
|
*/
|
|
2153
2729
|
toJSON() {
|
|
2154
2730
|
return {
|
|
2155
|
-
|
|
2731
|
+
strikethrough: this.strikethrough,
|
|
2156
2732
|
};
|
|
2157
2733
|
}
|
|
2158
2734
|
/**
|
|
2159
2735
|
* @inheritDoc
|
|
2160
2736
|
*/
|
|
2161
2737
|
clone() {
|
|
2162
|
-
return new
|
|
2738
|
+
return new StrikethroughAnnotation(this.strikethrough);
|
|
2163
2739
|
}
|
|
2164
2740
|
/**
|
|
2165
2741
|
* @inheritDoc
|
|
@@ -2167,7 +2743,7 @@ class UnderlineAnnotation extends NodeAnnotation {
|
|
|
2167
2743
|
renderClass(options) {
|
|
2168
2744
|
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
2169
2745
|
return null;
|
|
2170
|
-
return this.
|
|
2746
|
+
return this.strikethrough ? 'v-rte--strikethrough' : null;
|
|
2171
2747
|
}
|
|
2172
2748
|
/**
|
|
2173
2749
|
* @inheritDoc
|
|
@@ -2175,27 +2751,27 @@ class UnderlineAnnotation extends NodeAnnotation {
|
|
|
2175
2751
|
renderStyle(options) {
|
|
2176
2752
|
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
2177
2753
|
return null;
|
|
2178
|
-
return this.
|
|
2754
|
+
return this.strikethrough ? { textDecoration: STRIKETHROUGH_TEXT_DECORATION } : null;
|
|
2179
2755
|
}
|
|
2180
2756
|
}
|
|
2181
2757
|
|
|
2182
2758
|
/**
|
|
2183
|
-
* Annotation to make text
|
|
2759
|
+
* Annotation to make text with underline
|
|
2184
2760
|
*/
|
|
2185
|
-
class
|
|
2186
|
-
constructor(
|
|
2761
|
+
class UnderlineAnnotation extends NodeAnnotation {
|
|
2762
|
+
constructor(underline) {
|
|
2187
2763
|
super();
|
|
2188
|
-
this.type = NodeAnnotationTypeEnum.
|
|
2189
|
-
this.
|
|
2764
|
+
this.type = NodeAnnotationTypeEnum.UNDERLINE;
|
|
2765
|
+
this.underline = underline;
|
|
2190
2766
|
}
|
|
2191
2767
|
/**
|
|
2192
2768
|
* Generate the map item for the annotation
|
|
2193
2769
|
*
|
|
2194
|
-
* @param {boolean}
|
|
2195
|
-
* @returns {[NodeAnnotationTypeEnum.
|
|
2770
|
+
* @param {boolean} underline - Underline annotation
|
|
2771
|
+
* @returns {[NodeAnnotationTypeEnum.UNDERLINE, UnderlineAnnotation]} Map item for the annotation
|
|
2196
2772
|
*/
|
|
2197
|
-
static from(
|
|
2198
|
-
return [NodeAnnotationTypeEnum.
|
|
2773
|
+
static from(underline) {
|
|
2774
|
+
return [NodeAnnotationTypeEnum.UNDERLINE, new UnderlineAnnotation(underline)];
|
|
2199
2775
|
}
|
|
2200
2776
|
/**
|
|
2201
2777
|
* Generate the JSON representation of the annotation
|
|
@@ -2204,14 +2780,14 @@ class ItalicAnnotation extends NodeAnnotation {
|
|
|
2204
2780
|
*/
|
|
2205
2781
|
toJSON() {
|
|
2206
2782
|
return {
|
|
2207
|
-
|
|
2783
|
+
underline: this.underline,
|
|
2208
2784
|
};
|
|
2209
2785
|
}
|
|
2210
2786
|
/**
|
|
2211
2787
|
* @inheritDoc
|
|
2212
2788
|
*/
|
|
2213
2789
|
clone() {
|
|
2214
|
-
return new
|
|
2790
|
+
return new UnderlineAnnotation(this.underline);
|
|
2215
2791
|
}
|
|
2216
2792
|
/**
|
|
2217
2793
|
* @inheritDoc
|
|
@@ -2219,7 +2795,7 @@ class ItalicAnnotation extends NodeAnnotation {
|
|
|
2219
2795
|
renderClass(options) {
|
|
2220
2796
|
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
2221
2797
|
return null;
|
|
2222
|
-
return this.
|
|
2798
|
+
return this.underline ? 'v-rte--underline' : null;
|
|
2223
2799
|
}
|
|
2224
2800
|
/**
|
|
2225
2801
|
* @inheritDoc
|
|
@@ -2227,27 +2803,27 @@ class ItalicAnnotation extends NodeAnnotation {
|
|
|
2227
2803
|
renderStyle(options) {
|
|
2228
2804
|
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
2229
2805
|
return null;
|
|
2230
|
-
return this.
|
|
2806
|
+
return this.underline ? { textDecoration: UNDERLINE_TEXT_DECORATION } : null;
|
|
2231
2807
|
}
|
|
2232
2808
|
}
|
|
2233
2809
|
|
|
2234
2810
|
/**
|
|
2235
|
-
* Annotation to make text
|
|
2811
|
+
* Annotation to make text Italic
|
|
2236
2812
|
*/
|
|
2237
|
-
class
|
|
2238
|
-
constructor(
|
|
2813
|
+
class ItalicAnnotation extends NodeAnnotation {
|
|
2814
|
+
constructor(italic) {
|
|
2239
2815
|
super();
|
|
2240
|
-
this.type = NodeAnnotationTypeEnum.
|
|
2241
|
-
this.
|
|
2816
|
+
this.type = NodeAnnotationTypeEnum.ITALIC;
|
|
2817
|
+
this.italic = italic;
|
|
2242
2818
|
}
|
|
2243
2819
|
/**
|
|
2244
2820
|
* Generate the map item for the annotation
|
|
2245
2821
|
*
|
|
2246
|
-
* @param {boolean}
|
|
2247
|
-
* @returns {[NodeAnnotationTypeEnum.
|
|
2822
|
+
* @param {boolean} italic - Italic annotation
|
|
2823
|
+
* @returns {[NodeAnnotationTypeEnum.ITALIC, ItalicAnnotation]} Map item for the annotation
|
|
2248
2824
|
*/
|
|
2249
|
-
static from(
|
|
2250
|
-
return [NodeAnnotationTypeEnum.
|
|
2825
|
+
static from(italic) {
|
|
2826
|
+
return [NodeAnnotationTypeEnum.ITALIC, new ItalicAnnotation(italic)];
|
|
2251
2827
|
}
|
|
2252
2828
|
/**
|
|
2253
2829
|
* Generate the JSON representation of the annotation
|
|
@@ -2256,14 +2832,14 @@ class BoldAnnotation extends NodeAnnotation {
|
|
|
2256
2832
|
*/
|
|
2257
2833
|
toJSON() {
|
|
2258
2834
|
return {
|
|
2259
|
-
|
|
2835
|
+
italic: this.italic,
|
|
2260
2836
|
};
|
|
2261
2837
|
}
|
|
2262
2838
|
/**
|
|
2263
2839
|
* @inheritDoc
|
|
2264
2840
|
*/
|
|
2265
2841
|
clone() {
|
|
2266
|
-
return new
|
|
2842
|
+
return new ItalicAnnotation(this.italic);
|
|
2267
2843
|
}
|
|
2268
2844
|
/**
|
|
2269
2845
|
* @inheritDoc
|
|
@@ -2271,7 +2847,7 @@ class BoldAnnotation extends NodeAnnotation {
|
|
|
2271
2847
|
renderClass(options) {
|
|
2272
2848
|
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
2273
2849
|
return null;
|
|
2274
|
-
return this.
|
|
2850
|
+
return this.italic ? 'v-rte--italic' : null;
|
|
2275
2851
|
}
|
|
2276
2852
|
/**
|
|
2277
2853
|
* @inheritDoc
|
|
@@ -2279,7 +2855,7 @@ class BoldAnnotation extends NodeAnnotation {
|
|
|
2279
2855
|
renderStyle(options) {
|
|
2280
2856
|
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
2281
2857
|
return null;
|
|
2282
|
-
return this.
|
|
2858
|
+
return this.italic ? { fontStyle: ITALIC_FONT_STYLE } : null;
|
|
2283
2859
|
}
|
|
2284
2860
|
}
|
|
2285
2861
|
|
|
@@ -2382,6 +2958,14 @@ const RTE_TEXT_COLORS = [
|
|
|
2382
2958
|
},
|
|
2383
2959
|
];
|
|
2384
2960
|
const ZERO_WIDTH_SPACE = '\u200b';
|
|
2961
|
+
// Identifies the input source that triggered a value flush.
|
|
2962
|
+
var RTEUpdateSource;
|
|
2963
|
+
(function (RTEUpdateSource) {
|
|
2964
|
+
RTEUpdateSource["Default"] = "default";
|
|
2965
|
+
RTEUpdateSource["Composition"] = "composition";
|
|
2966
|
+
})(RTEUpdateSource || (RTEUpdateSource = {}));
|
|
2967
|
+
// Event property key used to carry the update source across the synthetic beforeinput event.
|
|
2968
|
+
const RTE_UPDATE_SOURCE_KEY = '__updateSource';
|
|
2385
2969
|
const VegaRTEDefaultTextStyleItems = [
|
|
2386
2970
|
{ key: 'title' },
|
|
2387
2971
|
{ key: 'subtitle' },
|
|
@@ -2440,114 +3024,45 @@ const RTE_BLOCK_BOUNDARY_ATTRIBUTE = 'data-vega-rte-block-boundary';
|
|
|
2440
3024
|
*/
|
|
2441
3025
|
const RTE_PASTE_MODE_DATA_TYPE = 'application/x-vega-rte-paste-mode';
|
|
2442
3026
|
/**
|
|
2443
|
-
* Custom DataTransfer MIME type value used to indicate that the paste content
|
|
2444
|
-
* originated from Microsoft Word.
|
|
2445
|
-
*/
|
|
2446
|
-
const RTE_PASTE_MODE_WORD = 'word';
|
|
2447
|
-
|
|
2448
|
-
/**
|
|
2449
|
-
* Annotation to make text with text color
|
|
2450
|
-
*/
|
|
2451
|
-
class TextColorAnnotation extends NodeAnnotation {
|
|
2452
|
-
constructor(textColor) {
|
|
2453
|
-
super();
|
|
2454
|
-
this.type = NodeAnnotationTypeEnum.TEXT_COLOR;
|
|
2455
|
-
this.textColor = this.formatTextColor(textColor);
|
|
2456
|
-
}
|
|
2457
|
-
/**
|
|
2458
|
-
* Generate the map item for the annotation
|
|
2459
|
-
*
|
|
2460
|
-
* @param {string} textColor - text color annotation
|
|
2461
|
-
* @returns {[NodeAnnotationTypeEnum.TEXT_COLOR, TextColorAnnotation]} Map item for the annotation
|
|
2462
|
-
*/
|
|
2463
|
-
static from(textColor) {
|
|
2464
|
-
return [NodeAnnotationTypeEnum.TEXT_COLOR, new TextColorAnnotation(textColor)];
|
|
2465
|
-
}
|
|
2466
|
-
/**
|
|
2467
|
-
* Generate the JSON representation of the annotation
|
|
2468
|
-
*
|
|
2469
|
-
* @returns {Record<string, unknown>} JSON representation of the annotation
|
|
2470
|
-
*/
|
|
2471
|
-
toJSON() {
|
|
2472
|
-
return {
|
|
2473
|
-
textColor: this.textColor.key,
|
|
2474
|
-
};
|
|
2475
|
-
}
|
|
2476
|
-
/**
|
|
2477
|
-
* @inheritDoc
|
|
2478
|
-
*/
|
|
2479
|
-
clone() {
|
|
2480
|
-
return new TextColorAnnotation(this.textColor.key);
|
|
2481
|
-
}
|
|
2482
|
-
/**
|
|
2483
|
-
* @inheritDoc
|
|
2484
|
-
*/
|
|
2485
|
-
renderClass() {
|
|
2486
|
-
return null;
|
|
2487
|
-
}
|
|
2488
|
-
/**
|
|
2489
|
-
* @inheritDoc
|
|
2490
|
-
*/
|
|
2491
|
-
renderStyle() {
|
|
2492
|
-
return {
|
|
2493
|
-
color: VegaInternalThemeManager.isDarkMode() ? this.textColor.dark : this.textColor.light,
|
|
2494
|
-
};
|
|
2495
|
-
}
|
|
2496
|
-
/**
|
|
2497
|
-
* format text color
|
|
2498
|
-
*
|
|
2499
|
-
* @param {string} textColor - text color
|
|
2500
|
-
* @returns {VegaRTEColorSchema} - VegaRTEColorSchema
|
|
2501
|
-
*/
|
|
2502
|
-
formatTextColor(textColor) {
|
|
2503
|
-
return (RTE_TEXT_COLORS.find((item) => item.key === textColor) || RTE_TEXT_COLORS[0]);
|
|
2504
|
-
}
|
|
2505
|
-
}
|
|
3027
|
+
* Custom DataTransfer MIME type value used to indicate that the paste content
|
|
3028
|
+
* originated from Microsoft Word.
|
|
3029
|
+
*/
|
|
3030
|
+
const RTE_PASTE_MODE_WORD = 'word';
|
|
3031
|
+
const RTE_WORD_COUNT_KEY = 'rte-word-count';
|
|
2506
3032
|
|
|
2507
3033
|
/**
|
|
2508
|
-
* Annotation to make text
|
|
3034
|
+
* Annotation to make text with text color
|
|
2509
3035
|
*/
|
|
2510
|
-
class
|
|
2511
|
-
constructor(
|
|
3036
|
+
class TextColorAnnotation extends NodeAnnotation {
|
|
3037
|
+
constructor(textColor) {
|
|
2512
3038
|
super();
|
|
2513
|
-
this.type = NodeAnnotationTypeEnum.
|
|
2514
|
-
this.
|
|
2515
|
-
this.useInternalStyle = useInternalStyle;
|
|
3039
|
+
this.type = NodeAnnotationTypeEnum.TEXT_COLOR;
|
|
3040
|
+
this.textColor = this.formatTextColor(textColor);
|
|
2516
3041
|
}
|
|
2517
3042
|
/**
|
|
2518
3043
|
* Generate the map item for the annotation
|
|
2519
3044
|
*
|
|
2520
|
-
* @param {
|
|
2521
|
-
* @
|
|
2522
|
-
* @returns {[NodeAnnotationTypeEnum.LINK, LinkAnnotation]} Map item for the annotation
|
|
3045
|
+
* @param {string} textColor - text color annotation
|
|
3046
|
+
* @returns {[NodeAnnotationTypeEnum.TEXT_COLOR, TextColorAnnotation]} Map item for the annotation
|
|
2523
3047
|
*/
|
|
2524
|
-
static from(
|
|
2525
|
-
return [NodeAnnotationTypeEnum.
|
|
3048
|
+
static from(textColor) {
|
|
3049
|
+
return [NodeAnnotationTypeEnum.TEXT_COLOR, new TextColorAnnotation(textColor)];
|
|
2526
3050
|
}
|
|
2527
3051
|
/**
|
|
2528
3052
|
* Generate the JSON representation of the annotation
|
|
2529
3053
|
*
|
|
2530
|
-
* @returns {Record<
|
|
3054
|
+
* @returns {Record<string, unknown>} JSON representation of the annotation
|
|
2531
3055
|
*/
|
|
2532
3056
|
toJSON() {
|
|
2533
3057
|
return {
|
|
2534
|
-
|
|
3058
|
+
textColor: this.textColor.key,
|
|
2535
3059
|
};
|
|
2536
3060
|
}
|
|
2537
3061
|
/**
|
|
2538
3062
|
* @inheritDoc
|
|
2539
3063
|
*/
|
|
2540
3064
|
clone() {
|
|
2541
|
-
return new
|
|
2542
|
-
}
|
|
2543
|
-
/**
|
|
2544
|
-
* Verify whether two link annotation is same or not
|
|
2545
|
-
*
|
|
2546
|
-
* @param {LinkAnnotation} annotation - Compared annotation
|
|
2547
|
-
* @returns {boolean} Whether two link annotation is same or not
|
|
2548
|
-
*/
|
|
2549
|
-
toEqual(annotation) {
|
|
2550
|
-
return this.link.groupKey === annotation.link.groupKey;
|
|
3065
|
+
return new TextColorAnnotation(this.textColor.key);
|
|
2551
3066
|
}
|
|
2552
3067
|
/**
|
|
2553
3068
|
* @inheritDoc
|
|
@@ -2559,28 +3074,18 @@ class LinkAnnotation extends NodeAnnotation {
|
|
|
2559
3074
|
* @inheritDoc
|
|
2560
3075
|
*/
|
|
2561
3076
|
renderStyle() {
|
|
2562
|
-
return
|
|
2563
|
-
|
|
2564
|
-
}
|
|
2565
|
-
|
|
2566
|
-
/**
|
|
2567
|
-
* Action to link a group of nodes
|
|
2568
|
-
*/
|
|
2569
|
-
class LinkGroupAnnotationAction extends AnnotationAction {
|
|
2570
|
-
constructor(groupKey, nodes, type) {
|
|
2571
|
-
super();
|
|
2572
|
-
this.isFlushable = false;
|
|
2573
|
-
this.groupKey = groupKey;
|
|
2574
|
-
this.nodes = nodes;
|
|
2575
|
-
this.type = type;
|
|
3077
|
+
return {
|
|
3078
|
+
color: VegaInternalThemeManager.isDarkMode() ? this.textColor.dark : this.textColor.light,
|
|
3079
|
+
};
|
|
2576
3080
|
}
|
|
2577
3081
|
/**
|
|
2578
|
-
*
|
|
3082
|
+
* format text color
|
|
2579
3083
|
*
|
|
2580
|
-
* @
|
|
3084
|
+
* @param {string} textColor - text color
|
|
3085
|
+
* @returns {VegaRTEColorSchema} - VegaRTEColorSchema
|
|
2581
3086
|
*/
|
|
2582
|
-
|
|
2583
|
-
return
|
|
3087
|
+
formatTextColor(textColor) {
|
|
3088
|
+
return (RTE_TEXT_COLORS.find((item) => item.key === textColor) || RTE_TEXT_COLORS[0]);
|
|
2584
3089
|
}
|
|
2585
3090
|
}
|
|
2586
3091
|
|
|
@@ -2602,139 +3107,6 @@ class SyncUpSelectionAction extends AnnotationAction {
|
|
|
2602
3107
|
}
|
|
2603
3108
|
}
|
|
2604
3109
|
|
|
2605
|
-
/**
|
|
2606
|
-
* The base action handle strategy class, use to modify the rich text node content or modify the annotation.
|
|
2607
|
-
*/
|
|
2608
|
-
class ActionHandleStrategy {
|
|
2609
|
-
/**
|
|
2610
|
-
* Public method to invoke the handle logic.
|
|
2611
|
-
*
|
|
2612
|
-
* @typedef R generic type
|
|
2613
|
-
* @param {ModifyContentAction | AnnotationAction} action - The action instance. Contains the action type and necessary params.
|
|
2614
|
-
* @param {RTENode | RTEBlock | VegaRTEContent} target - The rich text node instance that will be modified.
|
|
2615
|
-
* @returns {R} - The invoke result in special strategy.
|
|
2616
|
-
*/
|
|
2617
|
-
execute(action, target) {
|
|
2618
|
-
LogUtility.log(`Executing action ${action.constructor.name} on ${target.constructor.name} ${target['id']}`);
|
|
2619
|
-
return this.handleAction(action, target);
|
|
2620
|
-
}
|
|
2621
|
-
/**
|
|
2622
|
-
* Update the custom style annotation of a block or node
|
|
2623
|
-
*
|
|
2624
|
-
* @param {RTEBlock | RTETextNode} item - block or node
|
|
2625
|
-
* @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
|
|
2626
|
-
*/
|
|
2627
|
-
updateCustomStyleAnnotation(item, styleKeys) {
|
|
2628
|
-
const customStyleAnnotation = item.annotationMap.get(CommonAnnotationTypeEnum.CUSTOM_STYLE);
|
|
2629
|
-
if (customStyleAnnotation && this.isCustomStyle(customStyleAnnotation, styleKeys)) {
|
|
2630
|
-
item.annotationMap.set(customStyleAnnotation.type, new CustomStyleAnnotation(customStyleAnnotation.removeStyles(styleKeys)));
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
/**
|
|
2634
|
-
* Create a new paragraph block with the given text.
|
|
2635
|
-
*
|
|
2636
|
-
* @param {string} text - The text content for the new paragraph.
|
|
2637
|
-
* @returns {Nullable<RTETextBlock>} - The newly created paragraph block, or null if creation failed.
|
|
2638
|
-
*/
|
|
2639
|
-
createNewParagraph(text) {
|
|
2640
|
-
const dtoClass = RTEDTOClassManager$1.getRTEBlockClass('paragraph');
|
|
2641
|
-
if (dtoClass) {
|
|
2642
|
-
const newParagraph = dtoClass.from({
|
|
2643
|
-
id: generateUUID(),
|
|
2644
|
-
type: 'paragraph',
|
|
2645
|
-
nodes: [{ id: generateUUID(), type: 'text', text }],
|
|
2646
|
-
});
|
|
2647
|
-
return newParagraph;
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
/**
|
|
2651
|
-
* Get the root content from a child block or node.
|
|
2652
|
-
*
|
|
2653
|
-
* @param {RTEBlock | RTENode} child - The child block or node.
|
|
2654
|
-
* @returns {Nullable<VegaRTEContent>} The root content, if found.
|
|
2655
|
-
*/
|
|
2656
|
-
getRootContent(child) {
|
|
2657
|
-
const parent = child.parent;
|
|
2658
|
-
if (parent) {
|
|
2659
|
-
if (parent.dtoName === 'VegaRTEContent') {
|
|
2660
|
-
return parent;
|
|
2661
|
-
}
|
|
2662
|
-
else {
|
|
2663
|
-
return this.getRootContent(parent);
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
}
|
|
2667
|
-
/**
|
|
2668
|
-
* Check the caret position at the start of a block.
|
|
2669
|
-
*
|
|
2670
|
-
* @param {RTEBlock} block - The RTE Block.
|
|
2671
|
-
* @param {RTENode} node - The RTE Node.
|
|
2672
|
-
* @param {number} offset - The offset position.
|
|
2673
|
-
* @returns {boolean} - Whether the caret is at the start of the block.
|
|
2674
|
-
*/
|
|
2675
|
-
isCaretPositionAtBlockStart(block, node, offset) {
|
|
2676
|
-
return node === block.children[0] && offset === 0;
|
|
2677
|
-
}
|
|
2678
|
-
/**
|
|
2679
|
-
* Check the caret position at the end of a block.
|
|
2680
|
-
*
|
|
2681
|
-
* @param {RTEBlock} block - The RTE Block.
|
|
2682
|
-
* @param {RTENode} node - The RTE Node.
|
|
2683
|
-
* @param {number} offset - The offset position.
|
|
2684
|
-
* @returns {boolean} - Whether the caret is at the end of the block.
|
|
2685
|
-
*/
|
|
2686
|
-
isCaretPositionAtBlockEnd(block, node, offset) {
|
|
2687
|
-
if (!node.isContentEditable()) {
|
|
2688
|
-
return this.isCaretPositionAtDecoratorBlockEnd(block, node, offset);
|
|
2689
|
-
}
|
|
2690
|
-
else {
|
|
2691
|
-
return this.isCaretPositionAtTextBlockEnd(block, node, offset);
|
|
2692
|
-
}
|
|
2693
|
-
}
|
|
2694
|
-
/**
|
|
2695
|
-
* Get the registered DOM element by the RTE entity.
|
|
2696
|
-
*
|
|
2697
|
-
* @param {RTEBlock | RTENode} instance - The RTE block or node instance.
|
|
2698
|
-
* @returns {Nullable<HTMLElement>} The registered DOM element.
|
|
2699
|
-
*/
|
|
2700
|
-
getDOMByEntity(instance) {
|
|
2701
|
-
return stateEntityRenderingRegistry.getDOMByEntity(instance);
|
|
2702
|
-
}
|
|
2703
|
-
/**
|
|
2704
|
-
* Checks if the caret position is at the end of a specified RTETextNode.
|
|
2705
|
-
*
|
|
2706
|
-
* @param {RTETextBlock} textBlock - `RTETextBlock` - a text block.
|
|
2707
|
-
* @param {RTETextNode} node - `RTETextNode` - a node representing an image in a rich text editor.
|
|
2708
|
-
* @param {number} startOffset - The position within the text node where the caret is located.
|
|
2709
|
-
* @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTETextNode.
|
|
2710
|
-
*/
|
|
2711
|
-
isCaretPositionAtTextBlockEnd(textBlock, node, startOffset) {
|
|
2712
|
-
const lastNode = textBlock.children[textBlock.children.length - 1];
|
|
2713
|
-
return node === lastNode && (node.isEmpty() || startOffset === lastNode.text.length);
|
|
2714
|
-
}
|
|
2715
|
-
/**
|
|
2716
|
-
* Checks if the caret position is at the end of a given decorator node.
|
|
2717
|
-
*
|
|
2718
|
-
* @param {RTEBlock} target - The image block.
|
|
2719
|
-
* @param {RTENode} node - `node` is a RTEDecoratorNode or non-editable text node.
|
|
2720
|
-
* @param {number} startOffset - The position within the `RTEDecoratorNode` where the caret is located.
|
|
2721
|
-
* @returns {boolean}Returns a boolean value indicating whether the caret position is at the end of the `RTEDecoratorNode`.
|
|
2722
|
-
*/
|
|
2723
|
-
isCaretPositionAtDecoratorBlockEnd(target, node, startOffset) {
|
|
2724
|
-
return node === target.children[target.children.length - 1] && startOffset !== 0;
|
|
2725
|
-
}
|
|
2726
|
-
/**
|
|
2727
|
-
* Determines if the custom style annotation includes any the custom style.
|
|
2728
|
-
*
|
|
2729
|
-
* @param {CustomStyleAnnotation} customStyleAnnotation - custom style annotation
|
|
2730
|
-
* @param {string[]} styleKeys - custom style keys, for examples ['fontSize', 'fontWeight'].
|
|
2731
|
-
* @returns {boolean} - True if the custom key includes the custom style, false otherwise.
|
|
2732
|
-
*/
|
|
2733
|
-
isCustomStyle(customStyleAnnotation, styleKeys) {
|
|
2734
|
-
return styleKeys.some((item) => Object.keys(customStyleAnnotation.customStyle).includes(item));
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
|
|
2738
3110
|
/**
|
|
2739
3111
|
* Split the corresponding link group nodes *
|
|
2740
3112
|
*/
|
|
@@ -2884,25 +3256,6 @@ class NodeSplitTextStrategy extends ActionHandleStrategy {
|
|
|
2884
3256
|
}
|
|
2885
3257
|
}
|
|
2886
3258
|
|
|
2887
|
-
/**
|
|
2888
|
-
* Action to toggle bold annotation
|
|
2889
|
-
*/
|
|
2890
|
-
class BoldAnnotationAction extends TextSplittableAction {
|
|
2891
|
-
constructor(bold) {
|
|
2892
|
-
super();
|
|
2893
|
-
this.isFlushable = true;
|
|
2894
|
-
this.bold = bold;
|
|
2895
|
-
}
|
|
2896
|
-
/**
|
|
2897
|
-
* Converts the action to an annotation
|
|
2898
|
-
*
|
|
2899
|
-
* @returns {BoldAnnotation} the annotation
|
|
2900
|
-
*/
|
|
2901
|
-
toAnnotation() {
|
|
2902
|
-
return new BoldAnnotation(this.bold);
|
|
2903
|
-
}
|
|
2904
|
-
}
|
|
2905
|
-
|
|
2906
3259
|
/**
|
|
2907
3260
|
* Annotation to host which annotations will be clear formatting
|
|
2908
3261
|
*/
|
|
@@ -2959,66 +3312,22 @@ class CodeAnnotationAction extends TextSplittableAction {
|
|
|
2959
3312
|
}
|
|
2960
3313
|
}
|
|
2961
3314
|
|
|
2962
|
-
/**
|
|
2963
|
-
* Delete the node annotation by type
|
|
2964
|
-
*/
|
|
2965
|
-
class DeleteNodeAnnotationAction extends AnnotationAction {
|
|
2966
|
-
constructor(annotationType) {
|
|
2967
|
-
super();
|
|
2968
|
-
this.isFlushable = true;
|
|
2969
|
-
this.annotationType = annotationType;
|
|
2970
|
-
}
|
|
2971
|
-
/**
|
|
2972
|
-
* Don't need this for this action
|
|
2973
|
-
*
|
|
2974
|
-
* @returns {Nullable<Annotation>} undefined
|
|
2975
|
-
*/
|
|
2976
|
-
toAnnotation() {
|
|
2977
|
-
return undefined;
|
|
2978
|
-
}
|
|
2979
|
-
}
|
|
2980
|
-
|
|
2981
3315
|
/**
|
|
2982
3316
|
* Action to toggle the italic annotation
|
|
2983
3317
|
*/
|
|
2984
3318
|
class ItalicAnnotationAction extends TextSplittableAction {
|
|
2985
|
-
constructor(italic) {
|
|
2986
|
-
super();
|
|
2987
|
-
this.isFlushable = true;
|
|
2988
|
-
this.italic = italic;
|
|
2989
|
-
}
|
|
2990
|
-
/**
|
|
2991
|
-
* Converts the action to an annotation
|
|
2992
|
-
*
|
|
2993
|
-
* @returns {ItalicAnnotation} The annotation
|
|
2994
|
-
*/
|
|
2995
|
-
toAnnotation() {
|
|
2996
|
-
return new ItalicAnnotation(this.italic);
|
|
2997
|
-
}
|
|
2998
|
-
}
|
|
2999
|
-
|
|
3000
|
-
/**
|
|
3001
|
-
* Action to toggle link annotation
|
|
3002
|
-
*/
|
|
3003
|
-
class LinkAnnotationAction extends TextSplittableAction {
|
|
3004
|
-
constructor({ link, newText, needMergeNode, doSplit, type, }) {
|
|
3319
|
+
constructor(italic) {
|
|
3005
3320
|
super();
|
|
3006
3321
|
this.isFlushable = true;
|
|
3007
|
-
this.
|
|
3008
|
-
this.needMergeNode = needMergeNode;
|
|
3009
|
-
this.newText = newText;
|
|
3010
|
-
this.type = type;
|
|
3011
|
-
if (isNonNullable(doSplit)) {
|
|
3012
|
-
this.doSplit = doSplit;
|
|
3013
|
-
}
|
|
3322
|
+
this.italic = italic;
|
|
3014
3323
|
}
|
|
3015
3324
|
/**
|
|
3016
3325
|
* Converts the action to an annotation
|
|
3017
3326
|
*
|
|
3018
|
-
* @returns {
|
|
3327
|
+
* @returns {ItalicAnnotation} The annotation
|
|
3019
3328
|
*/
|
|
3020
3329
|
toAnnotation() {
|
|
3021
|
-
return new
|
|
3330
|
+
return new ItalicAnnotation(this.italic);
|
|
3022
3331
|
}
|
|
3023
3332
|
}
|
|
3024
3333
|
|
|
@@ -3571,6 +3880,12 @@ class RTETextNode extends RTENode {
|
|
|
3571
3880
|
isContentEditable() {
|
|
3572
3881
|
return true;
|
|
3573
3882
|
}
|
|
3883
|
+
/**
|
|
3884
|
+
* @inheritDoc
|
|
3885
|
+
*/
|
|
3886
|
+
getPlainText() {
|
|
3887
|
+
return this.text;
|
|
3888
|
+
}
|
|
3574
3889
|
/**
|
|
3575
3890
|
* Returns the inline HTML wrapper descriptor at the given depth in the
|
|
3576
3891
|
* annotation chain. Depth 0 is the outermost wrapper, depth 1 is its child, etc.
|
|
@@ -3674,413 +3989,132 @@ class RTETextNode extends RTENode {
|
|
|
3674
3989
|
/**
|
|
3675
3990
|
* @inheritDoc
|
|
3676
3991
|
*/
|
|
3677
|
-
doModifyActionApply(action) {
|
|
3678
|
-
ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
3679
|
-
}
|
|
3680
|
-
/**
|
|
3681
|
-
* Apply action to node
|
|
3682
|
-
*
|
|
3683
|
-
* @param {RTETextNode} node - Text node
|
|
3684
|
-
* @param {AnnotationAction} action - AnnotationAction
|
|
3685
|
-
*/
|
|
3686
|
-
applyActionToNode(node, action) {
|
|
3687
|
-
const annotation = action.toAnnotation();
|
|
3688
|
-
if (action instanceof SyncUpSelectionAction) {
|
|
3689
|
-
this.syncUpSelectedNodes(node);
|
|
3690
|
-
return;
|
|
3691
|
-
}
|
|
3692
|
-
// Sync up RTETextNode selected state to selection controller for any action apply, except selection range change.
|
|
3693
|
-
if (!(annotation instanceof SelectionRangeAnnotation)) {
|
|
3694
|
-
this.syncUpSelectedNodes(node);
|
|
3695
|
-
}
|
|
3696
|
-
/**
|
|
3697
|
-
* 1. Try to get the specific strategy for the action and node type first (e.g., LinkAnnotationAction on RTETextNode).
|
|
3698
|
-
* 2. If no specific strategy found, try to get the generic NodeUpdateAnnotationMapStrategy for AnnotationAction on RTETextNode.
|
|
3699
|
-
*/
|
|
3700
|
-
const strategy = ActionHandleStrategyRegistry.get(action.constructor.name, node.constructor.name);
|
|
3701
|
-
if (strategy) {
|
|
3702
|
-
strategy.execute(action, node);
|
|
3703
|
-
return;
|
|
3704
|
-
}
|
|
3705
|
-
const updateAnnotationMapStrategy = ActionHandleStrategyRegistry.get(AnnotationAction.name, RTETextNode.name);
|
|
3706
|
-
if (updateAnnotationMapStrategy) {
|
|
3707
|
-
updateAnnotationMapStrategy.execute(action, node);
|
|
3708
|
-
return;
|
|
3709
|
-
}
|
|
3710
|
-
}
|
|
3711
|
-
/**
|
|
3712
|
-
* Sync up the selected node by change manager
|
|
3713
|
-
*
|
|
3714
|
-
* @param {RTETextNode} selectedNode - The selected node
|
|
3715
|
-
*/
|
|
3716
|
-
syncUpSelectedNodes(selectedNode) {
|
|
3717
|
-
const currentNodeDom = this.getElementRef();
|
|
3718
|
-
if (currentNodeDom) {
|
|
3719
|
-
const nodeSubject = domNodeSubjectFactory.getSubjectFromParentNodeByEventId(currentNodeDom, VegaInternalRichTextEditorSelectionRangeChange);
|
|
3720
|
-
if (nodeSubject) {
|
|
3721
|
-
ChangeManager.notify(nodeSubject, { node: selectedNode });
|
|
3722
|
-
}
|
|
3723
|
-
}
|
|
3724
|
-
}
|
|
3725
|
-
/**
|
|
3726
|
-
* @param {InlineHtmlAnnotation} inlineHtmlNode - The inline HTML annotation to wrap the text node.
|
|
3727
|
-
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
|
|
3728
|
-
* @returns {string} The HTML string representation of the text node wrapped with the inline HTML.
|
|
3729
|
-
*/
|
|
3730
|
-
renderWithWrapperStr(inlineHtmlNode, options) {
|
|
3731
|
-
const { htmlTag, child } = inlineHtmlNode;
|
|
3732
|
-
const attrStr = this.annotationAttrStr(inlineHtmlNode);
|
|
3733
|
-
if (!child) {
|
|
3734
|
-
if (HTML_VOID_TAGS.has(htmlTag)) {
|
|
3735
|
-
return `<${htmlTag}${attrStr}>`;
|
|
3736
|
-
}
|
|
3737
|
-
if (!this.text) {
|
|
3738
|
-
return `<${htmlTag}${attrStr}></${htmlTag}>`;
|
|
3739
|
-
}
|
|
3740
|
-
return `<${htmlTag}${attrStr}>${this.renderTextStr(options)}</${htmlTag}>`;
|
|
3741
|
-
}
|
|
3742
|
-
return `<${htmlTag}${attrStr}>${this.renderWithWrapperStr(child, options)}</${htmlTag}>`;
|
|
3743
|
-
}
|
|
3744
|
-
/**
|
|
3745
|
-
* Generate the attribute string for the inline HTML annotation
|
|
3746
|
-
*
|
|
3747
|
-
* @param {InlineHtmlAnnotation} annotation - The inline HTML annotation
|
|
3748
|
-
* @returns {string} The attribute string for the inline HTML annotation
|
|
3749
|
-
*/
|
|
3750
|
-
annotationAttrStr(annotation) {
|
|
3751
|
-
const { customAttribute, customClass, customStyle } = annotation;
|
|
3752
|
-
const attrs = [
|
|
3753
|
-
...((customAttribute === null || customAttribute === void 0 ? void 0 : customAttribute.toString()) || []),
|
|
3754
|
-
customClass === null || customClass === void 0 ? void 0 : customClass.toString(),
|
|
3755
|
-
customStyle === null || customStyle === void 0 ? void 0 : customStyle.toString(),
|
|
3756
|
-
].filter(isNonNullable);
|
|
3757
|
-
return attrs.length > 0 ? ` ${attrs.join(' ')}` : '';
|
|
3758
|
-
}
|
|
3759
|
-
/**
|
|
3760
|
-
* Generates the HTML representation of the text node.
|
|
3761
|
-
*
|
|
3762
|
-
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
|
|
3763
|
-
* @returns {string} The HTML string representation of the text node.
|
|
3764
|
-
*/
|
|
3765
|
-
renderTextStr(options) {
|
|
3766
|
-
var _a;
|
|
3767
|
-
const NodeTag = ((_a = this.getAnnotationByType(NodeAnnotationTypeEnum.CODE)) === null || _a === void 0 ? void 0 : _a.code)
|
|
3768
|
-
? 'code'
|
|
3769
|
-
: 'span';
|
|
3770
|
-
const attrStr = super.generateAttributeString(options);
|
|
3771
|
-
// If the text contains a newline character, we need to replace it with a <br> tag.
|
|
3772
|
-
if (this.text === '\n') {
|
|
3773
|
-
return `<br>`;
|
|
3774
|
-
}
|
|
3775
|
-
if (this.shouldRenderAsPlainText()) {
|
|
3776
|
-
return this.text;
|
|
3777
|
-
}
|
|
3778
|
-
const content = NodeTag === 'code' ? escapeHtml(this.text) : this.text;
|
|
3779
|
-
return `<${NodeTag}${attrStr}>${content}</${NodeTag}>`;
|
|
3780
|
-
}
|
|
3781
|
-
/**
|
|
3782
|
-
* Determines if the text node should be rendered as plain text.
|
|
3783
|
-
*
|
|
3784
|
-
* @returns {boolean} `true` if the text node should be rendered as plain text, otherwise `false`.
|
|
3785
|
-
*/
|
|
3786
|
-
shouldRenderAsPlainText() {
|
|
3787
|
-
const plainTextAnnotation = super.getAnnotationByType(NodeAnnotationTypeEnum.PLAIN_TEXT);
|
|
3788
|
-
if (plainTextAnnotation) {
|
|
3789
|
-
return (plainTextAnnotation.plainText &&
|
|
3790
|
-
Array.from(this.annotationMap.values()).filter((annotation) => (annotation instanceof NodeAnnotation &&
|
|
3791
|
-
!(annotation instanceof LinkAnnotation) &&
|
|
3792
|
-
!(annotation instanceof PlainTextAnnotation)) ||
|
|
3793
|
-
annotation instanceof CommonAnnotation).length === 0);
|
|
3794
|
-
}
|
|
3795
|
-
else {
|
|
3796
|
-
return false;
|
|
3797
|
-
}
|
|
3798
|
-
}
|
|
3799
|
-
}
|
|
3800
|
-
RTETextNode.registerActionStrategyStatus = {};
|
|
3801
|
-
RTETextNode.htmlTag = 'span';
|
|
3802
|
-
RTETextNode.dtoName = 'RTETextNode';
|
|
3803
|
-
|
|
3804
|
-
/**
|
|
3805
|
-
* Append children to a block or rte content
|
|
3806
|
-
*
|
|
3807
|
-
* @example parent.apply(new AppendChildrenAction([newChildren]))
|
|
3808
|
-
*/
|
|
3809
|
-
class AppendChildrenAction extends ModifyContentAction {
|
|
3810
|
-
constructor(childNodes) {
|
|
3811
|
-
super();
|
|
3812
|
-
this.type = ModifyContentActionType.APPEND_CHILDREN;
|
|
3813
|
-
this.entityToBeAppended = childNodes;
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
|
|
3817
|
-
const TEXT_STYLE_DEFAULT_FONT_WEIGHT = '500';
|
|
3818
|
-
const TEXT_STYLE_BASE = {
|
|
3819
|
-
fontFamily: 'Inter',
|
|
3820
|
-
fontSize: '16px',
|
|
3821
|
-
lineHeight: '22px',
|
|
3822
|
-
minHeight: '22px',
|
|
3823
|
-
fontWeight: TEXT_STYLE_DEFAULT_FONT_WEIGHT,
|
|
3824
|
-
};
|
|
3825
|
-
const PARAGRAPH_TEXT_STYLE = Object.assign(Object.assign({}, TEXT_STYLE_BASE), { marginTop: '0px', marginBottom: '0px' });
|
|
3826
|
-
const TEXT_STYLE_DEFAULTS = {
|
|
3827
|
-
'paragraph': PARAGRAPH_TEXT_STYLE,
|
|
3828
|
-
'title': Object.assign(Object.assign({}, TEXT_STYLE_BASE), { fontSize: '36px', lineHeight: '40px', minHeight: '40px' }),
|
|
3829
|
-
'subtitle': Object.assign(Object.assign({}, TEXT_STYLE_BASE), { fontSize: '28px', lineHeight: '32px', minHeight: '32px' }),
|
|
3830
|
-
'heading-1': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '22px', lineHeight: '24px', minHeight: '24px' }),
|
|
3831
|
-
'heading-2': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '20px', lineHeight: '24px', minHeight: '24px' }),
|
|
3832
|
-
'heading-3': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '18px' }),
|
|
3833
|
-
'heading-4': Object.assign({}, PARAGRAPH_TEXT_STYLE),
|
|
3834
|
-
'heading-5': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '14px' }),
|
|
3835
|
-
'heading-6': Object.assign(Object.assign({}, PARAGRAPH_TEXT_STYLE), { fontSize: '12px' }),
|
|
3836
|
-
};
|
|
3837
|
-
|
|
3838
|
-
/**
|
|
3839
|
-
* Text style annotation
|
|
3840
|
-
*/
|
|
3841
|
-
class TextStyleAnnotation extends BlockAnnotation {
|
|
3842
|
-
constructor(textStyle) {
|
|
3843
|
-
super();
|
|
3844
|
-
this.type = BlockAnnotationTypeEnum.TEXT_STYLE;
|
|
3845
|
-
this.textStyle = textStyle;
|
|
3846
|
-
}
|
|
3847
|
-
/**
|
|
3848
|
-
* Generate the map item for the annotations
|
|
3849
|
-
*
|
|
3850
|
-
* @param {VegaRTETextStyleType} textStyle - the text style type
|
|
3851
|
-
* @returns {[BlockAnnotationTypeEnum.TEXT_STYLE, TextStyleAnnotation]} Map item for the annotation
|
|
3852
|
-
*/
|
|
3853
|
-
static from(textStyle) {
|
|
3854
|
-
return [BlockAnnotationTypeEnum.TEXT_STYLE, new TextStyleAnnotation(textStyle)];
|
|
3855
|
-
}
|
|
3856
|
-
/**
|
|
3857
|
-
* Get the default styles for a given text style type.
|
|
3858
|
-
*
|
|
3859
|
-
* @param {VegaRTETextStyleType} textStyle - The text style type.
|
|
3860
|
-
* @returns {Nullable<AnnotationStyle>} The default styles for the given text style type.
|
|
3861
|
-
*/
|
|
3862
|
-
static getDefaultStyles(textStyle) {
|
|
3863
|
-
if (!textStyle)
|
|
3864
|
-
return null;
|
|
3865
|
-
return TEXT_STYLE_DEFAULTS[textStyle];
|
|
3866
|
-
}
|
|
3867
|
-
/**
|
|
3868
|
-
* Generate the JSON representation of the annotation
|
|
3869
|
-
*
|
|
3870
|
-
* @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
|
|
3871
|
-
*/
|
|
3872
|
-
toJSON() {
|
|
3873
|
-
return { textStyle: this.textStyle };
|
|
3874
|
-
}
|
|
3875
|
-
/**
|
|
3876
|
-
* @inheritDoc
|
|
3877
|
-
*/
|
|
3878
|
-
clone() {
|
|
3879
|
-
return new TextStyleAnnotation(this.textStyle);
|
|
3880
|
-
}
|
|
3881
|
-
/**
|
|
3882
|
-
* @inheritDoc
|
|
3883
|
-
*/
|
|
3884
|
-
renderClass(options) {
|
|
3885
|
-
if (options === null || options === void 0 ? void 0 : options.standalone)
|
|
3886
|
-
return null;
|
|
3887
|
-
return this.textStyle ? `v-rte--text-style-${this.textStyle}` : null;
|
|
3888
|
-
}
|
|
3889
|
-
/**
|
|
3890
|
-
* @inheritDoc
|
|
3891
|
-
*/
|
|
3892
|
-
renderStyle(options) {
|
|
3893
|
-
if (!(options === null || options === void 0 ? void 0 : options.standalone))
|
|
3894
|
-
return null;
|
|
3895
|
-
return this.textStyle ? TextStyleAnnotation.getDefaultStyles(this.textStyle) : null;
|
|
3896
|
-
}
|
|
3897
|
-
}
|
|
3898
|
-
|
|
3899
|
-
/**
|
|
3900
|
-
* Action to change the text style of a block
|
|
3901
|
-
*/
|
|
3902
|
-
class TextStyleAnnotationAction extends AnnotationAction {
|
|
3903
|
-
constructor(textStyle, bold) {
|
|
3904
|
-
super();
|
|
3905
|
-
this.isFlushable = true;
|
|
3906
|
-
this.textStyle = textStyle;
|
|
3907
|
-
this.bold = bold;
|
|
3908
|
-
}
|
|
3909
|
-
/**
|
|
3910
|
-
* Converts the action to a block annotation
|
|
3911
|
-
*
|
|
3912
|
-
* @returns {BlockAnnotation} the block annotation
|
|
3913
|
-
*/
|
|
3914
|
-
toAnnotation() {
|
|
3915
|
-
return new TextStyleAnnotation(this.textStyle);
|
|
3992
|
+
doModifyActionApply(action) {
|
|
3993
|
+
ActionHandleStrategyRegistry.executeTheStrategy(action, this);
|
|
3916
3994
|
}
|
|
3917
|
-
}
|
|
3918
|
-
|
|
3919
|
-
/**
|
|
3920
|
-
* Update the text block text style strategy.
|
|
3921
|
-
*/
|
|
3922
|
-
class BlockUpdateTextStyleStrategy extends ActionHandleStrategy {
|
|
3923
3995
|
/**
|
|
3924
|
-
*
|
|
3996
|
+
* Apply action to node
|
|
3925
3997
|
*
|
|
3926
|
-
* @param {
|
|
3927
|
-
* @param {
|
|
3998
|
+
* @param {RTETextNode} node - Text node
|
|
3999
|
+
* @param {AnnotationAction} action - AnnotationAction
|
|
3928
4000
|
*/
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
4001
|
+
applyActionToNode(node, action) {
|
|
4002
|
+
const annotation = action.toAnnotation();
|
|
4003
|
+
if (action instanceof SyncUpSelectionAction) {
|
|
4004
|
+
this.syncUpSelectedNodes(node);
|
|
4005
|
+
return;
|
|
3932
4006
|
}
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
boldAnnotationAction.doSplit = false;
|
|
3937
|
-
node.apply(boldAnnotationAction);
|
|
3938
|
-
});
|
|
4007
|
+
// Sync up RTETextNode selected state to selection controller for any action apply, except selection range change.
|
|
4008
|
+
if (!(annotation instanceof SelectionRangeAnnotation)) {
|
|
4009
|
+
this.syncUpSelectedNodes(node);
|
|
3939
4010
|
}
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
4011
|
+
/**
|
|
4012
|
+
* 1. Try to get the specific strategy for the action and node type first (e.g., LinkAnnotationAction on RTETextNode).
|
|
4013
|
+
* 2. If no specific strategy found, try to get the generic NodeUpdateAnnotationMapStrategy for AnnotationAction on RTETextNode.
|
|
4014
|
+
*/
|
|
4015
|
+
const strategy = ActionHandleStrategyRegistry.get(action.constructor.name, node.constructor.name);
|
|
4016
|
+
if (strategy) {
|
|
4017
|
+
strategy.execute(action, node);
|
|
4018
|
+
return;
|
|
4019
|
+
}
|
|
4020
|
+
const updateAnnotationMapStrategy = ActionHandleStrategyRegistry.get(AnnotationAction.name, RTETextNode.name);
|
|
4021
|
+
if (updateAnnotationMapStrategy) {
|
|
4022
|
+
updateAnnotationMapStrategy.execute(action, node);
|
|
4023
|
+
return;
|
|
3944
4024
|
}
|
|
3945
|
-
this.updateCustomStyleAnnotation(target, ['fontFamily', 'lineHeight', 'fontWeight', 'fontSize']);
|
|
3946
4025
|
}
|
|
3947
|
-
}
|
|
3948
|
-
|
|
3949
|
-
/**
|
|
3950
|
-
* Update the text block link group annotation strategy.
|
|
3951
|
-
*/
|
|
3952
|
-
class BlockUpdateLinkGroupStrategy extends ActionHandleStrategy {
|
|
3953
4026
|
/**
|
|
3954
|
-
*
|
|
4027
|
+
* Sync up the selected node by change manager
|
|
3955
4028
|
*
|
|
3956
|
-
* @param {
|
|
3957
|
-
* @param {RTETextBlock} target - The current text block.
|
|
4029
|
+
* @param {RTETextNode} selectedNode - The selected node
|
|
3958
4030
|
*/
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
if (
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
linkGroupAnnotation.linkGroups.set(action.groupKey, [linkGroup[0]]);
|
|
3966
|
-
}
|
|
4031
|
+
syncUpSelectedNodes(selectedNode) {
|
|
4032
|
+
const currentNodeDom = this.getElementRef();
|
|
4033
|
+
if (currentNodeDom) {
|
|
4034
|
+
const nodeSubject = domNodeSubjectFactory.getSubjectFromParentNodeByEventId(currentNodeDom, VegaInternalRichTextEditorSelectionRangeChange);
|
|
4035
|
+
if (nodeSubject) {
|
|
4036
|
+
ChangeManager.notify(nodeSubject, { node: selectedNode });
|
|
3967
4037
|
}
|
|
3968
4038
|
}
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
4039
|
+
}
|
|
4040
|
+
/**
|
|
4041
|
+
* @param {InlineHtmlAnnotation} inlineHtmlNode - The inline HTML annotation to wrap the text node.
|
|
4042
|
+
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
|
|
4043
|
+
* @returns {string} The HTML string representation of the text node wrapped with the inline HTML.
|
|
4044
|
+
*/
|
|
4045
|
+
renderWithWrapperStr(inlineHtmlNode, options) {
|
|
4046
|
+
const { htmlTag, child } = inlineHtmlNode;
|
|
4047
|
+
const attrStr = this.annotationAttrStr(inlineHtmlNode);
|
|
4048
|
+
if (!child) {
|
|
4049
|
+
if (HTML_VOID_TAGS.has(htmlTag)) {
|
|
4050
|
+
return `<${htmlTag}${attrStr}>`;
|
|
3973
4051
|
}
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
linkGroupAnnotation.linkGroups.set(action.groupKey, [...action.nodes]);
|
|
4052
|
+
if (!this.text) {
|
|
4053
|
+
return `<${htmlTag}${attrStr}></${htmlTag}>`;
|
|
3977
4054
|
}
|
|
3978
|
-
|
|
4055
|
+
return `<${htmlTag}${attrStr}>${this.renderTextStr(options)}</${htmlTag}>`;
|
|
3979
4056
|
}
|
|
4057
|
+
return `<${htmlTag}${attrStr}>${this.renderWithWrapperStr(child, options)}</${htmlTag}>`;
|
|
3980
4058
|
}
|
|
3981
|
-
}
|
|
3982
|
-
|
|
3983
|
-
/**
|
|
3984
|
-
* Insert a new children after a existing children
|
|
3985
|
-
*
|
|
3986
|
-
* @example parent.apply(new InsertChildrenAfterAction(existingChildren, newChildren, ...))
|
|
3987
|
-
*/
|
|
3988
|
-
class InsertChildrenAfterAction extends ModifyContentAction {
|
|
3989
|
-
constructor(referBlock, ...blocksToBeInserted) {
|
|
3990
|
-
super();
|
|
3991
|
-
this.type = ModifyContentActionType.INSERT_CHILDREN_AFTER;
|
|
3992
|
-
this.referChildren = referBlock;
|
|
3993
|
-
this.childrenToBeInserted = blocksToBeInserted;
|
|
3994
|
-
}
|
|
3995
|
-
}
|
|
3996
|
-
|
|
3997
|
-
/**
|
|
3998
|
-
* Clear the current block nodes and append new nodes
|
|
3999
|
-
*
|
|
4000
|
-
* @example block.apply(new ReplaceChildNodesAction(newNodes))
|
|
4001
|
-
*/
|
|
4002
|
-
class ReplaceChildNodesAction extends ModifyContentAction {
|
|
4003
|
-
constructor(newChildNodes) {
|
|
4004
|
-
super();
|
|
4005
|
-
this.type = ModifyContentActionType.REPLACE_CHILD_NODES;
|
|
4006
|
-
this.newChildNodes = newChildNodes;
|
|
4007
|
-
}
|
|
4008
|
-
}
|
|
4009
|
-
|
|
4010
|
-
/**
|
|
4011
|
-
* Split the current node with a special position strategy.
|
|
4012
|
-
*/
|
|
4013
|
-
class BlockSplitWithTextNodeStrategy extends ActionHandleStrategy {
|
|
4014
4059
|
/**
|
|
4015
|
-
*
|
|
4060
|
+
* Generate the attribute string for the inline HTML annotation
|
|
4061
|
+
*
|
|
4062
|
+
* @param {InlineHtmlAnnotation} annotation - The inline HTML annotation
|
|
4063
|
+
* @returns {string} The attribute string for the inline HTML annotation
|
|
4016
4064
|
*/
|
|
4017
|
-
|
|
4018
|
-
|
|
4065
|
+
annotationAttrStr(annotation) {
|
|
4066
|
+
const { customAttribute, customClass, customStyle } = annotation;
|
|
4067
|
+
const attrs = [
|
|
4068
|
+
...((customAttribute === null || customAttribute === void 0 ? void 0 : customAttribute.toString()) || []),
|
|
4069
|
+
customClass === null || customClass === void 0 ? void 0 : customClass.toString(),
|
|
4070
|
+
customStyle === null || customStyle === void 0 ? void 0 : customStyle.toString(),
|
|
4071
|
+
].filter(isNonNullable);
|
|
4072
|
+
return attrs.length > 0 ? ` ${attrs.join(' ')}` : '';
|
|
4019
4073
|
}
|
|
4020
4074
|
/**
|
|
4021
|
-
*
|
|
4075
|
+
* Generates the HTML representation of the text node.
|
|
4022
4076
|
*
|
|
4023
|
-
* @param {
|
|
4024
|
-
* @
|
|
4025
|
-
* @param {RTETextBlock} textBlock - The text block need to be splited.
|
|
4026
|
-
* @returns {Nullable<RTEBlock>} return either an RTEBlock object or null.
|
|
4077
|
+
* @param {VegaRTETransformOptions} [options] - Optional conversion options that may affect how the text node is rendered as HTML.
|
|
4078
|
+
* @returns {string} The HTML string representation of the text node.
|
|
4027
4079
|
*/
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
if (afterText) {
|
|
4041
|
-
afterNodes.unshift(splitNode.cloneWithText(afterText));
|
|
4042
|
-
}
|
|
4043
|
-
}
|
|
4044
|
-
else {
|
|
4045
|
-
startOffsetOfNode > 0 ? beforeNodes.push(splitNode) : afterNodes.unshift(splitNode);
|
|
4046
|
-
}
|
|
4047
|
-
textBlock.apply(new ReplaceChildNodesAction(beforeNodes));
|
|
4048
|
-
const newBlock = textBlock.cloneWithNodes(afterNodes);
|
|
4049
|
-
textBlock.parent.apply(new InsertChildrenAfterAction(textBlock, newBlock));
|
|
4050
|
-
return newBlock;
|
|
4051
|
-
}
|
|
4080
|
+
renderTextStr(options) {
|
|
4081
|
+
var _a;
|
|
4082
|
+
const NodeTag = ((_a = this.getAnnotationByType(NodeAnnotationTypeEnum.CODE)) === null || _a === void 0 ? void 0 : _a.code)
|
|
4083
|
+
? 'code'
|
|
4084
|
+
: 'span';
|
|
4085
|
+
const attrStr = super.generateAttributeString(options);
|
|
4086
|
+
// If the text contains a newline character, we need to replace it with a <br> tag.
|
|
4087
|
+
if (this.text === '\n') {
|
|
4088
|
+
return `<br>`;
|
|
4089
|
+
}
|
|
4090
|
+
if (this.shouldRenderAsPlainText()) {
|
|
4091
|
+
return this.text;
|
|
4052
4092
|
}
|
|
4093
|
+
const content = NodeTag === 'code' ? escapeHtml(this.text) : this.text;
|
|
4094
|
+
return `<${NodeTag}${attrStr}>${content}</${NodeTag}>`;
|
|
4053
4095
|
}
|
|
4054
|
-
}
|
|
4055
|
-
|
|
4056
|
-
/**
|
|
4057
|
-
* Remove all nodes and append new nodes strategy.
|
|
4058
|
-
*/
|
|
4059
|
-
class BlockReplaceNodesStrategy extends ActionHandleStrategy {
|
|
4060
4096
|
/**
|
|
4061
|
-
*
|
|
4097
|
+
* Determines if the text node should be rendered as plain text.
|
|
4062
4098
|
*
|
|
4063
|
-
* @
|
|
4064
|
-
* @param {RTETextBlock | RTEImageBlock} target - The text block or the image block.
|
|
4099
|
+
* @returns {boolean} `true` if the text node should be rendered as plain text, otherwise `false`.
|
|
4065
4100
|
*/
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
constructor(childNode) {
|
|
4079
|
-
super();
|
|
4080
|
-
this.type = ModifyContentActionType.DELETE_CHILDREN;
|
|
4081
|
-
this.entityToBeRemoved = childNode;
|
|
4101
|
+
shouldRenderAsPlainText() {
|
|
4102
|
+
const plainTextAnnotation = super.getAnnotationByType(NodeAnnotationTypeEnum.PLAIN_TEXT);
|
|
4103
|
+
if (plainTextAnnotation) {
|
|
4104
|
+
return (plainTextAnnotation.plainText &&
|
|
4105
|
+
Array.from(this.annotationMap.values()).filter((annotation) => (annotation instanceof NodeAnnotation &&
|
|
4106
|
+
!(annotation instanceof LinkAnnotation) &&
|
|
4107
|
+
!(annotation instanceof PlainTextAnnotation)) ||
|
|
4108
|
+
annotation instanceof CommonAnnotation).length === 0);
|
|
4109
|
+
}
|
|
4110
|
+
else {
|
|
4111
|
+
return false;
|
|
4112
|
+
}
|
|
4082
4113
|
}
|
|
4083
4114
|
}
|
|
4115
|
+
RTETextNode.registerActionStrategyStatus = {};
|
|
4116
|
+
RTETextNode.htmlTag = 'span';
|
|
4117
|
+
RTETextNode.dtoName = 'RTETextNode';
|
|
4084
4118
|
|
|
4085
4119
|
/**
|
|
4086
4120
|
* Append the second block child nodes to the first block child nodes and remove the second block strategy.
|
|
@@ -4480,18 +4514,30 @@ class RTETextBlock extends RTEBlock {
|
|
|
4480
4514
|
const textBlock = new RTETextBlock(block.id, block.type, options);
|
|
4481
4515
|
const annotations = options.autoMatchFormat
|
|
4482
4516
|
? Object.assign(Object.assign({}, block.annotations), { textStyle: (_b = (_a = block.annotations) === null || _a === void 0 ? void 0 : _a.textStyle) !== null && _b !== void 0 ? _b : textBlock.type }) : block.annotations;
|
|
4483
|
-
textBlock.children = block.nodes
|
|
4517
|
+
textBlock.children = RTETextBlock.convertNodes(block.nodes, textBlock, options);
|
|
4518
|
+
if (annotations) {
|
|
4519
|
+
super.convertAnnotationsToMap(textBlock.annotationMap, annotations);
|
|
4520
|
+
}
|
|
4521
|
+
return textBlock;
|
|
4522
|
+
}
|
|
4523
|
+
/**
|
|
4524
|
+
* Convert raw node payloads to their registered `RTENode` subclasses via
|
|
4525
|
+
* `RTEDTOClassManager`, preserving custom types (e.g. `RTETokenNode`).
|
|
4526
|
+
*
|
|
4527
|
+
* @param {VegaRTETextNode[]} nodes - Raw node payloads.
|
|
4528
|
+
* @param {RTETextBlock} parent - Parent block for the converted nodes.
|
|
4529
|
+
* @param {VegaRTETransformOptions} [options] - Optional transform options.
|
|
4530
|
+
* @returns {RTETextNode[]} Converted nodes; unregistered types are dropped.
|
|
4531
|
+
*/
|
|
4532
|
+
static convertNodes(nodes, parent, options) {
|
|
4533
|
+
return nodes
|
|
4484
4534
|
.map((richText) => {
|
|
4485
4535
|
const NodeClass = RTEDTOClassManager$1.getRTENodeClass(richText.type);
|
|
4486
4536
|
if (NodeClass) {
|
|
4487
|
-
return NodeClass.from(richText,
|
|
4537
|
+
return NodeClass.from(richText, parent, options);
|
|
4488
4538
|
}
|
|
4489
4539
|
})
|
|
4490
4540
|
.filter(isNonNullable);
|
|
4491
|
-
if (annotations) {
|
|
4492
|
-
super.convertAnnotationsToMap(textBlock.annotationMap, annotations);
|
|
4493
|
-
}
|
|
4494
|
-
return textBlock;
|
|
4495
4541
|
}
|
|
4496
4542
|
/**
|
|
4497
4543
|
* The function `createAnnotationEntity` creates a block annotation entity based on the provided type
|
|
@@ -4923,7 +4969,7 @@ class RTEListItemBlock extends RTETextBlock {
|
|
|
4923
4969
|
*/
|
|
4924
4970
|
static from(block, options = { autoMatchFormat: true }) {
|
|
4925
4971
|
const listItemBlock = new RTEListItemBlock(block.id, undefined, options);
|
|
4926
|
-
listItemBlock.children = block.nodes
|
|
4972
|
+
listItemBlock.children = RTEListItemBlock.convertNodes(block.nodes, listItemBlock, options);
|
|
4927
4973
|
if (block.children) {
|
|
4928
4974
|
listItemBlock.nestList = block.children.map((child) => {
|
|
4929
4975
|
const listBlock = RTEListBlock.from(child, options);
|
|
@@ -4979,6 +5025,16 @@ class RTEListItemBlock extends RTETextBlock {
|
|
|
4979
5025
|
}
|
|
4980
5026
|
return super.getLastNode();
|
|
4981
5027
|
}
|
|
5028
|
+
/**
|
|
5029
|
+
* @inheritDoc
|
|
5030
|
+
*/
|
|
5031
|
+
getPlainText() {
|
|
5032
|
+
var _a;
|
|
5033
|
+
const nestListText = ((_a = this.nestList) !== null && _a !== void 0 ? _a : [])
|
|
5034
|
+
.map((list) => list.getPlainText())
|
|
5035
|
+
.join('');
|
|
5036
|
+
return super.getPlainText() + nestListText;
|
|
5037
|
+
}
|
|
4982
5038
|
/**
|
|
4983
5039
|
* Create a new list item block.
|
|
4984
5040
|
*
|
|
@@ -6581,6 +6637,12 @@ class RTECodeBlockNode extends RTEDecoratorNode {
|
|
|
6581
6637
|
toJSON() {
|
|
6582
6638
|
return { id: this.id, type: 'text', text: this.text, language: this.language };
|
|
6583
6639
|
}
|
|
6640
|
+
/**
|
|
6641
|
+
* @inheritDoc
|
|
6642
|
+
*/
|
|
6643
|
+
getPlainText() {
|
|
6644
|
+
return this.text;
|
|
6645
|
+
}
|
|
6584
6646
|
/**
|
|
6585
6647
|
* @inheritDoc
|
|
6586
6648
|
*/
|
|
@@ -6801,4 +6863,4 @@ class RTECodeBlock extends RTEBlock {
|
|
|
6801
6863
|
RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME = 'code-block-placeholder-element';
|
|
6802
6864
|
RTECodeBlock.dtoName = 'RTECodeBlock';
|
|
6803
6865
|
|
|
6804
|
-
export {
|
|
6866
|
+
export { ITALIC_FONT_STYLE as $, ActionHandleStrategyRegistry as A, BlockAnnotation as B, CommonAnnotationTypeEnum as C, CommonAnnotation as D, ReplaceChildNodesAction as E, BlockMergeNodesStrategy as F, BlockReplaceNodesStrategy as G, HTML_VOID_TAGS as H, InsertChildrenAfterAction as I, HorizontalAlignmentAnnotationAction as J, BlockUpdateHorizontalAlignmentStrategy as K, BlockDeleteNodeContentStrategy as L, ModifyContentAction as M, NodeAnnotationTypeEnum as N, RemoveChildrenStrategy as O, RemoveNestListAction as P, ReplaceNestListAction as Q, RTETextNode as R, SplitBlockWithNodeAction as S, RTEListBlock as T, UpdateTextAction as U, VegaRTEPresetToolbarItems as V, BOLD_FONT_WEIGHT_KEYWORD as W, BOLD_FONT_WEIGHT as X, createStyleMapFromElement as Y, RTE_TEXT_COLORS as Z, RTE_DEFAULT_TEXT_COLOR as _, RTEBlock as a, STRIKETHROUGH_TEXT_DECORATION as a0, UNDERLINE_TEXT_DECORATION as a1, TextStyleAnnotation as a2, RTEHtmlBlock as a3, Predicate as a4, ListAnnotation as a5, HorizontalAlignmentAnnotation as a6, CodeAnnotation as a7, TEXT_STYLE_DEFAULT_FONT_WEIGHT as a8, LinkFilterStylesStrategy as a9, RTE_PASTE_MODE_WORD as aA, RTE_UPDATE_SOURCE_KEY as aB, RTE_EMAIL_LINK_TYPE_KEY as aC, RTE_DEFAULT_LINK_TYPE_KEY as aD, RTE_SUPPORTED_LINK_TYPE_KEYS as aE, CodeBlockFilterStylesStrategy as aa, CodeBlockNodeFilterStylesStrategy as ab, SyncUpSelectionAction as ac, ActionHandlerInterceptorRegistry as ad, CodeLanguage as ae, CustomClassAnnotation as af, VegaRTEDefaultTextStyleItems as ag, ZERO_WIDTH_SPACE as ah, LinkAnnotationAction as ai, UpdateCodeBlockAction as aj, SelectionChangeAction as ak, TextColorAnnotationAction as al, VegaRTEOneRowHeightPx as am, BoldAnnotationAction as an, ItalicAnnotationAction as ao, UnderlineAnnotationAction as ap, TextStyleAnnotationAction as aq, BoldAnnotation as ar, BlockAnnotationTypeEnum as as, ClearFormattingAnnotationAction as at, CodeAnnotationAction as au, StrikethroughAnnotationAction as av, IndentAnnotationAction as aw, TransformParagraphAction as ax, RTEUpdateSource as ay, escapeHtml as az, RTETextBlock as b, RTE_BLOCK_BOUNDARY_ATTRIBUTE as c, RTEAnnotationStyle as d, ActionHandleStrategy as e, AppendChildrenAction as f, RTENode as g, InsertChildrenBeforeAction as h, InternalAnnotationTypeEnum as i, ModifyContentActionType as j, AnnotationAction as k, RemoveChildrenAction as l, CustomAttributeAnnotation as m, RTEDTOClassManager$1 as n, RTEFilterStylesStrategy as o, RTEDecoratorNode as p, RTECodeBlock as q, RTEListItemBlock as r, stateEntityRenderingRegistry as s, RTECodeBlockNode as t, CustomStyleAnnotation as u, RTEFilterStylesStrategyRegistry as v, RTE_PASTE_MODE_DATA_TYPE as w, RTE_WORD_COUNT_KEY as x, NodeAnnotation as y, NodeTypeEnum as z };
|