@cbm-common/cbm-types 0.0.366 → 0.0.367
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.
- package/lib/components/document-editor/clipboard/document-editor-node-ids.d.ts +2 -0
- package/lib/components/document-editor/clipboard/document-editor-paste.d.ts +3 -0
- package/lib/components/document-editor/document-editor.d.ts +421 -0
- package/lib/components/document-editor/find/document-editor-search.d.ts +23 -0
- package/lib/components/document-editor/find/find-panel/document-editor-find-panel.d.ts +45 -0
- package/lib/components/document-editor/format/document-editor-commands.d.ts +38 -0
- package/lib/components/document-editor/format/document-editor-defaults.d.ts +14 -0
- package/lib/components/document-editor/format/document-editor-format-state.d.ts +62 -0
- package/lib/components/document-editor/format/document-editor-format.d.ts +2 -0
- package/lib/components/document-editor/format/document-editor-typography.d.ts +26 -0
- package/lib/components/document-editor/i18n/document-editor-i18n.d.ts +2 -0
- package/lib/components/document-editor/lists/document-editor-list.d.ts +12 -0
- package/lib/components/document-editor/lists/list-panel/document-editor-list-panel.d.ts +55 -0
- package/lib/components/document-editor/nodes/document-editor-node-attributes.d.ts +16 -0
- package/lib/components/document-editor/nodes/document-editor-node-types.d.ts +83 -0
- package/lib/components/document-editor/nodes/document-editor-node.d.ts +24 -0
- package/lib/components/document-editor/nodes/node-panel/document-editor-node-panel.d.ts +34 -0
- package/lib/components/document-editor/page/document-editor-page-nodes.d.ts +18 -0
- package/lib/components/document-editor/page/document-editor-pages.d.ts +40 -0
- package/lib/components/document-editor/page/document-editor-region-guard.d.ts +2 -0
- package/lib/components/document-editor/public-api.d.ts +48 -0
- package/lib/components/document-editor/ribbon/color-menu/document-editor-color-menu.d.ts +34 -0
- package/lib/components/document-editor/ribbon/link-menu/document-editor-link-menu.d.ts +19 -0
- package/lib/components/document-editor/ribbon/spinner/document-editor-spinner.d.ts +51 -0
- package/lib/components/document-editor/ribbon/symbol-menu/document-editor-symbol-menu.d.ts +10 -0
- package/lib/components/document-editor/tables/borders/border-menu/document-editor-border-menu.d.ts +20 -0
- package/lib/components/document-editor/tables/borders/border-style-picker/document-editor-border-style-picker.d.ts +13 -0
- package/lib/components/document-editor/tables/borders/border-weight-picker/document-editor-border-weight-picker.d.ts +16 -0
- package/lib/components/document-editor/tables/borders/document-editor-table-border-painter.d.ts +14 -0
- package/lib/components/document-editor/tables/borders/document-editor-table-borders.d.ts +52 -0
- package/lib/components/document-editor/tables/document-editor-table-select.d.ts +14 -0
- package/lib/components/document-editor/tables/document-editor-table-selection.d.ts +47 -0
- package/lib/components/document-editor/tables/document-editor-table.d.ts +2 -0
- package/lib/components/document-editor/tables/handles/document-editor-table-handles-commands.d.ts +46 -0
- package/lib/components/document-editor/tables/handles/document-editor-table-handles-dom.d.ts +23 -0
- package/lib/components/document-editor/tables/handles/document-editor-table-handles-geometry.d.ts +104 -0
- package/lib/components/document-editor/tables/handles/document-editor-table-handles.d.ts +14 -0
- package/lib/components/document-editor/tables/layout/alignment-grid/document-editor-alignment-grid.d.ts +32 -0
- package/lib/components/document-editor/tables/layout/cell-margins-menu/document-editor-cell-margins-menu.d.ts +50 -0
- package/lib/components/document-editor/tables/layout/document-editor-table-layout.d.ts +92 -0
- package/lib/components/document-editor/tables/styles/document-editor-table-design-extension.d.ts +2 -0
- package/lib/components/document-editor/tables/styles/document-editor-table-design-state.d.ts +23 -0
- package/lib/components/document-editor/tables/styles/document-editor-table-design.d.ts +39 -0
- package/lib/components/document-editor/tables/styles/document-editor-table-styles.d.ts +114 -0
- package/lib/components/document-editor/tables/styles/style-gallery/document-editor-table-style-gallery.d.ts +65 -0
- package/lib/components/document-editor/tables/table-dialog/document-editor-table-dialog.d.ts +54 -0
- package/lib/components/document-editor/tables/table-grid-menu/document-editor-table-grid-menu.d.ts +31 -0
- package/lib/components/document-editor/variables/document-editor-sample-data.d.ts +4 -0
- package/lib/components/document-editor/variables/document-editor-schema.d.ts +87 -0
- package/lib/components/document-editor/variables/document-editor-template.d.ts +9 -0
- package/lib/components/document-editor/variables/variables-panel/document-editor-variables-panel.d.ts +39 -0
- package/lib/components/document-editor/word-import/document-editor-word-flatten.d.ts +7 -0
- package/lib/components/document-editor/word-import/document-editor-word-float.d.ts +23 -0
- package/lib/components/document-editor/word-import/document-editor-word-format.d.ts +17 -0
- package/lib/components/document-editor/word-import/document-editor-word-images.d.ts +24 -0
- package/lib/components/document-editor/word-import/document-editor-word-import.d.ts +20 -0
- package/lib/components/document-editor/word-import/document-editor-word-page.d.ts +57 -0
- package/lib/components/document-editor/word-import/document-editor-word-styles.d.ts +143 -0
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { DestroyRef, ElementRef, Injector } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { CbmNotificationService } from '../../domain/services/notification/notification.service';
|
|
4
|
+
import { AteEditorConfig, AteI18nService } from '@flogeez/angular-tiptap-editor';
|
|
5
|
+
import { Editor, type ChainedCommands } from '@tiptap/core';
|
|
6
|
+
import { DocumentCapturedFormat, DocumentTextCase } from './format/document-editor-commands';
|
|
7
|
+
import { DocumentDefaults } from './format/document-editor-defaults';
|
|
8
|
+
import { DocumentBlockStyle, DocumentFormatState, DocumentTableFloat, DocumentTextAlign } from './format/document-editor-format-state';
|
|
9
|
+
import { DocumentListPanelMode } from './lists/list-panel/document-editor-list-panel';
|
|
10
|
+
import { DocumentListCollection, DocumentVariable, DocumentVariablesCatalog } from './nodes/document-editor-node-types';
|
|
11
|
+
import { DocumentSchemaCategorySource, DocumentVariablesConfig, DocumentVariablesStatus } from './variables/document-editor-schema';
|
|
12
|
+
import { DocumentBorderLineStyle, DocumentBorderPen, DocumentBorderTarget } from './tables/borders/document-editor-table-borders';
|
|
13
|
+
import { DocumentCellMarginsRequest } from './tables/layout/cell-margins-menu/document-editor-cell-margins-menu';
|
|
14
|
+
import { DocumentCellAlignmentChoice, DocumentTableAutofit, DocumentTableLayoutState } from './tables/layout/document-editor-table-layout';
|
|
15
|
+
import { DocumentTableSelectPart } from './tables/document-editor-table-select';
|
|
16
|
+
import { TableLookFlag } from './tables/styles/document-editor-table-styles';
|
|
17
|
+
import { DocumentFieldKind, DocumentRegionKind } from './page/document-editor-page-nodes';
|
|
18
|
+
import { DocumentSpinnerCommit } from './ribbon/spinner/document-editor-spinner';
|
|
19
|
+
import { DocumentTableRequest } from './tables/table-dialog/document-editor-table-dialog';
|
|
20
|
+
import { DocumentMarginPreset, DocumentPageMarginSide, DocumentPageMargins, DocumentPageOrientation, DocumentPageSize } from './page/document-editor-pages';
|
|
21
|
+
type DocumentRibbonTab = 'home' | 'insert' | 'layout' | 'tableDesign' | 'tableLayout';
|
|
22
|
+
interface DocumentRibbonTabOption {
|
|
23
|
+
value: DocumentRibbonTab;
|
|
24
|
+
label: string;
|
|
25
|
+
contextual: boolean;
|
|
26
|
+
}
|
|
27
|
+
type DocumentRibbonCommand = 'undo' | 'redo' | 'bold' | 'italic' | 'underline' | 'strike' | 'subscript' | 'superscript' | 'bulletList' | 'orderedList' | 'horizontalRule' | 'addRowBefore' | 'addRowAfter' | 'addColumnBefore' | 'addColumnAfter' | 'deleteRow' | 'deleteColumn' | 'deleteTable' | 'mergeCells' | 'splitCell';
|
|
28
|
+
/**
|
|
29
|
+
* Editor de documentos (HTML), usable con `[formControl]`.
|
|
30
|
+
*
|
|
31
|
+
* Objetivo: que sea un editor tipo Word (documento con formato completo). La base es Tiptap OSS
|
|
32
|
+
* (`@flogeez/angular-tiptap-editor`) y se irá adaptando a nuestras necesidades: de momento este
|
|
33
|
+
* componente es solo una envoltura — el valor del control es el HTML del documento y el
|
|
34
|
+
* comportamiento lo resuelve la librería, que aún NO cubre lo propio de Word (páginas con saltos,
|
|
35
|
+
* reglas, márgenes, encabezado y pie, tamaño de hoja).
|
|
36
|
+
* Las pantallas consumen únicamente `<document-editor>` y sus inputs: cada adaptación (extensiones
|
|
37
|
+
* de Tiptap, toolbar, estilos) se agrega aquí adentro, sin tocar a los consumidores.
|
|
38
|
+
*/
|
|
39
|
+
export declare class CbmDocumentEditorComponent implements ControlValueAccessor {
|
|
40
|
+
private readonly destroyRef;
|
|
41
|
+
private readonly host;
|
|
42
|
+
private readonly injector;
|
|
43
|
+
private readonly i18nService;
|
|
44
|
+
private readonly notificationService;
|
|
45
|
+
constructor(destroyRef: DestroyRef, host: ElementRef<HTMLElement>, injector: Injector, i18nService: AteI18nService, notificationService: CbmNotificationService);
|
|
46
|
+
placeholder: import("@angular/core").InputSignal<string>;
|
|
47
|
+
/** Alto mínimo y máximo (px) de la ventana del lienzo; la hoja se desplaza dentro de ella. */
|
|
48
|
+
minHeight: import("@angular/core").InputSignal<number>;
|
|
49
|
+
maxHeight: import("@angular/core").InputSignal<number>;
|
|
50
|
+
/** Muestra en la cinta (pestaña "Disposición") el tamaño, la orientación y los márgenes de la hoja. */
|
|
51
|
+
showPageSetup: import("@angular/core").InputSignal<boolean>;
|
|
52
|
+
/** Ancho (px) del panel lateral cuando está desplegado; el lienzo ocupa el resto. */
|
|
53
|
+
sidePanelWidth: import("@angular/core").InputSignal<number>;
|
|
54
|
+
/** Activa el menú de clic derecho sobre el texto seleccionado, con la opción "Convertir a nodo". */
|
|
55
|
+
enableNodeConversion: import("@angular/core").InputSignal<boolean>;
|
|
56
|
+
/** Muestra las herramientas de edición (pestañas "Inicio", "Insertar", "Diseño de tabla" y "Disposición de tabla" de la cinta, menús y asas de tabla). Con `false` queda solo el lienzo. */
|
|
57
|
+
showTools: import("@angular/core").InputSignal<boolean>;
|
|
58
|
+
/** Muestra el botón para importar un documento de Word (.docx) al editor. Requiere `showTools`. */
|
|
59
|
+
enableWordImport: import("@angular/core").InputSignal<boolean>;
|
|
60
|
+
/** Sobrescribe la configuración estándar del editor (se aplica encima de los valores por defecto). */
|
|
61
|
+
config: import("@angular/core").InputSignal<AteEditorConfig>;
|
|
62
|
+
/**
|
|
63
|
+
* Variables tal como las entrega el backend del consumidor (categorías con campos o subcategorías); el editor las
|
|
64
|
+
* normaliza con `variablesConfig`. `null`/`undefined`: todavía no llegan. `[]`: llegaron y no hay ninguna.
|
|
65
|
+
*/
|
|
66
|
+
variables: import("@angular/core").InputSignal<readonly DocumentSchemaCategorySource[] | null | undefined>;
|
|
67
|
+
/** Estado de la carga de `variables`, que lleva el consumidor. Sin enlazar se deduce de `variables`. */
|
|
68
|
+
variablesStatus: import("@angular/core").InputSignal<DocumentVariablesStatus | null | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* Reglas para normalizar `variables`: cada clave que se pasa reemplaza entera a la de `DEFAULT_DOCUMENT_VARIABLES_CONFIG`.
|
|
71
|
+
* Debe ser una referencia estable (una constante), no un objeto nuevo en cada detección de cambios.
|
|
72
|
+
*/
|
|
73
|
+
variablesConfig: import("@angular/core").InputSignal<Partial<DocumentVariablesConfig> | null | undefined>;
|
|
74
|
+
sidePanelOpen: import("@angular/core").ModelSignal<boolean>;
|
|
75
|
+
fullscreen: import("@angular/core").ModelSignal<boolean>;
|
|
76
|
+
pageSize: import("@angular/core").ModelSignal<DocumentPageSize>;
|
|
77
|
+
orientation: import("@angular/core").ModelSignal<DocumentPageOrientation>;
|
|
78
|
+
margins: import("@angular/core").ModelSignal<DocumentPageMargins>;
|
|
79
|
+
defaults: import("@angular/core").ModelSignal<DocumentDefaults>;
|
|
80
|
+
/**
|
|
81
|
+
* El editor necesita que se vuelvan a pedir las variables: se pulsó "Reintentar" en un panel o se pidió la vista
|
|
82
|
+
* previa después de una carga fallida. El consumidor las pide y actualiza `variables` y `variablesStatus`.
|
|
83
|
+
*/
|
|
84
|
+
variablesRetry: import("@angular/core").OutputEmitterRef<void>;
|
|
85
|
+
readonly zoomMin = 25;
|
|
86
|
+
readonly zoomMax = 200;
|
|
87
|
+
private readonly editorId;
|
|
88
|
+
readonly fontFamilyInputId: string;
|
|
89
|
+
readonly fontSizeInputId: string;
|
|
90
|
+
readonly marginsPopoverId: string;
|
|
91
|
+
readonly blockStyleInputId: string;
|
|
92
|
+
readonly ribbonPanelId: string;
|
|
93
|
+
readonly popoverIds: {
|
|
94
|
+
readonly textCase: `document-editor-text-case-${number}`;
|
|
95
|
+
readonly highlight: `document-editor-highlight-${number}`;
|
|
96
|
+
readonly fontColor: `document-editor-font-color-${number}`;
|
|
97
|
+
readonly lineSpacing: `document-editor-line-spacing-${number}`;
|
|
98
|
+
readonly table: `document-editor-table-${number}`;
|
|
99
|
+
readonly link: `document-editor-link-${number}`;
|
|
100
|
+
readonly symbol: `document-editor-symbol-${number}`;
|
|
101
|
+
readonly tableDelete: `document-editor-table-delete-${number}`;
|
|
102
|
+
readonly shading: `document-editor-shading-${number}`;
|
|
103
|
+
readonly borders: `document-editor-borders-${number}`;
|
|
104
|
+
readonly tableStyles: `document-editor-table-styles-${number}`;
|
|
105
|
+
readonly borderStyle: `document-editor-border-style-${number}`;
|
|
106
|
+
readonly borderWeight: `document-editor-border-weight-${number}`;
|
|
107
|
+
readonly borderColor: `document-editor-border-color-${number}`;
|
|
108
|
+
readonly tableAutofit: `document-editor-table-autofit-${number}`;
|
|
109
|
+
readonly tableWrap: `document-editor-table-wrap-${number}`;
|
|
110
|
+
readonly tableSelect: `document-editor-table-select-${number}`;
|
|
111
|
+
readonly cellMargins: `document-editor-cell-margins-${number}`;
|
|
112
|
+
readonly orientation: `document-editor-orientation-${number}`;
|
|
113
|
+
readonly pageSize: `document-editor-page-size-menu-${number}`;
|
|
114
|
+
readonly breaks: `document-editor-breaks-${number}`;
|
|
115
|
+
};
|
|
116
|
+
readonly tableLookOptions: readonly {
|
|
117
|
+
flag: TableLookFlag;
|
|
118
|
+
label: string;
|
|
119
|
+
}[];
|
|
120
|
+
readonly autofitModes: readonly {
|
|
121
|
+
value: DocumentTableAutofit;
|
|
122
|
+
label: string;
|
|
123
|
+
hint: string;
|
|
124
|
+
icon: string;
|
|
125
|
+
}[];
|
|
126
|
+
readonly tableSelectOptions: readonly import("./tables/document-editor-table-select").DocumentTableSelectOption[];
|
|
127
|
+
readonly tableWrapOptions: ReadonlyArray<{
|
|
128
|
+
value: DocumentTableFloat | null;
|
|
129
|
+
label: string;
|
|
130
|
+
icon: string;
|
|
131
|
+
hint: string;
|
|
132
|
+
}>;
|
|
133
|
+
readonly wordImportAccept = ".docx,.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.wordprocessingml.template";
|
|
134
|
+
readonly fonts: readonly import("./format/document-editor-typography").DocumentFont[];
|
|
135
|
+
readonly fontSizes: readonly number[];
|
|
136
|
+
readonly blockStyles: readonly {
|
|
137
|
+
value: DocumentBlockStyle;
|
|
138
|
+
label: string;
|
|
139
|
+
fontSize: string;
|
|
140
|
+
fontWeight: number;
|
|
141
|
+
}[];
|
|
142
|
+
readonly textCases: readonly {
|
|
143
|
+
value: DocumentTextCase;
|
|
144
|
+
label: string;
|
|
145
|
+
}[];
|
|
146
|
+
readonly lineSpacings: readonly {
|
|
147
|
+
value: number;
|
|
148
|
+
label: string;
|
|
149
|
+
}[];
|
|
150
|
+
readonly marginFields: readonly {
|
|
151
|
+
side: DocumentPageMarginSide;
|
|
152
|
+
label: string;
|
|
153
|
+
}[];
|
|
154
|
+
readonly marginPresets: {
|
|
155
|
+
hint: string;
|
|
156
|
+
value: string;
|
|
157
|
+
label: string;
|
|
158
|
+
margins: DocumentPageMargins;
|
|
159
|
+
}[];
|
|
160
|
+
readonly pageSizeMenu: {
|
|
161
|
+
value: DocumentPageSize;
|
|
162
|
+
label: string;
|
|
163
|
+
dimensions: string;
|
|
164
|
+
}[];
|
|
165
|
+
private readonly menuElement;
|
|
166
|
+
private readonly marginsElement;
|
|
167
|
+
private readonly modalConfirm;
|
|
168
|
+
private readonly tableDialog;
|
|
169
|
+
protected readonly theme: import("@angular/core").WritableSignal<"light" | "dark">;
|
|
170
|
+
/** Zoom de la hoja en % (solo de vista: no se guarda con el documento). */
|
|
171
|
+
zoom: import("@angular/core").WritableSignal<number>;
|
|
172
|
+
/** Editor Tiptap ya creado (lo necesita el panel de nodos para leer y modificar el documento). */
|
|
173
|
+
tiptap: import("@angular/core").WritableSignal<Editor | null>;
|
|
174
|
+
/** Nodo cuyas propiedades muestra el panel lateral. */
|
|
175
|
+
activeNodeId: import("@angular/core").WritableSignal<string | null>;
|
|
176
|
+
/** Tabla de listado que muestra el panel lateral (en lugar de un nodo): asistente o fila repetible. */
|
|
177
|
+
listPanel: import("@angular/core").WritableSignal<{
|
|
178
|
+
mode: DocumentListPanelMode;
|
|
179
|
+
position: number;
|
|
180
|
+
collection: DocumentListCollection | null;
|
|
181
|
+
} | null>;
|
|
182
|
+
/** El clic derecho fue dentro de una fila de tabla (se ofrece "Fila repetible"). */
|
|
183
|
+
menuInTableRow: import("@angular/core").WritableSignal<boolean>;
|
|
184
|
+
/** Vista previa: la hoja de solo lectura llena con datos de ejemplo, en lugar del lienzo. */
|
|
185
|
+
previewOpen: import("@angular/core").WritableSignal<boolean>;
|
|
186
|
+
/** HTML de la vista previa (la plantilla ya llena). */
|
|
187
|
+
previewHtml: import("@angular/core").WritableSignal<string>;
|
|
188
|
+
/** Menú de clic derecho: "insert" (submenú Nodos) o "remove" (sobre un nodo existente). */
|
|
189
|
+
menuMode: import("@angular/core").WritableSignal<"remove" | "insert">;
|
|
190
|
+
/** Hay un texto seleccionado que se puede convertir en nodo de texto. */
|
|
191
|
+
menuCanConvertText: import("@angular/core").WritableSignal<boolean>;
|
|
192
|
+
submenuOpen: import("@angular/core").WritableSignal<boolean>;
|
|
193
|
+
submenuSide: import("@angular/core").WritableSignal<"left" | "right">;
|
|
194
|
+
/** Lista de márgenes de la barra desplegada (para `aria-expanded` del botón). */
|
|
195
|
+
marginsOpen: import("@angular/core").WritableSignal<boolean>;
|
|
196
|
+
/** Fuente del texto donde está el cursor cuando no es ninguna de la lista (se muestra como sugerencia). */
|
|
197
|
+
unknownFontName: import("@angular/core").WritableSignal<string | null>;
|
|
198
|
+
/** Se está leyendo un documento de Word para importarlo. */
|
|
199
|
+
importing: import("@angular/core").WritableSignal<boolean>;
|
|
200
|
+
/** El formulario deshabilitó el editor: no se puede importar. */
|
|
201
|
+
formDisabled: import("@angular/core").WritableSignal<boolean>;
|
|
202
|
+
/** El documento tiene encabezado / pie de página. */
|
|
203
|
+
hasHeader: import("@angular/core").WritableSignal<boolean>;
|
|
204
|
+
hasFooter: import("@angular/core").WritableSignal<boolean>;
|
|
205
|
+
/** El cursor está dentro del encabezado o del pie (donde se pueden insertar los campos de página). */
|
|
206
|
+
inRegion: import("@angular/core").WritableSignal<boolean>;
|
|
207
|
+
/** Páginas que ocuparía el documento (aproximado: la hoja no se pagina, ver `observePageCount`). */
|
|
208
|
+
pageCount: import("@angular/core").WritableSignal<number>;
|
|
209
|
+
/** Formato del texto donde está el cursor: marca los botones activos de la cinta (como en Word). */
|
|
210
|
+
formatState: import("@angular/core").WritableSignal<DocumentFormatState>;
|
|
211
|
+
private readonly selectedTab;
|
|
212
|
+
/** Menú desplegable de la cinta abierto (para `aria-expanded` y el resaltado de su botón). */
|
|
213
|
+
openPopover: import("@angular/core").WritableSignal<string | null>;
|
|
214
|
+
lastFontColor: import("@angular/core").WritableSignal<string>;
|
|
215
|
+
lastHighlight: import("@angular/core").WritableSignal<string>;
|
|
216
|
+
lastShading: import("@angular/core").WritableSignal<string>;
|
|
217
|
+
/** Pluma de los bordes (estilo, grosor y color de la línea): la usan el menú "Bordes" y "Copiar borde". Persiste hasta que se elija otra. */
|
|
218
|
+
borderPen: import("@angular/core").WritableSignal<DocumentBorderPen>;
|
|
219
|
+
/** "Copiar borde" activo: cada clic sobre el borde de una celda le pone la pluma (lo apaga Esc o volver a pulsar el botón). */
|
|
220
|
+
borderPainterActive: import("@angular/core").WritableSignal<boolean>;
|
|
221
|
+
/**
|
|
222
|
+
* Disposición de la tabla del cursor (alto, ancho, alineación, márgenes…) para los campos de "Disposición de tabla".
|
|
223
|
+
* Aparte de `formatState`: es un objeto anidado, que su igualdad por `===` redibujaría en cada transacción, y solo se
|
|
224
|
+
* lee con esa pestaña a la vista (recorre las celdas y mide columnas del DOM).
|
|
225
|
+
*/
|
|
226
|
+
tableLayout: import("@angular/core").WritableSignal<DocumentTableLayoutState>;
|
|
227
|
+
/** "Copiar formato" activo: el formato copiado, que se aplica al próximo texto que se seleccione. */
|
|
228
|
+
painting: import("@angular/core").WritableSignal<DocumentCapturedFormat | null>;
|
|
229
|
+
/** El panel lateral muestra "Buscar y reemplazar" (en lugar de un nodo o una tabla de listado). */
|
|
230
|
+
findPanelOpen: import("@angular/core").WritableSignal<boolean>;
|
|
231
|
+
/** Categoría de la fila repetible donde está el cursor (el panel de variables lo avisa en su grupo). */
|
|
232
|
+
cursorRowCollection: import("@angular/core").WritableSignal<string | null>;
|
|
233
|
+
private menuPosition;
|
|
234
|
+
private removeNodeId;
|
|
235
|
+
pageDimensions: import("@angular/core").Signal<{
|
|
236
|
+
width: number;
|
|
237
|
+
height: number;
|
|
238
|
+
}>;
|
|
239
|
+
fontSizeCss: import("@angular/core").Signal<string>;
|
|
240
|
+
spaceAfterCss: import("@angular/core").Signal<string>;
|
|
241
|
+
lineHeightCss: import("@angular/core").Signal<number>;
|
|
242
|
+
sheetMargins: import("@angular/core").Signal<DocumentPageMargins>;
|
|
243
|
+
activeMarginPreset: import("@angular/core").Signal<string | null>;
|
|
244
|
+
private readonly inTable;
|
|
245
|
+
ribbonTabs: import("@angular/core").Signal<readonly DocumentRibbonTabOption[]>;
|
|
246
|
+
activeTab: import("@angular/core").Signal<DocumentRibbonTab | null>;
|
|
247
|
+
currentLineSpacing: import("@angular/core").Signal<number>;
|
|
248
|
+
currentSpaceBefore: import("@angular/core").Signal<number>;
|
|
249
|
+
currentSpaceAfter: import("@angular/core").Signal<number>;
|
|
250
|
+
indentLeftCm: import("@angular/core").Signal<number>;
|
|
251
|
+
indentRightCm: import("@angular/core").Signal<number>;
|
|
252
|
+
sheetTextWidthCm: import("@angular/core").Signal<number>;
|
|
253
|
+
tableHasStyle: import("@angular/core").Signal<boolean>;
|
|
254
|
+
tableWrap: import("@angular/core").Signal<{
|
|
255
|
+
value: DocumentTableFloat | null;
|
|
256
|
+
label: string;
|
|
257
|
+
icon: string;
|
|
258
|
+
hint: string;
|
|
259
|
+
}>;
|
|
260
|
+
textDirection: import("@angular/core").Signal<{
|
|
261
|
+
value: import("./tables/layout/document-editor-table-layout").DocumentCellTextDirection;
|
|
262
|
+
label: string;
|
|
263
|
+
icon: string;
|
|
264
|
+
}>;
|
|
265
|
+
private readonly tiptapExtensions;
|
|
266
|
+
editorConfig: import("@angular/core").Signal<AteEditorConfig>;
|
|
267
|
+
previewConfig: import("@angular/core").Signal<AteEditorConfig>;
|
|
268
|
+
private readonly resolvedVariablesConfig;
|
|
269
|
+
protected readonly catalog: import("@angular/core").Signal<DocumentVariablesCatalog>;
|
|
270
|
+
protected readonly resolvedVariablesStatus: import("@angular/core").Signal<DocumentVariablesStatus>;
|
|
271
|
+
editorControl: FormControl<string>;
|
|
272
|
+
fontFamilyControl: FormControl<string | null>;
|
|
273
|
+
fontSizeControl: FormControl<number | null>;
|
|
274
|
+
blockStyleControl: FormControl<DocumentBlockStyle | null>;
|
|
275
|
+
marginsForm: FormGroup<{
|
|
276
|
+
top: FormControl<string>;
|
|
277
|
+
right: FormControl<string>;
|
|
278
|
+
bottom: FormControl<string>;
|
|
279
|
+
left: FormControl<string>;
|
|
280
|
+
}>;
|
|
281
|
+
private readonly _lockPageScrollEffect;
|
|
282
|
+
private readonly _syncMarginsFormEffect;
|
|
283
|
+
private readonly _remeasurePagesEffect;
|
|
284
|
+
private variablesPanelStarted;
|
|
285
|
+
private readonly _openVariablesPanelEffect;
|
|
286
|
+
private readonly _resetFindPanelEffect;
|
|
287
|
+
private readonly _resetPopoversEffect;
|
|
288
|
+
private readonly _stopBorderPainterEffect;
|
|
289
|
+
private readonly _syncTableLayoutEffect;
|
|
290
|
+
private onChange;
|
|
291
|
+
onTouched: () => void;
|
|
292
|
+
writeValue(value: string | null): void;
|
|
293
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
294
|
+
registerOnTouched(fn: () => void): void;
|
|
295
|
+
setDisabledState(isDisabled: boolean): void;
|
|
296
|
+
setZoom(value: number): void;
|
|
297
|
+
zoomOut(): void;
|
|
298
|
+
zoomIn(): void;
|
|
299
|
+
onZoomInput(event: Event): void;
|
|
300
|
+
selectTab(tab: DocumentRibbonTab): void;
|
|
301
|
+
ribbonTabId(tab: DocumentRibbonTab): string;
|
|
302
|
+
onRibbonTabKeydown(event: KeyboardEvent): void;
|
|
303
|
+
keepEditorFocus(event: MouseEvent): void;
|
|
304
|
+
run(command: (chain: ChainedCommands) => ChainedCommands): void;
|
|
305
|
+
exec(command: DocumentRibbonCommand): void;
|
|
306
|
+
align(value: DocumentTextAlign): void;
|
|
307
|
+
private withEditor;
|
|
308
|
+
growFont(): void;
|
|
309
|
+
shrinkFont(): void;
|
|
310
|
+
applyTextCase(mode: DocumentTextCase): void;
|
|
311
|
+
clearFormat(): void;
|
|
312
|
+
togglePainter(): void;
|
|
313
|
+
onEditorMouseUp(): void;
|
|
314
|
+
applyHighlight(color: string | null): void;
|
|
315
|
+
applyFontColor(color: string | null): void;
|
|
316
|
+
increaseIndent(): void;
|
|
317
|
+
decreaseIndent(): void;
|
|
318
|
+
applyLineSpacing(multiple: number): void;
|
|
319
|
+
isCurrentLineSpacing(multiple: number): boolean;
|
|
320
|
+
setIndent(side: 'left' | 'right', { value, returnFocus }: DocumentSpinnerCommit): void;
|
|
321
|
+
setSpacing(side: 'before' | 'after', { value, returnFocus }: DocumentSpinnerCommit): void;
|
|
322
|
+
toggleParagraphSpace(side: 'before' | 'after'): void;
|
|
323
|
+
insertTable({ rows, cols }: {
|
|
324
|
+
rows: number;
|
|
325
|
+
cols: number;
|
|
326
|
+
}): void;
|
|
327
|
+
openTableDialog(): void;
|
|
328
|
+
insertCustomTable({ rows, cols, options }: DocumentTableRequest): void;
|
|
329
|
+
insertSymbol(symbol: string): void;
|
|
330
|
+
applyLink(value: string): boolean;
|
|
331
|
+
removeLink(): void;
|
|
332
|
+
applyShading(color: string | null): void;
|
|
333
|
+
pickTableStyle(styleId: string | null): void;
|
|
334
|
+
reapplyTableStyle(): void;
|
|
335
|
+
setTableLook(flag: TableLookFlag, event: Event): void;
|
|
336
|
+
setBorderStyle(style: DocumentBorderLineStyle): void;
|
|
337
|
+
setBorderWidth(width: number): void;
|
|
338
|
+
setBorderColor(color: string | null): void;
|
|
339
|
+
private updateBorderPen;
|
|
340
|
+
applyBorders(target: DocumentBorderTarget): void;
|
|
341
|
+
toggleBorderPainter(): void;
|
|
342
|
+
setAutofit(mode: DocumentTableAutofit): void;
|
|
343
|
+
selectPart(part: DocumentTableSelectPart): void;
|
|
344
|
+
setRowHeightCm({ value, returnFocus }: DocumentSpinnerCommit): void;
|
|
345
|
+
setColumnWidthCm({ value, returnFocus }: DocumentSpinnerCommit): void;
|
|
346
|
+
distributeSelectedRows(): void;
|
|
347
|
+
distributeSelectedColumns(): void;
|
|
348
|
+
pickAlignment({ vertical, horizontal }: DocumentCellAlignmentChoice): void;
|
|
349
|
+
cycleTextDirection(): void;
|
|
350
|
+
applyCellMargins({ margins, scope }: DocumentCellMarginsRequest): void;
|
|
351
|
+
applyTableWrap(float: DocumentTableFloat | null): void;
|
|
352
|
+
setTableOffset({ value, returnFocus }: DocumentSpinnerCommit): void;
|
|
353
|
+
onEditorContextMenu(event: MouseEvent): void;
|
|
354
|
+
private showMenuAt;
|
|
355
|
+
private closeMenu;
|
|
356
|
+
toggleSubmenu(): void;
|
|
357
|
+
onEditorCreated(editor: Editor): void;
|
|
358
|
+
private syncFormatState;
|
|
359
|
+
private syncTableLayout;
|
|
360
|
+
private syncBorderPainter;
|
|
361
|
+
private syncRowCollection;
|
|
362
|
+
private syncRegionState;
|
|
363
|
+
goToRegion(kind: DocumentRegionKind): void;
|
|
364
|
+
deleteRegion(kind: DocumentRegionKind): void;
|
|
365
|
+
addPageBreak(): void;
|
|
366
|
+
addPageField(field: DocumentFieldKind): void;
|
|
367
|
+
private pageObserver;
|
|
368
|
+
private observePageCount;
|
|
369
|
+
private measurePageCount;
|
|
370
|
+
private syncFontControls;
|
|
371
|
+
private applyFontFamily;
|
|
372
|
+
private applyFontSize;
|
|
373
|
+
readonly addFontSize: (term: string) => number | null;
|
|
374
|
+
readonly fontSizeTerm: import("@angular/core").WritableSignal<string>;
|
|
375
|
+
readonly isFontSizeTermValid: import("@angular/core").Signal<boolean>;
|
|
376
|
+
onWordFileSelected(event: Event): Promise<void>;
|
|
377
|
+
private applyWordImport;
|
|
378
|
+
private importSnapshot;
|
|
379
|
+
private readSheet;
|
|
380
|
+
private syncSheetWithHistory;
|
|
381
|
+
applyMarginPreset(preset: DocumentMarginPreset): void;
|
|
382
|
+
commitMargins(): void;
|
|
383
|
+
private fitMarginAxis;
|
|
384
|
+
onMarginsBeforeToggle(event: Event, trigger: HTMLElement): void;
|
|
385
|
+
positionPopover(event: Event, trigger: HTMLElement, menu: HTMLElement): void;
|
|
386
|
+
private writeMarginsForm;
|
|
387
|
+
private toCentimeters;
|
|
388
|
+
private describeMargins;
|
|
389
|
+
addTextNode(): void;
|
|
390
|
+
private blockImageFiles;
|
|
391
|
+
addListTable(): void;
|
|
392
|
+
editRowRepeat(): void;
|
|
393
|
+
openListTable(collection?: DocumentListCollection | null): void;
|
|
394
|
+
openRowRepeat(): void;
|
|
395
|
+
private showNode;
|
|
396
|
+
private showListPanel;
|
|
397
|
+
openFind(): void;
|
|
398
|
+
closeFind(): void;
|
|
399
|
+
onListPanelDone(): void;
|
|
400
|
+
backToVariables(): void;
|
|
401
|
+
/** El panel lateral muestra las variables (y no un nodo, una tabla de listado ni la búsqueda). */
|
|
402
|
+
variablesVisible: import("@angular/core").Signal<boolean>;
|
|
403
|
+
toggleVariables(): void;
|
|
404
|
+
insertVariableFromPanel(variable: DocumentVariable): void;
|
|
405
|
+
reloadVariables(): void;
|
|
406
|
+
insertListTableFromPanel(collection: DocumentListCollection): void;
|
|
407
|
+
chooseListColumns(collection: DocumentListCollection): void;
|
|
408
|
+
togglePreview(): void;
|
|
409
|
+
removeNode(): void;
|
|
410
|
+
private variablesReady;
|
|
411
|
+
onEditorMouseDown(event: MouseEvent): void;
|
|
412
|
+
onDocumentMouseDown(event: MouseEvent): void;
|
|
413
|
+
toggleFullscreen(): void;
|
|
414
|
+
onEscape(): void;
|
|
415
|
+
fitToWidth(): void;
|
|
416
|
+
private toCm;
|
|
417
|
+
onContentChange(html: string): void;
|
|
418
|
+
private detectTheme;
|
|
419
|
+
private observeShellTheme;
|
|
420
|
+
}
|
|
421
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Editor, Extension } from '@tiptap/core';
|
|
2
|
+
export interface DocumentSearchMatch {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
}
|
|
6
|
+
export interface DocumentSearchState {
|
|
7
|
+
query: string;
|
|
8
|
+
caseSensitive: boolean;
|
|
9
|
+
matches: DocumentSearchMatch[];
|
|
10
|
+
/** Índice de la coincidencia actual (0 si no hay ninguna). */
|
|
11
|
+
current: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DocumentSearchOptions {
|
|
14
|
+
/** Se llama con Ctrl+F (Cmd+F) en el lienzo; sin él el atajo queda para el navegador. */
|
|
15
|
+
onOpen: (() => void) | null;
|
|
16
|
+
}
|
|
17
|
+
export declare const DocumentSearch: Extension<DocumentSearchOptions, any>;
|
|
18
|
+
export declare function getSearchState(editor: Editor): DocumentSearchState;
|
|
19
|
+
export declare function setSearchQuery(editor: Editor, query: string, caseSensitive: boolean): void;
|
|
20
|
+
export declare function goToMatch(editor: Editor, direction: 1 | -1): void;
|
|
21
|
+
export declare function replaceCurrentMatch(editor: Editor, replacement: string): void;
|
|
22
|
+
export declare function replaceAllMatches(editor: Editor, replacement: string): number;
|
|
23
|
+
export declare function clearSearch(editor: Editor): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DestroyRef, ElementRef } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { Editor } from '@tiptap/core';
|
|
4
|
+
import { DocumentSearchState } from '../document-editor-search';
|
|
5
|
+
/**
|
|
6
|
+
* Contenido del panel lateral de `document-editor` para buscar y reemplazar (Ctrl+F). Busca mientras se escribe,
|
|
7
|
+
* resalta todas las coincidencias en el lienzo y marca la actual; Intro pasa a la siguiente y Mayús+Intro a la
|
|
8
|
+
* anterior, sin sacar el foco del campo. Al cerrarse (o destruirse) se quita el resaltado.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DocumentEditorFindPanel {
|
|
11
|
+
private readonly destroyRef;
|
|
12
|
+
private readonly host;
|
|
13
|
+
constructor(destroyRef: DestroyRef, host: ElementRef<HTMLElement>);
|
|
14
|
+
editor: import("@angular/core").InputSignal<Editor>;
|
|
15
|
+
/** Se pidió cerrar el panel (botón Cerrar o Esc). */
|
|
16
|
+
closed: import("@angular/core").OutputEmitterRef<void>;
|
|
17
|
+
private readonly panelId;
|
|
18
|
+
readonly queryInputId: string;
|
|
19
|
+
readonly caseSensitiveInputId: string;
|
|
20
|
+
readonly replacementInputId: string;
|
|
21
|
+
private readonly queryInput;
|
|
22
|
+
searchState: import("@angular/core").WritableSignal<DocumentSearchState>;
|
|
23
|
+
/** Cuántas coincidencias cambió "Reemplazar todo"; se muestra hasta la siguiente búsqueda. */
|
|
24
|
+
replacedCount: import("@angular/core").WritableSignal<number | null>;
|
|
25
|
+
hasMatches: import("@angular/core").Signal<boolean>;
|
|
26
|
+
status: import("@angular/core").Signal<string | null>;
|
|
27
|
+
form: FormGroup<{
|
|
28
|
+
query: FormControl<string>;
|
|
29
|
+
caseSensitive: FormControl<boolean>;
|
|
30
|
+
replacement: FormControl<string>;
|
|
31
|
+
}>;
|
|
32
|
+
private readonly _syncWithEditorEffect;
|
|
33
|
+
private keepTypedText;
|
|
34
|
+
private search;
|
|
35
|
+
private prefillFromSelection;
|
|
36
|
+
private focusQuery;
|
|
37
|
+
previous(): void;
|
|
38
|
+
next(): void;
|
|
39
|
+
replace(): void;
|
|
40
|
+
replaceAll(): void;
|
|
41
|
+
close(): void;
|
|
42
|
+
onQueryKeydown(event: KeyboardEvent): void;
|
|
43
|
+
onReplacementKeydown(event: KeyboardEvent): void;
|
|
44
|
+
onKeydown(event: KeyboardEvent): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Editor } from '@tiptap/core';
|
|
2
|
+
import type { Mark as ProseMirrorMark } from '@tiptap/pm/model';
|
|
3
|
+
import { type Transaction } from '@tiptap/pm/state';
|
|
4
|
+
import { type DocumentBlockStyle, type DocumentTableFloat } from './document-editor-format-state';
|
|
5
|
+
export type DocumentTextCase = 'sentence' | 'lower' | 'upper' | 'title' | 'toggle';
|
|
6
|
+
export interface DocumentCapturedFormat {
|
|
7
|
+
/** Marcas del texto (negrita, fuente, tamaño, color…), sin nodos de datos ni enlaces. */
|
|
8
|
+
marks: readonly ProseMirrorMark[];
|
|
9
|
+
/** Formato del párrafo: alineación, interlineado, espaciado y sangrías. */
|
|
10
|
+
blockAttrs: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare const DOCUMENT_TABLE_BORDER_STYLE = "border: 0.5pt solid #000000";
|
|
13
|
+
export declare function runInTransaction(editor: Editor, edit: (tr: Transaction) => void, focus?: boolean): void;
|
|
14
|
+
export declare function clearFormatting(editor: Editor): void;
|
|
15
|
+
export declare function changeTextCase(editor: Editor, mode: DocumentTextCase): void;
|
|
16
|
+
export declare function stepFontSize(current: number | null, direction: 1 | -1): number;
|
|
17
|
+
export declare function setLineSpacing(editor: Editor, wordMultiple: number | null): void;
|
|
18
|
+
export declare function setParagraphSpacing(editor: Editor, side: 'before' | 'after', points: number | null, focus?: boolean): void;
|
|
19
|
+
export declare function setParagraphIndent(editor: Editor, side: 'left' | 'right', points: number | null, focus?: boolean): void;
|
|
20
|
+
export declare function changeIndent(editor: Editor, direction: 1 | -1): void;
|
|
21
|
+
export declare function setBlockStyle(editor: Editor, style: DocumentBlockStyle): void;
|
|
22
|
+
export declare function captureFormat(editor: Editor): DocumentCapturedFormat;
|
|
23
|
+
export declare function applyFormat(editor: Editor, format: DocumentCapturedFormat): void;
|
|
24
|
+
export declare function setCellShading(editor: Editor, color: string | null): void;
|
|
25
|
+
export declare function setTableFloat(editor: Editor, float: DocumentTableFloat | null): void;
|
|
26
|
+
export declare function setTableFloatOffset(editor: Editor, centimeters: number, focus?: boolean): void;
|
|
27
|
+
export type DocumentTableWidthMode = 'window' | 'fixed' | 'content';
|
|
28
|
+
export interface DocumentTableOptions {
|
|
29
|
+
widthMode: DocumentTableWidthMode;
|
|
30
|
+
/** Ancho de cada columna (px); solo con `fixed`. */
|
|
31
|
+
columnWidth: number;
|
|
32
|
+
/** La primera fila es de encabezado (celdas `th`, en negrita). */
|
|
33
|
+
headerRow: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare function insertBorderedTable(editor: Editor, rows: number, cols: number, options?: DocumentTableOptions | null): void;
|
|
36
|
+
export declare function normalizeHref(value: string): string | null;
|
|
37
|
+
export declare function setLink(editor: Editor, href: string): void;
|
|
38
|
+
export declare function unsetLink(editor: Editor): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DocumentDefaults {
|
|
2
|
+
/** Lista de fuentes CSS del texto base. */
|
|
3
|
+
fontFamily: string;
|
|
4
|
+
/** Tamaño del texto base, en puntos. */
|
|
5
|
+
fontSize: number;
|
|
6
|
+
/** Interlineado como múltiplo del sencillo de Word (1 = sencillo, 1,15, 2…). */
|
|
7
|
+
lineHeight: number;
|
|
8
|
+
/** Espacio (pt) que hay debajo de cada párrafo. */
|
|
9
|
+
spaceAfter: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_DOCUMENT_DEFAULTS: DocumentDefaults;
|
|
12
|
+
export declare const WORD_SINGLE_LINE_FACTOR = 1.2;
|
|
13
|
+
export declare const toCssLineHeight: (wordMultiple: number) => number;
|
|
14
|
+
export declare function toDocumentDefaults(value: Partial<DocumentDefaults> | null | undefined): DocumentDefaults;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import { type TableLook } from '../tables/styles/document-editor-table-styles';
|
|
3
|
+
export type DocumentBlockStyle = 'paragraph' | 'heading1' | 'heading2' | 'heading3';
|
|
4
|
+
export type DocumentTextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
5
|
+
/** Lado hacia el que flota una tabla (el texto la rodea por el otro lado). */
|
|
6
|
+
export type DocumentTableFloat = 'left' | 'right';
|
|
7
|
+
export declare const POINTS_PER_CM: number;
|
|
8
|
+
export interface DocumentFormatState {
|
|
9
|
+
bold: boolean;
|
|
10
|
+
italic: boolean;
|
|
11
|
+
underline: boolean;
|
|
12
|
+
strike: boolean;
|
|
13
|
+
superscript: boolean;
|
|
14
|
+
subscript: boolean;
|
|
15
|
+
bulletList: boolean;
|
|
16
|
+
orderedList: boolean;
|
|
17
|
+
textAlign: DocumentTextAlign;
|
|
18
|
+
/** Estilo del bloque del cursor; `null` si es otro (un título 4, por ejemplo). */
|
|
19
|
+
blockStyle: DocumentBlockStyle | null;
|
|
20
|
+
/** Color del texto guardado en el documento (`null`: automático). */
|
|
21
|
+
color: string | null;
|
|
22
|
+
/** Color de resaltado (fondo del texto). */
|
|
23
|
+
backgroundColor: string | null;
|
|
24
|
+
/** Interlineado del párrafo como múltiplo de Word (1, 1.15…); `null` si usa el de la hoja. */
|
|
25
|
+
lineSpacing: number | null;
|
|
26
|
+
/** Espacio antes y después del párrafo en puntos; `null` si usa el de la hoja. */
|
|
27
|
+
spaceBefore: number | null;
|
|
28
|
+
spaceAfter: number | null;
|
|
29
|
+
/** Sangría izquierda y derecha del párrafo en puntos; `null` si no tiene. */
|
|
30
|
+
indentLeft: number | null;
|
|
31
|
+
indentRight: number | null;
|
|
32
|
+
linkHref: string | null;
|
|
33
|
+
hasSelection: boolean;
|
|
34
|
+
inTable: boolean;
|
|
35
|
+
/** Sombreado de la celda del cursor como `#RRGGBB` (`null`: sin color o fuera de una tabla). */
|
|
36
|
+
cellShading: string | null;
|
|
37
|
+
/** Ajuste del texto de la tabla del cursor (la más interna): lado hacia el que flota, o `null` si va en línea. */
|
|
38
|
+
tableFloat: DocumentTableFloat | null;
|
|
39
|
+
/** Distancia (cm) de la tabla flotante al borde del lado hacia el que flota; `null` si no flota. */
|
|
40
|
+
tableFloatOffsetCm: number | null;
|
|
41
|
+
/** Código del estilo de tabla aplicado a la tabla del cursor (ver `DOCUMENT_TABLE_STYLES`); `null` si no tiene o fuera de una tabla. */
|
|
42
|
+
tableStyle: string | null;
|
|
43
|
+
/** Opciones de estilo de la tabla del cursor (fila de encabezado, filas con bandas…); todas apagadas si no tiene estilo. */
|
|
44
|
+
tableLook: TableLook;
|
|
45
|
+
canUndo: boolean;
|
|
46
|
+
canRedo: boolean;
|
|
47
|
+
canMergeCells: boolean;
|
|
48
|
+
canSplitCell: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const EMPTY_FORMAT_STATE: DocumentFormatState;
|
|
51
|
+
export interface DocumentTableFloatMargins {
|
|
52
|
+
top: number;
|
|
53
|
+
right: number;
|
|
54
|
+
bottom: number;
|
|
55
|
+
left: number;
|
|
56
|
+
}
|
|
57
|
+
export interface DocumentTableFloatStyle {
|
|
58
|
+
float: DocumentTableFloat;
|
|
59
|
+
margins: DocumentTableFloatMargins;
|
|
60
|
+
}
|
|
61
|
+
export declare function readTableFloat(style: unknown): DocumentTableFloatStyle | null;
|
|
62
|
+
export declare function readFormatState(editor: Editor): DocumentFormatState;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
export interface DocumentFont {
|
|
3
|
+
/** Nombre que ve el usuario y con el que se reconoce la fuente en el documento. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Lista de fuentes CSS que se guarda en el HTML: la elegida y sus alternativas si no está instalada. */
|
|
6
|
+
family: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const DEFAULT_DOCUMENT_FONT: DocumentFont;
|
|
9
|
+
export declare const DEFAULT_DOCUMENT_FONT_SIZE = 11;
|
|
10
|
+
export declare const DOCUMENT_FONTS: readonly DocumentFont[];
|
|
11
|
+
export declare const DOCUMENT_FONT_SIZES: readonly number[];
|
|
12
|
+
export declare const formatFontSize: (points: number) => string;
|
|
13
|
+
export declare function firstFontFamily(css: string | null | undefined): string | null;
|
|
14
|
+
export declare function findDocumentFont(css: string | null | undefined): DocumentFont | undefined;
|
|
15
|
+
export declare function toFontSizePoints(css: string | null | undefined): number | null;
|
|
16
|
+
export declare function parseFontSizeTerm(term: string): number | null;
|
|
17
|
+
export interface DocumentSelectionFont {
|
|
18
|
+
/**
|
|
19
|
+
* Primera fuente de la lista CSS (puede no estar en `DOCUMENT_FONTS`); `null` si no se pudo leer o si la
|
|
20
|
+
* selección mezcla varias fuentes.
|
|
21
|
+
*/
|
|
22
|
+
family: string | null;
|
|
23
|
+
/** Tamaño en puntos; `null` si la selección mezcla varios tamaños. */
|
|
24
|
+
size: number | null;
|
|
25
|
+
}
|
|
26
|
+
export declare function readSelectionFont(editor: Editor, baseSize?: number): DocumentSelectionFont;
|