@aeris-ui/core 22.0.0-alpha.1 → 22.0.0-alpha.10

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 (288) hide show
  1. package/README.md +200 -191
  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 +1228 -446
  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 +209 -101
  15. package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -1
  16. package/fesm2022/aeris-ui-core-breadcrumb.mjs +581 -189
  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 +741 -139
  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 +773 -369
  25. package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
  26. package/fesm2022/aeris-ui-core-cascade-select.mjs +1171 -521
  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 +440 -140
  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-code-block.mjs +637 -0
  37. package/fesm2022/aeris-ui-core-code-block.mjs.map +1 -0
  38. package/fesm2022/aeris-ui-core-color-picker.mjs +1340 -700
  39. package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
  40. package/fesm2022/aeris-ui-core-compare.mjs +823 -318
  41. package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
  42. package/fesm2022/aeris-ui-core-confirm-dialog.mjs +1404 -555
  43. package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
  44. package/fesm2022/aeris-ui-core-confirm-popup.mjs +1471 -740
  45. package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
  46. package/fesm2022/aeris-ui-core-context-menu.mjs +918 -443
  47. package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
  48. package/fesm2022/aeris-ui-core-date-picker.mjs +1942 -1123
  49. package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
  50. package/fesm2022/aeris-ui-core-dialog.mjs +1079 -346
  51. package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
  52. package/fesm2022/aeris-ui-core-divider.mjs +204 -43
  53. package/fesm2022/aeris-ui-core-divider.mjs.map +1 -1
  54. package/fesm2022/aeris-ui-core-drawer.mjs +1015 -322
  55. package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
  56. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +410 -254
  57. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
  58. package/fesm2022/aeris-ui-core-editor.mjs +967 -587
  59. package/fesm2022/aeris-ui-core-editor.mjs.map +1 -1
  60. package/fesm2022/aeris-ui-core-file-upload.mjs +1379 -522
  61. package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
  62. package/fesm2022/aeris-ui-core-filter-service.mjs +258 -301
  63. package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -1
  64. package/fesm2022/aeris-ui-core-fluid.mjs +68 -21
  65. package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -1
  66. package/fesm2022/aeris-ui-core-focus-trap.mjs +206 -182
  67. package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -1
  68. package/fesm2022/aeris-ui-core-form-field.mjs +688 -0
  69. package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -0
  70. package/fesm2022/aeris-ui-core-galleria.mjs +2446 -1117
  71. package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
  72. package/fesm2022/aeris-ui-core-glass.mjs +110 -33
  73. package/fesm2022/aeris-ui-core-glass.mjs.map +1 -1
  74. package/fesm2022/aeris-ui-core-icon-field.mjs +426 -98
  75. package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -1
  76. package/fesm2022/aeris-ui-core-inplace.mjs +452 -130
  77. package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -1
  78. package/fesm2022/aeris-ui-core-input-group.mjs +413 -107
  79. package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
  80. package/fesm2022/aeris-ui-core-input-mask.mjs +658 -255
  81. package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
  82. package/fesm2022/aeris-ui-core-input-number.mjs +926 -291
  83. package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
  84. package/fesm2022/aeris-ui-core-input-otp.mjs +678 -264
  85. package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -1
  86. package/fesm2022/aeris-ui-core-input-text.mjs +625 -158
  87. package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
  88. package/fesm2022/aeris-ui-core-key-filter.mjs +263 -201
  89. package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -1
  90. package/fesm2022/aeris-ui-core-mega-menu.mjs +613 -382
  91. package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
  92. package/fesm2022/aeris-ui-core-menu.mjs +1062 -472
  93. package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
  94. package/fesm2022/aeris-ui-core-menubar.mjs +994 -393
  95. package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
  96. package/fesm2022/aeris-ui-core-message.mjs +477 -145
  97. package/fesm2022/aeris-ui-core-message.mjs.map +1 -1
  98. package/fesm2022/aeris-ui-core-meter-group.mjs +623 -230
  99. package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -1
  100. package/fesm2022/aeris-ui-core-multi-select.mjs +1598 -561
  101. package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
  102. package/fesm2022/aeris-ui-core-order-list.mjs +592 -220
  103. package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
  104. package/fesm2022/aeris-ui-core-organization-chart.mjs +485 -199
  105. package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
  106. package/fesm2022/aeris-ui-core-paginator.mjs +428 -123
  107. package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
  108. package/fesm2022/aeris-ui-core-panel.mjs +596 -196
  109. package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
  110. package/fesm2022/aeris-ui-core-password.mjs +925 -249
  111. package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
  112. package/fesm2022/aeris-ui-core-pick-list.mjs +1280 -659
  113. package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
  114. package/fesm2022/aeris-ui-core-popover.mjs +912 -375
  115. package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
  116. package/fesm2022/aeris-ui-core-progress-bar.mjs +549 -176
  117. package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -1
  118. package/fesm2022/aeris-ui-core-progress-spinner.mjs +410 -133
  119. package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -1
  120. package/fesm2022/aeris-ui-core-radio-button.mjs +394 -124
  121. package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -1
  122. package/fesm2022/aeris-ui-core-rating.mjs +506 -231
  123. package/fesm2022/aeris-ui-core-rating.mjs.map +1 -1
  124. package/fesm2022/aeris-ui-core-scroll-panel.mjs +457 -154
  125. package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -1
  126. package/fesm2022/aeris-ui-core-scroll-top.mjs +226 -63
  127. package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -1
  128. package/fesm2022/aeris-ui-core-select.mjs +1845 -648
  129. package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
  130. package/fesm2022/aeris-ui-core-skeleton.mjs +149 -45
  131. package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -1
  132. package/fesm2022/aeris-ui-core-slider.mjs +884 -430
  133. package/fesm2022/aeris-ui-core-slider.mjs.map +1 -1
  134. package/fesm2022/aeris-ui-core-speed-dial.mjs +861 -337
  135. package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -1
  136. package/fesm2022/aeris-ui-core-split-button.mjs +955 -266
  137. package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
  138. package/fesm2022/aeris-ui-core-splitter.mjs +812 -352
  139. package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
  140. package/fesm2022/aeris-ui-core-stepper.mjs +697 -254
  141. package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
  142. package/fesm2022/aeris-ui-core-style-class.mjs +587 -342
  143. package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -1
  144. package/fesm2022/aeris-ui-core-table.mjs +2034 -869
  145. package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
  146. package/fesm2022/aeris-ui-core-tabs.mjs +789 -279
  147. package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
  148. package/fesm2022/aeris-ui-core-textarea.mjs +856 -219
  149. package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
  150. package/fesm2022/aeris-ui-core-theme-builder.mjs +1284 -1399
  151. package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
  152. package/fesm2022/aeris-ui-core-theming.mjs +132 -144
  153. package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
  154. package/fesm2022/aeris-ui-core-tiered-menu.mjs +909 -441
  155. package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
  156. package/fesm2022/aeris-ui-core-timeline.mjs +407 -131
  157. package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
  158. package/fesm2022/aeris-ui-core-toast.mjs +1076 -384
  159. package/fesm2022/aeris-ui-core-toast.mjs.map +1 -1
  160. package/fesm2022/aeris-ui-core-toggle-switch.mjs +398 -132
  161. package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -1
  162. package/fesm2022/aeris-ui-core-toolbar.mjs +458 -121
  163. package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
  164. package/fesm2022/aeris-ui-core-tooltip.mjs +625 -330
  165. package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
  166. package/fesm2022/aeris-ui-core-tree-select.mjs +1453 -621
  167. package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
  168. package/fesm2022/aeris-ui-core-tree-table.mjs +2019 -940
  169. package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
  170. package/fesm2022/aeris-ui-core-tree.mjs +1107 -658
  171. package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
  172. package/fesm2022/aeris-ui-core.mjs +985 -316
  173. package/fesm2022/aeris-ui-core.mjs.map +1 -1
  174. package/package.json +20 -8
  175. package/schematics/ng-add/schema.json +1 -1
  176. package/schematics/runtime/schematics/ng-add/options.js +4 -4
  177. package/schematics/runtime/schematics/ng-add/options.js.map +1 -1
  178. package/schematics/runtime/schematics/ng-add/workspace.js +1 -1
  179. package/schematics/runtime/schematics/ng-add/workspace.js.map +1 -1
  180. package/schematics/runtime/theme-builder/aeris-contrast.js +6 -17
  181. package/schematics/runtime/theme-builder/aeris-contrast.js.map +1 -1
  182. package/schematics/runtime/theme-builder/aeris-foundation.js +10 -4
  183. package/schematics/runtime/theme-builder/aeris-foundation.js.map +1 -1
  184. package/schematics/runtime/theme-builder/aeris-semantic-tones.js +28 -5
  185. package/schematics/runtime/theme-builder/aeris-semantic-tones.js.map +1 -1
  186. package/schematics/runtime/theme-builder/aeris-theme-generator.js +2 -2
  187. package/schematics/runtime/theme-builder/aeris-theme-generator.js.map +1 -1
  188. package/schematics/runtime/theme-builder/aeris-theme-resolver.js +22 -8
  189. package/schematics/runtime/theme-builder/aeris-theme-resolver.js.map +1 -1
  190. package/schematics/runtime/theme-builder/aeris-theme-tokens.js +12 -4
  191. package/schematics/runtime/theme-builder/aeris-theme-tokens.js.map +1 -1
  192. package/schematics/runtime/theme-builder/aeris-theme-validation.js +7 -1
  193. package/schematics/runtime/theme-builder/aeris-theme-validation.js.map +1 -1
  194. package/schematics/runtime/theme-builder/aeris-theme.js +49 -33
  195. package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -1
  196. package/styles/_fallback-colors.scss +10 -0
  197. package/styles/_mobile.scss +16 -0
  198. package/styles/_tokens.scss +5 -5
  199. package/styles/aeris.css +412 -125
  200. package/styles/controls.css +61 -29
  201. package/tools/aeris-theme.mjs +2 -2
  202. package/tools/aeris-theme.schema.json +5 -2
  203. package/types/aeris-ui-core-accordion.d.ts +167 -93
  204. package/types/aeris-ui-core-animate-on-scroll.d.ts +72 -31
  205. package/types/aeris-ui-core-auto-complete.d.ts +327 -140
  206. package/types/aeris-ui-core-auto-focus.d.ts +24 -16
  207. package/types/aeris-ui-core-avatar.d.ts +112 -42
  208. package/types/aeris-ui-core-badge.d.ts +160 -46
  209. package/types/aeris-ui-core-block-ui.d.ts +47 -27
  210. package/types/aeris-ui-core-breadcrumb.d.ts +163 -92
  211. package/types/aeris-ui-core-button-group.d.ts +37 -16
  212. package/types/aeris-ui-core-button.d.ts +226 -67
  213. package/types/aeris-ui-core-card.d.ts +74 -37
  214. package/types/aeris-ui-core-carousel.d.ts +201 -117
  215. package/types/aeris-ui-core-cascade-select.d.ts +257 -123
  216. package/types/aeris-ui-core-chart.d.ts +134 -84
  217. package/types/aeris-ui-core-checkbox.d.ts +139 -54
  218. package/types/aeris-ui-core-chip.d.ts +116 -51
  219. package/types/aeris-ui-core-class-names.d.ts +22 -20
  220. package/types/aeris-ui-core-code-block.d.ts +188 -0
  221. package/types/aeris-ui-core-color-picker.d.ts +348 -143
  222. package/types/aeris-ui-core-compare.d.ts +224 -102
  223. package/types/aeris-ui-core-confirm-dialog.d.ts +442 -245
  224. package/types/aeris-ui-core-confirm-popup.d.ts +442 -263
  225. package/types/aeris-ui-core-context-menu.d.ts +264 -146
  226. package/types/aeris-ui-core-date-picker.d.ts +489 -217
  227. package/types/aeris-ui-core-dialog.d.ts +288 -117
  228. package/types/aeris-ui-core-divider.d.ts +58 -20
  229. package/types/aeris-ui-core-drawer.d.ts +273 -112
  230. package/types/aeris-ui-core-dynamic-dialog.d.ts +158 -137
  231. package/types/aeris-ui-core-editor.d.ts +250 -123
  232. package/types/aeris-ui-core-file-upload.d.ts +367 -197
  233. package/types/aeris-ui-core-filter-service.d.ts +48 -52
  234. package/types/aeris-ui-core-fluid.d.ts +12 -9
  235. package/types/aeris-ui-core-focus-trap.d.ts +39 -31
  236. package/types/aeris-ui-core-form-field.d.ts +163 -0
  237. package/types/aeris-ui-core-galleria.d.ts +588 -256
  238. package/types/aeris-ui-core-glass.d.ts +24 -11
  239. package/types/aeris-ui-core-icon-field.d.ts +94 -32
  240. package/types/aeris-ui-core-inplace.d.ts +123 -62
  241. package/types/aeris-ui-core-input-group.d.ts +84 -33
  242. package/types/aeris-ui-core-input-mask.d.ts +194 -69
  243. package/types/aeris-ui-core-input-number.d.ts +272 -87
  244. package/types/aeris-ui-core-input-otp.d.ts +191 -81
  245. package/types/aeris-ui-core-input-text.d.ts +185 -60
  246. package/types/aeris-ui-core-key-filter.d.ts +53 -39
  247. package/types/aeris-ui-core-mega-menu.d.ts +175 -121
  248. package/types/aeris-ui-core-menu.d.ts +277 -168
  249. package/types/aeris-ui-core-menubar.d.ts +273 -135
  250. package/types/aeris-ui-core-message.d.ts +132 -60
  251. package/types/aeris-ui-core-meter-group.d.ts +163 -90
  252. package/types/aeris-ui-core-multi-select.d.ts +439 -180
  253. package/types/aeris-ui-core-order-list.d.ts +144 -66
  254. package/types/aeris-ui-core-organization-chart.d.ts +133 -77
  255. package/types/aeris-ui-core-paginator.d.ts +93 -38
  256. package/types/aeris-ui-core-panel.d.ts +149 -78
  257. package/types/aeris-ui-core-password.d.ts +258 -102
  258. package/types/aeris-ui-core-pick-list.d.ts +374 -179
  259. package/types/aeris-ui-core-popover.d.ts +219 -105
  260. package/types/aeris-ui-core-progress-bar.d.ts +157 -73
  261. package/types/aeris-ui-core-progress-spinner.d.ts +110 -48
  262. package/types/aeris-ui-core-radio-button.d.ts +124 -50
  263. package/types/aeris-ui-core-rating.d.ts +149 -76
  264. package/types/aeris-ui-core-scroll-panel.d.ts +142 -64
  265. package/types/aeris-ui-core-scroll-top.d.ts +66 -29
  266. package/types/aeris-ui-core-select.d.ts +475 -217
  267. package/types/aeris-ui-core-skeleton.d.ts +39 -17
  268. package/types/aeris-ui-core-slider.d.ts +270 -115
  269. package/types/aeris-ui-core-speed-dial.d.ts +241 -111
  270. package/types/aeris-ui-core-split-button.d.ts +267 -113
  271. package/types/aeris-ui-core-splitter.d.ts +225 -106
  272. package/types/aeris-ui-core-stepper.d.ts +184 -91
  273. package/types/aeris-ui-core-style-class.d.ts +141 -71
  274. package/types/aeris-ui-core-table.d.ts +596 -304
  275. package/types/aeris-ui-core-tabs.d.ts +181 -76
  276. package/types/aeris-ui-core-textarea.d.ts +261 -78
  277. package/types/aeris-ui-core-theme-builder.d.ts +472 -450
  278. package/types/aeris-ui-core-theming.d.ts +42 -45
  279. package/types/aeris-ui-core-tiered-menu.d.ts +251 -142
  280. package/types/aeris-ui-core-timeline.d.ts +109 -71
  281. package/types/aeris-ui-core-toast.d.ts +225 -115
  282. package/types/aeris-ui-core-toggle-switch.d.ts +125 -51
  283. package/types/aeris-ui-core-toolbar.d.ts +98 -41
  284. package/types/aeris-ui-core-tooltip.d.ts +157 -88
  285. package/types/aeris-ui-core-tree-select.d.ts +364 -171
  286. package/types/aeris-ui-core-tree-table.d.ts +566 -286
  287. package/types/aeris-ui-core-tree.d.ts +270 -165
  288. package/types/aeris-ui-core.d.ts +197 -72
@@ -1,561 +1,718 @@
1
- import { DOCUMENT } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, model, input, booleanAttribute, output, viewChild, signal, computed, effect, SecurityContext, forwardRef, ViewEncapsulation, Component } from '@angular/core';
4
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { DomSanitizer } from '@angular/platform-browser';
6
- 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';
7
- import { $createHeadingNode, $createQuoteNode, HeadingNode, QuoteNode, registerRichText } from '@lexical/rich-text';
8
- import { $generateHtmlFromNodes, $generateNodesFromDOM } from '@lexical/html';
9
- import { INSERT_UNORDERED_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_CHECK_LIST_COMMAND, REMOVE_LIST_COMMAND, ListNode, ListItemNode, registerList, registerCheckList } from '@lexical/list';
10
- import { createEmptyHistoryState, registerHistory } from '@lexical/history';
11
- import { $setBlocksType } from '@lexical/selection';
12
-
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";
13
13
  const AERIS_EDITOR_DEFAULT_FORMATS = [
14
- 'undo',
15
- 'redo',
16
- 'bold',
17
- 'italic',
18
- 'underline',
19
- 'heading',
20
- 'quote',
21
- 'bulletList',
22
- 'numberedList',
14
+ "undo",
15
+ "redo",
16
+ "bold",
17
+ "italic",
18
+ "underline",
19
+ "heading",
20
+ "quote",
21
+ "bulletList",
22
+ "numberedList"
23
23
  ];
24
24
  const AERIS_EDITOR_ALL_FORMATS = [
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',
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"
58
58
  ];
59
59
  let editorId = 0;
60
- class AerisEditorComponent {
61
- document = inject(DOCUMENT);
62
- sanitizer = inject(DomSanitizer);
63
- value = model('', /* @ts-ignore */
64
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
65
- inputId = input('', /* @ts-ignore */
66
- ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
67
- name = input('', /* @ts-ignore */
68
- ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
69
- placeholder = input('Write something...', /* @ts-ignore */
70
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
71
- ariaLabel = input('', /* @ts-ignore */
72
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
73
- ariaLabelledby = input('', /* @ts-ignore */
74
- ...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
75
- ariaDescribedby = input('', /* @ts-ignore */
76
- ...(ngDevMode ? [{ debugName: "ariaDescribedby" }] : /* istanbul ignore next */ []));
77
- toolbarAriaLabel = input('Formatting tools', /* @ts-ignore */
78
- ...(ngDevMode ? [{ debugName: "toolbarAriaLabel" }] : /* istanbul ignore next */ []));
79
- size = input('md', /* @ts-ignore */
80
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
81
- appearance = input('outline', /* @ts-ignore */
82
- ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
83
- minHeight = input('12rem', /* @ts-ignore */
84
- ...(ngDevMode ? [{ debugName: "minHeight" }] : /* istanbul ignore next */ []));
85
- formats = input(AERIS_EDITOR_DEFAULT_FORMATS, /* @ts-ignore */
86
- ...(ngDevMode ? [{ debugName: "formats" }] : /* istanbul ignore next */ []));
87
- namespace = input('AerisEditor', /* @ts-ignore */
88
- ...(ngDevMode ? [{ debugName: "namespace" }] : /* istanbul ignore next */ []));
89
- lexicalTheme = input({}, /* @ts-ignore */
90
- ...(ngDevMode ? [{ debugName: "lexicalTheme" }] : /* istanbul ignore next */ []));
91
- htmlConfig = input({}, /* @ts-ignore */
92
- ...(ngDevMode ? [{ debugName: "htmlConfig" }] : /* istanbul ignore next */ []));
93
- extensions = input([], /* @ts-ignore */
94
- ...(ngDevMode ? [{ debugName: "extensions" }] : /* istanbul ignore next */ []));
95
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
96
- readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
97
- required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
98
- invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
99
- fluid = input(false, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
100
- showToolbar = input(true, { ...(ngDevMode ? { debugName: "showToolbar" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
101
- valueInput = output();
102
- changed = output();
103
- focused = output();
104
- blurred = output();
105
- touch = output();
106
- ready = output();
107
- editorRoot = viewChild('editorRoot', /* @ts-ignore */
108
- ...(ngDevMode ? [{ debugName: "editorRoot" }] : /* istanbul ignore next */ []));
109
- generatedId = `aeris-editor-${++editorId}`;
110
- formDisabled = signal(false, /* @ts-ignore */
111
- ...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
112
- isEditorReady = signal(false, /* @ts-ignore */
113
- ...(ngDevMode ? [{ debugName: "isEditorReady" }] : /* istanbul ignore next */ []));
114
- hasFocus = signal(false, /* @ts-ignore */
115
- ...(ngDevMode ? [{ debugName: "hasFocus" }] : /* istanbul ignore next */ []));
116
- textContent = signal('', /* @ts-ignore */
117
- ...(ngDevMode ? [{ debugName: "textContent" }] : /* istanbul ignore next */ []));
118
- activeBold = signal(false, /* @ts-ignore */
119
- ...(ngDevMode ? [{ debugName: "activeBold" }] : /* istanbul ignore next */ []));
120
- activeItalic = signal(false, /* @ts-ignore */
121
- ...(ngDevMode ? [{ debugName: "activeItalic" }] : /* istanbul ignore next */ []));
122
- activeUnderline = signal(false, /* @ts-ignore */
123
- ...(ngDevMode ? [{ debugName: "activeUnderline" }] : /* istanbul ignore next */ []));
124
- activeStrikethrough = signal(false, /* @ts-ignore */
125
- ...(ngDevMode ? [{ debugName: "activeStrikethrough" }] : /* istanbul ignore next */ []));
126
- activeCode = signal(false, /* @ts-ignore */
127
- ...(ngDevMode ? [{ debugName: "activeCode" }] : /* istanbul ignore next */ []));
128
- activeHighlight = signal(false, /* @ts-ignore */
129
- ...(ngDevMode ? [{ debugName: "activeHighlight" }] : /* istanbul ignore next */ []));
130
- activeSubscript = signal(false, /* @ts-ignore */
131
- ...(ngDevMode ? [{ debugName: "activeSubscript" }] : /* istanbul ignore next */ []));
132
- activeSuperscript = signal(false, /* @ts-ignore */
133
- ...(ngDevMode ? [{ debugName: "activeSuperscript" }] : /* istanbul ignore next */ []));
134
- activeLowercase = signal(false, /* @ts-ignore */
135
- ...(ngDevMode ? [{ debugName: "activeLowercase" }] : /* istanbul ignore next */ []));
136
- activeUppercase = signal(false, /* @ts-ignore */
137
- ...(ngDevMode ? [{ debugName: "activeUppercase" }] : /* istanbul ignore next */ []));
138
- activeCapitalize = signal(false, /* @ts-ignore */
139
- ...(ngDevMode ? [{ debugName: "activeCapitalize" }] : /* istanbul ignore next */ []));
140
- activeBlock = signal('paragraph', /* @ts-ignore */
141
- ...(ngDevMode ? [{ debugName: "activeBlock" }] : /* istanbul ignore next */ []));
142
- activeList = signal(null, /* @ts-ignore */
143
- ...(ngDevMode ? [{ debugName: "activeList" }] : /* istanbul ignore next */ []));
144
- activeAlignment = signal('left', /* @ts-ignore */
145
- ...(ngDevMode ? [{ debugName: "activeAlignment" }] : /* istanbul ignore next */ []));
146
- availableFormats = computed(() => new Set(this.formats()), /* @ts-ignore */
147
- ...(ngDevMode ? [{ debugName: "availableFormats" }] : /* istanbul ignore next */ []));
148
- hasInlineActions = computed(() => this.formats().some((format) => [
149
- 'bold',
150
- 'italic',
151
- 'underline',
152
- 'strikethrough',
153
- 'code',
154
- 'highlight',
155
- 'subscript',
156
- 'superscript',
157
- 'lowercase',
158
- 'uppercase',
159
- 'capitalize',
160
- ].includes(format)), /* @ts-ignore */
161
- ...(ngDevMode ? [{ debugName: "hasInlineActions" }] : /* istanbul ignore next */ []));
162
- hasBlockActions = computed(() => this.formats().some((format) => [
163
- 'paragraph',
164
- 'heading',
165
- 'heading1',
166
- 'heading2',
167
- 'heading3',
168
- 'heading4',
169
- 'heading5',
170
- 'heading6',
171
- 'quote',
172
- ].includes(format)), /* @ts-ignore */
173
- ...(ngDevMode ? [{ debugName: "hasBlockActions" }] : /* istanbul ignore next */ []));
174
- hasListActions = computed(() => this.formats().some((format) => ['bulletList', 'numberedList', 'checkList'].includes(format)), /* @ts-ignore */
175
- ...(ngDevMode ? [{ debugName: "hasListActions" }] : /* istanbul ignore next */ []));
176
- hasAlignmentActions = computed(() => this.formats().some((format) => ['alignLeft', 'alignStart', 'alignCenter', 'alignRight', 'alignEnd', 'alignJustify'].includes(format)), /* @ts-ignore */
177
- ...(ngDevMode ? [{ debugName: "hasAlignmentActions" }] : /* istanbul ignore next */ []));
178
- hasDocumentActions = computed(() => this.formats().some((format) => ['outdent', 'indent', 'clear'].includes(format)), /* @ts-ignore */
179
- ...(ngDevMode ? [{ debugName: "hasDocumentActions" }] : /* istanbul ignore next */ []));
180
- resolvedInputId = computed(() => this.inputId() || this.generatedId, /* @ts-ignore */
181
- ...(ngDevMode ? [{ debugName: "resolvedInputId" }] : /* istanbul ignore next */ []));
182
- effectiveDisabled = computed(() => this.disabled() || this.formDisabled(), /* @ts-ignore */
183
- ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
184
- editable = computed(() => !this.effectiveDisabled() && !this.readonly(), /* @ts-ignore */
185
- ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
186
- toolbarDisabled = computed(() => !this.editable() || !this.isEditorReady(), /* @ts-ignore */
187
- ...(ngDevMode ? [{ debugName: "toolbarDisabled" }] : /* istanbul ignore next */ []));
188
- placeholderVisible = computed(() => !this.hasFocus() && !this.textContent().trim() && !!this.placeholder(), /* @ts-ignore */
189
- ...(ngDevMode ? [{ debugName: "placeholderVisible" }] : /* istanbul ignore next */ []));
190
- editor = null;
191
- unregisterEditor = null;
192
- lastSyncedValue = '';
193
- onChange = () => undefined;
194
- onTouched = () => undefined;
195
- constructor() {
196
- effect(() => {
197
- const editable = this.editable();
198
- this.editor?.setEditable(editable);
199
- });
200
- effect(() => {
201
- const nextValue = this.value();
202
- if (!this.editor || nextValue === this.lastSyncedValue)
203
- return;
204
- this.writeEditorValue(nextValue);
205
- });
206
- }
207
- ngAfterViewInit() {
208
- this.createEditor();
209
- }
210
- ngOnDestroy() {
211
- this.unregisterEditor?.();
212
- this.unregisterEditor = null;
213
- this.editor?.setRootElement(null);
214
- this.editor = null;
215
- this.isEditorReady.set(false);
216
- }
217
- writeValue(value) {
218
- const nextValue = value == null ? '' : String(value);
219
- this.value.set(nextValue);
220
- this.writeEditorValue(nextValue);
221
- }
222
- registerOnChange(callback) {
223
- this.onChange = callback;
224
- }
225
- registerOnTouched(callback) {
226
- this.onTouched = callback;
227
- }
228
- setDisabledState(disabled) {
229
- this.formDisabled.set(disabled);
230
- }
231
- focus() {
232
- this.editor?.focus();
233
- }
234
- clear() {
235
- if (!this.editable())
236
- return;
237
- this.writeEditorValue('');
238
- this.focus();
239
- }
240
- reset() {
241
- this.clear();
242
- }
243
- format(format) {
244
- if (!this.editable())
245
- return;
246
- this.editor?.dispatchCommand(FORMAT_TEXT_COMMAND, format);
247
- }
248
- setBlock(block) {
249
- if (!this.editable())
250
- return;
251
- this.editor?.update(() => {
252
- const selection = $getSelection();
253
- if (!$isRangeSelection(selection))
254
- return;
255
- if (block === 'heading') {
256
- block = 'h2';
257
- }
258
- if (block.startsWith('h') && this.activeBlock() !== block) {
259
- $setBlocksType(selection, () => $createHeadingNode(block));
260
- return;
261
- }
262
- if (block === 'quote' && this.activeBlock() !== 'quote') {
263
- $setBlocksType(selection, () => $createQuoteNode());
264
- return;
265
- }
266
- $setBlocksType(selection, () => $createParagraphNode());
267
- });
268
- }
269
- toggleBulletList() {
270
- if (!this.editable())
271
- return;
272
- this.editor?.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);
273
- }
274
- toggleNumberedList() {
275
- if (!this.editable())
276
- return;
277
- this.editor?.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);
278
- }
279
- toggleCheckList() {
280
- if (!this.editable())
281
- return;
282
- this.editor?.dispatchCommand(INSERT_CHECK_LIST_COMMAND, undefined);
283
- }
284
- removeList() {
285
- if (!this.editable())
286
- return;
287
- this.editor?.dispatchCommand(REMOVE_LIST_COMMAND, undefined);
288
- }
289
- undo() {
290
- if (!this.editable())
291
- return;
292
- this.editor?.dispatchCommand(UNDO_COMMAND, undefined);
293
- }
294
- redo() {
295
- if (!this.editable())
296
- return;
297
- this.editor?.dispatchCommand(REDO_COMMAND, undefined);
298
- }
299
- align(alignment) {
300
- if (!this.editable())
301
- return;
302
- this.editor?.dispatchCommand(FORMAT_ELEMENT_COMMAND, alignment);
303
- }
304
- indent() {
305
- if (!this.editable())
306
- return;
307
- this.editor?.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
308
- }
309
- outdent() {
310
- if (!this.editable())
311
- return;
312
- this.editor?.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
313
- }
314
- clearFormatting() {
315
- if (!this.editable())
316
- return;
317
- this.editor?.update(() => {
318
- const selection = $getSelection();
319
- if (!$isRangeSelection(selection))
320
- return;
321
- selection.setFormat(0);
322
- for (const node of selection.getNodes()) {
323
- if ($isTextNode(node)) {
324
- node.setFormat(0);
325
- node.setStyle('');
326
- }
327
- }
328
- });
329
- }
330
- getLexicalEditor() {
331
- return this.editor;
332
- }
333
- handleFocus(event) {
334
- this.hasFocus.set(true);
335
- this.focused.emit(event);
336
- }
337
- handleBlur(event) {
338
- this.blurred.emit(event);
339
- }
340
- handleFocusOut(event) {
341
- const relatedTarget = event.relatedTarget;
342
- const root = this.editorRoot()?.nativeElement;
343
- if (relatedTarget instanceof Node && root?.parentElement?.contains(relatedTarget))
344
- return;
345
- this.hasFocus.set(false);
346
- this.touch.emit();
347
- this.onTouched();
348
- }
349
- createEditor() {
350
- const rootElement = this.editorRoot()?.nativeElement;
351
- if (!rootElement)
352
- return;
353
- const extensions = this.extensions();
354
- const editor = createEditor({
355
- namespace: this.namespace(),
356
- html: this.htmlConfig(),
357
- nodes: [
358
- HeadingNode,
359
- QuoteNode,
360
- ListNode,
361
- ListItemNode,
362
- ...extensions.flatMap((extension) => extension.nodes ?? []),
363
- ],
364
- onError(error) {
365
- throw error;
366
- },
367
- theme: this.resolveTheme(),
368
- });
369
- this.editor = editor;
370
- editor.setRootElement(rootElement);
371
- editor.setEditable(this.editable());
372
- this.isEditorReady.set(true);
373
- const historyState = createEmptyHistoryState();
374
- const cleanups = [
375
- registerRichText(editor),
376
- registerList(editor),
377
- registerCheckList(editor),
378
- registerHistory(editor, historyState, 250),
379
- ...extensions.flatMap((extension) => {
380
- const cleanup = extension.setup?.(editor);
381
- return cleanup ? [cleanup] : [];
382
- }),
383
- editor.registerUpdateListener(({ editorState }) => {
384
- editorState.read(() => {
385
- const root = $getRoot();
386
- const textContent = root.getTextContent();
387
- const hasStructuredContent = root
388
- .getChildren()
389
- .some((node) => !['paragraph', 'heading', 'quote'].includes(node.getType()));
390
- const html = textContent.trim() || hasStructuredContent
391
- ? $generateHtmlFromNodes(editor, null)
392
- : '';
393
- this.syncSelectionState();
394
- this.emitValue(html, textContent);
395
- }, { editor });
396
- }),
397
- editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
398
- this.syncSelectionState();
399
- return false;
400
- }, COMMAND_PRIORITY_LOW),
401
- ];
402
- this.unregisterEditor = () => {
403
- for (const cleanup of cleanups)
404
- cleanup();
405
- };
406
- this.writeEditorValue(this.value());
407
- this.ready.emit(editor);
408
- }
409
- resolveTheme() {
410
- const customTheme = this.lexicalTheme();
411
- return {
412
- ...customTheme,
413
- heading: {
414
- h1: 'aeris-editor-content__heading aeris-editor-content__heading--h1',
415
- h2: 'aeris-editor-content__heading aeris-editor-content__heading--h2',
416
- h3: 'aeris-editor-content__heading aeris-editor-content__heading--h3',
417
- h4: 'aeris-editor-content__heading aeris-editor-content__heading--h4',
418
- h5: 'aeris-editor-content__heading aeris-editor-content__heading--h5',
419
- h6: 'aeris-editor-content__heading aeris-editor-content__heading--h6',
420
- ...customTheme.heading,
421
- },
422
- list: {
423
- checklist: 'aeris-editor-content__check-list',
424
- listitem: 'aeris-editor-content__list-item',
425
- listitemChecked: 'aeris-editor-content__list-item--checked',
426
- listitemUnchecked: 'aeris-editor-content__list-item--unchecked',
427
- ol: 'aeris-editor-content__ordered-list',
428
- ul: 'aeris-editor-content__unordered-list',
429
- ...customTheme.list,
430
- nested: {
431
- listitem: 'aeris-editor-content__nested-list-item',
432
- ...customTheme.list?.nested,
433
- },
434
- },
435
- paragraph: customTheme.paragraph ?? 'aeris-editor-content__paragraph',
436
- quote: customTheme.quote ?? 'aeris-editor-content__quote',
437
- text: {
438
- bold: 'aeris-editor-content__bold',
439
- capitalize: 'aeris-editor-content__capitalize',
440
- code: 'aeris-editor-content__code',
441
- highlight: 'aeris-editor-content__highlight',
442
- italic: 'aeris-editor-content__italic',
443
- lowercase: 'aeris-editor-content__lowercase',
444
- strikethrough: 'aeris-editor-content__strikethrough',
445
- subscript: 'aeris-editor-content__subscript',
446
- superscript: 'aeris-editor-content__superscript',
447
- underline: 'aeris-editor-content__underline',
448
- underlineStrikethrough: 'aeris-editor-content__underline aeris-editor-content__strikethrough',
449
- uppercase: 'aeris-editor-content__uppercase',
450
- ...customTheme.text,
451
- },
452
- };
453
- }
454
- writeEditorValue(value) {
455
- if (!this.editor)
456
- return;
457
- this.lastSyncedValue = value;
458
- this.editor.update(() => {
459
- const root = $getRoot();
460
- root.clear();
461
- const sanitizedValue = this.sanitizer.sanitize(SecurityContext.HTML, value) ?? '';
462
- if (!sanitizedValue.trim()) {
463
- root.append($createParagraphNode());
464
- this.textContent.set('');
465
- return;
466
- }
467
- const Parser = this.document.defaultView?.DOMParser;
468
- if (!Parser) {
469
- root.append($createParagraphNode());
470
- this.textContent.set('');
471
- return;
472
- }
473
- const parser = new Parser();
474
- const dom = parser.parseFromString(sanitizedValue, 'text/html');
475
- const nodes = $generateNodesFromDOM(this.editor, dom);
476
- root.append(...(nodes.length ? nodes : [$createParagraphNode()]));
477
- this.textContent.set(root.getTextContent());
478
- });
479
- }
480
- emitValue(value, textContent) {
481
- this.textContent.set(textContent);
482
- this.syncSelectionState();
483
- if (value === this.lastSyncedValue && value === this.value())
484
- return;
485
- this.lastSyncedValue = value;
486
- this.value.set(value);
487
- this.valueInput.emit(value);
488
- this.changed.emit({ value, textContent });
489
- this.onChange(value);
490
- }
491
- syncSelectionState() {
492
- const selection = $getSelection();
493
- if (!$isRangeSelection(selection)) {
494
- this.activeBold.set(false);
495
- this.activeItalic.set(false);
496
- this.activeUnderline.set(false);
497
- this.activeStrikethrough.set(false);
498
- this.activeCode.set(false);
499
- this.activeHighlight.set(false);
500
- this.activeSubscript.set(false);
501
- this.activeSuperscript.set(false);
502
- this.activeLowercase.set(false);
503
- this.activeUppercase.set(false);
504
- this.activeCapitalize.set(false);
505
- this.activeBlock.set('paragraph');
506
- this.activeList.set(null);
507
- this.activeAlignment.set('left');
508
- return;
509
- }
510
- this.activeBold.set(selection.hasFormat('bold'));
511
- this.activeItalic.set(selection.hasFormat('italic'));
512
- this.activeUnderline.set(selection.hasFormat('underline'));
513
- this.activeStrikethrough.set(selection.hasFormat('strikethrough'));
514
- this.activeCode.set(selection.hasFormat('code'));
515
- this.activeHighlight.set(selection.hasFormat('highlight'));
516
- this.activeSubscript.set(selection.hasFormat('subscript'));
517
- this.activeSuperscript.set(selection.hasFormat('superscript'));
518
- this.activeLowercase.set(selection.hasFormat('lowercase'));
519
- this.activeUppercase.set(selection.hasFormat('uppercase'));
520
- this.activeCapitalize.set(selection.hasFormat('capitalize'));
521
- const nodes = selection.getNodes();
522
- const topLevel = nodes[0]?.getTopLevelElementOrThrow();
523
- if (topLevel instanceof HeadingNode) {
524
- this.activeBlock.set(topLevel.getTag());
525
- }
526
- else if (topLevel instanceof QuoteNode) {
527
- this.activeBlock.set('quote');
528
- }
529
- else {
530
- this.activeBlock.set('paragraph');
531
- }
532
- const elementAlignment = $isElementNode(topLevel) ? topLevel.getFormatType() : '';
533
- this.activeAlignment.set(elementAlignment === 'center' ||
534
- elementAlignment === 'start' ||
535
- elementAlignment === 'right' ||
536
- elementAlignment === 'end' ||
537
- elementAlignment === 'justify'
538
- ? elementAlignment
539
- : 'left');
540
- let currentNode = nodes[0] ?? null;
541
- while (currentNode && !(currentNode instanceof ListNode)) {
542
- currentNode = currentNode.getParent();
543
- }
544
- this.activeList.set(currentNode instanceof ListNode ? currentNode.getListType() : null);
545
- }
546
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
547
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.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 }, 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", valueInput: "valueInput", changed: "changed", focused: "focused", blurred: "blurred", touch: "touch", ready: "ready" }, host: { properties: { "attr.data-fluid": "fluid() || null" } }, providers: [
548
- {
549
- provide: NG_VALUE_ACCESSOR,
550
- useExisting: forwardRef(() => AerisEditorComponent),
551
- multi: true,
552
- },
553
- ], 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
+ toolbarSeparators = computed(() => {
174
+ let hasPreviousGroup = this.availableFormats().has("undo") || this.availableFormats().has("redo");
175
+ const beforeGroup = (hasActions) => {
176
+ const show = hasPreviousGroup && hasActions;
177
+ hasPreviousGroup ||= hasActions;
178
+ return show;
179
+ };
180
+ return {
181
+ inline: beforeGroup(this.hasInlineActions()),
182
+ block: beforeGroup(this.hasBlockActions()),
183
+ list: beforeGroup(this.hasListActions()),
184
+ alignment: beforeGroup(this.hasAlignmentActions()),
185
+ document: beforeGroup(this.hasDocumentActions())
186
+ };
187
+ }, ...ngDevMode ? [{ debugName: "toolbarSeparators" }] : /* istanbul ignore next */ []);
188
+ resolvedInputId = computed(() => this.inputId() || this.generatedId, ...ngDevMode ? [{ debugName: "resolvedInputId" }] : /* istanbul ignore next */ []);
189
+ effectiveDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []);
190
+ editable = computed(() => !this.effectiveDisabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []);
191
+ toolbarDisabled = computed(() => !this.editable() || !this.isEditorReady(), ...ngDevMode ? [{ debugName: "toolbarDisabled" }] : /* istanbul ignore next */ []);
192
+ placeholderVisible = computed(() => !this.hasFocus() && !this.textContent().trim() && !!this.placeholder(), ...ngDevMode ? [{ debugName: "placeholderVisible" }] : /* istanbul ignore next */ []);
193
+ editor = null;
194
+ unregisterEditor = null;
195
+ lastSyncedValue = "";
196
+ onChange = () => void 0;
197
+ onTouched = () => void 0;
198
+ constructor() {
199
+ effect(() => {
200
+ const editable = this.editable();
201
+ this.editor?.setEditable(editable);
202
+ });
203
+ effect(() => {
204
+ const nextValue = this.value();
205
+ if (!this.editor || nextValue === this.lastSyncedValue) return;
206
+ this.writeEditorValue(nextValue);
207
+ });
208
+ }
209
+ ngAfterViewInit() {
210
+ this.createEditor();
211
+ }
212
+ ngOnDestroy() {
213
+ this.unregisterEditor?.();
214
+ this.unregisterEditor = null;
215
+ this.editor?.setRootElement(null);
216
+ this.editor = null;
217
+ this.isEditorReady.set(false);
218
+ }
219
+ writeValue(value) {
220
+ const nextValue = value == null ? "" : String(value);
221
+ this.value.set(nextValue);
222
+ this.writeEditorValue(nextValue);
223
+ }
224
+ registerOnChange(callback) {
225
+ this.onChange = callback;
226
+ }
227
+ registerOnTouched(callback) {
228
+ this.onTouched = callback;
229
+ }
230
+ setDisabledState(disabled) {
231
+ this.formDisabled.set(disabled);
232
+ }
233
+ focus() {
234
+ this.editor?.focus();
235
+ }
236
+ clear() {
237
+ if (!this.editable()) return;
238
+ this.writeEditorValue("");
239
+ this.focus();
240
+ }
241
+ reset() {
242
+ this.clear();
243
+ }
244
+ format(format) {
245
+ if (!this.editable()) return;
246
+ this.editor?.dispatchCommand(FORMAT_TEXT_COMMAND, format);
247
+ }
248
+ setBlock(block) {
249
+ if (!this.editable()) return;
250
+ this.editor?.update(() => {
251
+ const selection = $getSelection();
252
+ if (!$isRangeSelection(selection)) return;
253
+ if (block === "heading") block = "h2";
254
+ if (block.startsWith("h") && this.activeBlock() !== block) {
255
+ $setBlocksType(selection, () => $createHeadingNode(block));
256
+ return;
257
+ }
258
+ if (block === "quote" && this.activeBlock() !== "quote") {
259
+ $setBlocksType(selection, () => $createQuoteNode());
260
+ return;
261
+ }
262
+ $setBlocksType(selection, () => $createParagraphNode());
263
+ });
264
+ }
265
+ toggleBulletList() {
266
+ if (!this.editable()) return;
267
+ this.editor?.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, void 0);
268
+ }
269
+ toggleNumberedList() {
270
+ if (!this.editable()) return;
271
+ this.editor?.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, void 0);
272
+ }
273
+ toggleCheckList() {
274
+ if (!this.editable()) return;
275
+ this.editor?.dispatchCommand(INSERT_CHECK_LIST_COMMAND, void 0);
276
+ }
277
+ removeList() {
278
+ if (!this.editable()) return;
279
+ this.editor?.dispatchCommand(REMOVE_LIST_COMMAND, void 0);
280
+ }
281
+ undo() {
282
+ if (!this.editable()) return;
283
+ this.editor?.dispatchCommand(UNDO_COMMAND, void 0);
284
+ }
285
+ redo() {
286
+ if (!this.editable()) return;
287
+ this.editor?.dispatchCommand(REDO_COMMAND, void 0);
288
+ }
289
+ align(alignment) {
290
+ if (!this.editable()) return;
291
+ this.editor?.dispatchCommand(FORMAT_ELEMENT_COMMAND, alignment);
292
+ }
293
+ indent() {
294
+ if (!this.editable()) return;
295
+ this.editor?.dispatchCommand(INDENT_CONTENT_COMMAND, void 0);
296
+ }
297
+ outdent() {
298
+ if (!this.editable()) return;
299
+ this.editor?.dispatchCommand(OUTDENT_CONTENT_COMMAND, void 0);
300
+ }
301
+ clearFormatting() {
302
+ if (!this.editable()) return;
303
+ this.editor?.update(() => {
304
+ const selection = $getSelection();
305
+ if (!$isRangeSelection(selection)) return;
306
+ selection.setFormat(0);
307
+ for (const node of selection.getNodes()) if ($isTextNode(node)) {
308
+ node.setFormat(0);
309
+ node.setStyle("");
310
+ }
311
+ });
312
+ }
313
+ getLexicalEditor() {
314
+ return this.editor;
315
+ }
316
+ handleFocus(event) {
317
+ this.hasFocus.set(true);
318
+ this.focused.emit(event);
319
+ }
320
+ handleBlur(event) {
321
+ this.blurred.emit(event);
322
+ }
323
+ handleFocusOut(event) {
324
+ const relatedTarget = event.relatedTarget;
325
+ const root = this.editorRoot()?.nativeElement;
326
+ if (relatedTarget instanceof Node && root?.parentElement?.contains(relatedTarget)) return;
327
+ this.hasFocus.set(false);
328
+ this.touch.emit();
329
+ this.onTouched();
330
+ }
331
+ createEditor() {
332
+ const rootElement = this.editorRoot()?.nativeElement;
333
+ if (!rootElement) return;
334
+ const extensions = this.extensions();
335
+ const editor = createEditor({
336
+ namespace: this.namespace(),
337
+ html: this.htmlConfig(),
338
+ nodes: [
339
+ HeadingNode,
340
+ QuoteNode,
341
+ ListNode,
342
+ ListItemNode,
343
+ ...extensions.flatMap((extension) => extension.nodes ?? [])
344
+ ],
345
+ onError(error) {
346
+ throw error;
347
+ },
348
+ theme: this.resolveTheme()
349
+ });
350
+ this.editor = editor;
351
+ editor.setRootElement(rootElement);
352
+ editor.setEditable(this.editable());
353
+ this.isEditorReady.set(true);
354
+ const historyState = createEmptyHistoryState();
355
+ const cleanups = [
356
+ registerRichText(editor),
357
+ registerList(editor),
358
+ registerCheckList(editor),
359
+ registerHistory(editor, historyState, 250),
360
+ ...extensions.flatMap((extension) => {
361
+ const cleanup = extension.setup?.(editor);
362
+ return cleanup ? [cleanup] : [];
363
+ }),
364
+ editor.registerUpdateListener(({ editorState }) => {
365
+ editorState.read(() => {
366
+ const root = $getRoot();
367
+ const textContent = root.getTextContent();
368
+ const hasStructuredContent = root.getChildren().some((node) => ![
369
+ "paragraph",
370
+ "heading",
371
+ "quote"
372
+ ].includes(node.getType()));
373
+ const html = textContent.trim() || hasStructuredContent ? $generateHtmlFromNodes(editor, null) : "";
374
+ this.syncSelectionState();
375
+ this.emitValue(html, textContent);
376
+ }, { editor });
377
+ }),
378
+ editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
379
+ this.syncSelectionState();
380
+ return false;
381
+ }, COMMAND_PRIORITY_LOW)
382
+ ];
383
+ this.unregisterEditor = () => {
384
+ for (const cleanup of cleanups) cleanup();
385
+ };
386
+ this.writeEditorValue(this.value());
387
+ this.ready.emit(editor);
388
+ }
389
+ resolveTheme() {
390
+ const customTheme = this.lexicalTheme();
391
+ return {
392
+ ...customTheme,
393
+ heading: {
394
+ h1: "aeris-editor-content__heading aeris-editor-content__heading--h1",
395
+ h2: "aeris-editor-content__heading aeris-editor-content__heading--h2",
396
+ h3: "aeris-editor-content__heading aeris-editor-content__heading--h3",
397
+ h4: "aeris-editor-content__heading aeris-editor-content__heading--h4",
398
+ h5: "aeris-editor-content__heading aeris-editor-content__heading--h5",
399
+ h6: "aeris-editor-content__heading aeris-editor-content__heading--h6",
400
+ ...customTheme.heading
401
+ },
402
+ list: {
403
+ checklist: "aeris-editor-content__check-list",
404
+ listitem: "aeris-editor-content__list-item",
405
+ listitemChecked: "aeris-editor-content__list-item--checked",
406
+ listitemUnchecked: "aeris-editor-content__list-item--unchecked",
407
+ ol: "aeris-editor-content__ordered-list",
408
+ ul: "aeris-editor-content__unordered-list",
409
+ ...customTheme.list,
410
+ nested: {
411
+ listitem: "aeris-editor-content__nested-list-item",
412
+ ...customTheme.list?.nested
413
+ }
414
+ },
415
+ paragraph: customTheme.paragraph ?? "aeris-editor-content__paragraph",
416
+ quote: customTheme.quote ?? "aeris-editor-content__quote",
417
+ text: {
418
+ bold: "aeris-editor-content__bold",
419
+ capitalize: "aeris-editor-content__capitalize",
420
+ code: "aeris-editor-content__code",
421
+ highlight: "aeris-editor-content__highlight",
422
+ italic: "aeris-editor-content__italic",
423
+ lowercase: "aeris-editor-content__lowercase",
424
+ strikethrough: "aeris-editor-content__strikethrough",
425
+ subscript: "aeris-editor-content__subscript",
426
+ superscript: "aeris-editor-content__superscript",
427
+ underline: "aeris-editor-content__underline",
428
+ underlineStrikethrough: "aeris-editor-content__underline aeris-editor-content__strikethrough",
429
+ uppercase: "aeris-editor-content__uppercase",
430
+ ...customTheme.text
431
+ }
432
+ };
433
+ }
434
+ writeEditorValue(value) {
435
+ if (!this.editor) return;
436
+ this.lastSyncedValue = value;
437
+ this.editor.update(() => {
438
+ const root = $getRoot();
439
+ root.clear();
440
+ const sanitizedValue = this.sanitizer.sanitize(SecurityContext.HTML, value) ?? "";
441
+ if (!sanitizedValue.trim()) {
442
+ root.append($createParagraphNode());
443
+ this.textContent.set("");
444
+ return;
445
+ }
446
+ const Parser = this.document.defaultView?.DOMParser;
447
+ if (!Parser) {
448
+ root.append($createParagraphNode());
449
+ this.textContent.set("");
450
+ return;
451
+ }
452
+ const dom = new Parser().parseFromString(sanitizedValue, "text/html");
453
+ const nodes = $generateNodesFromDOM(this.editor, dom);
454
+ root.append(...nodes.length ? nodes : [$createParagraphNode()]);
455
+ this.textContent.set(root.getTextContent());
456
+ });
457
+ }
458
+ emitValue(value, textContent) {
459
+ this.textContent.set(textContent);
460
+ this.syncSelectionState();
461
+ if (value === this.lastSyncedValue && value === this.value()) return;
462
+ this.lastSyncedValue = value;
463
+ this.value.set(value);
464
+ this.changed.emit({
465
+ value,
466
+ textContent
467
+ });
468
+ this.onChange(value);
469
+ }
470
+ syncSelectionState() {
471
+ const selection = $getSelection();
472
+ if (!$isRangeSelection(selection)) {
473
+ this.activeBold.set(false);
474
+ this.activeItalic.set(false);
475
+ this.activeUnderline.set(false);
476
+ this.activeStrikethrough.set(false);
477
+ this.activeCode.set(false);
478
+ this.activeHighlight.set(false);
479
+ this.activeSubscript.set(false);
480
+ this.activeSuperscript.set(false);
481
+ this.activeLowercase.set(false);
482
+ this.activeUppercase.set(false);
483
+ this.activeCapitalize.set(false);
484
+ this.activeBlock.set("paragraph");
485
+ this.activeList.set(null);
486
+ this.activeAlignment.set("left");
487
+ return;
488
+ }
489
+ this.activeBold.set(selection.hasFormat("bold"));
490
+ this.activeItalic.set(selection.hasFormat("italic"));
491
+ this.activeUnderline.set(selection.hasFormat("underline"));
492
+ this.activeStrikethrough.set(selection.hasFormat("strikethrough"));
493
+ this.activeCode.set(selection.hasFormat("code"));
494
+ this.activeHighlight.set(selection.hasFormat("highlight"));
495
+ this.activeSubscript.set(selection.hasFormat("subscript"));
496
+ this.activeSuperscript.set(selection.hasFormat("superscript"));
497
+ this.activeLowercase.set(selection.hasFormat("lowercase"));
498
+ this.activeUppercase.set(selection.hasFormat("uppercase"));
499
+ this.activeCapitalize.set(selection.hasFormat("capitalize"));
500
+ const nodes = selection.getNodes();
501
+ const topLevel = nodes[0]?.getTopLevelElementOrThrow();
502
+ if (topLevel instanceof HeadingNode) this.activeBlock.set(topLevel.getTag());
503
+ else if (topLevel instanceof QuoteNode) this.activeBlock.set("quote");
504
+ else this.activeBlock.set("paragraph");
505
+ const elementAlignment = $isElementNode(topLevel) ? topLevel.getFormatType() : "";
506
+ this.activeAlignment.set(elementAlignment === "center" || elementAlignment === "start" || elementAlignment === "right" || elementAlignment === "end" || elementAlignment === "justify" ? elementAlignment : "left");
507
+ let currentNode = nodes[0] ?? null;
508
+ while (currentNode && !(currentNode instanceof ListNode)) currentNode = currentNode.getParent();
509
+ this.activeList.set(currentNode instanceof ListNode ? currentNode.getListType() : null);
510
+ }
511
+ static ɵfac = i0.ɵɵngDeclareFactory({
512
+ minVersion: "12.0.0",
513
+ version: "22.2.2",
514
+ ngImport: i0,
515
+ type: AerisEditorComponent,
516
+ deps: [],
517
+ target: i0.ɵɵFactoryTarget.Component
518
+ });
519
+ static ɵcmp = i0.ɵɵngDeclareComponent({
520
+ minVersion: "17.0.0",
521
+ version: "22.2.2",
522
+ type: AerisEditorComponent,
523
+ isStandalone: true,
524
+ selector: "aeris-editor",
525
+ inputs: {
526
+ value: {
527
+ classPropertyName: "value",
528
+ publicName: "value",
529
+ isSignal: true,
530
+ isRequired: false,
531
+ transformFunction: null
532
+ },
533
+ inputId: {
534
+ classPropertyName: "inputId",
535
+ publicName: "inputId",
536
+ isSignal: true,
537
+ isRequired: false,
538
+ transformFunction: null
539
+ },
540
+ name: {
541
+ classPropertyName: "name",
542
+ publicName: "name",
543
+ isSignal: true,
544
+ isRequired: false,
545
+ transformFunction: null
546
+ },
547
+ placeholder: {
548
+ classPropertyName: "placeholder",
549
+ publicName: "placeholder",
550
+ isSignal: true,
551
+ isRequired: false,
552
+ transformFunction: null
553
+ },
554
+ ariaLabel: {
555
+ classPropertyName: "ariaLabel",
556
+ publicName: "ariaLabel",
557
+ isSignal: true,
558
+ isRequired: false,
559
+ transformFunction: null
560
+ },
561
+ ariaLabelledBy: {
562
+ classPropertyName: "ariaLabelledBy",
563
+ publicName: "ariaLabelledBy",
564
+ isSignal: true,
565
+ isRequired: false,
566
+ transformFunction: null
567
+ },
568
+ ariaDescribedBy: {
569
+ classPropertyName: "ariaDescribedBy",
570
+ publicName: "ariaDescribedBy",
571
+ isSignal: true,
572
+ isRequired: false,
573
+ transformFunction: null
574
+ },
575
+ toolbarAriaLabel: {
576
+ classPropertyName: "toolbarAriaLabel",
577
+ publicName: "toolbarAriaLabel",
578
+ isSignal: true,
579
+ isRequired: false,
580
+ transformFunction: null
581
+ },
582
+ size: {
583
+ classPropertyName: "size",
584
+ publicName: "size",
585
+ isSignal: true,
586
+ isRequired: false,
587
+ transformFunction: null
588
+ },
589
+ appearance: {
590
+ classPropertyName: "appearance",
591
+ publicName: "appearance",
592
+ isSignal: true,
593
+ isRequired: false,
594
+ transformFunction: null
595
+ },
596
+ minHeight: {
597
+ classPropertyName: "minHeight",
598
+ publicName: "minHeight",
599
+ isSignal: true,
600
+ isRequired: false,
601
+ transformFunction: null
602
+ },
603
+ formats: {
604
+ classPropertyName: "formats",
605
+ publicName: "formats",
606
+ isSignal: true,
607
+ isRequired: false,
608
+ transformFunction: null
609
+ },
610
+ namespace: {
611
+ classPropertyName: "namespace",
612
+ publicName: "namespace",
613
+ isSignal: true,
614
+ isRequired: false,
615
+ transformFunction: null
616
+ },
617
+ lexicalTheme: {
618
+ classPropertyName: "lexicalTheme",
619
+ publicName: "lexicalTheme",
620
+ isSignal: true,
621
+ isRequired: false,
622
+ transformFunction: null
623
+ },
624
+ htmlConfig: {
625
+ classPropertyName: "htmlConfig",
626
+ publicName: "htmlConfig",
627
+ isSignal: true,
628
+ isRequired: false,
629
+ transformFunction: null
630
+ },
631
+ extensions: {
632
+ classPropertyName: "extensions",
633
+ publicName: "extensions",
634
+ isSignal: true,
635
+ isRequired: false,
636
+ transformFunction: null
637
+ },
638
+ disabled: {
639
+ classPropertyName: "disabled",
640
+ publicName: "disabled",
641
+ isSignal: true,
642
+ isRequired: false,
643
+ transformFunction: null
644
+ },
645
+ readonly: {
646
+ classPropertyName: "readonly",
647
+ publicName: "readonly",
648
+ isSignal: true,
649
+ isRequired: false,
650
+ transformFunction: null
651
+ },
652
+ required: {
653
+ classPropertyName: "required",
654
+ publicName: "required",
655
+ isSignal: true,
656
+ isRequired: false,
657
+ transformFunction: null
658
+ },
659
+ invalid: {
660
+ classPropertyName: "invalid",
661
+ publicName: "invalid",
662
+ isSignal: true,
663
+ isRequired: false,
664
+ transformFunction: null
665
+ },
666
+ touched: {
667
+ classPropertyName: "touched",
668
+ publicName: "touched",
669
+ isSignal: true,
670
+ isRequired: false,
671
+ transformFunction: null
672
+ },
673
+ fluid: {
674
+ classPropertyName: "fluid",
675
+ publicName: "fluid",
676
+ isSignal: true,
677
+ isRequired: false,
678
+ transformFunction: null
679
+ },
680
+ showToolbar: {
681
+ classPropertyName: "showToolbar",
682
+ publicName: "showToolbar",
683
+ isSignal: true,
684
+ isRequired: false,
685
+ transformFunction: null
686
+ }
687
+ },
688
+ outputs: {
689
+ value: "valueChange",
690
+ changed: "changed",
691
+ focused: "focused",
692
+ blurred: "blurred",
693
+ touch: "touch",
694
+ ready: "ready"
695
+ },
696
+ host: { properties: { "attr.data-fluid": "fluid() || null" } },
697
+ providers: [{
698
+ provide: NG_VALUE_ACCESSOR,
699
+ useExisting: forwardRef(() => AerisEditorComponent),
700
+ multi: true
701
+ }],
702
+ viewQueries: [{
703
+ propertyName: "editorRoot",
704
+ first: true,
705
+ predicate: ["editorRoot"],
706
+ descendants: true,
707
+ isSignal: true
708
+ }],
709
+ ngImport: i0,
710
+ template: `
554
711
  <div
555
712
  class="aeris-editor"
556
713
  [attr.data-size]="size()"
557
714
  [attr.data-appearance]="appearance()"
558
- [attr.data-invalid]="invalid() || null"
715
+ [attr.data-invalid]="displayInvalid() || null"
559
716
  [attr.data-disabled]="effectiveDisabled() || null"
560
717
  [attr.data-readonly]="readonly() || null"
561
718
  [attr.data-fluid]="fluid() || null"
@@ -580,7 +737,7 @@ class AerisEditorComponent {
580
737
  </button>
581
738
  }
582
739
 
583
- @if (hasInlineActions()) {
740
+ @if (toolbarSeparators().inline) {
584
741
  <span class="aeris-editor__separator" aria-hidden="true"></span>
585
742
  }
586
743
  @if (availableFormats().has('bold')) {
@@ -709,7 +866,7 @@ class AerisEditorComponent {
709
866
  </button>
710
867
  }
711
868
 
712
- @if (hasBlockActions()) {
869
+ @if (toolbarSeparators().block) {
713
870
  <span class="aeris-editor__separator" aria-hidden="true"></span>
714
871
  }
715
872
  @if (availableFormats().has('paragraph')) {
@@ -819,7 +976,7 @@ class AerisEditorComponent {
819
976
  </button>
820
977
  }
821
978
 
822
- @if (hasListActions()) {
979
+ @if (toolbarSeparators().list) {
823
980
  <span class="aeris-editor__separator" aria-hidden="true"></span>
824
981
  }
825
982
  @if (availableFormats().has('bulletList')) {
@@ -881,7 +1038,7 @@ class AerisEditorComponent {
881
1038
  </button>
882
1039
  }
883
1040
 
884
- @if (hasAlignmentActions()) {
1041
+ @if (toolbarSeparators().alignment) {
885
1042
  <span class="aeris-editor__separator" aria-hidden="true"></span>
886
1043
  }
887
1044
  @if (availableFormats().has('alignLeft')) {
@@ -963,7 +1120,7 @@ class AerisEditorComponent {
963
1120
  </button>
964
1121
  }
965
1122
 
966
- @if (hasDocumentActions()) {
1123
+ @if (toolbarSeparators().document) {
967
1124
  <span class="aeris-editor__separator" aria-hidden="true"></span>
968
1125
  }
969
1126
  @if (availableFormats().has('outdent')) {
@@ -1018,9 +1175,9 @@ class AerisEditorComponent {
1018
1175
  [id]="resolvedInputId()"
1019
1176
  [attr.contenteditable]="editable()"
1020
1177
  [attr.aria-label]="ariaLabel() || null"
1021
- [attr.aria-labelledby]="ariaLabelledby() || null"
1022
- [attr.aria-describedby]="ariaDescribedby() || null"
1023
- [attr.aria-invalid]="invalid() || null"
1178
+ [attr.aria-labelledby]="ariaLabelledBy() || null"
1179
+ [attr.aria-describedby]="ariaDescribedBy() || null"
1180
+ [attr.aria-invalid]="displayInvalid() || null"
1024
1181
  [attr.aria-required]="required() || null"
1025
1182
  [attr.aria-placeholder]="placeholder() || null"
1026
1183
  [attr.tabindex]="effectiveDisabled() ? -1 : 0"
@@ -1037,16 +1194,27 @@ class AerisEditorComponent {
1037
1194
  <input type="hidden" [name]="name()" [value]="value()" />
1038
1195
  }
1039
1196
  </div>
1040
- `, 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-strong, 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 });
1041
- }
1042
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisEditorComponent, decorators: [{
1043
- type: Component,
1044
- args: [{ selector: 'aeris-editor', template: `
1197
+ `,
1198
+ isInline: true,
1199
+ 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: var(--aeris-font-size-xl, .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-structured-control, var(--aeris-radius-control, var(--aeris-radius-md, .5625rem)));background:var(--aeris-surface);box-shadow:var(--aeris-shadow-xs, 0 1px 2px rgba(0, 0, 0, .1));transition:border-color var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),box-shadow var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),background var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease)}.aeris-editor[data-fluid]{width:100%}.aeris-editor[data-size=sm]{--aeris-editor-padding: .75rem;--aeris-editor-font-size: var(--aeris-font-size-lg, .875rem)}.aeris-editor[data-size=lg]{--aeris-editor-padding: 1rem;--aeris-editor-font-size: var(--aeris-font-size-2xl, 1rem)}.aeris-editor[data-appearance=filled]{background:var(--aeris-surface-2)}.aeris-editor:focus-within{border-color:var(--aeris-control-focus-border, var(--aeris-focus));box-shadow:0 0 0 var(--aeris-focus-ring-width, 3px) var(--aeris-control-focus-ring-color, var(--aeris-focus-ring-color, transparent))}.aeris-editor[data-invalid]{border-color:var(--aeris-control-invalid-border, var(--aeris-danger))}.aeris-editor[data-invalid]:focus-within{box-shadow:0 0 0 var(--aeris-focus-ring-width, 3px) var(--aeris-control-invalid-focus-ring-color, transparent)}.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-item, var(--aeris-radius-sm, .4375rem));background:transparent;color:var(--aeris-text);font:inherit;font-size:var(--aeris-font-size-md, .8125rem);font-weight:var(--aeris-font-weight-bold, 700);cursor:pointer;transition:background var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),color var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),box-shadow var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease)}.aeris-editor__toolbar button[aria-pressed=true]{background:var(--aeris-primary-soft);color:var(--aeris-text)}@media(hover:hover){.aeris-editor__toolbar button:hover:not(:disabled){background:var(--aeris-primary-soft);color:var(--aeris-text)}}.aeris-editor__toolbar button:focus-visible{outline:var(--aeris-focus-ring-width, 3px) solid var(--aeris-focus);outline-offset:var(--aeris-focus-ring-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:var(--aeris-line-height-tight, 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:.75rem .875rem;border-radius:var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem));background:var(--aeris-surface-2);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:var(--aeris-font-weight-bold, 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}}@media(pointer:coarse){input:not([type=checkbox]):not([type=radio]),textarea{font-size:var(--aeris-mobile-input-font-size, 1rem)}}\n"],
1200
+ encapsulation: i0.ViewEncapsulation.None
1201
+ });
1202
+ };
1203
+ i0.ɵɵngDeclareClassMetadata({
1204
+ minVersion: "12.0.0",
1205
+ version: "22.2.2",
1206
+ ngImport: i0,
1207
+ type: AerisEditorComponent,
1208
+ decorators: [{
1209
+ type: Component,
1210
+ args: [{
1211
+ selector: "aeris-editor",
1212
+ template: `
1045
1213
  <div
1046
1214
  class="aeris-editor"
1047
1215
  [attr.data-size]="size()"
1048
1216
  [attr.data-appearance]="appearance()"
1049
- [attr.data-invalid]="invalid() || null"
1217
+ [attr.data-invalid]="displayInvalid() || null"
1050
1218
  [attr.data-disabled]="effectiveDisabled() || null"
1051
1219
  [attr.data-readonly]="readonly() || null"
1052
1220
  [attr.data-fluid]="fluid() || null"
@@ -1071,7 +1239,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
1071
1239
  </button>
1072
1240
  }
1073
1241
 
1074
- @if (hasInlineActions()) {
1242
+ @if (toolbarSeparators().inline) {
1075
1243
  <span class="aeris-editor__separator" aria-hidden="true"></span>
1076
1244
  }
1077
1245
  @if (availableFormats().has('bold')) {
@@ -1200,7 +1368,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
1200
1368
  </button>
1201
1369
  }
1202
1370
 
1203
- @if (hasBlockActions()) {
1371
+ @if (toolbarSeparators().block) {
1204
1372
  <span class="aeris-editor__separator" aria-hidden="true"></span>
1205
1373
  }
1206
1374
  @if (availableFormats().has('paragraph')) {
@@ -1310,7 +1478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
1310
1478
  </button>
1311
1479
  }
1312
1480
 
1313
- @if (hasListActions()) {
1481
+ @if (toolbarSeparators().list) {
1314
1482
  <span class="aeris-editor__separator" aria-hidden="true"></span>
1315
1483
  }
1316
1484
  @if (availableFormats().has('bulletList')) {
@@ -1372,7 +1540,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
1372
1540
  </button>
1373
1541
  }
1374
1542
 
1375
- @if (hasAlignmentActions()) {
1543
+ @if (toolbarSeparators().alignment) {
1376
1544
  <span class="aeris-editor__separator" aria-hidden="true"></span>
1377
1545
  }
1378
1546
  @if (availableFormats().has('alignLeft')) {
@@ -1454,7 +1622,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
1454
1622
  </button>
1455
1623
  }
1456
1624
 
1457
- @if (hasDocumentActions()) {
1625
+ @if (toolbarSeparators().document) {
1458
1626
  <span class="aeris-editor__separator" aria-hidden="true"></span>
1459
1627
  }
1460
1628
  @if (availableFormats().has('outdent')) {
@@ -1509,9 +1677,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
1509
1677
  [id]="resolvedInputId()"
1510
1678
  [attr.contenteditable]="editable()"
1511
1679
  [attr.aria-label]="ariaLabel() || null"
1512
- [attr.aria-labelledby]="ariaLabelledby() || null"
1513
- [attr.aria-describedby]="ariaDescribedby() || null"
1514
- [attr.aria-invalid]="invalid() || null"
1680
+ [attr.aria-labelledby]="ariaLabelledBy() || null"
1681
+ [attr.aria-describedby]="ariaDescribedBy() || null"
1682
+ [attr.aria-invalid]="displayInvalid() || null"
1515
1683
  [attr.aria-required]="required() || null"
1516
1684
  [attr.aria-placeholder]="placeholder() || null"
1517
1685
  [attr.tabindex]="effectiveDisabled() ? -1 : 0"
@@ -1528,21 +1696,233 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
1528
1696
  <input type="hidden" [name]="name()" [value]="value()" />
1529
1697
  }
1530
1698
  </div>
1531
- `, encapsulation: ViewEncapsulation.None, providers: [
1532
- {
1533
- provide: NG_VALUE_ACCESSOR,
1534
- useExisting: forwardRef(() => AerisEditorComponent),
1535
- multi: true,
1536
- },
1537
- ], host: {
1538
- '[attr.data-fluid]': 'fluid() || null',
1539
- }, 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-strong, 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"] }]
1540
- }], 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 }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], valueInput: [{ type: i0.Output, args: ["valueInput"] }], 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 }] }] } });
1699
+ `,
1700
+ encapsulation: ViewEncapsulation.None,
1701
+ providers: [{
1702
+ provide: NG_VALUE_ACCESSOR,
1703
+ useExisting: forwardRef(() => AerisEditorComponent),
1704
+ multi: true
1705
+ }],
1706
+ host: { "[attr.data-fluid]": "fluid() || null" },
1707
+ 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: var(--aeris-font-size-xl, .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-structured-control, var(--aeris-radius-control, var(--aeris-radius-md, .5625rem)));background:var(--aeris-surface);box-shadow:var(--aeris-shadow-xs, 0 1px 2px rgba(0, 0, 0, .1));transition:border-color var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),box-shadow var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),background var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease)}.aeris-editor[data-fluid]{width:100%}.aeris-editor[data-size=sm]{--aeris-editor-padding: .75rem;--aeris-editor-font-size: var(--aeris-font-size-lg, .875rem)}.aeris-editor[data-size=lg]{--aeris-editor-padding: 1rem;--aeris-editor-font-size: var(--aeris-font-size-2xl, 1rem)}.aeris-editor[data-appearance=filled]{background:var(--aeris-surface-2)}.aeris-editor:focus-within{border-color:var(--aeris-control-focus-border, var(--aeris-focus));box-shadow:0 0 0 var(--aeris-focus-ring-width, 3px) var(--aeris-control-focus-ring-color, var(--aeris-focus-ring-color, transparent))}.aeris-editor[data-invalid]{border-color:var(--aeris-control-invalid-border, var(--aeris-danger))}.aeris-editor[data-invalid]:focus-within{box-shadow:0 0 0 var(--aeris-focus-ring-width, 3px) var(--aeris-control-invalid-focus-ring-color, transparent)}.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-item, var(--aeris-radius-sm, .4375rem));background:transparent;color:var(--aeris-text);font:inherit;font-size:var(--aeris-font-size-md, .8125rem);font-weight:var(--aeris-font-weight-bold, 700);cursor:pointer;transition:background var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),color var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),box-shadow var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease)}.aeris-editor__toolbar button[aria-pressed=true]{background:var(--aeris-primary-soft);color:var(--aeris-text)}@media(hover:hover){.aeris-editor__toolbar button:hover:not(:disabled){background:var(--aeris-primary-soft);color:var(--aeris-text)}}.aeris-editor__toolbar button:focus-visible{outline:var(--aeris-focus-ring-width, 3px) solid var(--aeris-focus);outline-offset:var(--aeris-focus-ring-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:var(--aeris-line-height-tight, 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:.75rem .875rem;border-radius:var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem));background:var(--aeris-surface-2);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:var(--aeris-font-weight-bold, 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}}@media(pointer:coarse){input:not([type=checkbox]):not([type=radio]),textarea{font-size:var(--aeris-mobile-input-font-size, 1rem)}}\n"]
1708
+ }]
1709
+ }],
1710
+ ctorParameters: () => [],
1711
+ propDecorators: {
1712
+ value: [{
1713
+ type: i0.Input,
1714
+ args: [{
1715
+ isSignal: true,
1716
+ alias: "value",
1717
+ required: false
1718
+ }]
1719
+ }, {
1720
+ type: i0.Output,
1721
+ args: ["valueChange"]
1722
+ }],
1723
+ inputId: [{
1724
+ type: i0.Input,
1725
+ args: [{
1726
+ isSignal: true,
1727
+ alias: "inputId",
1728
+ required: false
1729
+ }]
1730
+ }],
1731
+ name: [{
1732
+ type: i0.Input,
1733
+ args: [{
1734
+ isSignal: true,
1735
+ alias: "name",
1736
+ required: false
1737
+ }]
1738
+ }],
1739
+ placeholder: [{
1740
+ type: i0.Input,
1741
+ args: [{
1742
+ isSignal: true,
1743
+ alias: "placeholder",
1744
+ required: false
1745
+ }]
1746
+ }],
1747
+ ariaLabel: [{
1748
+ type: i0.Input,
1749
+ args: [{
1750
+ isSignal: true,
1751
+ alias: "ariaLabel",
1752
+ required: false
1753
+ }]
1754
+ }],
1755
+ ariaLabelledBy: [{
1756
+ type: i0.Input,
1757
+ args: [{
1758
+ isSignal: true,
1759
+ alias: "ariaLabelledBy",
1760
+ required: false
1761
+ }]
1762
+ }],
1763
+ ariaDescribedBy: [{
1764
+ type: i0.Input,
1765
+ args: [{
1766
+ isSignal: true,
1767
+ alias: "ariaDescribedBy",
1768
+ required: false
1769
+ }]
1770
+ }],
1771
+ toolbarAriaLabel: [{
1772
+ type: i0.Input,
1773
+ args: [{
1774
+ isSignal: true,
1775
+ alias: "toolbarAriaLabel",
1776
+ required: false
1777
+ }]
1778
+ }],
1779
+ size: [{
1780
+ type: i0.Input,
1781
+ args: [{
1782
+ isSignal: true,
1783
+ alias: "size",
1784
+ required: false
1785
+ }]
1786
+ }],
1787
+ appearance: [{
1788
+ type: i0.Input,
1789
+ args: [{
1790
+ isSignal: true,
1791
+ alias: "appearance",
1792
+ required: false
1793
+ }]
1794
+ }],
1795
+ minHeight: [{
1796
+ type: i0.Input,
1797
+ args: [{
1798
+ isSignal: true,
1799
+ alias: "minHeight",
1800
+ required: false
1801
+ }]
1802
+ }],
1803
+ formats: [{
1804
+ type: i0.Input,
1805
+ args: [{
1806
+ isSignal: true,
1807
+ alias: "formats",
1808
+ required: false
1809
+ }]
1810
+ }],
1811
+ namespace: [{
1812
+ type: i0.Input,
1813
+ args: [{
1814
+ isSignal: true,
1815
+ alias: "namespace",
1816
+ required: false
1817
+ }]
1818
+ }],
1819
+ lexicalTheme: [{
1820
+ type: i0.Input,
1821
+ args: [{
1822
+ isSignal: true,
1823
+ alias: "lexicalTheme",
1824
+ required: false
1825
+ }]
1826
+ }],
1827
+ htmlConfig: [{
1828
+ type: i0.Input,
1829
+ args: [{
1830
+ isSignal: true,
1831
+ alias: "htmlConfig",
1832
+ required: false
1833
+ }]
1834
+ }],
1835
+ extensions: [{
1836
+ type: i0.Input,
1837
+ args: [{
1838
+ isSignal: true,
1839
+ alias: "extensions",
1840
+ required: false
1841
+ }]
1842
+ }],
1843
+ disabled: [{
1844
+ type: i0.Input,
1845
+ args: [{
1846
+ isSignal: true,
1847
+ alias: "disabled",
1848
+ required: false
1849
+ }]
1850
+ }],
1851
+ readonly: [{
1852
+ type: i0.Input,
1853
+ args: [{
1854
+ isSignal: true,
1855
+ alias: "readonly",
1856
+ required: false
1857
+ }]
1858
+ }],
1859
+ required: [{
1860
+ type: i0.Input,
1861
+ args: [{
1862
+ isSignal: true,
1863
+ alias: "required",
1864
+ required: false
1865
+ }]
1866
+ }],
1867
+ invalid: [{
1868
+ type: i0.Input,
1869
+ args: [{
1870
+ isSignal: true,
1871
+ alias: "invalid",
1872
+ required: false
1873
+ }]
1874
+ }],
1875
+ touched: [{
1876
+ type: i0.Input,
1877
+ args: [{
1878
+ isSignal: true,
1879
+ alias: "touched",
1880
+ required: false
1881
+ }]
1882
+ }],
1883
+ fluid: [{
1884
+ type: i0.Input,
1885
+ args: [{
1886
+ isSignal: true,
1887
+ alias: "fluid",
1888
+ required: false
1889
+ }]
1890
+ }],
1891
+ showToolbar: [{
1892
+ type: i0.Input,
1893
+ args: [{
1894
+ isSignal: true,
1895
+ alias: "showToolbar",
1896
+ required: false
1897
+ }]
1898
+ }],
1899
+ changed: [{
1900
+ type: i0.Output,
1901
+ args: ["changed"]
1902
+ }],
1903
+ focused: [{
1904
+ type: i0.Output,
1905
+ args: ["focused"]
1906
+ }],
1907
+ blurred: [{
1908
+ type: i0.Output,
1909
+ args: ["blurred"]
1910
+ }],
1911
+ touch: [{
1912
+ type: i0.Output,
1913
+ args: ["touch"]
1914
+ }],
1915
+ ready: [{
1916
+ type: i0.Output,
1917
+ args: ["ready"]
1918
+ }],
1919
+ editorRoot: [{
1920
+ type: i0.ViewChild,
1921
+ args: ["editorRoot", { isSignal: true }]
1922
+ }]
1923
+ }
1924
+ });
1541
1925
  const AerisEditor = [AerisEditorComponent];
1542
-
1543
- /**
1544
- * Generated bundle index. Do not edit.
1545
- */
1546
-
1547
1926
  export { AERIS_EDITOR_ALL_FORMATS, AERIS_EDITOR_DEFAULT_FORMATS, AerisEditor, AerisEditorComponent };
1548
- //# sourceMappingURL=aeris-ui-core-editor.mjs.map
1927
+
1928
+ //# sourceMappingURL=aeris-ui-core-editor.mjs.map