@globalpayments/vega 2.87.0 → 2.88.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/action-color-accessibility-validator-15fa91e4.js +1817 -0
- package/dist/cjs/{app-globals-885090b1.js → app-globals-6fbbcb2f.js} +16 -7
- package/dist/cjs/{child-nodes-event-prevent-slimmer-b7498e5a.js → child-nodes-event-prevent-slimmer-01930b4e.js} +1 -1
- package/dist/cjs/{code-block-15411c14.js → code-block-00fee034.js} +31 -13
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-5218e4b3.js → component-value-history-controller-slimmer.abstract-066645b3.js} +25 -5
- package/dist/cjs/{content-state-a69d99b4.js → content-state-d4f54659.js} +66 -54
- package/dist/cjs/{dark-mode-style-controller-bd765afb.js → dark-mode-style-controller-ed481250.js} +41 -2
- package/dist/cjs/{date-required-rule-d65727c5.js → date-required-rule-4cea8fc8.js} +1 -1
- package/dist/cjs/{design-token-3bc36220.js → design-token-ad9f413c.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-f86e6811.js → element-appender-slimmer-d04aa177.js} +2 -2
- package/dist/cjs/{event-emit-slimmer-73c42d7e.js → event-emit-slimmer-5fd6e54a.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-44091874.js → form-field-controller-slimmer-23d112bd.js} +1 -1
- package/dist/cjs/{image-annotation-action-aad07357.js → image-annotation-action-bcf2a1b4.js} +4 -4
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/index.cjs.js +27 -17
- package/dist/cjs/{inject-keyboard-manager-d06b337e.js → inject-keyboard-manager-acaf1530.js} +1 -1
- package/dist/cjs/{internal-translation-controller-f0da24b2.js → internal-translation-controller-a1250419.js} +8 -0
- package/dist/cjs/{internal-vega-event-manager-063c17cb.js → internal-vega-event-manager-c515cf5e.js} +2 -2
- package/dist/cjs/{keyboard-manager-1e045791.js → keyboard-manager-6821709a.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-861d991f.js → keyboard-manager-slimmer-74528545.js} +1 -1
- package/dist/cjs/loader.cjs.js +13 -12
- package/dist/cjs/{month-view-generator-8ed9818e.js → month-view-generator-61578283.js} +1 -1
- package/dist/cjs/{public-rules-c7726702.js → public-rules-d2fbbbf5.js} +8 -8
- package/dist/cjs/{range-d6fb50a4.js → range-e797475c.js} +1 -1
- package/dist/cjs/replace-selected-text-action-a098523f.js +20 -0
- package/dist/cjs/{responsive-format-facade-9647775d.js → responsive-format-facade-bf330592.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-a1a070ce.js → rich-text-editor-required-rule-ba9d42fa.js} +1 -1
- package/dist/cjs/{split-cell-operation-39b19943.js → split-cell-operation-91ee6894.js} +79 -16
- package/dist/cjs/{state-border-formatter-1a483a9b.js → state-border-formatter-fd194e53.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-2aec209d.js → string-format-strategy.abstract-af9fc35e.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-e061bd10.js → string-input-formatter-slimmer-a3fb1292.js} +1 -1
- package/dist/cjs/{string-mask-strategy-4bc07c00.js → string-mask-strategy-2054f3fb.js} +2 -2
- package/dist/cjs/{style-formatter-263d5eb6.js → style-formatter-7d60fb70.js} +2 -2
- package/dist/cjs/{time-required-rule-f9a7e897.js → time-required-rule-ba450bbd.js} +1 -1
- package/dist/cjs/{token-extension-927062b9.js → token-extension-8b69f7e1.js} +1136 -26
- package/dist/cjs/{translation-slimmer-a4a7f0eb.js → translation-slimmer-aee3fb1c.js} +1 -1
- package/dist/cjs/{type-guard-c1195e50.js → type-guard-424efe26.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-22f3e6cf.js → valid-credit-card-number-rule-6bd5834c.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +22 -15
- package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
- package/dist/cjs/vega-app-header-button.cjs.entry.js +9 -9
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- 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 +9 -9
- package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +7 -7
- package/dist/cjs/vega-calendar_4.cjs.entry.js +10 -10
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +6 -6
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-chip.cjs.entry.js +9 -9
- package/dist/cjs/vega-code-block.cjs.entry.js +16 -15
- package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +7 -7
- package/dist/cjs/vega-color-swatch.cjs.entry.js +5 -5
- package/dist/cjs/vega-combo-box.cjs.entry.js +23 -10
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +327 -267
- package/dist/cjs/vega-dialog_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-f95480b7.js → vega-event-id-39dedd17.js} +2 -0
- package/dist/cjs/vega-field-label.cjs.entry.js +22 -5
- package/dist/cjs/vega-file-uploader.cjs.entry.js +20 -7
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- 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 +7 -7
- 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 +10 -10
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-numeric.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-passcode.cjs.entry.js +23 -10
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +22 -9
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +9 -9
- package/dist/cjs/vega-input.cjs.entry.js +23 -10
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +8 -8
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +7 -7
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +289 -193
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +400 -0
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +12 -12
- package/dist/cjs/vega-section-title.cjs.entry.js +3 -2
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +6 -6
- package/dist/cjs/vega-signature-capture.cjs.entry.js +10 -10
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +8 -8
- package/dist/cjs/vega-textarea.cjs.entry.js +17 -7
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +13 -12
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +12 -5
- package/dist/collection/components/vega-accordion/vega-accordion.css +23 -0
- package/dist/collection/components/vega-accordion/vega-accordion.js +28 -0
- package/dist/collection/components/vega-box/vega-box.js +3 -3
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +2 -2
- package/dist/collection/components/vega-code-block/vega-code-block.js +4 -0
- package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-renderer.js +4 -1
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +34 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-size-controller.js +46 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.js +8 -4
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.js +3 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +0 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +67 -6
- package/dist/collection/components/vega-field-label/vega-field-label.css +37 -0
- package/dist/collection/components/vega-field-label/vega-field-label.js +40 -0
- package/dist/collection/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-renderer.js +4 -1
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +34 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-renderer.js +4 -1
- package/dist/collection/components/vega-input/vega-input.js +34 -0
- package/dist/collection/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.js +4 -1
- package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +34 -0
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/vega-input-phone-number-renderer.js +4 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/assets/redo.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/undo.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation-style.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-heading-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-title-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/predicate.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/paragraph-filter-styles-strategy.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/title-heading-node-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/setup.js +29 -29
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +105 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +50 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +4 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/action-handler-strategies/block-update-line-height-strategy.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/annotations/line-height-annotation.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/assets/line-height.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/constants.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-filter-styles-strategy.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-from-json-handler.js +65 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-extension.js +44 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +131 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/arrow-characters.js +24 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/currency-characters.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/default-categories.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/latin-characters.js +130 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/mathematical-characters.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/text-characters.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-icon.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.js +184 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/types.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/constants.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/controllers/special-characters-panel-keyboard-controller.js +85 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/renderers/special-characters-panel-renderer.js +210 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.css +66 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.js +174 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-block/table-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-caption/table-caption-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-cell/table-cell-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/public-api.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/bold-annotaion-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/code-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/color-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-alt-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-size-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/indent-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/italic-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/link-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/strike-through-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-align-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/underline-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/history-controller.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/redo-toolbar-button-slimmer.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/undo-toolbar-button-slimmer.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +44 -0
- package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +1 -1
- package/dist/collection/components/vega-section-title/vega-section-title.js +2 -1
- package/dist/collection/components/vega-textarea/vega-textarea.js +35 -1
- package/dist/collection/constants/runtime-metrics-payload-definition/public-api/ThemeManager/runtime-metrics-payload-definition.js +30 -10
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/scripts/before-vega-load.js +13 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -2
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/slimmers/component-value-history-controller-slimmer.abstract.js +22 -2
- package/dist/collection/helpers/theme/controllers/action-color-accessibility-validator.js +34 -0
- package/dist/collection/helpers/theme/internal-theme-manager.js +39 -2
- package/dist/collection/helpers/theme/theme-manager.js +33 -2
- package/dist/collection/helpers/translation/locales/en.js +8 -0
- package/dist/esm/action-color-accessibility-validator-3d8efb64.js +1815 -0
- package/dist/esm/{app-globals-be458779.js → app-globals-98c3d676.js} +16 -7
- package/dist/esm/{child-nodes-event-prevent-slimmer-0a406a71.js → child-nodes-event-prevent-slimmer-2f823df2.js} +1 -1
- package/dist/esm/{code-block-ff52d912.js → code-block-6261a99d.js} +32 -14
- package/dist/esm/{component-value-history-controller-slimmer.abstract-ad5f29cd.js → component-value-history-controller-slimmer.abstract-07488472.js} +25 -5
- package/dist/esm/{content-state-6fccd284.js → content-state-9bf85e00.js} +66 -54
- package/dist/esm/{dark-mode-style-controller-e9a6b097.js → dark-mode-style-controller-fcda24ec.js} +40 -3
- package/dist/esm/{date-required-rule-70324452.js → date-required-rule-281aab50.js} +1 -1
- package/dist/esm/{design-token-0e6fb2c4.js → design-token-b7ce7ed4.js} +3 -3
- package/dist/esm/{element-appender-slimmer-afe5a638.js → element-appender-slimmer-3926470f.js} +2 -2
- package/dist/esm/{event-emit-slimmer-697ad0b7.js → event-emit-slimmer-0990037c.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-9e70a18d.js → form-field-controller-slimmer-24aca6c4.js} +1 -1
- package/dist/esm/{image-annotation-action-245eaa54.js → image-annotation-action-dadda36f.js} +4 -4
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/index.js +18 -17
- package/dist/esm/{inject-keyboard-manager-05d5db90.js → inject-keyboard-manager-6317d1b3.js} +1 -1
- package/dist/esm/{internal-translation-controller-d8217d93.js → internal-translation-controller-0b9589d0.js} +8 -0
- package/dist/esm/{internal-vega-event-manager-1ac5ee9a.js → internal-vega-event-manager-dc4c3a37.js} +2 -2
- package/dist/esm/{keyboard-manager-26e2fc32.js → keyboard-manager-69761aa6.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-012a9a9b.js → keyboard-manager-slimmer-c2d038f0.js} +1 -1
- package/dist/esm/loader.js +13 -12
- package/dist/esm/{month-view-generator-918f1f88.js → month-view-generator-4c1ee949.js} +1 -1
- package/dist/esm/{public-rules-22320bdf.js → public-rules-da28b413.js} +8 -8
- package/dist/esm/{range-76f8e7dd.js → range-342cbce9.js} +1 -1
- package/dist/esm/replace-selected-text-action-a45bee4b.js +18 -0
- package/dist/esm/{responsive-format-facade-2a1d6398.js → responsive-format-facade-3ca1422d.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-6eb90840.js → rich-text-editor-required-rule-46d0bc5b.js} +1 -1
- package/dist/esm/{split-cell-operation-7652e813.js → split-cell-operation-1d114aa3.js} +79 -16
- package/dist/esm/{state-border-formatter-a243f3fc.js → state-border-formatter-3ebc76a4.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-f6625ed7.js → string-format-strategy.abstract-95d691e1.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-e801bd7e.js → string-input-formatter-slimmer-e18d202c.js} +1 -1
- package/dist/esm/{string-mask-strategy-53cb9b33.js → string-mask-strategy-43d846ac.js} +2 -2
- package/dist/esm/{style-formatter-a622a045.js → style-formatter-197e2fd3.js} +2 -2
- package/dist/esm/{time-required-rule-2fd8df50.js → time-required-rule-78d8ecf1.js} +1 -1
- package/dist/esm/{token-extension-5838c71b.js → token-extension-30011dc4.js} +1128 -27
- package/dist/esm/{translation-slimmer-32353a1c.js → translation-slimmer-49903fc8.js} +1 -1
- package/dist/esm/{type-guard-ed1004cc.js → type-guard-b18807dc.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-7c9d6808.js → valid-credit-card-number-rule-fe1c8a9c.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +22 -15
- package/dist/esm/vega-app-footer.entry.js +1 -1
- package/dist/esm/vega-app-header-button.entry.js +9 -9
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-brand-logo.entry.js +1 -1
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +9 -9
- package/dist/esm/vega-button-group_2.entry.js +4 -4
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +7 -7
- package/dist/esm/vega-calendar_4.entry.js +10 -10
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +6 -6
- package/dist/esm/vega-checkbox_2.entry.js +6 -6
- package/dist/esm/vega-chip.entry.js +9 -9
- package/dist/esm/vega-code-block.entry.js +16 -15
- package/dist/esm/vega-color-picker.entry.js +5 -5
- package/dist/esm/vega-color-swatch-picker.entry.js +7 -7
- package/dist/esm/vega-color-swatch.entry.js +5 -5
- package/dist/esm/vega-combo-box.entry.js +23 -10
- package/dist/esm/vega-date-picker_2.entry.js +327 -267
- package/dist/esm/vega-dialog_2.entry.js +7 -7
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +11 -11
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-578c6c6d.js → vega-event-id-20494454.js} +2 -1
- package/dist/esm/vega-field-label.entry.js +22 -5
- package/dist/esm/vega-file-uploader.entry.js +20 -7
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +7 -7
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +10 -10
- package/dist/esm/vega-input-credit-card.entry.js +10 -10
- package/dist/esm/vega-input-numeric.entry.js +9 -9
- package/dist/esm/vega-input-passcode.entry.js +23 -10
- package/dist/esm/vega-input-phone-number.entry.js +22 -9
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +9 -9
- package/dist/esm/vega-input.entry.js +23 -10
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +11 -11
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination.entry.js +8 -8
- package/dist/esm/vega-popover_2.entry.js +11 -11
- package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +9 -9
- package/dist/esm/vega-rich-text-content.entry.js +7 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +285 -189
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +396 -0
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +12 -12
- package/dist/esm/vega-section-title.entry.js +3 -2
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +6 -6
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +10 -10
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +8 -8
- package/dist/esm/vega-textarea.entry.js +17 -7
- package/dist/esm/vega-time-picker_2.entry.js +13 -13
- package/dist/esm/vega-toggle-switch.entry.js +5 -5
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +13 -12
- package/dist/sri/vega-sri-manifest.json +363 -351
- package/dist/types/components/vega-accordion/slimmers/vega-accordion-renderer.d.ts +1 -0
- package/dist/types/components/vega-accordion/vega-accordion.d.ts +14 -0
- package/dist/types/components/vega-code-block/vega-code-block.d.ts +1 -0
- package/dist/types/components/vega-combo-box/slimmers/renderers/vega-combo-box-renderer.d.ts +1 -0
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +10 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-size-controller.d.ts +20 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.d.ts +2 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.d.ts +1 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +0 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +22 -2
- package/dist/types/components/vega-field-label/vega-field-label.d.ts +12 -0
- package/dist/types/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-renderer.d.ts +1 -0
- package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +10 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-input/vega-input.d.ts +10 -0
- package/dist/types/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-passcode/vega-input-passcode.d.ts +10 -0
- package/dist/types/components/vega-input-phone-number/slimmers/renderers/vega-input-phone-number-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/assets/redo.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/undo.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation-style.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/action-handler-strategies/block-update-line-height-strategy.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/annotations/line-height-annotation.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/assets/line-height.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/constants.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-filter-styles-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-from-json-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-extension.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/arrow-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/currency-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/default-categories.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/latin-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/mathematical-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/text-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-icon.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.d.ts +83 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/types.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/constants.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/controllers/special-characters-panel-keyboard-controller.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/renderers/special-characters-panel-renderer.d.ts +66 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.d.ts +58 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/type.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/redo-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/undo-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +14 -0
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +10 -0
- package/dist/types/components.d.ts +169 -5
- 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/slimmers/component-value-history-controller-slimmer.abstract.d.ts +13 -0
- package/dist/types/helpers/theme/controllers/action-color-accessibility-validator.d.ts +10 -0
- package/dist/types/helpers/theme/internal-theme-manager.d.ts +28 -1
- package/dist/types/helpers/theme/theme-manager.d.ts +24 -1
- package/dist/types/helpers/theme/theme.d.ts +8 -0
- package/dist/types/helpers/translation/interface.d.ts +10 -1
- package/dist/types/types/components.type.d.ts +11 -10
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/checker.d.ts +177 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/color-math.d.ts +125 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/contrast-check-strategy.d.ts +38 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/search.d.ts +58 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/token-checks.d.ts +122 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/token-checks.generated.d.ts +2 -0
- package/dist/types/vega-color-token-contrast-checker/src/index.d.ts +2 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-636d890e.entry.js → p-01f617ee.entry.js} +1 -1
- package/dist/vega/{p-fdb97cb7.entry.js → p-03b32939.entry.js} +1 -1
- package/dist/vega/{p-2927b7a1.js → p-05dc6718.js} +1 -1
- package/dist/vega/{p-72e2a587.js → p-0b2ca33b.js} +1 -1
- package/dist/vega/p-0c460945.js +1 -0
- package/dist/vega/{p-d286da1d.entry.js → p-0d248322.entry.js} +1 -1
- package/dist/vega/{p-2b2fefc6.js → p-0d3830f1.js} +1 -1
- package/dist/vega/{p-c45acdc3.entry.js → p-0dafd071.entry.js} +1 -1
- package/dist/vega/{p-a67d52ce.entry.js → p-0edf9c6e.entry.js} +1 -1
- package/dist/vega/{p-a03341d8.entry.js → p-1385da31.entry.js} +1 -1
- package/dist/vega/{p-d1a6e126.entry.js → p-18d1d404.entry.js} +1 -1
- package/dist/vega/{p-aa8f4713.entry.js → p-1d752c37.entry.js} +1 -1
- package/dist/vega/p-1f563387.js +1 -0
- package/dist/vega/{p-e85497ec.entry.js → p-296c90bd.entry.js} +1 -1
- package/dist/vega/p-30f76962.js +3 -0
- package/dist/vega/p-3186995a.entry.js +1 -0
- package/dist/vega/p-3312e3dd.js +1 -0
- package/dist/vega/{p-a0dd08b1.js → p-36e46c4f.js} +1 -1
- package/dist/vega/p-36f3dd19.entry.js +1 -0
- package/dist/vega/{p-d5aad9f0.entry.js → p-3ab50c06.entry.js} +1 -1
- package/dist/vega/{p-31ebace1.js → p-3d6568cc.js} +1 -1
- package/dist/vega/{p-19df2831.entry.js → p-3e2e4b00.entry.js} +1 -1
- package/dist/vega/{p-ff5208f5.entry.js → p-416e89b0.entry.js} +1 -1
- package/dist/vega/{p-79bb216e.entry.js → p-4914a5f8.entry.js} +1 -1
- package/dist/vega/{p-ac26924d.entry.js → p-4f53b45d.entry.js} +1 -1
- package/dist/vega/p-50958342.js +1 -0
- package/dist/vega/{p-2d694684.js → p-518e0a24.js} +1 -1
- package/dist/vega/p-540bd78a.entry.js +1 -0
- package/dist/vega/p-5424e837.js +1 -0
- package/dist/vega/p-54ed506c.entry.js +1 -0
- package/dist/vega/{p-7e7e2f85.entry.js → p-5a960f83.entry.js} +1 -1
- package/dist/vega/{p-879d3cc9.entry.js → p-5c1a4fd7.entry.js} +1 -1
- package/dist/vega/{p-5b43a303.entry.js → p-5c8522eb.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-0b41b49a.entry.js → p-6205288e.entry.js} +1 -1
- package/dist/vega/{p-04a65b3f.js → p-6629a68b.js} +1 -1
- package/dist/vega/p-696d7b8f.js +1 -0
- package/dist/vega/{p-931dac8c.entry.js → p-6ab23e89.entry.js} +1 -1
- package/dist/vega/{p-154cc614.js → p-6bd37d32.js} +1 -1
- package/dist/vega/{p-ce034372.entry.js → p-6be01c6b.entry.js} +1 -1
- package/dist/vega/{p-294cff20.entry.js → p-70e0c3eb.entry.js} +1 -1
- package/dist/vega/{p-4a9c8ec0.entry.js → p-7168ef16.entry.js} +1 -1
- package/dist/vega/{p-ab04eff6.js → p-7292ac20.js} +1 -1
- package/dist/vega/p-7348a091.entry.js +1 -0
- package/dist/vega/{p-19adf714.js → p-788ada42.js} +1 -1
- package/dist/vega/p-7cd8d054.entry.js +1 -0
- package/dist/vega/{p-bee5dfb0.entry.js → p-7dcc0b23.entry.js} +1 -1
- package/dist/vega/{p-189d36ec.js → p-81d55efd.js} +1 -1
- package/dist/vega/{p-8077b117.js → p-8ee917b4.js} +1 -1
- package/dist/vega/{p-52645382.entry.js → p-92468c30.entry.js} +1 -1
- package/dist/vega/{p-3a3720c7.entry.js → p-92710213.entry.js} +1 -1
- package/dist/vega/{p-e8de9535.js → p-9c48e4e5.js} +1 -1
- package/dist/vega/{p-891815d6.js → p-9f03856e.js} +1 -1
- package/dist/vega/{p-7ffe8081.entry.js → p-a0dd5273.entry.js} +1 -1
- package/dist/vega/p-a0fa5ccc.entry.js +1 -0
- package/dist/vega/{p-4a954d9d.entry.js → p-a32ad1ac.entry.js} +1 -1
- package/dist/vega/{p-01a54c29.entry.js → p-a36d4199.entry.js} +1 -1
- package/dist/vega/{p-d97974be.entry.js → p-a53e1a60.entry.js} +1 -1
- package/dist/vega/{p-d4262f06.entry.js → p-a73d8915.entry.js} +1 -1
- package/dist/vega/{p-07225567.entry.js → p-a87bc75a.entry.js} +1 -1
- package/dist/vega/{p-09076646.js → p-abfe46ca.js} +1 -1
- package/dist/vega/p-ad815280.js +1 -0
- package/dist/vega/p-b0fb5099.entry.js +1 -0
- package/dist/vega/{p-d05915af.entry.js → p-b218141f.entry.js} +1 -1
- package/dist/vega/{p-e7c930d9.entry.js → p-b2a0d104.entry.js} +1 -1
- package/dist/vega/{p-3bf3c8bb.entry.js → p-b31802b3.entry.js} +1 -1
- package/dist/vega/{p-255a7387.entry.js → p-b3e97e2f.entry.js} +1 -1
- package/dist/vega/{p-15b4f1ce.entry.js → p-b519b9ab.entry.js} +1 -1
- package/dist/vega/{p-8aee6b74.js → p-b565a6a5.js} +1 -1
- package/dist/vega/{p-2e0bdc53.entry.js → p-b5a3de00.entry.js} +1 -1
- package/dist/vega/p-b5d00d38.entry.js +1 -0
- package/dist/vega/p-b72d7b57.entry.js +1 -0
- package/dist/vega/{p-f5ae99b4.entry.js → p-b7f30f68.entry.js} +1 -1
- package/dist/vega/p-b857a661.js +1 -0
- package/dist/vega/{p-d9d4bdbf.entry.js → p-ba4f23d8.entry.js} +1 -1
- package/dist/vega/{p-5df7ab03.entry.js → p-c0c13993.entry.js} +1 -1
- package/dist/vega/p-c4675cd2.entry.js +1 -0
- package/dist/vega/p-c51e3b9e.js +1 -0
- package/dist/vega/{p-bd47d8a7.entry.js → p-c6201e76.entry.js} +1 -1
- package/dist/vega/p-c84aa55a.js +1 -0
- package/dist/vega/{p-858ec529.js → p-c93dfe23.js} +1 -1
- package/dist/vega/p-cacec680.js +1 -0
- package/dist/vega/{p-186df871.entry.js → p-cd382652.entry.js} +1 -1
- package/dist/vega/{p-49341532.entry.js → p-cdd3af89.entry.js} +1 -1
- package/dist/vega/{p-ec663f00.entry.js → p-ce8a0aa6.entry.js} +1 -1
- package/dist/vega/{p-648be36d.entry.js → p-cf5c6172.entry.js} +1 -1
- package/dist/vega/{p-0a322971.entry.js → p-d1641644.entry.js} +1 -1
- package/dist/vega/p-d2237b95.entry.js +1 -0
- package/dist/vega/{p-76075a1c.entry.js → p-d24892d6.entry.js} +1 -1
- package/dist/vega/p-d25ca0c3.entry.js +1 -0
- package/dist/vega/{p-b69755c7.entry.js → p-d8591207.entry.js} +1 -1
- package/dist/vega/p-da42fde0.js +1 -0
- package/dist/vega/{p-aa4e9a4b.entry.js → p-dc0f7ef1.entry.js} +1 -1
- package/dist/vega/{p-70ae9157.entry.js → p-dcd3b421.entry.js} +1 -1
- package/dist/vega/{p-c19132c9.entry.js → p-df4f9264.entry.js} +1 -1
- package/dist/vega/p-e5726df7.entry.js +1 -0
- package/dist/vega/{p-4c91b13d.js → p-e7fb7eee.js} +1 -1
- package/dist/vega/{p-98dad153.entry.js → p-ea4b5520.entry.js} +1 -1
- package/dist/vega/p-ecbead18.entry.js +1 -0
- package/dist/vega/{p-b02b985d.js → p-f0d70de3.js} +1 -1
- package/dist/vega/{p-78ba7ca9.js → p-f7ad9349.js} +1 -1
- package/dist/vega/{p-a6565e02.js → p-fdf6f368.js} +1 -1
- package/dist/vega/{p-0a261b66.js → p-fea75b87.js} +1 -1
- package/dist/vega/{p-296c5e52.js → p-ffda64ac.js} +1 -1
- package/dist/vega/{p-74a1a82a.entry.js → p-ffe8a826.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -2
- package/dist/vega/p-042933f1.js +0 -1
- package/dist/vega/p-0d97dcb9.js +0 -1
- package/dist/vega/p-1da42a63.entry.js +0 -1
- package/dist/vega/p-281fa1e0.js +0 -1
- package/dist/vega/p-32a0f887.js +0 -1
- package/dist/vega/p-4a6f241d.entry.js +0 -1
- package/dist/vega/p-4dd02704.js +0 -1
- package/dist/vega/p-50fb936f.entry.js +0 -1
- package/dist/vega/p-612808ce.entry.js +0 -1
- package/dist/vega/p-6399b5ed.js +0 -1
- package/dist/vega/p-686e0b6b.entry.js +0 -1
- package/dist/vega/p-6d4faebc.js +0 -1
- package/dist/vega/p-88e56a47.entry.js +0 -1
- package/dist/vega/p-8d36afcc.entry.js +0 -1
- package/dist/vega/p-979a5e91.entry.js +0 -1
- package/dist/vega/p-a2b8d49d.js +0 -1
- package/dist/vega/p-ab4c307b.js +0 -1
- package/dist/vega/p-ce2d9efe.entry.js +0 -1
- package/dist/vega/p-e46a23fc.entry.js +0 -1
- package/dist/vega/p-e8ea3b16.js +0 -3
- package/dist/vega/p-ea0e922f.entry.js +0 -1
- package/dist/vega/p-ec2333f7.entry.js +0 -1
- package/dist/vega/p-ed2b0e01.entry.js +0 -1
- package/dist/vega/p-ef13b346.js +0 -1
- package/dist/vega/p-fe220f3a.entry.js +0 -1
|
@@ -7,26 +7,27 @@ const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtim
|
|
|
7
7
|
const internalVegaZIndexManager = require('./internal-vega-z-index-manager-f03ddb37.js');
|
|
8
8
|
const dynamicSlimmer = require('./dynamic-slimmer-f31fdfd7.js');
|
|
9
9
|
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-273d62ef.js');
|
|
10
|
-
const internalVegaEventManager = require('./internal-vega-event-manager-
|
|
11
|
-
const internalTranslationController = require('./internal-translation-controller-
|
|
12
|
-
const contentState = require('./content-state-
|
|
13
|
-
const codeBlock = require('./code-block-
|
|
14
|
-
const typeGuard = require('./type-guard-
|
|
10
|
+
const internalVegaEventManager = require('./internal-vega-event-manager-c515cf5e.js');
|
|
11
|
+
const internalTranslationController = require('./internal-translation-controller-a1250419.js');
|
|
12
|
+
const contentState = require('./content-state-d4f54659.js');
|
|
13
|
+
const codeBlock = require('./code-block-00fee034.js');
|
|
14
|
+
const typeGuard = require('./type-guard-424efe26.js');
|
|
15
15
|
const dtoRendererManager = require('./dto-renderer-manager-7eb5c5ce.js');
|
|
16
16
|
const baseRenderer = require('./base-renderer-0a3b62b7.js');
|
|
17
17
|
const internalIconManager = require('./internal-icon-manager-66c48800.js');
|
|
18
18
|
const vegaNonceManager = require('./vega-nonce-manager-df69d3ed.js');
|
|
19
19
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-ba6a95f3.js');
|
|
20
|
-
const vegaEventId = require('./vega-event-id-
|
|
21
|
-
const splitCellOperation = require('./split-cell-operation-
|
|
20
|
+
const vegaEventId = require('./vega-event-id-39dedd17.js');
|
|
21
|
+
const splitCellOperation = require('./split-cell-operation-91ee6894.js');
|
|
22
22
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
23
23
|
const vegaInternalEventId = require('./vega-internal-event-id-e138d4d6.js');
|
|
24
24
|
const remoteInvocationRegistry = require('./remote-invocation-registry-fc22fdd0.js');
|
|
25
|
-
const darkModeStyleController = require('./dark-mode-style-controller-
|
|
25
|
+
const darkModeStyleController = require('./dark-mode-style-controller-ed481250.js');
|
|
26
26
|
const tryGetDocument = require('./try-get-document-c0ebd39a.js');
|
|
27
27
|
const pixel = require('./pixel-98f2a10c.js');
|
|
28
28
|
const object = require('./object-b53e9416.js');
|
|
29
29
|
const timer = require('./timer-5f33058b.js');
|
|
30
|
+
const replaceSelectedTextAction = require('./replace-selected-text-action-a098523f.js');
|
|
30
31
|
|
|
31
32
|
const VegaLoaderRuntimeMetricsPayloadDefinition = [
|
|
32
33
|
{
|
|
@@ -1063,9 +1064,15 @@ class RTEExtensionContextManager {
|
|
|
1063
1064
|
*
|
|
1064
1065
|
* @param {RTEExtensionContext} context - The extension context to store.
|
|
1065
1066
|
*/
|
|
1066
|
-
|
|
1067
|
+
updateExtensionContext(context) {
|
|
1067
1068
|
if (context && context.host) {
|
|
1068
|
-
|
|
1069
|
+
let newContext = context;
|
|
1070
|
+
const existingContext = this.extensionContextMap.get(context.host);
|
|
1071
|
+
// If there is already an existing context for the host, merge the new context with the existing one to avoid overwriting any properties that are not included in the new context.
|
|
1072
|
+
if (existingContext) {
|
|
1073
|
+
newContext = Object.assign(Object.assign({}, existingContext), context);
|
|
1074
|
+
}
|
|
1075
|
+
this.extensionContextMap.set(context.host, newContext);
|
|
1069
1076
|
}
|
|
1070
1077
|
}
|
|
1071
1078
|
/**
|
|
@@ -1192,6 +1199,8 @@ class VegaRTEExtensionRenderer extends baseRenderer.VegaRTEBaseRenderer {
|
|
|
1192
1199
|
}
|
|
1193
1200
|
VegaRTEExtensionRenderer.REGISTER_REF_FLAG = '__registeredRef__';
|
|
1194
1201
|
|
|
1202
|
+
const patchedBlockClasses = new WeakSet();
|
|
1203
|
+
const annotationHandlersByClass = new WeakMap();
|
|
1195
1204
|
/**
|
|
1196
1205
|
* Abstract class for Vega Rich Text Editor extensions.
|
|
1197
1206
|
*/
|
|
@@ -1232,6 +1241,53 @@ class VegaRTEExtension {
|
|
|
1232
1241
|
static registerFilterStylesStrategy(blockOrNodeClassName, strategy) {
|
|
1233
1242
|
codeBlock.RTEFilterStylesStrategyRegistry.register(blockOrNodeClassName, strategy);
|
|
1234
1243
|
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Attach a custom JSON annotation handler to a block DTO class's static `from` flow.
|
|
1246
|
+
*
|
|
1247
|
+
* This is a reusable extension point: any extension can register a handler for an
|
|
1248
|
+
* annotation key and transform the value into block annotations during JSON parsing.
|
|
1249
|
+
*
|
|
1250
|
+
* Safe to call multiple times per class/key/handler — duplicate registrations are no-ops.
|
|
1251
|
+
*
|
|
1252
|
+
* @param {BlockClassWithFrom} BlockClass - Block DTO class to patch.
|
|
1253
|
+
* @param {string} annotationKey - JSON annotation key to read from `block.annotations`.
|
|
1254
|
+
* @param {AnnotationFromJsonHandler} handler - Handler that applies annotation logic to the instance.
|
|
1255
|
+
*/
|
|
1256
|
+
static attachAnnotationFromJson(BlockClass, annotationKey, handler) {
|
|
1257
|
+
var _a, _b;
|
|
1258
|
+
const handlerMap = (_a = annotationHandlersByClass.get(BlockClass)) !== null && _a !== void 0 ? _a : new Map();
|
|
1259
|
+
const handlers = (_b = handlerMap.get(annotationKey)) !== null && _b !== void 0 ? _b : new Set();
|
|
1260
|
+
handlers.add(handler);
|
|
1261
|
+
handlerMap.set(annotationKey, handlers);
|
|
1262
|
+
annotationHandlersByClass.set(BlockClass, handlerMap);
|
|
1263
|
+
if (patchedBlockClasses.has(BlockClass)) {
|
|
1264
|
+
return;
|
|
1265
|
+
}
|
|
1266
|
+
patchedBlockClasses.add(BlockClass);
|
|
1267
|
+
const originalFrom = BlockClass.from.bind(BlockClass);
|
|
1268
|
+
/**
|
|
1269
|
+
* Wrapped static `from` that preserves original behavior and then applies
|
|
1270
|
+
* all registered annotation-from-json handlers for this BlockClass.
|
|
1271
|
+
*
|
|
1272
|
+
* @param {VegaRTEBlockBase} block - Raw JSON block payload.
|
|
1273
|
+
* @param {VegaRTETransformOptions} [options] - Optional transform options.
|
|
1274
|
+
* @returns {RTEBlock} The transformed block instance.
|
|
1275
|
+
*/
|
|
1276
|
+
BlockClass.from = function patchedFrom(block, options) {
|
|
1277
|
+
const instance = originalFrom(block, options);
|
|
1278
|
+
const annotations = block.annotations;
|
|
1279
|
+
const currentHandlerMap = annotationHandlersByClass.get(BlockClass);
|
|
1280
|
+
if (annotations && currentHandlerMap) {
|
|
1281
|
+
currentHandlerMap.forEach((registeredHandlers, key) => {
|
|
1282
|
+
const value = annotations[key];
|
|
1283
|
+
registeredHandlers.forEach((registeredHandler) => {
|
|
1284
|
+
registeredHandler(instance, value, block, options);
|
|
1285
|
+
});
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
return instance;
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1235
1291
|
/**
|
|
1236
1292
|
* Lifecycle hook called by the rich text editor before the first render
|
|
1237
1293
|
* (during `componentWillLoad`). Override this method to perform per-host
|
|
@@ -1253,7 +1309,7 @@ class VegaRTEExtension {
|
|
|
1253
1309
|
*/
|
|
1254
1310
|
initialExtensionAfterLoad(context) {
|
|
1255
1311
|
this.extensionContext = context;
|
|
1256
|
-
RTEExtensionContextManager$1.
|
|
1312
|
+
RTEExtensionContextManager$1.updateExtensionContext(context);
|
|
1257
1313
|
}
|
|
1258
1314
|
/**
|
|
1259
1315
|
* Callback method invoked when the extension is destroyed.
|
|
@@ -1393,6 +1449,11 @@ class VegaRTEExtension {
|
|
|
1393
1449
|
* Override the methods to customize the rendering and behavior of the button.
|
|
1394
1450
|
*/
|
|
1395
1451
|
class VegaRTEToolbarButtonRenderer {
|
|
1452
|
+
constructor() {
|
|
1453
|
+
this.dropdownEl = null;
|
|
1454
|
+
this.itemsContainerEl = null;
|
|
1455
|
+
this.buttonEl = null;
|
|
1456
|
+
}
|
|
1396
1457
|
/**
|
|
1397
1458
|
* Checks if the button should be hidden.
|
|
1398
1459
|
*
|
|
@@ -1425,6 +1486,7 @@ class VegaRTEToolbarButtonRenderer {
|
|
|
1425
1486
|
return h('vega-dropdown', Object.assign({ trigger: 'click', searchable: false, maxWidth: '200', itemDisplayRule: 'ellipsis',
|
|
1426
1487
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1427
1488
|
ref: (el) => {
|
|
1489
|
+
this.dropdownEl = el;
|
|
1428
1490
|
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(el, vegaEventId.VegaDropdownClick, (input) => {
|
|
1429
1491
|
const payload = input;
|
|
1430
1492
|
this.handleDropdownClick(payload.detail, editorContext);
|
|
@@ -1442,6 +1504,12 @@ class VegaRTEToolbarButtonRenderer {
|
|
|
1442
1504
|
return h('div', {
|
|
1443
1505
|
slot: 'items',
|
|
1444
1506
|
onMouseDown: this.preventDefault,
|
|
1507
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1508
|
+
onKeyDown: (e) => this.handleItemsKeyDown(e),
|
|
1509
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1510
|
+
ref: (el) => {
|
|
1511
|
+
this.itemsContainerEl = el;
|
|
1512
|
+
},
|
|
1445
1513
|
class: 'rte-dropdown-list',
|
|
1446
1514
|
}, [
|
|
1447
1515
|
h('style', { nonce: vegaNonceManager.vegaNonceManager.nonce }, '.rte-dropdown-list vega-dropdown-group vega-dropdown-group { padding-left: 4px }'),
|
|
@@ -1505,9 +1573,12 @@ class VegaRTEToolbarButtonRenderer {
|
|
|
1505
1573
|
selected: this.isSelected(editorContext),
|
|
1506
1574
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1507
1575
|
ref: (el) => {
|
|
1576
|
+
this.buttonEl = el;
|
|
1508
1577
|
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(el, vegaEventId.VegaClick, () => this.handleButtonClick(editorContext));
|
|
1509
1578
|
},
|
|
1510
1579
|
onMouseDown: this.preventDefault,
|
|
1580
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1581
|
+
onKeyDown: (e) => this.handleButtonKeyDown(e),
|
|
1511
1582
|
}, [
|
|
1512
1583
|
this.renderButtonLabel(h, editorContext, label),
|
|
1513
1584
|
showArrowIcon
|
|
@@ -1520,7 +1591,7 @@ class VegaRTEToolbarButtonRenderer {
|
|
|
1520
1591
|
: null,
|
|
1521
1592
|
].filter(typeGuard.isNonNullable));
|
|
1522
1593
|
if (tooltip === null || tooltip === void 0 ? void 0 : tooltip.text) {
|
|
1523
|
-
return h('vega-tooltip', { text: tooltip.text, placement: ['bottom', 'top'] }, [button]);
|
|
1594
|
+
return h('vega-tooltip', { text: editorContext.translation.t(tooltip.text), placement: ['bottom', 'top'] }, [button]);
|
|
1524
1595
|
}
|
|
1525
1596
|
return button;
|
|
1526
1597
|
}
|
|
@@ -1590,6 +1661,95 @@ class VegaRTEToolbarButtonRenderer {
|
|
|
1590
1661
|
}
|
|
1591
1662
|
return null;
|
|
1592
1663
|
}
|
|
1664
|
+
/**
|
|
1665
|
+
* Handles keyboard events on the toolbar button to support dropdown keyboard accessibility.
|
|
1666
|
+
* - Enter / Space: Toggles the dropdown open/closed.
|
|
1667
|
+
* - ArrowDown / ArrowUp: Opens the dropdown and focuses the first/last item.
|
|
1668
|
+
*
|
|
1669
|
+
* @param {KeyboardEvent} e The keyboard event.
|
|
1670
|
+
*/
|
|
1671
|
+
handleButtonKeyDown(e) {
|
|
1672
|
+
if (!this.dropdownEl) {
|
|
1673
|
+
return;
|
|
1674
|
+
}
|
|
1675
|
+
if (e.code === 'Enter' || e.code === 'Space') {
|
|
1676
|
+
e.preventDefault();
|
|
1677
|
+
e.stopPropagation();
|
|
1678
|
+
this.dropdownEl.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
1679
|
+
}
|
|
1680
|
+
else if (e.code === 'ArrowDown' || e.code === 'ArrowUp') {
|
|
1681
|
+
e.preventDefault();
|
|
1682
|
+
e.stopPropagation();
|
|
1683
|
+
void this.dropdownEl.show().then(() => {
|
|
1684
|
+
this.focusDropdownItem(e.code === 'ArrowDown' ? 'first' : 'last');
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Handles keyboard navigation within the dropdown items container.
|
|
1690
|
+
* - ArrowDown/ArrowUp: Moves focus to the next/previous non-disabled item.
|
|
1691
|
+
* - Escape: Closes the dropdown and returns focus to the toolbar button.
|
|
1692
|
+
*
|
|
1693
|
+
* @param {KeyboardEvent} e The keyboard event.
|
|
1694
|
+
*/
|
|
1695
|
+
handleItemsKeyDown(e) {
|
|
1696
|
+
var _a, _b, _c;
|
|
1697
|
+
if (e.code === 'Escape') {
|
|
1698
|
+
e.preventDefault();
|
|
1699
|
+
e.stopPropagation();
|
|
1700
|
+
if (this.dropdownEl) {
|
|
1701
|
+
void this.dropdownEl.hide();
|
|
1702
|
+
}
|
|
1703
|
+
(_a = this.buttonEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
if (e.code !== 'ArrowDown' && e.code !== 'ArrowUp') {
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
e.preventDefault();
|
|
1710
|
+
e.stopPropagation();
|
|
1711
|
+
const items = this.getDropdownItems();
|
|
1712
|
+
if (items.length === 0) {
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
const currentIndex = items.findIndex((item) => { var _a, _b; return ((_a = item.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('li')) === ((_b = item.shadowRoot) === null || _b === void 0 ? void 0 : _b.activeElement); });
|
|
1716
|
+
const direction = e.code === 'ArrowDown' ? 1 : -1;
|
|
1717
|
+
const startIndex = currentIndex === -1 ? (e.code === 'ArrowDown' ? 0 : items.length - 1) : currentIndex + direction;
|
|
1718
|
+
for (let offset = 0; offset < items.length; offset++) {
|
|
1719
|
+
const index = (startIndex + offset * direction + items.length) % items.length;
|
|
1720
|
+
if (!items[index].disabled) {
|
|
1721
|
+
(_c = (_b = items[index].shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('li')) === null || _c === void 0 ? void 0 : _c.focus();
|
|
1722
|
+
return;
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* Focuses the first or last non-disabled dropdown item.
|
|
1728
|
+
*
|
|
1729
|
+
* @param {'first' | 'last'} position Whether to focus the first or last item.
|
|
1730
|
+
*/
|
|
1731
|
+
focusDropdownItem(position) {
|
|
1732
|
+
var _a, _b;
|
|
1733
|
+
const items = this.getDropdownItems();
|
|
1734
|
+
const orderedItems = position === 'first' ? items : [...items].reverse();
|
|
1735
|
+
for (const item of orderedItems) {
|
|
1736
|
+
if (!item.disabled) {
|
|
1737
|
+
(_b = (_a = item.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('li')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
1738
|
+
return;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Gets all dropdown items from the items container.
|
|
1744
|
+
*
|
|
1745
|
+
* @returns {HTMLVegaDropdownItemElement[]} Array of dropdown item elements.
|
|
1746
|
+
*/
|
|
1747
|
+
getDropdownItems() {
|
|
1748
|
+
if (!this.itemsContainerEl) {
|
|
1749
|
+
return [];
|
|
1750
|
+
}
|
|
1751
|
+
return Array.from(this.itemsContainerEl.querySelectorAll('vega-dropdown-item'));
|
|
1752
|
+
}
|
|
1593
1753
|
}
|
|
1594
1754
|
|
|
1595
1755
|
/**
|
|
@@ -1698,6 +1858,7 @@ class RTETokenToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
|
1698
1858
|
class RTETokenNode extends codeBlock.RTETextNode {
|
|
1699
1859
|
constructor(id, token, text, parentBlock, annotations) {
|
|
1700
1860
|
super(id, text, parentBlock, annotations);
|
|
1861
|
+
this.dtoName = RTETokenNode.dtoName;
|
|
1701
1862
|
this.type = 'token';
|
|
1702
1863
|
this.token = token;
|
|
1703
1864
|
this.text = text;
|
|
@@ -1747,6 +1908,7 @@ class RTETokenNode extends codeBlock.RTETextNode {
|
|
|
1747
1908
|
return `<span class="token" contenteditable="false" template-token-key="${this.token}" token-key="${this.token}"${super.generateAttributeString()}>${this.text}</span>`;
|
|
1748
1909
|
}
|
|
1749
1910
|
}
|
|
1911
|
+
RTETokenNode.dtoName = 'RTETokenNode';
|
|
1750
1912
|
|
|
1751
1913
|
/**
|
|
1752
1914
|
* Token node renderer for the rich text editor.
|
|
@@ -2072,6 +2234,7 @@ class InsertFunctionBlockAction extends codeBlock.ModifyContentAction {
|
|
|
2072
2234
|
class RTEFunctionBlock extends codeBlock.RTEBlock {
|
|
2073
2235
|
constructor(id) {
|
|
2074
2236
|
super(id);
|
|
2237
|
+
this.dtoName = RTEFunctionBlock.dtoName;
|
|
2075
2238
|
this.type = 'function-block';
|
|
2076
2239
|
this.children = [];
|
|
2077
2240
|
}
|
|
@@ -2159,6 +2322,7 @@ class RTEFunctionBlock extends codeBlock.RTEBlock {
|
|
|
2159
2322
|
return styles ? ` style="${styles}"` : '';
|
|
2160
2323
|
}
|
|
2161
2324
|
}
|
|
2325
|
+
RTEFunctionBlock.dtoName = 'RTEFunctionBlock';
|
|
2162
2326
|
|
|
2163
2327
|
/**
|
|
2164
2328
|
* Strategy to handle the insertion of a function block into the rich text editor.
|
|
@@ -2260,6 +2424,7 @@ class InsertFunctionBlockStrategy extends codeBlock.ActionHandleStrategy {
|
|
|
2260
2424
|
class RTELogicControlNode extends codeBlock.RTENode {
|
|
2261
2425
|
constructor(id, text, parent) {
|
|
2262
2426
|
super(id);
|
|
2427
|
+
this.dtoName = RTELogicControlNode.dtoName;
|
|
2263
2428
|
this.type = 'logic-control-node';
|
|
2264
2429
|
this.text = '';
|
|
2265
2430
|
this.text = text;
|
|
@@ -2321,6 +2486,7 @@ class RTELogicControlNode extends codeBlock.RTENode {
|
|
|
2321
2486
|
return false;
|
|
2322
2487
|
}
|
|
2323
2488
|
}
|
|
2489
|
+
RTELogicControlNode.dtoName = 'RTELogicControlNode';
|
|
2324
2490
|
|
|
2325
2491
|
/**
|
|
2326
2492
|
* Class representing a logic control block in the rich text editor.
|
|
@@ -2328,6 +2494,7 @@ class RTELogicControlNode extends codeBlock.RTENode {
|
|
|
2328
2494
|
class RTELogicControlBlock extends codeBlock.RTEBlock {
|
|
2329
2495
|
constructor(id, statementText, parent) {
|
|
2330
2496
|
super(id);
|
|
2497
|
+
this.dtoName = RTELogicControlBlock.dtoName;
|
|
2331
2498
|
this.type = 'logic-control-block';
|
|
2332
2499
|
this.children = [];
|
|
2333
2500
|
this.statementText = '';
|
|
@@ -2393,6 +2560,7 @@ class RTELogicControlBlock extends codeBlock.RTEBlock {
|
|
|
2393
2560
|
};
|
|
2394
2561
|
}
|
|
2395
2562
|
}
|
|
2563
|
+
RTELogicControlBlock.dtoName = 'RTELogicControlBlock';
|
|
2396
2564
|
|
|
2397
2565
|
/**
|
|
2398
2566
|
* Function toolbar button renderer class.
|
|
@@ -2823,7 +2991,6 @@ const convertFunctionBlockStrategy = new DivToFunctionBlockStrategy();
|
|
|
2823
2991
|
class VegaRTEFunctionExtension extends VegaRTEExtension {
|
|
2824
2992
|
constructor() {
|
|
2825
2993
|
super();
|
|
2826
|
-
this.toolbarButtonRenderer = new FunctionToolbarButtonRenderer();
|
|
2827
2994
|
this.registerBlockBasicStrategies(RTELogicControlBlock.name);
|
|
2828
2995
|
this.registerBlockBasicStrategies(RTEFunctionBlock.name);
|
|
2829
2996
|
this.preventFunctionBlockDefaultInsertNewParagraph();
|
|
@@ -2831,11 +2998,14 @@ class VegaRTEFunctionExtension extends VegaRTEExtension {
|
|
|
2831
2998
|
this.registerRenderer('logic-control-block', new RTELogicControlBlockRenderer());
|
|
2832
2999
|
this.registerNode('function-block', RTEFunctionBlock);
|
|
2833
3000
|
this.registerRenderer('function-block', new RTEFunctionBlockRenderer());
|
|
2834
|
-
this.registerToolbarButtonRenderer('functions', this.toolbarButtonRenderer);
|
|
2835
3001
|
this.registerElementToBlockDTOClassStrategy(convertLogicControlBlockStrategy);
|
|
2836
3002
|
this.registerElementToBlockDTOClassStrategy(convertFunctionContentStrategy);
|
|
2837
3003
|
this.registerElementToBlockDTOClassStrategy(convertFunctionBlockStrategy);
|
|
2838
3004
|
}
|
|
3005
|
+
/** @inheritDoc */
|
|
3006
|
+
prepareBeforeLoad(host) {
|
|
3007
|
+
this.registerToolbarButtonRenderer('functions', new FunctionToolbarButtonRenderer(), host);
|
|
3008
|
+
}
|
|
2839
3009
|
/**
|
|
2840
3010
|
* Remove the appen children strategies to prevent default insert new paragraph logic in function block
|
|
2841
3011
|
*/
|
|
@@ -2956,6 +3126,7 @@ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2956
3126
|
class RTETableCaptionBlock extends codeBlock.RTEBlock {
|
|
2957
3127
|
constructor(id, options) {
|
|
2958
3128
|
super(id);
|
|
3129
|
+
this.dtoName = RTETableCaptionBlock.dtoName;
|
|
2959
3130
|
this.type = 'table-caption';
|
|
2960
3131
|
const { autoMatchFormat } = options || { autoMatchFormat: true };
|
|
2961
3132
|
if (autoMatchFormat) {
|
|
@@ -3018,6 +3189,7 @@ class RTETableCaptionBlock extends codeBlock.RTEBlock {
|
|
|
3018
3189
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.INSERT_CHILDREN_BEFORE, RTETableCaptionBlock.name, new contentState.InsertChildrenBeforeStrategy());
|
|
3019
3190
|
codeBlock.ActionHandleStrategyRegistry.register(codeBlock.ModifyContentActionType.PASTE_CONTENT, RTETableCaptionBlock.name, new contentState.PasteContentStrategy());
|
|
3020
3191
|
})();
|
|
3192
|
+
RTETableCaptionBlock.dtoName = 'RTETableCaptionBlock';
|
|
3021
3193
|
|
|
3022
3194
|
const TOGGLE_TABLE_CAPTION = 'TOGGLE_TABLE_CAPTION';
|
|
3023
3195
|
/**
|
|
@@ -6692,7 +6864,7 @@ class TableAnnotationHandler extends TableAnnotationHandlerBase {
|
|
|
6692
6864
|
* @inheritDoc
|
|
6693
6865
|
*/
|
|
6694
6866
|
canHandle(targetDto) {
|
|
6695
|
-
return targetDto.
|
|
6867
|
+
return targetDto.dtoName === 'RTETableBlock';
|
|
6696
6868
|
}
|
|
6697
6869
|
/**
|
|
6698
6870
|
* Handle annotation extraction from table element.
|
|
@@ -6760,7 +6932,7 @@ class TableCellAnnotationHandler extends TableAnnotationHandlerBase {
|
|
|
6760
6932
|
* @inheritDoc
|
|
6761
6933
|
*/
|
|
6762
6934
|
canHandle(targetDto) {
|
|
6763
|
-
return targetDto.
|
|
6935
|
+
return targetDto.dtoName === 'RTETableCellBlock';
|
|
6764
6936
|
}
|
|
6765
6937
|
/**
|
|
6766
6938
|
* Handle annotation extraction from table cell element.
|
|
@@ -6869,7 +7041,7 @@ class TableHeadCellAnnotationHandler extends TableCellAnnotationHandler {
|
|
|
6869
7041
|
* @inheritDoc
|
|
6870
7042
|
*/
|
|
6871
7043
|
canHandle(targetDto) {
|
|
6872
|
-
return targetDto.
|
|
7044
|
+
return targetDto.dtoName === 'RTETableHeadCellBlock';
|
|
6873
7045
|
}
|
|
6874
7046
|
}
|
|
6875
7047
|
|
|
@@ -7349,7 +7521,7 @@ class TableBlockFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
|
7349
7521
|
* @inheritDoc
|
|
7350
7522
|
*/
|
|
7351
7523
|
canFilter(blockOrNodeInstance) {
|
|
7352
|
-
return this.isTableBlock(blockOrNodeInstance.
|
|
7524
|
+
return this.isTableBlock(blockOrNodeInstance.dtoName);
|
|
7353
7525
|
}
|
|
7354
7526
|
/**
|
|
7355
7527
|
* @inheritDoc
|
|
@@ -7387,7 +7559,7 @@ class TableCaptionFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy
|
|
|
7387
7559
|
* @inheritDoc
|
|
7388
7560
|
*/
|
|
7389
7561
|
canFilter(blockOrNodeInstance) {
|
|
7390
|
-
return this.isTableCaption(blockOrNodeInstance.
|
|
7562
|
+
return this.isTableCaption(blockOrNodeInstance.dtoName);
|
|
7391
7563
|
}
|
|
7392
7564
|
/**
|
|
7393
7565
|
* @inheritDoc
|
|
@@ -7429,7 +7601,7 @@ class TableCellFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
|
7429
7601
|
* @inheritDoc
|
|
7430
7602
|
*/
|
|
7431
7603
|
canFilter(blockOrNodeInstance) {
|
|
7432
|
-
return this.isTableCell(blockOrNodeInstance.
|
|
7604
|
+
return this.isTableCell(blockOrNodeInstance.dtoName);
|
|
7433
7605
|
}
|
|
7434
7606
|
/**
|
|
7435
7607
|
* The table cell border color can be represented in different formats (e.g., hex, rgb), so we need to ensure that we can handle both cases.
|
|
@@ -7575,10 +7747,936 @@ class VegaRTETableExtension extends VegaRTEExtension {
|
|
|
7575
7747
|
VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableCellBlock.name, codeBlock.ModifyContentActionType.DELETE_CHILDREN, new PreventCellChildrenRemoveInterceptor());
|
|
7576
7748
|
VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableHeadCellBlock.name, codeBlock.ModifyContentActionType.DELETE_CHILDREN, new PreventCellChildrenRemoveInterceptor());
|
|
7577
7749
|
VegaRTEExtension.registerActionHandlerInterceptor(splitCellOperation.RTETableBlock.name, codeBlock.ModifyContentActionType.INSERT_NEW_PARAGRAPH, new PreventTableInsertParagraphInterceptor());
|
|
7578
|
-
VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableBlock.
|
|
7579
|
-
VegaRTEExtension.registerFilterStylesStrategy(RTETableCaptionBlock.
|
|
7580
|
-
VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableCellBlock.
|
|
7581
|
-
VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableHeadCellBlock.
|
|
7750
|
+
VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableBlock.dtoName, new TableBlockFilterStylesStrategy());
|
|
7751
|
+
VegaRTEExtension.registerFilterStylesStrategy(RTETableCaptionBlock.dtoName, new TableCaptionFilterStylesStrategy());
|
|
7752
|
+
VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableCellBlock.dtoName, new TableCellFilterStylesStrategy());
|
|
7753
|
+
VegaRTEExtension.registerFilterStylesStrategy(splitCellOperation.RTETableHeadCellBlock.dtoName, new TableCellFilterStylesStrategy('th'));
|
|
7754
|
+
})();
|
|
7755
|
+
|
|
7756
|
+
const ARROW_CHARACTERS = [
|
|
7757
|
+
{ character: '←', title: 'leftwards simple arrow' },
|
|
7758
|
+
{ character: '→', title: 'rightwards simple arrow' },
|
|
7759
|
+
{ character: '↑', title: 'upwards simple arrow' },
|
|
7760
|
+
{ character: '↓', title: 'downwards simple arrow' },
|
|
7761
|
+
{ character: '⇐', title: 'leftwards double arrow' },
|
|
7762
|
+
{ character: '⇒', title: 'rightwards double arrow' },
|
|
7763
|
+
{ character: '⇑', title: 'upwards double arrow' },
|
|
7764
|
+
{ character: '⇓', title: 'downwards double arrow' },
|
|
7765
|
+
{ character: '⇠', title: 'leftwards dashed arrow' },
|
|
7766
|
+
{ character: '⇢', title: 'rightwards dashed arrow' },
|
|
7767
|
+
{ character: '⇡', title: 'upwards dashed arrow' },
|
|
7768
|
+
{ character: '⇣', title: 'downwards dashed arrow' },
|
|
7769
|
+
{ character: '⇤', title: 'leftwards arrow to bar' },
|
|
7770
|
+
{ character: '⇥', title: 'rightwards arrow to bar' },
|
|
7771
|
+
{ character: '⤒', title: 'upwards arrow to bar' },
|
|
7772
|
+
{ character: '⤓', title: 'downwards arrow to bar' },
|
|
7773
|
+
{ character: '↨', title: 'up down arrow with base' },
|
|
7774
|
+
{ character: '🔙', title: 'back with leftwards arrow above' },
|
|
7775
|
+
{ character: '🔚', title: 'end with leftwards arrow above' },
|
|
7776
|
+
{ character: '🔛', title: 'on with exclamation mark with left right arrow above' },
|
|
7777
|
+
{ character: '🔜', title: 'soon with rightwards arrow above' },
|
|
7778
|
+
{ character: '🔝', title: 'top with upwards arrow above' },
|
|
7779
|
+
];
|
|
7780
|
+
|
|
7781
|
+
const CURRENCY_CHARACTERS = [
|
|
7782
|
+
{ character: '$', title: 'Dollar sign' },
|
|
7783
|
+
{ character: '€', title: 'Euro sign' },
|
|
7784
|
+
{ character: '¥', title: 'Yen sign' },
|
|
7785
|
+
{ character: '£', title: 'Pound sign' },
|
|
7786
|
+
{ character: '¢', title: 'Cent sign' },
|
|
7787
|
+
{ character: '₠', title: 'Euro-currency sign' },
|
|
7788
|
+
{ character: '₡', title: 'Colon sign' },
|
|
7789
|
+
{ character: '₢', title: 'Cruzeiro sign' },
|
|
7790
|
+
{ character: '₣', title: 'French franc sign' },
|
|
7791
|
+
{ character: '₤', title: 'Lira sign' },
|
|
7792
|
+
{ character: '¤', title: 'Currency sign' },
|
|
7793
|
+
{ character: '₿', title: 'Bitcoin sign' },
|
|
7794
|
+
{ character: '₥', title: 'Mill sign' },
|
|
7795
|
+
{ character: '₦', title: 'Naira sign' },
|
|
7796
|
+
{ character: '₧', title: 'Peseta sign' },
|
|
7797
|
+
{ character: '₨', title: 'Rupee sign' },
|
|
7798
|
+
{ character: '₩', title: 'Won sign' },
|
|
7799
|
+
{ character: '₪', title: 'New sheqel sign' },
|
|
7800
|
+
{ character: '₫', title: 'Dong sign' },
|
|
7801
|
+
{ character: '₭', title: 'Kip sign' },
|
|
7802
|
+
{ character: '₮', title: 'Tugrik sign' },
|
|
7803
|
+
{ character: '₯', title: 'Drachma sign' },
|
|
7804
|
+
{ character: '₰', title: 'German penny sign' },
|
|
7805
|
+
{ character: '₱', title: 'Peso sign' },
|
|
7806
|
+
{ character: '₲', title: 'Guarani sign' },
|
|
7807
|
+
{ character: '₳', title: 'Austral sign' },
|
|
7808
|
+
{ character: '₴', title: 'Hryvnia sign' },
|
|
7809
|
+
{ character: '₵', title: 'Cedi sign' },
|
|
7810
|
+
{ character: '₶', title: 'Livre tournois sign' },
|
|
7811
|
+
{ character: '₷', title: 'Spesmilo sign' },
|
|
7812
|
+
{ character: '₸', title: 'Tenge sign' },
|
|
7813
|
+
{ character: '₹', title: 'Indian rupee sign' },
|
|
7814
|
+
{ character: '₺', title: 'Turkish lira sign' },
|
|
7815
|
+
{ character: '₻', title: 'Nordic mark sign' },
|
|
7816
|
+
{ character: '₼', title: 'Manat sign' },
|
|
7817
|
+
{ character: '₽', title: 'Ruble sign' },
|
|
7818
|
+
];
|
|
7819
|
+
|
|
7820
|
+
const LATIN_CHARACTERS = [
|
|
7821
|
+
{ character: 'Ā', title: 'Latin capital letter a with macron' },
|
|
7822
|
+
{ character: 'ā', title: 'Latin small letter a with macron' },
|
|
7823
|
+
{ character: 'Ă', title: 'Latin capital letter a with breve' },
|
|
7824
|
+
{ character: 'ă', title: 'Latin small letter a with breve' },
|
|
7825
|
+
{ character: 'Ą', title: 'Latin capital letter a with ogonek' },
|
|
7826
|
+
{ character: 'ą', title: 'Latin small letter a with ogonek' },
|
|
7827
|
+
{ character: 'Ć', title: 'Latin capital letter c with acute' },
|
|
7828
|
+
{ character: 'ć', title: 'Latin small letter c with acute' },
|
|
7829
|
+
{ character: 'Ĉ', title: 'Latin capital letter c with circumflex' },
|
|
7830
|
+
{ character: 'ĉ', title: 'Latin small letter c with circumflex' },
|
|
7831
|
+
{ character: 'Ċ', title: 'Latin capital letter c with dot above' },
|
|
7832
|
+
{ character: 'ċ', title: 'Latin small letter c with dot above' },
|
|
7833
|
+
{ character: 'Č', title: 'Latin capital letter c with caron' },
|
|
7834
|
+
{ character: 'č', title: 'Latin small letter c with caron' },
|
|
7835
|
+
{ character: 'Ď', title: 'Latin capital letter d with caron' },
|
|
7836
|
+
{ character: 'ď', title: 'Latin small letter d with caron' },
|
|
7837
|
+
{ character: 'Đ', title: 'Latin capital letter d with stroke' },
|
|
7838
|
+
{ character: 'đ', title: 'Latin small letter d with stroke' },
|
|
7839
|
+
{ character: 'Ē', title: 'Latin capital letter e with macron' },
|
|
7840
|
+
{ character: 'ē', title: 'Latin small letter e with macron' },
|
|
7841
|
+
{ character: 'Ĕ', title: 'Latin capital letter e with breve' },
|
|
7842
|
+
{ character: 'ĕ', title: 'Latin small letter e with breve' },
|
|
7843
|
+
{ character: 'Ė', title: 'Latin capital letter e with dot above' },
|
|
7844
|
+
{ character: 'ė', title: 'Latin small letter e with dot above' },
|
|
7845
|
+
{ character: 'Ę', title: 'Latin capital letter e with ogonek' },
|
|
7846
|
+
{ character: 'ę', title: 'Latin small letter e with ogonek' },
|
|
7847
|
+
{ character: 'Ě', title: 'Latin capital letter e with caron' },
|
|
7848
|
+
{ character: 'ě', title: 'Latin small letter e with caron' },
|
|
7849
|
+
{ character: 'Ĝ', title: 'Latin capital letter g with circumflex' },
|
|
7850
|
+
{ character: 'ĝ', title: 'Latin small letter g with circumflex' },
|
|
7851
|
+
{ character: 'Ğ', title: 'Latin capital letter g with breve' },
|
|
7852
|
+
{ character: 'ğ', title: 'Latin small letter g with breve' },
|
|
7853
|
+
{ character: 'Ġ', title: 'Latin capital letter g with dot above' },
|
|
7854
|
+
{ character: 'ġ', title: 'Latin small letter g with dot above' },
|
|
7855
|
+
{ character: 'Ģ', title: 'Latin capital letter g with cedilla' },
|
|
7856
|
+
{ character: 'ģ', title: 'Latin small letter g with cedilla' },
|
|
7857
|
+
{ character: 'Ĥ', title: 'Latin capital letter h with circumflex' },
|
|
7858
|
+
{ character: 'ĥ', title: 'Latin small letter h with circumflex' },
|
|
7859
|
+
{ character: 'Ħ', title: 'Latin capital letter h with stroke' },
|
|
7860
|
+
{ character: 'ħ', title: 'Latin small letter h with stroke' },
|
|
7861
|
+
{ character: 'Ĩ', title: 'Latin capital letter i with tilde' },
|
|
7862
|
+
{ character: 'ĩ', title: 'Latin small letter i with tilde' },
|
|
7863
|
+
{ character: 'Ī', title: 'Latin capital letter i with macron' },
|
|
7864
|
+
{ character: 'ī', title: 'Latin small letter i with macron' },
|
|
7865
|
+
{ character: 'Ĭ', title: 'Latin capital letter i with breve' },
|
|
7866
|
+
{ character: 'ĭ', title: 'Latin small letter i with breve' },
|
|
7867
|
+
{ character: 'Į', title: 'Latin capital letter i with ogonek' },
|
|
7868
|
+
{ character: 'į', title: 'Latin small letter i with ogonek' },
|
|
7869
|
+
{ character: 'İ', title: 'Latin capital letter i with dot above' },
|
|
7870
|
+
{ character: 'ı', title: 'Latin small letter dotless i' },
|
|
7871
|
+
{ character: 'IJ', title: 'Latin capital ligature ij' },
|
|
7872
|
+
{ character: 'ij', title: 'Latin small ligature ij' },
|
|
7873
|
+
{ character: 'Ĵ', title: 'Latin capital letter j with circumflex' },
|
|
7874
|
+
{ character: 'ĵ', title: 'Latin small letter j with circumflex' },
|
|
7875
|
+
{ character: 'Ķ', title: 'Latin capital letter k with cedilla' },
|
|
7876
|
+
{ character: 'ķ', title: 'Latin small letter k with cedilla' },
|
|
7877
|
+
{ character: 'ĸ', title: 'Latin small letter kra' },
|
|
7878
|
+
{ character: 'Ĺ', title: 'Latin capital letter l with acute' },
|
|
7879
|
+
{ character: 'ĺ', title: 'Latin small letter l with acute' },
|
|
7880
|
+
{ character: 'Ļ', title: 'Latin capital letter l with cedilla' },
|
|
7881
|
+
{ character: 'ļ', title: 'Latin small letter l with cedilla' },
|
|
7882
|
+
{ character: 'Ľ', title: 'Latin capital letter l with caron' },
|
|
7883
|
+
{ character: 'ľ', title: 'Latin small letter l with caron' },
|
|
7884
|
+
{ character: 'Ŀ', title: 'Latin capital letter l with middle dot' },
|
|
7885
|
+
{ character: 'ŀ', title: 'Latin small letter l with middle dot' },
|
|
7886
|
+
{ character: 'Ł', title: 'Latin capital letter l with stroke' },
|
|
7887
|
+
{ character: 'ł', title: 'Latin small letter l with stroke' },
|
|
7888
|
+
{ character: 'Ń', title: 'Latin capital letter n with acute' },
|
|
7889
|
+
{ character: 'ń', title: 'Latin small letter n with acute' },
|
|
7890
|
+
{ character: 'Ņ', title: 'Latin capital letter n with cedilla' },
|
|
7891
|
+
{ character: 'ņ', title: 'Latin small letter n with cedilla' },
|
|
7892
|
+
{ character: 'Ň', title: 'Latin capital letter n with caron' },
|
|
7893
|
+
{ character: 'ň', title: 'Latin small letter n with caron' },
|
|
7894
|
+
{ character: 'ʼn', title: 'Latin small letter n preceded by apostrophe' },
|
|
7895
|
+
{ character: 'Ŋ', title: 'Latin capital letter eng' },
|
|
7896
|
+
{ character: 'ŋ', title: 'Latin small letter eng' },
|
|
7897
|
+
{ character: 'Ō', title: 'Latin capital letter o with macron' },
|
|
7898
|
+
{ character: 'ō', title: 'Latin small letter o with macron' },
|
|
7899
|
+
{ character: 'Ŏ', title: 'Latin capital letter o with breve' },
|
|
7900
|
+
{ character: 'ŏ', title: 'Latin small letter o with breve' },
|
|
7901
|
+
{ character: 'Ő', title: 'Latin capital letter o with double acute' },
|
|
7902
|
+
{ character: 'ő', title: 'Latin small letter o with double acute' },
|
|
7903
|
+
{ character: 'Œ', title: 'Latin capital ligature oe' },
|
|
7904
|
+
{ character: 'œ', title: 'Latin small ligature oe' },
|
|
7905
|
+
{ character: 'Ŕ', title: 'Latin capital letter r with acute' },
|
|
7906
|
+
{ character: 'ŕ', title: 'Latin small letter r with acute' },
|
|
7907
|
+
{ character: 'Ŗ', title: 'Latin capital letter r with cedilla' },
|
|
7908
|
+
{ character: 'ŗ', title: 'Latin small letter r with cedilla' },
|
|
7909
|
+
{ character: 'Ř', title: 'Latin capital letter r with caron' },
|
|
7910
|
+
{ character: 'ř', title: 'Latin small letter r with caron' },
|
|
7911
|
+
{ character: 'Ś', title: 'Latin capital letter s with acute' },
|
|
7912
|
+
{ character: 'ś', title: 'Latin small letter s with acute' },
|
|
7913
|
+
{ character: 'Ŝ', title: 'Latin capital letter s with circumflex' },
|
|
7914
|
+
{ character: 'ŝ', title: 'Latin small letter s with circumflex' },
|
|
7915
|
+
{ character: 'Ş', title: 'Latin capital letter s with cedilla' },
|
|
7916
|
+
{ character: 'ş', title: 'Latin small letter s with cedilla' },
|
|
7917
|
+
{ character: 'Š', title: 'Latin capital letter s with caron' },
|
|
7918
|
+
{ character: 'š', title: 'Latin small letter s with caron' },
|
|
7919
|
+
{ character: 'Ţ', title: 'Latin capital letter t with cedilla' },
|
|
7920
|
+
{ character: 'ţ', title: 'Latin small letter t with cedilla' },
|
|
7921
|
+
{ character: 'Ť', title: 'Latin capital letter t with caron' },
|
|
7922
|
+
{ character: 'ť', title: 'Latin small letter t with caron' },
|
|
7923
|
+
{ character: 'Ŧ', title: 'Latin capital letter t with stroke' },
|
|
7924
|
+
{ character: 'ŧ', title: 'Latin small letter t with stroke' },
|
|
7925
|
+
{ character: 'Ũ', title: 'Latin capital letter u with tilde' },
|
|
7926
|
+
{ character: 'ũ', title: 'Latin small letter u with tilde' },
|
|
7927
|
+
{ character: 'Ū', title: 'Latin capital letter u with macron' },
|
|
7928
|
+
{ character: 'ū', title: 'Latin small letter u with macron' },
|
|
7929
|
+
{ character: 'Ŭ', title: 'Latin capital letter u with breve' },
|
|
7930
|
+
{ character: 'ŭ', title: 'Latin small letter u with breve' },
|
|
7931
|
+
{ character: 'Ů', title: 'Latin capital letter u with ring above' },
|
|
7932
|
+
{ character: 'ů', title: 'Latin small letter u with ring above' },
|
|
7933
|
+
{ character: 'Ű', title: 'Latin capital letter u with double acute' },
|
|
7934
|
+
{ character: 'ű', title: 'Latin small letter u with double acute' },
|
|
7935
|
+
{ character: 'Ų', title: 'Latin capital letter u with ogonek' },
|
|
7936
|
+
{ character: 'ų', title: 'Latin small letter u with ogonek' },
|
|
7937
|
+
{ character: 'Ŵ', title: 'Latin capital letter w with circumflex' },
|
|
7938
|
+
{ character: 'ŵ', title: 'Latin small letter w with circumflex' },
|
|
7939
|
+
{ character: 'Ŷ', title: 'Latin capital letter y with circumflex' },
|
|
7940
|
+
{ character: 'ŷ', title: 'Latin small letter y with circumflex' },
|
|
7941
|
+
{ character: 'Ÿ', title: 'Latin capital letter y with diaeresis' },
|
|
7942
|
+
{ character: 'Ź', title: 'Latin capital letter z with acute' },
|
|
7943
|
+
{ character: 'ź', title: 'Latin small letter z with acute' },
|
|
7944
|
+
{ character: 'Ż', title: 'Latin capital letter z with dot above' },
|
|
7945
|
+
{ character: 'ż', title: 'Latin small letter z with dot above' },
|
|
7946
|
+
{ character: 'Ž', title: 'Latin capital letter z with caron' },
|
|
7947
|
+
{ character: 'ž', title: 'Latin small letter z with caron' },
|
|
7948
|
+
{ character: 'ſ', title: 'Latin small letter long s' },
|
|
7949
|
+
];
|
|
7950
|
+
|
|
7951
|
+
const MATHEMATICAL_CHARACTERS = [
|
|
7952
|
+
{ character: '<', title: 'Less-than sign' },
|
|
7953
|
+
{ character: '>', title: 'Greater-than sign' },
|
|
7954
|
+
{ character: '≤', title: 'Less-than or equal to' },
|
|
7955
|
+
{ character: '≥', title: 'Greater-than or equal to' },
|
|
7956
|
+
{ character: '–', title: 'En dash' },
|
|
7957
|
+
{ character: '—', title: 'Em dash' },
|
|
7958
|
+
{ character: '¯', title: 'Macron' },
|
|
7959
|
+
{ character: '‾', title: 'Overline' },
|
|
7960
|
+
{ character: '°', title: 'Degree sign' },
|
|
7961
|
+
{ character: '−', title: 'Minus sign' },
|
|
7962
|
+
{ character: '±', title: 'Plus-minus sign' },
|
|
7963
|
+
{ character: '÷', title: 'Division sign' },
|
|
7964
|
+
{ character: '⁄', title: 'Fraction slash' },
|
|
7965
|
+
{ character: '×', title: 'Multiplication sign' },
|
|
7966
|
+
{ character: 'ƒ', title: 'Latin small letter f with hook' },
|
|
7967
|
+
{ character: '∫', title: 'Integral' },
|
|
7968
|
+
{ character: '∑', title: 'N-ary summation' },
|
|
7969
|
+
{ character: '∞', title: 'Infinity' },
|
|
7970
|
+
{ character: '√', title: 'Square root' },
|
|
7971
|
+
{ character: '∼', title: 'Tilde operator' },
|
|
7972
|
+
{ character: '≅', title: 'Approximately equal to' },
|
|
7973
|
+
{ character: '≈', title: 'Almost equal to' },
|
|
7974
|
+
{ character: '≠', title: 'Not equal to' },
|
|
7975
|
+
{ character: '≡', title: 'Identical to' },
|
|
7976
|
+
{ character: '∈', title: 'Element of' },
|
|
7977
|
+
{ character: '∉', title: 'Not an element of' },
|
|
7978
|
+
{ character: '∋', title: 'Contains as member' },
|
|
7979
|
+
{ character: '∏', title: 'N-ary product' },
|
|
7980
|
+
{ character: '∧', title: 'Logical and' },
|
|
7981
|
+
{ character: '∨', title: 'Logical or' },
|
|
7982
|
+
{ character: '¬', title: 'Not sign' },
|
|
7983
|
+
{ character: '∩', title: 'Intersection' },
|
|
7984
|
+
{ character: '∪', title: 'Union' },
|
|
7985
|
+
{ character: '∂', title: 'Partial differential' },
|
|
7986
|
+
{ character: '∀', title: 'For all' },
|
|
7987
|
+
{ character: '∃', title: 'There exists' },
|
|
7988
|
+
{ character: '∅', title: 'Empty set' },
|
|
7989
|
+
{ character: '∇', title: 'Nabla' },
|
|
7990
|
+
{ character: '∗', title: 'Asterisk operator' },
|
|
7991
|
+
{ character: '∝', title: 'Proportional to' },
|
|
7992
|
+
{ character: '∠', title: 'Angle' },
|
|
7993
|
+
{ character: '¼', title: 'Vulgar fraction one quarter' },
|
|
7994
|
+
{ character: '½', title: 'Vulgar fraction one half' },
|
|
7995
|
+
{ character: '¾', title: 'Vulgar fraction three quarters' },
|
|
7996
|
+
];
|
|
7997
|
+
|
|
7998
|
+
const TEXT_CHARACTERS = [
|
|
7999
|
+
{ character: '‹', title: 'Single left-pointing angle quotation mark' },
|
|
8000
|
+
{ character: '›', title: 'Single right-pointing angle quotation mark' },
|
|
8001
|
+
{ character: '«', title: 'Left-pointing double angle quotation mark' },
|
|
8002
|
+
{ character: '»', title: 'Right-pointing double angle quotation mark' },
|
|
8003
|
+
{ character: '‘', title: 'Left single quotation mark' },
|
|
8004
|
+
{ character: '’', title: 'Right single quotation mark' },
|
|
8005
|
+
{ character: '“', title: 'Left double quotation mark' },
|
|
8006
|
+
{ character: '”', title: 'Right double quotation mark' },
|
|
8007
|
+
{ character: '‚', title: 'Single low-9 quotation mark' },
|
|
8008
|
+
{ character: '„', title: 'Double low-9 quotation mark' },
|
|
8009
|
+
{ character: '¡', title: 'Inverted exclamation mark' },
|
|
8010
|
+
{ character: '¿', title: 'Inverted question mark' },
|
|
8011
|
+
{ character: '‥', title: 'Two dot leader' },
|
|
8012
|
+
{ character: '…', title: 'Horizontal ellipsis' },
|
|
8013
|
+
{ character: '‡', title: 'Double dagger' },
|
|
8014
|
+
{ character: '‰', title: 'Per mille sign' },
|
|
8015
|
+
{ character: '‱', title: 'Per ten thousand sign' },
|
|
8016
|
+
{ character: '‼', title: 'Double exclamation mark' },
|
|
8017
|
+
{ character: '⁈', title: 'Question exclamation mark' },
|
|
8018
|
+
{ character: '⁉', title: 'Exclamation question mark' },
|
|
8019
|
+
{ character: '⁇', title: 'Double question mark' },
|
|
8020
|
+
{ character: '©', title: 'Copyright sign' },
|
|
8021
|
+
{ character: '®', title: 'Registered sign' },
|
|
8022
|
+
{ character: '™', title: 'Trade mark sign' },
|
|
8023
|
+
{ character: '§', title: 'Section sign' },
|
|
8024
|
+
{ character: '¶', title: 'Paragraph sign' },
|
|
8025
|
+
{ character: '⁋', title: 'Reversed paragraph sign' },
|
|
8026
|
+
];
|
|
8027
|
+
|
|
8028
|
+
const VegaRTESpecialCharactersLatin = {
|
|
8029
|
+
key: 'latin',
|
|
8030
|
+
label: 'Latin',
|
|
8031
|
+
characters: LATIN_CHARACTERS,
|
|
8032
|
+
};
|
|
8033
|
+
const VegaRTESpecialCharactersMathematical = {
|
|
8034
|
+
key: 'mathematical',
|
|
8035
|
+
label: 'Mathematical',
|
|
8036
|
+
characters: MATHEMATICAL_CHARACTERS,
|
|
8037
|
+
};
|
|
8038
|
+
const VegaRTESpecialCharactersArrows = {
|
|
8039
|
+
key: 'arrows',
|
|
8040
|
+
label: 'Arrows',
|
|
8041
|
+
characters: ARROW_CHARACTERS,
|
|
8042
|
+
};
|
|
8043
|
+
const VegaRTESpecialCharactersCurrency = {
|
|
8044
|
+
key: 'currency',
|
|
8045
|
+
label: 'Currency',
|
|
8046
|
+
characters: CURRENCY_CHARACTERS,
|
|
8047
|
+
};
|
|
8048
|
+
const VegaRTESpecialCharactersText = {
|
|
8049
|
+
key: 'text',
|
|
8050
|
+
label: 'Text',
|
|
8051
|
+
characters: TEXT_CHARACTERS,
|
|
8052
|
+
};
|
|
8053
|
+
const VegaRTESpecialCharactersEssentials = [
|
|
8054
|
+
VegaRTESpecialCharactersCurrency,
|
|
8055
|
+
VegaRTESpecialCharactersText,
|
|
8056
|
+
VegaRTESpecialCharactersMathematical,
|
|
8057
|
+
VegaRTESpecialCharactersArrows,
|
|
8058
|
+
VegaRTESpecialCharactersLatin,
|
|
8059
|
+
];
|
|
8060
|
+
|
|
8061
|
+
const specialCharactersIcon = {
|
|
8062
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M224 80C126.8 80 48 158.8 48 256c0 63.7 33.8 119.5 84.6 150.4c11.4 7 19.4 19.6 19.4 34.2c0 21.8-17.6 39.4-39.4 39.4H24c-13.3 0-24-10.7-24-24s10.7-24 24-24H85.4C33.4 391 0 327.4 0 256C0 132.3 100.3 32 224 32s224 100.3 224 224c0 71.4-33.4 135-85.4 176H424c13.3 0 24 10.7 24 24s-10.7 24-24 24H335.4c-21.8 0-39.4-17.6-39.4-39.4c0-14.6 8-27.2 19.4-34.2C366.2 375.5 400 319.7 400 256c0-97.2-78.8-176-176-176z"/></svg>`,
|
|
8063
|
+
};
|
|
8064
|
+
|
|
8065
|
+
/**
|
|
8066
|
+
* Toolbar button renderer for the Special Characters extension.
|
|
8067
|
+
* Renders a toolbar button with an Ω icon that opens a popover panel
|
|
8068
|
+
* with categorized character grids.
|
|
8069
|
+
*/
|
|
8070
|
+
class RTESpecialCharactersToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
8071
|
+
constructor(categories) {
|
|
8072
|
+
super();
|
|
8073
|
+
this.panelRef = null;
|
|
8074
|
+
this.categories = categories;
|
|
8075
|
+
}
|
|
8076
|
+
/**
|
|
8077
|
+
* Renders the special characters toolbar button wrapped in a popover.
|
|
8078
|
+
*
|
|
8079
|
+
* @param {VegaRTECreateElementFunction} h - Create element function.
|
|
8080
|
+
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
8081
|
+
* @returns {VegaRTERenderResult} - The toolbar button render result.
|
|
8082
|
+
*/
|
|
8083
|
+
render(h, editorContext) {
|
|
8084
|
+
return h('vega-popover', {
|
|
8085
|
+
trigger: 'click',
|
|
8086
|
+
alignment: 'start',
|
|
8087
|
+
placement: 'bottom',
|
|
8088
|
+
showArrow: false,
|
|
8089
|
+
isScreenPosition: true,
|
|
8090
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
8091
|
+
ref: (ref) => {
|
|
8092
|
+
if (ref) {
|
|
8093
|
+
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, vegaEventId.VegaPopoverShow, () => {
|
|
8094
|
+
this.handlePopoverShow();
|
|
8095
|
+
});
|
|
8096
|
+
}
|
|
8097
|
+
},
|
|
8098
|
+
}, [
|
|
8099
|
+
h('div', { slot: 'popover' }, [
|
|
8100
|
+
h('vega-rich-text-special-characters-panel', {
|
|
8101
|
+
categories: this.categories,
|
|
8102
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
8103
|
+
ref: (ref) => {
|
|
8104
|
+
if (ref) {
|
|
8105
|
+
this.panelRef = ref;
|
|
8106
|
+
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, vegaEventId.VegaClick,
|
|
8107
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
8108
|
+
(payload) => {
|
|
8109
|
+
this.insertCharacter(editorContext, payload.detail);
|
|
8110
|
+
});
|
|
8111
|
+
}
|
|
8112
|
+
},
|
|
8113
|
+
}),
|
|
8114
|
+
]),
|
|
8115
|
+
h('div', { slot: 'popover-content' }, this.renderButton(h, editorContext, {
|
|
8116
|
+
icon: 'rte-special-characters',
|
|
8117
|
+
tooltip: { text: 'Special Characters' },
|
|
8118
|
+
})),
|
|
8119
|
+
]);
|
|
8120
|
+
}
|
|
8121
|
+
/**
|
|
8122
|
+
* @inheritDoc
|
|
8123
|
+
*/
|
|
8124
|
+
handleButtonClick() {
|
|
8125
|
+
// Popover handles open/close via trigger='click'
|
|
8126
|
+
}
|
|
8127
|
+
/* istanbul ignore next */
|
|
8128
|
+
/**
|
|
8129
|
+
* @inheritDoc
|
|
8130
|
+
*/
|
|
8131
|
+
handleDropdownClick() {
|
|
8132
|
+
// No dropdown used
|
|
8133
|
+
}
|
|
8134
|
+
/**
|
|
8135
|
+
* Resets the panel and moves focus to the category select when the
|
|
8136
|
+
* popover opens.
|
|
8137
|
+
*/
|
|
8138
|
+
handlePopoverShow() {
|
|
8139
|
+
if (this.panelRef) {
|
|
8140
|
+
void this.panelRef.resetPanel();
|
|
8141
|
+
}
|
|
8142
|
+
}
|
|
8143
|
+
/**
|
|
8144
|
+
* Inserts a special character at the current cursor position using ReplaceSelectedTextAction,
|
|
8145
|
+
* then restores the cursor position after flushing.
|
|
8146
|
+
*
|
|
8147
|
+
* @param {VegaRTEToolbarRenderContext} editorContext - The render context for the editor.
|
|
8148
|
+
* @param {string} char - The Unicode character to insert.
|
|
8149
|
+
*/
|
|
8150
|
+
insertCharacter(editorContext, char) {
|
|
8151
|
+
const currentRange = editorContext.rteRange;
|
|
8152
|
+
const cursorNode = currentRange.startNode;
|
|
8153
|
+
if (!cursorNode)
|
|
8154
|
+
return;
|
|
8155
|
+
const target = this.isCaretOnLineBreak(cursorNode, currentRange)
|
|
8156
|
+
? this.insertAtLineBreak(cursorNode, char, currentRange)
|
|
8157
|
+
: this.insertAtTextNode(cursorNode, char, currentRange);
|
|
8158
|
+
editorContext.host.value.apply(new contentState.UpdateCursorPositionAction(target.node, target.offset));
|
|
8159
|
+
}
|
|
8160
|
+
/**
|
|
8161
|
+
* Checks whether the caret is collapsed on a Shift+Enter line-break text node.
|
|
8162
|
+
*
|
|
8163
|
+
* @param {RTENode} cursorNode - The current cursor node.
|
|
8164
|
+
* @param {RTERange} range - The current selection range.
|
|
8165
|
+
* @returns {boolean} True if the caret is collapsed on a '\n' text node.
|
|
8166
|
+
*/
|
|
8167
|
+
isCaretOnLineBreak(cursorNode, range) {
|
|
8168
|
+
return (cursorNode instanceof codeBlock.RTETextNode &&
|
|
8169
|
+
cursorNode.text === '\n' &&
|
|
8170
|
+
range.startOffset === range.endOffset);
|
|
8171
|
+
}
|
|
8172
|
+
/**
|
|
8173
|
+
* Default insert path: replace the selected range on a regular text node.
|
|
8174
|
+
*
|
|
8175
|
+
* @param {RTENode} cursorNode - The current cursor node.
|
|
8176
|
+
* @param {string} char - The Unicode character to insert.
|
|
8177
|
+
* @param {RTERange} range - The current selection range.
|
|
8178
|
+
* @returns {CaretTarget} The node and offset for the resulting caret position.
|
|
8179
|
+
*/
|
|
8180
|
+
insertAtTextNode(cursorNode, char, range) {
|
|
8181
|
+
const action = new replaceSelectedTextAction.ReplaceSelectedTextAction(char, range);
|
|
8182
|
+
action.isFlushable = true;
|
|
8183
|
+
cursorNode.apply(action);
|
|
8184
|
+
// Clamp to node length: empty paragraphs contain a ZWS in the DOM (startOffset=1)
|
|
8185
|
+
// but the DTO text node is empty, so `startOffset + char.length` would overflow.
|
|
8186
|
+
return {
|
|
8187
|
+
node: cursorNode,
|
|
8188
|
+
offset: Math.min(range.startOffset + char.length, cursorNode.getRangeEndOffset()),
|
|
8189
|
+
};
|
|
8190
|
+
}
|
|
8191
|
+
/**
|
|
8192
|
+
* Line-break insert path: delegate to insertTextToLineBreakNode and place
|
|
8193
|
+
* the caret at the end of the inserted text.
|
|
8194
|
+
*
|
|
8195
|
+
* @param {RTETextNode} lineBreakNode - The '\n' text node at the caret.
|
|
8196
|
+
* @param {string} char - The Unicode character to insert.
|
|
8197
|
+
* @param {RTERange} range - The current selection range.
|
|
8198
|
+
* @returns {CaretTarget} Caret target.
|
|
8199
|
+
*/
|
|
8200
|
+
insertAtLineBreak(lineBreakNode, char, range) {
|
|
8201
|
+
return {
|
|
8202
|
+
node: this.insertTextToLineBreakNode(lineBreakNode, char, range),
|
|
8203
|
+
offset: char.length,
|
|
8204
|
+
};
|
|
8205
|
+
}
|
|
8206
|
+
/**
|
|
8207
|
+
* Mirror of InsertTextHandler.insertTextToLineBreakNode for the toolbar
|
|
8208
|
+
* insert path: caret on a Shift+Enter line-break text node needs either a
|
|
8209
|
+
* new sibling text node inserted before the break, or the break's text
|
|
8210
|
+
* replaced. The default ReplaceSelectedTextAction + getRangeEndOffset()
|
|
8211
|
+
* path returns 0 for '\n' text nodes and drops the caret in front of the
|
|
8212
|
+
* inserted character.
|
|
8213
|
+
*
|
|
8214
|
+
* @param {RTETextNode} lineBreakNode - The '\n' text node at the caret.
|
|
8215
|
+
* @param {string} text - The text to insert.
|
|
8216
|
+
* @param {RTERange} currentRange - The current selection range.
|
|
8217
|
+
* @returns {RTETextNode} The node the caret should land in.
|
|
8218
|
+
*/
|
|
8219
|
+
insertTextToLineBreakNode(lineBreakNode, text, currentRange) {
|
|
8220
|
+
// '\n' text nodes always live inside a text block in the RTE structure.
|
|
8221
|
+
const textBlock = lineBreakNode.parent;
|
|
8222
|
+
const index = textBlock.children.indexOf(lineBreakNode);
|
|
8223
|
+
if (currentRange.startOffset === 0 && textBlock.children[index + 1]) {
|
|
8224
|
+
const newTextNode = lineBreakNode.cloneWithText(text);
|
|
8225
|
+
const insertAction = new codeBlock.InsertChildrenBeforeAction(lineBreakNode, newTextNode);
|
|
8226
|
+
insertAction.isFlushable = true;
|
|
8227
|
+
textBlock.apply(insertAction);
|
|
8228
|
+
return newTextNode;
|
|
8229
|
+
}
|
|
8230
|
+
const updateAction = new codeBlock.UpdateTextAction(text);
|
|
8231
|
+
updateAction.isFlushable = true;
|
|
8232
|
+
lineBreakNode.apply(updateAction);
|
|
8233
|
+
return lineBreakNode;
|
|
8234
|
+
}
|
|
8235
|
+
}
|
|
8236
|
+
(() => {
|
|
8237
|
+
internalIconManager.VegaInternalIconManager.register({ 'rte-special-characters': specialCharactersIcon });
|
|
8238
|
+
})();
|
|
8239
|
+
|
|
8240
|
+
/**
|
|
8241
|
+
* Vega Rich Text Editor Special Characters Extension.
|
|
8242
|
+
* Adds a toolbar button that opens a popover with categorized Unicode characters
|
|
8243
|
+
* for insertion into the editor content as plain text.
|
|
8244
|
+
*/
|
|
8245
|
+
class VegaRTESpecialCharactersExtension extends VegaRTEExtension {
|
|
8246
|
+
constructor(config) {
|
|
8247
|
+
super();
|
|
8248
|
+
this.categories = this.buildCategories(config);
|
|
8249
|
+
}
|
|
8250
|
+
/** @inheritDoc */
|
|
8251
|
+
prepareBeforeLoad(host) {
|
|
8252
|
+
this.registerToolbarButtonRenderer('special-characters', new RTESpecialCharactersToolbarButtonRenderer(this.categories), host);
|
|
8253
|
+
}
|
|
8254
|
+
/**
|
|
8255
|
+
* Builds the final list of special character categories from the provided config.
|
|
8256
|
+
*
|
|
8257
|
+
* @param {VegaRTESpecialCharactersConfig} config - Optional configuration with custom categories.
|
|
8258
|
+
* @returns {VegaRTESpecialCharacterCategory[]} - The merged categories array.
|
|
8259
|
+
*/
|
|
8260
|
+
buildCategories(config) {
|
|
8261
|
+
const includeDefaults = (config === null || config === void 0 ? void 0 : config.includeDefaults) !== false;
|
|
8262
|
+
const defaultCategories = includeDefaults
|
|
8263
|
+
? VegaRTESpecialCharactersEssentials
|
|
8264
|
+
: [];
|
|
8265
|
+
if (!(config === null || config === void 0 ? void 0 : config.categories)) {
|
|
8266
|
+
return defaultCategories;
|
|
8267
|
+
}
|
|
8268
|
+
return [...defaultCategories, ...config.categories];
|
|
8269
|
+
}
|
|
8270
|
+
}
|
|
8271
|
+
|
|
8272
|
+
/**
|
|
8273
|
+
* Default line height options used by the line-height extension when no
|
|
8274
|
+
* custom options are provided.
|
|
8275
|
+
*/
|
|
8276
|
+
const VegaRTEDefaultLineHeightOptions = [
|
|
8277
|
+
{ title: '0.5', value: '0.5' },
|
|
8278
|
+
{ title: '1', value: '1' },
|
|
8279
|
+
{ title: '1.5', value: '1.5' },
|
|
8280
|
+
{ title: '2', value: '2' },
|
|
8281
|
+
{ title: '2.5', value: '2.5' },
|
|
8282
|
+
];
|
|
8283
|
+
|
|
8284
|
+
var RTELineHeightExtensionAnnotationTypeEnum;
|
|
8285
|
+
(function (RTELineHeightExtensionAnnotationTypeEnum) {
|
|
8286
|
+
RTELineHeightExtensionAnnotationTypeEnum["LINE_HEIGHT"] = "LINE_HEIGHT";
|
|
8287
|
+
})(RTELineHeightExtensionAnnotationTypeEnum || (RTELineHeightExtensionAnnotationTypeEnum = {}));
|
|
8288
|
+
/**
|
|
8289
|
+
* Annotation to set block line height.
|
|
8290
|
+
*/
|
|
8291
|
+
class LineHeightAnnotation extends codeBlock.BlockAnnotation {
|
|
8292
|
+
constructor(lineHeight) {
|
|
8293
|
+
super();
|
|
8294
|
+
this.type = RTELineHeightExtensionAnnotationTypeEnum.LINE_HEIGHT;
|
|
8295
|
+
this.lineHeight = lineHeight;
|
|
8296
|
+
}
|
|
8297
|
+
/**
|
|
8298
|
+
* Generate the map item for the annotation.
|
|
8299
|
+
*
|
|
8300
|
+
* @param {string} lineHeight - Line height value.
|
|
8301
|
+
* @returns {[RTELineHeightExtensionAnnotationTypeEnum.LINE_HEIGHT, LineHeightAnnotation]} Map item for the annotation.
|
|
8302
|
+
*/
|
|
8303
|
+
static from(lineHeight) {
|
|
8304
|
+
return [RTELineHeightExtensionAnnotationTypeEnum.LINE_HEIGHT, new LineHeightAnnotation(lineHeight)];
|
|
8305
|
+
}
|
|
8306
|
+
/**
|
|
8307
|
+
* Get the default standalone styles for a given line height value.
|
|
8308
|
+
*
|
|
8309
|
+
* @param {string} lineHeight - The line height value.
|
|
8310
|
+
* @returns {AnnotationStyle} The default standalone styles.
|
|
8311
|
+
*/
|
|
8312
|
+
static getDefaultStyles(lineHeight) {
|
|
8313
|
+
return { lineHeight };
|
|
8314
|
+
}
|
|
8315
|
+
/**
|
|
8316
|
+
* Generate the JSON item of the annotation.
|
|
8317
|
+
*
|
|
8318
|
+
* @returns {Record<string, unknown>} JSON representation of the annotation.
|
|
8319
|
+
*/
|
|
8320
|
+
toJSON() {
|
|
8321
|
+
return {
|
|
8322
|
+
lineHeight: this.lineHeight,
|
|
8323
|
+
};
|
|
8324
|
+
}
|
|
8325
|
+
/**
|
|
8326
|
+
* @inheritDoc
|
|
8327
|
+
*/
|
|
8328
|
+
renderClass() {
|
|
8329
|
+
return null;
|
|
8330
|
+
}
|
|
8331
|
+
/**
|
|
8332
|
+
* @inheritDoc
|
|
8333
|
+
*/
|
|
8334
|
+
clone() {
|
|
8335
|
+
return new LineHeightAnnotation(this.lineHeight);
|
|
8336
|
+
}
|
|
8337
|
+
/**
|
|
8338
|
+
* @inheritDoc
|
|
8339
|
+
*/
|
|
8340
|
+
renderStyle() {
|
|
8341
|
+
return LineHeightAnnotation.getDefaultStyles(this.lineHeight);
|
|
8342
|
+
}
|
|
8343
|
+
}
|
|
8344
|
+
|
|
8345
|
+
/**
|
|
8346
|
+
* Action to update block line height annotation.
|
|
8347
|
+
*/
|
|
8348
|
+
class LineHeightAnnotationAction extends codeBlock.AnnotationAction {
|
|
8349
|
+
constructor(lineHeight) {
|
|
8350
|
+
super();
|
|
8351
|
+
this.isFlushable = true;
|
|
8352
|
+
this.lineHeight = lineHeight;
|
|
8353
|
+
}
|
|
8354
|
+
/**
|
|
8355
|
+
* Converts the action to an annotation.
|
|
8356
|
+
*
|
|
8357
|
+
* @returns {LineHeightAnnotation} The annotation.
|
|
8358
|
+
*/
|
|
8359
|
+
toAnnotation() {
|
|
8360
|
+
return new LineHeightAnnotation(this.lineHeight);
|
|
8361
|
+
}
|
|
8362
|
+
}
|
|
8363
|
+
|
|
8364
|
+
/**
|
|
8365
|
+
* Update the block line height strategy.
|
|
8366
|
+
*
|
|
8367
|
+
* Registered for RTETextBlock and RTEListItemBlock, so the
|
|
8368
|
+
* target type is widened to the common RTEBlock base.
|
|
8369
|
+
*/
|
|
8370
|
+
class BlockUpdateLineHeightStrategy extends codeBlock.ActionHandleStrategy {
|
|
8371
|
+
/**
|
|
8372
|
+
* Updating the line height of a block requires cascading updates to the custom style.
|
|
8373
|
+
*
|
|
8374
|
+
* @param {LineHeightAnnotationAction} _action - The line height annotation action.
|
|
8375
|
+
* @param {RTEBlock} target - The current block.
|
|
8376
|
+
*/
|
|
8377
|
+
handleAction(_action, target) {
|
|
8378
|
+
this.updateCustomStyleAnnotation(target, ['lineHeight']);
|
|
8379
|
+
}
|
|
8380
|
+
}
|
|
8381
|
+
|
|
8382
|
+
const lineHeight = {
|
|
8383
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M113.8 39.9c-4.6-5.1-11-7.9-17.8-7.9s-13.3 2.9-17.8 7.9l-72 80c-8.9 9.9-8.1 25 1.8 33.9s25 8.1 33.9-1.8L72 118.5V393.5L41.8 359.9c-8.9-9.9-24-10.7-33.9-1.8s-10.7 24-1.8 33.9l72 80c4.6 5.1 11 7.9 17.8 7.9s13.3-2.9 17.8-7.9l72-80c8.9-9.9 8.1-25-1.8-33.9s-25-8.1-33.9 1.8L120 393.5V118.5l30.2 33.5c8.9 9.9 24 10.7 33.9 1.8s10.7-24 1.8-33.9l-72-80zM248 72c-13.3 0-24 10.7-24 24s10.7 24 24 24H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H248zm0 160c-13.3 0-24 10.7-24 24s10.7 24 24 24H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H248zM224 416c0 13.3 10.7 24 24 24H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H248c-13.3 0-24 10.7-24 24z"/></svg>`,
|
|
8384
|
+
};
|
|
8385
|
+
|
|
8386
|
+
/**
|
|
8387
|
+
* Renderer for the line-height toolbar button in the Vega Rich Text Editor.
|
|
8388
|
+
*/
|
|
8389
|
+
class RTELineHeightToolbarButtonRenderer extends VegaRTEToolbarButtonRenderer {
|
|
8390
|
+
constructor(options) {
|
|
8391
|
+
super();
|
|
8392
|
+
this.options = options;
|
|
8393
|
+
}
|
|
8394
|
+
/**
|
|
8395
|
+
* @inheritDoc
|
|
8396
|
+
*/
|
|
8397
|
+
render(createElement, editorContext) {
|
|
8398
|
+
const dropdownItems = this.options.map((item) => {
|
|
8399
|
+
var _a;
|
|
8400
|
+
return ({
|
|
8401
|
+
key: item.value,
|
|
8402
|
+
label: (_a = item.title) !== null && _a !== void 0 ? _a : item.value,
|
|
8403
|
+
});
|
|
8404
|
+
});
|
|
8405
|
+
return this.renderDropdown(createElement, editorContext, {
|
|
8406
|
+
selectType: 'single',
|
|
8407
|
+
selectedSourceKey: this.getSelectedSourceValue(editorContext),
|
|
8408
|
+
}, [
|
|
8409
|
+
this.renderButton(createElement, editorContext, {
|
|
8410
|
+
icon: 'line-height',
|
|
8411
|
+
showArrowIcon: true,
|
|
8412
|
+
tooltip: { text: internalTranslationController.VegaInternalTranslation.t('Line Height') },
|
|
8413
|
+
}),
|
|
8414
|
+
this.renderDropdownListTemplate(createElement, dropdownItems),
|
|
8415
|
+
]);
|
|
8416
|
+
}
|
|
8417
|
+
/**
|
|
8418
|
+
* @inheritDoc
|
|
8419
|
+
*/
|
|
8420
|
+
isSelected() {
|
|
8421
|
+
return false;
|
|
8422
|
+
}
|
|
8423
|
+
/**
|
|
8424
|
+
* @inheritDoc
|
|
8425
|
+
*/
|
|
8426
|
+
isDisabled(editorContext) {
|
|
8427
|
+
var _a;
|
|
8428
|
+
if (editorContext.host.disabled) {
|
|
8429
|
+
return true;
|
|
8430
|
+
}
|
|
8431
|
+
const extensionContext = this.getExtensionContext(editorContext.host);
|
|
8432
|
+
const selectedNodes = (_a = extensionContext === null || extensionContext === void 0 ? void 0 : extensionContext.getSelectedNodes()) !== null && _a !== void 0 ? _a : [];
|
|
8433
|
+
if (selectedNodes.some((node) => {
|
|
8434
|
+
var _a;
|
|
8435
|
+
return ((_a = node.getAnnotationByType(codeBlock.NodeAnnotationTypeEnum.CODE)) === null || _a === void 0 ? void 0 : _a.code) ||
|
|
8436
|
+
node.parent instanceof codeBlock.RTECodeBlock;
|
|
8437
|
+
})) {
|
|
8438
|
+
return true;
|
|
8439
|
+
}
|
|
8440
|
+
const selectedBlocks = this.getSelectedBlocks(editorContext);
|
|
8441
|
+
return selectedBlocks.some((block) => block instanceof codeBlock.RTECodeBlock ||
|
|
8442
|
+
block instanceof contentState.RTEImageBlock ||
|
|
8443
|
+
!codeBlock.ActionHandleStrategyRegistry.canHandle(LineHeightAnnotationAction.name, block));
|
|
8444
|
+
}
|
|
8445
|
+
/**
|
|
8446
|
+
* @inheritDoc
|
|
8447
|
+
*/
|
|
8448
|
+
handleDropdownClick(itemValue, editorContext) {
|
|
8449
|
+
const selectedLineHeight = itemValue;
|
|
8450
|
+
const selectedBlocks = this.getSelectedBlocks(editorContext);
|
|
8451
|
+
selectedBlocks.forEach((block) => {
|
|
8452
|
+
block.apply(new LineHeightAnnotationAction(selectedLineHeight));
|
|
8453
|
+
});
|
|
8454
|
+
}
|
|
8455
|
+
/**
|
|
8456
|
+
* Handle direct toolbar button click.
|
|
8457
|
+
*/
|
|
8458
|
+
handleButtonClick() {
|
|
8459
|
+
// No direct click action; selection happens in dropdown options.
|
|
8460
|
+
}
|
|
8461
|
+
/**
|
|
8462
|
+
* Get the selected line-height key for dropdown selection state.
|
|
8463
|
+
*
|
|
8464
|
+
* @param {VegaRTEToolbarRenderContext} editorContext - Current toolbar context.
|
|
8465
|
+
* @returns {string} Selected line-height key or empty string for mixed/none.
|
|
8466
|
+
*/
|
|
8467
|
+
getSelectedSourceValue(editorContext) {
|
|
8468
|
+
const selectedBlocks = this.getSelectedBlocks(editorContext);
|
|
8469
|
+
if (selectedBlocks.length === 0) {
|
|
8470
|
+
return '';
|
|
8471
|
+
}
|
|
8472
|
+
const firstAnnotation = selectedBlocks[0].getAnnotationByType(RTELineHeightExtensionAnnotationTypeEnum.LINE_HEIGHT);
|
|
8473
|
+
const isSameLineHeight = selectedBlocks.every((block) => {
|
|
8474
|
+
const annotation = block.getAnnotationByType(RTELineHeightExtensionAnnotationTypeEnum.LINE_HEIGHT);
|
|
8475
|
+
return (annotation === null || annotation === void 0 ? void 0 : annotation.lineHeight) === (firstAnnotation === null || firstAnnotation === void 0 ? void 0 : firstAnnotation.lineHeight);
|
|
8476
|
+
});
|
|
8477
|
+
return isSameLineHeight && firstAnnotation ? firstAnnotation.lineHeight : '';
|
|
8478
|
+
}
|
|
8479
|
+
/**
|
|
8480
|
+
* Resolve selected blocks from selected nodes with range fallback.
|
|
8481
|
+
*
|
|
8482
|
+
* @param {VegaRTEToolbarRenderContext} editorContext - Current toolbar context.
|
|
8483
|
+
* @returns {RTEBlock[]} Selected blocks.
|
|
8484
|
+
*/
|
|
8485
|
+
getSelectedBlocks(editorContext) {
|
|
8486
|
+
var _a, _b;
|
|
8487
|
+
const extensionContext = this.getExtensionContext(editorContext.host);
|
|
8488
|
+
const selectedNodes = (_a = extensionContext === null || extensionContext === void 0 ? void 0 : extensionContext.getSelectedNodes()) !== null && _a !== void 0 ? _a : [];
|
|
8489
|
+
const selectedBlocks = [];
|
|
8490
|
+
selectedNodes.forEach((node) => {
|
|
8491
|
+
if (node.parent instanceof codeBlock.RTEBlock && !selectedBlocks.includes(node.parent)) {
|
|
8492
|
+
selectedBlocks.push(node.parent);
|
|
8493
|
+
}
|
|
8494
|
+
});
|
|
8495
|
+
if (selectedBlocks.length === 0 && ((_b = editorContext.rteRange.startNode) === null || _b === void 0 ? void 0 : _b.parent) instanceof codeBlock.RTEBlock) {
|
|
8496
|
+
selectedBlocks.push(editorContext.rteRange.startNode.parent);
|
|
8497
|
+
}
|
|
8498
|
+
return selectedBlocks;
|
|
8499
|
+
}
|
|
8500
|
+
}
|
|
8501
|
+
(() => {
|
|
8502
|
+
internalIconManager.VegaInternalIconManager.register({
|
|
8503
|
+
'line-height': lineHeight,
|
|
8504
|
+
});
|
|
8505
|
+
})();
|
|
8506
|
+
|
|
8507
|
+
const LINE_HEIGHT_AWARE_BLOCK_NAMES = new Set([
|
|
8508
|
+
codeBlock.RTETextBlock.name,
|
|
8509
|
+
contentState.RTEListItemBlock.name,
|
|
8510
|
+
]);
|
|
8511
|
+
/** Handle line height annotation. */
|
|
8512
|
+
class LineHeightAnnotationHandler extends contentState.AnnotationGeneratorStrategyAbstract {
|
|
8513
|
+
constructor(options = VegaRTEDefaultLineHeightOptions) {
|
|
8514
|
+
super();
|
|
8515
|
+
this.allowedLineHeights = new Set(options.map((option) => option.value));
|
|
8516
|
+
}
|
|
8517
|
+
/**
|
|
8518
|
+
* Can be handled.
|
|
8519
|
+
*
|
|
8520
|
+
* @param {RTEDtoClassPrototype} targetDto - Target DTO.
|
|
8521
|
+
* @returns {boolean} Whether the target DTO supports line-height annotations.
|
|
8522
|
+
*/
|
|
8523
|
+
canHandle(targetDto) {
|
|
8524
|
+
return LINE_HEIGHT_AWARE_BLOCK_NAMES.has(targetDto.name);
|
|
8525
|
+
}
|
|
8526
|
+
/**
|
|
8527
|
+
* Extract inline `line-height` as a semantic `lineHeight` annotation.
|
|
8528
|
+
*
|
|
8529
|
+
* @param {HTMLElement} [element] - Current element.
|
|
8530
|
+
* @returns {VegaRTEBlockAnnotations} `{ lineHeight }` when present, otherwise `{}`.
|
|
8531
|
+
*/
|
|
8532
|
+
handle(element) {
|
|
8533
|
+
var _a, _b;
|
|
8534
|
+
const lineHeight = (_b = (_a = element === null || element === void 0 ? void 0 : element.style.lineHeight) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
|
|
8535
|
+
if (!lineHeight) {
|
|
8536
|
+
return {};
|
|
8537
|
+
}
|
|
8538
|
+
if (!this.allowedLineHeights.has(lineHeight)) {
|
|
8539
|
+
return {};
|
|
8540
|
+
}
|
|
8541
|
+
return { lineHeight };
|
|
8542
|
+
}
|
|
8543
|
+
}
|
|
8544
|
+
|
|
8545
|
+
/**
|
|
8546
|
+
* Removes a redundant inline `customStyle.lineHeight` when it duplicates the
|
|
8547
|
+
* semantic `lineHeight` annotation during HTML-to-DTO conversion.
|
|
8548
|
+
*
|
|
8549
|
+
* Note: moving out-of-list line-height values from the semantic annotation to
|
|
8550
|
+
* `customStyle.lineHeight` is handled by the per-host interceptor in
|
|
8551
|
+
* `line-height-host-interceptor.ts`, not here.
|
|
8552
|
+
*/
|
|
8553
|
+
class LineHeightFilterStylesStrategy extends codeBlock.RTEFilterStylesStrategy {
|
|
8554
|
+
constructor() {
|
|
8555
|
+
super(...arguments);
|
|
8556
|
+
this.stylesToBeFiltered = {};
|
|
8557
|
+
}
|
|
8558
|
+
/**
|
|
8559
|
+
* Always run this strategy, even when autoMatchFormat is disabled.
|
|
8560
|
+
*
|
|
8561
|
+
* @returns {boolean} Always true.
|
|
8562
|
+
*/
|
|
8563
|
+
get alwaysFilter() {
|
|
8564
|
+
return true;
|
|
8565
|
+
}
|
|
8566
|
+
/**
|
|
8567
|
+
* Drop `customStyle.lineHeight` when it duplicates the semantic `lineHeight`.
|
|
8568
|
+
*
|
|
8569
|
+
* @param {VegaRTEAnnotations} annotations - The annotations to filter.
|
|
8570
|
+
* @returns {VegaRTEAnnotations} The same annotations reference.
|
|
8571
|
+
*/
|
|
8572
|
+
filterAnnotations(annotations) {
|
|
8573
|
+
const blockAnnotations = annotations;
|
|
8574
|
+
const lineHeight = blockAnnotations.lineHeight;
|
|
8575
|
+
const customStyle = blockAnnotations.customStyle;
|
|
8576
|
+
if (lineHeight && customStyle && customStyle.lineHeight === lineHeight) {
|
|
8577
|
+
delete customStyle.lineHeight;
|
|
8578
|
+
}
|
|
8579
|
+
if (customStyle && Object.keys(customStyle).length === 0) {
|
|
8580
|
+
delete blockAnnotations.customStyle;
|
|
8581
|
+
}
|
|
8582
|
+
return annotations;
|
|
8583
|
+
}
|
|
8584
|
+
}
|
|
8585
|
+
|
|
8586
|
+
/**
|
|
8587
|
+
* Per-class set of allowed line-height values, updated as extension instances
|
|
8588
|
+
* are constructed with (possibly custom) options.
|
|
8589
|
+
*/
|
|
8590
|
+
const allowedLineHeightsByClass = new WeakMap();
|
|
8591
|
+
/**
|
|
8592
|
+
* Tracks which block classes have had their JSON `lineHeight` annotation
|
|
8593
|
+
* handler installed, so we register it exactly once per class.
|
|
8594
|
+
*/
|
|
8595
|
+
const handlerInstalledClasses = new WeakSet();
|
|
8596
|
+
/**
|
|
8597
|
+
* Move an out-of-range `lineHeight` annotation into `customStyle.lineHeight`.
|
|
8598
|
+
*
|
|
8599
|
+
* @param {RTEBlock} block - The block to inspect.
|
|
8600
|
+
* @param {ReadonlySet<string>} allowed - Allowed line-height values.
|
|
8601
|
+
*/
|
|
8602
|
+
function normalizeLineHeightStyle(block, allowed) {
|
|
8603
|
+
const annotation = block.annotationMap.get(RTELineHeightExtensionAnnotationTypeEnum.LINE_HEIGHT);
|
|
8604
|
+
if (!annotation || allowed.has(annotation.lineHeight)) {
|
|
8605
|
+
return;
|
|
8606
|
+
}
|
|
8607
|
+
const value = annotation.lineHeight;
|
|
8608
|
+
block.annotationMap.delete(RTELineHeightExtensionAnnotationTypeEnum.LINE_HEIGHT);
|
|
8609
|
+
const existing = block.annotationMap.get(codeBlock.CommonAnnotationTypeEnum.CUSTOM_STYLE);
|
|
8610
|
+
if (existing) {
|
|
8611
|
+
existing.customStyle = Object.assign(Object.assign({}, existing.customStyle), { lineHeight: value });
|
|
8612
|
+
}
|
|
8613
|
+
else {
|
|
8614
|
+
block.annotationMap.set(...codeBlock.CustomStyleAnnotation.from({ lineHeight: value }));
|
|
8615
|
+
}
|
|
8616
|
+
}
|
|
8617
|
+
/**
|
|
8618
|
+
* Install the JSON `lineHeight` annotation handler for a block class.
|
|
8619
|
+
*
|
|
8620
|
+
* @param {LineHeightBlockClass} BlockClass - Target block class.
|
|
8621
|
+
*/
|
|
8622
|
+
function attachLineHeightFromJson(BlockClass) {
|
|
8623
|
+
if (handlerInstalledClasses.has(BlockClass)) {
|
|
8624
|
+
return;
|
|
8625
|
+
}
|
|
8626
|
+
handlerInstalledClasses.add(BlockClass);
|
|
8627
|
+
VegaRTEExtension.attachAnnotationFromJson(BlockClass, 'lineHeight', (instance, value) => {
|
|
8628
|
+
if (typeof value !== 'string' || value === '') {
|
|
8629
|
+
return;
|
|
8630
|
+
}
|
|
8631
|
+
instance.annotationMap.set(...LineHeightAnnotation.from(value));
|
|
8632
|
+
const allowed = allowedLineHeightsByClass.get(BlockClass);
|
|
8633
|
+
if (allowed && allowed.size > 0) {
|
|
8634
|
+
normalizeLineHeightStyle(instance, allowed);
|
|
8635
|
+
}
|
|
8636
|
+
});
|
|
8637
|
+
}
|
|
8638
|
+
/**
|
|
8639
|
+
* Update the set of allowed line-height values for a block class.
|
|
8640
|
+
*
|
|
8641
|
+
* @param {LineHeightBlockClass} BlockClass - Target block class.
|
|
8642
|
+
* @param {VegaRTELineHeightOption[]} options - Allowed line-height options.
|
|
8643
|
+
*/
|
|
8644
|
+
function setAllowedLineHeights(BlockClass, options) {
|
|
8645
|
+
allowedLineHeightsByClass.set(BlockClass, new Set(options.map((option) => option.value)));
|
|
8646
|
+
}
|
|
8647
|
+
|
|
8648
|
+
/**
|
|
8649
|
+
* Rich Text Editor extension that adds configurable line-height support
|
|
8650
|
+
* (toolbar control, annotations, content transforms, and JSON parsing).
|
|
8651
|
+
*/
|
|
8652
|
+
class VegaRTELineHeightExtension extends VegaRTEExtension {
|
|
8653
|
+
constructor(options = VegaRTEDefaultLineHeightOptions) {
|
|
8654
|
+
super();
|
|
8655
|
+
this.options = options;
|
|
8656
|
+
this.toolbarButtonRenderer = null;
|
|
8657
|
+
this.registerAnnotationHandler(new LineHeightAnnotationHandler(this.options));
|
|
8658
|
+
[codeBlock.RTETextBlock, contentState.RTEListItemBlock].forEach((BlockClass) => {
|
|
8659
|
+
setAllowedLineHeights(BlockClass, this.options);
|
|
8660
|
+
});
|
|
8661
|
+
}
|
|
8662
|
+
/**
|
|
8663
|
+
* Register the per-host toolbar renderer so each editor on the page gets
|
|
8664
|
+
* its own isolated line-height renderer instance.
|
|
8665
|
+
*
|
|
8666
|
+
* @typedef HTMLVegaRichTextEditorElement - The type of the host rich text editor element.
|
|
8667
|
+
* @param {HTMLVegaRichTextEditorElement} host - The host element.
|
|
8668
|
+
*/
|
|
8669
|
+
prepareBeforeLoad(host) {
|
|
8670
|
+
this.toolbarButtonRenderer = new RTELineHeightToolbarButtonRenderer(this.options);
|
|
8671
|
+
this.registerToolbarButtonRenderer('lineHeight', this.toolbarButtonRenderer, host);
|
|
8672
|
+
}
|
|
8673
|
+
}
|
|
8674
|
+
(() => {
|
|
8675
|
+
[codeBlock.RTETextBlock, contentState.RTEListItemBlock].forEach((BlockClass) => {
|
|
8676
|
+
VegaRTEExtension.registerActionHandleStrategy(BlockClass.name, LineHeightAnnotationAction.name, new BlockUpdateLineHeightStrategy());
|
|
8677
|
+
codeBlock.RTEFilterStylesStrategyRegistry.register(BlockClass.name, new LineHeightFilterStylesStrategy());
|
|
8678
|
+
attachLineHeightFromJson(BlockClass);
|
|
8679
|
+
});
|
|
7582
8680
|
})();
|
|
7583
8681
|
|
|
7584
8682
|
/**
|
|
@@ -7692,12 +8790,15 @@ class VegaRTETokenExtension extends VegaRTEExtension {
|
|
|
7692
8790
|
constructor(tokenList = []) {
|
|
7693
8791
|
super();
|
|
7694
8792
|
this.tokenRenderer = new RTETokenNodeRenderer();
|
|
8793
|
+
this.tokenList = tokenList;
|
|
7695
8794
|
this.registerNode('token', RTETokenNode);
|
|
7696
8795
|
this.registerRenderer('token', this.tokenRenderer);
|
|
7697
|
-
this.tokenToolbarButtonRenderer = new RTETokenToolbarButtonRenderer(tokenList);
|
|
7698
|
-
this.registerToolbarButtonRenderer('token', this.tokenToolbarButtonRenderer);
|
|
7699
8796
|
this.registerElementToNodeDTOClassStrategy(spanToTokenNodeStrategy);
|
|
7700
8797
|
}
|
|
8798
|
+
/** @inheritDoc */
|
|
8799
|
+
prepareBeforeLoad(host) {
|
|
8800
|
+
this.registerToolbarButtonRenderer('token', new RTETokenToolbarButtonRenderer(this.tokenList), host);
|
|
8801
|
+
}
|
|
7701
8802
|
}
|
|
7702
8803
|
(() => {
|
|
7703
8804
|
const insertTokenNodeStrategy = new InsertTokenNodeStrategy();
|
|
@@ -7714,10 +8815,19 @@ exports.RTETokenToolbarButtonRenderer = RTETokenToolbarButtonRenderer;
|
|
|
7714
8815
|
exports.VegaEventManager = VegaEventManager$1;
|
|
7715
8816
|
exports.VegaLoader = VegaLoader;
|
|
7716
8817
|
exports.VegaNotify = VegaNotify;
|
|
8818
|
+
exports.VegaRTEDefaultLineHeightOptions = VegaRTEDefaultLineHeightOptions;
|
|
7717
8819
|
exports.VegaRTEExtension = VegaRTEExtension;
|
|
7718
8820
|
exports.VegaRTEExtensionRenderer = VegaRTEExtensionRenderer;
|
|
7719
8821
|
exports.VegaRTEFunctionExtension = VegaRTEFunctionExtension;
|
|
7720
8822
|
exports.VegaRTELanguageExtension = VegaRTELanguageExtension;
|
|
8823
|
+
exports.VegaRTELineHeightExtension = VegaRTELineHeightExtension;
|
|
8824
|
+
exports.VegaRTESpecialCharactersArrows = VegaRTESpecialCharactersArrows;
|
|
8825
|
+
exports.VegaRTESpecialCharactersCurrency = VegaRTESpecialCharactersCurrency;
|
|
8826
|
+
exports.VegaRTESpecialCharactersEssentials = VegaRTESpecialCharactersEssentials;
|
|
8827
|
+
exports.VegaRTESpecialCharactersExtension = VegaRTESpecialCharactersExtension;
|
|
8828
|
+
exports.VegaRTESpecialCharactersLatin = VegaRTESpecialCharactersLatin;
|
|
8829
|
+
exports.VegaRTESpecialCharactersMathematical = VegaRTESpecialCharactersMathematical;
|
|
8830
|
+
exports.VegaRTESpecialCharactersText = VegaRTESpecialCharactersText;
|
|
7721
8831
|
exports.VegaRTETableExtension = VegaRTETableExtension;
|
|
7722
8832
|
exports.VegaRTETokenExtension = VegaRTETokenExtension;
|
|
7723
8833
|
exports.VegaRTEToolbarButtonRenderer = VegaRTEToolbarButtonRenderer;
|