@pixerate/editor 0.144.0 → 0.146.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/animation/index.cjs +2 -2
- package/dist/animation/index.js +1 -1
- package/dist/animation/player.d.cts +5 -0
- package/dist/animation/player.d.ts +5 -0
- package/dist/animation-editor/controller.d.cts +101 -1
- package/dist/animation-editor/controller.d.ts +101 -1
- package/dist/animation-editor/index.cjs +594 -147
- package/dist/animation-editor/index.d.cts +1 -0
- package/dist/animation-editor/index.d.ts +1 -0
- package/dist/animation-editor/index.js +525 -78
- package/dist/animation-editor/record.d.cts +114 -0
- package/dist/animation-editor/record.d.ts +114 -0
- package/dist/animation-editor/tools.d.cts +1 -0
- package/dist/animation-editor/tools.d.ts +1 -0
- package/dist/animation-editor/types.d.cts +6 -0
- package/dist/animation-editor/types.d.ts +6 -0
- package/dist/canvas/index.cjs +24 -24
- package/dist/canvas/index.js +1 -1
- package/dist/chunk-HRLT5BYO.js +133 -0
- package/dist/chunk-KC7HB5GF.cjs +133 -0
- package/dist/{chunk-I4T4J27S.js → chunk-QX25HWFL.js} +9 -0
- package/dist/{chunk-SVR5FR7B.cjs → chunk-UUTTJK77.cjs} +9 -0
- package/dist/diagram/editorDocument.d.cts +12 -0
- package/dist/diagram/editorDocument.d.ts +12 -0
- package/dist/diagram/index.cjs +35 -1
- package/dist/diagram/index.d.cts +1 -0
- package/dist/diagram/index.d.ts +1 -0
- package/dist/diagram/index.js +34 -0
- package/dist/persistence/documentStore.d.cts +51 -0
- package/dist/persistence/documentStore.d.ts +51 -0
- package/dist/persistence/documentTools.d.cts +35 -0
- package/dist/persistence/documentTools.d.ts +35 -0
- package/dist/persistence/editorAutosave.d.cts +33 -0
- package/dist/persistence/editorAutosave.d.ts +33 -0
- package/dist/persistence/editorDocument.d.cts +118 -0
- package/dist/persistence/editorDocument.d.ts +118 -0
- package/dist/persistence/index.cjs +294 -1
- package/dist/persistence/index.d.cts +4 -0
- package/dist/persistence/index.d.ts +4 -0
- package/dist/persistence/index.js +293 -0
- package/dist/video-editor/index.cjs +2 -2
- package/dist/video-editor/index.js +1 -1
- package/package.json +1 -1
- package/skills/pixerate-agent-tools/SKILL.md +21 -0
- package/skills/pixerate-animation-editor/SKILL.md +10 -0
- package/skills/pixerate-animation-editor/references/commands.md +3 -1
- package/skills/pixerate-diagram/SKILL.md +13 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentToolProvider } from "../tools/registry.js";
|
|
2
|
+
import type { EditorDocumentStore } from "./documentStore.js";
|
|
3
|
+
import type { EditorDocument } from "./editorDocument.js";
|
|
4
|
+
export interface DocumentToolProviderOptions {
|
|
5
|
+
/** Provider id (default `<kind>-document`). */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Tool-name prefix (`<namespace>__<name>`); defaults to the id, `''` for bare names. */
|
|
8
|
+
namespace?: string;
|
|
9
|
+
/** Toolset title (default "<Noun> document"). */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** The skill that documents the editor's tools, e.g. `pixerate-diagram`. */
|
|
12
|
+
skill?: string;
|
|
13
|
+
/** What the document is called in descriptions (default the kind with spaces, e.g. "video project"). */
|
|
14
|
+
noun?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Add `undo_<kind>` / `redo_<kind>` (default `true`). Pass `false` for editors
|
|
17
|
+
* whose own provider already has them.
|
|
18
|
+
*/
|
|
19
|
+
history?: boolean;
|
|
20
|
+
/** Saved documents: adds `save_<kind>_document`, `list_saved_<kind>_documents` and `open_saved_<kind>_document`. */
|
|
21
|
+
store?: EditorDocumentStore;
|
|
22
|
+
/** Name `save_<kind>_document` uses when none is given (default "Untitled <noun>"). */
|
|
23
|
+
name?: () => string | undefined;
|
|
24
|
+
/** `get_<kind>_document` refuses documents whose JSON is longer than this (default 200000 characters). */
|
|
25
|
+
maxChars?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The same document tools for every editor, named after `doc.kind`:
|
|
29
|
+
* `get_<kind>_document`, `load_<kind>_document`, `undo_<kind>`, `redo_<kind>`
|
|
30
|
+
* and, with a `store`, `save_<kind>_document`, `list_saved_<kind>_documents`
|
|
31
|
+
* and `open_saved_<kind>_document`. Loads are checked before anything changes
|
|
32
|
+
* and are one undo step where the editor supports it. A read-only document
|
|
33
|
+
* keeps its read tools; its write tools refuse with the reason.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createDocumentToolProvider(doc: EditorDocument, options?: DocumentToolProviderOptions): AgentToolProvider;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type AutosaveController, type AutosaveControllerOptions, type AutosaveRecovery } from "./autosave.cjs";
|
|
2
|
+
import { type EditorDocument, type EditorDocumentFile } from "./editorDocument.cjs";
|
|
3
|
+
import type { LoadReport } from "./migrate.cjs";
|
|
4
|
+
import { type DirtyFlagSource, type RevisionTracker } from "./revisions.cjs";
|
|
5
|
+
export interface EditorAutosaveOptions extends Omit<AutosaveControllerOptions<EditorDocumentFile>, "getSnapshot" | "serialize" | "deserialize" | "revision" | "savedRevision" | "key"> {
|
|
6
|
+
/** Snapshot key (default the document's `kind`). */
|
|
7
|
+
key?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Saved-vs-current flag (e.g. `bindDirtyToHistory`), so undoing back to the
|
|
10
|
+
* saved state needs no snapshot. Without it, every change counts until `markClean()`.
|
|
11
|
+
*/
|
|
12
|
+
dirty?: DirtyFlagSource;
|
|
13
|
+
}
|
|
14
|
+
export interface EditorAutosave {
|
|
15
|
+
readonly controller: AutosaveController<EditorDocumentFile>;
|
|
16
|
+
readonly revisions: RevisionTracker;
|
|
17
|
+
/** An earlier session's unsaved snapshot of this document, or `null`. */
|
|
18
|
+
checkRecovery(): Promise<AutosaveRecovery<EditorDocumentFile> | null>;
|
|
19
|
+
/** Loads a recovered snapshot into the document and starts autosaving. */
|
|
20
|
+
restore(recovery: AutosaveRecovery<EditorDocumentFile>): LoadReport;
|
|
21
|
+
/** Deletes the earlier session's snapshot and starts autosaving. */
|
|
22
|
+
discard(): Promise<void>;
|
|
23
|
+
/** Call after an explicit save. */
|
|
24
|
+
markClean(): Promise<void>;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Crash-recovery autosave for any editor: snapshots `doc` as an
|
|
29
|
+
* `EditorDocumentFile` after each change. Like `createAutosaveController`,
|
|
30
|
+
* nothing is written until the recovery check is settled: call
|
|
31
|
+
* `controller.ready()` when nothing was found, or `restore` / `discard`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createEditorAutosave(doc: EditorDocument, options: EditorAutosaveOptions): EditorAutosave;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type AutosaveController, type AutosaveControllerOptions, type AutosaveRecovery } from "./autosave.js";
|
|
2
|
+
import { type EditorDocument, type EditorDocumentFile } from "./editorDocument.js";
|
|
3
|
+
import type { LoadReport } from "./migrate.js";
|
|
4
|
+
import { type DirtyFlagSource, type RevisionTracker } from "./revisions.js";
|
|
5
|
+
export interface EditorAutosaveOptions extends Omit<AutosaveControllerOptions<EditorDocumentFile>, "getSnapshot" | "serialize" | "deserialize" | "revision" | "savedRevision" | "key"> {
|
|
6
|
+
/** Snapshot key (default the document's `kind`). */
|
|
7
|
+
key?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Saved-vs-current flag (e.g. `bindDirtyToHistory`), so undoing back to the
|
|
10
|
+
* saved state needs no snapshot. Without it, every change counts until `markClean()`.
|
|
11
|
+
*/
|
|
12
|
+
dirty?: DirtyFlagSource;
|
|
13
|
+
}
|
|
14
|
+
export interface EditorAutosave {
|
|
15
|
+
readonly controller: AutosaveController<EditorDocumentFile>;
|
|
16
|
+
readonly revisions: RevisionTracker;
|
|
17
|
+
/** An earlier session's unsaved snapshot of this document, or `null`. */
|
|
18
|
+
checkRecovery(): Promise<AutosaveRecovery<EditorDocumentFile> | null>;
|
|
19
|
+
/** Loads a recovered snapshot into the document and starts autosaving. */
|
|
20
|
+
restore(recovery: AutosaveRecovery<EditorDocumentFile>): LoadReport;
|
|
21
|
+
/** Deletes the earlier session's snapshot and starts autosaving. */
|
|
22
|
+
discard(): Promise<void>;
|
|
23
|
+
/** Call after an explicit save. */
|
|
24
|
+
markClean(): Promise<void>;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Crash-recovery autosave for any editor: snapshots `doc` as an
|
|
29
|
+
* `EditorDocumentFile` after each change. Like `createAutosaveController`,
|
|
30
|
+
* nothing is written until the recovery check is settled: call
|
|
31
|
+
* `controller.ready()` when nothing was found, or `restore` / `discard`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createEditorAutosave(doc: EditorDocument, options: EditorAutosaveOptions): EditorAutosave;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { type LoadReport } from "./migrate.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Undo / redo of an editor. Satisfies `HistoryCommandTarget`, so
|
|
4
|
+
* `createHistoryCommands(doc.history)` works for every editor.
|
|
5
|
+
*/
|
|
6
|
+
export interface EditorDocumentHistory {
|
|
7
|
+
/** Returns `false` when there was nothing to undo. */
|
|
8
|
+
undo(): boolean;
|
|
9
|
+
/** Returns `false` when there was nothing to redo. */
|
|
10
|
+
redo(): boolean;
|
|
11
|
+
getState(): {
|
|
12
|
+
canUndo: boolean;
|
|
13
|
+
canRedo: boolean;
|
|
14
|
+
undoName?: string;
|
|
15
|
+
redoName?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface LoadEditorDocumentOptions {
|
|
19
|
+
/**
|
|
20
|
+
* `"reset"` (default) opens the document fresh and clears the undo stack.
|
|
21
|
+
* `"record"` makes the load one undo step (agent loads); editors whose
|
|
22
|
+
* `recordsLoads` is `false` reset instead.
|
|
23
|
+
*/
|
|
24
|
+
history?: "reset" | "record";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The save / load / undo contract every editor exposes (e.g.
|
|
28
|
+
* `createDiagramEditorDocument(controller)`). Autosave
|
|
29
|
+
* (`createEditorAutosave`), the agent tools (`createDocumentToolProvider`) and
|
|
30
|
+
* the React / Svelte wrappers take it, so they work the same for every editor.
|
|
31
|
+
*/
|
|
32
|
+
export interface EditorDocument<T = unknown> {
|
|
33
|
+
/** Editor domain, e.g. `"diagram"`; names the tools and storage keys (`[a-z][a-z0-9_]*`). */
|
|
34
|
+
readonly kind: string;
|
|
35
|
+
/** The format version `getDocument()` writes; older files are migrated on load. */
|
|
36
|
+
readonly formatVersion: number;
|
|
37
|
+
/** Whether `loadDocument(…, { history: "record" })` is one undo step. */
|
|
38
|
+
readonly recordsLoads: boolean;
|
|
39
|
+
/** Plain JSON snapshot of the whole document; `loadDocument(getDocument())` changes nothing. */
|
|
40
|
+
getDocument(): T;
|
|
41
|
+
/**
|
|
42
|
+
* Replaces the document with a raw document or an `EditorDocumentFile`.
|
|
43
|
+
* Validates and migrates first: throws `EditorDocumentLoadError` and changes
|
|
44
|
+
* nothing when the input does not fit.
|
|
45
|
+
*/
|
|
46
|
+
loadDocument(input: unknown, options?: LoadEditorDocumentOptions): LoadReport;
|
|
47
|
+
/** Bumped on every document change, including undo, redo and load (not on selection). */
|
|
48
|
+
revision(): number;
|
|
49
|
+
/** Called after every document change. Returns an unsubscribe function. */
|
|
50
|
+
subscribe(listener: () => void): () => void;
|
|
51
|
+
readonly history: EditorDocumentHistory;
|
|
52
|
+
/** Why the document cannot be changed (a sentence, e.g. "The diagram is read-only."), or `false`. */
|
|
53
|
+
readOnly(): string | false;
|
|
54
|
+
/** Stops listening to the editor; `subscribe` or `revision` reconnects (React StrictMode remounts). */
|
|
55
|
+
destroy(): void;
|
|
56
|
+
}
|
|
57
|
+
/** Thrown by `loadDocument` / `parseEditorDocument` when the input does not fit; nothing changed. */
|
|
58
|
+
export declare class EditorDocumentLoadError extends Error {
|
|
59
|
+
/** The `LoadReport` when the input was a file that could not be migrated. */
|
|
60
|
+
readonly report?: LoadReport;
|
|
61
|
+
constructor(message: string, report?: LoadReport);
|
|
62
|
+
}
|
|
63
|
+
/** Marker of a saved editor document file (`EditorDocumentFile.format`). */
|
|
64
|
+
export declare const EDITOR_DOCUMENT_FORMAT = "pixerate.editor-document";
|
|
65
|
+
/** A document as it is saved: names its editor and format version. */
|
|
66
|
+
export interface EditorDocumentFile<T = unknown> {
|
|
67
|
+
format: typeof EDITOR_DOCUMENT_FORMAT;
|
|
68
|
+
kind: string;
|
|
69
|
+
formatVersion: number;
|
|
70
|
+
/** Display name, when it has one. */
|
|
71
|
+
name?: string;
|
|
72
|
+
document: T;
|
|
73
|
+
}
|
|
74
|
+
export declare function isEditorDocumentFile(value: unknown): value is EditorDocumentFile;
|
|
75
|
+
/** The current document wrapped as a file (what autosave and the save tools store). */
|
|
76
|
+
export declare function toEditorDocumentFile<T>(doc: EditorDocument<T>, name?: string): EditorDocumentFile<T>;
|
|
77
|
+
/** JSON text of the current document as a file. */
|
|
78
|
+
export declare function serializeEditorDocument(doc: EditorDocument, options?: {
|
|
79
|
+
name?: string;
|
|
80
|
+
space?: number;
|
|
81
|
+
}): string;
|
|
82
|
+
/**
|
|
83
|
+
* Parses a file written by `serializeEditorDocument`. With `kind`, a file of
|
|
84
|
+
* another editor is refused. Throws `EditorDocumentLoadError` with a message
|
|
85
|
+
* that says what is wrong.
|
|
86
|
+
*/
|
|
87
|
+
export declare function parseEditorDocument<T = unknown>(text: string, options?: {
|
|
88
|
+
kind?: string;
|
|
89
|
+
}): EditorDocumentFile<T>;
|
|
90
|
+
/** What an editor supplies to `defineEditorDocument`. */
|
|
91
|
+
export interface EditorDocumentSpec<T> {
|
|
92
|
+
kind: string;
|
|
93
|
+
/** Default 1. */
|
|
94
|
+
formatVersion?: number;
|
|
95
|
+
/** Default `true`: `load` honours `history: "record"`. */
|
|
96
|
+
recordsLoads?: boolean;
|
|
97
|
+
get(): T;
|
|
98
|
+
/**
|
|
99
|
+
* Replaces the document. Throw (with a message saying what is wrong) before
|
|
100
|
+
* changing anything when `document` does not fit.
|
|
101
|
+
*/
|
|
102
|
+
load(document: unknown, options: {
|
|
103
|
+
history: "reset" | "record";
|
|
104
|
+
}): void;
|
|
105
|
+
/** Calls `listener` after each document change (not selection or view changes). */
|
|
106
|
+
subscribe(listener: () => void): () => void;
|
|
107
|
+
history: EditorDocumentHistory;
|
|
108
|
+
/** Why the document cannot be changed, or `false` (default: never read-only). */
|
|
109
|
+
readOnly?: () => string | false;
|
|
110
|
+
/** `migrations[v]` turns a version `v` document into version `v + 1`. */
|
|
111
|
+
migrations?: Record<number, (document: unknown) => unknown>;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Builds an `EditorDocument` from an editor's own methods: counts revisions,
|
|
115
|
+
* unwraps and migrates files, and turns load failures into
|
|
116
|
+
* `EditorDocumentLoadError`.
|
|
117
|
+
*/
|
|
118
|
+
export declare function defineEditorDocument<T>(spec: EditorDocumentSpec<T>): EditorDocument<T>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { type LoadReport } from "./migrate.js";
|
|
2
|
+
/**
|
|
3
|
+
* Undo / redo of an editor. Satisfies `HistoryCommandTarget`, so
|
|
4
|
+
* `createHistoryCommands(doc.history)` works for every editor.
|
|
5
|
+
*/
|
|
6
|
+
export interface EditorDocumentHistory {
|
|
7
|
+
/** Returns `false` when there was nothing to undo. */
|
|
8
|
+
undo(): boolean;
|
|
9
|
+
/** Returns `false` when there was nothing to redo. */
|
|
10
|
+
redo(): boolean;
|
|
11
|
+
getState(): {
|
|
12
|
+
canUndo: boolean;
|
|
13
|
+
canRedo: boolean;
|
|
14
|
+
undoName?: string;
|
|
15
|
+
redoName?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface LoadEditorDocumentOptions {
|
|
19
|
+
/**
|
|
20
|
+
* `"reset"` (default) opens the document fresh and clears the undo stack.
|
|
21
|
+
* `"record"` makes the load one undo step (agent loads); editors whose
|
|
22
|
+
* `recordsLoads` is `false` reset instead.
|
|
23
|
+
*/
|
|
24
|
+
history?: "reset" | "record";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The save / load / undo contract every editor exposes (e.g.
|
|
28
|
+
* `createDiagramEditorDocument(controller)`). Autosave
|
|
29
|
+
* (`createEditorAutosave`), the agent tools (`createDocumentToolProvider`) and
|
|
30
|
+
* the React / Svelte wrappers take it, so they work the same for every editor.
|
|
31
|
+
*/
|
|
32
|
+
export interface EditorDocument<T = unknown> {
|
|
33
|
+
/** Editor domain, e.g. `"diagram"`; names the tools and storage keys (`[a-z][a-z0-9_]*`). */
|
|
34
|
+
readonly kind: string;
|
|
35
|
+
/** The format version `getDocument()` writes; older files are migrated on load. */
|
|
36
|
+
readonly formatVersion: number;
|
|
37
|
+
/** Whether `loadDocument(…, { history: "record" })` is one undo step. */
|
|
38
|
+
readonly recordsLoads: boolean;
|
|
39
|
+
/** Plain JSON snapshot of the whole document; `loadDocument(getDocument())` changes nothing. */
|
|
40
|
+
getDocument(): T;
|
|
41
|
+
/**
|
|
42
|
+
* Replaces the document with a raw document or an `EditorDocumentFile`.
|
|
43
|
+
* Validates and migrates first: throws `EditorDocumentLoadError` and changes
|
|
44
|
+
* nothing when the input does not fit.
|
|
45
|
+
*/
|
|
46
|
+
loadDocument(input: unknown, options?: LoadEditorDocumentOptions): LoadReport;
|
|
47
|
+
/** Bumped on every document change, including undo, redo and load (not on selection). */
|
|
48
|
+
revision(): number;
|
|
49
|
+
/** Called after every document change. Returns an unsubscribe function. */
|
|
50
|
+
subscribe(listener: () => void): () => void;
|
|
51
|
+
readonly history: EditorDocumentHistory;
|
|
52
|
+
/** Why the document cannot be changed (a sentence, e.g. "The diagram is read-only."), or `false`. */
|
|
53
|
+
readOnly(): string | false;
|
|
54
|
+
/** Stops listening to the editor; `subscribe` or `revision` reconnects (React StrictMode remounts). */
|
|
55
|
+
destroy(): void;
|
|
56
|
+
}
|
|
57
|
+
/** Thrown by `loadDocument` / `parseEditorDocument` when the input does not fit; nothing changed. */
|
|
58
|
+
export declare class EditorDocumentLoadError extends Error {
|
|
59
|
+
/** The `LoadReport` when the input was a file that could not be migrated. */
|
|
60
|
+
readonly report?: LoadReport;
|
|
61
|
+
constructor(message: string, report?: LoadReport);
|
|
62
|
+
}
|
|
63
|
+
/** Marker of a saved editor document file (`EditorDocumentFile.format`). */
|
|
64
|
+
export declare const EDITOR_DOCUMENT_FORMAT = "pixerate.editor-document";
|
|
65
|
+
/** A document as it is saved: names its editor and format version. */
|
|
66
|
+
export interface EditorDocumentFile<T = unknown> {
|
|
67
|
+
format: typeof EDITOR_DOCUMENT_FORMAT;
|
|
68
|
+
kind: string;
|
|
69
|
+
formatVersion: number;
|
|
70
|
+
/** Display name, when it has one. */
|
|
71
|
+
name?: string;
|
|
72
|
+
document: T;
|
|
73
|
+
}
|
|
74
|
+
export declare function isEditorDocumentFile(value: unknown): value is EditorDocumentFile;
|
|
75
|
+
/** The current document wrapped as a file (what autosave and the save tools store). */
|
|
76
|
+
export declare function toEditorDocumentFile<T>(doc: EditorDocument<T>, name?: string): EditorDocumentFile<T>;
|
|
77
|
+
/** JSON text of the current document as a file. */
|
|
78
|
+
export declare function serializeEditorDocument(doc: EditorDocument, options?: {
|
|
79
|
+
name?: string;
|
|
80
|
+
space?: number;
|
|
81
|
+
}): string;
|
|
82
|
+
/**
|
|
83
|
+
* Parses a file written by `serializeEditorDocument`. With `kind`, a file of
|
|
84
|
+
* another editor is refused. Throws `EditorDocumentLoadError` with a message
|
|
85
|
+
* that says what is wrong.
|
|
86
|
+
*/
|
|
87
|
+
export declare function parseEditorDocument<T = unknown>(text: string, options?: {
|
|
88
|
+
kind?: string;
|
|
89
|
+
}): EditorDocumentFile<T>;
|
|
90
|
+
/** What an editor supplies to `defineEditorDocument`. */
|
|
91
|
+
export interface EditorDocumentSpec<T> {
|
|
92
|
+
kind: string;
|
|
93
|
+
/** Default 1. */
|
|
94
|
+
formatVersion?: number;
|
|
95
|
+
/** Default `true`: `load` honours `history: "record"`. */
|
|
96
|
+
recordsLoads?: boolean;
|
|
97
|
+
get(): T;
|
|
98
|
+
/**
|
|
99
|
+
* Replaces the document. Throw (with a message saying what is wrong) before
|
|
100
|
+
* changing anything when `document` does not fit.
|
|
101
|
+
*/
|
|
102
|
+
load(document: unknown, options: {
|
|
103
|
+
history: "reset" | "record";
|
|
104
|
+
}): void;
|
|
105
|
+
/** Calls `listener` after each document change (not selection or view changes). */
|
|
106
|
+
subscribe(listener: () => void): () => void;
|
|
107
|
+
history: EditorDocumentHistory;
|
|
108
|
+
/** Why the document cannot be changed, or `false` (default: never read-only). */
|
|
109
|
+
readOnly?: () => string | false;
|
|
110
|
+
/** `migrations[v]` turns a version `v` document into version `v + 1`. */
|
|
111
|
+
migrations?: Record<number, (document: unknown) => unknown>;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Builds an `EditorDocument` from an editor's own methods: counts revisions,
|
|
115
|
+
* unwraps and migrates files, and turns load failures into
|
|
116
|
+
* `EditorDocumentLoadError`.
|
|
117
|
+
*/
|
|
118
|
+
export declare function defineEditorDocument<T>(spec: EditorDocumentSpec<T>): EditorDocument<T>;
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkKC7HB5GFcjs = require('../chunk-KC7HB5GF.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
7
16
|
var _chunkL5OWG2NAcjs = require('../chunk-L5OWG2NA.cjs');
|
|
8
17
|
require('../chunk-2BSBFBOA.cjs');
|
|
9
18
|
|
|
@@ -652,6 +661,290 @@ function createRevisionTracker(options = {}) {
|
|
|
652
661
|
};
|
|
653
662
|
}
|
|
654
663
|
|
|
664
|
+
// src/persistence/editorAutosave.ts
|
|
665
|
+
function createEditorAutosave(doc, options) {
|
|
666
|
+
const { dirty, key, ...rest } = options;
|
|
667
|
+
const revisions = createRevisionTracker({ history: doc, dirty });
|
|
668
|
+
const controller = createAutosaveController({
|
|
669
|
+
...rest,
|
|
670
|
+
key: _nullishCoalesce(key, () => ( doc.kind)),
|
|
671
|
+
getSnapshot: () => _chunkKC7HB5GFcjs.toEditorDocumentFile.call(void 0, doc),
|
|
672
|
+
deserialize: (text) => _chunkKC7HB5GFcjs.parseEditorDocument.call(void 0, text, { kind: doc.kind }),
|
|
673
|
+
revision: revisions.revision,
|
|
674
|
+
savedRevision: revisions.savedRevision
|
|
675
|
+
});
|
|
676
|
+
const unsubscribe = revisions.subscribe(() => controller.notify());
|
|
677
|
+
return {
|
|
678
|
+
controller,
|
|
679
|
+
revisions,
|
|
680
|
+
checkRecovery: () => controller.checkRecovery(),
|
|
681
|
+
restore(recovery) {
|
|
682
|
+
if (!recovery.snapshot) throw _nullishCoalesce(recovery.error, () => ( new Error("The recovered snapshot could not be read.")));
|
|
683
|
+
const report = doc.loadDocument(recovery.snapshot, { history: "reset" });
|
|
684
|
+
controller.ready();
|
|
685
|
+
return report;
|
|
686
|
+
},
|
|
687
|
+
async discard() {
|
|
688
|
+
await controller.discardRecovery();
|
|
689
|
+
controller.ready();
|
|
690
|
+
},
|
|
691
|
+
async markClean() {
|
|
692
|
+
revisions.markSaved();
|
|
693
|
+
await controller.markClean();
|
|
694
|
+
},
|
|
695
|
+
destroy() {
|
|
696
|
+
unsubscribe();
|
|
697
|
+
revisions.destroy();
|
|
698
|
+
controller.destroy();
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
// src/persistence/documentStore.ts
|
|
704
|
+
function slugifyDocumentName(name) {
|
|
705
|
+
const slug = name.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80);
|
|
706
|
+
return slug || "untitled";
|
|
707
|
+
}
|
|
708
|
+
function createEditorDocumentStore(options) {
|
|
709
|
+
const { storage } = options;
|
|
710
|
+
const ns = _nullishCoalesce(options.namespace, () => ( "pixerate.documents"));
|
|
711
|
+
const now = _nullishCoalesce(options.now, () => ( Date.now));
|
|
712
|
+
const indexKey = `${ns}:index`;
|
|
713
|
+
const fileKey = (key) => `${ns}:file:${key}`;
|
|
714
|
+
let index = null;
|
|
715
|
+
let queue = Promise.resolve();
|
|
716
|
+
const run = (task) => {
|
|
717
|
+
const result = queue.then(task, task);
|
|
718
|
+
queue = result.catch(() => void 0);
|
|
719
|
+
return result;
|
|
720
|
+
};
|
|
721
|
+
const loadIndex = async () => {
|
|
722
|
+
if (index) return index;
|
|
723
|
+
const raw = await storage.get(indexKey);
|
|
724
|
+
let items = [];
|
|
725
|
+
if (raw) {
|
|
726
|
+
try {
|
|
727
|
+
const data = JSON.parse(raw);
|
|
728
|
+
if (data && Array.isArray(data.items)) {
|
|
729
|
+
items = data.items.filter((item) => item && typeof item.key === "string" && typeof item.kind === "string");
|
|
730
|
+
}
|
|
731
|
+
} catch (e6) {
|
|
732
|
+
items = [];
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
index = items;
|
|
736
|
+
return index;
|
|
737
|
+
};
|
|
738
|
+
const saveIndex = async (items) => {
|
|
739
|
+
await storage.set(indexKey, JSON.stringify({ version: 1, items }));
|
|
740
|
+
index = items;
|
|
741
|
+
};
|
|
742
|
+
const newestFirst = (a, b) => a.savedAt < b.savedAt ? 1 : a.savedAt > b.savedAt ? -1 : 0;
|
|
743
|
+
const readFile = async (key) => {
|
|
744
|
+
const raw = await storage.get(fileKey(key));
|
|
745
|
+
return raw === null ? null : _chunkKC7HB5GFcjs.parseEditorDocument.call(void 0, raw);
|
|
746
|
+
};
|
|
747
|
+
return {
|
|
748
|
+
save: (doc, name) => run(async () => {
|
|
749
|
+
const trimmed = name.trim() || "Untitled";
|
|
750
|
+
const entry = {
|
|
751
|
+
key: `${doc.kind}/${slugifyDocumentName(trimmed)}`,
|
|
752
|
+
kind: doc.kind,
|
|
753
|
+
name: trimmed,
|
|
754
|
+
formatVersion: doc.formatVersion,
|
|
755
|
+
savedAt: new Date(now()).toISOString()
|
|
756
|
+
};
|
|
757
|
+
await storage.set(fileKey(entry.key), JSON.stringify(_chunkKC7HB5GFcjs.toEditorDocumentFile.call(void 0, doc, trimmed)));
|
|
758
|
+
await saveIndex([...(await loadIndex()).filter((item) => item.key !== entry.key), entry]);
|
|
759
|
+
return entry;
|
|
760
|
+
}),
|
|
761
|
+
list: (kind) => run(async () => (await loadIndex()).filter((item) => !kind || item.kind === kind).sort(newestFirst)),
|
|
762
|
+
read: (key) => run(() => readFile(key)),
|
|
763
|
+
open: (doc, key, openOptions = {}) => run(async () => {
|
|
764
|
+
const entry = (await loadIndex()).find((item) => item.key === key);
|
|
765
|
+
const file = entry ? await readFile(key) : null;
|
|
766
|
+
if (!entry || !file) {
|
|
767
|
+
const keys = (await loadIndex()).filter((item) => item.kind === doc.kind).sort(newestFirst).map((item) => item.key);
|
|
768
|
+
throw new (0, _chunkKC7HB5GFcjs.EditorDocumentLoadError)(
|
|
769
|
+
`There is no saved document "${key}". ${keys.length ? `Saved ${doc.kind} documents: ${keys.join(", ")}.` : `No ${doc.kind} documents are saved yet.`}`
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
const report = doc.loadDocument(file, { history: _nullishCoalesce(openOptions.history, () => ( "reset")) });
|
|
773
|
+
return { ...entry, report };
|
|
774
|
+
}),
|
|
775
|
+
remove: (key) => run(async () => {
|
|
776
|
+
const items = await loadIndex();
|
|
777
|
+
if (!items.some((item) => item.key === key)) return false;
|
|
778
|
+
await saveIndex(items.filter((item) => item.key !== key));
|
|
779
|
+
await storage.remove(fileKey(key));
|
|
780
|
+
return true;
|
|
781
|
+
})
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// src/persistence/documentTools.ts
|
|
786
|
+
var READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
|
|
787
|
+
var WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
|
|
788
|
+
var REPLACE = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false };
|
|
789
|
+
var OVERWRITE = { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false };
|
|
790
|
+
var object = (properties, required = []) => ({
|
|
791
|
+
type: "object",
|
|
792
|
+
properties,
|
|
793
|
+
...required.length ? { required } : {},
|
|
794
|
+
additionalProperties: false
|
|
795
|
+
});
|
|
796
|
+
var reportOut = (report) => ({
|
|
797
|
+
...report.migratedFrom !== null ? { migratedFrom: report.migratedFrom } : {},
|
|
798
|
+
...report.problems.length ? { problems: report.problems } : {},
|
|
799
|
+
...report.unknownKeys.length ? { unknownKeys: report.unknownKeys } : {}
|
|
800
|
+
});
|
|
801
|
+
function createDocumentToolProvider(doc, options = {}) {
|
|
802
|
+
const { kind } = doc;
|
|
803
|
+
const noun = _nullishCoalesce(options.noun, () => ( kind.replace(/_/g, " ")));
|
|
804
|
+
const maxChars = _nullishCoalesce(options.maxChars, () => ( 2e5));
|
|
805
|
+
const store = options.store;
|
|
806
|
+
const writable = () => {
|
|
807
|
+
const reason = doc.readOnly();
|
|
808
|
+
if (reason) throw new Error(`${reason} Read tools still work; write tools are refused.`);
|
|
809
|
+
};
|
|
810
|
+
const historyOut = () => {
|
|
811
|
+
const h = doc.history.getState();
|
|
812
|
+
return {
|
|
813
|
+
revision: doc.revision(),
|
|
814
|
+
canUndo: h.canUndo,
|
|
815
|
+
canRedo: h.canRedo,
|
|
816
|
+
...h.undoName ? { undoName: h.undoName } : {},
|
|
817
|
+
...h.redoName ? { redoName: h.redoName } : {}
|
|
818
|
+
};
|
|
819
|
+
};
|
|
820
|
+
const loaded = (report) => ({
|
|
821
|
+
revision: doc.revision(),
|
|
822
|
+
undoable: doc.recordsLoads,
|
|
823
|
+
...reportOut(report)
|
|
824
|
+
});
|
|
825
|
+
const get = {
|
|
826
|
+
name: `get_${kind}_document`,
|
|
827
|
+
title: `Get the ${noun} document`,
|
|
828
|
+
description: `Returns the whole ${noun} as plain JSON: { kind, formatVersion, revision, document }. Use it to keep a copy, compare versions or pass the document to load_${kind}_document later. For reading or editing parts of the ${noun}, prefer the editor's own read tools: this result can be large.`,
|
|
829
|
+
inputSchema: object({}),
|
|
830
|
+
annotations: { title: `Get the ${noun} document`, ...READ },
|
|
831
|
+
handler: () => {
|
|
832
|
+
const document = doc.getDocument();
|
|
833
|
+
const size = _nullishCoalesce(_optionalChain([JSON, 'access', _6 => _6.stringify, 'call', _7 => _7(document), 'optionalAccess', _8 => _8.length]), () => ( 0));
|
|
834
|
+
if (size > maxChars) {
|
|
835
|
+
throw new Error(`The ${noun} document is ${size} characters of JSON, over the ${maxChars} limit for this tool. Use the editor's read tools to look at parts of it.`);
|
|
836
|
+
}
|
|
837
|
+
return { kind, formatVersion: doc.formatVersion, revision: doc.revision(), document };
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
const load = {
|
|
841
|
+
name: `load_${kind}_document`,
|
|
842
|
+
title: `Load a ${noun} document`,
|
|
843
|
+
description: `Replaces the whole ${noun} with a document from get_${kind}_document (its "document" value, or the whole result as a saved file). The document is checked first: when it does not fit, nothing changes and the error says why. Returns { revision, undoable, migratedFrom?, problems?, unknownKeys? }; undoable: true means undo_${kind} brings the previous ${noun} back.`,
|
|
844
|
+
inputSchema: object(
|
|
845
|
+
{
|
|
846
|
+
document: {
|
|
847
|
+
type: "object",
|
|
848
|
+
description: `The ${noun} document: the "document" value from get_${kind}_document, or a saved file ({ format, kind, formatVersion, document }).`
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
["document"]
|
|
852
|
+
),
|
|
853
|
+
annotations: { title: `Load a ${noun} document`, ...REPLACE },
|
|
854
|
+
handler: ({ document }) => {
|
|
855
|
+
writable();
|
|
856
|
+
return loaded(doc.loadDocument(document, { history: "record" }));
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
const undo = {
|
|
860
|
+
name: `undo_${kind}`,
|
|
861
|
+
title: `Undo a ${noun} edit`,
|
|
862
|
+
description: `Undoes the last ${noun} edit (one tool call or one user gesture). Returns { undone, revision, canUndo, canRedo, undoName?, redoName? }; undone is the name of the step that was undone.`,
|
|
863
|
+
inputSchema: object({}),
|
|
864
|
+
annotations: { title: `Undo a ${noun} edit`, ...WRITE },
|
|
865
|
+
handler: () => {
|
|
866
|
+
writable();
|
|
867
|
+
const name = doc.history.getState().undoName;
|
|
868
|
+
if (!doc.history.getState().canUndo || !doc.history.undo()) throw new Error("Nothing to undo.");
|
|
869
|
+
return { undone: _nullishCoalesce(name, () => ( true)), ...historyOut() };
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
const redo = {
|
|
873
|
+
name: `redo_${kind}`,
|
|
874
|
+
title: `Redo a ${noun} edit`,
|
|
875
|
+
description: `Redoes the last undone ${noun} edit. Returns { redone, revision, canUndo, canRedo, undoName?, redoName? }; redone is the name of the step that was redone.`,
|
|
876
|
+
inputSchema: object({}),
|
|
877
|
+
annotations: { title: `Redo a ${noun} edit`, ...WRITE },
|
|
878
|
+
handler: () => {
|
|
879
|
+
writable();
|
|
880
|
+
const name = doc.history.getState().redoName;
|
|
881
|
+
if (!doc.history.getState().canRedo || !doc.history.redo()) throw new Error("Nothing to redo.");
|
|
882
|
+
return { redone: _nullishCoalesce(name, () => ( true)), ...historyOut() };
|
|
883
|
+
}
|
|
884
|
+
};
|
|
885
|
+
const storeTools = (s) => [
|
|
886
|
+
{
|
|
887
|
+
name: `save_${kind}_document`,
|
|
888
|
+
title: `Save the ${noun}`,
|
|
889
|
+
description: `Saves the current ${noun} under a name in the host's document storage. Saving the same name again replaces that saved copy. Returns { key, name, savedAt, revision }; pass key to open_saved_${kind}_document to load it again.`,
|
|
890
|
+
inputSchema: object({
|
|
891
|
+
name: {
|
|
892
|
+
type: "string",
|
|
893
|
+
minLength: 1,
|
|
894
|
+
maxLength: 200,
|
|
895
|
+
description: `Name to save under (default: the ${noun}'s current name, or "Untitled ${noun}").`
|
|
896
|
+
}
|
|
897
|
+
}),
|
|
898
|
+
annotations: { title: `Save the ${noun}`, ...OVERWRITE },
|
|
899
|
+
handler: async ({ name }) => {
|
|
900
|
+
const entry = await s.save(doc, _nullishCoalesce(_nullishCoalesce(name, () => ( _optionalChain([options, 'access', _9 => _9.name, 'optionalCall', _10 => _10()]))), () => ( `Untitled ${noun}`)));
|
|
901
|
+
return { key: entry.key, name: entry.name, savedAt: entry.savedAt, revision: doc.revision() };
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
name: `list_saved_${kind}_documents`,
|
|
906
|
+
title: `List saved ${noun} documents`,
|
|
907
|
+
description: `Lists the ${noun} documents in the host's document storage, newest first. Returns { documents: [{ key, name, savedAt, formatVersion }] }.`,
|
|
908
|
+
inputSchema: object({}),
|
|
909
|
+
annotations: { title: `List saved ${noun} documents`, ...READ },
|
|
910
|
+
handler: async () => ({
|
|
911
|
+
documents: (await s.list(kind)).map(({ key, name, savedAt, formatVersion }) => ({ key, name, savedAt, formatVersion }))
|
|
912
|
+
})
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
name: `open_saved_${kind}_document`,
|
|
916
|
+
title: `Open a saved ${noun}`,
|
|
917
|
+
description: `Replaces the current ${noun} with a saved one. Unsaved changes stay reachable through undo_${kind} when undoable is true. Returns { key, name, revision, undoable, migratedFrom?, problems?, unknownKeys? }.`,
|
|
918
|
+
inputSchema: object({ key: { type: "string", minLength: 1, description: `A key from list_saved_${kind}_documents or save_${kind}_document.` } }, ["key"]),
|
|
919
|
+
annotations: { title: `Open a saved ${noun}`, ...REPLACE },
|
|
920
|
+
handler: async ({ key }) => {
|
|
921
|
+
writable();
|
|
922
|
+
const entry = await s.open(doc, key, { history: "record" });
|
|
923
|
+
return { key: entry.key, name: entry.name, ...loaded(entry.report) };
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
];
|
|
927
|
+
return {
|
|
928
|
+
id: _nullishCoalesce(options.id, () => ( `${kind}-document`)),
|
|
929
|
+
...options.namespace !== void 0 ? { namespace: options.namespace } : {},
|
|
930
|
+
title: _nullishCoalesce(options.title, () => ( `${noun.charAt(0).toUpperCase()}${noun.slice(1)} document`)),
|
|
931
|
+
description: `Get, load${options.history === false ? "" : ", undo, redo"}${store ? ", save and open" : ""} the whole ${noun}.`,
|
|
932
|
+
...options.skill ? { skill: options.skill } : {},
|
|
933
|
+
tools: [get, load, ...options.history === false ? [] : [undo, redo], ...store ? storeTools(store) : []]
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
|
|
655
948
|
|
|
656
949
|
|
|
657
950
|
|
|
@@ -673,4 +966,4 @@ function createRevisionTracker(options = {}) {
|
|
|
673
966
|
|
|
674
967
|
|
|
675
968
|
|
|
676
|
-
exports.InjectedStorageError = InjectedStorageError; exports.StorageUnavailableError = StorageUnavailableError; exports.createAutosaveController = createAutosaveController; exports.createIndexedDbAdapter = createIndexedDbAdapter; exports.createLoadReport = _chunkL5OWG2NAcjs.createLoadReport; exports.createLocalStorageAdapter = createLocalStorageAdapter; exports.createMemoryStorage = createMemoryStorage; exports.createOpfsAdapter = createOpfsAdapter; exports.createRecoveryPolicy = createRecoveryPolicy; exports.createRevisionTracker = createRevisionTracker; exports.exponentialBackoff = exponentialBackoff; exports.formatRecoveryMessage = formatRecoveryMessage; exports.hasLoadProblems = _chunkL5OWG2NAcjs.hasLoadProblems; exports.isIndexedDbAvailable = isIndexedDbAvailable; exports.isLocalStorageAvailable = isLocalStorageAvailable; exports.isOpfsAvailable = isOpfsAvailable; exports.loadDocument = _chunkL5OWG2NAcjs.loadDocument; exports.loadSections = _chunkL5OWG2NAcjs.loadSections; exports.migrateDocument = _chunkL5OWG2NAcjs.migrateDocument; exports.recoveryMetaKey = recoveryMetaKey; exports.withStorageFailures = withStorageFailures;
|
|
969
|
+
exports.EDITOR_DOCUMENT_FORMAT = _chunkKC7HB5GFcjs.EDITOR_DOCUMENT_FORMAT; exports.EditorDocumentLoadError = _chunkKC7HB5GFcjs.EditorDocumentLoadError; exports.InjectedStorageError = InjectedStorageError; exports.StorageUnavailableError = StorageUnavailableError; exports.createAutosaveController = createAutosaveController; exports.createDocumentToolProvider = createDocumentToolProvider; exports.createEditorAutosave = createEditorAutosave; exports.createEditorDocumentStore = createEditorDocumentStore; exports.createIndexedDbAdapter = createIndexedDbAdapter; exports.createLoadReport = _chunkL5OWG2NAcjs.createLoadReport; exports.createLocalStorageAdapter = createLocalStorageAdapter; exports.createMemoryStorage = createMemoryStorage; exports.createOpfsAdapter = createOpfsAdapter; exports.createRecoveryPolicy = createRecoveryPolicy; exports.createRevisionTracker = createRevisionTracker; exports.defineEditorDocument = _chunkKC7HB5GFcjs.defineEditorDocument; exports.exponentialBackoff = exponentialBackoff; exports.formatRecoveryMessage = formatRecoveryMessage; exports.hasLoadProblems = _chunkL5OWG2NAcjs.hasLoadProblems; exports.isEditorDocumentFile = _chunkKC7HB5GFcjs.isEditorDocumentFile; exports.isIndexedDbAvailable = isIndexedDbAvailable; exports.isLocalStorageAvailable = isLocalStorageAvailable; exports.isOpfsAvailable = isOpfsAvailable; exports.loadDocument = _chunkL5OWG2NAcjs.loadDocument; exports.loadSections = _chunkL5OWG2NAcjs.loadSections; exports.migrateDocument = _chunkL5OWG2NAcjs.migrateDocument; exports.parseEditorDocument = _chunkKC7HB5GFcjs.parseEditorDocument; exports.recoveryMetaKey = recoveryMetaKey; exports.serializeEditorDocument = _chunkKC7HB5GFcjs.serializeEditorDocument; exports.slugifyDocumentName = slugifyDocumentName; exports.toEditorDocumentFile = _chunkKC7HB5GFcjs.toEditorDocumentFile; exports.withStorageFailures = withStorageFailures;
|
|
@@ -3,3 +3,7 @@ export * from "./storage.cjs";
|
|
|
3
3
|
export * from "./autosave.cjs";
|
|
4
4
|
export * from "./migrate.cjs";
|
|
5
5
|
export * from "./revisions.cjs";
|
|
6
|
+
export * from "./editorDocument.cjs";
|
|
7
|
+
export * from "./editorAutosave.cjs";
|
|
8
|
+
export * from "./documentStore.cjs";
|
|
9
|
+
export * from "./documentTools.cjs";
|
|
@@ -3,3 +3,7 @@ export * from "./storage.js";
|
|
|
3
3
|
export * from "./autosave.js";
|
|
4
4
|
export * from "./migrate.js";
|
|
5
5
|
export * from "./revisions.js";
|
|
6
|
+
export * from "./editorDocument.js";
|
|
7
|
+
export * from "./editorAutosave.js";
|
|
8
|
+
export * from "./documentStore.js";
|
|
9
|
+
export * from "./documentTools.js";
|