@aeris-ui/core 22.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +189 -0
  3. package/fesm2022/aeris-ui-core-accordion.mjs +412 -0
  4. package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -0
  5. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +107 -0
  6. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -0
  7. package/fesm2022/aeris-ui-core-auto-complete.mjs +754 -0
  8. package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -0
  9. package/fesm2022/aeris-ui-core-auto-focus.mjs +63 -0
  10. package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -0
  11. package/fesm2022/aeris-ui-core-avatar.mjs +133 -0
  12. package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -0
  13. package/fesm2022/aeris-ui-core-badge.mjs +163 -0
  14. package/fesm2022/aeris-ui-core-badge.mjs.map +1 -0
  15. package/fesm2022/aeris-ui-core-block-ui.mjs +139 -0
  16. package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -0
  17. package/fesm2022/aeris-ui-core-breadcrumb.mjs +433 -0
  18. package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -0
  19. package/fesm2022/aeris-ui-core-button-group.mjs +39 -0
  20. package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -0
  21. package/fesm2022/aeris-ui-core-button.mjs +246 -0
  22. package/fesm2022/aeris-ui-core-button.mjs.map +1 -0
  23. package/fesm2022/aeris-ui-core-card.mjs +134 -0
  24. package/fesm2022/aeris-ui-core-card.mjs.map +1 -0
  25. package/fesm2022/aeris-ui-core-carousel.mjs +542 -0
  26. package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -0
  27. package/fesm2022/aeris-ui-core-cascade-select.mjs +673 -0
  28. package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -0
  29. package/fesm2022/aeris-ui-core-chart.mjs +296 -0
  30. package/fesm2022/aeris-ui-core-chart.mjs.map +1 -0
  31. package/fesm2022/aeris-ui-core-checkbox.mjs +220 -0
  32. package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -0
  33. package/fesm2022/aeris-ui-core-chip.mjs +200 -0
  34. package/fesm2022/aeris-ui-core-chip.mjs.map +1 -0
  35. package/fesm2022/aeris-ui-core-class-names.mjs +67 -0
  36. package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -0
  37. package/fesm2022/aeris-ui-core-color-picker.mjs +1192 -0
  38. package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -0
  39. package/fesm2022/aeris-ui-core-compare.mjs +508 -0
  40. package/fesm2022/aeris-ui-core-compare.mjs.map +1 -0
  41. package/fesm2022/aeris-ui-core-confirm-dialog.mjs +818 -0
  42. package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -0
  43. package/fesm2022/aeris-ui-core-confirm-popup.mjs +1010 -0
  44. package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -0
  45. package/fesm2022/aeris-ui-core-context-menu.mjs +720 -0
  46. package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -0
  47. package/fesm2022/aeris-ui-core-date-picker.mjs +1471 -0
  48. package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -0
  49. package/fesm2022/aeris-ui-core-dialog.mjs +574 -0
  50. package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -0
  51. package/fesm2022/aeris-ui-core-divider.mjs +51 -0
  52. package/fesm2022/aeris-ui-core-divider.mjs.map +1 -0
  53. package/fesm2022/aeris-ui-core-drawer.mjs +549 -0
  54. package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -0
  55. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +333 -0
  56. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -0
  57. package/fesm2022/aeris-ui-core-editor.mjs +1548 -0
  58. package/fesm2022/aeris-ui-core-editor.mjs.map +1 -0
  59. package/fesm2022/aeris-ui-core-file-upload.mjs +965 -0
  60. package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -0
  61. package/fesm2022/aeris-ui-core-filter-service.mjs +304 -0
  62. package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -0
  63. package/fesm2022/aeris-ui-core-fluid.mjs +23 -0
  64. package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -0
  65. package/fesm2022/aeris-ui-core-focus-trap.mjs +185 -0
  66. package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -0
  67. package/fesm2022/aeris-ui-core-galleria.mjs +1657 -0
  68. package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -0
  69. package/fesm2022/aeris-ui-core-glass.mjs +35 -0
  70. package/fesm2022/aeris-ui-core-glass.mjs.map +1 -0
  71. package/fesm2022/aeris-ui-core-icon-field.mjs +113 -0
  72. package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -0
  73. package/fesm2022/aeris-ui-core-inplace.mjs +243 -0
  74. package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -0
  75. package/fesm2022/aeris-ui-core-input-group.mjs +110 -0
  76. package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -0
  77. package/fesm2022/aeris-ui-core-input-mask.mjs +343 -0
  78. package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -0
  79. package/fesm2022/aeris-ui-core-input-number.mjs +497 -0
  80. package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -0
  81. package/fesm2022/aeris-ui-core-input-otp.mjs +361 -0
  82. package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -0
  83. package/fesm2022/aeris-ui-core-input-text.mjs +226 -0
  84. package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -0
  85. package/fesm2022/aeris-ui-core-key-filter.mjs +208 -0
  86. package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -0
  87. package/fesm2022/aeris-ui-core-mega-menu.mjs +835 -0
  88. package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -0
  89. package/fesm2022/aeris-ui-core-menu.mjs +796 -0
  90. package/fesm2022/aeris-ui-core-menu.mjs.map +1 -0
  91. package/fesm2022/aeris-ui-core-menubar.mjs +729 -0
  92. package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -0
  93. package/fesm2022/aeris-ui-core-message.mjs +225 -0
  94. package/fesm2022/aeris-ui-core-message.mjs.map +1 -0
  95. package/fesm2022/aeris-ui-core-meter-group.mjs +377 -0
  96. package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -0
  97. package/fesm2022/aeris-ui-core-multi-select.mjs +1033 -0
  98. package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -0
  99. package/fesm2022/aeris-ui-core-order-list.mjs +351 -0
  100. package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -0
  101. package/fesm2022/aeris-ui-core-organization-chart.mjs +382 -0
  102. package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -0
  103. package/fesm2022/aeris-ui-core-paginator.mjs +254 -0
  104. package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -0
  105. package/fesm2022/aeris-ui-core-panel.mjs +352 -0
  106. package/fesm2022/aeris-ui-core-panel.mjs.map +1 -0
  107. package/fesm2022/aeris-ui-core-password.mjs +479 -0
  108. package/fesm2022/aeris-ui-core-password.mjs.map +1 -0
  109. package/fesm2022/aeris-ui-core-pick-list.mjs +939 -0
  110. package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -0
  111. package/fesm2022/aeris-ui-core-popover.mjs +535 -0
  112. package/fesm2022/aeris-ui-core-popover.mjs.map +1 -0
  113. package/fesm2022/aeris-ui-core-progress-bar.mjs +260 -0
  114. package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -0
  115. package/fesm2022/aeris-ui-core-progress-spinner.mjs +218 -0
  116. package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -0
  117. package/fesm2022/aeris-ui-core-radio-button.mjs +194 -0
  118. package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -0
  119. package/fesm2022/aeris-ui-core-rating.mjs +385 -0
  120. package/fesm2022/aeris-ui-core-rating.mjs.map +1 -0
  121. package/fesm2022/aeris-ui-core-scroll-panel.mjs +211 -0
  122. package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -0
  123. package/fesm2022/aeris-ui-core-scroll-top.mjs +94 -0
  124. package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -0
  125. package/fesm2022/aeris-ui-core-select.mjs +1134 -0
  126. package/fesm2022/aeris-ui-core-select.mjs.map +1 -0
  127. package/fesm2022/aeris-ui-core-skeleton.mjs +47 -0
  128. package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -0
  129. package/fesm2022/aeris-ui-core-slider.mjs +724 -0
  130. package/fesm2022/aeris-ui-core-slider.mjs.map +1 -0
  131. package/fesm2022/aeris-ui-core-speed-dial.mjs +589 -0
  132. package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -0
  133. package/fesm2022/aeris-ui-core-split-button.mjs +532 -0
  134. package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -0
  135. package/fesm2022/aeris-ui-core-splitter.mjs +488 -0
  136. package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -0
  137. package/fesm2022/aeris-ui-core-stepper.mjs +437 -0
  138. package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -0
  139. package/fesm2022/aeris-ui-core-style-class.mjs +344 -0
  140. package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -0
  141. package/fesm2022/aeris-ui-core-table.mjs +1580 -0
  142. package/fesm2022/aeris-ui-core-table.mjs.map +1 -0
  143. package/fesm2022/aeris-ui-core-tabs.mjs +438 -0
  144. package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -0
  145. package/fesm2022/aeris-ui-core-textarea.mjs +349 -0
  146. package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -0
  147. package/fesm2022/aeris-ui-core-theme-builder.mjs +1565 -0
  148. package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -0
  149. package/fesm2022/aeris-ui-core-theming.mjs +150 -0
  150. package/fesm2022/aeris-ui-core-theming.mjs.map +1 -0
  151. package/fesm2022/aeris-ui-core-tiered-menu.mjs +718 -0
  152. package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -0
  153. package/fesm2022/aeris-ui-core-timeline.mjs +278 -0
  154. package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -0
  155. package/fesm2022/aeris-ui-core-toast.mjs +422 -0
  156. package/fesm2022/aeris-ui-core-toast.mjs.map +1 -0
  157. package/fesm2022/aeris-ui-core-toggle-switch.mjs +202 -0
  158. package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -0
  159. package/fesm2022/aeris-ui-core-toolbar.mjs +136 -0
  160. package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -0
  161. package/fesm2022/aeris-ui-core-tooltip.mjs +365 -0
  162. package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -0
  163. package/fesm2022/aeris-ui-core-tree-select.mjs +995 -0
  164. package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -0
  165. package/fesm2022/aeris-ui-core-tree-table.mjs +1600 -0
  166. package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -0
  167. package/fesm2022/aeris-ui-core-tree.mjs +962 -0
  168. package/fesm2022/aeris-ui-core-tree.mjs.map +1 -0
  169. package/fesm2022/aeris-ui-core.mjs +360 -0
  170. package/fesm2022/aeris-ui-core.mjs.map +1 -0
  171. package/package.json +432 -0
  172. package/schematics/aeris-setup.schema.json +52 -0
  173. package/schematics/collection.json +10 -0
  174. package/schematics/ng-add/schema.json +64 -0
  175. package/schematics/runtime/package.json +3 -0
  176. package/schematics/runtime/schematics/ng-add/index.js +13 -0
  177. package/schematics/runtime/schematics/ng-add/index.js.map +1 -0
  178. package/schematics/runtime/schematics/ng-add/options.js +338 -0
  179. package/schematics/runtime/schematics/ng-add/options.js.map +1 -0
  180. package/schematics/runtime/schematics/ng-add/schema.js +3 -0
  181. package/schematics/runtime/schematics/ng-add/schema.js.map +1 -0
  182. package/schematics/runtime/schematics/ng-add/workspace.js +273 -0
  183. package/schematics/runtime/schematics/ng-add/workspace.js.map +1 -0
  184. package/schematics/runtime/theme-builder/aeris-color-derivation.js +12 -0
  185. package/schematics/runtime/theme-builder/aeris-color-derivation.js.map +1 -0
  186. package/schematics/runtime/theme-builder/aeris-color.js +263 -0
  187. package/schematics/runtime/theme-builder/aeris-color.js.map +1 -0
  188. package/schematics/runtime/theme-builder/aeris-contrast.js +245 -0
  189. package/schematics/runtime/theme-builder/aeris-contrast.js.map +1 -0
  190. package/schematics/runtime/theme-builder/aeris-foundation.js +47 -0
  191. package/schematics/runtime/theme-builder/aeris-foundation.js.map +1 -0
  192. package/schematics/runtime/theme-builder/aeris-semantic-tones.js +121 -0
  193. package/schematics/runtime/theme-builder/aeris-semantic-tones.js.map +1 -0
  194. package/schematics/runtime/theme-builder/aeris-theme-generator.js +238 -0
  195. package/schematics/runtime/theme-builder/aeris-theme-generator.js.map +1 -0
  196. package/schematics/runtime/theme-builder/aeris-theme-resolver.js +101 -0
  197. package/schematics/runtime/theme-builder/aeris-theme-resolver.js.map +1 -0
  198. package/schematics/runtime/theme-builder/aeris-theme-tokens.js +82 -0
  199. package/schematics/runtime/theme-builder/aeris-theme-tokens.js.map +1 -0
  200. package/schematics/runtime/theme-builder/aeris-theme-validation.js +183 -0
  201. package/schematics/runtime/theme-builder/aeris-theme-validation.js.map +1 -0
  202. package/schematics/runtime/theme-builder/aeris-theme.js +322 -0
  203. package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -0
  204. package/schematics/runtime/theme-builder/public-api.js +17 -0
  205. package/schematics/runtime/theme-builder/public-api.js.map +1 -0
  206. package/styles/_index.scss +1 -0
  207. package/styles/_tokens.scss +13 -0
  208. package/styles/aeris.css +555 -0
  209. package/styles/controls.css +169 -0
  210. package/tools/aeris-theme.mjs +149 -0
  211. package/tools/aeris-theme.schema.json +143 -0
  212. package/types/aeris-ui-core-accordion.d.ts +101 -0
  213. package/types/aeris-ui-core-animate-on-scroll.d.ts +34 -0
  214. package/types/aeris-ui-core-auto-complete.d.ts +154 -0
  215. package/types/aeris-ui-core-auto-focus.d.ts +17 -0
  216. package/types/aeris-ui-core-avatar.d.ts +44 -0
  217. package/types/aeris-ui-core-badge.d.ts +48 -0
  218. package/types/aeris-ui-core-block-ui.d.ts +28 -0
  219. package/types/aeris-ui-core-breadcrumb.d.ts +104 -0
  220. package/types/aeris-ui-core-button-group.d.ts +17 -0
  221. package/types/aeris-ui-core-button.d.ts +71 -0
  222. package/types/aeris-ui-core-card.d.ts +43 -0
  223. package/types/aeris-ui-core-carousel.d.ts +126 -0
  224. package/types/aeris-ui-core-cascade-select.d.ts +130 -0
  225. package/types/aeris-ui-core-chart.d.ts +92 -0
  226. package/types/aeris-ui-core-checkbox.d.ts +55 -0
  227. package/types/aeris-ui-core-chip.d.ts +56 -0
  228. package/types/aeris-ui-core-class-names.d.ts +21 -0
  229. package/types/aeris-ui-core-color-picker.d.ts +149 -0
  230. package/types/aeris-ui-core-compare.d.ts +109 -0
  231. package/types/aeris-ui-core-confirm-dialog.d.ts +263 -0
  232. package/types/aeris-ui-core-confirm-popup.d.ts +281 -0
  233. package/types/aeris-ui-core-context-menu.d.ts +156 -0
  234. package/types/aeris-ui-core-date-picker.d.ts +226 -0
  235. package/types/aeris-ui-core-dialog.d.ts +124 -0
  236. package/types/aeris-ui-core-divider.d.ts +21 -0
  237. package/types/aeris-ui-core-drawer.d.ts +119 -0
  238. package/types/aeris-ui-core-dynamic-dialog.d.ts +148 -0
  239. package/types/aeris-ui-core-editor.d.ts +130 -0
  240. package/types/aeris-ui-core-file-upload.d.ts +199 -0
  241. package/types/aeris-ui-core-filter-service.d.ts +54 -0
  242. package/types/aeris-ui-core-fluid.d.ts +10 -0
  243. package/types/aeris-ui-core-focus-trap.d.ts +32 -0
  244. package/types/aeris-ui-core-galleria.d.ts +273 -0
  245. package/types/aeris-ui-core-glass.d.ts +17 -0
  246. package/types/aeris-ui-core-icon-field.d.ts +36 -0
  247. package/types/aeris-ui-core-inplace.d.ts +68 -0
  248. package/types/aeris-ui-core-input-group.d.ts +38 -0
  249. package/types/aeris-ui-core-input-mask.d.ts +73 -0
  250. package/types/aeris-ui-core-input-number.d.ts +87 -0
  251. package/types/aeris-ui-core-input-otp.d.ts +88 -0
  252. package/types/aeris-ui-core-input-text.d.ts +63 -0
  253. package/types/aeris-ui-core-key-filter.d.ts +41 -0
  254. package/types/aeris-ui-core-mega-menu.d.ts +130 -0
  255. package/types/aeris-ui-core-menu.d.ts +182 -0
  256. package/types/aeris-ui-core-menubar.d.ts +145 -0
  257. package/types/aeris-ui-core-message.d.ts +65 -0
  258. package/types/aeris-ui-core-meter-group.d.ts +100 -0
  259. package/types/aeris-ui-core-multi-select.d.ts +193 -0
  260. package/types/aeris-ui-core-order-list.d.ts +73 -0
  261. package/types/aeris-ui-core-organization-chart.d.ts +85 -0
  262. package/types/aeris-ui-core-paginator.d.ts +39 -0
  263. package/types/aeris-ui-core-panel.d.ts +85 -0
  264. package/types/aeris-ui-core-password.d.ts +110 -0
  265. package/types/aeris-ui-core-pick-list.d.ts +193 -0
  266. package/types/aeris-ui-core-popover.d.ts +112 -0
  267. package/types/aeris-ui-core-progress-bar.d.ts +81 -0
  268. package/types/aeris-ui-core-progress-spinner.d.ts +51 -0
  269. package/types/aeris-ui-core-radio-button.d.ts +51 -0
  270. package/types/aeris-ui-core-rating.d.ts +80 -0
  271. package/types/aeris-ui-core-scroll-panel.d.ts +66 -0
  272. package/types/aeris-ui-core-scroll-top.d.ts +29 -0
  273. package/types/aeris-ui-core-select.d.ts +223 -0
  274. package/types/aeris-ui-core-skeleton.d.ts +18 -0
  275. package/types/aeris-ui-core-slider.d.ts +117 -0
  276. package/types/aeris-ui-core-speed-dial.d.ts +119 -0
  277. package/types/aeris-ui-core-split-button.d.ts +122 -0
  278. package/types/aeris-ui-core-splitter.d.ts +113 -0
  279. package/types/aeris-ui-core-stepper.d.ts +99 -0
  280. package/types/aeris-ui-core-style-class.d.ts +73 -0
  281. package/types/aeris-ui-core-table.d.ts +333 -0
  282. package/types/aeris-ui-core-tabs.d.ts +82 -0
  283. package/types/aeris-ui-core-textarea.d.ts +80 -0
  284. package/types/aeris-ui-core-theme-builder.d.ts +499 -0
  285. package/types/aeris-ui-core-theming.d.ts +47 -0
  286. package/types/aeris-ui-core-tiered-menu.d.ts +152 -0
  287. package/types/aeris-ui-core-timeline.d.ts +80 -0
  288. package/types/aeris-ui-core-toast.d.ts +127 -0
  289. package/types/aeris-ui-core-toggle-switch.d.ts +52 -0
  290. package/types/aeris-ui-core-toolbar.d.ts +47 -0
  291. package/types/aeris-ui-core-tooltip.d.ts +92 -0
  292. package/types/aeris-ui-core-tree-select.d.ts +187 -0
  293. package/types/aeris-ui-core-tree-table.d.ts +311 -0
  294. package/types/aeris-ui-core-tree.d.ts +179 -0
  295. package/types/aeris-ui-core.d.ts +85 -0
@@ -0,0 +1,1548 @@
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
+
13
+ const AERIS_EDITOR_DEFAULT_FORMATS = [
14
+ 'undo',
15
+ 'redo',
16
+ 'bold',
17
+ 'italic',
18
+ 'underline',
19
+ 'heading',
20
+ 'quote',
21
+ 'bulletList',
22
+ 'numberedList',
23
+ ];
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',
58
+ ];
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: `
554
+ <div
555
+ class="aeris-editor"
556
+ [attr.data-size]="size()"
557
+ [attr.data-appearance]="appearance()"
558
+ [attr.data-invalid]="invalid() || null"
559
+ [attr.data-disabled]="effectiveDisabled() || null"
560
+ [attr.data-readonly]="readonly() || null"
561
+ [attr.data-fluid]="fluid() || null"
562
+ (focusout)="handleFocusOut($event)"
563
+ >
564
+ @if (showToolbar()) {
565
+ <div class="aeris-editor__toolbar" role="toolbar" [attr.aria-label]="toolbarAriaLabel()">
566
+ @if (availableFormats().has('undo')) {
567
+ <button type="button" aria-label="Undo" [disabled]="toolbarDisabled()" (click)="undo()">
568
+ <svg aria-hidden="true" viewBox="0 0 24 24">
569
+ <path d="M9 8H4V3" />
570
+ <path d="M4 8c2.1-2.7 5-4 8.1-4A8 8 0 1 1 6 17.1" />
571
+ </svg>
572
+ </button>
573
+ }
574
+ @if (availableFormats().has('redo')) {
575
+ <button type="button" aria-label="Redo" [disabled]="toolbarDisabled()" (click)="redo()">
576
+ <svg aria-hidden="true" viewBox="0 0 24 24">
577
+ <path d="M15 8h5V3" />
578
+ <path d="M20 8c-2.1-2.7-5-4-8.1-4A8 8 0 1 0 18 17.1" />
579
+ </svg>
580
+ </button>
581
+ }
582
+
583
+ @if (hasInlineActions()) {
584
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
585
+ }
586
+ @if (availableFormats().has('bold')) {
587
+ <button
588
+ type="button"
589
+ aria-label="Bold"
590
+ [attr.aria-pressed]="activeBold()"
591
+ [disabled]="toolbarDisabled()"
592
+ (click)="format('bold')"
593
+ >
594
+ <strong>B</strong>
595
+ </button>
596
+ }
597
+ @if (availableFormats().has('italic')) {
598
+ <button
599
+ type="button"
600
+ aria-label="Italic"
601
+ [attr.aria-pressed]="activeItalic()"
602
+ [disabled]="toolbarDisabled()"
603
+ (click)="format('italic')"
604
+ >
605
+ <em>I</em>
606
+ </button>
607
+ }
608
+ @if (availableFormats().has('underline')) {
609
+ <button
610
+ type="button"
611
+ aria-label="Underline"
612
+ [attr.aria-pressed]="activeUnderline()"
613
+ [disabled]="toolbarDisabled()"
614
+ (click)="format('underline')"
615
+ >
616
+ <span class="aeris-editor__underline">U</span>
617
+ </button>
618
+ }
619
+ @if (availableFormats().has('strikethrough')) {
620
+ <button
621
+ type="button"
622
+ aria-label="Strikethrough"
623
+ [attr.aria-pressed]="activeStrikethrough()"
624
+ [disabled]="toolbarDisabled()"
625
+ (click)="format('strikethrough')"
626
+ >
627
+ <span class="aeris-editor__strikethrough">S</span>
628
+ </button>
629
+ }
630
+ @if (availableFormats().has('code')) {
631
+ <button
632
+ type="button"
633
+ aria-label="Inline code"
634
+ [attr.aria-pressed]="activeCode()"
635
+ [disabled]="toolbarDisabled()"
636
+ (click)="format('code')"
637
+ >
638
+ <span aria-hidden="true">&lt;/&gt;</span>
639
+ </button>
640
+ }
641
+ @if (availableFormats().has('highlight')) {
642
+ <button
643
+ type="button"
644
+ aria-label="Highlight"
645
+ [attr.aria-pressed]="activeHighlight()"
646
+ [disabled]="toolbarDisabled()"
647
+ (click)="format('highlight')"
648
+ >
649
+ <svg aria-hidden="true" viewBox="0 0 24 24">
650
+ <path d="m9 11 4 4" />
651
+ <path d="m14.5 4.5 5 5L10 19H5v-5Z" />
652
+ <path d="M4 21h16" />
653
+ </svg>
654
+ </button>
655
+ }
656
+ @if (availableFormats().has('subscript')) {
657
+ <button
658
+ type="button"
659
+ aria-label="Subscript"
660
+ [attr.aria-pressed]="activeSubscript()"
661
+ [disabled]="toolbarDisabled()"
662
+ (click)="format('subscript')"
663
+ >
664
+ <span aria-hidden="true">X<sub>2</sub></span>
665
+ </button>
666
+ }
667
+ @if (availableFormats().has('superscript')) {
668
+ <button
669
+ type="button"
670
+ aria-label="Superscript"
671
+ [attr.aria-pressed]="activeSuperscript()"
672
+ [disabled]="toolbarDisabled()"
673
+ (click)="format('superscript')"
674
+ >
675
+ <span aria-hidden="true">X<sup>2</sup></span>
676
+ </button>
677
+ }
678
+ @if (availableFormats().has('lowercase')) {
679
+ <button
680
+ type="button"
681
+ aria-label="Lowercase"
682
+ [attr.aria-pressed]="activeLowercase()"
683
+ [disabled]="toolbarDisabled()"
684
+ (click)="format('lowercase')"
685
+ >
686
+ aa
687
+ </button>
688
+ }
689
+ @if (availableFormats().has('uppercase')) {
690
+ <button
691
+ type="button"
692
+ aria-label="Uppercase"
693
+ [attr.aria-pressed]="activeUppercase()"
694
+ [disabled]="toolbarDisabled()"
695
+ (click)="format('uppercase')"
696
+ >
697
+ AA
698
+ </button>
699
+ }
700
+ @if (availableFormats().has('capitalize')) {
701
+ <button
702
+ type="button"
703
+ aria-label="Capitalize"
704
+ [attr.aria-pressed]="activeCapitalize()"
705
+ [disabled]="toolbarDisabled()"
706
+ (click)="format('capitalize')"
707
+ >
708
+ Aa
709
+ </button>
710
+ }
711
+
712
+ @if (hasBlockActions()) {
713
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
714
+ }
715
+ @if (availableFormats().has('paragraph')) {
716
+ <button
717
+ type="button"
718
+ aria-label="Paragraph"
719
+ [attr.aria-pressed]="activeBlock() === 'paragraph'"
720
+ [disabled]="toolbarDisabled()"
721
+ (click)="setBlock('paragraph')"
722
+ >
723
+ P
724
+ </button>
725
+ }
726
+ @if (availableFormats().has('heading1')) {
727
+ <button
728
+ type="button"
729
+ aria-label="Heading 1"
730
+ [attr.aria-pressed]="activeBlock() === 'h1'"
731
+ [disabled]="toolbarDisabled()"
732
+ (click)="setBlock('h1')"
733
+ >
734
+ H1
735
+ </button>
736
+ }
737
+ @if (availableFormats().has('heading')) {
738
+ <button
739
+ type="button"
740
+ aria-label="Heading"
741
+ [attr.aria-pressed]="activeBlock() === 'h2'"
742
+ [disabled]="toolbarDisabled()"
743
+ (click)="setBlock('heading')"
744
+ >
745
+ H2
746
+ </button>
747
+ }
748
+ @if (availableFormats().has('heading2')) {
749
+ <button
750
+ type="button"
751
+ aria-label="Heading 2"
752
+ [attr.aria-pressed]="activeBlock() === 'h2'"
753
+ [disabled]="toolbarDisabled()"
754
+ (click)="setBlock('h2')"
755
+ >
756
+ H2
757
+ </button>
758
+ }
759
+ @if (availableFormats().has('heading3')) {
760
+ <button
761
+ type="button"
762
+ aria-label="Heading 3"
763
+ [attr.aria-pressed]="activeBlock() === 'h3'"
764
+ [disabled]="toolbarDisabled()"
765
+ (click)="setBlock('h3')"
766
+ >
767
+ H3
768
+ </button>
769
+ }
770
+ @if (availableFormats().has('heading4')) {
771
+ <button
772
+ type="button"
773
+ aria-label="Heading 4"
774
+ [attr.aria-pressed]="activeBlock() === 'h4'"
775
+ [disabled]="toolbarDisabled()"
776
+ (click)="setBlock('h4')"
777
+ >
778
+ H4
779
+ </button>
780
+ }
781
+ @if (availableFormats().has('heading5')) {
782
+ <button
783
+ type="button"
784
+ aria-label="Heading 5"
785
+ [attr.aria-pressed]="activeBlock() === 'h5'"
786
+ [disabled]="toolbarDisabled()"
787
+ (click)="setBlock('h5')"
788
+ >
789
+ H5
790
+ </button>
791
+ }
792
+ @if (availableFormats().has('heading6')) {
793
+ <button
794
+ type="button"
795
+ aria-label="Heading 6"
796
+ [attr.aria-pressed]="activeBlock() === 'h6'"
797
+ [disabled]="toolbarDisabled()"
798
+ (click)="setBlock('h6')"
799
+ >
800
+ H6
801
+ </button>
802
+ }
803
+ @if (availableFormats().has('quote')) {
804
+ <button
805
+ type="button"
806
+ aria-label="Quote"
807
+ [attr.aria-pressed]="activeBlock() === 'quote'"
808
+ [disabled]="toolbarDisabled()"
809
+ (click)="setBlock('quote')"
810
+ >
811
+ <svg aria-hidden="true" viewBox="0 0 24 24">
812
+ <path
813
+ d="M8 6H5.8C4.8 7.7 4.3 9.3 4.3 11c0 2.1 1.1 3.6 3 3.6 1.5 0 2.7-1.1 2.7-2.7 0-1.4-1-2.5-2.4-2.7.1-.9.5-1.9 1.1-3.2Z"
814
+ />
815
+ <path
816
+ d="M18 6h-2.2c-1 1.7-1.5 3.3-1.5 5 0 2.1 1.1 3.6 3 3.6 1.5 0 2.7-1.1 2.7-2.7 0-1.4-1-2.5-2.4-2.7.1-.9.5-1.9 1.1-3.2Z"
817
+ />
818
+ </svg>
819
+ </button>
820
+ }
821
+
822
+ @if (hasListActions()) {
823
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
824
+ }
825
+ @if (availableFormats().has('bulletList')) {
826
+ <button
827
+ type="button"
828
+ aria-label="Bulleted list"
829
+ [attr.aria-pressed]="activeList() === 'bullet'"
830
+ [disabled]="toolbarDisabled()"
831
+ (click)="toggleBulletList()"
832
+ >
833
+ <svg aria-hidden="true" viewBox="0 0 24 24">
834
+ <path d="M8 6h12" />
835
+ <path d="M8 12h12" />
836
+ <path d="M8 18h12" />
837
+ <circle cx="4" cy="6" r="1" />
838
+ <circle cx="4" cy="12" r="1" />
839
+ <circle cx="4" cy="18" r="1" />
840
+ </svg>
841
+ </button>
842
+ }
843
+ @if (availableFormats().has('numberedList')) {
844
+ <button
845
+ type="button"
846
+ aria-label="Numbered list"
847
+ [attr.aria-pressed]="activeList() === 'number'"
848
+ [disabled]="toolbarDisabled()"
849
+ (click)="toggleNumberedList()"
850
+ >
851
+ <svg aria-hidden="true" viewBox="0 0 24 24">
852
+ <path d="M10 6h10" />
853
+ <path d="M10 12h10" />
854
+ <path d="M10 18h10" />
855
+ <path d="M4 5h1v3" />
856
+ <path d="M3.7 8h2.6" />
857
+ <path
858
+ d="M3.6 11.4c.3-.4.8-.6 1.4-.6.8 0 1.4.5 1.4 1.2 0 .5-.3.9-.8 1.2L4 14.5h2.5"
859
+ />
860
+ <path
861
+ d="M3.7 17h2.1l-1 1h.3c.8 0 1.4.4 1.4 1.1 0 .7-.6 1.2-1.5 1.2-.6 0-1.1-.2-1.5-.6"
862
+ />
863
+ </svg>
864
+ </button>
865
+ }
866
+ @if (availableFormats().has('checkList')) {
867
+ <button
868
+ type="button"
869
+ aria-label="Checklist"
870
+ [attr.aria-pressed]="activeList() === 'check'"
871
+ [disabled]="toolbarDisabled()"
872
+ (click)="toggleCheckList()"
873
+ >
874
+ <svg aria-hidden="true" viewBox="0 0 24 24">
875
+ <rect x="3" y="4" width="5" height="5" rx="1" />
876
+ <path d="m4.5 6.5 1.2 1.2L8.3 5" />
877
+ <path d="M11 6.5h10" />
878
+ <rect x="3" y="15" width="5" height="5" rx="1" />
879
+ <path d="M11 17.5h10" />
880
+ </svg>
881
+ </button>
882
+ }
883
+
884
+ @if (hasAlignmentActions()) {
885
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
886
+ }
887
+ @if (availableFormats().has('alignLeft')) {
888
+ <button
889
+ type="button"
890
+ aria-label="Align left"
891
+ [attr.aria-pressed]="activeAlignment() === 'left'"
892
+ [disabled]="toolbarDisabled()"
893
+ (click)="align('left')"
894
+ >
895
+ <svg aria-hidden="true" viewBox="0 0 24 24">
896
+ <path d="M4 6h16M4 10h11M4 14h16M4 18h11" />
897
+ </svg>
898
+ </button>
899
+ }
900
+ @if (availableFormats().has('alignStart')) {
901
+ <button
902
+ type="button"
903
+ aria-label="Align start"
904
+ [attr.aria-pressed]="activeAlignment() === 'start'"
905
+ [disabled]="toolbarDisabled()"
906
+ (click)="align('start')"
907
+ >
908
+ <svg class="aeris-editor__logical-icon" aria-hidden="true" viewBox="0 0 24 24">
909
+ <path d="M4 6h16M4 10h11M4 14h16M4 18h11" />
910
+ </svg>
911
+ </button>
912
+ }
913
+ @if (availableFormats().has('alignCenter')) {
914
+ <button
915
+ type="button"
916
+ aria-label="Align center"
917
+ [attr.aria-pressed]="activeAlignment() === 'center'"
918
+ [disabled]="toolbarDisabled()"
919
+ (click)="align('center')"
920
+ >
921
+ <svg aria-hidden="true" viewBox="0 0 24 24">
922
+ <path d="M4 6h16M6.5 10h11M4 14h16M6.5 18h11" />
923
+ </svg>
924
+ </button>
925
+ }
926
+ @if (availableFormats().has('alignRight')) {
927
+ <button
928
+ type="button"
929
+ aria-label="Align right"
930
+ [attr.aria-pressed]="activeAlignment() === 'right'"
931
+ [disabled]="toolbarDisabled()"
932
+ (click)="align('right')"
933
+ >
934
+ <svg aria-hidden="true" viewBox="0 0 24 24">
935
+ <path d="M4 6h16M9 10h11M4 14h16M9 18h11" />
936
+ </svg>
937
+ </button>
938
+ }
939
+ @if (availableFormats().has('alignEnd')) {
940
+ <button
941
+ type="button"
942
+ aria-label="Align end"
943
+ [attr.aria-pressed]="activeAlignment() === 'end'"
944
+ [disabled]="toolbarDisabled()"
945
+ (click)="align('end')"
946
+ >
947
+ <svg class="aeris-editor__logical-icon" aria-hidden="true" viewBox="0 0 24 24">
948
+ <path d="M4 6h16M9 10h11M4 14h16M9 18h11" />
949
+ </svg>
950
+ </button>
951
+ }
952
+ @if (availableFormats().has('alignJustify')) {
953
+ <button
954
+ type="button"
955
+ aria-label="Justify"
956
+ [attr.aria-pressed]="activeAlignment() === 'justify'"
957
+ [disabled]="toolbarDisabled()"
958
+ (click)="align('justify')"
959
+ >
960
+ <svg aria-hidden="true" viewBox="0 0 24 24">
961
+ <path d="M4 6h16M4 10h16M4 14h16M4 18h16" />
962
+ </svg>
963
+ </button>
964
+ }
965
+
966
+ @if (hasDocumentActions()) {
967
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
968
+ }
969
+ @if (availableFormats().has('outdent')) {
970
+ <button
971
+ type="button"
972
+ aria-label="Decrease indent"
973
+ [disabled]="toolbarDisabled()"
974
+ (click)="outdent()"
975
+ >
976
+ <svg aria-hidden="true" viewBox="0 0 24 24">
977
+ <path d="M11 6h9M11 10h9M11 14h9M11 18h9" />
978
+ <path d="m8 9-4 3 4 3" />
979
+ </svg>
980
+ </button>
981
+ }
982
+ @if (availableFormats().has('indent')) {
983
+ <button
984
+ type="button"
985
+ aria-label="Increase indent"
986
+ [disabled]="toolbarDisabled()"
987
+ (click)="indent()"
988
+ >
989
+ <svg aria-hidden="true" viewBox="0 0 24 24">
990
+ <path d="M11 6h9M11 10h9M11 14h9M11 18h9" />
991
+ <path d="m4 9 4 3-4 3" />
992
+ </svg>
993
+ </button>
994
+ }
995
+ @if (availableFormats().has('clear')) {
996
+ <button
997
+ type="button"
998
+ aria-label="Clear formatting"
999
+ [disabled]="toolbarDisabled()"
1000
+ (click)="clearFormatting()"
1001
+ >
1002
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1003
+ <path d="m4 20 16-16" />
1004
+ <path d="M6.5 4h9l-1.5 5" />
1005
+ <path d="m9.5 15-.5 2H5" />
1006
+ </svg>
1007
+ </button>
1008
+ }
1009
+ </div>
1010
+ }
1011
+
1012
+ <div class="aeris-editor__content-shell" [style.min-height]="minHeight()">
1013
+ <div
1014
+ #editorRoot
1015
+ class="aeris-editor__content"
1016
+ role="textbox"
1017
+ aria-multiline="true"
1018
+ [id]="resolvedInputId()"
1019
+ [attr.contenteditable]="editable()"
1020
+ [attr.aria-label]="ariaLabel() || null"
1021
+ [attr.aria-labelledby]="ariaLabelledby() || null"
1022
+ [attr.aria-describedby]="ariaDescribedby() || null"
1023
+ [attr.aria-invalid]="invalid() || null"
1024
+ [attr.aria-required]="required() || null"
1025
+ [attr.aria-placeholder]="placeholder() || null"
1026
+ [attr.tabindex]="effectiveDisabled() ? -1 : 0"
1027
+ (focus)="handleFocus($event)"
1028
+ (blur)="handleBlur($event)"
1029
+ ></div>
1030
+
1031
+ @if (placeholderVisible()) {
1032
+ <span class="aeris-editor__placeholder">{{ placeholder() }}</span>
1033
+ }
1034
+ </div>
1035
+
1036
+ @if (name()) {
1037
+ <input type="hidden" [name]="name()" [value]="value()" />
1038
+ }
1039
+ </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: `
1045
+ <div
1046
+ class="aeris-editor"
1047
+ [attr.data-size]="size()"
1048
+ [attr.data-appearance]="appearance()"
1049
+ [attr.data-invalid]="invalid() || null"
1050
+ [attr.data-disabled]="effectiveDisabled() || null"
1051
+ [attr.data-readonly]="readonly() || null"
1052
+ [attr.data-fluid]="fluid() || null"
1053
+ (focusout)="handleFocusOut($event)"
1054
+ >
1055
+ @if (showToolbar()) {
1056
+ <div class="aeris-editor__toolbar" role="toolbar" [attr.aria-label]="toolbarAriaLabel()">
1057
+ @if (availableFormats().has('undo')) {
1058
+ <button type="button" aria-label="Undo" [disabled]="toolbarDisabled()" (click)="undo()">
1059
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1060
+ <path d="M9 8H4V3" />
1061
+ <path d="M4 8c2.1-2.7 5-4 8.1-4A8 8 0 1 1 6 17.1" />
1062
+ </svg>
1063
+ </button>
1064
+ }
1065
+ @if (availableFormats().has('redo')) {
1066
+ <button type="button" aria-label="Redo" [disabled]="toolbarDisabled()" (click)="redo()">
1067
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1068
+ <path d="M15 8h5V3" />
1069
+ <path d="M20 8c-2.1-2.7-5-4-8.1-4A8 8 0 1 0 18 17.1" />
1070
+ </svg>
1071
+ </button>
1072
+ }
1073
+
1074
+ @if (hasInlineActions()) {
1075
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
1076
+ }
1077
+ @if (availableFormats().has('bold')) {
1078
+ <button
1079
+ type="button"
1080
+ aria-label="Bold"
1081
+ [attr.aria-pressed]="activeBold()"
1082
+ [disabled]="toolbarDisabled()"
1083
+ (click)="format('bold')"
1084
+ >
1085
+ <strong>B</strong>
1086
+ </button>
1087
+ }
1088
+ @if (availableFormats().has('italic')) {
1089
+ <button
1090
+ type="button"
1091
+ aria-label="Italic"
1092
+ [attr.aria-pressed]="activeItalic()"
1093
+ [disabled]="toolbarDisabled()"
1094
+ (click)="format('italic')"
1095
+ >
1096
+ <em>I</em>
1097
+ </button>
1098
+ }
1099
+ @if (availableFormats().has('underline')) {
1100
+ <button
1101
+ type="button"
1102
+ aria-label="Underline"
1103
+ [attr.aria-pressed]="activeUnderline()"
1104
+ [disabled]="toolbarDisabled()"
1105
+ (click)="format('underline')"
1106
+ >
1107
+ <span class="aeris-editor__underline">U</span>
1108
+ </button>
1109
+ }
1110
+ @if (availableFormats().has('strikethrough')) {
1111
+ <button
1112
+ type="button"
1113
+ aria-label="Strikethrough"
1114
+ [attr.aria-pressed]="activeStrikethrough()"
1115
+ [disabled]="toolbarDisabled()"
1116
+ (click)="format('strikethrough')"
1117
+ >
1118
+ <span class="aeris-editor__strikethrough">S</span>
1119
+ </button>
1120
+ }
1121
+ @if (availableFormats().has('code')) {
1122
+ <button
1123
+ type="button"
1124
+ aria-label="Inline code"
1125
+ [attr.aria-pressed]="activeCode()"
1126
+ [disabled]="toolbarDisabled()"
1127
+ (click)="format('code')"
1128
+ >
1129
+ <span aria-hidden="true">&lt;/&gt;</span>
1130
+ </button>
1131
+ }
1132
+ @if (availableFormats().has('highlight')) {
1133
+ <button
1134
+ type="button"
1135
+ aria-label="Highlight"
1136
+ [attr.aria-pressed]="activeHighlight()"
1137
+ [disabled]="toolbarDisabled()"
1138
+ (click)="format('highlight')"
1139
+ >
1140
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1141
+ <path d="m9 11 4 4" />
1142
+ <path d="m14.5 4.5 5 5L10 19H5v-5Z" />
1143
+ <path d="M4 21h16" />
1144
+ </svg>
1145
+ </button>
1146
+ }
1147
+ @if (availableFormats().has('subscript')) {
1148
+ <button
1149
+ type="button"
1150
+ aria-label="Subscript"
1151
+ [attr.aria-pressed]="activeSubscript()"
1152
+ [disabled]="toolbarDisabled()"
1153
+ (click)="format('subscript')"
1154
+ >
1155
+ <span aria-hidden="true">X<sub>2</sub></span>
1156
+ </button>
1157
+ }
1158
+ @if (availableFormats().has('superscript')) {
1159
+ <button
1160
+ type="button"
1161
+ aria-label="Superscript"
1162
+ [attr.aria-pressed]="activeSuperscript()"
1163
+ [disabled]="toolbarDisabled()"
1164
+ (click)="format('superscript')"
1165
+ >
1166
+ <span aria-hidden="true">X<sup>2</sup></span>
1167
+ </button>
1168
+ }
1169
+ @if (availableFormats().has('lowercase')) {
1170
+ <button
1171
+ type="button"
1172
+ aria-label="Lowercase"
1173
+ [attr.aria-pressed]="activeLowercase()"
1174
+ [disabled]="toolbarDisabled()"
1175
+ (click)="format('lowercase')"
1176
+ >
1177
+ aa
1178
+ </button>
1179
+ }
1180
+ @if (availableFormats().has('uppercase')) {
1181
+ <button
1182
+ type="button"
1183
+ aria-label="Uppercase"
1184
+ [attr.aria-pressed]="activeUppercase()"
1185
+ [disabled]="toolbarDisabled()"
1186
+ (click)="format('uppercase')"
1187
+ >
1188
+ AA
1189
+ </button>
1190
+ }
1191
+ @if (availableFormats().has('capitalize')) {
1192
+ <button
1193
+ type="button"
1194
+ aria-label="Capitalize"
1195
+ [attr.aria-pressed]="activeCapitalize()"
1196
+ [disabled]="toolbarDisabled()"
1197
+ (click)="format('capitalize')"
1198
+ >
1199
+ Aa
1200
+ </button>
1201
+ }
1202
+
1203
+ @if (hasBlockActions()) {
1204
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
1205
+ }
1206
+ @if (availableFormats().has('paragraph')) {
1207
+ <button
1208
+ type="button"
1209
+ aria-label="Paragraph"
1210
+ [attr.aria-pressed]="activeBlock() === 'paragraph'"
1211
+ [disabled]="toolbarDisabled()"
1212
+ (click)="setBlock('paragraph')"
1213
+ >
1214
+ P
1215
+ </button>
1216
+ }
1217
+ @if (availableFormats().has('heading1')) {
1218
+ <button
1219
+ type="button"
1220
+ aria-label="Heading 1"
1221
+ [attr.aria-pressed]="activeBlock() === 'h1'"
1222
+ [disabled]="toolbarDisabled()"
1223
+ (click)="setBlock('h1')"
1224
+ >
1225
+ H1
1226
+ </button>
1227
+ }
1228
+ @if (availableFormats().has('heading')) {
1229
+ <button
1230
+ type="button"
1231
+ aria-label="Heading"
1232
+ [attr.aria-pressed]="activeBlock() === 'h2'"
1233
+ [disabled]="toolbarDisabled()"
1234
+ (click)="setBlock('heading')"
1235
+ >
1236
+ H2
1237
+ </button>
1238
+ }
1239
+ @if (availableFormats().has('heading2')) {
1240
+ <button
1241
+ type="button"
1242
+ aria-label="Heading 2"
1243
+ [attr.aria-pressed]="activeBlock() === 'h2'"
1244
+ [disabled]="toolbarDisabled()"
1245
+ (click)="setBlock('h2')"
1246
+ >
1247
+ H2
1248
+ </button>
1249
+ }
1250
+ @if (availableFormats().has('heading3')) {
1251
+ <button
1252
+ type="button"
1253
+ aria-label="Heading 3"
1254
+ [attr.aria-pressed]="activeBlock() === 'h3'"
1255
+ [disabled]="toolbarDisabled()"
1256
+ (click)="setBlock('h3')"
1257
+ >
1258
+ H3
1259
+ </button>
1260
+ }
1261
+ @if (availableFormats().has('heading4')) {
1262
+ <button
1263
+ type="button"
1264
+ aria-label="Heading 4"
1265
+ [attr.aria-pressed]="activeBlock() === 'h4'"
1266
+ [disabled]="toolbarDisabled()"
1267
+ (click)="setBlock('h4')"
1268
+ >
1269
+ H4
1270
+ </button>
1271
+ }
1272
+ @if (availableFormats().has('heading5')) {
1273
+ <button
1274
+ type="button"
1275
+ aria-label="Heading 5"
1276
+ [attr.aria-pressed]="activeBlock() === 'h5'"
1277
+ [disabled]="toolbarDisabled()"
1278
+ (click)="setBlock('h5')"
1279
+ >
1280
+ H5
1281
+ </button>
1282
+ }
1283
+ @if (availableFormats().has('heading6')) {
1284
+ <button
1285
+ type="button"
1286
+ aria-label="Heading 6"
1287
+ [attr.aria-pressed]="activeBlock() === 'h6'"
1288
+ [disabled]="toolbarDisabled()"
1289
+ (click)="setBlock('h6')"
1290
+ >
1291
+ H6
1292
+ </button>
1293
+ }
1294
+ @if (availableFormats().has('quote')) {
1295
+ <button
1296
+ type="button"
1297
+ aria-label="Quote"
1298
+ [attr.aria-pressed]="activeBlock() === 'quote'"
1299
+ [disabled]="toolbarDisabled()"
1300
+ (click)="setBlock('quote')"
1301
+ >
1302
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1303
+ <path
1304
+ d="M8 6H5.8C4.8 7.7 4.3 9.3 4.3 11c0 2.1 1.1 3.6 3 3.6 1.5 0 2.7-1.1 2.7-2.7 0-1.4-1-2.5-2.4-2.7.1-.9.5-1.9 1.1-3.2Z"
1305
+ />
1306
+ <path
1307
+ d="M18 6h-2.2c-1 1.7-1.5 3.3-1.5 5 0 2.1 1.1 3.6 3 3.6 1.5 0 2.7-1.1 2.7-2.7 0-1.4-1-2.5-2.4-2.7.1-.9.5-1.9 1.1-3.2Z"
1308
+ />
1309
+ </svg>
1310
+ </button>
1311
+ }
1312
+
1313
+ @if (hasListActions()) {
1314
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
1315
+ }
1316
+ @if (availableFormats().has('bulletList')) {
1317
+ <button
1318
+ type="button"
1319
+ aria-label="Bulleted list"
1320
+ [attr.aria-pressed]="activeList() === 'bullet'"
1321
+ [disabled]="toolbarDisabled()"
1322
+ (click)="toggleBulletList()"
1323
+ >
1324
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1325
+ <path d="M8 6h12" />
1326
+ <path d="M8 12h12" />
1327
+ <path d="M8 18h12" />
1328
+ <circle cx="4" cy="6" r="1" />
1329
+ <circle cx="4" cy="12" r="1" />
1330
+ <circle cx="4" cy="18" r="1" />
1331
+ </svg>
1332
+ </button>
1333
+ }
1334
+ @if (availableFormats().has('numberedList')) {
1335
+ <button
1336
+ type="button"
1337
+ aria-label="Numbered list"
1338
+ [attr.aria-pressed]="activeList() === 'number'"
1339
+ [disabled]="toolbarDisabled()"
1340
+ (click)="toggleNumberedList()"
1341
+ >
1342
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1343
+ <path d="M10 6h10" />
1344
+ <path d="M10 12h10" />
1345
+ <path d="M10 18h10" />
1346
+ <path d="M4 5h1v3" />
1347
+ <path d="M3.7 8h2.6" />
1348
+ <path
1349
+ d="M3.6 11.4c.3-.4.8-.6 1.4-.6.8 0 1.4.5 1.4 1.2 0 .5-.3.9-.8 1.2L4 14.5h2.5"
1350
+ />
1351
+ <path
1352
+ d="M3.7 17h2.1l-1 1h.3c.8 0 1.4.4 1.4 1.1 0 .7-.6 1.2-1.5 1.2-.6 0-1.1-.2-1.5-.6"
1353
+ />
1354
+ </svg>
1355
+ </button>
1356
+ }
1357
+ @if (availableFormats().has('checkList')) {
1358
+ <button
1359
+ type="button"
1360
+ aria-label="Checklist"
1361
+ [attr.aria-pressed]="activeList() === 'check'"
1362
+ [disabled]="toolbarDisabled()"
1363
+ (click)="toggleCheckList()"
1364
+ >
1365
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1366
+ <rect x="3" y="4" width="5" height="5" rx="1" />
1367
+ <path d="m4.5 6.5 1.2 1.2L8.3 5" />
1368
+ <path d="M11 6.5h10" />
1369
+ <rect x="3" y="15" width="5" height="5" rx="1" />
1370
+ <path d="M11 17.5h10" />
1371
+ </svg>
1372
+ </button>
1373
+ }
1374
+
1375
+ @if (hasAlignmentActions()) {
1376
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
1377
+ }
1378
+ @if (availableFormats().has('alignLeft')) {
1379
+ <button
1380
+ type="button"
1381
+ aria-label="Align left"
1382
+ [attr.aria-pressed]="activeAlignment() === 'left'"
1383
+ [disabled]="toolbarDisabled()"
1384
+ (click)="align('left')"
1385
+ >
1386
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1387
+ <path d="M4 6h16M4 10h11M4 14h16M4 18h11" />
1388
+ </svg>
1389
+ </button>
1390
+ }
1391
+ @if (availableFormats().has('alignStart')) {
1392
+ <button
1393
+ type="button"
1394
+ aria-label="Align start"
1395
+ [attr.aria-pressed]="activeAlignment() === 'start'"
1396
+ [disabled]="toolbarDisabled()"
1397
+ (click)="align('start')"
1398
+ >
1399
+ <svg class="aeris-editor__logical-icon" aria-hidden="true" viewBox="0 0 24 24">
1400
+ <path d="M4 6h16M4 10h11M4 14h16M4 18h11" />
1401
+ </svg>
1402
+ </button>
1403
+ }
1404
+ @if (availableFormats().has('alignCenter')) {
1405
+ <button
1406
+ type="button"
1407
+ aria-label="Align center"
1408
+ [attr.aria-pressed]="activeAlignment() === 'center'"
1409
+ [disabled]="toolbarDisabled()"
1410
+ (click)="align('center')"
1411
+ >
1412
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1413
+ <path d="M4 6h16M6.5 10h11M4 14h16M6.5 18h11" />
1414
+ </svg>
1415
+ </button>
1416
+ }
1417
+ @if (availableFormats().has('alignRight')) {
1418
+ <button
1419
+ type="button"
1420
+ aria-label="Align right"
1421
+ [attr.aria-pressed]="activeAlignment() === 'right'"
1422
+ [disabled]="toolbarDisabled()"
1423
+ (click)="align('right')"
1424
+ >
1425
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1426
+ <path d="M4 6h16M9 10h11M4 14h16M9 18h11" />
1427
+ </svg>
1428
+ </button>
1429
+ }
1430
+ @if (availableFormats().has('alignEnd')) {
1431
+ <button
1432
+ type="button"
1433
+ aria-label="Align end"
1434
+ [attr.aria-pressed]="activeAlignment() === 'end'"
1435
+ [disabled]="toolbarDisabled()"
1436
+ (click)="align('end')"
1437
+ >
1438
+ <svg class="aeris-editor__logical-icon" aria-hidden="true" viewBox="0 0 24 24">
1439
+ <path d="M4 6h16M9 10h11M4 14h16M9 18h11" />
1440
+ </svg>
1441
+ </button>
1442
+ }
1443
+ @if (availableFormats().has('alignJustify')) {
1444
+ <button
1445
+ type="button"
1446
+ aria-label="Justify"
1447
+ [attr.aria-pressed]="activeAlignment() === 'justify'"
1448
+ [disabled]="toolbarDisabled()"
1449
+ (click)="align('justify')"
1450
+ >
1451
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1452
+ <path d="M4 6h16M4 10h16M4 14h16M4 18h16" />
1453
+ </svg>
1454
+ </button>
1455
+ }
1456
+
1457
+ @if (hasDocumentActions()) {
1458
+ <span class="aeris-editor__separator" aria-hidden="true"></span>
1459
+ }
1460
+ @if (availableFormats().has('outdent')) {
1461
+ <button
1462
+ type="button"
1463
+ aria-label="Decrease indent"
1464
+ [disabled]="toolbarDisabled()"
1465
+ (click)="outdent()"
1466
+ >
1467
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1468
+ <path d="M11 6h9M11 10h9M11 14h9M11 18h9" />
1469
+ <path d="m8 9-4 3 4 3" />
1470
+ </svg>
1471
+ </button>
1472
+ }
1473
+ @if (availableFormats().has('indent')) {
1474
+ <button
1475
+ type="button"
1476
+ aria-label="Increase indent"
1477
+ [disabled]="toolbarDisabled()"
1478
+ (click)="indent()"
1479
+ >
1480
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1481
+ <path d="M11 6h9M11 10h9M11 14h9M11 18h9" />
1482
+ <path d="m4 9 4 3-4 3" />
1483
+ </svg>
1484
+ </button>
1485
+ }
1486
+ @if (availableFormats().has('clear')) {
1487
+ <button
1488
+ type="button"
1489
+ aria-label="Clear formatting"
1490
+ [disabled]="toolbarDisabled()"
1491
+ (click)="clearFormatting()"
1492
+ >
1493
+ <svg aria-hidden="true" viewBox="0 0 24 24">
1494
+ <path d="m4 20 16-16" />
1495
+ <path d="M6.5 4h9l-1.5 5" />
1496
+ <path d="m9.5 15-.5 2H5" />
1497
+ </svg>
1498
+ </button>
1499
+ }
1500
+ </div>
1501
+ }
1502
+
1503
+ <div class="aeris-editor__content-shell" [style.min-height]="minHeight()">
1504
+ <div
1505
+ #editorRoot
1506
+ class="aeris-editor__content"
1507
+ role="textbox"
1508
+ aria-multiline="true"
1509
+ [id]="resolvedInputId()"
1510
+ [attr.contenteditable]="editable()"
1511
+ [attr.aria-label]="ariaLabel() || null"
1512
+ [attr.aria-labelledby]="ariaLabelledby() || null"
1513
+ [attr.aria-describedby]="ariaDescribedby() || null"
1514
+ [attr.aria-invalid]="invalid() || null"
1515
+ [attr.aria-required]="required() || null"
1516
+ [attr.aria-placeholder]="placeholder() || null"
1517
+ [attr.tabindex]="effectiveDisabled() ? -1 : 0"
1518
+ (focus)="handleFocus($event)"
1519
+ (blur)="handleBlur($event)"
1520
+ ></div>
1521
+
1522
+ @if (placeholderVisible()) {
1523
+ <span class="aeris-editor__placeholder">{{ placeholder() }}</span>
1524
+ }
1525
+ </div>
1526
+
1527
+ @if (name()) {
1528
+ <input type="hidden" [name]="name()" [value]="value()" />
1529
+ }
1530
+ </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 }] }] } });
1541
+ const AerisEditor = [AerisEditorComponent];
1542
+
1543
+ /**
1544
+ * Generated bundle index. Do not edit.
1545
+ */
1546
+
1547
+ export { AERIS_EDITOR_ALL_FORMATS, AERIS_EDITOR_DEFAULT_FORMATS, AerisEditor, AerisEditorComponent };
1548
+ //# sourceMappingURL=aeris-ui-core-editor.mjs.map