@globalpayments/vega 2.34.0 → 2.34.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.
Files changed (122) hide show
  1. package/dist/cjs/{app-globals-4e819773.js → app-globals-48582633.js} +2 -2
  2. package/dist/cjs/{content-state-3a2724f6.js → content-state-6a5b9736.js} +64 -294
  3. package/dist/cjs/index.cjs.js +2 -2
  4. package/dist/cjs/loader.cjs.js +3 -3
  5. package/dist/cjs/{text-color-toolbar-button-slimmer-b1c9f40e.js → text-color-toolbar-button-slimmer-21a166e4.js} +1 -1
  6. package/dist/cjs/{text-node-0d12da5a.js → text-node-494856f3.js} +0 -122
  7. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  8. package/dist/cjs/vega-pagination.cjs.entry.js +5 -2
  9. package/dist/cjs/vega-rich-text-content.cjs.entry.js +2 -2
  10. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +629 -416
  11. package/dist/cjs/vega-table_8.cjs.entry.js +1 -1
  12. package/dist/cjs/vega.cjs.js +3 -3
  13. package/dist/collection/components/vega-pagination/vega-pagination.js +5 -2
  14. package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +0 -10
  15. package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +0 -9
  16. package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +0 -44
  17. package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +0 -10
  18. package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +0 -42
  19. package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +0 -9
  20. package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +0 -14
  21. package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +0 -11
  22. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +0 -26
  23. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +0 -44
  24. package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +0 -11
  25. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +0 -18
  26. package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +0 -13
  27. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +0 -19
  28. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +0 -27
  29. package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +2 -14
  30. package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +0 -10
  31. package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +0 -32
  32. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +258 -0
  33. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.js +71 -0
  34. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.js +70 -0
  35. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +37 -0
  36. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.js +55 -0
  37. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.js +85 -0
  38. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +49 -0
  39. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +50 -0
  40. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.js +60 -0
  41. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +50 -0
  42. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +56 -0
  43. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +7 -3
  44. package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +3 -0
  45. package/dist/esm/{app-globals-9971ccfd.js → app-globals-48531a04.js} +2 -2
  46. package/dist/esm/{content-state-acf55eb0.js → content-state-4b036bf1.js} +65 -295
  47. package/dist/esm/index.js +2 -2
  48. package/dist/esm/loader.js +3 -3
  49. package/dist/esm/{text-color-toolbar-button-slimmer-d0255b98.js → text-color-toolbar-button-slimmer-b2270b64.js} +1 -1
  50. package/dist/esm/{text-node-6f7d736c.js → text-node-a652ca87.js} +0 -122
  51. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  52. package/dist/esm/vega-pagination.entry.js +5 -2
  53. package/dist/esm/vega-rich-text-content.entry.js +2 -2
  54. package/dist/esm/vega-rich-text-editor_4.entry.js +630 -417
  55. package/dist/esm/vega-table_8.entry.js +1 -1
  56. package/dist/esm/vega.js +3 -3
  57. package/dist/types/components/vega-pagination/vega-pagination.d.ts +1 -0
  58. package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +0 -7
  59. package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +0 -7
  60. package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +0 -14
  61. package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +0 -8
  62. package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +0 -14
  63. package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +0 -7
  64. package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +0 -7
  65. package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +0 -7
  66. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +0 -7
  67. package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +0 -14
  68. package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +0 -7
  69. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +0 -8
  70. package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +0 -1
  71. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +0 -1
  72. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +0 -1
  73. package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +0 -1
  74. package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +0 -1
  75. package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +0 -2
  76. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.d.ts +111 -0
  77. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/continue-inline-to-rte-text-block-strategy.d.ts +32 -0
  78. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy-processor.d.ts +19 -0
  79. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +32 -0
  80. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/img-to-rte-image-block-strategy.d.ts +31 -0
  81. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/inline-block-to-rte-text-block-strategy.d.ts +38 -0
  82. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.d.ts +35 -0
  83. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.d.ts +36 -0
  84. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/span-img-to-rte-image-block-strategy.d.ts +31 -0
  85. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.d.ts +36 -0
  86. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.d.ts +31 -0
  87. package/dist/vega/index.esm.js +1 -1
  88. package/dist/vega/{p-d302f052.entry.js → p-0190095c.entry.js} +1 -1
  89. package/dist/vega/p-10393104.js +1 -0
  90. package/dist/vega/p-584dcd9b.js +1 -0
  91. package/dist/vega/p-5f377954.js +1 -1
  92. package/dist/vega/{p-c1d97d12.entry.js → p-734ea281.entry.js} +1 -1
  93. package/dist/vega/{p-49f4a666.js → p-8836c1b9.js} +1 -1
  94. package/dist/vega/p-8f004647.entry.js +1 -0
  95. package/dist/vega/p-9e732a26.entry.js +1 -0
  96. package/dist/vega/{p-2fc3af2f.js → p-9f39dd10.js} +1 -1
  97. package/dist/vega/vega.esm.js +1 -1
  98. package/package.json +1 -1
  99. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/element-to-dto-handler.abstract.js +0 -135
  100. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/element-to-dto-processor.js +0 -74
  101. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/image-to-dto-handler.js +0 -47
  102. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/inline-block-to-dto-handler.js +0 -39
  103. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/link-to-dto-handler.js +0 -50
  104. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/list-item-to-dto-handler.js +0 -41
  105. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/list-to-dto-handler.js +0 -57
  106. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/paragraph-to-dto-handler.js +0 -56
  107. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/text-block-to-dto-handler.js +0 -77
  108. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/text-to-dto-handler.js +0 -44
  109. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/element-to-dto-handler.abstract.d.ts +0 -67
  110. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/element-to-dto-processor.d.ts +0 -29
  111. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/image-to-dto-handler.d.ts +0 -37
  112. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/inline-block-to-dto-handler.d.ts +0 -35
  113. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/link-to-dto-handler.d.ts +0 -37
  114. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/list-item-to-dto-handler.d.ts +0 -36
  115. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/list-to-dto-handler.d.ts +0 -39
  116. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/paragraph-to-dto-handler.d.ts +0 -39
  117. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/text-block-to-dto-handler.d.ts +0 -46
  118. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-handler/text-to-dto-handler.d.ts +0 -37
  119. package/dist/vega/p-315667f1.js +0 -1
  120. package/dist/vega/p-728b029a.entry.js +0 -1
  121. package/dist/vega/p-b6af0fc1.entry.js +0 -1
  122. package/dist/vega/p-e43c2a27.js +0 -1
@@ -1,56 +0,0 @@
1
- import { RTETextBlock } from '../../../../dto/blocks/text-block';
2
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
3
- /**
4
- * Transform paragraph.
5
- */
6
- export class ParagraphToDTOHandler extends ElementToDTOHandlerAbstract {
7
- /**
8
- * Can be transform.
9
- *
10
- * @param {HTMLElement} element - An pasted element.
11
- * @returns {boolean} Result.
12
- */
13
- static canHandle(element) {
14
- return ['DIV', 'P'].includes(element.nodeName);
15
- }
16
- /**
17
- * Special the child elements of current.
18
- *
19
- * @returns {HTMLElement[]} - child elements.
20
- */
21
- childElements() {
22
- return Array.from(this.currentEntityElement.childNodes);
23
- }
24
- /**
25
- * Transform element to DTO.
26
- * When blockElement is exist, it means that the current element is a child node,
27
- * and we need to wait for its root block to be converted into a dto.
28
- * Otherwise, the current node is the root node, and we can directly convert it.
29
- *
30
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
31
- * @returns {RTEContentBlock[]} - Block DTO.
32
- */
33
- handle(blockElement) {
34
- if (this.handleEmptyBlock(blockElement)) {
35
- return [];
36
- }
37
- if (blockElement && !ParagraphToDTOHandler.canHandle(blockElement)) {
38
- blockElement.append(...Array.from(this.currentVirtualElement.childNodes));
39
- return [];
40
- }
41
- else {
42
- return [
43
- ElementToDTOHandlerAbstract.currentTextBlockElementToDTO(),
44
- RTETextBlock.fromHTML(this.currentVirtualElement, 'paragraph'),
45
- ];
46
- }
47
- }
48
- /**
49
- * Get the block element for child nodes
50
- *
51
- * @returns {HTMLElement} - Block element for child nodes.
52
- */
53
- getNextBlockElement() {
54
- return this.currentVirtualElement;
55
- }
56
- }
@@ -1,77 +0,0 @@
1
- import { RTETextBlock } from '../../../../dto/blocks/text-block';
2
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
3
- /**
4
- * Transform text block element to DTO.
5
- */
6
- export class TextBlockToDTOHandler extends ElementToDTOHandlerAbstract {
7
- /**
8
- * Can be transform.
9
- *
10
- * @param {HTMLElement} element - An pasted element.
11
- * @returns {boolean} Result.
12
- */
13
- static canHandle(element) {
14
- return ['heading-1', 'heading-2', 'heading-3', 'title', 'subtitle'].includes(this.getElementType(element));
15
- }
16
- /**
17
- * Get type of element.
18
- *
19
- * @param {HTMLElement} element - An pasted element.
20
- * @returns {string} type.
21
- */
22
- static getElementType(element) {
23
- if (element.nodeType !== Node.TEXT_NODE && element.hasAttribute('data-type')) {
24
- return element.getAttribute('data-type');
25
- }
26
- switch (element.nodeName) {
27
- case 'H1':
28
- return 'heading-1';
29
- case 'H2':
30
- return 'heading-2';
31
- case 'H3':
32
- return 'heading-3';
33
- default:
34
- return '';
35
- }
36
- }
37
- /**
38
- * Special the child elements of current.
39
- *
40
- * @returns {HTMLElement[]} - child elements.
41
- */
42
- childElements() {
43
- return Array.from(this.currentEntityElement.childNodes);
44
- }
45
- /**
46
- * Transform element to DTO.
47
- * When blockElement is exist, it means that the current element is a child node,
48
- * and we need to wait for its root block to be converted into a dto.
49
- * Otherwise, the current node is the root node, and we can directly convert it.
50
- *
51
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
52
- * @returns {RTEContentBlock[]} - Block DTO.
53
- */
54
- handle(blockElement) {
55
- if (this.handleEmptyBlock(blockElement)) {
56
- return [];
57
- }
58
- if (blockElement) {
59
- blockElement.append(...Array.from(this.currentVirtualElement.childNodes));
60
- return [];
61
- }
62
- else {
63
- return [
64
- ElementToDTOHandlerAbstract.currentTextBlockElementToDTO(),
65
- RTETextBlock.fromHTML(this.currentVirtualElement, TextBlockToDTOHandler.getElementType(this.currentVirtualElement)),
66
- ];
67
- }
68
- }
69
- /**
70
- * Get the block element for child nodes
71
- *
72
- * @returns {HTMLElement} - Block element for child nodes.
73
- */
74
- getNextBlockElement() {
75
- return this.currentVirtualElement;
76
- }
77
- }
@@ -1,44 +0,0 @@
1
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
2
- /**
3
- * Transform text element to DTO.
4
- */
5
- export class TextToDTOHandler extends ElementToDTOHandlerAbstract {
6
- /**
7
- * Can be transform.
8
- *
9
- * @param {HTMLElement} element - An pasted element.
10
- * @returns {boolean} Result.
11
- */
12
- static canHandle(element) {
13
- return element.nodeType === Node.TEXT_NODE;
14
- }
15
- /* istanbul ignore next */
16
- /**
17
- * Special the child elements of current.
18
- *
19
- * @returns {HTMLElement[]} - child elements.
20
- */
21
- childElements() {
22
- return [];
23
- }
24
- /**
25
- * Append text node to it block element.
26
- *
27
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
28
- * @returns {RTEContentBlock[]} - Block DTO.
29
- */
30
- handle(blockElement) {
31
- (blockElement || ElementToDTOHandlerAbstract.getCurrentTextBlockElement()).append(this.currentVirtualElement);
32
- return [];
33
- }
34
- /* istanbul ignore next */
35
- /**
36
- * Get the block element for child nodes
37
- *
38
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
39
- * @returns {Nullable<HTMLElement>} - blockElement.
40
- */
41
- getNextBlockElement(blockElement) {
42
- return blockElement;
43
- }
44
- }
@@ -1,67 +0,0 @@
1
- import { Nullable } from '../../../../../../types/general';
2
- import { RTETextBlock } from '../../../../dto/blocks/text-block';
3
- import { RTEContentBlock } from '../../../../interface';
4
- /**
5
- * Abstract class of element to DTO handler
6
- */
7
- export declare abstract class ElementToDTOHandlerAbstract {
8
- private static currentTextBlockElement;
9
- protected abstract currentEntityElement: HTMLElement;
10
- protected abstract currentVirtualElement: HTMLElement;
11
- /**
12
- * At new of handler, We need to inherit the style of the parent element
13
- * and clone an empty element so that the child elements can be appended.
14
- *
15
- * @param {HTMLElement} element - Current element.
16
- */
17
- constructor(element: HTMLElement);
18
- /**
19
- * Can be handle, the class inherit this class should implement it.
20
- *
21
- * @param {HTMLElement} element - Current element.
22
- * @returns {boolean} Can be handle.
23
- */
24
- static canHandle(element: HTMLElement): boolean;
25
- /**
26
- * Transform current text block to a DTO.
27
- *
28
- * @returns {RTETextBlock} Current text block.
29
- */
30
- static currentTextBlockElementToDTO(): RTETextBlock;
31
- /**
32
- * Get current text block element.
33
- *
34
- * @returns {HTMLDivElement} - Current text block element.
35
- */
36
- protected static getCurrentTextBlockElement(): HTMLDivElement;
37
- /**
38
- * While it a empty block. we should use new line span instead this block.
39
- *
40
- * @param {HTMLElement} blockElement - Current block element.
41
- * @returns {boolean} - is handled.
42
- */
43
- protected handleEmptyBlock(blockElement: HTMLElement): boolean;
44
- /**
45
- * Inherit style of parent.
46
- *
47
- * @param {HTMLElement} element - Current element.
48
- */
49
- private setEntityElementStyle;
50
- /**
51
- * Set current element.
52
- * while element is a text node, we should wrap it and inherit it style
53
- * otherwise, we should clone it and clear content.
54
- *
55
- * @param {HTMLElement} element - Current element.
56
- */
57
- private setElement;
58
- /**
59
- * Create a new line span.
60
- *
61
- * @returns {HTMLElement} - new line span.
62
- */
63
- private createNewLineSpan;
64
- abstract handle(blockElement: Nullable<HTMLElement>): RTEContentBlock[];
65
- abstract childElements(): HTMLElement[];
66
- abstract getNextBlockElement(currentBlockElement: Nullable<HTMLElement>): Nullable<HTMLElement>;
67
- }
@@ -1,29 +0,0 @@
1
- import { RTEContentBlock } from '../../../../interface';
2
- /**
3
- * Element to DTO processor
4
- */
5
- export declare class ElementToDTOProcessor {
6
- private elementHandlers;
7
- /**
8
- * Transform element to block DTO.
9
- *
10
- * @param {HTMLElement} element - An pasted element.
11
- * @returns {RTEContentBlock[]} Block DTO.
12
- */
13
- process(element: HTMLElement): RTEContentBlock[];
14
- /**
15
- * Transform elements to block DTO.
16
- *
17
- * @param {HTMLElement[]} elements - An pasted elements.
18
- * @param {HTMLElement} blockElement - Current block element.
19
- * @returns {RTEContentBlock[]} Block DTO.
20
- */
21
- private transformDomToDto;
22
- /**
23
- * Checks if the given element is valid to parse.
24
- *
25
- * @param {HTMLElement} element - The pasted element.
26
- * @returns {boolean} Is valid
27
- */
28
- private isInvalidElement;
29
- }
@@ -1,37 +0,0 @@
1
- import { RTEContentBlock } from '../../../../interface';
2
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
3
- /**
4
- * Transform image element to DTO.
5
- */
6
- export declare class ImageToDTOHandler extends ElementToDTOHandlerAbstract {
7
- protected currentEntityElement: HTMLElement;
8
- protected currentVirtualElement: HTMLElement;
9
- /**
10
- * Can be transform.
11
- *
12
- * @param {HTMLElement} element - An pasted element.
13
- * @returns {boolean} Result.
14
- */
15
- static canHandle(element: HTMLElement): boolean;
16
- /**
17
- * Special the child elements of current.
18
- *
19
- * @returns {HTMLElement[]} - child elements.
20
- */
21
- childElements(): HTMLElement[];
22
- /**
23
- * Transform element to DTO.
24
- * When blockElement is exist, it means that the current element is a child node,
25
- * and we need to wait for its root block to be converted into a dto.
26
- * Otherwise, the current node is the root node, and we can directly convert it.
27
- *
28
- * @returns {RTEContentBlock[]} - Block DTO.
29
- */
30
- handle(): RTEContentBlock[];
31
- /**
32
- * Get the block element for child nodes
33
- *
34
- * @returns {HTMLElement} - Block element for child nodes.
35
- */
36
- getNextBlockElement(): HTMLElement;
37
- }
@@ -1,35 +0,0 @@
1
- import { Nullable } from '../../../../../../types/general';
2
- import { RTEContentBlock } from '../../../../interface';
3
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
4
- /**
5
- * Transform link element to DTO.
6
- */
7
- export declare class InlineBlockToDTOHandler extends ElementToDTOHandlerAbstract {
8
- protected currentEntityElement: HTMLElement;
9
- protected currentVirtualElement: HTMLElement;
10
- /**
11
- * Can be transform.
12
- *
13
- * @returns {boolean} Result.
14
- */
15
- static canHandle(): boolean;
16
- /**
17
- * Special the child elements of current.
18
- *
19
- * @returns {HTMLElement[]} - child elements.
20
- */
21
- childElements(): HTMLElement[];
22
- /**
23
- * The inline block is a child element, and there is no need to convert it to a dto here
24
- *
25
- * @returns {RTEContentBlock[]} - Empty dto.
26
- */
27
- handle(): RTEContentBlock[];
28
- /**
29
- * Get the block element for child nodes
30
- *
31
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
32
- * @returns {Nullable<HTMLElement>} - blockElement.
33
- */
34
- getNextBlockElement(blockElement: Nullable<HTMLElement>): Nullable<HTMLElement>;
35
- }
@@ -1,37 +0,0 @@
1
- import { Nullable } from '../../../../../../types/general';
2
- import { RTEContentBlock } from '../../../../interface';
3
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
4
- /**
5
- * Transform link element to DTO.
6
- */
7
- export declare class LinkToDTOHandler extends ElementToDTOHandlerAbstract {
8
- protected currentEntityElement: HTMLElement;
9
- protected currentVirtualElement: HTMLElement;
10
- constructor(element: HTMLElement);
11
- /**
12
- * Can be transform.
13
- *
14
- * @param {HTMLElement} element - An pasted element.
15
- * @returns {boolean} Result.
16
- */
17
- static canHandle(element: HTMLElement): boolean;
18
- /**
19
- * Special the child elements of current.
20
- *
21
- * @returns {HTMLElement[]} - child elements.
22
- */
23
- childElements(): HTMLElement[];
24
- /**
25
- * Format and append element for it block element.
26
- *
27
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
28
- * @returns {RTEContentBlock[]} - Block DTO.
29
- */
30
- handle(blockElement: Nullable<HTMLElement>): RTEContentBlock[];
31
- /**
32
- * Get the block element for child nodes
33
- *
34
- * @returns {HTMLElement} - Block element for child nodes.
35
- */
36
- getNextBlockElement(): HTMLElement;
37
- }
@@ -1,36 +0,0 @@
1
- import { Nullable } from '../../../../../../types/general';
2
- import { RTEContentBlock } from '../../../../interface';
3
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
4
- /**
5
- * Transform list element to DTO.
6
- */
7
- export declare class ListItemToDTOHandler extends ElementToDTOHandlerAbstract {
8
- protected currentEntityElement: HTMLElement;
9
- protected currentVirtualElement: HTMLElement;
10
- /**
11
- * Can be transform.
12
- *
13
- * @param {HTMLElement} element - An pasted element.
14
- * @returns {boolean} Result.
15
- */
16
- static canHandle(element: HTMLElement): boolean;
17
- /**
18
- * Special the child elements of current.
19
- *
20
- * @returns {HTMLElement[]} - child elements.
21
- */
22
- childElements(): HTMLElement[];
23
- /**
24
- * Append list item node to it block element.
25
- *
26
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
27
- * @returns {RTEContentBlock[]} - Block DTO.
28
- */
29
- handle(blockElement: Nullable<HTMLElement>): RTEContentBlock[];
30
- /**
31
- * Get the block element for child nodes
32
- *
33
- * @returns {HTMLElement} - Block element for child nodes.
34
- */
35
- getNextBlockElement(): HTMLElement;
36
- }
@@ -1,39 +0,0 @@
1
- import { Nullable } from '../../../../../../types/general';
2
- import { RTEContentBlock } from '../../../../interface';
3
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
4
- /**
5
- * Transform list element to DTO.
6
- */
7
- export declare class ListToDTOHandler extends ElementToDTOHandlerAbstract {
8
- protected currentEntityElement: HTMLElement;
9
- protected currentVirtualElement: HTMLElement;
10
- /**
11
- * Can be transform.
12
- *
13
- * @param {HTMLElement} element - An pasted element.
14
- * @returns {boolean} Result.
15
- */
16
- static canHandle(element: HTMLElement): boolean;
17
- /**
18
- * Special the child elements of current.
19
- *
20
- * @returns {HTMLElement[]} - child elements.
21
- */
22
- childElements(): HTMLElement[];
23
- /**
24
- * Transform element to DTO.
25
- * When blockElement is exist, it means that the current element is a child node,
26
- * and we need to append and wait for its root block to be converted into a dto.
27
- * Otherwise, the current node is the root node, and we can directly convert it.
28
- *
29
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
30
- * @returns {RTEContentBlock[]} - Block DTO.
31
- */
32
- handle(blockElement: Nullable<HTMLElement>): RTEContentBlock[];
33
- /**
34
- * Get the block element for child nodes
35
- *
36
- * @returns {HTMLElement} - Block element for child nodes.
37
- */
38
- getNextBlockElement(): HTMLElement;
39
- }
@@ -1,39 +0,0 @@
1
- import { Nullable } from '../../../../../../types/general';
2
- import { RTEContentBlock } from '../../../../interface';
3
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
4
- /**
5
- * Transform paragraph.
6
- */
7
- export declare class ParagraphToDTOHandler extends ElementToDTOHandlerAbstract {
8
- protected currentEntityElement: HTMLElement;
9
- protected currentVirtualElement: HTMLElement;
10
- /**
11
- * Can be transform.
12
- *
13
- * @param {HTMLElement} element - An pasted element.
14
- * @returns {boolean} Result.
15
- */
16
- static canHandle(element: HTMLElement): boolean;
17
- /**
18
- * Special the child elements of current.
19
- *
20
- * @returns {HTMLElement[]} - child elements.
21
- */
22
- childElements(): HTMLElement[];
23
- /**
24
- * Transform element to DTO.
25
- * When blockElement is exist, it means that the current element is a child node,
26
- * and we need to wait for its root block to be converted into a dto.
27
- * Otherwise, the current node is the root node, and we can directly convert it.
28
- *
29
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
30
- * @returns {RTEContentBlock[]} - Block DTO.
31
- */
32
- handle(blockElement: Nullable<HTMLElement>): RTEContentBlock[];
33
- /**
34
- * Get the block element for child nodes
35
- *
36
- * @returns {HTMLElement} - Block element for child nodes.
37
- */
38
- getNextBlockElement(): HTMLElement;
39
- }
@@ -1,46 +0,0 @@
1
- import { Nullable } from '../../../../../../types/general';
2
- import { RTEContentBlock } from '../../../../interface';
3
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
4
- /**
5
- * Transform text block element to DTO.
6
- */
7
- export declare class TextBlockToDTOHandler extends ElementToDTOHandlerAbstract {
8
- protected currentEntityElement: HTMLElement;
9
- protected currentVirtualElement: HTMLElement;
10
- /**
11
- * Can be transform.
12
- *
13
- * @param {HTMLElement} element - An pasted element.
14
- * @returns {boolean} Result.
15
- */
16
- static canHandle(element: HTMLElement): boolean;
17
- /**
18
- * Get type of element.
19
- *
20
- * @param {HTMLElement} element - An pasted element.
21
- * @returns {string} type.
22
- */
23
- static getElementType(element: HTMLElement): string;
24
- /**
25
- * Special the child elements of current.
26
- *
27
- * @returns {HTMLElement[]} - child elements.
28
- */
29
- childElements(): HTMLElement[];
30
- /**
31
- * Transform element to DTO.
32
- * When blockElement is exist, it means that the current element is a child node,
33
- * and we need to wait for its root block to be converted into a dto.
34
- * Otherwise, the current node is the root node, and we can directly convert it.
35
- *
36
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
37
- * @returns {RTEContentBlock[]} - Block DTO.
38
- */
39
- handle(blockElement: Nullable<HTMLElement>): RTEContentBlock[];
40
- /**
41
- * Get the block element for child nodes
42
- *
43
- * @returns {HTMLElement} - Block element for child nodes.
44
- */
45
- getNextBlockElement(): HTMLElement;
46
- }
@@ -1,37 +0,0 @@
1
- import { Nullable } from '../../../../../../types/general';
2
- import { RTEContentBlock } from '../../../../interface';
3
- import { ElementToDTOHandlerAbstract } from './element-to-dto-handler.abstract';
4
- /**
5
- * Transform text element to DTO.
6
- */
7
- export declare class TextToDTOHandler extends ElementToDTOHandlerAbstract {
8
- protected currentEntityElement: HTMLElement;
9
- protected currentVirtualElement: HTMLElement;
10
- /**
11
- * Can be transform.
12
- *
13
- * @param {HTMLElement} element - An pasted element.
14
- * @returns {boolean} Result.
15
- */
16
- static canHandle(element: HTMLElement): boolean;
17
- /**
18
- * Special the child elements of current.
19
- *
20
- * @returns {HTMLElement[]} - child elements.
21
- */
22
- childElements(): HTMLElement[];
23
- /**
24
- * Append text node to it block element.
25
- *
26
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
27
- * @returns {RTEContentBlock[]} - Block DTO.
28
- */
29
- handle(blockElement: Nullable<HTMLElement>): RTEContentBlock[];
30
- /**
31
- * Get the block element for child nodes
32
- *
33
- * @param {Nullable<HTMLElement>} blockElement - Current block container.
34
- * @returns {Nullable<HTMLElement>} - blockElement.
35
- */
36
- getNextBlockElement(blockElement: Nullable<HTMLElement>): Nullable<HTMLElement>;
37
- }
@@ -1 +0,0 @@
1
- import{W as t,A as s,I as e,N as r,a as n,V as i,M as o,b as a,R as h,c,s as u}from"./p-8c26227e.js";import{O as l,d,D as f,V as p}from"./p-a5ffe912.js";import{C as w}from"./p-443ad3b3.js";import{a as m,b as k}from"./p-f357cf46.js";import{h as x}from"./p-9c1eeff2.js";import{g as O}from"./p-3ce31dc3.js";import{i as g}from"./p-b1f65b13.js";import{r as y}from"./p-1995e98e.js";import{c as T}from"./p-86194314.js";const N=async()=>t.handle(),C=async t=>new Promise((s=>{const e=new l(L.bind(null),(()=>{w.unregister(d.getSubject(t,m),e),s(null)}));w.register(d.getSubject(t,m),e)})),L=()=>!0,b=[{key:"black",light:"#111128",dark:"#E3E3E8"},{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],E="​";class M{}class A extends M{constructor(){super(...arguments),this.doSplit=!0}}class S extends s{constructor(t){super(),this.type=e.SELECTION_RANGE,this.range=t}}const v=new class{constructor(){this.textNodeElements=new Map}register(t,s){this.textNodeElements.set(t,s)}getTextNodeElements(){return this.textNodeElements}};class j extends r{constructor(t){super(),this.type=n.STRIKETHROUGH,this.strikethrough=t}static from(t){return[n.STRIKETHROUGH,new j(t)]}static fromHTML(t){return this.from(t.style.textDecoration.includes("line-through")||"S"===t.nodeName||t.classList.contains("v-rte--strikethrough"))}toJSON(){return{strikethrough:this.strikethrough}}renderClass(){return this.strikethrough?"v-rte--strikethrough":null}render(){return null}}class D extends r{constructor(t){super(),this.type=n.UNDERLINE,this.underline=t}static from(t){return[n.UNDERLINE,new D(t)]}static fromHTML(t){return this.from(t.style.textDecoration.includes("underline")||"U"===t.nodeName||t.classList.contains("v-rte--underline"))}toJSON(){return{underline:this.underline}}renderClass(){return this.underline?"v-rte--underline":null}render(){return null}}class H extends r{constructor(t){super(),this.type=n.ITALIC,this.italic=t}static from(t){return[n.ITALIC,new H(t)]}static fromHTML(t){return this.from("I"===t.nodeName||"italic"===t.style.fontStyle||"EM"===t.nodeName)}toJSON(){return{italic:this.italic}}render(){return this.italic?{"font-style":"italic"}:null}}class B extends r{constructor(t){super(),this.type=n.BOLD,this.bold=t}static from(t){return[n.BOLD,new B(t)]}static fromHTML(t){const s=t.style;return this.from("STRONG"===t.nodeName||"bold"===s.fontWeight||"700"===s.fontWeight)}toJSON(){return{bold:this.bold}}render(){return this.bold?{"font-weight":"700"}:null}}class I extends s{constructor(){super(...arguments),this.type=e.CLEAR_FORMATTING,this.items=[n.BOLD,n.ITALIC,n.UNDERLINE,n.STRIKETHROUGH,n.TEXT_COLOR,n.CODE]}}class F extends r{constructor(t){super(),this.type=n.CODE,this.code=t}static from(t){return[n.CODE,new F(t)]}static fromHTML(t){return this.from(t.classList.contains("v-rte--code")||"CODE"===t.nodeName)}toJSON(){return{code:this.code}}renderClass(){return this.code?"v-rte--code":null}render(){return null}}class R extends r{constructor(t){super(),this.type=n.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[n.TEXT_COLOR,new R(t)]}static fromHTML(t){var s;const e=null===(s=y(t.style.color))||void 0===s?void 0:s.toUpperCase();if(e){const t=b.find((t=>t.light===e||t.dark===e));return t?this.from(t.key):null}for(const s of b)if(t.style.color.includes(s.key))return this.from(s.key);return null}toJSON(){return{textColor:this.textColor.key}}renderClass(){return null}render(){return{color:i.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return b.find((s=>s.key===t))||b[0]}}class J extends r{constructor(t){super(),this.type=n.LINK,this.link=t}static from(t){return[n.LINK,new J({href:t.href,groupKey:t.groupKey})]}static fromHTML(t){return t.hasAttribute("data-href")?this.from({href:t.getAttribute("data-href"),groupKey:t.getAttribute("data-group-key")}):null}toJSON(){return{link:{href:this.link.href,groupKey:this.link.groupKey}}}toEqual(t){return this.link.groupKey===t.link.groupKey}render(){return null}}class K extends A{constructor({link:t,newText:s,needMergeNode:e,doSplit:r}){super(),this.isFlushable=!0,this.link=t,this.needMergeNode=e,this.newText=s,g(r)&&(this.doSplit=r)}toAnnotation(){return new J(this.link)}}class U extends A{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new F(this.code)}}class G extends A{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new I}}class W extends o{constructor(t){super(),this.type=a.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class _ extends s{constructor(t){super(),this.type=e.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}renderNodes(t,{editable:s}){return this.groupNodesByLink(t).flatMap((t=>{if(this.isLinkGroup(t)){const e=t[0].getAnnotationByType(n.LINK);return s?this.renderLinkEditorWrapper(t,e):this.renderLink(t,e)}return t.render()}))}renderLinkEditorWrapper(t,s){const{href:e}=s.link,r=t.map((t=>t.text)).join(""),i=({detail:s})=>{switch(s.action){case"link":{const{url:e,text:n}=s.payload,i=n!==r,o=O();return void t.forEach((s=>{const r=new K({link:{href:e,groupKey:o},newText:i?n:void 0,needMergeNode:i&&t.length>1,doSplit:!1});s.apply(r)}))}case"unlink":return void t.forEach((t=>t.deleteAnnotationByType(n.LINK)))}};let o;return x("span",{class:"link-editor-wrapper",role:"link",tabIndex:0,onKeyDown:T(),ref:t=>{t&&(o=t)}},this.renderLink(t,s),x("vega-rich-text-link-editor",{record:{text:r,url:e},ref:t=>{t&&(t.target=o,f.addUniqueObserverToNode(t,p,i))}}))}renderLink(t,s){const{href:e}=s.link;return x("a",{class:"v-rte--link",href:e,target:"_blank"},t.map((t=>t.render())))}isLinkGroup(t){return Array.isArray(t)}groupNodesByLink(t){return t.reduce(((t,s)=>{const e=s.getAnnotationByType(n.LINK),r=t[t.length-1];return g(e)?r&&this.isLinkGroup(r)&&r[0].getAnnotationByType(n.LINK).toEqual(e)?r.push(s):t.push([s]):t.push(s),t}),[])}}class V extends M{constructor(t,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=s}toAnnotation(){return new _(this.groupKey)}}class X extends M{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class q extends M{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class P extends h{constructor(t,s,e,r){super(t,r),this.type=c.TEXT,this.parentBlock=e,this.text=s}static from(t,s){const e=new P(t.id,t.text,s),{annotations:r}=t;return r&&(e.annotationMap=new Map(Object.keys(r).map((t=>(r.link&&s.apply(new V(r.link.groupKey,[e])),this.createAnnotationEntity(t,r[t])))).filter(g))),e}static fromHTML(t,s){const e=new P(O(),t.textContent,s);return t.nodeType!==Node.TEXT_NODE&&(e.annotationMap=new Map(Object.keys(n).map((s=>this.createAnnotationEntityFromHTML(s,t))).filter(g)),t.hasAttribute("data-group-key")&&s.apply(new V(t.getAttribute("data-group-key"),[e]))),e}static createAnnotationEntity(t,s){switch(t){case"bold":return B.from(s);case"italic":return H.from(s);case"underline":return D.from(s);case"strikethrough":return j.from(s);case"code":return F.from(s);case"textColor":return R.from(s);case"link":return J.from(s)}}static createAnnotationEntityFromHTML(t,s){switch(t){case"BOLD":return B.fromHTML(s);case"ITALIC":return H.fromHTML(s);case"UNDERLINE":return D.fromHTML(s);case"STRIKETHROUGH":return j.fromHTML(s);case"CODE":return F.fromHTML(s);case"TEXT_COLOR":return R.fromHTML(s);case"LINK":return J.fromHTML(s)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof r)).reduce(((t,s)=>Object.assign(Object.assign({},t),s.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}cloneWithText(t){return new P(O(),t,this.parentBlock,new Map(this.annotationMap))}isEmpty(){return!this.text||"​"===this.text||"\n"===this.text}render(){const t=this.annotationMap.get(n.CODE);return x((null==t?void 0:t.code)?"code":"span",{style:this.getStyles(),class:this.getClasses(),ref:this.registerRef.bind(this)},this.text||"​")}doAnnotationActionApply(t){const s=this.getAnnotationByType(e.SELECTION_RANGE);if(t instanceof A&&t.doSplit&&s){const{startContainer:e,endContainer:r,startOffset:n,endOffset:i}=s.range,o=e===r&&n===i;this.parentBlock.nodes=this.parentBlock.nodes.flatMap((e=>e.id===this.id?o?this.insertNewNode(n,t):this.shouldSplitSelection(s.range)?this.splitTextNode(t,s.range):(this.applyActionToNode(this,t),this):e))}else this.applyActionToNode(this,t);this.parentBlock.mergeNodes(t)}doModifyActionApply(t){switch(t.type){case a.UPDATE_TEXT:this.updateText(t.newTextContent);break;case a.REPLACE_SELECTED_TEXT:this.replaceSelectedText(t.textToBeInsert,t.currentRange)}}registerRef(t){if(t){u.register(t,this);const s=this.getAnnotationByType("TEXT_COLOR");s&&v.register(t,s)}}splitTextNode(t,s){const{startContainer:e,endContainer:r,startOffset:n}=s,i=e.parentElement,o=r.parentElement,a=(t,s,e)=>{const r=t.substring(0,s),n=t.substring(s,e),i=t.substring(e);return[this.cloneWithText(r),this.cloneWithText(n),this.cloneWithText(i)]},h=i&&u.getEntityByDOM(i),c=o&&u.getEntityByDOM(o);if(h&&h.id===this.id){const i=e===r?s.endOffset:this.text.length,[o,h,c]=a(this.text,n,i);return this.applyActionToNode(h,t),[o,h,c].filter((t=>!!t.text))}if(c&&c.id===this.id){const[e,r,n]=a(this.text,0,s.endOffset);return this.applyActionToNode(r,t),[e,r,n].filter((t=>!!t.text))}return this.applyActionToNode(this,t),this}applyActionToNode(t,s){const e=s.toAnnotation();if(s instanceof X)this.syncUpSelectedNodes(t);else if(e instanceof S||this.syncUpSelectedNodes(t),s instanceof q)this.annotationMap.delete(s.annotationType);else{if(!(e instanceof I))return e instanceof r||e instanceof S?(s instanceof K&&(g(s.newText)&&(t.text=s.newText),this.parentBlock.apply(new V(s.link.groupKey,[t]))),s instanceof U&&this.applyActionToNode(t,new G),void t.annotationMap.set(e.type,e)):void 0;e.items.forEach((s=>{t.deleteAnnotationByType(s)}))}}replaceSelectedText(t,s){if(s&&s.startContainer&&s.endContainer){const{startContainer:e,endContainer:r,startOffset:n,endOffset:i}=s,o=e.parentElement,a=r.parentElement,h=o&&u.getEntityByDOM(o),c=a&&u.getEntityByDOM(a);let l=0,d=this.text.length;h&&h===this?(l=n,d=e===r?i:d):c&&c===this&&(d=i),this.apply(new W(this.text.slice(0,l)+t+this.text.slice(d)))}}updateText(t){this.text=t,!this.text&&this.isLinkNode()&&this.annotationMap.delete(n.LINK)}isLinkNode(){return this.annotationMap.has("LINK")}shouldSplitSelection(t){const{startContainer:s,endContainer:e,startOffset:r,endOffset:n}=t;return s!==e||r>0||n<(e.textContent?e.textContent.length:0)}syncUpSelectedNodes(t){const s=u.getDOMByEntity(this);if(s){const e=d.getSubjectFromParentNodeByEventId(s,k);e&&w.notify(e,{node:t})}}insertNewNode(t,s){if(0===t){const t=this.cloneWithText("");return this.applyActionToNode(t,s),[t,this]}if(t===this.text.length){const t=this.cloneWithText("");return this.applyActionToNode(t,s),[this,t]}const e=this.cloneWithText(this.text.substring(0,t)),r=this.cloneWithText(""),n=this.cloneWithText(this.text.substring(t));return this.applyActionToNode(r,s),[e,r,n]}}export{M as A,B,G as C,q as D,H as I,K as L,P as R,X as S,A as T,W as U,E as Z,V as a,C as b,R as c,b as d,D as e,U as f,j as g,S as h,v as i,N as w}