@4sh/ui-kit 0.15.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 (220) hide show
  1. package/README.fr.md +18 -10
  2. package/README.md +18 -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 -953
  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 -2039
  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 -130
  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 -246
  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 -291
  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 -194
  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 -131
  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 +723 -596
  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 +313 -2
  143. package/mcp/data/text-search-docs.json +177 -17
  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/styles/utils/_mixins.scss +11 -0
  150. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  151. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  152. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  153. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  154. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  155. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  156. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +577 -367
  157. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  158. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  159. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  160. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  161. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  162. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  163. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  164. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  165. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -57
  166. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -93
  167. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -100
  168. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  169. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -116
  170. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  171. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  172. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  173. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  174. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  175. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  176. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  177. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  178. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  179. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -54
  180. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  181. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  182. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  183. package/types/4sh-ui-kit-forms.d.ts +291 -186
  184. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  185. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  186. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  187. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  188. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  189. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  190. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  191. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  192. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  193. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  194. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  195. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  196. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  197. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  198. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  199. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  200. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  201. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  202. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  203. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  204. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  205. package/types/4sh-ui-kit-motion.d.ts +117 -67
  206. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  207. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  208. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  209. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  210. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  211. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  212. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  213. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  214. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  215. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  216. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  217. package/types/4sh-ui-kit-theming.d.ts +27 -29
  218. package/types/4sh-ui-kit-types.d.ts +6 -5
  219. package/types/4sh-ui-kit.d.ts +4 -3
  220. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,7 +1,9 @@
1
- import * as _angular_core from '@angular/core';
2
- import { BaseFormField } from '@4sh/ui-kit/forms';
3
- import { UiSwatch } from '@4sh/ui-kit/forms/ui-swatch-picker';
4
-
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import { BaseFormField } from "@4sh/ui-kit/forms";
5
+ import { UiSwatch } from "@4sh/ui-kit/forms/ui-swatch-picker";
6
+ import * as i0 from "@angular/core";
5
7
  /**
6
8
  * Rich-text command layer — the only place that talks to the legacy editing API.
7
9
  *
@@ -17,16 +19,16 @@ import { UiSwatch } from '@4sh/ui-kit/forms/ui-swatch-picker';
17
19
  * `separator` is purely visual; `fontFamily` renders a dropdown rather than a
18
20
  * button, since it picks among values instead of toggling one.
19
21
  */
20
- type EditorTool = 'bold' | 'italic' | 'underline' | 'bulletList' | 'orderedList' | 'codeBlock' | 'fontFamily' | 'fontSize' | 'indent' | 'outdent' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'textColor' | 'highlightColor' | 'link' | 'clearFormat' | 'separator';
22
+ export type EditorTool = 'bold' | 'italic' | 'underline' | 'bulletList' | 'orderedList' | 'codeBlock' | 'fontFamily' | 'fontSize' | 'indent' | 'outdent' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'textColor' | 'highlightColor' | 'link' | 'clearFormat' | 'separator';
21
23
  /** Tools rendered as a dropdown: they pick among values instead of toggling one. */
22
- type EditorSelectTool = 'fontFamily' | 'fontSize';
24
+ export type EditorSelectTool = 'fontFamily' | 'fontSize';
23
25
  /** Tools rendered as an icon button. */
24
- type EditorButtonTool = Exclude<EditorTool, 'separator' | EditorSelectTool>;
25
- declare const EDITOR_SELECT_TOOLS: readonly EditorSelectTool[];
26
+ export type EditorButtonTool = Exclude<EditorTool, 'separator' | EditorSelectTool>;
27
+ export declare const EDITOR_SELECT_TOOLS: readonly EditorSelectTool[];
26
28
  /** Commands whose active/inactive state the toolbar reflects via `aria-pressed`. */
27
- type EditorToggleTool = Extract<EditorTool, 'bold' | 'italic' | 'underline' | 'bulletList' | 'orderedList' | 'codeBlock' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify'>;
29
+ export type EditorToggleTool = Extract<EditorTool, 'bold' | 'italic' | 'underline' | 'bulletList' | 'orderedList' | 'codeBlock' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify'>;
28
30
  /** Active formatting at the caret, recomputed after every interaction. */
29
- type EditorState = Record<EditorToggleTool, boolean>;
31
+ export type EditorState = Record<EditorToggleTool, boolean>;
30
32
  /**
31
33
  * Type families the editor can apply.
32
34
  *
@@ -34,7 +36,7 @@ type EditorState = Record<EditorToggleTool, boolean>;
34
36
  * into the value and step outside the `--fontfamily-*` tokens. The system has no
35
37
  * serif face, so the list is the three families the tokens actually carry.
36
38
  */
37
- type EditorFont = 'base' | 'title' | 'monospace';
39
+ export type EditorFont = 'base' | 'title' | 'monospace';
38
40
  /**
39
41
  * Font key → class written into the value, token holding the family, and the
40
42
  * fallback label used when the real name cannot be read (SSR, unset token).
@@ -43,11 +45,11 @@ type EditorFont = 'base' | 'title' | 'monospace';
43
45
  * (see {@link resolveFontLabel}) rather than hardcoded: a project that rebinds
44
46
  * `--fontfamily-base` would otherwise see a menu naming a font it no longer uses.
45
47
  */
46
- declare const EDITOR_FONTS: readonly {
47
- key: EditorFont;
48
- className: string;
49
- cssVar: string;
50
- label: string;
48
+ export declare const EDITOR_FONTS: readonly {
49
+ key: EditorFont;
50
+ className: string;
51
+ cssVar: string;
52
+ label: string;
51
53
  }[];
52
54
  /**
53
55
  * First face named by a font token — what the family dropdown displays.
@@ -55,14 +57,14 @@ declare const EDITOR_FONTS: readonly {
55
57
  * `--fontfamily-base` holds a whole stack (`Inter, system-ui, …`); only the head
56
58
  * of it is a name a person recognises.
57
59
  */
58
- declare function resolveFontLabel(cssVar: string, fallback: string): string;
60
+ export declare function resolveFontLabel(cssVar: string, fallback: string): string;
59
61
  /** Text sizes the editor can apply, as a step on the typography scale. */
60
- type EditorSize = 'sm' | 'default' | 'lg' | 'xl';
62
+ export type EditorSize = 'sm' | 'default' | 'lg' | 'xl';
61
63
  /** Size key → class written into the value + French label for the dropdown. */
62
- declare const EDITOR_SIZES: readonly {
63
- key: EditorSize;
64
- className: string;
65
- label: string;
64
+ export declare const EDITOR_SIZES: readonly {
65
+ key: EditorSize;
66
+ className: string;
67
+ label: string;
66
68
  }[];
67
69
  /**
68
70
  * The tools enabled when the consumer does not provide a `tools` list.
@@ -76,24 +78,24 @@ declare const EDITOR_SIZES: readonly {
76
78
  * explicitly adds it to `tools`, but shipping it by default would be shipping
77
79
  * a broken button.
78
80
  */
79
- declare const DEFAULT_EDITOR_TOOLS: readonly EditorTool[];
81
+ export declare const DEFAULT_EDITOR_TOOLS: readonly EditorTool[];
80
82
  /** Toolbar metadata per button tool: icon (FontAwesome) + French accessible name. */
81
- declare const EDITOR_TOOL_META: Record<EditorButtonTool, {
82
- icon: string;
83
- label: string;
83
+ export declare const EDITOR_TOOL_META: Record<EditorButtonTool, {
84
+ icon: string;
85
+ label: string;
84
86
  }>;
85
87
  /** Every state off — the value used before the first render and on SSR. */
86
- declare function emptyEditorState(): EditorState;
88
+ export declare function emptyEditorState(): EditorState;
87
89
  /** Applies a formatting command to the current selection. */
88
- declare function applyCommand(tool: Exclude<EditorButtonTool, 'link' | 'codeBlock' | 'textColor' | 'highlightColor'>): void;
90
+ export declare function applyCommand(tool: Exclude<EditorButtonTool, 'link' | 'codeBlock' | 'textColor' | 'highlightColor'>): void;
89
91
  /** Toggles the block under the caret between `<pre>` and a plain paragraph. */
90
- declare function toggleCodeBlock(): void;
92
+ export declare function toggleCodeBlock(): void;
91
93
  /** The caret sits in a code block. */
92
- declare function isInCodeBlock(): boolean;
94
+ export declare function isInCodeBlock(): boolean;
93
95
  /** Applies a type family to the selection (see {@link convertFontMarkers}). */
94
- declare function applyFontFamily(): void;
96
+ export declare function applyFontFamily(): void;
95
97
  /** Rewrites the `<font>` elements `fontName` just produced into `<span class>`. */
96
- declare function convertFontMarkers(root: ParentNode, className: string): void;
98
+ export declare function convertFontMarkers(root: ParentNode, className: string): void;
97
99
  /**
98
100
  * Type family in force at the caret.
99
101
  *
@@ -102,44 +104,44 @@ declare function convertFontMarkers(root: ParentNode, className: string): void;
102
104
  * reporting the base family there would name a font the reader does not see.
103
105
  * `null` only when the computed face matches none of the system families.
104
106
  */
105
- declare function readFontFamily(node: Node | null): EditorFont | null;
107
+ export declare function readFontFamily(node: Node | null): EditorFont | null;
106
108
  /** Applies a text size to the selection (see {@link convertSizeMarkers}). */
107
- declare function applyFontSize(): void;
109
+ export declare function applyFontSize(): void;
108
110
  /** Rewrites the `<font>` elements `fontSize` just produced into `<span class>`. */
109
- declare function convertSizeMarkers(root: ParentNode, className: string): void;
111
+ export declare function convertSizeMarkers(root: ParentNode, className: string): void;
110
112
  /** Text size active at the caret, or `null` when the text uses the default. */
111
- declare function readFontSize(node: Node | null): EditorSize | null;
113
+ export declare function readFontSize(node: Node | null): EditorSize | null;
112
114
  /**
113
115
  * Color key → class written into the value, token holding the swatch, and
114
116
  * label, derived from `ui-swatch-picker`'s default palette rather than
115
117
  * hand-duplicated: the editor's color tools and the nuancier it opens must
116
118
  * always offer the same token set.
117
119
  */
118
- declare const EDITOR_COLORS: readonly {
119
- key: string;
120
- className: string;
121
- cssVar: string;
122
- label: string;
120
+ export declare const EDITOR_COLORS: readonly {
121
+ key: string;
122
+ className: string;
123
+ cssVar: string;
124
+ label: string;
123
125
  }[];
124
126
  /** Same key set as {@link EDITOR_COLORS}, classed separately for the highlight tool. */
125
- declare const EDITOR_HIGHLIGHTS: readonly {
126
- key: string;
127
- className: string;
128
- cssVar: string;
129
- label: string;
127
+ export declare const EDITOR_HIGHLIGHTS: readonly {
128
+ key: string;
129
+ className: string;
130
+ cssVar: string;
131
+ label: string;
130
132
  }[];
131
133
  /** Applies a text color to the selection (see {@link convertColorMarkers}). */
132
- declare function applyTextColor(): void;
134
+ export declare function applyTextColor(): void;
133
135
  /** Rewrites the `<font>` elements `foreColor` just produced into `<span class>`. */
134
- declare function convertColorMarkers(root: ParentNode, className: string): void;
136
+ export declare function convertColorMarkers(root: ParentNode, className: string): void;
135
137
  /** Text color active at the caret, or `null` when the text uses the default. */
136
- declare function readTextColor(node: Node | null): string | null;
138
+ export declare function readTextColor(node: Node | null): string | null;
137
139
  /** Applies a highlight color to the selection (see {@link convertHighlightMarkers}). */
138
- declare function applyHighlightColor(): void;
140
+ export declare function applyHighlightColor(): void;
139
141
  /** Rewrites the `<span style>` elements `hiliteColor` just produced into `<span class>`. */
140
- declare function convertHighlightMarkers(root: ParentNode, className: string): void;
142
+ export declare function convertHighlightMarkers(root: ParentNode, className: string): void;
141
143
  /** Highlight color active at the caret, or `null` when the text carries none. */
142
- declare function readHighlightColor(node: Node | null): string | null;
144
+ export declare function readHighlightColor(node: Node | null): string | null;
143
145
  /**
144
146
  * Strips a color/highlight class from every element carrying it inside
145
147
  * `range`, unwrapping the element when nothing else justifies it (a plain
@@ -149,7 +151,7 @@ declare function readHighlightColor(node: Node | null): string | null;
149
151
  * set a color, there is no native command to remove one, so this undoes what
150
152
  * {@link convertColorMarkers}/{@link convertHighlightMarkers} previously wrote.
151
153
  */
152
- declare function clearMarkerClass(root: ParentNode, range: Range, className: string): void;
154
+ export declare function clearMarkerClass(root: ParentNode, range: Range, className: string): void;
153
155
  /**
154
156
  * Strips every font/size/color/highlight class the editor writes, from
155
157
  * whatever intersects `range`.
@@ -160,21 +162,21 @@ declare function clearMarkerClass(root: ParentNode, range: Range, className: str
160
162
  * `textColor`/`highlightColor` write, so "Clear formatting" needs this on top
161
163
  * of it to actually clear everything.
162
164
  */
163
- declare function clearFormatMarkers(root: ParentNode, range: Range): void;
165
+ export declare function clearFormatMarkers(root: ParentNode, range: Range): void;
164
166
  /** Wraps the current selection in a link (`removeFormat` alone cannot unlink). */
165
- declare function applyLink(href: string): void;
167
+ export declare function applyLink(href: string): void;
166
168
  /** Removes the link around the caret. */
167
- declare function removeLink(): void;
169
+ export declare function removeLink(): void;
168
170
  /** Reads the formatting active at the caret. */
169
- declare function readEditorState(): EditorState;
171
+ export declare function readEditorState(): EditorState;
170
172
  /** Inserts already-sanitised markup at the caret, replacing the selection. */
171
- declare function insertHtml(html: string): void;
173
+ export declare function insertHtml(html: string): void;
172
174
  /** Inserts plain text at the caret, replacing the selection. */
173
- declare function insertText(text: string): void;
175
+ export declare function insertText(text: string): void;
174
176
  /** Keeps only the allowed declarations of a `style` attribute. */
175
- declare function sanitizeStyle(style: string): string;
177
+ export declare function sanitizeStyle(style: string): string;
176
178
  /** Sanitises a value with `sanitize`, relaying the allowed `style` through a class it keeps. */
177
- declare function sanitizeEditorHtml(html: string, sanitize: (html: string) => string): string;
179
+ export declare function sanitizeEditorHtml(html: string, sanitize: (html: string) => string): string;
178
180
  /**
179
181
  * Strips everything outside the whitelist, keeping the text of dropped elements.
180
182
  *
@@ -182,7 +184,7 @@ declare function sanitizeEditorHtml(html: string, sanitize: (html: string) => st
182
184
  * dangerous, this removes what is merely foreign to the editor (Word spans, inline
183
185
  * styles, headings, tables) so the value stays a small, predictable HTML subset.
184
186
  */
185
- declare function normalizeHtml(html: string): string;
187
+ export declare function normalizeHtml(html: string): string;
186
188
  /**
187
189
  * Applies the same scrubbing to a live element, in place.
188
190
  *
@@ -191,14 +193,13 @@ declare function normalizeHtml(html: string): string;
191
193
  * once it is in the document. Attributes are removed node by node rather than by
192
194
  * rewriting `innerHTML`, which would drop the caret.
193
195
  */
194
- declare function scrubInPlace(root: ParentNode): void;
196
+ export declare function scrubInPlace(root: ParentNode): void;
195
197
  /** Normalises a browser-produced empty document (`<br>`, empty block) to `''`. */
196
- declare function isEmptyHtml(html: string): boolean;
198
+ export declare function isEmptyHtml(html: string): boolean;
197
199
  /** Plain-text projection of the value — what the character counter measures. */
198
- declare function htmlToText(html: string): string;
199
-
200
+ export declare function htmlToText(html: string): string;
200
201
  /** Where the toolbar sits relative to the editing area. */
201
- type EditorToolbarPosition = 'top' | 'bottom';
202
+ export type EditorToolbarPosition = 'top' | 'bottom';
202
203
  /**
203
204
  * ui-editor — headless rich-text field, built on the `ui-field` shell (label +
204
205
  * box + helper) in **multiline** mode + a `contenteditable` area and its toolbar.
@@ -210,276 +211,309 @@ type EditorToolbarPosition = 'top' | 'bottom';
210
211
  *
211
212
  * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).
212
213
  */
213
- declare class UiEditor extends BaseFormField<string> {
214
- /**
215
- * Tools shown in the toolbar, in order (`separator` draws a divider).
216
- *
217
- * An empty or absent list falls back to the default set: a template binding an
218
- * optional variable (`[tools]="tools"`) hands us `undefined`, which would
219
- * otherwise leave the editor without any formatting at all.
220
- */
221
- tools: _angular_core.InputSignalWithTransform<readonly EditorTool[], readonly EditorTool[] | null | undefined>;
222
- /** Hint shown while the editor is empty (no native placeholder on contenteditable). */
223
- placeholder: _angular_core.InputSignal<string | undefined>;
224
- /** Minimum height of the editing area, in lines of text. */
225
- minRows: _angular_core.InputSignal<number>;
226
- /** Maximum number of **text** characters (markup is not counted). */
227
- maxlength: _angular_core.InputSignal<number | undefined>;
228
- /** Shows a character counter under the field (`count` or `count / maxlength`). */
229
- showCount: _angular_core.InputSignalWithTransform<boolean, unknown>;
230
- /** Toolbar placement relative to the editing area. */
231
- toolbarPosition: _angular_core.InputSignal<EditorToolbarPosition>;
232
- /** Emitted on each edit with the new HTML value. */
233
- valueChange: _angular_core.OutputEmitterRef<string>;
234
- /** Emitted when the editing area receives focus. */
235
- editorFocus: _angular_core.OutputEmitterRef<FocusEvent>;
236
- /** Emitted when the editing area loses focus. */
237
- editorBlur: _angular_core.OutputEmitterRef<FocusEvent>;
238
- /** Emitted when the formatting under the caret changes. */
239
- selectionChange: _angular_core.OutputEmitterRef<EditorState>;
240
- /** @ignore */
241
- private readonly sanitizer;
242
- /** @ignore */
243
- private readonly contentEl;
244
- /** @ignore The rendered toolbar — holds the roving tabindex ring, in DOM order. */
245
- private readonly toolbarEl;
246
- /** @ignore Text color popup (see {@link onColorToolClick}). */
247
- private readonly textColorPicker;
248
- /** @ignore Highlight color popup (see {@link onColorToolClick}). */
249
- private readonly highlightColorPicker;
250
- /**
251
- * @ignore Last HTML this component wrote out.
252
- *
253
- * The editing area owns its own DOM while the user types, so the value cannot be
254
- * bound with `[innerHTML]`: re-rendering it on every keystroke would collapse the
255
- * caret. Instead the DOM is only rewritten when the incoming value differs from
256
- * what we last emitted — i.e. when a form writes to us.
257
- */
258
- private lastEmitted;
259
- /** @ignore Formatting active at the caret. */
260
- protected readonly state: _angular_core.WritableSignal<EditorState>;
261
- /** @ignore Type family at the caret (`null` = the default family). */
262
- protected readonly currentFont: _angular_core.WritableSignal<EditorFont | null>;
263
- /** @ignore Text size at the caret (`null` = the default size). */
264
- protected readonly currentSize: _angular_core.WritableSignal<EditorSize | null>;
265
- /** @ignore Text color at the caret (`null` = the default color). */
266
- protected readonly currentTextColor: _angular_core.WritableSignal<string | null>;
267
- /** @ignore Highlight color at the caret (`null` = no highlight). */
268
- protected readonly currentHighlightColor: _angular_core.WritableSignal<string | null>;
269
- /** @ignore Index of the toolbar button reachable with Tab (roving tabindex). */
270
- protected readonly activeTool: _angular_core.WritableSignal<number>;
271
- /** @ignore Open state of the `textColor` popup (drives its trigger's `aria-expanded`). */
272
- protected readonly textColorPickerOpen: _angular_core.WritableSignal<boolean>;
273
- /** @ignore Open state of the `highlightColor` popup (drives its trigger's `aria-expanded`). */
274
- protected readonly highlightColorPickerOpen: _angular_core.WritableSignal<boolean>;
275
- /**
276
- * @ignore Last selection seen inside the editing area.
277
- *
278
- * The buttons cancel their own mousedown and never take the focus, but opening
279
- * the font dropdown does — and a `contenteditable` loses its selection with it.
280
- * The range is therefore kept here and restored before the command runs.
281
- */
282
- private savedRange;
283
- /** @ignore Sanitised value — never inject `modelValue` into the DOM raw. */
284
- private readonly safeValue;
285
- /** @ignore Plain-text length, what `maxlength` and the counter measure. */
286
- protected readonly charCount: _angular_core.Signal<number>;
287
- /** @ignore Keeps a floating label raised once focus leaves. */
288
- protected readonly isFilled: _angular_core.Signal<boolean>;
289
- /** @ignore Over the maxlength (only reachable programmatically). */
290
- protected readonly overLimit: _angular_core.Signal<boolean>;
291
- /** @ignore The placeholder only shows while there is nothing to read. */
292
- protected readonly showPlaceholder: _angular_core.Signal<boolean>;
293
- /** @ignore The area is editable (a read-only editor keeps its caret but not its edits). */
294
- protected readonly isEditable: _angular_core.Signal<boolean>;
295
- /** @ignore Resolved toolbar entries (icon + accessible name + toggle state). */
296
- protected readonly toolbar: _angular_core.Signal<{
297
- tool: EditorTool;
298
- index: number;
299
- isSeparator: boolean;
300
- select: EditorSelectTool | null;
301
- buttonTool: EditorButtonTool | null;
302
- meta: {
303
- icon: string;
304
- label: string;
305
- } | null;
306
- }[]>;
307
- /** @ignore Text sizes offered by the `fontSize` dropdown. */
308
- protected readonly sizes: readonly {
309
- key: EditorSize;
310
- className: string;
311
- label: string;
312
- }[];
313
- /**
314
- * @ignore Type families, labelled with the face each token actually resolves to.
315
- *
316
- * Read once the view exists, since the value comes from the computed style: a
317
- * hardcoded "Inter" would lie as soon as a project rebinds the token.
318
- */
319
- protected readonly fonts: _angular_core.WritableSignal<{
320
- key: EditorFont;
321
- className: string;
322
- cssVar: string;
323
- label: string;
324
- }[]>;
325
- /** @ignore `fontFamily` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */
326
- protected readonly fontFamilyOptions: _angular_core.Signal<{
327
- value: EditorFont;
328
- label: string;
329
- }[]>;
330
- /** @ignore `fontSize` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */
331
- protected readonly fontSizeOptions: _angular_core.Signal<{
332
- value: EditorSize;
333
- label: string;
334
- }[]>;
335
- /** @ignore Swatch entry backing the `textColor` button's color indicator. */
336
- protected readonly currentTextColorSwatch: _angular_core.Signal<{
337
- key: string;
338
- className: string;
339
- cssVar: string;
340
- label: string;
341
- } | undefined>;
342
- /** @ignore Swatch entry backing the `highlightColor` button's color indicator. */
343
- protected readonly currentHighlightColorSwatch: _angular_core.Signal<{
344
- key: string;
345
- className: string;
346
- cssVar: string;
347
- label: string;
348
- } | undefined>;
349
- /** @ignore The toolbar has at least one actionable entry. */
350
- protected readonly hasToolbar: _angular_core.Signal<boolean>;
351
- /**
352
- * @ignore Index carrying the toolbar's single tab stop.
353
- *
354
- * Falls back to the first actionable tool, so a `tools` list opening on a
355
- * separator still leaves the toolbar reachable with Tab.
356
- */
357
- protected readonly tabStop: _angular_core.Signal<number>;
358
- /** @ignore id of the character counter (for `aria-describedby`). */
359
- protected readonly countId: _angular_core.Signal<string>;
360
- /** @ignore `aria-describedby` combines the message and the counter, whichever are shown. */
361
- protected readonly describedByIds: _angular_core.Signal<string | null>;
362
- constructor();
363
- /** @ignore Auto-generated ids read as `ui-editor-*`. */
364
- protected uidPrefix(): string;
365
- /** Focuses the editing area. */
366
- focus(options?: FocusOptions): void;
367
- /** @ignore Input: single source of the value (view → form). */
368
- protected onInput(): void;
369
- /**
370
- * @ignore Enforces `maxlength` on the text, not the markup.
371
- *
372
- * Deletions and formatting must stay available once the limit is reached, so only
373
- * the insertion intents are cancelled.
374
- */
375
- protected onBeforeInput(event: InputEvent): void;
376
- /** @ignore Paste is reduced to the editor's own tag whitelist. */
377
- protected onPaste(event: ClipboardEvent): void;
378
- /** @ignore The browser applies Ctrl/Cmd+B/I/U itself; we only mirror the state. */
379
- protected onContentKeydown(event: KeyboardEvent): void;
380
- /** @ignore */
381
- protected onBlur(event: FocusEvent): void;
382
- /** @ignore Recomputes the active formatting and notifies the consumer. */
383
- protected refreshState(): void;
384
- /** @ignore Keeps the caret position around for controls that steal the focus. */
385
- private rememberSelection;
386
- /** @ignore Puts the remembered caret back before running a command. */
387
- private restoreSelection;
388
- /** @ignore Runs a button tool against the selection the mousedown handler preserved. */
389
- protected runTool(tool: EditorButtonTool, index: number, event?: MouseEvent): void;
390
- /**
391
- * @ignore `removeFormat` (the native command behind `clearFormat`) only
392
- * strips inline formatting the browser itself applies — bold, italic,
393
- * underline… — never the `<span class="ui-editor-*">` wrappers `fontFamily`/
394
- * `fontSize`/`textColor`/`highlightColor` write, so those survived
395
- * "Effacer le formatage" untouched. Run the native command, then unwrap
396
- * those classes too, across whatever is currently selected.
397
- */
398
- private clearFormat;
399
- /**
400
- * @ignore Trigger click for `textColor`/`highlightColor`: opens the matching
401
- * `ui-swatch-picker` instead of applying a command directly — same
402
- * "picker takes the focus, the caret is restored before the real command
403
- * runs" pattern as {@link onSelectMenuTrigger}, but these two are button
404
- * tools (a one-shot action button, not a value dropdown), so they run
405
- * through `runTool` rather than `onSelectChange`.
406
- */
407
- private onColorToolClick;
408
- /**
409
- * @ignore Applies the text color chosen in the `textColor` picker.
410
- *
411
- * The popup took the focus, so the caret is put back first. `foreColor`
412
- * emits a legacy `<font>` element, immediately rewritten into a class.
413
- */
414
- protected onTextColorSelect(swatch: UiSwatch | null): void;
415
- /**
416
- * @ignore Applies the highlight color chosen in the `highlightColor` picker.
417
- *
418
- * The popup took the focus, so the caret is put back first. `hiliteColor`
419
- * emits a `<span style="background-color:…">`, immediately rewritten into a
420
- * class (see {@link convertHighlightMarkers}).
421
- */
422
- protected onHighlightColorSelect(swatch: UiSwatch | null): void;
423
- /** @ignore Options for a `ui-select` dropdown ({@link UiSelect} `optionLabel`/`optionValue`). */
424
- protected selectOptions(tool: EditorSelectTool): {
425
- value: string;
426
- label: string;
427
- }[];
428
- /**
429
- * @ignore Current value of a `ui-select` dropdown, so it reflects the caret.
430
- *
431
- * Falls back to the value actually in force when no class was applied: text
432
- * carrying no class really is rendered with `--fontfamily-base` at the
433
- * default size, so naming it states a fact rather than a placeholder.
434
- */
435
- protected selectValue(tool: EditorSelectTool): string;
436
- /** @ignore Accessible name of a dropdown — spelled out, it is never truncated. */
437
- protected selectLabel(tool: EditorSelectTool): string;
438
- /**
439
- * @ignore Applies the value chosen in a `ui-select` dropdown.
440
- *
441
- * `ui-select` opens its own overlay and takes the focus, so the caret is put
442
- * back first — same reasoning as the color pickers. `fontName`/`fontSize`
443
- * each emit a legacy `<font>` element, immediately rewritten into a class.
444
- */
445
- protected onSelectValueChange(tool: EditorSelectTool, value: unknown, index: number): void;
446
- /**
447
- * @ignore v1 link flow: the native prompt.
448
- *
449
- * Deliberately minimal — a popover with a `ui-input` is the planned replacement,
450
- * and it changes the component's overlay footprint, not this call site.
451
- */
452
- private promptForLink;
453
- /** @ignore Keeps the caret in the editing area when a tool is clicked. */
454
- protected onToolbarMousedown(event: MouseEvent): void;
455
- /** @ignore Roving tabindex: the toolbar is one tab stop, arrows move within it. */
456
- protected onToolbarKeydown(event: KeyboardEvent): void;
457
- /**
458
- * @ignore Moves the DOM focus onto the control now holding the tab stop.
459
- *
460
- * Queried from the live toolbar rather than from the `ui-button` children:
461
- * DOM order is the visual order, and every tool (buttons and select-menu
462
- * triggers alike) renders as a `<button>`.
463
- */
464
- private focusTool;
465
- /**
466
- * @ignore `var(--primitives-…)` for the `textColor`/`highlightColor`
467
- * buttons' color indicator, or `null` for every other tool (no swatch
468
- * active, or a tool the indicator does not apply to).
469
- */
470
- protected colorIndicatorVar(tool: EditorButtonTool | null): string | null;
471
- /**
472
- * @ignore Native attributes forwarded to a tool button.
473
- *
474
- * `aria-pressed` only on the toggles: `link` and `clearFormat` are one-shot
475
- * actions, and a permanently unpressed toggle would misreport them.
476
- * `textColor`/`highlightColor` forward `aria-haspopup`/`aria-expanded`
477
- * instead — they open a `ui-swatch-picker` popup, not a toggle.
478
- */
479
- protected toolProps(tool: EditorTool): Record<string, string> | undefined;
480
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiEditor, never>;
481
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiEditor, "ui-editor", never, { "tools": { "alias": "tools"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "minRows": { "alias": "minRows"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "showCount": { "alias": "showCount"; "required": false; "isSignal": true; }; "toolbarPosition": { "alias": "toolbarPosition"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "editorFocus": "editorFocus"; "editorBlur": "editorBlur"; "selectionChange": "selectionChange"; }, never, never, true, never>;
482
- }
483
-
484
- 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 };
485
- export type { EditorButtonTool, EditorFont, EditorSelectTool, EditorSize, EditorState, EditorToggleTool, EditorTool, EditorToolbarPosition };
214
+ export declare class UiEditor extends BaseFormField<string> {
215
+ /**
216
+ * Tools shown in the toolbar, in order (`separator` draws a divider).
217
+ *
218
+ * An empty or absent list falls back to the default set: a template binding an
219
+ * optional variable (`[tools]="tools"`) hands us `undefined`, which would
220
+ * otherwise leave the editor without any formatting at all.
221
+ */
222
+ tools: import("@angular/core").InputSignalWithTransform<readonly EditorTool[], readonly EditorTool[] | null | undefined>;
223
+ /** Hint shown while the editor is empty (no native placeholder on contenteditable). */
224
+ placeholder: import("@angular/core").InputSignal<string | undefined>;
225
+ /** Minimum height of the editing area, in lines of text. */
226
+ minRows: import("@angular/core").InputSignal<number>;
227
+ /** Maximum number of **text** characters (markup is not counted). */
228
+ maxlength: import("@angular/core").InputSignal<number | undefined>;
229
+ /** Shows a character counter under the field (`count` or `count / maxlength`). */
230
+ showCount: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
231
+ /** Toolbar placement relative to the editing area. */
232
+ toolbarPosition: import("@angular/core").InputSignal<EditorToolbarPosition>;
233
+ /** Emitted on each edit with the new HTML value. */
234
+ valueChange: import("@angular/core").OutputEmitterRef<string>;
235
+ /** Emitted when the editing area receives focus. */
236
+ editorFocus: import("@angular/core").OutputEmitterRef<FocusEvent>;
237
+ /** Emitted when the editing area loses focus. */
238
+ editorBlur: import("@angular/core").OutputEmitterRef<FocusEvent>;
239
+ /** Emitted when the formatting under the caret changes. */
240
+ selectionChange: import("@angular/core").OutputEmitterRef<EditorState>;
241
+ /** @ignore */
242
+ private readonly sanitizer;
243
+ /** @ignore */
244
+ private readonly contentEl;
245
+ /** @ignore The rendered toolbar — holds the roving tabindex ring, in DOM order. */
246
+ private readonly toolbarEl;
247
+ /** @ignore Text color popup (see {@link onColorToolClick}). */
248
+ private readonly textColorPicker;
249
+ /** @ignore Highlight color popup (see {@link onColorToolClick}). */
250
+ private readonly highlightColorPicker;
251
+ /**
252
+ * @ignore Last HTML this component wrote out.
253
+ *
254
+ * The editing area owns its own DOM while the user types, so the value cannot be
255
+ * bound with `[innerHTML]`: re-rendering it on every keystroke would collapse the
256
+ * caret. Instead the DOM is only rewritten when the incoming value differs from
257
+ * what we last emitted — i.e. when a form writes to us.
258
+ */
259
+ private lastEmitted;
260
+ /** @ignore Formatting active at the caret. */
261
+ protected readonly state: import("@angular/core").WritableSignal<EditorState>;
262
+ /** @ignore Type family at the caret (`null` = the default family). */
263
+ protected readonly currentFont: import("@angular/core").WritableSignal<EditorFont | null>;
264
+ /** @ignore Text size at the caret (`null` = the default size). */
265
+ protected readonly currentSize: import("@angular/core").WritableSignal<EditorSize | null>;
266
+ /** @ignore Text color at the caret (`null` = the default color). */
267
+ protected readonly currentTextColor: import("@angular/core").WritableSignal<string | null>;
268
+ /** @ignore Highlight color at the caret (`null` = no highlight). */
269
+ protected readonly currentHighlightColor: import("@angular/core").WritableSignal<string | null>;
270
+ /** @ignore Index of the toolbar button reachable with Tab (roving tabindex). */
271
+ protected readonly activeTool: import("@angular/core").WritableSignal<number>;
272
+ /** @ignore Open state of the `textColor` popup (drives its trigger's `aria-expanded`). */
273
+ protected readonly textColorPickerOpen: import("@angular/core").WritableSignal<boolean>;
274
+ /** @ignore Open state of the `highlightColor` popup (drives its trigger's `aria-expanded`). */
275
+ protected readonly highlightColorPickerOpen: import("@angular/core").WritableSignal<boolean>;
276
+ /**
277
+ * @ignore Last selection seen inside the editing area.
278
+ *
279
+ * The buttons cancel their own mousedown and never take the focus, but opening
280
+ * the font dropdown does — and a `contenteditable` loses its selection with it.
281
+ * The range is therefore kept here and restored before the command runs.
282
+ */
283
+ private savedRange;
284
+ /** @ignore Sanitised value — never inject `modelValue` into the DOM raw. */
285
+ private readonly safeValue;
286
+ /** @ignore Plain-text length, what `maxlength` and the counter measure. */
287
+ protected readonly charCount: import("@angular/core").Signal<number>;
288
+ /** @ignore Keeps a floating label raised once focus leaves. */
289
+ protected readonly isFilled: import("@angular/core").Signal<boolean>;
290
+ /** @ignore Over the maxlength (only reachable programmatically). */
291
+ protected readonly overLimit: import("@angular/core").Signal<boolean>;
292
+ /** @ignore The placeholder only shows while there is nothing to read. */
293
+ protected readonly showPlaceholder: import("@angular/core").Signal<boolean>;
294
+ /** @ignore The area is editable (a read-only editor keeps its caret but not its edits). */
295
+ protected readonly isEditable: import("@angular/core").Signal<boolean>;
296
+ /** @ignore Resolved toolbar entries (icon + accessible name + toggle state). */
297
+ protected readonly toolbar: import("@angular/core").Signal<{
298
+ tool: EditorTool;
299
+ index: number;
300
+ isSeparator: boolean;
301
+ select: EditorSelectTool | null;
302
+ buttonTool: EditorButtonTool | null;
303
+ meta: {
304
+ icon: string;
305
+ label: string;
306
+ } | null;
307
+ }[]>;
308
+ /** @ignore Text sizes offered by the `fontSize` dropdown. */
309
+ protected readonly sizes: readonly {
310
+ key: EditorSize;
311
+ className: string;
312
+ label: string;
313
+ }[];
314
+ /**
315
+ * @ignore Type families, labelled with the face each token actually resolves to.
316
+ *
317
+ * Read once the view exists, since the value comes from the computed style: a
318
+ * hardcoded "Inter" would lie as soon as a project rebinds the token.
319
+ */
320
+ protected readonly fonts: import("@angular/core").WritableSignal<{
321
+ key: EditorFont;
322
+ className: string;
323
+ cssVar: string;
324
+ label: string;
325
+ }[]>;
326
+ /** @ignore `fontFamily` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */
327
+ protected readonly fontFamilyOptions: import("@angular/core").Signal<{
328
+ value: EditorFont;
329
+ label: string;
330
+ }[]>;
331
+ /** @ignore `fontSize` dropdown options ({@link UiSelect} `optionLabel`/`optionValue`). */
332
+ protected readonly fontSizeOptions: import("@angular/core").Signal<{
333
+ value: EditorSize;
334
+ label: string;
335
+ }[]>;
336
+ /** @ignore Swatch entry backing the `textColor` button's color indicator. */
337
+ protected readonly currentTextColorSwatch: import("@angular/core").Signal<{
338
+ key: string;
339
+ className: string;
340
+ cssVar: string;
341
+ label: string;
342
+ } | undefined>;
343
+ /** @ignore Swatch entry backing the `highlightColor` button's color indicator. */
344
+ protected readonly currentHighlightColorSwatch: import("@angular/core").Signal<{
345
+ key: string;
346
+ className: string;
347
+ cssVar: string;
348
+ label: string;
349
+ } | undefined>;
350
+ /** @ignore The toolbar has at least one actionable entry. */
351
+ protected readonly hasToolbar: import("@angular/core").Signal<boolean>;
352
+ /**
353
+ * @ignore Index carrying the toolbar's single tab stop.
354
+ *
355
+ * Falls back to the first actionable tool, so a `tools` list opening on a
356
+ * separator still leaves the toolbar reachable with Tab.
357
+ */
358
+ protected readonly tabStop: import("@angular/core").Signal<number>;
359
+ /** @ignore id of the character counter (for `aria-describedby`). */
360
+ protected readonly countId: import("@angular/core").Signal<string>;
361
+ /** @ignore `aria-describedby` combines the message and the counter, whichever are shown. */
362
+ protected readonly describedByIds: import("@angular/core").Signal<string | null>;
363
+ constructor();
364
+ /** @ignore Auto-generated ids read as `ui-editor-*`. */
365
+ protected uidPrefix(): string;
366
+ /** Focuses the editing area. */
367
+ focus(options?: FocusOptions): void;
368
+ /** @ignore Input: single source of the value (view → form). */
369
+ protected onInput(): void;
370
+ /**
371
+ * @ignore Enforces `maxlength` on the text, not the markup.
372
+ *
373
+ * Deletions and formatting must stay available once the limit is reached, so only
374
+ * the insertion intents are cancelled.
375
+ */
376
+ protected onBeforeInput(event: InputEvent): void;
377
+ /** @ignore Paste is reduced to the editor's own tag whitelist. */
378
+ protected onPaste(event: ClipboardEvent): void;
379
+ /** @ignore The browser applies Ctrl/Cmd+B/I/U itself; we only mirror the state. */
380
+ protected onContentKeydown(event: KeyboardEvent): void;
381
+ /** @ignore */
382
+ protected onBlur(event: FocusEvent): void;
383
+ /** @ignore Recomputes the active formatting and notifies the consumer. */
384
+ protected refreshState(): void;
385
+ /** @ignore Keeps the caret position around for controls that steal the focus. */
386
+ private rememberSelection;
387
+ /** @ignore Puts the remembered caret back before running a command. */
388
+ private restoreSelection;
389
+ /** @ignore Runs a button tool against the selection the mousedown handler preserved. */
390
+ protected runTool(tool: EditorButtonTool, index: number, event?: MouseEvent): void;
391
+ /**
392
+ * @ignore `removeFormat` (the native command behind `clearFormat`) only
393
+ * strips inline formatting the browser itself applies — bold, italic,
394
+ * underline… — never the `<span class="ui-editor-*">` wrappers `fontFamily`/
395
+ * `fontSize`/`textColor`/`highlightColor` write, so those survived
396
+ * "Effacer le formatage" untouched. Run the native command, then unwrap
397
+ * those classes too, across whatever is currently selected.
398
+ */
399
+ private clearFormat;
400
+ /**
401
+ * @ignore Trigger click for `textColor`/`highlightColor`: opens the matching
402
+ * `ui-swatch-picker` instead of applying a command directly — same
403
+ * "picker takes the focus, the caret is restored before the real command
404
+ * runs" pattern as {@link onSelectMenuTrigger}, but these two are button
405
+ * tools (a one-shot action button, not a value dropdown), so they run
406
+ * through `runTool` rather than `onSelectChange`.
407
+ */
408
+ private onColorToolClick;
409
+ /**
410
+ * @ignore Applies the text color chosen in the `textColor` picker.
411
+ *
412
+ * The popup took the focus, so the caret is put back first. `foreColor`
413
+ * emits a legacy `<font>` element, immediately rewritten into a class.
414
+ */
415
+ protected onTextColorSelect(swatch: UiSwatch | null): void;
416
+ /**
417
+ * @ignore Applies the highlight color chosen in the `highlightColor` picker.
418
+ *
419
+ * The popup took the focus, so the caret is put back first. `hiliteColor`
420
+ * emits a `<span style="background-color:…">`, immediately rewritten into a
421
+ * class (see {@link convertHighlightMarkers}).
422
+ */
423
+ protected onHighlightColorSelect(swatch: UiSwatch | null): void;
424
+ /** @ignore Options for a `ui-select` dropdown ({@link UiSelect} `optionLabel`/`optionValue`). */
425
+ protected selectOptions(tool: EditorSelectTool): {
426
+ value: string;
427
+ label: string;
428
+ }[];
429
+ /**
430
+ * @ignore Current value of a `ui-select` dropdown, so it reflects the caret.
431
+ *
432
+ * Falls back to the value actually in force when no class was applied: text
433
+ * carrying no class really is rendered with `--fontfamily-base` at the
434
+ * default size, so naming it states a fact rather than a placeholder.
435
+ */
436
+ protected selectValue(tool: EditorSelectTool): string;
437
+ /** @ignore Accessible name of a dropdown — spelled out, it is never truncated. */
438
+ protected selectLabel(tool: EditorSelectTool): string;
439
+ /**
440
+ * @ignore Applies the value chosen in a `ui-select` dropdown.
441
+ *
442
+ * `ui-select` opens its own overlay and takes the focus, so the caret is put
443
+ * back first — same reasoning as the color pickers. `fontName`/`fontSize`
444
+ * each emit a legacy `<font>` element, immediately rewritten into a class.
445
+ */
446
+ protected onSelectValueChange(tool: EditorSelectTool, value: unknown, index: number): void;
447
+ /**
448
+ * @ignore v1 link flow: the native prompt.
449
+ *
450
+ * Deliberately minimal — a popover with a `ui-input` is the planned replacement,
451
+ * and it changes the component's overlay footprint, not this call site.
452
+ */
453
+ private promptForLink;
454
+ /** @ignore Keeps the caret in the editing area when a tool is clicked. */
455
+ protected onToolbarMousedown(event: MouseEvent): void;
456
+ /** @ignore Roving tabindex: the toolbar is one tab stop, arrows move within it. */
457
+ protected onToolbarKeydown(event: KeyboardEvent): void;
458
+ /**
459
+ * @ignore Moves the DOM focus onto the control now holding the tab stop.
460
+ *
461
+ * Queried from the live toolbar rather than from the `ui-button` children:
462
+ * DOM order is the visual order, and every tool (buttons and select-menu
463
+ * triggers alike) renders as a `<button>`.
464
+ */
465
+ private focusTool;
466
+ /**
467
+ * @ignore `var(--primitives-…)` for the `textColor`/`highlightColor`
468
+ * buttons' color indicator, or `null` for every other tool (no swatch
469
+ * active, or a tool the indicator does not apply to).
470
+ */
471
+ protected colorIndicatorVar(tool: EditorButtonTool | null): string | null;
472
+ /**
473
+ * @ignore Native attributes forwarded to a tool button.
474
+ *
475
+ * `aria-pressed` only on the toggles: `link` and `clearFormat` are one-shot
476
+ * actions, and a permanently unpressed toggle would misreport them.
477
+ * `textColor`/`highlightColor` forward `aria-haspopup`/`aria-expanded`
478
+ * instead — they open a `ui-swatch-picker` popup, not a toggle.
479
+ */
480
+ protected toolProps(tool: EditorTool): Record<string, string> | undefined;
481
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiEditor, never>;
482
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiEditor, "ui-editor", never, {
483
+ "tools": {
484
+ "alias": "tools";
485
+ "required": false;
486
+ "isSignal": true;
487
+ };
488
+ "placeholder": {
489
+ "alias": "placeholder";
490
+ "required": false;
491
+ "isSignal": true;
492
+ };
493
+ "minRows": {
494
+ "alias": "minRows";
495
+ "required": false;
496
+ "isSignal": true;
497
+ };
498
+ "maxlength": {
499
+ "alias": "maxlength";
500
+ "required": false;
501
+ "isSignal": true;
502
+ };
503
+ "showCount": {
504
+ "alias": "showCount";
505
+ "required": false;
506
+ "isSignal": true;
507
+ };
508
+ "toolbarPosition": {
509
+ "alias": "toolbarPosition";
510
+ "required": false;
511
+ "isSignal": true;
512
+ };
513
+ }, {
514
+ "valueChange": "valueChange";
515
+ "editorFocus": "editorFocus";
516
+ "editorBlur": "editorBlur";
517
+ "selectionChange": "selectionChange";
518
+ }, never, never, true, never>;
519
+ }