@aeris-ui/core 22.0.0-alpha.7 → 22.0.0-alpha.9

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 (263) hide show
  1. package/README.md +2 -2
  2. package/fesm2022/aeris-ui-core-accordion.mjs +646 -255
  3. package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -1
  4. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +284 -103
  5. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -1
  6. package/fesm2022/aeris-ui-core-auto-complete.mjs +1171 -428
  7. package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
  8. package/fesm2022/aeris-ui-core-auto-focus.mjs +111 -61
  9. package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -1
  10. package/fesm2022/aeris-ui-core-avatar.mjs +383 -101
  11. package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -1
  12. package/fesm2022/aeris-ui-core-badge.mjs +562 -115
  13. package/fesm2022/aeris-ui-core-badge.mjs.map +1 -1
  14. package/fesm2022/aeris-ui-core-block-ui.mjs +205 -101
  15. package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -1
  16. package/fesm2022/aeris-ui-core-breadcrumb.mjs +547 -177
  17. package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -1
  18. package/fesm2022/aeris-ui-core-button-group.mjs +153 -38
  19. package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -1
  20. package/fesm2022/aeris-ui-core-button.mjs +730 -110
  21. package/fesm2022/aeris-ui-core-button.mjs.map +1 -1
  22. package/fesm2022/aeris-ui-core-card.mjs +371 -101
  23. package/fesm2022/aeris-ui-core-card.mjs.map +1 -1
  24. package/fesm2022/aeris-ui-core-carousel.mjs +690 -353
  25. package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
  26. package/fesm2022/aeris-ui-core-cascade-select.mjs +915 -423
  27. package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
  28. package/fesm2022/aeris-ui-core-chart.mjs +455 -258
  29. package/fesm2022/aeris-ui-core-chart.mjs.map +1 -1
  30. package/fesm2022/aeris-ui-core-checkbox.mjs +432 -135
  31. package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -1
  32. package/fesm2022/aeris-ui-core-chip.mjs +430 -117
  33. package/fesm2022/aeris-ui-core-chip.mjs.map +1 -1
  34. package/fesm2022/aeris-ui-core-class-names.mjs +87 -65
  35. package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -1
  36. package/fesm2022/aeris-ui-core-color-picker.mjs +1313 -683
  37. package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
  38. package/fesm2022/aeris-ui-core-compare.mjs +819 -310
  39. package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
  40. package/fesm2022/aeris-ui-core-confirm-dialog.mjs +1392 -551
  41. package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
  42. package/fesm2022/aeris-ui-core-confirm-popup.mjs +1447 -744
  43. package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
  44. package/fesm2022/aeris-ui-core-context-menu.mjs +900 -450
  45. package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
  46. package/fesm2022/aeris-ui-core-date-picker.mjs +1656 -863
  47. package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
  48. package/fesm2022/aeris-ui-core-dialog.mjs +1066 -355
  49. package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
  50. package/fesm2022/aeris-ui-core-divider.mjs +204 -43
  51. package/fesm2022/aeris-ui-core-divider.mjs.map +1 -1
  52. package/fesm2022/aeris-ui-core-drawer.mjs +1002 -326
  53. package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
  54. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +402 -249
  55. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
  56. package/fesm2022/aeris-ui-core-editor.mjs +934 -572
  57. package/fesm2022/aeris-ui-core-editor.mjs.map +1 -1
  58. package/fesm2022/aeris-ui-core-file-upload.mjs +1339 -514
  59. package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
  60. package/fesm2022/aeris-ui-core-filter-service.mjs +258 -301
  61. package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -1
  62. package/fesm2022/aeris-ui-core-fluid.mjs +68 -21
  63. package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -1
  64. package/fesm2022/aeris-ui-core-focus-trap.mjs +206 -182
  65. package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -1
  66. package/fesm2022/aeris-ui-core-form-field.mjs +672 -170
  67. package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -1
  68. package/fesm2022/aeris-ui-core-galleria.mjs +1987 -797
  69. package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
  70. package/fesm2022/aeris-ui-core-glass.mjs +110 -33
  71. package/fesm2022/aeris-ui-core-glass.mjs.map +1 -1
  72. package/fesm2022/aeris-ui-core-icon-field.mjs +426 -103
  73. package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -1
  74. package/fesm2022/aeris-ui-core-inplace.mjs +452 -130
  75. package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -1
  76. package/fesm2022/aeris-ui-core-input-group.mjs +413 -112
  77. package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
  78. package/fesm2022/aeris-ui-core-input-mask.mjs +650 -248
  79. package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
  80. package/fesm2022/aeris-ui-core-input-number.mjs +902 -334
  81. package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
  82. package/fesm2022/aeris-ui-core-input-otp.mjs +667 -253
  83. package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -1
  84. package/fesm2022/aeris-ui-core-input-text.mjs +618 -152
  85. package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
  86. package/fesm2022/aeris-ui-core-key-filter.mjs +263 -201
  87. package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -1
  88. package/fesm2022/aeris-ui-core-mega-menu.mjs +601 -388
  89. package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
  90. package/fesm2022/aeris-ui-core-menu.mjs +1032 -495
  91. package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
  92. package/fesm2022/aeris-ui-core-menubar.mjs +960 -491
  93. package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
  94. package/fesm2022/aeris-ui-core-message.mjs +477 -145
  95. package/fesm2022/aeris-ui-core-message.mjs.map +1 -1
  96. package/fesm2022/aeris-ui-core-meter-group.mjs +587 -196
  97. package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -1
  98. package/fesm2022/aeris-ui-core-multi-select.mjs +1550 -552
  99. package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
  100. package/fesm2022/aeris-ui-core-order-list.mjs +518 -202
  101. package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
  102. package/fesm2022/aeris-ui-core-organization-chart.mjs +455 -177
  103. package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
  104. package/fesm2022/aeris-ui-core-paginator.mjs +329 -127
  105. package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
  106. package/fesm2022/aeris-ui-core-panel.mjs +596 -196
  107. package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
  108. package/fesm2022/aeris-ui-core-password.mjs +894 -247
  109. package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
  110. package/fesm2022/aeris-ui-core-pick-list.mjs +1280 -659
  111. package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
  112. package/fesm2022/aeris-ui-core-popover.mjs +892 -386
  113. package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
  114. package/fesm2022/aeris-ui-core-progress-bar.mjs +549 -176
  115. package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -1
  116. package/fesm2022/aeris-ui-core-progress-spinner.mjs +410 -133
  117. package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -1
  118. package/fesm2022/aeris-ui-core-radio-button.mjs +386 -119
  119. package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -1
  120. package/fesm2022/aeris-ui-core-rating.mjs +502 -225
  121. package/fesm2022/aeris-ui-core-rating.mjs.map +1 -1
  122. package/fesm2022/aeris-ui-core-scroll-panel.mjs +457 -154
  123. package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -1
  124. package/fesm2022/aeris-ui-core-scroll-top.mjs +204 -63
  125. package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -1
  126. package/fesm2022/aeris-ui-core-select.mjs +1794 -643
  127. package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
  128. package/fesm2022/aeris-ui-core-skeleton.mjs +149 -45
  129. package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -1
  130. package/fesm2022/aeris-ui-core-slider.mjs +868 -404
  131. package/fesm2022/aeris-ui-core-slider.mjs.map +1 -1
  132. package/fesm2022/aeris-ui-core-speed-dial.mjs +800 -329
  133. package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -1
  134. package/fesm2022/aeris-ui-core-split-button.mjs +918 -257
  135. package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
  136. package/fesm2022/aeris-ui-core-splitter.mjs +812 -352
  137. package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
  138. package/fesm2022/aeris-ui-core-stepper.mjs +697 -254
  139. package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
  140. package/fesm2022/aeris-ui-core-style-class.mjs +587 -342
  141. package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -1
  142. package/fesm2022/aeris-ui-core-table.mjs +1984 -865
  143. package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
  144. package/fesm2022/aeris-ui-core-tabs.mjs +686 -324
  145. package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
  146. package/fesm2022/aeris-ui-core-textarea.mjs +846 -212
  147. package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
  148. package/fesm2022/aeris-ui-core-theme-builder.mjs +1258 -1413
  149. package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
  150. package/fesm2022/aeris-ui-core-theming.mjs +132 -147
  151. package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
  152. package/fesm2022/aeris-ui-core-tiered-menu.mjs +885 -465
  153. package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
  154. package/fesm2022/aeris-ui-core-timeline.mjs +407 -131
  155. package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
  156. package/fesm2022/aeris-ui-core-toast.mjs +855 -615
  157. package/fesm2022/aeris-ui-core-toast.mjs.map +1 -1
  158. package/fesm2022/aeris-ui-core-toggle-switch.mjs +390 -127
  159. package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -1
  160. package/fesm2022/aeris-ui-core-toolbar.mjs +458 -121
  161. package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
  162. package/fesm2022/aeris-ui-core-tooltip.mjs +623 -345
  163. package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
  164. package/fesm2022/aeris-ui-core-tree-select.mjs +1356 -601
  165. package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
  166. package/fesm2022/aeris-ui-core-tree-table.mjs +2001 -942
  167. package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
  168. package/fesm2022/aeris-ui-core-tree.mjs +1103 -658
  169. package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
  170. package/fesm2022/aeris-ui-core.mjs +861 -842
  171. package/fesm2022/aeris-ui-core.mjs.map +1 -1
  172. package/package.json +1 -1
  173. package/schematics/runtime/theme-builder/aeris-theme.js +28 -16
  174. package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -1
  175. package/styles/_fallback-colors.scss +3 -3
  176. package/styles/_tokens.scss +5 -5
  177. package/styles/aeris.css +12 -16
  178. package/styles/controls.css +1 -1
  179. package/types/aeris-ui-core-accordion.d.ts +166 -93
  180. package/types/aeris-ui-core-animate-on-scroll.d.ts +71 -31
  181. package/types/aeris-ui-core-auto-complete.d.ts +326 -149
  182. package/types/aeris-ui-core-auto-focus.d.ts +24 -16
  183. package/types/aeris-ui-core-avatar.d.ts +112 -42
  184. package/types/aeris-ui-core-badge.d.ts +160 -47
  185. package/types/aeris-ui-core-block-ui.d.ts +47 -27
  186. package/types/aeris-ui-core-breadcrumb.d.ts +162 -92
  187. package/types/aeris-ui-core-button-group.d.ts +37 -16
  188. package/types/aeris-ui-core-button.d.ts +226 -64
  189. package/types/aeris-ui-core-card.d.ts +74 -37
  190. package/types/aeris-ui-core-carousel.d.ts +197 -117
  191. package/types/aeris-ui-core-cascade-select.d.ts +252 -131
  192. package/types/aeris-ui-core-chart.d.ts +134 -84
  193. package/types/aeris-ui-core-checkbox.d.ts +139 -55
  194. package/types/aeris-ui-core-chip.d.ts +116 -51
  195. package/types/aeris-ui-core-class-names.d.ts +22 -20
  196. package/types/aeris-ui-core-color-picker.d.ts +347 -150
  197. package/types/aeris-ui-core-compare.d.ts +224 -101
  198. package/types/aeris-ui-core-confirm-dialog.d.ts +441 -249
  199. package/types/aeris-ui-core-confirm-popup.d.ts +440 -268
  200. package/types/aeris-ui-core-context-menu.d.ts +262 -150
  201. package/types/aeris-ui-core-date-picker.d.ts +488 -226
  202. package/types/aeris-ui-core-dialog.d.ts +288 -121
  203. package/types/aeris-ui-core-divider.d.ts +58 -20
  204. package/types/aeris-ui-core-drawer.d.ts +273 -116
  205. package/types/aeris-ui-core-dynamic-dialog.d.ts +157 -140
  206. package/types/aeris-ui-core-editor.d.ts +243 -124
  207. package/types/aeris-ui-core-file-upload.d.ts +366 -197
  208. package/types/aeris-ui-core-filter-service.d.ts +48 -52
  209. package/types/aeris-ui-core-fluid.d.ts +12 -9
  210. package/types/aeris-ui-core-focus-trap.d.ts +39 -31
  211. package/types/aeris-ui-core-form-field.d.ts +158 -62
  212. package/types/aeris-ui-core-galleria.d.ts +589 -256
  213. package/types/aeris-ui-core-glass.d.ts +24 -11
  214. package/types/aeris-ui-core-icon-field.d.ts +94 -34
  215. package/types/aeris-ui-core-inplace.d.ts +123 -62
  216. package/types/aeris-ui-core-input-group.d.ts +84 -35
  217. package/types/aeris-ui-core-input-mask.d.ts +194 -71
  218. package/types/aeris-ui-core-input-number.d.ts +272 -90
  219. package/types/aeris-ui-core-input-otp.d.ts +190 -82
  220. package/types/aeris-ui-core-input-text.d.ts +185 -62
  221. package/types/aeris-ui-core-key-filter.d.ts +53 -39
  222. package/types/aeris-ui-core-mega-menu.d.ts +174 -123
  223. package/types/aeris-ui-core-menu.d.ts +275 -172
  224. package/types/aeris-ui-core-menubar.d.ts +272 -160
  225. package/types/aeris-ui-core-message.d.ts +132 -61
  226. package/types/aeris-ui-core-meter-group.d.ts +162 -90
  227. package/types/aeris-ui-core-multi-select.d.ts +435 -187
  228. package/types/aeris-ui-core-order-list.d.ts +143 -66
  229. package/types/aeris-ui-core-organization-chart.d.ts +132 -77
  230. package/types/aeris-ui-core-paginator.d.ts +92 -46
  231. package/types/aeris-ui-core-panel.d.ts +149 -78
  232. package/types/aeris-ui-core-password.d.ts +257 -108
  233. package/types/aeris-ui-core-pick-list.d.ts +373 -179
  234. package/types/aeris-ui-core-popover.d.ts +218 -107
  235. package/types/aeris-ui-core-progress-bar.d.ts +156 -73
  236. package/types/aeris-ui-core-progress-spinner.d.ts +110 -48
  237. package/types/aeris-ui-core-radio-button.d.ts +124 -51
  238. package/types/aeris-ui-core-rating.d.ts +149 -76
  239. package/types/aeris-ui-core-scroll-panel.d.ts +142 -64
  240. package/types/aeris-ui-core-scroll-top.d.ts +64 -29
  241. package/types/aeris-ui-core-select.d.ts +474 -226
  242. package/types/aeris-ui-core-skeleton.d.ts +39 -17
  243. package/types/aeris-ui-core-slider.d.ts +270 -116
  244. package/types/aeris-ui-core-speed-dial.d.ts +240 -112
  245. package/types/aeris-ui-core-split-button.d.ts +265 -115
  246. package/types/aeris-ui-core-splitter.d.ts +224 -106
  247. package/types/aeris-ui-core-stepper.d.ts +183 -91
  248. package/types/aeris-ui-core-style-class.d.ts +141 -71
  249. package/types/aeris-ui-core-table.d.ts +595 -308
  250. package/types/aeris-ui-core-tabs.d.ts +163 -90
  251. package/types/aeris-ui-core-textarea.d.ts +261 -81
  252. package/types/aeris-ui-core-theme-builder.d.ts +466 -451
  253. package/types/aeris-ui-core-theming.d.ts +42 -49
  254. package/types/aeris-ui-core-tiered-menu.d.ts +249 -147
  255. package/types/aeris-ui-core-timeline.d.ts +108 -71
  256. package/types/aeris-ui-core-toast.d.ts +219 -155
  257. package/types/aeris-ui-core-toggle-switch.d.ts +125 -52
  258. package/types/aeris-ui-core-toolbar.d.ts +98 -41
  259. package/types/aeris-ui-core-tooltip.d.ts +157 -92
  260. package/types/aeris-ui-core-tree-select.d.ts +359 -179
  261. package/types/aeris-ui-core-tree-table.d.ts +565 -290
  262. package/types/aeris-ui-core-tree.d.ts +269 -165
  263. package/types/aeris-ui-core.d.ts +161 -125
@@ -1,559 +1,698 @@
1
- import { DOCUMENT } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, model, input, booleanAttribute, computed, output, viewChild, signal, effect, SecurityContext, forwardRef, ViewEncapsulation, Component } from '@angular/core';
4
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { ɵaerisDisplayInvalid as _aerisDisplayInvalid } from '@aeris-ui/core';
6
- import { DomSanitizer } from '@angular/platform-browser';
7
- import { FORMAT_TEXT_COMMAND, $getSelection, $isRangeSelection, $createParagraphNode, UNDO_COMMAND, REDO_COMMAND, FORMAT_ELEMENT_COMMAND, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, $isTextNode, createEditor, $getRoot, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_LOW, $isElementNode } from 'lexical';
8
- import { $createHeadingNode, $createQuoteNode, HeadingNode, QuoteNode, registerRichText } from '@lexical/rich-text';
9
- import { $generateHtmlFromNodes, $generateNodesFromDOM } from '@lexical/html';
10
- import { INSERT_UNORDERED_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_CHECK_LIST_COMMAND, REMOVE_LIST_COMMAND, ListNode, ListItemNode, registerList, registerCheckList } from '@lexical/list';
11
- import { createEmptyHistoryState, registerHistory } from '@lexical/history';
12
- import { $setBlocksType } from '@lexical/selection';
13
-
1
+ import { DOCUMENT } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, SecurityContext, ViewEncapsulation, booleanAttribute, computed, effect, forwardRef, inject, input, model, output, signal, viewChild } from "@angular/core";
4
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
5
+ import { ɵaerisDisplayInvalid } from "@aeris-ui/core";
6
+ import { DomSanitizer } from "@angular/platform-browser";
7
+ import { $createParagraphNode, $getRoot, $getSelection, $isElementNode, $isRangeSelection, $isTextNode, COMMAND_PRIORITY_LOW, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, REDO_COMMAND, SELECTION_CHANGE_COMMAND, UNDO_COMMAND, createEditor } from "lexical";
8
+ import { $createHeadingNode, $createQuoteNode, HeadingNode, QuoteNode, registerRichText } from "@lexical/rich-text";
9
+ import { $generateHtmlFromNodes, $generateNodesFromDOM } from "@lexical/html";
10
+ import { INSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, ListItemNode, ListNode, REMOVE_LIST_COMMAND, registerCheckList, registerList } from "@lexical/list";
11
+ import { createEmptyHistoryState, registerHistory } from "@lexical/history";
12
+ import { $setBlocksType } from "@lexical/selection";
14
13
  const AERIS_EDITOR_DEFAULT_FORMATS = [
15
- 'undo',
16
- 'redo',
17
- 'bold',
18
- 'italic',
19
- 'underline',
20
- 'heading',
21
- 'quote',
22
- 'bulletList',
23
- 'numberedList',
14
+ "undo",
15
+ "redo",
16
+ "bold",
17
+ "italic",
18
+ "underline",
19
+ "heading",
20
+ "quote",
21
+ "bulletList",
22
+ "numberedList"
24
23
  ];
25
24
  const AERIS_EDITOR_ALL_FORMATS = [
26
- 'undo',
27
- 'redo',
28
- 'bold',
29
- 'italic',
30
- 'underline',
31
- 'strikethrough',
32
- 'code',
33
- 'highlight',
34
- 'subscript',
35
- 'superscript',
36
- 'lowercase',
37
- 'uppercase',
38
- 'capitalize',
39
- 'paragraph',
40
- 'heading1',
41
- 'heading2',
42
- 'heading3',
43
- 'heading4',
44
- 'heading5',
45
- 'heading6',
46
- 'quote',
47
- 'bulletList',
48
- 'numberedList',
49
- 'checkList',
50
- 'alignLeft',
51
- 'alignStart',
52
- 'alignCenter',
53
- 'alignRight',
54
- 'alignEnd',
55
- 'alignJustify',
56
- 'outdent',
57
- 'indent',
58
- 'clear',
25
+ "undo",
26
+ "redo",
27
+ "bold",
28
+ "italic",
29
+ "underline",
30
+ "strikethrough",
31
+ "code",
32
+ "highlight",
33
+ "subscript",
34
+ "superscript",
35
+ "lowercase",
36
+ "uppercase",
37
+ "capitalize",
38
+ "paragraph",
39
+ "heading1",
40
+ "heading2",
41
+ "heading3",
42
+ "heading4",
43
+ "heading5",
44
+ "heading6",
45
+ "quote",
46
+ "bulletList",
47
+ "numberedList",
48
+ "checkList",
49
+ "alignLeft",
50
+ "alignStart",
51
+ "alignCenter",
52
+ "alignRight",
53
+ "alignEnd",
54
+ "alignJustify",
55
+ "outdent",
56
+ "indent",
57
+ "clear"
59
58
  ];
60
59
  let editorId = 0;
61
- class AerisEditorComponent {
62
- document = inject(DOCUMENT);
63
- sanitizer = inject(DomSanitizer);
64
- value = model('', /* @ts-ignore */
65
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
66
- inputId = input('', /* @ts-ignore */
67
- ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
68
- name = input('', /* @ts-ignore */
69
- ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
70
- placeholder = input('Write something...', /* @ts-ignore */
71
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
72
- ariaLabel = input('', /* @ts-ignore */
73
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
74
- ariaLabelledBy = input('', /* @ts-ignore */
75
- ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
76
- ariaDescribedBy = input('', /* @ts-ignore */
77
- ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
78
- toolbarAriaLabel = input('Formatting tools', /* @ts-ignore */
79
- ...(ngDevMode ? [{ debugName: "toolbarAriaLabel" }] : /* istanbul ignore next */ []));
80
- size = input('md', /* @ts-ignore */
81
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
82
- appearance = input('outline', /* @ts-ignore */
83
- ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
84
- minHeight = input('12rem', /* @ts-ignore */
85
- ...(ngDevMode ? [{ debugName: "minHeight" }] : /* istanbul ignore next */ []));
86
- formats = input(AERIS_EDITOR_DEFAULT_FORMATS, /* @ts-ignore */
87
- ...(ngDevMode ? [{ debugName: "formats" }] : /* istanbul ignore next */ []));
88
- namespace = input('AerisEditor', /* @ts-ignore */
89
- ...(ngDevMode ? [{ debugName: "namespace" }] : /* istanbul ignore next */ []));
90
- lexicalTheme = input({}, /* @ts-ignore */
91
- ...(ngDevMode ? [{ debugName: "lexicalTheme" }] : /* istanbul ignore next */ []));
92
- htmlConfig = input({}, /* @ts-ignore */
93
- ...(ngDevMode ? [{ debugName: "htmlConfig" }] : /* istanbul ignore next */ []));
94
- extensions = input([], /* @ts-ignore */
95
- ...(ngDevMode ? [{ debugName: "extensions" }] : /* istanbul ignore next */ []));
96
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
97
- readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
98
- required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
99
- invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
100
- touched = input(null, /* @ts-ignore */
101
- ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
102
- displayInvalid = computed(() => _aerisDisplayInvalid(this.invalid(), this.touched()), /* @ts-ignore */
103
- ...(ngDevMode ? [{ debugName: "displayInvalid" }] : /* istanbul ignore next */ []));
104
- fluid = input(false, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
105
- showToolbar = input(true, { ...(ngDevMode ? { debugName: "showToolbar" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
106
- changed = output();
107
- focused = output();
108
- blurred = output();
109
- touch = output();
110
- ready = output();
111
- editorRoot = viewChild('editorRoot', /* @ts-ignore */
112
- ...(ngDevMode ? [{ debugName: "editorRoot" }] : /* istanbul ignore next */ []));
113
- generatedId = `aeris-editor-${++editorId}`;
114
- formDisabled = signal(false, /* @ts-ignore */
115
- ...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
116
- isEditorReady = signal(false, /* @ts-ignore */
117
- ...(ngDevMode ? [{ debugName: "isEditorReady" }] : /* istanbul ignore next */ []));
118
- hasFocus = signal(false, /* @ts-ignore */
119
- ...(ngDevMode ? [{ debugName: "hasFocus" }] : /* istanbul ignore next */ []));
120
- textContent = signal('', /* @ts-ignore */
121
- ...(ngDevMode ? [{ debugName: "textContent" }] : /* istanbul ignore next */ []));
122
- activeBold = signal(false, /* @ts-ignore */
123
- ...(ngDevMode ? [{ debugName: "activeBold" }] : /* istanbul ignore next */ []));
124
- activeItalic = signal(false, /* @ts-ignore */
125
- ...(ngDevMode ? [{ debugName: "activeItalic" }] : /* istanbul ignore next */ []));
126
- activeUnderline = signal(false, /* @ts-ignore */
127
- ...(ngDevMode ? [{ debugName: "activeUnderline" }] : /* istanbul ignore next */ []));
128
- activeStrikethrough = signal(false, /* @ts-ignore */
129
- ...(ngDevMode ? [{ debugName: "activeStrikethrough" }] : /* istanbul ignore next */ []));
130
- activeCode = signal(false, /* @ts-ignore */
131
- ...(ngDevMode ? [{ debugName: "activeCode" }] : /* istanbul ignore next */ []));
132
- activeHighlight = signal(false, /* @ts-ignore */
133
- ...(ngDevMode ? [{ debugName: "activeHighlight" }] : /* istanbul ignore next */ []));
134
- activeSubscript = signal(false, /* @ts-ignore */
135
- ...(ngDevMode ? [{ debugName: "activeSubscript" }] : /* istanbul ignore next */ []));
136
- activeSuperscript = signal(false, /* @ts-ignore */
137
- ...(ngDevMode ? [{ debugName: "activeSuperscript" }] : /* istanbul ignore next */ []));
138
- activeLowercase = signal(false, /* @ts-ignore */
139
- ...(ngDevMode ? [{ debugName: "activeLowercase" }] : /* istanbul ignore next */ []));
140
- activeUppercase = signal(false, /* @ts-ignore */
141
- ...(ngDevMode ? [{ debugName: "activeUppercase" }] : /* istanbul ignore next */ []));
142
- activeCapitalize = signal(false, /* @ts-ignore */
143
- ...(ngDevMode ? [{ debugName: "activeCapitalize" }] : /* istanbul ignore next */ []));
144
- activeBlock = signal('paragraph', /* @ts-ignore */
145
- ...(ngDevMode ? [{ debugName: "activeBlock" }] : /* istanbul ignore next */ []));
146
- activeList = signal(null, /* @ts-ignore */
147
- ...(ngDevMode ? [{ debugName: "activeList" }] : /* istanbul ignore next */ []));
148
- activeAlignment = signal('left', /* @ts-ignore */
149
- ...(ngDevMode ? [{ debugName: "activeAlignment" }] : /* istanbul ignore next */ []));
150
- availableFormats = computed(() => new Set(this.formats()), /* @ts-ignore */
151
- ...(ngDevMode ? [{ debugName: "availableFormats" }] : /* istanbul ignore next */ []));
152
- hasInlineActions = computed(() => this.formats().some((format) => [
153
- 'bold',
154
- 'italic',
155
- 'underline',
156
- 'strikethrough',
157
- 'code',
158
- 'highlight',
159
- 'subscript',
160
- 'superscript',
161
- 'lowercase',
162
- 'uppercase',
163
- 'capitalize',
164
- ].includes(format)), /* @ts-ignore */
165
- ...(ngDevMode ? [{ debugName: "hasInlineActions" }] : /* istanbul ignore next */ []));
166
- hasBlockActions = computed(() => this.formats().some((format) => [
167
- 'paragraph',
168
- 'heading',
169
- 'heading1',
170
- 'heading2',
171
- 'heading3',
172
- 'heading4',
173
- 'heading5',
174
- 'heading6',
175
- 'quote',
176
- ].includes(format)), /* @ts-ignore */
177
- ...(ngDevMode ? [{ debugName: "hasBlockActions" }] : /* istanbul ignore next */ []));
178
- hasListActions = computed(() => this.formats().some((format) => ['bulletList', 'numberedList', 'checkList'].includes(format)), /* @ts-ignore */
179
- ...(ngDevMode ? [{ debugName: "hasListActions" }] : /* istanbul ignore next */ []));
180
- hasAlignmentActions = computed(() => this.formats().some((format) => ['alignLeft', 'alignStart', 'alignCenter', 'alignRight', 'alignEnd', 'alignJustify'].includes(format)), /* @ts-ignore */
181
- ...(ngDevMode ? [{ debugName: "hasAlignmentActions" }] : /* istanbul ignore next */ []));
182
- hasDocumentActions = computed(() => this.formats().some((format) => ['outdent', 'indent', 'clear'].includes(format)), /* @ts-ignore */
183
- ...(ngDevMode ? [{ debugName: "hasDocumentActions" }] : /* istanbul ignore next */ []));
184
- resolvedInputId = computed(() => this.inputId() || this.generatedId, /* @ts-ignore */
185
- ...(ngDevMode ? [{ debugName: "resolvedInputId" }] : /* istanbul ignore next */ []));
186
- effectiveDisabled = computed(() => this.disabled() || this.formDisabled(), /* @ts-ignore */
187
- ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
188
- editable = computed(() => !this.effectiveDisabled() && !this.readonly(), /* @ts-ignore */
189
- ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
190
- toolbarDisabled = computed(() => !this.editable() || !this.isEditorReady(), /* @ts-ignore */
191
- ...(ngDevMode ? [{ debugName: "toolbarDisabled" }] : /* istanbul ignore next */ []));
192
- placeholderVisible = computed(() => !this.hasFocus() && !this.textContent().trim() && !!this.placeholder(), /* @ts-ignore */
193
- ...(ngDevMode ? [{ debugName: "placeholderVisible" }] : /* istanbul ignore next */ []));
194
- editor = null;
195
- unregisterEditor = null;
196
- lastSyncedValue = '';
197
- onChange = () => undefined;
198
- onTouched = () => undefined;
199
- constructor() {
200
- effect(() => {
201
- const editable = this.editable();
202
- this.editor?.setEditable(editable);
203
- });
204
- effect(() => {
205
- const nextValue = this.value();
206
- if (!this.editor || nextValue === this.lastSyncedValue)
207
- return;
208
- this.writeEditorValue(nextValue);
209
- });
210
- }
211
- ngAfterViewInit() {
212
- this.createEditor();
213
- }
214
- ngOnDestroy() {
215
- this.unregisterEditor?.();
216
- this.unregisterEditor = null;
217
- this.editor?.setRootElement(null);
218
- this.editor = null;
219
- this.isEditorReady.set(false);
220
- }
221
- writeValue(value) {
222
- const nextValue = value == null ? '' : String(value);
223
- this.value.set(nextValue);
224
- this.writeEditorValue(nextValue);
225
- }
226
- registerOnChange(callback) {
227
- this.onChange = callback;
228
- }
229
- registerOnTouched(callback) {
230
- this.onTouched = callback;
231
- }
232
- setDisabledState(disabled) {
233
- this.formDisabled.set(disabled);
234
- }
235
- focus() {
236
- this.editor?.focus();
237
- }
238
- clear() {
239
- if (!this.editable())
240
- return;
241
- this.writeEditorValue('');
242
- this.focus();
243
- }
244
- reset() {
245
- this.clear();
246
- }
247
- format(format) {
248
- if (!this.editable())
249
- return;
250
- this.editor?.dispatchCommand(FORMAT_TEXT_COMMAND, format);
251
- }
252
- setBlock(block) {
253
- if (!this.editable())
254
- return;
255
- this.editor?.update(() => {
256
- const selection = $getSelection();
257
- if (!$isRangeSelection(selection))
258
- return;
259
- if (block === 'heading') {
260
- block = 'h2';
261
- }
262
- if (block.startsWith('h') && this.activeBlock() !== block) {
263
- $setBlocksType(selection, () => $createHeadingNode(block));
264
- return;
265
- }
266
- if (block === 'quote' && this.activeBlock() !== 'quote') {
267
- $setBlocksType(selection, () => $createQuoteNode());
268
- return;
269
- }
270
- $setBlocksType(selection, () => $createParagraphNode());
271
- });
272
- }
273
- toggleBulletList() {
274
- if (!this.editable())
275
- return;
276
- this.editor?.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);
277
- }
278
- toggleNumberedList() {
279
- if (!this.editable())
280
- return;
281
- this.editor?.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);
282
- }
283
- toggleCheckList() {
284
- if (!this.editable())
285
- return;
286
- this.editor?.dispatchCommand(INSERT_CHECK_LIST_COMMAND, undefined);
287
- }
288
- removeList() {
289
- if (!this.editable())
290
- return;
291
- this.editor?.dispatchCommand(REMOVE_LIST_COMMAND, undefined);
292
- }
293
- undo() {
294
- if (!this.editable())
295
- return;
296
- this.editor?.dispatchCommand(UNDO_COMMAND, undefined);
297
- }
298
- redo() {
299
- if (!this.editable())
300
- return;
301
- this.editor?.dispatchCommand(REDO_COMMAND, undefined);
302
- }
303
- align(alignment) {
304
- if (!this.editable())
305
- return;
306
- this.editor?.dispatchCommand(FORMAT_ELEMENT_COMMAND, alignment);
307
- }
308
- indent() {
309
- if (!this.editable())
310
- return;
311
- this.editor?.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
312
- }
313
- outdent() {
314
- if (!this.editable())
315
- return;
316
- this.editor?.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
317
- }
318
- clearFormatting() {
319
- if (!this.editable())
320
- return;
321
- this.editor?.update(() => {
322
- const selection = $getSelection();
323
- if (!$isRangeSelection(selection))
324
- return;
325
- selection.setFormat(0);
326
- for (const node of selection.getNodes()) {
327
- if ($isTextNode(node)) {
328
- node.setFormat(0);
329
- node.setStyle('');
330
- }
331
- }
332
- });
333
- }
334
- getLexicalEditor() {
335
- return this.editor;
336
- }
337
- handleFocus(event) {
338
- this.hasFocus.set(true);
339
- this.focused.emit(event);
340
- }
341
- handleBlur(event) {
342
- this.blurred.emit(event);
343
- }
344
- handleFocusOut(event) {
345
- const relatedTarget = event.relatedTarget;
346
- const root = this.editorRoot()?.nativeElement;
347
- if (relatedTarget instanceof Node && root?.parentElement?.contains(relatedTarget))
348
- return;
349
- this.hasFocus.set(false);
350
- this.touch.emit();
351
- this.onTouched();
352
- }
353
- createEditor() {
354
- const rootElement = this.editorRoot()?.nativeElement;
355
- if (!rootElement)
356
- return;
357
- const extensions = this.extensions();
358
- const editor = createEditor({
359
- namespace: this.namespace(),
360
- html: this.htmlConfig(),
361
- nodes: [
362
- HeadingNode,
363
- QuoteNode,
364
- ListNode,
365
- ListItemNode,
366
- ...extensions.flatMap((extension) => extension.nodes ?? []),
367
- ],
368
- onError(error) {
369
- throw error;
370
- },
371
- theme: this.resolveTheme(),
372
- });
373
- this.editor = editor;
374
- editor.setRootElement(rootElement);
375
- editor.setEditable(this.editable());
376
- this.isEditorReady.set(true);
377
- const historyState = createEmptyHistoryState();
378
- const cleanups = [
379
- registerRichText(editor),
380
- registerList(editor),
381
- registerCheckList(editor),
382
- registerHistory(editor, historyState, 250),
383
- ...extensions.flatMap((extension) => {
384
- const cleanup = extension.setup?.(editor);
385
- return cleanup ? [cleanup] : [];
386
- }),
387
- editor.registerUpdateListener(({ editorState }) => {
388
- editorState.read(() => {
389
- const root = $getRoot();
390
- const textContent = root.getTextContent();
391
- const hasStructuredContent = root
392
- .getChildren()
393
- .some((node) => !['paragraph', 'heading', 'quote'].includes(node.getType()));
394
- const html = textContent.trim() || hasStructuredContent
395
- ? $generateHtmlFromNodes(editor, null)
396
- : '';
397
- this.syncSelectionState();
398
- this.emitValue(html, textContent);
399
- }, { editor });
400
- }),
401
- editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
402
- this.syncSelectionState();
403
- return false;
404
- }, COMMAND_PRIORITY_LOW),
405
- ];
406
- this.unregisterEditor = () => {
407
- for (const cleanup of cleanups)
408
- cleanup();
409
- };
410
- this.writeEditorValue(this.value());
411
- this.ready.emit(editor);
412
- }
413
- resolveTheme() {
414
- const customTheme = this.lexicalTheme();
415
- return {
416
- ...customTheme,
417
- heading: {
418
- h1: 'aeris-editor-content__heading aeris-editor-content__heading--h1',
419
- h2: 'aeris-editor-content__heading aeris-editor-content__heading--h2',
420
- h3: 'aeris-editor-content__heading aeris-editor-content__heading--h3',
421
- h4: 'aeris-editor-content__heading aeris-editor-content__heading--h4',
422
- h5: 'aeris-editor-content__heading aeris-editor-content__heading--h5',
423
- h6: 'aeris-editor-content__heading aeris-editor-content__heading--h6',
424
- ...customTheme.heading,
425
- },
426
- list: {
427
- checklist: 'aeris-editor-content__check-list',
428
- listitem: 'aeris-editor-content__list-item',
429
- listitemChecked: 'aeris-editor-content__list-item--checked',
430
- listitemUnchecked: 'aeris-editor-content__list-item--unchecked',
431
- ol: 'aeris-editor-content__ordered-list',
432
- ul: 'aeris-editor-content__unordered-list',
433
- ...customTheme.list,
434
- nested: {
435
- listitem: 'aeris-editor-content__nested-list-item',
436
- ...customTheme.list?.nested,
437
- },
438
- },
439
- paragraph: customTheme.paragraph ?? 'aeris-editor-content__paragraph',
440
- quote: customTheme.quote ?? 'aeris-editor-content__quote',
441
- text: {
442
- bold: 'aeris-editor-content__bold',
443
- capitalize: 'aeris-editor-content__capitalize',
444
- code: 'aeris-editor-content__code',
445
- highlight: 'aeris-editor-content__highlight',
446
- italic: 'aeris-editor-content__italic',
447
- lowercase: 'aeris-editor-content__lowercase',
448
- strikethrough: 'aeris-editor-content__strikethrough',
449
- subscript: 'aeris-editor-content__subscript',
450
- superscript: 'aeris-editor-content__superscript',
451
- underline: 'aeris-editor-content__underline',
452
- underlineStrikethrough: 'aeris-editor-content__underline aeris-editor-content__strikethrough',
453
- uppercase: 'aeris-editor-content__uppercase',
454
- ...customTheme.text,
455
- },
456
- };
457
- }
458
- writeEditorValue(value) {
459
- if (!this.editor)
460
- return;
461
- this.lastSyncedValue = value;
462
- this.editor.update(() => {
463
- const root = $getRoot();
464
- root.clear();
465
- const sanitizedValue = this.sanitizer.sanitize(SecurityContext.HTML, value) ?? '';
466
- if (!sanitizedValue.trim()) {
467
- root.append($createParagraphNode());
468
- this.textContent.set('');
469
- return;
470
- }
471
- const Parser = this.document.defaultView?.DOMParser;
472
- if (!Parser) {
473
- root.append($createParagraphNode());
474
- this.textContent.set('');
475
- return;
476
- }
477
- const parser = new Parser();
478
- const dom = parser.parseFromString(sanitizedValue, 'text/html');
479
- const nodes = $generateNodesFromDOM(this.editor, dom);
480
- root.append(...(nodes.length ? nodes : [$createParagraphNode()]));
481
- this.textContent.set(root.getTextContent());
482
- });
483
- }
484
- emitValue(value, textContent) {
485
- this.textContent.set(textContent);
486
- this.syncSelectionState();
487
- if (value === this.lastSyncedValue && value === this.value())
488
- return;
489
- this.lastSyncedValue = value;
490
- this.value.set(value);
491
- this.changed.emit({ value, textContent });
492
- this.onChange(value);
493
- }
494
- syncSelectionState() {
495
- const selection = $getSelection();
496
- if (!$isRangeSelection(selection)) {
497
- this.activeBold.set(false);
498
- this.activeItalic.set(false);
499
- this.activeUnderline.set(false);
500
- this.activeStrikethrough.set(false);
501
- this.activeCode.set(false);
502
- this.activeHighlight.set(false);
503
- this.activeSubscript.set(false);
504
- this.activeSuperscript.set(false);
505
- this.activeLowercase.set(false);
506
- this.activeUppercase.set(false);
507
- this.activeCapitalize.set(false);
508
- this.activeBlock.set('paragraph');
509
- this.activeList.set(null);
510
- this.activeAlignment.set('left');
511
- return;
512
- }
513
- this.activeBold.set(selection.hasFormat('bold'));
514
- this.activeItalic.set(selection.hasFormat('italic'));
515
- this.activeUnderline.set(selection.hasFormat('underline'));
516
- this.activeStrikethrough.set(selection.hasFormat('strikethrough'));
517
- this.activeCode.set(selection.hasFormat('code'));
518
- this.activeHighlight.set(selection.hasFormat('highlight'));
519
- this.activeSubscript.set(selection.hasFormat('subscript'));
520
- this.activeSuperscript.set(selection.hasFormat('superscript'));
521
- this.activeLowercase.set(selection.hasFormat('lowercase'));
522
- this.activeUppercase.set(selection.hasFormat('uppercase'));
523
- this.activeCapitalize.set(selection.hasFormat('capitalize'));
524
- const nodes = selection.getNodes();
525
- const topLevel = nodes[0]?.getTopLevelElementOrThrow();
526
- if (topLevel instanceof HeadingNode) {
527
- this.activeBlock.set(topLevel.getTag());
528
- }
529
- else if (topLevel instanceof QuoteNode) {
530
- this.activeBlock.set('quote');
531
- }
532
- else {
533
- this.activeBlock.set('paragraph');
534
- }
535
- const elementAlignment = $isElementNode(topLevel) ? topLevel.getFormatType() : '';
536
- this.activeAlignment.set(elementAlignment === 'center' ||
537
- elementAlignment === 'start' ||
538
- elementAlignment === 'right' ||
539
- elementAlignment === 'end' ||
540
- elementAlignment === 'justify'
541
- ? elementAlignment
542
- : 'left');
543
- let currentNode = nodes[0] ?? null;
544
- while (currentNode && !(currentNode instanceof ListNode)) {
545
- currentNode = currentNode.getParent();
546
- }
547
- this.activeList.set(currentNode instanceof ListNode ? currentNode.getListType() : null);
548
- }
549
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AerisEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
550
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: AerisEditorComponent, isStandalone: true, selector: "aeris-editor", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null }, toolbarAriaLabel: { classPropertyName: "toolbarAriaLabel", publicName: "toolbarAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, formats: { classPropertyName: "formats", publicName: "formats", isSignal: true, isRequired: false, transformFunction: null }, namespace: { classPropertyName: "namespace", publicName: "namespace", isSignal: true, isRequired: false, transformFunction: null }, lexicalTheme: { classPropertyName: "lexicalTheme", publicName: "lexicalTheme", isSignal: true, isRequired: false, transformFunction: null }, htmlConfig: { classPropertyName: "htmlConfig", publicName: "htmlConfig", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed", focused: "focused", blurred: "blurred", touch: "touch", ready: "ready" }, host: { properties: { "attr.data-fluid": "fluid() || null" } }, providers: [
551
- {
552
- provide: NG_VALUE_ACCESSOR,
553
- useExisting: forwardRef(() => AerisEditorComponent),
554
- multi: true,
555
- },
556
- ], viewQueries: [{ propertyName: "editorRoot", first: true, predicate: ["editorRoot"], descendants: true, isSignal: true }], ngImport: i0, template: `
60
+ var AerisEditorComponent = class AerisEditorComponent {
61
+ document = inject(DOCUMENT);
62
+ sanitizer = inject(DomSanitizer);
63
+ value = model("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
64
+ inputId = input("", ...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
65
+ name = input("", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
66
+ placeholder = input("Write something...", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
67
+ ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
68
+ ariaLabelledBy = input("", ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
69
+ ariaDescribedBy = input("", ...ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []);
70
+ toolbarAriaLabel = input("Formatting tools", ...ngDevMode ? [{ debugName: "toolbarAriaLabel" }] : /* istanbul ignore next */ []);
71
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
72
+ appearance = input("outline", ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
73
+ minHeight = input("12rem", ...ngDevMode ? [{ debugName: "minHeight" }] : /* istanbul ignore next */ []);
74
+ formats = input(AERIS_EDITOR_DEFAULT_FORMATS, ...ngDevMode ? [{ debugName: "formats" }] : /* istanbul ignore next */ []);
75
+ namespace = input("AerisEditor", ...ngDevMode ? [{ debugName: "namespace" }] : /* istanbul ignore next */ []);
76
+ lexicalTheme = input({}, ...ngDevMode ? [{ debugName: "lexicalTheme" }] : /* istanbul ignore next */ []);
77
+ htmlConfig = input({}, ...ngDevMode ? [{ debugName: "htmlConfig" }] : /* istanbul ignore next */ []);
78
+ extensions = input([], ...ngDevMode ? [{ debugName: "extensions" }] : /* istanbul ignore next */ []);
79
+ disabled = input(false, {
80
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
81
+ transform: booleanAttribute
82
+ });
83
+ readonly = input(false, {
84
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
85
+ transform: booleanAttribute
86
+ });
87
+ required = input(false, {
88
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
89
+ transform: booleanAttribute
90
+ });
91
+ invalid = input(false, {
92
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
93
+ transform: booleanAttribute
94
+ });
95
+ touched = input(null, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
96
+ displayInvalid = computed(() => ɵaerisDisplayInvalid(this.invalid(), this.touched()), ...ngDevMode ? [{ debugName: "displayInvalid" }] : /* istanbul ignore next */ []);
97
+ fluid = input(false, {
98
+ ...ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {},
99
+ transform: booleanAttribute
100
+ });
101
+ showToolbar = input(true, {
102
+ ...ngDevMode ? { debugName: "showToolbar" } : /* istanbul ignore next */ {},
103
+ transform: booleanAttribute
104
+ });
105
+ changed = output();
106
+ focused = output();
107
+ blurred = output();
108
+ touch = output();
109
+ ready = output();
110
+ editorRoot = viewChild("editorRoot", ...ngDevMode ? [{ debugName: "editorRoot" }] : /* istanbul ignore next */ []);
111
+ generatedId = `aeris-editor-${++editorId}`;
112
+ formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
113
+ isEditorReady = signal(false, ...ngDevMode ? [{ debugName: "isEditorReady" }] : /* istanbul ignore next */ []);
114
+ hasFocus = signal(false, ...ngDevMode ? [{ debugName: "hasFocus" }] : /* istanbul ignore next */ []);
115
+ textContent = signal("", ...ngDevMode ? [{ debugName: "textContent" }] : /* istanbul ignore next */ []);
116
+ activeBold = signal(false, ...ngDevMode ? [{ debugName: "activeBold" }] : /* istanbul ignore next */ []);
117
+ activeItalic = signal(false, ...ngDevMode ? [{ debugName: "activeItalic" }] : /* istanbul ignore next */ []);
118
+ activeUnderline = signal(false, ...ngDevMode ? [{ debugName: "activeUnderline" }] : /* istanbul ignore next */ []);
119
+ activeStrikethrough = signal(false, ...ngDevMode ? [{ debugName: "activeStrikethrough" }] : /* istanbul ignore next */ []);
120
+ activeCode = signal(false, ...ngDevMode ? [{ debugName: "activeCode" }] : /* istanbul ignore next */ []);
121
+ activeHighlight = signal(false, ...ngDevMode ? [{ debugName: "activeHighlight" }] : /* istanbul ignore next */ []);
122
+ activeSubscript = signal(false, ...ngDevMode ? [{ debugName: "activeSubscript" }] : /* istanbul ignore next */ []);
123
+ activeSuperscript = signal(false, ...ngDevMode ? [{ debugName: "activeSuperscript" }] : /* istanbul ignore next */ []);
124
+ activeLowercase = signal(false, ...ngDevMode ? [{ debugName: "activeLowercase" }] : /* istanbul ignore next */ []);
125
+ activeUppercase = signal(false, ...ngDevMode ? [{ debugName: "activeUppercase" }] : /* istanbul ignore next */ []);
126
+ activeCapitalize = signal(false, ...ngDevMode ? [{ debugName: "activeCapitalize" }] : /* istanbul ignore next */ []);
127
+ activeBlock = signal("paragraph", ...ngDevMode ? [{ debugName: "activeBlock" }] : /* istanbul ignore next */ []);
128
+ activeList = signal(null, ...ngDevMode ? [{ debugName: "activeList" }] : /* istanbul ignore next */ []);
129
+ activeAlignment = signal("left", ...ngDevMode ? [{ debugName: "activeAlignment" }] : /* istanbul ignore next */ []);
130
+ availableFormats = computed(() => new Set(this.formats()), ...ngDevMode ? [{ debugName: "availableFormats" }] : /* istanbul ignore next */ []);
131
+ hasInlineActions = computed(() => this.formats().some((format) => [
132
+ "bold",
133
+ "italic",
134
+ "underline",
135
+ "strikethrough",
136
+ "code",
137
+ "highlight",
138
+ "subscript",
139
+ "superscript",
140
+ "lowercase",
141
+ "uppercase",
142
+ "capitalize"
143
+ ].includes(format)), ...ngDevMode ? [{ debugName: "hasInlineActions" }] : /* istanbul ignore next */ []);
144
+ hasBlockActions = computed(() => this.formats().some((format) => [
145
+ "paragraph",
146
+ "heading",
147
+ "heading1",
148
+ "heading2",
149
+ "heading3",
150
+ "heading4",
151
+ "heading5",
152
+ "heading6",
153
+ "quote"
154
+ ].includes(format)), ...ngDevMode ? [{ debugName: "hasBlockActions" }] : /* istanbul ignore next */ []);
155
+ hasListActions = computed(() => this.formats().some((format) => [
156
+ "bulletList",
157
+ "numberedList",
158
+ "checkList"
159
+ ].includes(format)), ...ngDevMode ? [{ debugName: "hasListActions" }] : /* istanbul ignore next */ []);
160
+ hasAlignmentActions = computed(() => this.formats().some((format) => [
161
+ "alignLeft",
162
+ "alignStart",
163
+ "alignCenter",
164
+ "alignRight",
165
+ "alignEnd",
166
+ "alignJustify"
167
+ ].includes(format)), ...ngDevMode ? [{ debugName: "hasAlignmentActions" }] : /* istanbul ignore next */ []);
168
+ hasDocumentActions = computed(() => this.formats().some((format) => [
169
+ "outdent",
170
+ "indent",
171
+ "clear"
172
+ ].includes(format)), ...ngDevMode ? [{ debugName: "hasDocumentActions" }] : /* istanbul ignore next */ []);
173
+ resolvedInputId = computed(() => this.inputId() || this.generatedId, ...ngDevMode ? [{ debugName: "resolvedInputId" }] : /* istanbul ignore next */ []);
174
+ effectiveDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []);
175
+ editable = computed(() => !this.effectiveDisabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []);
176
+ toolbarDisabled = computed(() => !this.editable() || !this.isEditorReady(), ...ngDevMode ? [{ debugName: "toolbarDisabled" }] : /* istanbul ignore next */ []);
177
+ placeholderVisible = computed(() => !this.hasFocus() && !this.textContent().trim() && !!this.placeholder(), ...ngDevMode ? [{ debugName: "placeholderVisible" }] : /* istanbul ignore next */ []);
178
+ editor = null;
179
+ unregisterEditor = null;
180
+ lastSyncedValue = "";
181
+ onChange = () => void 0;
182
+ onTouched = () => void 0;
183
+ constructor() {
184
+ effect(() => {
185
+ const editable = this.editable();
186
+ this.editor?.setEditable(editable);
187
+ });
188
+ effect(() => {
189
+ const nextValue = this.value();
190
+ if (!this.editor || nextValue === this.lastSyncedValue) return;
191
+ this.writeEditorValue(nextValue);
192
+ });
193
+ }
194
+ ngAfterViewInit() {
195
+ this.createEditor();
196
+ }
197
+ ngOnDestroy() {
198
+ this.unregisterEditor?.();
199
+ this.unregisterEditor = null;
200
+ this.editor?.setRootElement(null);
201
+ this.editor = null;
202
+ this.isEditorReady.set(false);
203
+ }
204
+ writeValue(value) {
205
+ const nextValue = value == null ? "" : String(value);
206
+ this.value.set(nextValue);
207
+ this.writeEditorValue(nextValue);
208
+ }
209
+ registerOnChange(callback) {
210
+ this.onChange = callback;
211
+ }
212
+ registerOnTouched(callback) {
213
+ this.onTouched = callback;
214
+ }
215
+ setDisabledState(disabled) {
216
+ this.formDisabled.set(disabled);
217
+ }
218
+ focus() {
219
+ this.editor?.focus();
220
+ }
221
+ clear() {
222
+ if (!this.editable()) return;
223
+ this.writeEditorValue("");
224
+ this.focus();
225
+ }
226
+ reset() {
227
+ this.clear();
228
+ }
229
+ format(format) {
230
+ if (!this.editable()) return;
231
+ this.editor?.dispatchCommand(FORMAT_TEXT_COMMAND, format);
232
+ }
233
+ setBlock(block) {
234
+ if (!this.editable()) return;
235
+ this.editor?.update(() => {
236
+ const selection = $getSelection();
237
+ if (!$isRangeSelection(selection)) return;
238
+ if (block === "heading") block = "h2";
239
+ if (block.startsWith("h") && this.activeBlock() !== block) {
240
+ $setBlocksType(selection, () => $createHeadingNode(block));
241
+ return;
242
+ }
243
+ if (block === "quote" && this.activeBlock() !== "quote") {
244
+ $setBlocksType(selection, () => $createQuoteNode());
245
+ return;
246
+ }
247
+ $setBlocksType(selection, () => $createParagraphNode());
248
+ });
249
+ }
250
+ toggleBulletList() {
251
+ if (!this.editable()) return;
252
+ this.editor?.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, void 0);
253
+ }
254
+ toggleNumberedList() {
255
+ if (!this.editable()) return;
256
+ this.editor?.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, void 0);
257
+ }
258
+ toggleCheckList() {
259
+ if (!this.editable()) return;
260
+ this.editor?.dispatchCommand(INSERT_CHECK_LIST_COMMAND, void 0);
261
+ }
262
+ removeList() {
263
+ if (!this.editable()) return;
264
+ this.editor?.dispatchCommand(REMOVE_LIST_COMMAND, void 0);
265
+ }
266
+ undo() {
267
+ if (!this.editable()) return;
268
+ this.editor?.dispatchCommand(UNDO_COMMAND, void 0);
269
+ }
270
+ redo() {
271
+ if (!this.editable()) return;
272
+ this.editor?.dispatchCommand(REDO_COMMAND, void 0);
273
+ }
274
+ align(alignment) {
275
+ if (!this.editable()) return;
276
+ this.editor?.dispatchCommand(FORMAT_ELEMENT_COMMAND, alignment);
277
+ }
278
+ indent() {
279
+ if (!this.editable()) return;
280
+ this.editor?.dispatchCommand(INDENT_CONTENT_COMMAND, void 0);
281
+ }
282
+ outdent() {
283
+ if (!this.editable()) return;
284
+ this.editor?.dispatchCommand(OUTDENT_CONTENT_COMMAND, void 0);
285
+ }
286
+ clearFormatting() {
287
+ if (!this.editable()) return;
288
+ this.editor?.update(() => {
289
+ const selection = $getSelection();
290
+ if (!$isRangeSelection(selection)) return;
291
+ selection.setFormat(0);
292
+ for (const node of selection.getNodes()) if ($isTextNode(node)) {
293
+ node.setFormat(0);
294
+ node.setStyle("");
295
+ }
296
+ });
297
+ }
298
+ getLexicalEditor() {
299
+ return this.editor;
300
+ }
301
+ handleFocus(event) {
302
+ this.hasFocus.set(true);
303
+ this.focused.emit(event);
304
+ }
305
+ handleBlur(event) {
306
+ this.blurred.emit(event);
307
+ }
308
+ handleFocusOut(event) {
309
+ const relatedTarget = event.relatedTarget;
310
+ const root = this.editorRoot()?.nativeElement;
311
+ if (relatedTarget instanceof Node && root?.parentElement?.contains(relatedTarget)) return;
312
+ this.hasFocus.set(false);
313
+ this.touch.emit();
314
+ this.onTouched();
315
+ }
316
+ createEditor() {
317
+ const rootElement = this.editorRoot()?.nativeElement;
318
+ if (!rootElement) return;
319
+ const extensions = this.extensions();
320
+ const editor = createEditor({
321
+ namespace: this.namespace(),
322
+ html: this.htmlConfig(),
323
+ nodes: [
324
+ HeadingNode,
325
+ QuoteNode,
326
+ ListNode,
327
+ ListItemNode,
328
+ ...extensions.flatMap((extension) => extension.nodes ?? [])
329
+ ],
330
+ onError(error) {
331
+ throw error;
332
+ },
333
+ theme: this.resolveTheme()
334
+ });
335
+ this.editor = editor;
336
+ editor.setRootElement(rootElement);
337
+ editor.setEditable(this.editable());
338
+ this.isEditorReady.set(true);
339
+ const historyState = createEmptyHistoryState();
340
+ const cleanups = [
341
+ registerRichText(editor),
342
+ registerList(editor),
343
+ registerCheckList(editor),
344
+ registerHistory(editor, historyState, 250),
345
+ ...extensions.flatMap((extension) => {
346
+ const cleanup = extension.setup?.(editor);
347
+ return cleanup ? [cleanup] : [];
348
+ }),
349
+ editor.registerUpdateListener(({ editorState }) => {
350
+ editorState.read(() => {
351
+ const root = $getRoot();
352
+ const textContent = root.getTextContent();
353
+ const hasStructuredContent = root.getChildren().some((node) => ![
354
+ "paragraph",
355
+ "heading",
356
+ "quote"
357
+ ].includes(node.getType()));
358
+ const html = textContent.trim() || hasStructuredContent ? $generateHtmlFromNodes(editor, null) : "";
359
+ this.syncSelectionState();
360
+ this.emitValue(html, textContent);
361
+ }, { editor });
362
+ }),
363
+ editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
364
+ this.syncSelectionState();
365
+ return false;
366
+ }, COMMAND_PRIORITY_LOW)
367
+ ];
368
+ this.unregisterEditor = () => {
369
+ for (const cleanup of cleanups) cleanup();
370
+ };
371
+ this.writeEditorValue(this.value());
372
+ this.ready.emit(editor);
373
+ }
374
+ resolveTheme() {
375
+ const customTheme = this.lexicalTheme();
376
+ return {
377
+ ...customTheme,
378
+ heading: {
379
+ h1: "aeris-editor-content__heading aeris-editor-content__heading--h1",
380
+ h2: "aeris-editor-content__heading aeris-editor-content__heading--h2",
381
+ h3: "aeris-editor-content__heading aeris-editor-content__heading--h3",
382
+ h4: "aeris-editor-content__heading aeris-editor-content__heading--h4",
383
+ h5: "aeris-editor-content__heading aeris-editor-content__heading--h5",
384
+ h6: "aeris-editor-content__heading aeris-editor-content__heading--h6",
385
+ ...customTheme.heading
386
+ },
387
+ list: {
388
+ checklist: "aeris-editor-content__check-list",
389
+ listitem: "aeris-editor-content__list-item",
390
+ listitemChecked: "aeris-editor-content__list-item--checked",
391
+ listitemUnchecked: "aeris-editor-content__list-item--unchecked",
392
+ ol: "aeris-editor-content__ordered-list",
393
+ ul: "aeris-editor-content__unordered-list",
394
+ ...customTheme.list,
395
+ nested: {
396
+ listitem: "aeris-editor-content__nested-list-item",
397
+ ...customTheme.list?.nested
398
+ }
399
+ },
400
+ paragraph: customTheme.paragraph ?? "aeris-editor-content__paragraph",
401
+ quote: customTheme.quote ?? "aeris-editor-content__quote",
402
+ text: {
403
+ bold: "aeris-editor-content__bold",
404
+ capitalize: "aeris-editor-content__capitalize",
405
+ code: "aeris-editor-content__code",
406
+ highlight: "aeris-editor-content__highlight",
407
+ italic: "aeris-editor-content__italic",
408
+ lowercase: "aeris-editor-content__lowercase",
409
+ strikethrough: "aeris-editor-content__strikethrough",
410
+ subscript: "aeris-editor-content__subscript",
411
+ superscript: "aeris-editor-content__superscript",
412
+ underline: "aeris-editor-content__underline",
413
+ underlineStrikethrough: "aeris-editor-content__underline aeris-editor-content__strikethrough",
414
+ uppercase: "aeris-editor-content__uppercase",
415
+ ...customTheme.text
416
+ }
417
+ };
418
+ }
419
+ writeEditorValue(value) {
420
+ if (!this.editor) return;
421
+ this.lastSyncedValue = value;
422
+ this.editor.update(() => {
423
+ const root = $getRoot();
424
+ root.clear();
425
+ const sanitizedValue = this.sanitizer.sanitize(SecurityContext.HTML, value) ?? "";
426
+ if (!sanitizedValue.trim()) {
427
+ root.append($createParagraphNode());
428
+ this.textContent.set("");
429
+ return;
430
+ }
431
+ const Parser = this.document.defaultView?.DOMParser;
432
+ if (!Parser) {
433
+ root.append($createParagraphNode());
434
+ this.textContent.set("");
435
+ return;
436
+ }
437
+ const dom = new Parser().parseFromString(sanitizedValue, "text/html");
438
+ const nodes = $generateNodesFromDOM(this.editor, dom);
439
+ root.append(...nodes.length ? nodes : [$createParagraphNode()]);
440
+ this.textContent.set(root.getTextContent());
441
+ });
442
+ }
443
+ emitValue(value, textContent) {
444
+ this.textContent.set(textContent);
445
+ this.syncSelectionState();
446
+ if (value === this.lastSyncedValue && value === this.value()) return;
447
+ this.lastSyncedValue = value;
448
+ this.value.set(value);
449
+ this.changed.emit({
450
+ value,
451
+ textContent
452
+ });
453
+ this.onChange(value);
454
+ }
455
+ syncSelectionState() {
456
+ const selection = $getSelection();
457
+ if (!$isRangeSelection(selection)) {
458
+ this.activeBold.set(false);
459
+ this.activeItalic.set(false);
460
+ this.activeUnderline.set(false);
461
+ this.activeStrikethrough.set(false);
462
+ this.activeCode.set(false);
463
+ this.activeHighlight.set(false);
464
+ this.activeSubscript.set(false);
465
+ this.activeSuperscript.set(false);
466
+ this.activeLowercase.set(false);
467
+ this.activeUppercase.set(false);
468
+ this.activeCapitalize.set(false);
469
+ this.activeBlock.set("paragraph");
470
+ this.activeList.set(null);
471
+ this.activeAlignment.set("left");
472
+ return;
473
+ }
474
+ this.activeBold.set(selection.hasFormat("bold"));
475
+ this.activeItalic.set(selection.hasFormat("italic"));
476
+ this.activeUnderline.set(selection.hasFormat("underline"));
477
+ this.activeStrikethrough.set(selection.hasFormat("strikethrough"));
478
+ this.activeCode.set(selection.hasFormat("code"));
479
+ this.activeHighlight.set(selection.hasFormat("highlight"));
480
+ this.activeSubscript.set(selection.hasFormat("subscript"));
481
+ this.activeSuperscript.set(selection.hasFormat("superscript"));
482
+ this.activeLowercase.set(selection.hasFormat("lowercase"));
483
+ this.activeUppercase.set(selection.hasFormat("uppercase"));
484
+ this.activeCapitalize.set(selection.hasFormat("capitalize"));
485
+ const nodes = selection.getNodes();
486
+ const topLevel = nodes[0]?.getTopLevelElementOrThrow();
487
+ if (topLevel instanceof HeadingNode) this.activeBlock.set(topLevel.getTag());
488
+ else if (topLevel instanceof QuoteNode) this.activeBlock.set("quote");
489
+ else this.activeBlock.set("paragraph");
490
+ const elementAlignment = $isElementNode(topLevel) ? topLevel.getFormatType() : "";
491
+ this.activeAlignment.set(elementAlignment === "center" || elementAlignment === "start" || elementAlignment === "right" || elementAlignment === "end" || elementAlignment === "justify" ? elementAlignment : "left");
492
+ let currentNode = nodes[0] ?? null;
493
+ while (currentNode && !(currentNode instanceof ListNode)) currentNode = currentNode.getParent();
494
+ this.activeList.set(currentNode instanceof ListNode ? currentNode.getListType() : null);
495
+ }
496
+ static ɵfac = i0.ɵɵngDeclareFactory({
497
+ minVersion: "12.0.0",
498
+ version: "22.2.1",
499
+ ngImport: i0,
500
+ type: AerisEditorComponent,
501
+ deps: [],
502
+ target: i0.ɵɵFactoryTarget.Component
503
+ });
504
+ static ɵcmp = i0.ɵɵngDeclareComponent({
505
+ minVersion: "17.0.0",
506
+ version: "22.2.1",
507
+ type: AerisEditorComponent,
508
+ isStandalone: true,
509
+ selector: "aeris-editor",
510
+ inputs: {
511
+ value: {
512
+ classPropertyName: "value",
513
+ publicName: "value",
514
+ isSignal: true,
515
+ isRequired: false,
516
+ transformFunction: null
517
+ },
518
+ inputId: {
519
+ classPropertyName: "inputId",
520
+ publicName: "inputId",
521
+ isSignal: true,
522
+ isRequired: false,
523
+ transformFunction: null
524
+ },
525
+ name: {
526
+ classPropertyName: "name",
527
+ publicName: "name",
528
+ isSignal: true,
529
+ isRequired: false,
530
+ transformFunction: null
531
+ },
532
+ placeholder: {
533
+ classPropertyName: "placeholder",
534
+ publicName: "placeholder",
535
+ isSignal: true,
536
+ isRequired: false,
537
+ transformFunction: null
538
+ },
539
+ ariaLabel: {
540
+ classPropertyName: "ariaLabel",
541
+ publicName: "ariaLabel",
542
+ isSignal: true,
543
+ isRequired: false,
544
+ transformFunction: null
545
+ },
546
+ ariaLabelledBy: {
547
+ classPropertyName: "ariaLabelledBy",
548
+ publicName: "ariaLabelledBy",
549
+ isSignal: true,
550
+ isRequired: false,
551
+ transformFunction: null
552
+ },
553
+ ariaDescribedBy: {
554
+ classPropertyName: "ariaDescribedBy",
555
+ publicName: "ariaDescribedBy",
556
+ isSignal: true,
557
+ isRequired: false,
558
+ transformFunction: null
559
+ },
560
+ toolbarAriaLabel: {
561
+ classPropertyName: "toolbarAriaLabel",
562
+ publicName: "toolbarAriaLabel",
563
+ isSignal: true,
564
+ isRequired: false,
565
+ transformFunction: null
566
+ },
567
+ size: {
568
+ classPropertyName: "size",
569
+ publicName: "size",
570
+ isSignal: true,
571
+ isRequired: false,
572
+ transformFunction: null
573
+ },
574
+ appearance: {
575
+ classPropertyName: "appearance",
576
+ publicName: "appearance",
577
+ isSignal: true,
578
+ isRequired: false,
579
+ transformFunction: null
580
+ },
581
+ minHeight: {
582
+ classPropertyName: "minHeight",
583
+ publicName: "minHeight",
584
+ isSignal: true,
585
+ isRequired: false,
586
+ transformFunction: null
587
+ },
588
+ formats: {
589
+ classPropertyName: "formats",
590
+ publicName: "formats",
591
+ isSignal: true,
592
+ isRequired: false,
593
+ transformFunction: null
594
+ },
595
+ namespace: {
596
+ classPropertyName: "namespace",
597
+ publicName: "namespace",
598
+ isSignal: true,
599
+ isRequired: false,
600
+ transformFunction: null
601
+ },
602
+ lexicalTheme: {
603
+ classPropertyName: "lexicalTheme",
604
+ publicName: "lexicalTheme",
605
+ isSignal: true,
606
+ isRequired: false,
607
+ transformFunction: null
608
+ },
609
+ htmlConfig: {
610
+ classPropertyName: "htmlConfig",
611
+ publicName: "htmlConfig",
612
+ isSignal: true,
613
+ isRequired: false,
614
+ transformFunction: null
615
+ },
616
+ extensions: {
617
+ classPropertyName: "extensions",
618
+ publicName: "extensions",
619
+ isSignal: true,
620
+ isRequired: false,
621
+ transformFunction: null
622
+ },
623
+ disabled: {
624
+ classPropertyName: "disabled",
625
+ publicName: "disabled",
626
+ isSignal: true,
627
+ isRequired: false,
628
+ transformFunction: null
629
+ },
630
+ readonly: {
631
+ classPropertyName: "readonly",
632
+ publicName: "readonly",
633
+ isSignal: true,
634
+ isRequired: false,
635
+ transformFunction: null
636
+ },
637
+ required: {
638
+ classPropertyName: "required",
639
+ publicName: "required",
640
+ isSignal: true,
641
+ isRequired: false,
642
+ transformFunction: null
643
+ },
644
+ invalid: {
645
+ classPropertyName: "invalid",
646
+ publicName: "invalid",
647
+ isSignal: true,
648
+ isRequired: false,
649
+ transformFunction: null
650
+ },
651
+ touched: {
652
+ classPropertyName: "touched",
653
+ publicName: "touched",
654
+ isSignal: true,
655
+ isRequired: false,
656
+ transformFunction: null
657
+ },
658
+ fluid: {
659
+ classPropertyName: "fluid",
660
+ publicName: "fluid",
661
+ isSignal: true,
662
+ isRequired: false,
663
+ transformFunction: null
664
+ },
665
+ showToolbar: {
666
+ classPropertyName: "showToolbar",
667
+ publicName: "showToolbar",
668
+ isSignal: true,
669
+ isRequired: false,
670
+ transformFunction: null
671
+ }
672
+ },
673
+ outputs: {
674
+ value: "valueChange",
675
+ changed: "changed",
676
+ focused: "focused",
677
+ blurred: "blurred",
678
+ touch: "touch",
679
+ ready: "ready"
680
+ },
681
+ host: { properties: { "attr.data-fluid": "fluid() || null" } },
682
+ providers: [{
683
+ provide: NG_VALUE_ACCESSOR,
684
+ useExisting: forwardRef(() => AerisEditorComponent),
685
+ multi: true
686
+ }],
687
+ viewQueries: [{
688
+ propertyName: "editorRoot",
689
+ first: true,
690
+ predicate: ["editorRoot"],
691
+ descendants: true,
692
+ isSignal: true
693
+ }],
694
+ ngImport: i0,
695
+ template: `
557
696
  <div
558
697
  class="aeris-editor"
559
698
  [attr.data-size]="size()"
@@ -1040,11 +1179,22 @@ class AerisEditorComponent {
1040
1179
  <input type="hidden" [name]="name()" [value]="value()" />
1041
1180
  }
1042
1181
  </div>
1043
- `, isInline: true, styles: [":host{display:inline-block;color:var(--aeris-text)}:host([data-fluid]){display:block;width:100%}.aeris-editor{--aeris-editor-padding: .875rem;--aeris-editor-font-size: .9375rem;--aeris-editor-line-height: 1.6;display:grid;overflow:hidden;width:min(100%,44rem);border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-md, .875rem);background:var(--aeris-surface);box-shadow:var(--aeris-shadow-xs, 0 1px 2px rgba(15, 23, 42, .05));transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.aeris-editor[data-fluid]{width:100%}.aeris-editor[data-size=sm]{--aeris-editor-padding: .75rem;--aeris-editor-font-size: .875rem}.aeris-editor[data-size=lg]{--aeris-editor-padding: 1rem;--aeris-editor-font-size: 1rem}.aeris-editor[data-appearance=filled]{background:var(--aeris-surface-2)}.aeris-editor:focus-within{border-color:var(--aeris-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--aeris-focus) 18%,transparent)}.aeris-editor[data-invalid]{border-color:var(--aeris-danger)}.aeris-editor[data-disabled]{cursor:not-allowed;opacity:.62}.aeris-editor__toolbar{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;padding:.5rem;border-bottom:1px solid var(--aeris-border);background:color-mix(in srgb,var(--aeris-surface-2) 82%,transparent)}.aeris-editor__toolbar button{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:var(--aeris-radius-sm, .625rem);background:transparent;color:var(--aeris-text);font:inherit;font-size:.8125rem;font-weight:700;cursor:pointer;transition:background .14s ease,color .14s ease,box-shadow .14s ease}.aeris-editor__toolbar button:hover:not(:disabled),.aeris-editor__toolbar button[aria-pressed=true]{background:var(--aeris-primary-soft);color:var(--aeris-text)}.aeris-editor__toolbar button:focus-visible{outline:2px solid var(--aeris-focus);outline-offset:2px}.aeris-editor__toolbar button:disabled{cursor:not-allowed;opacity:.45}.aeris-editor__toolbar svg{width:1rem;height:1rem;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.9}:dir(rtl) .aeris-editor__logical-icon{transform:scaleX(-1)}.aeris-editor__separator{width:1px;height:1.5rem;margin-inline:.125rem;background:var(--aeris-border)}.aeris-editor__underline{text-decoration:underline;text-underline-offset:.14em}.aeris-editor__strikethrough{text-decoration:line-through}.aeris-editor__toolbar sub,.aeris-editor__toolbar sup{font-size:.65em}.aeris-editor__content-shell{position:relative;display:grid}.aeris-editor__content{position:relative;z-index:1;min-width:0;padding:var(--aeris-editor-padding);color:var(--aeris-text);font-size:var(--aeris-editor-font-size);line-height:var(--aeris-editor-line-height);outline:0;overflow-wrap:anywhere}.aeris-editor__content[contenteditable=false]{cursor:default}.aeris-editor__placeholder{position:absolute;inset-block-start:var(--aeris-editor-padding);inset-inline-start:var(--aeris-editor-padding);color:var(--aeris-text-muted);font-size:var(--aeris-editor-font-size);line-height:var(--aeris-editor-line-height);pointer-events:none}.aeris-editor-content__paragraph{margin:0 0 .65rem}.aeris-editor-content__paragraph:last-child{margin-bottom:0}.aeris-editor-content__heading{margin:0 0 .75rem;color:var(--aeris-text);font-size:1.3em;line-height:1.25}.aeris-editor-content__heading--h1{font-size:1.65em}.aeris-editor-content__heading--h2{font-size:1.35em}.aeris-editor-content__heading--h3{font-size:1.15em}.aeris-editor-content__heading--h4{font-size:1.05em}.aeris-editor-content__heading--h5{font-size:.95em}.aeris-editor-content__heading--h6{font-size:.85em;letter-spacing:.02em;text-transform:uppercase}.aeris-editor-content__quote{margin:0 0 .75rem;padding-inline-start:.875rem;border-inline-start:3px solid var(--aeris-primary);color:var(--aeris-text-muted)}.aeris-editor-content__unordered-list,.aeris-editor-content__ordered-list{margin:0 0 .75rem;padding-inline-start:1.35rem}.aeris-editor-content__nested-list-item{list-style-type:none}.aeris-editor-content__check-list{margin:0 0 .75rem;padding-inline-start:0;list-style:none}.aeris-editor-content__list-item--checked,.aeris-editor-content__list-item--unchecked{position:relative;padding-inline-start:1.75rem;list-style:none}.aeris-editor-content__list-item--checked:before,.aeris-editor-content__list-item--unchecked:before{position:absolute;inset-block-start:.26em;inset-inline-start:0;width:1rem;height:1rem;border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-xs, .25rem);background:var(--aeris-surface);content:\"\"}.aeris-editor-content__list-item--checked:before{border-color:var(--aeris-primary);background:var(--aeris-primary)}.aeris-editor-content__list-item--checked:after{position:absolute;inset-block-start:.43em;inset-inline-start:.27rem;width:.45rem;height:.24rem;border-block-end:2px solid var(--aeris-primary-contrast, white);border-inline-start:2px solid var(--aeris-primary-contrast, white);content:\"\";transform:rotate(-45deg)}.aeris-editor-content__list-item--checked{color:var(--aeris-text-muted);text-decoration:line-through}.aeris-editor-content__bold{font-weight:700}.aeris-editor-content__italic{font-style:italic}.aeris-editor-content__underline{text-decoration:underline;text-underline-offset:.14em}.aeris-editor-content__strikethrough{text-decoration:line-through}.aeris-editor-content__code{padding:.12em .32em;border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-xs, .25rem);background:var(--aeris-surface-2);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em}.aeris-editor-content__highlight{border-radius:.18em;background:color-mix(in srgb,var(--aeris-warning, #c38600) 28%,transparent)}.aeris-editor-content__lowercase{text-transform:lowercase}.aeris-editor-content__uppercase{text-transform:uppercase}.aeris-editor-content__capitalize{text-transform:capitalize}.aeris-editor-content__subscript,.aeris-editor-content__superscript{font-size:.75em;line-height:0}.aeris-editor-content__subscript{vertical-align:sub}.aeris-editor-content__superscript{vertical-align:super}@media(prefers-reduced-motion:reduce){.aeris-editor,.aeris-editor__toolbar button{transition:none}}\n"], encapsulation: i0.ViewEncapsulation.None });
1044
- }
1045
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AerisEditorComponent, decorators: [{
1046
- type: Component,
1047
- args: [{ selector: 'aeris-editor', template: `
1182
+ `,
1183
+ isInline: true,
1184
+ styles: [":host{display:inline-block;color:var(--aeris-text)}:host([data-fluid]){display:block;width:100%}.aeris-editor{--aeris-editor-padding: .875rem;--aeris-editor-font-size: .9375rem;--aeris-editor-line-height: 1.6;display:grid;overflow:hidden;width:min(100%,44rem);border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-md, .875rem);background:var(--aeris-surface);box-shadow:var(--aeris-shadow-xs, 0 1px 2px rgba(15, 23, 42, .05));transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.aeris-editor[data-fluid]{width:100%}.aeris-editor[data-size=sm]{--aeris-editor-padding: .75rem;--aeris-editor-font-size: .875rem}.aeris-editor[data-size=lg]{--aeris-editor-padding: 1rem;--aeris-editor-font-size: 1rem}.aeris-editor[data-appearance=filled]{background:var(--aeris-surface-2)}.aeris-editor:focus-within{border-color:var(--aeris-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--aeris-focus) 18%,transparent)}.aeris-editor[data-invalid]{border-color:var(--aeris-danger)}.aeris-editor[data-disabled]{cursor:not-allowed;opacity:.62}.aeris-editor__toolbar{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;padding:.5rem;border-bottom:1px solid var(--aeris-border);background:color-mix(in srgb,var(--aeris-surface-2) 82%,transparent)}.aeris-editor__toolbar button{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:var(--aeris-radius-sm, .625rem);background:transparent;color:var(--aeris-text);font:inherit;font-size:.8125rem;font-weight:700;cursor:pointer;transition:background .14s ease,color .14s ease,box-shadow .14s ease}.aeris-editor__toolbar button:hover:not(:disabled),.aeris-editor__toolbar button[aria-pressed=true]{background:var(--aeris-primary-soft);color:var(--aeris-text)}.aeris-editor__toolbar button:focus-visible{outline:2px solid var(--aeris-focus);outline-offset:2px}.aeris-editor__toolbar button:disabled{cursor:not-allowed;opacity:.45}.aeris-editor__toolbar svg{width:1rem;height:1rem;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.9}:dir(rtl) .aeris-editor__logical-icon{transform:scaleX(-1)}.aeris-editor__separator{width:1px;height:1.5rem;margin-inline:.125rem;background:var(--aeris-border)}.aeris-editor__underline{text-decoration:underline;text-underline-offset:.14em}.aeris-editor__strikethrough{text-decoration:line-through}.aeris-editor__toolbar sub,.aeris-editor__toolbar sup{font-size:.65em}.aeris-editor__content-shell{position:relative;display:grid}.aeris-editor__content{position:relative;z-index:1;min-width:0;padding:var(--aeris-editor-padding);color:var(--aeris-text);font-size:var(--aeris-editor-font-size);line-height:var(--aeris-editor-line-height);outline:0;overflow-wrap:anywhere}.aeris-editor__content[contenteditable=false]{cursor:default}.aeris-editor__placeholder{position:absolute;inset-block-start:var(--aeris-editor-padding);inset-inline-start:var(--aeris-editor-padding);color:var(--aeris-text-muted);font-size:var(--aeris-editor-font-size);line-height:var(--aeris-editor-line-height);pointer-events:none}.aeris-editor-content__paragraph{margin:0 0 .65rem}.aeris-editor-content__paragraph:last-child{margin-bottom:0}.aeris-editor-content__heading{margin:0 0 .75rem;color:var(--aeris-text);font-size:1.3em;line-height:1.25}.aeris-editor-content__heading--h1{font-size:1.65em}.aeris-editor-content__heading--h2{font-size:1.35em}.aeris-editor-content__heading--h3{font-size:1.15em}.aeris-editor-content__heading--h4{font-size:1.05em}.aeris-editor-content__heading--h5{font-size:.95em}.aeris-editor-content__heading--h6{font-size:.85em;letter-spacing:.02em;text-transform:uppercase}.aeris-editor-content__quote{margin:0 0 .75rem;padding-inline-start:.875rem;border-inline-start:3px solid var(--aeris-primary);color:var(--aeris-text-muted)}.aeris-editor-content__unordered-list,.aeris-editor-content__ordered-list{margin:0 0 .75rem;padding-inline-start:1.35rem}.aeris-editor-content__nested-list-item{list-style-type:none}.aeris-editor-content__check-list{margin:0 0 .75rem;padding-inline-start:0;list-style:none}.aeris-editor-content__list-item--checked,.aeris-editor-content__list-item--unchecked{position:relative;padding-inline-start:1.75rem;list-style:none}.aeris-editor-content__list-item--checked:before,.aeris-editor-content__list-item--unchecked:before{position:absolute;inset-block-start:.26em;inset-inline-start:0;width:1rem;height:1rem;border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-xs, .25rem);background:var(--aeris-surface);content:\"\"}.aeris-editor-content__list-item--checked:before{border-color:var(--aeris-primary);background:var(--aeris-primary)}.aeris-editor-content__list-item--checked:after{position:absolute;inset-block-start:.43em;inset-inline-start:.27rem;width:.45rem;height:.24rem;border-block-end:2px solid var(--aeris-primary-contrast, white);border-inline-start:2px solid var(--aeris-primary-contrast, white);content:\"\";transform:rotate(-45deg)}.aeris-editor-content__list-item--checked{color:var(--aeris-text-muted);text-decoration:line-through}.aeris-editor-content__bold{font-weight:700}.aeris-editor-content__italic{font-style:italic}.aeris-editor-content__underline{text-decoration:underline;text-underline-offset:.14em}.aeris-editor-content__strikethrough{text-decoration:line-through}.aeris-editor-content__code{padding:.12em .32em;border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-xs, .25rem);background:var(--aeris-surface-2);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em}.aeris-editor-content__highlight{border-radius:.18em;background:color-mix(in srgb,var(--aeris-warning, #c38600) 28%,transparent)}.aeris-editor-content__lowercase{text-transform:lowercase}.aeris-editor-content__uppercase{text-transform:uppercase}.aeris-editor-content__capitalize{text-transform:capitalize}.aeris-editor-content__subscript,.aeris-editor-content__superscript{font-size:.75em;line-height:0}.aeris-editor-content__subscript{vertical-align:sub}.aeris-editor-content__superscript{vertical-align:super}@media(prefers-reduced-motion:reduce){.aeris-editor,.aeris-editor__toolbar button{transition:none}}\n"],
1185
+ encapsulation: i0.ViewEncapsulation.None
1186
+ });
1187
+ };
1188
+ i0.ɵɵngDeclareClassMetadata({
1189
+ minVersion: "12.0.0",
1190
+ version: "22.2.1",
1191
+ ngImport: i0,
1192
+ type: AerisEditorComponent,
1193
+ decorators: [{
1194
+ type: Component,
1195
+ args: [{
1196
+ selector: "aeris-editor",
1197
+ template: `
1048
1198
  <div
1049
1199
  class="aeris-editor"
1050
1200
  [attr.data-size]="size()"
@@ -1531,21 +1681,233 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
1531
1681
  <input type="hidden" [name]="name()" [value]="value()" />
1532
1682
  }
1533
1683
  </div>
1534
- `, encapsulation: ViewEncapsulation.None, providers: [
1535
- {
1536
- provide: NG_VALUE_ACCESSOR,
1537
- useExisting: forwardRef(() => AerisEditorComponent),
1538
- multi: true,
1539
- },
1540
- ], host: {
1541
- '[attr.data-fluid]': 'fluid() || null',
1542
- }, styles: [":host{display:inline-block;color:var(--aeris-text)}:host([data-fluid]){display:block;width:100%}.aeris-editor{--aeris-editor-padding: .875rem;--aeris-editor-font-size: .9375rem;--aeris-editor-line-height: 1.6;display:grid;overflow:hidden;width:min(100%,44rem);border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-md, .875rem);background:var(--aeris-surface);box-shadow:var(--aeris-shadow-xs, 0 1px 2px rgba(15, 23, 42, .05));transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.aeris-editor[data-fluid]{width:100%}.aeris-editor[data-size=sm]{--aeris-editor-padding: .75rem;--aeris-editor-font-size: .875rem}.aeris-editor[data-size=lg]{--aeris-editor-padding: 1rem;--aeris-editor-font-size: 1rem}.aeris-editor[data-appearance=filled]{background:var(--aeris-surface-2)}.aeris-editor:focus-within{border-color:var(--aeris-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--aeris-focus) 18%,transparent)}.aeris-editor[data-invalid]{border-color:var(--aeris-danger)}.aeris-editor[data-disabled]{cursor:not-allowed;opacity:.62}.aeris-editor__toolbar{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;padding:.5rem;border-bottom:1px solid var(--aeris-border);background:color-mix(in srgb,var(--aeris-surface-2) 82%,transparent)}.aeris-editor__toolbar button{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:var(--aeris-radius-sm, .625rem);background:transparent;color:var(--aeris-text);font:inherit;font-size:.8125rem;font-weight:700;cursor:pointer;transition:background .14s ease,color .14s ease,box-shadow .14s ease}.aeris-editor__toolbar button:hover:not(:disabled),.aeris-editor__toolbar button[aria-pressed=true]{background:var(--aeris-primary-soft);color:var(--aeris-text)}.aeris-editor__toolbar button:focus-visible{outline:2px solid var(--aeris-focus);outline-offset:2px}.aeris-editor__toolbar button:disabled{cursor:not-allowed;opacity:.45}.aeris-editor__toolbar svg{width:1rem;height:1rem;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.9}:dir(rtl) .aeris-editor__logical-icon{transform:scaleX(-1)}.aeris-editor__separator{width:1px;height:1.5rem;margin-inline:.125rem;background:var(--aeris-border)}.aeris-editor__underline{text-decoration:underline;text-underline-offset:.14em}.aeris-editor__strikethrough{text-decoration:line-through}.aeris-editor__toolbar sub,.aeris-editor__toolbar sup{font-size:.65em}.aeris-editor__content-shell{position:relative;display:grid}.aeris-editor__content{position:relative;z-index:1;min-width:0;padding:var(--aeris-editor-padding);color:var(--aeris-text);font-size:var(--aeris-editor-font-size);line-height:var(--aeris-editor-line-height);outline:0;overflow-wrap:anywhere}.aeris-editor__content[contenteditable=false]{cursor:default}.aeris-editor__placeholder{position:absolute;inset-block-start:var(--aeris-editor-padding);inset-inline-start:var(--aeris-editor-padding);color:var(--aeris-text-muted);font-size:var(--aeris-editor-font-size);line-height:var(--aeris-editor-line-height);pointer-events:none}.aeris-editor-content__paragraph{margin:0 0 .65rem}.aeris-editor-content__paragraph:last-child{margin-bottom:0}.aeris-editor-content__heading{margin:0 0 .75rem;color:var(--aeris-text);font-size:1.3em;line-height:1.25}.aeris-editor-content__heading--h1{font-size:1.65em}.aeris-editor-content__heading--h2{font-size:1.35em}.aeris-editor-content__heading--h3{font-size:1.15em}.aeris-editor-content__heading--h4{font-size:1.05em}.aeris-editor-content__heading--h5{font-size:.95em}.aeris-editor-content__heading--h6{font-size:.85em;letter-spacing:.02em;text-transform:uppercase}.aeris-editor-content__quote{margin:0 0 .75rem;padding-inline-start:.875rem;border-inline-start:3px solid var(--aeris-primary);color:var(--aeris-text-muted)}.aeris-editor-content__unordered-list,.aeris-editor-content__ordered-list{margin:0 0 .75rem;padding-inline-start:1.35rem}.aeris-editor-content__nested-list-item{list-style-type:none}.aeris-editor-content__check-list{margin:0 0 .75rem;padding-inline-start:0;list-style:none}.aeris-editor-content__list-item--checked,.aeris-editor-content__list-item--unchecked{position:relative;padding-inline-start:1.75rem;list-style:none}.aeris-editor-content__list-item--checked:before,.aeris-editor-content__list-item--unchecked:before{position:absolute;inset-block-start:.26em;inset-inline-start:0;width:1rem;height:1rem;border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-xs, .25rem);background:var(--aeris-surface);content:\"\"}.aeris-editor-content__list-item--checked:before{border-color:var(--aeris-primary);background:var(--aeris-primary)}.aeris-editor-content__list-item--checked:after{position:absolute;inset-block-start:.43em;inset-inline-start:.27rem;width:.45rem;height:.24rem;border-block-end:2px solid var(--aeris-primary-contrast, white);border-inline-start:2px solid var(--aeris-primary-contrast, white);content:\"\";transform:rotate(-45deg)}.aeris-editor-content__list-item--checked{color:var(--aeris-text-muted);text-decoration:line-through}.aeris-editor-content__bold{font-weight:700}.aeris-editor-content__italic{font-style:italic}.aeris-editor-content__underline{text-decoration:underline;text-underline-offset:.14em}.aeris-editor-content__strikethrough{text-decoration:line-through}.aeris-editor-content__code{padding:.12em .32em;border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-xs, .25rem);background:var(--aeris-surface-2);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em}.aeris-editor-content__highlight{border-radius:.18em;background:color-mix(in srgb,var(--aeris-warning, #c38600) 28%,transparent)}.aeris-editor-content__lowercase{text-transform:lowercase}.aeris-editor-content__uppercase{text-transform:uppercase}.aeris-editor-content__capitalize{text-transform:capitalize}.aeris-editor-content__subscript,.aeris-editor-content__superscript{font-size:.75em;line-height:0}.aeris-editor-content__subscript{vertical-align:sub}.aeris-editor-content__superscript{vertical-align:super}@media(prefers-reduced-motion:reduce){.aeris-editor,.aeris-editor__toolbar button{transition:none}}\n"] }]
1543
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], toolbarAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbarAriaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], formats: [{ type: i0.Input, args: [{ isSignal: true, alias: "formats", required: false }] }], namespace: [{ type: i0.Input, args: [{ isSignal: true, alias: "namespace", required: false }] }], lexicalTheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "lexicalTheme", required: false }] }], htmlConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "htmlConfig", required: false }] }], extensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "extensions", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }], focused: [{ type: i0.Output, args: ["focused"] }], blurred: [{ type: i0.Output, args: ["blurred"] }], touch: [{ type: i0.Output, args: ["touch"] }], ready: [{ type: i0.Output, args: ["ready"] }], editorRoot: [{ type: i0.ViewChild, args: ['editorRoot', { isSignal: true }] }] } });
1684
+ `,
1685
+ encapsulation: ViewEncapsulation.None,
1686
+ providers: [{
1687
+ provide: NG_VALUE_ACCESSOR,
1688
+ useExisting: forwardRef(() => AerisEditorComponent),
1689
+ multi: true
1690
+ }],
1691
+ host: { "[attr.data-fluid]": "fluid() || null" },
1692
+ styles: [":host{display:inline-block;color:var(--aeris-text)}:host([data-fluid]){display:block;width:100%}.aeris-editor{--aeris-editor-padding: .875rem;--aeris-editor-font-size: .9375rem;--aeris-editor-line-height: 1.6;display:grid;overflow:hidden;width:min(100%,44rem);border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-md, .875rem);background:var(--aeris-surface);box-shadow:var(--aeris-shadow-xs, 0 1px 2px rgba(15, 23, 42, .05));transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.aeris-editor[data-fluid]{width:100%}.aeris-editor[data-size=sm]{--aeris-editor-padding: .75rem;--aeris-editor-font-size: .875rem}.aeris-editor[data-size=lg]{--aeris-editor-padding: 1rem;--aeris-editor-font-size: 1rem}.aeris-editor[data-appearance=filled]{background:var(--aeris-surface-2)}.aeris-editor:focus-within{border-color:var(--aeris-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--aeris-focus) 18%,transparent)}.aeris-editor[data-invalid]{border-color:var(--aeris-danger)}.aeris-editor[data-disabled]{cursor:not-allowed;opacity:.62}.aeris-editor__toolbar{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;padding:.5rem;border-bottom:1px solid var(--aeris-border);background:color-mix(in srgb,var(--aeris-surface-2) 82%,transparent)}.aeris-editor__toolbar button{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:var(--aeris-radius-sm, .625rem);background:transparent;color:var(--aeris-text);font:inherit;font-size:.8125rem;font-weight:700;cursor:pointer;transition:background .14s ease,color .14s ease,box-shadow .14s ease}.aeris-editor__toolbar button:hover:not(:disabled),.aeris-editor__toolbar button[aria-pressed=true]{background:var(--aeris-primary-soft);color:var(--aeris-text)}.aeris-editor__toolbar button:focus-visible{outline:2px solid var(--aeris-focus);outline-offset:2px}.aeris-editor__toolbar button:disabled{cursor:not-allowed;opacity:.45}.aeris-editor__toolbar svg{width:1rem;height:1rem;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.9}:dir(rtl) .aeris-editor__logical-icon{transform:scaleX(-1)}.aeris-editor__separator{width:1px;height:1.5rem;margin-inline:.125rem;background:var(--aeris-border)}.aeris-editor__underline{text-decoration:underline;text-underline-offset:.14em}.aeris-editor__strikethrough{text-decoration:line-through}.aeris-editor__toolbar sub,.aeris-editor__toolbar sup{font-size:.65em}.aeris-editor__content-shell{position:relative;display:grid}.aeris-editor__content{position:relative;z-index:1;min-width:0;padding:var(--aeris-editor-padding);color:var(--aeris-text);font-size:var(--aeris-editor-font-size);line-height:var(--aeris-editor-line-height);outline:0;overflow-wrap:anywhere}.aeris-editor__content[contenteditable=false]{cursor:default}.aeris-editor__placeholder{position:absolute;inset-block-start:var(--aeris-editor-padding);inset-inline-start:var(--aeris-editor-padding);color:var(--aeris-text-muted);font-size:var(--aeris-editor-font-size);line-height:var(--aeris-editor-line-height);pointer-events:none}.aeris-editor-content__paragraph{margin:0 0 .65rem}.aeris-editor-content__paragraph:last-child{margin-bottom:0}.aeris-editor-content__heading{margin:0 0 .75rem;color:var(--aeris-text);font-size:1.3em;line-height:1.25}.aeris-editor-content__heading--h1{font-size:1.65em}.aeris-editor-content__heading--h2{font-size:1.35em}.aeris-editor-content__heading--h3{font-size:1.15em}.aeris-editor-content__heading--h4{font-size:1.05em}.aeris-editor-content__heading--h5{font-size:.95em}.aeris-editor-content__heading--h6{font-size:.85em;letter-spacing:.02em;text-transform:uppercase}.aeris-editor-content__quote{margin:0 0 .75rem;padding-inline-start:.875rem;border-inline-start:3px solid var(--aeris-primary);color:var(--aeris-text-muted)}.aeris-editor-content__unordered-list,.aeris-editor-content__ordered-list{margin:0 0 .75rem;padding-inline-start:1.35rem}.aeris-editor-content__nested-list-item{list-style-type:none}.aeris-editor-content__check-list{margin:0 0 .75rem;padding-inline-start:0;list-style:none}.aeris-editor-content__list-item--checked,.aeris-editor-content__list-item--unchecked{position:relative;padding-inline-start:1.75rem;list-style:none}.aeris-editor-content__list-item--checked:before,.aeris-editor-content__list-item--unchecked:before{position:absolute;inset-block-start:.26em;inset-inline-start:0;width:1rem;height:1rem;border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-xs, .25rem);background:var(--aeris-surface);content:\"\"}.aeris-editor-content__list-item--checked:before{border-color:var(--aeris-primary);background:var(--aeris-primary)}.aeris-editor-content__list-item--checked:after{position:absolute;inset-block-start:.43em;inset-inline-start:.27rem;width:.45rem;height:.24rem;border-block-end:2px solid var(--aeris-primary-contrast, white);border-inline-start:2px solid var(--aeris-primary-contrast, white);content:\"\";transform:rotate(-45deg)}.aeris-editor-content__list-item--checked{color:var(--aeris-text-muted);text-decoration:line-through}.aeris-editor-content__bold{font-weight:700}.aeris-editor-content__italic{font-style:italic}.aeris-editor-content__underline{text-decoration:underline;text-underline-offset:.14em}.aeris-editor-content__strikethrough{text-decoration:line-through}.aeris-editor-content__code{padding:.12em .32em;border:1px solid var(--aeris-border);border-radius:var(--aeris-radius-xs, .25rem);background:var(--aeris-surface-2);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em}.aeris-editor-content__highlight{border-radius:.18em;background:color-mix(in srgb,var(--aeris-warning, #c38600) 28%,transparent)}.aeris-editor-content__lowercase{text-transform:lowercase}.aeris-editor-content__uppercase{text-transform:uppercase}.aeris-editor-content__capitalize{text-transform:capitalize}.aeris-editor-content__subscript,.aeris-editor-content__superscript{font-size:.75em;line-height:0}.aeris-editor-content__subscript{vertical-align:sub}.aeris-editor-content__superscript{vertical-align:super}@media(prefers-reduced-motion:reduce){.aeris-editor,.aeris-editor__toolbar button{transition:none}}\n"]
1693
+ }]
1694
+ }],
1695
+ ctorParameters: () => [],
1696
+ propDecorators: {
1697
+ value: [{
1698
+ type: i0.Input,
1699
+ args: [{
1700
+ isSignal: true,
1701
+ alias: "value",
1702
+ required: false
1703
+ }]
1704
+ }, {
1705
+ type: i0.Output,
1706
+ args: ["valueChange"]
1707
+ }],
1708
+ inputId: [{
1709
+ type: i0.Input,
1710
+ args: [{
1711
+ isSignal: true,
1712
+ alias: "inputId",
1713
+ required: false
1714
+ }]
1715
+ }],
1716
+ name: [{
1717
+ type: i0.Input,
1718
+ args: [{
1719
+ isSignal: true,
1720
+ alias: "name",
1721
+ required: false
1722
+ }]
1723
+ }],
1724
+ placeholder: [{
1725
+ type: i0.Input,
1726
+ args: [{
1727
+ isSignal: true,
1728
+ alias: "placeholder",
1729
+ required: false
1730
+ }]
1731
+ }],
1732
+ ariaLabel: [{
1733
+ type: i0.Input,
1734
+ args: [{
1735
+ isSignal: true,
1736
+ alias: "ariaLabel",
1737
+ required: false
1738
+ }]
1739
+ }],
1740
+ ariaLabelledBy: [{
1741
+ type: i0.Input,
1742
+ args: [{
1743
+ isSignal: true,
1744
+ alias: "ariaLabelledBy",
1745
+ required: false
1746
+ }]
1747
+ }],
1748
+ ariaDescribedBy: [{
1749
+ type: i0.Input,
1750
+ args: [{
1751
+ isSignal: true,
1752
+ alias: "ariaDescribedBy",
1753
+ required: false
1754
+ }]
1755
+ }],
1756
+ toolbarAriaLabel: [{
1757
+ type: i0.Input,
1758
+ args: [{
1759
+ isSignal: true,
1760
+ alias: "toolbarAriaLabel",
1761
+ required: false
1762
+ }]
1763
+ }],
1764
+ size: [{
1765
+ type: i0.Input,
1766
+ args: [{
1767
+ isSignal: true,
1768
+ alias: "size",
1769
+ required: false
1770
+ }]
1771
+ }],
1772
+ appearance: [{
1773
+ type: i0.Input,
1774
+ args: [{
1775
+ isSignal: true,
1776
+ alias: "appearance",
1777
+ required: false
1778
+ }]
1779
+ }],
1780
+ minHeight: [{
1781
+ type: i0.Input,
1782
+ args: [{
1783
+ isSignal: true,
1784
+ alias: "minHeight",
1785
+ required: false
1786
+ }]
1787
+ }],
1788
+ formats: [{
1789
+ type: i0.Input,
1790
+ args: [{
1791
+ isSignal: true,
1792
+ alias: "formats",
1793
+ required: false
1794
+ }]
1795
+ }],
1796
+ namespace: [{
1797
+ type: i0.Input,
1798
+ args: [{
1799
+ isSignal: true,
1800
+ alias: "namespace",
1801
+ required: false
1802
+ }]
1803
+ }],
1804
+ lexicalTheme: [{
1805
+ type: i0.Input,
1806
+ args: [{
1807
+ isSignal: true,
1808
+ alias: "lexicalTheme",
1809
+ required: false
1810
+ }]
1811
+ }],
1812
+ htmlConfig: [{
1813
+ type: i0.Input,
1814
+ args: [{
1815
+ isSignal: true,
1816
+ alias: "htmlConfig",
1817
+ required: false
1818
+ }]
1819
+ }],
1820
+ extensions: [{
1821
+ type: i0.Input,
1822
+ args: [{
1823
+ isSignal: true,
1824
+ alias: "extensions",
1825
+ required: false
1826
+ }]
1827
+ }],
1828
+ disabled: [{
1829
+ type: i0.Input,
1830
+ args: [{
1831
+ isSignal: true,
1832
+ alias: "disabled",
1833
+ required: false
1834
+ }]
1835
+ }],
1836
+ readonly: [{
1837
+ type: i0.Input,
1838
+ args: [{
1839
+ isSignal: true,
1840
+ alias: "readonly",
1841
+ required: false
1842
+ }]
1843
+ }],
1844
+ required: [{
1845
+ type: i0.Input,
1846
+ args: [{
1847
+ isSignal: true,
1848
+ alias: "required",
1849
+ required: false
1850
+ }]
1851
+ }],
1852
+ invalid: [{
1853
+ type: i0.Input,
1854
+ args: [{
1855
+ isSignal: true,
1856
+ alias: "invalid",
1857
+ required: false
1858
+ }]
1859
+ }],
1860
+ touched: [{
1861
+ type: i0.Input,
1862
+ args: [{
1863
+ isSignal: true,
1864
+ alias: "touched",
1865
+ required: false
1866
+ }]
1867
+ }],
1868
+ fluid: [{
1869
+ type: i0.Input,
1870
+ args: [{
1871
+ isSignal: true,
1872
+ alias: "fluid",
1873
+ required: false
1874
+ }]
1875
+ }],
1876
+ showToolbar: [{
1877
+ type: i0.Input,
1878
+ args: [{
1879
+ isSignal: true,
1880
+ alias: "showToolbar",
1881
+ required: false
1882
+ }]
1883
+ }],
1884
+ changed: [{
1885
+ type: i0.Output,
1886
+ args: ["changed"]
1887
+ }],
1888
+ focused: [{
1889
+ type: i0.Output,
1890
+ args: ["focused"]
1891
+ }],
1892
+ blurred: [{
1893
+ type: i0.Output,
1894
+ args: ["blurred"]
1895
+ }],
1896
+ touch: [{
1897
+ type: i0.Output,
1898
+ args: ["touch"]
1899
+ }],
1900
+ ready: [{
1901
+ type: i0.Output,
1902
+ args: ["ready"]
1903
+ }],
1904
+ editorRoot: [{
1905
+ type: i0.ViewChild,
1906
+ args: ["editorRoot", { isSignal: true }]
1907
+ }]
1908
+ }
1909
+ });
1544
1910
  const AerisEditor = [AerisEditorComponent];
1545
-
1546
- /**
1547
- * Generated bundle index. Do not edit.
1548
- */
1549
-
1550
1911
  export { AERIS_EDITOR_ALL_FORMATS, AERIS_EDITOR_DEFAULT_FORMATS, AerisEditor, AerisEditorComponent };
1551
- //# sourceMappingURL=aeris-ui-core-editor.mjs.map
1912
+
1913
+ //# sourceMappingURL=aeris-ui-core-editor.mjs.map