@caribeng/ui 22.1.1 → 22.2.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 (253) hide show
  1. package/README.md +48 -8
  2. package/fesm2022/caribeng-ui-accordion.mjs +2 -2
  3. package/fesm2022/caribeng-ui-anchor.mjs +169 -0
  4. package/fesm2022/caribeng-ui-autocomplete.mjs +10 -8
  5. package/fesm2022/caribeng-ui-avatargroup.mjs +9 -3
  6. package/fesm2022/caribeng-ui-blockui.mjs +12 -4
  7. package/fesm2022/caribeng-ui-breadcrumb.mjs +5 -2
  8. package/fesm2022/caribeng-ui-button.mjs +22 -2
  9. package/fesm2022/caribeng-ui-caribe-alert.mjs +5 -2
  10. package/fesm2022/caribeng-ui-caribe-animation-lottie.mjs +6 -3
  11. package/fesm2022/caribeng-ui-caribe-button-group.mjs +6 -3
  12. package/fesm2022/caribeng-ui-caribe-calendar.mjs +11 -6
  13. package/fesm2022/caribeng-ui-caribe-card-content.mjs +6 -3
  14. package/fesm2022/caribeng-ui-caribe-card-move.mjs +29 -7
  15. package/fesm2022/caribeng-ui-caribe-card-select.mjs +56 -14
  16. package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +10 -7
  17. package/fesm2022/caribeng-ui-caribe-coachmark.mjs +42 -19
  18. package/fesm2022/caribeng-ui-caribe-data-table.mjs +15 -9
  19. package/fesm2022/caribeng-ui-caribe-dots-indicator.mjs +38 -5
  20. package/fesm2022/caribeng-ui-caribe-expansion-panel.mjs +16 -5
  21. package/fesm2022/caribeng-ui-caribe-fab-menu.mjs +56 -7
  22. package/fesm2022/caribeng-ui-caribe-file-download.mjs +68 -27
  23. package/fesm2022/caribeng-ui-caribe-file-select.mjs +22 -17
  24. package/fesm2022/caribeng-ui-caribe-float-menu.mjs +6 -3
  25. package/fesm2022/caribeng-ui-caribe-footer.mjs +8 -4
  26. package/fesm2022/caribeng-ui-caribe-header.mjs +6 -3
  27. package/fesm2022/caribeng-ui-caribe-icon-button.mjs +6 -3
  28. package/fesm2022/caribeng-ui-caribe-illustration.mjs +6 -3
  29. package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +5 -2
  30. package/fesm2022/caribeng-ui-caribe-input-search.mjs +14 -10
  31. package/fesm2022/caribeng-ui-caribe-input-select.mjs +12 -10
  32. package/fesm2022/caribeng-ui-caribe-input-token.mjs +61 -11
  33. package/fesm2022/caribeng-ui-caribe-link.mjs +7 -2
  34. package/fesm2022/caribeng-ui-caribe-loader.mjs +8 -5
  35. package/fesm2022/caribeng-ui-caribe-modal.mjs +32 -16
  36. package/fesm2022/caribeng-ui-caribe-off-canvas.mjs +26 -12
  37. package/fesm2022/caribeng-ui-caribe-onboarding.mjs +44 -19
  38. package/fesm2022/caribeng-ui-caribe-pictogram.mjs +6 -3
  39. package/fesm2022/caribeng-ui-caribe-pop-over.mjs +34 -10
  40. package/fesm2022/caribeng-ui-caribe-preloader.mjs +9 -6
  41. package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +5 -2
  42. package/fesm2022/caribeng-ui-caribe-shortcut.mjs +8 -3
  43. package/fesm2022/caribeng-ui-caribe-step-indicator.mjs +12 -5
  44. package/fesm2022/caribeng-ui-caribe-stroke.mjs +6 -3
  45. package/fesm2022/caribeng-ui-caribe-switch.mjs +5 -3
  46. package/fesm2022/caribeng-ui-caribe-tag-button.mjs +1 -1
  47. package/fesm2022/caribeng-ui-caribe-tracker.mjs +5 -2
  48. package/fesm2022/caribeng-ui-caribe-transaction-status.mjs +1 -1
  49. package/fesm2022/caribeng-ui-caribe-voucher.mjs +11 -8
  50. package/fesm2022/caribeng-ui-carousel.mjs +49 -14
  51. package/fesm2022/caribeng-ui-cascadeselect.mjs +22 -8
  52. package/fesm2022/caribeng-ui-chart.mjs +2598 -303
  53. package/fesm2022/caribeng-ui-chip.mjs +9 -4
  54. package/fesm2022/caribeng-ui-chips.mjs +9 -5
  55. package/fesm2022/caribeng-ui-colorpicker.mjs +9 -7
  56. package/fesm2022/caribeng-ui-confirmdialog.mjs +74 -9
  57. package/fesm2022/caribeng-ui-confirmpopup.mjs +134 -9
  58. package/fesm2022/caribeng-ui-contextmenu.mjs +6 -3
  59. package/fesm2022/caribeng-ui-dataview.mjs +211 -6
  60. package/fesm2022/caribeng-ui-datepicker.mjs +1630 -393
  61. package/fesm2022/caribeng-ui-descriptions.mjs +124 -0
  62. package/fesm2022/caribeng-ui-dialog.mjs +10 -7
  63. package/fesm2022/caribeng-ui-dock.mjs +6 -3
  64. package/fesm2022/caribeng-ui-drawer.mjs +10 -7
  65. package/fesm2022/caribeng-ui-dynamicdialog.mjs +210 -6
  66. package/fesm2022/caribeng-ui-editor.mjs +4392 -243
  67. package/fesm2022/caribeng-ui-empty.mjs +80 -0
  68. package/fesm2022/caribeng-ui-file-card.mjs +2 -2
  69. package/fesm2022/caribeng-ui-fileupload.mjs +96 -19
  70. package/fesm2022/caribeng-ui-floatlabel.mjs +4 -2
  71. package/fesm2022/caribeng-ui-folder-card.mjs +10 -3
  72. package/fesm2022/caribeng-ui-galleria.mjs +76 -45
  73. package/fesm2022/caribeng-ui-image.mjs +52 -29
  74. package/fesm2022/caribeng-ui-inplace.mjs +22 -6
  75. package/fesm2022/caribeng-ui-input-number.mjs +9 -7
  76. package/fesm2022/caribeng-ui-inputgroup.mjs +2 -2
  77. package/fesm2022/caribeng-ui-inputmask.mjs +14 -11
  78. package/fesm2022/caribeng-ui-inputotp.mjs +12 -6
  79. package/fesm2022/caribeng-ui-keyfilter.mjs +72 -0
  80. package/fesm2022/caribeng-ui-listbox.mjs +13 -11
  81. package/fesm2022/caribeng-ui-megamenu.mjs +222 -30
  82. package/fesm2022/caribeng-ui-menu.mjs +11 -5
  83. package/fesm2022/caribeng-ui-menubar.mjs +10 -5
  84. package/fesm2022/caribeng-ui-message.mjs +7 -4
  85. package/fesm2022/caribeng-ui-metergroup.mjs +29 -11
  86. package/fesm2022/caribeng-ui-multiselect.mjs +399 -97
  87. package/fesm2022/caribeng-ui-orderlist.mjs +230 -11
  88. package/fesm2022/caribeng-ui-organizationchart.mjs +12 -7
  89. package/fesm2022/caribeng-ui-paginator.mjs +18 -15
  90. package/fesm2022/caribeng-ui-panel.mjs +5 -2
  91. package/fesm2022/caribeng-ui-panelmenu.mjs +6 -3
  92. package/fesm2022/caribeng-ui-password.mjs +8 -6
  93. package/fesm2022/caribeng-ui-pdfviewer.mjs +1553 -0
  94. package/fesm2022/caribeng-ui-picklist.mjs +251 -14
  95. package/fesm2022/caribeng-ui-pricing.mjs +17 -14
  96. package/fesm2022/caribeng-ui-rating.mjs +7 -3
  97. package/fesm2022/caribeng-ui-repeater.mjs +223 -0
  98. package/fesm2022/caribeng-ui-result.mjs +91 -0
  99. package/fesm2022/caribeng-ui-scrollpanel.mjs +6 -3
  100. package/fesm2022/caribeng-ui-scrolltop.mjs +6 -3
  101. package/fesm2022/caribeng-ui-select.mjs +379 -87
  102. package/fesm2022/caribeng-ui-selectbutton.mjs +2 -2
  103. package/fesm2022/caribeng-ui-slider.mjs +171 -75
  104. package/fesm2022/caribeng-ui-speeddial.mjs +7 -4
  105. package/fesm2022/caribeng-ui-spinner.mjs +5 -2
  106. package/fesm2022/caribeng-ui-splitbutton.mjs +163 -0
  107. package/fesm2022/caribeng-ui-splitter.mjs +5 -2
  108. package/fesm2022/caribeng-ui-statistic.mjs +183 -0
  109. package/fesm2022/caribeng-ui-stepper.mjs +8 -5
  110. package/fesm2022/caribeng-ui-steps.mjs +6 -3
  111. package/fesm2022/caribeng-ui-table.mjs +708 -82
  112. package/fesm2022/caribeng-ui-tabmenu.mjs +6 -3
  113. package/fesm2022/caribeng-ui-tag.mjs +2 -2
  114. package/fesm2022/caribeng-ui-terminal.mjs +45 -9
  115. package/fesm2022/caribeng-ui-themetoggle.mjs +82 -0
  116. package/fesm2022/caribeng-ui-tieredmenu.mjs +9 -6
  117. package/fesm2022/caribeng-ui-timeline.mjs +175 -6
  118. package/fesm2022/caribeng-ui-toast.mjs +7 -4
  119. package/fesm2022/caribeng-ui-togglebutton.mjs +8 -6
  120. package/fesm2022/caribeng-ui-toolbar.mjs +6 -3
  121. package/fesm2022/caribeng-ui-tree.mjs +302 -6
  122. package/fesm2022/caribeng-ui-treeselect.mjs +26 -10
  123. package/fesm2022/caribeng-ui-treetable.mjs +269 -6
  124. package/fesm2022/caribeng-ui-virtualscroller.mjs +123 -10
  125. package/fesm2022/caribeng-ui.mjs +829 -6
  126. package/package.json +53 -3
  127. package/schematics/collection.json +10 -0
  128. package/schematics/ng-add/index.js +125 -0
  129. package/schematics/ng-add/schema.js +2 -0
  130. package/schematics/ng-add/schema.json +66 -0
  131. package/styles/caribeng.css +380 -0
  132. package/styles/scss/_mixins.scss +46 -0
  133. package/styles/scss/_overlay.scss +15 -0
  134. package/styles/scss/_tokens.scss +267 -0
  135. package/styles/scss/_utilities.scss +73 -0
  136. package/styles/scss/_variables.scss +33 -0
  137. package/styles/scss/index.scss +16 -0
  138. package/types/caribeng-ui-anchor.d.ts +50 -0
  139. package/types/caribeng-ui-autocomplete.d.ts +4 -2
  140. package/types/caribeng-ui-avatargroup.d.ts +3 -1
  141. package/types/caribeng-ui-blockui.d.ts +9 -4
  142. package/types/caribeng-ui-breadcrumb.d.ts +3 -0
  143. package/types/caribeng-ui-button.d.ts +9 -1
  144. package/types/caribeng-ui-caribe-alert.d.ts +3 -0
  145. package/types/caribeng-ui-caribe-animation-lottie.d.ts +4 -1
  146. package/types/caribeng-ui-caribe-button-group.d.ts +4 -1
  147. package/types/caribeng-ui-caribe-calendar.d.ts +5 -1
  148. package/types/caribeng-ui-caribe-card-content.d.ts +4 -1
  149. package/types/caribeng-ui-caribe-card-move.d.ts +13 -13
  150. package/types/caribeng-ui-caribe-card-select.d.ts +10 -1
  151. package/types/caribeng-ui-caribe-circle-loading.d.ts +4 -1
  152. package/types/caribeng-ui-caribe-coachmark.d.ts +6 -0
  153. package/types/caribeng-ui-caribe-data-table.d.ts +7 -2
  154. package/types/caribeng-ui-caribe-dots-indicator.d.ts +9 -0
  155. package/types/caribeng-ui-caribe-expansion-panel.d.ts +7 -10
  156. package/types/caribeng-ui-caribe-fab-menu.d.ts +10 -1
  157. package/types/caribeng-ui-caribe-file-download.d.ts +8 -10
  158. package/types/caribeng-ui-caribe-file-select.d.ts +7 -1
  159. package/types/caribeng-ui-caribe-float-menu.d.ts +4 -1
  160. package/types/caribeng-ui-caribe-header.d.ts +3 -0
  161. package/types/caribeng-ui-caribe-icon-button.d.ts +4 -1
  162. package/types/caribeng-ui-caribe-illustration.d.ts +4 -1
  163. package/types/caribeng-ui-caribe-inline-alert.d.ts +3 -0
  164. package/types/caribeng-ui-caribe-input-search.d.ts +4 -2
  165. package/types/caribeng-ui-caribe-input-select.d.ts +4 -2
  166. package/types/caribeng-ui-caribe-input-token.d.ts +16 -1
  167. package/types/caribeng-ui-caribe-link.d.ts +3 -0
  168. package/types/caribeng-ui-caribe-loader.d.ts +4 -1
  169. package/types/caribeng-ui-caribe-modal.d.ts +7 -10
  170. package/types/caribeng-ui-caribe-off-canvas.d.ts +6 -1
  171. package/types/caribeng-ui-caribe-onboarding.d.ts +6 -0
  172. package/types/caribeng-ui-caribe-pictogram.d.ts +4 -1
  173. package/types/caribeng-ui-caribe-pop-over.d.ts +7 -10
  174. package/types/caribeng-ui-caribe-preloader.d.ts +4 -1
  175. package/types/caribeng-ui-caribe-progress-bar.d.ts +3 -0
  176. package/types/caribeng-ui-caribe-shortcut.d.ts +3 -1
  177. package/types/caribeng-ui-caribe-step-indicator.d.ts +6 -0
  178. package/types/caribeng-ui-caribe-stroke.d.ts +4 -1
  179. package/types/caribeng-ui-caribe-switch.d.ts +3 -1
  180. package/types/caribeng-ui-caribe-tracker.d.ts +3 -0
  181. package/types/caribeng-ui-caribe-voucher.d.ts +5 -2
  182. package/types/caribeng-ui-carousel.d.ts +10 -1
  183. package/types/caribeng-ui-cascadeselect.d.ts +7 -2
  184. package/types/caribeng-ui-chart.d.ts +469 -44
  185. package/types/caribeng-ui-chip.d.ts +6 -0
  186. package/types/caribeng-ui-chips.d.ts +6 -2
  187. package/types/caribeng-ui-colorpicker.d.ts +3 -1
  188. package/types/caribeng-ui-confirmdialog.d.ts +25 -6
  189. package/types/caribeng-ui-confirmpopup.d.ts +37 -5
  190. package/types/caribeng-ui-contextmenu.d.ts +4 -1
  191. package/types/caribeng-ui-dataview.d.ts +63 -5
  192. package/types/caribeng-ui-datepicker.d.ts +186 -21
  193. package/types/caribeng-ui-descriptions.d.ts +63 -0
  194. package/types/caribeng-ui-dialog.d.ts +4 -1
  195. package/types/caribeng-ui-dock.d.ts +4 -1
  196. package/types/caribeng-ui-drawer.d.ts +4 -1
  197. package/types/caribeng-ui-dynamicdialog.d.ts +93 -3
  198. package/types/caribeng-ui-editor.d.ts +486 -13
  199. package/types/caribeng-ui-empty.d.ts +34 -0
  200. package/types/caribeng-ui-file-card.d.ts +1 -1
  201. package/types/caribeng-ui-fileupload.d.ts +27 -4
  202. package/types/caribeng-ui-folder-card.d.ts +4 -1
  203. package/types/caribeng-ui-galleria.d.ts +9 -0
  204. package/types/caribeng-ui-image.d.ts +10 -0
  205. package/types/caribeng-ui-inplace.d.ts +8 -0
  206. package/types/caribeng-ui-input-number.d.ts +3 -1
  207. package/types/caribeng-ui-inputmask.d.ts +5 -0
  208. package/types/caribeng-ui-inputotp.d.ts +7 -2
  209. package/types/caribeng-ui-keyfilter.d.ts +30 -0
  210. package/types/caribeng-ui-listbox.d.ts +5 -3
  211. package/types/caribeng-ui-megamenu.d.ts +26 -2
  212. package/types/caribeng-ui-menu.d.ts +7 -2
  213. package/types/caribeng-ui-menubar.d.ts +5 -1
  214. package/types/caribeng-ui-message.d.ts +3 -0
  215. package/types/caribeng-ui-metergroup.d.ts +9 -1
  216. package/types/caribeng-ui-multiselect.d.ts +71 -10
  217. package/types/caribeng-ui-orderlist.d.ts +58 -6
  218. package/types/caribeng-ui-organizationchart.d.ts +7 -1
  219. package/types/caribeng-ui-paginator.d.ts +3 -0
  220. package/types/caribeng-ui-panel.d.ts +3 -0
  221. package/types/caribeng-ui-panelmenu.d.ts +4 -1
  222. package/types/caribeng-ui-password.d.ts +4 -2
  223. package/types/caribeng-ui-pdfviewer.d.ts +258 -0
  224. package/types/caribeng-ui-picklist.d.ts +67 -7
  225. package/types/caribeng-ui-pricing.d.ts +8 -5
  226. package/types/caribeng-ui-rating.d.ts +6 -2
  227. package/types/caribeng-ui-repeater.d.ts +79 -0
  228. package/types/caribeng-ui-result.d.ts +35 -0
  229. package/types/caribeng-ui-scrollpanel.d.ts +4 -1
  230. package/types/caribeng-ui-scrolltop.d.ts +4 -1
  231. package/types/caribeng-ui-select.d.ts +73 -9
  232. package/types/caribeng-ui-slider.d.ts +63 -10
  233. package/types/caribeng-ui-speeddial.d.ts +5 -2
  234. package/types/caribeng-ui-spinner.d.ts +3 -0
  235. package/types/caribeng-ui-splitbutton.d.ts +49 -0
  236. package/types/caribeng-ui-splitter.d.ts +3 -0
  237. package/types/caribeng-ui-statistic.d.ts +65 -0
  238. package/types/caribeng-ui-stepper.d.ts +3 -0
  239. package/types/caribeng-ui-steps.d.ts +4 -1
  240. package/types/caribeng-ui-table.d.ts +184 -16
  241. package/types/caribeng-ui-tabmenu.d.ts +4 -1
  242. package/types/caribeng-ui-terminal.d.ts +10 -0
  243. package/types/caribeng-ui-themetoggle.d.ts +32 -0
  244. package/types/caribeng-ui-tieredmenu.d.ts +5 -2
  245. package/types/caribeng-ui-timeline.d.ts +63 -4
  246. package/types/caribeng-ui-toast.d.ts +3 -0
  247. package/types/caribeng-ui-togglebutton.d.ts +5 -3
  248. package/types/caribeng-ui-toolbar.d.ts +7 -4
  249. package/types/caribeng-ui-tree.d.ts +76 -4
  250. package/types/caribeng-ui-treeselect.d.ts +10 -2
  251. package/types/caribeng-ui-treetable.d.ts +68 -4
  252. package/types/caribeng-ui-virtualscroller.d.ts +45 -5
  253. package/types/caribeng-ui.d.ts +501 -12
@@ -1,14 +1,104 @@
1
1
  import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, Type, Injector } from '@angular/core';
3
+ import * as _caribeng_ui from '@caribeng/ui';
4
+ import { Observable } from 'rxjs';
2
5
 
6
+ /**
7
+ * Variante declarativa del diálogo dinámico: un `cb-dialog` con título y
8
+ * texto, para casos simples. Para abrir **componentes** con datos y recibir un
9
+ * resultado, usa `CbDialogService.open()`.
10
+ *
11
+ * @example
12
+ * ```html
13
+ * <cb-dynamic-dialog [(visible)]="visible" header="Detalle" content="Tu solicitud fue enviada." />
14
+ * ```
15
+ */
3
16
  declare class CbDynamicDialog {
17
+ protected readonly t: _angular_core.Signal<_caribeng_ui.CbTranslation>;
18
+ /** Visibilidad (two-way). */
4
19
  readonly visible: _angular_core.ModelSignal<boolean>;
5
- readonly header: _angular_core.InputSignal<string>;
20
+ /** Título. Por defecto, "Diálogo" del idioma activo. */
21
+ readonly header: _angular_core.InputSignal<string | undefined>;
22
+ /** Texto del cuerpo (también se puede proyectar contenido). */
6
23
  readonly content: _angular_core.InputSignal<string>;
24
+ /** Se emite al cerrarse. */
7
25
  readonly closed: _angular_core.OutputEmitterRef<void>;
8
- protected close(): void;
9
26
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CbDynamicDialog, never>;
10
27
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<CbDynamicDialog, "cb-dynamic-dialog", never, { "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "header": { "alias": "header"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; }, { "visible": "visibleChange"; "closed": "closed"; }, never, ["*"], true, never>;
11
28
  }
12
29
 
13
- export { CbDynamicDialog };
30
+ /** Opciones de `CbDialogService.open()`. */
31
+ interface CbDynamicDialogConfig<D = unknown> {
32
+ /** Título del diálogo; si se omite, se usa `ariaLabel` como nombre accesible. */
33
+ header?: string;
34
+ /** Datos para el componente abierto (inyéctalos con `CB_DYNAMIC_DIALOG_DATA`). */
35
+ data?: D;
36
+ /** Ancho del panel. Por defecto `32rem`. */
37
+ width?: string;
38
+ /** Muestra el botón de cerrar. Por defecto `true`. */
39
+ closable?: boolean;
40
+ /** Cierra con Escape. Por defecto `true`. */
41
+ closeOnEscape?: boolean;
42
+ /** Cierra al hacer clic en el fondo. Por defecto `true`. */
43
+ dismissableMask?: boolean;
44
+ /** Nombre accesible cuando no hay `header`. */
45
+ ariaLabel?: string;
46
+ }
47
+ /** Datos pasados en `config.data`, para inyectar en el componente abierto. */
48
+ declare const CB_DYNAMIC_DIALOG_DATA: InjectionToken<unknown>;
49
+ /**
50
+ * Referencia a un diálogo abierto con `CbDialogService`. El componente abierto
51
+ * puede inyectarla para cerrarse devolviendo un resultado.
52
+ */
53
+ declare class CbDynamicDialogRef<R = unknown> {
54
+ private readonly dispose;
55
+ private readonly closed$;
56
+ private isClosed;
57
+ /** Emite el resultado (o `undefined` si se cerró sin él) y completa. */
58
+ readonly onClose: Observable<R | undefined>;
59
+ /** @internal */
60
+ constructor(dispose: () => void);
61
+ /** Cierra el diálogo devolviendo un resultado opcional. */
62
+ close(result?: R): void;
63
+ }
64
+ /** Contenedor visual del diálogo dinámico (uso interno de CbDialogService). */
65
+ declare class CbDynamicDialogContainer {
66
+ protected readonly t: _angular_core.Signal<_caribeng_ui.CbTranslation>;
67
+ protected readonly config: CbDynamicDialogConfig<unknown>;
68
+ protected readonly ref: CbDynamicDialogRef<any>;
69
+ protected readonly component: Type<unknown>;
70
+ protected readonly injector: Injector;
71
+ protected readonly titleId: string;
72
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CbDynamicDialogContainer, never>;
73
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CbDynamicDialogContainer, "cb-dynamic-dialog-container", never, {}, {}, never, never, true, never>;
74
+ }
75
+ /**
76
+ * Abre componentes dentro de un diálogo modal (como `DialogService` de PrimeNG):
77
+ * trampa de foco, cierre con Escape y fondo, y devolución del foco al cerrar.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const ref = inject(CbDialogService).open(EditarCliente, {
82
+ * header: 'Editar cliente',
83
+ * data: { id: 42 },
84
+ * });
85
+ * ref.onClose.subscribe((guardado) => { … });
86
+ *
87
+ * // Dentro de EditarCliente:
88
+ * readonly data = inject<{ id: number }>(CB_DYNAMIC_DIALOG_DATA);
89
+ * readonly ref = inject(CbDynamicDialogRef);
90
+ * guardar() { this.ref.close(true); }
91
+ * ```
92
+ */
93
+ declare class CbDialogService {
94
+ private readonly overlay;
95
+ private readonly injector;
96
+ private readonly document;
97
+ open<T, D = unknown, R = unknown>(component: Type<T>, config?: CbDynamicDialogConfig<D>): CbDynamicDialogRef<R>;
98
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CbDialogService, never>;
99
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<CbDialogService>;
100
+ }
101
+
102
+ export { CB_DYNAMIC_DIALOG_DATA, CbDialogService, CbDynamicDialog, CbDynamicDialogContainer, CbDynamicDialogRef };
103
+ export type { CbDynamicDialogConfig };
14
104
  //# sourceMappingURL=caribeng-ui-dynamicdialog.d.ts.map
@@ -1,26 +1,333 @@
1
1
  import * as _caribeng_ui from '@caribeng/ui';
2
+ import { CbTranslation } from '@caribeng/ui';
2
3
  import * as _angular_core from '@angular/core';
3
4
  import { ControlValueAccessor } from '@angular/forms';
4
5
 
6
+ interface CbCharGroup {
7
+ label: (t: CbTranslation) => string;
8
+ chars: readonly string[];
9
+ }
10
+
11
+ /** Color de una paleta del editor: valor CSS y nombre traducido. */
12
+ interface CbEditorColor {
13
+ value: string;
14
+ label: (t: CbTranslation) => string;
15
+ }
16
+
17
+ /** Alineación de una imagen: `left`/`right` (flotante, el texto la rodea) o `center` (bloque centrado). */
18
+ type CbImageAlign = 'left' | 'center' | 'right';
19
+ /** Bordes de una tabla: todos, solo líneas horizontales o ninguno. */
20
+ type CbTableBorders = 'all' | 'horizontal' | 'none';
21
+ interface CbSanitizeOptions {
22
+ /** Permite imágenes (por defecto true). */
23
+ images?: boolean;
24
+ /**
25
+ * Tipografías permitidas (pilas CSS, p. ej. `"'Open Sans', sans-serif"`). Una tipografía
26
+ * se reconoce por su primer nombre; las demás se quitan. Por defecto, las del editor.
27
+ */
28
+ fonts?: readonly string[];
29
+ }
30
+ /** Devuelve el HTML saneado y normalizado; `''` si no hay texto ni imágenes. */
31
+ declare function cbSanitizeHtml(html: string | null | undefined, options?: CbSanitizeOptions): string;
32
+ /** Texto plano del HTML (para contar caracteres o guardar un resumen). */
33
+ declare function cbHtmlToText(html: string | null | undefined): string;
34
+
35
+ /** Recuadro de recorte en fracciones de la imagen (0–1). */
36
+ interface CbCropRect {
37
+ x: number;
38
+ y: number;
39
+ w: number;
40
+ h: number;
41
+ }
42
+
43
+ /** Una tipografía del selector: nombre visible y pila CSS que se guarda en el HTML (`''` = predeterminada). */
44
+ interface CbEditorFont {
45
+ name: string;
46
+ value: string;
47
+ }
48
+ /** Grupo del selector de tipografía (`<optgroup>`). */
49
+ interface CbEditorFontGroup {
50
+ label: string | ((t: CbTranslation) => string);
51
+ fonts: readonly CbEditorFont[];
52
+ }
5
53
  /**
6
- * Editor de CaribeNG: editor de texto enriquecido sin dependencias de terceros,
7
- * con barra de herramientas accesible (encabezados, formato, listas, cita,
8
- * alineación, enlaces, deshacer/rehacer) e integración CVA.
54
+ * Tipografías por defecto, todas libres (Google Fonts). Las "clásicas de Office" son
55
+ * métricamente compatibles con Arial, Times New Roman y Courier New, y Carlito con Calibri,
56
+ * así un documento conserva su maquetación.
57
+ */
58
+ declare const CB_EDITOR_FONTS: readonly CbEditorFontGroup[];
59
+ /** Hoja de Google Fonts con las tipografías por defecto (regular, negrita y sus cursivas). */
60
+ declare const CB_EDITOR_FONTS_HREF: string;
61
+
62
+ /** Herramientas de la barra; `'|'` es un separador y `'-'` empieza una fila nueva. */
63
+ type CbEditorTool = 'heading' | 'fontFamily' | 'fontSize' | 'bold' | 'italic' | 'underline' | 'strike' | 'code' | 'subscript' | 'superscript' | 'textColor' | 'highlight' | 'bulletList' | 'orderedList' | 'taskList' | 'indent' | 'outdent' | 'quote' | 'codeBlock' | 'alignment' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'link' | 'image' | 'table' | 'horizontalRule' | 'clear' | 'undo' | 'redo' | 'source' | 'fullscreen' | 'specialChars' | 'findReplace' | '|' | '-';
64
+ /**
65
+ * Barra por defecto, en dos filas: arriba el texto (bloque, fuente, tamaño, estilos y color);
66
+ * abajo la estructura (listas, alineación, inserciones, buscar y vistas).
67
+ */
68
+ declare const CB_EDITOR_DEFAULT_TOOLBAR: readonly CbEditorTool[];
69
+ /** Sube una imagen y devuelve su URL pública (p. ej. a tu servidor o a un bucket). */
70
+ type CbEditorImageUpload = (file: File) => Promise<string>;
71
+ /** Motivo por el que no se insertó una imagen. */
72
+ interface CbEditorImageError {
73
+ file: File;
74
+ reason: 'type' | 'size' | 'upload';
75
+ error?: unknown;
76
+ }
77
+ /** Bloques que se insertan escribiendo `/` (filtrables por nombre o por palabras clave). */
78
+ interface SlashItem {
79
+ id: string;
80
+ icon: string;
81
+ label: (t: CbTranslation) => string;
82
+ keywords: string;
83
+ }
84
+ interface EditorState {
85
+ bold: boolean;
86
+ italic: boolean;
87
+ underline: boolean;
88
+ strike: boolean;
89
+ code: boolean;
90
+ bulletList: boolean;
91
+ orderedList: boolean;
92
+ quote: boolean;
93
+ codeBlock: boolean;
94
+ subscript: boolean;
95
+ superscript: boolean;
96
+ taskList: boolean;
97
+ alignLeft: boolean;
98
+ alignCenter: boolean;
99
+ alignRight: boolean;
100
+ alignJustify: boolean;
101
+ link: boolean;
102
+ block: string;
103
+ fontSize: string;
104
+ fontFamily: string;
105
+ }
106
+ /**
107
+ * Editor de CaribeNG: editor de texto enriquecido sin dependencias de terceros.
108
+ *
109
+ * - **Valor**: HTML saneado y normalizado (lista blanca de etiquetas, sin scripts,
110
+ * eventos ni URLs peligrosas; igual en todos los navegadores; `''` si está vacío).
111
+ * El mismo saneado se aplica al cargar un valor y al pegar.
112
+ * - Barra configurable (`toolbar`) con estado activo, panel de enlaces con
113
+ * validación, imágenes con `imageUpload` (o data URL con límite de tamaño),
114
+ * pegado limpio desde Word y Google Docs, atajos de escritura (`# `, `* `,
115
+ * `1. `, `> `), contador con `maxLength`, vista de HTML y modo `readonly`.
116
+ * - Integración con Angular Forms (`ControlValueAccessor`).
117
+ *
118
+ * @example
119
+ * ```html
120
+ * <cb-editor formControlName="descripcion" [maxLength]="2000" [imageUpload]="subirImagen" />
121
+ * <cb-editor [value]="html" readonly />
122
+ * ```
9
123
  */
10
124
  declare class CbEditor implements ControlValueAccessor {
11
- readonly placeholder: _angular_core.InputSignal<string>;
125
+ /** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
126
+ protected readonly t: _angular_core.Signal<CbTranslation>;
127
+ private readonly document;
128
+ private readonly injector;
129
+ readonly placeholder: _angular_core.InputSignal<string | undefined>;
130
+ /** Nombre accesible del área de texto. Por defecto, "Editor de texto" del idioma activo. */
131
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
132
+ /** Alto mínimo del área de texto. */
12
133
  readonly height: _angular_core.InputSignal<string>;
13
- readonly disabled: _angular_core.InputSignal<boolean>;
134
+ /** Alto máximo: a partir de él, el área hace scroll (la barra queda fija). Sin él, crece con el contenido. */
135
+ readonly maxHeight: _angular_core.InputSignal<string | undefined>;
136
+ /** Muestra el número de palabras y caracteres al pie. */
137
+ readonly wordCount: _angular_core.InputSignalWithTransform<boolean, unknown>;
138
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
139
+ /** Muestra el contenido (saneado) sin barra ni edición. */
140
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
14
141
  /** Marca visual y ARIA de estado inválido (también se activa con Angular Forms). */
15
142
  readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
143
+ readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
144
+ /** Herramientas de la barra y su orden (`'|'` separa grupos). */
145
+ readonly toolbar: _angular_core.InputSignal<readonly CbEditorTool[]>;
146
+ /** Máximo de caracteres de texto (sin contar las etiquetas). Muestra un contador. */
147
+ readonly maxLength: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
148
+ /** Permite imágenes (botón, pegar y soltar). */
149
+ readonly images: _angular_core.InputSignalWithTransform<boolean, unknown>;
150
+ /**
151
+ * Sube la imagen y devuelve su URL; así el HTML guarda una URL y no la imagen.
152
+ * Sin él, la imagen se inserta como data URL si no supera `maxImageSize`.
153
+ */
154
+ readonly imageUpload: _angular_core.InputSignal<CbEditorImageUpload | undefined>;
155
+ /** Tamaño máximo (bytes) de una imagen insertada como data URL. Por defecto 1 MB. */
156
+ readonly maxImageSize: _angular_core.InputSignalWithTransform<number, unknown>;
157
+ /** Pega siempre como texto plano (sin formato). */
158
+ readonly pastePlainText: _angular_core.InputSignalWithTransform<boolean, unknown>;
159
+ /** Tipografías del selector, por grupos. La primera opción con valor `''` es la predeterminada. */
160
+ readonly fonts: _angular_core.InputSignal<readonly CbEditorFontGroup[]>;
161
+ /**
162
+ * Hoja de estilos que carga las tipografías (por defecto, Google Fonts). Usa `''` si
163
+ * las sirves tú (o si tu CSP no permite fuentes externas).
164
+ */
165
+ readonly fontsHref: _angular_core.InputSignal<string>;
166
+ /** Menú flotante con formato rápido al seleccionar texto. */
167
+ readonly bubbleMenu: _angular_core.InputSignalWithTransform<boolean, unknown>;
168
+ /** Escribir `/` al inicio de una línea (o tras un espacio) abre un menú para insertar bloques. */
169
+ readonly slashCommands: _angular_core.InputSignalWithTransform<boolean, unknown>;
170
+ /** Convierte en enlace las URL (`https://…`, `www.…`) al escribir un espacio después. */
171
+ readonly autolink: _angular_core.InputSignalWithTransform<boolean, unknown>;
172
+ /** Corrección tipográfica al escribir: `(c)` → ©, `...` → …, `->` → →, ` -- ` → –, `1/2` → ½. */
173
+ readonly typography: _angular_core.InputSignalWithTransform<boolean, unknown>;
174
+ /** HTML del contenido (saneado y normalizado; `''` si está vacío). */
175
+ readonly value: _angular_core.ModelSignal<string>;
176
+ /** Una imagen no se pudo insertar (tipo, tamaño o error de subida). */
177
+ readonly imageError: _angular_core.OutputEmitterRef<CbEditorImageError>;
16
178
  /** Estado de validación: inputs manuales + estado de Angular Forms. */
17
179
  protected readonly fieldState: _caribeng_ui.CbFieldState;
18
- readonly value: _angular_core.ModelSignal<string>;
180
+ protected readonly surfaceId: string;
181
+ protected readonly countId: string;
182
+ protected readonly linkErrorId: string;
19
183
  private readonly cvaDisabled;
20
184
  protected readonly isDisabled: _angular_core.Signal<boolean>;
185
+ protected readonly state: _angular_core.WritableSignal<EditorState>;
186
+ protected readonly sourceMode: _angular_core.WritableSignal<boolean>;
187
+ protected readonly sourceText: _angular_core.WritableSignal<string>;
188
+ protected readonly message: _angular_core.WritableSignal<string>;
189
+ protected readonly length: _angular_core.WritableSignal<number>;
190
+ protected readonly linkPanel: _angular_core.WritableSignal<{
191
+ url: string;
192
+ newTab: boolean;
193
+ editing: boolean;
194
+ } | null>;
195
+ protected readonly linkUrl: _angular_core.WritableSignal<string>;
196
+ protected readonly linkNewTab: _angular_core.WritableSignal<boolean>;
197
+ protected readonly linkError: _angular_core.WritableSignal<boolean>;
198
+ protected readonly isEmpty: _angular_core.Signal<boolean>;
199
+ protected readonly invalidState: _angular_core.Signal<boolean>;
200
+ protected readonly countText: _angular_core.Signal<string>;
201
+ protected readonly words: _angular_core.WritableSignal<number>;
202
+ protected readonly wordsText: _angular_core.Signal<string>;
203
+ /** Pie: palabras y caracteres (con `maxLength`, "N de M caracteres"). */
204
+ protected readonly countLine: _angular_core.Signal<string>;
205
+ protected readonly fullscreen: _angular_core.WritableSignal<boolean>;
206
+ protected readonly openMenu: _angular_core.WritableSignal<CbEditorTool | null>;
207
+ protected readonly lastTextColor: _angular_core.WritableSignal<string>;
208
+ protected readonly lastHighlight: _angular_core.WritableSignal<string>;
209
+ protected readonly textColors: readonly CbEditorColor[];
210
+ protected readonly highlightColors: readonly CbEditorColor[];
211
+ protected readonly fontSizes: readonly [10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48];
212
+ protected readonly specialChars: readonly CbCharGroup[];
213
+ protected readonly bubbleTools: readonly CbEditorTool[];
214
+ /** Pilas CSS permitidas al sanear (las del selector). */
215
+ private readonly fontStackList;
216
+ protected readonly alignments: readonly ("alignLeft" | "alignCenter" | "alignRight" | "alignJustify")[];
217
+ protected readonly describedBy: _angular_core.Signal<string | null>;
218
+ protected readonly toolbarItems: _angular_core.Signal<CbEditorTool[]>;
219
+ /** Filas de la barra (`'-'` empieza una nueva). */
220
+ protected readonly toolbarRows: _angular_core.Signal<CbEditorTool[][]>;
221
+ /** Menú flotante de formato: posición respecto al área (encima o debajo de la selección). */
222
+ protected readonly bubble: _angular_core.WritableSignal<{
223
+ left: number;
224
+ top: number;
225
+ below: boolean;
226
+ } | null>;
227
+ /** Se está seleccionando con el ratón (el menú flotante espera a soltar). */
228
+ protected pointerSelecting: boolean;
229
+ /** Menú `/`: texto escrito tras la barra, opción activa y posición. */
230
+ protected readonly slash: _angular_core.WritableSignal<{
231
+ query: string;
232
+ active: number;
233
+ left: number;
234
+ top: number;
235
+ } | null>;
236
+ private slashAnchor;
237
+ protected readonly slashListId: string;
238
+ protected readonly slashItems: _angular_core.Signal<SlashItem[]>;
239
+ /** Buscar y reemplazar. */
240
+ protected readonly findOpen: _angular_core.WritableSignal<boolean>;
241
+ protected readonly findQuery: _angular_core.WritableSignal<string>;
242
+ protected readonly replaceText: _angular_core.WritableSignal<string>;
243
+ protected readonly findCase: _angular_core.WritableSignal<boolean>;
244
+ protected readonly findWhole: _angular_core.WritableSignal<boolean>;
245
+ protected readonly findTotal: _angular_core.WritableSignal<number>;
246
+ protected readonly findIndex: _angular_core.WritableSignal<number>;
247
+ /** Aviso tras "Reemplazar todo" (sustituye al contador hasta la siguiente búsqueda). */
248
+ private readonly findNote;
249
+ private findRanges;
250
+ private readonly findInputRef;
251
+ protected readonly findStatus: _angular_core.Signal<string>;
21
252
  private readonly surfaceRef;
22
253
  private readonly imageInputRef;
254
+ private readonly toolbarRef;
255
+ private readonly linkInputRef;
256
+ private readonly bodyRef;
257
+ private readonly tableRowsRef;
258
+ private readonly tableColsRef;
259
+ private readonly tableHeaderRef;
260
+ private readonly altInputRef;
23
261
  private savedRange;
262
+ private editingLink;
263
+ /** Celda de tabla donde está el cursor (muestra la barra de tabla). */
264
+ protected readonly tableCell: _angular_core.WritableSignal<HTMLTableCellElement | null>;
265
+ protected readonly tableHasHeader: _angular_core.Signal<boolean>;
266
+ protected readonly tablePanel: _angular_core.WritableSignal<boolean>;
267
+ protected readonly tableHeader: _angular_core.WritableSignal<boolean>;
268
+ protected readonly pickerRows: number[];
269
+ protected readonly pickerCols: number[];
270
+ protected readonly pickerHover: _angular_core.WritableSignal<{
271
+ r: number;
272
+ c: number;
273
+ } | null>;
274
+ protected readonly pickerFocus: _angular_core.WritableSignal<{
275
+ r: number;
276
+ c: number;
277
+ }>;
278
+ /** Se incrementa al cambiar los bordes (viven en el DOM de las celdas). */
279
+ private readonly tableTick;
280
+ protected readonly tableBorders: _angular_core.Signal<{
281
+ borders: CbTableBorders;
282
+ color: string | null;
283
+ }>;
284
+ protected readonly borderColors: {
285
+ value: string;
286
+ label: (t: CbTranslation) => string;
287
+ }[];
288
+ protected readonly crop: _angular_core.WritableSignal<{
289
+ src: string;
290
+ rect: CbCropRect;
291
+ ratio: number | null;
292
+ natural: {
293
+ w: number;
294
+ h: number;
295
+ };
296
+ busy: boolean;
297
+ error: boolean;
298
+ } | null>;
299
+ protected readonly cropRatios: {
300
+ label: string;
301
+ value: number | null;
302
+ }[];
303
+ protected readonly cropCorners: readonly ["nw", "ne", "sw", "se"];
304
+ protected readonly cropHelpId: string;
305
+ private readonly cropStageRef;
306
+ protected readonly cropValueText: _angular_core.Signal<string>;
307
+ /** Imagen seleccionada con un clic (muestra su barra y el tirador de tamaño). */
308
+ protected readonly selectedImage: _angular_core.WritableSignal<HTMLImageElement | null>;
309
+ /** Se incrementa al cambiar la imagen seleccionada (su estilo vive en el DOM, no en una señal). */
310
+ private readonly imageTick;
311
+ protected readonly imageState: _angular_core.Signal<{
312
+ width: string | null;
313
+ align: CbImageAlign | null;
314
+ }>;
315
+ protected readonly imageFrame: _angular_core.WritableSignal<{
316
+ left: number;
317
+ top: number;
318
+ width: number;
319
+ height: number;
320
+ } | null>;
321
+ protected readonly altPanel: _angular_core.WritableSignal<boolean>;
322
+ private resizing;
323
+ protected readonly imageWidths: string[];
324
+ protected readonly imageAligns: {
325
+ align: CbImageAlign | null;
326
+ icon: string;
327
+ label: (t: CbTranslation) => string;
328
+ }[];
329
+ /** Último HTML emitido o cargado: evita reescribir el DOM (y mover el cursor) con su propio valor. */
330
+ private lastHtml;
24
331
  private onChange;
25
332
  private onTouched;
26
333
  constructor();
@@ -28,22 +335,188 @@ declare class CbEditor implements ControlValueAccessor {
28
335
  registerOnChange(fn: (val: string) => void): void;
29
336
  registerOnTouched(fn: () => void): void;
30
337
  setDisabledState(isDisabled: boolean): void;
338
+ private tools;
339
+ /** Deja solo `active` en el orden de tabulación de la barra. */
340
+ protected setActiveTool(active: HTMLElement | undefined): void;
341
+ /** Flechas, Inicio y Fin mueven el foco entre las herramientas (de forma circular). */
342
+ protected onToolbarKeydown(event: KeyboardEvent): void;
343
+ protected toolIcon(tool: CbEditorTool): string;
344
+ protected toolLabel(tool: CbEditorTool): string;
345
+ protected toolKeys(tool: CbEditorTool): string;
346
+ /** Tooltip: nombre y atajo, p. ej. "Negrita (Ctrl+B)". */
347
+ protected toolTitle(tool: CbEditorTool): string;
348
+ protected ariaKeys(tool: CbEditorTool): string | null;
349
+ protected isMenu(tool: CbEditorTool): boolean;
350
+ protected groupLabel(group: CbEditorFontGroup): string;
351
+ /** Icono del botón de un menú: el de la alineación actual, o el de la herramienta. */
352
+ protected menuIcon(tool: CbEditorTool): string;
353
+ protected toggleMenu(tool: CbEditorTool): void;
354
+ /** Flecha abajo, Enter o Espacio en el botón abren el menú y enfocan su primera opción. */
355
+ protected onMenuTriggerKeydown(event: KeyboardEvent, tool: CbEditorTool): void;
356
+ /** Flechas (en la paleta, en cuadrícula de 5), Inicio, Fin, Escape y Tab dentro de un menú. */
357
+ protected onMenuKeydown(event: KeyboardEvent): void;
358
+ /** Aplica la opción elegida de un menú y lo cierra. */
359
+ protected applyMenu(tool: CbEditorTool, value: string | null): void;
360
+ protected pressable(tool: CbEditorTool): boolean;
361
+ protected isActive(tool: CbEditorTool): boolean;
31
362
  /** Evita que el botón robe la selección del área editable. */
32
363
  protected hold(event: MouseEvent): void;
33
- exec(command: string, value?: string): void;
364
+ protected run(tool: CbEditorTool): void;
365
+ exec(command: string, value?: string, css?: boolean): void;
366
+ /** Ejecuta el comando sin emitir el valor (para retocar el resultado antes). */
367
+ private command;
34
368
  /** Aplica un bloque (encabezado, párrafo o cita). */
35
369
  protected format(tag: string): void;
36
- /** Inserta un enlace sobre la selección actual. */
37
- protected insertLink(): void;
370
+ /** Quita el formato en línea y vuelve el bloque a párrafo. */
371
+ protected clearFormat(): void;
372
+ private selectionRange;
373
+ /** Color del texto seleccionado; `null` = automático (quita el color). */
374
+ setTextColor(color: string | null): void;
375
+ /** Resaltado (color de fondo) del texto seleccionado; `null` lo quita. */
376
+ setHighlight(color: string | null): void;
377
+ /** Tamaño de letra de la selección en px (`''` = normal). */
378
+ setFontSize(value: string): void;
379
+ /** Tipografía de la selección (pila CSS; `''` = la predeterminada). */
380
+ setFontFamily(value: string): void;
381
+ /** Sangría: anida en listas; en párrafos y títulos, margen en pasos de 2rem. */
382
+ changeIndent(delta: 1 | -1): void;
383
+ /** Lista de tareas: crea una, convierte la lista actual o la quita. */
384
+ toggleTaskList(): void;
385
+ /** Pantalla completa (Escape sale). */
386
+ toggleFullscreen(): void;
387
+ /** Envuelve la selección en `<code>` o la saca de él. */
388
+ private toggleCode;
389
+ /** Abre el panel de enlace (Ctrl + K); si el cursor está en un enlace, lo edita. */
390
+ protected openLink(): void;
391
+ protected closeLink(): void;
392
+ protected applyLink(event: Event): void;
393
+ protected removeLink(): void;
38
394
  /** Abre el selector de archivos guardando la posición del cursor. */
39
395
  protected pickImage(): void;
40
- /** Inserta la imagen elegida (como data URL) donde estaba el cursor. */
41
396
  protected onImageFile(event: Event): void;
42
- protected onSurfaceInput(): void;
397
+ /** Sube (o lee) la imagen y la inserta donde estaba el cursor. */
398
+ insertImage(file: File): Promise<void>;
399
+ protected onPaste(event: ClipboardEvent): void;
400
+ protected onDrop(event: DragEvent): void;
401
+ /** Inserta lo pegado: HTML saneado o texto plano, recortado si supera `maxLength`. */
402
+ private insertClipboard;
403
+ /** Impide escribir más allá de `maxLength`. */
404
+ protected onBeforeInput(event: InputEvent): void;
405
+ protected onSurfaceInput(event?: Event): void;
406
+ /** Texto (nodo y posición) donde está el cursor, si no es código ni una selección. */
407
+ private caretText;
408
+ private setCaret;
409
+ /** Al escribir un espacio tras una URL, la convierte en enlace. */
410
+ private autolinkAtCaret;
411
+ /** Corrección tipográfica del texto recién escrito (`(c)` → ©, `...` → …). */
412
+ private fixTypography;
413
+ /** Tras escribir `/` al inicio de una línea o después de un espacio, abre el menú de bloques. */
414
+ private openSlash;
415
+ /** Filtra con lo escrito tras la `/`; se cierra si el cursor sale de ahí o se escribe un espacio. */
416
+ private updateSlash;
417
+ protected closeSlash(): void;
418
+ protected slashOptionId(index: number): string;
419
+ /** Quita la `/` y lo escrito tras ella, y aplica el bloque elegido. */
420
+ protected applySlash(item: SlashItem): void;
421
+ /** Flechas, Enter / Tab y Escape mientras el menú `/` está abierto. */
422
+ private onSlashKeydown;
423
+ /** Posición del cursor (o de la selección) respecto al área, para colocar menús. */
424
+ private caretPosition;
425
+ /** Muestra el menú de formato rápido sobre una selección de texto (o lo oculta). */
426
+ private updateBubble;
427
+ /** Una herramienta del menú flotante: la aplica y recoloca el menú. */
428
+ protected runBubble(tool: CbEditorTool): void;
429
+ /** Abre el panel (Ctrl + F); el texto seleccionado se usa como búsqueda. */
430
+ openFind(): void;
431
+ /** Cierra el panel y deja seleccionada la coincidencia actual en el texto. */
432
+ closeFind(): void;
433
+ protected setFindQuery(query: string): void;
434
+ protected setFindOption(option: 'case' | 'whole'): void;
435
+ /** Recalcula las coincidencias y marca la actual (`index`, limitado al total). */
436
+ private refreshFind;
437
+ /** Siguiente (1) o anterior (-1) coincidencia, de forma circular. */
438
+ findStep(step: 1 | -1): void;
439
+ /** Resalta todas las coincidencias y la actual (sin tocar el contenido) y la hace visible. */
440
+ private paintFind;
441
+ private clearFindHighlight;
442
+ /** Reemplaza la coincidencia actual y pasa a la siguiente. */
443
+ replaceCurrent(): void;
444
+ /** Reemplaza todas las coincidencias (cada una se puede deshacer con Ctrl + Z). */
445
+ replaceAllMatches(): void;
446
+ /** Sustituye el texto de los rangos (del último al primero, para no desplazar los demás). */
447
+ private replaceRanges;
448
+ /** Enter: siguiente; Mayús + Enter: anterior (en el campo de reemplazo, reemplaza); Escape: cerrar. */
449
+ protected onFindKeydown(event: KeyboardEvent): void;
450
+ /** Atajos de teclado: Ctrl + K enlace; Ctrl + Mayús + 7 / 8 listas; Ctrl + Alt + 0–3 bloques. */
451
+ protected onSurfaceKeydown(event: KeyboardEvent): void;
452
+ /**
453
+ * Formato al escribir (como Markdown): al pulsar espacio tras `#`, `##`, `###`,
454
+ * `*`, `-`, `1.` o `>` al inicio de un párrafo, se convierte el bloque.
455
+ */
456
+ private autoformat;
457
+ protected openTablePanel(): void;
458
+ protected closeTablePanel(): void;
459
+ protected pickerOn(r: number, c: number): boolean;
460
+ protected tableSizeLabel(r: number, c: number): string;
461
+ /** Flechas en la cuadrícula de tamaño; Enter inserta. */
462
+ protected onPickerKeydown(event: KeyboardEvent, r: number, c: number): void;
463
+ /** Inserta una tabla de filas × columnas con bordes grises (se ven igual fuera del editor). */
464
+ insertTable(rows: number, cols: number): void;
465
+ /** Bordes de toda la tabla: todos, solo horizontales o ninguno; y su color. */
466
+ setTableBorders(borders: CbTableBorders | null, color: string | null): void;
467
+ /** Acciones de la barra de tabla sobre la celda actual. */
468
+ protected tableAction(id: string): void;
469
+ private deleteTable;
470
+ /** Tab / Mayús + Tab: celda siguiente o anterior; en la última, añade una fila. */
471
+ private moveCell;
472
+ /** Pone el cursor al inicio de un elemento. */
473
+ private placeCaret;
474
+ protected onSurfaceClick(event: MouseEvent): void;
475
+ private deselectImage;
476
+ /** Coloca el marco y el tirador sobre la imagen seleccionada. */
477
+ protected refreshFrame(): void;
478
+ protected imageWidthLabel(width: string): string;
479
+ private applyImageStyle;
480
+ /** Alineación: en línea (`null`), izquierda o derecha (el texto la rodea) o centrada. */
481
+ setImageAlign(align: CbImageAlign | null): void;
482
+ /** Ancho en % o px; `null` vuelve al tamaño original. */
483
+ setImageWidth(width: string | null): void;
484
+ protected deleteImage(): void;
485
+ protected openAlt(): void;
486
+ protected closeAlt(): void;
487
+ protected applyAlt(event: Event): void;
488
+ protected openCrop(): void;
489
+ protected closeCrop(): void;
490
+ /** Proporción fija (ancho / alto) o libre (`null`). */
491
+ setCropRatio(ratio: number | null): void;
492
+ /** Mueve (`corner` null) o redimensiona el recuadro arrastrando. */
493
+ protected startCropDrag(event: PointerEvent, corner: 'nw' | 'ne' | 'sw' | 'se' | null): void;
494
+ /** Flechas: mover un 2 %; Mayús + flechas: cambiar el tamaño desde la esquina inferior derecha; Enter: aplicar. */
495
+ protected onCropKeydown(event: KeyboardEvent): void;
496
+ /** Recorta los píxeles y sustituye la imagen (subiéndola con `imageUpload` si lo hay). */
497
+ applyCrop(): Promise<void>;
498
+ /** Arrastrar el tirador cambia el ancho (en % del área, para que se adapte a la pantalla). */
499
+ protected startResize(event: PointerEvent): void;
500
+ /** Flechas, Inicio y Fin en las barras de tabla e imagen (patrón *toolbar*). */
501
+ protected onContextKeydown(event: KeyboardEvent): void;
502
+ private toggleSource;
503
+ /** Saneado con las opciones del editor (imágenes y tipografías permitidas). */
504
+ private sanitize;
505
+ /** Emite el HTML saneado sin tocar el DOM (no se pierde la posición del cursor). */
506
+ private emit;
43
507
  protected onBlur(): void;
508
+ private textLength;
509
+ private remaining;
510
+ private saveSelection;
511
+ private restoreSelection;
512
+ private closest;
513
+ private closestBlock;
514
+ /** Lee el formato de la selección para marcar las herramientas activas. */
515
+ private updateState;
44
516
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CbEditor, never>;
45
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CbEditor, "cb-editor", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
517
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CbEditor, "cb-editor", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "wordCount": { "alias": "wordCount"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "toolbar": { "alias": "toolbar"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "images": { "alias": "images"; "required": false; "isSignal": true; }; "imageUpload": { "alias": "imageUpload"; "required": false; "isSignal": true; }; "maxImageSize": { "alias": "maxImageSize"; "required": false; "isSignal": true; }; "pastePlainText": { "alias": "pastePlainText"; "required": false; "isSignal": true; }; "fonts": { "alias": "fonts"; "required": false; "isSignal": true; }; "fontsHref": { "alias": "fontsHref"; "required": false; "isSignal": true; }; "bubbleMenu": { "alias": "bubbleMenu"; "required": false; "isSignal": true; }; "slashCommands": { "alias": "slashCommands"; "required": false; "isSignal": true; }; "autolink": { "alias": "autolink"; "required": false; "isSignal": true; }; "typography": { "alias": "typography"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "imageError": "imageError"; }, never, never, true, never>;
46
518
  }
47
519
 
48
- export { CbEditor };
520
+ export { CB_EDITOR_DEFAULT_TOOLBAR, CB_EDITOR_FONTS, CB_EDITOR_FONTS_HREF, CbEditor, cbHtmlToText, cbSanitizeHtml };
521
+ export type { CbEditorFont, CbEditorFontGroup, CbEditorImageError, CbEditorImageUpload, CbEditorTool, CbSanitizeOptions };
49
522
  //# sourceMappingURL=caribeng-ui-editor.d.ts.map