@globalpayments/vega 2.45.0 → 2.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1357) hide show
  1. package/dist/cjs/app-globals-981f7aba.js +334 -0
  2. package/dist/cjs/child-nodes-event-prevent-slimmer-37870b2e.js +158 -0
  3. package/dist/cjs/child-nodes-notify-observer-slimmer-5817a53b.js +90 -0
  4. package/dist/cjs/content-state-605de6a3.js +3628 -0
  5. package/dist/cjs/country-flags-dc0f0d09.js +2403 -0
  6. package/dist/cjs/dark-mode-state-controller-slimmer-2af3e67c.js +51 -0
  7. package/dist/cjs/dark-mode-style-controller-c93b94d2.js +3467 -0
  8. package/dist/cjs/design-token-117a19a8.js +403 -0
  9. package/dist/cjs/dom-node-subject-factory-d5826bff.js +252 -0
  10. package/dist/cjs/dom-node-subject-observer-factory-a7a3b196.js +45 -0
  11. package/dist/cjs/element-appender-slimmer-4bdbd76d.js +1466 -0
  12. package/dist/cjs/event-emit-slimmer-8247249c.js +266 -0
  13. package/dist/cjs/form-field-controller-slimmer-6d69c74f.js +1256 -0
  14. package/dist/cjs/image-annotation-action-5e3aa73c.js +277 -0
  15. package/dist/cjs/index-09acd3c9.js +8 -0
  16. package/dist/cjs/index-ec9a1f36.js +43 -0
  17. package/dist/cjs/index.cjs.js +22 -20
  18. package/dist/cjs/internal-icon-manager-00f49470.js +55 -0
  19. package/dist/cjs/internal-vega-event-manager-c9948b59.js +475 -0
  20. package/dist/cjs/loader.cjs.js +16 -14
  21. package/dist/cjs/observer-f49483e8.js +32 -0
  22. package/dist/cjs/public-rules-66f53e7e.js +43 -0
  23. package/dist/cjs/remote-invocation-registry-fc22fdd0.js +65 -0
  24. package/dist/cjs/responsive-format-facade-3542fc47.js +923 -0
  25. package/dist/cjs/rich-text-editor-required-rule-649ef4b4.js +64 -0
  26. package/dist/cjs/static-subject-title-1d23c102.js +79 -0
  27. package/dist/cjs/string-input-formatter-slimmer-56a2401f.js +434 -0
  28. package/dist/cjs/style-formatter-b735d506.js +34 -0
  29. package/dist/cjs/sub-state-notify-slimmer-b16c9094.js +81 -0
  30. package/dist/cjs/sub-state-observer-slimmer-1b6de09f.js +134 -0
  31. package/dist/cjs/translation-5173d223.js +339 -0
  32. package/dist/cjs/translation-slimmer-e900e8d4.js +42 -0
  33. package/dist/cjs/vega-accordion.cjs.entry.js +16 -14
  34. package/dist/cjs/vega-app-footer.cjs.entry.js +40 -7
  35. package/dist/cjs/vega-app-header-button.cjs.entry.js +18 -16
  36. package/dist/cjs/vega-banner.cjs.entry.js +6 -5
  37. package/dist/cjs/vega-box.cjs.entry.js +14 -12
  38. package/dist/cjs/vega-brand-logo.cjs.entry.js +232 -0
  39. package/dist/cjs/vega-breadcrumb.cjs.entry.js +6 -5
  40. package/dist/cjs/vega-button-circle.cjs.entry.js +16 -14
  41. package/dist/cjs/vega-button-group_2.cjs.entry.js +11 -10
  42. package/dist/cjs/vega-button-link.cjs.entry.js +14 -11
  43. package/dist/cjs/vega-button.cjs.entry.js +15 -13
  44. package/dist/cjs/vega-calendar_3.cjs.entry.js +13 -12
  45. package/dist/cjs/vega-card.cjs.entry.js +13 -11
  46. package/dist/cjs/vega-carousel.cjs.entry.js +15 -13
  47. package/dist/cjs/vega-checkbox_2.cjs.entry.js +15 -13
  48. package/dist/cjs/vega-chip.cjs.entry.js +17 -15
  49. package/dist/cjs/vega-color-picker.cjs.entry.js +20 -15
  50. package/dist/cjs/vega-combo-box.cjs.entry.js +12 -10
  51. package/dist/cjs/vega-date-picker_2.cjs.entry.js +22 -19
  52. package/dist/cjs/vega-dialog_2.cjs.entry.js +15 -13
  53. package/dist/cjs/vega-divider.cjs.entry.js +13 -11
  54. package/dist/cjs/vega-dropdown_5.cjs.entry.js +282 -187
  55. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  56. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  57. package/dist/cjs/vega-field-label.cjs.entry.js +5 -4
  58. package/dist/cjs/vega-file-uploader.cjs.entry.js +12 -10
  59. package/dist/cjs/vega-flag-icon.cjs.entry.js +207 -0
  60. package/dist/cjs/vega-flex.cjs.entry.js +12 -10
  61. package/dist/cjs/vega-font.cjs.entry.js +13 -11
  62. package/dist/cjs/vega-form.cjs.entry.js +71 -15
  63. package/dist/cjs/vega-grid.cjs.entry.js +13 -11
  64. package/dist/cjs/vega-icon.cjs.entry.js +13 -11
  65. package/dist/cjs/vega-image-uploader.cjs.entry.js +18 -15
  66. package/dist/cjs/vega-input-credit-card.cjs.entry.js +12 -10
  67. package/dist/cjs/vega-input-numeric.cjs.entry.js +12 -10
  68. package/dist/cjs/vega-input-phone-number.cjs.entry.js +86 -2472
  69. package/dist/cjs/vega-input-range.cjs.entry.js +13 -11
  70. package/dist/cjs/vega-input-select.cjs.entry.js +133 -73
  71. package/dist/cjs/vega-input.cjs.entry.js +13 -12
  72. package/dist/cjs/vega-internal-event-id-dc866d43.js +80 -0
  73. package/dist/cjs/vega-item-toggle.cjs.entry.js +5 -4
  74. package/dist/cjs/vega-left-nav_5.cjs.entry.js +32 -20
  75. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +12 -10
  76. package/dist/cjs/vega-page-notification_2.cjs.entry.js +3 -2
  77. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +6 -5
  78. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +7 -6
  79. package/dist/cjs/vega-pagination.cjs.entry.js +16 -14
  80. package/dist/cjs/vega-popover_2.cjs.entry.js +15 -13
  81. package/dist/cjs/vega-progress-tracker.cjs.entry.js +6 -5
  82. package/dist/cjs/vega-radio_2.cjs.entry.js +15 -13
  83. package/dist/cjs/vega-rich-text-content.cjs.entry.js +13 -11
  84. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +136 -176
  85. package/dist/cjs/vega-segment-control.cjs.entry.js +5 -4
  86. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +18 -16
  87. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +14 -13
  88. package/dist/cjs/vega-sidenav_3.cjs.entry.js +18 -16
  89. package/dist/cjs/vega-signature-capture.cjs.entry.js +19 -16
  90. package/dist/cjs/vega-skeleton-loader-controller-8cbd7656.js +1291 -0
  91. package/dist/cjs/vega-stepper.cjs.entry.js +12 -10
  92. package/dist/cjs/vega-tab-group_2.cjs.entry.js +9 -8
  93. package/dist/cjs/vega-table_8.cjs.entry.js +30 -28
  94. package/dist/cjs/vega-textarea.cjs.entry.js +12 -10
  95. package/dist/cjs/vega-time-picker_2.cjs.entry.js +19 -16
  96. package/dist/cjs/vega-toggle-switch.cjs.entry.js +11 -9
  97. package/dist/cjs/vega-tooltip_2.cjs.entry.js +14 -12
  98. package/dist/cjs/vega.cjs.js +16 -14
  99. package/dist/collection/collection-manifest.json +12 -0
  100. package/dist/collection/components/vega-app-footer/vega-app-footer.css +3 -4
  101. package/dist/collection/components/vega-app-footer/vega-app-footer.js +40 -13
  102. package/dist/collection/components/vega-app-header-button/vega-app-header-button.css +9 -4
  103. package/dist/collection/components/vega-brand-logo/assets/dark-mode/g-symbol-large.js +4 -0
  104. package/dist/collection/components/vega-brand-logo/assets/dark-mode/g-symbol-medium.js +4 -0
  105. package/dist/collection/components/vega-brand-logo/assets/dark-mode/g-symbol-small.js +4 -0
  106. package/dist/collection/components/vega-brand-logo/assets/dark-mode/genius-large.js +4 -0
  107. package/dist/collection/components/vega-brand-logo/assets/dark-mode/genius-medium.js +4 -0
  108. package/dist/collection/components/vega-brand-logo/assets/dark-mode/genius-small.js +4 -0
  109. package/dist/collection/components/vega-brand-logo/assets/dark-mode/global-payments-large.js +4 -0
  110. package/dist/collection/components/vega-brand-logo/assets/dark-mode/global-payments-medium.js +4 -0
  111. package/dist/collection/components/vega-brand-logo/assets/dark-mode/global-payments-small.js +4 -0
  112. package/dist/collection/components/vega-brand-logo/assets/index.js +18 -0
  113. package/dist/collection/components/vega-brand-logo/assets/light-mode/g-symbol-large.js +4 -0
  114. package/dist/collection/components/vega-brand-logo/assets/light-mode/g-symbol-medium.js +4 -0
  115. package/dist/collection/components/vega-brand-logo/assets/light-mode/g-symbol-small.js +4 -0
  116. package/dist/collection/components/vega-brand-logo/assets/light-mode/genius-large.js +4 -0
  117. package/dist/collection/components/vega-brand-logo/assets/light-mode/genius-medium.js +4 -0
  118. package/dist/collection/components/vega-brand-logo/assets/light-mode/genius-small.js +4 -0
  119. package/dist/collection/components/vega-brand-logo/assets/light-mode/global-payments-large.js +4 -0
  120. package/dist/collection/components/vega-brand-logo/assets/light-mode/global-payments-medium.js +4 -0
  121. package/dist/collection/components/vega-brand-logo/assets/light-mode/global-payments-small.js +4 -0
  122. package/dist/collection/components/vega-brand-logo/slimmers/renderers/vega-brand-logo-renderer.js +62 -0
  123. package/dist/collection/components/vega-brand-logo/vega-brand-logo.css +8 -0
  124. package/dist/collection/components/vega-brand-logo/vega-brand-logo.js +140 -0
  125. package/dist/collection/components/vega-button/vega-button.css +11 -6
  126. package/dist/collection/components/vega-button-circle/vega-button-circle.css +15 -10
  127. package/dist/collection/components/vega-button-group/vega-button-group-item/vega-button-group-item.css +11 -12
  128. package/dist/collection/components/vega-button-group/vega-button-group.css +0 -2
  129. package/dist/collection/components/vega-button-link/vega-button-link.css +21 -37
  130. package/dist/collection/components/vega-button-link/vega-button-link.js +7 -6
  131. package/dist/collection/components/vega-carousel/vega-carousel.css +2 -1
  132. package/dist/collection/components/vega-checkbox/vega-checkbox.css +4 -6
  133. package/dist/collection/components/vega-chip/vega-chip.css +5 -4
  134. package/dist/collection/components/vega-color-picker/vega-color-picker.css +14 -8
  135. package/dist/collection/components/vega-color-picker/vega-color-picker.js +9 -6
  136. package/dist/collection/components/vega-combo-box/vega-combo-box.css +4 -2
  137. package/dist/collection/components/vega-date-picker/vega-date-picker.css +6 -4
  138. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-scrollable-controller.js +34 -5
  139. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-selected-controller.js +13 -0
  140. package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-renderer.js +5 -4
  141. package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-reset-renderer.js +31 -0
  142. package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-search-renderer.js +19 -15
  143. package/dist/collection/components/vega-dropdown/vega-dropdown-content-box/vega-dropdown-content-box.css +34 -21
  144. package/dist/collection/components/vega-dropdown/vega-dropdown.js +77 -1
  145. package/dist/collection/components/vega-flag-icon/assets/flags/ac.js +692 -0
  146. package/dist/collection/components/vega-flag-icon/assets/flags/ad.js +4 -0
  147. package/dist/collection/components/vega-flag-icon/assets/flags/ae.js +4 -0
  148. package/dist/collection/components/vega-flag-icon/assets/flags/af.js +4 -0
  149. package/dist/collection/components/vega-flag-icon/assets/flags/ag.js +4 -0
  150. package/dist/collection/components/vega-flag-icon/assets/flags/ai.js +4 -0
  151. package/dist/collection/components/vega-flag-icon/assets/flags/al.js +4 -0
  152. package/dist/collection/components/vega-flag-icon/assets/flags/am.js +4 -0
  153. package/dist/collection/components/vega-flag-icon/assets/flags/ao.js +4 -0
  154. package/dist/collection/components/vega-flag-icon/assets/flags/ar.js +4 -0
  155. package/dist/collection/components/vega-flag-icon/assets/flags/as.js +4 -0
  156. package/dist/collection/components/vega-flag-icon/assets/flags/at.js +4 -0
  157. package/dist/collection/components/vega-flag-icon/assets/flags/au.js +4 -0
  158. package/dist/collection/components/vega-flag-icon/assets/flags/aw.js +4 -0
  159. package/dist/collection/components/vega-flag-icon/assets/flags/ax.js +4 -0
  160. package/dist/collection/components/vega-flag-icon/assets/flags/az.js +4 -0
  161. package/dist/collection/components/vega-flag-icon/assets/flags/ba.js +4 -0
  162. package/dist/collection/components/vega-flag-icon/assets/flags/bb.js +4 -0
  163. package/dist/collection/components/vega-flag-icon/assets/flags/bd.js +4 -0
  164. package/dist/collection/components/vega-flag-icon/assets/flags/be.js +4 -0
  165. package/dist/collection/components/vega-flag-icon/assets/flags/bf.js +4 -0
  166. package/dist/collection/components/vega-flag-icon/assets/flags/bg.js +4 -0
  167. package/dist/collection/components/vega-flag-icon/assets/flags/bh.js +4 -0
  168. package/dist/collection/components/vega-flag-icon/assets/flags/bi.js +4 -0
  169. package/dist/collection/components/vega-flag-icon/assets/flags/bj.js +4 -0
  170. package/dist/collection/components/vega-flag-icon/assets/flags/bl.js +4 -0
  171. package/dist/collection/components/vega-flag-icon/assets/flags/bm.js +4 -0
  172. package/dist/collection/components/vega-flag-icon/assets/flags/bn.js +4 -0
  173. package/dist/collection/components/vega-flag-icon/assets/flags/bo.js +4 -0
  174. package/dist/collection/components/vega-flag-icon/assets/flags/bq.js +4 -0
  175. package/dist/collection/components/vega-flag-icon/assets/flags/br.js +4 -0
  176. package/dist/collection/components/vega-flag-icon/assets/flags/bs.js +4 -0
  177. package/dist/collection/components/vega-flag-icon/assets/flags/bt.js +4 -0
  178. package/dist/collection/components/vega-flag-icon/assets/flags/bw.js +4 -0
  179. package/dist/collection/components/vega-flag-icon/assets/flags/by.js +4 -0
  180. package/dist/collection/components/vega-flag-icon/assets/flags/bz.js +4 -0
  181. package/dist/collection/components/vega-flag-icon/assets/flags/ca.js +4 -0
  182. package/dist/collection/components/vega-flag-icon/assets/flags/cc.js +4 -0
  183. package/dist/collection/components/vega-flag-icon/assets/flags/cd.js +4 -0
  184. package/dist/collection/components/vega-flag-icon/assets/flags/cf.js +4 -0
  185. package/dist/collection/components/vega-flag-icon/assets/flags/cg.js +4 -0
  186. package/dist/collection/components/vega-flag-icon/assets/flags/ch.js +4 -0
  187. package/dist/collection/components/vega-flag-icon/assets/flags/ci.js +4 -0
  188. package/dist/collection/components/vega-flag-icon/assets/flags/ck.js +4 -0
  189. package/dist/collection/components/vega-flag-icon/assets/flags/cl.js +4 -0
  190. package/dist/collection/components/vega-flag-icon/assets/flags/cm.js +4 -0
  191. package/dist/collection/components/vega-flag-icon/assets/flags/cn.js +4 -0
  192. package/dist/collection/components/vega-flag-icon/assets/flags/co.js +4 -0
  193. package/dist/collection/components/vega-flag-icon/assets/flags/cr.js +4 -0
  194. package/dist/collection/components/vega-flag-icon/assets/flags/cu.js +4 -0
  195. package/dist/collection/components/vega-flag-icon/assets/flags/cv.js +4 -0
  196. package/dist/collection/components/vega-flag-icon/assets/flags/cw.js +4 -0
  197. package/dist/collection/components/vega-flag-icon/assets/flags/cx.js +4 -0
  198. package/dist/collection/components/vega-flag-icon/assets/flags/cy.js +4 -0
  199. package/dist/collection/components/vega-flag-icon/assets/flags/cz.js +4 -0
  200. package/dist/collection/components/vega-flag-icon/assets/flags/de.js +4 -0
  201. package/dist/collection/components/vega-flag-icon/assets/flags/dj.js +4 -0
  202. package/dist/collection/components/vega-flag-icon/assets/flags/dk.js +4 -0
  203. package/dist/collection/components/vega-flag-icon/assets/flags/dm.js +4 -0
  204. package/dist/collection/components/vega-flag-icon/assets/flags/do.js +4 -0
  205. package/dist/collection/components/vega-flag-icon/assets/flags/dz.js +4 -0
  206. package/dist/collection/components/vega-flag-icon/assets/flags/ec.js +4 -0
  207. package/dist/collection/components/vega-flag-icon/assets/flags/ee.js +4 -0
  208. package/dist/collection/components/vega-flag-icon/assets/flags/eg.js +4 -0
  209. package/dist/collection/components/vega-flag-icon/assets/flags/eh.js +4 -0
  210. package/dist/collection/components/vega-flag-icon/assets/flags/er.js +4 -0
  211. package/dist/collection/components/vega-flag-icon/assets/flags/es.js +4 -0
  212. package/dist/collection/components/vega-flag-icon/assets/flags/et.js +4 -0
  213. package/dist/collection/components/vega-flag-icon/assets/flags/fi.js +4 -0
  214. package/dist/collection/components/vega-flag-icon/assets/flags/fj.js +4 -0
  215. package/dist/collection/components/vega-flag-icon/assets/flags/fk.js +4 -0
  216. package/dist/collection/components/vega-flag-icon/assets/flags/fm.js +4 -0
  217. package/dist/collection/components/vega-flag-icon/assets/flags/fo.js +4 -0
  218. package/dist/collection/components/vega-flag-icon/assets/flags/fr.js +4 -0
  219. package/dist/collection/components/vega-flag-icon/assets/flags/ga.js +4 -0
  220. package/dist/collection/components/vega-flag-icon/assets/flags/gb.js +4 -0
  221. package/dist/collection/components/vega-flag-icon/assets/flags/gd.js +4 -0
  222. package/dist/collection/components/vega-flag-icon/assets/flags/ge.js +4 -0
  223. package/dist/collection/components/vega-flag-icon/assets/flags/gf.js +4 -0
  224. package/dist/collection/components/vega-flag-icon/assets/flags/gg.js +4 -0
  225. package/dist/collection/components/vega-flag-icon/assets/flags/gh.js +4 -0
  226. package/dist/collection/components/vega-flag-icon/assets/flags/gi.js +4 -0
  227. package/dist/collection/components/vega-flag-icon/assets/flags/gl.js +4 -0
  228. package/dist/collection/components/vega-flag-icon/assets/flags/gm.js +4 -0
  229. package/dist/collection/components/vega-flag-icon/assets/flags/gn.js +4 -0
  230. package/dist/collection/components/vega-flag-icon/assets/flags/gp.js +4 -0
  231. package/dist/collection/components/vega-flag-icon/assets/flags/gq.js +4 -0
  232. package/dist/collection/components/vega-flag-icon/assets/flags/gr.js +4 -0
  233. package/dist/collection/components/vega-flag-icon/assets/flags/gt.js +4 -0
  234. package/dist/collection/components/vega-flag-icon/assets/flags/gu.js +4 -0
  235. package/dist/collection/components/vega-flag-icon/assets/flags/gw.js +4 -0
  236. package/dist/collection/components/vega-flag-icon/assets/flags/gy.js +4 -0
  237. package/dist/collection/components/vega-flag-icon/assets/flags/hk.js +4 -0
  238. package/dist/collection/components/vega-flag-icon/assets/flags/hn.js +4 -0
  239. package/dist/collection/components/vega-flag-icon/assets/flags/hr.js +4 -0
  240. package/dist/collection/components/vega-flag-icon/assets/flags/ht.js +4 -0
  241. package/dist/collection/components/vega-flag-icon/assets/flags/hu.js +4 -0
  242. package/dist/collection/components/vega-flag-icon/assets/flags/id.js +4 -0
  243. package/dist/collection/components/vega-flag-icon/assets/flags/ie.js +4 -0
  244. package/dist/collection/components/vega-flag-icon/assets/flags/il.js +4 -0
  245. package/dist/collection/components/vega-flag-icon/assets/flags/im.js +4 -0
  246. package/dist/collection/components/vega-flag-icon/assets/flags/in.js +4 -0
  247. package/dist/collection/components/vega-flag-icon/assets/flags/io.js +4 -0
  248. package/dist/collection/components/vega-flag-icon/assets/flags/iq.js +4 -0
  249. package/dist/collection/components/vega-flag-icon/assets/flags/ir.js +4 -0
  250. package/dist/collection/components/vega-flag-icon/assets/flags/is.js +4 -0
  251. package/dist/collection/components/vega-flag-icon/assets/flags/it.js +4 -0
  252. package/dist/collection/components/vega-flag-icon/assets/flags/je.js +4 -0
  253. package/dist/collection/components/vega-flag-icon/assets/flags/jm.js +4 -0
  254. package/dist/collection/components/vega-flag-icon/assets/flags/jo.js +4 -0
  255. package/dist/collection/components/vega-flag-icon/assets/flags/jp.js +4 -0
  256. package/dist/collection/components/vega-flag-icon/assets/flags/ke.js +4 -0
  257. package/dist/collection/components/vega-flag-icon/assets/flags/kg.js +4 -0
  258. package/dist/collection/components/vega-flag-icon/assets/flags/kh.js +4 -0
  259. package/dist/collection/components/vega-flag-icon/assets/flags/ki.js +4 -0
  260. package/dist/collection/components/vega-flag-icon/assets/flags/km.js +4 -0
  261. package/dist/collection/components/vega-flag-icon/assets/flags/kn.js +4 -0
  262. package/dist/collection/components/vega-flag-icon/assets/flags/kp.js +4 -0
  263. package/dist/collection/components/vega-flag-icon/assets/flags/kr.js +4 -0
  264. package/dist/collection/components/vega-flag-icon/assets/flags/kw.js +4 -0
  265. package/dist/collection/components/vega-flag-icon/assets/flags/ky.js +4 -0
  266. package/dist/collection/components/vega-flag-icon/assets/flags/kz.js +4 -0
  267. package/dist/collection/components/vega-flag-icon/assets/flags/la.js +4 -0
  268. package/dist/collection/components/vega-flag-icon/assets/flags/lb.js +4 -0
  269. package/dist/collection/components/vega-flag-icon/assets/flags/lc.js +4 -0
  270. package/dist/collection/components/vega-flag-icon/assets/flags/li.js +4 -0
  271. package/dist/collection/components/vega-flag-icon/assets/flags/lk.js +4 -0
  272. package/dist/collection/components/vega-flag-icon/assets/flags/lr.js +4 -0
  273. package/dist/collection/components/vega-flag-icon/assets/flags/ls.js +4 -0
  274. package/dist/collection/components/vega-flag-icon/assets/flags/lt.js +4 -0
  275. package/dist/collection/components/vega-flag-icon/assets/flags/lu.js +4 -0
  276. package/dist/collection/components/vega-flag-icon/assets/flags/lv.js +4 -0
  277. package/dist/collection/components/vega-flag-icon/assets/flags/ly.js +4 -0
  278. package/dist/collection/components/vega-flag-icon/assets/flags/ma.js +4 -0
  279. package/dist/collection/components/vega-flag-icon/assets/flags/mc.js +4 -0
  280. package/dist/collection/components/vega-flag-icon/assets/flags/md.js +4 -0
  281. package/dist/collection/components/vega-flag-icon/assets/flags/me.js +4 -0
  282. package/dist/collection/components/vega-flag-icon/assets/flags/mf.js +4 -0
  283. package/dist/collection/components/vega-flag-icon/assets/flags/mg.js +4 -0
  284. package/dist/collection/components/vega-flag-icon/assets/flags/mh.js +4 -0
  285. package/dist/collection/components/vega-flag-icon/assets/flags/mk.js +4 -0
  286. package/dist/collection/components/vega-flag-icon/assets/flags/ml.js +4 -0
  287. package/dist/collection/components/vega-flag-icon/assets/flags/mm.js +4 -0
  288. package/dist/collection/components/vega-flag-icon/assets/flags/mn.js +4 -0
  289. package/dist/collection/components/vega-flag-icon/assets/flags/mo.js +4 -0
  290. package/dist/collection/components/vega-flag-icon/assets/flags/mp.js +4 -0
  291. package/dist/collection/components/vega-flag-icon/assets/flags/mq.js +4 -0
  292. package/dist/collection/components/vega-flag-icon/assets/flags/mr.js +4 -0
  293. package/dist/collection/components/vega-flag-icon/assets/flags/ms.js +4 -0
  294. package/dist/collection/components/vega-flag-icon/assets/flags/mt.js +4 -0
  295. package/dist/collection/components/vega-flag-icon/assets/flags/mu.js +4 -0
  296. package/dist/collection/components/vega-flag-icon/assets/flags/mv.js +4 -0
  297. package/dist/collection/components/vega-flag-icon/assets/flags/mw.js +4 -0
  298. package/dist/collection/components/vega-flag-icon/assets/flags/mx.js +4 -0
  299. package/dist/collection/components/vega-flag-icon/assets/flags/my.js +4 -0
  300. package/dist/collection/components/vega-flag-icon/assets/flags/mz.js +4 -0
  301. package/dist/collection/components/vega-flag-icon/assets/flags/na.js +4 -0
  302. package/dist/collection/components/vega-flag-icon/assets/flags/nc.js +4 -0
  303. package/dist/collection/components/vega-flag-icon/assets/flags/ne.js +4 -0
  304. package/dist/collection/components/vega-flag-icon/assets/flags/nf.js +4 -0
  305. package/dist/collection/components/vega-flag-icon/assets/flags/ng.js +4 -0
  306. package/dist/collection/components/vega-flag-icon/assets/flags/ni.js +4 -0
  307. package/dist/collection/components/vega-flag-icon/assets/flags/nl.js +4 -0
  308. package/dist/collection/components/vega-flag-icon/assets/flags/no.js +4 -0
  309. package/dist/collection/components/vega-flag-icon/assets/flags/np.js +4 -0
  310. package/dist/collection/components/vega-flag-icon/assets/flags/nr.js +4 -0
  311. package/dist/collection/components/vega-flag-icon/assets/flags/nu.js +4 -0
  312. package/dist/collection/components/vega-flag-icon/assets/flags/nz.js +4 -0
  313. package/dist/collection/components/vega-flag-icon/assets/flags/om.js +4 -0
  314. package/dist/collection/components/vega-flag-icon/assets/flags/pa.js +4 -0
  315. package/dist/collection/components/vega-flag-icon/assets/flags/pe.js +4 -0
  316. package/dist/collection/components/vega-flag-icon/assets/flags/pf.js +4 -0
  317. package/dist/collection/components/vega-flag-icon/assets/flags/pg.js +4 -0
  318. package/dist/collection/components/vega-flag-icon/assets/flags/ph.js +4 -0
  319. package/dist/collection/components/vega-flag-icon/assets/flags/pk.js +4 -0
  320. package/dist/collection/components/vega-flag-icon/assets/flags/pl.js +4 -0
  321. package/dist/collection/components/vega-flag-icon/assets/flags/pm.js +4 -0
  322. package/dist/collection/components/vega-flag-icon/assets/flags/pr.js +4 -0
  323. package/dist/collection/components/vega-flag-icon/assets/flags/ps.js +4 -0
  324. package/dist/collection/components/vega-flag-icon/assets/flags/pt.js +4 -0
  325. package/dist/collection/components/vega-flag-icon/assets/flags/pw.js +4 -0
  326. package/dist/collection/components/vega-flag-icon/assets/flags/py.js +4 -0
  327. package/dist/collection/components/vega-flag-icon/assets/flags/qa.js +4 -0
  328. package/dist/collection/components/vega-flag-icon/assets/flags/re.js +4 -0
  329. package/dist/collection/components/vega-flag-icon/assets/flags/ro.js +4 -0
  330. package/dist/collection/components/vega-flag-icon/assets/flags/rs.js +4 -0
  331. package/dist/collection/components/vega-flag-icon/assets/flags/ru.js +4 -0
  332. package/dist/collection/components/vega-flag-icon/assets/flags/rw.js +4 -0
  333. package/dist/collection/components/vega-flag-icon/assets/flags/sa.js +4 -0
  334. package/dist/collection/components/vega-flag-icon/assets/flags/sb.js +4 -0
  335. package/dist/collection/components/vega-flag-icon/assets/flags/sc.js +4 -0
  336. package/dist/collection/components/vega-flag-icon/assets/flags/sd.js +4 -0
  337. package/dist/collection/components/vega-flag-icon/assets/flags/se.js +4 -0
  338. package/dist/collection/components/vega-flag-icon/assets/flags/sg.js +4 -0
  339. package/dist/collection/components/vega-flag-icon/assets/flags/sh.js +167 -0
  340. package/dist/collection/components/vega-flag-icon/assets/flags/si.js +4 -0
  341. package/dist/collection/components/vega-flag-icon/assets/flags/sj.js +4 -0
  342. package/dist/collection/components/vega-flag-icon/assets/flags/sk.js +4 -0
  343. package/dist/collection/components/vega-flag-icon/assets/flags/sl.js +4 -0
  344. package/dist/collection/components/vega-flag-icon/assets/flags/sm.js +4 -0
  345. package/dist/collection/components/vega-flag-icon/assets/flags/sn.js +4 -0
  346. package/dist/collection/components/vega-flag-icon/assets/flags/so.js +4 -0
  347. package/dist/collection/components/vega-flag-icon/assets/flags/sr.js +4 -0
  348. package/dist/collection/components/vega-flag-icon/assets/flags/ss.js +4 -0
  349. package/dist/collection/components/vega-flag-icon/assets/flags/st.js +4 -0
  350. package/dist/collection/components/vega-flag-icon/assets/flags/sv.js +4 -0
  351. package/dist/collection/components/vega-flag-icon/assets/flags/sx.js +4 -0
  352. package/dist/collection/components/vega-flag-icon/assets/flags/sy.js +4 -0
  353. package/dist/collection/components/vega-flag-icon/assets/flags/sz.js +4 -0
  354. package/dist/collection/components/vega-flag-icon/assets/flags/ta.js +79 -0
  355. package/dist/collection/components/vega-flag-icon/assets/flags/tc.js +4 -0
  356. package/dist/collection/components/vega-flag-icon/assets/flags/td.js +4 -0
  357. package/dist/collection/components/vega-flag-icon/assets/flags/tg.js +4 -0
  358. package/dist/collection/components/vega-flag-icon/assets/flags/th.js +4 -0
  359. package/dist/collection/components/vega-flag-icon/assets/flags/tj.js +4 -0
  360. package/dist/collection/components/vega-flag-icon/assets/flags/tk.js +4 -0
  361. package/dist/collection/components/vega-flag-icon/assets/flags/tl.js +4 -0
  362. package/dist/collection/components/vega-flag-icon/assets/flags/tm.js +4 -0
  363. package/dist/collection/components/vega-flag-icon/assets/flags/tn.js +4 -0
  364. package/dist/collection/components/vega-flag-icon/assets/flags/to.js +4 -0
  365. package/dist/collection/components/vega-flag-icon/assets/flags/tr.js +4 -0
  366. package/dist/collection/components/vega-flag-icon/assets/flags/tt.js +4 -0
  367. package/dist/collection/components/vega-flag-icon/assets/flags/tv.js +4 -0
  368. package/dist/collection/components/vega-flag-icon/assets/flags/tw.js +4 -0
  369. package/dist/collection/components/vega-flag-icon/assets/flags/tz.js +4 -0
  370. package/dist/collection/components/vega-flag-icon/assets/flags/ua.js +4 -0
  371. package/dist/collection/components/vega-flag-icon/assets/flags/ug.js +4 -0
  372. package/dist/collection/components/vega-flag-icon/assets/flags/us.js +4 -0
  373. package/dist/collection/components/vega-flag-icon/assets/flags/uy.js +4 -0
  374. package/dist/collection/components/vega-flag-icon/assets/flags/uz.js +4 -0
  375. package/dist/collection/components/vega-flag-icon/assets/flags/va.js +4 -0
  376. package/dist/collection/components/vega-flag-icon/assets/flags/vc.js +4 -0
  377. package/dist/collection/components/vega-flag-icon/assets/flags/ve.js +4 -0
  378. package/dist/collection/components/vega-flag-icon/assets/flags/vg.js +4 -0
  379. package/dist/collection/components/vega-flag-icon/assets/flags/vi.js +4 -0
  380. package/dist/collection/components/vega-flag-icon/assets/flags/vn.js +4 -0
  381. package/dist/collection/components/vega-flag-icon/assets/flags/vu.js +4 -0
  382. package/dist/collection/components/vega-flag-icon/assets/flags/wf.js +4 -0
  383. package/dist/collection/components/vega-flag-icon/assets/flags/ws.js +4 -0
  384. package/dist/collection/components/vega-flag-icon/assets/flags/xk.js +4 -0
  385. package/dist/collection/components/vega-flag-icon/assets/flags/ye.js +4 -0
  386. package/dist/collection/components/vega-flag-icon/assets/flags/yt.js +4 -0
  387. package/dist/collection/components/vega-flag-icon/assets/flags/za.js +4 -0
  388. package/dist/collection/components/vega-flag-icon/assets/flags/zm.js +4 -0
  389. package/dist/collection/components/vega-flag-icon/assets/flags/zw.js +4 -0
  390. package/dist/collection/components/vega-flag-icon/slimmers/controllers/vega-flag-icon-controller.js +102 -0
  391. package/dist/collection/components/vega-flag-icon/slimmers/renderers/vega-flag-icon-renderer.js +28 -0
  392. package/dist/collection/components/vega-flag-icon/vega-flag-icon.css +13 -0
  393. package/dist/collection/components/vega-flag-icon/vega-flag-icon.js +106 -0
  394. package/dist/collection/components/vega-form/slimmers/controllers/vega-form-nest-state-controller.js +31 -0
  395. package/dist/collection/components/vega-form/vega-form.js +50 -1
  396. package/dist/collection/components/vega-image-uploader/vega-image-uploader.css +19 -9
  397. package/dist/collection/components/vega-input/vega-input.css +2 -2
  398. package/dist/collection/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.js +28 -52
  399. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +35 -7
  400. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/phone-number-input-renderer.js +10 -3
  401. package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.css +1 -1
  402. package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +3 -3
  403. package/dist/collection/components/vega-input-range/vega-input-range.css +2 -2
  404. package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-dropdown-controller.js +7 -1
  405. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +8 -6
  406. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-prefix-icon-renderer.js +48 -0
  407. package/dist/collection/components/vega-input-select/vega-input-select.css +2 -2
  408. package/dist/collection/components/vega-input-select/vega-input-select.js +6 -1
  409. package/dist/collection/components/vega-nav/vega-left-nav/slimmers/renderers/vega-left-nav-header-renderer.js +12 -1
  410. package/dist/collection/components/vega-nav/vega-left-nav/vega-left-nav.css +0 -5
  411. package/dist/collection/components/vega-nav/vega-left-nav-group/vega-left-nav-group.css +2 -2
  412. package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.css +2 -4
  413. package/dist/collection/components/vega-pagination/vega-pagination.css +2 -1
  414. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +2 -1
  415. package/dist/collection/components/vega-radio/vega-radio.css +6 -5
  416. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +2 -1
  417. package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +2 -2
  418. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +2 -2
  419. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +2 -2
  420. package/dist/collection/components/vega-signature-capture/vega-signature-capture.css +2 -2
  421. package/dist/collection/components/vega-stepper/vega-stepper.css +1 -1
  422. package/dist/collection/components/vega-tab-group/vega-tab-group.css +1 -1
  423. package/dist/collection/components/vega-textarea/vega-textarea.css +6 -2
  424. package/dist/collection/components/vega-time-picker/vega-time-picker.css +2 -2
  425. package/dist/collection/components/vega-toggle-switch/vega-toggle-switch.css +2 -1
  426. package/dist/collection/constants/misc.js +2 -0
  427. package/dist/collection/constants/runtime-metrics-payload-definition/public-api/ThemeManager/runtime-metrics-payload-definition.js +20 -0
  428. package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-border-tokens.js +32 -0
  429. package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-color-tokens.js +184 -0
  430. package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-ring-tokens.js +7 -0
  431. package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-shadow-tokens.js +12 -0
  432. package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-border-tokens.js +32 -0
  433. package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-color-tokens.js +184 -0
  434. package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-shadow-tokens.js +12 -0
  435. package/dist/collection/constants/ui.js +1 -0
  436. package/dist/collection/global/scripts/before-vega-load.js +9 -0
  437. package/dist/collection/global/tests/before-vega-load.test.js +7 -0
  438. package/dist/collection/helpers/change-manager/subject/static-subject/static-subject-title.js +2 -0
  439. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -1
  440. package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
  441. package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
  442. package/dist/collection/helpers/event-manager/slimmers/event-emit-slimmer.js +8 -0
  443. package/dist/collection/helpers/event-manager/test/event-emit-slimmer.test.js +28 -1
  444. package/dist/collection/helpers/event-manager/test/vega-event-manager.test.js +2 -1
  445. package/dist/collection/helpers/icon/internal-icon-manager.js +10 -0
  446. package/dist/collection/helpers/slimmers/form-field-controller-slimmer.js +6 -1
  447. package/dist/collection/helpers/slimmers/form-field-state-controller-slimmer.js +45 -0
  448. package/dist/collection/helpers/theme/controllers/dark-mode-style-controller.js +17 -30
  449. package/dist/collection/helpers/theme/controllers/new-brand-style-controller.js +50 -0
  450. package/dist/collection/helpers/theme/controllers/style-controller.abstract.js +31 -0
  451. package/dist/collection/helpers/theme/internal-theme-manager.js +68 -0
  452. package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +17 -0
  453. package/dist/collection/helpers/theme/theme-manager.js +16 -17
  454. package/dist/collection/helpers/translation/locales/en.js +1 -0
  455. package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +1 -0
  456. package/dist/collection/helpers/validator/form-field-controller.js +9 -1
  457. package/dist/esm/app-globals-c055c18a.js +332 -0
  458. package/dist/esm/child-nodes-event-prevent-slimmer-d3a94ef2.js +156 -0
  459. package/dist/esm/child-nodes-notify-observer-slimmer-ddaad39a.js +88 -0
  460. package/dist/esm/content-state-8d0d38d7.js +3586 -0
  461. package/dist/esm/country-flags-b68c3349.js +2401 -0
  462. package/dist/esm/dark-mode-state-controller-slimmer-0678a94b.js +49 -0
  463. package/dist/esm/dark-mode-style-controller-e5915f26.js +3464 -0
  464. package/dist/esm/design-token-7406782c.js +389 -0
  465. package/dist/esm/dom-node-subject-factory-f77cf9cc.js +202 -0
  466. package/dist/esm/dom-node-subject-observer-factory-715dccf9.js +43 -0
  467. package/dist/esm/element-appender-slimmer-16eaeb31.js +1464 -0
  468. package/dist/esm/event-emit-slimmer-b7d511f6.js +264 -0
  469. package/dist/esm/form-field-controller-slimmer-a383d067.js +1254 -0
  470. package/dist/esm/image-annotation-action-de567e61.js +272 -0
  471. package/dist/esm/index-187f71d1.js +8 -0
  472. package/dist/esm/index-96374234.js +40 -0
  473. package/dist/esm/index.js +15 -13
  474. package/dist/esm/internal-icon-manager-58cf8aa6.js +53 -0
  475. package/dist/esm/internal-vega-event-manager-87dc436c.js +471 -0
  476. package/dist/esm/loader.js +16 -14
  477. package/dist/esm/observer-3959f9dd.js +30 -0
  478. package/dist/esm/public-rules-f9fe1987.js +28 -0
  479. package/dist/esm/remote-invocation-registry-d69245c2.js +63 -0
  480. package/dist/esm/responsive-format-facade-299d8ee9.js +919 -0
  481. package/dist/esm/rich-text-editor-required-rule-7fd7dcb3.js +62 -0
  482. package/dist/esm/static-subject-title-4a9deb68.js +51 -0
  483. package/dist/esm/string-input-formatter-slimmer-8c7987ac.js +430 -0
  484. package/dist/esm/style-formatter-2ebb1fd2.js +32 -0
  485. package/dist/esm/sub-state-notify-slimmer-2216c7dc.js +79 -0
  486. package/dist/esm/sub-state-observer-slimmer-da938c88.js +132 -0
  487. package/dist/esm/translation-78207e81.js +335 -0
  488. package/dist/esm/translation-slimmer-d49fcdf4.js +40 -0
  489. package/dist/esm/vega-accordion.entry.js +15 -13
  490. package/dist/esm/vega-app-footer.entry.js +40 -7
  491. package/dist/esm/vega-app-header-button.entry.js +18 -16
  492. package/dist/esm/vega-banner.entry.js +6 -5
  493. package/dist/esm/vega-box.entry.js +14 -12
  494. package/dist/esm/vega-brand-logo.entry.js +228 -0
  495. package/dist/esm/vega-breadcrumb.entry.js +6 -5
  496. package/dist/esm/vega-button-circle.entry.js +16 -14
  497. package/dist/esm/vega-button-group_2.entry.js +11 -10
  498. package/dist/esm/vega-button-link.entry.js +14 -11
  499. package/dist/esm/vega-button.entry.js +15 -13
  500. package/dist/esm/vega-calendar_3.entry.js +13 -12
  501. package/dist/esm/vega-card.entry.js +13 -11
  502. package/dist/esm/vega-carousel.entry.js +15 -13
  503. package/dist/esm/vega-checkbox_2.entry.js +13 -11
  504. package/dist/esm/vega-chip.entry.js +17 -15
  505. package/dist/esm/vega-color-picker.entry.js +20 -15
  506. package/dist/esm/vega-combo-box.entry.js +12 -10
  507. package/dist/esm/vega-date-picker_2.entry.js +22 -19
  508. package/dist/esm/vega-dialog_2.entry.js +15 -13
  509. package/dist/esm/vega-divider.entry.js +13 -11
  510. package/dist/esm/vega-dropdown_5.entry.js +282 -187
  511. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  512. package/dist/esm/vega-field-error.entry.js +1 -1
  513. package/dist/esm/vega-field-label.entry.js +5 -4
  514. package/dist/esm/vega-file-uploader.entry.js +12 -10
  515. package/dist/esm/vega-flag-icon.entry.js +203 -0
  516. package/dist/esm/vega-flex.entry.js +12 -10
  517. package/dist/esm/vega-font.entry.js +13 -11
  518. package/dist/esm/vega-form.entry.js +68 -12
  519. package/dist/esm/vega-grid.entry.js +13 -11
  520. package/dist/esm/vega-icon.entry.js +13 -11
  521. package/dist/esm/vega-image-uploader.entry.js +18 -15
  522. package/dist/esm/vega-input-credit-card.entry.js +12 -10
  523. package/dist/esm/vega-input-numeric.entry.js +12 -10
  524. package/dist/esm/vega-input-phone-number.entry.js +86 -2472
  525. package/dist/esm/vega-input-range.entry.js +13 -11
  526. package/dist/esm/vega-input-select.entry.js +133 -73
  527. package/dist/esm/vega-input.entry.js +13 -12
  528. package/dist/esm/vega-internal-event-id-7d1ff289.js +50 -0
  529. package/dist/esm/vega-item-toggle.entry.js +5 -4
  530. package/dist/esm/vega-left-nav_5.entry.js +30 -18
  531. package/dist/esm/vega-loader-wrapper_2.entry.js +12 -10
  532. package/dist/esm/vega-page-notification_2.entry.js +3 -2
  533. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +6 -5
  534. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +7 -6
  535. package/dist/esm/vega-pagination.entry.js +16 -14
  536. package/dist/esm/vega-popover_2.entry.js +15 -13
  537. package/dist/esm/vega-progress-tracker.entry.js +6 -5
  538. package/dist/esm/vega-radio_2.entry.js +13 -11
  539. package/dist/esm/vega-rich-text-content.entry.js +12 -10
  540. package/dist/esm/vega-rich-text-editor_4.entry.js +132 -172
  541. package/dist/esm/vega-segment-control.entry.js +5 -4
  542. package/dist/esm/vega-selection-chip_2.entry.js +17 -15
  543. package/dist/esm/vega-selection-tile_2.entry.js +13 -12
  544. package/dist/esm/vega-sidenav_3.entry.js +16 -14
  545. package/dist/esm/vega-signature-capture.entry.js +19 -16
  546. package/dist/esm/vega-skeleton-loader-controller-90e8d34d.js +1282 -0
  547. package/dist/esm/vega-stepper.entry.js +12 -10
  548. package/dist/esm/vega-tab-group_2.entry.js +8 -7
  549. package/dist/esm/vega-table_8.entry.js +19 -17
  550. package/dist/esm/vega-textarea.entry.js +12 -10
  551. package/dist/esm/vega-time-picker_2.entry.js +19 -16
  552. package/dist/esm/vega-toggle-switch.entry.js +11 -9
  553. package/dist/esm/vega-tooltip_2.entry.js +14 -12
  554. package/dist/esm/vega.js +16 -14
  555. package/dist/types/components/vega-app-footer/vega-app-footer.d.ts +7 -3
  556. package/dist/types/components/vega-brand-logo/assets/dark-mode/g-symbol-large.d.ts +2 -0
  557. package/dist/types/components/vega-brand-logo/assets/dark-mode/g-symbol-medium.d.ts +2 -0
  558. package/dist/types/components/vega-brand-logo/assets/dark-mode/g-symbol-small.d.ts +2 -0
  559. package/dist/types/components/vega-brand-logo/assets/dark-mode/genius-large.d.ts +2 -0
  560. package/dist/types/components/vega-brand-logo/assets/dark-mode/genius-medium.d.ts +2 -0
  561. package/dist/types/components/vega-brand-logo/assets/dark-mode/genius-small.d.ts +2 -0
  562. package/dist/types/components/vega-brand-logo/assets/dark-mode/global-payments-large.d.ts +2 -0
  563. package/dist/types/components/vega-brand-logo/assets/dark-mode/global-payments-medium.d.ts +2 -0
  564. package/dist/types/components/vega-brand-logo/assets/dark-mode/global-payments-small.d.ts +2 -0
  565. package/dist/types/components/vega-brand-logo/assets/index.d.ts +18 -0
  566. package/dist/types/components/vega-brand-logo/assets/light-mode/g-symbol-large.d.ts +2 -0
  567. package/dist/types/components/vega-brand-logo/assets/light-mode/g-symbol-medium.d.ts +2 -0
  568. package/dist/types/components/vega-brand-logo/assets/light-mode/g-symbol-small.d.ts +2 -0
  569. package/dist/types/components/vega-brand-logo/assets/light-mode/genius-large.d.ts +2 -0
  570. package/dist/types/components/vega-brand-logo/assets/light-mode/genius-medium.d.ts +2 -0
  571. package/dist/types/components/vega-brand-logo/assets/light-mode/genius-small.d.ts +2 -0
  572. package/dist/types/components/vega-brand-logo/assets/light-mode/global-payments-large.d.ts +2 -0
  573. package/dist/types/components/vega-brand-logo/assets/light-mode/global-payments-medium.d.ts +2 -0
  574. package/dist/types/components/vega-brand-logo/assets/light-mode/global-payments-small.d.ts +2 -0
  575. package/dist/types/components/vega-brand-logo/slimmers/renderers/vega-brand-logo-renderer.d.ts +12 -0
  576. package/dist/types/components/vega-brand-logo/vega-brand-logo.d.ts +39 -0
  577. package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-scrollable-controller.d.ts +10 -0
  578. package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-selected-controller.d.ts +5 -0
  579. package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-renderer.d.ts +1 -0
  580. package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-reset-renderer.d.ts +9 -0
  581. package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +23 -0
  582. package/dist/types/components/vega-flag-icon/assets/country-flags.d.ts +3 -0
  583. package/dist/types/components/vega-flag-icon/slimmers/controllers/vega-flag-icon-controller.d.ts +45 -0
  584. package/dist/types/components/vega-flag-icon/slimmers/renderers/vega-flag-icon-renderer.d.ts +7 -0
  585. package/dist/types/components/vega-flag-icon/vega-flag-icon.d.ts +29 -0
  586. package/dist/types/components/vega-form/slimmers/controllers/vega-form-nest-state-controller.d.ts +10 -0
  587. package/dist/types/components/vega-form/vega-form.d.ts +16 -0
  588. package/dist/types/components/vega-input-phone-number/slimmers/controllers/country-select-controller.d.ts +1 -1
  589. package/dist/types/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.d.ts +12 -29
  590. package/dist/types/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.d.ts +16 -1
  591. package/dist/types/components/vega-input-phone-number/types.d.ts +1 -3
  592. package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +2 -1
  593. package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-dropdown-controller.d.ts +1 -0
  594. package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +2 -1
  595. package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-prefix-icon-renderer.d.ts +21 -0
  596. package/dist/types/components/vega-input-select/types.d.ts +1 -0
  597. package/dist/types/components/vega-input-select/vega-input-select.d.ts +2 -0
  598. package/dist/types/components/vega-nav/vega-left-nav/slimmers/renderers/vega-left-nav-header-renderer.d.ts +1 -0
  599. package/dist/types/components.d.ts +115 -7
  600. package/dist/types/constants/misc.d.ts +2 -0
  601. package/dist/types/constants/tokens/themes/v2-new-brand/dark-mode-border-tokens.d.ts +1 -0
  602. package/dist/types/constants/tokens/themes/v2-new-brand/dark-mode-color-tokens.d.ts +1 -0
  603. package/dist/types/constants/tokens/themes/v2-new-brand/dark-mode-ring-tokens.d.ts +1 -0
  604. package/dist/types/constants/tokens/themes/v2-new-brand/dark-mode-shadow-tokens.d.ts +1 -0
  605. package/dist/types/constants/tokens/themes/v2-new-brand/light-mode-border-tokens.d.ts +1 -0
  606. package/dist/types/constants/tokens/themes/v2-new-brand/light-mode-color-tokens.d.ts +1 -0
  607. package/dist/types/constants/tokens/themes/v2-new-brand/light-mode-shadow-tokens.d.ts +1 -0
  608. package/dist/types/constants/ui.d.ts +1 -1
  609. package/dist/types/helpers/change-manager/subject/static-subject/static-subject-title.d.ts +3 -1
  610. package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
  611. package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
  612. package/dist/types/helpers/event-manager/slimmers/event-emit-slimmer.d.ts +9 -0
  613. package/dist/types/helpers/icon/internal-icon-manager.d.ts +8 -0
  614. package/dist/types/helpers/slimmers/form-field-controller-slimmer.d.ts +4 -2
  615. package/dist/types/helpers/slimmers/form-field-state-controller-slimmer.d.ts +15 -0
  616. package/dist/types/helpers/theme/controllers/dark-mode-style-controller.d.ts +4 -12
  617. package/dist/types/helpers/theme/controllers/new-brand-style-controller.d.ts +22 -0
  618. package/dist/types/helpers/theme/controllers/style-controller.abstract.d.ts +19 -0
  619. package/dist/types/helpers/theme/internal-theme-manager.d.ts +48 -0
  620. package/dist/types/helpers/theme/theme-manager.d.ts +9 -1
  621. package/dist/types/helpers/theme/theme.d.ts +2 -0
  622. package/dist/types/helpers/translation/interface.d.ts +3 -1
  623. package/dist/types/helpers/validator/form-field-controller.d.ts +7 -0
  624. package/dist/types/helpers/validator/rules/valid-phone-number-rule.d.ts +1 -1
  625. package/dist/types/types/components.type.d.ts +2 -1
  626. package/dist/types/types/flag.type.d.ts +3 -0
  627. package/dist/types/types/public-api.d.ts +1 -1
  628. package/dist/vega/index.esm.js +1 -1
  629. package/dist/vega/p-06d7990e.js +1 -0
  630. package/dist/vega/p-0835a2fd.js +1 -0
  631. package/dist/vega/p-0a3607f7.entry.js +1 -0
  632. package/dist/vega/p-0e7fc736.entry.js +1 -0
  633. package/dist/vega/p-10a40dfb.entry.js +1 -0
  634. package/dist/vega/p-1114896d.entry.js +1 -0
  635. package/dist/vega/p-1138fa63.entry.js +1 -0
  636. package/dist/vega/p-1154e439.entry.js +1 -0
  637. package/dist/vega/p-12a8d705.js +1 -0
  638. package/dist/vega/p-12d60f5f.js +1 -0
  639. package/dist/vega/p-1486bc3f.js +1 -0
  640. package/dist/vega/p-1e926324.js +1 -0
  641. package/dist/vega/p-20af6415.entry.js +1 -0
  642. package/dist/vega/p-214aa52e.js +1 -0
  643. package/dist/vega/p-23a26150.js +1 -0
  644. package/dist/vega/p-23ff7605.entry.js +1 -0
  645. package/dist/vega/p-26005df1.js +1 -0
  646. package/dist/vega/p-27003a81.entry.js +1 -0
  647. package/dist/vega/p-27287998.entry.js +1 -0
  648. package/dist/vega/p-28b7d6ba.entry.js +1 -0
  649. package/dist/vega/p-2c0d1ec9.entry.js +1 -0
  650. package/dist/vega/p-3165ee95.entry.js +1 -0
  651. package/dist/vega/p-327a017b.entry.js +1 -0
  652. package/dist/vega/p-331a62d5.js +1 -0
  653. package/dist/vega/p-380ba357.entry.js +1 -0
  654. package/dist/vega/p-414e7edc.entry.js +1 -0
  655. package/dist/vega/p-41c48bcc.entry.js +1 -0
  656. package/dist/vega/p-42b62b48.js +1 -0
  657. package/dist/vega/p-431ab4dd.js +1 -0
  658. package/dist/vega/p-4640d35d.entry.js +1 -0
  659. package/dist/vega/p-48517a5d.entry.js +1 -0
  660. package/dist/vega/p-4b541ce8.entry.js +1 -0
  661. package/dist/vega/p-4c62c178.entry.js +1 -0
  662. package/dist/vega/p-5064a804.js +1 -0
  663. package/dist/vega/p-562de411.entry.js +1 -0
  664. package/dist/vega/p-5f377954.js +1 -1
  665. package/dist/vega/p-626dd54f.entry.js +1 -0
  666. package/dist/vega/p-63ea4f38.entry.js +1 -0
  667. package/dist/vega/p-6586e2a2.entry.js +1 -0
  668. package/dist/vega/p-693934d5.entry.js +1 -0
  669. package/dist/vega/p-69cc3fa2.js +1 -0
  670. package/dist/vega/p-6cd8e6f4.entry.js +1 -0
  671. package/dist/vega/p-6e898779.js +1 -0
  672. package/dist/vega/p-6f2faa34.js +1 -0
  673. package/dist/vega/p-6f81fe1e.js +1 -0
  674. package/dist/vega/p-6f9731a1.entry.js +1 -0
  675. package/dist/vega/p-704d9730.js +1 -0
  676. package/dist/vega/p-720d87f9.entry.js +1 -0
  677. package/dist/vega/p-76a3a552.entry.js +13 -0
  678. package/dist/vega/p-77e64f26.js +1 -0
  679. package/dist/vega/p-7a3826a0.entry.js +1 -0
  680. package/dist/vega/p-7cc3feb4.entry.js +1 -0
  681. package/dist/vega/p-7f1a7346.entry.js +1 -0
  682. package/dist/vega/p-7f9dd834.entry.js +1 -0
  683. package/dist/vega/p-804f71b3.js +1 -0
  684. package/dist/vega/p-84aa2ebc.entry.js +1 -0
  685. package/dist/vega/p-865b45dc.entry.js +1 -0
  686. package/dist/vega/p-8f98e604.entry.js +1 -0
  687. package/dist/vega/p-90e70662.entry.js +1 -0
  688. package/dist/vega/p-90ebcda7.entry.js +1 -0
  689. package/dist/vega/p-a0b6da44.js +1 -0
  690. package/dist/vega/p-a5c39ba2.entry.js +1 -0
  691. package/dist/vega/p-a821bcf3.js +1 -0
  692. package/dist/vega/p-a8e9bfae.entry.js +1 -0
  693. package/dist/vega/p-a9f2ad08.entry.js +1 -0
  694. package/dist/vega/p-aa29ccd4.entry.js +1 -0
  695. package/dist/vega/p-b07add9c.entry.js +1 -0
  696. package/dist/vega/p-b2643e88.js +1 -0
  697. package/dist/vega/p-b4108ddb.entry.js +1 -0
  698. package/dist/vega/p-b5f05d21.entry.js +1 -0
  699. package/dist/vega/p-ba0a76fe.entry.js +1 -0
  700. package/dist/vega/p-be186a9f.entry.js +1 -0
  701. package/dist/vega/p-c17b7a1f.js +1 -0
  702. package/dist/vega/p-c87b5c83.entry.js +1 -0
  703. package/dist/vega/p-c9b9322b.js +1 -0
  704. package/dist/vega/p-d2947f32.entry.js +1 -0
  705. package/dist/vega/p-d296cf86.entry.js +1 -0
  706. package/dist/vega/p-d2a65457.entry.js +1 -0
  707. package/dist/vega/p-d54c48b0.js +1 -0
  708. package/dist/vega/p-d7642125.js +1 -0
  709. package/dist/vega/p-da40b4c3.js +1 -0
  710. package/dist/vega/p-e309bfd1.entry.js +1 -0
  711. package/dist/vega/p-e3b70eed.entry.js +1 -0
  712. package/dist/vega/p-e66515c7.js +1 -0
  713. package/dist/vega/p-eaab3fea.entry.js +1 -0
  714. package/dist/vega/p-f01300ea.entry.js +1 -0
  715. package/dist/vega/p-f0c85061.js +1 -0
  716. package/dist/vega/p-f3efc8f0.entry.js +1 -0
  717. package/dist/vega/p-f3f73fd3.entry.js +1 -0
  718. package/dist/vega/p-f5fdf1ae.entry.js +1 -0
  719. package/dist/vega/p-fb6d87cd.entry.js +1 -0
  720. package/dist/vega/p-ff8ef8af.entry.js +1 -0
  721. package/dist/vega/p-ff9ccfa8.js +1 -0
  722. package/dist/vega/p-ff9e8753.entry.js +1 -0
  723. package/dist/vega/vega.esm.js +1 -1
  724. package/package.json +1 -1
  725. package/dist/cjs/app-globals-c99ca280.js +0 -325
  726. package/dist/cjs/child-nodes-event-prevent-slimmer-4982065c.js +0 -158
  727. package/dist/cjs/child-nodes-notify-observer-slimmer-100dbe59.js +0 -90
  728. package/dist/cjs/content-state-5659cad7.js +0 -6647
  729. package/dist/cjs/design-token-61572ad6.js +0 -403
  730. package/dist/cjs/dom-node-subject-factory-6a2aa462.js +0 -280
  731. package/dist/cjs/dom-node-subject-observer-factory-8f9ed458.js +0 -44
  732. package/dist/cjs/element-appender-slimmer-6de02fb6.js +0 -1465
  733. package/dist/cjs/event-emit-slimmer-93183c4d.js +0 -258
  734. package/dist/cjs/form-field-controller-slimmer-ac875498.js +0 -1198
  735. package/dist/cjs/image-annotation-action-cd529b25.js +0 -276
  736. package/dist/cjs/index-cea30b8b.js +0 -42
  737. package/dist/cjs/internal-icon-manager-cf3347e7.js +0 -45
  738. package/dist/cjs/internal-vega-event-manager-cd87600e.js +0 -474
  739. package/dist/cjs/public-rules-a23c74a9.js +0 -41
  740. package/dist/cjs/remote-invocation-registry-08e3c509.js +0 -65
  741. package/dist/cjs/responsive-format-facade-bf7d9ab2.js +0 -923
  742. package/dist/cjs/rich-text-editor-required-rule-cdc2e15e.js +0 -64
  743. package/dist/cjs/static-subject-title-64175f06.js +0 -75
  744. package/dist/cjs/string-input-formatter-slimmer-90bdfcf6.js +0 -434
  745. package/dist/cjs/style-formatter-f26738b9.js +0 -34
  746. package/dist/cjs/sub-state-notify-slimmer-88e2f4aa.js +0 -80
  747. package/dist/cjs/sub-state-observer-slimmer-8ed18a5a.js +0 -133
  748. package/dist/cjs/translation-f7279bf1.js +0 -338
  749. package/dist/cjs/translation-slimmer-4d852eab.js +0 -42
  750. package/dist/cjs/vega-internal-event-id-a0ca9af9.js +0 -78
  751. package/dist/cjs/vega-skeleton-loader-controller-1c91112a.js +0 -1120
  752. package/dist/collection/components/vega-input-phone-number/assets/flags/ac.js +0 -692
  753. package/dist/collection/components/vega-input-phone-number/assets/flags/ad.js +0 -4
  754. package/dist/collection/components/vega-input-phone-number/assets/flags/ae.js +0 -4
  755. package/dist/collection/components/vega-input-phone-number/assets/flags/af.js +0 -4
  756. package/dist/collection/components/vega-input-phone-number/assets/flags/ag.js +0 -4
  757. package/dist/collection/components/vega-input-phone-number/assets/flags/ai.js +0 -4
  758. package/dist/collection/components/vega-input-phone-number/assets/flags/al.js +0 -4
  759. package/dist/collection/components/vega-input-phone-number/assets/flags/am.js +0 -4
  760. package/dist/collection/components/vega-input-phone-number/assets/flags/ao.js +0 -4
  761. package/dist/collection/components/vega-input-phone-number/assets/flags/ar.js +0 -4
  762. package/dist/collection/components/vega-input-phone-number/assets/flags/as.js +0 -4
  763. package/dist/collection/components/vega-input-phone-number/assets/flags/at.js +0 -4
  764. package/dist/collection/components/vega-input-phone-number/assets/flags/au.js +0 -4
  765. package/dist/collection/components/vega-input-phone-number/assets/flags/aw.js +0 -4
  766. package/dist/collection/components/vega-input-phone-number/assets/flags/ax.js +0 -4
  767. package/dist/collection/components/vega-input-phone-number/assets/flags/az.js +0 -4
  768. package/dist/collection/components/vega-input-phone-number/assets/flags/ba.js +0 -4
  769. package/dist/collection/components/vega-input-phone-number/assets/flags/bb.js +0 -4
  770. package/dist/collection/components/vega-input-phone-number/assets/flags/bd.js +0 -4
  771. package/dist/collection/components/vega-input-phone-number/assets/flags/be.js +0 -4
  772. package/dist/collection/components/vega-input-phone-number/assets/flags/bf.js +0 -4
  773. package/dist/collection/components/vega-input-phone-number/assets/flags/bg.js +0 -4
  774. package/dist/collection/components/vega-input-phone-number/assets/flags/bh.js +0 -4
  775. package/dist/collection/components/vega-input-phone-number/assets/flags/bi.js +0 -4
  776. package/dist/collection/components/vega-input-phone-number/assets/flags/bj.js +0 -4
  777. package/dist/collection/components/vega-input-phone-number/assets/flags/bl.js +0 -4
  778. package/dist/collection/components/vega-input-phone-number/assets/flags/bm.js +0 -4
  779. package/dist/collection/components/vega-input-phone-number/assets/flags/bn.js +0 -4
  780. package/dist/collection/components/vega-input-phone-number/assets/flags/bo.js +0 -4
  781. package/dist/collection/components/vega-input-phone-number/assets/flags/bq.js +0 -4
  782. package/dist/collection/components/vega-input-phone-number/assets/flags/br.js +0 -4
  783. package/dist/collection/components/vega-input-phone-number/assets/flags/bs.js +0 -4
  784. package/dist/collection/components/vega-input-phone-number/assets/flags/bt.js +0 -4
  785. package/dist/collection/components/vega-input-phone-number/assets/flags/bw.js +0 -4
  786. package/dist/collection/components/vega-input-phone-number/assets/flags/by.js +0 -4
  787. package/dist/collection/components/vega-input-phone-number/assets/flags/bz.js +0 -4
  788. package/dist/collection/components/vega-input-phone-number/assets/flags/ca.js +0 -4
  789. package/dist/collection/components/vega-input-phone-number/assets/flags/cc.js +0 -4
  790. package/dist/collection/components/vega-input-phone-number/assets/flags/cd.js +0 -4
  791. package/dist/collection/components/vega-input-phone-number/assets/flags/cf.js +0 -4
  792. package/dist/collection/components/vega-input-phone-number/assets/flags/cg.js +0 -4
  793. package/dist/collection/components/vega-input-phone-number/assets/flags/ch.js +0 -4
  794. package/dist/collection/components/vega-input-phone-number/assets/flags/ci.js +0 -4
  795. package/dist/collection/components/vega-input-phone-number/assets/flags/ck.js +0 -4
  796. package/dist/collection/components/vega-input-phone-number/assets/flags/cl.js +0 -4
  797. package/dist/collection/components/vega-input-phone-number/assets/flags/cm.js +0 -4
  798. package/dist/collection/components/vega-input-phone-number/assets/flags/cn.js +0 -4
  799. package/dist/collection/components/vega-input-phone-number/assets/flags/co.js +0 -4
  800. package/dist/collection/components/vega-input-phone-number/assets/flags/cr.js +0 -4
  801. package/dist/collection/components/vega-input-phone-number/assets/flags/cu.js +0 -4
  802. package/dist/collection/components/vega-input-phone-number/assets/flags/cv.js +0 -4
  803. package/dist/collection/components/vega-input-phone-number/assets/flags/cw.js +0 -4
  804. package/dist/collection/components/vega-input-phone-number/assets/flags/cx.js +0 -4
  805. package/dist/collection/components/vega-input-phone-number/assets/flags/cy.js +0 -4
  806. package/dist/collection/components/vega-input-phone-number/assets/flags/cz.js +0 -4
  807. package/dist/collection/components/vega-input-phone-number/assets/flags/de.js +0 -4
  808. package/dist/collection/components/vega-input-phone-number/assets/flags/dj.js +0 -4
  809. package/dist/collection/components/vega-input-phone-number/assets/flags/dk.js +0 -4
  810. package/dist/collection/components/vega-input-phone-number/assets/flags/dm.js +0 -4
  811. package/dist/collection/components/vega-input-phone-number/assets/flags/do.js +0 -4
  812. package/dist/collection/components/vega-input-phone-number/assets/flags/dz.js +0 -4
  813. package/dist/collection/components/vega-input-phone-number/assets/flags/ec.js +0 -4
  814. package/dist/collection/components/vega-input-phone-number/assets/flags/ee.js +0 -4
  815. package/dist/collection/components/vega-input-phone-number/assets/flags/eg.js +0 -4
  816. package/dist/collection/components/vega-input-phone-number/assets/flags/eh.js +0 -4
  817. package/dist/collection/components/vega-input-phone-number/assets/flags/er.js +0 -4
  818. package/dist/collection/components/vega-input-phone-number/assets/flags/es.js +0 -4
  819. package/dist/collection/components/vega-input-phone-number/assets/flags/et.js +0 -4
  820. package/dist/collection/components/vega-input-phone-number/assets/flags/fi.js +0 -4
  821. package/dist/collection/components/vega-input-phone-number/assets/flags/fj.js +0 -4
  822. package/dist/collection/components/vega-input-phone-number/assets/flags/fk.js +0 -4
  823. package/dist/collection/components/vega-input-phone-number/assets/flags/fm.js +0 -4
  824. package/dist/collection/components/vega-input-phone-number/assets/flags/fo.js +0 -4
  825. package/dist/collection/components/vega-input-phone-number/assets/flags/fr.js +0 -4
  826. package/dist/collection/components/vega-input-phone-number/assets/flags/ga.js +0 -4
  827. package/dist/collection/components/vega-input-phone-number/assets/flags/gb.js +0 -4
  828. package/dist/collection/components/vega-input-phone-number/assets/flags/gd.js +0 -4
  829. package/dist/collection/components/vega-input-phone-number/assets/flags/ge.js +0 -4
  830. package/dist/collection/components/vega-input-phone-number/assets/flags/gf.js +0 -4
  831. package/dist/collection/components/vega-input-phone-number/assets/flags/gg.js +0 -4
  832. package/dist/collection/components/vega-input-phone-number/assets/flags/gh.js +0 -4
  833. package/dist/collection/components/vega-input-phone-number/assets/flags/gi.js +0 -4
  834. package/dist/collection/components/vega-input-phone-number/assets/flags/gl.js +0 -4
  835. package/dist/collection/components/vega-input-phone-number/assets/flags/gm.js +0 -4
  836. package/dist/collection/components/vega-input-phone-number/assets/flags/gn.js +0 -4
  837. package/dist/collection/components/vega-input-phone-number/assets/flags/gp.js +0 -4
  838. package/dist/collection/components/vega-input-phone-number/assets/flags/gq.js +0 -4
  839. package/dist/collection/components/vega-input-phone-number/assets/flags/gr.js +0 -4
  840. package/dist/collection/components/vega-input-phone-number/assets/flags/gt.js +0 -4
  841. package/dist/collection/components/vega-input-phone-number/assets/flags/gu.js +0 -4
  842. package/dist/collection/components/vega-input-phone-number/assets/flags/gw.js +0 -4
  843. package/dist/collection/components/vega-input-phone-number/assets/flags/gy.js +0 -4
  844. package/dist/collection/components/vega-input-phone-number/assets/flags/hk.js +0 -4
  845. package/dist/collection/components/vega-input-phone-number/assets/flags/hn.js +0 -4
  846. package/dist/collection/components/vega-input-phone-number/assets/flags/hr.js +0 -4
  847. package/dist/collection/components/vega-input-phone-number/assets/flags/ht.js +0 -4
  848. package/dist/collection/components/vega-input-phone-number/assets/flags/hu.js +0 -4
  849. package/dist/collection/components/vega-input-phone-number/assets/flags/id.js +0 -4
  850. package/dist/collection/components/vega-input-phone-number/assets/flags/ie.js +0 -4
  851. package/dist/collection/components/vega-input-phone-number/assets/flags/il.js +0 -4
  852. package/dist/collection/components/vega-input-phone-number/assets/flags/im.js +0 -4
  853. package/dist/collection/components/vega-input-phone-number/assets/flags/in.js +0 -4
  854. package/dist/collection/components/vega-input-phone-number/assets/flags/io.js +0 -4
  855. package/dist/collection/components/vega-input-phone-number/assets/flags/iq.js +0 -4
  856. package/dist/collection/components/vega-input-phone-number/assets/flags/ir.js +0 -4
  857. package/dist/collection/components/vega-input-phone-number/assets/flags/is.js +0 -4
  858. package/dist/collection/components/vega-input-phone-number/assets/flags/it.js +0 -4
  859. package/dist/collection/components/vega-input-phone-number/assets/flags/je.js +0 -4
  860. package/dist/collection/components/vega-input-phone-number/assets/flags/jm.js +0 -4
  861. package/dist/collection/components/vega-input-phone-number/assets/flags/jo.js +0 -4
  862. package/dist/collection/components/vega-input-phone-number/assets/flags/jp.js +0 -4
  863. package/dist/collection/components/vega-input-phone-number/assets/flags/ke.js +0 -4
  864. package/dist/collection/components/vega-input-phone-number/assets/flags/kg.js +0 -4
  865. package/dist/collection/components/vega-input-phone-number/assets/flags/kh.js +0 -4
  866. package/dist/collection/components/vega-input-phone-number/assets/flags/ki.js +0 -4
  867. package/dist/collection/components/vega-input-phone-number/assets/flags/km.js +0 -4
  868. package/dist/collection/components/vega-input-phone-number/assets/flags/kn.js +0 -4
  869. package/dist/collection/components/vega-input-phone-number/assets/flags/kp.js +0 -4
  870. package/dist/collection/components/vega-input-phone-number/assets/flags/kr.js +0 -4
  871. package/dist/collection/components/vega-input-phone-number/assets/flags/kw.js +0 -4
  872. package/dist/collection/components/vega-input-phone-number/assets/flags/ky.js +0 -4
  873. package/dist/collection/components/vega-input-phone-number/assets/flags/kz.js +0 -4
  874. package/dist/collection/components/vega-input-phone-number/assets/flags/la.js +0 -4
  875. package/dist/collection/components/vega-input-phone-number/assets/flags/lb.js +0 -4
  876. package/dist/collection/components/vega-input-phone-number/assets/flags/lc.js +0 -4
  877. package/dist/collection/components/vega-input-phone-number/assets/flags/li.js +0 -4
  878. package/dist/collection/components/vega-input-phone-number/assets/flags/lk.js +0 -4
  879. package/dist/collection/components/vega-input-phone-number/assets/flags/lr.js +0 -4
  880. package/dist/collection/components/vega-input-phone-number/assets/flags/ls.js +0 -4
  881. package/dist/collection/components/vega-input-phone-number/assets/flags/lt.js +0 -4
  882. package/dist/collection/components/vega-input-phone-number/assets/flags/lu.js +0 -4
  883. package/dist/collection/components/vega-input-phone-number/assets/flags/lv.js +0 -4
  884. package/dist/collection/components/vega-input-phone-number/assets/flags/ly.js +0 -4
  885. package/dist/collection/components/vega-input-phone-number/assets/flags/ma.js +0 -4
  886. package/dist/collection/components/vega-input-phone-number/assets/flags/mc.js +0 -4
  887. package/dist/collection/components/vega-input-phone-number/assets/flags/md.js +0 -4
  888. package/dist/collection/components/vega-input-phone-number/assets/flags/me.js +0 -4
  889. package/dist/collection/components/vega-input-phone-number/assets/flags/mf.js +0 -4
  890. package/dist/collection/components/vega-input-phone-number/assets/flags/mg.js +0 -4
  891. package/dist/collection/components/vega-input-phone-number/assets/flags/mh.js +0 -4
  892. package/dist/collection/components/vega-input-phone-number/assets/flags/mk.js +0 -4
  893. package/dist/collection/components/vega-input-phone-number/assets/flags/ml.js +0 -4
  894. package/dist/collection/components/vega-input-phone-number/assets/flags/mm.js +0 -4
  895. package/dist/collection/components/vega-input-phone-number/assets/flags/mn.js +0 -4
  896. package/dist/collection/components/vega-input-phone-number/assets/flags/mo.js +0 -4
  897. package/dist/collection/components/vega-input-phone-number/assets/flags/mp.js +0 -4
  898. package/dist/collection/components/vega-input-phone-number/assets/flags/mq.js +0 -4
  899. package/dist/collection/components/vega-input-phone-number/assets/flags/mr.js +0 -4
  900. package/dist/collection/components/vega-input-phone-number/assets/flags/ms.js +0 -4
  901. package/dist/collection/components/vega-input-phone-number/assets/flags/mt.js +0 -4
  902. package/dist/collection/components/vega-input-phone-number/assets/flags/mu.js +0 -4
  903. package/dist/collection/components/vega-input-phone-number/assets/flags/mv.js +0 -4
  904. package/dist/collection/components/vega-input-phone-number/assets/flags/mw.js +0 -4
  905. package/dist/collection/components/vega-input-phone-number/assets/flags/mx.js +0 -4
  906. package/dist/collection/components/vega-input-phone-number/assets/flags/my.js +0 -4
  907. package/dist/collection/components/vega-input-phone-number/assets/flags/mz.js +0 -4
  908. package/dist/collection/components/vega-input-phone-number/assets/flags/na.js +0 -4
  909. package/dist/collection/components/vega-input-phone-number/assets/flags/nc.js +0 -4
  910. package/dist/collection/components/vega-input-phone-number/assets/flags/ne.js +0 -4
  911. package/dist/collection/components/vega-input-phone-number/assets/flags/nf.js +0 -4
  912. package/dist/collection/components/vega-input-phone-number/assets/flags/ng.js +0 -4
  913. package/dist/collection/components/vega-input-phone-number/assets/flags/ni.js +0 -4
  914. package/dist/collection/components/vega-input-phone-number/assets/flags/nl.js +0 -4
  915. package/dist/collection/components/vega-input-phone-number/assets/flags/no.js +0 -4
  916. package/dist/collection/components/vega-input-phone-number/assets/flags/np.js +0 -4
  917. package/dist/collection/components/vega-input-phone-number/assets/flags/nr.js +0 -4
  918. package/dist/collection/components/vega-input-phone-number/assets/flags/nu.js +0 -4
  919. package/dist/collection/components/vega-input-phone-number/assets/flags/nz.js +0 -4
  920. package/dist/collection/components/vega-input-phone-number/assets/flags/om.js +0 -4
  921. package/dist/collection/components/vega-input-phone-number/assets/flags/pa.js +0 -4
  922. package/dist/collection/components/vega-input-phone-number/assets/flags/pe.js +0 -4
  923. package/dist/collection/components/vega-input-phone-number/assets/flags/pf.js +0 -4
  924. package/dist/collection/components/vega-input-phone-number/assets/flags/pg.js +0 -4
  925. package/dist/collection/components/vega-input-phone-number/assets/flags/ph.js +0 -4
  926. package/dist/collection/components/vega-input-phone-number/assets/flags/pk.js +0 -4
  927. package/dist/collection/components/vega-input-phone-number/assets/flags/pl.js +0 -4
  928. package/dist/collection/components/vega-input-phone-number/assets/flags/pm.js +0 -4
  929. package/dist/collection/components/vega-input-phone-number/assets/flags/pr.js +0 -4
  930. package/dist/collection/components/vega-input-phone-number/assets/flags/ps.js +0 -4
  931. package/dist/collection/components/vega-input-phone-number/assets/flags/pt.js +0 -4
  932. package/dist/collection/components/vega-input-phone-number/assets/flags/pw.js +0 -4
  933. package/dist/collection/components/vega-input-phone-number/assets/flags/py.js +0 -4
  934. package/dist/collection/components/vega-input-phone-number/assets/flags/qa.js +0 -4
  935. package/dist/collection/components/vega-input-phone-number/assets/flags/re.js +0 -4
  936. package/dist/collection/components/vega-input-phone-number/assets/flags/ro.js +0 -4
  937. package/dist/collection/components/vega-input-phone-number/assets/flags/rs.js +0 -4
  938. package/dist/collection/components/vega-input-phone-number/assets/flags/ru.js +0 -4
  939. package/dist/collection/components/vega-input-phone-number/assets/flags/rw.js +0 -4
  940. package/dist/collection/components/vega-input-phone-number/assets/flags/sa.js +0 -4
  941. package/dist/collection/components/vega-input-phone-number/assets/flags/sb.js +0 -4
  942. package/dist/collection/components/vega-input-phone-number/assets/flags/sc.js +0 -4
  943. package/dist/collection/components/vega-input-phone-number/assets/flags/sd.js +0 -4
  944. package/dist/collection/components/vega-input-phone-number/assets/flags/se.js +0 -4
  945. package/dist/collection/components/vega-input-phone-number/assets/flags/sg.js +0 -4
  946. package/dist/collection/components/vega-input-phone-number/assets/flags/sh.js +0 -167
  947. package/dist/collection/components/vega-input-phone-number/assets/flags/si.js +0 -4
  948. package/dist/collection/components/vega-input-phone-number/assets/flags/sj.js +0 -4
  949. package/dist/collection/components/vega-input-phone-number/assets/flags/sk.js +0 -4
  950. package/dist/collection/components/vega-input-phone-number/assets/flags/sl.js +0 -4
  951. package/dist/collection/components/vega-input-phone-number/assets/flags/sm.js +0 -4
  952. package/dist/collection/components/vega-input-phone-number/assets/flags/sn.js +0 -4
  953. package/dist/collection/components/vega-input-phone-number/assets/flags/so.js +0 -4
  954. package/dist/collection/components/vega-input-phone-number/assets/flags/sr.js +0 -4
  955. package/dist/collection/components/vega-input-phone-number/assets/flags/ss.js +0 -4
  956. package/dist/collection/components/vega-input-phone-number/assets/flags/st.js +0 -4
  957. package/dist/collection/components/vega-input-phone-number/assets/flags/sv.js +0 -4
  958. package/dist/collection/components/vega-input-phone-number/assets/flags/sx.js +0 -4
  959. package/dist/collection/components/vega-input-phone-number/assets/flags/sy.js +0 -4
  960. package/dist/collection/components/vega-input-phone-number/assets/flags/sz.js +0 -4
  961. package/dist/collection/components/vega-input-phone-number/assets/flags/ta.js +0 -79
  962. package/dist/collection/components/vega-input-phone-number/assets/flags/tc.js +0 -4
  963. package/dist/collection/components/vega-input-phone-number/assets/flags/td.js +0 -4
  964. package/dist/collection/components/vega-input-phone-number/assets/flags/tg.js +0 -4
  965. package/dist/collection/components/vega-input-phone-number/assets/flags/th.js +0 -4
  966. package/dist/collection/components/vega-input-phone-number/assets/flags/tj.js +0 -4
  967. package/dist/collection/components/vega-input-phone-number/assets/flags/tk.js +0 -4
  968. package/dist/collection/components/vega-input-phone-number/assets/flags/tl.js +0 -4
  969. package/dist/collection/components/vega-input-phone-number/assets/flags/tm.js +0 -4
  970. package/dist/collection/components/vega-input-phone-number/assets/flags/tn.js +0 -4
  971. package/dist/collection/components/vega-input-phone-number/assets/flags/to.js +0 -4
  972. package/dist/collection/components/vega-input-phone-number/assets/flags/tr.js +0 -4
  973. package/dist/collection/components/vega-input-phone-number/assets/flags/tt.js +0 -4
  974. package/dist/collection/components/vega-input-phone-number/assets/flags/tv.js +0 -4
  975. package/dist/collection/components/vega-input-phone-number/assets/flags/tw.js +0 -4
  976. package/dist/collection/components/vega-input-phone-number/assets/flags/tz.js +0 -4
  977. package/dist/collection/components/vega-input-phone-number/assets/flags/ua.js +0 -4
  978. package/dist/collection/components/vega-input-phone-number/assets/flags/ug.js +0 -4
  979. package/dist/collection/components/vega-input-phone-number/assets/flags/us.js +0 -4
  980. package/dist/collection/components/vega-input-phone-number/assets/flags/uy.js +0 -4
  981. package/dist/collection/components/vega-input-phone-number/assets/flags/uz.js +0 -4
  982. package/dist/collection/components/vega-input-phone-number/assets/flags/va.js +0 -4
  983. package/dist/collection/components/vega-input-phone-number/assets/flags/vc.js +0 -4
  984. package/dist/collection/components/vega-input-phone-number/assets/flags/ve.js +0 -4
  985. package/dist/collection/components/vega-input-phone-number/assets/flags/vg.js +0 -4
  986. package/dist/collection/components/vega-input-phone-number/assets/flags/vi.js +0 -4
  987. package/dist/collection/components/vega-input-phone-number/assets/flags/vn.js +0 -4
  988. package/dist/collection/components/vega-input-phone-number/assets/flags/vu.js +0 -4
  989. package/dist/collection/components/vega-input-phone-number/assets/flags/wf.js +0 -4
  990. package/dist/collection/components/vega-input-phone-number/assets/flags/ws.js +0 -4
  991. package/dist/collection/components/vega-input-phone-number/assets/flags/xk.js +0 -4
  992. package/dist/collection/components/vega-input-phone-number/assets/flags/ye.js +0 -4
  993. package/dist/collection/components/vega-input-phone-number/assets/flags/yt.js +0 -4
  994. package/dist/collection/components/vega-input-phone-number/assets/flags/za.js +0 -4
  995. package/dist/collection/components/vega-input-phone-number/assets/flags/zm.js +0 -4
  996. package/dist/collection/components/vega-input-phone-number/assets/flags/zw.js +0 -4
  997. package/dist/esm/app-globals-6a7d90a9.js +0 -323
  998. package/dist/esm/child-nodes-event-prevent-slimmer-aab1c019.js +0 -156
  999. package/dist/esm/child-nodes-notify-observer-slimmer-12d38571.js +0 -88
  1000. package/dist/esm/content-state-7e9f3421.js +0 -6603
  1001. package/dist/esm/design-token-e349fd57.js +0 -389
  1002. package/dist/esm/dom-node-subject-factory-286df025.js +0 -230
  1003. package/dist/esm/dom-node-subject-observer-factory-d661fc7c.js +0 -42
  1004. package/dist/esm/element-appender-slimmer-a187435b.js +0 -1463
  1005. package/dist/esm/event-emit-slimmer-acc7fbb7.js +0 -256
  1006. package/dist/esm/form-field-controller-slimmer-c9280871.js +0 -1196
  1007. package/dist/esm/image-annotation-action-2541490e.js +0 -271
  1008. package/dist/esm/index-707fec53.js +0 -39
  1009. package/dist/esm/internal-icon-manager-c05720ca.js +0 -43
  1010. package/dist/esm/internal-vega-event-manager-d2c962d2.js +0 -470
  1011. package/dist/esm/public-rules-596db5ba.js +0 -26
  1012. package/dist/esm/remote-invocation-registry-0b330137.js +0 -63
  1013. package/dist/esm/responsive-format-facade-ce8a1ef5.js +0 -919
  1014. package/dist/esm/rich-text-editor-required-rule-ef25c4da.js +0 -62
  1015. package/dist/esm/static-subject-title-249c76cd.js +0 -49
  1016. package/dist/esm/string-input-formatter-slimmer-452c439c.js +0 -430
  1017. package/dist/esm/style-formatter-3b67ed25.js +0 -32
  1018. package/dist/esm/sub-state-notify-slimmer-c7169226.js +0 -78
  1019. package/dist/esm/sub-state-observer-slimmer-1d3336d6.js +0 -131
  1020. package/dist/esm/translation-4bed3392.js +0 -334
  1021. package/dist/esm/translation-slimmer-fc1ddf17.js +0 -40
  1022. package/dist/esm/vega-internal-event-id-d7113cf7.js +0 -49
  1023. package/dist/esm/vega-skeleton-loader-controller-722a41c2.js +0 -1112
  1024. package/dist/types/components/vega-input-phone-number/assets/country-flags.d.ts +0 -5
  1025. package/dist/vega/p-01d4c679.js +0 -1
  1026. package/dist/vega/p-0a8b91f5.entry.js +0 -1
  1027. package/dist/vega/p-0d8136bc.entry.js +0 -1
  1028. package/dist/vega/p-0f1a56d0.entry.js +0 -1
  1029. package/dist/vega/p-11249b56.entry.js +0 -1
  1030. package/dist/vega/p-11ccc1a9.entry.js +0 -1
  1031. package/dist/vega/p-179887da.js +0 -1
  1032. package/dist/vega/p-179c59ff.js +0 -1
  1033. package/dist/vega/p-1d46d29d.entry.js +0 -1
  1034. package/dist/vega/p-25d18888.entry.js +0 -1
  1035. package/dist/vega/p-27192960.js +0 -1
  1036. package/dist/vega/p-2b7252c6.js +0 -1
  1037. package/dist/vega/p-2d6928c3.entry.js +0 -1
  1038. package/dist/vega/p-32af415d.entry.js +0 -1
  1039. package/dist/vega/p-39bb2289.js +0 -1
  1040. package/dist/vega/p-39d3782b.entry.js +0 -1
  1041. package/dist/vega/p-3b877fa3.entry.js +0 -1
  1042. package/dist/vega/p-3c36bd11.entry.js +0 -1
  1043. package/dist/vega/p-3d236584.entry.js +0 -1
  1044. package/dist/vega/p-46555732.entry.js +0 -1
  1045. package/dist/vega/p-4868e57c.entry.js +0 -1
  1046. package/dist/vega/p-4a47bc03.entry.js +0 -1
  1047. package/dist/vega/p-4e406f70.entry.js +0 -1
  1048. package/dist/vega/p-51686ec2.js +0 -1
  1049. package/dist/vega/p-5299a287.entry.js +0 -1
  1050. package/dist/vega/p-55101775.entry.js +0 -1
  1051. package/dist/vega/p-57f406cf.entry.js +0 -1
  1052. package/dist/vega/p-5825343a.entry.js +0 -1
  1053. package/dist/vega/p-59c9de55.js +0 -1
  1054. package/dist/vega/p-5f5bfd9c.js +0 -1
  1055. package/dist/vega/p-60234e0a.entry.js +0 -1
  1056. package/dist/vega/p-619fdde5.js +0 -1
  1057. package/dist/vega/p-631c8001.entry.js +0 -1
  1058. package/dist/vega/p-639c3322.entry.js +0 -1
  1059. package/dist/vega/p-65dc0b25.entry.js +0 -1
  1060. package/dist/vega/p-66c5fa14.js +0 -1
  1061. package/dist/vega/p-6be0a9bf.entry.js +0 -1
  1062. package/dist/vega/p-71b82ba5.entry.js +0 -1
  1063. package/dist/vega/p-7617b2ac.js +0 -1
  1064. package/dist/vega/p-7839a201.entry.js +0 -1
  1065. package/dist/vega/p-8b044ac7.entry.js +0 -1
  1066. package/dist/vega/p-8d1e0418.entry.js +0 -1
  1067. package/dist/vega/p-901c5b75.js +0 -1
  1068. package/dist/vega/p-99289273.js +0 -1
  1069. package/dist/vega/p-9955844c.entry.js +0 -1
  1070. package/dist/vega/p-9ba28523.js +0 -1
  1071. package/dist/vega/p-9bebdace.entry.js +0 -1
  1072. package/dist/vega/p-9d3d7854.entry.js +0 -1
  1073. package/dist/vega/p-a02f52b7.js +0 -1
  1074. package/dist/vega/p-a04624f3.entry.js +0 -1
  1075. package/dist/vega/p-a247e073.js +0 -1
  1076. package/dist/vega/p-a3fa41c8.js +0 -1
  1077. package/dist/vega/p-a501fb74.entry.js +0 -1
  1078. package/dist/vega/p-a88acecd.entry.js +0 -1
  1079. package/dist/vega/p-acba84aa.entry.js +0 -1
  1080. package/dist/vega/p-b196eab0.entry.js +0 -1
  1081. package/dist/vega/p-b288e52e.entry.js +0 -1
  1082. package/dist/vega/p-b54328c6.js +0 -1
  1083. package/dist/vega/p-b587e576.entry.js +0 -1
  1084. package/dist/vega/p-b6c155d4.entry.js +0 -1
  1085. package/dist/vega/p-b87ede84.entry.js +0 -1
  1086. package/dist/vega/p-c00d95d2.entry.js +0 -13
  1087. package/dist/vega/p-c66b55f8.js +0 -1
  1088. package/dist/vega/p-c8408c13.js +0 -1
  1089. package/dist/vega/p-c8f914d2.js +0 -1
  1090. package/dist/vega/p-c906aa4f.js +0 -1
  1091. package/dist/vega/p-cf3d8e47.entry.js +0 -1
  1092. package/dist/vega/p-d3101d07.entry.js +0 -1
  1093. package/dist/vega/p-d3aa2ea7.entry.js +0 -1
  1094. package/dist/vega/p-d82cdded.entry.js +0 -1
  1095. package/dist/vega/p-d8683a5f.js +0 -1
  1096. package/dist/vega/p-dbd3e747.entry.js +0 -1
  1097. package/dist/vega/p-dd94bd57.entry.js +0 -1
  1098. package/dist/vega/p-e06361df.js +0 -1
  1099. package/dist/vega/p-e244aa52.entry.js +0 -1
  1100. package/dist/vega/p-e8bb5d2e.entry.js +0 -1
  1101. package/dist/vega/p-e8be1bd4.entry.js +0 -1
  1102. package/dist/vega/p-eae914b0.entry.js +0 -1
  1103. package/dist/vega/p-ed569397.entry.js +0 -1
  1104. package/dist/vega/p-f18ed03e.entry.js +0 -1
  1105. package/dist/vega/p-f1e0e7d4.js +0 -1
  1106. package/dist/vega/p-f3ffe0ee.entry.js +0 -1
  1107. package/dist/vega/p-f5c32d70.entry.js +0 -1
  1108. package/dist/vega/p-f8f056db.entry.js +0 -1
  1109. package/dist/vega/p-fe51bfea.entry.js +0 -1
  1110. package/dist/vega/p-fea464ce.entry.js +0 -1
  1111. package/dist/vega/p-ffaafd34.js +0 -1
  1112. /package/dist/collection/components/{vega-input-phone-number → vega-flag-icon}/assets/country-flags.js +0 -0
  1113. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ac.d.ts +0 -0
  1114. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ad.d.ts +0 -0
  1115. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ae.d.ts +0 -0
  1116. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/af.d.ts +0 -0
  1117. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ag.d.ts +0 -0
  1118. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ai.d.ts +0 -0
  1119. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/al.d.ts +0 -0
  1120. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/am.d.ts +0 -0
  1121. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ao.d.ts +0 -0
  1122. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ar.d.ts +0 -0
  1123. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/as.d.ts +0 -0
  1124. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/at.d.ts +0 -0
  1125. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/au.d.ts +0 -0
  1126. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/aw.d.ts +0 -0
  1127. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ax.d.ts +0 -0
  1128. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/az.d.ts +0 -0
  1129. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ba.d.ts +0 -0
  1130. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bb.d.ts +0 -0
  1131. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bd.d.ts +0 -0
  1132. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/be.d.ts +0 -0
  1133. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bf.d.ts +0 -0
  1134. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bg.d.ts +0 -0
  1135. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bh.d.ts +0 -0
  1136. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bi.d.ts +0 -0
  1137. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bj.d.ts +0 -0
  1138. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bl.d.ts +0 -0
  1139. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bm.d.ts +0 -0
  1140. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bn.d.ts +0 -0
  1141. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bo.d.ts +0 -0
  1142. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bq.d.ts +0 -0
  1143. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/br.d.ts +0 -0
  1144. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bs.d.ts +0 -0
  1145. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bt.d.ts +0 -0
  1146. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bw.d.ts +0 -0
  1147. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/by.d.ts +0 -0
  1148. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/bz.d.ts +0 -0
  1149. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ca.d.ts +0 -0
  1150. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cc.d.ts +0 -0
  1151. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cd.d.ts +0 -0
  1152. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cf.d.ts +0 -0
  1153. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cg.d.ts +0 -0
  1154. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ch.d.ts +0 -0
  1155. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ci.d.ts +0 -0
  1156. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ck.d.ts +0 -0
  1157. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cl.d.ts +0 -0
  1158. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cm.d.ts +0 -0
  1159. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cn.d.ts +0 -0
  1160. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/co.d.ts +0 -0
  1161. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cr.d.ts +0 -0
  1162. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cu.d.ts +0 -0
  1163. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cv.d.ts +0 -0
  1164. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cw.d.ts +0 -0
  1165. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cx.d.ts +0 -0
  1166. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cy.d.ts +0 -0
  1167. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/cz.d.ts +0 -0
  1168. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/de.d.ts +0 -0
  1169. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/dj.d.ts +0 -0
  1170. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/dk.d.ts +0 -0
  1171. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/dm.d.ts +0 -0
  1172. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/do.d.ts +0 -0
  1173. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/dz.d.ts +0 -0
  1174. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ec.d.ts +0 -0
  1175. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ee.d.ts +0 -0
  1176. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/eg.d.ts +0 -0
  1177. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/eh.d.ts +0 -0
  1178. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/er.d.ts +0 -0
  1179. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/es.d.ts +0 -0
  1180. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/et.d.ts +0 -0
  1181. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/fi.d.ts +0 -0
  1182. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/fj.d.ts +0 -0
  1183. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/fk.d.ts +0 -0
  1184. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/fm.d.ts +0 -0
  1185. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/fo.d.ts +0 -0
  1186. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/fr.d.ts +0 -0
  1187. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ga.d.ts +0 -0
  1188. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gb.d.ts +0 -0
  1189. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gd.d.ts +0 -0
  1190. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ge.d.ts +0 -0
  1191. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gf.d.ts +0 -0
  1192. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gg.d.ts +0 -0
  1193. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gh.d.ts +0 -0
  1194. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gi.d.ts +0 -0
  1195. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gl.d.ts +0 -0
  1196. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gm.d.ts +0 -0
  1197. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gn.d.ts +0 -0
  1198. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gp.d.ts +0 -0
  1199. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gq.d.ts +0 -0
  1200. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gr.d.ts +0 -0
  1201. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gt.d.ts +0 -0
  1202. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gu.d.ts +0 -0
  1203. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gw.d.ts +0 -0
  1204. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/gy.d.ts +0 -0
  1205. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/hk.d.ts +0 -0
  1206. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/hn.d.ts +0 -0
  1207. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/hr.d.ts +0 -0
  1208. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ht.d.ts +0 -0
  1209. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/hu.d.ts +0 -0
  1210. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/id.d.ts +0 -0
  1211. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ie.d.ts +0 -0
  1212. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/il.d.ts +0 -0
  1213. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/im.d.ts +0 -0
  1214. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/in.d.ts +0 -0
  1215. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/io.d.ts +0 -0
  1216. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/iq.d.ts +0 -0
  1217. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ir.d.ts +0 -0
  1218. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/is.d.ts +0 -0
  1219. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/it.d.ts +0 -0
  1220. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/je.d.ts +0 -0
  1221. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/jm.d.ts +0 -0
  1222. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/jo.d.ts +0 -0
  1223. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/jp.d.ts +0 -0
  1224. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ke.d.ts +0 -0
  1225. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/kg.d.ts +0 -0
  1226. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/kh.d.ts +0 -0
  1227. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ki.d.ts +0 -0
  1228. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/km.d.ts +0 -0
  1229. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/kn.d.ts +0 -0
  1230. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/kp.d.ts +0 -0
  1231. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/kr.d.ts +0 -0
  1232. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/kw.d.ts +0 -0
  1233. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ky.d.ts +0 -0
  1234. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/kz.d.ts +0 -0
  1235. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/la.d.ts +0 -0
  1236. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/lb.d.ts +0 -0
  1237. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/lc.d.ts +0 -0
  1238. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/li.d.ts +0 -0
  1239. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/lk.d.ts +0 -0
  1240. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/lr.d.ts +0 -0
  1241. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ls.d.ts +0 -0
  1242. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/lt.d.ts +0 -0
  1243. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/lu.d.ts +0 -0
  1244. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/lv.d.ts +0 -0
  1245. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ly.d.ts +0 -0
  1246. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ma.d.ts +0 -0
  1247. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mc.d.ts +0 -0
  1248. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/md.d.ts +0 -0
  1249. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/me.d.ts +0 -0
  1250. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mf.d.ts +0 -0
  1251. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mg.d.ts +0 -0
  1252. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mh.d.ts +0 -0
  1253. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mk.d.ts +0 -0
  1254. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ml.d.ts +0 -0
  1255. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mm.d.ts +0 -0
  1256. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mn.d.ts +0 -0
  1257. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mo.d.ts +0 -0
  1258. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mp.d.ts +0 -0
  1259. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mq.d.ts +0 -0
  1260. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mr.d.ts +0 -0
  1261. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ms.d.ts +0 -0
  1262. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mt.d.ts +0 -0
  1263. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mu.d.ts +0 -0
  1264. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mv.d.ts +0 -0
  1265. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mw.d.ts +0 -0
  1266. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mx.d.ts +0 -0
  1267. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/my.d.ts +0 -0
  1268. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/mz.d.ts +0 -0
  1269. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/na.d.ts +0 -0
  1270. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/nc.d.ts +0 -0
  1271. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ne.d.ts +0 -0
  1272. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/nf.d.ts +0 -0
  1273. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ng.d.ts +0 -0
  1274. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ni.d.ts +0 -0
  1275. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/nl.d.ts +0 -0
  1276. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/no.d.ts +0 -0
  1277. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/np.d.ts +0 -0
  1278. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/nr.d.ts +0 -0
  1279. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/nu.d.ts +0 -0
  1280. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/nz.d.ts +0 -0
  1281. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/om.d.ts +0 -0
  1282. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pa.d.ts +0 -0
  1283. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pe.d.ts +0 -0
  1284. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pf.d.ts +0 -0
  1285. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pg.d.ts +0 -0
  1286. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ph.d.ts +0 -0
  1287. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pk.d.ts +0 -0
  1288. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pl.d.ts +0 -0
  1289. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pm.d.ts +0 -0
  1290. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pr.d.ts +0 -0
  1291. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ps.d.ts +0 -0
  1292. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pt.d.ts +0 -0
  1293. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/pw.d.ts +0 -0
  1294. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/py.d.ts +0 -0
  1295. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/qa.d.ts +0 -0
  1296. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/re.d.ts +0 -0
  1297. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ro.d.ts +0 -0
  1298. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/rs.d.ts +0 -0
  1299. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ru.d.ts +0 -0
  1300. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/rw.d.ts +0 -0
  1301. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sa.d.ts +0 -0
  1302. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sb.d.ts +0 -0
  1303. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sc.d.ts +0 -0
  1304. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sd.d.ts +0 -0
  1305. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/se.d.ts +0 -0
  1306. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sg.d.ts +0 -0
  1307. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sh.d.ts +0 -0
  1308. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/si.d.ts +0 -0
  1309. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sj.d.ts +0 -0
  1310. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sk.d.ts +0 -0
  1311. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sl.d.ts +0 -0
  1312. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sm.d.ts +0 -0
  1313. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sn.d.ts +0 -0
  1314. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/so.d.ts +0 -0
  1315. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sr.d.ts +0 -0
  1316. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ss.d.ts +0 -0
  1317. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/st.d.ts +0 -0
  1318. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sv.d.ts +0 -0
  1319. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sx.d.ts +0 -0
  1320. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sy.d.ts +0 -0
  1321. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/sz.d.ts +0 -0
  1322. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ta.d.ts +0 -0
  1323. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tc.d.ts +0 -0
  1324. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/td.d.ts +0 -0
  1325. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tg.d.ts +0 -0
  1326. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/th.d.ts +0 -0
  1327. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tj.d.ts +0 -0
  1328. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tk.d.ts +0 -0
  1329. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tl.d.ts +0 -0
  1330. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tm.d.ts +0 -0
  1331. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tn.d.ts +0 -0
  1332. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/to.d.ts +0 -0
  1333. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tr.d.ts +0 -0
  1334. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tt.d.ts +0 -0
  1335. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tv.d.ts +0 -0
  1336. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tw.d.ts +0 -0
  1337. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/tz.d.ts +0 -0
  1338. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ua.d.ts +0 -0
  1339. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ug.d.ts +0 -0
  1340. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/us.d.ts +0 -0
  1341. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/uy.d.ts +0 -0
  1342. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/uz.d.ts +0 -0
  1343. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/va.d.ts +0 -0
  1344. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/vc.d.ts +0 -0
  1345. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ve.d.ts +0 -0
  1346. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/vg.d.ts +0 -0
  1347. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/vi.d.ts +0 -0
  1348. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/vn.d.ts +0 -0
  1349. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/vu.d.ts +0 -0
  1350. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/wf.d.ts +0 -0
  1351. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ws.d.ts +0 -0
  1352. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/xk.d.ts +0 -0
  1353. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/ye.d.ts +0 -0
  1354. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/yt.d.ts +0 -0
  1355. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/za.d.ts +0 -0
  1356. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/zm.d.ts +0 -0
  1357. /package/dist/types/components/{vega-input-phone-number → vega-flag-icon}/assets/flags/zw.d.ts +0 -0
@@ -0,0 +1,3628 @@
1
+ 'use strict';
2
+
3
+ const changeManager = require('./change-manager-a297e4d2.js');
4
+ const domNodeSubjectFactory = require('./dom-node-subject-factory-d5826bff.js');
5
+ const vegaInternalEventId = require('./vega-internal-event-id-dc866d43.js');
6
+ const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
7
+ const typeGuard = require('./type-guard-4ba85fdc.js');
8
+ const createPublicApiRuntimeMetricsSlimmer = require('./create-public-api-runtime-metrics-slimmer-a3d17afb.js');
9
+ const darkModeStyleController = require('./dark-mode-style-controller-c93b94d2.js');
10
+
11
+ exports.InternalAnnotationTypeEnum = void 0;
12
+ (function (InternalAnnotationTypeEnum) {
13
+ InternalAnnotationTypeEnum["SELECTION_RANGE"] = "SELECTION_RANGE";
14
+ InternalAnnotationTypeEnum["CLEAR_FORMATTING"] = "CLEAR_FORMATTING";
15
+ InternalAnnotationTypeEnum["LINK_GROUP"] = "LINK_GROUP";
16
+ })(exports.InternalAnnotationTypeEnum || (exports.InternalAnnotationTypeEnum = {}));
17
+ /**
18
+ * Abstract class for all annotations
19
+ */
20
+ class Annotation {
21
+ }
22
+
23
+ exports.BlockAnnotationTypeEnum = void 0;
24
+ (function (BlockAnnotationTypeEnum) {
25
+ BlockAnnotationTypeEnum["ALIGNMENT"] = "ALIGNMENT";
26
+ BlockAnnotationTypeEnum["TEXT_STYLE"] = "TEXT_STYLE";
27
+ BlockAnnotationTypeEnum["INDENT"] = "INDENT";
28
+ })(exports.BlockAnnotationTypeEnum || (exports.BlockAnnotationTypeEnum = {}));
29
+ /**
30
+ * BlockAnnotation is an abstract class that represents a block annotation.
31
+ */
32
+ class BlockAnnotation extends Annotation {
33
+ }
34
+
35
+ /**
36
+ * This class is responsible for keeping track of the DOM elements and their corresponding entities.
37
+ */
38
+ class StateEntityRenderingRegistry {
39
+ constructor() {
40
+ this.domToEntity = new WeakMap();
41
+ this.entityToDOM = new WeakMap();
42
+ }
43
+ /**
44
+ * Registers a DOM element and its corresponding entity.
45
+ *
46
+ * @param {HTMLElement} dom The DOM element to register.
47
+ * @param {RTEBlock | RTENode} entity The entity to register.
48
+ */
49
+ register(dom, entity) {
50
+ this.domToEntity.set(dom, entity);
51
+ this.entityToDOM.set(entity, dom);
52
+ }
53
+ /**
54
+ * Retrieves the entity corresponding to a DOM element.
55
+ *
56
+ * @param {HTMLElement} dom The DOM element to retrieve the entity for.
57
+ * @returns {Nullable<RTEBlock | RTENode>} The entity corresponding to the DOM element, or null if not found.
58
+ */
59
+ getEntityByDOM(dom) {
60
+ return this.domToEntity.get(dom);
61
+ }
62
+ /**
63
+ * Retrieves the DOM element corresponding to an entity.
64
+ *
65
+ * @param {RTEBlock | RTENode} entity The entity to retrieve the DOM element for.
66
+ * @returns {Nullable<HTMLElement>} The DOM element corresponding to the entity, or null if not found.
67
+ */
68
+ getDOMByEntity(entity) {
69
+ return this.entityToDOM.get(entity);
70
+ }
71
+ /**
72
+ * Delete the dirty element to entity ref.
73
+ *
74
+ * @example Convert text node to the link node, the old span will change to the link wrapper element, and there will be a new text span, so we need remove the old span ref from the map.
75
+ * @param {HTMLElement} dom - The dirty element ref.
76
+ */
77
+ removeDirtyDomRef(dom) {
78
+ this.domToEntity.delete(dom);
79
+ }
80
+ }
81
+ const stateEntityRenderingRegistry = new StateEntityRenderingRegistry();
82
+
83
+ exports.ModifyContentActionType = void 0;
84
+ (function (ModifyContentActionType) {
85
+ ModifyContentActionType["DELETE_CHILD"] = "DELETE_CHILD";
86
+ ModifyContentActionType["DELETE_NEST_LIST"] = "DELETE_NEST_LIST";
87
+ ModifyContentActionType["UPDATE_TEXT"] = "UPDATE_TEXT";
88
+ ModifyContentActionType["REPLACE_SELECTED_TEXT"] = "REPLACE_SELECTED_TEXT";
89
+ ModifyContentActionType["APPEND_CHILD_NODES"] = "APPEND_CHILD_NODES";
90
+ ModifyContentActionType["INSERT_BLOCKS_AFTER"] = "INSERT_BLOCKS_AFTER";
91
+ ModifyContentActionType["INSERT_BLOCKS_BEFORE"] = "INSERT_BLOCKS_BEFORE";
92
+ ModifyContentActionType["INSERT_NODES_AFTER"] = "INSERT_NODES_AFTER";
93
+ ModifyContentActionType["INSERT_NODES_BEFORE"] = "INSERT_NODES_BEFORE";
94
+ ModifyContentActionType["SPLIT_BLOCK_WITH_NODE"] = "SPLIT_BLOCK_WITH_NODE";
95
+ ModifyContentActionType["REPLACE_CHILD_NODES"] = "REPLACE_CHILD_NODES";
96
+ ModifyContentActionType["REPLACE_NEST_LIST"] = "REPLACE_NEST_LIST";
97
+ ModifyContentActionType["MERGE_TWO_BLOCKS_NODES"] = "MERGE_TWO_BLOCKS_NODES";
98
+ ModifyContentActionType["BREAK_SINGLE_BLOCK"] = "BREAK_SINGLE_BLOCK";
99
+ ModifyContentActionType["LINE_BREAK_SINGLE_BLOCK"] = "LINE_BREAK_SINGLE_BLOCK";
100
+ ModifyContentActionType["LINE_BREAK_MULTIPLE_BLOCKS"] = "LINE_BREAK_MULTIPLE_BLOCKS";
101
+ ModifyContentActionType["TRANSFORM_LIST_BLOCK"] = "TRANSFORM_LIST_BLOCK";
102
+ ModifyContentActionType["TRANSFORM_PARAGRAPH_BLOCK"] = "TRANSFORM_PARAGRAPH_BLOCK";
103
+ ModifyContentActionType["DELETE_BLOCK_CONTENT"] = "DELETE_BLOCK_CONTENT";
104
+ ModifyContentActionType["INSERT_IMAGE_TO_BLOCK"] = "INSERT_IMAGE_TO_BLOCK";
105
+ ModifyContentActionType["UPDATE_IMAGE_NODE_URL"] = "UPDATE_IMAGE_NODE_URL";
106
+ })(exports.ModifyContentActionType || (exports.ModifyContentActionType = {}));
107
+ /**
108
+ * Abstract class for update node content, delete node, insert node
109
+ */
110
+ class ModifyContentAction {
111
+ constructor() {
112
+ this.isFlushable = false;
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Annotation to make block with horizontal alignment
118
+ */
119
+ class HorizontalAlignmentAnnotation extends BlockAnnotation {
120
+ constructor(textAlign) {
121
+ super();
122
+ this.type = exports.BlockAnnotationTypeEnum.ALIGNMENT;
123
+ this.textAlign = textAlign;
124
+ }
125
+ /**
126
+ * Generate the map item for the annotation
127
+ *
128
+ * @param {VegaRTEBlockAlignment} textAlign - Text alignment
129
+ * @returns {[BlockAnnotationTypeEnum.ALIGNMENT, HorizontalAlignmentAnnotation]} Map item for the annotation
130
+ */
131
+ static from(textAlign) {
132
+ return [exports.BlockAnnotationTypeEnum.ALIGNMENT, new HorizontalAlignmentAnnotation(textAlign)];
133
+ }
134
+ /**
135
+ * Generate the JSON item of the annotation
136
+ *
137
+ * @returns {Record<string, unknown>} JSON representation of the annotation
138
+ */
139
+ toJSON() {
140
+ return {
141
+ textAlign: this.textAlign,
142
+ };
143
+ }
144
+ /**
145
+ * Generate the class for the annotation
146
+ *
147
+ * @returns {string} - Annotation class
148
+ */
149
+ renderClass() {
150
+ return `v-rte--horizontal-alignment-${this.textAlign}`;
151
+ }
152
+ /**
153
+ * Generate the style for the annotation
154
+ *
155
+ * @returns {Nullable<AnnotationStyle>} - Annotation style
156
+ */
157
+ render() {
158
+ return null;
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Annotation for block indentation
164
+ */
165
+ class IndentAnnotation extends BlockAnnotation {
166
+ constructor(indent) {
167
+ super();
168
+ this.type = exports.BlockAnnotationTypeEnum.INDENT;
169
+ this.indent = Math.max(0, indent);
170
+ }
171
+ /**
172
+ * Generate the map item for the annotation
173
+ *
174
+ * @param {number} indent - Text alignment
175
+ * @returns {[BlockAnnotationTypeEnum.INDENT, IndentAnnotation]} Map item for the annotation
176
+ */
177
+ static from(indent) {
178
+ return [exports.BlockAnnotationTypeEnum.INDENT, new IndentAnnotation(indent)];
179
+ }
180
+ /**
181
+ * Generate the JSON item of the annotation
182
+ *
183
+ * @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
184
+ */
185
+ toJSON() {
186
+ return this.indent > 0 ? { indent: this.indent } : null;
187
+ }
188
+ /**
189
+ * Generate the style for the annotation
190
+ *
191
+ * @returns {Nullable<AnnotationStyle>} - Annotation style
192
+ */
193
+ render() {
194
+ return this.indent > 0 ? { 'margin-left': `${this.indent * 16}px` } : null;
195
+ }
196
+ }
197
+
198
+ /**
199
+ * The strategies registry, contains static methods `register`, `get` and `getStrategyAndExecute`.
200
+ */
201
+ class ActionHandleStrategyRegistry {
202
+ /**
203
+ * Bind a specific strategy to a special action type of the rich text node.
204
+ *
205
+ * @param {string} actionType - The special action type or the action class name.
206
+ * @param {string} targetClass - The rich text node class name.
207
+ * @param {ActionHandleStrategy} strategy - The action handle strategy instance.
208
+ */
209
+ static register(actionType, targetClass, strategy) {
210
+ if (!this.registry.has(targetClass)) {
211
+ this.registry.set(targetClass, new Map());
212
+ }
213
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
214
+ this.registry.get(targetClass).set(actionType, strategy);
215
+ }
216
+ /**
217
+ * Get the special strategy that handle the action logic.
218
+ *
219
+ * @typedef T generic type
220
+ * @typedef target generic type
221
+ * @typedef R generic type
222
+ * @param {string} actionType - The special action type or the action class name.
223
+ * @param {string} targetClass - The rich text node class name.
224
+ * @returns {Nullable<ActionHandleStrategy<T, target, R>>} - The action handle strategy instance if defined.
225
+ */
226
+ static get(actionType, targetClass) {
227
+ const strategyMap = this.registry.get(targetClass);
228
+ if (strategyMap) {
229
+ return strategyMap.get(actionType);
230
+ }
231
+ }
232
+ /**
233
+ * Get the special strategy from the registry and run the strategy execute method.
234
+ *
235
+ * @typedef R generic type
236
+ * @param {ModifyContentAction | AnnotationAction} action - The update node action instance.
237
+ * @param {RTENode | RTEBlock | VegaRTEContent} RTEInstance - The rich text editor node.
238
+ * @returns {R | undefined} The return value of the strategy method execute invoke result.
239
+ */
240
+ static executeTheStrategy(action, RTEInstance) {
241
+ const actionType = action instanceof ModifyContentAction ? action.type : action.constructor.name;
242
+ const strategy = ActionHandleStrategyRegistry.get(actionType, RTEInstance.constructor.name);
243
+ if (strategy) {
244
+ return strategy.execute(action, RTEInstance);
245
+ }
246
+ else {
247
+ globalSlimmerRegistry.LogUtility.error(`Type ${actionType} action handle strategy is not registered in class ${RTEInstance.constructor.name}`);
248
+ }
249
+ }
250
+ }
251
+ ActionHandleStrategyRegistry.registry = new Map();
252
+
253
+ /**
254
+ * Abstract class for block
255
+ */
256
+ class RTEBlock {
257
+ constructor(id) {
258
+ this.annotationMap = new Map();
259
+ this.id = id;
260
+ }
261
+ /**
262
+ * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
263
+ * and value.
264
+ *
265
+ * @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
266
+ * the type of annotation entity to create.
267
+ * @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
268
+ * that will be used to create the annotation entity. It can be of any type depending on the specific
269
+ * annotation being created.
270
+ * @returns {Nullable<[BlockAnnotationTypeEnum, BlockAnnotation]>} The `createAnnotationEntity` function returns a nullable tuple containing a
271
+ * `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
272
+ */
273
+ static createAnnotationEntity(type, value) {
274
+ switch (type) {
275
+ case 'textAlign':
276
+ return HorizontalAlignmentAnnotation.from(value);
277
+ case 'indent':
278
+ return IndentAnnotation.from(value);
279
+ }
280
+ }
281
+ /**
282
+ * Class to JSON object
283
+ *
284
+ * @returns {VegaRTEBlockBase} - JSON object
285
+ */
286
+ toJSON() {
287
+ const annotations = Array.from(this.annotationMap.values())
288
+ .filter((annotation) => annotation instanceof BlockAnnotation)
289
+ .reduce((record, annotation) => {
290
+ return Object.assign(Object.assign({}, record), annotation.toJSON());
291
+ }, {});
292
+ return Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {}));
293
+ }
294
+ /**
295
+ * Get annotation by type
296
+ *
297
+ * @typedef T generic type
298
+ * @param {keyof typeof BlockAnnotationTypeEnum} type - Annotation type
299
+ * @returns {Nullable<T>} - Annotation
300
+ */
301
+ getAnnotationByType(type) {
302
+ return this.annotationMap.get(type);
303
+ }
304
+ /**
305
+ * Apply action to block
306
+ *
307
+ * @param {AnnotationAction} action - Annotation action
308
+ */
309
+ apply(action) {
310
+ this.doApply(action);
311
+ if (action.isFlushable) {
312
+ const domNode = stateEntityRenderingRegistry.getDOMByEntity(this);
313
+ if (domNode) {
314
+ const nodeSubject = domNodeSubjectFactory.domNodeSubjectFactory.getSubjectFromParentNodeByEventId(domNode, vegaInternalEventId.VegaInternalRichTextEditorFlushChanges);
315
+ if (nodeSubject) {
316
+ changeManager.ChangeManager.notify(nodeSubject, {});
317
+ }
318
+ }
319
+ }
320
+ }
321
+ /**
322
+ * Apply action to block
323
+ *
324
+ * @param {AnnotationAction|ModifyContentAction} action - Annotation action
325
+ */
326
+ doApply(action) {
327
+ if (action instanceof ModifyContentAction) {
328
+ ActionHandleStrategyRegistry.executeTheStrategy(action, this);
329
+ }
330
+ else {
331
+ this.applyAnnotationAction(action);
332
+ }
333
+ }
334
+ /**
335
+ * Apply annotation action to block
336
+ *
337
+ * @param {AnnotationAction} action - Annotation action
338
+ */
339
+ applyAnnotationAction(action) {
340
+ const annotation = action.toAnnotation();
341
+ this.annotationMap.set(annotation.type, annotation);
342
+ typeof this.doAnnotationActionApply === 'function' && this.doAnnotationActionApply(action);
343
+ }
344
+ }
345
+
346
+ var NodeTypeEnum;
347
+ (function (NodeTypeEnum) {
348
+ NodeTypeEnum["TEXT"] = "TEXT";
349
+ NodeTypeEnum["IMAGE"] = "IMAGE";
350
+ })(NodeTypeEnum || (NodeTypeEnum = {}));
351
+ /**
352
+ * Abstract class for all nodes
353
+ */
354
+ class RTENode {
355
+ constructor(id, annotationMap) {
356
+ this.annotationMap = new Map();
357
+ this.id = id;
358
+ if (annotationMap) {
359
+ this.annotationMap = annotationMap;
360
+ }
361
+ }
362
+ /**
363
+ * Get annotation by type
364
+ *
365
+ * @typedef T generic type
366
+ * @param {RTENodeAnnotationMapKey} type - Annotation type
367
+ * @returns {Nullable<T>} - Annotation
368
+ */
369
+ getAnnotationByType(type) {
370
+ return this.annotationMap.get(type);
371
+ }
372
+ /**
373
+ * Delete annotation by type
374
+ *
375
+ * @param {RTENodeAnnotationMapKey} type - Annotation type
376
+ */
377
+ deleteAnnotationByType(type) {
378
+ this.annotationMap.delete(type);
379
+ this.flushChange();
380
+ }
381
+ /**
382
+ * Apply action to node
383
+ *
384
+ * @param {AnnotationAction} action - Annotation action
385
+ * @returns {this} - Node
386
+ */
387
+ apply(action) {
388
+ this.doApply(action);
389
+ if (action.isFlushable) {
390
+ this.flushChange();
391
+ }
392
+ return this;
393
+ }
394
+ /**
395
+ * apply annotation action or modify content action
396
+ *
397
+ * @param {AnnotationAction | ModifyContentAction} action annotation type action or modify content type action
398
+ */
399
+ doApply(action) {
400
+ if (action instanceof ModifyContentAction) {
401
+ this.doModifyActionApply(action);
402
+ }
403
+ else {
404
+ this.doAnnotationActionApply(action);
405
+ }
406
+ }
407
+ /**
408
+ * Flush the value change
409
+ */
410
+ flushChange() {
411
+ const domNode = stateEntityRenderingRegistry.getDOMByEntity(this);
412
+ if (domNode) {
413
+ const nodeSubject = domNodeSubjectFactory.domNodeSubjectFactory.getSubjectFromParentNodeByEventId(domNode, vegaInternalEventId.VegaInternalRichTextEditorFlushChanges);
414
+ if (nodeSubject) {
415
+ changeManager.ChangeManager.notify(nodeSubject, {});
416
+ }
417
+ }
418
+ }
419
+ }
420
+
421
+ exports.NodeAnnotationTypeEnum = void 0;
422
+ (function (NodeAnnotationTypeEnum) {
423
+ NodeAnnotationTypeEnum["BOLD"] = "BOLD";
424
+ NodeAnnotationTypeEnum["ITALIC"] = "ITALIC";
425
+ NodeAnnotationTypeEnum["UNDERLINE"] = "UNDERLINE";
426
+ NodeAnnotationTypeEnum["STRIKETHROUGH"] = "STRIKETHROUGH";
427
+ NodeAnnotationTypeEnum["SELECTION_RANGE"] = "SELECTION_RANGE";
428
+ NodeAnnotationTypeEnum["IMAGE"] = "IMAGE";
429
+ NodeAnnotationTypeEnum["CODE"] = "CODE";
430
+ NodeAnnotationTypeEnum["TEXT_COLOR"] = "TEXT_COLOR";
431
+ NodeAnnotationTypeEnum["LINK"] = "LINK";
432
+ })(exports.NodeAnnotationTypeEnum || (exports.NodeAnnotationTypeEnum = {}));
433
+ /**
434
+ * Abstract class for all annotations
435
+ */
436
+ class NodeAnnotation extends Annotation {
437
+ }
438
+
439
+ /**
440
+ * Annotation for image
441
+ */
442
+ class ImageAnnotation extends NodeAnnotation {
443
+ constructor(size = 'md', alt) {
444
+ super();
445
+ this.type = exports.NodeAnnotationTypeEnum.IMAGE;
446
+ this.size = size;
447
+ this.alt = alt;
448
+ }
449
+ /**
450
+ * Generate the map item for the annotation
451
+ *
452
+ * @param {string} size - Image size
453
+ * @param {string} alt - Image alt
454
+ * @returns {[NodeAnnotationTypeEnum.IMAGE, ImageAnnotation]} Map item for the annotation
455
+ */
456
+ static from(size, alt) {
457
+ return [exports.NodeAnnotationTypeEnum.IMAGE, new ImageAnnotation(size, alt)];
458
+ }
459
+ /**
460
+ * Generate the JSON representation of the annotation
461
+ *
462
+ * @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
463
+ */
464
+ toJSON() {
465
+ return typeGuard.isNonNullable(this.alt)
466
+ ? {
467
+ size: this.size,
468
+ alt: this.alt,
469
+ }
470
+ : {
471
+ size: this.size,
472
+ };
473
+ }
474
+ /**
475
+ * Generate the style for the image
476
+ *
477
+ * @returns {Nullable<AnnotationStyle>} image style
478
+ */
479
+ render() {
480
+ switch (this.size) {
481
+ case 'sm': {
482
+ return { width: '25%' };
483
+ }
484
+ case 'md': {
485
+ return { width: '50%' };
486
+ }
487
+ case 'lg': {
488
+ return { width: '100%' };
489
+ }
490
+ }
491
+ }
492
+ }
493
+
494
+ /**
495
+ * The base action handle strategy class, use to modify the rich text node content or modify the annotation.
496
+ */
497
+ class ActionHandleStrategy {
498
+ /**
499
+ * Public method to invoke the handle logic.
500
+ *
501
+ * @typedef R generic type
502
+ * @param {ModifyContentAction | AnnotationAction} action - The action instance. Contains the action type and necessary params.
503
+ * @param {RTENode | RTEBlock | VegaRTEContent} target - The rich text node instance that will be modified.
504
+ * @returns {R} - The invoke result in special strategy.
505
+ */
506
+ execute(action, target) {
507
+ globalSlimmerRegistry.LogUtility.log(`Executing action ${action.constructor.name} on ${target.constructor.name} ${target['id']}`);
508
+ return this.handleAction(action, target);
509
+ }
510
+ /**
511
+ * Checks if the caret position is at the end of a specified RTETextNode.
512
+ *
513
+ * @param {RTETextBlock} textBlock - `RTETextBlock` - a text block.
514
+ * @param {RTETextNode} node - `RTETextNode` - a node representing an image in a rich text editor.
515
+ * @param {number} startOffset - The position within the text node where the caret is located.
516
+ * @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTETextNode.
517
+ */
518
+ isCaretPositionAtTextBlockEnd(textBlock, node, startOffset) {
519
+ const lastNode = textBlock.nodes[textBlock.nodes.length - 1];
520
+ return node === lastNode && (node.isEmpty() || startOffset === lastNode.text.length);
521
+ }
522
+ /**
523
+ * Checks if the caret position is at the start of a specified RTETextNode.
524
+ *
525
+ * @param {RTETextBlock} textBlock - `RTETextBlock` - a text block.
526
+ * @param {RTETextNode} node - `RTETextNode` - a node representing an image in a rich text editor.
527
+ * @param {number} startOffset - The position within the text node where the caret is located.
528
+ * @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTETextNode.
529
+ */
530
+ isCaretPositionAtTextBlockStart(textBlock, node, startOffset) {
531
+ return node === textBlock.nodes[0] && startOffset === 0;
532
+ }
533
+ /**
534
+ * Checks if the caret position is at the start of a specified RTEImageNode.
535
+ *
536
+ * @param {RTEImageBlock} target - The image block.
537
+ * @param {RTEImageNode} node - `RTEImageNode` - a node representing an image in a rich text editor.
538
+ * @param {number} startOffset - The position within the text node where the caret is located.
539
+ * @returns {boolean} a boolean value, which indicates whether the caret position is at the start of the RTEImageNode.
540
+ */
541
+ isCaretPositionAtImageBlockStart(target, node, startOffset) {
542
+ return node === target.nodes[0] && startOffset === 0;
543
+ }
544
+ /**
545
+ * Checks if the caret position is at the end of a given RTEImageNode.
546
+ *
547
+ * @param {RTEImageBlock} target - The image block.
548
+ * @param {RTEImageNode} node - `node` is a RTEImageNode
549
+ * @param {number} startOffset - The position within the `RTEImageNode` where the caret is located.
550
+ * @returns {boolean}Returns a boolean value indicating whether the caret position is at the end of the `RTEImageNode`.
551
+ */
552
+ isCaretPositionAtImageBlockEnd(target, node, startOffset) {
553
+ const lastNode = target.nodes[target.nodes.length - 1];
554
+ return node === lastNode && startOffset === 1;
555
+ }
556
+ }
557
+
558
+ /**
559
+ * Update the image node annotation map strategy.
560
+ */
561
+ class ImageSetAnnotationMapStrategy extends ActionHandleStrategy {
562
+ /**
563
+ * @inheritDoc
564
+ */
565
+ handleAction(action, target) {
566
+ const annotation = action.toAnnotation();
567
+ target.annotationMap.set(annotation.type, annotation);
568
+ }
569
+ }
570
+
571
+ /**
572
+ * The image node update property url strategy.
573
+ */
574
+ class ImageUpdateUrlStrategy extends ActionHandleStrategy {
575
+ /**
576
+ * @inheritDoc
577
+ */
578
+ handleAction(action, target) {
579
+ target.url = action.url;
580
+ }
581
+ }
582
+
583
+ /**
584
+ * Abstract class for annotation actions
585
+ */
586
+ class AnnotationAction {
587
+ }
588
+
589
+ /**
590
+ * Image node
591
+ */
592
+ class RTEImageNode extends RTENode {
593
+ constructor(id, url, parentBlock, annotationMap) {
594
+ super(id, annotationMap);
595
+ this.type = NodeTypeEnum.IMAGE;
596
+ this.url = url;
597
+ this.parentBlock = parentBlock;
598
+ }
599
+ /**
600
+ * Converts a VegaRTEImageNode into an RTEImageNode by mapping nodes and creating annotations.
601
+ *
602
+ * @param {VegaRTEImageNode} node - The node to be converted.
603
+ * @param {RTEImageBlock} parentBlock - The parent block
604
+ * @returns {RTEImageNode} An instance of `RTEImageBlock`
605
+ */
606
+ static from(node, parentBlock) {
607
+ const imageNode = new RTEImageNode(node.id, node.url, parentBlock);
608
+ let annotations;
609
+ if (!node.annotations || Object.keys(node.annotations).length === 0) {
610
+ annotations = { size: 'md' };
611
+ }
612
+ else {
613
+ annotations = node.annotations;
614
+ }
615
+ imageNode.annotationMap = new Map(Object.keys(annotations)
616
+ .map(() => ImageAnnotation.from(annotations.size, annotations.alt))
617
+ .filter(typeGuard.isNonNullable));
618
+ return imageNode;
619
+ }
620
+ /**
621
+ * @inheritDoc
622
+ */
623
+ toJSON() {
624
+ const imageAnnotation = this.annotationMap.get(exports.NodeAnnotationTypeEnum.IMAGE);
625
+ const annotations = {};
626
+ if (imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.size) {
627
+ annotations.size = imageAnnotation.size;
628
+ }
629
+ if (imageAnnotation === null || imageAnnotation === void 0 ? void 0 : imageAnnotation.alt) {
630
+ annotations.alt = imageAnnotation.alt;
631
+ }
632
+ return Object.assign(Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {})), { type: 'image', url: this.url });
633
+ }
634
+ /**
635
+ * @inheritDoc
636
+ */
637
+ doAnnotationActionApply(action) {
638
+ const strategy = ActionHandleStrategyRegistry.get(AnnotationAction.name, RTEImageNode.name);
639
+ if (strategy) {
640
+ strategy.execute(action, this);
641
+ }
642
+ }
643
+ /**
644
+ * @inheritDoc
645
+ */
646
+ doModifyActionApply(action) {
647
+ ActionHandleStrategyRegistry.executeTheStrategy(action, this);
648
+ }
649
+ }
650
+ (() => {
651
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.UPDATE_IMAGE_NODE_URL, RTEImageNode.name, new ImageUpdateUrlStrategy());
652
+ ActionHandleStrategyRegistry.register(AnnotationAction.name, RTEImageNode.name, new ImageSetAnnotationMapStrategy());
653
+ })();
654
+
655
+ /**
656
+ * Delete child node or child block from the current list action
657
+ *
658
+ * @example needRemovedNode.parentBlock.apply(new RemoveChildAction(needRemovedNode))
659
+ * @example needRemovedBlock.parent.apply(new RemoveChildAction(needRemovedBlock))
660
+ */
661
+ class RemoveChildAction extends ModifyContentAction {
662
+ constructor(childNode) {
663
+ super();
664
+ this.type = exports.ModifyContentActionType.DELETE_CHILD;
665
+ this.entityToBeRemoved = childNode;
666
+ }
667
+ }
668
+
669
+ /**
670
+ * The delete node content contains some common functions that used for image block delete the image node or text block delete text node.
671
+ */
672
+ class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
673
+ /**
674
+ * Returns the previous node relative to the current node in a rich text editor structure.
675
+ *
676
+ * @param {RTENode} currentNode - An object of type `RTENode`.
677
+ * @returns {Nullable<RTENode>} the previous block last node
678
+ */
679
+ getPreviousNode(currentNode) {
680
+ const currentBlock = currentNode.parentBlock;
681
+ const currentIndex = currentBlock['nodes'].indexOf(currentNode);
682
+ if (currentIndex > 0) {
683
+ return currentBlock['nodes'][currentIndex - 1];
684
+ }
685
+ else if (currentBlock.parent) {
686
+ const previousBlock = this.getPreviousBlock(currentBlock);
687
+ if (previousBlock) {
688
+ return this.getBlockLastNode(previousBlock);
689
+ }
690
+ }
691
+ }
692
+ /**
693
+ * Returns the next node relative to the current node in a rich text editor structure.
694
+ *
695
+ * @param {RTENode} currentNode - An object of type `RTENode`.
696
+ * @returns {Nullable<RTENode>} the next block first node
697
+ */
698
+ getNextNode(currentNode) {
699
+ const currentBlock = currentNode.parentBlock;
700
+ const currentIndex = currentBlock['nodes'].indexOf(currentNode);
701
+ if (currentBlock['nodes'][currentIndex + 1]) {
702
+ return currentBlock['nodes'][currentIndex + 1];
703
+ }
704
+ else if (currentBlock.parent) {
705
+ const nextBlock = this.getNextBlock(currentBlock);
706
+ if (nextBlock) {
707
+ return this.getBlockFirstNode(nextBlock);
708
+ }
709
+ }
710
+ }
711
+ /**
712
+ * Determines if a given node is the first node within the current state.
713
+ *
714
+ * @param {RTENode} currentNode - An object representing a node in a rich text editor (RTE).
715
+ * @returns {boolean} True or false;
716
+ */
717
+ isContentFirstNode(currentNode) {
718
+ const currentBlock = currentNode.parentBlock;
719
+ const currentIndex = currentBlock['nodes'].indexOf(currentNode);
720
+ const parent = currentBlock.parent;
721
+ if (currentBlock.type === 'list-item') {
722
+ const listParent = parent.parent;
723
+ return (currentIndex === 0 &&
724
+ Array.isArray(parent['blocks']) &&
725
+ parent['blocks'][0] === currentBlock &&
726
+ listParent['type'] !== 'list-item' &&
727
+ Array.isArray(listParent['blocks']) &&
728
+ listParent['blocks'][0] === parent);
729
+ }
730
+ else {
731
+ return (currentIndex === 0 && Array.isArray(parent['blocks']) && parent['blocks'][0] === currentBlock);
732
+ }
733
+ }
734
+ /**
735
+ * TODO: The getPreviousBlock add nest list support
736
+ * This function retrieves the previous block in a rich text editor, considering different scenarios such as being in a bullet list.
737
+ *
738
+ * @param {RTEBlock} currentBlock - Used to retrieve the previous block relative to the given `currentBlock` within a rich text editor context.
739
+ * @returns {Nullable<RTEBlock>} The previous block if existing
740
+ */
741
+ getPreviousBlock(currentBlock) {
742
+ if (currentBlock && currentBlock.parent && currentBlock.parent['blocks']) {
743
+ const currentBlockIndex = currentBlock.parent['blocks'].indexOf(currentBlock);
744
+ if (currentBlockIndex > 0) {
745
+ return currentBlock.parent['blocks'][currentBlockIndex - 1];
746
+ }
747
+ else if ((currentBlock.parent['type'] === 'number-list' ||
748
+ currentBlock.parent['type'] === 'bullet-list') &&
749
+ currentBlockIndex === 0) {
750
+ return this.getPreviousBlock(currentBlock.parent);
751
+ }
752
+ }
753
+ }
754
+ /**
755
+ * Returns the last node within a given RTE block, handling different block types accordingly.
756
+ *
757
+ * @param {RTEBlock} currentBlock - Returns the last node within that block.
758
+ * @returns {Nullable<RTENode>} Returns the last node of the given `currentBlock` object.
759
+ */
760
+ getBlockLastNode(currentBlock) {
761
+ if (currentBlock.type === 'list-item') {
762
+ if (currentBlock['children'] && currentBlock['children'].length > 0) {
763
+ return this.getBlockLastNode(currentBlock['children'][currentBlock['children'].length - 1]);
764
+ }
765
+ else {
766
+ return currentBlock['nodes'][currentBlock['nodes'].length - 1];
767
+ }
768
+ }
769
+ else if (currentBlock.type === 'number-list' || currentBlock.type === 'bullet-list') {
770
+ const listItems = currentBlock.blocks;
771
+ if (listItems) {
772
+ const lastListItem = listItems[listItems.length - 1];
773
+ return this.getBlockLastNode(lastListItem);
774
+ }
775
+ }
776
+ else {
777
+ if (currentBlock['nodes']) {
778
+ return currentBlock['nodes'][currentBlock['nodes'].length - 1];
779
+ }
780
+ }
781
+ }
782
+ /**
783
+ * Returns the first node within a given RTE block, handling different block types accordingly.
784
+ *
785
+ * @param {RTEBlock} currentBlock - Returns the first node within that block.
786
+ * @returns {Nullable<RTENode>} Returns the first node of the given `currentBlock` object.
787
+ */
788
+ getBlockFirstNode(currentBlock) {
789
+ if (currentBlock.type === 'number-list' || currentBlock.type === 'bullet-list') {
790
+ if (currentBlock.blocks) {
791
+ const firstListItem = currentBlock.blocks[0];
792
+ return this.getBlockFirstNode(firstListItem);
793
+ }
794
+ }
795
+ else {
796
+ if (currentBlock['nodes']) {
797
+ return currentBlock['nodes'][0];
798
+ }
799
+ }
800
+ }
801
+ /**
802
+ * This function retrieves the next block in a rich text editor, considering different scenarios such as being in a bullet list.
803
+ *
804
+ * @param {RTEBlock} currentBlock - Used to retrieve the next block relative to the given `currentBlock` within a rich text editor context.
805
+ * @returns {Nullable<RTEBlock>} The next block if existing
806
+ */
807
+ getNextBlock(currentBlock) {
808
+ if (currentBlock && currentBlock.parent && currentBlock.parent['blocks']) {
809
+ const currentBlockIndex = currentBlock.parent['blocks'].indexOf(currentBlock);
810
+ if (currentBlock.parent['blocks'][currentBlockIndex + 1]) {
811
+ return currentBlock.parent['blocks'][currentBlockIndex + 1];
812
+ }
813
+ else if (currentBlock.type === 'list-item' &&
814
+ currentBlock.parent.blocks.length === currentBlockIndex + 1) {
815
+ return this.getNextBlock(currentBlock.parent);
816
+ }
817
+ }
818
+ }
819
+ }
820
+
821
+ /**
822
+ * The image block delete the image node strategy.
823
+ */
824
+ class BlockDeleteImageStrategy extends BlockDeleteNodeContentStrategy {
825
+ /**
826
+ * @inheritDoc
827
+ */
828
+ handleAction(action, target) {
829
+ this.deleteNodeContent(action, target);
830
+ }
831
+ /**
832
+ * Deletes content from a block node based on specific conditions.
833
+ *
834
+ * @param {DeleteBlockContentAction} action - Delete block content action
835
+ * @param {RTEImageBlock} target - The image block.
836
+ */
837
+ deleteNodeContent(action, target) {
838
+ const startContainerNode = action
839
+ .startContainerNode, startOffset = action.startOffset;
840
+ let previousNode = this.getPreviousNode(startContainerNode);
841
+ let nextNode = null;
842
+ if (startOffset === 1) {
843
+ const parentBlock = target;
844
+ if (this.isContentFirstNode(startContainerNode)) {
845
+ nextNode = this.getNextNode(startContainerNode);
846
+ }
847
+ if (parentBlock.nodes.length === 1) {
848
+ parentBlock.parent.apply(new RemoveChildAction(parentBlock));
849
+ }
850
+ else {
851
+ parentBlock.apply(new RemoveChildAction(startContainerNode));
852
+ }
853
+ }
854
+ else {
855
+ const shouldRemoveNode = previousNode;
856
+ if (shouldRemoveNode && shouldRemoveNode instanceof RTEImageNode) {
857
+ previousNode = this.getPreviousNode(shouldRemoveNode);
858
+ shouldRemoveNode.parentBlock.apply(new RemoveChildAction(shouldRemoveNode));
859
+ if (!previousNode) {
860
+ action.nextNode = startContainerNode;
861
+ }
862
+ }
863
+ }
864
+ if (previousNode) {
865
+ action.previousNode = previousNode;
866
+ }
867
+ else if (nextNode) {
868
+ action.nextNode = nextNode;
869
+ }
870
+ }
871
+ }
872
+
873
+ /** Append blocks or nodes to a block */
874
+ class AppendChildNodesAction extends ModifyContentAction {
875
+ constructor(childNodes) {
876
+ super();
877
+ this.type = exports.ModifyContentActionType.APPEND_CHILD_NODES;
878
+ this.entityToBeAppended = childNodes;
879
+ }
880
+ }
881
+
882
+ /**
883
+ * Append the second block child nodes to the first block child nodes and remove the second block strategy.
884
+ */
885
+ class BlockMergeNodesStrategy extends ActionHandleStrategy {
886
+ /**
887
+ * Merges the child nodes of two RTEBlocks if they have the same type or both are not images.
888
+ *
889
+ * @param {MergeTwoBlocksNodesAction} action - The merge block nodes action instance.
890
+ * @param {RTETextBlock | RTEImageBlock} target - The first text block or image block.
891
+ */
892
+ handleAction(action, target) {
893
+ const anotherBlock = action.blockNeedToBeMerged;
894
+ if (target.type === anotherBlock.type || (target.type !== 'image' && anotherBlock.type !== 'image')) {
895
+ let shouldMergeNodes = anotherBlock['nodes'];
896
+ if (anotherBlock['type'] !== 'image') {
897
+ shouldMergeNodes = anotherBlock['nodes'].filter((node) => node.text);
898
+ }
899
+ target.apply(new AppendChildNodesAction(shouldMergeNodes));
900
+ anotherBlock.parent.apply(new RemoveChildAction(anotherBlock));
901
+ }
902
+ }
903
+ }
904
+
905
+ /**
906
+ * Remove the node from the text block or image block strategy.
907
+ */
908
+ class BlockRemoveNodeStrategy extends ActionHandleStrategy {
909
+ /**
910
+ * Remove the text node from the parent text block or remove the image node from the parent image block.
911
+ * Remove the block if the block nodes is empty after delete the current node.
912
+ *
913
+ * @param {RemoveChildAction} action - The remove child action instance.
914
+ * @param {RTETextBlock | RTEImageBlock} target - The parent block of the node that will be removed.
915
+ */
916
+ handleAction(action, target) {
917
+ const arrayFixed = target.nodes;
918
+ target.nodes = arrayFixed.filter((node) => node !== action.entityToBeRemoved);
919
+ if (target.nodes.length === 0 && target.parent) {
920
+ target.parent.apply(new RemoveChildAction(target));
921
+ }
922
+ }
923
+ }
924
+
925
+ /**
926
+ * Append the nodes to the text block or image block strategy.
927
+ */
928
+ class BlockAppendNodesStrategy extends ActionHandleStrategy {
929
+ /**
930
+ * Append the text nodes to the text block or the image block.
931
+ *
932
+ * @param {AppendChildNodesAction} action - The remove child action instance.
933
+ * @param {RTETextBlock | RTEImageBlock} target - The parent block of the node that will be removed.
934
+ */
935
+ handleAction(action, target) {
936
+ const nodesToBeAppended = action.entityToBeAppended;
937
+ nodesToBeAppended.forEach((node) => {
938
+ node.parentBlock = target;
939
+ });
940
+ // This line is used to fix the typescript error `This expression is not callable`. https://github.com/microsoft/TypeScript/issues/44373
941
+ const arrayFixed = target.nodes;
942
+ target.nodes = arrayFixed.concat(nodesToBeAppended);
943
+ }
944
+ }
945
+
946
+ /**
947
+ * Remove all nodes and append new nodes strategy.
948
+ */
949
+ class BlockReplaceNodesStrategy extends ActionHandleStrategy {
950
+ /**
951
+ * Empty the text block or image block nodes and add new nodes.
952
+ *
953
+ * @param {ReplaceChildNodesAction} action - The replace child nodes action instance.
954
+ * @param {RTETextBlock | RTEImageBlock} target - The text block or the image block.
955
+ */
956
+ handleAction(action, target) {
957
+ target.nodes = [];
958
+ target.apply(new AppendChildNodesAction(action.newChildNodes));
959
+ }
960
+ }
961
+
962
+ /**
963
+ * Insert a new block after a existing block
964
+ *
965
+ * @example currentBlock.parent.apply(new InsertBlocksAfterAction(currentBlock, newBlock, ...))
966
+ */
967
+ class InsertBlocksAfterAction extends ModifyContentAction {
968
+ constructor(referBlock, ...blocksToBeInserted) {
969
+ super();
970
+ this.type = exports.ModifyContentActionType.INSERT_BLOCKS_AFTER;
971
+ this.referBlock = referBlock;
972
+ this.blocksToBeInserted = blocksToBeInserted;
973
+ }
974
+ }
975
+
976
+ /**
977
+ * Clear the current block nodes and append new nodes
978
+ *
979
+ * @example block.apply(new ReplaceChildNodesAction(newNodes))
980
+ */
981
+ class ReplaceChildNodesAction extends ModifyContentAction {
982
+ constructor(newChildNodes) {
983
+ super();
984
+ this.type = exports.ModifyContentActionType.REPLACE_CHILD_NODES;
985
+ this.newChildNodes = newChildNodes;
986
+ }
987
+ }
988
+
989
+ /**
990
+ * Split the current image block with a special position strategy.
991
+ */
992
+ class BlockSplitWithImageNodeStrategy extends ActionHandleStrategy {
993
+ /**
994
+ * @inheritDoc
995
+ */
996
+ handleAction(action, target) {
997
+ action.newBlock = this.splitImageNodes(action.splitPointNode, action.startOffsetOfNode, target);
998
+ }
999
+ /**
1000
+ * The image offset should be 0 or 1
1001
+ * <vega-rich-text-image-editor><img /></vega-rich-text-image-editor>
1002
+ *
1003
+ * @param {RTEImageNode} imageNode The split point image node.
1004
+ * @param {number} imageOffset The cursor point 0 | 1.
1005
+ * @param {RTEImageBlock} target The image block.
1006
+ * @returns {Nullable<RTEBlock>} The new block after split
1007
+ */
1008
+ splitImageNodes(imageNode, imageOffset, target) {
1009
+ const nodesSplitIndex = target.nodes.indexOf(imageNode);
1010
+ if (nodesSplitIndex > -1) {
1011
+ const beforeNodes = target.nodes.slice(0, nodesSplitIndex + imageOffset);
1012
+ const afterNodes = target.nodes.slice(nodesSplitIndex + imageOffset);
1013
+ target.apply(new ReplaceChildNodesAction(beforeNodes));
1014
+ const newBlock = this.cloneWithNodes(afterNodes, target);
1015
+ target.parent.apply(new InsertBlocksAfterAction(target, newBlock));
1016
+ return newBlock;
1017
+ }
1018
+ }
1019
+ /**
1020
+ * Creates a new RTEImageBlock instance with the provided RTEImageNode instances appended to it.
1021
+ *
1022
+ * @param {RTEImageNode[]} nodes - An array of RTEImageNode objects that will be used to create a new RTEImageBlock instance.
1023
+ * @param {RTEImageBlock} target The image block.
1024
+ * @returns {RTEImageBlock} A new `RTEImageBlock` object with the provided `nodes` appended to it.
1025
+ */
1026
+ cloneWithNodes(nodes, target) {
1027
+ const block = target.createNewImageBlock();
1028
+ block.nodes = [];
1029
+ block.apply(new AppendChildNodesAction(nodes));
1030
+ return block;
1031
+ }
1032
+ }
1033
+
1034
+ /**
1035
+ * Insert a new block before a existing block
1036
+ *
1037
+ * @example currentBlock.parent.apply(new InsertBlocksBeforeAction(currentBlock, newBlock, ...))
1038
+ */
1039
+ class InsertBlocksBeforeAction extends ModifyContentAction {
1040
+ constructor(referBlock, ...blocksToBeInserted) {
1041
+ super();
1042
+ this.type = exports.ModifyContentActionType.INSERT_BLOCKS_BEFORE;
1043
+ this.referBlock = referBlock;
1044
+ this.blocksToBeInserted = blocksToBeInserted;
1045
+ }
1046
+ }
1047
+
1048
+ /**
1049
+ * Split the block with a split point node.
1050
+ * The property `newBlock` use to store the new create block if need.
1051
+ *
1052
+ * @example block.apply(new SplitBlockWithNodeAction(node, offset))
1053
+ */
1054
+ class SplitBlockWithNodeAction extends ModifyContentAction {
1055
+ constructor(splitPointNode, startOffsetOfNode) {
1056
+ super();
1057
+ this.type = exports.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE;
1058
+ this.splitPointNode = splitPointNode;
1059
+ this.startOffsetOfNode = startOffsetOfNode;
1060
+ }
1061
+ }
1062
+
1063
+ /**
1064
+ * Abstract class for which can be splittable
1065
+ */
1066
+ class TextSplittableAction extends AnnotationAction {
1067
+ constructor() {
1068
+ super(...arguments);
1069
+ /**
1070
+ * Whether the action should split the node
1071
+ */
1072
+ this.doSplit = true;
1073
+ }
1074
+ }
1075
+
1076
+ /**
1077
+ * Annotation to represent a selection range
1078
+ */
1079
+ class SelectionRangeAnnotation extends Annotation {
1080
+ constructor(range) {
1081
+ super();
1082
+ this.type = exports.InternalAnnotationTypeEnum.SELECTION_RANGE;
1083
+ this.range = range;
1084
+ }
1085
+ }
1086
+
1087
+ /**
1088
+ * Annotation to make text with strikethrough
1089
+ */
1090
+ class StrikethroughAnnotation extends NodeAnnotation {
1091
+ constructor(underline) {
1092
+ super();
1093
+ this.type = exports.NodeAnnotationTypeEnum.STRIKETHROUGH;
1094
+ this.strikethrough = underline;
1095
+ }
1096
+ /**
1097
+ * Generate the map item for the annotation
1098
+ *
1099
+ * @param {Nullable<boolean>} strikethrough - Strikethrough annotation
1100
+ * @returns {[NodeAnnotationTypeEnum.STRIKETHROUGH, StrikethroughAnnotation]} Map item for the annotation
1101
+ */
1102
+ static from(strikethrough) {
1103
+ return [exports.NodeAnnotationTypeEnum.STRIKETHROUGH, new StrikethroughAnnotation(strikethrough)];
1104
+ }
1105
+ /**
1106
+ * Generate the JSON representation of the annotation
1107
+ *
1108
+ * @returns {Record<string, unknown>} JSON representation of the annotation
1109
+ */
1110
+ toJSON() {
1111
+ return {
1112
+ strikethrough: this.strikethrough,
1113
+ };
1114
+ }
1115
+ /**
1116
+ * Generate the class for the annotation
1117
+ *
1118
+ * @returns {Nullable<string>} - Annotation class
1119
+ */
1120
+ renderClass() {
1121
+ return this.strikethrough ? 'v-rte--strikethrough' : null;
1122
+ }
1123
+ /**
1124
+ * Generate the style for the annotation
1125
+ *
1126
+ * @returns {Nullable<AnnotationStyle>} - Annotation style
1127
+ */
1128
+ render() {
1129
+ return null;
1130
+ }
1131
+ }
1132
+
1133
+ /**
1134
+ * Annotation to make text with underline
1135
+ */
1136
+ class UnderlineAnnotation extends NodeAnnotation {
1137
+ constructor(underline) {
1138
+ super();
1139
+ this.type = exports.NodeAnnotationTypeEnum.UNDERLINE;
1140
+ this.underline = underline;
1141
+ }
1142
+ /**
1143
+ * Generate the map item for the annotation
1144
+ *
1145
+ * @param {boolean} underline - Underline annotation
1146
+ * @returns {[NodeAnnotationTypeEnum.UNDERLINE, UnderlineAnnotation]} Map item for the annotation
1147
+ */
1148
+ static from(underline) {
1149
+ return [exports.NodeAnnotationTypeEnum.UNDERLINE, new UnderlineAnnotation(underline)];
1150
+ }
1151
+ /**
1152
+ * Generate the JSON representation of the annotation
1153
+ *
1154
+ * @returns {Record<string, unknown>} JSON representation of the annotation
1155
+ */
1156
+ toJSON() {
1157
+ return {
1158
+ underline: this.underline,
1159
+ };
1160
+ }
1161
+ /**
1162
+ * Generate the class for the annotation
1163
+ *
1164
+ * @returns {Nullable<string>} - Annotation class
1165
+ */
1166
+ renderClass() {
1167
+ return this.underline ? 'v-rte--underline' : null;
1168
+ }
1169
+ /**
1170
+ * Generate the style for the annotation
1171
+ *
1172
+ * @returns {Nullable<AnnotationStyle>} - Annotation style
1173
+ */
1174
+ render() {
1175
+ return null;
1176
+ }
1177
+ }
1178
+
1179
+ /**
1180
+ * Annotation to make text Italic
1181
+ */
1182
+ class ItalicAnnotation extends NodeAnnotation {
1183
+ constructor(italic) {
1184
+ super();
1185
+ this.type = exports.NodeAnnotationTypeEnum.ITALIC;
1186
+ this.italic = italic;
1187
+ }
1188
+ /**
1189
+ * Generate the map item for the annotation
1190
+ *
1191
+ * @param {boolean} italic - Italic annotation
1192
+ * @returns {[NodeAnnotationTypeEnum.ITALIC, ItalicAnnotation]} Map item for the annotation
1193
+ */
1194
+ static from(italic) {
1195
+ return [exports.NodeAnnotationTypeEnum.ITALIC, new ItalicAnnotation(italic)];
1196
+ }
1197
+ /**
1198
+ * Generate the JSON representation of the annotation
1199
+ *
1200
+ * @returns {Record<string, unknown>} JSON representation of the annotation
1201
+ */
1202
+ toJSON() {
1203
+ return {
1204
+ italic: this.italic,
1205
+ };
1206
+ }
1207
+ /**
1208
+ * Generate the style for the annotation
1209
+ *
1210
+ * @returns {Nullable<AnnotationStyle>} Italic style
1211
+ */
1212
+ render() {
1213
+ return this.italic ? { 'font-style': 'italic' } : null;
1214
+ }
1215
+ }
1216
+
1217
+ /**
1218
+ * Annotation to make text bold
1219
+ */
1220
+ class BoldAnnotation extends NodeAnnotation {
1221
+ constructor(bold) {
1222
+ super();
1223
+ this.type = exports.NodeAnnotationTypeEnum.BOLD;
1224
+ this.bold = bold;
1225
+ }
1226
+ /**
1227
+ * Generate the map item for the annotation
1228
+ *
1229
+ * @param {boolean} bold - Bold annotation
1230
+ * @returns {[NodeAnnotationTypeEnum.BOLD, BoldAnnotation]} Map item for the annotation
1231
+ */
1232
+ static from(bold) {
1233
+ return [exports.NodeAnnotationTypeEnum.BOLD, new BoldAnnotation(bold)];
1234
+ }
1235
+ /**
1236
+ * Generate the JSON representation of the annotation
1237
+ *
1238
+ * @returns {Record<string, unknown>} JSON representation of the annotation
1239
+ */
1240
+ toJSON() {
1241
+ return {
1242
+ bold: this.bold,
1243
+ };
1244
+ }
1245
+ /**
1246
+ * Generate the style for the annotation
1247
+ *
1248
+ * @returns {Nullable<AnnotationStyle>} Bold style
1249
+ */
1250
+ render() {
1251
+ return this.bold ? { 'font-weight': '700' } : null;
1252
+ }
1253
+ }
1254
+
1255
+ /**
1256
+ * Annotation to make text code
1257
+ */
1258
+ class CodeAnnotation extends NodeAnnotation {
1259
+ constructor(code) {
1260
+ super();
1261
+ this.type = exports.NodeAnnotationTypeEnum.CODE;
1262
+ this.code = code;
1263
+ }
1264
+ /**
1265
+ * Generate the map item for the annotation
1266
+ *
1267
+ * @param {boolean} code - Bold annotation
1268
+ * @returns {[NodeAnnotationTypeEnum.CODE, CodeAnnotation]} Map item for the annotation
1269
+ */
1270
+ static from(code) {
1271
+ return [exports.NodeAnnotationTypeEnum.CODE, new CodeAnnotation(code)];
1272
+ }
1273
+ /**
1274
+ * Generate the JSON representation of the annotation
1275
+ *
1276
+ * @returns {Record<string, unknown>} JSON representation of the annotation
1277
+ */
1278
+ toJSON() {
1279
+ return {
1280
+ code: this.code,
1281
+ };
1282
+ }
1283
+ /**
1284
+ * Generate the class for the annotation
1285
+ *
1286
+ * @returns {Nullable<string>} - Annotation class
1287
+ */
1288
+ renderClass() {
1289
+ return this.code ? 'v-rte--code' : null;
1290
+ }
1291
+ /**
1292
+ * Generate the style for the annotation
1293
+ *
1294
+ * @returns {Nullable<AnnotationStyle>} Bold style
1295
+ */
1296
+ render() {
1297
+ return null;
1298
+ }
1299
+ }
1300
+
1301
+ const RTE_TEXT_COLORS = [
1302
+ {
1303
+ key: 'black',
1304
+ light: '#111128',
1305
+ dark: '#E3E3E8',
1306
+ },
1307
+ {
1308
+ key: 'gray',
1309
+ light: '#5E5E6D',
1310
+ dark: '#B9B9C1',
1311
+ },
1312
+ {
1313
+ key: 'green',
1314
+ light: '#01801F',
1315
+ dark: '#59D977',
1316
+ },
1317
+ {
1318
+ key: 'red',
1319
+ light: '#BD2947',
1320
+ dark: '#FFB2B5',
1321
+ },
1322
+ {
1323
+ key: 'purple',
1324
+ light: '#563D82',
1325
+ dark: '#BEB2FF',
1326
+ },
1327
+ {
1328
+ key: 'teal',
1329
+ light: '#17758F',
1330
+ dark: '#4CD8FF',
1331
+ },
1332
+ ];
1333
+ const ZERO_WIDTH_SPACE = '\u200b';
1334
+
1335
+ /**
1336
+ * Annotation to make text with text color
1337
+ */
1338
+ class TextColorAnnotation extends NodeAnnotation {
1339
+ constructor(textColor) {
1340
+ super();
1341
+ this.type = exports.NodeAnnotationTypeEnum.TEXT_COLOR;
1342
+ this.textColor = this.formatTextColor(textColor);
1343
+ }
1344
+ /**
1345
+ * Generate the map item for the annotation
1346
+ *
1347
+ * @param {string} textColor - text color annotation
1348
+ * @returns {[NodeAnnotationTypeEnum.TEXT_COLOR, TextColorAnnotation]} Map item for the annotation
1349
+ */
1350
+ static from(textColor) {
1351
+ return [exports.NodeAnnotationTypeEnum.TEXT_COLOR, new TextColorAnnotation(textColor)];
1352
+ }
1353
+ /**
1354
+ * Generate the JSON representation of the annotation
1355
+ *
1356
+ * @returns {Record<string, unknown>} JSON representation of the annotation
1357
+ */
1358
+ toJSON() {
1359
+ return {
1360
+ textColor: this.textColor.key,
1361
+ };
1362
+ }
1363
+ /**
1364
+ * Generate the class for the annotation
1365
+ *
1366
+ * @returns {Nullable<string>} - Annotation class
1367
+ */
1368
+ renderClass() {
1369
+ return null;
1370
+ }
1371
+ /**
1372
+ * Generate the style for the annotation
1373
+ *
1374
+ * @returns {Nullable<AnnotationStyle>} - Annotation style
1375
+ */
1376
+ render() {
1377
+ return {
1378
+ color: darkModeStyleController.VegaInternalThemeManager.isDarkMode() ? this.textColor.dark : this.textColor.light,
1379
+ };
1380
+ }
1381
+ /**
1382
+ * format text color
1383
+ *
1384
+ * @param {string} textColor - text color
1385
+ * @returns {VegaRTEColorSchema} - VegaRTEColorSchema
1386
+ */
1387
+ formatTextColor(textColor) {
1388
+ return (RTE_TEXT_COLORS.find((item) => item.key === textColor) || RTE_TEXT_COLORS[0]);
1389
+ }
1390
+ }
1391
+
1392
+ /**
1393
+ * Annotation to make text a link
1394
+ */
1395
+ class LinkAnnotation extends NodeAnnotation {
1396
+ constructor(link) {
1397
+ super();
1398
+ this.type = exports.NodeAnnotationTypeEnum.LINK;
1399
+ this.link = link;
1400
+ }
1401
+ /**
1402
+ * Generate the map item for the annotation
1403
+ *
1404
+ * @param {VegaRTELink} link - Bold annotation
1405
+ * @returns {[NodeAnnotationTypeEnum.LINK, LinkAnnotation]} Map item for the annotation
1406
+ */
1407
+ static from(link) {
1408
+ return [
1409
+ exports.NodeAnnotationTypeEnum.LINK,
1410
+ new LinkAnnotation({ href: link.href, groupKey: link.groupKey }),
1411
+ ];
1412
+ }
1413
+ /**
1414
+ * Generate the JSON representation of the annotation
1415
+ *
1416
+ * @returns {Record<'link', VegaRTELink>} JSON representation of the annotation
1417
+ */
1418
+ toJSON() {
1419
+ return { link: { href: this.link.href, groupKey: this.link.groupKey } };
1420
+ }
1421
+ /**
1422
+ * Verify whether two link annotation is same or not
1423
+ *
1424
+ * @param {LinkAnnotation} annotation - Compared annotation
1425
+ * @returns {boolean} Whether two link annotation is same or not
1426
+ */
1427
+ toEqual(annotation) {
1428
+ return this.link.groupKey === annotation.link.groupKey;
1429
+ }
1430
+ /**
1431
+ * Generate the style for the annotation
1432
+ *
1433
+ * @returns {Nullable<AnnotationStyle>} Link style
1434
+ */
1435
+ render() {
1436
+ return null;
1437
+ }
1438
+ }
1439
+
1440
+ /**
1441
+ * Annotation to represent a link of grouped nodes
1442
+ */
1443
+ class LinkGroupAnnotation extends Annotation {
1444
+ constructor(groupKey) {
1445
+ super();
1446
+ this.type = exports.InternalAnnotationTypeEnum.LINK_GROUP;
1447
+ this.linkGroups = new Map();
1448
+ this.linkGroups = new Map([[groupKey, []]]);
1449
+ }
1450
+ }
1451
+
1452
+ /**
1453
+ * Action to link a group of nodes
1454
+ */
1455
+ class LinkGroupAnnotationAction extends AnnotationAction {
1456
+ constructor(groupKey, nodes) {
1457
+ super();
1458
+ this.isFlushable = false;
1459
+ this.groupKey = groupKey;
1460
+ this.nodes = nodes;
1461
+ }
1462
+ /**
1463
+ * Converts the action to an annotation
1464
+ *
1465
+ * @returns {Annotation} The annotation
1466
+ */
1467
+ toAnnotation() {
1468
+ return new LinkGroupAnnotation(this.groupKey);
1469
+ }
1470
+ }
1471
+
1472
+ /**
1473
+ * Sync up selection action
1474
+ */
1475
+ class SyncUpSelectionAction extends AnnotationAction {
1476
+ constructor() {
1477
+ super();
1478
+ this.isFlushable = false;
1479
+ }
1480
+ /**
1481
+ * annotation null
1482
+ *
1483
+ * @returns {Nullable<Annotation>} null
1484
+ */
1485
+ toAnnotation() {
1486
+ return null;
1487
+ }
1488
+ }
1489
+
1490
+ /**
1491
+ * Update the editor text node text content strategy.
1492
+ */
1493
+ class NodeUpdateTextStrategy extends ActionHandleStrategy {
1494
+ /**
1495
+ * Updates the text content of a node and unlink the node if it is a link node and the text is deleted.
1496
+ *
1497
+ * @param {UpdateTextAction} action - The update text action instance.
1498
+ * @param {RTETextNode} target - The text node instance which need update the text.
1499
+ */
1500
+ handleAction(action, target) {
1501
+ target.text = action.newTextContent;
1502
+ // The link node should unlink when delete all text
1503
+ if (!target.text && target.annotationMap.has('LINK')) {
1504
+ target.annotationMap.delete(exports.NodeAnnotationTypeEnum.LINK);
1505
+ }
1506
+ }
1507
+ }
1508
+
1509
+ /**
1510
+ * Update the text node property text action
1511
+ *
1512
+ * @example textNode.apply(new UpdateTextAction(newText))
1513
+ */
1514
+ class UpdateTextAction extends ModifyContentAction {
1515
+ constructor(text) {
1516
+ super();
1517
+ this.type = exports.ModifyContentActionType.UPDATE_TEXT;
1518
+ this.newTextContent = '';
1519
+ this.newTextContent = text;
1520
+ }
1521
+ }
1522
+
1523
+ /**
1524
+ * Replaces the rich text node selected text strategy.
1525
+ */
1526
+ class NodeReplaceSelectedTextStrategy extends ActionHandleStrategy {
1527
+ /**
1528
+ * @inheritDoc
1529
+ */
1530
+ handleAction(action, target) {
1531
+ this.replaceSelectedText(action.textToBeInsert, action.currentRange, target);
1532
+ }
1533
+ /**
1534
+ * Replaces the selected text within a given range with a new text in a TypeScript class.
1535
+ *
1536
+ * @param {string} text - The new text that will replace the currently selected text within the specified range.
1537
+ * @param {RTERange} currentRange - A range of text within a Rich Text Editor (RTE).
1538
+ * @param {RTETextNode} target - The RTE text node instance.
1539
+ */
1540
+ replaceSelectedText(text, currentRange, target) {
1541
+ if (currentRange && currentRange.startContainer && currentRange.endContainer) {
1542
+ const { startContainer, endContainer, startOffset, endOffset } = currentRange;
1543
+ let newText = target.text;
1544
+ if (startContainer === endContainer && startOffset === endOffset && text) {
1545
+ newText = target.text.slice(0, startOffset) + text + target.text.slice(startOffset);
1546
+ }
1547
+ else {
1548
+ const startNode = startContainer.parentElement;
1549
+ const endNode = endContainer.parentElement;
1550
+ const startItemDto = startNode && stateEntityRenderingRegistry.getEntityByDOM(startNode);
1551
+ const endItemDto = endNode && stateEntityRenderingRegistry.getEntityByDOM(endNode);
1552
+ let startIndex = 0, endIndex = target.text.length;
1553
+ if (startItemDto && startItemDto === target) {
1554
+ startIndex = startOffset;
1555
+ endIndex = startContainer === endContainer ? endOffset : endIndex;
1556
+ }
1557
+ else if (endItemDto && endItemDto === target) {
1558
+ endIndex = endOffset;
1559
+ }
1560
+ newText = target.text.slice(0, startIndex) + text + target.text.slice(endIndex);
1561
+ }
1562
+ target.apply(new UpdateTextAction(newText));
1563
+ }
1564
+ }
1565
+ }
1566
+
1567
+ /**
1568
+ * Split the text node into two or there nodes according to the rules.
1569
+ */
1570
+ class NodeSplitTextStrategy extends ActionHandleStrategy {
1571
+ constructor() {
1572
+ super(...arguments);
1573
+ // The new create node that need apply annotation or the current target. This property used to export after the execute method invoke.
1574
+ this.applyTargetNode = null;
1575
+ }
1576
+ /**
1577
+ * Split the text node.
1578
+ *
1579
+ * @param {TextSplittableAction} action - The split action.
1580
+ * @param {RTETextNode} target - The text node that need to be splited.
1581
+ * @returns {Nullable<RTETextNode>} - The new insert text node or the current text node that need to apply the action.
1582
+ */
1583
+ handleAction(action, target) {
1584
+ const selectionRangeAnnotation = target.getAnnotationByType(exports.InternalAnnotationTypeEnum.SELECTION_RANGE);
1585
+ this.setApplyTargetNode(null);
1586
+ if (action instanceof TextSplittableAction && action.doSplit && selectionRangeAnnotation) {
1587
+ const { startContainer, endContainer, startOffset, endOffset } = selectionRangeAnnotation.range;
1588
+ const noTextRangeSelected = startContainer === endContainer && startOffset === endOffset;
1589
+ target.parentBlock.nodes = target.parentBlock.nodes.flatMap((item) => {
1590
+ if (item.id === target.id) {
1591
+ if (noTextRangeSelected) {
1592
+ return this.insertNewNode(startOffset, target);
1593
+ }
1594
+ if (this.shouldSplitSelection(selectionRangeAnnotation.range)) {
1595
+ return this.splitTextNode(selectionRangeAnnotation.range, target);
1596
+ }
1597
+ else {
1598
+ this.setApplyTargetNode(target);
1599
+ return target;
1600
+ }
1601
+ }
1602
+ return item;
1603
+ });
1604
+ }
1605
+ return this.applyTargetNode;
1606
+ }
1607
+ /**
1608
+ * Insert the new node at the start offset
1609
+ *
1610
+ * @param {number} startOffset - The start position offset
1611
+ * @param {RTETextNode} target - RTETextNode
1612
+ * @returns {RTETextNode[]} - RTETextNode array
1613
+ */
1614
+ insertNewNode(startOffset, target) {
1615
+ const newNode = target.cloneWithText('');
1616
+ this.setApplyTargetNode(newNode);
1617
+ if (startOffset === 0) {
1618
+ return [newNode, target];
1619
+ }
1620
+ if (startOffset === target.text.length) {
1621
+ return [target, newNode];
1622
+ }
1623
+ const beforeNode = target.cloneWithText(target.text.substring(0, startOffset));
1624
+ const afterNode = target.cloneWithText(target.text.substring(startOffset));
1625
+ return [beforeNode, newNode, afterNode];
1626
+ }
1627
+ /**
1628
+ * Whether a given range should be split based on various conditions within the range.
1629
+ *
1630
+ * @param {Range} range - Selection range
1631
+ * @returns {boolean} Returns a boolean value indicating whether the selection range should be split.
1632
+ */
1633
+ shouldSplitSelection(range) {
1634
+ const { startContainer, endContainer, startOffset, endOffset } = range;
1635
+ const isCrossNode = startContainer !== endContainer;
1636
+ const isPartialStart = startOffset > 0;
1637
+ const isPartialEnd = endOffset < (endContainer.textContent ? endContainer.textContent.length : 0);
1638
+ const isPartialSelection = isPartialStart || isPartialEnd;
1639
+ return isCrossNode || isPartialSelection;
1640
+ }
1641
+ /**
1642
+ * Split text node with range
1643
+ *
1644
+ * @param {Range} range - Selection range
1645
+ * @param {RTETextNode} target - RTETextNode
1646
+ * @returns {RTETextNode[] | RTETextNode} RTETextNode array
1647
+ */
1648
+ splitTextNode(range, target) {
1649
+ const { startContainer, endContainer, startOffset } = range;
1650
+ const startNode = startContainer.parentElement;
1651
+ const endNode = endContainer.parentElement;
1652
+ /**
1653
+ * Split the text from the start offset to the end offset
1654
+ *
1655
+ * @param {string} text - The text string
1656
+ * @param {number} startOffset - The start offset position
1657
+ * @param {number} endOffset - The end offset position
1658
+ * @returns {RTETextNode[]} - The split text node array
1659
+ */
1660
+ const splitText = (text, startOffset, endOffset) => {
1661
+ const beforeText = text.substring(0, startOffset);
1662
+ const selectedText = text.substring(startOffset, endOffset);
1663
+ const afterText = text.substring(endOffset);
1664
+ return [
1665
+ target.cloneWithText(beforeText),
1666
+ target.cloneWithText(selectedText),
1667
+ target.cloneWithText(afterText),
1668
+ ];
1669
+ };
1670
+ const startItemDto = startNode && stateEntityRenderingRegistry.getEntityByDOM(startNode);
1671
+ const endItemDto = endNode && stateEntityRenderingRegistry.getEntityByDOM(endNode);
1672
+ if (startItemDto && startItemDto.id === target.id) {
1673
+ const endOffset = startContainer === endContainer ? range.endOffset : target.text.length;
1674
+ const [beforeNode, selectedNode, afterNode] = splitText(target.text, startOffset, endOffset);
1675
+ this.setApplyTargetNode(selectedNode);
1676
+ return [beforeNode, selectedNode, afterNode].filter((node) => !!node.text);
1677
+ }
1678
+ else if (endItemDto && endItemDto.id === target.id) {
1679
+ const [beforeNode, selectedNode, afterNode] = splitText(target.text, 0, range.endOffset);
1680
+ this.setApplyTargetNode(selectedNode);
1681
+ return [beforeNode, selectedNode, afterNode].filter((node) => !!node.text);
1682
+ }
1683
+ else {
1684
+ this.setApplyTargetNode(target);
1685
+ return target;
1686
+ }
1687
+ }
1688
+ /**
1689
+ * Store the text node which need to apply the annotation. Clear the value if the input is null.
1690
+ *
1691
+ * @param {RTETextNode | null} node - The new text node.
1692
+ */
1693
+ setApplyTargetNode(node) {
1694
+ this.applyTargetNode = node;
1695
+ }
1696
+ }
1697
+
1698
+ /**
1699
+ * Annotation to host which annotations will be clear formatting
1700
+ */
1701
+ class ClearFormattingAnnotation extends Annotation {
1702
+ constructor() {
1703
+ super(...arguments);
1704
+ this.type = exports.InternalAnnotationTypeEnum.CLEAR_FORMATTING;
1705
+ this.items = [
1706
+ exports.NodeAnnotationTypeEnum.BOLD,
1707
+ exports.NodeAnnotationTypeEnum.ITALIC,
1708
+ exports.NodeAnnotationTypeEnum.UNDERLINE,
1709
+ exports.NodeAnnotationTypeEnum.STRIKETHROUGH,
1710
+ exports.NodeAnnotationTypeEnum.TEXT_COLOR,
1711
+ exports.NodeAnnotationTypeEnum.CODE,
1712
+ ];
1713
+ }
1714
+ }
1715
+
1716
+ /**
1717
+ * Action to toggle clear formatting
1718
+ */
1719
+ class ClearFormattingAnnotationAction extends TextSplittableAction {
1720
+ constructor() {
1721
+ super(...arguments);
1722
+ this.isFlushable = true;
1723
+ }
1724
+ /**
1725
+ * Converts the action to an annotation
1726
+ *
1727
+ * @returns {Annotation} the annotation
1728
+ */
1729
+ toAnnotation() {
1730
+ return new ClearFormattingAnnotation();
1731
+ }
1732
+ }
1733
+
1734
+ /**
1735
+ * Action to toggle code annotation
1736
+ */
1737
+ class CodeAnnotationAction extends TextSplittableAction {
1738
+ constructor(code) {
1739
+ super();
1740
+ this.isFlushable = true;
1741
+ this.code = code;
1742
+ }
1743
+ /**
1744
+ * Converts the action to an annotation
1745
+ *
1746
+ * @returns {CodeAnnotation} the annotation
1747
+ */
1748
+ toAnnotation() {
1749
+ return new CodeAnnotation(this.code);
1750
+ }
1751
+ }
1752
+
1753
+ /**
1754
+ * Delete the node annotation by type
1755
+ */
1756
+ class DeleteNodeAnnotationAction extends AnnotationAction {
1757
+ constructor(annotationType) {
1758
+ super();
1759
+ this.isFlushable = true;
1760
+ this.annotationType = annotationType;
1761
+ }
1762
+ /**
1763
+ * Don't need this for this action
1764
+ *
1765
+ * @returns {Nullable<Annotation>} undefined
1766
+ */
1767
+ toAnnotation() {
1768
+ return undefined;
1769
+ }
1770
+ }
1771
+
1772
+ /**
1773
+ * Action to toggle link annotation
1774
+ */
1775
+ class LinkAnnotationAction extends TextSplittableAction {
1776
+ constructor({ link, newText, needMergeNode, doSplit, }) {
1777
+ super();
1778
+ this.isFlushable = true;
1779
+ this.link = link;
1780
+ this.needMergeNode = needMergeNode;
1781
+ this.newText = newText;
1782
+ if (typeGuard.isNonNullable(doSplit)) {
1783
+ this.doSplit = doSplit;
1784
+ }
1785
+ }
1786
+ /**
1787
+ * Converts the action to an annotation
1788
+ *
1789
+ * @returns {LinkAnnotation} the annotation
1790
+ */
1791
+ toAnnotation() {
1792
+ return new LinkAnnotation(this.link);
1793
+ }
1794
+ }
1795
+
1796
+ /**
1797
+ * The current strategy used to modify the text node annotation map.
1798
+ */
1799
+ class NodeUpdateAnnotationMapStrategy extends ActionHandleStrategy {
1800
+ /**
1801
+ * Remove or set annotation to the text node annotation map.
1802
+ *
1803
+ * @param {AnnotationAction} action - The annotation action instance.
1804
+ * @param {RTETextNode} target - The current text node.
1805
+ */
1806
+ handleAction(action, target) {
1807
+ const annotation = action.toAnnotation();
1808
+ if (action instanceof DeleteNodeAnnotationAction) {
1809
+ target.annotationMap.delete(action.annotationType);
1810
+ return;
1811
+ }
1812
+ if (annotation instanceof ClearFormattingAnnotation) {
1813
+ annotation.items.forEach((item) => {
1814
+ target.deleteAnnotationByType(item);
1815
+ });
1816
+ return;
1817
+ }
1818
+ if (annotation instanceof NodeAnnotation || annotation instanceof SelectionRangeAnnotation) {
1819
+ if (action instanceof LinkAnnotationAction) {
1820
+ if (typeGuard.isNonNullable(action.newText)) {
1821
+ target.text = action.newText;
1822
+ }
1823
+ target.parentBlock.apply(new LinkGroupAnnotationAction(action.link.groupKey, [target]));
1824
+ }
1825
+ if (action instanceof CodeAnnotationAction) {
1826
+ this.handleAction(new ClearFormattingAnnotationAction(), target);
1827
+ }
1828
+ target.annotationMap.set(annotation.type, annotation);
1829
+ return;
1830
+ }
1831
+ }
1832
+ }
1833
+
1834
+ /**
1835
+ * Text node
1836
+ */
1837
+ class RTETextNode extends RTENode {
1838
+ constructor(id, text, parentBlock, annotationMap) {
1839
+ super(id, annotationMap);
1840
+ this.type = NodeTypeEnum.TEXT;
1841
+ this.parentBlock = parentBlock;
1842
+ this.text = text;
1843
+ }
1844
+ /**
1845
+ * Creates an RTETextNode from a VegaRTETextNode with annotations and a parent RTETextBlock.
1846
+ *
1847
+ * @param {VegaRTETextNode} richText - A rich text node
1848
+ * @param {RTETextBlock} parentBlock - Parent block
1849
+ * @returns {RTETextNode} an RTETextNode
1850
+ */
1851
+ static from(richText, parentBlock) {
1852
+ const textNode = new RTETextNode(richText.id, richText.text, parentBlock);
1853
+ const { annotations } = richText;
1854
+ if (annotations) {
1855
+ textNode.annotationMap = new Map(Object.keys(annotations)
1856
+ .map((type) => {
1857
+ if (annotations.link) {
1858
+ parentBlock.apply(new LinkGroupAnnotationAction(annotations.link.groupKey, [textNode]));
1859
+ }
1860
+ return this.createAnnotationEntity(type, annotations[type]);
1861
+ })
1862
+ .filter(typeGuard.isNonNullable));
1863
+ }
1864
+ return textNode;
1865
+ }
1866
+ /**
1867
+ * Creates different types of text annotations based on the provided type and value.
1868
+ *
1869
+ * @param {keyof VegaRTETextAnnotations} type - The key of the type.
1870
+ * @param {unknown} value - The value that will be used to create the specific type of annotation entity based on the `type` provided.
1871
+ * @returns {Nullable<[RTENodeAnnotationMapKey, RTENodeAnnotationMapValue]>} Returning a nullable tuple containing a key and a
1872
+ * value from the `RTENodeAnnotationMapKey` and `RTENodeAnnotationMapValue` types.
1873
+ */
1874
+ static createAnnotationEntity(type, value) {
1875
+ switch (type) {
1876
+ case 'bold':
1877
+ return BoldAnnotation.from(value);
1878
+ case 'italic':
1879
+ return ItalicAnnotation.from(value);
1880
+ case 'underline':
1881
+ return UnderlineAnnotation.from(value);
1882
+ case 'strikethrough':
1883
+ return StrikethroughAnnotation.from(value);
1884
+ case 'code':
1885
+ return CodeAnnotation.from(value);
1886
+ case 'textColor':
1887
+ return TextColorAnnotation.from(value);
1888
+ case 'link':
1889
+ return LinkAnnotation.from(value);
1890
+ }
1891
+ }
1892
+ /**
1893
+ * @inheritDoc
1894
+ */
1895
+ toJSON() {
1896
+ const annotations = Array.from(this.annotationMap.values())
1897
+ .filter((annotation) => annotation instanceof NodeAnnotation)
1898
+ .reduce((record, annotation) => {
1899
+ return Object.assign(Object.assign({}, record), annotation.toJSON());
1900
+ }, {});
1901
+ return Object.assign(Object.assign({ id: this.id }, (Object.keys(annotations).length > 0 ? { annotations } : {})), { type: 'text', text: this.text });
1902
+ }
1903
+ /**
1904
+ * Creates a new RTETextNode with the specified text and copies the parent block and annotation map from the original node.
1905
+ *
1906
+ * @param {string} text - The text content of the RTETextNode that will be created.
1907
+ * @returns {RTETextNode} An new RTETextNode
1908
+ */
1909
+ cloneWithText(text) {
1910
+ return new RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), text, this.parentBlock, new Map(this.annotationMap));
1911
+ }
1912
+ /**
1913
+ * Checks if a node is empty
1914
+ *
1915
+ * @returns {boolean} It returns `true` if the node is empty
1916
+ */
1917
+ isEmpty() {
1918
+ return !this.text || this.text === ZERO_WIDTH_SPACE || this.text === '\n';
1919
+ }
1920
+ /**
1921
+ * @inheritDoc
1922
+ */
1923
+ doAnnotationActionApply(action) {
1924
+ const selectionRangeAnnotation = this.getAnnotationByType(exports.InternalAnnotationTypeEnum.SELECTION_RANGE);
1925
+ if (action instanceof TextSplittableAction && action.doSplit && selectionRangeAnnotation) {
1926
+ const splitStrategy = ActionHandleStrategyRegistry.get(TextSplittableAction.name, RTETextNode.name);
1927
+ if (splitStrategy) {
1928
+ const newNode = splitStrategy.execute(action, this);
1929
+ if (newNode) {
1930
+ this.applyActionToNode(newNode, action);
1931
+ }
1932
+ }
1933
+ }
1934
+ else {
1935
+ this.applyActionToNode(this, action);
1936
+ }
1937
+ this.parentBlock.mergeNodes(action);
1938
+ }
1939
+ /**
1940
+ * @inheritDoc
1941
+ */
1942
+ doModifyActionApply(action) {
1943
+ ActionHandleStrategyRegistry.executeTheStrategy(action, this);
1944
+ }
1945
+ /**
1946
+ * Apply action to node
1947
+ *
1948
+ * @param {RTETextNode} node - Text node
1949
+ * @param {AnnotationAction} action - AnnotationAction
1950
+ */
1951
+ applyActionToNode(node, action) {
1952
+ const annotation = action.toAnnotation();
1953
+ if (action instanceof SyncUpSelectionAction) {
1954
+ this.syncUpSelectedNodes(node);
1955
+ return;
1956
+ }
1957
+ // Sync up RTETextNode selected state to selection controller for any action apply, except selection range change.
1958
+ if (!(annotation instanceof SelectionRangeAnnotation)) {
1959
+ this.syncUpSelectedNodes(node);
1960
+ }
1961
+ const updateAnnotationMapStrategy = ActionHandleStrategyRegistry.get(AnnotationAction.name, RTETextNode.name);
1962
+ if (updateAnnotationMapStrategy) {
1963
+ updateAnnotationMapStrategy.execute(action, node);
1964
+ return;
1965
+ }
1966
+ }
1967
+ /**
1968
+ * Sync up the selected node by change manager
1969
+ *
1970
+ * @param {RTETextNode} selectedNode - The selected node
1971
+ */
1972
+ syncUpSelectedNodes(selectedNode) {
1973
+ const currentNodeDom = stateEntityRenderingRegistry.getDOMByEntity(this);
1974
+ if (currentNodeDom) {
1975
+ const nodeSubject = domNodeSubjectFactory.domNodeSubjectFactory.getSubjectFromParentNodeByEventId(currentNodeDom, vegaInternalEventId.VegaInternalRichTextEditorSelectionRangeChange);
1976
+ if (nodeSubject) {
1977
+ changeManager.ChangeManager.notify(nodeSubject, { node: selectedNode });
1978
+ }
1979
+ }
1980
+ }
1981
+ }
1982
+ (() => {
1983
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.UPDATE_TEXT, RTETextNode.name, new NodeUpdateTextStrategy());
1984
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.REPLACE_SELECTED_TEXT, RTETextNode.name, new NodeReplaceSelectedTextStrategy());
1985
+ ActionHandleStrategyRegistry.register(TextSplittableAction.name, RTETextNode.name, new NodeSplitTextStrategy());
1986
+ ActionHandleStrategyRegistry.register(AnnotationAction.name, RTETextNode.name, new NodeUpdateAnnotationMapStrategy());
1987
+ })();
1988
+
1989
+ /**
1990
+ * Text style annotation
1991
+ */
1992
+ class TextStyleAnnotation extends BlockAnnotation {
1993
+ constructor(textStyle) {
1994
+ super();
1995
+ this.type = exports.BlockAnnotationTypeEnum.TEXT_STYLE;
1996
+ this.textStyle = textStyle;
1997
+ }
1998
+ /**
1999
+ * Generate the map item for the annotations
2000
+ *
2001
+ * @param {VegaRTETextStyleType} textStyle - the text style type
2002
+ * @returns {[BlockAnnotationTypeEnum.TEXT_STYLE, TextStyleAnnotation]} Map item for the annotation
2003
+ */
2004
+ static from(textStyle) {
2005
+ return [exports.BlockAnnotationTypeEnum.TEXT_STYLE, new TextStyleAnnotation(textStyle)];
2006
+ }
2007
+ /**
2008
+ * Generate the JSON representation of the annotation
2009
+ *
2010
+ * @returns {Nullable<Record<string, unknown>>} JSON representation of the annotation
2011
+ */
2012
+ toJSON() {
2013
+ return { textStyle: this.textStyle };
2014
+ }
2015
+ /**
2016
+ * Render the styles by block type
2017
+ *
2018
+ * @returns {AnnotationStyle} the styles to apply
2019
+ */
2020
+ render() {
2021
+ const paragraphStyle = {
2022
+ fontFamily: 'Inter',
2023
+ fontSize: '16px',
2024
+ lineHeight: '22px',
2025
+ fontWeight: '500',
2026
+ };
2027
+ switch (this.textStyle) {
2028
+ case 'paragraph': {
2029
+ return paragraphStyle;
2030
+ }
2031
+ case 'title': {
2032
+ return { fontFamily: 'Inter', fontSize: '36px', lineHeight: '40px', fontWeight: '500' };
2033
+ }
2034
+ case 'subtitle': {
2035
+ return { fontFamily: 'Inter', fontSize: '28px', lineHeight: '32px', fontWeight: '500' };
2036
+ }
2037
+ case 'heading-1': {
2038
+ return { fontFamily: 'Inter', fontSize: '22px', lineHeight: '24px', fontWeight: '500' };
2039
+ }
2040
+ case 'heading-2': {
2041
+ return { fontFamily: 'Inter', fontSize: '20px', lineHeight: '24px', fontWeight: '500' };
2042
+ }
2043
+ case 'heading-3': {
2044
+ return { fontFamily: 'Inter', fontSize: '18px', lineHeight: '22px', fontWeight: '500' };
2045
+ }
2046
+ }
2047
+ }
2048
+ }
2049
+
2050
+ /**
2051
+ * Action to change the text style of a block
2052
+ */
2053
+ class TextStyleAnnotationAction extends AnnotationAction {
2054
+ constructor(textStyle, bold) {
2055
+ super();
2056
+ this.isFlushable = true;
2057
+ this.textStyle = textStyle;
2058
+ this.bold = bold;
2059
+ }
2060
+ /**
2061
+ * Converts the action to a block annotation
2062
+ *
2063
+ * @returns {BlockAnnotation} the block annotation
2064
+ */
2065
+ toAnnotation() {
2066
+ return new TextStyleAnnotation(this.textStyle);
2067
+ }
2068
+ }
2069
+
2070
+ /**
2071
+ * Action to toggle bold annotation
2072
+ */
2073
+ class BoldAnnotationAction extends TextSplittableAction {
2074
+ constructor(bold) {
2075
+ super();
2076
+ this.isFlushable = true;
2077
+ this.bold = bold;
2078
+ }
2079
+ /**
2080
+ * Converts the action to an annotation
2081
+ *
2082
+ * @returns {BoldAnnotation} the annotation
2083
+ */
2084
+ toAnnotation() {
2085
+ return new BoldAnnotation(this.bold);
2086
+ }
2087
+ }
2088
+
2089
+ /**
2090
+ * Update the text block text style strategy.
2091
+ */
2092
+ class BlockUpdateTextStyleStrategy extends ActionHandleStrategy {
2093
+ /**
2094
+ * Update the text block type and add or remove the bold style from child nodes.
2095
+ *
2096
+ * @param {TextStyleAnnotationAction} action - The text style annotation action.
2097
+ * @param {RTETextBlock} target - The current text block.
2098
+ */
2099
+ handleAction(action, target) {
2100
+ if (target.type !== 'list-item') {
2101
+ target.type = action.textStyle;
2102
+ }
2103
+ if (action.bold) {
2104
+ target.nodes.forEach((node) => {
2105
+ const boldAnnotationAction = new BoldAnnotationAction(true);
2106
+ boldAnnotationAction.doSplit = false;
2107
+ node.apply(boldAnnotationAction);
2108
+ });
2109
+ }
2110
+ else {
2111
+ target.nodes.forEach((node) => {
2112
+ node.apply(new DeleteNodeAnnotationAction(exports.NodeAnnotationTypeEnum.BOLD));
2113
+ });
2114
+ }
2115
+ }
2116
+ }
2117
+
2118
+ /**
2119
+ * Update the text block link group annotation strategy.
2120
+ */
2121
+ class BlockUpdateLinkGroupStrategy extends ActionHandleStrategy {
2122
+ /**
2123
+ * Update link group after the child link node update.
2124
+ *
2125
+ * @param {LinkGroupAnnotationAction} action - The link group annotation action instance.
2126
+ * @param {RTETextBlock} target - The current text block.
2127
+ */
2128
+ handleAction(action, target) {
2129
+ const linkGroupAnnotation = target.getAnnotationByType(exports.InternalAnnotationTypeEnum.LINK_GROUP);
2130
+ if (linkGroupAnnotation) {
2131
+ const linkGroup = linkGroupAnnotation.linkGroups.get(action.groupKey);
2132
+ linkGroupAnnotation.linkGroups.set(action.groupKey, [...linkGroup, ...action.nodes]);
2133
+ target.annotationMap.set(exports.InternalAnnotationTypeEnum.LINK_GROUP, linkGroupAnnotation);
2134
+ }
2135
+ }
2136
+ }
2137
+
2138
+ /**
2139
+ * Split the current node with a special position strategy.
2140
+ */
2141
+ class BlockSplitWithTextNodeStrategy extends ActionHandleStrategy {
2142
+ /**
2143
+ * @inheritDoc
2144
+ */
2145
+ handleAction(action, target) {
2146
+ action.newBlock = this.splitTextNodeBlock(action.splitPointNode, action.startOffsetOfNode, target);
2147
+ }
2148
+ /**
2149
+ * Splits a text node at a specified offset within a block of nodes and returns a new block with the split nodes.
2150
+ *
2151
+ * @param {RTETextNode} splitNode - The text node that will be split
2152
+ * @param {number} startOffsetOfNode - The index at which will split the text content of the `splitNode`.
2153
+ * @param {RTETextBlock} textBlock - The text block need to be splited.
2154
+ * @returns {Nullable<RTEBlock>} return either an RTEBlock object or null.
2155
+ */
2156
+ splitTextNodeBlock(splitNode, startOffsetOfNode, textBlock) {
2157
+ if (splitNode) {
2158
+ const beforeText = splitNode.text.slice(0, startOffsetOfNode);
2159
+ const afterText = splitNode.text.slice(startOffsetOfNode);
2160
+ const nodesSplitIndex = textBlock.nodes.indexOf(splitNode);
2161
+ if (nodesSplitIndex > -1) {
2162
+ const beforeNodes = textBlock.nodes.slice(0, nodesSplitIndex);
2163
+ const afterNodes = textBlock.nodes.slice(nodesSplitIndex + 1);
2164
+ if (beforeText) {
2165
+ beforeNodes.push(splitNode.cloneWithText(beforeText));
2166
+ }
2167
+ if (afterText) {
2168
+ afterNodes.unshift(splitNode.cloneWithText(afterText));
2169
+ }
2170
+ textBlock.apply(new ReplaceChildNodesAction(beforeNodes));
2171
+ const newBlock = textBlock.cloneWithNodes(afterNodes);
2172
+ textBlock.parent.apply(new InsertBlocksAfterAction(textBlock, newBlock));
2173
+ return newBlock;
2174
+ }
2175
+ }
2176
+ }
2177
+ }
2178
+
2179
+ /**
2180
+ * Insert new paragraph into current text block at special position.
2181
+ */
2182
+ class BlockInsertNewParagraphStrategy extends ActionHandleStrategy {
2183
+ /**
2184
+ * @inheritDoc
2185
+ */
2186
+ handleAction(action, target) {
2187
+ action.newBlock = this.breakSingleTextBlock(action.startContainerNode, action.startOffset, target);
2188
+ }
2189
+ /**
2190
+ * breakSingleTextBlock
2191
+ *
2192
+ * @param {RTETextNode} splitNode -
2193
+ * @param {number} startOffsetOfNode -
2194
+ * @param {RTETextBlock} target -
2195
+ * @returns {Nullable<RTEBlock>} Nullable<RTEBlock>
2196
+ */
2197
+ breakSingleTextBlock(splitNode, startOffsetOfNode, target) {
2198
+ const newParagraph = this.copyInlineStyleToNewParagraph(splitNode, target);
2199
+ if (this.isCaretPositionAtTextBlockEnd(target, splitNode, startOffsetOfNode)) {
2200
+ target.parent.apply(new InsertBlocksAfterAction(target, newParagraph));
2201
+ }
2202
+ else if (this.isCaretPositionAtTextBlockStart(target, splitNode, startOffsetOfNode)) {
2203
+ target.parent.apply(new InsertBlocksBeforeAction(target, newParagraph));
2204
+ }
2205
+ else {
2206
+ const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
2207
+ target.apply(splitBlockAction);
2208
+ return splitBlockAction.newBlock;
2209
+ }
2210
+ return newParagraph;
2211
+ }
2212
+ /**
2213
+ * copyInlineStyleToNewParagraph
2214
+ *
2215
+ * @param {RTETextNode} needCopedNode - The text node.
2216
+ * @param {RTETextBlock} target - The text block.
2217
+ * @returns {RTETextBlock} - The new paragraph.
2218
+ */
2219
+ copyInlineStyleToNewParagraph(needCopedNode, target) {
2220
+ const textNode = needCopedNode.cloneWithText('');
2221
+ // The link annotation don't need inherited
2222
+ textNode.annotationMap.delete(exports.NodeAnnotationTypeEnum.LINK);
2223
+ const newParagraph = target.createNewParagraph();
2224
+ newParagraph.apply(new AppendChildNodesAction([textNode]));
2225
+ return newParagraph;
2226
+ }
2227
+ }
2228
+
2229
+ /**
2230
+ * Insert a line break node into current text block at special position strategy.
2231
+ */
2232
+ class BlockInsertLineBreakStrategy extends ActionHandleStrategy {
2233
+ /**
2234
+ * @inheritDoc
2235
+ */
2236
+ handleAction(action, target) {
2237
+ action.lineBreakNode = this.lineBreakSingleBlock(action.startContainerNode, action.startOffset, target);
2238
+ }
2239
+ /**
2240
+ * lineBreakSingleBlock
2241
+ *
2242
+ * @param {RTETextNode} splitNode -
2243
+ * @param {number} startOffsetOfNode -
2244
+ * @param {RTETextBlock} target -
2245
+ * @returns {Nullable<RTETextNode>} Nullable<RTETextNode>
2246
+ */
2247
+ lineBreakSingleBlock(splitNode, startOffsetOfNode, target) {
2248
+ if (splitNode) {
2249
+ const lineBreakNode = new RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', target);
2250
+ const beforeText = splitNode.text.slice(0, startOffsetOfNode);
2251
+ const afterText = splitNode.text.slice(startOffsetOfNode);
2252
+ const nodesSplitIndex = target.nodes.indexOf(splitNode);
2253
+ if (nodesSplitIndex > -1) {
2254
+ const beforeNodes = target.nodes.slice(0, nodesSplitIndex);
2255
+ const afterNodes = target.nodes.slice(nodesSplitIndex + 1);
2256
+ if (beforeText) {
2257
+ beforeNodes.push(splitNode.cloneWithText(beforeText));
2258
+ }
2259
+ if (afterText) {
2260
+ afterNodes.unshift(splitNode.cloneWithText(afterText));
2261
+ }
2262
+ this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes, target);
2263
+ }
2264
+ return lineBreakNode;
2265
+ }
2266
+ }
2267
+ /**
2268
+ * mergeLineBreakNodes
2269
+ *
2270
+ * @param {RTENode[]} beforeNodes -
2271
+ * @param {RTETextNode} lineBreakNode -
2272
+ * @param {RTENode[]} afterNodes -
2273
+ * @param {RTETextBlock} target -
2274
+ */
2275
+ mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes, target) {
2276
+ if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
2277
+ afterNodes.push(new RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', target, beforeNodes[beforeNodes.length - 1] && beforeNodes[beforeNodes.length - 1].annotationMap));
2278
+ }
2279
+ target.apply(new ReplaceChildNodesAction([...beforeNodes, lineBreakNode, ...afterNodes]));
2280
+ }
2281
+ }
2282
+
2283
+ /**
2284
+ * Insert a line break node into multiple blocks selection at special position strategy.
2285
+ */
2286
+ class BlockInsertLineBreakWithBlocksStrategy extends ActionHandleStrategy {
2287
+ /**
2288
+ * @inheritDoc
2289
+ */
2290
+ handleAction(action, target) {
2291
+ action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks, target);
2292
+ }
2293
+ /**
2294
+ * lineBreakMultipleBlocks
2295
+ *
2296
+ * @param {RTEBlock[]} selectedBlocks -
2297
+ * @param {RTETextBlock} target -
2298
+ * @returns {Nullable<RTETextNode>} Nullable<RTETextNode>
2299
+ */
2300
+ lineBreakMultipleBlocks(selectedBlocks, target) {
2301
+ const beforeNodes = target.nodes;
2302
+ const lineBreakNode = new RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', target);
2303
+ const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
2304
+ this.mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes, target);
2305
+ return lineBreakNode;
2306
+ }
2307
+ /**
2308
+ * Concat the child nodes of multiple RTEBlocks if both are not images.
2309
+ *
2310
+ * @param {RTEBlock[]} blocks - multiple block of content in a rich text editor, such as a paragraph, heading, image, etc.
2311
+ * @returns {RTENode[]} Array of connected block nodes
2312
+ */
2313
+ concatBlocksNodes(blocks) {
2314
+ const nodes = [];
2315
+ blocks.map((block) => {
2316
+ if (block.type !== 'image') {
2317
+ nodes.push(...block['nodes']);
2318
+ block.parent.apply(new RemoveChildAction(block));
2319
+ }
2320
+ });
2321
+ return nodes;
2322
+ }
2323
+ /**
2324
+ * mergeLineBreakNodes
2325
+ *
2326
+ * @param {RTENode[]} beforeNodes -
2327
+ * @param {RTETextNode} lineBreakNode -
2328
+ * @param {RTENode[]} afterNodes -
2329
+ * @param {RTETextBlock} target -
2330
+ */
2331
+ mergeLineBreakNodes(beforeNodes, lineBreakNode, afterNodes, target) {
2332
+ if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
2333
+ afterNodes.push(new RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', target, beforeNodes[beforeNodes.length - 1] && beforeNodes[beforeNodes.length - 1].annotationMap));
2334
+ }
2335
+ target.apply(new ReplaceChildNodesAction([...beforeNodes, lineBreakNode, ...afterNodes]));
2336
+ }
2337
+ }
2338
+
2339
+ /**
2340
+ * Merge the two blocks node into first block if the two blocks nodes type is same(text node or image node)
2341
+ *
2342
+ * @example firstBlock.apply(new MergeTwoBlocksNodesAction(secondBlock))
2343
+ */
2344
+ class MergeTwoBlocksNodesAction extends ModifyContentAction {
2345
+ constructor(blockNeedToBeMerged) {
2346
+ super();
2347
+ this.type = exports.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES;
2348
+ this.blockNeedToBeMerged = blockNeedToBeMerged;
2349
+ }
2350
+ }
2351
+
2352
+ /**
2353
+ * The text block delete text content strategy.
2354
+ */
2355
+ class BlockDeleteTextContentStrategy extends BlockDeleteNodeContentStrategy {
2356
+ /**
2357
+ * @inheritDoc
2358
+ */
2359
+ handleAction(action, target) {
2360
+ this.deleteNodeContent(action, target);
2361
+ }
2362
+ /**
2363
+ * Handle the delete text logic when press delete key.
2364
+ *
2365
+ * @param {DeleteBlockContentAction} action - ModifyContentAction
2366
+ * @param {RTETextBlock} target - Current text block
2367
+ */
2368
+ deleteNodeContent(action, target) {
2369
+ const startContainerNode = action.startContainerNode;
2370
+ const startOffset = action.startOffset;
2371
+ if (startOffset !== 0 && !startContainerNode.isEmpty()) {
2372
+ const newText = startContainerNode.text.slice(0, startOffset - 1) +
2373
+ startContainerNode.text.slice(startOffset);
2374
+ startContainerNode.apply(new UpdateTextAction(newText));
2375
+ if (newText) {
2376
+ action.previousNode = startContainerNode;
2377
+ return;
2378
+ }
2379
+ else {
2380
+ const previousNode = this.getPreviousNode(startContainerNode);
2381
+ // Remove the last character will not delete paragraph, the paragraph will removed after press delete again
2382
+ if ((previousNode && previousNode.parentBlock === target && previousNode['text'] === '\n') ||
2383
+ target.nodes.length === 1) {
2384
+ action.previousNode = startContainerNode;
2385
+ return;
2386
+ }
2387
+ else {
2388
+ target.apply(new RemoveChildAction(startContainerNode));
2389
+ action.previousNode = previousNode;
2390
+ return;
2391
+ }
2392
+ }
2393
+ }
2394
+ else {
2395
+ let previousNode = this.getPreviousNode(startContainerNode);
2396
+ let nextNode = null;
2397
+ if (target.nodes.length && previousNode && previousNode.parentBlock !== target) {
2398
+ if (startContainerNode.isEmpty()) {
2399
+ target.apply(new RemoveChildAction(startContainerNode));
2400
+ }
2401
+ previousNode.parentBlock.apply(new MergeTwoBlocksNodesAction(target));
2402
+ }
2403
+ else {
2404
+ if (this.isContentFirstNode(startContainerNode) && startContainerNode.isEmpty()) {
2405
+ nextNode = this.getNextNode(startContainerNode);
2406
+ }
2407
+ /**
2408
+ * Remove line break
2409
+ *
2410
+ * @example caret at the first line
2411
+ * \n
2412
+ * test
2413
+ */
2414
+ if (startContainerNode.isEmpty()) {
2415
+ target.apply(new RemoveChildAction(startContainerNode));
2416
+ }
2417
+ /**
2418
+ * Remove line break
2419
+ *
2420
+ * @example caret at the begin of second line
2421
+ * \n
2422
+ * test
2423
+ */
2424
+ if (previousNode instanceof RTETextNode && previousNode.isEmpty()) {
2425
+ const shouldRemoveNode = previousNode;
2426
+ previousNode = this.getPreviousNode(previousNode);
2427
+ shouldRemoveNode.parentBlock.apply(new RemoveChildAction(shouldRemoveNode));
2428
+ if (!previousNode) {
2429
+ nextNode = startContainerNode;
2430
+ }
2431
+ }
2432
+ }
2433
+ //Remove the paragraph block if the content is empty
2434
+ if (target.nodes.length === 0) {
2435
+ target.parent.apply(new RemoveChildAction(target));
2436
+ }
2437
+ if (previousNode) {
2438
+ action.previousNode = previousNode;
2439
+ }
2440
+ else if (nextNode) {
2441
+ action.nextNode = nextNode;
2442
+ }
2443
+ }
2444
+ }
2445
+ }
2446
+
2447
+ /**
2448
+ * Insert a image block into the text block at special position strategy.
2449
+ */
2450
+ class BlockInsertImageIntoTextStrategy extends ActionHandleStrategy {
2451
+ /**
2452
+ * insertImage
2453
+ *
2454
+ * @param {InsertImageToBlockAction} action - Insert image action instance.
2455
+ * @param {RTETextBlock} target - The text block.
2456
+ */
2457
+ handleAction(action, target) {
2458
+ const splitNode = action.splitPointNode;
2459
+ const startOffsetOfNode = action.startOffsetOfNode;
2460
+ const newImageBlock = action.imageBlockToBeInserted;
2461
+ if (this.isCaretPositionAtTextBlockEnd(target, splitNode, startOffsetOfNode)) {
2462
+ target.parent.apply(new InsertBlocksAfterAction(target, newImageBlock));
2463
+ }
2464
+ else if (this.isCaretPositionAtTextBlockStart(target, splitNode, startOffsetOfNode)) {
2465
+ target.parent.apply(new InsertBlocksBeforeAction(target, newImageBlock));
2466
+ }
2467
+ else {
2468
+ const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
2469
+ target.apply(splitBlockAction);
2470
+ target.parent.apply(new InsertBlocksAfterAction(target, newImageBlock));
2471
+ }
2472
+ }
2473
+ }
2474
+
2475
+ /**
2476
+ * Replace the node with new node array strategy.
2477
+ */
2478
+ class BlockReplaceNodeWithNodesStrategy extends ActionHandleStrategy {
2479
+ /**
2480
+ * Replace the current node to the new node array.
2481
+ *
2482
+ * @param {RTEBlock} target - The image block or the text block.
2483
+ * @param {RTENode} referNode - The text node or the image node.
2484
+ * @param {RTENode[]} newNodes - The array of the text node or the image node.
2485
+ */
2486
+ replaceNodeWithNodes(target, referNode, newNodes) {
2487
+ if (target['nodes']) {
2488
+ newNodes.forEach((node) => {
2489
+ node.parentBlock = target;
2490
+ });
2491
+ target['nodes'] = target['nodes'].flatMap((node) => {
2492
+ if (node === referNode) {
2493
+ return newNodes;
2494
+ }
2495
+ else {
2496
+ return node;
2497
+ }
2498
+ });
2499
+ }
2500
+ }
2501
+ }
2502
+
2503
+ /**
2504
+ * Insert some text nodes at the before of the node strategy.
2505
+ */
2506
+ class BlockInsertNodesBeforeNodeStrategy extends BlockReplaceNodeWithNodesStrategy {
2507
+ /**
2508
+ * @inheritDoc
2509
+ */
2510
+ handleAction(action, target) {
2511
+ const referNode = action.referNode;
2512
+ const nodes = [...action.nodesToBeInserted, referNode];
2513
+ this.replaceNodeWithNodes(target, referNode, nodes);
2514
+ }
2515
+ }
2516
+
2517
+ /**
2518
+ * Convert the selected blocks to list strategy.
2519
+ */
2520
+ class BlockTransformToListStrategy extends ActionHandleStrategy {
2521
+ /**
2522
+ * This method will create a empty list block and append all selected blocks as list item block.
2523
+ *
2524
+ * @param {TransformListAction} action - The transform list action instance.
2525
+ * @param {RTETextBlock} target - The first item of the selected block.
2526
+ */
2527
+ handleAction(action, target) {
2528
+ const contentState = target.parent;
2529
+ const bulletList = contentState.createList(action.listType);
2530
+ const selectedBlocks = action.selectedBlocks;
2531
+ const listItems = selectedBlocks.map((block) => contentState.toListItem(block));
2532
+ bulletList.apply(new AppendChildNodesAction(listItems));
2533
+ contentState.apply(new InsertBlocksAfterAction(action.selectedBlocks[0], bulletList));
2534
+ selectedBlocks.forEach((block) => {
2535
+ block.parent.apply(new RemoveChildAction(block));
2536
+ });
2537
+ }
2538
+ }
2539
+
2540
+ /**
2541
+ * Text block
2542
+ */
2543
+ class RTETextBlock extends RTEBlock {
2544
+ constructor(id, type) {
2545
+ super(id);
2546
+ this.nodes = [];
2547
+ this.type = type;
2548
+ if (RTETextBlock.isAcceptableTextStyle(type)) {
2549
+ this.annotationMap = new Map([TextStyleAnnotation.from(type)]);
2550
+ }
2551
+ else {
2552
+ this.annotationMap = new Map([TextStyleAnnotation.from('paragraph')]);
2553
+ }
2554
+ }
2555
+ /**
2556
+ * Converts a VegaRTETextBlock into an RTETextBlock.
2557
+ *
2558
+ * @param {VegaRTETextBlock} block - The block object
2559
+ * @returns {RTETextBlock} A RTETextBlock class
2560
+ */
2561
+ static from(block) {
2562
+ const textBlock = new RTETextBlock(block.id, block.type);
2563
+ const { annotations } = block;
2564
+ textBlock.nodes = block.nodes.map((richText) => RTETextNode.from(richText, textBlock));
2565
+ if (annotations) {
2566
+ Object.entries(annotations).forEach(([type, value]) => {
2567
+ const item = this.createAnnotationEntity(type, value);
2568
+ if (typeGuard.isNonNullable(item)) {
2569
+ textBlock.annotationMap.set(...item);
2570
+ }
2571
+ });
2572
+ }
2573
+ return textBlock;
2574
+ }
2575
+ /**
2576
+ * The function `createAnnotationEntity` creates a block annotation entity based on the provided type
2577
+ * and value.
2578
+ *
2579
+ * @param {keyof VegaRTEBlockAnnotations} type - The `type` parameter is a key of the `VegaRTEBlockAnnotations` enum, which specifies
2580
+ * the type of annotation entity to create.
2581
+ * @param {unknown} value - The `value` parameter in the `createAnnotationEntity` function is the value
2582
+ * that will be used to create the annotation entity. It can be of any type depending on the specific
2583
+ * annotation being created.
2584
+ * @returns {Nullable<[BlockAnnotationTypeEnum, BlockAnnotation]>} The `createAnnotationEntity` function returns a nullable tuple containing a
2585
+ * `BlockAnnotationTypeEnum` and a `BlockAnnotation` object.
2586
+ */
2587
+ static createAnnotationEntity(type, value) {
2588
+ if (type === 'textStyle') {
2589
+ return TextStyleAnnotation.from(value);
2590
+ }
2591
+ else {
2592
+ return super.createAnnotationEntity(type, value);
2593
+ }
2594
+ }
2595
+ /**
2596
+ * Checks if a given text block type is one of the acceptable text styles.
2597
+ *
2598
+ * @param {VegaRTETextBlockType} type - The text block type
2599
+ * @returns {boolean} Return a boolean value indicating whether the `type` parameter is valid.
2600
+ */
2601
+ static isAcceptableTextStyle(type) {
2602
+ return ['title', 'subtitle', 'paragraph', 'heading-1', 'heading-2', 'heading-3'].includes(type);
2603
+ }
2604
+ /**
2605
+ * Merges RTETextNode nodes based on certain conditions.
2606
+ *
2607
+ * @param {AnnotationAction} action - AnnotationAction
2608
+ */
2609
+ mergeNodes(action) {
2610
+ this.nodes = this.nodes.reduce((prev, cur) => {
2611
+ const lastNode = prev.at(-1);
2612
+ if (action instanceof LinkAnnotationAction && action.needMergeNode) {
2613
+ const lastNodeLinkAnnotation = lastNode === null || lastNode === void 0 ? void 0 : lastNode.getAnnotationByType(exports.NodeAnnotationTypeEnum.LINK);
2614
+ const curNodeLinkAnnotation = cur.getAnnotationByType(exports.NodeAnnotationTypeEnum.LINK);
2615
+ if (lastNodeLinkAnnotation &&
2616
+ curNodeLinkAnnotation &&
2617
+ lastNodeLinkAnnotation.toEqual(curNodeLinkAnnotation)) {
2618
+ return prev;
2619
+ }
2620
+ }
2621
+ // TODO: handle other cases like merge bold nodes
2622
+ return [...prev, cur];
2623
+ }, []);
2624
+ }
2625
+ /**
2626
+ * @inheritDoc
2627
+ */
2628
+ toJSON() {
2629
+ return Object.assign(Object.assign({}, super.toJSON()), { type: this.type, nodes: this.nodes.map((node) => node.toJSON()) });
2630
+ }
2631
+ /**
2632
+ * Clone the nodes to a new block
2633
+ *
2634
+ * @param {RTEBlock} nodes - The nodes will be copied
2635
+ * @returns {RTEBlock} New block
2636
+ */
2637
+ cloneWithNodes(nodes) {
2638
+ const block = new RTETextBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), this.type);
2639
+ block.nodes = [];
2640
+ block.apply(new AppendChildNodesAction(nodes));
2641
+ return block;
2642
+ }
2643
+ /**
2644
+ * @inheritDoc
2645
+ */
2646
+ isNotEmpty() {
2647
+ return this.nodes.length > 0 && this.nodes.some((node) => !node.isEmpty());
2648
+ }
2649
+ /**
2650
+ * @inheritDoc
2651
+ */
2652
+ getLastNode() {
2653
+ return this.nodes[this.nodes.length - 1];
2654
+ }
2655
+ /**
2656
+ * Create new empty paragraph.
2657
+ *
2658
+ * @returns {RTETextBlock} Paragraph.
2659
+ */
2660
+ createNewParagraph() {
2661
+ return new RTETextBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), 'paragraph');
2662
+ }
2663
+ /**
2664
+ * @inheritDoc
2665
+ */
2666
+ doAnnotationActionApply(action) {
2667
+ const strategy = ActionHandleStrategyRegistry.get(action.constructor.name, RTETextBlock.name);
2668
+ if (strategy) {
2669
+ strategy.execute(action, this);
2670
+ }
2671
+ }
2672
+ }
2673
+ (() => {
2674
+ ActionHandleStrategyRegistry.register(TextStyleAnnotationAction.name, RTETextBlock.name, new BlockUpdateTextStyleStrategy());
2675
+ ActionHandleStrategyRegistry.register(LinkGroupAnnotationAction.name, RTETextBlock.name, new BlockUpdateLinkGroupStrategy());
2676
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_CHILD, RTETextBlock.name, new BlockRemoveNodeStrategy());
2677
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.APPEND_CHILD_NODES, RTETextBlock.name, new BlockAppendNodesStrategy());
2678
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTETextBlock.name, new BlockSplitWithTextNodeStrategy());
2679
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.REPLACE_CHILD_NODES, RTETextBlock.name, new BlockReplaceNodesStrategy());
2680
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTETextBlock.name, new BlockMergeNodesStrategy());
2681
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.BREAK_SINGLE_BLOCK, RTETextBlock.name, new BlockInsertNewParagraphStrategy());
2682
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTETextBlock.name, new BlockInsertLineBreakStrategy());
2683
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTETextBlock.name, new BlockInsertLineBreakWithBlocksStrategy());
2684
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_BLOCK_CONTENT, RTETextBlock.name, new BlockDeleteTextContentStrategy());
2685
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTETextBlock.name, new BlockInsertImageIntoTextStrategy());
2686
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_NODES_BEFORE, RTETextBlock.name, new BlockInsertNodesBeforeNodeStrategy());
2687
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTETextBlock.name, new BlockTransformToListStrategy());
2688
+ })();
2689
+
2690
+ /**
2691
+ * Insert a new paragraph at the image block special position strategy.
2692
+ */
2693
+ class ImageInsertNewParagraphStrategy extends ActionHandleStrategy {
2694
+ /**
2695
+ * @inheritDoc
2696
+ */
2697
+ handleAction(action, target) {
2698
+ action.newBlock = this.breakSingleBlock(action.startContainerNode, action.startOffset, target);
2699
+ }
2700
+ /**
2701
+ * Used to split a block of text at a specific position and insert a new paragraph block.
2702
+ *
2703
+ * @param {RTEImageNode} splitNode - The node that needs to be split into separate blocks.
2704
+ * @param {number} startOffsetOfNode - The index or position within the `splitNode` where the block should be broken or split.
2705
+ * @param {RTEImageBlock} target - The image block.
2706
+ * @returns {Nullable<RTEBlock>} Returns either a new paragraph block or the new block created after splitting the original block.
2707
+ */
2708
+ breakSingleBlock(splitNode, startOffsetOfNode, target) {
2709
+ const newParagraph = RTETextBlock.from({
2710
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
2711
+ type: 'paragraph',
2712
+ nodes: [{ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(), type: 'text', text: '' }],
2713
+ });
2714
+ if (this.isCaretPositionAtImageBlockEnd(target, splitNode, startOffsetOfNode)) {
2715
+ target.parent.apply(new InsertBlocksAfterAction(target, newParagraph));
2716
+ }
2717
+ else if (this.isCaretPositionAtImageBlockStart(target, splitNode, startOffsetOfNode)) {
2718
+ target.parent.apply(new InsertBlocksBeforeAction(target, newParagraph));
2719
+ }
2720
+ else {
2721
+ const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
2722
+ target.apply(splitBlockAction);
2723
+ return splitBlockAction.newBlock;
2724
+ }
2725
+ return newParagraph;
2726
+ }
2727
+ }
2728
+
2729
+ /**
2730
+ * Break the current block after press enter, this action is similar with the SplitBlockWithNodeAction,
2731
+ * The SplitBlockWithNodeAction split the current block to two same type blocks, but this action will create new paragraph or list item when break at start or end.
2732
+ * The property `newBlock` use to store the new create block if need.
2733
+ *
2734
+ * @example currentBlock.apply(new BreakSingleBlockAction(startContainerNode, startOffset))
2735
+ */
2736
+ class BreakSingleBlockAction extends ModifyContentAction {
2737
+ constructor(startContainerNode, startOffset) {
2738
+ super();
2739
+ this.type = exports.ModifyContentActionType.BREAK_SINGLE_BLOCK;
2740
+ this.startContainerNode = startContainerNode;
2741
+ this.startOffset = startOffset;
2742
+ }
2743
+ }
2744
+
2745
+ /**
2746
+ * The image block insert line break strategy.
2747
+ */
2748
+ class ImageInsertLineBreakStrategy extends ActionHandleStrategy {
2749
+ /**
2750
+ * The image block not support insert the line break node, so invoke the insert new paragraph logic directly.
2751
+ *
2752
+ * @param {LineBreakSingleBlockAction} action - The action instance.
2753
+ * @param {RTEImageBlock} target - The image block.
2754
+ */
2755
+ handleAction(action, target) {
2756
+ const insertNewParagraphAction = new BreakSingleBlockAction(action.startContainerNode, action.startOffset);
2757
+ target.apply(insertNewParagraphAction);
2758
+ const newBlock = insertNewParagraphAction.newBlock;
2759
+ if (newBlock) {
2760
+ action.lineBreakNode = newBlock.nodes[0];
2761
+ }
2762
+ }
2763
+ }
2764
+
2765
+ /**
2766
+ * Insert a line break node into multiple blocks selection at special position strategy.
2767
+ */
2768
+ class ImageInsertLineBreakWithBlocksStrategy extends ActionHandleStrategy {
2769
+ /**
2770
+ * @inheritDoc
2771
+ */
2772
+ handleAction(action, target) {
2773
+ action.lineBreakNode = this.lineBreakMultipleBlocks(action.selectedBlocks, target);
2774
+ }
2775
+ /**
2776
+ * Inserts a new paragraph block with a line break after a selected block of text in a rich text editor.
2777
+ *
2778
+ * @param {RTEBlock[]} selectedBlocks - An array of RTEBlock objects that represent the blocks that have been selected for a specific action in the Rich Text Editor.
2779
+ * @param {RTEImageBlock} target - The image block.
2780
+ * @returns {Nullable<RTETextNode>} Returns a Nullable RTETextNode.
2781
+ */
2782
+ lineBreakMultipleBlocks(selectedBlocks, target) {
2783
+ const newParagraph = RTETextBlock.from({
2784
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
2785
+ type: 'paragraph',
2786
+ nodes: [{ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(), type: 'text', text: '\n' }],
2787
+ });
2788
+ target.parent.apply(new InsertBlocksAfterAction(target, newParagraph));
2789
+ const afterNodes = this.concatBlocksNodes(selectedBlocks.slice(1));
2790
+ if (afterNodes.length === 0 || (afterNodes[0] && afterNodes[0].text === '')) {
2791
+ afterNodes.push(new RTETextNode(createPublicApiRuntimeMetricsSlimmer.generateUUID(), '\n', newParagraph));
2792
+ }
2793
+ newParagraph.apply(new AppendChildNodesAction(afterNodes));
2794
+ return newParagraph['nodes'][0];
2795
+ }
2796
+ /**
2797
+ * Concat the child nodes of multiple RTEBlocks if both are not images.
2798
+ *
2799
+ * @param {RTEBlock[]} blocks - multiple block of content in a rich text editor, such as a paragraph, heading, image, etc.
2800
+ * @returns {RTENode[]} Array of connected block nodes
2801
+ */
2802
+ concatBlocksNodes(blocks) {
2803
+ const nodes = [];
2804
+ blocks.map((block) => {
2805
+ if (block.type !== 'image') {
2806
+ nodes.push(...block['nodes']);
2807
+ block.parent.apply(new RemoveChildAction(block));
2808
+ }
2809
+ });
2810
+ return nodes;
2811
+ }
2812
+ }
2813
+
2814
+ /**
2815
+ * Insert a image node at the special position of image block.
2816
+ */
2817
+ class ImageBlockInsertImageStrategy extends ActionHandleStrategy {
2818
+ /**
2819
+ * @inheritDoc
2820
+ */
2821
+ handleAction(action, target) {
2822
+ const splitNode = action.splitPointNode;
2823
+ const startOffsetOfNode = action.startOffsetOfNode;
2824
+ const newImageBlock = action.imageBlockToBeInserted;
2825
+ const newImageNodes = newImageBlock.nodes;
2826
+ if (target.nodes.length < 1) {
2827
+ target.apply(new AppendChildNodesAction(newImageNodes));
2828
+ }
2829
+ else if (this.isCaretPositionAtImageBlockEnd(target, splitNode, startOffsetOfNode)) {
2830
+ target.parent.apply(new InsertBlocksAfterAction(target, newImageBlock));
2831
+ }
2832
+ else if (this.isCaretPositionAtImageBlockStart(target, splitNode, startOffsetOfNode)) {
2833
+ target.parent.apply(new InsertBlocksBeforeAction(target, newImageBlock));
2834
+ }
2835
+ else {
2836
+ target.apply(new SplitBlockWithNodeAction(splitNode, startOffsetOfNode));
2837
+ target.parent.apply(new InsertBlocksAfterAction(target, newImageBlock));
2838
+ }
2839
+ }
2840
+ }
2841
+
2842
+ /**
2843
+ * Insert some text nodes at the behind of the node strategy.
2844
+ */
2845
+ class BlockInsertNodesAfterNodeStrategy extends BlockReplaceNodeWithNodesStrategy {
2846
+ /**
2847
+ * @inheritDoc
2848
+ */
2849
+ handleAction(action, target) {
2850
+ const referNode = action.referNode;
2851
+ const nodes = [referNode, ...action.nodesToBeInserted];
2852
+ this.replaceNodeWithNodes(target, referNode, nodes);
2853
+ }
2854
+ }
2855
+
2856
+ /**
2857
+ * Image block
2858
+ */
2859
+ class RTEImageBlock extends RTEBlock {
2860
+ constructor(id) {
2861
+ super(id);
2862
+ this.type = 'image';
2863
+ this.nodes = [];
2864
+ }
2865
+ /**
2866
+ * Converts a VegaRTEImageBlock object into an RTEImageBlock object by mapping nodes and creating annotations.
2867
+ *
2868
+ * @param {VegaRTEImageBlock} block - The block object to be converted.
2869
+ * @returns {RTEImageBlock} An instance of `RTEImageBlock`
2870
+ */
2871
+ static from(block) {
2872
+ const imageBlock = new RTEImageBlock(block.id);
2873
+ const { annotations } = block;
2874
+ imageBlock.nodes = block.nodes.map((image) => RTEImageNode.from(image, imageBlock));
2875
+ if (annotations) {
2876
+ Object.entries(annotations).forEach(([type, value]) => {
2877
+ const item = this.createAnnotationEntity(type, value);
2878
+ if (typeGuard.isNonNullable(item)) {
2879
+ imageBlock.annotationMap.set(...item);
2880
+ }
2881
+ });
2882
+ }
2883
+ return imageBlock;
2884
+ }
2885
+ /**
2886
+ * @inheritDoc
2887
+ */
2888
+ toJSON() {
2889
+ return Object.assign(Object.assign({}, super.toJSON()), { type: 'image', nodes: this.nodes.map((node) => node.toJSON()) });
2890
+ }
2891
+ /**
2892
+ * @inheritDoc
2893
+ */
2894
+ isNotEmpty() {
2895
+ return this.nodes.length > 0 && this.nodes.some((node) => node.url.length > 0);
2896
+ }
2897
+ /**
2898
+ * @inheritDoc
2899
+ */
2900
+ getLastNode() {
2901
+ return this.nodes[this.nodes.length - 1];
2902
+ }
2903
+ /**
2904
+ * Create a new image block.
2905
+ *
2906
+ * @returns {RTEImageBlock} - The empty image block.
2907
+ */
2908
+ createNewImageBlock() {
2909
+ return new RTEImageBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
2910
+ }
2911
+ }
2912
+ (() => {
2913
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_BLOCK_CONTENT, RTEImageBlock.name, new BlockDeleteImageStrategy());
2914
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTEImageBlock.name, new BlockMergeNodesStrategy());
2915
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_CHILD, RTEImageBlock.name, new BlockRemoveNodeStrategy());
2916
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.APPEND_CHILD_NODES, RTEImageBlock.name, new BlockAppendNodesStrategy());
2917
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.REPLACE_CHILD_NODES, RTEImageBlock.name, new BlockReplaceNodesStrategy());
2918
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTEImageBlock.name, new BlockSplitWithImageNodeStrategy());
2919
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.BREAK_SINGLE_BLOCK, RTEImageBlock.name, new ImageInsertNewParagraphStrategy());
2920
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEImageBlock.name, new ImageInsertLineBreakStrategy());
2921
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEImageBlock.name, new ImageInsertLineBreakWithBlocksStrategy());
2922
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEImageBlock.name, new ImageBlockInsertImageStrategy());
2923
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_NODES_BEFORE, RTEImageBlock.name, new BlockInsertNodesBeforeNodeStrategy());
2924
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_NODES_AFTER, RTEImageBlock.name, new BlockInsertNodesAfterNodeStrategy());
2925
+ })();
2926
+
2927
+ /**
2928
+ * The list item block block delete text content strategy.
2929
+ */
2930
+ class ListItemDeleteTextContentStrategy extends BlockDeleteTextContentStrategy {
2931
+ /**
2932
+ * Delete the list item content and delete the parent list after delete the last item.
2933
+ *
2934
+ * @param {DeleteBlockContentAction} action - The delete block content action instance.
2935
+ * @param {RTEListItemBlock} target - The list item block.
2936
+ */
2937
+ handleAction(action, target) {
2938
+ const listBlock = target.parent;
2939
+ this.deleteNodeContent(action, target);
2940
+ if (listBlock.blocks.length === 0) {
2941
+ listBlock.parent.apply(new RemoveChildAction(listBlock));
2942
+ }
2943
+ }
2944
+ }
2945
+
2946
+ /**
2947
+ * Remove list item child node strategy.
2948
+ */
2949
+ class ListItemRemoveNodeStrategy extends ActionHandleStrategy {
2950
+ /**
2951
+ * Remove child node from the list item, remove the list item if the list item is empty.
2952
+ *
2953
+ * @param {RemoveChildAction} action - The remove child action instance.
2954
+ * @param {RTEListItemBlock} target - The list item block.
2955
+ */
2956
+ handleAction(action, target) {
2957
+ target.nodes = target.nodes.filter((node) => node !== action.entityToBeRemoved);
2958
+ if (target.nodes.length === 0 && (!target.children || !target.children.length)) {
2959
+ target.parent.apply(new RemoveChildAction(target));
2960
+ }
2961
+ }
2962
+ }
2963
+
2964
+ /**
2965
+ * Remove list item nest list block strategy.
2966
+ */
2967
+ class ListItemRemoveNestListStrategy extends ActionHandleStrategy {
2968
+ /**
2969
+ * Remove the nest list block from the list item, clear the property children when the children is empty.
2970
+ *
2971
+ * @param {RemoveNestListAction} action - The action instance.
2972
+ * @param {RTEListItemBlock} target - The list item block.
2973
+ */
2974
+ handleAction(action, target) {
2975
+ if (target.children) {
2976
+ if (target.children.length > 1) {
2977
+ target.children = target.children.filter((child) => child !== action.nestListBlockToBeRemoved);
2978
+ }
2979
+ else {
2980
+ target.children = undefined;
2981
+ }
2982
+ }
2983
+ }
2984
+ }
2985
+
2986
+ /**
2987
+ * Replace list item nest list strategy.
2988
+ */
2989
+ class ListItemReplaceNestListStrategy extends ActionHandleStrategy {
2990
+ /**
2991
+ * @inheritDoc
2992
+ */
2993
+ handleAction(action, target) {
2994
+ action.newList.forEach((listBlock) => {
2995
+ listBlock.parent = target;
2996
+ });
2997
+ target.children = action.newList;
2998
+ }
2999
+ }
3000
+
3001
+ /**
3002
+ * Insert new paragraph into current list item block at special position.
3003
+ */
3004
+ class ListItemInsertNewParagraphStrategy extends ActionHandleStrategy {
3005
+ /**
3006
+ * @inheritDoc
3007
+ */
3008
+ handleAction(action, target) {
3009
+ action.newBlock = this.breakSingleListItemBlock(action.startContainerNode, action.startOffset, target);
3010
+ }
3011
+ /**
3012
+ * Breaks a single list item block at a specific position.
3013
+ *
3014
+ * @param {RTETextNode} splitNode - The node that needs to be split within a list item block.
3015
+ * @param {number} startOffsetOfNode - The index within the `splitNode` where the break operation should occur.
3016
+ * @param {RTEListItemBlock} target - The list item block.
3017
+ * @returns {Nullable<RTEBlock>} Returns either a new `RTEListItemBlock` if the caret
3018
+ * position is at the end of the `splitNode`, or it returns the result of splitting the block at the
3019
+ * caret position if it is neither at the start nor at the end.
3020
+ */
3021
+ breakSingleListItemBlock(splitNode, startOffsetOfNode, target) {
3022
+ const newListItem = target.createNewListItem();
3023
+ const newBreakNode = this.copyInlineStyleToNewNode(splitNode);
3024
+ newListItem.apply(new AppendChildNodesAction([newBreakNode]));
3025
+ if (this.isCaretPositionAtTextBlockEnd(target, splitNode, startOffsetOfNode)) {
3026
+ return this.breakListItemAtEnd(newListItem, target);
3027
+ }
3028
+ else if (this.isCaretPositionAtTextBlockStart(target, splitNode, startOffsetOfNode)) {
3029
+ target.parent.apply(new InsertBlocksBeforeAction(target, newListItem));
3030
+ }
3031
+ else {
3032
+ const splitBlockAction = new SplitBlockWithNodeAction(splitNode, startOffsetOfNode);
3033
+ target.apply(splitBlockAction);
3034
+ return splitBlockAction.newBlock;
3035
+ }
3036
+ return newListItem;
3037
+ }
3038
+ /**
3039
+ * Breaks a list item at the end and handles the insertion of a new list item or paragraph accordingly.
3040
+ *
3041
+ * @param {RTEListItemBlock} newListItem - Item that represents a new list item to be added to the existing list.
3042
+ * @param {RTEListItemBlock} target - The list item block.
3043
+ * @returns {RTEBlock} Returns a `RTEBlock`.
3044
+ */
3045
+ breakListItemAtEnd(newListItem, target) {
3046
+ const lastItem = target.parent.blocks[target.parent.blocks.length - 1];
3047
+ const currentItemIsEmpty = target.nodes.length === 1 && target.nodes[0].isEmpty();
3048
+ if (target === lastItem && currentItemIsEmpty) {
3049
+ const parentParent = target.parent.parent;
3050
+ if (parentParent['type'] !== 'list-item') {
3051
+ const newParagraph = RTETextBlock.from({
3052
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
3053
+ type: 'paragraph',
3054
+ nodes: [],
3055
+ });
3056
+ newParagraph.apply(new AppendChildNodesAction(newListItem.nodes));
3057
+ parentParent.apply(new InsertBlocksAfterAction(target.parent, newParagraph));
3058
+ target.parent.apply(new RemoveChildAction(target));
3059
+ return newParagraph;
3060
+ }
3061
+ else {
3062
+ parentParent.parent.apply(new InsertBlocksAfterAction(parentParent, newListItem));
3063
+ target.parent.apply(new RemoveChildAction(target));
3064
+ }
3065
+ }
3066
+ else {
3067
+ target.parent.apply(new InsertBlocksAfterAction(target, newListItem));
3068
+ }
3069
+ return newListItem;
3070
+ }
3071
+ /**
3072
+ * Copy the inline style to new node
3073
+ *
3074
+ * @param {RTETextNode} needCopedNode - The node that needed to be copied to
3075
+ * @returns {RTETextNode} Returns a `RTETextNode`.
3076
+ */
3077
+ copyInlineStyleToNewNode(needCopedNode) {
3078
+ const textNode = needCopedNode.cloneWithText('');
3079
+ // The link annotation doesn't need to inherit
3080
+ textNode.annotationMap.delete(exports.NodeAnnotationTypeEnum.LINK);
3081
+ return textNode;
3082
+ }
3083
+ }
3084
+
3085
+ /**
3086
+ * Insert image node to list item block strategy.
3087
+ */
3088
+ class ListItemInsertImageStrategy extends ActionHandleStrategy {
3089
+ /**
3090
+ * The image node can not insert into list item block, so insert image after parent list block.
3091
+ *
3092
+ * @param {InsertImageToBlockAction} action - The action instance.
3093
+ * @param {RTEListItemBlock} target - The list item block.
3094
+ */
3095
+ handleAction(action, target) {
3096
+ target.parent.apply(action);
3097
+ }
3098
+ }
3099
+
3100
+ /**
3101
+ * List item block
3102
+ */
3103
+ class RTEListItemBlock extends RTETextBlock {
3104
+ constructor(id, children) {
3105
+ super(id, 'list-item');
3106
+ this.children = [];
3107
+ this.children = children;
3108
+ }
3109
+ /**
3110
+ * Converts a VegaRTEListItemBlock object to an RTEListItemBlock
3111
+ *
3112
+ * @param {VegaRTEListBlock} block - Converts a `VegaRTEListItemBlock` object into an `RTEListItemBlock`.
3113
+ * @returns {RTEListItemBlock} Return an instance of `RTEListItemBlock`
3114
+ */
3115
+ static from(block) {
3116
+ const listItemBlock = new RTEListItemBlock(block.id);
3117
+ listItemBlock.nodes = block.nodes.map((richText) => RTETextNode.from(richText, listItemBlock));
3118
+ if (block.children) {
3119
+ listItemBlock.children = block.children.map((child) => {
3120
+ const listBlock = RTEListBlock.from(child);
3121
+ listBlock.parent = listItemBlock;
3122
+ return listBlock;
3123
+ });
3124
+ }
3125
+ const { annotations } = block;
3126
+ if (annotations) {
3127
+ Object.entries(annotations).forEach(([type, value]) => {
3128
+ const item = this.createAnnotationEntity(type, value);
3129
+ if (typeGuard.isNonNullable(item)) {
3130
+ listItemBlock.annotationMap.set(...item);
3131
+ }
3132
+ });
3133
+ }
3134
+ return listItemBlock;
3135
+ }
3136
+ /**
3137
+ * @inheritDoc
3138
+ */
3139
+ toJSON() {
3140
+ var _a;
3141
+ 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()) });
3142
+ }
3143
+ /**
3144
+ * @inheritDoc
3145
+ */
3146
+ cloneWithNodes(nodes) {
3147
+ const block = new RTEListItemBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
3148
+ block.nodes = [];
3149
+ block.apply(new AppendChildNodesAction(nodes));
3150
+ return block;
3151
+ }
3152
+ /**
3153
+ * @inheritDoc
3154
+ */
3155
+ getLastNode() {
3156
+ if (this.children && this.children.length > 0) {
3157
+ const childListBlock = this.children[this.children.length - 1];
3158
+ return childListBlock.getLastNode();
3159
+ }
3160
+ return super.getLastNode();
3161
+ }
3162
+ /**
3163
+ * Create a new list item block.
3164
+ *
3165
+ * @returns {RTEListItemBlock} - A list item block.
3166
+ */
3167
+ createNewListItem() {
3168
+ return new RTEListItemBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
3169
+ }
3170
+ }
3171
+ (() => {
3172
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_BLOCK_CONTENT, RTEListItemBlock.name, new ListItemDeleteTextContentStrategy());
3173
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.LINE_BREAK_SINGLE_BLOCK, RTEListItemBlock.name, new BlockInsertLineBreakStrategy());
3174
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.LINE_BREAK_MULTIPLE_BLOCKS, RTEListItemBlock.name, new BlockInsertLineBreakWithBlocksStrategy());
3175
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_CHILD, RTEListItemBlock.name, new ListItemRemoveNodeStrategy());
3176
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_NEST_LIST, RTEListItemBlock.name, new ListItemRemoveNestListStrategy());
3177
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.APPEND_CHILD_NODES, RTEListItemBlock.name, new BlockAppendNodesStrategy());
3178
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.SPLIT_BLOCK_WITH_NODE, RTEListItemBlock.name, new BlockSplitWithTextNodeStrategy());
3179
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.REPLACE_CHILD_NODES, RTEListItemBlock.name, new BlockReplaceNodesStrategy());
3180
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.REPLACE_NEST_LIST, RTEListItemBlock.name, new ListItemReplaceNestListStrategy());
3181
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.MERGE_TWO_BLOCKS_NODES, RTEListItemBlock.name, new BlockMergeNodesStrategy());
3182
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.BREAK_SINGLE_BLOCK, RTEListItemBlock.name, new ListItemInsertNewParagraphStrategy());
3183
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListItemBlock.name, new ListItemInsertImageStrategy());
3184
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_NODES_BEFORE, RTEListItemBlock.name, new BlockInsertNodesBeforeNodeStrategy());
3185
+ })();
3186
+
3187
+ /**
3188
+ * Insert block array at the front of the block strategy.
3189
+ */
3190
+ class BlockInsertBlocksBeforeStrategy extends ActionHandleStrategy {
3191
+ /**
3192
+ * @inheritDoc
3193
+ */
3194
+ handleAction(action, target) {
3195
+ this.replaceBlockWithBlocks(target, action.referBlock, [
3196
+ ...action.blocksToBeInserted,
3197
+ action.referBlock,
3198
+ ]);
3199
+ }
3200
+ /**
3201
+ * Replaces a specific block with an array of blocks within a RTEContentBlock array.
3202
+ *
3203
+ * @param {RTEListBlock|VegaRTEContent} target - The list block or the VegaRTEContent instance.
3204
+ * @param {RTEBlock} referBlock - Used as a reference block to identify the block that needs to be replaced in the `blocks` array.
3205
+ * @param {RTEBlock[]} blocks - An array of RTEBlock objects that you want to replace the `referBlock` with in the `blocks` array.
3206
+ */
3207
+ replaceBlockWithBlocks(target, referBlock, blocks) {
3208
+ if (target.blocks) {
3209
+ blocks.forEach((block) => {
3210
+ block.parent = target;
3211
+ });
3212
+ const arrayFixed = target.blocks;
3213
+ target.blocks = arrayFixed.flatMap((block) => {
3214
+ if (block === referBlock) {
3215
+ return blocks;
3216
+ }
3217
+ else {
3218
+ return block;
3219
+ }
3220
+ });
3221
+ }
3222
+ }
3223
+ }
3224
+
3225
+ /**
3226
+ * Insert block array at the behind of the block strategy.
3227
+ */
3228
+ class BlockInsertBlocksAfterStrategy extends BlockInsertBlocksBeforeStrategy {
3229
+ /**
3230
+ * @inheritDoc
3231
+ */
3232
+ handleAction(action, target) {
3233
+ this.replaceBlockWithBlocks(target, action.referBlock, [
3234
+ action.referBlock,
3235
+ ...action.blocksToBeInserted,
3236
+ ]);
3237
+ }
3238
+ }
3239
+
3240
+ /**
3241
+ * Append new block array to list block or VegaRTEContent instance strategy.
3242
+ */
3243
+ class BlockAppendBlocksStrategy extends ActionHandleStrategy {
3244
+ /**
3245
+ * @inheritDoc
3246
+ */
3247
+ handleAction(action, target) {
3248
+ const newBlocks = action.entityToBeAppended;
3249
+ if (target.blocks) {
3250
+ newBlocks.forEach((block) => {
3251
+ block.parent = target;
3252
+ });
3253
+ const arrayFixed = target.blocks;
3254
+ target.blocks = arrayFixed.concat(newBlocks);
3255
+ }
3256
+ }
3257
+ }
3258
+
3259
+ /**
3260
+ * Delete the nest list block action
3261
+ *
3262
+ * @example needRemovedNestList.parent.apply(new RemoveNestListAction(needRemovedNestList))
3263
+ */
3264
+ class RemoveNestListAction extends ModifyContentAction {
3265
+ constructor(childList) {
3266
+ super();
3267
+ this.type = exports.ModifyContentActionType.DELETE_NEST_LIST;
3268
+ this.nestListBlockToBeRemoved = childList;
3269
+ }
3270
+ }
3271
+
3272
+ /**
3273
+ * List block or VegaRTEContent remove child block strategy.
3274
+ */
3275
+ class BlockRemoveChildBlockStrategy extends ActionHandleStrategy {
3276
+ /**
3277
+ * @inheritDoc
3278
+ */
3279
+ handleAction(action, target) {
3280
+ const blockToBeRemoved = action.entityToBeRemoved;
3281
+ if (target.blocks) {
3282
+ target.blocks = target.blocks.filter((block) => block !== blockToBeRemoved);
3283
+ }
3284
+ }
3285
+ }
3286
+
3287
+ /**
3288
+ * List remove list item strategy.
3289
+ */
3290
+ class ListRemoveListItemStrategy extends BlockRemoveChildBlockStrategy {
3291
+ /**
3292
+ * Remove the list item, check the list item and remove self if the list item is empty.
3293
+ *
3294
+ * @param {RemoveChildAction} action - The remove action instance.
3295
+ * @param {RTEListBlock} target - The list block.
3296
+ */
3297
+ handleAction(action, target) {
3298
+ super.handleAction(action, target);
3299
+ const parent = target.parent;
3300
+ if (target.blocks.length === 0 && parent) {
3301
+ // The parent is a list item mean the current block is a nest list, so we need to use RemoveNestListAction to remove the item
3302
+ if (parent['type'] === 'list-item') {
3303
+ parent.apply(new RemoveNestListAction(target));
3304
+ }
3305
+ else {
3306
+ parent.apply(new RemoveChildAction(target));
3307
+ }
3308
+ }
3309
+ }
3310
+ }
3311
+
3312
+ /**
3313
+ * Convert the selected blocks to list strategy.
3314
+ */
3315
+ class ListTransformToListStrategy extends ActionHandleStrategy {
3316
+ /**
3317
+ * @inheritDoc
3318
+ */
3319
+ handleAction(action, target) {
3320
+ const selectedBlocks = action.selectedBlocks;
3321
+ const bulletList = target.parent.createList(action.listType);
3322
+ const isSameList = selectedBlocks.every((block) => block.parent === target);
3323
+ if (isSameList) {
3324
+ // Select one or more list items belonging to the same list, and all items in this list should be updated
3325
+ bulletList.apply(new AppendChildNodesAction(target.blocks));
3326
+ target.parent.apply(new InsertBlocksAfterAction(target, bulletList));
3327
+ target.parent.apply(new RemoveChildAction(target));
3328
+ selectedBlocks.forEach((block) => block.nodes.map((node) => node.apply(new SyncUpSelectionAction())));
3329
+ }
3330
+ else {
3331
+ const listItems = action.selectedBlocks.map((block) => target.parent.toListItem(block));
3332
+ bulletList.apply(new AppendChildNodesAction(listItems));
3333
+ target.parent.apply(new InsertBlocksAfterAction(target, bulletList));
3334
+ action.selectedBlocks.forEach((block) => {
3335
+ block.parent.apply(new RemoveChildAction(block));
3336
+ });
3337
+ if (target.blocks.length === 0) {
3338
+ target.parent.apply(new RemoveChildAction(target));
3339
+ }
3340
+ }
3341
+ }
3342
+ }
3343
+
3344
+ /**
3345
+ * Convert the selected list block to paragraph strategy.
3346
+ */
3347
+ class ListTransformToParagraphStrategy extends ActionHandleStrategy {
3348
+ /**
3349
+ * @inheritDoc
3350
+ */
3351
+ handleAction(action, target) {
3352
+ let isSelectedFirstBlock = false;
3353
+ let isSelectedLastBlock = false;
3354
+ const selectedBlocks = action.selectedBlocks;
3355
+ const currentParagraph = selectedBlocks.map((block) => {
3356
+ block.nodes.map((node) => node.apply(new SyncUpSelectionAction()));
3357
+ if (block === target.blocks[0])
3358
+ isSelectedFirstBlock = true;
3359
+ if (block === target.blocks[target.blocks.length - 1])
3360
+ isSelectedLastBlock = true;
3361
+ return this.toParagraph(block);
3362
+ });
3363
+ if (isSelectedFirstBlock) {
3364
+ target.parent.apply(new InsertBlocksBeforeAction(target, ...currentParagraph));
3365
+ }
3366
+ else if (isSelectedLastBlock) {
3367
+ target.parent.apply(new InsertBlocksAfterAction(target, ...currentParagraph));
3368
+ }
3369
+ else {
3370
+ const startIndex = target.blocks.indexOf(selectedBlocks[0]);
3371
+ const lastIndex = target.blocks.indexOf(selectedBlocks[selectedBlocks.length - 1]);
3372
+ const firstBulletList = target.parent.createList(target.type);
3373
+ firstBulletList.apply(new AppendChildNodesAction(target.blocks.slice(0, startIndex)));
3374
+ const lastBulletList = target.parent.createList(target.type);
3375
+ lastBulletList.apply(new AppendChildNodesAction(target.blocks.slice(lastIndex + 1)));
3376
+ target.parent.apply(new InsertBlocksBeforeAction(target, firstBulletList, ...currentParagraph, lastBulletList));
3377
+ target.parent.apply(new RemoveChildAction(target));
3378
+ }
3379
+ selectedBlocks.map((block) => {
3380
+ target.apply(new RemoveChildAction(block));
3381
+ });
3382
+ if (target.blocks.length === 0) {
3383
+ target.parent.apply(new RemoveChildAction(target));
3384
+ }
3385
+ }
3386
+ /**
3387
+ * Converts a RTEListItemBlock to a RTETextBlock representing a paragraph.
3388
+ *
3389
+ * @param {RTEListItemBlock} block - The block that will be covered
3390
+ * @returns {RTETextBlock} Returns a `RTETextBlock`.
3391
+ */
3392
+ toParagraph(block) {
3393
+ const textBlock = new RTETextBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), 'paragraph');
3394
+ textBlock.apply(new AppendChildNodesAction(block['nodes']));
3395
+ textBlock['annotationMap'] = block['annotationMap'];
3396
+ return textBlock;
3397
+ }
3398
+ }
3399
+
3400
+ /**
3401
+ * Insert image to list block strategy.
3402
+ */
3403
+ class ListInsertImageStrategy extends ActionHandleStrategy {
3404
+ /**
3405
+ * Insert image block at behind of the list item block.
3406
+ *
3407
+ * @param {InsertImageToBlockAction} action - The insert image action instance.
3408
+ * @param {RTEListBlock} target - The list block.
3409
+ */
3410
+ handleAction(action, target) {
3411
+ const imageBlock = action.imageBlockToBeInserted;
3412
+ if (target.parent['type'] !== 'list-item') {
3413
+ target.parent.apply(new InsertBlocksAfterAction(target, imageBlock));
3414
+ }
3415
+ else {
3416
+ target.parent.apply(action);
3417
+ }
3418
+ }
3419
+ }
3420
+
3421
+ /**
3422
+ * List block
3423
+ */
3424
+ class RTEListBlock extends RTEBlock {
3425
+ constructor(id, type) {
3426
+ super(id);
3427
+ this.type = 'bullet-list';
3428
+ this.blocks = [];
3429
+ this.type = type;
3430
+ }
3431
+ /**
3432
+ * Converts a VegaRTEListBlock object to an RTEListBlock
3433
+ *
3434
+ * @param {VegaRTEListBlock} block - Converts a `VegaRTEListBlock` object into an `RTEListBlock`.
3435
+ * @returns {RTEListBlock} Return an instance of `RTEListBlock`
3436
+ */
3437
+ static from(block) {
3438
+ const listBlock = new RTEListBlock(block.id, block.type);
3439
+ listBlock.blocks = block.blocks.map((item) => {
3440
+ const listItemBlock = RTEListItemBlock.from(item);
3441
+ listItemBlock.parent = listBlock;
3442
+ return listItemBlock;
3443
+ });
3444
+ return listBlock;
3445
+ }
3446
+ /**
3447
+ * @inheritDoc
3448
+ */
3449
+ toJSON() {
3450
+ return Object.assign(Object.assign({}, super.toJSON()), { id: this.id, type: this.type, blocks: this.blocks.map((block) => block.toJSON()) });
3451
+ }
3452
+ /**
3453
+ * @inheritDoc
3454
+ */
3455
+ isNotEmpty() {
3456
+ return this.blocks.length > 0;
3457
+ }
3458
+ /**
3459
+ * @inheritDoc
3460
+ */
3461
+ getLastNode() {
3462
+ return this.blocks[this.blocks.length - 1].getLastNode();
3463
+ }
3464
+ }
3465
+ (() => {
3466
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_CHILD, RTEListBlock.name, new ListRemoveListItemStrategy());
3467
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_BLOCKS_BEFORE, RTEListBlock.name, new BlockInsertBlocksBeforeStrategy());
3468
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_BLOCKS_AFTER, RTEListBlock.name, new BlockInsertBlocksAfterStrategy());
3469
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.APPEND_CHILD_NODES, RTEListBlock.name, new BlockAppendBlocksStrategy());
3470
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTEListBlock.name, new ListTransformToListStrategy());
3471
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK, RTEListBlock.name, new ListTransformToParagraphStrategy());
3472
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListBlock.name, new ListInsertImageStrategy());
3473
+ })();
3474
+
3475
+ /**
3476
+ * Class representing the content state of the rich text editor.
3477
+ */
3478
+ class VegaRTEContent {
3479
+ constructor(blocks) {
3480
+ blocks.forEach((block) => {
3481
+ block.parent = this;
3482
+ });
3483
+ this.blocks = blocks;
3484
+ }
3485
+ /**
3486
+ * Converts a JSON array of blocks to a class array of RTEContentBlock.
3487
+ *
3488
+ * @param {VegaRTEContentBlock[]} value The JSON array of blocks to convert.
3489
+ * @returns {VegaRTEContent} The converted array of RTEContentBlock.
3490
+ */
3491
+ static fromJSON(value) {
3492
+ const blocks = value.map((block) => {
3493
+ switch (block.type) {
3494
+ case 'paragraph':
3495
+ case 'title':
3496
+ case 'subtitle':
3497
+ case 'heading-1':
3498
+ case 'heading-2':
3499
+ case 'heading-3': {
3500
+ return RTETextBlock.from(block);
3501
+ }
3502
+ case 'image':
3503
+ return RTEImageBlock.from(block);
3504
+ case 'bullet-list':
3505
+ case 'number-list':
3506
+ return RTEListBlock.from(block);
3507
+ default: {
3508
+ throw new Error(`[Vega] Unknown block type: ${block.type}`);
3509
+ }
3510
+ }
3511
+ });
3512
+ return new VegaRTEContent(blocks);
3513
+ }
3514
+ /**
3515
+ * Create an empty content state
3516
+ *
3517
+ * @returns {VegaRTEContent} An empty content state
3518
+ */
3519
+ static createEmptyContent() {
3520
+ return VegaRTEContent.fromJSON([
3521
+ {
3522
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
3523
+ type: 'paragraph',
3524
+ nodes: [
3525
+ {
3526
+ id: createPublicApiRuntimeMetricsSlimmer.generateUUID(),
3527
+ type: 'text',
3528
+ text: '',
3529
+ },
3530
+ ],
3531
+ },
3532
+ ]);
3533
+ }
3534
+ /**
3535
+ * Clones the content state.
3536
+ *
3537
+ * @returns {VegaRTEContent} The cloned content state.
3538
+ */
3539
+ clone() {
3540
+ return new VegaRTEContent([...this.blocks]);
3541
+ }
3542
+ /**
3543
+ * Converts the content state to a JSON array of blocks.
3544
+ *
3545
+ * @returns {VegaRTEContentBlock[]} The JSON array of blocks.
3546
+ */
3547
+ toJSON() {
3548
+ return this.blocks.map((block) => block.toJSON());
3549
+ }
3550
+ /**
3551
+ * Internal method to add the block item, remove the block item
3552
+ *
3553
+ * @param {ModifyContentAction} action - Modify content action
3554
+ */
3555
+ apply(action) {
3556
+ ActionHandleStrategyRegistry.executeTheStrategy(action, this);
3557
+ }
3558
+ /**
3559
+ * Convert text to list.
3560
+ *
3561
+ * @param {RTETextBlock} block - block
3562
+ * @returns {RTEListItemBlock} list item block dto.
3563
+ */
3564
+ toListItem(block) {
3565
+ block.nodes.map((node) => node.apply(new SyncUpSelectionAction()));
3566
+ const listItemBlock = new RTEListItemBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID());
3567
+ listItemBlock.apply(new AppendChildNodesAction(block['nodes']));
3568
+ listItemBlock['annotationMap'] = block['annotationMap'];
3569
+ return listItemBlock;
3570
+ }
3571
+ /**
3572
+ * create list.
3573
+ *
3574
+ * @param {ListType} type - type
3575
+ * @returns {RTEListBlock} list block dto.
3576
+ */
3577
+ createList(type) {
3578
+ return new RTEListBlock(createPublicApiRuntimeMetricsSlimmer.generateUUID(), type);
3579
+ }
3580
+ }
3581
+ (() => {
3582
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.DELETE_CHILD, VegaRTEContent.name, new BlockRemoveChildBlockStrategy());
3583
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.APPEND_CHILD_NODES, VegaRTEContent.name, new BlockAppendBlocksStrategy());
3584
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_BLOCKS_BEFORE, VegaRTEContent.name, new BlockInsertBlocksBeforeStrategy());
3585
+ ActionHandleStrategyRegistry.register(exports.ModifyContentActionType.INSERT_BLOCKS_AFTER, VegaRTEContent.name, new BlockInsertBlocksAfterStrategy());
3586
+ })();
3587
+
3588
+ exports.AnnotationAction = AnnotationAction;
3589
+ exports.AppendChildNodesAction = AppendChildNodesAction;
3590
+ exports.BlockAnnotation = BlockAnnotation;
3591
+ exports.BoldAnnotation = BoldAnnotation;
3592
+ exports.BoldAnnotationAction = BoldAnnotationAction;
3593
+ exports.BreakSingleBlockAction = BreakSingleBlockAction;
3594
+ exports.ClearFormattingAnnotationAction = ClearFormattingAnnotationAction;
3595
+ exports.CodeAnnotationAction = CodeAnnotationAction;
3596
+ exports.HorizontalAlignmentAnnotation = HorizontalAlignmentAnnotation;
3597
+ exports.ImageAnnotation = ImageAnnotation;
3598
+ exports.IndentAnnotation = IndentAnnotation;
3599
+ exports.InsertBlocksAfterAction = InsertBlocksAfterAction;
3600
+ exports.InsertBlocksBeforeAction = InsertBlocksBeforeAction;
3601
+ exports.ItalicAnnotation = ItalicAnnotation;
3602
+ exports.LinkAnnotationAction = LinkAnnotationAction;
3603
+ exports.MergeTwoBlocksNodesAction = MergeTwoBlocksNodesAction;
3604
+ exports.ModifyContentAction = ModifyContentAction;
3605
+ exports.NodeAnnotation = NodeAnnotation;
3606
+ exports.RTEBlock = RTEBlock;
3607
+ exports.RTEImageBlock = RTEImageBlock;
3608
+ exports.RTEImageNode = RTEImageNode;
3609
+ exports.RTEListBlock = RTEListBlock;
3610
+ exports.RTEListItemBlock = RTEListItemBlock;
3611
+ exports.RTENode = RTENode;
3612
+ exports.RTETextBlock = RTETextBlock;
3613
+ exports.RTETextNode = RTETextNode;
3614
+ exports.RTE_TEXT_COLORS = RTE_TEXT_COLORS;
3615
+ exports.RemoveChildAction = RemoveChildAction;
3616
+ exports.ReplaceChildNodesAction = ReplaceChildNodesAction;
3617
+ exports.SelectionRangeAnnotation = SelectionRangeAnnotation;
3618
+ exports.SplitBlockWithNodeAction = SplitBlockWithNodeAction;
3619
+ exports.StrikethroughAnnotation = StrikethroughAnnotation;
3620
+ exports.TextColorAnnotation = TextColorAnnotation;
3621
+ exports.TextSplittableAction = TextSplittableAction;
3622
+ exports.TextStyleAnnotation = TextStyleAnnotation;
3623
+ exports.TextStyleAnnotationAction = TextStyleAnnotationAction;
3624
+ exports.UnderlineAnnotation = UnderlineAnnotation;
3625
+ exports.UpdateTextAction = UpdateTextAction;
3626
+ exports.VegaRTEContent = VegaRTEContent;
3627
+ exports.ZERO_WIDTH_SPACE = ZERO_WIDTH_SPACE;
3628
+ exports.stateEntityRenderingRegistry = stateEntityRenderingRegistry;