@globalpayments/vega 2.37.0 → 2.37.1
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-7980768c.js → app-globals-e10d1859.js} +3 -3
- package/dist/cjs/{content-state-9a9a4bd8.js → content-state-f97d3278.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-0303f4a7.js → form-field-controller-slimmer-48c0ad0b.js} +1 -1
- package/dist/cjs/{image-annotation-action-8e622f61.js → image-annotation-action-7d82f7e1.js} +2 -2
- package/dist/cjs/{index-7c81de06.js → index-0546e2ea.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{node-annotation.abstract-2c8373c1.js → node-annotation.abstract-4f6df9cf.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-396b1cee.js → string-input-formatter-slimmer-072b75a0.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-ae490543.js → sub-state-notify-slimmer-b1f1e61a.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-080731bc.js → sub-state-observer-slimmer-02634647.js} +1 -1
- package/dist/cjs/vega-app-footer.cjs.entry.js +3 -0
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-link.cjs.entry.js +1 -0
- package/dist/cjs/vega-calendar_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +11 -4
- 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 +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +3 -3
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +2 -2
- package/dist/cjs/vega-form.cjs.entry.js +2 -2
- package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -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 +5 -2
- 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 +5 -5
- package/dist/cjs/{vega-internal-event-id-b12071ea.js → vega-internal-event-id-bda63e14.js} +2 -0
- package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +6 -4
- package/dist/cjs/vega-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-radio_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +680 -412
- 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 +3 -2
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-table_8.cjs.entry.js +10 -7
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega.cjs.js +5 -5
- package/dist/collection/components/vega-app-footer/vega-app-footer.js +12 -0
- package/dist/collection/components/vega-button-link/vega-button-link.js +4 -0
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +9 -1
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +4 -0
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +12 -0
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-item-toggle/vega-item-toggle.js +8 -0
- package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.js +7 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +190 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +18 -123
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.js +9 -11
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +8 -18
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +5 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.js +244 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +13 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +16 -70
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +22 -14
- package/dist/collection/components/vega-signature-capture/vega-signature-capture.js +4 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-editable-controller.js +2 -3
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-renderer.js +5 -1
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
- package/dist/esm/{app-globals-6912a75d.js → app-globals-c1f2bea9.js} +3 -3
- package/dist/esm/{content-state-c2d29b35.js → content-state-ccf5f960.js} +3 -3
- package/dist/esm/{form-field-controller-slimmer-7136b7fa.js → form-field-controller-slimmer-3535e76a.js} +1 -1
- package/dist/esm/{image-annotation-action-84422458.js → image-annotation-action-3da42221.js} +2 -2
- package/dist/esm/{index-b2045ad0.js → index-6e05b241.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{node-annotation.abstract-a58b5a49.js → node-annotation.abstract-b2e36bc4.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-0ecbf367.js → string-input-formatter-slimmer-930f1125.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-4a201088.js → sub-state-notify-slimmer-51151fc3.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-0d6da563.js → sub-state-observer-slimmer-d77a1c46.js} +1 -1
- package/dist/esm/vega-app-footer.entry.js +3 -0
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button-link.entry.js +1 -0
- package/dist/esm/vega-calendar_3.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +11 -4
- 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 +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +3 -3
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +2 -2
- package/dist/esm/vega-form.entry.js +2 -2
- package/dist/esm/vega-image-uploader.entry.js +3 -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 +5 -2
- 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 +5 -5
- package/dist/esm/{vega-internal-event-id-458939b6.js → vega-internal-event-id-d0690d0d.js} +2 -1
- package/dist/esm/vega-item-toggle.entry.js +2 -0
- package/dist/esm/vega-left-nav_5.entry.js +6 -4
- package/dist/esm/vega-popover_2.entry.js +1 -1
- package/dist/esm/vega-radio_2.entry.js +2 -2
- package/dist/esm/vega-rich-text-content.entry.js +6 -6
- package/dist/esm/vega-rich-text-editor_4.entry.js +680 -412
- 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 +3 -2
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-table_8.entry.js +10 -7
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +2 -2
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega.js +5 -5
- package/dist/types/components/vega-app-footer/vega-app-footer.d.ts +3 -0
- package/dist/types/components/vega-button-link/vega-button-link.d.ts +1 -0
- package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +2 -0
- package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +1 -0
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +3 -0
- package/dist/types/components/vega-input-select/types.d.ts +1 -0
- package/dist/types/components/vega-item-toggle/vega-item-toggle.d.ts +2 -0
- package/dist/types/components/vega-nav/vega-left-nav-link/vega-left-nav-link.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.d.ts +57 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +11 -28
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.d.ts +4 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.d.ts +1 -8
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.d.ts +99 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +2 -21
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +7 -2
- package/dist/types/components/vega-signature-capture/vega-signature-capture.d.ts +1 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-renderer.d.ts +1 -0
- package/dist/types/components.d.ts +31 -5
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
- package/dist/types/types/components.type.d.ts +1 -5
- package/dist/types/types/public-api.d.ts +2 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-2d36dbfe.js → p-0461e318.js} +1 -1
- package/dist/vega/{p-1f67c930.entry.js → p-12fe63c1.entry.js} +1 -1
- package/dist/vega/{p-29dd376c.entry.js → p-1b67c443.entry.js} +1 -1
- package/dist/vega/{p-fbb91e25.entry.js → p-23fd9401.entry.js} +1 -1
- package/dist/vega/{p-5d7d0085.entry.js → p-267cde46.entry.js} +1 -1
- package/dist/vega/{p-ca239f51.js → p-29d6ec6c.js} +1 -1
- package/dist/vega/{p-d57920df.entry.js → p-2fecbcf9.entry.js} +1 -1
- package/dist/vega/{p-fe9644a0.js → p-348e95ba.js} +1 -1
- package/dist/vega/{p-00de36e4.js → p-34bd9204.js} +1 -1
- package/dist/vega/{p-3aec260c.entry.js → p-3cb90bdf.entry.js} +1 -1
- package/dist/vega/{p-fcab2244.entry.js → p-3e8f9fcf.entry.js} +1 -1
- package/dist/vega/{p-233e6715.entry.js → p-497f2f86.entry.js} +1 -1
- package/dist/vega/p-50eabdca.entry.js +1 -0
- package/dist/vega/{p-503ff1ef.js → p-52a8a4f8.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-5f82eb88.js → p-6100e1aa.js} +1 -1
- package/dist/vega/{p-766a0cdd.entry.js → p-6419e13e.entry.js} +1 -1
- package/dist/vega/{p-b2b41aa4.entry.js → p-7198d675.entry.js} +1 -1
- package/dist/vega/{p-00f4cf6a.entry.js → p-7baa4fae.entry.js} +1 -1
- package/dist/vega/p-7edcb8d0.entry.js +1 -0
- package/dist/vega/{p-34caa637.entry.js → p-84a7c18a.entry.js} +1 -1
- package/dist/vega/{p-bbea0599.entry.js → p-904b489a.entry.js} +1 -1
- package/dist/vega/{p-fea15767.entry.js → p-9689ad99.entry.js} +1 -1
- package/dist/vega/{p-95e50f3a.entry.js → p-9eb90ee8.entry.js} +1 -1
- package/dist/vega/{p-b1096431.entry.js → p-a7e078ac.entry.js} +1 -1
- package/dist/vega/{p-eb798062.entry.js → p-a7f40a65.entry.js} +1 -1
- package/dist/vega/{p-7fedfba5.js → p-a8b16ff2.js} +1 -1
- package/dist/vega/{p-9625162b.entry.js → p-aed80794.entry.js} +1 -1
- package/dist/vega/{p-c2ded423.js → p-b2d47bdd.js} +1 -1
- package/dist/vega/{p-7da8b05f.js → p-b517ed15.js} +1 -1
- package/dist/vega/{p-b6b4e40f.entry.js → p-b809f3d7.entry.js} +1 -1
- package/dist/vega/{p-0b9480a9.entry.js → p-b9a0f136.entry.js} +1 -1
- package/dist/vega/{p-5a19bcb5.entry.js → p-ba077ca8.entry.js} +1 -1
- package/dist/vega/{p-53360bc2.entry.js → p-ba2833c0.entry.js} +1 -1
- package/dist/vega/{p-13c22d72.entry.js → p-bf4996d5.entry.js} +1 -1
- package/dist/vega/{p-570bdeb5.entry.js → p-cb4fd6e1.entry.js} +1 -1
- package/dist/vega/p-da66dad5.entry.js +1 -0
- package/dist/vega/{p-cfd486ab.entry.js → p-e9785742.entry.js} +1 -1
- package/dist/vega/p-e9a5bd12.entry.js +1 -0
- package/dist/vega/{p-fb5c2cc6.entry.js → p-ee2e4bff.entry.js} +1 -1
- package/dist/vega/{p-8f8ab0d3.js → p-f86ec91b.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-497db801.entry.js +0 -1
- package/dist/vega/p-6705ce8f.entry.js +0 -1
- package/dist/vega/p-775fa5dd.entry.js +0 -1
- package/dist/vega/p-98043367.entry.js +0 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { VegaSlimmer, MapToComponentField, MapToComponentMethod } from 'vega-slimmer/core';
|
|
8
|
+
import { RTETextNode } from '../../dto/nodes/text-node';
|
|
9
|
+
import { InsertNodesBeforeAction } from '../../dto/actions/insert-nodes-before-node-action';
|
|
10
|
+
import stateEntityRenderingRegistry from './state-entity-rendering-registry';
|
|
11
|
+
import { ZERO_WIDTH_SPACE } from '../../constants/constant';
|
|
12
|
+
import { UpdateTextAction } from '../../dto/actions/update-text-action';
|
|
13
|
+
import changeManager from '../../../../helpers/change-manager/change-manager';
|
|
14
|
+
import domNodeSubjectFactory from '../../../../helpers/change-manager/subject/dom-node-subject/dom-node-subject-factory';
|
|
15
|
+
import { VegaInternalRichTextEditDeleteSelectedNodes } from '../../../../helpers/event-manager/event-id/vega-internal-event-id';
|
|
16
|
+
/** Handles inserting composition text into a VegaRTEContent based on the current selection and input event. User input character will trigger this callback */
|
|
17
|
+
export class InsertCompositionTextController extends VegaSlimmer {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.insertCompositionTextEndFlag = true;
|
|
21
|
+
this.observerOptions = {
|
|
22
|
+
characterData: true,
|
|
23
|
+
characterDataOldValue: true,
|
|
24
|
+
subtree: true,
|
|
25
|
+
childList: true,
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The current method is called when the insert text is update by the Pinyin input or the word correction plugin.
|
|
29
|
+
*
|
|
30
|
+
* @param {MutationRecord[]} records - The mutation record object array.
|
|
31
|
+
*/
|
|
32
|
+
this.updateTextFromDom = (records) => {
|
|
33
|
+
let updateFlag = false;
|
|
34
|
+
if (this.insertCompositionTextEndFlag !== false) {
|
|
35
|
+
records.forEach((record) => {
|
|
36
|
+
const { target, oldValue } = record;
|
|
37
|
+
if (target.nodeType === Node.TEXT_NODE && target.parentElement) {
|
|
38
|
+
const richTextNode = stateEntityRenderingRegistry.getEntityByDOM(target.parentElement);
|
|
39
|
+
const newValue = target.textContent;
|
|
40
|
+
if (richTextNode instanceof RTETextNode) {
|
|
41
|
+
updateFlag = this.updateCurrentNodeText(richTextNode, newValue, oldValue);
|
|
42
|
+
}
|
|
43
|
+
else if (newValue) {
|
|
44
|
+
// The text element should removed if insert text to the image block.
|
|
45
|
+
target.parentElement.removeChild(target);
|
|
46
|
+
updateFlag = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (updateFlag) {
|
|
52
|
+
void this.valueController.flushChanges(this.value);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Processes mutation records related to character data and updates the text content of a rich text node accordingly.
|
|
57
|
+
*
|
|
58
|
+
* @param {MutationRecord[]} records - Each `MutationRecord` object represents a single mutation that occurred in the DOM.
|
|
59
|
+
*/
|
|
60
|
+
this.handleObserver = (records) => {
|
|
61
|
+
if (records.every((record) => record.type === 'characterData')) {
|
|
62
|
+
this.updateTextFromDom(records);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* An event handler function that is triggered when the composition of text input starts. In this case,
|
|
67
|
+
* it sets the `insertCompositionTextEndFlag` property of the `UserInputController` class to `false`.
|
|
68
|
+
*/
|
|
69
|
+
this.handleCompositionStart = () => {
|
|
70
|
+
this.insertCompositionTextEndFlag = false;
|
|
71
|
+
changeManager.notify(domNodeSubjectFactory.getSubject(this.host, VegaInternalRichTextEditDeleteSelectedNodes), { host: this.host, detail: true });
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* An event handler function that is triggered when the composition of text input ends. In this case,
|
|
75
|
+
* it sets the `insertCompositionTextEndFlag` property of the `UserInputController` class to `true`.
|
|
76
|
+
*
|
|
77
|
+
* @param {CompositionEvent} event The composition event instance
|
|
78
|
+
*/
|
|
79
|
+
this.handleCompositionEnd = (event) => {
|
|
80
|
+
this.insertCompositionTextEndFlag = true;
|
|
81
|
+
const insertData = event.data;
|
|
82
|
+
if (insertData) {
|
|
83
|
+
this.dispatchInsertTextEvent(insertData);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The function `initMutationObserver` initializes a MutationObserver on an editable HTML element if it exists.
|
|
89
|
+
*/
|
|
90
|
+
initMutationObserver() {
|
|
91
|
+
if (this.mutationObserver) {
|
|
92
|
+
const editableElement = this.getEditableElementRef();
|
|
93
|
+
if (editableElement) {
|
|
94
|
+
this.mutationObserver.disconnect();
|
|
95
|
+
this.mutationObserver.observe(editableElement, this.observerOptions);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Disconnects the mutation observer if it exists.
|
|
101
|
+
*/
|
|
102
|
+
removeObserver() {
|
|
103
|
+
if (this.mutationObserver) {
|
|
104
|
+
this.mutationObserver.disconnect();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The method is to get the composition text insert end or not.
|
|
109
|
+
*
|
|
110
|
+
* @returns {boolean} The false is main that insert composition text process is end.
|
|
111
|
+
*/
|
|
112
|
+
isComposing() {
|
|
113
|
+
return !this.insertCompositionTextEndFlag;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Adds event listener to an editable HTML element to handle composition text insert actions.
|
|
117
|
+
*/
|
|
118
|
+
addCompositionTextEventListener() {
|
|
119
|
+
const editableElement = this.getEditableElementRef();
|
|
120
|
+
if (editableElement) {
|
|
121
|
+
editableElement.addEventListener('compositionstart', this.handleCompositionStart);
|
|
122
|
+
editableElement.addEventListener('compositionend', this.handleCompositionEnd);
|
|
123
|
+
}
|
|
124
|
+
this.mutationObserver = new MutationObserver(this.handleObserver);
|
|
125
|
+
this.initMutationObserver();
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Removes event listener to an editable HTML element to handle composition text insert actions.
|
|
129
|
+
*/
|
|
130
|
+
removeCompositionTextEventListener() {
|
|
131
|
+
const editableElement = this.getEditableElementRef();
|
|
132
|
+
if (editableElement) {
|
|
133
|
+
editableElement.removeEventListener('compositionstart', this.handleCompositionStart);
|
|
134
|
+
editableElement.removeEventListener('compositionend', this.handleCompositionEnd);
|
|
135
|
+
}
|
|
136
|
+
this.removeObserver();
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* re-connect the observer after the props change and component did render
|
|
140
|
+
*/
|
|
141
|
+
reConnectObserver() {
|
|
142
|
+
this.initMutationObserver();
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Insert text to a line break node need a special logic if the line break has a next text node.
|
|
146
|
+
*
|
|
147
|
+
* @param {RTETextNode} currentNode The current line break node, the text value is \n
|
|
148
|
+
*/
|
|
149
|
+
appendLineBreakNode(currentNode) {
|
|
150
|
+
const textBlock = currentNode.parentBlock;
|
|
151
|
+
const index = textBlock.nodes.indexOf(currentNode);
|
|
152
|
+
if (textBlock.nodes[index + 1]) {
|
|
153
|
+
const newTextNode = currentNode.cloneWithText('\n');
|
|
154
|
+
textBlock.apply(new InsertNodesBeforeAction(textBlock.nodes[index + 1], newTextNode));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Updates the text content of a rich text node and handles line breaks.
|
|
159
|
+
*
|
|
160
|
+
* @param {RTETextNode} richTextNode - The current rich text node.
|
|
161
|
+
* @param {string} newValue - The target element textContent
|
|
162
|
+
* @param {Nullable<string>} oldValue - The target element old textContent
|
|
163
|
+
* @returns {Nullable<boolean>} The node text is updated or not
|
|
164
|
+
*/
|
|
165
|
+
updateCurrentNodeText(richTextNode, newValue, oldValue) {
|
|
166
|
+
const insertText = this.removeZeroWidthSpace(newValue.replace(/(\n)$/, ''));
|
|
167
|
+
if (richTextNode.text !== insertText) {
|
|
168
|
+
const { startOffset } = this.selectionController.getCurrentRange();
|
|
169
|
+
const currentIsLineBreakNode = richTextNode.text === '\n';
|
|
170
|
+
richTextNode.apply(new UpdateTextAction(insertText));
|
|
171
|
+
if (currentIsLineBreakNode) {
|
|
172
|
+
this.appendLineBreakNode(richTextNode);
|
|
173
|
+
}
|
|
174
|
+
const lengthGap = oldValue ? oldValue.length - newValue.length : 0;
|
|
175
|
+
const newOffset = Math.min(insertText.length, startOffset - lengthGap);
|
|
176
|
+
this.selectionController.enqueueSelectionRangeFutureState(richTextNode, Math.max(0, newOffset));
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The function `getEditableElementRef` returns a reference to the editable HTMLDivElement within a rich text editor.
|
|
182
|
+
*
|
|
183
|
+
* @returns {HTMLDivElement|null} A reference to an HTMLDivElement element that is editable.
|
|
184
|
+
*/
|
|
185
|
+
getEditableElementRef() {
|
|
186
|
+
if (!this.editableElementRef) {
|
|
187
|
+
this.editableElementRef = this.vegaRichTextEditorRenderer.getRTEEditableElementRef();
|
|
188
|
+
}
|
|
189
|
+
return this.editableElementRef;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Remove the ZERO_WIDTH_SPACE from the text.
|
|
193
|
+
*
|
|
194
|
+
* @param {string} text The input text that could include ZERO_WIDTH_SPACE.
|
|
195
|
+
* @returns {string} The result text.
|
|
196
|
+
*/
|
|
197
|
+
removeZeroWidthSpace(text) {
|
|
198
|
+
if (text.startsWith(ZERO_WIDTH_SPACE)) {
|
|
199
|
+
return text.slice(ZERO_WIDTH_SPACE.length);
|
|
200
|
+
}
|
|
201
|
+
else if (text.endsWith(ZERO_WIDTH_SPACE)) {
|
|
202
|
+
return text.slice(0, text.length - ZERO_WIDTH_SPACE.length);
|
|
203
|
+
}
|
|
204
|
+
return text;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Dispatch a insert text event to handle the composition text insert logic.
|
|
208
|
+
*
|
|
209
|
+
* @param {string} text - The text need to insert.
|
|
210
|
+
*/
|
|
211
|
+
dispatchInsertTextEvent(text) {
|
|
212
|
+
const inputEvent = new CustomEvent('beforeinput');
|
|
213
|
+
inputEvent['data'] = text;
|
|
214
|
+
inputEvent['inputType'] = 'insertText';
|
|
215
|
+
this.editableElementRef.dispatchEvent(inputEvent);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
__decorate([
|
|
219
|
+
MapToComponentField()
|
|
220
|
+
], InsertCompositionTextController.prototype, "selectionController", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
MapToComponentField()
|
|
223
|
+
], InsertCompositionTextController.prototype, "host", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
MapToComponentField()
|
|
226
|
+
], InsertCompositionTextController.prototype, "value", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
MapToComponentField()
|
|
229
|
+
], InsertCompositionTextController.prototype, "valueController", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
MapToComponentField()
|
|
232
|
+
], InsertCompositionTextController.prototype, "userInputController", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
MapToComponentField()
|
|
235
|
+
], InsertCompositionTextController.prototype, "vegaRichTextEditorRenderer", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
MapToComponentMethod('componentDidLoad')
|
|
238
|
+
], InsertCompositionTextController.prototype, "addCompositionTextEventListener", null);
|
|
239
|
+
__decorate([
|
|
240
|
+
MapToComponentMethod('disconnectedCallback')
|
|
241
|
+
], InsertCompositionTextController.prototype, "removeCompositionTextEventListener", null);
|
|
242
|
+
__decorate([
|
|
243
|
+
MapToComponentMethod('componentDidRender')
|
|
244
|
+
], InsertCompositionTextController.prototype, "reConnectObserver", null);
|
|
@@ -134,17 +134,22 @@ export class SelectionController extends VegaSlimmer {
|
|
|
134
134
|
*/
|
|
135
135
|
setSelectionRange(range) {
|
|
136
136
|
const selection = this.getSelection();
|
|
137
|
-
selection
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
if (selection) {
|
|
138
|
+
selection.removeAllRanges();
|
|
139
|
+
selection.addRange(range);
|
|
140
|
+
this.saveSelection();
|
|
141
|
+
}
|
|
140
142
|
}
|
|
141
143
|
/**
|
|
142
144
|
* Save the current selection range detail
|
|
143
145
|
*/
|
|
144
146
|
saveSelection() {
|
|
145
147
|
const selection = this.getSelection();
|
|
146
|
-
// The range is out of date if the queue is not empty, so we should not update the RTERange
|
|
147
|
-
if (selection &&
|
|
148
|
+
// The range is out of date if the queue is not empty, or the range is update by the composition text insert, so we should not update the RTERange
|
|
149
|
+
if (selection &&
|
|
150
|
+
selection.rangeCount > 0 &&
|
|
151
|
+
this.updateCaretPositionTaskQueue.queue.length === 0 &&
|
|
152
|
+
!this.insertCompositionTextController.isComposing()) {
|
|
148
153
|
const range = selection.getRangeAt(0);
|
|
149
154
|
const { startContainer: startNode, endContainer: endNode, startOffset, endOffset } = range;
|
|
150
155
|
this.currentRange = this.currentRange.updateRTERange({ startNode, endNode, startOffset, endOffset }, range);
|
|
@@ -277,6 +282,9 @@ __decorate([
|
|
|
277
282
|
__decorate([
|
|
278
283
|
MapToComponentField()
|
|
279
284
|
], SelectionController.prototype, "valueController", void 0);
|
|
285
|
+
__decorate([
|
|
286
|
+
MapToComponentField()
|
|
287
|
+
], SelectionController.prototype, "insertCompositionTextController", void 0);
|
|
280
288
|
__decorate([
|
|
281
289
|
MapToComponentMethod('connectedCallback')
|
|
282
290
|
], SelectionController.prototype, "connectedCallback", null);
|
|
@@ -5,7 +5,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { MapToComponentField, MapToComponentMethod, VegaSlimmer } from 'vega-slimmer/core';
|
|
8
|
-
import stateEntity from './state-entity-rendering-registry';
|
|
9
8
|
import { InsertTextHandler } from './helper/input-event-handler/insert-text-handler';
|
|
10
9
|
import { InsertParagraphHandler } from './helper/input-event-handler/insert-paragraph-handler';
|
|
11
10
|
import { InsertLineBreakHandler } from './helper/input-event-handler/insert-line-break-handler';
|
|
@@ -13,7 +12,7 @@ import { DeleteContentHandler } from './helper/input-event-handler/delete-conten
|
|
|
13
12
|
import { VegaRTEContent } from '../../dto/content-state';
|
|
14
13
|
import { InsertPasteHandler } from './helper/input-event-handler/insert-paste-handler';
|
|
15
14
|
import { generateUUID } from '../../../../utils/misc';
|
|
16
|
-
/** Used to monitoring the user input actions by event listener
|
|
15
|
+
/** Used to monitoring the user input actions by event listener */
|
|
17
16
|
export class UserInputController extends VegaSlimmer {
|
|
18
17
|
constructor() {
|
|
19
18
|
super(...arguments);
|
|
@@ -22,91 +21,47 @@ export class UserInputController extends VegaSlimmer {
|
|
|
22
21
|
this.insertLineBreakHandler = new InsertLineBreakHandler();
|
|
23
22
|
this.deleteContentHandler = new DeleteContentHandler();
|
|
24
23
|
this.insertPasteHandler = new InsertPasteHandler();
|
|
25
|
-
this.observerOptions = {
|
|
26
|
-
characterData: true,
|
|
27
|
-
characterDataOldValue: true,
|
|
28
|
-
subtree: true,
|
|
29
|
-
childList: true,
|
|
30
|
-
};
|
|
31
24
|
/**
|
|
32
25
|
* When a user performs an input action within the editable element, this function is triggered.
|
|
33
26
|
*
|
|
34
27
|
* @param {InputEvent} e the before input event object
|
|
35
28
|
*/
|
|
36
29
|
this.handleUserInputAction = (e) => {
|
|
37
|
-
|
|
30
|
+
const inputType = e.inputType;
|
|
38
31
|
e.preventDefault();
|
|
39
32
|
this.initValueIfEmpty();
|
|
33
|
+
// The insertCompositionText type input event can not be prevented, so we process the current action by insertCompositionTextController.
|
|
34
|
+
if (inputType === 'insertCompositionText') {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.insertCompositionTextController.removeObserver();
|
|
40
38
|
let updateFlag = false;
|
|
41
|
-
switch (
|
|
39
|
+
switch (inputType) {
|
|
42
40
|
case 'insertParagraph':
|
|
43
41
|
updateFlag = true;
|
|
44
|
-
this.insertParagraphHandler.execute(this.value, this.selectionController, e);
|
|
42
|
+
this.insertParagraphHandler.execute(this.value, this.selectionController, this.host, e);
|
|
45
43
|
break;
|
|
46
44
|
case 'insertText':
|
|
47
45
|
updateFlag = true;
|
|
48
|
-
this.insertTextHandler.execute(this.value, this.selectionController, e);
|
|
46
|
+
this.insertTextHandler.execute(this.value, this.selectionController, this.host, e);
|
|
49
47
|
break;
|
|
50
48
|
case 'insertLineBreak':
|
|
51
49
|
updateFlag = true;
|
|
52
|
-
this.insertLineBreakHandler.execute(this.value, this.selectionController, e);
|
|
50
|
+
this.insertLineBreakHandler.execute(this.value, this.selectionController, this.host, e);
|
|
53
51
|
break;
|
|
54
52
|
case 'deleteContentBackward':
|
|
55
53
|
updateFlag = true;
|
|
56
|
-
this.deleteContentHandler.execute(this.value, this.selectionController, e);
|
|
54
|
+
this.deleteContentHandler.execute(this.value, this.selectionController, this.host, e);
|
|
57
55
|
break;
|
|
58
56
|
case 'insertFromPaste':
|
|
59
57
|
updateFlag = true;
|
|
60
|
-
this.insertPasteHandler.execute(this.value, this.selectionController, e);
|
|
58
|
+
this.insertPasteHandler.execute(this.value, this.selectionController, this.host, e);
|
|
61
59
|
break;
|
|
62
60
|
}
|
|
63
61
|
if (updateFlag) {
|
|
64
62
|
this.notifyComponentFlushValue();
|
|
65
63
|
}
|
|
66
64
|
};
|
|
67
|
-
/**
|
|
68
|
-
* Processes mutation records related to character data and updates the text content of a rich text node accordingly.
|
|
69
|
-
*
|
|
70
|
-
* @param {MutationRecord[]} records - Each `MutationRecord` object represents a single mutation that occurred in the DOM.
|
|
71
|
-
*/
|
|
72
|
-
this.handleObserver = (records) => {
|
|
73
|
-
let updateFlag = false;
|
|
74
|
-
if (records.every((record) => record.type === 'characterData')) {
|
|
75
|
-
records.forEach((record) => {
|
|
76
|
-
const { target } = record;
|
|
77
|
-
if (target.nodeType === Node.TEXT_NODE && target.parentElement) {
|
|
78
|
-
const richTextNode = stateEntity.getEntityByDOM(target.parentElement);
|
|
79
|
-
if (richTextNode && richTextNode['text'] !== target.textContent) {
|
|
80
|
-
updateFlag = true;
|
|
81
|
-
richTextNode['text'] = target.textContent;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
if (updateFlag) {
|
|
86
|
-
this.notifyComponentFlushValue();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* The function `initMutationObserver` initializes a MutationObserver on an editable HTML element if it exists.
|
|
93
|
-
*/
|
|
94
|
-
initMutationObserver() {
|
|
95
|
-
if (this.mutationObserver) {
|
|
96
|
-
const editableElement = this.getEditableElementRef();
|
|
97
|
-
if (editableElement) {
|
|
98
|
-
this.mutationObserver.disconnect();
|
|
99
|
-
this.mutationObserver.observe(editableElement, this.observerOptions);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Disconnects the mutation observer if it exists.
|
|
105
|
-
*/
|
|
106
|
-
removeObserver() {
|
|
107
|
-
if (this.mutationObserver) {
|
|
108
|
-
this.mutationObserver.disconnect();
|
|
109
|
-
}
|
|
110
65
|
}
|
|
111
66
|
/**
|
|
112
67
|
* Adds event listener to an editable HTML element to handle user input actions.
|
|
@@ -117,8 +72,6 @@ export class UserInputController extends VegaSlimmer {
|
|
|
117
72
|
editableElement.addEventListener('beforeinput', this.handleUserInputAction);
|
|
118
73
|
editableElement.addEventListener('drop', this.preventDropEvent);
|
|
119
74
|
}
|
|
120
|
-
this.mutationObserver = new MutationObserver(this.handleObserver);
|
|
121
|
-
this.initMutationObserver();
|
|
122
75
|
}
|
|
123
76
|
/**
|
|
124
77
|
* Removes event listener for user input actions from an editable HTML div element.
|
|
@@ -129,13 +82,6 @@ export class UserInputController extends VegaSlimmer {
|
|
|
129
82
|
editableElement.removeEventListener('beforeinput', this.handleUserInputAction);
|
|
130
83
|
editableElement.removeEventListener('drop', this.preventDropEvent);
|
|
131
84
|
}
|
|
132
|
-
this.removeObserver();
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* re-connect the observer after the props change and component did render
|
|
136
|
-
*/
|
|
137
|
-
reConnectObserver() {
|
|
138
|
-
this.initMutationObserver();
|
|
139
85
|
}
|
|
140
86
|
/**
|
|
141
87
|
* The function `getEditableElementRef` returns a reference to the editable HTMLDivElement within a rich text editor.
|
|
@@ -190,12 +136,12 @@ __decorate([
|
|
|
190
136
|
__decorate([
|
|
191
137
|
MapToComponentField()
|
|
192
138
|
], UserInputController.prototype, "selectionController", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
MapToComponentField()
|
|
141
|
+
], UserInputController.prototype, "insertCompositionTextController", void 0);
|
|
193
142
|
__decorate([
|
|
194
143
|
MapToComponentMethod('componentDidLoad')
|
|
195
144
|
], UserInputController.prototype, "addActionListener", null);
|
|
196
145
|
__decorate([
|
|
197
146
|
MapToComponentMethod('disconnectedCallback')
|
|
198
147
|
], UserInputController.prototype, "removeActionListener", null);
|
|
199
|
-
__decorate([
|
|
200
|
-
MapToComponentMethod('componentDidRender')
|
|
201
|
-
], UserInputController.prototype, "reConnectObserver", null);
|
|
@@ -40,6 +40,8 @@ import { InsertImageController } from './slimmers/controllers/insert-image-contr
|
|
|
40
40
|
import { ChildNodesEventPreventSlimmer } from '../../helpers/event-manager/slimmers/child-nodes-event-prevent-slimmer';
|
|
41
41
|
import { FocusController } from './slimmers/controllers/focus-controller';
|
|
42
42
|
import { TextNodeColorController } from './slimmers/controllers/text-node-color-controller';
|
|
43
|
+
import { InsertCompositionTextController } from './slimmers/controllers/insert-composition-text-controller';
|
|
44
|
+
import { DeleteSelectedNodesController } from './slimmers/controllers/delete-selected-nodes-controller';
|
|
43
45
|
/**
|
|
44
46
|
* @vegaVersion 2.34.0
|
|
45
47
|
*/
|
|
@@ -86,9 +88,11 @@ export class VegaRichTextEditor {
|
|
|
86
88
|
this.richTextContentController = new RichTextContentController(this);
|
|
87
89
|
this.userInputController = new UserInputController();
|
|
88
90
|
this.insertImageController = new InsertImageController();
|
|
91
|
+
this.insertCompositionTextController = new InsertCompositionTextController();
|
|
89
92
|
this.imageInsertedEventEmitter = createEventEmitSlimmer(VegaRichTextEditor, VegaImageInserted);
|
|
90
93
|
this.changeEventPreventSlimmer = new ChildNodesEventPreventSlimmer([VegaChange], () => this.vegaRichTextEditorRenderer.getRichTextWrapperRef());
|
|
91
94
|
this.textNodeColorController = new TextNodeColorController();
|
|
95
|
+
this.deleteSelectedNodesController = new DeleteSelectedNodesController();
|
|
92
96
|
this.richTextContentEditable = true;
|
|
93
97
|
this.selectionMap = new Map();
|
|
94
98
|
this.isInDarkMode = VegaThemeManager.isDarkMode();
|
|
@@ -142,6 +146,7 @@ export class VegaRichTextEditor {
|
|
|
142
146
|
* Only in exceptional cases should the original data in the VegaRTEContentBlock type be used.
|
|
143
147
|
*
|
|
144
148
|
* @vegaVersion 2.34.0
|
|
149
|
+
* @defaultValue [{id:'UUID', type:'paragraph', nodes:[{id: 'UUID',type: 'text',text:''}]}]
|
|
145
150
|
*/
|
|
146
151
|
// eslint-disable-next-line @stencil/strict-mutable
|
|
147
152
|
this.value = VegaRTEContent.createEmptyContent();
|
|
@@ -356,6 +361,9 @@ export class VegaRichTextEditor {
|
|
|
356
361
|
"tags": [{
|
|
357
362
|
"name": "vegaVersion",
|
|
358
363
|
"text": "2.34.0"
|
|
364
|
+
}, {
|
|
365
|
+
"name": "defaultValue",
|
|
366
|
+
"text": "[{id:'UUID', type:'paragraph', nodes:[{id: 'UUID',type: 'text',text:''}]}]"
|
|
359
367
|
}],
|
|
360
368
|
"text": "Specifies the value of the rich text editor, which can be either VegaRTEContent or VegaRTEContentBlock.\nIt is recommended to use the VegaRTEContent type.\nOnly in exceptional cases should the original data in the VegaRTEContentBlock type be used."
|
|
361
369
|
},
|
|
@@ -471,15 +479,12 @@ export class VegaRichTextEditor {
|
|
|
471
479
|
"text": "An event emitter notifying a value change."
|
|
472
480
|
},
|
|
473
481
|
"complexType": {
|
|
474
|
-
"original": "
|
|
475
|
-
"resolved": "
|
|
482
|
+
"original": "VegaRTEContent",
|
|
483
|
+
"resolved": "VegaRTEContent",
|
|
476
484
|
"references": {
|
|
477
|
-
"
|
|
478
|
-
"location": "global"
|
|
479
|
-
},
|
|
480
|
-
"VegaRTEContentBlock": {
|
|
485
|
+
"VegaRTEContent": {
|
|
481
486
|
"location": "import",
|
|
482
|
-
"path": "./
|
|
487
|
+
"path": "./dto/content-state"
|
|
483
488
|
}
|
|
484
489
|
}
|
|
485
490
|
}
|
|
@@ -500,15 +505,12 @@ export class VegaRichTextEditor {
|
|
|
500
505
|
"text": "An event emitter notifying a value change."
|
|
501
506
|
},
|
|
502
507
|
"complexType": {
|
|
503
|
-
"original": "
|
|
504
|
-
"resolved": "
|
|
508
|
+
"original": "VegaRTEContent",
|
|
509
|
+
"resolved": "VegaRTEContent",
|
|
505
510
|
"references": {
|
|
506
|
-
"
|
|
507
|
-
"location": "global"
|
|
508
|
-
},
|
|
509
|
-
"VegaRTEContentBlock": {
|
|
511
|
+
"VegaRTEContent": {
|
|
510
512
|
"location": "import",
|
|
511
|
-
"path": "./
|
|
513
|
+
"path": "./dto/content-state"
|
|
512
514
|
}
|
|
513
515
|
}
|
|
514
516
|
}
|
|
@@ -667,6 +669,9 @@ __decorate([
|
|
|
667
669
|
__decorate([
|
|
668
670
|
InjectVegaSlimmer()
|
|
669
671
|
], VegaRichTextEditor.prototype, "insertImageController", void 0);
|
|
672
|
+
__decorate([
|
|
673
|
+
InjectVegaSlimmer()
|
|
674
|
+
], VegaRichTextEditor.prototype, "insertCompositionTextController", void 0);
|
|
670
675
|
__decorate([
|
|
671
676
|
InjectVegaSlimmer()
|
|
672
677
|
], VegaRichTextEditor.prototype, "imageInsertedEventEmitter", void 0);
|
|
@@ -676,3 +681,6 @@ __decorate([
|
|
|
676
681
|
__decorate([
|
|
677
682
|
InjectVegaSlimmer()
|
|
678
683
|
], VegaRichTextEditor.prototype, "textNodeColorController", void 0);
|
|
684
|
+
__decorate([
|
|
685
|
+
InjectVegaSlimmer()
|
|
686
|
+
], VegaRichTextEditor.prototype, "deleteSelectedNodesController", void 0);
|
|
@@ -92,6 +92,7 @@ export class VegaSignatureCapture {
|
|
|
92
92
|
* of the signature capture.
|
|
93
93
|
*
|
|
94
94
|
* @vegaVersion 2.19.0
|
|
95
|
+
* @defaultValue v-internal-icon signature
|
|
95
96
|
*/
|
|
96
97
|
this.placeholderIcon = VegaInternalIconManager.getIconKey('signature');
|
|
97
98
|
/**
|
|
@@ -285,6 +286,9 @@ export class VegaSignatureCapture {
|
|
|
285
286
|
"tags": [{
|
|
286
287
|
"name": "vegaVersion",
|
|
287
288
|
"text": "2.19.0"
|
|
289
|
+
}, {
|
|
290
|
+
"name": "defaultValue",
|
|
291
|
+
"text": "v-internal-icon signature"
|
|
288
292
|
}],
|
|
289
293
|
"text": "Specifies an icon or symbol that appears before the placeholder,\n providing visual context or enhancing the aesthetic appearance\n of the signature capture."
|
|
290
294
|
},
|
package/dist/collection/components/vega-table/slimmers/controllers/vega-table-editable-controller.js
CHANGED
|
@@ -149,9 +149,8 @@ export class VegaTableEditableController extends VegaSlimmer {
|
|
|
149
149
|
if (!this.canMethodBeInvokedInCurrentState('getRowsData')) {
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
.getValue();
|
|
152
|
+
const tableFormRef = this.vegaTableBodyRenderer.getTableFormRef();
|
|
153
|
+
const formValues = tableFormRef ? await tableFormRef.getValue() : [];
|
|
155
154
|
return [
|
|
156
155
|
...this.vegaTableDataSourceController.getCurrentData().map((record) => {
|
|
157
156
|
const value = formValues[`${VegaTableEditableController.rowFormKeyPrefix}${this.vegaTableDataSourceController.getRecordKey(record)}`];
|
|
@@ -22,7 +22,8 @@ export class VegaTableRenderer extends VegaSlimmer {
|
|
|
22
22
|
this.vegaTableColGroupRenderer.render(),
|
|
23
23
|
this.vegaTableHeaderRenderer.render(),
|
|
24
24
|
],
|
|
25
|
-
this.dataSource.length > 0
|
|
25
|
+
(this.dataSource.length > 0 || this.editingRows.size > 0) &&
|
|
26
|
+
this.vegaTableBodyRenderer.render(),
|
|
26
27
|
this.isTemplateRenderMode && h("slot", null)));
|
|
27
28
|
};
|
|
28
29
|
this.renderEmpty = () => {
|
|
@@ -94,3 +95,6 @@ __decorate([
|
|
|
94
95
|
__decorate([
|
|
95
96
|
MapToComponentField()
|
|
96
97
|
], VegaTableRenderer.prototype, "isTemplateRenderMode", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
MapToComponentField()
|
|
100
|
+
], VegaTableRenderer.prototype, "editingRows", void 0);
|
|
@@ -40,3 +40,4 @@ export const VegaInternalRichTextImageClick = new VegaInternalEventID('richTextI
|
|
|
40
40
|
export const VegaInternalRichTextImageDeleteButtonClicked = new VegaInternalEventID('richTextImageDeleteButtonClicked');
|
|
41
41
|
export const VegaInternalComponentDidRender = new VegaInternalEventID('componentDidRender');
|
|
42
42
|
export const VegaInternalPopoverUpdateTarget = new VegaInternalEventID('popoverUpdateTarget');
|
|
43
|
+
export const VegaInternalRichTextEditDeleteSelectedNodes = new VegaInternalEventID('richTextEditDeleteSelectedNodes');
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { F as FeatureFlag } from './feature-flag-controller-4b3fe6f8.js';
|
|
2
2
|
import { V as VegaLoader, a as VegaNotify, b as VegaEventManager, c as VegaZIndexManager, d as VegaSkeletonLoader } from './vega-skeleton-loader-controller-0044d77f.js';
|
|
3
|
-
import { V as VegaThemeManager } from './node-annotation.abstract-
|
|
3
|
+
import { V as VegaThemeManager } from './node-annotation.abstract-b2e36bc4.js';
|
|
4
4
|
import { M as MapToComponentMethod, V as VegaSlimmer, s as setVegaLogLevel, G as GlobalSlimmersRegistry } from './global-slimmer-registry-17c4efd4.js';
|
|
5
5
|
import { V as VegaDialog } from './vega-dialog-controller-34eb8967.js';
|
|
6
6
|
import { v as vegaEnvManager } from './vega-env-manager-8f8dc473.js';
|
|
7
7
|
import { V as VegaIconManager } from './icon-manager-b889176b.js';
|
|
8
|
-
import { w as waitForVega } from './index-
|
|
8
|
+
import { w as waitForVega } from './index-6e05b241.js';
|
|
9
9
|
import './ui-62e4be97.js';
|
|
10
10
|
import { V as VegaInternalTranslation, a as VegaTranslation, s as staticTranslations } from './translation-c08f2274.js';
|
|
11
11
|
import { T as TypographyUrls } from './typography-396de03f.js';
|
|
12
12
|
import { V as ValidCreditCardNumberRule } from './valid-credit-card-number-rule-2aef3ad5.js';
|
|
13
|
-
import { V as VegaRTEContent } from './content-state-
|
|
13
|
+
import { V as VegaRTEContent } from './content-state-ccf5f960.js';
|
|
14
14
|
import { U as UPDATE_TRANSLATION } from './static-subject-title-8268945e.js';
|
|
15
15
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
16
16
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BlockAnnotation, a as BlockAnnotationTypeEnum, M as ModifyContentAction, b as ModifyContentActionType, s as stateEntityRenderingRegistry, N as NodeAnnotation, c as NodeAnnotationTypeEnum, R as RTENode, d as NodeTypeEnum, A as Annotation, I as InternalAnnotationTypeEnum, V as VegaThemeManager } from './node-annotation.abstract-
|
|
1
|
+
import { B as BlockAnnotation, a as BlockAnnotationTypeEnum, M as ModifyContentAction, b as ModifyContentActionType, s as stateEntityRenderingRegistry, N as NodeAnnotation, c as NodeAnnotationTypeEnum, R as RTENode, d as NodeTypeEnum, A as Annotation, I as InternalAnnotationTypeEnum, V as VegaThemeManager } from './node-annotation.abstract-b2e36bc4.js';
|
|
2
2
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
3
3
|
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-97deb349.js';
|
|
4
|
-
import { V as VegaInternalRichTextEditorFlushChanges, b as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-
|
|
4
|
+
import { V as VegaInternalRichTextEditorFlushChanges, b as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-d0690d0d.js';
|
|
5
5
|
import { i as isNonNullable } from './type-guard-158f6d7a.js';
|
|
6
6
|
import './global-slimmer-registry-17c4efd4.js';
|
|
7
7
|
import { g as generateUUID } from './create-public-api-runtime-metrics-slimmer-9ab05523.js';
|
|
@@ -2951,4 +2951,4 @@ class VegaRTEContent extends BlockBaseOperator {
|
|
|
2951
2951
|
}
|
|
2952
2952
|
}
|
|
2953
2953
|
|
|
2954
|
-
export { AnnotationAction as A, BoldAnnotationAction as B, ClearFormattingAnnotationAction as C, HorizontalAlignmentAnnotation as H, ImageAnnotation as I, LinkAnnotationAction as L, MergeTwoBlocksNodesAction as M, RTETextBlock as R, StrikethroughAnnotation as S, TextSplittableAction as T, UnderlineAnnotation as U, VegaRTEContent as V, ZERO_WIDTH_SPACE as Z, RTEImageBlock as a, RTEListItemBlock as b, RTEListBlock as c, RTEBlock as d, RTEImageNode as e, RTETextNode as f, TextColorAnnotation as g, RTE_TEXT_COLORS as h, ItalicAnnotation as i, TextStyleAnnotationAction as j, TextStyleAnnotation as k, BoldAnnotation as l, CodeAnnotationAction as m, SelectionRangeAnnotation as n, IndentAnnotation as o,
|
|
2954
|
+
export { AnnotationAction as A, BoldAnnotationAction as B, ClearFormattingAnnotationAction as C, HorizontalAlignmentAnnotation as H, ImageAnnotation as I, LinkAnnotationAction as L, MergeTwoBlocksNodesAction as M, RTETextBlock as R, StrikethroughAnnotation as S, TextSplittableAction as T, UnderlineAnnotation as U, VegaRTEContent as V, ZERO_WIDTH_SPACE as Z, RTEImageBlock as a, RTEListItemBlock as b, RTEListBlock as c, RTEBlock as d, RTEImageNode as e, RTETextNode as f, TextColorAnnotation as g, RTE_TEXT_COLORS as h, ItalicAnnotation as i, TextStyleAnnotationAction as j, TextStyleAnnotation as k, BoldAnnotation as l, CodeAnnotationAction as m, SelectionRangeAnnotation as n, IndentAnnotation as o, AppendChildNodesAction as p, UpdateTextAction as q, SplitBlockWithNodeAction as r, RemoveChildAction as s, ReplaceChildNodesAction as t, InsertBlocksBeforeAction as u, InsertBlocksAfterAction as v };
|
|
@@ -7,7 +7,7 @@ import { f as findParent, c as isElementVisible } from './ui-62e4be97.js';
|
|
|
7
7
|
import { i as isAsyncFunction, g as generateUUID } from './create-public-api-runtime-metrics-slimmer-9ab05523.js';
|
|
8
8
|
import { c as createDynamicSlimmer } from './dynamic-slimmer-90b8af32.js';
|
|
9
9
|
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-97deb349.js';
|
|
10
|
-
import { c as VegaInternalFieldErrorStateChange, d as VegaInternalValid } from './vega-internal-event-id-
|
|
10
|
+
import { c as VegaInternalFieldErrorStateChange, d as VegaInternalValid } from './vega-internal-event-id-d0690d0d.js';
|
|
11
11
|
import { V as VegaInternalTranslation } from './translation-c08f2274.js';
|
|
12
12
|
import { P as PageResizeObserverSlimmer } from './page-resize-observer-slimmer-beb7b0bd.js';
|
|
13
13
|
import { D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-857c65fa.js';
|
package/dist/esm/{image-annotation-action-84422458.js → image-annotation-action-3da42221.js}
RENAMED
|
@@ -3,8 +3,8 @@ import { c as MapToComponentField, V as VegaSlimmer } from './global-slimmer-reg
|
|
|
3
3
|
import { D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-857c65fa.js';
|
|
4
4
|
import { a as VegaClick, L as VegaPopoverShow, M as VegaPopoverHide, f as VegaChange } from './dom-node-subject-factory-97deb349.js';
|
|
5
5
|
import { V as VegaInternalIconManager } from './internal-icon-manager-900a5bb4.js';
|
|
6
|
-
import { T as TextSplittableAction, g as TextColorAnnotation, h as RTE_TEXT_COLORS, f as RTETextNode, A as AnnotationAction, I as ImageAnnotation } from './content-state-
|
|
7
|
-
import { e as VegaDarkModeStyleController, c as NodeAnnotationTypeEnum } from './node-annotation.abstract-
|
|
6
|
+
import { T as TextSplittableAction, g as TextColorAnnotation, h as RTE_TEXT_COLORS, f as RTETextNode, A as AnnotationAction, I as ImageAnnotation } from './content-state-ccf5f960.js';
|
|
7
|
+
import { e as VegaDarkModeStyleController, c as NodeAnnotationTypeEnum } from './node-annotation.abstract-b2e36bc4.js';
|
|
8
8
|
|
|
9
9
|
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
10
10
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|