@cbm-common/cbm-types 0.0.366 → 0.0.368
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 +425 -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 +56 -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 +85 -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 +40 -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,12 @@
|
|
|
1
|
+
import { Editor, Extension } from '@tiptap/core';
|
|
2
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
+
import { DocumentListCollection, DocumentVariablesCatalog } from '../nodes/document-editor-node-types';
|
|
4
|
+
export declare const DocumentListRow: Extension<any, any>;
|
|
5
|
+
export interface DocumentTableRow {
|
|
6
|
+
position: number;
|
|
7
|
+
node: ProseMirrorNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function findTableRowAt(editor: Editor, position: number): DocumentTableRow | null;
|
|
10
|
+
export declare function getRowRepeat(editor: Editor, position: number): DocumentListCollection | null;
|
|
11
|
+
export declare function setRowRepeat(editor: Editor, position: number, collection: DocumentListCollection | null): void;
|
|
12
|
+
export declare function insertListTable(editor: Editor, position: number, collection: DocumentListCollection, columns: readonly string[], catalog: DocumentVariablesCatalog): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DestroyRef } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { Editor } from '@tiptap/core';
|
|
4
|
+
import { IGeneral } from '../../../../domain/models/general.domain.model';
|
|
5
|
+
import { DocumentListCollection, DocumentVariablesCatalog } from '../../nodes/document-editor-node-types';
|
|
6
|
+
export type DocumentListPanelMode = 'insert' | 'row';
|
|
7
|
+
/**
|
|
8
|
+
* Contenido del panel lateral de `document-editor` para las tablas de listado:
|
|
9
|
+
* - `insert`: asistente "Tabla de listado" (categoría y columnas) que inserta la tabla en `position`.
|
|
10
|
+
* - `row`: "Fila repetible", elige la categoría por la que se repite la fila de tabla que contiene `position`.
|
|
11
|
+
* Cualquier categoría del backend puede ser un listado; una tabla sin fila repetible es una tabla fija.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DocumentEditorListPanel {
|
|
14
|
+
private readonly destroyRef;
|
|
15
|
+
constructor(destroyRef: DestroyRef);
|
|
16
|
+
editor: import("@angular/core").InputSignal<Editor>;
|
|
17
|
+
mode: import("@angular/core").InputSignal<DocumentListPanelMode>;
|
|
18
|
+
/** Posición del documento donde se hizo clic derecho. */
|
|
19
|
+
position: import("@angular/core").InputSignal<number>;
|
|
20
|
+
/** Listado que se muestra elegido de inicio en el asistente (el del panel de variables). */
|
|
21
|
+
initialCollection: import("@angular/core").InputSignal<string | null>;
|
|
22
|
+
/** Catálogo del editor que contiene el panel. */
|
|
23
|
+
catalog: import("@angular/core").InputSignal<DocumentVariablesCatalog>;
|
|
24
|
+
/** Estado de la carga de las variables (las categorías las entrega el backend). */
|
|
25
|
+
status: import("@angular/core").InputSignal<IGeneral.STATUS>;
|
|
26
|
+
/** Se insertó la tabla: el panel ya no tiene nada que mostrar. */
|
|
27
|
+
done: import("@angular/core").OutputEmitterRef<void>;
|
|
28
|
+
/** Volver a pedir las categorías al backend (la carga falló). */
|
|
29
|
+
retry: import("@angular/core").OutputEmitterRef<void>;
|
|
30
|
+
private readonly panelId;
|
|
31
|
+
readonly collectionInputId: string;
|
|
32
|
+
readonly columnInputId: string;
|
|
33
|
+
readonly columnSearchId: string;
|
|
34
|
+
collection: import("@angular/core").WritableSignal<string | null>;
|
|
35
|
+
/** Columnas marcadas en el asistente (códigos de valor del nodo de ítem). */
|
|
36
|
+
columns: import("@angular/core").WritableSignal<string[]>;
|
|
37
|
+
/** Texto con el que se filtran las columnas (una categoría puede tener decenas de campos). */
|
|
38
|
+
columnQuery: import("@angular/core").WritableSignal<string>;
|
|
39
|
+
collectionOptions: import("@angular/core").Signal<{
|
|
40
|
+
value: DocumentListCollection;
|
|
41
|
+
label: string;
|
|
42
|
+
}[]>;
|
|
43
|
+
columnOptions: import("@angular/core").Signal<import("../../nodes/document-editor-node-types").DocumentNodeOption[]>;
|
|
44
|
+
visibleColumnOptions: import("@angular/core").Signal<import("../../nodes/document-editor-node-types").DocumentNodeOption[]>;
|
|
45
|
+
loadingCollections: import("@angular/core").Signal<boolean>;
|
|
46
|
+
loadFailed: import("@angular/core").Signal<boolean>;
|
|
47
|
+
collectionLabel: import("@angular/core").Signal<string>;
|
|
48
|
+
collectionControl: FormControl<string | null>;
|
|
49
|
+
private readonly _loadEffect;
|
|
50
|
+
private defaultColumns;
|
|
51
|
+
onColumnSearch(event: Event): void;
|
|
52
|
+
clearColumns(): void;
|
|
53
|
+
isColumnSelected(value: string): boolean;
|
|
54
|
+
toggleColumn(value: string, event: Event): void;
|
|
55
|
+
insertTable(): void;
|
|
56
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DocumentNodeBinding {
|
|
2
|
+
nodeType: string | null;
|
|
3
|
+
nodeValue: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface DocumentNodeAttrs extends DocumentNodeBinding {
|
|
6
|
+
nodeId: string;
|
|
7
|
+
/** Solo nodos de texto: el texto que tenía antes de convertirse en nodo. */
|
|
8
|
+
nodeOriginal: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function dataAttribute(key: keyof DocumentNodeAttrs): {
|
|
11
|
+
default: null;
|
|
12
|
+
parseHTML: (element: HTMLElement) => string | null;
|
|
13
|
+
renderHTML: (attributes: Record<string, unknown>) => {
|
|
14
|
+
[x: string]: {};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { DocumentFieldKind, DocumentSchemaCategory, DocumentVariablesConfig } from '../variables/document-editor-schema';
|
|
2
|
+
export interface DocumentNodeOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DocumentNodeCatalog {
|
|
7
|
+
/** Primer selector del panel: "Tipo de nodo" (las categorías). */
|
|
8
|
+
types: DocumentNodeOption[];
|
|
9
|
+
/** Segundo selector, según el tipo elegido: "Valor del nodo" (los campos de esa categoría). */
|
|
10
|
+
values: Record<string, DocumentNodeOption[]>;
|
|
11
|
+
}
|
|
12
|
+
/** Lo que ofrece UN editor. Inmutable: no se modifica ni se guarda a nivel de módulo. */
|
|
13
|
+
export interface DocumentVariablesCatalog {
|
|
14
|
+
/** Categorías normalizadas, en el orden del backend. */
|
|
15
|
+
readonly categories: readonly DocumentSchemaCategory[];
|
|
16
|
+
/** Opciones de los selectores del panel de nodo (categorías y, por categoría, campos). */
|
|
17
|
+
readonly nodes: DocumentNodeCatalog;
|
|
18
|
+
/** Definición de listado por nombre de categoría. */
|
|
19
|
+
readonly lists: Readonly<Record<string, DocumentListDefinition>>;
|
|
20
|
+
/** Un grupo por categoría con sus campos como variables (panel "Variables"). */
|
|
21
|
+
readonly variableGroups: readonly DocumentVariableGroup[];
|
|
22
|
+
/** Todas las etiquetas `nombre corto · campo` que el panel puede generar. */
|
|
23
|
+
readonly generatedLabels: ReadonlySet<string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Arma el catálogo de un editor con las categorías ya normalizadas (`toDocumentSchemaCategories`). Cada llamada
|
|
27
|
+
* devuelve un catálogo nuevo y no guarda nada: lo que arma un editor no lo ve otro editor de la misma página.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createDocumentVariablesCatalog(categories: readonly DocumentSchemaCategory[] | null | undefined, options?: Pick<Partial<DocumentVariablesConfig>, 'defaultListColumns'> | null): DocumentVariablesCatalog;
|
|
30
|
+
/** Catálogo sin variables: el de un editor al que todavía no le llegan. */
|
|
31
|
+
export declare const EMPTY_DOCUMENT_VARIABLES_CATALOG: DocumentVariablesCatalog;
|
|
32
|
+
/** Valores (campos) de un tipo de nodo (categoría). */
|
|
33
|
+
export declare function documentNodeValues(catalog: DocumentVariablesCatalog, type: string): DocumentNodeOption[];
|
|
34
|
+
export declare function toDocumentNodeType(catalog: DocumentVariablesCatalog, value: string | null | undefined): string | null;
|
|
35
|
+
export declare function findDocumentNodeValue(catalog: DocumentVariablesCatalog, type: string | null | undefined, value: string | null | undefined): DocumentNodeOption | null;
|
|
36
|
+
/** Para qué sirve el dato de un campo (texto, número, fecha…), según las categorías ya normalizadas. */
|
|
37
|
+
export declare function documentFieldKind(categories: readonly DocumentSchemaCategory[], type: string, value: string): DocumentFieldKind | null;
|
|
38
|
+
export type DocumentListCollection = string;
|
|
39
|
+
export interface DocumentListDefinition {
|
|
40
|
+
label: string;
|
|
41
|
+
/** Categoría de los nodos de texto que se llenan con cada ítem del listado (la misma que el listado). */
|
|
42
|
+
itemType: string;
|
|
43
|
+
/** Columnas (campos) que el asistente "Tabla de listado" marca de inicio. */
|
|
44
|
+
defaultColumns: string[];
|
|
45
|
+
}
|
|
46
|
+
export declare const documentListCollectionOptions: (catalog: DocumentVariablesCatalog) => {
|
|
47
|
+
value: DocumentListCollection;
|
|
48
|
+
label: string;
|
|
49
|
+
}[];
|
|
50
|
+
/** Columnas (campos) que el asistente "Tabla de listado" marca de inicio para un listado. */
|
|
51
|
+
export declare function documentListDefaultColumns(catalog: DocumentVariablesCatalog, collection: DocumentListCollection): string[];
|
|
52
|
+
export declare function toDocumentListCollection(value: string | null | undefined): DocumentListCollection | null;
|
|
53
|
+
/** Nombre en español del listado (la descripción de su categoría; si no está en el catálogo, su nombre). */
|
|
54
|
+
export declare function documentListLabel(catalog: DocumentVariablesCatalog, collection: DocumentListCollection): string;
|
|
55
|
+
export interface DocumentVariable {
|
|
56
|
+
/** Categoría (`client`). */
|
|
57
|
+
type: string;
|
|
58
|
+
/** Nombre del campo (`client_business_name`). */
|
|
59
|
+
value: string;
|
|
60
|
+
/** Descripción del dato (`Razón social del cliente`). */
|
|
61
|
+
label: string;
|
|
62
|
+
/** Lo que muestra el documento (`Cliente · Razón social del cliente`). */
|
|
63
|
+
fullLabel: string;
|
|
64
|
+
kind: DocumentFieldKind;
|
|
65
|
+
}
|
|
66
|
+
export interface DocumentVariableGroup {
|
|
67
|
+
/** Categoría (`client`). */
|
|
68
|
+
type: string;
|
|
69
|
+
label: string;
|
|
70
|
+
variables: DocumentVariable[];
|
|
71
|
+
}
|
|
72
|
+
/** Etiqueta de una variable, o `null` si el tipo o el valor no están en el catálogo. */
|
|
73
|
+
export declare function variableLabel(catalog: DocumentVariablesCatalog, type: string | null | undefined, value: string | null | undefined): string | null;
|
|
74
|
+
export declare const isGeneratedVariableLabel: (catalog: DocumentVariablesCatalog, text: string) => boolean;
|
|
75
|
+
/** Texto sin acentos ni mayúsculas, para buscar. */
|
|
76
|
+
export declare const normalizeSearchText: (text: string) => string;
|
|
77
|
+
/** HTML de una variable (el mismo `span` que guarda el documento): lo usa el arrastre del panel. */
|
|
78
|
+
export declare function variableHtml(variable: DocumentVariable, nodeId: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Nodos de texto del HTML que no están enlazados a un dato (les falta el tipo o el valor). Los tramos de un mismo
|
|
81
|
+
* nodo (cortados por el formato) cuentan una vez.
|
|
82
|
+
*/
|
|
83
|
+
export declare function countIncompleteNodes(html: string): number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Editor, Mark } from '@tiptap/core';
|
|
2
|
+
import type { Mark as ProseMirrorMark } from '@tiptap/pm/model';
|
|
3
|
+
import { DocumentNodeBinding } from './document-editor-node-attributes';
|
|
4
|
+
import { DocumentVariablesCatalog } from './document-editor-node-types';
|
|
5
|
+
export declare const DOCUMENT_NODE_MARK_NAME = "documentNode";
|
|
6
|
+
export declare const DOCUMENT_NODE_SELECTOR = "[data-document-node]";
|
|
7
|
+
export interface DocumentNodeRange extends DocumentNodeBinding {
|
|
8
|
+
nodeId: string;
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
/** Texto actual del nodo. */
|
|
12
|
+
text: string;
|
|
13
|
+
/** Texto que tenía antes de convertirse en nodo. */
|
|
14
|
+
original: string | null;
|
|
15
|
+
marks: readonly ProseMirrorMark[];
|
|
16
|
+
}
|
|
17
|
+
export declare const DocumentNodeMark: Mark<any, any>;
|
|
18
|
+
export declare function canConvertSelection(editor: Editor): boolean;
|
|
19
|
+
export declare function findDocumentNode(editor: Editor, nodeId: string): DocumentNodeRange | null;
|
|
20
|
+
export declare function convertSelectionToNode(editor: Editor): DocumentNodeRange | null;
|
|
21
|
+
export declare function updateDocumentNodeText(editor: Editor, nodeId: string, text: string): void;
|
|
22
|
+
export declare function updateDocumentNodeBinding(editor: Editor, nodeId: string, binding: DocumentNodeBinding, catalog: DocumentVariablesCatalog): void;
|
|
23
|
+
export declare function insertVariable(editor: Editor, type: string, value: string, catalog: DocumentVariablesCatalog): boolean;
|
|
24
|
+
export declare function removeDocumentNode(editor: Editor, nodeId: string, catalog: DocumentVariablesCatalog): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DestroyRef } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { Editor } from '@tiptap/core';
|
|
4
|
+
import { DocumentVariablesCatalog } from '../document-editor-node-types';
|
|
5
|
+
/**
|
|
6
|
+
* Contenido del panel lateral de `document-editor`: propiedades del nodo activo (su texto, la categoría y el campo
|
|
7
|
+
* al que está enlazado; las dos listas salen del catálogo que entrega el backend). Cada cambio del formulario se
|
|
8
|
+
* aplica al lienzo y lo que se edita en el lienzo se refleja en el formulario.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DocumentEditorNodePanel {
|
|
11
|
+
private readonly destroyRef;
|
|
12
|
+
constructor(destroyRef: DestroyRef);
|
|
13
|
+
editor: import("@angular/core").InputSignal<Editor>;
|
|
14
|
+
nodeId: import("@angular/core").InputSignal<string>;
|
|
15
|
+
/** Catálogo del editor que contiene el panel. */
|
|
16
|
+
catalog: import("@angular/core").InputSignal<DocumentVariablesCatalog>;
|
|
17
|
+
/** El nodo ya no existe en el documento (se borró su texto o su imagen). */
|
|
18
|
+
nodeRemoved: import("@angular/core").OutputEmitterRef<void>;
|
|
19
|
+
private readonly panelId;
|
|
20
|
+
readonly textInputId: string;
|
|
21
|
+
readonly typeInputId: string;
|
|
22
|
+
readonly valueInputId: string;
|
|
23
|
+
nodeType: import("@angular/core").WritableSignal<string | null>;
|
|
24
|
+
typeOptions: import("@angular/core").Signal<import("../document-editor-node-types").DocumentNodeOption[]>;
|
|
25
|
+
valueOptions: import("@angular/core").Signal<import("../document-editor-node-types").DocumentNodeOption[]>;
|
|
26
|
+
form: FormGroup<{
|
|
27
|
+
text: FormControl<string>;
|
|
28
|
+
type: FormControl<string | null>;
|
|
29
|
+
value: FormControl<string | null>;
|
|
30
|
+
}>;
|
|
31
|
+
private readonly _syncWithEditorEffect;
|
|
32
|
+
private loadNode;
|
|
33
|
+
private applyBinding;
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor, Node } from '@tiptap/core';
|
|
2
|
+
export declare const DOCUMENT_HEADER_NODE_NAME = "documentHeader";
|
|
3
|
+
export declare const DOCUMENT_FOOTER_NODE_NAME = "documentFooter";
|
|
4
|
+
export declare const DOCUMENT_PAGE_BREAK_NODE_NAME = "documentPageBreak";
|
|
5
|
+
export declare const DOCUMENT_FIELD_NODE_NAME = "documentField";
|
|
6
|
+
export type DocumentRegionKind = 'header' | 'footer';
|
|
7
|
+
export type DocumentFieldKind = 'page' | 'pages';
|
|
8
|
+
export declare const DocumentHeader: Node<any, any>;
|
|
9
|
+
export declare const DocumentFooter: Node<any, any>;
|
|
10
|
+
export declare const DocumentPageBreak: Node<any, any>;
|
|
11
|
+
export declare const DocumentField: Node<any, any>;
|
|
12
|
+
export declare const hasRegion: (editor: Editor, kind: DocumentRegionKind) => boolean;
|
|
13
|
+
export declare function isSelectionInRegion(editor: Editor): boolean;
|
|
14
|
+
export declare function focusRegion(editor: Editor, kind: DocumentRegionKind): boolean;
|
|
15
|
+
export declare function addRegion(editor: Editor, kind: DocumentRegionKind): void;
|
|
16
|
+
export declare function removeRegion(editor: Editor, kind: DocumentRegionKind): void;
|
|
17
|
+
export declare function insertPageBreak(editor: Editor): boolean;
|
|
18
|
+
export declare function insertField(editor: Editor, field: DocumentFieldKind): boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type DocumentPageSize = 'letter' | 'legal' | 'executive' | 'a3' | 'a4' | 'a5';
|
|
2
|
+
export type DocumentPageOrientation = 'portrait' | 'landscape';
|
|
3
|
+
export interface DocumentPageDimensions {
|
|
4
|
+
label: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const DOCUMENT_PAGE_SIZES: Record<DocumentPageSize, DocumentPageDimensions>;
|
|
9
|
+
export declare const DEFAULT_DOCUMENT_PAGE_SIZE: DocumentPageSize;
|
|
10
|
+
export declare const DEFAULT_DOCUMENT_PAGE_ORIENTATION: DocumentPageOrientation;
|
|
11
|
+
export interface DocumentPageMargins {
|
|
12
|
+
top: number;
|
|
13
|
+
right: number;
|
|
14
|
+
bottom: number;
|
|
15
|
+
left: number;
|
|
16
|
+
header: number;
|
|
17
|
+
footer: number;
|
|
18
|
+
}
|
|
19
|
+
/** Los cuatro márgenes del cuerpo (los que se editan en la lista de márgenes). */
|
|
20
|
+
export type DocumentPageMarginSide = 'top' | 'right' | 'bottom' | 'left';
|
|
21
|
+
export declare const DEFAULT_HEADER_FOOTER_DISTANCE_MM = 12.7;
|
|
22
|
+
export interface DocumentMarginPreset {
|
|
23
|
+
value: string;
|
|
24
|
+
label: string;
|
|
25
|
+
margins: DocumentPageMargins;
|
|
26
|
+
}
|
|
27
|
+
export declare const DEFAULT_DOCUMENT_PAGE_MARGINS: DocumentPageMargins;
|
|
28
|
+
export declare const DOCUMENT_MARGIN_PRESETS: readonly DocumentMarginPreset[];
|
|
29
|
+
export declare const MIN_CONTENT_SIZE_MM = 30;
|
|
30
|
+
export declare const roundMillimeters: (value: number) => number;
|
|
31
|
+
export declare function toDocumentPageMargins(value: Partial<DocumentPageMargins> | null | undefined): DocumentPageMargins;
|
|
32
|
+
export declare function haveSameMargins(left: DocumentPageMargins, right: DocumentPageMargins): boolean;
|
|
33
|
+
export declare function haveSameMarginSides(left: DocumentPageMargins, right: DocumentPageMargins): boolean;
|
|
34
|
+
export declare function clampMargin(value: number, opposite: number, pageSize: number): number;
|
|
35
|
+
export declare function fitMargins(margins: DocumentPageMargins, page: {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
}): DocumentPageMargins;
|
|
39
|
+
export declare function toDocumentPageSize(value: string | null | undefined): DocumentPageSize;
|
|
40
|
+
export declare function toDocumentPageOrientation(value: string | null | undefined): DocumentPageOrientation;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export { CbmDocumentEditorComponent } from './document-editor';
|
|
2
|
+
/**
|
|
3
|
+
* Lo que un consumidor puede sobrescribir con `[config]`. Es un tipo propio (subconjunto de `AteEditorConfig`) que no
|
|
4
|
+
* importa `@flogeez/angular-tiptap-editor`: así no queda en `any` en los proyectos que no instalan la librería. Las
|
|
5
|
+
* claves de `AteEditorConfig` que necesitan tipos de la librería o de Tiptap (`toolbar`, `bubbleMenu`,
|
|
6
|
+
* `tiptapExtensions`…) quedan fuera a propósito.
|
|
7
|
+
*/
|
|
8
|
+
export interface DocumentEditorConfig {
|
|
9
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
10
|
+
mode?: 'classic' | 'seamless';
|
|
11
|
+
height?: string | number;
|
|
12
|
+
autofocus?: 'start' | 'end' | 'all' | boolean | number;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
editable?: boolean;
|
|
15
|
+
minHeight?: string | number;
|
|
16
|
+
maxHeight?: string | number;
|
|
17
|
+
fillContainer?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
locale?: string;
|
|
20
|
+
spellcheck?: boolean;
|
|
21
|
+
enableOfficePaste?: boolean;
|
|
22
|
+
showToolbar?: boolean;
|
|
23
|
+
showFooter?: boolean;
|
|
24
|
+
showCharacterCount?: boolean;
|
|
25
|
+
showWordCount?: boolean;
|
|
26
|
+
showEditToggle?: boolean;
|
|
27
|
+
showBubbleMenu?: boolean;
|
|
28
|
+
showImageBubbleMenu?: boolean;
|
|
29
|
+
showTableMenu?: boolean;
|
|
30
|
+
showCellMenu?: boolean;
|
|
31
|
+
downloadImage?: boolean;
|
|
32
|
+
enableSlashCommands?: boolean;
|
|
33
|
+
maxCharacters?: number;
|
|
34
|
+
blockControls?: 'inside' | 'outside' | 'none';
|
|
35
|
+
floatingToolbar?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export { DOCUMENT_PAGE_SIZES, DEFAULT_DOCUMENT_PAGE_SIZE, DEFAULT_DOCUMENT_PAGE_ORIENTATION, DEFAULT_DOCUMENT_PAGE_MARGINS, fitMargins, toDocumentPageSize, toDocumentPageOrientation, toDocumentPageMargins, } from './page/document-editor-pages';
|
|
38
|
+
export type { DocumentPageSize, DocumentPageOrientation, DocumentPageMargins, DocumentPageDimensions, } from './page/document-editor-pages';
|
|
39
|
+
export { DEFAULT_DOCUMENT_DEFAULTS, toDocumentDefaults } from './format/document-editor-defaults';
|
|
40
|
+
export type { DocumentDefaults } from './format/document-editor-defaults';
|
|
41
|
+
export { DEFAULT_DOCUMENT_VARIABLES_CONFIG, resolveDocumentVariablesConfig, toDocumentSchemaCategories, } from './variables/document-editor-schema';
|
|
42
|
+
export type { DocumentFieldKind, DocumentSchemaCategory, DocumentSchemaCategorySource, DocumentSchemaField, DocumentSchemaFieldSource, DocumentVariablesConfig, DocumentVariablesHiddenField, } from './variables/document-editor-schema';
|
|
43
|
+
export { countIncompleteNodes, documentFieldKind } from './nodes/document-editor-node-types';
|
|
44
|
+
export type { DocumentListCollection } from './nodes/document-editor-node-types';
|
|
45
|
+
export { buildSampleData } from './variables/document-editor-sample-data';
|
|
46
|
+
export { fillDocumentTemplate } from './variables/document-editor-template';
|
|
47
|
+
export type { DocumentTemplateData, DocumentTemplateValues } from './variables/document-editor-template';
|
|
48
|
+
export { registerDocumentEditorI18n } from './i18n/document-editor-i18n';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Paleta que muestra el menú: color de fuente (tema de Office) o resaltado (colores de Word). */
|
|
2
|
+
export type DocumentColorPalette = 'text' | 'highlight';
|
|
3
|
+
/** Muestra de color: valor `#RRGGBB` (mayúsculas) y nombre para el `title`/`aria-label`. */
|
|
4
|
+
export interface DocumentColorSwatch {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Contenido del menú de color de `document-editor` (color de fuente o resaltado), al estilo de Word.
|
|
10
|
+
* Se dibuja dentro de un `popover` del editor: no se abre ni se cierra solo, solo avisa el color elegido
|
|
11
|
+
* (`null` = el botón "Automático"/"Sin color"). Ningún botón toma el foco, así el editor conserva la selección.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DocumentEditorColorMenu {
|
|
14
|
+
palette: import("@angular/core").InputSignal<DocumentColorPalette>;
|
|
15
|
+
/** Texto del botón que quita el color. */
|
|
16
|
+
noneLabel: import("@angular/core").InputSignal<string>;
|
|
17
|
+
/** Color aplicado a la selección (`null` si no tiene). Su muestra se marca como activa. */
|
|
18
|
+
current: import("@angular/core").InputSignal<string | null>;
|
|
19
|
+
/** Color elegido en `#RRGGBB` (`#rrggbb` desde "Más colores…"), o `null` para quitarlo. */
|
|
20
|
+
picked: import("@angular/core").OutputEmitterRef<string | null>;
|
|
21
|
+
private readonly menuId;
|
|
22
|
+
readonly themeTitleId: string;
|
|
23
|
+
readonly standardTitleId: string;
|
|
24
|
+
readonly customInputId: string;
|
|
25
|
+
readonly themeColors: readonly (readonly DocumentColorSwatch[])[];
|
|
26
|
+
readonly standardColors: readonly DocumentColorSwatch[];
|
|
27
|
+
readonly highlightColors: readonly DocumentColorSwatch[];
|
|
28
|
+
/** Color actual en mayúsculas, para compararlo con las muestras sin importar cómo llegó escrito. */
|
|
29
|
+
activeColor: import("@angular/core").Signal<string | null>;
|
|
30
|
+
/** Valor inicial del selector nativo: el color actual si es un `#rrggbb` válido; si no, negro. */
|
|
31
|
+
customValue: import("@angular/core").Signal<string>;
|
|
32
|
+
pick(color: string | null): void;
|
|
33
|
+
pickCustom(event: Event): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FormControl } from '@angular/forms';
|
|
2
|
+
/**
|
|
3
|
+
* Contenido del menú "Vínculo" de `document-editor`: dirección del vínculo de la selección. Se dibuja
|
|
4
|
+
* dentro de un `popover` del editor: no se abre ni se cierra solo, solo avisa la dirección escrita (tal
|
|
5
|
+
* cual, recortada; quien lo usa la normaliza) o que se quitó el vínculo.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DocumentEditorLinkMenu {
|
|
8
|
+
/** Dirección del vínculo de la selección (`null` si no tiene). */
|
|
9
|
+
href: import("@angular/core").InputSignal<string | null>;
|
|
10
|
+
applied: import("@angular/core").OutputEmitterRef<string>;
|
|
11
|
+
removed: import("@angular/core").OutputEmitterRef<void>;
|
|
12
|
+
readonly hrefInputId: string;
|
|
13
|
+
hrefControl: FormControl<string>;
|
|
14
|
+
private readonly hrefText;
|
|
15
|
+
canApply: import("@angular/core").Signal<boolean>;
|
|
16
|
+
private readonly _syncHrefEffect;
|
|
17
|
+
apply(event?: Event): void;
|
|
18
|
+
remove(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { FormControl } from '@angular/forms';
|
|
2
|
+
/** Valor confirmado en el campo y si el documento debe recuperar el foco (solo al confirmar con Enter). */
|
|
3
|
+
export interface DocumentSpinnerCommit {
|
|
4
|
+
value: number;
|
|
5
|
+
returnFocus: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Campo numérico con flechas de la cinta de `document-editor` (como "Izquierda: 0 cm" o "Antes: 0 pt" del grupo
|
|
9
|
+
* Párrafo de Word): se escribe el valor y se confirma con Enter o al salir del campo, o se sube y baja con las
|
|
10
|
+
* flechas del campo y del teclado. Solo avisa el valor confirmado (`committed`); quien lo usa lo aplica.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DocumentEditorSpinner {
|
|
13
|
+
/** Nombre del campo ("Izquierda"). */
|
|
14
|
+
label: import("@angular/core").InputSignal<string>;
|
|
15
|
+
/** Unidad que se muestra junto al valor ("cm", "pt"). */
|
|
16
|
+
unit: import("@angular/core").InputSignal<string>;
|
|
17
|
+
/** Valor actual (el del párrafo donde está el cursor); `null` si no hay uno. */
|
|
18
|
+
value: import("@angular/core").InputSignal<number | null>;
|
|
19
|
+
/** Cuánto suben o bajan las flechas. */
|
|
20
|
+
step: import("@angular/core").InputSignal<number>;
|
|
21
|
+
min: import("@angular/core").InputSignal<number>;
|
|
22
|
+
max: import("@angular/core").InputSignal<number>;
|
|
23
|
+
/** Decimales que se muestran y se conservan. */
|
|
24
|
+
decimals: import("@angular/core").InputSignal<number>;
|
|
25
|
+
/** Icono de Material Symbols que va antes de la etiqueta. */
|
|
26
|
+
icon: import("@angular/core").InputSignal<string | null>;
|
|
27
|
+
disabled: import("@angular/core").InputSignal<boolean>;
|
|
28
|
+
/** Ancho mínimo (px) de la etiqueta: alinea las cajas de varios campos seguidos; con 0 solo ocupa su texto. */
|
|
29
|
+
labelWidth: import("@angular/core").InputSignal<number>;
|
|
30
|
+
committed: import("@angular/core").OutputEmitterRef<DocumentSpinnerCommit>;
|
|
31
|
+
private readonly field;
|
|
32
|
+
readonly fieldId: string;
|
|
33
|
+
private dirty;
|
|
34
|
+
control: FormControl<string>;
|
|
35
|
+
private readonly _syncValueEffect;
|
|
36
|
+
private readonly _syncDisabledEffect;
|
|
37
|
+
private show;
|
|
38
|
+
private format;
|
|
39
|
+
markDirty(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Descarta lo escrito y muestra `value` (por defecto el valor actual), aunque el campo tenga el foco (un valor nuevo
|
|
42
|
+
* no lo reescribe mientras se escribe en él). No avisa nada.
|
|
43
|
+
*/
|
|
44
|
+
discard(value?: number | null): void;
|
|
45
|
+
private round;
|
|
46
|
+
private clamp;
|
|
47
|
+
private read;
|
|
48
|
+
commit(returnFocus?: boolean): void;
|
|
49
|
+
stepBy(direction: 1 | -1): void;
|
|
50
|
+
onKeydown(event: KeyboardEvent): void;
|
|
51
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contenido del menú "Símbolos" de `document-editor`: cuadrícula de símbolos para insertar en el cursor.
|
|
3
|
+
* Se dibuja dentro de un `popover` del editor: no se abre ni se cierra solo, solo avisa el símbolo elegido.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DocumentEditorSymbolMenu {
|
|
6
|
+
picked: import("@angular/core").OutputEmitterRef<string>;
|
|
7
|
+
readonly titleId: string;
|
|
8
|
+
readonly symbols: readonly string[];
|
|
9
|
+
pick(symbol: string): void;
|
|
10
|
+
}
|
package/lib/components/document-editor/tables/borders/border-menu/document-editor-border-menu.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DocumentBorderTarget } from '../document-editor-table-borders';
|
|
2
|
+
/** Opción del menú: la orden, su icono de Material Symbols y su texto. */
|
|
3
|
+
interface BorderMenuItem {
|
|
4
|
+
target: DocumentBorderTarget;
|
|
5
|
+
icon: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Contenido del menú "Bordes" de `document-editor` (la pestaña de tabla): las diez órdenes de borde de Word. Se
|
|
10
|
+
* dibuja dentro de un `popover` del editor con `role="menu"`: no se abre ni se cierra solo, solo avisa la orden
|
|
11
|
+
* elegida (quien lo usa la aplica con `applyTableBorders` y cierra el menú). Ningún botón toma el foco, así el
|
|
12
|
+
* editor conserva la selección de celdas.
|
|
13
|
+
*/
|
|
14
|
+
export declare class DocumentEditorBorderMenu {
|
|
15
|
+
/** Orden elegida ("Borde inferior", "Todos los bordes"…). */
|
|
16
|
+
chosen: import("@angular/core").OutputEmitterRef<DocumentBorderTarget>;
|
|
17
|
+
readonly groups: readonly (readonly BorderMenuItem[])[];
|
|
18
|
+
choose(target: DocumentBorderTarget): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DocumentBorderLineStyle } from '../document-editor-table-borders';
|
|
2
|
+
/**
|
|
3
|
+
* Lista del "Estilo de línea" de la pluma de bordes de `document-editor` (continua, guiones, puntos, doble), cada
|
|
4
|
+
* estilo con una muestra de la línea. Se dibuja dentro de un `popover` del editor con `role="menu"`: no se abre ni
|
|
5
|
+
* se cierra solo, solo avisa el estilo elegido. Ningún botón toma el foco, así el editor conserva la selección.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DocumentEditorBorderStylePicker {
|
|
8
|
+
/** Estilo de la pluma (se marca en la lista); `null` si no hay uno. */
|
|
9
|
+
current: import("@angular/core").InputSignal<DocumentBorderLineStyle | null>;
|
|
10
|
+
picked: import("@angular/core").OutputEmitterRef<DocumentBorderLineStyle>;
|
|
11
|
+
readonly styles: readonly import("../document-editor-table-borders").DocumentBorderLineStyleOption[];
|
|
12
|
+
pick(style: DocumentBorderLineStyle): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lista del "Grosor de línea" de la pluma de bordes de `document-editor` (de 1/4 a 6 pto), cada grosor con una
|
|
3
|
+
* muestra de la línea y su nombre. Se dibuja dentro de un `popover` del editor con `role="menu"`: no se abre ni se
|
|
4
|
+
* cierra solo, solo avisa el grosor elegido (en puntos). Ningún botón toma el foco, así el editor conserva la
|
|
5
|
+
* selección.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DocumentEditorBorderWeightPicker {
|
|
8
|
+
/** Grosor de la pluma en puntos (se marca el de la lista que coincide); `null` si no hay uno. */
|
|
9
|
+
current: import("@angular/core").InputSignal<number | null>;
|
|
10
|
+
/** Grosor elegido, en puntos. */
|
|
11
|
+
picked: import("@angular/core").OutputEmitterRef<number>;
|
|
12
|
+
readonly weights: readonly import("../document-editor-table-borders").DocumentBorderWeightOption[];
|
|
13
|
+
/** Grosor de la lista que corresponde al actual; `null` si el actual no es de la lista (un borde importado, por ejemplo). */
|
|
14
|
+
activeWeight: import("@angular/core").Signal<number | null>;
|
|
15
|
+
pick(weight: number): void;
|
|
16
|
+
}
|
package/lib/components/document-editor/tables/borders/document-editor-table-border-painter.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Extension, type Editor } from '@tiptap/core';
|
|
2
|
+
import { type DocumentBorderPen } from './document-editor-table-borders';
|
|
3
|
+
/** Clase que lleva la hoja mientras "Copiar borde" está activo. */
|
|
4
|
+
export declare const BORDER_PAINTER_CLASS = "document-editor--border-painter";
|
|
5
|
+
export declare const DocumentTableBorderPainter: Extension<any, any>;
|
|
6
|
+
/** ¿Está activo "Copiar borde" en este editor? `false` también si la extensión no está registrada. */
|
|
7
|
+
export declare function isBorderPainterActive(editor: Editor): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Activa "Copiar borde" con la pluma `pen`. Llamarla con la herramienta ya activa cambia la pluma (así la cinta
|
|
10
|
+
* puede cambiar el color o el grosor sin apagarla). Se apaga con `stopBorderPainter` o con Esc.
|
|
11
|
+
*/
|
|
12
|
+
export declare function startBorderPainter(editor: Editor, pen: DocumentBorderPen): void;
|
|
13
|
+
/** Apaga "Copiar borde". */
|
|
14
|
+
export declare function stopBorderPainter(editor: Editor): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import type { Transaction } from '@tiptap/pm/state';
|
|
3
|
+
/** Estilos de línea de la pluma. "Sin borde" no es un estilo: es la orden `none` del menú "Bordes". */
|
|
4
|
+
export type DocumentBorderLineStyle = 'solid' | 'dashed' | 'dotted' | 'double';
|
|
5
|
+
/** La pluma de los bordes: cómo se dibuja la línea que se aplica. */
|
|
6
|
+
export interface DocumentBorderPen {
|
|
7
|
+
style: DocumentBorderLineStyle;
|
|
8
|
+
/** Grosor en puntos. */
|
|
9
|
+
width: number;
|
|
10
|
+
/** Color como `#RRGGBB`. */
|
|
11
|
+
color: string;
|
|
12
|
+
}
|
|
13
|
+
/** Lado de una celda. */
|
|
14
|
+
export type DocumentBorderSide = 'top' | 'right' | 'bottom' | 'left';
|
|
15
|
+
/**
|
|
16
|
+
* Órdenes del menú "Bordes":
|
|
17
|
+
* - `top` / `bottom` / `left` / `right`: ese lado del rectángulo de la selección;
|
|
18
|
+
* - `outside`: los cuatro lados del rectángulo; `inside`: las líneas internas (horizontales y verticales);
|
|
19
|
+
* - `insideHorizontal` / `insideVertical`: solo las líneas internas de ese sentido;
|
|
20
|
+
* - `all`: exteriores e interiores; `none`: quita todos (el borde de cada celda seleccionada y el que la vecina
|
|
21
|
+
* tiene frente a ella).
|
|
22
|
+
*/
|
|
23
|
+
export type DocumentBorderTarget = 'bottom' | 'top' | 'left' | 'right' | 'none' | 'all' | 'outside' | 'inside' | 'insideHorizontal' | 'insideVertical';
|
|
24
|
+
export interface DocumentBorderLineStyleOption {
|
|
25
|
+
value: DocumentBorderLineStyle;
|
|
26
|
+
label: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DocumentBorderWeightOption {
|
|
29
|
+
/** Grosor en puntos. */
|
|
30
|
+
value: number;
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const DEFAULT_BORDER_PEN: Readonly<DocumentBorderPen>;
|
|
34
|
+
export declare const DOCUMENT_BORDER_LINE_STYLES: readonly DocumentBorderLineStyleOption[];
|
|
35
|
+
export declare const DOCUMENT_BORDER_WEIGHTS: readonly DocumentBorderWeightOption[];
|
|
36
|
+
/** Pluma válida: estilo conocido, grosor entre 1/4 y 6 pt y color `#RRGGBB` en mayúsculas; lo demás vuelve al valor por defecto. */
|
|
37
|
+
export declare function normalizeBorderPen(pen: DocumentBorderPen): DocumentBorderPen;
|
|
38
|
+
/** Valor CSS del borde de la pluma (`0.5pt solid #000000`), el que se escribe en el estilo de la celda. */
|
|
39
|
+
export declare function toBorderCss(pen: DocumentBorderPen): string;
|
|
40
|
+
/**
|
|
41
|
+
* Aplica un borde a las celdas seleccionadas (o a la celda del cursor), como el menú "Bordes" de Word (ver
|
|
42
|
+
* `DocumentBorderTarget`). Con `none` quita los bordes y `pen` no se usa. Se escribe también el lado vecino de las
|
|
43
|
+
* celdas que no están seleccionadas, para que la línea visible sea la misma. Todo en un solo paso del historial.
|
|
44
|
+
* Con `focus` en `false` el foco se queda donde está.
|
|
45
|
+
*/
|
|
46
|
+
export declare function applyTableBorders(editor: Editor, target: DocumentBorderTarget, pen?: DocumentBorderPen, focus?: boolean): void;
|
|
47
|
+
/**
|
|
48
|
+
* Aplica la pluma a UN lado de la celda que empieza en `cellPosition` (y al lado de las celdas vecinas que lo tocan),
|
|
49
|
+
* dentro de la transacción `tr`. Lo usa "Copiar borde". Devuelve si cambió algo; `false` también si la posición no
|
|
50
|
+
* es la de una celda.
|
|
51
|
+
*/
|
|
52
|
+
export declare function applyCellSideBorder(tr: Transaction, cellPosition: number, side: DocumentBorderSide, pen: DocumentBorderPen): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
export type DocumentTableSelectPart = 'cell' | 'row' | 'column' | 'table';
|
|
3
|
+
export interface DocumentTableSelectOption {
|
|
4
|
+
value: DocumentTableSelectPart;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
hint: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DOCUMENT_TABLE_SELECT_OPTIONS: readonly DocumentTableSelectOption[];
|
|
10
|
+
/**
|
|
11
|
+
* Selecciona una parte de la tabla donde está el cursor (la más interna si hay tablas anidadas) y devuelve el foco a la
|
|
12
|
+
* hoja. Devuelve si hubo algo que seleccionar (el cursor debe estar en una celda).
|
|
13
|
+
*/
|
|
14
|
+
export declare function selectTablePart(editor: Editor, part: DocumentTableSelectPart): boolean;
|