@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
@@ -3562,7 +3562,7 @@ __decorate$b([
3562
3562
  globalSlimmerRegistry.MapToComponentField()
3563
3563
  ], SortIconRenderer.prototype, "sortOrder", void 0);
3564
3564
 
3565
- const vegaTableHeadCellCss = ":host(.v-hidden){display:none}@media (min-width: 320px){:host(.S\\:v-table-cell){display:table-cell}}@media (min-width: 768px){:host(.M\\:v-table-cell){display:table-cell}}@media (min-width: 1024px){:host(.L\\:v-table-cell){display:table-cell}}@media (min-width: 1440px){:host(.XL\\:v-table-cell){display:table-cell}}:host{display:table-cell;background-color:rgba(var(--v-bg-table-header, 240, 243, 247, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;vertical-align:middle}:host(.sortable){cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.sortable:hover){background-color:rgba(var(--v-bg-table-row-hover, 241, 248, 251, 1))}th{display:block;padding:0px;padding:12px;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;overflow-wrap:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){th{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){th{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){th{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}th.break-word{word-break:break-word}.vega-table-column{display:flex;align-items:center}.vega-table-column.center{justify-content:center}.vega-table-column.right{justify-content:flex-end}.vega-table-column.left{justify-content:flex-start}.vega-table-column .vega-table-column-label{min-width:0px}.vega-table-column .vega-table-column-sorter{display:flex;align-items:center;justify-content:center;padding:2px;margin-left:8px;cursor:pointer;outline:none}:host(.density-default) .vega-table-cell{padding:12px}:host(.density-compact) .vega-table-cell{padding:4px}:host(.density-relaxed) .vega-table-cell{padding:16px}";
3565
+ const vegaTableHeadCellCss = ":host(.v-hidden){display:none}@media (min-width: 320px){:host(.S\\:v-table-cell){display:table-cell}}@media (min-width: 768px){:host(.M\\:v-table-cell){display:table-cell}}@media (min-width: 1024px){:host(.L\\:v-table-cell){display:table-cell}}@media (min-width: 1440px){:host(.XL\\:v-table-cell){display:table-cell}}:host{display:table-cell;background-color:rgba(var(--v-bg-table-header, 240, 243, 247, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;vertical-align:middle}:host(.sortable){cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.sortable:hover){background-color:rgba(var(--v-bg-table-row-hover, 241, 248, 251, 1))}th{display:block;padding:0px;padding:12px;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px;overflow-wrap:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){th{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){th{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){th{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:700;line-height:18px}}th.break-word{word-break:break-word}.vega-table-column{display:flex;align-items:center}.vega-table-column.center{justify-content:center;text-align:center}.vega-table-column.right{justify-content:flex-end;text-align:right}.vega-table-column.left{justify-content:flex-start;text-align:left}.vega-table-column .vega-table-column-label{min-width:0px}.vega-table-column .vega-table-column-sorter{display:flex;align-items:center;justify-content:center;padding:2px;margin-left:8px;cursor:pointer;outline:none}:host(.density-default) .vega-table-cell{padding:12px}:host(.density-compact) .vega-table-cell{padding:4px}:host(.density-relaxed) .vega-table-cell{padding:16px}";
3566
3566
 
3567
3567
  var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3568
3568
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const globalSlimmerRegistry = require('./global-slimmer-registry-dd2691b8.js');
4
- const appGlobals = require('./app-globals-4e819773.js');
4
+ const appGlobals = require('./app-globals-48582633.js');
5
5
  require('./feature-flag-controller-e97b5f29.js');
6
6
  require('./index-8b247c17.js');
7
7
  require('./_commonjsHelpers-537d719a.js');
@@ -28,10 +28,10 @@ require('./translation-f6b7ee84.js');
28
28
  require('./typography-4560e7f1.js');
29
29
  require('./valid-credit-card-number-rule-4a9ae5d9.js');
30
30
  require('./regex-c1f70fd4.js');
31
- require('./text-node-0d12da5a.js');
31
+ require('./text-node-494856f3.js');
32
32
  require('./type-guard-4ba85fdc.js');
33
33
  require('./accessibility-bfa227f6.js');
34
- require('./content-state-3a2724f6.js');
34
+ require('./content-state-6a5b9736.js');
35
35
 
36
36
  /*
37
37
  Stencil Client Patch Browser v2.17.4 | MIT Licensed | https://stenciljs.com
@@ -104,7 +104,6 @@ export class VegaPagination {
104
104
  };
105
105
  this.onPageSizeSelectorChange = (pageSize) => {
106
106
  this.pageSize = pageSize;
107
- this.vegaPageSizeChangeEventEmitter.emit(this.pageSize);
108
107
  };
109
108
  this.calculatePages = () => {
110
109
  if (!this.total) {
@@ -155,7 +154,11 @@ export class VegaPagination {
155
154
  this.currentValueGuard();
156
155
  this.vegaChangeEventEmitter.emit(this.current);
157
156
  }
157
+ watchTotal() {
158
+ this.pageCount = this.calculatePages();
159
+ }
158
160
  watchPageSize() {
161
+ this.vegaPageSizeChangeEventEmitter.emit(this.pageSize);
159
162
  this.pageCount = this.calculatePages();
160
163
  }
161
164
  componentWillLoad() {
@@ -375,7 +378,7 @@ export class VegaPagination {
375
378
  "methodName": "watchCurrent"
376
379
  }, {
377
380
  "propName": "total",
378
- "methodName": "watchPageSize"
381
+ "methodName": "watchTotal"
379
382
  }, {
380
383
  "propName": "pageSize",
381
384
  "methodName": "watchPageSize"
@@ -17,16 +17,6 @@ export class BoldAnnotation extends NodeAnnotation {
17
17
  static from(bold) {
18
18
  return [NodeAnnotationTypeEnum.BOLD, new BoldAnnotation(bold)];
19
19
  }
20
- /**
21
- * Generate the map item for the annotation by html element
22
- *
23
- * @param {HTMLElement} node - An html element.
24
- * @returns {[NodeAnnotationTypeEnum.BOLD, BoldAnnotation]} Map item for the annotation
25
- */
26
- static fromHTML(node) {
27
- const style = node.style;
28
- return this.from(node.nodeName === 'STRONG' || style.fontWeight === 'bold' || style.fontWeight === '700');
29
- }
30
20
  /**
31
21
  * Generate the JSON representation of the annotation
32
22
  *
@@ -17,15 +17,6 @@ export class CodeAnnotation extends NodeAnnotation {
17
17
  static from(code) {
18
18
  return [NodeAnnotationTypeEnum.CODE, new CodeAnnotation(code)];
19
19
  }
20
- /**
21
- * Generate the map item for the annotation by html element
22
- *
23
- * @param {HTMLElement} node - An html element.
24
- * @returns {[NodeAnnotationTypeEnum.CODE, CodeAnnotation]} Map item for the annotation
25
- */
26
- static fromHTML(node) {
27
- return this.from(node.classList.contains('v-rte--code') || node.nodeName === 'CODE');
28
- }
29
20
  /**
30
21
  * Generate the JSON representation of the annotation
31
22
  *
@@ -17,50 +17,6 @@ export class HorizontalAlignmentAnnotation extends BlockAnnotation {
17
17
  static from(textAlign) {
18
18
  return [BlockAnnotationTypeEnum.ALIGNMENT, new HorizontalAlignmentAnnotation(textAlign)];
19
19
  }
20
- /**
21
- * Generate the map item for the annotation by html element
22
- *
23
- * @param {HTMLElement} node - An html element.
24
- * @returns {[BlockAnnotationTypeEnum.ALIGNMENT, HorizontalAlignmentAnnotation]} Map item for the annotation
25
- */
26
- static fromHTML(node) {
27
- const alignment = this.getTextAlign(node);
28
- return alignment ? this.from(alignment) : null;
29
- }
30
- /**
31
- * Get the text alignment of an HTML element.
32
- *
33
- * @param {HTMLElement} node - An HTMLElement.
34
- * @returns {Nullable<VegaRTEBlockAlignment>} text alignment.
35
- */
36
- static getTextAlign(node) {
37
- const classList = node.classList;
38
- if (classList.contains(`v-rte--horizontal-alignment-left`)) {
39
- return 'left';
40
- }
41
- else if (classList.contains(`v-rte--horizontal-alignment-center`)) {
42
- return 'center';
43
- }
44
- else if (classList.contains(`v-rte--horizontal-alignment-right`)) {
45
- return 'right';
46
- }
47
- else if (classList.contains(`v-rte--horizontal-alignment-justify`)) {
48
- return 'justify';
49
- }
50
- const style = node.style;
51
- switch (style.textAlign) {
52
- case 'center':
53
- return 'center';
54
- case 'right':
55
- return 'right';
56
- case 'justify':
57
- return 'justify';
58
- case 'left':
59
- return 'left';
60
- default:
61
- return null;
62
- }
63
- }
64
20
  /**
65
21
  * Generate the JSON item of the annotation
66
22
  *
@@ -20,16 +20,6 @@ export class ImageAnnotation extends NodeAnnotation {
20
20
  static from(size, alt) {
21
21
  return [NodeAnnotationTypeEnum.IMAGE, new ImageAnnotation(size, alt)];
22
22
  }
23
- /**
24
- * Generate the map item for the annotation
25
- *
26
- * @param {VegaRichTextImageEditorSizeType} size - size.
27
- * @param {string} alt - alt.
28
- * @returns {[NodeAnnotationTypeEnum.IMAGE, ImageAnnotation]} Map item for the annotation
29
- */
30
- static fromHTML(size, alt) {
31
- return this.from(size || 'md', alt);
32
- }
33
23
  /**
34
24
  * Generate the JSON representation of the annotation
35
25
  *
@@ -17,48 +17,6 @@ export class IndentAnnotation extends BlockAnnotation {
17
17
  static from(indent) {
18
18
  return [BlockAnnotationTypeEnum.INDENT, new IndentAnnotation(indent)];
19
19
  }
20
- /**
21
- * Generate the map item for the annotation by html element
22
- *
23
- * @param {HTMLElement} node - An html element.
24
- * @returns {[BlockAnnotationTypeEnum.INDENT, IndentAnnotation]} Map item for the annotation
25
- */
26
- static fromHTML(node) {
27
- const marginLeft = this.getMarginLeft(node);
28
- return marginLeft && marginLeft >= 0 ? this.from(Math.floor(marginLeft / 16)) : null;
29
- }
30
- /**
31
- * Retrieves the left margin value of an HTML element.
32
- *
33
- * @param {HTMLElement} node - An html element.
34
- * @returns {number} margin left.
35
- */
36
- static getMarginLeft(node) {
37
- const style = node.style;
38
- let marginLeft;
39
- if (style.marginLeft) {
40
- marginLeft = style.marginLeft;
41
- }
42
- else if (style.margin) {
43
- const margins = style.margin.split(' ');
44
- switch (margins.length) {
45
- case 4:
46
- marginLeft = margins[3];
47
- break;
48
- case 2:
49
- case 3:
50
- marginLeft = margins[1];
51
- break;
52
- default:
53
- marginLeft = margins[0];
54
- break;
55
- }
56
- }
57
- else {
58
- return null;
59
- }
60
- return Number(marginLeft.replace('px', ''));
61
- }
62
20
  /**
63
21
  * Generate the JSON item of the annotation
64
22
  *
@@ -17,15 +17,6 @@ export class ItalicAnnotation extends NodeAnnotation {
17
17
  static from(italic) {
18
18
  return [NodeAnnotationTypeEnum.ITALIC, new ItalicAnnotation(italic)];
19
19
  }
20
- /**
21
- * Generate the map item for the annotation by html element
22
- *
23
- * @param {HTMLElement} node - An html element.
24
- * @returns {[NodeAnnotationTypeEnum.ITALIC, ItalicAnnotation]} Map item for the annotation
25
- */
26
- static fromHTML(node) {
27
- return this.from(node.nodeName === 'I' || node.style.fontStyle === 'italic' || node.nodeName === 'EM');
28
- }
29
20
  /**
30
21
  * Generate the JSON representation of the annotation
31
22
  *
@@ -20,20 +20,6 @@ export class LinkAnnotation extends NodeAnnotation {
20
20
  new LinkAnnotation({ href: link.href, groupKey: link.groupKey }),
21
21
  ];
22
22
  }
23
- /**
24
- * Generate the map item for the annotation by html element
25
- *
26
- * @param {HTMLElement} node - An html element.
27
- * @returns {[NodeAnnotationTypeEnum.LINK, LinkAnnotation]} Map item for the annotation
28
- */
29
- static fromHTML(node) {
30
- return node.hasAttribute('data-href')
31
- ? this.from({
32
- href: node.getAttribute('data-href'),
33
- groupKey: node.getAttribute('data-group-key'),
34
- })
35
- : null;
36
- }
37
23
  /**
38
24
  * Generate the JSON representation of the annotation
39
25
  *
@@ -17,17 +17,6 @@ export class StrikethroughAnnotation extends NodeAnnotation {
17
17
  static from(strikethrough) {
18
18
  return [NodeAnnotationTypeEnum.STRIKETHROUGH, new StrikethroughAnnotation(strikethrough)];
19
19
  }
20
- /**
21
- * Generate the map item for the annotation by html element
22
- *
23
- * @param {HTMLElement} node - An html element.
24
- * @returns {[NodeAnnotationTypeEnum.STRIKETHROUGH, StrikethroughAnnotation]} Map item for the annotation
25
- */
26
- static fromHTML(node) {
27
- return this.from(node.style.textDecoration.includes('line-through') ||
28
- node.nodeName === 'S' ||
29
- node.classList.contains('v-rte--strikethrough'));
30
- }
31
20
  /**
32
21
  * Generate the JSON representation of the annotation
33
22
  *
@@ -1,6 +1,5 @@
1
1
  import { NodeAnnotation, NodeAnnotationTypeEnum } from './node-annotation.abstract';
2
2
  import { RTE_TEXT_COLORS } from '../../constants/constant';
3
- import { rgbToHex } from '../../../../utils/ui';
4
3
  import { VegaThemeManager } from '../../../../helpers/theme/theme-manager';
5
4
  /**
6
5
  * Annotation to make text with text color
@@ -20,31 +19,6 @@ export class TextColorAnnotation extends NodeAnnotation {
20
19
  static from(textColor) {
21
20
  return [NodeAnnotationTypeEnum.TEXT_COLOR, new TextColorAnnotation(textColor)];
22
21
  }
23
- /**
24
- * Generate the map item for the annotation by html element
25
- *
26
- * @param {HTMLElement} node - An html element.
27
- * @returns {[NodeAnnotationTypeEnum.TEXT_COLOR, TextColorAnnotation]} Map item for the annotation
28
- */
29
- static fromHTML(node) {
30
- var _a;
31
- const color = node.style.color;
32
- const hexColor = (_a = rgbToHex(color)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
33
- if (hexColor) {
34
- const colorSchema = RTE_TEXT_COLORS.find((schema) => schema.light === hexColor || schema.dark === hexColor);
35
- if (colorSchema)
36
- return this.from(colorSchema.key);
37
- return null;
38
- }
39
- else {
40
- for (const color of RTE_TEXT_COLORS) {
41
- if (node.style.color.includes(color.key)) {
42
- return this.from(color.key);
43
- }
44
- }
45
- return null;
46
- }
47
- }
48
22
  /**
49
23
  * Generate the JSON representation of the annotation
50
24
  *
@@ -17,50 +17,6 @@ export class TextStyleAnnotation extends BlockAnnotation {
17
17
  static from(textStyle) {
18
18
  return [BlockAnnotationTypeEnum.TEXT_STYLE, new TextStyleAnnotation(textStyle)];
19
19
  }
20
- /**
21
- * Generate the map item for the annotation by html element
22
- *
23
- * @param {HTMLElement} node - An html element.
24
- * @returns {[BlockAnnotationTypeEnum.TEXT_STYLE, TextStyleAnnotation]} Map item for the annotation
25
- */
26
- static fromHTML(node) {
27
- return this.from(this.getTextStyle(node));
28
- }
29
- /**
30
- * Get the type of block.
31
- *
32
- * @param {HTMLElement} node - An HTMLElement.
33
- * @returns {VegaRTETextStyleType} text style type.
34
- */
35
- static getTextStyle(node) {
36
- if (node.nodeType !== Node.TEXT_NODE && node.hasAttribute('data-type')) {
37
- return node.getAttribute('data-type');
38
- }
39
- switch (node.style.fontSize) {
40
- case '36px':
41
- return 'title';
42
- case '28px':
43
- return 'subtitle';
44
- case '22px':
45
- return 'heading-1';
46
- case '20px':
47
- return 'heading-2';
48
- case '18px':
49
- return 'heading-3';
50
- default:
51
- break;
52
- }
53
- switch (node.nodeName) {
54
- case 'H1':
55
- return 'heading-1';
56
- case 'H2':
57
- return 'heading-2';
58
- case 'H3':
59
- return 'heading-3';
60
- default:
61
- return 'paragraph';
62
- }
63
- }
64
20
  /**
65
21
  * Generate the JSON representation of the annotation
66
22
  *
@@ -17,17 +17,6 @@ export class UnderlineAnnotation extends NodeAnnotation {
17
17
  static from(underline) {
18
18
  return [NodeAnnotationTypeEnum.UNDERLINE, new UnderlineAnnotation(underline)];
19
19
  }
20
- /**
21
- * Generate the map item for the annotation by html element
22
- *
23
- * @param {HTMLElement} node - An html element.
24
- * @returns {[NodeAnnotationTypeEnum.UNDERLINE, UnderlineAnnotation]} Map item for the annotation
25
- */
26
- static fromHTML(node) {
27
- return this.from(node.style.textDecoration.includes('underline') ||
28
- node.nodeName === 'U' ||
29
- node.classList.contains('v-rte--underline'));
30
- }
31
20
  /**
32
21
  * Generate the JSON representation of the annotation
33
22
  *
@@ -11,7 +11,6 @@ import { BlockBaseOperator } from '../helper/block-base-operator';
11
11
  import { AppendChildNodesAction } from '../actions/append-child-nodes-action';
12
12
  import { RemoveChildAction } from '../actions/remove-child-action';
13
13
  import { ZERO_WIDTH_SPACE } from '../../constants/constant';
14
- import { TextStyleAnnotation } from '../annotations/text-style-annotation';
15
14
  /**
16
15
  * Abstract class for block
17
16
  */
@@ -41,23 +40,6 @@ export class RTEBlock extends BlockBaseOperator {
41
40
  return IndentAnnotation.from(value);
42
41
  }
43
42
  }
44
- /**
45
- * Create annotations for block element.
46
- *
47
- * @param {string} type - Annotations type.
48
- * @param {HTMLElement} node - current node.
49
- * @returns {Nullable<[BlockAnnotationTypeEnum, BlockAnnotation]>} - result.
50
- */
51
- static createAnnotationEntityFromHTML(type, node) {
52
- switch (type) {
53
- case 'ALIGNMENT':
54
- return HorizontalAlignmentAnnotation.fromHTML(node);
55
- case 'TEXT_STYLE':
56
- return TextStyleAnnotation.fromHTML(node);
57
- case 'INDENT':
58
- return IndentAnnotation.fromHTML(node);
59
- }
60
- }
61
43
  /**
62
44
  * Class to JSON object
63
45
  *
@@ -4,7 +4,6 @@ import { RTEImageNode } from '../nodes/image-node';
4
4
  import stateEntityRenderingRegistry from '../../slimmers/controllers/state-entity-rendering-registry';
5
5
  import { ModifyContentActionType } from '../actions/modify-content-action.abstract';
6
6
  import { RemoveChildAction } from '../actions/remove-child-action';
7
- import { BlockAnnotationTypeEnum } from '../annotations/block-annotation.abstract';
8
7
  import { isNonNullable } from '../../../../types/type-guard';
9
8
  import { AppendChildNodesAction } from '../actions/append-child-nodes-action';
10
9
  import { ReplaceChildNodesAction } from '../actions/replace-child-nodes-action';
@@ -37,18 +36,6 @@ export class RTEImageBlock extends RTEBlock {
37
36
  }
38
37
  return imageBlock;
39
38
  }
40
- static fromHTML(node) {
41
- const nodes = node.nodeName === 'IMG' ? [node] : Array.from(node.children);
42
- const imageBlock = new RTEImageBlock(generateUUID());
43
- imageBlock.nodes = nodes.map((item) => RTEImageNode.fromHTML(item, imageBlock));
44
- Object.keys(BlockAnnotationTypeEnum).forEach((type) => {
45
- const item = this.createAnnotationEntityFromHTML(type, node);
46
- if (isNonNullable(item)) {
47
- imageBlock.annotationMap.set(...item);
48
- }
49
- });
50
- return imageBlock;
51
- }
52
39
  toJSON() {
53
40
  return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.nodes.map((node) => node.toJSON()) });
54
41
  }
@@ -11,8 +11,6 @@ import { AppendChildNodesAction } from '../actions/append-child-nodes-action';
11
11
  import { InsertBlocksBeforeAction } from '../actions/insert-blocks-before-block';
12
12
  import { SyncUpSelectionAction } from '../actions/sync-up-selection-action';
13
13
  import { RemoveNestListAction } from '../actions/remove-nest-list-action';
14
- import { BlockAnnotationTypeEnum } from '../annotations/block-annotation.abstract';
15
- import { isNonNullable } from '../../../../types/type-guard';
16
14
  export class RTEListBlock extends RTEBlock {
17
15
  constructor(id, type) {
18
16
  super(id);
@@ -29,23 +27,6 @@ export class RTEListBlock extends RTEBlock {
29
27
  });
30
28
  return listBlock;
31
29
  }
32
- static fromHTML(node) {
33
- const listBlock = new RTEListBlock(generateUUID(), node.nodeName === 'UL' ? 'bullet-list' : 'number-list');
34
- listBlock.blocks = Array.from(node.children)
35
- .map((item) => {
36
- const listItemBlock = RTEListItemBlock.fromHTML(item);
37
- listItemBlock && (listItemBlock.parent = listBlock);
38
- return listItemBlock;
39
- })
40
- .filter(Boolean);
41
- Object.keys(BlockAnnotationTypeEnum).forEach((type) => {
42
- const item = this.createAnnotationEntityFromHTML(type, node);
43
- if (isNonNullable(item)) {
44
- listBlock.annotationMap.set(...item);
45
- }
46
- });
47
- return listBlock;
48
- }
49
30
  toJSON() {
50
31
  return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.blocks.map((block) => block.toJSON()) });
51
32
  }
@@ -8,7 +8,6 @@ import { SplitBlockWithNodeAction } from '../actions/split-block-with-node-actio
8
8
  import { RTETextBlock } from './text-block';
9
9
  import { InsertBlocksAfterAction } from '../actions/insert-blocks-after-block';
10
10
  import { InsertBlocksBeforeAction } from '../actions/insert-blocks-before-block';
11
- import { BlockAnnotationTypeEnum } from '../annotations/block-annotation.abstract';
12
11
  import { isNonNullable } from '../../../../types/type-guard';
13
12
  import { NodeAnnotationTypeEnum } from '../annotations/node-annotation.abstract';
14
13
  export class RTEListItemBlock extends RTETextBlock {
@@ -38,32 +37,6 @@ export class RTEListItemBlock extends RTETextBlock {
38
37
  }
39
38
  return listItemBlock;
40
39
  }
41
- static fromHTML(node) {
42
- const listItem = new RTEListItemBlock(generateUUID());
43
- listItem.nodes = Array.from(node.childNodes)
44
- .map((item) => {
45
- if (!['UL', 'OL'].includes(item.nodeName)) {
46
- return RTETextNode.fromHTML(item, listItem);
47
- }
48
- })
49
- .filter(Boolean);
50
- listItem.children = Array.from(node.childNodes)
51
- .map((item) => {
52
- if (['UL', 'OL'].includes(item.nodeName)) {
53
- const listBlock = RTEListBlock.fromHTML(item);
54
- listBlock && (listBlock.parent = listItem);
55
- return listBlock;
56
- }
57
- })
58
- .filter(Boolean);
59
- Object.keys(BlockAnnotationTypeEnum).forEach((type) => {
60
- const item = this.createAnnotationEntityFromHTML(type, node);
61
- if (isNonNullable(item)) {
62
- listItem.annotationMap.set(...item);
63
- }
64
- });
65
- return listItem;
66
- }
67
40
  toJSON() {
68
41
  var _a;
69
42
  return Object.assign(Object.assign({}, super.toJSON()), { type: 'list-item', children: (_a = this.children) === null || _a === void 0 ? void 0 : _a.map((block) => block.toJSON()) });
@@ -2,7 +2,6 @@ import { h } from '@stencil/core';
2
2
  import { RTETextNode } from '../nodes/text-node';
3
3
  import stateEntityRenderingRegistry from '../../slimmers/controllers/state-entity-rendering-registry';
4
4
  import { isNonNullable } from '../../../../types/type-guard';
5
- import { BlockAnnotationTypeEnum } from '../annotations/block-annotation.abstract';
6
5
  import { TextStyleAnnotation } from '../annotations/text-style-annotation';
7
6
  import { ModifyContentActionType } from '../actions/modify-content-action.abstract';
8
7
  import { RemoveChildAction } from '../actions/remove-child-action';
@@ -31,10 +30,10 @@ export class RTETextBlock extends RTEBlock {
31
30
  this.nodes = [];
32
31
  this.type = type;
33
32
  if (RTETextBlock.isAcceptableTextStyle(type)) {
34
- super.annotationMap = new Map([TextStyleAnnotation.from(type)]);
33
+ this.annotationMap = new Map([TextStyleAnnotation.from(type)]);
35
34
  }
36
35
  else {
37
- super.annotationMap = new Map([TextStyleAnnotation.from('paragraph')]);
36
+ this.annotationMap = new Map([TextStyleAnnotation.from('paragraph')]);
38
37
  }
39
38
  }
40
39
  static from(block) {
@@ -51,17 +50,6 @@ export class RTETextBlock extends RTEBlock {
51
50
  }
52
51
  return textBlock;
53
52
  }
54
- static fromHTML(node, blockType) {
55
- const textBlock = new RTETextBlock(generateUUID(), blockType);
56
- textBlock.nodes = Array.from(node.childNodes).map((item) => RTETextNode.fromHTML(item, textBlock));
57
- Object.keys(BlockAnnotationTypeEnum).forEach((type) => {
58
- const item = this.createAnnotationEntityFromHTML(type, node);
59
- if (isNonNullable(item)) {
60
- textBlock.annotationMap.set(...item);
61
- }
62
- });
63
- return textBlock;
64
- }
65
53
  /**
66
54
  * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
67
55
  * and value.
@@ -8,7 +8,6 @@ import { NodeAnnotationTypeEnum } from '../annotations/node-annotation.abstract'
8
8
  import { isNonNullable } from '../../../../types/type-guard';
9
9
  import { DomNodeSubjectObserverFactory } from '../../../../helpers/change-manager/subject/dom-node-subject/dom-node-subject-observer-factory';
10
10
  import { VegaChange } from '../../../../helpers/event-manager/event-id/vega-event-id';
11
- import { generateUUID } from '../../../../utils/misc';
12
11
  export class RTEImageNode extends RTENode {
13
12
  constructor(id, url, parentBlock, annotationMap) {
14
13
  super(id, annotationMap);
@@ -30,15 +29,6 @@ export class RTEImageNode extends RTENode {
30
29
  .filter(isNonNullable));
31
30
  return imageNode;
32
31
  }
33
- static fromHTML(node, parentBlock) {
34
- const src = node.nodeName === 'IMG'
35
- ? node.src
36
- : node.querySelector('img').src;
37
- const size = node.size;
38
- const imageNode = new RTEImageNode(generateUUID(), src, parentBlock);
39
- imageNode.annotationMap = new Map([ImageAnnotation.fromHTML(size, node.alt)]);
40
- return imageNode;
41
- }
42
32
  toJSON() {
43
33
  const imageAnnotation = this.annotationMap.get(NodeAnnotationTypeEnum.IMAGE);
44
34
  const annotations = {};
@@ -50,20 +50,6 @@ export class RTETextNode extends RTENode {
50
50
  }
51
51
  return textNode;
52
52
  }
53
- static fromHTML(node, parentBlock) {
54
- const textNode = new RTETextNode(generateUUID(), node.textContent, parentBlock);
55
- if (node.nodeType !== Node.TEXT_NODE) {
56
- textNode.annotationMap = new Map(Object.keys(NodeAnnotationTypeEnum)
57
- .map((nodeAnnotationType) => {
58
- return this.createAnnotationEntityFromHTML(nodeAnnotationType, node);
59
- })
60
- .filter(isNonNullable));
61
- if (node.hasAttribute('data-group-key')) {
62
- parentBlock.apply(new LinkGroupAnnotationAction(node.getAttribute('data-group-key'), [textNode]));
63
- }
64
- }
65
- return textNode;
66
- }
67
53
  static createAnnotationEntity(type, value) {
68
54
  switch (type) {
69
55
  case 'bold':
@@ -82,24 +68,6 @@ export class RTETextNode extends RTENode {
82
68
  return LinkAnnotation.from(value);
83
69
  }
84
70
  }
85
- static createAnnotationEntityFromHTML(type, node) {
86
- switch (type) {
87
- case 'BOLD':
88
- return BoldAnnotation.fromHTML(node);
89
- case 'ITALIC':
90
- return ItalicAnnotation.fromHTML(node);
91
- case 'UNDERLINE':
92
- return UnderlineAnnotation.fromHTML(node);
93
- case 'STRIKETHROUGH':
94
- return StrikethroughAnnotation.fromHTML(node);
95
- case 'CODE':
96
- return CodeAnnotation.fromHTML(node);
97
- case 'TEXT_COLOR':
98
- return TextColorAnnotation.fromHTML(node);
99
- case 'LINK':
100
- return LinkAnnotation.fromHTML(node);
101
- }
102
- }
103
71
  toJSON() {
104
72
  const annotations = Array.from(this.annotationMap.values())
105
73
  .filter((annotation) => annotation instanceof NodeAnnotation)