oasis-editor 0.0.138 → 0.0.140
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/dist/{OasisEditorApp-DMI2ZfOd.js → OasisEditorApp-vqeSS8FT.js} +71 -8
- package/dist/adapters/mountController.d.ts +11 -0
- package/dist/adapters/react.d.ts +8 -0
- package/dist/adapters/ui.d.ts +1 -1
- package/dist/adapters/vue.d.ts +10 -0
- package/dist/app/bootstrap/createOasisEditorApp.d.ts +9 -0
- package/dist/app/bootstrap/createOasisEditorContainer.d.ts +9 -0
- package/dist/app/client/OasisEditorClient.d.ts +254 -1
- package/dist/app/client/publicDocumentApi.d.ts +223 -0
- package/dist/app/controllers/documentIO/DocumentExporter.d.ts +10 -2
- package/dist/app/controllers/documentIO/DocumentImporter.d.ts +6 -0
- package/dist/app/controllers/useEditorDocumentIO.d.ts +4 -2
- package/dist/app/controllers/useEditorFindReplace.d.ts +7 -0
- package/dist/app/controllers/useEditorPersistence.d.ts +10 -0
- package/dist/app/services/FindReplaceService.d.ts +9 -0
- package/dist/app/services/indexedDbPersistence.d.ts +10 -1
- package/dist/app/services/tablePropertiesService.d.ts +12 -3
- package/dist/app/services/userPreferences.d.ts +4 -0
- package/dist/assets/{importDocxWorker-DBjcGf-C.js → importDocxWorker-B1vHeo5L.js} +1 -1
- package/dist/core/Editor.d.ts +33 -1
- package/dist/core/commands/CommandBus.d.ts +26 -0
- package/dist/core/commands/publicCommandTypes.d.ts +53 -0
- package/dist/core/model/types/document.d.ts +2 -0
- package/dist/core/plugin.d.ts +60 -0
- package/dist/import/DocumentFormatImporter.d.ts +20 -4
- package/dist/import/documentImporterRegistry.d.ts +6 -2
- package/dist/{index-M7h7REmM.js → index-C_F1o38Z.js} +1191 -760
- package/dist/index.d.ts +3 -1
- package/dist/mountController.d.ts +11 -0
- package/dist/oasis-editor.js +44 -36
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/react.d.ts +8 -0
- package/dist/ui/OasisEditorAppProps.d.ts +8 -4
- package/dist/ui/app/connectEditorClientHost.d.ts +12 -2
- package/dist/ui/app/createEditorCommandRuntime.d.ts +8 -1
- package/dist/ui/app/createEditorDocumentRuntime.d.ts +4 -2
- package/dist/ui/app/essentials/types.d.ts +2 -2
- package/dist/ui/canvas/CanvasDebug.d.ts +15 -1
- package/dist/ui/components/Menubar/menuRegistry.d.ts +11 -0
- package/dist/ui/components/Toolbar/registry/ToolbarRegistry.d.ts +43 -7
- package/dist/ui/components/Toolbar/schema/items.d.ts +39 -7
- package/dist/ui/components/Toolbar/state/createToolbarApi.d.ts +8 -4
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +29 -30
- package/dist/vue.d.ts +10 -0
- package/package.json +2 -1
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { EditorBlockNode, EditorDocument, EditorParagraphNode, EditorPosition, EditorTextStyle } from '../../core/model.js';
|
|
2
|
+
import { createEditorParagraph, createEditorTable } from '../../core/editorState.js';
|
|
3
|
+
|
|
4
|
+
/** Current version of the editor document schema. */
|
|
5
|
+
export declare const EDITOR_SCHEMA_VERSION = 1;
|
|
6
|
+
/**
|
|
7
|
+
* Selects a specific node in the document tree. Used as a targeting mechanism
|
|
8
|
+
* for edit operations and queries.
|
|
9
|
+
*/
|
|
10
|
+
export type DocumentSelector = {
|
|
11
|
+
nodeId: string;
|
|
12
|
+
} | {
|
|
13
|
+
text: string;
|
|
14
|
+
occurrence?: number;
|
|
15
|
+
} | {
|
|
16
|
+
headingPath: string[];
|
|
17
|
+
} | {
|
|
18
|
+
tableId: string;
|
|
19
|
+
row: number;
|
|
20
|
+
column: number;
|
|
21
|
+
} | {
|
|
22
|
+
bookmark: string;
|
|
23
|
+
} | {
|
|
24
|
+
contentControlTag: string;
|
|
25
|
+
};
|
|
26
|
+
/** A range between two positions in the document. */
|
|
27
|
+
export interface DocumentRange {
|
|
28
|
+
start: EditorPosition;
|
|
29
|
+
end: EditorPosition;
|
|
30
|
+
}
|
|
31
|
+
/** Descriptor for a node in a semantic document snapshot. */
|
|
32
|
+
export interface SemanticNode {
|
|
33
|
+
id: string;
|
|
34
|
+
type: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
node: unknown;
|
|
37
|
+
}
|
|
38
|
+
/** Descriptor for a text match found by the find API. */
|
|
39
|
+
export interface DocumentMatch {
|
|
40
|
+
selector: {
|
|
41
|
+
nodeId: string;
|
|
42
|
+
};
|
|
43
|
+
paragraphId: string;
|
|
44
|
+
text: string;
|
|
45
|
+
start: number;
|
|
46
|
+
end: number;
|
|
47
|
+
}
|
|
48
|
+
/** An item in the document outline (heading hierarchy). */
|
|
49
|
+
export interface DocumentOutlineItem {
|
|
50
|
+
id: string;
|
|
51
|
+
level: number;
|
|
52
|
+
text: string;
|
|
53
|
+
path: string[];
|
|
54
|
+
}
|
|
55
|
+
/** Immutable snapshot of the document's semantic structure. */
|
|
56
|
+
export interface SemanticDocumentSnapshot {
|
|
57
|
+
schemaVersion: number;
|
|
58
|
+
documentId: string;
|
|
59
|
+
text: string;
|
|
60
|
+
outline: DocumentOutlineItem[];
|
|
61
|
+
nodes: SemanticNode[];
|
|
62
|
+
}
|
|
63
|
+
/** Non-fatal warning produced during an operation. */
|
|
64
|
+
export type OasisWarning = {
|
|
65
|
+
code: string;
|
|
66
|
+
message: string;
|
|
67
|
+
nodeId?: string;
|
|
68
|
+
};
|
|
69
|
+
/** Error codes for operation failures. */
|
|
70
|
+
export type OasisErrorCode = "NODE_NOT_FOUND" | "AMBIGUOUS_SELECTOR" | "INVALID_RANGE" | "VALIDATION_FAILED" | "READ_ONLY" | "UNSUPPORTED_OPERATION" | "DOCUMENT_VERSION_CONFLICT" | "IMPORT_FAILED" | "EXPORT_FAILED" | "ABORTED";
|
|
71
|
+
/** Structured error information returned on operation failure. */
|
|
72
|
+
export interface OasisError {
|
|
73
|
+
code: OasisErrorCode;
|
|
74
|
+
message: string;
|
|
75
|
+
expectedVersion?: number;
|
|
76
|
+
actualVersion?: number;
|
|
77
|
+
details?: unknown;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Wraps a successful value or an error with its metadata.
|
|
81
|
+
* @typeParam T - The type of the success value.
|
|
82
|
+
*/
|
|
83
|
+
export type OasisResult<T> = {
|
|
84
|
+
ok: true;
|
|
85
|
+
value: T;
|
|
86
|
+
version: number;
|
|
87
|
+
warnings: OasisWarning[];
|
|
88
|
+
} | {
|
|
89
|
+
ok: false;
|
|
90
|
+
error: OasisError;
|
|
91
|
+
};
|
|
92
|
+
/** A single edit operation to be applied to the document. */
|
|
93
|
+
export type EditOperation = {
|
|
94
|
+
op: "insertText";
|
|
95
|
+
target: DocumentSelector;
|
|
96
|
+
text: string;
|
|
97
|
+
offset?: number;
|
|
98
|
+
} | {
|
|
99
|
+
op: "replaceText";
|
|
100
|
+
target: DocumentSelector;
|
|
101
|
+
text: string;
|
|
102
|
+
} | {
|
|
103
|
+
op: "deleteRange";
|
|
104
|
+
range: DocumentRange;
|
|
105
|
+
} | {
|
|
106
|
+
op: "insertParagraph";
|
|
107
|
+
text?: string;
|
|
108
|
+
after?: DocumentSelector;
|
|
109
|
+
} | {
|
|
110
|
+
op: "insertBlocks";
|
|
111
|
+
blocks: EditorBlockNode[];
|
|
112
|
+
after?: DocumentSelector;
|
|
113
|
+
} | {
|
|
114
|
+
op: "deleteNode";
|
|
115
|
+
target: DocumentSelector;
|
|
116
|
+
} | {
|
|
117
|
+
op: "setTextStyle";
|
|
118
|
+
target: DocumentSelector;
|
|
119
|
+
style: EditorTextStyle;
|
|
120
|
+
} | {
|
|
121
|
+
op: "setParagraphStyle";
|
|
122
|
+
target: DocumentSelector;
|
|
123
|
+
style: {
|
|
124
|
+
styleId: string;
|
|
125
|
+
};
|
|
126
|
+
} | {
|
|
127
|
+
op: "insertTable";
|
|
128
|
+
rows: string[][];
|
|
129
|
+
after?: DocumentSelector;
|
|
130
|
+
} | {
|
|
131
|
+
op: "updateTableCell";
|
|
132
|
+
target: {
|
|
133
|
+
tableId: string;
|
|
134
|
+
row: number;
|
|
135
|
+
column: number;
|
|
136
|
+
};
|
|
137
|
+
text: string;
|
|
138
|
+
};
|
|
139
|
+
/** Describes the origin/actor of an edit request. */
|
|
140
|
+
export interface EditActor {
|
|
141
|
+
type: string;
|
|
142
|
+
actorId?: string;
|
|
143
|
+
label?: string;
|
|
144
|
+
}
|
|
145
|
+
/** Request to apply one or more edit operations to the document. */
|
|
146
|
+
export interface ApplyEditRequest {
|
|
147
|
+
operations: EditOperation[];
|
|
148
|
+
expectedVersion?: number;
|
|
149
|
+
transactionId?: string;
|
|
150
|
+
idempotencyKey?: string;
|
|
151
|
+
origin?: EditActor;
|
|
152
|
+
}
|
|
153
|
+
/** Result value returned after applying edit operations. */
|
|
154
|
+
export interface ApplyEditValue {
|
|
155
|
+
changedNodeIds: string[];
|
|
156
|
+
createdNodeIds: string[];
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Deep-clones a document.
|
|
160
|
+
* @param document - The document to clone.
|
|
161
|
+
* @returns A deep copy of the document.
|
|
162
|
+
*/
|
|
163
|
+
export declare function cloneDocument<T extends EditorDocument>(document: T): T;
|
|
164
|
+
/**
|
|
165
|
+
* Ensures the document has a schemaVersion property set.
|
|
166
|
+
* @param document - The document to normalize.
|
|
167
|
+
* @returns The normalized document.
|
|
168
|
+
*/
|
|
169
|
+
export declare function normalizeDocument(document: EditorDocument): EditorDocument;
|
|
170
|
+
/**
|
|
171
|
+
* Validates document structure, returning errors if any.
|
|
172
|
+
* @param document - The document to validate.
|
|
173
|
+
* @returns An OasisResult indicating success or listing validation errors.
|
|
174
|
+
*/
|
|
175
|
+
export declare function validateDocument(document: EditorDocument): OasisResult<true>;
|
|
176
|
+
/**
|
|
177
|
+
* Creates a new empty editor document.
|
|
178
|
+
* @param options - Optional initial blocks and title.
|
|
179
|
+
* @returns A new EditorDocument.
|
|
180
|
+
*/
|
|
181
|
+
export declare function createDocument(options?: {
|
|
182
|
+
blocks?: EditorBlockNode[];
|
|
183
|
+
title?: string;
|
|
184
|
+
}): EditorDocument;
|
|
185
|
+
/** Creates an empty paragraph node. Alias for {@link createEditorParagraph}. */
|
|
186
|
+
export declare const createParagraph: typeof createEditorParagraph;
|
|
187
|
+
/**
|
|
188
|
+
* Creates a heading paragraph.
|
|
189
|
+
* @param text - The heading text.
|
|
190
|
+
* @param options - Options including the heading level.
|
|
191
|
+
* @returns A new heading paragraph node.
|
|
192
|
+
*/
|
|
193
|
+
export declare function createHeading(text: string, options?: {
|
|
194
|
+
level?: number;
|
|
195
|
+
}): EditorParagraphNode;
|
|
196
|
+
/**
|
|
197
|
+
* Creates a table node from a 2D array of string cell values.
|
|
198
|
+
* @param rows - A 2D array where each inner array represents a row of cell values.
|
|
199
|
+
* @returns A new table node.
|
|
200
|
+
*/
|
|
201
|
+
export declare function createTable(rows: string[][]): ReturnType<typeof createEditorTable>;
|
|
202
|
+
/**
|
|
203
|
+
* Creates a query object for read-only document inspection.
|
|
204
|
+
* @param document - The document to query against.
|
|
205
|
+
* @returns An object with snapshot, getText, getNode, find, and outline methods.
|
|
206
|
+
*/
|
|
207
|
+
export declare function queryDocument(document: EditorDocument): {
|
|
208
|
+
snapshot: () => SemanticDocumentSnapshot;
|
|
209
|
+
getText: (target?: DocumentSelector | DocumentRange) => string;
|
|
210
|
+
getNode: (selector: DocumentSelector) => SemanticNode | null;
|
|
211
|
+
find: (text: string) => DocumentMatch[];
|
|
212
|
+
outline: () => DocumentOutlineItem[];
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Applies an array of edit operations to a document.
|
|
216
|
+
* @param document - The document to mutate.
|
|
217
|
+
* @param operations - The operations to apply.
|
|
218
|
+
* @returns The mutated document along with metadata about changed and created nodes.
|
|
219
|
+
*/
|
|
220
|
+
export declare function applyDocumentOperations(document: EditorDocument, operations: EditOperation[]): {
|
|
221
|
+
document: EditorDocument;
|
|
222
|
+
value: ApplyEditValue;
|
|
223
|
+
};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { EditorDocument } from '../../../core/model.js';
|
|
2
2
|
|
|
3
|
+
/** Dependencies required by {@link createDocumentExporter}. */
|
|
3
4
|
export interface DocumentExporterDeps {
|
|
4
5
|
document: () => EditorDocument;
|
|
5
6
|
focusInput: () => void;
|
|
6
7
|
download?: (blob: Blob, filename: string) => void;
|
|
7
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a document exporter with support for .docx and .pdf output.
|
|
11
|
+
* @param deps - The dependencies required for exporting.
|
|
12
|
+
* @returns An object with export methods.
|
|
13
|
+
*/
|
|
8
14
|
export declare function createDocumentExporter(deps: DocumentExporterDeps): {
|
|
9
|
-
handleExportDocx: () => Promise<
|
|
10
|
-
handleExportPdf: () => Promise<
|
|
15
|
+
handleExportDocx: () => Promise<Blob>;
|
|
16
|
+
handleExportPdf: () => Promise<Blob>;
|
|
17
|
+
exportDocxBlob: () => Promise<Blob>;
|
|
18
|
+
exportPdfBlob: () => Promise<Blob>;
|
|
11
19
|
};
|
|
@@ -2,6 +2,7 @@ import { EditorState, getDocumentParagraphs } from '../../../core/model.js';
|
|
|
2
2
|
import { EditorLogger } from '../../../utils/logger.js';
|
|
3
3
|
import { ImportProgressPhase } from './importProgress.js';
|
|
4
4
|
|
|
5
|
+
/** Dependencies required by {@link createDocumentImporter}. */
|
|
5
6
|
export interface DocumentImporterDeps {
|
|
6
7
|
applyState: (state: EditorState) => void;
|
|
7
8
|
stabilizeLayoutAfterImport: () => Promise<void>;
|
|
@@ -14,6 +15,11 @@ export interface DocumentImporterDeps {
|
|
|
14
15
|
now: () => number;
|
|
15
16
|
logger: EditorLogger;
|
|
16
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates a document importer that handles file import with progress tracking.
|
|
20
|
+
* @param deps - The dependencies required for importing.
|
|
21
|
+
* @returns An object with the `handleImportFile` method.
|
|
22
|
+
*/
|
|
17
23
|
export declare function createDocumentImporter(deps: DocumentImporterDeps): {
|
|
18
24
|
handleImportFile: (file: File | null) => Promise<void>;
|
|
19
25
|
};
|
|
@@ -23,8 +23,10 @@ export declare function createEditorDocumentIO(deps: UseEditorDocumentIOProps):
|
|
|
23
23
|
declare function createEditorDocumentIOImpl(deps: UseEditorDocumentIOProps): {
|
|
24
24
|
importProgress: import('solid-js').Accessor<ImportProgressState | null>;
|
|
25
25
|
handleImportFile: (file: File | null) => Promise<void>;
|
|
26
|
-
handleExportDocx: () => Promise<
|
|
27
|
-
handleExportPdf: () => Promise<
|
|
26
|
+
handleExportDocx: () => Promise<Blob>;
|
|
27
|
+
handleExportPdf: () => Promise<Blob>;
|
|
28
|
+
exportDocxBlob: () => Promise<Blob>;
|
|
29
|
+
exportPdfBlob: () => Promise<Blob>;
|
|
28
30
|
insertImageFromFile: (file: File, position?: EditorPosition | null) => Promise<void>;
|
|
29
31
|
handleInsertImage: (file: File | null) => Promise<void>;
|
|
30
32
|
};
|
|
@@ -2,6 +2,7 @@ import { MergeKey } from '../../core/transactionMergeKeys.js';
|
|
|
2
2
|
import { FindOptions, FindReplaceMatch } from '../services/FindReplaceService.js';
|
|
3
3
|
import { EditorState } from '../../core/model.js';
|
|
4
4
|
|
|
5
|
+
/** Result of the {@link useEditorFindReplace} hook. */
|
|
5
6
|
export interface UseEditorFindReplaceResult {
|
|
6
7
|
searchTerm: () => string;
|
|
7
8
|
setSearchTerm: (term: string) => void;
|
|
@@ -18,6 +19,7 @@ export interface UseEditorFindReplaceResult {
|
|
|
18
19
|
isOpen: () => boolean;
|
|
19
20
|
setIsOpen: (open: boolean) => void;
|
|
20
21
|
}
|
|
22
|
+
/** Dependencies required by {@link useEditorFindReplace}. */
|
|
21
23
|
export interface FindReplaceDeps {
|
|
22
24
|
state: EditorState;
|
|
23
25
|
applyState: (next: EditorState) => void;
|
|
@@ -26,4 +28,9 @@ export interface FindReplaceDeps {
|
|
|
26
28
|
}) => void;
|
|
27
29
|
focusInput: () => void;
|
|
28
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* SolidJS hook that drives find-and-replace state and actions.
|
|
33
|
+
* @param deps - The dependencies required by the hook.
|
|
34
|
+
* @returns The find/replace state and action methods.
|
|
35
|
+
*/
|
|
29
36
|
export declare function useEditorFindReplace(deps: FindReplaceDeps): UseEditorFindReplaceResult;
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { EditorDocument, EditorState } from '../../core/model.js';
|
|
2
2
|
import { EditorLogger } from '../../utils/logger.js';
|
|
3
3
|
|
|
4
|
+
/** Current persistence status indicator. */
|
|
4
5
|
export type PersistenceStatus = "Saved" | "Saving..." | "Error" | "Initial";
|
|
6
|
+
/** Return value of the {@link useEditorPersistence} hook. */
|
|
5
7
|
export interface UseEditorPersistenceResult {
|
|
6
8
|
status: () => PersistenceStatus;
|
|
7
9
|
}
|
|
10
|
+
/** Minimal persistence interface for saving and loading documents. */
|
|
8
11
|
export interface DocumentPersistence {
|
|
9
12
|
saveDocument(doc: EditorDocument): Promise<void>;
|
|
10
13
|
loadDocument(): Promise<EditorDocument | null>;
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* SolidJS hook that manages auto-saving the editor document via a persistence backend.
|
|
17
|
+
* @param state - The editor state to watch for changes.
|
|
18
|
+
* @param onLoaded - Callback invoked when a previously saved document is loaded.
|
|
19
|
+
* @param options - Configuration including the persistence backend and logger.
|
|
20
|
+
* @returns The persistence status.
|
|
21
|
+
*/
|
|
12
22
|
export declare function useEditorPersistence(state: EditorState, onLoaded: (doc: EditorDocument) => void, options: {
|
|
13
23
|
enabled?: boolean;
|
|
14
24
|
persistence: DocumentPersistence;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { EditorDocument, EditorPosition } from '../../core/model.js';
|
|
2
2
|
|
|
3
|
+
/** Describes a single match found by the find service. */
|
|
3
4
|
export interface FindReplaceMatch {
|
|
4
5
|
anchor: EditorPosition;
|
|
5
6
|
focus: EditorPosition;
|
|
6
7
|
paragraphIndex: number;
|
|
7
8
|
}
|
|
9
|
+
/** Options that control how find searches operate. */
|
|
8
10
|
export interface FindOptions {
|
|
9
11
|
matchCase?: boolean;
|
|
10
12
|
wholeWord?: boolean;
|
|
11
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Searches a document for the given term and returns all matches.
|
|
16
|
+
* @param doc - The document to search.
|
|
17
|
+
* @param searchTerm - The text to search for.
|
|
18
|
+
* @param options - Search options (case sensitivity, whole word).
|
|
19
|
+
* @returns An array of match descriptors.
|
|
20
|
+
*/
|
|
12
21
|
export declare function findMatchesInDocument(doc: EditorDocument, searchTerm: string, options?: FindOptions): FindReplaceMatch[];
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { EditorDocument } from '../../core/model.js';
|
|
2
2
|
|
|
3
|
+
/** Options for configuring an IndexedDB persistence instance. */
|
|
3
4
|
export interface IndexedDbPersistenceOptions {
|
|
4
5
|
/** Key under which the document is stored. Distinct keys isolate editors. */
|
|
5
6
|
key?: string;
|
|
6
7
|
dbName?: string;
|
|
7
8
|
storeName?: string;
|
|
8
9
|
}
|
|
10
|
+
/** IndexedDB-backed persistence contract for saving and loading documents. */
|
|
9
11
|
export interface IndexedDbPersistence {
|
|
12
|
+
/** Persists the document to IndexedDB. */
|
|
10
13
|
saveDocument(doc: EditorDocument): Promise<void>;
|
|
14
|
+
/** Loads the document from IndexedDB, or null if none exists. */
|
|
11
15
|
loadDocument(): Promise<EditorDocument | null>;
|
|
16
|
+
/** Removes the stored document from IndexedDB. */
|
|
12
17
|
clearDocument(): Promise<void>;
|
|
18
|
+
/** Closes the database connection. */
|
|
13
19
|
close(): void;
|
|
14
20
|
}
|
|
15
21
|
/**
|
|
16
|
-
*
|
|
22
|
+
* Creates an IndexedDB-backed persistence instance. Each call owns its own
|
|
17
23
|
* connection and storage key, so two editors on the same page never share a
|
|
18
24
|
* document slot. There is intentionally no module-level singleton.
|
|
25
|
+
*
|
|
26
|
+
* @param options - Configuration options for the persistence instance.
|
|
27
|
+
* @returns A new IndexedDbPersistence instance.
|
|
19
28
|
*/
|
|
20
29
|
export declare function createIndexedDbPersistence(options?: IndexedDbPersistenceOptions): IndexedDbPersistence;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { EditorState } from '../../core/model.js';
|
|
2
2
|
import { TablePropertiesDialogApplyValues, TablePropertiesDialogInitialValues } from '../../ui/components/Dialogs/TablePropertiesDialog.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @param state - The current editor state.
|
|
6
|
+
* @returns Whether the current selection sits inside a table.
|
|
7
|
+
*/
|
|
5
8
|
export declare function hasActiveTable(state: EditorState): boolean;
|
|
6
9
|
/**
|
|
7
|
-
* Reads the active table/cell into the dialog's initial values
|
|
8
|
-
*
|
|
10
|
+
* Reads the active table/cell into the dialog's initial values.
|
|
11
|
+
* @param state - The current editor state.
|
|
12
|
+
* @param activeTab - The default active tab in the dialog.
|
|
13
|
+
* @returns The dialog initial values, or `null` when the selection is not inside a table.
|
|
9
14
|
*/
|
|
10
15
|
export declare function readTableProperties(state: EditorState, activeTab?: TablePropertiesDialogInitialValues["activeTab"]): TablePropertiesDialogInitialValues | null;
|
|
11
16
|
/**
|
|
12
17
|
* Applies the dialog's submitted values to the active table/cell, returning the
|
|
13
18
|
* next state. A no-op when the selection is no longer inside a table.
|
|
19
|
+
*
|
|
20
|
+
* @param state - The current editor state.
|
|
21
|
+
* @param values - The dialog values to apply.
|
|
22
|
+
* @returns The next editor state.
|
|
14
23
|
*/
|
|
15
24
|
export declare function applyTableProperties(state: EditorState, values: TablePropertiesDialogApplyValues): EditorState;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
/** @returns Whether the welcome overlay has been seen. */
|
|
1
2
|
export declare function getWelcomeSeen(): boolean;
|
|
3
|
+
/** Marks the welcome overlay as seen. */
|
|
2
4
|
export declare function setWelcomeSeen(): void;
|
|
5
|
+
/** @returns Whether the user prefers precise font rendering. */
|
|
3
6
|
export declare function getPreciseFontPreference(): boolean;
|
|
7
|
+
/** @param on - Whether precise font rendering should be enabled. */
|
|
4
8
|
export declare function setPreciseFontPreference(on: boolean): void;
|