@4sh/ui-kit 0.16.0 → 0.17.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 (219) hide show
  1. package/README.fr.md +10 -10
  2. package/README.md +10 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -1000
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2048
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -138
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -257
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -312
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -199
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -137
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +721 -638
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +299 -2
  143. package/mcp/data/text-search-docs.json +149 -9
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  150. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  151. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  152. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  153. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  154. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  155. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
  156. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  157. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  158. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  159. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  160. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  161. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  162. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  163. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  164. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
  165. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
  166. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
  167. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  168. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
  169. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  170. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  171. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  172. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  173. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  174. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  175. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  176. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  177. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  178. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
  179. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  180. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  181. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  182. package/types/4sh-ui-kit-forms.d.ts +275 -194
  183. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  184. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  185. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  186. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  187. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  188. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  189. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  190. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  191. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  192. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  193. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  194. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  195. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  196. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  197. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  198. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  199. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  200. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  201. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  202. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  203. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  204. package/types/4sh-ui-kit-motion.d.ts +117 -67
  205. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  206. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  207. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  208. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  209. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  210. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  211. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  212. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  213. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  214. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  215. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  216. package/types/4sh-ui-kit-theming.d.ts +27 -29
  217. package/types/4sh-ui-kit-types.d.ts +6 -5
  218. package/types/4sh-ui-kit.d.ts +4 -3
  219. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,1210 +1,1155 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, output, inject, viewChild, signal, computed, SecurityContext, afterNextRender, effect, forwardRef, Component } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
4
- import * as i1 from '@angular/forms';
5
- import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
6
- import { DomSanitizer } from '@angular/platform-browser';
7
- import { BaseFormField } from '@4sh/ui-kit/forms';
8
- import { UiField } from '@4sh/ui-kit/forms/ui-field';
9
- import { UiButton } from '@4sh/ui-kit/actions/ui-button';
10
- import { UiSelect } from '@4sh/ui-kit/forms/ui-select';
11
- import { DEFAULT_SWATCH_PALETTE, UiSwatchPicker } from '@4sh/ui-kit/forms/ui-swatch-picker';
12
-
13
- const EDITOR_SELECT_TOOLS = [
14
- 'fontFamily',
15
- 'fontSize',
16
- ];
17
- /**
18
- * Font key → class written into the value, token holding the family, and the
19
- * fallback label used when the real name cannot be read (SSR, unset token).
20
- *
21
- * The dropdown shows the **actual** face name, resolved from the token at runtime
22
- * (see {@link resolveFontLabel}) rather than hardcoded: a project that rebinds
23
- * `--fontfamily-base` would otherwise see a menu naming a font it no longer uses.
24
- */
1
+ import * as i0 from "@angular/core";
2
+ import { Component, SecurityContext, afterNextRender, booleanAttribute, computed, effect, forwardRef, inject, input, output, signal, viewChild } from "@angular/core";
3
+ import { NgTemplateOutlet } from "@angular/common";
4
+ import * as i1 from "@angular/forms";
5
+ import { FormsModule, NG_VALUE_ACCESSOR } from "@angular/forms";
6
+ import { DomSanitizer } from "@angular/platform-browser";
7
+ import { BaseFormField } from "@4sh/ui-kit/forms";
8
+ import { UiField } from "@4sh/ui-kit/forms/ui-field";
9
+ import { UiButton } from "@4sh/ui-kit/actions/ui-button";
10
+ import { UiSelect } from "@4sh/ui-kit/forms/ui-select";
11
+ import { DEFAULT_SWATCH_PALETTE, UiSwatchPicker } from "@4sh/ui-kit/forms/ui-swatch-picker";
12
+ const EDITOR_SELECT_TOOLS = ["fontFamily", "fontSize"];
25
13
  const EDITOR_FONTS = [
26
- { key: 'base', className: 'ui-editor-font-base', cssVar: '--fontfamily-base', label: 'Standard' },
27
- {
28
- key: 'title',
29
- className: 'ui-editor-font-title',
30
- cssVar: '--fontfamily-title',
31
- label: 'Titre',
32
- },
33
- {
34
- key: 'monospace',
35
- className: 'ui-editor-font-monospace',
36
- cssVar: '--fontfamily-monospace',
37
- label: 'Monospace',
38
- },
14
+ {
15
+ key: "base",
16
+ className: "ui-editor-font-base",
17
+ cssVar: "--fontfamily-base",
18
+ label: "Standard"
19
+ },
20
+ {
21
+ key: "title",
22
+ className: "ui-editor-font-title",
23
+ cssVar: "--fontfamily-title",
24
+ label: "Titre"
25
+ },
26
+ {
27
+ key: "monospace",
28
+ className: "ui-editor-font-monospace",
29
+ cssVar: "--fontfamily-monospace",
30
+ label: "Monospace"
31
+ }
39
32
  ];
40
- /**
41
- * First face named by a font token — what the family dropdown displays.
42
- *
43
- * `--fontfamily-base` holds a whole stack (`Inter, system-ui, …`); only the head
44
- * of it is a name a person recognises.
45
- */
46
33
  function resolveFontLabel(cssVar, fallback) {
47
- if (typeof document === 'undefined')
48
- return fallback;
49
- const raw = getComputedStyle(document.documentElement).getPropertyValue(cssVar).trim();
50
- const first = raw
51
- .split(',')[0]
52
- ?.trim()
53
- .replace(/^["']|["']$/g, '');
54
- return first || fallback;
34
+ if (typeof document === "undefined") return fallback;
35
+ return getComputedStyle(document.documentElement).getPropertyValue(cssVar).trim().split(",")[0]?.trim().replace(/^["']|["']$/g, "") || fallback;
55
36
  }
56
- /** Size key → class written into the value + French label for the dropdown. */
57
37
  const EDITOR_SIZES = [
58
- { key: 'sm', className: 'ui-editor-size-sm', label: 'Petit' },
59
- { key: 'default', className: 'ui-editor-size-default', label: 'Normal' },
60
- { key: 'lg', className: 'ui-editor-size-lg', label: 'Grand' },
61
- { key: 'xl', className: 'ui-editor-size-xl', label: 'Très grand' },
38
+ {
39
+ key: "sm",
40
+ className: "ui-editor-size-sm",
41
+ label: "Petit"
42
+ },
43
+ {
44
+ key: "default",
45
+ className: "ui-editor-size-default",
46
+ label: "Normal"
47
+ },
48
+ {
49
+ key: "lg",
50
+ className: "ui-editor-size-lg",
51
+ label: "Grand"
52
+ },
53
+ {
54
+ key: "xl",
55
+ className: "ui-editor-size-xl",
56
+ label: "Très grand"
57
+ }
62
58
  ];
63
59
  const SIZE_CLASSES = new Set(EDITOR_SIZES.map((s) => s.className));
64
60
  const FONT_CLASSES = new Set(EDITOR_FONTS.map((f) => f.className));
65
- /**
66
- * The tools enabled when the consumer does not provide a `tools` list.
67
- *
68
- * There is no block-level dropdown (no `blockFormat`, no headings): the editor
69
- * only ever produces `<p>`. `fontFamily`/`fontSize` are both first-class,
70
- * always-on tools rather than one gated behind the other.
71
- *
72
- * `clearFormat` is deliberately absent for now: `clearFormatMarkers()` does not
73
- * reliably clear every marker class yet. It stays available for a project that
74
- * explicitly adds it to `tools`, but shipping it by default would be shipping
75
- * a broken button.
76
- */
77
61
  const DEFAULT_EDITOR_TOOLS = [
78
- 'fontFamily',
79
- 'fontSize',
80
- 'separator',
81
- 'bold',
82
- 'italic',
83
- 'underline',
84
- 'separator',
85
- 'bulletList',
86
- 'orderedList',
87
- 'separator',
88
- 'alignLeft',
89
- 'alignCenter',
90
- 'alignRight',
91
- 'alignJustify',
92
- 'separator',
93
- 'link',
94
- 'codeBlock',
62
+ "fontFamily",
63
+ "fontSize",
64
+ "separator",
65
+ "bold",
66
+ "italic",
67
+ "underline",
68
+ "separator",
69
+ "bulletList",
70
+ "orderedList",
71
+ "separator",
72
+ "alignLeft",
73
+ "alignCenter",
74
+ "alignRight",
75
+ "alignJustify",
76
+ "separator",
77
+ "link",
78
+ "codeBlock"
95
79
  ];
96
- /** Toolbar metadata per button tool: icon (FontAwesome) + French accessible name. */
97
80
  const EDITOR_TOOL_META = {
98
- bold: { icon: 'bold', label: 'Gras' },
99
- italic: { icon: 'italic', label: 'Italique' },
100
- underline: { icon: 'underline', label: 'Souligné' },
101
- bulletList: { icon: 'list-ul', label: 'Liste à puces' },
102
- orderedList: { icon: 'list-ol', label: 'Liste numérotée' },
103
- codeBlock: { icon: 'code', label: 'Bloc de code' },
104
- indent: { icon: 'indent', label: 'Augmenter le retrait' },
105
- outdent: { icon: 'outdent', label: 'Diminuer le retrait' },
106
- alignLeft: { icon: 'align-left', label: 'Aligner à gauche' },
107
- alignCenter: { icon: 'align-center', label: 'Centrer' },
108
- alignRight: { icon: 'align-right', label: 'Aligner à droite' },
109
- alignJustify: { icon: 'align-justify', label: 'Justifier' },
110
- textColor: { icon: 'font', label: 'Couleur du texte' },
111
- highlightColor: { icon: 'highlighter', label: 'Couleur de surlignage' },
112
- link: { icon: 'link', label: 'Lien' },
113
- clearFormat: { icon: 'text-slash', label: 'Effacer le formatage' },
81
+ bold: {
82
+ icon: "bold",
83
+ label: "Gras"
84
+ },
85
+ italic: {
86
+ icon: "italic",
87
+ label: "Italique"
88
+ },
89
+ underline: {
90
+ icon: "underline",
91
+ label: "Souligné"
92
+ },
93
+ bulletList: {
94
+ icon: "list-ul",
95
+ label: "Liste à puces"
96
+ },
97
+ orderedList: {
98
+ icon: "list-ol",
99
+ label: "Liste numérotée"
100
+ },
101
+ codeBlock: {
102
+ icon: "code",
103
+ label: "Bloc de code"
104
+ },
105
+ indent: {
106
+ icon: "indent",
107
+ label: "Augmenter le retrait"
108
+ },
109
+ outdent: {
110
+ icon: "outdent",
111
+ label: "Diminuer le retrait"
112
+ },
113
+ alignLeft: {
114
+ icon: "align-left",
115
+ label: "Aligner à gauche"
116
+ },
117
+ alignCenter: {
118
+ icon: "align-center",
119
+ label: "Centrer"
120
+ },
121
+ alignRight: {
122
+ icon: "align-right",
123
+ label: "Aligner à droite"
124
+ },
125
+ alignJustify: {
126
+ icon: "align-justify",
127
+ label: "Justifier"
128
+ },
129
+ textColor: {
130
+ icon: "font",
131
+ label: "Couleur du texte"
132
+ },
133
+ highlightColor: {
134
+ icon: "highlighter",
135
+ label: "Couleur de surlignage"
136
+ },
137
+ link: {
138
+ icon: "link",
139
+ label: "Lien"
140
+ },
141
+ clearFormat: {
142
+ icon: "text-slash",
143
+ label: "Effacer le formatage"
144
+ }
114
145
  };
115
- /** Tool → legacy command name. */
116
146
  const NATIVE_COMMAND = {
117
- bold: 'bold',
118
- italic: 'italic',
119
- underline: 'underline',
120
- bulletList: 'insertUnorderedList',
121
- orderedList: 'insertOrderedList',
122
- indent: 'indent',
123
- outdent: 'outdent',
124
- alignLeft: 'justifyLeft',
125
- alignCenter: 'justifyCenter',
126
- alignRight: 'justifyRight',
127
- alignJustify: 'justifyFull',
128
- clearFormat: 'removeFormat',
147
+ bold: "bold",
148
+ italic: "italic",
149
+ underline: "underline",
150
+ bulletList: "insertUnorderedList",
151
+ orderedList: "insertOrderedList",
152
+ indent: "indent",
153
+ outdent: "outdent",
154
+ alignLeft: "justifyLeft",
155
+ alignCenter: "justifyCenter",
156
+ alignRight: "justifyRight",
157
+ alignJustify: "justifyFull",
158
+ clearFormat: "removeFormat"
129
159
  };
130
160
  const TOGGLE_TOOLS = [
131
- 'bold',
132
- 'italic',
133
- 'underline',
134
- 'bulletList',
135
- 'orderedList',
136
- 'alignLeft',
137
- 'alignCenter',
138
- 'alignRight',
139
- 'alignJustify',
161
+ "bold",
162
+ "italic",
163
+ "underline",
164
+ "bulletList",
165
+ "orderedList",
166
+ "alignLeft",
167
+ "alignCenter",
168
+ "alignRight",
169
+ "alignJustify"
140
170
  ];
141
- /** Every state off — the value used before the first render and on SSR. */
142
171
  function emptyEditorState() {
143
- return {
144
- bold: false,
145
- italic: false,
146
- underline: false,
147
- bulletList: false,
148
- orderedList: false,
149
- codeBlock: false,
150
- alignLeft: false,
151
- alignCenter: false,
152
- alignRight: false,
153
- alignJustify: false,
154
- };
172
+ return {
173
+ bold: false,
174
+ italic: false,
175
+ underline: false,
176
+ bulletList: false,
177
+ orderedList: false,
178
+ codeBlock: false,
179
+ alignLeft: false,
180
+ alignCenter: false,
181
+ alignRight: false,
182
+ alignJustify: false
183
+ };
155
184
  }
156
- /** Applies a formatting command to the current selection. */
157
185
  function applyCommand(tool) {
158
- document.execCommand(NATIVE_COMMAND[tool], false);
186
+ document.execCommand(NATIVE_COMMAND[tool], false);
159
187
  }
160
- // --- Code block ---------------------------------------------------------
161
- /** Toggles the block under the caret between `<pre>` and a plain paragraph. */
162
188
  function toggleCodeBlock() {
163
- document.execCommand('formatBlock', false, isInCodeBlock() ? 'p' : 'pre');
189
+ document.execCommand("formatBlock", false, isInCodeBlock() ? "p" : "pre");
164
190
  }
165
- /** The caret sits in a code block. */
166
191
  function isInCodeBlock() {
167
- try {
168
- return (document.queryCommandValue('formatBlock') || '').toLowerCase() === 'pre';
169
- }
170
- catch {
171
- return false;
172
- }
192
+ try {
193
+ return (document.queryCommandValue("formatBlock") || "").toLowerCase() === "pre";
194
+ } catch {
195
+ return false;
196
+ }
173
197
  }
174
- // --- Font family --------------------------------------------------------
175
- /**
176
- * Marker handed to `fontName`, immediately rewritten into a class.
177
- *
178
- * `fontName` is the only command that can apply a family to an arbitrary
179
- * selection, but it emits `<font face="…">` — an obsolete tag carrying a raw
180
- * family name. We let it run, then convert its output so the value only ever
181
- * holds a class bound to a `--fontfamily-*` token.
182
- */
183
- const FONT_MARKER = '__ui-editor-font__';
184
- /** Applies a type family to the selection (see {@link convertFontMarkers}). */
198
+ const FONT_MARKER = "__ui-editor-font__";
185
199
  function applyFontFamily() {
186
- document.execCommand('fontName', false, FONT_MARKER);
200
+ document.execCommand("fontName", false, FONT_MARKER);
187
201
  }
188
- /** Rewrites the `<font>` elements `fontName` just produced into `<span class>`. */
189
202
  function convertFontMarkers(root, className) {
190
- convertMarkers(root, `font[face="${FONT_MARKER}"]`, className, FONT_CLASSES);
203
+ convertMarkers(root, `font[face="${FONT_MARKER}"]`, className, FONT_CLASSES);
191
204
  }
192
- /** @internal Replaces the matched legacy `<font>` elements with a classed span. */
193
205
  function convertMarkers(root, selector, className, family) {
194
- const spans = [];
195
- for (const el of Array.from(root.querySelectorAll(selector))) {
196
- const span = document.createElement('span');
197
- span.className = className;
198
- span.append(...Array.from(el.childNodes));
199
- el.replaceWith(span);
200
- spans.push(span);
201
- }
202
- // A same-family class left inside would win over the new one.
203
- for (const span of spans) {
204
- for (const inner of Array.from(span.querySelectorAll('[class]'))) {
205
- for (const cls of Array.from(inner.classList))
206
- if (family.has(cls))
207
- inner.classList.remove(cls);
208
- if (inner.classList.length > 0)
209
- continue;
210
- inner.removeAttribute('class');
211
- if (inner.tagName === 'SPAN' && inner.attributes.length === 0) {
212
- inner.replaceWith(...Array.from(inner.childNodes));
213
- }
214
- }
215
- }
216
- // Replacing the nodes collapsed the selection: put it back.
217
- const live = spans.filter((span) => span.isConnected);
218
- const selection = document.getSelection();
219
- if (!live.length || !selection)
220
- return;
221
- const last = live[live.length - 1];
222
- const range = document.createRange();
223
- range.setStart(live[0], 0);
224
- range.setEnd(last, last.childNodes.length);
225
- selection.removeAllRanges();
226
- selection.addRange(range);
206
+ const spans = [];
207
+ for (const el of Array.from(root.querySelectorAll(selector))) {
208
+ const span = document.createElement("span");
209
+ span.className = className;
210
+ span.append(...Array.from(el.childNodes));
211
+ el.replaceWith(span);
212
+ spans.push(span);
213
+ }
214
+ for (const span of spans) for (const inner of Array.from(span.querySelectorAll("[class]"))) {
215
+ for (const cls of Array.from(inner.classList)) if (family.has(cls)) inner.classList.remove(cls);
216
+ if (inner.classList.length > 0) continue;
217
+ inner.removeAttribute("class");
218
+ if (inner.tagName === "SPAN" && inner.attributes.length === 0) inner.replaceWith(...Array.from(inner.childNodes));
219
+ }
220
+ const live = spans.filter((span) => span.isConnected);
221
+ const selection = document.getSelection();
222
+ if (!live.length || !selection) return;
223
+ const last = live[live.length - 1];
224
+ const range = document.createRange();
225
+ range.setStart(live[0], 0);
226
+ range.setEnd(last, last.childNodes.length);
227
+ selection.removeAllRanges();
228
+ selection.addRange(range);
227
229
  }
228
- /**
229
- * Type family in force at the caret.
230
- *
231
- * Falls back to the family the text is actually rendered with when no class was
232
- * applied: a heading carries `--fontfamily-title` from its own styling, and
233
- * reporting the base family there would name a font the reader does not see.
234
- * `null` only when the computed face matches none of the system families.
235
- */
236
230
  function readFontFamily(node) {
237
- const tagged = findClassKey(node, EDITOR_FONTS);
238
- if (tagged)
239
- return tagged;
240
- const el = node?.nodeType === Node.ELEMENT_NODE ? node : (node?.parentElement ?? null);
241
- if (!el || typeof getComputedStyle !== 'function')
242
- return null;
243
- const rendered = firstFace(getComputedStyle(el).fontFamily);
244
- return (EDITOR_FONTS.find((f) => firstFace(resolveFontLabel(f.cssVar, '')) === rendered)?.key ?? null);
231
+ const tagged = findClassKey(node, EDITOR_FONTS);
232
+ if (tagged) return tagged;
233
+ const el = node?.nodeType === Node.ELEMENT_NODE ? node : node?.parentElement ?? null;
234
+ if (!el || typeof getComputedStyle !== "function") return null;
235
+ const rendered = firstFace(getComputedStyle(el).fontFamily);
236
+ return EDITOR_FONTS.find((f) => firstFace(resolveFontLabel(f.cssVar, "")) === rendered)?.key ?? null;
245
237
  }
246
- /** @internal Head of a font stack, unquoted and lowercased for comparison. */
247
238
  function firstFace(stack) {
248
- return (stack.split(',')[0] ?? '')
249
- .trim()
250
- .replace(/^["']|["']$/g, '')
251
- .toLowerCase();
239
+ return (stack.split(",")[0] ?? "").trim().replace(/^["']|["']$/g, "").toLowerCase();
252
240
  }
253
- // --- Font size ----------------------------------------------------------
254
- /**
255
- * Marker handed to `fontSize`, immediately rewritten into a class.
256
- *
257
- * Same trick as the family: `fontSize` is the only command that can size an
258
- * arbitrary selection, but it emits `<font size="7">` — a legacy 1-7 scale with
259
- * no relation to the typography tokens.
260
- */
261
- const SIZE_MARKER = '7';
262
- /** Applies a text size to the selection (see {@link convertSizeMarkers}). */
241
+ const SIZE_MARKER = "7";
263
242
  function applyFontSize() {
264
- document.execCommand('fontSize', false, SIZE_MARKER);
243
+ document.execCommand("fontSize", false, SIZE_MARKER);
265
244
  }
266
- /** Rewrites the `<font>` elements `fontSize` just produced into `<span class>`. */
267
245
  function convertSizeMarkers(root, className) {
268
- convertMarkers(root, `font[size="${SIZE_MARKER}"]`, className, SIZE_CLASSES);
246
+ convertMarkers(root, `font[size="${SIZE_MARKER}"]`, className, SIZE_CLASSES);
269
247
  }
270
- /** Text size active at the caret, or `null` when the text uses the default. */
271
248
  function readFontSize(node) {
272
- return findClassKey(node, EDITOR_SIZES);
249
+ return findClassKey(node, EDITOR_SIZES);
273
250
  }
274
- // --- Text color / highlight color ---------------------------------------
275
- /**
276
- * Color key → class written into the value, token holding the swatch, and
277
- * label, derived from `ui-swatch-picker`'s default palette rather than
278
- * hand-duplicated: the editor's color tools and the nuancier it opens must
279
- * always offer the same token set.
280
- */
281
251
  const EDITOR_COLORS = DEFAULT_SWATCH_PALETTE.flatMap((group) => group.swatches.map((swatch) => ({
282
- key: swatch.key,
283
- className: `ui-editor-color-${swatch.key}`,
284
- cssVar: swatch.cssVar,
285
- label: swatch.label,
252
+ key: swatch.key,
253
+ className: `ui-editor-color-${swatch.key}`,
254
+ cssVar: swatch.cssVar,
255
+ label: swatch.label
286
256
  })));
287
- /** Same key set as {@link EDITOR_COLORS}, classed separately for the highlight tool. */
288
257
  const EDITOR_HIGHLIGHTS = DEFAULT_SWATCH_PALETTE.flatMap((group) => group.swatches.map((swatch) => ({
289
- key: swatch.key,
290
- className: `ui-editor-highlight-${swatch.key}`,
291
- cssVar: swatch.cssVar,
292
- label: swatch.label,
258
+ key: swatch.key,
259
+ className: `ui-editor-highlight-${swatch.key}`,
260
+ cssVar: swatch.cssVar,
261
+ label: swatch.label
293
262
  })));
294
263
  const COLOR_CLASSES = new Set(EDITOR_COLORS.map((c) => c.className));
295
264
  const HIGHLIGHT_CLASSES = new Set(EDITOR_HIGHLIGHTS.map((c) => c.className));
296
- /**
297
- * Marker handed to `foreColor`, immediately rewritten into a class.
298
- *
299
- * `foreColor` is the only command that can color an arbitrary selection, but
300
- * it emits `<font color="…">` — same trick as the family/size markers. Must
301
- * be a value the browser accepts as a real color (unlike `fontName`'s marker,
302
- * which is free text): an unparseable string is silently dropped instead of
303
- * being written to the `color` attribute. A hex triplet unlikely to collide
304
- * with a real token value is used, and Chromium/Firefox both echo it back
305
- * verbatim on the `<font color>` attribute (verified empirically).
306
- */
307
- const COLOR_MARKER = '#010203';
308
- /** Applies a text color to the selection (see {@link convertColorMarkers}). */
265
+ const COLOR_MARKER = "#010203";
309
266
  function applyTextColor() {
310
- document.execCommand('foreColor', false, COLOR_MARKER);
267
+ document.execCommand("foreColor", false, COLOR_MARKER);
311
268
  }
312
- /** Rewrites the `<font>` elements `foreColor` just produced into `<span class>`. */
313
269
  function convertColorMarkers(root, className) {
314
- convertMarkers(root, `font[color="${COLOR_MARKER}"]`, className, COLOR_CLASSES);
270
+ convertMarkers(root, `font[color="${COLOR_MARKER}"]`, className, COLOR_CLASSES);
315
271
  }
316
- /** Text color active at the caret, or `null` when the text uses the default. */
317
272
  function readTextColor(node) {
318
- return findClassKey(node, EDITOR_COLORS);
273
+ return findClassKey(node, EDITOR_COLORS);
319
274
  }
320
- /**
321
- * Marker handed to `hiliteColor`, immediately rewritten into a class.
322
- *
323
- * Unlike `fontName`/`fontSize`/`foreColor`, `hiliteColor` does **not** emit a
324
- * `<font>` element: verified empirically (Playwright, Chromium + Firefox)
325
- * that it always produces `<span style="background-color: rgb(r, g, b);">`,
326
- * converting whatever color is handed to it — including a hex marker — to an
327
- * `rgb(...)` triplet in the `style` attribute. `HILITE_MARKER` is therefore
328
- * kept as the hex value passed to the command, and `HILITE_MARKER_RGB` as the
329
- * exact `rgb(...)` string both browsers echo back for it, used to build the
330
- * `[style*="…"]` selector `convertHighlightMarkers` matches on.
331
- */
332
- const HILITE_MARKER = '#040506';
333
- /** @internal `rgb(...)` form both Chromium and Firefox normalize `HILITE_MARKER` to. */
334
- const HILITE_MARKER_RGB = 'rgb(4, 5, 6)';
335
- /** Applies a highlight color to the selection (see {@link convertHighlightMarkers}). */
275
+ const HILITE_MARKER = "#040506";
276
+ const HILITE_MARKER_RGB = "rgb(4, 5, 6)";
336
277
  function applyHighlightColor() {
337
- document.execCommand('hiliteColor', false, HILITE_MARKER);
278
+ document.execCommand("hiliteColor", false, HILITE_MARKER);
338
279
  }
339
- /** Rewrites the `<span style>` elements `hiliteColor` just produced into `<span class>`. */
340
280
  function convertHighlightMarkers(root, className) {
341
- convertMarkers(root, `[style*="background-color: ${HILITE_MARKER_RGB}"]`, className, HIGHLIGHT_CLASSES);
281
+ convertMarkers(root, `[style*="background-color: ${HILITE_MARKER_RGB}"]`, className, HIGHLIGHT_CLASSES);
342
282
  }
343
- /** Highlight color active at the caret, or `null` when the text carries none. */
344
283
  function readHighlightColor(node) {
345
- return findClassKey(node, EDITOR_HIGHLIGHTS);
284
+ return findClassKey(node, EDITOR_HIGHLIGHTS);
346
285
  }
347
- /**
348
- * Strips a color/highlight class from every element carrying it inside
349
- * `range`, unwrapping the element when nothing else justifies it (a plain
350
- * `<span>` holding only that class).
351
- *
352
- * Used by the pickers' "no color" swatch: `foreColor`/`hiliteColor` can only
353
- * set a color, there is no native command to remove one, so this undoes what
354
- * {@link convertColorMarkers}/{@link convertHighlightMarkers} previously wrote.
355
- */
356
286
  function clearMarkerClass(root, range, className) {
357
- for (const el of Array.from(root.querySelectorAll(`.${className}`))) {
358
- if (!range.intersectsNode(el))
359
- continue;
360
- el.classList.remove(className);
361
- if (el.classList.length > 0)
362
- continue;
363
- el.removeAttribute('class');
364
- if (el.tagName === 'SPAN' && el.attributes.length === 0) {
365
- el.replaceWith(...Array.from(el.childNodes));
366
- }
367
- }
287
+ for (const el of Array.from(root.querySelectorAll(`.${className}`))) {
288
+ if (!range.intersectsNode(el)) continue;
289
+ el.classList.remove(className);
290
+ if (el.classList.length > 0) continue;
291
+ el.removeAttribute("class");
292
+ if (el.tagName === "SPAN" && el.attributes.length === 0) el.replaceWith(...Array.from(el.childNodes));
293
+ }
368
294
  }
369
- /**
370
- * Strips every font/size/color/highlight class the editor writes, from
371
- * whatever intersects `range`.
372
- *
373
- * `removeFormat` (the `clearFormat` tool's native command) only knows inline
374
- * formatting the browser itself applies (bold, italic, underline…) — it never
375
- * touches the `<span class="ui-editor-*">` wrappers `fontFamily`/`fontSize`/
376
- * `textColor`/`highlightColor` write, so "Clear formatting" needs this on top
377
- * of it to actually clear everything.
378
- */
379
295
  function clearFormatMarkers(root, range) {
380
- for (const className of [...FONT_CLASSES, ...SIZE_CLASSES, ...COLOR_CLASSES, ...HIGHLIGHT_CLASSES]) {
381
- clearMarkerClass(root, range, className);
382
- }
296
+ for (const className of [
297
+ ...FONT_CLASSES,
298
+ ...SIZE_CLASSES,
299
+ ...COLOR_CLASSES,
300
+ ...HIGHLIGHT_CLASSES
301
+ ]) clearMarkerClass(root, range, className);
383
302
  }
384
- /** @internal Nearest ancestor carrying one of the given classes. */
385
303
  function findClassKey(node, table) {
386
- let el = node?.nodeType === Node.ELEMENT_NODE ? node : (node?.parentElement ?? null);
387
- while (el) {
388
- const match = table.find((entry) => el.classList?.contains(entry.className));
389
- if (match)
390
- return match.key;
391
- el = el.parentElement;
392
- }
393
- return null;
304
+ let el = node?.nodeType === Node.ELEMENT_NODE ? node : node?.parentElement ?? null;
305
+ while (el) {
306
+ const match = table.find((entry) => el.classList?.contains(entry.className));
307
+ if (match) return match.key;
308
+ el = el.parentElement;
309
+ }
310
+ return null;
394
311
  }
395
- /** Wraps the current selection in a link (`removeFormat` alone cannot unlink). */
396
312
  function applyLink(href) {
397
- document.execCommand('createLink', false, href);
313
+ document.execCommand("createLink", false, href);
398
314
  }
399
- /** Removes the link around the caret. */
400
315
  function removeLink() {
401
- document.execCommand('unlink', false);
316
+ document.execCommand("unlink", false);
402
317
  }
403
- /** Reads the formatting active at the caret. */
404
318
  function readEditorState() {
405
- const state = emptyEditorState();
406
- for (const tool of TOGGLE_TOOLS) {
407
- try {
408
- state[tool] = document.queryCommandState(NATIVE_COMMAND[tool]);
409
- }
410
- catch {
411
- // queryCommandState throws when the document has no selection yet.
412
- state[tool] = false;
413
- }
414
- }
415
- state.codeBlock = isInCodeBlock();
416
- return state;
319
+ const state = emptyEditorState();
320
+ for (const tool of TOGGLE_TOOLS) try {
321
+ state[tool] = document.queryCommandState(NATIVE_COMMAND[tool]);
322
+ } catch {
323
+ state[tool] = false;
324
+ }
325
+ state.codeBlock = isInCodeBlock();
326
+ return state;
417
327
  }
418
- /** Inserts already-sanitised markup at the caret, replacing the selection. */
419
328
  function insertHtml(html) {
420
- document.execCommand('insertHTML', false, html);
329
+ document.execCommand("insertHTML", false, html);
421
330
  }
422
- /** Inserts plain text at the caret, replacing the selection. */
423
331
  function insertText(text) {
424
- document.execCommand('insertText', false, text);
332
+ document.execCommand("insertText", false, text);
425
333
  }
426
- // --- Value sanitisation --------------------------------------------------
427
- const LENGTH = String.raw `(?:0|-?\d+(?:\.\d+)?(?:px|em|rem|%))`;
334
+ const LENGTH = String.raw`(?:0|-?\d+(?:\.\d+)?(?:px|em|rem|%))`;
428
335
  const LENGTHS = new RegExp(`^${LENGTH}(?:\\s+${LENGTH}){0,3}$`);
429
- /** The only `style` a value keeps: alignment and indentation. Same list as the React kit. */
430
336
  const STYLE_ALLOWLIST = {
431
- 'text-align': /^(?:left|right|center|justify|start|end)$/,
432
- margin: LENGTHS,
433
- 'margin-left': LENGTHS,
434
- 'margin-right': LENGTHS,
435
- 'margin-inline-start': LENGTHS,
436
- padding: LENGTHS,
437
- border: /^none$/,
337
+ "text-align": /^(?:left|right|center|justify|start|end)$/,
338
+ margin: LENGTHS,
339
+ "margin-left": LENGTHS,
340
+ "margin-right": LENGTHS,
341
+ "margin-inline-start": LENGTHS,
342
+ padding: LENGTHS,
343
+ border: /^none$/
438
344
  };
439
- /** Keeps only the allowed declarations of a `style` attribute. */
440
345
  function sanitizeStyle(style) {
441
- const kept = [];
442
- for (const declaration of style.split(';')) {
443
- const colon = declaration.indexOf(':');
444
- if (colon < 0)
445
- continue;
446
- const property = declaration.slice(0, colon).trim().toLowerCase();
447
- const value = declaration.slice(colon + 1).trim().toLowerCase();
448
- const pattern = STYLE_ALLOWLIST[property];
449
- if (pattern?.test(value))
450
- kept.push(`${property}: ${value};`);
451
- }
452
- return kept.join(' ');
346
+ const kept = [];
347
+ for (const declaration of style.split(";")) {
348
+ const colon = declaration.indexOf(":");
349
+ if (colon < 0) continue;
350
+ const property = declaration.slice(0, colon).trim().toLowerCase();
351
+ const value = declaration.slice(colon + 1).trim().toLowerCase();
352
+ if (STYLE_ALLOWLIST[property]?.test(value)) kept.push(`${property}: ${value};`);
353
+ }
354
+ return kept.join(" ");
453
355
  }
454
- const STYLE_RELAY = 'ui-editor-style-';
455
- /** Sanitises a value with `sanitize`, relaying the allowed `style` through a class it keeps. */
356
+ const STYLE_RELAY = "ui-editor-style-";
456
357
  function sanitizeEditorHtml(html, sanitize) {
457
- if (typeof DOMParser === 'undefined' || !/\sstyle\s*=/i.test(html))
458
- return sanitize(html);
459
- const styles = [];
460
- const source = parseInert(html);
461
- for (const el of Array.from(source.querySelectorAll('*'))) {
462
- const forged = Array.from(el.classList).filter((cls) => cls.startsWith(STYLE_RELAY));
463
- if (forged.length) {
464
- el.classList.remove(...forged);
465
- if (!el.classList.length)
466
- el.removeAttribute('class');
467
- }
468
- const style = el.getAttribute('style');
469
- if (style === null)
470
- continue;
471
- el.removeAttribute('style');
472
- const kept = sanitizeStyle(style);
473
- if (!kept)
474
- continue;
475
- el.classList.add(`${STYLE_RELAY}${styles.length}`);
476
- styles.push(kept);
477
- }
478
- const safe = sanitize(source.innerHTML);
479
- if (!styles.length)
480
- return safe;
481
- const out = parseInert(safe);
482
- for (const el of Array.from(out.querySelectorAll(`[class*="${STYLE_RELAY}"]`))) {
483
- for (const cls of Array.from(el.classList)) {
484
- if (!cls.startsWith(STYLE_RELAY))
485
- continue;
486
- el.classList.remove(cls);
487
- const kept = styles[Number(cls.slice(STYLE_RELAY.length))];
488
- if (kept)
489
- el.setAttribute('style', kept);
490
- }
491
- if (!el.classList.length)
492
- el.removeAttribute('class');
493
- }
494
- return out.innerHTML;
358
+ if (typeof DOMParser === "undefined" || !/\sstyle\s*=/i.test(html)) return sanitize(html);
359
+ const styles = [];
360
+ const source = parseInert(html);
361
+ for (const el of Array.from(source.querySelectorAll("*"))) {
362
+ const forged = Array.from(el.classList).filter((cls) => cls.startsWith(STYLE_RELAY));
363
+ if (forged.length) {
364
+ el.classList.remove(...forged);
365
+ if (!el.classList.length) el.removeAttribute("class");
366
+ }
367
+ const style = el.getAttribute("style");
368
+ if (style === null) continue;
369
+ el.removeAttribute("style");
370
+ const kept = sanitizeStyle(style);
371
+ if (!kept) continue;
372
+ el.classList.add(`${STYLE_RELAY}${styles.length}`);
373
+ styles.push(kept);
374
+ }
375
+ const safe = sanitize(source.innerHTML);
376
+ if (!styles.length) return safe;
377
+ const out = parseInert(safe);
378
+ for (const el of Array.from(out.querySelectorAll(`[class*="${STYLE_RELAY}"]`))) {
379
+ for (const cls of Array.from(el.classList)) {
380
+ if (!cls.startsWith(STYLE_RELAY)) continue;
381
+ el.classList.remove(cls);
382
+ const kept = styles[Number(cls.slice(16))];
383
+ if (kept) el.setAttribute("style", kept);
384
+ }
385
+ if (!el.classList.length) el.removeAttribute("class");
386
+ }
387
+ return out.innerHTML;
495
388
  }
496
- /** @internal Inert parse; the leading `<remove>` keeps head-only tags in the body. */
497
389
  function parseInert(html) {
498
- const body = new DOMParser().parseFromString(`<body><remove></remove>${html}`, 'text/html').body;
499
- body.firstChild?.remove();
500
- return body;
390
+ const body = new DOMParser().parseFromString(`<body><remove></remove>${html}`, "text/html").body;
391
+ body.firstChild?.remove();
392
+ return body;
501
393
  }
502
- // --- Content normalisation ---------------------------------------------
503
- /** Inline + block tags the editor is allowed to produce or to accept on paste. */
504
- const ALLOWED_TAGS = new Set([
505
- 'B',
506
- 'STRONG',
507
- 'I',
508
- 'EM',
509
- 'U',
510
- 'A',
511
- 'UL',
512
- 'OL',
513
- 'LI',
514
- 'P',
515
- 'BR',
516
- 'DIV',
517
- 'SPAN',
518
- 'PRE',
519
- 'CODE',
520
- 'H1',
521
- 'H2',
522
- 'H3',
394
+ const ALLOWED_TAGS = /* @__PURE__ */ new Set([
395
+ "B",
396
+ "STRONG",
397
+ "I",
398
+ "EM",
399
+ "U",
400
+ "A",
401
+ "UL",
402
+ "OL",
403
+ "LI",
404
+ "P",
405
+ "BR",
406
+ "DIV",
407
+ "SPAN",
408
+ "PRE",
409
+ "CODE",
410
+ "H1",
411
+ "H2",
412
+ "H3"
523
413
  ]);
524
- /**
525
- * Tags dropped WITH their content, instead of being unwrapped.
526
- *
527
- * Unwrapping keeps the text of a rejected element, which is what we want for a
528
- * heading or a table cell — but a script or stylesheet body would then land in
529
- * the document as visible text.
530
- */
531
- const VOIDED_TAGS = 'script, style, noscript, iframe, object, embed, template, title, meta, link';
532
- /** Only `href` survives, and only on a link. */
533
- const ALLOWED_HREF_PROTOCOLS = ['http:', 'https:', 'mailto:', 'tel:'];
534
- /**
535
- * Strips everything outside the whitelist, keeping the text of dropped elements.
536
- *
537
- * Runs on paste, on top of Angular's `DomSanitizer`: the sanitizer removes what is
538
- * dangerous, this removes what is merely foreign to the editor (Word spans, inline
539
- * styles, headings, tables) so the value stays a small, predictable HTML subset.
540
- */
414
+ const VOIDED_TAGS = "script, style, noscript, iframe, object, embed, template, title, meta, link";
415
+ const ALLOWED_HREF_PROTOCOLS = [
416
+ "http:",
417
+ "https:",
418
+ "mailto:",
419
+ "tel:"
420
+ ];
541
421
  function normalizeHtml(html) {
542
- if (typeof document === 'undefined')
543
- return html;
544
- const template = document.createElement('template');
545
- /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :
546
- `<template>` détaché, contenu inerte — étape de parsing du scrub, pas une
547
- injection dans le document. Registre : docs/SECURITY-PRACTICES.md. */
548
- template.innerHTML = html;
549
- scrubNode(template.content);
550
- return template.innerHTML;
422
+ if (typeof document === "undefined") return html;
423
+ const template = document.createElement("template");
424
+ template.innerHTML = html;
425
+ scrubNode(template.content);
426
+ return template.innerHTML;
551
427
  }
552
- /**
553
- * Applies the same scrubbing to a live element, in place.
554
- *
555
- * `insertHTML` re-decorates what it inserts (`style="background-color: transparent"`
556
- * and friends) *after* our normalisation, so the markup has to be cleaned once more
557
- * once it is in the document. Attributes are removed node by node rather than by
558
- * rewriting `innerHTML`, which would drop the caret.
559
- */
560
428
  function scrubInPlace(root) {
561
- scrubNode(root);
429
+ scrubNode(root);
562
430
  }
563
- /** @internal Unwraps disallowed elements, voids the unsafe ones, drops attributes. */
564
431
  function scrubNode(root) {
565
- for (const el of Array.from(root.querySelectorAll(VOIDED_TAGS)))
566
- el.remove();
567
- for (const el of Array.from(root.querySelectorAll('*'))) {
568
- if (!ALLOWED_TAGS.has(el.tagName)) {
569
- el.replaceWith(...Array.from(el.childNodes));
570
- continue;
571
- }
572
- for (const attr of Array.from(el.attributes)) {
573
- if (attr.name === 'class') {
574
- // Only the editor's own font/size/color classes survive — anything else
575
- // pasted in would style the value against a foreign stylesheet.
576
- const kept = attr.value
577
- .split(/\s+/)
578
- .filter((c) => FONT_CLASSES.has(c) ||
579
- SIZE_CLASSES.has(c) ||
580
- COLOR_CLASSES.has(c) ||
581
- HIGHLIGHT_CLASSES.has(c));
582
- if (kept.length)
583
- el.setAttribute('class', kept.join(' '));
584
- else
585
- el.removeAttribute('class');
586
- continue;
587
- }
588
- const keep = el.tagName === 'A' && attr.name === 'href' && isSafeHref(attr.value);
589
- if (!keep)
590
- el.removeAttribute(attr.name);
591
- }
592
- }
432
+ for (const el of Array.from(root.querySelectorAll(VOIDED_TAGS))) el.remove();
433
+ for (const el of Array.from(root.querySelectorAll("*"))) {
434
+ if (!ALLOWED_TAGS.has(el.tagName)) {
435
+ el.replaceWith(...Array.from(el.childNodes));
436
+ continue;
437
+ }
438
+ for (const attr of Array.from(el.attributes)) {
439
+ if (attr.name === "class") {
440
+ const kept = attr.value.split(/\s+/).filter((c) => FONT_CLASSES.has(c) || SIZE_CLASSES.has(c) || COLOR_CLASSES.has(c) || HIGHLIGHT_CLASSES.has(c));
441
+ if (kept.length) el.setAttribute("class", kept.join(" "));
442
+ else el.removeAttribute("class");
443
+ continue;
444
+ }
445
+ if (!(el.tagName === "A" && attr.name === "href" && isSafeHref(attr.value))) el.removeAttribute(attr.name);
446
+ }
447
+ }
593
448
  }
594
- /** @internal Rejects `javascript:` and other non-navigational schemes. */
595
449
  function isSafeHref(href) {
596
- try {
597
- return ALLOWED_HREF_PROTOCOLS.includes(new URL(href, document.baseURI).protocol);
598
- }
599
- catch {
600
- return false;
601
- }
450
+ try {
451
+ return ALLOWED_HREF_PROTOCOLS.includes(new URL(href, document.baseURI).protocol);
452
+ } catch {
453
+ return false;
454
+ }
602
455
  }
603
- /** Normalises a browser-produced empty document (`<br>`, empty block) to `''`. */
604
456
  function isEmptyHtml(html) {
605
- return htmlToText(html).length === 0 && !/<(img|hr)\b/i.test(html);
457
+ return htmlToText(html).length === 0 && !/<(img|hr)\b/i.test(html);
606
458
  }
607
- /** Plain-text projection of the value — what the character counter measures. */
608
459
  function htmlToText(html) {
609
- if (!html)
610
- return '';
611
- if (typeof document === 'undefined') {
612
- // SSR fallback: good enough for a length, never rendered.
613
- return html.replace(/<[^>]*>/g, '').trim();
614
- }
615
- const template = document.createElement('template');
616
- /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :
617
- `<template>` détaché, contenu inerte, jamais rendu — on n'en lit que
618
- `textContent` pour compter les caractères. Registre :
619
- docs/SECURITY-PRACTICES.md. */
620
- template.innerHTML = html;
621
- return (template.content.textContent ?? '').trim();
460
+ if (!html) return "";
461
+ if (typeof document === "undefined") return html.replace(/<[^>]*>/g, "").trim();
462
+ const template = document.createElement("template");
463
+ template.innerHTML = html;
464
+ return (template.content.textContent ?? "").trim();
622
465
  }
623
-
624
- /** Keyboard shortcut → tool (the browser applies these natively; we mirror the state). */
625
- const SHORTCUTS = { b: 'bold', i: 'italic', u: 'underline' };
626
- /**
627
- * ui-editor — headless rich-text field, built on the `ui-field` shell (label +
628
- * box + helper) in **multiline** mode + a `contenteditable` area and its toolbar.
629
- *
630
- * Zero third-party engine: the formatting commands live in `ui-editor-commands`,
631
- * the single place that touches the legacy editing API. The value is an HTML
632
- * string, sanitised on the way in (`DomSanitizer`) and normalised to a small tag
633
- * whitelist on paste.
634
- *
635
- * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).
636
- */
637
- class UiEditor extends BaseFormField {
638
- constructor() {
639
- super();
640
- /**
641
- * Tools shown in the toolbar, in order (`separator` draws a divider).
642
- *
643
- * An empty or absent list falls back to the default set: a template binding an
644
- * optional variable (`[tools]="tools"`) hands us `undefined`, which would
645
- * otherwise leave the editor without any formatting at all.
646
- */
647
- this.tools = input(DEFAULT_EDITOR_TOOLS, { ...(ngDevMode ? { debugName: "tools" } : /* istanbul ignore next */ {}), transform: (value) => value?.length ? value : DEFAULT_EDITOR_TOOLS });
648
- /** Hint shown while the editor is empty (no native placeholder on contenteditable). */
649
- this.placeholder = input(/* @ts-ignore */
650
- ...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
651
- /** Minimum height of the editing area, in lines of text. */
652
- this.minRows = input(4, /* @ts-ignore */
653
- ...(ngDevMode ? [{ debugName: "minRows" }] : /* istanbul ignore next */ []));
654
- /** Maximum number of **text** characters (markup is not counted). */
655
- this.maxlength = input(/* @ts-ignore */
656
- ...(ngDevMode ? [undefined, { debugName: "maxlength" }] : /* istanbul ignore next */ []));
657
- /** Shows a character counter under the field (`count` or `count / maxlength`). */
658
- this.showCount = input(false, { ...(ngDevMode ? { debugName: "showCount" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
659
- /** Toolbar placement relative to the editing area. */
660
- this.toolbarPosition = input('top', /* @ts-ignore */
661
- ...(ngDevMode ? [{ debugName: "toolbarPosition" }] : /* istanbul ignore next */ []));
662
- /** Emitted on each edit with the new HTML value. */
663
- this.valueChange = output();
664
- /** Emitted when the editing area receives focus. */
665
- this.editorFocus = output();
666
- /** Emitted when the editing area loses focus. */
667
- this.editorBlur = output();
668
- /** Emitted when the formatting under the caret changes. */
669
- this.selectionChange = output();
670
- /** @ignore */
671
- this.sanitizer = inject(DomSanitizer);
672
- /** @ignore */
673
- this.contentEl = viewChild('contentEl', /* @ts-ignore */
674
- ...(ngDevMode ? [{ debugName: "contentEl" }] : /* istanbul ignore next */ []));
675
- /** @ignore The rendered toolbar — holds the roving tabindex ring, in DOM order. */
676
- this.toolbarEl = viewChild('toolbarEl', /* @ts-ignore */
677
- ...(ngDevMode ? [{ debugName: "toolbarEl" }] : /* istanbul ignore next */ []));
678
- /** @ignore Text color popup (see {@link onColorToolClick}). */
679
- this.textColorPicker = viewChild('textColorPicker', /* @ts-ignore */
680
- ...(ngDevMode ? [{ debugName: "textColorPicker" }] : /* istanbul ignore next */ []));
681
- /** @ignore Highlight color popup (see {@link onColorToolClick}). */
682
- this.highlightColorPicker = viewChild('highlightColorPicker', /* @ts-ignore */
683
- ...(ngDevMode ? [{ debugName: "highlightColorPicker" }] : /* istanbul ignore next */ []));
684
- /**
685
- * @ignore Last HTML this component wrote out.
686
- *
687
- * The editing area owns its own DOM while the user types, so the value cannot be
688
- * bound with `[innerHTML]`: re-rendering it on every keystroke would collapse the
689
- * caret. Instead the DOM is only rewritten when the incoming value differs from
690
- * what we last emitted — i.e. when a form writes to us.
691
- */
692
- this.lastEmitted = '';
693
- /** @ignore Formatting active at the caret. */
694
- this.state = signal(emptyEditorState(), /* @ts-ignore */
695
- ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
696
- /** @ignore Type family at the caret (`null` = the default family). */
697
- this.currentFont = signal(null, /* @ts-ignore */
698
- ...(ngDevMode ? [{ debugName: "currentFont" }] : /* istanbul ignore next */ []));
699
- /** @ignore Text size at the caret (`null` = the default size). */
700
- this.currentSize = signal(null, /* @ts-ignore */
701
- ...(ngDevMode ? [{ debugName: "currentSize" }] : /* istanbul ignore next */ []));
702
- /** @ignore Text color at the caret (`null` = the default color). */
703
- this.currentTextColor = signal(null, /* @ts-ignore */
704
- ...(ngDevMode ? [{ debugName: "currentTextColor" }] : /* istanbul ignore next */ []));
705
- /** @ignore Highlight color at the caret (`null` = no highlight). */
706
- this.currentHighlightColor = signal(null, /* @ts-ignore */
707
- ...(ngDevMode ? [{ debugName: "currentHighlightColor" }] : /* istanbul ignore next */ []));
708
- /** @ignore Index of the toolbar button reachable with Tab (roving tabindex). */
709
- this.activeTool = signal(0, /* @ts-ignore */
710
- ...(ngDevMode ? [{ debugName: "activeTool" }] : /* istanbul ignore next */ []));
711
- /** @ignore Open state of the `textColor` popup (drives its trigger's `aria-expanded`). */
712
- this.textColorPickerOpen = signal(false, /* @ts-ignore */
713
- ...(ngDevMode ? [{ debugName: "textColorPickerOpen" }] : /* istanbul ignore next */ []));
714
- /** @ignore Open state of the `highlightColor` popup (drives its trigger's `aria-expanded`). */
715
- this.highlightColorPickerOpen = signal(false, /* @ts-ignore */
716
- ...(ngDevMode ? [{ debugName: "highlightColorPickerOpen" }] : /* istanbul ignore next */ []));
717
- /**
718
- * @ignore Last selection seen inside the editing area.
719
- *
720
- * The buttons cancel their own mousedown and never take the focus, but opening
721
- * the font dropdown does — and a `contenteditable` loses its selection with it.
722
- * The range is therefore kept here and restored before the command runs.
723
- */
724
- this.savedRange = null;
725
- /** @ignore Sanitised value — never inject `modelValue` into the DOM raw. */
726
- this.safeValue = computed(() => sanitizeEditorHtml(this.modelValue() ?? '', (html) => this.sanitizer.sanitize(SecurityContext.HTML, html) ?? ''), /* @ts-ignore */
727
- ...(ngDevMode ? [{ debugName: "safeValue" }] : /* istanbul ignore next */ []));
728
- /** @ignore Plain-text length, what `maxlength` and the counter measure. */
729
- this.charCount = computed(() => htmlToText(this.safeValue()).length, /* @ts-ignore */
730
- ...(ngDevMode ? [{ debugName: "charCount" }] : /* istanbul ignore next */ []));
731
- /** @ignore Keeps a floating label raised once focus leaves. */
732
- this.isFilled = computed(() => this.charCount() > 0, /* @ts-ignore */
733
- ...(ngDevMode ? [{ debugName: "isFilled" }] : /* istanbul ignore next */ []));
734
- /** @ignore Over the maxlength (only reachable programmatically). */
735
- this.overLimit = computed(() => {
736
- const max = this.maxlength();
737
- return max != null && this.charCount() > max;
738
- }, /* @ts-ignore */
739
- ...(ngDevMode ? [{ debugName: "overLimit" }] : /* istanbul ignore next */ []));
740
- /** @ignore The placeholder only shows while there is nothing to read. */
741
- this.showPlaceholder = computed(() => !!this.placeholder() && !this.hasFloatLabel() && this.charCount() === 0, /* @ts-ignore */
742
- ...(ngDevMode ? [{ debugName: "showPlaceholder" }] : /* istanbul ignore next */ []));
743
- /** @ignore The area is editable (a read-only editor keeps its caret but not its edits). */
744
- this.isEditable = computed(() => !this.isDisabled() && !this.readonly(), /* @ts-ignore */
745
- ...(ngDevMode ? [{ debugName: "isEditable" }] : /* istanbul ignore next */ []));
746
- /** @ignore Resolved toolbar entries (icon + accessible name + toggle state). */
747
- this.toolbar = computed(() => this.tools().map((tool, index) => ({
748
- tool,
749
- index,
750
- isSeparator: tool === 'separator',
751
- select: (EDITOR_SELECT_TOOLS.includes(tool)
752
- ? tool
753
- : null),
754
- buttonTool: (tool === 'separator' || EDITOR_SELECT_TOOLS.includes(tool)
755
- ? null
756
- : tool),
757
- meta: tool === 'separator' || EDITOR_SELECT_TOOLS.includes(tool)
758
- ? null
759
- : EDITOR_TOOL_META[tool],
760
- })), /* @ts-ignore */
761
- ...(ngDevMode ? [{ debugName: "toolbar" }] : /* istanbul ignore next */ []));
762
- /** @ignore Text sizes offered by the `fontSize` dropdown. */
763
- this.sizes = EDITOR_SIZES;
764
- /**
765
- * @ignore Type families, labelled with the face each token actually resolves to.
766
- *
767
- * Read once the view exists, since the value comes from the computed style: a
768
- * hardcoded "Inter" would lie as soon as a project rebinds the token.
769
- */
770
- this.fonts = signal(EDITOR_FONTS.map((f) => ({ ...f })), /* @ts-ignore */
771
- ...(ngDevMode ? [{ debugName: "fonts" }] : /* istanbul ignore next */ []));
772
- /** @ignore `fontFamily` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */
773
- this.fontFamilyOptions = computed(() => this.fonts().map((font) => ({ value: font.key, label: font.label })), /* @ts-ignore */
774
- ...(ngDevMode ? [{ debugName: "fontFamilyOptions" }] : /* istanbul ignore next */ []));
775
- /** @ignore `fontSize` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */
776
- this.fontSizeOptions = computed(() => this.sizes.map((size) => ({ value: size.key, label: size.label })), /* @ts-ignore */
777
- ...(ngDevMode ? [{ debugName: "fontSizeOptions" }] : /* istanbul ignore next */ []));
778
- /** @ignore Swatch entry backing the `textColor` button's color indicator. */
779
- this.currentTextColorSwatch = computed(() => EDITOR_COLORS.find((c) => c.key === this.currentTextColor()), /* @ts-ignore */
780
- ...(ngDevMode ? [{ debugName: "currentTextColorSwatch" }] : /* istanbul ignore next */ []));
781
- /** @ignore Swatch entry backing the `highlightColor` button's color indicator. */
782
- this.currentHighlightColorSwatch = computed(() => EDITOR_HIGHLIGHTS.find((c) => c.key === this.currentHighlightColor()), /* @ts-ignore */
783
- ...(ngDevMode ? [{ debugName: "currentHighlightColorSwatch" }] : /* istanbul ignore next */ []));
784
- /** @ignore The toolbar has at least one actionable entry. */
785
- this.hasToolbar = computed(() => this.tools().some((t) => t !== 'separator'), /* @ts-ignore */
786
- ...(ngDevMode ? [{ debugName: "hasToolbar" }] : /* istanbul ignore next */ []));
787
- /**
788
- * @ignore Index carrying the toolbar's single tab stop.
789
- *
790
- * Falls back to the first actionable tool, so a `tools` list opening on a
791
- * separator still leaves the toolbar reachable with Tab.
792
- */
793
- this.tabStop = computed(() => {
794
- const actionable = this.toolbar().filter((entry) => !entry.isSeparator);
795
- if (!actionable.length)
796
- return -1;
797
- const active = this.activeTool();
798
- return actionable.some((entry) => entry.index === active) ? active : actionable[0].index;
799
- }, /* @ts-ignore */
800
- ...(ngDevMode ? [{ debugName: "tabStop" }] : /* istanbul ignore next */ []));
801
- /** @ignore id of the character counter (for `aria-describedby`). */
802
- this.countId = computed(() => `${this.resolvedId()}-count`, /* @ts-ignore */
803
- ...(ngDevMode ? [{ debugName: "countId" }] : /* istanbul ignore next */ []));
804
- /** @ignore `aria-describedby` combines the message and the counter, whichever are shown. */
805
- this.describedByIds = computed(() => {
806
- const ids = [
807
- this.displayMessage() ? this.messageId() : null,
808
- this.showCount() ? this.countId() : null,
809
- ].filter(Boolean);
810
- return ids.length ? ids.join(' ') : null;
811
- }, /* @ts-ignore */
812
- ...(ngDevMode ? [{ debugName: "describedByIds" }] : /* istanbul ignore next */ []));
813
- // Label each family with the face its token actually resolves to.
814
- afterNextRender(() => {
815
- this.fonts.set(EDITOR_FONTS.map((f) => ({ ...f, label: resolveFontLabel(f.cssVar, f.label) })));
816
- });
817
- // Sync the DOM when the value comes from outside (form write, reset).
818
- effect(() => {
819
- const value = this.safeValue();
820
- const el = this.contentEl()?.nativeElement;
821
- if (!el)
822
- return;
823
- // Our own edit read back, or already on screen: rewriting would collapse the
824
- // caret. Raw value on purpose: sanitising re-encodes it (`é` → `&#233;`).
825
- if (this.modelValue() === this.lastEmitted || el.innerHTML === value)
826
- return;
827
- /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :
828
- `value` vient de `safeValue()`, donc de
829
- `DomSanitizer.sanitize(SecurityContext.HTML, …)`, plus le seul `style`
830
- d'alignement et de retrait de `sanitizeStyle()`. L'écriture directe est
831
- imposée par le `contenteditable` : une liaison `[innerHTML]` réécrirait
832
- la zone à chaque frappe et effondrerait le caret. Registre :
833
- docs/SECURITY-PRACTICES.md. */
834
- el.innerHTML = value;
835
- this.lastEmitted = value;
836
- });
837
- }
838
- /** @ignore Auto-generated ids read as `ui-editor-*`. */
839
- uidPrefix() {
840
- return 'ui-editor';
841
- }
842
- /** Focuses the editing area. */
843
- focus(options) {
844
- this.contentEl()?.nativeElement.focus(options);
845
- }
846
- // --- Editing ----------------------------------------------------------
847
- /** @ignore Input: single source of the value (view → form). */
848
- onInput() {
849
- const el = this.contentEl()?.nativeElement;
850
- if (!el)
851
- return;
852
- const html = isEmptyHtml(el.innerHTML) ? '' : el.innerHTML;
853
- this.lastEmitted = html;
854
- this.modelValue.set(html);
855
- this.emitChange(html);
856
- this.valueChange.emit(html);
857
- this.refreshState();
858
- }
859
- /**
860
- * @ignore Enforces `maxlength` on the text, not the markup.
861
- *
862
- * Deletions and formatting must stay available once the limit is reached, so only
863
- * the insertion intents are cancelled.
864
- */
865
- onBeforeInput(event) {
866
- const max = this.maxlength();
867
- if (max == null || !event.inputType.startsWith('insert'))
868
- return;
869
- const selection = document.getSelection();
870
- const replaced = selection && !selection.isCollapsed ? selection.toString().length : 0;
871
- const incoming = event.data?.length ?? 1;
872
- if (this.charCount() - replaced + incoming > max)
873
- event.preventDefault();
874
- }
875
- /** @ignore Paste is reduced to the editor's own tag whitelist. */
876
- onPaste(event) {
877
- if (!this.isEditable())
878
- return;
879
- event.preventDefault();
880
- const clipboard = event.clipboardData;
881
- if (!clipboard)
882
- return;
883
- const html = clipboard.getData('text/html');
884
- if (html) {
885
- const safe = this.sanitizer.sanitize(SecurityContext.HTML, normalizeHtml(html)) ?? '';
886
- insertHtml(safe);
887
- // `insertHTML` re-decorates what it inserted; strip that back off in place.
888
- const el = this.contentEl()?.nativeElement;
889
- if (el)
890
- scrubInPlace(el);
891
- }
892
- else {
893
- insertText(clipboard.getData('text/plain'));
894
- }
895
- this.onInput();
896
- }
897
- /** @ignore The browser applies Ctrl/Cmd+B/I/U itself; we only mirror the state. */
898
- onContentKeydown(event) {
899
- if (!(event.metaKey || event.ctrlKey))
900
- return;
901
- if (!SHORTCUTS[event.key.toLowerCase()])
902
- return;
903
- // Let the native shortcut run, then read the resulting formatting back.
904
- queueMicrotask(() => this.refreshState());
905
- }
906
- /** @ignore */
907
- onBlur(event) {
908
- this.emitTouch();
909
- this.editorBlur.emit(event);
910
- }
911
- /** @ignore Recomputes the active formatting and notifies the consumer. */
912
- refreshState() {
913
- this.rememberSelection();
914
- const anchor = document.getSelection()?.anchorNode ?? null;
915
- this.currentFont.set(readFontFamily(anchor));
916
- this.currentSize.set(readFontSize(anchor));
917
- this.currentTextColor.set(readTextColor(anchor));
918
- this.currentHighlightColor.set(readHighlightColor(anchor));
919
- const next = readEditorState();
920
- const prev = this.state();
921
- if (Object.keys(next).every((k) => next[k] === prev[k]))
922
- return;
923
- this.state.set(next);
924
- this.selectionChange.emit(next);
925
- }
926
- /** @ignore Keeps the caret position around for controls that steal the focus. */
927
- rememberSelection() {
928
- const el = this.contentEl()?.nativeElement;
929
- const selection = document.getSelection();
930
- if (!el || !selection?.rangeCount)
931
- return;
932
- const range = selection.getRangeAt(0);
933
- if (el.contains(range.commonAncestorContainer))
934
- this.savedRange = range.cloneRange();
935
- }
936
- /** @ignore Puts the remembered caret back before running a command. */
937
- restoreSelection() {
938
- this.focus();
939
- const range = this.savedRange;
940
- if (!range)
941
- return;
942
- const selection = document.getSelection();
943
- selection?.removeAllRanges();
944
- selection?.addRange(range);
945
- }
946
- // --- Toolbar ----------------------------------------------------------
947
- /** @ignore Runs a button tool against the selection the mousedown handler preserved. */
948
- runTool(tool, index, event) {
949
- if (!this.isEditable())
950
- return;
951
- this.activeTool.set(index);
952
- if (tool === 'textColor' || tool === 'highlightColor') {
953
- this.onColorToolClick(tool, event);
954
- return;
955
- }
956
- this.focus();
957
- if (tool === 'link')
958
- this.promptForLink();
959
- else if (tool === 'codeBlock')
960
- toggleCodeBlock();
961
- else if (tool === 'clearFormat')
962
- this.clearFormat();
963
- else
964
- applyCommand(tool);
965
- this.onInput();
966
- }
967
- /**
968
- * @ignore `removeFormat` (the native command behind `clearFormat`) only
969
- * strips inline formatting the browser itself applies — bold, italic,
970
- * underline… — never the `<span class="ui-editor-*">` wrappers `fontFamily`/
971
- * `fontSize`/`textColor`/`highlightColor` write, so those survived
972
- * "Effacer le formatage" untouched. Run the native command, then unwrap
973
- * those classes too, across whatever is currently selected.
974
- */
975
- clearFormat() {
976
- applyCommand('clearFormat');
977
- const el = this.contentEl()?.nativeElement;
978
- const selection = document.getSelection();
979
- if (!el || !selection?.rangeCount)
980
- return;
981
- const range = selection.getRangeAt(0);
982
- if (!el.contains(range.commonAncestorContainer))
983
- return;
984
- clearFormatMarkers(el, range);
985
- }
986
- /**
987
- * @ignore Trigger click for `textColor`/`highlightColor`: opens the matching
988
- * `ui-swatch-picker` instead of applying a command directly — same
989
- * "picker takes the focus, the caret is restored before the real command
990
- * runs" pattern as {@link onSelectMenuTrigger}, but these two are button
991
- * tools (a one-shot action button, not a value dropdown), so they run
992
- * through `runTool` rather than `onSelectChange`.
993
- */
994
- onColorToolClick(tool, event) {
995
- this.rememberSelection();
996
- const picker = tool === 'textColor' ? this.textColorPicker() : this.highlightColorPicker();
997
- picker?.toggle(event);
998
- }
999
- /**
1000
- * @ignore Applies the text color chosen in the `textColor` picker.
1001
- *
1002
- * The popup took the focus, so the caret is put back first. `foreColor`
1003
- * emits a legacy `<font>` element, immediately rewritten into a class.
1004
- */
1005
- onTextColorSelect(swatch) {
1006
- if (!this.isEditable())
1007
- return;
1008
- this.restoreSelection();
1009
- const el = this.contentEl()?.nativeElement;
1010
- if (swatch) {
1011
- applyTextColor();
1012
- if (el)
1013
- convertColorMarkers(el, `ui-editor-color-${swatch.key}`);
1014
- }
1015
- else if (el && this.savedRange) {
1016
- for (const color of EDITOR_COLORS)
1017
- clearMarkerClass(el, this.savedRange, color.className);
1018
- }
1019
- this.onInput();
1020
- }
1021
- /**
1022
- * @ignore Applies the highlight color chosen in the `highlightColor` picker.
1023
- *
1024
- * The popup took the focus, so the caret is put back first. `hiliteColor`
1025
- * emits a `<span style="background-color:…">`, immediately rewritten into a
1026
- * class (see {@link convertHighlightMarkers}).
1027
- */
1028
- onHighlightColorSelect(swatch) {
1029
- if (!this.isEditable())
1030
- return;
1031
- this.restoreSelection();
1032
- const el = this.contentEl()?.nativeElement;
1033
- if (swatch) {
1034
- applyHighlightColor();
1035
- if (el)
1036
- convertHighlightMarkers(el, `ui-editor-highlight-${swatch.key}`);
1037
- }
1038
- else if (el && this.savedRange) {
1039
- for (const color of EDITOR_HIGHLIGHTS) {
1040
- clearMarkerClass(el, this.savedRange, color.className);
1041
- }
1042
- }
1043
- this.onInput();
1044
- }
1045
- /** @ignore Options for a `ui-select` dropdown ({@link UiSelect} `optionLabel`/`optionValue`). */
1046
- selectOptions(tool) {
1047
- return tool === 'fontFamily' ? this.fontFamilyOptions() : this.fontSizeOptions();
1048
- }
1049
- /**
1050
- * @ignore Current value of a `ui-select` dropdown, so it reflects the caret.
1051
- *
1052
- * Falls back to the value actually in force when no class was applied: text
1053
- * carrying no class really is rendered with `--fontfamily-base` at the
1054
- * default size, so naming it states a fact rather than a placeholder.
1055
- */
1056
- selectValue(tool) {
1057
- if (tool === 'fontFamily')
1058
- return this.currentFont() ?? 'base';
1059
- return this.currentSize() ?? 'default';
1060
- }
1061
- /** @ignore Accessible name of a dropdown — spelled out, it is never truncated. */
1062
- selectLabel(tool) {
1063
- if (tool === 'fontFamily')
1064
- return 'Police';
1065
- return 'Taille du texte';
1066
- }
1067
- /**
1068
- * @ignore Applies the value chosen in a `ui-select` dropdown.
1069
- *
1070
- * `ui-select` opens its own overlay and takes the focus, so the caret is put
1071
- * back first — same reasoning as the color pickers. `fontName`/`fontSize`
1072
- * each emit a legacy `<font>` element, immediately rewritten into a class.
1073
- */
1074
- onSelectValueChange(tool, value, index) {
1075
- this.activeTool.set(index);
1076
- if (!this.isEditable() || value == null)
1077
- return;
1078
- this.restoreSelection();
1079
- const el = this.contentEl()?.nativeElement;
1080
- if (tool === 'fontFamily') {
1081
- const choice = this.fonts().find((f) => f.key === value);
1082
- if (!choice)
1083
- return;
1084
- applyFontFamily();
1085
- if (el)
1086
- convertFontMarkers(el, choice.className);
1087
- }
1088
- else {
1089
- const choice = this.sizes.find((s) => s.key === value);
1090
- if (!choice)
1091
- return;
1092
- applyFontSize();
1093
- if (el)
1094
- convertSizeMarkers(el, choice.className);
1095
- }
1096
- this.onInput();
1097
- }
1098
- /**
1099
- * @ignore v1 link flow: the native prompt.
1100
- *
1101
- * Deliberately minimal — a popover with a `ui-input` is the planned replacement,
1102
- * and it changes the component's overlay footprint, not this call site.
1103
- */
1104
- promptForLink() {
1105
- const href = window.prompt('Adresse du lien (laisser vide pour retirer le lien)');
1106
- if (href === null)
1107
- return;
1108
- if (href.trim() === '')
1109
- removeLink();
1110
- else
1111
- applyLink(href.trim());
1112
- }
1113
- /** @ignore Keeps the caret in the editing area when a tool is clicked. */
1114
- onToolbarMousedown(event) {
1115
- event.preventDefault();
1116
- }
1117
- /** @ignore Roving tabindex: the toolbar is one tab stop, arrows move within it. */
1118
- onToolbarKeydown(event) {
1119
- const indexes = this.toolbar()
1120
- .filter((entry) => !entry.isSeparator)
1121
- .map((entry) => entry.index);
1122
- if (!indexes.length)
1123
- return;
1124
- const current = Math.max(0, indexes.indexOf(this.tabStop()));
1125
- let next;
1126
- switch (event.key) {
1127
- case 'ArrowRight':
1128
- next = indexes[(current + 1) % indexes.length];
1129
- break;
1130
- case 'ArrowLeft':
1131
- next = indexes[(current - 1 + indexes.length) % indexes.length];
1132
- break;
1133
- case 'Home':
1134
- next = indexes[0];
1135
- break;
1136
- case 'End':
1137
- next = indexes[indexes.length - 1];
1138
- break;
1139
- case 'Escape':
1140
- event.preventDefault();
1141
- this.focus();
1142
- return;
1143
- default:
1144
- return;
1145
- }
1146
- event.preventDefault();
1147
- this.activeTool.set(next);
1148
- this.focusTool(next);
1149
- }
1150
- /**
1151
- * @ignore Moves the DOM focus onto the control now holding the tab stop.
1152
- *
1153
- * Queried from the live toolbar rather than from the `ui-button` children:
1154
- * DOM order is the visual order, and every tool (buttons and select-menu
1155
- * triggers alike) renders as a `<button>`.
1156
- */
1157
- focusTool(index) {
1158
- const position = this.toolbar().filter((e) => !e.isSeparator && e.index <= index).length - 1;
1159
- const controls = this.toolbarEl()?.nativeElement.querySelectorAll('button');
1160
- controls?.[position]?.focus();
1161
- }
1162
- /**
1163
- * @ignore `var(--primitives-…)` for the `textColor`/`highlightColor`
1164
- * buttons' color indicator, or `null` for every other tool (no swatch
1165
- * active, or a tool the indicator does not apply to).
1166
- */
1167
- colorIndicatorVar(tool) {
1168
- const swatch = tool === 'textColor'
1169
- ? this.currentTextColorSwatch()
1170
- : tool === 'highlightColor'
1171
- ? this.currentHighlightColorSwatch()
1172
- : null;
1173
- return swatch ? `var(${swatch.cssVar})` : null;
1174
- }
1175
- /**
1176
- * @ignore Native attributes forwarded to a tool button.
1177
- *
1178
- * `aria-pressed` only on the toggles: `link` and `clearFormat` are one-shot
1179
- * actions, and a permanently unpressed toggle would misreport them.
1180
- * `textColor`/`highlightColor` forward `aria-haspopup`/`aria-expanded`
1181
- * instead — they open a `ui-swatch-picker` popup, not a toggle.
1182
- */
1183
- toolProps(tool) {
1184
- if (tool === 'textColor' || tool === 'highlightColor') {
1185
- const open = tool === 'textColor' ? this.textColorPickerOpen() : this.highlightColorPickerOpen();
1186
- return { 'aria-haspopup': 'true', 'aria-expanded': open ? 'true' : 'false' };
1187
- }
1188
- const state = this.state();
1189
- if (!(tool in state))
1190
- return undefined;
1191
- return { 'aria-pressed': state[tool] ? 'true' : 'false' };
1192
- }
1193
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiEditor, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1194
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiEditor, isStandalone: true, selector: "ui-editor", inputs: { tools: { classPropertyName: "tools", publicName: "tools", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minRows: { classPropertyName: "minRows", publicName: "minRows", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, toolbarPosition: { classPropertyName: "toolbarPosition", publicName: "toolbarPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", editorFocus: "editorFocus", editorBlur: "editorBlur", selectionChange: "selectionChange" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiEditor), multi: true }], viewQueries: [{ propertyName: "contentEl", first: true, predicate: ["contentEl"], descendants: true, isSignal: true }, { propertyName: "toolbarEl", first: true, predicate: ["toolbarEl"], descendants: true, isSignal: true }, { propertyName: "textColorPicker", first: true, predicate: ["textColorPicker"], descendants: true, isSignal: true }, { propertyName: "highlightColorPicker", first: true, predicate: ["highlightColorPicker"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ui-field\n multiline\n [label]=\"label()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n [hasFooter]=\"showCount()\"\n>\n <div class=\"ui-editor\" [class._small]=\"size() === 'small'\" [style.--_rows]=\"minRows()\">\n @if (toolbarPosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n\n <div class=\"ui-editor-area\">\n <div\n #contentEl\n class=\"ui-editor-content\"\n [class._small]=\"size() === 'small'\"\n [id]=\"resolvedId()\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"isEditable() ? 'true' : 'false'\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"describedByIds()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (beforeinput)=\"onBeforeInput($any($event))\"\n (paste)=\"onPaste($event)\"\n (keydown)=\"onContentKeydown($event)\"\n (keyup)=\"refreshState()\"\n (mouseup)=\"refreshState()\"\n (focus)=\"editorFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n\n @if (showPlaceholder()) {\n <span class=\"ui-editor-placeholder\" aria-hidden=\"true\">{{ placeholder() }}</span>\n }\n </div>\n\n @if (toolbarPosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n </div>\n\n @if (showCount()) {\n <span\n uiFieldFooter\n class=\"ui-editor-count\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n [class._over]=\"overLimit()\"\n [attr.id]=\"countId()\"\n >\n {{ charCount() }}\n @if (maxlength(); as max) {\n &nbsp;/&nbsp;{{ max }}\n }\n </span>\n }\n</ui-field>\n\n<ng-template #toolbarTpl>\n @if (hasToolbar()) {\n <!-- ARIA toolbar pattern: keyboard delegated to the role=\"toolbar\" container,\n focus lives on the items (roving tabindex), same as ui-menu. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n #toolbarEl\n class=\"ui-editor-toolbar\"\n [class._bottom]=\"toolbarPosition() === 'bottom'\"\n role=\"toolbar\"\n aria-label=\"Mise en forme\"\n aria-orientation=\"horizontal\"\n (mousedown)=\"onToolbarMousedown($event)\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (entry of toolbar(); track entry.index) {\n @if (entry.isSeparator) {\n <span class=\"ui-editor-toolbar-separator\" aria-hidden=\"true\"></span>\n } @else if (entry.select; as select) {\n <!-- The dropdown takes the focus, so the command restores the caret\n before it runs (see onSelectValueChange). -->\n <ui-select\n class=\"ui-editor-tool ui-editor-select\"\n size=\"small\"\n [options]=\"selectOptions(select)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"selectValue(select)\"\n [ariaLabel]=\"selectLabel(select)\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n (valueChange)=\"onSelectValueChange(select, $event, entry.index)\"\n />\n } @else {\n <ui-button\n class=\"ui-editor-tool\"\n [class._colorTool]=\"\n entry.buttonTool === 'textColor' || entry.buttonTool === 'highlightColor'\n \"\n variant=\"ghost\"\n level=\"low\"\n size=\"small\"\n iconOnly\n [icon]=\"entry.meta!.icon\"\n [ariaLabel]=\"entry.meta!.label\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n [buttonProps]=\"toolProps(entry.buttonTool!)\"\n [style.--ui-editor-swatch-indicator-color]=\"colorIndicatorVar(entry.buttonTool)\"\n (buttonClick)=\"runTool(entry.buttonTool!, entry.index, $event)\"\n />\n }\n }\n\n <!-- `textColor`/`highlightColor` popups: no trigger of their own (same\n composition contract as `ui-menu`), opened via `runTool` ->\n `onColorToolClick` -> `toggle(event)`. -->\n <ui-swatch-picker\n #textColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentTextColor()\"\n ariaLabel=\"Couleur du texte\"\n (swatchSelect)=\"onTextColorSelect($event)\"\n (opened)=\"textColorPickerOpen.set(true)\"\n (closed)=\"textColorPickerOpen.set(false)\"\n />\n <ui-swatch-picker\n #highlightColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentHighlightColor()\"\n ariaLabel=\"Couleur de surlignage\"\n (swatchSelect)=\"onHighlightColorSelect($event)\"\n (opened)=\"highlightColorPickerOpen.set(true)\"\n (closed)=\"highlightColorPickerOpen.set(false)\"\n />\n </div>\n }\n</ng-template>\n", styles: [".ui-editor{display:flex;flex:1 1 auto;flex-direction:column;min-width:0;border-radius:var(--ui-editor-radius, inherit);overflow:hidden}.ui-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-editor-toolbar-gap, var(--units-2xs));flex-shrink:0;padding:var(--ui-editor-toolbar-padding-y, var(--units-2xs)) var(--ui-editor-toolbar-padding-x, var(--units-xs));background-color:var(--ui-editor-toolbar-surface, var(--global-background-muted));border-block-end:var(--ui-editor-toolbar-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-editor-toolbar-stroke, var(--form-low-stroke-default))}.ui-editor-toolbar._bottom{border-block-end:none;border-block-start:var(--ui-editor-toolbar-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-editor-toolbar-stroke, var(--form-low-stroke-default))}.ui-editor-toolbar-separator{flex-shrink:0;inline-size:var(--ui-editor-separator-width, var(--stroke-sm));block-size:var(--ui-editor-separator-height, var(--size-typography-text-default));background-color:var(--ui-editor-separator-color, var(--form-low-stroke-default))}.ui-editor-select{display:inline-flex;flex-shrink:0;min-inline-size:var(--ui-editor-select-width, 13ch);--ui-field-stroke-width: 0}.ui-editor-select ::ng-deep .ui-select{inline-size:100%}.ui-editor-select ::ng-deep .ui-field-box{background:transparent;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-editor-select ::ng-deep .ui-field-box:hover{background-color:var(--ui-editor-toolbar-select-surface-hover, var(--form-low-surface-hover))}.ui-editor-tool._colorTool{position:relative}.ui-editor-tool._colorTool:after{content:\"\";position:absolute;inset-inline:var(--ui-editor-swatch-indicator-offset-x, var(--units-2xs));inset-block-end:0;block-size:var(--ui-editor-swatch-indicator-height, var(--stroke-lg));border-radius:var(--ui-editor-swatch-indicator-height, var(--stroke-lg));background-color:var(--ui-editor-swatch-indicator-color, transparent)}.ui-editor-area{position:relative;display:flex;flex:1 1 auto;min-height:0}.ui-editor-content{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-editor-content::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-editor-content:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-editor-content{box-sizing:border-box;width:100%;min-height:var(--ui-editor-min-height, calc(var(--_rows, 4) * var(--ui-editor-line-height, 1.5) * 1em));max-height:var(--ui-editor-max-height, none);padding:var(--ui-editor-padding-y, var(--ui-form-textarea-padding-y, var(--units-default))) var(--ui-editor-padding-x, var(--ui-form-field-padding-x, var(--units-md)));overflow-y:auto;line-height:var(--ui-editor-line-height, 1.5);font-size:var(--ui-editor-font-size, var(--size-typography-text-default));overflow-wrap:break-word}.ui-editor-content._small{padding-block:var(--ui-editor-padding-y-small, var(--ui-form-textarea-padding-y-small, var(--units-md)));font-size:var(--ui-editor-font-size-small, var(--size-typography-text-md))}.ui-editor-content:focus,.ui-editor-content:focus-visible{outline:none}.ui-editor-content[contenteditable=false]{cursor:default}.ui-editor-placeholder{position:absolute;inset-block-start:var(--ui-editor-padding-y, var(--ui-form-textarea-padding-y, var(--units-default)));inset-inline-start:var(--ui-editor-padding-x, var(--ui-form-field-padding-x, var(--units-md)));line-height:var(--ui-editor-line-height, 1.5);font-family:var(--ui-editor-placeholder-font-family, var(--fontfamily-base));font-size:var(--ui-editor-font-size, var(--size-typography-text-default));color:var(--ui-editor-placeholder-color, var(--form-low-content-default));pointer-events:none;-webkit-user-select:none;user-select:none}.ui-editor._small .ui-editor-placeholder{inset-block-start:var(--ui-editor-padding-y-small, var(--ui-form-textarea-padding-y-small, var(--units-md)));font-size:var(--ui-editor-font-size-small, var(--size-typography-text-md))}.ui-editor-content ::ng-deep p{margin-block:0 var(--ui-editor-block-gap, var(--units-sm))}.ui-editor-content ::ng-deep p:last-child{margin-block-end:0}.ui-editor-content ::ng-deep ul,.ui-editor-content ::ng-deep ol{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));padding-inline-start:var(--ui-editor-list-padding-inline-start, var(--units-xl))}.ui-editor-content ::ng-deep ul:last-child,.ui-editor-content ::ng-deep ol:last-child{margin-block-end:0}.ui-editor-content ::ng-deep li+li{margin-block-start:var(--ui-editor-list-item-gap, var(--units-2xs))}.ui-editor-content ::ng-deep b,.ui-editor-content ::ng-deep strong{font-weight:var(--ui-editor-bold-weight, var(--weight-bold))}.ui-editor-content ::ng-deep a{color:var(--ui-editor-link-color, var(--global-text-brand));text-decoration:var(--ui-editor-link-text-decoration, underline)}.ui-editor-content ::ng-deep pre{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));padding:var(--ui-editor-code-padding-y, var(--units-sm)) var(--ui-editor-code-padding-x, var(--units-md));border-radius:var(--ui-editor-code-radius, var(--radius-xs));background-color:var(--ui-editor-code-surface, var(--global-background-muted));color:var(--ui-editor-code-color, var(--global-text-default));font-family:var(--ui-editor-code-font-family, var(--fontfamily-monospace));font-size:var(--ui-editor-code-font-size, var(--size-typography-text-md));white-space:pre-wrap;overflow-wrap:break-word}.ui-editor-content ::ng-deep pre:last-child{margin-block-end:0}.ui-editor-content ::ng-deep code{font-family:var(--ui-editor-code-font-family, var(--fontfamily-monospace))}.ui-editor-content ::ng-deep h1,.ui-editor-content ::ng-deep h2,.ui-editor-content ::ng-deep h3{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));font-family:var(--ui-editor-heading-font-family, var(--fontfamily-title));font-weight:var(--ui-editor-heading-weight, var(--weight-bold));line-height:var(--ui-editor-heading-line-height, 1.25)}.ui-editor-content ::ng-deep h1:last-child,.ui-editor-content ::ng-deep h2:last-child,.ui-editor-content ::ng-deep h3:last-child{margin-block-end:0}.ui-editor-content ::ng-deep h1{font-size:var(--ui-editor-heading-1-font-size, var(--size-typography-title-lg))}.ui-editor-content ::ng-deep h2{font-size:var(--ui-editor-heading-2-font-size, var(--size-typography-title-md))}.ui-editor-content ::ng-deep h3{font-size:var(--ui-editor-heading-3-font-size, var(--size-typography-title-sm))}.ui-editor-content ::ng-deep .ui-editor-font-base{font-family:var(--fontfamily-base)}.ui-editor-content ::ng-deep .ui-editor-font-title{font-family:var(--fontfamily-title)}.ui-editor-content ::ng-deep .ui-editor-font-monospace{font-family:var(--fontfamily-monospace)}.ui-editor-content ::ng-deep .ui-editor-size-sm{font-size:var(--ui-editor-size-sm-font-size, var(--size-typography-text-sm))}.ui-editor-content ::ng-deep .ui-editor-size-default{font-size:var(--ui-editor-size-default-font-size, var(--size-typography-text-default))}.ui-editor-content ::ng-deep .ui-editor-size-lg{font-size:var(--ui-editor-size-lg-font-size, var(--size-typography-text-lg))}.ui-editor-content ::ng-deep .ui-editor-size-xl{font-size:var(--ui-editor-size-xl-font-size, var(--size-typography-text-xl))}.ui-editor-content ::ng-deep .ui-editor-color-primary-900{color:var(--primitives-primary-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-900{background-color:var(--primitives-primary-900)}.ui-editor-content ::ng-deep .ui-editor-color-primary-700{color:var(--primitives-primary-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-700{background-color:var(--primitives-primary-700)}.ui-editor-content ::ng-deep .ui-editor-color-primary-500{color:var(--primitives-primary-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-500{background-color:var(--primitives-primary-500)}.ui-editor-content ::ng-deep .ui-editor-color-primary-300{color:var(--primitives-primary-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-300{background-color:var(--primitives-primary-300)}.ui-editor-content ::ng-deep .ui-editor-color-primary-100{color:var(--primitives-primary-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-100{background-color:var(--primitives-primary-100)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-900{color:var(--primitives-secondary-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-900{background-color:var(--primitives-secondary-900)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-700{color:var(--primitives-secondary-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-700{background-color:var(--primitives-secondary-700)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-500{color:var(--primitives-secondary-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-500{background-color:var(--primitives-secondary-500)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-300{color:var(--primitives-secondary-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-300{background-color:var(--primitives-secondary-300)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-100{color:var(--primitives-secondary-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-100{background-color:var(--primitives-secondary-100)}.ui-editor-content ::ng-deep .ui-editor-color-green-900{color:var(--primitives-green-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-900{background-color:var(--primitives-green-900)}.ui-editor-content ::ng-deep .ui-editor-color-green-700{color:var(--primitives-green-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-700{background-color:var(--primitives-green-700)}.ui-editor-content ::ng-deep .ui-editor-color-green-500{color:var(--primitives-green-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-500{background-color:var(--primitives-green-500)}.ui-editor-content ::ng-deep .ui-editor-color-green-300{color:var(--primitives-green-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-300{background-color:var(--primitives-green-300)}.ui-editor-content ::ng-deep .ui-editor-color-green-100{color:var(--primitives-green-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-100{background-color:var(--primitives-green-100)}.ui-editor-content ::ng-deep .ui-editor-color-orange-900{color:var(--primitives-orange-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-900{background-color:var(--primitives-orange-900)}.ui-editor-content ::ng-deep .ui-editor-color-orange-700{color:var(--primitives-orange-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-700{background-color:var(--primitives-orange-700)}.ui-editor-content ::ng-deep .ui-editor-color-orange-500{color:var(--primitives-orange-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-500{background-color:var(--primitives-orange-500)}.ui-editor-content ::ng-deep .ui-editor-color-orange-300{color:var(--primitives-orange-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-300{background-color:var(--primitives-orange-300)}.ui-editor-content ::ng-deep .ui-editor-color-orange-100{color:var(--primitives-orange-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-100{background-color:var(--primitives-orange-100)}.ui-editor-content ::ng-deep .ui-editor-color-red-900{color:var(--primitives-red-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-900{background-color:var(--primitives-red-900)}.ui-editor-content ::ng-deep .ui-editor-color-red-700{color:var(--primitives-red-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-700{background-color:var(--primitives-red-700)}.ui-editor-content ::ng-deep .ui-editor-color-red-500{color:var(--primitives-red-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-500{background-color:var(--primitives-red-500)}.ui-editor-content ::ng-deep .ui-editor-color-red-300{color:var(--primitives-red-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-300{background-color:var(--primitives-red-300)}.ui-editor-content ::ng-deep .ui-editor-color-red-100{color:var(--primitives-red-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-100{background-color:var(--primitives-red-100)}.ui-editor-content ::ng-deep .ui-editor-color-slate-900{color:var(--primitives-slate-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-900{background-color:var(--primitives-slate-900)}.ui-editor-content ::ng-deep .ui-editor-color-slate-700{color:var(--primitives-slate-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-700{background-color:var(--primitives-slate-700)}.ui-editor-content ::ng-deep .ui-editor-color-slate-500{color:var(--primitives-slate-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-500{background-color:var(--primitives-slate-500)}.ui-editor-content ::ng-deep .ui-editor-color-slate-300{color:var(--primitives-slate-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-300{background-color:var(--primitives-slate-300)}.ui-editor-content ::ng-deep .ui-editor-color-slate-100{color:var(--primitives-slate-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-100{background-color:var(--primitives-slate-100)}.ui-editor-content ::ng-deep .ui-editor-color-grey-900{color:var(--primitives-grey-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-900{background-color:var(--primitives-grey-900)}.ui-editor-content ::ng-deep .ui-editor-color-grey-700{color:var(--primitives-grey-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-700{background-color:var(--primitives-grey-700)}.ui-editor-content ::ng-deep .ui-editor-color-grey-500{color:var(--primitives-grey-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-500{background-color:var(--primitives-grey-500)}.ui-editor-content ::ng-deep .ui-editor-color-grey-300{color:var(--primitives-grey-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-300{background-color:var(--primitives-grey-300)}.ui-editor-content ::ng-deep .ui-editor-color-grey-100{color:var(--primitives-grey-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-100{background-color:var(--primitives-grey-100)}.ui-editor-content ::ng-deep .ui-editor-color-black{color:var(--primitives-black-base)}.ui-editor-content ::ng-deep .ui-editor-color-white{color:var(--primitives-white-base)}.ui-editor-content ::ng-deep .ui-editor-highlight-black{background-color:var(--primitives-black-base)}.ui-editor-content ::ng-deep .ui-editor-highlight-white{background-color:var(--primitives-white-base)}.ui-editor-count{margin-left:auto;flex-shrink:0;font-family:var(--ui-editor-count-font-family, var(--fontfamily-base));font-size:var(--ui-editor-count-font-size, var(--size-typography-text-md));color:var(--ui-editor-count-color, var(--form-low-content-default));-webkit-user-select:none;user-select:none}.ui-editor-count._small{font-size:var(--ui-editor-count-font-size-small, var(--size-typography-text-sm))}.ui-editor-count._over{color:var(--ui-editor-count-color-over, var(--form-error-content-default))}.ui-editor-count._disabled{color:var(--ui-editor-count-color-disabled, var(--form-high-content-disabled))}\n"], dependencies: [{ kind: "component", type: UiField, selector: "ui-field", inputs: ["label", "for", "required", "size", "level", "floatLabel", "filled", "disabled", "readonly", "multiline", "autoHeight", "message", "messageId", "showMessageIcon", "messageIcon", "hasFooter", "hasPrefix"] }, { kind: "component", type: UiButton, selector: "ui-button", inputs: ["label", "ariaLabel", "type", "level", "variant", "onColor", "size", "icon", "iconPos", "iconOnly", "loading", "loadingIcon", "expanded", "rounded", "disabled", "ripple", "tabindex", "buttonProps", "iconTemplate", "loadingIconTemplate", "href", "routerLink", "target", "rel"], outputs: ["buttonClick", "buttonFocus", "buttonBlur"] }, { kind: "component", type: UiSwatchPicker, selector: "ui-swatch-picker", inputs: ["palette", "value", "popup", "size", "allowClear", "ariaLabel"], outputs: ["valueChange", "swatchSelect", "opened", "closed"] }, { kind: "component", type: UiSelect, selector: "ui-select", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "group", "optionGroupLabel", "optionGroupChildren", "dataKey", "multiple", "checkmark", "checkbox", "maxSelectedLabels", "overflowLabel", "placeholder", "showClear", "clearAriaLabel", "icon", "showIcon", "filter", "filterPlaceholder", "filterAriaLabel", "filterBy", "autofocusFilter", "resetFilterOnHide", "ripple", "emptyMessage", "emptyFilterMessage", "editable", "loading", "autoOptionFocus", "selectOnFocus", "focusOnHover", "virtualScroll", "virtualScrollItemSize", "lazy", "scrollHeight", "autoFlip", "panelStyleClass", "panelWidth"], outputs: ["valueChange", "opened", "closed", "cleared", "filterChange", "lazyLoad", "inputFocus", "inputBlur"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
1195
- }
1196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiEditor, decorators: [{
1197
- type: Component,
1198
- args: [{ selector: 'ui-editor', imports: [UiField, UiButton, UiSwatchPicker, UiSelect, NgTemplateOutlet, FormsModule], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiEditor), multi: true }], template: "<ui-field\n multiline\n [label]=\"label()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n [hasFooter]=\"showCount()\"\n>\n <div class=\"ui-editor\" [class._small]=\"size() === 'small'\" [style.--_rows]=\"minRows()\">\n @if (toolbarPosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n\n <div class=\"ui-editor-area\">\n <div\n #contentEl\n class=\"ui-editor-content\"\n [class._small]=\"size() === 'small'\"\n [id]=\"resolvedId()\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"isEditable() ? 'true' : 'false'\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"describedByIds()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (beforeinput)=\"onBeforeInput($any($event))\"\n (paste)=\"onPaste($event)\"\n (keydown)=\"onContentKeydown($event)\"\n (keyup)=\"refreshState()\"\n (mouseup)=\"refreshState()\"\n (focus)=\"editorFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n\n @if (showPlaceholder()) {\n <span class=\"ui-editor-placeholder\" aria-hidden=\"true\">{{ placeholder() }}</span>\n }\n </div>\n\n @if (toolbarPosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n </div>\n\n @if (showCount()) {\n <span\n uiFieldFooter\n class=\"ui-editor-count\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n [class._over]=\"overLimit()\"\n [attr.id]=\"countId()\"\n >\n {{ charCount() }}\n @if (maxlength(); as max) {\n &nbsp;/&nbsp;{{ max }}\n }\n </span>\n }\n</ui-field>\n\n<ng-template #toolbarTpl>\n @if (hasToolbar()) {\n <!-- ARIA toolbar pattern: keyboard delegated to the role=\"toolbar\" container,\n focus lives on the items (roving tabindex), same as ui-menu. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n #toolbarEl\n class=\"ui-editor-toolbar\"\n [class._bottom]=\"toolbarPosition() === 'bottom'\"\n role=\"toolbar\"\n aria-label=\"Mise en forme\"\n aria-orientation=\"horizontal\"\n (mousedown)=\"onToolbarMousedown($event)\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (entry of toolbar(); track entry.index) {\n @if (entry.isSeparator) {\n <span class=\"ui-editor-toolbar-separator\" aria-hidden=\"true\"></span>\n } @else if (entry.select; as select) {\n <!-- The dropdown takes the focus, so the command restores the caret\n before it runs (see onSelectValueChange). -->\n <ui-select\n class=\"ui-editor-tool ui-editor-select\"\n size=\"small\"\n [options]=\"selectOptions(select)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"selectValue(select)\"\n [ariaLabel]=\"selectLabel(select)\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n (valueChange)=\"onSelectValueChange(select, $event, entry.index)\"\n />\n } @else {\n <ui-button\n class=\"ui-editor-tool\"\n [class._colorTool]=\"\n entry.buttonTool === 'textColor' || entry.buttonTool === 'highlightColor'\n \"\n variant=\"ghost\"\n level=\"low\"\n size=\"small\"\n iconOnly\n [icon]=\"entry.meta!.icon\"\n [ariaLabel]=\"entry.meta!.label\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n [buttonProps]=\"toolProps(entry.buttonTool!)\"\n [style.--ui-editor-swatch-indicator-color]=\"colorIndicatorVar(entry.buttonTool)\"\n (buttonClick)=\"runTool(entry.buttonTool!, entry.index, $event)\"\n />\n }\n }\n\n <!-- `textColor`/`highlightColor` popups: no trigger of their own (same\n composition contract as `ui-menu`), opened via `runTool` ->\n `onColorToolClick` -> `toggle(event)`. -->\n <ui-swatch-picker\n #textColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentTextColor()\"\n ariaLabel=\"Couleur du texte\"\n (swatchSelect)=\"onTextColorSelect($event)\"\n (opened)=\"textColorPickerOpen.set(true)\"\n (closed)=\"textColorPickerOpen.set(false)\"\n />\n <ui-swatch-picker\n #highlightColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentHighlightColor()\"\n ariaLabel=\"Couleur de surlignage\"\n (swatchSelect)=\"onHighlightColorSelect($event)\"\n (opened)=\"highlightColorPickerOpen.set(true)\"\n (closed)=\"highlightColorPickerOpen.set(false)\"\n />\n </div>\n }\n</ng-template>\n", styles: [".ui-editor{display:flex;flex:1 1 auto;flex-direction:column;min-width:0;border-radius:var(--ui-editor-radius, inherit);overflow:hidden}.ui-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-editor-toolbar-gap, var(--units-2xs));flex-shrink:0;padding:var(--ui-editor-toolbar-padding-y, var(--units-2xs)) var(--ui-editor-toolbar-padding-x, var(--units-xs));background-color:var(--ui-editor-toolbar-surface, var(--global-background-muted));border-block-end:var(--ui-editor-toolbar-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-editor-toolbar-stroke, var(--form-low-stroke-default))}.ui-editor-toolbar._bottom{border-block-end:none;border-block-start:var(--ui-editor-toolbar-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-editor-toolbar-stroke, var(--form-low-stroke-default))}.ui-editor-toolbar-separator{flex-shrink:0;inline-size:var(--ui-editor-separator-width, var(--stroke-sm));block-size:var(--ui-editor-separator-height, var(--size-typography-text-default));background-color:var(--ui-editor-separator-color, var(--form-low-stroke-default))}.ui-editor-select{display:inline-flex;flex-shrink:0;min-inline-size:var(--ui-editor-select-width, 13ch);--ui-field-stroke-width: 0}.ui-editor-select ::ng-deep .ui-select{inline-size:100%}.ui-editor-select ::ng-deep .ui-field-box{background:transparent;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-editor-select ::ng-deep .ui-field-box:hover{background-color:var(--ui-editor-toolbar-select-surface-hover, var(--form-low-surface-hover))}.ui-editor-tool._colorTool{position:relative}.ui-editor-tool._colorTool:after{content:\"\";position:absolute;inset-inline:var(--ui-editor-swatch-indicator-offset-x, var(--units-2xs));inset-block-end:0;block-size:var(--ui-editor-swatch-indicator-height, var(--stroke-lg));border-radius:var(--ui-editor-swatch-indicator-height, var(--stroke-lg));background-color:var(--ui-editor-swatch-indicator-color, transparent)}.ui-editor-area{position:relative;display:flex;flex:1 1 auto;min-height:0}.ui-editor-content{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-editor-content::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-editor-content:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-editor-content{box-sizing:border-box;width:100%;min-height:var(--ui-editor-min-height, calc(var(--_rows, 4) * var(--ui-editor-line-height, 1.5) * 1em));max-height:var(--ui-editor-max-height, none);padding:var(--ui-editor-padding-y, var(--ui-form-textarea-padding-y, var(--units-default))) var(--ui-editor-padding-x, var(--ui-form-field-padding-x, var(--units-md)));overflow-y:auto;line-height:var(--ui-editor-line-height, 1.5);font-size:var(--ui-editor-font-size, var(--size-typography-text-default));overflow-wrap:break-word}.ui-editor-content._small{padding-block:var(--ui-editor-padding-y-small, var(--ui-form-textarea-padding-y-small, var(--units-md)));font-size:var(--ui-editor-font-size-small, var(--size-typography-text-md))}.ui-editor-content:focus,.ui-editor-content:focus-visible{outline:none}.ui-editor-content[contenteditable=false]{cursor:default}.ui-editor-placeholder{position:absolute;inset-block-start:var(--ui-editor-padding-y, var(--ui-form-textarea-padding-y, var(--units-default)));inset-inline-start:var(--ui-editor-padding-x, var(--ui-form-field-padding-x, var(--units-md)));line-height:var(--ui-editor-line-height, 1.5);font-family:var(--ui-editor-placeholder-font-family, var(--fontfamily-base));font-size:var(--ui-editor-font-size, var(--size-typography-text-default));color:var(--ui-editor-placeholder-color, var(--form-low-content-default));pointer-events:none;-webkit-user-select:none;user-select:none}.ui-editor._small .ui-editor-placeholder{inset-block-start:var(--ui-editor-padding-y-small, var(--ui-form-textarea-padding-y-small, var(--units-md)));font-size:var(--ui-editor-font-size-small, var(--size-typography-text-md))}.ui-editor-content ::ng-deep p{margin-block:0 var(--ui-editor-block-gap, var(--units-sm))}.ui-editor-content ::ng-deep p:last-child{margin-block-end:0}.ui-editor-content ::ng-deep ul,.ui-editor-content ::ng-deep ol{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));padding-inline-start:var(--ui-editor-list-padding-inline-start, var(--units-xl))}.ui-editor-content ::ng-deep ul:last-child,.ui-editor-content ::ng-deep ol:last-child{margin-block-end:0}.ui-editor-content ::ng-deep li+li{margin-block-start:var(--ui-editor-list-item-gap, var(--units-2xs))}.ui-editor-content ::ng-deep b,.ui-editor-content ::ng-deep strong{font-weight:var(--ui-editor-bold-weight, var(--weight-bold))}.ui-editor-content ::ng-deep a{color:var(--ui-editor-link-color, var(--global-text-brand));text-decoration:var(--ui-editor-link-text-decoration, underline)}.ui-editor-content ::ng-deep pre{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));padding:var(--ui-editor-code-padding-y, var(--units-sm)) var(--ui-editor-code-padding-x, var(--units-md));border-radius:var(--ui-editor-code-radius, var(--radius-xs));background-color:var(--ui-editor-code-surface, var(--global-background-muted));color:var(--ui-editor-code-color, var(--global-text-default));font-family:var(--ui-editor-code-font-family, var(--fontfamily-monospace));font-size:var(--ui-editor-code-font-size, var(--size-typography-text-md));white-space:pre-wrap;overflow-wrap:break-word}.ui-editor-content ::ng-deep pre:last-child{margin-block-end:0}.ui-editor-content ::ng-deep code{font-family:var(--ui-editor-code-font-family, var(--fontfamily-monospace))}.ui-editor-content ::ng-deep h1,.ui-editor-content ::ng-deep h2,.ui-editor-content ::ng-deep h3{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));font-family:var(--ui-editor-heading-font-family, var(--fontfamily-title));font-weight:var(--ui-editor-heading-weight, var(--weight-bold));line-height:var(--ui-editor-heading-line-height, 1.25)}.ui-editor-content ::ng-deep h1:last-child,.ui-editor-content ::ng-deep h2:last-child,.ui-editor-content ::ng-deep h3:last-child{margin-block-end:0}.ui-editor-content ::ng-deep h1{font-size:var(--ui-editor-heading-1-font-size, var(--size-typography-title-lg))}.ui-editor-content ::ng-deep h2{font-size:var(--ui-editor-heading-2-font-size, var(--size-typography-title-md))}.ui-editor-content ::ng-deep h3{font-size:var(--ui-editor-heading-3-font-size, var(--size-typography-title-sm))}.ui-editor-content ::ng-deep .ui-editor-font-base{font-family:var(--fontfamily-base)}.ui-editor-content ::ng-deep .ui-editor-font-title{font-family:var(--fontfamily-title)}.ui-editor-content ::ng-deep .ui-editor-font-monospace{font-family:var(--fontfamily-monospace)}.ui-editor-content ::ng-deep .ui-editor-size-sm{font-size:var(--ui-editor-size-sm-font-size, var(--size-typography-text-sm))}.ui-editor-content ::ng-deep .ui-editor-size-default{font-size:var(--ui-editor-size-default-font-size, var(--size-typography-text-default))}.ui-editor-content ::ng-deep .ui-editor-size-lg{font-size:var(--ui-editor-size-lg-font-size, var(--size-typography-text-lg))}.ui-editor-content ::ng-deep .ui-editor-size-xl{font-size:var(--ui-editor-size-xl-font-size, var(--size-typography-text-xl))}.ui-editor-content ::ng-deep .ui-editor-color-primary-900{color:var(--primitives-primary-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-900{background-color:var(--primitives-primary-900)}.ui-editor-content ::ng-deep .ui-editor-color-primary-700{color:var(--primitives-primary-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-700{background-color:var(--primitives-primary-700)}.ui-editor-content ::ng-deep .ui-editor-color-primary-500{color:var(--primitives-primary-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-500{background-color:var(--primitives-primary-500)}.ui-editor-content ::ng-deep .ui-editor-color-primary-300{color:var(--primitives-primary-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-300{background-color:var(--primitives-primary-300)}.ui-editor-content ::ng-deep .ui-editor-color-primary-100{color:var(--primitives-primary-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-100{background-color:var(--primitives-primary-100)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-900{color:var(--primitives-secondary-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-900{background-color:var(--primitives-secondary-900)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-700{color:var(--primitives-secondary-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-700{background-color:var(--primitives-secondary-700)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-500{color:var(--primitives-secondary-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-500{background-color:var(--primitives-secondary-500)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-300{color:var(--primitives-secondary-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-300{background-color:var(--primitives-secondary-300)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-100{color:var(--primitives-secondary-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-100{background-color:var(--primitives-secondary-100)}.ui-editor-content ::ng-deep .ui-editor-color-green-900{color:var(--primitives-green-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-900{background-color:var(--primitives-green-900)}.ui-editor-content ::ng-deep .ui-editor-color-green-700{color:var(--primitives-green-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-700{background-color:var(--primitives-green-700)}.ui-editor-content ::ng-deep .ui-editor-color-green-500{color:var(--primitives-green-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-500{background-color:var(--primitives-green-500)}.ui-editor-content ::ng-deep .ui-editor-color-green-300{color:var(--primitives-green-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-300{background-color:var(--primitives-green-300)}.ui-editor-content ::ng-deep .ui-editor-color-green-100{color:var(--primitives-green-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-100{background-color:var(--primitives-green-100)}.ui-editor-content ::ng-deep .ui-editor-color-orange-900{color:var(--primitives-orange-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-900{background-color:var(--primitives-orange-900)}.ui-editor-content ::ng-deep .ui-editor-color-orange-700{color:var(--primitives-orange-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-700{background-color:var(--primitives-orange-700)}.ui-editor-content ::ng-deep .ui-editor-color-orange-500{color:var(--primitives-orange-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-500{background-color:var(--primitives-orange-500)}.ui-editor-content ::ng-deep .ui-editor-color-orange-300{color:var(--primitives-orange-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-300{background-color:var(--primitives-orange-300)}.ui-editor-content ::ng-deep .ui-editor-color-orange-100{color:var(--primitives-orange-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-100{background-color:var(--primitives-orange-100)}.ui-editor-content ::ng-deep .ui-editor-color-red-900{color:var(--primitives-red-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-900{background-color:var(--primitives-red-900)}.ui-editor-content ::ng-deep .ui-editor-color-red-700{color:var(--primitives-red-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-700{background-color:var(--primitives-red-700)}.ui-editor-content ::ng-deep .ui-editor-color-red-500{color:var(--primitives-red-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-500{background-color:var(--primitives-red-500)}.ui-editor-content ::ng-deep .ui-editor-color-red-300{color:var(--primitives-red-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-300{background-color:var(--primitives-red-300)}.ui-editor-content ::ng-deep .ui-editor-color-red-100{color:var(--primitives-red-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-100{background-color:var(--primitives-red-100)}.ui-editor-content ::ng-deep .ui-editor-color-slate-900{color:var(--primitives-slate-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-900{background-color:var(--primitives-slate-900)}.ui-editor-content ::ng-deep .ui-editor-color-slate-700{color:var(--primitives-slate-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-700{background-color:var(--primitives-slate-700)}.ui-editor-content ::ng-deep .ui-editor-color-slate-500{color:var(--primitives-slate-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-500{background-color:var(--primitives-slate-500)}.ui-editor-content ::ng-deep .ui-editor-color-slate-300{color:var(--primitives-slate-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-300{background-color:var(--primitives-slate-300)}.ui-editor-content ::ng-deep .ui-editor-color-slate-100{color:var(--primitives-slate-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-100{background-color:var(--primitives-slate-100)}.ui-editor-content ::ng-deep .ui-editor-color-grey-900{color:var(--primitives-grey-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-900{background-color:var(--primitives-grey-900)}.ui-editor-content ::ng-deep .ui-editor-color-grey-700{color:var(--primitives-grey-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-700{background-color:var(--primitives-grey-700)}.ui-editor-content ::ng-deep .ui-editor-color-grey-500{color:var(--primitives-grey-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-500{background-color:var(--primitives-grey-500)}.ui-editor-content ::ng-deep .ui-editor-color-grey-300{color:var(--primitives-grey-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-300{background-color:var(--primitives-grey-300)}.ui-editor-content ::ng-deep .ui-editor-color-grey-100{color:var(--primitives-grey-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-100{background-color:var(--primitives-grey-100)}.ui-editor-content ::ng-deep .ui-editor-color-black{color:var(--primitives-black-base)}.ui-editor-content ::ng-deep .ui-editor-color-white{color:var(--primitives-white-base)}.ui-editor-content ::ng-deep .ui-editor-highlight-black{background-color:var(--primitives-black-base)}.ui-editor-content ::ng-deep .ui-editor-highlight-white{background-color:var(--primitives-white-base)}.ui-editor-count{margin-left:auto;flex-shrink:0;font-family:var(--ui-editor-count-font-family, var(--fontfamily-base));font-size:var(--ui-editor-count-font-size, var(--size-typography-text-md));color:var(--ui-editor-count-color, var(--form-low-content-default));-webkit-user-select:none;user-select:none}.ui-editor-count._small{font-size:var(--ui-editor-count-font-size-small, var(--size-typography-text-sm))}.ui-editor-count._over{color:var(--ui-editor-count-color-over, var(--form-error-content-default))}.ui-editor-count._disabled{color:var(--ui-editor-count-color-disabled, var(--form-high-content-disabled))}\n"] }]
1199
- }], ctorParameters: () => [], propDecorators: { tools: [{ type: i0.Input, args: [{ isSignal: true, alias: "tools", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "minRows", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], toolbarPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbarPosition", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], editorFocus: [{ type: i0.Output, args: ["editorFocus"] }], editorBlur: [{ type: i0.Output, args: ["editorBlur"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], contentEl: [{ type: i0.ViewChild, args: ['contentEl', { isSignal: true }] }], toolbarEl: [{ type: i0.ViewChild, args: ['toolbarEl', { isSignal: true }] }], textColorPicker: [{ type: i0.ViewChild, args: ['textColorPicker', { isSignal: true }] }], highlightColorPicker: [{ type: i0.ViewChild, args: ['highlightColorPicker', { isSignal: true }] }] } });
1200
-
1201
- /*
1202
- * Public API Surface of ui-kit/ui-editor
1203
- */
1204
-
1205
- /**
1206
- * Generated bundle index. Do not edit.
1207
- */
1208
-
466
+ const SHORTCUTS = {
467
+ b: "bold",
468
+ i: "italic",
469
+ u: "underline"
470
+ };
471
+ var UiEditor = class UiEditor extends BaseFormField {
472
+ constructor() {
473
+ super();
474
+ this.tools = input(DEFAULT_EDITOR_TOOLS, {
475
+ ...ngDevMode ? { debugName: "tools" } : /* istanbul ignore next */ {},
476
+ transform: (value) => value?.length ? value : DEFAULT_EDITOR_TOOLS
477
+ });
478
+ this.placeholder = input(...ngDevMode ? [void 0, { debugName: "placeholder" }] : /* istanbul ignore next */ []);
479
+ this.minRows = input(4, ...ngDevMode ? [{ debugName: "minRows" }] : /* istanbul ignore next */ []);
480
+ this.maxlength = input(...ngDevMode ? [void 0, { debugName: "maxlength" }] : /* istanbul ignore next */ []);
481
+ this.showCount = input(false, {
482
+ ...ngDevMode ? { debugName: "showCount" } : /* istanbul ignore next */ {},
483
+ transform: booleanAttribute
484
+ });
485
+ this.toolbarPosition = input("top", ...ngDevMode ? [{ debugName: "toolbarPosition" }] : /* istanbul ignore next */ []);
486
+ this.valueChange = output();
487
+ this.editorFocus = output();
488
+ this.editorBlur = output();
489
+ this.selectionChange = output();
490
+ this.sanitizer = inject(DomSanitizer);
491
+ this.contentEl = viewChild("contentEl", ...ngDevMode ? [{ debugName: "contentEl" }] : /* istanbul ignore next */ []);
492
+ this.toolbarEl = viewChild("toolbarEl", ...ngDevMode ? [{ debugName: "toolbarEl" }] : /* istanbul ignore next */ []);
493
+ this.textColorPicker = viewChild("textColorPicker", ...ngDevMode ? [{ debugName: "textColorPicker" }] : /* istanbul ignore next */ []);
494
+ this.highlightColorPicker = viewChild("highlightColorPicker", ...ngDevMode ? [{ debugName: "highlightColorPicker" }] : /* istanbul ignore next */ []);
495
+ this.lastEmitted = "";
496
+ this.state = signal(emptyEditorState(), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
497
+ this.currentFont = signal(null, ...ngDevMode ? [{ debugName: "currentFont" }] : /* istanbul ignore next */ []);
498
+ this.currentSize = signal(null, ...ngDevMode ? [{ debugName: "currentSize" }] : /* istanbul ignore next */ []);
499
+ this.currentTextColor = signal(null, ...ngDevMode ? [{ debugName: "currentTextColor" }] : /* istanbul ignore next */ []);
500
+ this.currentHighlightColor = signal(null, ...ngDevMode ? [{ debugName: "currentHighlightColor" }] : /* istanbul ignore next */ []);
501
+ this.activeTool = signal(0, ...ngDevMode ? [{ debugName: "activeTool" }] : /* istanbul ignore next */ []);
502
+ this.textColorPickerOpen = signal(false, ...ngDevMode ? [{ debugName: "textColorPickerOpen" }] : /* istanbul ignore next */ []);
503
+ this.highlightColorPickerOpen = signal(false, ...ngDevMode ? [{ debugName: "highlightColorPickerOpen" }] : /* istanbul ignore next */ []);
504
+ this.savedRange = null;
505
+ this.safeValue = computed(() => sanitizeEditorHtml(this.modelValue() ?? "", (html) => this.sanitizer.sanitize(SecurityContext.HTML, html) ?? ""), ...ngDevMode ? [{ debugName: "safeValue" }] : /* istanbul ignore next */ []);
506
+ this.charCount = computed(() => htmlToText(this.safeValue()).length, ...ngDevMode ? [{ debugName: "charCount" }] : /* istanbul ignore next */ []);
507
+ this.isFilled = computed(() => this.charCount() > 0, ...ngDevMode ? [{ debugName: "isFilled" }] : /* istanbul ignore next */ []);
508
+ this.overLimit = computed(() => {
509
+ const max = this.maxlength();
510
+ return max != null && this.charCount() > max;
511
+ }, ...ngDevMode ? [{ debugName: "overLimit" }] : /* istanbul ignore next */ []);
512
+ this.showPlaceholder = computed(() => !!this.placeholder() && !this.hasFloatLabel() && this.charCount() === 0, ...ngDevMode ? [{ debugName: "showPlaceholder" }] : /* istanbul ignore next */ []);
513
+ this.isEditable = computed(() => !this.isDisabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "isEditable" }] : /* istanbul ignore next */ []);
514
+ this.toolbar = computed(() => this.tools().map((tool, index) => ({
515
+ tool,
516
+ index,
517
+ isSeparator: tool === "separator",
518
+ select: EDITOR_SELECT_TOOLS.includes(tool) ? tool : null,
519
+ buttonTool: tool === "separator" || EDITOR_SELECT_TOOLS.includes(tool) ? null : tool,
520
+ meta: tool === "separator" || EDITOR_SELECT_TOOLS.includes(tool) ? null : EDITOR_TOOL_META[tool]
521
+ })), ...ngDevMode ? [{ debugName: "toolbar" }] : /* istanbul ignore next */ []);
522
+ this.sizes = EDITOR_SIZES;
523
+ this.fonts = signal(EDITOR_FONTS.map((f) => ({ ...f })), ...ngDevMode ? [{ debugName: "fonts" }] : /* istanbul ignore next */ []);
524
+ this.fontFamilyOptions = computed(() => this.fonts().map((font) => ({
525
+ value: font.key,
526
+ label: font.label
527
+ })), ...ngDevMode ? [{ debugName: "fontFamilyOptions" }] : /* istanbul ignore next */ []);
528
+ this.fontSizeOptions = computed(() => this.sizes.map((size) => ({
529
+ value: size.key,
530
+ label: size.label
531
+ })), ...ngDevMode ? [{ debugName: "fontSizeOptions" }] : /* istanbul ignore next */ []);
532
+ this.currentTextColorSwatch = computed(() => EDITOR_COLORS.find((c) => c.key === this.currentTextColor()), ...ngDevMode ? [{ debugName: "currentTextColorSwatch" }] : /* istanbul ignore next */ []);
533
+ this.currentHighlightColorSwatch = computed(() => EDITOR_HIGHLIGHTS.find((c) => c.key === this.currentHighlightColor()), ...ngDevMode ? [{ debugName: "currentHighlightColorSwatch" }] : /* istanbul ignore next */ []);
534
+ this.hasToolbar = computed(() => this.tools().some((t) => t !== "separator"), ...ngDevMode ? [{ debugName: "hasToolbar" }] : /* istanbul ignore next */ []);
535
+ this.tabStop = computed(() => {
536
+ const actionable = this.toolbar().filter((entry) => !entry.isSeparator);
537
+ if (!actionable.length) return -1;
538
+ const active = this.activeTool();
539
+ return actionable.some((entry) => entry.index === active) ? active : actionable[0].index;
540
+ }, ...ngDevMode ? [{ debugName: "tabStop" }] : /* istanbul ignore next */ []);
541
+ this.countId = computed(() => `${this.resolvedId()}-count`, ...ngDevMode ? [{ debugName: "countId" }] : /* istanbul ignore next */ []);
542
+ this.describedByIds = computed(() => {
543
+ const ids = [this.displayMessage() ? this.messageId() : null, this.showCount() ? this.countId() : null].filter(Boolean);
544
+ return ids.length ? ids.join(" ") : null;
545
+ }, ...ngDevMode ? [{ debugName: "describedByIds" }] : /* istanbul ignore next */ []);
546
+ afterNextRender(() => {
547
+ this.fonts.set(EDITOR_FONTS.map((f) => ({
548
+ ...f,
549
+ label: resolveFontLabel(f.cssVar, f.label)
550
+ })));
551
+ });
552
+ effect(() => {
553
+ const value = this.safeValue();
554
+ const el = this.contentEl()?.nativeElement;
555
+ if (!el) return;
556
+ if (this.modelValue() === this.lastEmitted || el.innerHTML === value) return;
557
+ el.innerHTML = value;
558
+ this.lastEmitted = value;
559
+ });
560
+ }
561
+ uidPrefix() {
562
+ return "ui-editor";
563
+ }
564
+ focus(options) {
565
+ this.contentEl()?.nativeElement.focus(options);
566
+ }
567
+ onInput() {
568
+ const el = this.contentEl()?.nativeElement;
569
+ if (!el) return;
570
+ const html = isEmptyHtml(el.innerHTML) ? "" : el.innerHTML;
571
+ this.lastEmitted = html;
572
+ this.modelValue.set(html);
573
+ this.emitChange(html);
574
+ this.valueChange.emit(html);
575
+ this.refreshState();
576
+ }
577
+ onBeforeInput(event) {
578
+ const max = this.maxlength();
579
+ if (max == null || !event.inputType.startsWith("insert")) return;
580
+ const selection = document.getSelection();
581
+ const replaced = selection && !selection.isCollapsed ? selection.toString().length : 0;
582
+ const incoming = event.data?.length ?? 1;
583
+ if (this.charCount() - replaced + incoming > max) event.preventDefault();
584
+ }
585
+ onPaste(event) {
586
+ if (!this.isEditable()) return;
587
+ event.preventDefault();
588
+ const clipboard = event.clipboardData;
589
+ if (!clipboard) return;
590
+ const html = clipboard.getData("text/html");
591
+ if (html) {
592
+ insertHtml(this.sanitizer.sanitize(SecurityContext.HTML, normalizeHtml(html)) ?? "");
593
+ const el = this.contentEl()?.nativeElement;
594
+ if (el) scrubInPlace(el);
595
+ } else insertText(clipboard.getData("text/plain"));
596
+ this.onInput();
597
+ }
598
+ onContentKeydown(event) {
599
+ if (!(event.metaKey || event.ctrlKey)) return;
600
+ if (!SHORTCUTS[event.key.toLowerCase()]) return;
601
+ queueMicrotask(() => this.refreshState());
602
+ }
603
+ onBlur(event) {
604
+ this.emitTouch();
605
+ this.editorBlur.emit(event);
606
+ }
607
+ refreshState() {
608
+ this.rememberSelection();
609
+ const anchor = document.getSelection()?.anchorNode ?? null;
610
+ this.currentFont.set(readFontFamily(anchor));
611
+ this.currentSize.set(readFontSize(anchor));
612
+ this.currentTextColor.set(readTextColor(anchor));
613
+ this.currentHighlightColor.set(readHighlightColor(anchor));
614
+ const next = readEditorState();
615
+ const prev = this.state();
616
+ if (Object.keys(next).every((k) => next[k] === prev[k])) return;
617
+ this.state.set(next);
618
+ this.selectionChange.emit(next);
619
+ }
620
+ rememberSelection() {
621
+ const el = this.contentEl()?.nativeElement;
622
+ const selection = document.getSelection();
623
+ if (!el || !selection?.rangeCount) return;
624
+ const range = selection.getRangeAt(0);
625
+ if (el.contains(range.commonAncestorContainer)) this.savedRange = range.cloneRange();
626
+ }
627
+ restoreSelection() {
628
+ this.focus();
629
+ const range = this.savedRange;
630
+ if (!range) return;
631
+ const selection = document.getSelection();
632
+ selection?.removeAllRanges();
633
+ selection?.addRange(range);
634
+ }
635
+ runTool(tool, index, event) {
636
+ if (!this.isEditable()) return;
637
+ this.activeTool.set(index);
638
+ if (tool === "textColor" || tool === "highlightColor") {
639
+ this.onColorToolClick(tool, event);
640
+ return;
641
+ }
642
+ this.focus();
643
+ if (tool === "link") this.promptForLink();
644
+ else if (tool === "codeBlock") toggleCodeBlock();
645
+ else if (tool === "clearFormat") this.clearFormat();
646
+ else applyCommand(tool);
647
+ this.onInput();
648
+ }
649
+ clearFormat() {
650
+ applyCommand("clearFormat");
651
+ const el = this.contentEl()?.nativeElement;
652
+ const selection = document.getSelection();
653
+ if (!el || !selection?.rangeCount) return;
654
+ const range = selection.getRangeAt(0);
655
+ if (!el.contains(range.commonAncestorContainer)) return;
656
+ clearFormatMarkers(el, range);
657
+ }
658
+ onColorToolClick(tool, event) {
659
+ this.rememberSelection();
660
+ (tool === "textColor" ? this.textColorPicker() : this.highlightColorPicker())?.toggle(event);
661
+ }
662
+ onTextColorSelect(swatch) {
663
+ if (!this.isEditable()) return;
664
+ this.restoreSelection();
665
+ const el = this.contentEl()?.nativeElement;
666
+ if (swatch) {
667
+ applyTextColor();
668
+ if (el) convertColorMarkers(el, `ui-editor-color-${swatch.key}`);
669
+ } else if (el && this.savedRange) for (const color of EDITOR_COLORS) clearMarkerClass(el, this.savedRange, color.className);
670
+ this.onInput();
671
+ }
672
+ onHighlightColorSelect(swatch) {
673
+ if (!this.isEditable()) return;
674
+ this.restoreSelection();
675
+ const el = this.contentEl()?.nativeElement;
676
+ if (swatch) {
677
+ applyHighlightColor();
678
+ if (el) convertHighlightMarkers(el, `ui-editor-highlight-${swatch.key}`);
679
+ } else if (el && this.savedRange) for (const color of EDITOR_HIGHLIGHTS) clearMarkerClass(el, this.savedRange, color.className);
680
+ this.onInput();
681
+ }
682
+ selectOptions(tool) {
683
+ return tool === "fontFamily" ? this.fontFamilyOptions() : this.fontSizeOptions();
684
+ }
685
+ selectValue(tool) {
686
+ if (tool === "fontFamily") return this.currentFont() ?? "base";
687
+ return this.currentSize() ?? "default";
688
+ }
689
+ selectLabel(tool) {
690
+ if (tool === "fontFamily") return "Police";
691
+ return "Taille du texte";
692
+ }
693
+ onSelectValueChange(tool, value, index) {
694
+ this.activeTool.set(index);
695
+ if (!this.isEditable() || value == null) return;
696
+ this.restoreSelection();
697
+ const el = this.contentEl()?.nativeElement;
698
+ if (tool === "fontFamily") {
699
+ const choice = this.fonts().find((f) => f.key === value);
700
+ if (!choice) return;
701
+ applyFontFamily();
702
+ if (el) convertFontMarkers(el, choice.className);
703
+ } else {
704
+ const choice = this.sizes.find((s) => s.key === value);
705
+ if (!choice) return;
706
+ applyFontSize();
707
+ if (el) convertSizeMarkers(el, choice.className);
708
+ }
709
+ this.onInput();
710
+ }
711
+ promptForLink() {
712
+ const href = window.prompt("Adresse du lien (laisser vide pour retirer le lien)");
713
+ if (href === null) return;
714
+ if (href.trim() === "") removeLink();
715
+ else applyLink(href.trim());
716
+ }
717
+ onToolbarMousedown(event) {
718
+ event.preventDefault();
719
+ }
720
+ onToolbarKeydown(event) {
721
+ const indexes = this.toolbar().filter((entry) => !entry.isSeparator).map((entry) => entry.index);
722
+ if (!indexes.length) return;
723
+ const current = Math.max(0, indexes.indexOf(this.tabStop()));
724
+ let next;
725
+ switch (event.key) {
726
+ case "ArrowRight":
727
+ next = indexes[(current + 1) % indexes.length];
728
+ break;
729
+ case "ArrowLeft":
730
+ next = indexes[(current - 1 + indexes.length) % indexes.length];
731
+ break;
732
+ case "Home":
733
+ next = indexes[0];
734
+ break;
735
+ case "End":
736
+ next = indexes[indexes.length - 1];
737
+ break;
738
+ case "Escape":
739
+ event.preventDefault();
740
+ this.focus();
741
+ return;
742
+ default: return;
743
+ }
744
+ event.preventDefault();
745
+ this.activeTool.set(next);
746
+ this.focusTool(next);
747
+ }
748
+ focusTool(index) {
749
+ const position = this.toolbar().filter((e) => !e.isSeparator && e.index <= index).length - 1;
750
+ (this.toolbarEl()?.nativeElement.querySelectorAll("button"))?.[position]?.focus();
751
+ }
752
+ colorIndicatorVar(tool) {
753
+ const swatch = tool === "textColor" ? this.currentTextColorSwatch() : tool === "highlightColor" ? this.currentHighlightColorSwatch() : null;
754
+ return swatch ? `var(${swatch.cssVar})` : null;
755
+ }
756
+ toolProps(tool) {
757
+ if (tool === "textColor" || tool === "highlightColor") return {
758
+ "aria-haspopup": "true",
759
+ "aria-expanded": (tool === "textColor" ? this.textColorPickerOpen() : this.highlightColorPickerOpen()) ? "true" : "false"
760
+ };
761
+ const state = this.state();
762
+ if (!(tool in state)) return void 0;
763
+ return { "aria-pressed": state[tool] ? "true" : "false" };
764
+ }
765
+ static {
766
+ this.ɵfac = i0.ɵɵngDeclareFactory({
767
+ minVersion: "12.0.0",
768
+ version: "22.3.0",
769
+ ngImport: i0,
770
+ type: UiEditor,
771
+ deps: [],
772
+ target: i0.ɵɵFactoryTarget.Component
773
+ });
774
+ }
775
+ static {
776
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
777
+ minVersion: "17.0.0",
778
+ version: "22.3.0",
779
+ type: UiEditor,
780
+ isStandalone: true,
781
+ selector: "ui-editor",
782
+ inputs: {
783
+ tools: {
784
+ classPropertyName: "tools",
785
+ publicName: "tools",
786
+ isSignal: true,
787
+ isRequired: false,
788
+ transformFunction: null
789
+ },
790
+ placeholder: {
791
+ classPropertyName: "placeholder",
792
+ publicName: "placeholder",
793
+ isSignal: true,
794
+ isRequired: false,
795
+ transformFunction: null
796
+ },
797
+ minRows: {
798
+ classPropertyName: "minRows",
799
+ publicName: "minRows",
800
+ isSignal: true,
801
+ isRequired: false,
802
+ transformFunction: null
803
+ },
804
+ maxlength: {
805
+ classPropertyName: "maxlength",
806
+ publicName: "maxlength",
807
+ isSignal: true,
808
+ isRequired: false,
809
+ transformFunction: null
810
+ },
811
+ showCount: {
812
+ classPropertyName: "showCount",
813
+ publicName: "showCount",
814
+ isSignal: true,
815
+ isRequired: false,
816
+ transformFunction: null
817
+ },
818
+ toolbarPosition: {
819
+ classPropertyName: "toolbarPosition",
820
+ publicName: "toolbarPosition",
821
+ isSignal: true,
822
+ isRequired: false,
823
+ transformFunction: null
824
+ }
825
+ },
826
+ outputs: {
827
+ valueChange: "valueChange",
828
+ editorFocus: "editorFocus",
829
+ editorBlur: "editorBlur",
830
+ selectionChange: "selectionChange"
831
+ },
832
+ providers: [{
833
+ provide: NG_VALUE_ACCESSOR,
834
+ useExisting: forwardRef(() => UiEditor),
835
+ multi: true
836
+ }],
837
+ viewQueries: [
838
+ {
839
+ propertyName: "contentEl",
840
+ first: true,
841
+ predicate: ["contentEl"],
842
+ descendants: true,
843
+ isSignal: true
844
+ },
845
+ {
846
+ propertyName: "toolbarEl",
847
+ first: true,
848
+ predicate: ["toolbarEl"],
849
+ descendants: true,
850
+ isSignal: true
851
+ },
852
+ {
853
+ propertyName: "textColorPicker",
854
+ first: true,
855
+ predicate: ["textColorPicker"],
856
+ descendants: true,
857
+ isSignal: true
858
+ },
859
+ {
860
+ propertyName: "highlightColorPicker",
861
+ first: true,
862
+ predicate: ["highlightColorPicker"],
863
+ descendants: true,
864
+ isSignal: true
865
+ }
866
+ ],
867
+ usesInheritance: true,
868
+ ngImport: i0,
869
+ template: "<ui-field\n multiline\n [label]=\"label()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n [hasFooter]=\"showCount()\"\n>\n <div class=\"ui-editor\" [class._small]=\"size() === 'small'\" [style.--_rows]=\"minRows()\">\n @if (toolbarPosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n\n <div class=\"ui-editor-area\">\n <div\n #contentEl\n class=\"ui-editor-content\"\n [class._small]=\"size() === 'small'\"\n [id]=\"resolvedId()\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"isEditable() ? 'true' : 'false'\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"describedByIds()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (beforeinput)=\"onBeforeInput($any($event))\"\n (paste)=\"onPaste($event)\"\n (keydown)=\"onContentKeydown($event)\"\n (keyup)=\"refreshState()\"\n (mouseup)=\"refreshState()\"\n (focus)=\"editorFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n\n @if (showPlaceholder()) {\n <span class=\"ui-editor-placeholder\" aria-hidden=\"true\">{{ placeholder() }}</span>\n }\n </div>\n\n @if (toolbarPosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n </div>\n\n @if (showCount()) {\n <span\n uiFieldFooter\n class=\"ui-editor-count\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n [class._over]=\"overLimit()\"\n [attr.id]=\"countId()\"\n >\n {{ charCount() }}\n @if (maxlength(); as max) {\n &nbsp;/&nbsp;{{ max }}\n }\n </span>\n }\n</ui-field>\n\n<ng-template #toolbarTpl>\n @if (hasToolbar()) {\n <!-- ARIA toolbar pattern: keyboard delegated to the role=\"toolbar\" container,\n focus lives on the items (roving tabindex), same as ui-menu. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n #toolbarEl\n class=\"ui-editor-toolbar\"\n [class._bottom]=\"toolbarPosition() === 'bottom'\"\n role=\"toolbar\"\n aria-label=\"Mise en forme\"\n aria-orientation=\"horizontal\"\n (mousedown)=\"onToolbarMousedown($event)\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (entry of toolbar(); track entry.index) {\n @if (entry.isSeparator) {\n <span class=\"ui-editor-toolbar-separator\" aria-hidden=\"true\"></span>\n } @else if (entry.select; as select) {\n <!-- The dropdown takes the focus, so the command restores the caret\n before it runs (see onSelectValueChange). -->\n <ui-select\n class=\"ui-editor-tool ui-editor-select\"\n size=\"small\"\n [options]=\"selectOptions(select)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"selectValue(select)\"\n [ariaLabel]=\"selectLabel(select)\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n (valueChange)=\"onSelectValueChange(select, $event, entry.index)\"\n />\n } @else {\n <ui-button\n class=\"ui-editor-tool\"\n [class._colorTool]=\"\n entry.buttonTool === 'textColor' || entry.buttonTool === 'highlightColor'\n \"\n variant=\"ghost\"\n level=\"low\"\n size=\"small\"\n iconOnly\n [icon]=\"entry.meta!.icon\"\n [ariaLabel]=\"entry.meta!.label\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n [buttonProps]=\"toolProps(entry.buttonTool!)\"\n [style.--ui-editor-swatch-indicator-color]=\"colorIndicatorVar(entry.buttonTool)\"\n (buttonClick)=\"runTool(entry.buttonTool!, entry.index, $event)\"\n />\n }\n }\n\n <!-- `textColor`/`highlightColor` popups: no trigger of their own (same\n composition contract as `ui-menu`), opened via `runTool` ->\n `onColorToolClick` -> `toggle(event)`. -->\n <ui-swatch-picker\n #textColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentTextColor()\"\n ariaLabel=\"Couleur du texte\"\n (swatchSelect)=\"onTextColorSelect($event)\"\n (opened)=\"textColorPickerOpen.set(true)\"\n (closed)=\"textColorPickerOpen.set(false)\"\n />\n <ui-swatch-picker\n #highlightColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentHighlightColor()\"\n ariaLabel=\"Couleur de surlignage\"\n (swatchSelect)=\"onHighlightColorSelect($event)\"\n (opened)=\"highlightColorPickerOpen.set(true)\"\n (closed)=\"highlightColorPickerOpen.set(false)\"\n />\n </div>\n }\n</ng-template>\n",
870
+ styles: [".ui-editor{display:flex;flex:1 1 auto;flex-direction:column;min-width:0;border-radius:var(--ui-editor-radius, inherit);overflow:hidden}.ui-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-editor-toolbar-gap, var(--units-2xs));flex-shrink:0;padding:var(--ui-editor-toolbar-padding-y, var(--units-2xs)) var(--ui-editor-toolbar-padding-x, var(--units-xs));background-color:var(--ui-editor-toolbar-surface, var(--global-background-muted));border-block-end:var(--ui-editor-toolbar-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-editor-toolbar-stroke, var(--form-low-stroke-default))}.ui-editor-toolbar._bottom{border-block-end:none;border-block-start:var(--ui-editor-toolbar-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-editor-toolbar-stroke, var(--form-low-stroke-default))}.ui-editor-toolbar-separator{flex-shrink:0;inline-size:var(--ui-editor-separator-width, var(--stroke-sm));block-size:var(--ui-editor-separator-height, var(--size-typography-text-default));background-color:var(--ui-editor-separator-color, var(--form-low-stroke-default))}.ui-editor-select{display:inline-flex;flex-shrink:0;min-inline-size:var(--ui-editor-select-width, 13ch);--ui-field-stroke-width: 0}.ui-editor-select ::ng-deep .ui-select{inline-size:100%}.ui-editor-select ::ng-deep .ui-field-box{background:transparent;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-editor-select ::ng-deep .ui-field-box:hover{background-color:var(--ui-editor-toolbar-select-surface-hover, var(--form-low-surface-hover))}.ui-editor-tool._colorTool{position:relative}.ui-editor-tool._colorTool:after{content:\"\";position:absolute;inset-inline:var(--ui-editor-swatch-indicator-offset-x, var(--units-2xs));inset-block-end:0;block-size:var(--ui-editor-swatch-indicator-height, var(--stroke-lg));border-radius:var(--ui-editor-swatch-indicator-height, var(--stroke-lg));background-color:var(--ui-editor-swatch-indicator-color, transparent)}.ui-editor-area{position:relative;display:flex;flex:1 1 auto;min-height:0}.ui-editor-content{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-editor-content::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-editor-content:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-editor-content{box-sizing:border-box;width:100%;min-height:var(--ui-editor-min-height, calc(var(--_rows, 4) * var(--ui-editor-line-height, 1.5) * 1em));max-height:var(--ui-editor-max-height, none);padding:var(--ui-editor-padding-y, var(--ui-form-textarea-padding-y, var(--units-default))) var(--ui-editor-padding-x, var(--ui-form-field-padding-x, var(--units-md)));overflow-y:auto;line-height:var(--ui-editor-line-height, 1.5);font-size:var(--ui-editor-font-size, var(--size-typography-text-default));overflow-wrap:break-word}.ui-editor-content._small{padding-block:var(--ui-editor-padding-y-small, var(--ui-form-textarea-padding-y-small, var(--units-md)));font-size:var(--ui-editor-font-size-small, var(--size-typography-text-md))}.ui-editor-content:focus,.ui-editor-content:focus-visible{outline:none}.ui-editor-content[contenteditable=false]{cursor:default}.ui-editor-placeholder{position:absolute;inset-block-start:var(--ui-editor-padding-y, var(--ui-form-textarea-padding-y, var(--units-default)));inset-inline-start:var(--ui-editor-padding-x, var(--ui-form-field-padding-x, var(--units-md)));line-height:var(--ui-editor-line-height, 1.5);font-family:var(--ui-editor-placeholder-font-family, var(--fontfamily-base));font-size:var(--ui-editor-font-size, var(--size-typography-text-default));color:var(--ui-editor-placeholder-color, var(--form-low-content-default));pointer-events:none;-webkit-user-select:none;user-select:none}.ui-editor._small .ui-editor-placeholder{inset-block-start:var(--ui-editor-padding-y-small, var(--ui-form-textarea-padding-y-small, var(--units-md)));font-size:var(--ui-editor-font-size-small, var(--size-typography-text-md))}.ui-editor-content ::ng-deep p{margin-block:0 var(--ui-editor-block-gap, var(--units-sm))}.ui-editor-content ::ng-deep p:last-child{margin-block-end:0}.ui-editor-content ::ng-deep ul,.ui-editor-content ::ng-deep ol{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));padding-inline-start:var(--ui-editor-list-padding-inline-start, var(--units-xl))}.ui-editor-content ::ng-deep ul:last-child,.ui-editor-content ::ng-deep ol:last-child{margin-block-end:0}.ui-editor-content ::ng-deep li+li{margin-block-start:var(--ui-editor-list-item-gap, var(--units-2xs))}.ui-editor-content ::ng-deep b,.ui-editor-content ::ng-deep strong{font-weight:var(--ui-editor-bold-weight, var(--weight-bold))}.ui-editor-content ::ng-deep a{color:var(--ui-editor-link-color, var(--global-text-brand));text-decoration:var(--ui-editor-link-text-decoration, underline)}.ui-editor-content ::ng-deep pre{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));padding:var(--ui-editor-code-padding-y, var(--units-sm)) var(--ui-editor-code-padding-x, var(--units-md));border-radius:var(--ui-editor-code-radius, var(--radius-xs));background-color:var(--ui-editor-code-surface, var(--global-background-muted));color:var(--ui-editor-code-color, var(--global-text-default));font-family:var(--ui-editor-code-font-family, var(--fontfamily-monospace));font-size:var(--ui-editor-code-font-size, var(--size-typography-text-md));white-space:pre-wrap;overflow-wrap:break-word}.ui-editor-content ::ng-deep pre:last-child{margin-block-end:0}.ui-editor-content ::ng-deep code{font-family:var(--ui-editor-code-font-family, var(--fontfamily-monospace))}.ui-editor-content ::ng-deep h1,.ui-editor-content ::ng-deep h2,.ui-editor-content ::ng-deep h3{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));font-family:var(--ui-editor-heading-font-family, var(--fontfamily-title));font-weight:var(--ui-editor-heading-weight, var(--weight-bold));line-height:var(--ui-editor-heading-line-height, 1.25)}.ui-editor-content ::ng-deep h1:last-child,.ui-editor-content ::ng-deep h2:last-child,.ui-editor-content ::ng-deep h3:last-child{margin-block-end:0}.ui-editor-content ::ng-deep h1{font-size:var(--ui-editor-heading-1-font-size, var(--size-typography-title-lg))}.ui-editor-content ::ng-deep h2{font-size:var(--ui-editor-heading-2-font-size, var(--size-typography-title-md))}.ui-editor-content ::ng-deep h3{font-size:var(--ui-editor-heading-3-font-size, var(--size-typography-title-sm))}.ui-editor-content ::ng-deep .ui-editor-font-base{font-family:var(--fontfamily-base)}.ui-editor-content ::ng-deep .ui-editor-font-title{font-family:var(--fontfamily-title)}.ui-editor-content ::ng-deep .ui-editor-font-monospace{font-family:var(--fontfamily-monospace)}.ui-editor-content ::ng-deep .ui-editor-size-sm{font-size:var(--ui-editor-size-sm-font-size, var(--size-typography-text-sm))}.ui-editor-content ::ng-deep .ui-editor-size-default{font-size:var(--ui-editor-size-default-font-size, var(--size-typography-text-default))}.ui-editor-content ::ng-deep .ui-editor-size-lg{font-size:var(--ui-editor-size-lg-font-size, var(--size-typography-text-lg))}.ui-editor-content ::ng-deep .ui-editor-size-xl{font-size:var(--ui-editor-size-xl-font-size, var(--size-typography-text-xl))}.ui-editor-content ::ng-deep .ui-editor-color-primary-900{color:var(--primitives-primary-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-900{background-color:var(--primitives-primary-900)}.ui-editor-content ::ng-deep .ui-editor-color-primary-700{color:var(--primitives-primary-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-700{background-color:var(--primitives-primary-700)}.ui-editor-content ::ng-deep .ui-editor-color-primary-500{color:var(--primitives-primary-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-500{background-color:var(--primitives-primary-500)}.ui-editor-content ::ng-deep .ui-editor-color-primary-300{color:var(--primitives-primary-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-300{background-color:var(--primitives-primary-300)}.ui-editor-content ::ng-deep .ui-editor-color-primary-100{color:var(--primitives-primary-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-100{background-color:var(--primitives-primary-100)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-900{color:var(--primitives-secondary-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-900{background-color:var(--primitives-secondary-900)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-700{color:var(--primitives-secondary-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-700{background-color:var(--primitives-secondary-700)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-500{color:var(--primitives-secondary-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-500{background-color:var(--primitives-secondary-500)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-300{color:var(--primitives-secondary-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-300{background-color:var(--primitives-secondary-300)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-100{color:var(--primitives-secondary-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-100{background-color:var(--primitives-secondary-100)}.ui-editor-content ::ng-deep .ui-editor-color-green-900{color:var(--primitives-green-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-900{background-color:var(--primitives-green-900)}.ui-editor-content ::ng-deep .ui-editor-color-green-700{color:var(--primitives-green-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-700{background-color:var(--primitives-green-700)}.ui-editor-content ::ng-deep .ui-editor-color-green-500{color:var(--primitives-green-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-500{background-color:var(--primitives-green-500)}.ui-editor-content ::ng-deep .ui-editor-color-green-300{color:var(--primitives-green-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-300{background-color:var(--primitives-green-300)}.ui-editor-content ::ng-deep .ui-editor-color-green-100{color:var(--primitives-green-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-100{background-color:var(--primitives-green-100)}.ui-editor-content ::ng-deep .ui-editor-color-orange-900{color:var(--primitives-orange-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-900{background-color:var(--primitives-orange-900)}.ui-editor-content ::ng-deep .ui-editor-color-orange-700{color:var(--primitives-orange-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-700{background-color:var(--primitives-orange-700)}.ui-editor-content ::ng-deep .ui-editor-color-orange-500{color:var(--primitives-orange-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-500{background-color:var(--primitives-orange-500)}.ui-editor-content ::ng-deep .ui-editor-color-orange-300{color:var(--primitives-orange-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-300{background-color:var(--primitives-orange-300)}.ui-editor-content ::ng-deep .ui-editor-color-orange-100{color:var(--primitives-orange-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-100{background-color:var(--primitives-orange-100)}.ui-editor-content ::ng-deep .ui-editor-color-red-900{color:var(--primitives-red-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-900{background-color:var(--primitives-red-900)}.ui-editor-content ::ng-deep .ui-editor-color-red-700{color:var(--primitives-red-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-700{background-color:var(--primitives-red-700)}.ui-editor-content ::ng-deep .ui-editor-color-red-500{color:var(--primitives-red-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-500{background-color:var(--primitives-red-500)}.ui-editor-content ::ng-deep .ui-editor-color-red-300{color:var(--primitives-red-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-300{background-color:var(--primitives-red-300)}.ui-editor-content ::ng-deep .ui-editor-color-red-100{color:var(--primitives-red-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-100{background-color:var(--primitives-red-100)}.ui-editor-content ::ng-deep .ui-editor-color-slate-900{color:var(--primitives-slate-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-900{background-color:var(--primitives-slate-900)}.ui-editor-content ::ng-deep .ui-editor-color-slate-700{color:var(--primitives-slate-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-700{background-color:var(--primitives-slate-700)}.ui-editor-content ::ng-deep .ui-editor-color-slate-500{color:var(--primitives-slate-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-500{background-color:var(--primitives-slate-500)}.ui-editor-content ::ng-deep .ui-editor-color-slate-300{color:var(--primitives-slate-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-300{background-color:var(--primitives-slate-300)}.ui-editor-content ::ng-deep .ui-editor-color-slate-100{color:var(--primitives-slate-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-100{background-color:var(--primitives-slate-100)}.ui-editor-content ::ng-deep .ui-editor-color-grey-900{color:var(--primitives-grey-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-900{background-color:var(--primitives-grey-900)}.ui-editor-content ::ng-deep .ui-editor-color-grey-700{color:var(--primitives-grey-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-700{background-color:var(--primitives-grey-700)}.ui-editor-content ::ng-deep .ui-editor-color-grey-500{color:var(--primitives-grey-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-500{background-color:var(--primitives-grey-500)}.ui-editor-content ::ng-deep .ui-editor-color-grey-300{color:var(--primitives-grey-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-300{background-color:var(--primitives-grey-300)}.ui-editor-content ::ng-deep .ui-editor-color-grey-100{color:var(--primitives-grey-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-100{background-color:var(--primitives-grey-100)}.ui-editor-content ::ng-deep .ui-editor-color-black{color:var(--primitives-black-base)}.ui-editor-content ::ng-deep .ui-editor-color-white{color:var(--primitives-white-base)}.ui-editor-content ::ng-deep .ui-editor-highlight-black{background-color:var(--primitives-black-base)}.ui-editor-content ::ng-deep .ui-editor-highlight-white{background-color:var(--primitives-white-base)}.ui-editor-count{margin-left:auto;flex-shrink:0;font-family:var(--ui-editor-count-font-family, var(--fontfamily-base));font-size:var(--ui-editor-count-font-size, var(--size-typography-text-md));color:var(--ui-editor-count-color, var(--form-low-content-default));-webkit-user-select:none;user-select:none}.ui-editor-count._small{font-size:var(--ui-editor-count-font-size-small, var(--size-typography-text-sm))}.ui-editor-count._over{color:var(--ui-editor-count-color-over, var(--form-error-content-default))}.ui-editor-count._disabled{color:var(--ui-editor-count-color-disabled, var(--form-high-content-disabled))}\n"],
871
+ dependencies: [
872
+ {
873
+ kind: "component",
874
+ type: UiField,
875
+ selector: "ui-field",
876
+ inputs: [
877
+ "label",
878
+ "for",
879
+ "required",
880
+ "size",
881
+ "level",
882
+ "floatLabel",
883
+ "filled",
884
+ "disabled",
885
+ "readonly",
886
+ "multiline",
887
+ "autoHeight",
888
+ "message",
889
+ "messageId",
890
+ "showMessageIcon",
891
+ "messageIcon",
892
+ "hasFooter",
893
+ "hasPrefix"
894
+ ]
895
+ },
896
+ {
897
+ kind: "component",
898
+ type: UiButton,
899
+ selector: "ui-button",
900
+ inputs: [
901
+ "label",
902
+ "ariaLabel",
903
+ "type",
904
+ "level",
905
+ "variant",
906
+ "onColor",
907
+ "size",
908
+ "icon",
909
+ "iconPos",
910
+ "iconOnly",
911
+ "loading",
912
+ "loadingIcon",
913
+ "expanded",
914
+ "rounded",
915
+ "disabled",
916
+ "ripple",
917
+ "tabindex",
918
+ "buttonProps",
919
+ "iconTemplate",
920
+ "loadingIconTemplate",
921
+ "href",
922
+ "routerLink",
923
+ "target",
924
+ "rel"
925
+ ],
926
+ outputs: [
927
+ "buttonClick",
928
+ "buttonFocus",
929
+ "buttonBlur"
930
+ ]
931
+ },
932
+ {
933
+ kind: "component",
934
+ type: UiSwatchPicker,
935
+ selector: "ui-swatch-picker",
936
+ inputs: [
937
+ "palette",
938
+ "value",
939
+ "popup",
940
+ "size",
941
+ "allowClear",
942
+ "ariaLabel"
943
+ ],
944
+ outputs: [
945
+ "valueChange",
946
+ "swatchSelect",
947
+ "opened",
948
+ "closed"
949
+ ]
950
+ },
951
+ {
952
+ kind: "component",
953
+ type: UiSelect,
954
+ selector: "ui-select",
955
+ inputs: [
956
+ "options",
957
+ "optionLabel",
958
+ "optionValue",
959
+ "optionDisabled",
960
+ "group",
961
+ "optionGroupLabel",
962
+ "optionGroupChildren",
963
+ "dataKey",
964
+ "multiple",
965
+ "checkmark",
966
+ "checkbox",
967
+ "maxSelectedLabels",
968
+ "overflowLabel",
969
+ "placeholder",
970
+ "showClear",
971
+ "clearAriaLabel",
972
+ "icon",
973
+ "showIcon",
974
+ "filter",
975
+ "filterPlaceholder",
976
+ "filterAriaLabel",
977
+ "filterBy",
978
+ "autofocusFilter",
979
+ "resetFilterOnHide",
980
+ "ripple",
981
+ "emptyMessage",
982
+ "emptyFilterMessage",
983
+ "editable",
984
+ "loading",
985
+ "autoOptionFocus",
986
+ "selectOnFocus",
987
+ "focusOnHover",
988
+ "virtualScroll",
989
+ "virtualScrollItemSize",
990
+ "lazy",
991
+ "scrollHeight",
992
+ "autoFlip",
993
+ "panelStyleClass",
994
+ "panelWidth"
995
+ ],
996
+ outputs: [
997
+ "valueChange",
998
+ "opened",
999
+ "closed",
1000
+ "cleared",
1001
+ "filterChange",
1002
+ "lazyLoad",
1003
+ "inputFocus",
1004
+ "inputBlur"
1005
+ ]
1006
+ },
1007
+ {
1008
+ kind: "directive",
1009
+ type: NgTemplateOutlet,
1010
+ selector: "[ngTemplateOutlet]",
1011
+ inputs: [
1012
+ "ngTemplateOutletContext",
1013
+ "ngTemplateOutlet",
1014
+ "ngTemplateOutletInjector"
1015
+ ]
1016
+ },
1017
+ {
1018
+ kind: "ngmodule",
1019
+ type: FormsModule
1020
+ },
1021
+ {
1022
+ kind: "directive",
1023
+ type: i1.NgControlStatus,
1024
+ selector: "[formControlName],[ngModel],[formControl]"
1025
+ },
1026
+ {
1027
+ kind: "directive",
1028
+ type: i1.NgModel,
1029
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
1030
+ inputs: [
1031
+ "name",
1032
+ "disabled",
1033
+ "ngModel",
1034
+ "ngModelOptions"
1035
+ ],
1036
+ outputs: ["ngModelChange"],
1037
+ exportAs: ["ngModel"]
1038
+ }
1039
+ ]
1040
+ });
1041
+ }
1042
+ };
1043
+ i0.ɵɵngDeclareClassMetadata({
1044
+ minVersion: "12.0.0",
1045
+ version: "22.3.0",
1046
+ ngImport: i0,
1047
+ type: UiEditor,
1048
+ decorators: [{
1049
+ type: Component,
1050
+ args: [{
1051
+ selector: "ui-editor",
1052
+ imports: [
1053
+ UiField,
1054
+ UiButton,
1055
+ UiSwatchPicker,
1056
+ UiSelect,
1057
+ NgTemplateOutlet,
1058
+ FormsModule
1059
+ ],
1060
+ providers: [{
1061
+ provide: NG_VALUE_ACCESSOR,
1062
+ useExisting: forwardRef(() => UiEditor),
1063
+ multi: true
1064
+ }],
1065
+ template: "<ui-field\n multiline\n [label]=\"label()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n [hasFooter]=\"showCount()\"\n>\n <div class=\"ui-editor\" [class._small]=\"size() === 'small'\" [style.--_rows]=\"minRows()\">\n @if (toolbarPosition() === 'top') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n\n <div class=\"ui-editor-area\">\n <div\n #contentEl\n class=\"ui-editor-content\"\n [class._small]=\"size() === 'small'\"\n [id]=\"resolvedId()\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"isEditable() ? 'true' : 'false'\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"describedByIds()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (beforeinput)=\"onBeforeInput($any($event))\"\n (paste)=\"onPaste($event)\"\n (keydown)=\"onContentKeydown($event)\"\n (keyup)=\"refreshState()\"\n (mouseup)=\"refreshState()\"\n (focus)=\"editorFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n\n @if (showPlaceholder()) {\n <span class=\"ui-editor-placeholder\" aria-hidden=\"true\">{{ placeholder() }}</span>\n }\n </div>\n\n @if (toolbarPosition() === 'bottom') {\n <ng-container [ngTemplateOutlet]=\"toolbarTpl\" />\n }\n </div>\n\n @if (showCount()) {\n <span\n uiFieldFooter\n class=\"ui-editor-count\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n [class._over]=\"overLimit()\"\n [attr.id]=\"countId()\"\n >\n {{ charCount() }}\n @if (maxlength(); as max) {\n &nbsp;/&nbsp;{{ max }}\n }\n </span>\n }\n</ui-field>\n\n<ng-template #toolbarTpl>\n @if (hasToolbar()) {\n <!-- ARIA toolbar pattern: keyboard delegated to the role=\"toolbar\" container,\n focus lives on the items (roving tabindex), same as ui-menu. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n #toolbarEl\n class=\"ui-editor-toolbar\"\n [class._bottom]=\"toolbarPosition() === 'bottom'\"\n role=\"toolbar\"\n aria-label=\"Mise en forme\"\n aria-orientation=\"horizontal\"\n (mousedown)=\"onToolbarMousedown($event)\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (entry of toolbar(); track entry.index) {\n @if (entry.isSeparator) {\n <span class=\"ui-editor-toolbar-separator\" aria-hidden=\"true\"></span>\n } @else if (entry.select; as select) {\n <!-- The dropdown takes the focus, so the command restores the caret\n before it runs (see onSelectValueChange). -->\n <ui-select\n class=\"ui-editor-tool ui-editor-select\"\n size=\"small\"\n [options]=\"selectOptions(select)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"selectValue(select)\"\n [ariaLabel]=\"selectLabel(select)\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n (valueChange)=\"onSelectValueChange(select, $event, entry.index)\"\n />\n } @else {\n <ui-button\n class=\"ui-editor-tool\"\n [class._colorTool]=\"\n entry.buttonTool === 'textColor' || entry.buttonTool === 'highlightColor'\n \"\n variant=\"ghost\"\n level=\"low\"\n size=\"small\"\n iconOnly\n [icon]=\"entry.meta!.icon\"\n [ariaLabel]=\"entry.meta!.label\"\n [disabled]=\"!isEditable()\"\n [tabindex]=\"entry.index === tabStop() ? 0 : -1\"\n [buttonProps]=\"toolProps(entry.buttonTool!)\"\n [style.--ui-editor-swatch-indicator-color]=\"colorIndicatorVar(entry.buttonTool)\"\n (buttonClick)=\"runTool(entry.buttonTool!, entry.index, $event)\"\n />\n }\n }\n\n <!-- `textColor`/`highlightColor` popups: no trigger of their own (same\n composition contract as `ui-menu`), opened via `runTool` ->\n `onColorToolClick` -> `toggle(event)`. -->\n <ui-swatch-picker\n #textColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentTextColor()\"\n ariaLabel=\"Couleur du texte\"\n (swatchSelect)=\"onTextColorSelect($event)\"\n (opened)=\"textColorPickerOpen.set(true)\"\n (closed)=\"textColorPickerOpen.set(false)\"\n />\n <ui-swatch-picker\n #highlightColorPicker\n popup\n size=\"small\"\n [allowClear]=\"true\"\n [value]=\"currentHighlightColor()\"\n ariaLabel=\"Couleur de surlignage\"\n (swatchSelect)=\"onHighlightColorSelect($event)\"\n (opened)=\"highlightColorPickerOpen.set(true)\"\n (closed)=\"highlightColorPickerOpen.set(false)\"\n />\n </div>\n }\n</ng-template>\n",
1066
+ styles: [".ui-editor{display:flex;flex:1 1 auto;flex-direction:column;min-width:0;border-radius:var(--ui-editor-radius, inherit);overflow:hidden}.ui-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-editor-toolbar-gap, var(--units-2xs));flex-shrink:0;padding:var(--ui-editor-toolbar-padding-y, var(--units-2xs)) var(--ui-editor-toolbar-padding-x, var(--units-xs));background-color:var(--ui-editor-toolbar-surface, var(--global-background-muted));border-block-end:var(--ui-editor-toolbar-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-editor-toolbar-stroke, var(--form-low-stroke-default))}.ui-editor-toolbar._bottom{border-block-end:none;border-block-start:var(--ui-editor-toolbar-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-editor-toolbar-stroke, var(--form-low-stroke-default))}.ui-editor-toolbar-separator{flex-shrink:0;inline-size:var(--ui-editor-separator-width, var(--stroke-sm));block-size:var(--ui-editor-separator-height, var(--size-typography-text-default));background-color:var(--ui-editor-separator-color, var(--form-low-stroke-default))}.ui-editor-select{display:inline-flex;flex-shrink:0;min-inline-size:var(--ui-editor-select-width, 13ch);--ui-field-stroke-width: 0}.ui-editor-select ::ng-deep .ui-select{inline-size:100%}.ui-editor-select ::ng-deep .ui-field-box{background:transparent;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-editor-select ::ng-deep .ui-field-box:hover{background-color:var(--ui-editor-toolbar-select-surface-hover, var(--form-low-surface-hover))}.ui-editor-tool._colorTool{position:relative}.ui-editor-tool._colorTool:after{content:\"\";position:absolute;inset-inline:var(--ui-editor-swatch-indicator-offset-x, var(--units-2xs));inset-block-end:0;block-size:var(--ui-editor-swatch-indicator-height, var(--stroke-lg));border-radius:var(--ui-editor-swatch-indicator-height, var(--stroke-lg));background-color:var(--ui-editor-swatch-indicator-color, transparent)}.ui-editor-area{position:relative;display:flex;flex:1 1 auto;min-height:0}.ui-editor-content{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-editor-content::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-editor-content:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-editor-content{box-sizing:border-box;width:100%;min-height:var(--ui-editor-min-height, calc(var(--_rows, 4) * var(--ui-editor-line-height, 1.5) * 1em));max-height:var(--ui-editor-max-height, none);padding:var(--ui-editor-padding-y, var(--ui-form-textarea-padding-y, var(--units-default))) var(--ui-editor-padding-x, var(--ui-form-field-padding-x, var(--units-md)));overflow-y:auto;line-height:var(--ui-editor-line-height, 1.5);font-size:var(--ui-editor-font-size, var(--size-typography-text-default));overflow-wrap:break-word}.ui-editor-content._small{padding-block:var(--ui-editor-padding-y-small, var(--ui-form-textarea-padding-y-small, var(--units-md)));font-size:var(--ui-editor-font-size-small, var(--size-typography-text-md))}.ui-editor-content:focus,.ui-editor-content:focus-visible{outline:none}.ui-editor-content[contenteditable=false]{cursor:default}.ui-editor-placeholder{position:absolute;inset-block-start:var(--ui-editor-padding-y, var(--ui-form-textarea-padding-y, var(--units-default)));inset-inline-start:var(--ui-editor-padding-x, var(--ui-form-field-padding-x, var(--units-md)));line-height:var(--ui-editor-line-height, 1.5);font-family:var(--ui-editor-placeholder-font-family, var(--fontfamily-base));font-size:var(--ui-editor-font-size, var(--size-typography-text-default));color:var(--ui-editor-placeholder-color, var(--form-low-content-default));pointer-events:none;-webkit-user-select:none;user-select:none}.ui-editor._small .ui-editor-placeholder{inset-block-start:var(--ui-editor-padding-y-small, var(--ui-form-textarea-padding-y-small, var(--units-md)));font-size:var(--ui-editor-font-size-small, var(--size-typography-text-md))}.ui-editor-content ::ng-deep p{margin-block:0 var(--ui-editor-block-gap, var(--units-sm))}.ui-editor-content ::ng-deep p:last-child{margin-block-end:0}.ui-editor-content ::ng-deep ul,.ui-editor-content ::ng-deep ol{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));padding-inline-start:var(--ui-editor-list-padding-inline-start, var(--units-xl))}.ui-editor-content ::ng-deep ul:last-child,.ui-editor-content ::ng-deep ol:last-child{margin-block-end:0}.ui-editor-content ::ng-deep li+li{margin-block-start:var(--ui-editor-list-item-gap, var(--units-2xs))}.ui-editor-content ::ng-deep b,.ui-editor-content ::ng-deep strong{font-weight:var(--ui-editor-bold-weight, var(--weight-bold))}.ui-editor-content ::ng-deep a{color:var(--ui-editor-link-color, var(--global-text-brand));text-decoration:var(--ui-editor-link-text-decoration, underline)}.ui-editor-content ::ng-deep pre{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));padding:var(--ui-editor-code-padding-y, var(--units-sm)) var(--ui-editor-code-padding-x, var(--units-md));border-radius:var(--ui-editor-code-radius, var(--radius-xs));background-color:var(--ui-editor-code-surface, var(--global-background-muted));color:var(--ui-editor-code-color, var(--global-text-default));font-family:var(--ui-editor-code-font-family, var(--fontfamily-monospace));font-size:var(--ui-editor-code-font-size, var(--size-typography-text-md));white-space:pre-wrap;overflow-wrap:break-word}.ui-editor-content ::ng-deep pre:last-child{margin-block-end:0}.ui-editor-content ::ng-deep code{font-family:var(--ui-editor-code-font-family, var(--fontfamily-monospace))}.ui-editor-content ::ng-deep h1,.ui-editor-content ::ng-deep h2,.ui-editor-content ::ng-deep h3{margin-block:0 var(--ui-editor-block-gap, var(--units-sm));font-family:var(--ui-editor-heading-font-family, var(--fontfamily-title));font-weight:var(--ui-editor-heading-weight, var(--weight-bold));line-height:var(--ui-editor-heading-line-height, 1.25)}.ui-editor-content ::ng-deep h1:last-child,.ui-editor-content ::ng-deep h2:last-child,.ui-editor-content ::ng-deep h3:last-child{margin-block-end:0}.ui-editor-content ::ng-deep h1{font-size:var(--ui-editor-heading-1-font-size, var(--size-typography-title-lg))}.ui-editor-content ::ng-deep h2{font-size:var(--ui-editor-heading-2-font-size, var(--size-typography-title-md))}.ui-editor-content ::ng-deep h3{font-size:var(--ui-editor-heading-3-font-size, var(--size-typography-title-sm))}.ui-editor-content ::ng-deep .ui-editor-font-base{font-family:var(--fontfamily-base)}.ui-editor-content ::ng-deep .ui-editor-font-title{font-family:var(--fontfamily-title)}.ui-editor-content ::ng-deep .ui-editor-font-monospace{font-family:var(--fontfamily-monospace)}.ui-editor-content ::ng-deep .ui-editor-size-sm{font-size:var(--ui-editor-size-sm-font-size, var(--size-typography-text-sm))}.ui-editor-content ::ng-deep .ui-editor-size-default{font-size:var(--ui-editor-size-default-font-size, var(--size-typography-text-default))}.ui-editor-content ::ng-deep .ui-editor-size-lg{font-size:var(--ui-editor-size-lg-font-size, var(--size-typography-text-lg))}.ui-editor-content ::ng-deep .ui-editor-size-xl{font-size:var(--ui-editor-size-xl-font-size, var(--size-typography-text-xl))}.ui-editor-content ::ng-deep .ui-editor-color-primary-900{color:var(--primitives-primary-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-900{background-color:var(--primitives-primary-900)}.ui-editor-content ::ng-deep .ui-editor-color-primary-700{color:var(--primitives-primary-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-700{background-color:var(--primitives-primary-700)}.ui-editor-content ::ng-deep .ui-editor-color-primary-500{color:var(--primitives-primary-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-500{background-color:var(--primitives-primary-500)}.ui-editor-content ::ng-deep .ui-editor-color-primary-300{color:var(--primitives-primary-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-300{background-color:var(--primitives-primary-300)}.ui-editor-content ::ng-deep .ui-editor-color-primary-100{color:var(--primitives-primary-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-primary-100{background-color:var(--primitives-primary-100)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-900{color:var(--primitives-secondary-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-900{background-color:var(--primitives-secondary-900)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-700{color:var(--primitives-secondary-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-700{background-color:var(--primitives-secondary-700)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-500{color:var(--primitives-secondary-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-500{background-color:var(--primitives-secondary-500)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-300{color:var(--primitives-secondary-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-300{background-color:var(--primitives-secondary-300)}.ui-editor-content ::ng-deep .ui-editor-color-secondary-100{color:var(--primitives-secondary-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-secondary-100{background-color:var(--primitives-secondary-100)}.ui-editor-content ::ng-deep .ui-editor-color-green-900{color:var(--primitives-green-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-900{background-color:var(--primitives-green-900)}.ui-editor-content ::ng-deep .ui-editor-color-green-700{color:var(--primitives-green-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-700{background-color:var(--primitives-green-700)}.ui-editor-content ::ng-deep .ui-editor-color-green-500{color:var(--primitives-green-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-500{background-color:var(--primitives-green-500)}.ui-editor-content ::ng-deep .ui-editor-color-green-300{color:var(--primitives-green-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-300{background-color:var(--primitives-green-300)}.ui-editor-content ::ng-deep .ui-editor-color-green-100{color:var(--primitives-green-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-green-100{background-color:var(--primitives-green-100)}.ui-editor-content ::ng-deep .ui-editor-color-orange-900{color:var(--primitives-orange-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-900{background-color:var(--primitives-orange-900)}.ui-editor-content ::ng-deep .ui-editor-color-orange-700{color:var(--primitives-orange-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-700{background-color:var(--primitives-orange-700)}.ui-editor-content ::ng-deep .ui-editor-color-orange-500{color:var(--primitives-orange-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-500{background-color:var(--primitives-orange-500)}.ui-editor-content ::ng-deep .ui-editor-color-orange-300{color:var(--primitives-orange-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-300{background-color:var(--primitives-orange-300)}.ui-editor-content ::ng-deep .ui-editor-color-orange-100{color:var(--primitives-orange-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-orange-100{background-color:var(--primitives-orange-100)}.ui-editor-content ::ng-deep .ui-editor-color-red-900{color:var(--primitives-red-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-900{background-color:var(--primitives-red-900)}.ui-editor-content ::ng-deep .ui-editor-color-red-700{color:var(--primitives-red-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-700{background-color:var(--primitives-red-700)}.ui-editor-content ::ng-deep .ui-editor-color-red-500{color:var(--primitives-red-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-500{background-color:var(--primitives-red-500)}.ui-editor-content ::ng-deep .ui-editor-color-red-300{color:var(--primitives-red-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-300{background-color:var(--primitives-red-300)}.ui-editor-content ::ng-deep .ui-editor-color-red-100{color:var(--primitives-red-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-red-100{background-color:var(--primitives-red-100)}.ui-editor-content ::ng-deep .ui-editor-color-slate-900{color:var(--primitives-slate-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-900{background-color:var(--primitives-slate-900)}.ui-editor-content ::ng-deep .ui-editor-color-slate-700{color:var(--primitives-slate-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-700{background-color:var(--primitives-slate-700)}.ui-editor-content ::ng-deep .ui-editor-color-slate-500{color:var(--primitives-slate-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-500{background-color:var(--primitives-slate-500)}.ui-editor-content ::ng-deep .ui-editor-color-slate-300{color:var(--primitives-slate-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-300{background-color:var(--primitives-slate-300)}.ui-editor-content ::ng-deep .ui-editor-color-slate-100{color:var(--primitives-slate-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-slate-100{background-color:var(--primitives-slate-100)}.ui-editor-content ::ng-deep .ui-editor-color-grey-900{color:var(--primitives-grey-900)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-900{background-color:var(--primitives-grey-900)}.ui-editor-content ::ng-deep .ui-editor-color-grey-700{color:var(--primitives-grey-700)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-700{background-color:var(--primitives-grey-700)}.ui-editor-content ::ng-deep .ui-editor-color-grey-500{color:var(--primitives-grey-500)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-500{background-color:var(--primitives-grey-500)}.ui-editor-content ::ng-deep .ui-editor-color-grey-300{color:var(--primitives-grey-300)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-300{background-color:var(--primitives-grey-300)}.ui-editor-content ::ng-deep .ui-editor-color-grey-100{color:var(--primitives-grey-100)}.ui-editor-content ::ng-deep .ui-editor-highlight-grey-100{background-color:var(--primitives-grey-100)}.ui-editor-content ::ng-deep .ui-editor-color-black{color:var(--primitives-black-base)}.ui-editor-content ::ng-deep .ui-editor-color-white{color:var(--primitives-white-base)}.ui-editor-content ::ng-deep .ui-editor-highlight-black{background-color:var(--primitives-black-base)}.ui-editor-content ::ng-deep .ui-editor-highlight-white{background-color:var(--primitives-white-base)}.ui-editor-count{margin-left:auto;flex-shrink:0;font-family:var(--ui-editor-count-font-family, var(--fontfamily-base));font-size:var(--ui-editor-count-font-size, var(--size-typography-text-md));color:var(--ui-editor-count-color, var(--form-low-content-default));-webkit-user-select:none;user-select:none}.ui-editor-count._small{font-size:var(--ui-editor-count-font-size-small, var(--size-typography-text-sm))}.ui-editor-count._over{color:var(--ui-editor-count-color-over, var(--form-error-content-default))}.ui-editor-count._disabled{color:var(--ui-editor-count-color-disabled, var(--form-high-content-disabled))}\n"]
1067
+ }]
1068
+ }],
1069
+ ctorParameters: () => [],
1070
+ propDecorators: {
1071
+ tools: [{
1072
+ type: i0.Input,
1073
+ args: [{
1074
+ isSignal: true,
1075
+ alias: "tools",
1076
+ required: false
1077
+ }]
1078
+ }],
1079
+ placeholder: [{
1080
+ type: i0.Input,
1081
+ args: [{
1082
+ isSignal: true,
1083
+ alias: "placeholder",
1084
+ required: false
1085
+ }]
1086
+ }],
1087
+ minRows: [{
1088
+ type: i0.Input,
1089
+ args: [{
1090
+ isSignal: true,
1091
+ alias: "minRows",
1092
+ required: false
1093
+ }]
1094
+ }],
1095
+ maxlength: [{
1096
+ type: i0.Input,
1097
+ args: [{
1098
+ isSignal: true,
1099
+ alias: "maxlength",
1100
+ required: false
1101
+ }]
1102
+ }],
1103
+ showCount: [{
1104
+ type: i0.Input,
1105
+ args: [{
1106
+ isSignal: true,
1107
+ alias: "showCount",
1108
+ required: false
1109
+ }]
1110
+ }],
1111
+ toolbarPosition: [{
1112
+ type: i0.Input,
1113
+ args: [{
1114
+ isSignal: true,
1115
+ alias: "toolbarPosition",
1116
+ required: false
1117
+ }]
1118
+ }],
1119
+ valueChange: [{
1120
+ type: i0.Output,
1121
+ args: ["valueChange"]
1122
+ }],
1123
+ editorFocus: [{
1124
+ type: i0.Output,
1125
+ args: ["editorFocus"]
1126
+ }],
1127
+ editorBlur: [{
1128
+ type: i0.Output,
1129
+ args: ["editorBlur"]
1130
+ }],
1131
+ selectionChange: [{
1132
+ type: i0.Output,
1133
+ args: ["selectionChange"]
1134
+ }],
1135
+ contentEl: [{
1136
+ type: i0.ViewChild,
1137
+ args: ["contentEl", { isSignal: true }]
1138
+ }],
1139
+ toolbarEl: [{
1140
+ type: i0.ViewChild,
1141
+ args: ["toolbarEl", { isSignal: true }]
1142
+ }],
1143
+ textColorPicker: [{
1144
+ type: i0.ViewChild,
1145
+ args: ["textColorPicker", { isSignal: true }]
1146
+ }],
1147
+ highlightColorPicker: [{
1148
+ type: i0.ViewChild,
1149
+ args: ["highlightColorPicker", { isSignal: true }]
1150
+ }]
1151
+ }
1152
+ });
1209
1153
  export { DEFAULT_EDITOR_TOOLS, EDITOR_COLORS, EDITOR_FONTS, EDITOR_HIGHLIGHTS, EDITOR_SELECT_TOOLS, EDITOR_SIZES, EDITOR_TOOL_META, UiEditor, applyCommand, applyFontFamily, applyFontSize, applyHighlightColor, applyLink, applyTextColor, clearFormatMarkers, clearMarkerClass, convertColorMarkers, convertFontMarkers, convertHighlightMarkers, convertSizeMarkers, emptyEditorState, htmlToText, insertHtml, insertText, isEmptyHtml, isInCodeBlock, normalizeHtml, readEditorState, readFontFamily, readFontSize, readHighlightColor, readTextColor, removeLink, resolveFontLabel, sanitizeEditorHtml, sanitizeStyle, scrubInPlace, toggleCodeBlock };
1210
- //# sourceMappingURL=4sh-ui-kit-forms-ui-editor.mjs.map
1154
+
1155
+ //# sourceMappingURL=4sh-ui-kit-forms-ui-editor.mjs.map