@heartlandone/vega 2.35.0-RTE-preview → 2.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-fb3693cc.js → app-globals-13d4a0be.js} +3 -4
- package/dist/cjs/{list-block-91116257.js → content-state-2336e368.js} +130 -4
- package/dist/cjs/{element-appender-slimmer-700b7004.js → element-appender-slimmer-77f9c4a0.js} +11 -3
- package/dist/cjs/{form-field-controller-slimmer-7ef32059.js → form-field-controller-slimmer-8d4d2723.js} +56 -25
- package/dist/cjs/{image-annotation-action-d3e1699c.js → image-annotation-action-4135ca69.js} +12 -12
- package/dist/cjs/index.cjs.js +5 -6
- package/dist/cjs/loader.cjs.js +5 -6
- package/dist/cjs/{node-annotation.abstract-e5d3a859.js → node-annotation.abstract-c3c07af5.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-c2e08e06.js → sub-state-notify-slimmer-994eb848.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-b97e46b5.js → sub-state-observer-slimmer-080a4bea.js} +1 -1
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +2 -2
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +532 -115
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +68 -19
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +120 -40
- package/dist/cjs/vega-font.cjs.entry.js +8 -1
- package/dist/cjs/vega-form.cjs.entry.js +11 -6
- package/dist/cjs/vega-image-uploader.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +51 -5
- package/dist/cjs/vega-input-range.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-select.cjs.entry.js +2 -2
- package/dist/cjs/vega-input.cjs.entry.js +3 -3
- package/dist/cjs/{vega-internal-event-id-85b68849.js → vega-internal-event-id-b12071ea.js} +2 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
- package/dist/cjs/vega-popover_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-radio_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +134 -110
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +182 -118
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +2 -2
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +35 -24
- package/dist/cjs/vega-table_8.cjs.entry.js +3 -3
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +1 -1
- package/dist/cjs/vega.cjs.js +5 -6
- package/dist/collection/components/vega-date-picker/assets/icons.js +3 -0
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-controller.js +23 -1
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-month-year-dropdown-renderer.js +316 -0
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +60 -2
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-renderer.js +16 -4
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +24 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker.js +59 -0
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.js +56 -14
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +37 -0
- package/dist/collection/components/vega-file-uploader/slimmers/controllers/vega-file-uploader-file-limit-controller.js +35 -0
- package/dist/collection/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-container-renderer.js +36 -7
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +41 -0
- package/dist/collection/components/vega-font/slimmers/renderers/vega-font-renderer.js +8 -1
- package/dist/collection/components/vega-form/vega-form.js +13 -4
- package/dist/collection/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.js +38 -3
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +35 -0
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-pagination/internal/vega-pagination-page-size-selector.js +2 -2
- package/dist/collection/components/vega-pagination/vega-pagination.js +24 -1
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +33 -19
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +11 -4
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.js +8 -10
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +104 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +9 -7
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +9 -7
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +10 -12
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +9 -104
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +14 -13
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.js +8 -10
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +9 -11
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-not-li-child-to-rte-list-item-block.js +49 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +15 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +4 -2
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-page-index-controller.js +22 -22
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-selected-target-controller.js +9 -1
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-direction-button-renderer.js +4 -1
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
- package/dist/collection/helpers/slimmers/field-error-controller-silmmer.js +8 -2
- package/dist/collection/helpers/slimmers/field-error-ui-controller-slimmer.js +10 -16
- package/dist/collection/helpers/slimmers/form-field-message-translator.js +17 -0
- package/dist/collection/helpers/slimmers/form-field-valid-invoke-slimmer.js +6 -3
- package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +1 -1
- package/dist/collection/helpers/ui/element-appender.js +10 -2
- package/dist/collection/helpers/validator/form-field-controller.js +11 -3
- package/dist/collection/helpers/validator/rules/rich-text-editor-required-rule.js +4 -3
- package/dist/collection/helpers/validator/test/rules/rich-text-editor-required-rule.test.js +43 -0
- package/dist/collection/helpers/validator/validation-rule-handler/form-field-validation-rule-handler-chain.js +7 -2
- package/dist/esm/{app-globals-5b154b6d.js → app-globals-9ded4406.js} +2 -3
- package/dist/esm/{list-block-ba82c846.js → content-state-42a06d75.js} +130 -3
- package/dist/esm/{element-appender-slimmer-d71e3109.js → element-appender-slimmer-f3eceb79.js} +11 -3
- package/dist/esm/{form-field-controller-slimmer-af969d03.js → form-field-controller-slimmer-6ef5641b.js} +57 -26
- package/dist/esm/{image-annotation-action-a8e00f28.js → image-annotation-action-8a12e0bd.js} +2 -2
- package/dist/esm/index.js +3 -4
- package/dist/esm/loader.js +5 -6
- package/dist/esm/{node-annotation.abstract-d7d52bce.js → node-annotation.abstract-af11b11b.js} +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{sub-state-notify-slimmer-48bad548.js → sub-state-notify-slimmer-7d5a295a.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-403cc4e7.js → sub-state-observer-slimmer-901c7953.js} +1 -1
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-calendar_3.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +2 -2
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +2 -2
- package/dist/esm/vega-date-picker_2.entry.js +533 -116
- package/dist/esm/vega-dropdown_5.entry.js +68 -19
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +120 -40
- package/dist/esm/vega-font.entry.js +8 -1
- package/dist/esm/vega-form.entry.js +11 -6
- package/dist/esm/vega-image-uploader.entry.js +2 -2
- package/dist/esm/vega-input-credit-card.entry.js +2 -2
- package/dist/esm/vega-input-numeric.entry.js +3 -3
- package/dist/esm/vega-input-phone-number.entry.js +51 -5
- package/dist/esm/vega-input-range.entry.js +2 -2
- package/dist/esm/vega-input-select.entry.js +2 -2
- package/dist/esm/vega-input.entry.js +3 -3
- package/dist/esm/{vega-internal-event-id-4af5c6e9.js → vega-internal-event-id-458939b6.js} +2 -1
- package/dist/esm/vega-left-nav_5.entry.js +3 -3
- package/dist/esm/vega-pagination.entry.js +3 -3
- package/dist/esm/vega-popover_2.entry.js +2 -2
- package/dist/esm/vega-radio_2.entry.js +2 -2
- package/dist/esm/vega-rich-text-content.entry.js +132 -108
- package/dist/esm/vega-rich-text-editor_4.entry.js +76 -12
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-selection-tile_2.entry.js +4 -4
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +2 -2
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +35 -24
- package/dist/esm/vega-table_8.entry.js +3 -3
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +3 -3
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +1 -1
- package/dist/esm/vega.js +5 -6
- package/dist/types/components/vega-date-picker/assets/icons.d.ts +1 -1
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-controller.d.ts +4 -18
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-month-year-dropdown-renderer.d.ts +85 -0
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +9 -0
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-renderer.d.ts +2 -0
- package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +21 -2
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-appender-controller.d.ts +20 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +10 -0
- package/dist/types/components/vega-file-uploader/slimmers/controllers/vega-file-uploader-file-limit-controller.d.ts +18 -0
- package/dist/types/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-container-renderer.d.ts +15 -0
- package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +12 -0
- package/dist/types/components/vega-form/types.d.ts +1 -0
- package/dist/types/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.d.ts +19 -0
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +9 -0
- package/dist/types/components/vega-input-select/types.d.ts +1 -0
- package/dist/types/components/vega-pagination/internal/vega-pagination-page-size-selector.d.ts +2 -0
- package/dist/types/components/vega-pagination/types.d.ts +6 -0
- package/dist/types/components/vega-pagination/vega-pagination.d.ts +9 -1
- package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +4 -0
- package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +4 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.d.ts +13 -7
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.d.ts +6 -4
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +6 -4
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.d.ts +5 -5
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +7 -11
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.d.ts +4 -4
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.d.ts +6 -7
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.d.ts +5 -6
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-not-li-child-to-rte-list-item-block.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +3 -1
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-page-index-controller.d.ts +6 -6
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-selected-target-controller.d.ts +1 -0
- package/dist/types/components.d.ts +70 -5
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
- package/dist/types/helpers/slimmers/field-error-controller-silmmer.d.ts +7 -2
- package/dist/types/helpers/slimmers/field-error-ui-controller-slimmer.d.ts +2 -7
- package/dist/types/helpers/slimmers/form-field-message-translator.d.ts +12 -0
- package/dist/types/helpers/ui/element-appender.d.ts +4 -0
- package/dist/types/helpers/validator/form-field-controller.d.ts +5 -2
- package/dist/types/helpers/validator/rules/rich-text-editor-required-rule.d.ts +1 -1
- package/dist/types/helpers/validator/validation-rule-handler/form-field-validation-rule-handler-chain.d.ts +2 -2
- package/dist/types/helpers/validator/validator.d.ts +1 -1
- package/dist/types/types/components.type.d.ts +2 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-032ed643.entry.js +13 -0
- package/dist/vega/{p-a0e90d5d.entry.js → p-13ce8d87.entry.js} +1 -1
- package/dist/vega/{p-f84fd31c.js → p-26af2a8b.js} +1 -1
- package/dist/vega/{p-dcdac4d0.entry.js → p-2ff936da.entry.js} +1 -1
- package/dist/vega/p-3126edd6.entry.js +1 -0
- package/dist/vega/{p-45c88f7f.entry.js → p-317c72e4.entry.js} +1 -1
- package/dist/vega/{p-4f0b56fc.js → p-349dd552.js} +1 -1
- package/dist/vega/p-36ad5ee1.entry.js +1 -0
- package/dist/vega/p-42465abc.entry.js +1 -0
- package/dist/vega/{p-6d43b123.entry.js → p-43b6aced.entry.js} +1 -1
- package/dist/vega/{p-fe388812.entry.js → p-441c9c90.entry.js} +1 -1
- package/dist/vega/{p-926596cc.js → p-446c691b.js} +1 -1
- package/dist/vega/{p-465fa96d.entry.js → p-4d307520.entry.js} +1 -1
- package/dist/vega/p-524ff1a3.entry.js +1 -0
- package/dist/vega/p-558450ba.entry.js +1 -0
- package/dist/vega/{p-c02f650e.entry.js → p-589530e4.entry.js} +1 -1
- package/dist/vega/{p-71eeb279.entry.js → p-5ae1a322.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-61cffe6a.entry.js +1 -0
- package/dist/vega/{p-84113217.entry.js → p-6bf28253.entry.js} +1 -1
- package/dist/vega/{p-0bd9b1d9.entry.js → p-6df81ec2.entry.js} +1 -1
- package/dist/vega/p-75bca1c6.js +1 -0
- package/dist/vega/{p-b64981de.entry.js → p-7b72dc7a.entry.js} +1 -1
- package/dist/vega/{p-b9a09a76.js → p-83d87df5.js} +1 -1
- package/dist/vega/{p-b450bf46.entry.js → p-8a77ff64.entry.js} +1 -1
- package/dist/vega/{p-6661a462.entry.js → p-906991ec.entry.js} +1 -1
- package/dist/vega/{p-f6b89936.entry.js → p-96389073.entry.js} +1 -1
- package/dist/vega/{p-f31bb1fd.js → p-983c7d9b.js} +1 -1
- package/dist/vega/{p-91aa058f.entry.js → p-9ec7d6c4.entry.js} +1 -1
- package/dist/vega/{p-8067bd31.entry.js → p-a213b305.entry.js} +1 -1
- package/dist/vega/{p-e923637d.entry.js → p-a956561e.entry.js} +1 -1
- package/dist/vega/{p-625771d7.entry.js → p-b0c6cc78.entry.js} +1 -1
- package/dist/vega/p-b1524c6c.js +1 -0
- package/dist/vega/{p-1dd9f841.entry.js → p-bd2cdf10.entry.js} +1 -1
- package/dist/vega/p-c06e55d6.js +1 -0
- package/dist/vega/{p-19556584.entry.js → p-cea7506a.entry.js} +1 -1
- package/dist/vega/{p-0da2de05.entry.js → p-cff45d92.entry.js} +1 -1
- package/dist/vega/p-d3d4bf51.entry.js +1 -0
- package/dist/vega/{p-3a6c9b9d.entry.js → p-df4142dd.entry.js} +1 -1
- package/dist/vega/p-df9dbe2d.entry.js +1 -0
- package/dist/vega/p-ebb30774.entry.js +1 -0
- package/dist/vega/{p-e04d4ba3.entry.js → p-eed64b78.entry.js} +1 -1
- package/dist/vega/{p-1b3e0a9f.entry.js → p-f7fdf737.entry.js} +1 -1
- package/dist/vega/p-fe9644a0.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/content-state-3e4467a3.js +0 -134
- package/dist/esm/content-state-f39c4bbf.js +0 -132
- package/dist/vega/p-0283712e.entry.js +0 -13
- package/dist/vega/p-0ee10fd7.js +0 -1
- package/dist/vega/p-2f32a9ba.js +0 -1
- package/dist/vega/p-36db2554.entry.js +0 -1
- package/dist/vega/p-42df8a42.js +0 -1
- package/dist/vega/p-6d23c08b.entry.js +0 -1
- package/dist/vega/p-843b13e6.entry.js +0 -1
- package/dist/vega/p-85365f8b.js +0 -1
- package/dist/vega/p-8be7b62c.entry.js +0 -1
- package/dist/vega/p-96f0ef53.entry.js +0 -1
- package/dist/vega/p-c88acd87.entry.js +0 -1
- package/dist/vega/p-dbec03ed.entry.js +0 -1
- package/dist/vega/p-de13b747.entry.js +0 -1
- package/dist/vega/p-f357cf46.js +0 -1
- package/dist/vega/p-ff50c204.entry.js +0 -1
|
@@ -9,21 +9,20 @@ const component = require('./component-73a88c4e.js');
|
|
|
9
9
|
const accessibility = require('./accessibility-bfa227f6.js');
|
|
10
10
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
11
11
|
const domNodeSubjectFactory = require('./dom-node-subject-factory-3ec114b8.js');
|
|
12
|
-
const vegaInternalEventId = require('./vega-internal-event-id-
|
|
13
|
-
const imageAnnotationAction = require('./image-annotation-action-
|
|
12
|
+
const vegaInternalEventId = require('./vega-internal-event-id-b12071ea.js');
|
|
13
|
+
const imageAnnotationAction = require('./image-annotation-action-4135ca69.js');
|
|
14
14
|
const internalIconManager = require('./internal-icon-manager-5ccb9443.js');
|
|
15
|
-
const
|
|
16
|
-
const nodeAnnotation_abstract = require('./node-annotation.abstract-
|
|
15
|
+
const contentState = require('./content-state-2336e368.js');
|
|
16
|
+
const nodeAnnotation_abstract = require('./node-annotation.abstract-c3c07af5.js');
|
|
17
17
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-5f0eae19.js');
|
|
18
18
|
const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtime-metrics-slimmer-54c3f73b.js');
|
|
19
|
-
const formFieldControllerSlimmer = require('./form-field-controller-slimmer-
|
|
19
|
+
const formFieldControllerSlimmer = require('./form-field-controller-slimmer-8d4d2723.js');
|
|
20
20
|
const eventEmitSlimmer = require('./event-emit-slimmer-9c223f73.js');
|
|
21
|
-
const subStateNotifySlimmer = require('./sub-state-notify-slimmer-
|
|
21
|
+
const subStateNotifySlimmer = require('./sub-state-notify-slimmer-994eb848.js');
|
|
22
22
|
const timer = require('./timer-5f33058b.js');
|
|
23
23
|
const synchronizeTaskQueue = require('./synchronize-task-queue-1ee80e94.js');
|
|
24
24
|
const ui = require('./ui-5fd9b267.js');
|
|
25
25
|
const staticSubjectTitle = require('./static-subject-title-d66b88fb.js');
|
|
26
|
-
const contentState = require('./content-state-3e4467a3.js');
|
|
27
26
|
require('./vega-env-manager-23b8b23c.js');
|
|
28
27
|
require('./vega-skeleton-loader-controller-7dac484f.js');
|
|
29
28
|
require('./feature-flag-controller-7b22e598.js');
|
|
@@ -292,13 +291,13 @@ class BoldToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSlimme
|
|
|
292
291
|
const bold = this.isSelected();
|
|
293
292
|
this.selectionController
|
|
294
293
|
.getSelectedNodes()
|
|
295
|
-
.filter((node) => node instanceof
|
|
296
|
-
.forEach((node) => node.apply(new
|
|
294
|
+
.filter((node) => node instanceof contentState.RTETextNode)
|
|
295
|
+
.forEach((node) => node.apply(new contentState.BoldAnnotationAction(!bold)));
|
|
297
296
|
}
|
|
298
297
|
isSelected() {
|
|
299
298
|
const selectedNodes = this.selectionController
|
|
300
299
|
.getSelectedNodes()
|
|
301
|
-
.filter((node) => node instanceof
|
|
300
|
+
.filter((node) => node instanceof contentState.RTETextNode);
|
|
302
301
|
return (selectedNodes.length > 0 &&
|
|
303
302
|
selectedNodes.every((node) => { var _a; return (_a = node.getAnnotationByType(nodeAnnotation_abstract.NodeAnnotationTypeEnum.BOLD)) === null || _a === void 0 ? void 0 : _a.bold; }));
|
|
304
303
|
}
|
|
@@ -325,7 +324,7 @@ const italic = {
|
|
|
325
324
|
/**
|
|
326
325
|
* Action to toggle the italic annotation
|
|
327
326
|
*/
|
|
328
|
-
class ItalicAnnotationAction extends
|
|
327
|
+
class ItalicAnnotationAction extends contentState.TextSplittableAction {
|
|
329
328
|
constructor(italic) {
|
|
330
329
|
super();
|
|
331
330
|
this.isFlushable = true;
|
|
@@ -337,7 +336,7 @@ class ItalicAnnotationAction extends listBlock.TextSplittableAction {
|
|
|
337
336
|
* @returns {ItalicAnnotation} The annotation
|
|
338
337
|
*/
|
|
339
338
|
toAnnotation() {
|
|
340
|
-
return new
|
|
339
|
+
return new contentState.ItalicAnnotation(this.italic);
|
|
341
340
|
}
|
|
342
341
|
}
|
|
343
342
|
|
|
@@ -357,7 +356,7 @@ class ItalicToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSlim
|
|
|
357
356
|
isSelected() {
|
|
358
357
|
const selectedNodes = this.selectionController
|
|
359
358
|
.getSelectedNodes()
|
|
360
|
-
.filter((node) => node instanceof
|
|
359
|
+
.filter((node) => node instanceof contentState.RTETextNode);
|
|
361
360
|
return (selectedNodes.length > 0 &&
|
|
362
361
|
selectedNodes.every((node) => { var _a; return (_a = node.getAnnotationByType(nodeAnnotation_abstract.NodeAnnotationTypeEnum.ITALIC)) === null || _a === void 0 ? void 0 : _a.italic; }));
|
|
363
362
|
}
|
|
@@ -365,7 +364,7 @@ class ItalicToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSlim
|
|
|
365
364
|
const italic = this.isSelected();
|
|
366
365
|
this.selectionController
|
|
367
366
|
.getSelectedNodes()
|
|
368
|
-
.filter((node) => node instanceof
|
|
367
|
+
.filter((node) => node instanceof contentState.RTETextNode)
|
|
369
368
|
.forEach((node) => node.apply(new ItalicAnnotationAction(!italic)));
|
|
370
369
|
}
|
|
371
370
|
isDisabled() {
|
|
@@ -391,7 +390,7 @@ const underline = {
|
|
|
391
390
|
/**
|
|
392
391
|
* Action to toggle the underline annotation
|
|
393
392
|
*/
|
|
394
|
-
class UnderlineAnnotationAction extends
|
|
393
|
+
class UnderlineAnnotationAction extends contentState.TextSplittableAction {
|
|
395
394
|
constructor(underline) {
|
|
396
395
|
super();
|
|
397
396
|
this.isFlushable = true;
|
|
@@ -403,7 +402,7 @@ class UnderlineAnnotationAction extends listBlock.TextSplittableAction {
|
|
|
403
402
|
* @returns {UnderlineAnnotation} the annotation
|
|
404
403
|
*/
|
|
405
404
|
toAnnotation() {
|
|
406
|
-
return new
|
|
405
|
+
return new contentState.UnderlineAnnotation(this.underline);
|
|
407
406
|
}
|
|
408
407
|
}
|
|
409
408
|
|
|
@@ -423,7 +422,7 @@ class UnderlineToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonS
|
|
|
423
422
|
isSelected() {
|
|
424
423
|
const selectedNodes = this.selectionController
|
|
425
424
|
.getSelectedNodes()
|
|
426
|
-
.filter((node) => node instanceof
|
|
425
|
+
.filter((node) => node instanceof contentState.RTETextNode);
|
|
427
426
|
return (selectedNodes.length > 0 &&
|
|
428
427
|
selectedNodes.every((node) => {
|
|
429
428
|
var _a;
|
|
@@ -434,7 +433,7 @@ class UnderlineToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonS
|
|
|
434
433
|
const selected = this.isSelected();
|
|
435
434
|
this.selectionController
|
|
436
435
|
.getSelectedNodes()
|
|
437
|
-
.filter((node) => node instanceof
|
|
436
|
+
.filter((node) => node instanceof contentState.RTETextNode)
|
|
438
437
|
.forEach((node) => node.apply(new UnderlineAnnotationAction(!selected)));
|
|
439
438
|
}
|
|
440
439
|
isDisabled() {
|
|
@@ -474,19 +473,19 @@ class TextStylesToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButton
|
|
|
474
473
|
const boldByDefault = TextStylesToolbarButtonSlimmer.items.find((item) => item.key === selectedType).bold;
|
|
475
474
|
const selectedTextBlocks = this.selectionController
|
|
476
475
|
.getSelectedBlocks()
|
|
477
|
-
.filter((block) => block instanceof
|
|
476
|
+
.filter((block) => block instanceof contentState.RTETextBlock);
|
|
478
477
|
if (selectedTextBlocks.length > 0) {
|
|
479
478
|
selectedTextBlocks.forEach((item) => {
|
|
480
|
-
item.apply(new
|
|
479
|
+
item.apply(new contentState.TextStyleAnnotationAction(selectedType, boldByDefault));
|
|
481
480
|
});
|
|
482
481
|
}
|
|
483
482
|
else {
|
|
484
483
|
void this.focusController.focusOnLastTextNode({ newLine: true }).then(() => {
|
|
485
484
|
this.selectionController
|
|
486
485
|
.getSelectedBlocks()
|
|
487
|
-
.filter((node) => node instanceof
|
|
486
|
+
.filter((node) => node instanceof contentState.RTETextBlock)
|
|
488
487
|
.forEach((item) => {
|
|
489
|
-
item.apply(new
|
|
488
|
+
item.apply(new contentState.TextStyleAnnotationAction(selectedType, boldByDefault));
|
|
490
489
|
});
|
|
491
490
|
});
|
|
492
491
|
}
|
|
@@ -501,8 +500,8 @@ class TextStylesToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButton
|
|
|
501
500
|
}
|
|
502
501
|
renderDropdownContent() {
|
|
503
502
|
return (index.h(index.Fragment, null, TextStylesToolbarButtonSlimmer.items.map((item) => {
|
|
504
|
-
const textStyleAnnotation = new
|
|
505
|
-
const boldAnnotation = new
|
|
503
|
+
const textStyleAnnotation = new contentState.TextStyleAnnotation(item.key);
|
|
504
|
+
const boldAnnotation = new contentState.BoldAnnotation(item.bold);
|
|
506
505
|
return (index.h("vega-dropdown-item", { key: item.key, itemKey: item.key },
|
|
507
506
|
index.h("vega-box", { padding: { right: 'size-20' } },
|
|
508
507
|
index.h("div", { style: Object.assign(Object.assign({}, textStyleAnnotation.render()), boldAnnotation.render()) }, item.label))));
|
|
@@ -521,7 +520,7 @@ class TextStylesToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButton
|
|
|
521
520
|
getSelectedSourceKey() {
|
|
522
521
|
const currentSelectedBlocks = this.selectionController
|
|
523
522
|
.getSelectedBlocks()
|
|
524
|
-
.filter((block) => block instanceof
|
|
523
|
+
.filter((block) => block instanceof contentState.RTETextBlock);
|
|
525
524
|
const isSameType = currentSelectedBlocks.length > 0 &&
|
|
526
525
|
currentSelectedBlocks.every((block) => block.type === currentSelectedBlocks[0].type);
|
|
527
526
|
if (isSameType) {
|
|
@@ -598,9 +597,9 @@ class ClearStyleToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButton
|
|
|
598
597
|
onClick() {
|
|
599
598
|
this.selectionController
|
|
600
599
|
.getSelectedNodes()
|
|
601
|
-
.filter((node) => node instanceof
|
|
600
|
+
.filter((node) => node instanceof contentState.RTETextNode)
|
|
602
601
|
.forEach((node) => {
|
|
603
|
-
node.apply(new
|
|
602
|
+
node.apply(new contentState.ClearFormattingAnnotationAction());
|
|
604
603
|
});
|
|
605
604
|
}
|
|
606
605
|
isDisabled() {
|
|
@@ -638,14 +637,14 @@ class CodeToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSlimme
|
|
|
638
637
|
const selected = this.isSelected();
|
|
639
638
|
this.selectionController
|
|
640
639
|
.getSelectedNodes()
|
|
641
|
-
.filter((node) => node instanceof
|
|
642
|
-
.forEach((node) => node.apply(new
|
|
640
|
+
.filter((node) => node instanceof contentState.RTETextNode)
|
|
641
|
+
.forEach((node) => node.apply(new contentState.CodeAnnotationAction(!selected)));
|
|
643
642
|
}
|
|
644
643
|
isSelected() {
|
|
645
644
|
const selectedNodes = this.selectionController.getSelectedNodes();
|
|
646
645
|
return (selectedNodes.length > 0 &&
|
|
647
646
|
selectedNodes
|
|
648
|
-
.filter((node) => node instanceof
|
|
647
|
+
.filter((node) => node instanceof contentState.RTETextNode)
|
|
649
648
|
.map((node) => node.getAnnotationByType(nodeAnnotation_abstract.NodeAnnotationTypeEnum.CODE))
|
|
650
649
|
.every((annotation) => annotation && annotation.code));
|
|
651
650
|
}
|
|
@@ -669,7 +668,7 @@ const strikethrough = {
|
|
|
669
668
|
/**
|
|
670
669
|
* Action to toggle the strikethrough annotation
|
|
671
670
|
*/
|
|
672
|
-
class StrikethroughAnnotationAction extends
|
|
671
|
+
class StrikethroughAnnotationAction extends contentState.TextSplittableAction {
|
|
673
672
|
constructor(underline) {
|
|
674
673
|
super();
|
|
675
674
|
this.isFlushable = true;
|
|
@@ -681,7 +680,7 @@ class StrikethroughAnnotationAction extends listBlock.TextSplittableAction {
|
|
|
681
680
|
* @returns {StrikethroughAnnotation} the annotation
|
|
682
681
|
*/
|
|
683
682
|
toAnnotation() {
|
|
684
|
-
return new
|
|
683
|
+
return new contentState.StrikethroughAnnotation(this.strikethrough);
|
|
685
684
|
}
|
|
686
685
|
}
|
|
687
686
|
|
|
@@ -701,7 +700,7 @@ class StrikethroughToolbarButtonSlimmer extends imageAnnotationAction.ToolbarBut
|
|
|
701
700
|
isSelected() {
|
|
702
701
|
const selectedNodes = this.selectionController
|
|
703
702
|
.getSelectedNodes()
|
|
704
|
-
.filter((node) => node instanceof
|
|
703
|
+
.filter((node) => node instanceof contentState.RTETextNode);
|
|
705
704
|
return (selectedNodes.length > 0 &&
|
|
706
705
|
selectedNodes.every((node) => {
|
|
707
706
|
var _a;
|
|
@@ -712,7 +711,7 @@ class StrikethroughToolbarButtonSlimmer extends imageAnnotationAction.ToolbarBut
|
|
|
712
711
|
const selected = this.isSelected();
|
|
713
712
|
this.selectionController
|
|
714
713
|
.getSelectedNodes()
|
|
715
|
-
.filter((node) => node instanceof
|
|
714
|
+
.filter((node) => node instanceof contentState.RTETextNode)
|
|
716
715
|
.forEach((node) => node.apply(new StrikethroughAnnotationAction(!selected)));
|
|
717
716
|
}
|
|
718
717
|
isDisabled() {
|
|
@@ -738,7 +737,7 @@ const link = {
|
|
|
738
737
|
/**
|
|
739
738
|
* Action to change the selection range
|
|
740
739
|
*/
|
|
741
|
-
class SelectionChangeAction extends
|
|
740
|
+
class SelectionChangeAction extends contentState.AnnotationAction {
|
|
742
741
|
constructor(range) {
|
|
743
742
|
super();
|
|
744
743
|
this.isFlushable = false;
|
|
@@ -750,7 +749,7 @@ class SelectionChangeAction extends listBlock.AnnotationAction {
|
|
|
750
749
|
* @returns {SelectionRangeAnnotation} The annotation
|
|
751
750
|
*/
|
|
752
751
|
toAnnotation() {
|
|
753
|
-
return new
|
|
752
|
+
return new contentState.SelectionRangeAnnotation(this.range);
|
|
754
753
|
}
|
|
755
754
|
}
|
|
756
755
|
|
|
@@ -775,7 +774,7 @@ class LinkToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSlimme
|
|
|
775
774
|
const textChanged = text !== this.currentSelectedText;
|
|
776
775
|
const groupKey = createPublicApiRuntimeMetricsSlimmer.generateUUID();
|
|
777
776
|
this.currentSelectedNodes.forEach((node) => {
|
|
778
|
-
node.apply(new SelectionChangeAction(this.currentRange)).apply(new
|
|
777
|
+
node.apply(new SelectionChangeAction(this.currentRange)).apply(new contentState.LinkAnnotationAction({
|
|
779
778
|
link: { href: url, groupKey: groupKey },
|
|
780
779
|
newText: textChanged ? text : undefined,
|
|
781
780
|
needMergeNode: textChanged && this.currentSelectedNodes.length > 1,
|
|
@@ -805,7 +804,7 @@ class LinkToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSlimme
|
|
|
805
804
|
return (selectedBlocks.length > 1 ||
|
|
806
805
|
selectedNodes.some((node) => {
|
|
807
806
|
var _a;
|
|
808
|
-
return !(node instanceof
|
|
807
|
+
return !(node instanceof contentState.RTETextNode) ||
|
|
809
808
|
node.getAnnotationByType(nodeAnnotation_abstract.NodeAnnotationTypeEnum.LINK) ||
|
|
810
809
|
((_a = node.getAnnotationByType(nodeAnnotation_abstract.NodeAnnotationTypeEnum.CODE)) === null || _a === void 0 ? void 0 : _a.code);
|
|
811
810
|
}));
|
|
@@ -826,7 +825,7 @@ class LinkToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSlimme
|
|
|
826
825
|
// Element appender will control the show and hide logic except for the first time.
|
|
827
826
|
if (!this.linkEditorRef.target) {
|
|
828
827
|
this.linkEditorRef.target = this.linkBtnWrapperRef;
|
|
829
|
-
void
|
|
828
|
+
void contentState.waitForComponentDidRender(this.linkEditorRef).then(() => {
|
|
830
829
|
void this.linkEditorRef.show();
|
|
831
830
|
});
|
|
832
831
|
}
|
|
@@ -846,7 +845,7 @@ const indent = {
|
|
|
846
845
|
/**
|
|
847
846
|
* Action to toggle block indent annotation
|
|
848
847
|
*/
|
|
849
|
-
class IndentAnnotationAction extends
|
|
848
|
+
class IndentAnnotationAction extends contentState.AnnotationAction {
|
|
850
849
|
constructor(indent) {
|
|
851
850
|
super();
|
|
852
851
|
this.isFlushable = true;
|
|
@@ -858,7 +857,7 @@ class IndentAnnotationAction extends listBlock.AnnotationAction {
|
|
|
858
857
|
* @returns {IndentAnnotation} The annotation
|
|
859
858
|
*/
|
|
860
859
|
toAnnotation() {
|
|
861
|
-
return new
|
|
860
|
+
return new contentState.IndentAnnotation(this.indent);
|
|
862
861
|
}
|
|
863
862
|
}
|
|
864
863
|
|
|
@@ -884,7 +883,7 @@ class MoreIndentToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButton
|
|
|
884
883
|
const selectedBlocks = this.selectionController.getSelectedBlocks();
|
|
885
884
|
const selectedNodes = this.selectionController.getSelectedNodes();
|
|
886
885
|
return (selectedBlocks.some((node) => node.type === 'list-item') ||
|
|
887
|
-
selectedNodes.some((node) => node instanceof
|
|
886
|
+
selectedNodes.some((node) => node instanceof contentState.RTEImageNode));
|
|
888
887
|
}
|
|
889
888
|
onClick() {
|
|
890
889
|
this.selectionController.getSelectedBlocks().forEach((item) => {
|
|
@@ -927,7 +926,7 @@ class LessIndentToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButton
|
|
|
927
926
|
const selectedBlocks = this.selectionController.getSelectedBlocks();
|
|
928
927
|
const selectedNodes = this.selectionController.getSelectedNodes();
|
|
929
928
|
return (selectedBlocks.some((node) => node.type === 'list-item') ||
|
|
930
|
-
selectedNodes.some((node) => node instanceof
|
|
929
|
+
selectedNodes.some((node) => node instanceof contentState.RTEImageNode));
|
|
931
930
|
}
|
|
932
931
|
onClick() {
|
|
933
932
|
this.selectionController.getSelectedBlocks().forEach((item) => {
|
|
@@ -1079,11 +1078,11 @@ class BulletsToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSli
|
|
|
1079
1078
|
}
|
|
1080
1079
|
isDisabled() {
|
|
1081
1080
|
const selectedNodes = this.selectionController.getSelectedNodes();
|
|
1082
|
-
return selectedNodes.some((node) => node instanceof
|
|
1081
|
+
return selectedNodes.some((node) => node instanceof contentState.RTEImageNode);
|
|
1083
1082
|
}
|
|
1084
1083
|
isListType(selectedBlocks, type = 'bullet-list') {
|
|
1085
1084
|
return (selectedBlocks.length > 0 &&
|
|
1086
|
-
selectedBlocks.every((block) => block instanceof
|
|
1085
|
+
selectedBlocks.every((block) => block instanceof contentState.RTEListItemBlock && block.parent.type === type));
|
|
1087
1086
|
}
|
|
1088
1087
|
/**
|
|
1089
1088
|
* Deselect bullet list item to convert it to default paragraph
|
|
@@ -1142,11 +1141,11 @@ class NumbersToolbarButtonSlimmer extends imageAnnotationAction.ToolbarButtonSli
|
|
|
1142
1141
|
}
|
|
1143
1142
|
isDisabled() {
|
|
1144
1143
|
const selectedNodes = this.selectionController.getSelectedNodes();
|
|
1145
|
-
return selectedNodes.some((node) => node instanceof
|
|
1144
|
+
return selectedNodes.some((node) => node instanceof contentState.RTEImageNode);
|
|
1146
1145
|
}
|
|
1147
1146
|
isListType(selectedBlocks, type = 'number-list') {
|
|
1148
1147
|
return (selectedBlocks.length > 0 &&
|
|
1149
|
-
selectedBlocks.every((block) => block instanceof
|
|
1148
|
+
selectedBlocks.every((block) => block instanceof contentState.RTEListItemBlock && block.parent.type === type));
|
|
1150
1149
|
}
|
|
1151
1150
|
/**
|
|
1152
1151
|
* Deselect bullet list item to convert it to default paragraph
|
|
@@ -1217,7 +1216,7 @@ class BulletsNumbersToolbarButtonSlimmer extends imageAnnotationAction.ToolbarBu
|
|
|
1217
1216
|
}
|
|
1218
1217
|
isDisabled() {
|
|
1219
1218
|
const selectedNodes = this.selectionController.getSelectedNodes();
|
|
1220
|
-
return selectedNodes.some((node) => node instanceof
|
|
1219
|
+
return selectedNodes.some((node) => node instanceof contentState.RTEImageNode);
|
|
1221
1220
|
}
|
|
1222
1221
|
}
|
|
1223
1222
|
(() => {
|
|
@@ -1242,7 +1241,7 @@ __decorate$j([
|
|
|
1242
1241
|
/**
|
|
1243
1242
|
* Action to toggle block horizontal alignment annotation
|
|
1244
1243
|
*/
|
|
1245
|
-
class HorizontalAlignmentAnnotationAction extends
|
|
1244
|
+
class HorizontalAlignmentAnnotationAction extends contentState.AnnotationAction {
|
|
1246
1245
|
constructor(textAlign) {
|
|
1247
1246
|
super();
|
|
1248
1247
|
this.isFlushable = true;
|
|
@@ -1254,7 +1253,7 @@ class HorizontalAlignmentAnnotationAction extends listBlock.AnnotationAction {
|
|
|
1254
1253
|
* @returns {HorizontalAlignmentAnnotation} The annotation
|
|
1255
1254
|
*/
|
|
1256
1255
|
toAnnotation() {
|
|
1257
|
-
return new
|
|
1256
|
+
return new contentState.HorizontalAlignmentAnnotation(this.textAlign);
|
|
1258
1257
|
}
|
|
1259
1258
|
}
|
|
1260
1259
|
|
|
@@ -1828,7 +1827,7 @@ class RTERange {
|
|
|
1828
1827
|
if (node) {
|
|
1829
1828
|
const element = nodeAnnotation_abstract.stateEntityRenderingRegistry.getDOMByEntity(node);
|
|
1830
1829
|
if (element) {
|
|
1831
|
-
return node instanceof
|
|
1830
|
+
return node instanceof contentState.RTEImageNode
|
|
1832
1831
|
? ui.findParent(element, 'vega-rich-text-image-editor')
|
|
1833
1832
|
: element.firstChild;
|
|
1834
1833
|
}
|
|
@@ -1997,7 +1996,7 @@ class SelectionController extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
1997
1996
|
const startNode = this.selectedNodes[0];
|
|
1998
1997
|
const endNode = this.selectedNodes.length > 1 ? this.selectedNodes[this.selectedNodes.length - 1] : startNode;
|
|
1999
1998
|
if (startNode === endNode && startNode.text.length === 0) {
|
|
2000
|
-
this.enqueueSelectionRangeFutureState(startNode,
|
|
1999
|
+
this.enqueueSelectionRangeFutureState(startNode, contentState.ZERO_WIDTH_SPACE.length);
|
|
2001
2000
|
}
|
|
2002
2001
|
else {
|
|
2003
2002
|
const { startContainer, endContainer, startOffset, endOffset } = this.currentRange;
|
|
@@ -2158,11 +2157,22 @@ class ValueController extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
2158
2157
|
disconnectedCallback() {
|
|
2159
2158
|
changeManager.ChangeManager.unregister(domNodeSubjectFactory.domNodeSubjectFactory.getSubject(this.host, vegaInternalEventId.VegaInternalRichTextEditorFlushChanges), this.flushChangeObserver);
|
|
2160
2159
|
}
|
|
2160
|
+
/**
|
|
2161
|
+
* Component lifecycle - [componentWillLoad]{@link VegaRichTextEditor.componentWillLoad}
|
|
2162
|
+
*/
|
|
2163
|
+
componentWillLoad() {
|
|
2164
|
+
if (this.value && !(this.value instanceof contentState.VegaRTEContent)) {
|
|
2165
|
+
this.value = contentState.VegaRTEContent.fromJSON(this.value);
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2161
2168
|
/**
|
|
2162
2169
|
* Watches the value of the editor and updates the internal value.
|
|
2163
2170
|
*/
|
|
2164
2171
|
watchValueUpdate() {
|
|
2165
|
-
if (
|
|
2172
|
+
if (this.value && !(this.value instanceof contentState.VegaRTEContent)) {
|
|
2173
|
+
this.value = contentState.VegaRTEContent.fromJSON(this.value);
|
|
2174
|
+
}
|
|
2175
|
+
else if (!this.value || this.value.blocks.length === 0) {
|
|
2166
2176
|
this.value = contentState.VegaRTEContent.createEmptyContent();
|
|
2167
2177
|
}
|
|
2168
2178
|
else {
|
|
@@ -2180,7 +2190,7 @@ class ValueController extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
2180
2190
|
*/
|
|
2181
2191
|
async flushChanges(newValue) {
|
|
2182
2192
|
this.value = newValue.clone();
|
|
2183
|
-
await
|
|
2193
|
+
await contentState.waitForComponentDidRender(this.host);
|
|
2184
2194
|
}
|
|
2185
2195
|
/**
|
|
2186
2196
|
* Determines whether the observer should accept changes.
|
|
@@ -2210,6 +2220,9 @@ __decorate$c([
|
|
|
2210
2220
|
__decorate$c([
|
|
2211
2221
|
globalSlimmerRegistry.MapToComponentMethod('disconnectedCallback')
|
|
2212
2222
|
], ValueController.prototype, "disconnectedCallback", null);
|
|
2223
|
+
__decorate$c([
|
|
2224
|
+
globalSlimmerRegistry.MapToComponentMethod('componentWillLoad')
|
|
2225
|
+
], ValueController.prototype, "componentWillLoad", null);
|
|
2213
2226
|
__decorate$c([
|
|
2214
2227
|
globalSlimmerRegistry.MapToComponentMethod('watchValueUpdate')
|
|
2215
2228
|
], ValueController.prototype, "watchValueUpdate", null);
|
|
@@ -2314,8 +2327,8 @@ class BaseHandler {
|
|
|
2314
2327
|
const { startContainer, endContainer } = range;
|
|
2315
2328
|
const result = this.removeSelectionRange();
|
|
2316
2329
|
const startNode = selectedNodes[0];
|
|
2317
|
-
if (startNode instanceof
|
|
2318
|
-
startNode.apply(new
|
|
2330
|
+
if (startNode instanceof contentState.RTETextNode && text) {
|
|
2331
|
+
startNode.apply(new contentState.UpdateTextAction(startNode.text + text));
|
|
2319
2332
|
}
|
|
2320
2333
|
this.mergeRangeStartAndEnd(startContainer, endContainer);
|
|
2321
2334
|
return result;
|
|
@@ -2346,10 +2359,10 @@ class BaseHandler {
|
|
|
2346
2359
|
removeRangeStartAndEndSelectedText() {
|
|
2347
2360
|
const selectedNodes = this.selectionController.getSelectedNodes();
|
|
2348
2361
|
const currentRange = this.selectionController.getCurrentRange();
|
|
2349
|
-
if (selectedNodes[0] instanceof
|
|
2362
|
+
if (selectedNodes[0] instanceof contentState.RTETextNode) {
|
|
2350
2363
|
selectedNodes[0].apply(new ReplaceSelectedTextAction('', currentRange));
|
|
2351
2364
|
}
|
|
2352
|
-
if (selectedNodes.length > 1 && selectedNodes[selectedNodes.length - 1] instanceof
|
|
2365
|
+
if (selectedNodes.length > 1 && selectedNodes[selectedNodes.length - 1] instanceof contentState.RTETextNode) {
|
|
2353
2366
|
selectedNodes[selectedNodes.length - 1].apply(new ReplaceSelectedTextAction('', currentRange));
|
|
2354
2367
|
}
|
|
2355
2368
|
}
|
|
@@ -2368,20 +2381,20 @@ class BaseHandler {
|
|
|
2368
2381
|
if (startRTENode && startRTENode.parentBlock && endRTENode && endRTENode.parentBlock) {
|
|
2369
2382
|
const endBlock = endRTENode.parentBlock;
|
|
2370
2383
|
if (this.shouldMergeTextNode(startRTENode, endRTENode)) {
|
|
2371
|
-
startRTENode.apply(new
|
|
2384
|
+
startRTENode.apply(new contentState.UpdateTextAction(startRTENode.text + endRTENode.text));
|
|
2372
2385
|
if (startRTENode.parentBlock === endRTENode.parentBlock) {
|
|
2373
|
-
startRTENode.parentBlock.apply(new
|
|
2386
|
+
startRTENode.parentBlock.apply(new contentState.RemoveChildAction(endRTENode));
|
|
2374
2387
|
}
|
|
2375
2388
|
else {
|
|
2376
|
-
endRTENode.parentBlock.apply(new
|
|
2389
|
+
endRTENode.parentBlock.apply(new contentState.RemoveChildAction(endRTENode.parentBlock.nodes[0]));
|
|
2377
2390
|
}
|
|
2378
2391
|
}
|
|
2379
2392
|
if (startRTENode.parentBlock !== endRTENode.parentBlock) {
|
|
2380
|
-
startRTENode.parentBlock.apply(new
|
|
2393
|
+
startRTENode.parentBlock.apply(new contentState.AppendChildNodesAction(endBlock.nodes));
|
|
2381
2394
|
endBlock.nodes = [];
|
|
2382
2395
|
}
|
|
2383
2396
|
if (endBlock.nodes.length < 1) {
|
|
2384
|
-
endBlock.parent.apply(new
|
|
2397
|
+
endBlock.parent.apply(new contentState.RemoveChildAction(endBlock));
|
|
2385
2398
|
}
|
|
2386
2399
|
}
|
|
2387
2400
|
}
|
|
@@ -2410,7 +2423,7 @@ class BaseHandler {
|
|
|
2410
2423
|
}
|
|
2411
2424
|
});
|
|
2412
2425
|
shouldRemovedItems.forEach((item) => {
|
|
2413
|
-
item.parentBlock.apply(new
|
|
2426
|
+
item.parentBlock.apply(new contentState.RemoveChildAction(item));
|
|
2414
2427
|
});
|
|
2415
2428
|
}
|
|
2416
2429
|
this.removeRangeStartAndEndSelectedText();
|
|
@@ -2418,19 +2431,19 @@ class BaseHandler {
|
|
|
2418
2431
|
* if the range start node is image and the item is selected, so we need remove the image item, the image block will be removed if the item is the only item.
|
|
2419
2432
|
* but before remove the image block, we need insert a paragraph to make sure the start block and start node could be get correct before insert text or break paragraph action
|
|
2420
2433
|
*/
|
|
2421
|
-
if (startNode instanceof
|
|
2434
|
+
if (startNode instanceof contentState.RTEImageNode &&
|
|
2422
2435
|
startOffset !== 1 &&
|
|
2423
2436
|
(endNode !== startNode || endOffset !== 0)) {
|
|
2424
2437
|
// the image block will be deleted when the image is the only item
|
|
2425
2438
|
if (startNode.parentBlock.nodes.length === 1) {
|
|
2426
2439
|
const paragraph = this.createEmptyParagraph();
|
|
2427
|
-
startNode.parentBlock.parent.apply(new
|
|
2428
|
-
startNode.parentBlock.apply(new
|
|
2440
|
+
startNode.parentBlock.parent.apply(new contentState.InsertBlocksBeforeAction(startNode.parentBlock, paragraph));
|
|
2441
|
+
startNode.parentBlock.apply(new contentState.RemoveChildAction(startNode));
|
|
2429
2442
|
return paragraph.nodes[0];
|
|
2430
2443
|
}
|
|
2431
2444
|
else if (startNode === startNode.parentBlock.nodes[0]) {
|
|
2432
2445
|
// the start node should be the next image item if the image is first item
|
|
2433
|
-
startNode.parentBlock.apply(new
|
|
2446
|
+
startNode.parentBlock.apply(new contentState.RemoveChildAction(startNode));
|
|
2434
2447
|
return startNode.parentBlock.nodes[0];
|
|
2435
2448
|
}
|
|
2436
2449
|
}
|
|
@@ -2442,9 +2455,9 @@ class BaseHandler {
|
|
|
2442
2455
|
* @returns {RTETextBlock} An empty paragraph with a unique identifier and a text node appended to it.
|
|
2443
2456
|
*/
|
|
2444
2457
|
createEmptyParagraph() {
|
|
2445
|
-
const paragraph = new
|
|
2446
|
-
const textNode = new
|
|
2447
|
-
paragraph.apply(new
|
|
2458
|
+
const paragraph = new contentState.RTETextBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), 'paragraph');
|
|
2459
|
+
const textNode = new contentState.RTETextNode(`${paragraph.id}1`, '', paragraph);
|
|
2460
|
+
paragraph.apply(new contentState.AppendChildNodesAction([textNode]));
|
|
2448
2461
|
return paragraph;
|
|
2449
2462
|
}
|
|
2450
2463
|
/**
|
|
@@ -2502,7 +2515,7 @@ class InsertTextHandler extends BaseHandler {
|
|
|
2502
2515
|
const cursorNode = this.insertTextToRoot(text);
|
|
2503
2516
|
this.selectionController.enqueueSelectionRangeFutureState(cursorNode, text.length);
|
|
2504
2517
|
}
|
|
2505
|
-
else if (selectedNodes[0] instanceof
|
|
2518
|
+
else if (selectedNodes[0] instanceof contentState.RTETextNode) {
|
|
2506
2519
|
let nextOffset = startOffset + text.length;
|
|
2507
2520
|
let updateFlag = false;
|
|
2508
2521
|
let cursorNode = selectedNodes[0];
|
|
@@ -2511,13 +2524,13 @@ class InsertTextHandler extends BaseHandler {
|
|
|
2511
2524
|
updateFlag = true;
|
|
2512
2525
|
}
|
|
2513
2526
|
else {
|
|
2514
|
-
if (startContainer.nodeValue ===
|
|
2515
|
-
startOffset ===
|
|
2527
|
+
if (startContainer.nodeValue === contentState.ZERO_WIDTH_SPACE &&
|
|
2528
|
+
startOffset === contentState.ZERO_WIDTH_SPACE.length &&
|
|
2516
2529
|
cursorNode.isEmpty()) {
|
|
2517
2530
|
startContainer.nodeValue = '';
|
|
2518
|
-
nextOffset = nextOffset -
|
|
2531
|
+
nextOffset = nextOffset - contentState.ZERO_WIDTH_SPACE.length;
|
|
2519
2532
|
}
|
|
2520
|
-
if (cursorNode instanceof
|
|
2533
|
+
if (cursorNode instanceof contentState.RTETextNode) {
|
|
2521
2534
|
updateFlag = true;
|
|
2522
2535
|
cursorNode.apply(new ReplaceSelectedTextAction(text, currentRange));
|
|
2523
2536
|
}
|
|
@@ -2529,7 +2542,7 @@ class InsertTextHandler extends BaseHandler {
|
|
|
2529
2542
|
else {
|
|
2530
2543
|
// The selected nodes is multiple nodes
|
|
2531
2544
|
const cursorNode = this.replaceSelectedNodesWithText(text);
|
|
2532
|
-
this.selectionController.enqueueSelectionRangeFutureState(cursorNode, cursorNode instanceof
|
|
2545
|
+
this.selectionController.enqueueSelectionRangeFutureState(cursorNode, cursorNode instanceof contentState.RTETextNode
|
|
2533
2546
|
? Math.min(startOffset + text.length, cursorNode.text.length)
|
|
2534
2547
|
: startOffset);
|
|
2535
2548
|
}
|
|
@@ -2543,9 +2556,9 @@ class InsertTextHandler extends BaseHandler {
|
|
|
2543
2556
|
insertTextToRoot(text) {
|
|
2544
2557
|
if (this.currentState &&
|
|
2545
2558
|
this.currentState.blocks[0] &&
|
|
2546
|
-
this.currentState.blocks[0] instanceof
|
|
2559
|
+
this.currentState.blocks[0] instanceof contentState.RTETextBlock) {
|
|
2547
2560
|
const firstNode = this.currentState.blocks[0].nodes[0];
|
|
2548
|
-
firstNode.apply(new
|
|
2561
|
+
firstNode.apply(new contentState.UpdateTextAction(text));
|
|
2549
2562
|
return firstNode;
|
|
2550
2563
|
}
|
|
2551
2564
|
}
|
|
@@ -2566,7 +2579,7 @@ class InsertTextHandler extends BaseHandler {
|
|
|
2566
2579
|
return newTextNode;
|
|
2567
2580
|
}
|
|
2568
2581
|
else {
|
|
2569
|
-
lineBreakNode.apply(new
|
|
2582
|
+
lineBreakNode.apply(new contentState.UpdateTextAction(text));
|
|
2570
2583
|
return lineBreakNode;
|
|
2571
2584
|
}
|
|
2572
2585
|
}
|
|
@@ -2641,8 +2654,8 @@ class InsertParagraphHandler extends BaseHandler {
|
|
|
2641
2654
|
*/
|
|
2642
2655
|
if (firstBlock.type !== lastBlock.type &&
|
|
2643
2656
|
range.startContainer.nodeType === range.endContainer.nodeType) {
|
|
2644
|
-
firstBlock.apply(new
|
|
2645
|
-
const splitAction = new
|
|
2657
|
+
firstBlock.apply(new contentState.MergeTwoBlocksNodesAction(lastBlock));
|
|
2658
|
+
const splitAction = new contentState.SplitBlockWithNodeAction(cursorNode, cursorNode['text'].length);
|
|
2646
2659
|
firstBlock.apply(splitAction);
|
|
2647
2660
|
this.switchCaretPositionToNextElement(splitAction.newBlock);
|
|
2648
2661
|
return;
|
|
@@ -2728,10 +2741,10 @@ class InsertLineBreakHandler extends BaseHandler {
|
|
|
2728
2741
|
* </p>
|
|
2729
2742
|
*/
|
|
2730
2743
|
breakNewBlock() {
|
|
2731
|
-
const newBlock = new
|
|
2744
|
+
const newBlock = new contentState.RTETextBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), 'paragraph');
|
|
2732
2745
|
const lineBreakNode = this.createLineBreakNode(newBlock);
|
|
2733
|
-
newBlock.apply(new
|
|
2734
|
-
this.currentState.apply(new
|
|
2746
|
+
newBlock.apply(new contentState.AppendChildNodesAction([this.createLineBreakNode(newBlock), lineBreakNode]));
|
|
2747
|
+
this.currentState.apply(new contentState.AppendChildNodesAction([newBlock]));
|
|
2735
2748
|
this.switchCaretPositionToSpecifiedNode(lineBreakNode);
|
|
2736
2749
|
}
|
|
2737
2750
|
/**
|
|
@@ -2792,7 +2805,7 @@ class InsertLineBreakHandler extends BaseHandler {
|
|
|
2792
2805
|
* @returns {RTETextNode} the new line break node.
|
|
2793
2806
|
*/
|
|
2794
2807
|
createLineBreakNode(block) {
|
|
2795
|
-
return new
|
|
2808
|
+
return new contentState.RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', block);
|
|
2796
2809
|
}
|
|
2797
2810
|
}
|
|
2798
2811
|
|
|
@@ -2858,7 +2871,7 @@ class DeleteContentHandler extends BaseHandler {
|
|
|
2858
2871
|
*/
|
|
2859
2872
|
insertDefaultParagraph() {
|
|
2860
2873
|
const paragraph = this.createEmptyParagraph();
|
|
2861
|
-
this.currentState.apply(new
|
|
2874
|
+
this.currentState.apply(new contentState.AppendChildNodesAction([paragraph]));
|
|
2862
2875
|
this.selectionController.enqueueSelectionRangeFutureState(paragraph.nodes[0], 1);
|
|
2863
2876
|
}
|
|
2864
2877
|
/**
|
|
@@ -2870,9 +2883,9 @@ class DeleteContentHandler extends BaseHandler {
|
|
|
2870
2883
|
const cursorNode = this.replaceSelectedNodesWithText('');
|
|
2871
2884
|
const lastSelectedNode = selectedNodes[selectedNodes.length - 1];
|
|
2872
2885
|
if (selectedNodes.length > 1 &&
|
|
2873
|
-
lastSelectedNode instanceof
|
|
2886
|
+
lastSelectedNode instanceof contentState.RTETextNode &&
|
|
2874
2887
|
lastSelectedNode.isEmpty()) {
|
|
2875
|
-
lastSelectedNode.parentBlock.apply(new
|
|
2888
|
+
lastSelectedNode.parentBlock.apply(new contentState.RemoveChildAction(lastSelectedNode));
|
|
2876
2889
|
}
|
|
2877
2890
|
this.convertFirstBlockToParagraph(cursorNode.parentBlock);
|
|
2878
2891
|
this.selectionController.enqueueSelectionRangeFutureState(cursorNode, range.startOffset);
|
|
@@ -2885,14 +2898,14 @@ class DeleteContentHandler extends BaseHandler {
|
|
|
2885
2898
|
convertFirstBlockToParagraph(block) {
|
|
2886
2899
|
const firstBlock = this.currentState.blocks[0];
|
|
2887
2900
|
if (firstBlock === block &&
|
|
2888
|
-
block instanceof
|
|
2901
|
+
block instanceof contentState.RTETextBlock &&
|
|
2889
2902
|
block.nodes.length === 1 &&
|
|
2890
2903
|
block.nodes[0].isEmpty() &&
|
|
2891
2904
|
block.type !== 'paragraph') {
|
|
2892
2905
|
const paragraph = this.createEmptyParagraph();
|
|
2893
|
-
paragraph.apply(new
|
|
2894
|
-
block.parent.apply(new
|
|
2895
|
-
block.parent.apply(new
|
|
2906
|
+
paragraph.apply(new contentState.ReplaceChildNodesAction(block.nodes));
|
|
2907
|
+
block.parent.apply(new contentState.InsertBlocksBeforeAction(block, paragraph));
|
|
2908
|
+
block.parent.apply(new contentState.RemoveChildAction(block));
|
|
2896
2909
|
}
|
|
2897
2910
|
}
|
|
2898
2911
|
/**
|
|
@@ -3106,13 +3119,13 @@ class BlockToRTEBlockStrategyAbstract extends ElementToDTOStrategy {
|
|
|
3106
3119
|
const color = element.style.color;
|
|
3107
3120
|
const hexColor = (_a = ui.rgbToHex(color)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
3108
3121
|
if (hexColor) {
|
|
3109
|
-
const colorSchema =
|
|
3122
|
+
const colorSchema = contentState.RTE_TEXT_COLORS.find((schema) => schema.light === hexColor || schema.dark === hexColor);
|
|
3110
3123
|
if (colorSchema)
|
|
3111
3124
|
return colorSchema.key;
|
|
3112
3125
|
return null;
|
|
3113
3126
|
}
|
|
3114
3127
|
else {
|
|
3115
|
-
for (const color of
|
|
3128
|
+
for (const color of contentState.RTE_TEXT_COLORS) {
|
|
3116
3129
|
if (element.style.color.includes(color.key)) {
|
|
3117
3130
|
return color.key;
|
|
3118
3131
|
}
|
|
@@ -3239,7 +3252,7 @@ class ContinueInlineToRTETextBlockStrategy extends BlockToRTEBlockStrategyAbstra
|
|
|
3239
3252
|
const nodes = this.generateChildNodes(elementsArray);
|
|
3240
3253
|
if (nodes.length === 0)
|
|
3241
3254
|
return null;
|
|
3242
|
-
return
|
|
3255
|
+
return contentState.RTETextBlock.from({
|
|
3243
3256
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3244
3257
|
type: 'paragraph',
|
|
3245
3258
|
nodes: nodes,
|
|
@@ -3294,7 +3307,7 @@ class UlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3294
3307
|
handle(elementsArray) {
|
|
3295
3308
|
if (elementsArray[0].childNodes.length === 0)
|
|
3296
3309
|
return null;
|
|
3297
|
-
return
|
|
3310
|
+
return contentState.RTEListBlock.from({
|
|
3298
3311
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3299
3312
|
type: 'bullet-list',
|
|
3300
3313
|
blocks: [],
|
|
@@ -3342,7 +3355,7 @@ class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3342
3355
|
handle(elementsArray) {
|
|
3343
3356
|
if (elementsArray[0].childNodes.length === 0)
|
|
3344
3357
|
return null;
|
|
3345
|
-
return
|
|
3358
|
+
return contentState.RTEListItemBlock.from({
|
|
3346
3359
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3347
3360
|
type: 'list-item',
|
|
3348
3361
|
nodes: this.generateChildNodes(Array.from(elementsArray[0].childNodes).filter((item) => !['UL', 'OL'].includes(item.nodeName))),
|
|
@@ -3392,7 +3405,7 @@ class InlineBlockToRTETextBlockStrategy extends BlockToRTEBlockStrategyAbstract
|
|
|
3392
3405
|
const nodes = this.generateChildNodes(elementsArray);
|
|
3393
3406
|
if (nodes.length === 0)
|
|
3394
3407
|
return null;
|
|
3395
|
-
return
|
|
3408
|
+
return contentState.RTETextBlock.from({
|
|
3396
3409
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3397
3410
|
type: this.getElementType(elementsArray[0]),
|
|
3398
3411
|
nodes: nodes,
|
|
@@ -3469,7 +3482,7 @@ class ImgToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3469
3482
|
*/
|
|
3470
3483
|
handle(elementsArray) {
|
|
3471
3484
|
const element = elementsArray[0];
|
|
3472
|
-
return
|
|
3485
|
+
return contentState.RTEImageBlock.from({
|
|
3473
3486
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3474
3487
|
type: 'image',
|
|
3475
3488
|
nodes: [
|
|
@@ -3523,7 +3536,7 @@ class VegaImageToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3523
3536
|
handle(elementsArray) {
|
|
3524
3537
|
const element = elementsArray[0];
|
|
3525
3538
|
const image = element.querySelector('img');
|
|
3526
|
-
return
|
|
3539
|
+
return contentState.RTEImageBlock.from({
|
|
3527
3540
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3528
3541
|
type: 'image',
|
|
3529
3542
|
nodes: [
|
|
@@ -3577,7 +3590,7 @@ class OlToRTEListBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3577
3590
|
handle(elementsArray) {
|
|
3578
3591
|
if (elementsArray[0].childNodes.length === 0)
|
|
3579
3592
|
return null;
|
|
3580
|
-
return
|
|
3593
|
+
return contentState.RTEListBlock.from({
|
|
3581
3594
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3582
3595
|
type: 'number-list',
|
|
3583
3596
|
blocks: [],
|
|
@@ -3629,7 +3642,7 @@ class SpanImageToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3629
3642
|
*/
|
|
3630
3643
|
handle(elementsArray) {
|
|
3631
3644
|
const element = elementsArray[0].querySelector('img');
|
|
3632
|
-
return
|
|
3645
|
+
return contentState.RTEImageBlock.from({
|
|
3633
3646
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3634
3647
|
type: 'image',
|
|
3635
3648
|
nodes: [
|
|
@@ -3662,12 +3675,60 @@ class SpanImageToRTEImageBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
|
3662
3675
|
}
|
|
3663
3676
|
}
|
|
3664
3677
|
|
|
3678
|
+
/** Transform child element of UL element which are not LI element to list item block DTO */
|
|
3679
|
+
class ULNotLiChildToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstract {
|
|
3680
|
+
/**
|
|
3681
|
+
* Can be handle.
|
|
3682
|
+
*
|
|
3683
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3684
|
+
* @param {number} currentIndex - Current element index.
|
|
3685
|
+
* @returns {number} - can be handled element count.
|
|
3686
|
+
*/
|
|
3687
|
+
canHandle(elementsArray, currentIndex) {
|
|
3688
|
+
const element = elementsArray[currentIndex];
|
|
3689
|
+
const parent = element.parentElement;
|
|
3690
|
+
return element.nodeName !== 'LI' && parent && ['UL', 'OL'].includes(parent.nodeName) ? 1 : 0;
|
|
3691
|
+
}
|
|
3692
|
+
/**
|
|
3693
|
+
* Parse to a list item block.
|
|
3694
|
+
*
|
|
3695
|
+
* @param {HTMLElement[]} elementsArray - Current elements.
|
|
3696
|
+
* @returns {Nullable<RTEContentBlock>} - List item block.
|
|
3697
|
+
*/
|
|
3698
|
+
handle(elementsArray) {
|
|
3699
|
+
const nodes = this.generateChildNodes(elementsArray);
|
|
3700
|
+
if (nodes.length === 0)
|
|
3701
|
+
return null;
|
|
3702
|
+
return contentState.RTEListItemBlock.from({
|
|
3703
|
+
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
3704
|
+
type: 'list-item',
|
|
3705
|
+
nodes: nodes,
|
|
3706
|
+
annotations: {},
|
|
3707
|
+
});
|
|
3708
|
+
}
|
|
3709
|
+
/* istanbul ignore next */
|
|
3710
|
+
/**
|
|
3711
|
+
* Append child blocks.
|
|
3712
|
+
*/
|
|
3713
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3714
|
+
appendChildBlocks() { }
|
|
3715
|
+
/**
|
|
3716
|
+
* Should continue process to child elements.
|
|
3717
|
+
*
|
|
3718
|
+
* @returns {boolean} - boolean.
|
|
3719
|
+
*/
|
|
3720
|
+
shouldProceedToElementChildren() {
|
|
3721
|
+
return false;
|
|
3722
|
+
}
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3665
3725
|
/** Element to DTO processor */
|
|
3666
3726
|
class ElementToDtoStrategyProcessor {
|
|
3667
3727
|
constructor() {
|
|
3668
3728
|
this.elementStrategies = [
|
|
3669
3729
|
new UlToRTEListBlockStrategy(),
|
|
3670
3730
|
new OlToRTEListBlockStrategy(),
|
|
3731
|
+
new ULNotLiChildToRTEListItemBlockStrategy(),
|
|
3671
3732
|
new LiToRTEListItemBlockStrategy(),
|
|
3672
3733
|
new InlineBlockToRTETextBlockStrategy(),
|
|
3673
3734
|
new ImgToRTEImageBlockStrategy(),
|
|
@@ -3756,7 +3817,7 @@ class InsertPasteHandler extends BaseHandler {
|
|
|
3756
3817
|
* @param { RTEContentBlock[]} blocks - blocks
|
|
3757
3818
|
*/
|
|
3758
3819
|
insertBlocksToRoot(blocks) {
|
|
3759
|
-
this.currentState.apply(new
|
|
3820
|
+
this.currentState.apply(new contentState.AppendChildNodesAction(blocks));
|
|
3760
3821
|
}
|
|
3761
3822
|
/**
|
|
3762
3823
|
* Insert the blocks to content
|
|
@@ -3768,9 +3829,9 @@ class InsertPasteHandler extends BaseHandler {
|
|
|
3768
3829
|
const currentBlock = cursorNode === null || cursorNode === void 0 ? void 0 : cursorNode.parentBlock;
|
|
3769
3830
|
if (currentBlock) {
|
|
3770
3831
|
const { startOffset } = this.selectionController.getCurrentRange();
|
|
3771
|
-
const breakAction = new
|
|
3832
|
+
const breakAction = new contentState.SplitBlockWithNodeAction(cursorNode, startOffset);
|
|
3772
3833
|
currentBlock.apply(breakAction);
|
|
3773
|
-
currentBlock.parent.apply(new
|
|
3834
|
+
currentBlock.parent.apply(new contentState.InsertBlocksAfterAction(currentBlock, ...blocks));
|
|
3774
3835
|
this.switchCaretPositionToNextElement(breakAction.newBlock);
|
|
3775
3836
|
}
|
|
3776
3837
|
}
|
|
@@ -3783,7 +3844,7 @@ class InsertPasteHandler extends BaseHandler {
|
|
|
3783
3844
|
const cursorNode = this.removeSelectionRange();
|
|
3784
3845
|
/* istanbul ignore next */
|
|
3785
3846
|
const currentBlock = cursorNode === null || cursorNode === void 0 ? void 0 : cursorNode.parentBlock;
|
|
3786
|
-
currentBlock.parent.apply(new
|
|
3847
|
+
currentBlock.parent.apply(new contentState.InsertBlocksBeforeAction(currentBlock, ...blocks));
|
|
3787
3848
|
this.switchCaretPositionToNextElement(currentBlock);
|
|
3788
3849
|
}
|
|
3789
3850
|
/**
|
|
@@ -4008,7 +4069,7 @@ __decorate$a([
|
|
|
4008
4069
|
], UserInputController.prototype, "reConnectObserver", null);
|
|
4009
4070
|
|
|
4010
4071
|
/**
|
|
4011
|
-
* A rule that checks if input range is empty or not
|
|
4072
|
+
* A rule that checks if the input range is empty or not
|
|
4012
4073
|
*
|
|
4013
4074
|
* @implements {FormFieldValidationRule<string[]>}
|
|
4014
4075
|
*/
|
|
@@ -4020,11 +4081,12 @@ class RichTextEditorRequiredRule {
|
|
|
4020
4081
|
* @returns {EvaluateResultTranslation} An object with two properties: isValid and message.
|
|
4021
4082
|
*/
|
|
4022
4083
|
evaluate(input) {
|
|
4023
|
-
var _a;
|
|
4084
|
+
var _a, _b;
|
|
4024
4085
|
if (!this.isAcceptedInputType(input)) {
|
|
4025
4086
|
throw new Error(`Invalid value ${input} for rich text editor`);
|
|
4026
4087
|
}
|
|
4027
|
-
const isValid = ((_a = input === null || input === void 0 ? void 0 : input.blocks) === null || _a === void 0 ? void 0 : _a.length) >
|
|
4088
|
+
const isValid = ((_a = input === null || input === void 0 ? void 0 : input.blocks) === null || _a === void 0 ? void 0 : _a.length) > 1 || // isValid: true when the length is greater than 1 to keep the same behavior as vega-textarea
|
|
4089
|
+
(((_b = input === null || input === void 0 ? void 0 : input.blocks) === null || _b === void 0 ? void 0 : _b.length) === 1 && input.blocks.some((block) => block.isNotEmpty()));
|
|
4028
4090
|
return {
|
|
4029
4091
|
isValid,
|
|
4030
4092
|
message: isValid ? '' : 'This field is required',
|
|
@@ -4096,12 +4158,12 @@ class InsertImageController extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
4096
4158
|
*/
|
|
4097
4159
|
insertImageToCaretPosition(imageUrl) {
|
|
4098
4160
|
const selectedBlocks = this.selectionController.getSelectedBlocks();
|
|
4099
|
-
const imageBlock = new
|
|
4100
|
-
const newImageNode = new
|
|
4161
|
+
const imageBlock = new contentState.RTEImageBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
|
|
4162
|
+
const newImageNode = new contentState.RTEImageNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), imageUrl, imageBlock);
|
|
4101
4163
|
newImageNode.apply(new imageAnnotationAction.ImageAnnotationAction('md', ''));
|
|
4102
|
-
imageBlock.apply(new
|
|
4164
|
+
imageBlock.apply(new contentState.AppendChildNodesAction([newImageNode]));
|
|
4103
4165
|
if (selectedBlocks.length < 1 || this.value.blocks.length < 1) {
|
|
4104
|
-
this.value.apply(new
|
|
4166
|
+
this.value.apply(new contentState.AppendChildNodesAction([imageBlock]));
|
|
4105
4167
|
void this.valueController.flushChanges(this.value);
|
|
4106
4168
|
}
|
|
4107
4169
|
else {
|
|
@@ -4219,13 +4281,13 @@ class FocusController extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
4219
4281
|
*/
|
|
4220
4282
|
async focusOnLastTextNode(options) {
|
|
4221
4283
|
const lastBlock = this.value.blocks[this.value.blocks.length - 1];
|
|
4222
|
-
if (!(lastBlock instanceof
|
|
4223
|
-
const newTextBlock =
|
|
4284
|
+
if (!(lastBlock instanceof contentState.RTETextBlock) || (options === null || options === void 0 ? void 0 : options.newLine)) {
|
|
4285
|
+
const newTextBlock = contentState.RTETextBlock.from({
|
|
4224
4286
|
id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
|
|
4225
4287
|
type: 'paragraph',
|
|
4226
4288
|
nodes: [{ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(), type: 'text', text: '' }],
|
|
4227
4289
|
});
|
|
4228
|
-
lastBlock.parent.apply(new
|
|
4290
|
+
lastBlock.parent.apply(new contentState.InsertBlocksAfterAction(lastBlock, newTextBlock));
|
|
4229
4291
|
await this.valueController.flushChanges(this.value);
|
|
4230
4292
|
await this.doFocusOnLastTextNode(newTextBlock);
|
|
4231
4293
|
}
|
|
@@ -4415,7 +4477,9 @@ const VegaRichTextEditor = class {
|
|
|
4415
4477
|
*/
|
|
4416
4478
|
this.rows = 4;
|
|
4417
4479
|
/**
|
|
4418
|
-
* Specifies the value of the rich text editor
|
|
4480
|
+
* Specifies the value of the rich text editor, which can be either VegaRTEContent or VegaRTEContentBlock.
|
|
4481
|
+
* It is recommended to use the VegaRTEContent type.
|
|
4482
|
+
* Only in exceptional cases should the original data in the VegaRTEContentBlock type be used.
|
|
4419
4483
|
*
|
|
4420
4484
|
* @vegaVersion 2.34.0
|
|
4421
4485
|
*/
|