edytor 3.0.0 → 5.0.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 +2 -2
- package/dist/block/block.svelte.js +6 -21
- package/dist/block/inlineBlock.svelte.js +4 -6
- package/dist/clipboard/moveText.js +6 -8
- package/dist/cloudflare/DocumentRoom.d.ts +23 -12
- package/dist/cloudflare/DocumentRoom.js +10 -6
- package/dist/cloudflare/index.d.ts +1 -1
- package/dist/cloudflare/room/access.d.ts +8 -3
- package/dist/cloudflare/room/access.js +44 -20
- package/dist/cloudflare/room/admission.js +28 -5
- package/dist/cloudflare/room/comments.js +28 -1
- package/dist/cloudflare/room/context.d.ts +139 -129
- package/dist/cloudflare/room/context.js +11 -4
- package/dist/cloudflare/room/forged.d.ts +14 -0
- package/dist/cloudflare/room/forged.js +30 -2
- package/dist/cloudflare/room/frames.d.ts +4 -0
- package/dist/cloudflare/room/frames.js +5 -1
- package/dist/cloudflare/room/purge.d.ts +6 -3
- package/dist/cloudflare/room/purge.js +45 -19
- package/dist/cloudflare/room/replicas.d.ts +4 -2
- package/dist/cloudflare/room/replicas.js +8 -3
- package/dist/cloudflare/room/suggest.d.ts +7 -0
- package/dist/cloudflare/room/suggest.js +143 -0
- package/dist/cloudflare/room/updates.d.ts +3 -4
- package/dist/cloudflare/room/updates.js +6 -8
- package/dist/cloudflare/routeDocumentSocket.d.ts +10 -1
- package/dist/cloudflare/routeDocumentSocket.js +5 -3
- package/dist/components/Content.svelte +9 -1
- package/dist/crdt/anchors.js +3 -2
- package/dist/crdt/attribution/attribution.d.ts +34 -12
- package/dist/crdt/attribution/attribution.js +59 -21
- package/dist/crdt/attribution/block.d.ts +3 -3
- package/dist/crdt/attribution/block.js +7 -8
- package/dist/crdt/attribution/index.d.ts +1 -1
- package/dist/crdt/attribution/index.js +1 -1
- package/dist/crdt/data.d.ts +62 -31
- package/dist/crdt/data.js +211 -103
- package/dist/crdt/doc/capability.js +9 -13
- package/dist/crdt/doc/delete.d.ts +1 -1
- package/dist/crdt/doc/delete.js +13 -30
- package/dist/crdt/doc/funnel.d.ts +1 -1
- package/dist/crdt/doc/funnel.js +34 -26
- package/dist/crdt/doc/gate.d.ts +3 -3
- package/dist/crdt/doc/history.d.ts +31 -9
- package/dist/crdt/doc/history.js +204 -73
- package/dist/crdt/doc/layout.js +16 -27
- package/dist/crdt/doc/meta.js +17 -23
- package/dist/crdt/doc/moves.d.ts +1 -1
- package/dist/crdt/doc/moves.js +52 -32
- package/dist/crdt/doc/reads.d.ts +2 -2
- package/dist/crdt/doc/reads.js +20 -30
- package/dist/crdt/doc/seed.js +2 -2
- package/dist/crdt/doc/split-merge.js +12 -15
- package/dist/crdt/doc/steps.d.ts +25 -13
- package/dist/crdt/doc/steps.js +55 -125
- package/dist/crdt/doc/suggest.d.ts +167 -0
- package/dist/crdt/doc/suggest.js +579 -0
- package/dist/crdt/doc/types.d.ts +21 -9
- package/dist/crdt/document.d.ts +26 -6
- package/dist/crdt/document.js +40 -15
- package/dist/crdt/edytor-doc.d.ts +410 -390
- package/dist/crdt/edytor-doc.js +143 -95
- package/dist/crdt/engine-api.d.ts +39 -1
- package/dist/crdt/engine.d.ts +2 -2
- package/dist/crdt/engine.js +4 -5
- package/dist/crdt/flow.d.ts +2 -2
- package/dist/crdt/flow.js +29 -37
- package/dist/crdt/index.d.ts +134 -127
- package/dist/crdt/index.js +4 -1
- package/dist/crdt/operations.d.ts +12 -3
- package/dist/crdt/parts.d.ts +43 -0
- package/dist/crdt/parts.js +44 -0
- package/dist/crdt/placement/display.d.ts +6 -31
- package/dist/crdt/placement/display.js +41 -146
- package/dist/crdt/placement/keys.d.ts +63 -0
- package/dist/crdt/placement/keys.js +95 -0
- package/dist/crdt/placement/model.d.ts +119 -118
- package/dist/crdt/placement/model.js +242 -142
- package/dist/crdt/placement/resolve.d.ts +123 -35
- package/dist/crdt/placement/resolve.js +188 -153
- package/dist/crdt/placement/slots.d.ts +134 -0
- package/dist/crdt/placement/slots.js +152 -0
- package/dist/crdt/protocol.d.ts +1 -1
- package/dist/crdt/protocol.js +1 -1
- package/dist/crdt/protocols/auth.d.ts +11 -1
- package/dist/crdt/protocols/auth.js +17 -1
- package/dist/crdt/protocols/comments.d.ts +16 -1
- package/dist/crdt/protocols/comments.js +9 -1
- package/dist/crdt/providers/index.d.ts +6 -4
- package/dist/crdt/providers/index.js +3 -1
- package/dist/crdt/providers/room.d.ts +16 -2
- package/dist/crdt/providers/room.js +64 -17
- package/dist/crdt/providers/websocket.d.ts +6 -4
- package/dist/crdt/providers/websocket.js +14 -7
- package/dist/crdt/purge.d.ts +24 -9
- package/dist/crdt/purge.js +266 -126
- package/dist/crdt/restore.d.ts +4 -3
- package/dist/crdt/restore.js +27 -34
- package/dist/crdt/schema.d.ts +30 -21
- package/dist/crdt/schema.js +39 -23
- package/dist/crdt/storage.d.ts +1 -1
- package/dist/crdt/storage.js +1 -1
- package/dist/crdt/structs.d.ts +17 -15
- package/dist/crdt/structs.js +10 -22
- package/dist/crdt/text/index/cache.js +4 -0
- package/dist/crdt/text/index/claims.js +13 -23
- package/dist/crdt/text/index/fold.d.ts +2 -3
- package/dist/crdt/text/index/fold.js +194 -44
- package/dist/crdt/text/index/layout.d.ts +2 -4
- package/dist/crdt/text/index/layout.js +14 -30
- package/dist/crdt/text/index/placement.d.ts +26 -18
- package/dist/crdt/text/index/placement.js +420 -157
- package/dist/crdt/text/index/records.d.ts +3 -3
- package/dist/crdt/text/index/records.js +24 -31
- package/dist/crdt/text/index/shared.d.ts +11 -3
- package/dist/crdt/text/index/shared.js +29 -17
- package/dist/crdt/text/index/state.d.ts +21 -17
- package/dist/crdt/text/index/state.js +15 -17
- package/dist/crdt/text/index/streams.d.ts +10 -5
- package/dist/crdt/text/index/streams.js +78 -27
- package/dist/crdt/text/items.d.ts +10 -3
- package/dist/crdt/text/items.js +7 -0
- package/dist/crdt/text/model.d.ts +87 -62
- package/dist/crdt/text/model.js +91 -169
- package/dist/crdt/text/ranges.d.ts +1 -1
- package/dist/crdt/text/ranges.js +3 -3
- package/dist/crdt/text/rows.d.ts +13 -7
- package/dist/crdt/text/rows.js +24 -7
- package/dist/crdt/text/runs.d.ts +51 -42
- package/dist/crdt/text/runs.js +24 -7
- package/dist/crdt/text/streams.d.ts +26 -13
- package/dist/crdt/text/streams.js +41 -14
- package/dist/crdt/vendor/yjs/UPSTREAM.md +651 -21
- package/dist/crdt/vendor/yjs/dts/global.d.ts +2 -0
- package/dist/crdt/vendor/yjs/dts/index.d.ts +1 -1
- package/dist/crdt/vendor/yjs/dts/structs/AbstractStruct.d.ts +7 -0
- package/dist/crdt/vendor/yjs/dts/structs/Item.d.ts +197 -10
- package/dist/crdt/vendor/yjs/dts/utils/Doc.d.ts +6 -3
- package/dist/crdt/vendor/yjs/dts/utils/StructStore.d.ts +5 -18
- package/dist/crdt/vendor/yjs/dts/utils/Transaction.d.ts +15 -1
- package/dist/crdt/vendor/yjs/dts/utils/UpdateDecoder.d.ts +14 -6
- package/dist/crdt/vendor/yjs/dts/utils/UpdateEncoder.d.ts +33 -6
- package/dist/crdt/vendor/yjs/dts/utils/ids.d.ts +1 -65
- package/dist/crdt/vendor/yjs/dts/utils/marks.d.ts +6 -1
- package/dist/crdt/vendor/yjs/dts/ynode.d.ts +54 -7
- package/dist/crdt/vendor/yjs/global.d.ts +2 -0
- package/dist/crdt/vendor/yjs/src/index.js +1 -1
- package/dist/crdt/vendor/yjs/src/structs/AbstractStruct.js +10 -0
- package/dist/crdt/vendor/yjs/src/structs/Item.js +649 -51
- package/dist/crdt/vendor/yjs/src/utils/BlockSet.js +18 -9
- package/dist/crdt/vendor/yjs/src/utils/Doc.js +5 -3
- package/dist/crdt/vendor/yjs/src/utils/StructStore.js +5 -0
- package/dist/crdt/vendor/yjs/src/utils/Transaction.js +36 -13
- package/dist/crdt/vendor/yjs/src/utils/UpdateDecoder.js +88 -18
- package/dist/crdt/vendor/yjs/src/utils/UpdateEncoder.js +119 -32
- package/dist/crdt/vendor/yjs/src/utils/encoding.js +13 -1
- package/dist/crdt/vendor/yjs/src/utils/ids.js +7 -7
- package/dist/crdt/vendor/yjs/src/utils/marks.js +193 -8
- package/dist/crdt/vendor/yjs/src/utils/redo.js +1 -1
- package/dist/crdt/vendor/yjs/src/utils/transaction-helpers.js +1 -1
- package/dist/crdt/vendor/yjs/src/utils/updates.js +3 -3
- package/dist/crdt/vendor/yjs/src/ynode.js +199 -12
- package/dist/edytor.svelte.d.ts +1 -1
- package/dist/edytor.svelte.js +103 -75
- package/dist/events/beforeInputCommands.d.ts +2 -2
- package/dist/events/beforeInputCommands.js +2 -2
- package/dist/events/nativeInteractiveControl.d.ts +11 -1
- package/dist/events/nativeInteractiveControl.js +41 -1
- package/dist/events/onBeforeInput.js +3 -3
- package/dist/events/onFocus.js +9 -11
- package/dist/events/onPageHide.d.ts +3 -0
- package/dist/events/onPageHide.js +16 -0
- package/dist/export/forms.d.ts +50 -50
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/labels.d.ts +8 -0
- package/dist/labels.js +6 -1
- package/dist/plugins/comments/CommentsController.svelte.d.ts +5 -1
- package/dist/plugins/comments/CommentsController.svelte.js +14 -4
- package/dist/plugins/find/search.js +2 -2
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/suggestions/SuggestionBars.svelte +40 -23
- package/dist/plugins/suggestions/SuggestionBars.svelte.d.ts +3 -1
- package/dist/plugins/suggestions/SuggestionRuns.svelte +77 -0
- package/dist/plugins/suggestions/SuggestionRuns.svelte.d.ts +9 -0
- package/dist/plugins/suggestions/shared.svelte.d.ts +58 -0
- package/dist/plugins/suggestions/shared.svelte.js +421 -0
- package/dist/plugins/suggestions/suggestionsPlugin.d.ts +15 -4
- package/dist/selection/domSelection.d.ts +2 -0
- package/dist/selection/domSelection.js +6 -2
- package/dist/selection/pointer.svelte.js +75 -48
- package/dist/selection/replaceSelection.js +2 -6
- package/dist/selection/selection.svelte.d.ts +3 -3
- package/dist/selection/selection.svelte.js +39 -32
- package/dist/selection/selection.utils.d.ts +14 -0
- package/dist/selection/selection.utils.js +28 -3
- package/dist/session/commands.js +21 -11
- package/dist/session/composition.svelte.d.ts +5 -3
- package/dist/session/composition.svelte.js +21 -17
- package/dist/session/handles.d.ts +4 -17
- package/dist/session/handles.js +11 -37
- package/dist/session/navigation.js +6 -9
- package/dist/session/selection.d.ts +11 -5
- package/dist/session/selection.js +14 -48
- package/dist/session/suggestions.svelte.d.ts +38 -9
- package/dist/session/suggestions.svelte.js +37 -18
- package/dist/session/virtual.d.ts +1 -1
- package/dist/surface/attributes.d.ts +5 -0
- package/dist/surface/attributes.js +2 -2
- package/dist/surface/cells.d.ts +2 -26
- package/dist/surface/cells.js +2 -33
- package/dist/surface/observer.svelte.d.ts +6 -1
- package/dist/surface/observer.svelte.js +130 -83
- package/dist/surface/pin.svelte.d.ts +9 -9
- package/dist/surface/pin.svelte.js +15 -22
- package/dist/surface/projector.svelte.d.ts +15 -3
- package/dist/surface/projector.svelte.js +67 -22
- package/dist/text/text.svelte.js +14 -19
- package/dist/themes/notion.css +29 -0
- package/package.json +4 -2
- package/dist/crdt/placement/rank.d.ts +0 -87
- package/dist/crdt/placement/rank.js +0 -332
- package/dist/crdt/placement/source.d.ts +0 -43
- package/dist/crdt/placement/source.js +0 -66
- package/dist/crdt/text/delete-index.d.ts +0 -129
- package/dist/crdt/text/delete-index.js +0 -365
- package/dist/crdt/text/deletes.d.ts +0 -76
- package/dist/crdt/text/deletes.js +0 -362
- package/dist/crdt/text/index/anchored.d.ts +0 -17
- package/dist/crdt/text/index/anchored.js +0 -197
|
@@ -6,6 +6,7 @@ import { type RunView } from './text/runs.js';
|
|
|
6
6
|
import { type BlockAttribution } from './attribution/block.js';
|
|
7
7
|
import type { JSONBlock, JSONDoc } from '../utils/json.js';
|
|
8
8
|
import { assertSchema, checkSchema, isInitialized, META_KEY, registryEmpty, SCHEMA_NAME, SCHEMA_VERSION, SchemaMismatchError, schemaVersion } from './doc/gate.js';
|
|
9
|
+
import type { SuggestContext } from './doc/suggest.js';
|
|
9
10
|
import type { EngineNode } from './engine-api.js';
|
|
10
11
|
import type { ContentItem, InlineSpec, ModelView, SplitTail } from './placement/model.js';
|
|
11
12
|
import type { Anchor } from './text/model.js';
|
|
@@ -38,126 +39,157 @@ type Layers = {
|
|
|
38
39
|
* The per-doc facade factory over the engine `Y` (the editor's documents
|
|
39
40
|
* use it directly; {@link bindDocModel} is the public binding around it).
|
|
40
41
|
*/
|
|
42
|
+
/**
|
|
43
|
+
* Give `doc` edytor's rule — a registry value a concurrent creation replaced
|
|
44
|
+
* keeps its subtree (fork patch YP14, `keepingReplaced`) — or refuse it
|
|
45
|
+
* loudly when it has integrated updates without it: the engine decides what
|
|
46
|
+
* a replaced value keeps when it integrates, so a document that took updates
|
|
47
|
+
* under the engine's default could lose a subtree its peers keep, forever.
|
|
48
|
+
* Create it with `createDoc()` (or `createDocument`/`loadDocument`), never
|
|
49
|
+
* `new Y.Doc()`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const adoptRules: <D extends object>(doc: D) => D;
|
|
41
52
|
export declare const docFacade: <L extends Layers>(Y: EngineApi, layers: L) => (doc: EngineDoc, config?: EdytorDocConfig) => {
|
|
53
|
+
init: (opts?: Parameters<(doc: EngineDoc, opts?: {
|
|
54
|
+
content?: import("./index.js").BlockSpec[];
|
|
55
|
+
defaultType?: string;
|
|
56
|
+
}) => void>[1]) => void;
|
|
57
|
+
/** Apply the deterministic seed of `value` and the document's `data` — the document's seed decision. */
|
|
58
|
+
seed: (value: JSONBlock[], data?: JsonObj) => void;
|
|
59
|
+
isInitialized: () => boolean;
|
|
60
|
+
/** Replicated `meta.v` schema version (the module-level read, bound). */
|
|
61
|
+
schemaVersion: () => number | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The schema gate for this doc — throws {@link SchemaMismatchError}
|
|
64
|
+
* on unversioned-content or unsupported-version state. Consumers
|
|
65
|
+
* (`Edytor.sync()`, packed consumers) call it before trusting
|
|
66
|
+
* a synced doc.
|
|
67
|
+
*/
|
|
68
|
+
checkSchema: () => import("./edytor-doc.js").SchemaProblem | null;
|
|
69
|
+
assertSchema: () => void;
|
|
70
|
+
dispose: () => void;
|
|
71
|
+
createUndoManager: (options?: import("./doc/history.js").HistoryOptions) => import("./doc/history.js").UndoManager;
|
|
72
|
+
/** @internal What a part built over the document reads and writes (`doc/suggest.ts`). */
|
|
73
|
+
part: SuggestContext;
|
|
74
|
+
/** Visible children of `parent` with their ranks, in `(rank, id)` order. */
|
|
75
|
+
childSlots: (parent: BlockId | null) => import("./placement/model.js").ChildSlot[];
|
|
76
|
+
slotOf: (id: string) => {
|
|
77
|
+
parent: BlockId | null;
|
|
78
|
+
rank: string;
|
|
79
|
+
} | null;
|
|
80
|
+
crdtId: (id: string) => string | null;
|
|
81
|
+
resolveBlock: (id: string) => EngineNode | null;
|
|
82
|
+
followUndo: (anchor: DocAnchor) => DocAnchor;
|
|
83
|
+
/** Re-read the roles after `roleOf` answers differently (roles adopted later). */
|
|
84
|
+
rolesChanged: (place?: boolean) => void;
|
|
85
|
+
defaultChild: (id: string | null) => string;
|
|
86
|
+
contentJSON: (id: string) => ({
|
|
87
|
+
text: string;
|
|
88
|
+
marks?: Record<string, unknown>;
|
|
89
|
+
} | {
|
|
90
|
+
id?: string;
|
|
91
|
+
type: string;
|
|
92
|
+
data?: unknown;
|
|
93
|
+
})[];
|
|
94
|
+
model: L["model"];
|
|
95
|
+
text: L["text"];
|
|
96
|
+
runsView: RunView;
|
|
97
|
+
/** The public members' names (`EdytorDocument` forwards them). */
|
|
98
|
+
api: object;
|
|
99
|
+
} & {
|
|
42
100
|
/** Every op prepared: pure, a plan of named steps + its effect, or `refused`. */
|
|
43
101
|
prepare: {
|
|
44
102
|
insertFlow: (target: import("./flow.js").FlowTarget, flow: import("./flow.js").Flow, view?: import("./flow.js").FlowView) => Prepared;
|
|
45
103
|
deleteRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView) => Prepared;
|
|
46
104
|
replaceRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView) => Prepared;
|
|
47
|
-
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (import("./index.js").BlockSpec | JSONBlock)[]) => Prepared;
|
|
48
|
-
moveBlocks: (ids: readonly BlockId[], dest: import("./index.js").Destination) => Prepared;
|
|
49
105
|
/**
|
|
50
106
|
* Move `id` to the last position under `parent` — under a container
|
|
51
107
|
* it is no item of, under its last item (`nestParent`: Tab after a list).
|
|
52
108
|
*/
|
|
53
109
|
nestBlock: (id: BlockId, parent: BlockId) => Prepared;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
mergeBackward: (id: BlockId) => Prepared;
|
|
65
|
-
mergeForward: (id: BlockId) => Prepared;
|
|
66
|
-
deleteBlock: (id: BlockId, opts?: {
|
|
67
|
-
keepChildren?: boolean;
|
|
68
|
-
}) => Prepared;
|
|
110
|
+
/** Delete a block selection — one plan; only the members leave (`deleteBlocks` above). */
|
|
111
|
+
deleteBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
112
|
+
insertText: (id: BlockId, offset: number, text: string, marks?: Record<string, unknown>) => Prepared;
|
|
113
|
+
deleteText: (id: BlockId, offset: number, length: number) => Prepared;
|
|
114
|
+
formatRange: (id: BlockId, offset: number, length: number, marks: Record<string, unknown>) => Prepared;
|
|
115
|
+
clearMarks: (id: BlockId, offset: number, length: number) => Prepared;
|
|
116
|
+
insertInline: (id: BlockId, offset: number, atom: import("./doc/content.js").NewInline) => Prepared;
|
|
117
|
+
removeInline: (id: BlockId, inlineId: string) => Prepared;
|
|
118
|
+
setBlockType: (id: BlockId, type: string) => Prepared;
|
|
119
|
+
patchData: (target: DataTarget, patches: readonly DataPatch[]) => Prepared;
|
|
69
120
|
setBlock: (id: BlockId, value: {
|
|
70
121
|
type?: string;
|
|
71
122
|
data?: Record<string, unknown>;
|
|
72
123
|
content?: (ContentItem | import("./index.js").JSONText | import("./index.js").JSONInlineBlock)[];
|
|
73
124
|
children?: (import("./index.js").BlockSpec | JSONBlock)[];
|
|
74
125
|
}) => Prepared;
|
|
75
|
-
|
|
76
|
-
|
|
126
|
+
deleteBlock: (id: BlockId, opts?: {
|
|
127
|
+
keepChildren?: boolean;
|
|
128
|
+
}) => Prepared;
|
|
129
|
+
splitBlock: (id: BlockId, offset: number, newId: BlockId, tail?: SplitTail) => Prepared;
|
|
130
|
+
mergeBlocks: (fromId: BlockId, intoId: BlockId) => Prepared;
|
|
131
|
+
mergeBackward: (id: BlockId) => Prepared;
|
|
132
|
+
mergeForward: (id: BlockId) => Prepared;
|
|
133
|
+
placeBeside: (ids: readonly BlockId[], target: BlockId, side: "left" | "right", kind?: string) => Prepared;
|
|
134
|
+
wrapInLayout: (ids: readonly BlockId[], kind?: string, columns?: number) => Prepared;
|
|
135
|
+
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (import("./index.js").BlockSpec | JSONBlock)[]) => Prepared;
|
|
136
|
+
moveBlocks: (ids: readonly BlockId[], dest: import("./index.js").Destination) => Prepared;
|
|
137
|
+
unNestBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
138
|
+
unNestBlock: (id: BlockId) => Prepared;
|
|
139
|
+
liftOut: (id: BlockId, kind: string, { keep, after }?: {
|
|
140
|
+
keep?: boolean;
|
|
141
|
+
after?: readonly import("./index.js").BlockSpec[];
|
|
142
|
+
}) => Prepared;
|
|
77
143
|
duplicateBlock: (id: BlockId, freshId?: (oldId: string, kind: "block" | "inline") => string) => Prepared;
|
|
78
|
-
insertText: (id: BlockId, offset: number, text: string, marks?: Record<string, unknown>) => Prepared;
|
|
79
|
-
deleteText: (id: BlockId, offset: number, length: number) => Prepared;
|
|
80
|
-
formatRange: (id: BlockId, offset: number, length: number, marks: Record<string, unknown>) => Prepared;
|
|
81
|
-
clearMarks: (id: BlockId, offset: number, length: number) => Prepared;
|
|
82
|
-
insertInline: (id: BlockId, offset: number, atom: import("./doc/content.js").NewInline) => Prepared;
|
|
83
|
-
removeInline: (id: BlockId, inlineId: string) => Prepared;
|
|
84
|
-
/** Delete a block selection — one plan; only the members leave (`deleteBlocks` above). */
|
|
85
|
-
deleteBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
86
144
|
};
|
|
87
145
|
/** Write a prepared plan exactly (refusals pass through). */
|
|
88
|
-
apply: (p: Prepared) => OpResult;
|
|
146
|
+
apply: (p: Prepared, quiet?: boolean) => OpResult;
|
|
89
147
|
compose: (...parts: Prepared[]) => Prepared;
|
|
90
148
|
transact: <R>(fn: () => R, origin?: unknown) => R;
|
|
91
|
-
model: L["model"];
|
|
92
|
-
text: L["text"];
|
|
93
|
-
runsView: RunView;
|
|
94
149
|
version: number;
|
|
95
150
|
insertFlow: (target: import("./flow.js").FlowTarget, flow: import("./flow.js").Flow, view?: import("./flow.js").FlowView | undefined) => OpResult;
|
|
96
151
|
deleteRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView | undefined) => OpResult;
|
|
97
152
|
replaceRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView | undefined) => OpResult;
|
|
98
|
-
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (import("./index.js").BlockSpec | JSONBlock)[]) => OpResult;
|
|
99
|
-
moveBlocks: (ids: readonly string[], dest: import("./index.js").Destination) => OpResult;
|
|
100
153
|
nestBlock: (id: string, parent: string) => OpResult;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
mergeBlocks: (fromId: string, intoId: string) => OpResult;
|
|
111
|
-
mergeBackward: (id: string) => OpResult;
|
|
112
|
-
mergeForward: (id: string) => OpResult;
|
|
113
|
-
deleteBlock: (id: string, opts?: {
|
|
114
|
-
keepChildren?: boolean;
|
|
115
|
-
} | undefined) => OpResult;
|
|
154
|
+
deleteBlocks: (ids: readonly string[]) => OpResult;
|
|
155
|
+
insertText: (id: string, offset: number, text: string, marks?: Record<string, unknown> | undefined) => OpResult;
|
|
156
|
+
deleteText: (id: string, offset: number, length: number) => OpResult;
|
|
157
|
+
formatRange: (id: string, offset: number, length: number, marks: Record<string, unknown>) => OpResult;
|
|
158
|
+
clearMarks: (id: string, offset: number, length: number) => OpResult;
|
|
159
|
+
insertInline: (id: string, offset: number, atom: import("./doc/content.js").NewInline) => OpResult;
|
|
160
|
+
removeInline: (id: string, inlineId: string) => OpResult;
|
|
161
|
+
setBlockType: (id: string, type: string) => OpResult;
|
|
162
|
+
patchData: (target: DataTarget, patches: readonly DataPatch[]) => OpResult;
|
|
116
163
|
setBlock: (id: string, value: {
|
|
117
164
|
type?: string;
|
|
118
165
|
data?: Record<string, unknown>;
|
|
119
166
|
content?: (ContentItem | import("./index.js").JSONText | import("./index.js").JSONInlineBlock)[];
|
|
120
167
|
children?: (import("./index.js").BlockSpec | JSONBlock)[];
|
|
121
168
|
}) => OpResult;
|
|
122
|
-
|
|
123
|
-
|
|
169
|
+
deleteBlock: (id: string, opts?: {
|
|
170
|
+
keepChildren?: boolean;
|
|
171
|
+
} | undefined) => OpResult;
|
|
172
|
+
splitBlock: (id: string, offset: number, newId: string, tail?: SplitTail | undefined) => OpResult;
|
|
173
|
+
mergeBlocks: (fromId: string, intoId: string) => OpResult;
|
|
174
|
+
mergeBackward: (id: string) => OpResult;
|
|
175
|
+
mergeForward: (id: string) => OpResult;
|
|
176
|
+
placeBeside: (ids: readonly string[], target: string, side: "left" | "right", kind?: string | undefined) => OpResult;
|
|
177
|
+
wrapInLayout: (ids: readonly string[], kind?: string | undefined, columns?: number | undefined) => OpResult;
|
|
178
|
+
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (JSONBlock | import("./index.js").BlockSpec)[]) => OpResult;
|
|
179
|
+
moveBlocks: (ids: readonly string[], dest: import("./index.js").Destination) => OpResult;
|
|
180
|
+
unNestBlocks: (ids: readonly string[]) => OpResult;
|
|
181
|
+
unNestBlock: (id: string) => OpResult;
|
|
182
|
+
liftOut: (id: string, kind: string, args_2?: {
|
|
183
|
+
keep?: boolean;
|
|
184
|
+
after?: readonly import("./index.js").BlockSpec[];
|
|
185
|
+
} | undefined) => OpResult;
|
|
124
186
|
duplicateBlock: (id: string, freshId?: ((oldId: string, kind: "block" | "inline") => string) | undefined) => OpResult;
|
|
125
|
-
insertText: (id: string, offset: number, text: string, marks?: Record<string, unknown> | undefined) => OpResult;
|
|
126
|
-
deleteText: (id: string, offset: number, length: number) => OpResult;
|
|
127
|
-
formatRange: (id: string, offset: number, length: number, marks: Record<string, unknown>) => OpResult;
|
|
128
|
-
clearMarks: (id: string, offset: number, length: number) => OpResult;
|
|
129
|
-
insertInline: (id: string, offset: number, atom: import("./doc/content.js").NewInline) => OpResult;
|
|
130
|
-
removeInline: (id: string, inlineId: string) => OpResult;
|
|
131
|
-
deleteBlocks: (ids: readonly string[]) => OpResult;
|
|
132
|
-
init: (opts?: Parameters<(doc: EngineDoc, opts?: {
|
|
133
|
-
content?: import("./index.js").BlockSpec[];
|
|
134
|
-
defaultType?: string;
|
|
135
|
-
}) => void>[1]) => void;
|
|
136
|
-
/** Apply the deterministic seed of `value` and the document's `data` — the document's seed decision. */
|
|
137
|
-
seed: (value: JSONBlock[], data?: JsonObj) => void;
|
|
138
|
-
isInitialized: () => boolean;
|
|
139
|
-
/** Replicated `meta.v` schema version (the module-level read, bound). */
|
|
140
|
-
schemaVersion: () => number | undefined;
|
|
141
|
-
/**
|
|
142
|
-
* The schema gate for this doc — throws {@link SchemaMismatchError}
|
|
143
|
-
* on unversioned-content or unsupported-version state. Consumers
|
|
144
|
-
* (`Edytor.sync()`, packed consumers) call it before trusting
|
|
145
|
-
* a synced doc.
|
|
146
|
-
*/
|
|
147
|
-
checkSchema: () => import("./edytor-doc.js").SchemaProblem | null;
|
|
148
|
-
assertSchema: () => void;
|
|
149
|
-
dispose: () => void;
|
|
150
|
-
createUndoManager: (options?: import("./doc/history.js").HistoryOptions) => import("./doc/history.js").UndoManager;
|
|
151
187
|
project: () => import("./index.js").ProjectedDoc;
|
|
152
|
-
toJSON: (
|
|
188
|
+
toJSON: (options?: {
|
|
189
|
+
suggestions?: boolean;
|
|
190
|
+
}) => JSONDoc;
|
|
153
191
|
blockJSON: (id: string) => JSONBlock;
|
|
154
192
|
childrenIds: (id: string | null) => string[];
|
|
155
|
-
/** Visible children of `parent` with their ranks, in `(rank, id)` order. */
|
|
156
|
-
childSlots: (parent: BlockId | null) => import("./placement/model.js").ChildSlot[];
|
|
157
|
-
slotOf: (id: string) => {
|
|
158
|
-
parent: BlockId | null;
|
|
159
|
-
rank: string;
|
|
160
|
-
} | null;
|
|
161
193
|
positionOf: (id: string) => import("./index.js").Destination | null;
|
|
162
194
|
pathOf: (id: string) => number[] | null;
|
|
163
195
|
parentOf: (id: string) => string | null;
|
|
@@ -180,8 +212,6 @@ export declare const docFacade: <L extends Layers>(Y: EngineApi, layers: L) => (
|
|
|
180
212
|
* O(1) per call; live-replicated (remote values read the same).
|
|
181
213
|
*/
|
|
182
214
|
blockAttribution: (id: string) => BlockAttribution | undefined;
|
|
183
|
-
crdtId: (id: string) => string | null;
|
|
184
|
-
resolveBlock: (id: string) => EngineNode | null;
|
|
185
215
|
displayLength: (id: string) => number;
|
|
186
216
|
contentItems: (id: string) => ContentItem[];
|
|
187
217
|
hasBlock: (id: string) => boolean;
|
|
@@ -195,9 +225,6 @@ export declare const docFacade: <L extends Layers>(Y: EngineApi, layers: L) => (
|
|
|
195
225
|
blockId: BlockId;
|
|
196
226
|
offset: number;
|
|
197
227
|
} | null;
|
|
198
|
-
followUndo: (anchor: DocAnchor) => DocAnchor;
|
|
199
|
-
/** Re-read the roles after `roleOf` answers differently (roles adopted later). */
|
|
200
|
-
rolesChanged: () => void;
|
|
201
228
|
isVoid: (id: string) => boolean;
|
|
202
229
|
isIsland: (id: string) => boolean;
|
|
203
230
|
isLines: (id: string) => boolean;
|
|
@@ -244,16 +271,7 @@ export declare const docFacade: <L extends Layers>(Y: EngineApi, layers: L) => (
|
|
|
244
271
|
parent: string | null;
|
|
245
272
|
levels: string[];
|
|
246
273
|
};
|
|
247
|
-
defaultChild: (id: string | null) => string;
|
|
248
274
|
runs: (id: string) => readonly ContentRun[];
|
|
249
|
-
contentJSON: (id: string) => ({
|
|
250
|
-
text: string;
|
|
251
|
-
marks?: Record<string, unknown>;
|
|
252
|
-
} | {
|
|
253
|
-
id?: string;
|
|
254
|
-
type: string;
|
|
255
|
-
data?: unknown;
|
|
256
|
-
})[];
|
|
257
275
|
onChange: (cb: (change: DocChange) => void) => (() => void);
|
|
258
276
|
};
|
|
259
277
|
/**
|
|
@@ -265,7 +283,7 @@ export declare const docFacade: <L extends Layers>(Y: EngineApi, layers: L) => (
|
|
|
265
283
|
export declare const bindDocModel: (Y: EngineApi) => {
|
|
266
284
|
/** The schema manifest constants table. */
|
|
267
285
|
SCHEMA: {
|
|
268
|
-
readonly version:
|
|
286
|
+
readonly version: 11;
|
|
269
287
|
readonly name: "edytor-doc";
|
|
270
288
|
readonly roots: {
|
|
271
289
|
readonly registry: "blocks";
|
|
@@ -276,7 +294,7 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
276
294
|
readonly schema: "schema";
|
|
277
295
|
};
|
|
278
296
|
};
|
|
279
|
-
SCHEMA_VERSION:
|
|
297
|
+
SCHEMA_VERSION: 11;
|
|
280
298
|
SCHEMA_NAME: "edytor-doc";
|
|
281
299
|
META_KEY: "meta";
|
|
282
300
|
/** Doc-level API (no facade needed). */
|
|
@@ -294,84 +312,77 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
294
312
|
SchemaMismatchError: typeof SchemaMismatchError;
|
|
295
313
|
/** Attach the per-doc facade. */
|
|
296
314
|
create: (doc: EngineDoc, config?: EdytorDocConfig) => {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
removeInline: (id: BlockId, inlineId: string) => Prepared;
|
|
339
|
-
/** Delete a block selection — one plan; only the members leave (`deleteBlocks` above). */
|
|
340
|
-
deleteBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
341
|
-
};
|
|
342
|
-
/** Write a prepared plan exactly (refusals pass through). */
|
|
343
|
-
apply: (p: Prepared) => OpResult;
|
|
344
|
-
compose: (...parts: Prepared[]) => Prepared;
|
|
345
|
-
transact: <R>(fn: () => R, origin?: unknown) => R;
|
|
315
|
+
init: (opts?: Parameters<(doc: EngineDoc, opts?: {
|
|
316
|
+
content?: import("./index.js").BlockSpec[];
|
|
317
|
+
defaultType?: string;
|
|
318
|
+
}) => void>[1]) => void;
|
|
319
|
+
/** Apply the deterministic seed of `value` and the document's `data` — the document's seed decision. */
|
|
320
|
+
seed: (value: JSONBlock[], data?: JsonObj) => void;
|
|
321
|
+
isInitialized: () => boolean;
|
|
322
|
+
/** Replicated `meta.v` schema version (the module-level read, bound). */
|
|
323
|
+
schemaVersion: () => number | undefined;
|
|
324
|
+
/**
|
|
325
|
+
* The schema gate for this doc — throws {@link SchemaMismatchError}
|
|
326
|
+
* on unversioned-content or unsupported-version state. Consumers
|
|
327
|
+
* (`Edytor.sync()`, packed consumers) call it before trusting
|
|
328
|
+
* a synced doc.
|
|
329
|
+
*/
|
|
330
|
+
checkSchema: () => import("./edytor-doc.js").SchemaProblem | null;
|
|
331
|
+
assertSchema: () => void;
|
|
332
|
+
dispose: () => void;
|
|
333
|
+
createUndoManager: (options?: import("./doc/history.js").HistoryOptions) => import("./doc/history.js").UndoManager;
|
|
334
|
+
/** @internal What a part built over the document reads and writes (`doc/suggest.ts`). */
|
|
335
|
+
part: SuggestContext;
|
|
336
|
+
/** Visible children of `parent` with their ranks, in `(rank, id)` order. */
|
|
337
|
+
childSlots: (parent: BlockId | null) => import("./placement/model.js").ChildSlot[];
|
|
338
|
+
slotOf: (id: string) => {
|
|
339
|
+
parent: BlockId | null;
|
|
340
|
+
rank: string;
|
|
341
|
+
} | null;
|
|
342
|
+
crdtId: (id: string) => string | null;
|
|
343
|
+
resolveBlock: (id: string) => EngineNode | null;
|
|
344
|
+
followUndo: (anchor: DocAnchor) => DocAnchor;
|
|
345
|
+
/** Re-read the roles after `roleOf` answers differently (roles adopted later). */
|
|
346
|
+
rolesChanged: (place?: boolean) => void;
|
|
347
|
+
defaultChild: (id: string | null) => string;
|
|
348
|
+
contentJSON: (id: string) => ({
|
|
349
|
+
text: string;
|
|
350
|
+
marks?: Record<string, unknown>;
|
|
351
|
+
} | {
|
|
352
|
+
id?: string;
|
|
353
|
+
type: string;
|
|
354
|
+
data?: unknown;
|
|
355
|
+
})[];
|
|
346
356
|
model: {
|
|
347
357
|
REGISTRY_KEY: string;
|
|
348
358
|
registryOf: (doc: EngineDoc) => EngineNode;
|
|
349
359
|
blockNodeOf: (doc: EngineDoc, id: BlockId) => EngineNode | null;
|
|
350
360
|
liveNodeOf: (doc: EngineDoc, id: BlockId) => EngineNode | null;
|
|
351
361
|
isLive: (doc: EngineDoc, id: BlockId) => boolean;
|
|
352
|
-
candidatesOf: (node: EngineNode) => import("./placement/model.js").PlacementCand[];
|
|
353
362
|
view: (doc: EngineDoc) => ModelView;
|
|
354
|
-
resolvePlacements: (blocks: Map<BlockId, import("./placement/model.js").BlockRec>, ownerOf?: (b: BlockId) => import("./text/model.js").Owner) => Map<BlockId, import("./placement/model.js").ResolvedPlacement>;
|
|
355
363
|
childrenIndex: (placements: Map<BlockId, import("./placement/model.js").ResolvedPlacement>, own: import("./placement/model.js").DisplayOwnership) => Map<BlockId | null, import("./placement/model.js").ChildSlot[]>;
|
|
356
364
|
positionInView: (v: ModelView, id: BlockId) => import("./index.js").Destination | null;
|
|
357
365
|
buildInline: (atom: InlineSpec) => EngineNode;
|
|
358
366
|
isSelfOrDescendant: (placements: Map<BlockId, import("./placement/model.js").ResolvedPlacement>, own: import("./text/model.js").Ownership, id: BlockId, maybeAncestor: BlockId) => boolean;
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
writePlacement: (doc: EngineDoc, node: EngineNode, p: BlockId | null, r: string) => void;
|
|
367
|
+
placeBlocks: (doc: EngineDoc, v: ModelView, parent: BlockId | null, left: BlockId | null, right: BlockId | null, slots: readonly import("./placement/slots.js").BlockSlot[] | null, moved?: readonly number[] | null, side?: number, part?: number, at?: import("./placement/slots.js").Unit | null) => void;
|
|
368
|
+
moveBlocksTo: (doc: EngineDoc, v: ModelView, ids: readonly BlockId[], parent: BlockId | null, index: number, side?: number, part?: number, at?: BlockId | null) => void;
|
|
369
|
+
insertSpecsAt: (doc: EngineDoc, v: ModelView, parent: BlockId | null, index: number, specs: readonly import("./index.js").BlockSpec[], split?: import("./placement/slots.js").Unit | null) => void;
|
|
363
370
|
withdrawOnUndo: (doc: EngineDoc) => (item: import("./engine-api.js").EngineItemRef, stackItem: {
|
|
364
371
|
inserts: {
|
|
365
372
|
has(client: number, clock: number): boolean;
|
|
366
373
|
};
|
|
367
374
|
}) => boolean;
|
|
368
|
-
materializeSpec: (doc: EngineDoc, sp: import("./index.js").BlockSpec, parent: BlockId | null, rank: string) => void;
|
|
369
375
|
collides: (doc: EngineDoc, specs: readonly import("./index.js").BlockSpec[]) => boolean;
|
|
370
|
-
writeSplit: (doc: EngineDoc, id: BlockId, offset: number, newId: BlockId, tail: SplitTail,
|
|
376
|
+
writeSplit: (doc: EngineDoc, id: BlockId, offset: number, newId: BlockId, tail: SplitTail, parent: BlockId | null, index: number) => import("./placement/slots.js").Unit;
|
|
371
377
|
ownText: (doc: EngineDoc, id: BlockId) => {
|
|
372
378
|
from: unknown;
|
|
373
379
|
to: number;
|
|
374
380
|
};
|
|
381
|
+
recordsOf: (doc: EngineDoc, node: EngineNode, v?: ModelView) => {
|
|
382
|
+
item: import("./placement/slots.js").SeqItem;
|
|
383
|
+
stamp: import("./placement/slots.js").Stamp;
|
|
384
|
+
wins: boolean;
|
|
385
|
+
}[];
|
|
375
386
|
insertBlocks: (doc: EngineDoc, dest: import("./index.js").Destination, specs: import("./index.js").BlockSpec[]) => boolean;
|
|
376
387
|
insertBlock: (doc: EngineDoc, dest: import("./index.js").Destination, spec: import("./index.js").BlockSpec) => boolean;
|
|
377
388
|
restoreBlocks: (doc: EngineDoc, specs: import("./index.js").BlockSpec[]) => void;
|
|
@@ -403,81 +414,110 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
403
414
|
at: number;
|
|
404
415
|
node: EngineNode;
|
|
405
416
|
} | null;
|
|
406
|
-
splitAt: (blocks: ReadonlyMap<import("./text/model.js").BlockId, import("./text/model.js").TextBlockRec>, own: import("./text/model.js").Ownership, b: import("./text/model.js").BlockId, offset: number, newId: import("./text/model.js").BlockId, n: number) =>
|
|
407
|
-
claimInto: (
|
|
417
|
+
splitAt: (doc: EngineDoc, blocks: ReadonlyMap<import("./text/model.js").BlockId, import("./text/model.js").TextBlockRec>, own: import("./text/model.js").Ownership, b: import("./text/model.js").BlockId, offset: number, newId: import("./text/model.js").BlockId, n: number) => void;
|
|
418
|
+
claimInto: (own: Pick<import("./text/model.js").Ownership, "streamOf">, from: import("./text/model.js").BlockId, into: import("./text/model.js").BlockId) => void;
|
|
408
419
|
ownText: (doc: EngineDoc, rec: import("./text/model.js").TextBlockRec) => {
|
|
409
420
|
from: unknown;
|
|
410
421
|
to: number;
|
|
411
422
|
};
|
|
412
423
|
};
|
|
413
424
|
runsView: RunView;
|
|
425
|
+
/** The public members' names (`EdytorDocument` forwards them). */
|
|
426
|
+
api: object;
|
|
427
|
+
} & {
|
|
428
|
+
/** Every op prepared: pure, a plan of named steps + its effect, or `refused`. */
|
|
429
|
+
prepare: {
|
|
430
|
+
insertFlow: (target: import("./flow.js").FlowTarget, flow: import("./flow.js").Flow, view?: import("./flow.js").FlowView) => Prepared;
|
|
431
|
+
deleteRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView) => Prepared;
|
|
432
|
+
replaceRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView) => Prepared;
|
|
433
|
+
/**
|
|
434
|
+
* Move `id` to the last position under `parent` — under a container
|
|
435
|
+
* it is no item of, under its last item (`nestParent`: Tab after a list).
|
|
436
|
+
*/
|
|
437
|
+
nestBlock: (id: BlockId, parent: BlockId) => Prepared;
|
|
438
|
+
/** Delete a block selection — one plan; only the members leave (`deleteBlocks` above). */
|
|
439
|
+
deleteBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
440
|
+
insertText: (id: BlockId, offset: number, text: string, marks?: Record<string, unknown>) => Prepared;
|
|
441
|
+
deleteText: (id: BlockId, offset: number, length: number) => Prepared;
|
|
442
|
+
formatRange: (id: BlockId, offset: number, length: number, marks: Record<string, unknown>) => Prepared;
|
|
443
|
+
clearMarks: (id: BlockId, offset: number, length: number) => Prepared;
|
|
444
|
+
insertInline: (id: BlockId, offset: number, atom: import("./doc/content.js").NewInline) => Prepared;
|
|
445
|
+
removeInline: (id: BlockId, inlineId: string) => Prepared;
|
|
446
|
+
setBlockType: (id: BlockId, type: string) => Prepared;
|
|
447
|
+
patchData: (target: DataTarget, patches: readonly DataPatch[]) => Prepared;
|
|
448
|
+
setBlock: (id: BlockId, value: {
|
|
449
|
+
type?: string;
|
|
450
|
+
data?: Record<string, unknown>;
|
|
451
|
+
content?: (ContentItem | import("./index.js").JSONText | import("./index.js").JSONInlineBlock)[];
|
|
452
|
+
children?: (import("./index.js").BlockSpec | JSONBlock)[];
|
|
453
|
+
}) => Prepared;
|
|
454
|
+
deleteBlock: (id: BlockId, opts?: {
|
|
455
|
+
keepChildren?: boolean;
|
|
456
|
+
}) => Prepared;
|
|
457
|
+
splitBlock: (id: BlockId, offset: number, newId: BlockId, tail?: SplitTail) => Prepared;
|
|
458
|
+
mergeBlocks: (fromId: BlockId, intoId: BlockId) => Prepared;
|
|
459
|
+
mergeBackward: (id: BlockId) => Prepared;
|
|
460
|
+
mergeForward: (id: BlockId) => Prepared;
|
|
461
|
+
placeBeside: (ids: readonly BlockId[], target: BlockId, side: "left" | "right", kind?: string) => Prepared;
|
|
462
|
+
wrapInLayout: (ids: readonly BlockId[], kind?: string, columns?: number) => Prepared;
|
|
463
|
+
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (import("./index.js").BlockSpec | JSONBlock)[]) => Prepared;
|
|
464
|
+
moveBlocks: (ids: readonly BlockId[], dest: import("./index.js").Destination) => Prepared;
|
|
465
|
+
unNestBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
466
|
+
unNestBlock: (id: BlockId) => Prepared;
|
|
467
|
+
liftOut: (id: BlockId, kind: string, { keep, after }?: {
|
|
468
|
+
keep?: boolean;
|
|
469
|
+
after?: readonly import("./index.js").BlockSpec[];
|
|
470
|
+
}) => Prepared;
|
|
471
|
+
duplicateBlock: (id: BlockId, freshId?: (oldId: string, kind: "block" | "inline") => string) => Prepared;
|
|
472
|
+
};
|
|
473
|
+
/** Write a prepared plan exactly (refusals pass through). */
|
|
474
|
+
apply: (p: Prepared, quiet?: boolean) => OpResult;
|
|
475
|
+
compose: (...parts: Prepared[]) => Prepared;
|
|
476
|
+
transact: <R>(fn: () => R, origin?: unknown) => R;
|
|
414
477
|
version: number;
|
|
415
478
|
insertFlow: (target: import("./flow.js").FlowTarget, flow: import("./flow.js").Flow, view?: import("./flow.js").FlowView | undefined) => OpResult;
|
|
416
479
|
deleteRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView | undefined) => OpResult;
|
|
417
480
|
replaceRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView | undefined) => OpResult;
|
|
418
|
-
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (import("./index.js").BlockSpec | JSONBlock)[]) => OpResult;
|
|
419
|
-
moveBlocks: (ids: readonly string[], dest: import("./index.js").Destination) => OpResult;
|
|
420
481
|
nestBlock: (id: string, parent: string) => OpResult;
|
|
421
|
-
|
|
422
|
-
unNestBlocks: (ids: readonly string[]) => OpResult;
|
|
423
|
-
liftOut: (id: string, kind: string, args_2?: {
|
|
424
|
-
keep?: boolean;
|
|
425
|
-
after?: readonly import("./index.js").BlockSpec[];
|
|
426
|
-
} | undefined) => OpResult;
|
|
427
|
-
placeBeside: (ids: readonly string[], target: string, side: "right" | "left", kind?: string | undefined) => OpResult;
|
|
428
|
-
wrapInLayout: (ids: readonly string[], kind?: string | undefined, columns?: number | undefined) => OpResult;
|
|
429
|
-
splitBlock: (id: string, offset: number, newId: string, tail?: SplitTail | undefined) => OpResult;
|
|
430
|
-
mergeBlocks: (fromId: string, intoId: string) => OpResult;
|
|
431
|
-
mergeBackward: (id: string) => OpResult;
|
|
432
|
-
mergeForward: (id: string) => OpResult;
|
|
433
|
-
deleteBlock: (id: string, opts?: {
|
|
434
|
-
keepChildren?: boolean;
|
|
435
|
-
} | undefined) => OpResult;
|
|
436
|
-
setBlock: (id: string, value: {
|
|
437
|
-
type?: string;
|
|
438
|
-
data?: Record<string, unknown>;
|
|
439
|
-
content?: (ContentItem | import("./index.js").JSONText | import("./index.js").JSONInlineBlock)[];
|
|
440
|
-
children?: (import("./index.js").BlockSpec | JSONBlock)[];
|
|
441
|
-
}) => OpResult;
|
|
442
|
-
setBlockType: (id: string, type: string) => OpResult;
|
|
443
|
-
patchData: (target: DataTarget, patches: readonly DataPatch[]) => OpResult;
|
|
444
|
-
duplicateBlock: (id: string, freshId?: ((oldId: string, kind: "block" | "inline") => string) | undefined) => OpResult;
|
|
482
|
+
deleteBlocks: (ids: readonly string[]) => OpResult;
|
|
445
483
|
insertText: (id: string, offset: number, text: string, marks?: Record<string, unknown> | undefined) => OpResult;
|
|
446
484
|
deleteText: (id: string, offset: number, length: number) => OpResult;
|
|
447
485
|
formatRange: (id: string, offset: number, length: number, marks: Record<string, unknown>) => OpResult;
|
|
448
486
|
clearMarks: (id: string, offset: number, length: number) => OpResult;
|
|
449
487
|
insertInline: (id: string, offset: number, atom: import("./doc/content.js").NewInline) => OpResult;
|
|
450
488
|
removeInline: (id: string, inlineId: string) => OpResult;
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
489
|
+
setBlockType: (id: string, type: string) => OpResult;
|
|
490
|
+
patchData: (target: DataTarget, patches: readonly DataPatch[]) => OpResult;
|
|
491
|
+
setBlock: (id: string, value: {
|
|
492
|
+
type?: string;
|
|
493
|
+
data?: Record<string, unknown>;
|
|
494
|
+
content?: (ContentItem | import("./index.js").JSONText | import("./index.js").JSONInlineBlock)[];
|
|
495
|
+
children?: (import("./index.js").BlockSpec | JSONBlock)[];
|
|
496
|
+
}) => OpResult;
|
|
497
|
+
deleteBlock: (id: string, opts?: {
|
|
498
|
+
keepChildren?: boolean;
|
|
499
|
+
} | undefined) => OpResult;
|
|
500
|
+
splitBlock: (id: string, offset: number, newId: string, tail?: SplitTail | undefined) => OpResult;
|
|
501
|
+
mergeBlocks: (fromId: string, intoId: string) => OpResult;
|
|
502
|
+
mergeBackward: (id: string) => OpResult;
|
|
503
|
+
mergeForward: (id: string) => OpResult;
|
|
504
|
+
placeBeside: (ids: readonly string[], target: string, side: "left" | "right", kind?: string | undefined) => OpResult;
|
|
505
|
+
wrapInLayout: (ids: readonly string[], kind?: string | undefined, columns?: number | undefined) => OpResult;
|
|
506
|
+
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (JSONBlock | import("./index.js").BlockSpec)[]) => OpResult;
|
|
507
|
+
moveBlocks: (ids: readonly string[], dest: import("./index.js").Destination) => OpResult;
|
|
508
|
+
unNestBlocks: (ids: readonly string[]) => OpResult;
|
|
509
|
+
unNestBlock: (id: string) => OpResult;
|
|
510
|
+
liftOut: (id: string, kind: string, args_2?: {
|
|
511
|
+
keep?: boolean;
|
|
512
|
+
after?: readonly import("./index.js").BlockSpec[];
|
|
513
|
+
} | undefined) => OpResult;
|
|
514
|
+
duplicateBlock: (id: string, freshId?: ((oldId: string, kind: "block" | "inline") => string) | undefined) => OpResult;
|
|
471
515
|
project: () => import("./index.js").ProjectedDoc;
|
|
472
|
-
toJSON: (
|
|
516
|
+
toJSON: (options?: {
|
|
517
|
+
suggestions?: boolean;
|
|
518
|
+
} | undefined) => JSONDoc;
|
|
473
519
|
blockJSON: (id: string) => JSONBlock;
|
|
474
520
|
childrenIds: (id: string | null) => string[];
|
|
475
|
-
/** Visible children of `parent` with their ranks, in `(rank, id)` order. */
|
|
476
|
-
childSlots: (parent: BlockId | null) => import("./placement/model.js").ChildSlot[];
|
|
477
|
-
slotOf: (id: string) => {
|
|
478
|
-
parent: BlockId | null;
|
|
479
|
-
rank: string;
|
|
480
|
-
} | null;
|
|
481
521
|
positionOf: (id: string) => import("./index.js").Destination | null;
|
|
482
522
|
pathOf: (id: string) => number[] | null;
|
|
483
523
|
parentOf: (id: string) => string | null;
|
|
@@ -500,8 +540,6 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
500
540
|
* O(1) per call; live-replicated (remote values read the same).
|
|
501
541
|
*/
|
|
502
542
|
blockAttribution: (id: string) => BlockAttribution | undefined;
|
|
503
|
-
crdtId: (id: string) => string | null;
|
|
504
|
-
resolveBlock: (id: string) => EngineNode | null;
|
|
505
543
|
displayLength: (id: string) => number;
|
|
506
544
|
contentItems: (id: string) => ContentItem[];
|
|
507
545
|
hasBlock: (id: string) => boolean;
|
|
@@ -515,9 +553,6 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
515
553
|
blockId: BlockId;
|
|
516
554
|
offset: number;
|
|
517
555
|
} | null;
|
|
518
|
-
followUndo: (anchor: DocAnchor) => DocAnchor;
|
|
519
|
-
/** Re-read the roles after `roleOf` answers differently (roles adopted later). */
|
|
520
|
-
rolesChanged: () => void;
|
|
521
556
|
isVoid: (id: string) => boolean;
|
|
522
557
|
isIsland: (id: string) => boolean;
|
|
523
558
|
isLines: (id: string) => boolean;
|
|
@@ -564,16 +599,7 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
564
599
|
parent: string | null;
|
|
565
600
|
levels: string[];
|
|
566
601
|
};
|
|
567
|
-
defaultChild: (id: string | null) => string;
|
|
568
602
|
runs: (id: string) => readonly ContentRun[];
|
|
569
|
-
contentJSON: (id: string) => ({
|
|
570
|
-
text: string;
|
|
571
|
-
marks?: Record<string, unknown>;
|
|
572
|
-
} | {
|
|
573
|
-
id?: string;
|
|
574
|
-
type: string;
|
|
575
|
-
data?: unknown;
|
|
576
|
-
})[];
|
|
577
603
|
onChange: (cb: (change: DocChange) => void) => (() => void);
|
|
578
604
|
};
|
|
579
605
|
/**
|
|
@@ -584,14 +610,6 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
584
610
|
* not have integrated anything yet.
|
|
585
611
|
*/
|
|
586
612
|
newDoc: (opts?: ConstructorParameters<EngineApi["Doc"]>[0]) => YDoc;
|
|
587
|
-
/**
|
|
588
|
-
* Keep, on `doc`, the text a replica may have to copy again: its
|
|
589
|
-
* `gcFilter` then spares a deleted copy's content, as every facade's
|
|
590
|
-
* history does. A doc that only relays updates (the room) calls it
|
|
591
|
-
* before applying anything, so what it collects and encodes matches
|
|
592
|
-
* what an editing replica keeps.
|
|
593
|
-
*/
|
|
594
|
-
keepCopies: (doc: EngineDoc) => void;
|
|
595
613
|
/** The bound engine layers (same instances the facades use). */
|
|
596
614
|
model: {
|
|
597
615
|
REGISTRY_KEY: string;
|
|
@@ -599,29 +617,30 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
599
617
|
blockNodeOf: (doc: EngineDoc, id: BlockId) => EngineNode | null;
|
|
600
618
|
liveNodeOf: (doc: EngineDoc, id: BlockId) => EngineNode | null;
|
|
601
619
|
isLive: (doc: EngineDoc, id: BlockId) => boolean;
|
|
602
|
-
candidatesOf: (node: EngineNode) => import("./placement/model.js").PlacementCand[];
|
|
603
620
|
view: (doc: EngineDoc) => ModelView;
|
|
604
|
-
resolvePlacements: (blocks: Map<BlockId, import("./placement/model.js").BlockRec>, ownerOf?: (b: BlockId) => import("./text/model.js").Owner) => Map<BlockId, import("./placement/model.js").ResolvedPlacement>;
|
|
605
621
|
childrenIndex: (placements: Map<BlockId, import("./placement/model.js").ResolvedPlacement>, own: import("./placement/model.js").DisplayOwnership) => Map<BlockId | null, import("./placement/model.js").ChildSlot[]>;
|
|
606
622
|
positionInView: (v: ModelView, id: BlockId) => import("./index.js").Destination | null;
|
|
607
623
|
buildInline: (atom: InlineSpec) => EngineNode;
|
|
608
624
|
isSelfOrDescendant: (placements: Map<BlockId, import("./placement/model.js").ResolvedPlacement>, own: import("./text/model.js").Ownership, id: BlockId, maybeAncestor: BlockId) => boolean;
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
writePlacement: (doc: EngineDoc, node: EngineNode, p: BlockId | null, r: string) => void;
|
|
625
|
+
placeBlocks: (doc: EngineDoc, v: ModelView, parent: BlockId | null, left: BlockId | null, right: BlockId | null, slots: readonly import("./placement/slots.js").BlockSlot[] | null, moved?: readonly number[] | null, side?: number, part?: number, at?: import("./placement/slots.js").Unit | null) => void;
|
|
626
|
+
moveBlocksTo: (doc: EngineDoc, v: ModelView, ids: readonly BlockId[], parent: BlockId | null, index: number, side?: number, part?: number, at?: BlockId | null) => void;
|
|
627
|
+
insertSpecsAt: (doc: EngineDoc, v: ModelView, parent: BlockId | null, index: number, specs: readonly import("./index.js").BlockSpec[], split?: import("./placement/slots.js").Unit | null) => void;
|
|
613
628
|
withdrawOnUndo: (doc: EngineDoc) => (item: import("./engine-api.js").EngineItemRef, stackItem: {
|
|
614
629
|
inserts: {
|
|
615
630
|
has(client: number, clock: number): boolean;
|
|
616
631
|
};
|
|
617
632
|
}) => boolean;
|
|
618
|
-
materializeSpec: (doc: EngineDoc, sp: import("./index.js").BlockSpec, parent: BlockId | null, rank: string) => void;
|
|
619
633
|
collides: (doc: EngineDoc, specs: readonly import("./index.js").BlockSpec[]) => boolean;
|
|
620
|
-
writeSplit: (doc: EngineDoc, id: BlockId, offset: number, newId: BlockId, tail: SplitTail,
|
|
634
|
+
writeSplit: (doc: EngineDoc, id: BlockId, offset: number, newId: BlockId, tail: SplitTail, parent: BlockId | null, index: number) => import("./placement/slots.js").Unit;
|
|
621
635
|
ownText: (doc: EngineDoc, id: BlockId) => {
|
|
622
636
|
from: unknown;
|
|
623
637
|
to: number;
|
|
624
638
|
};
|
|
639
|
+
recordsOf: (doc: EngineDoc, node: EngineNode, v?: ModelView) => {
|
|
640
|
+
item: import("./placement/slots.js").SeqItem;
|
|
641
|
+
stamp: import("./placement/slots.js").Stamp;
|
|
642
|
+
wins: boolean;
|
|
643
|
+
}[];
|
|
625
644
|
insertBlocks: (doc: EngineDoc, dest: import("./index.js").Destination, specs: import("./index.js").BlockSpec[]) => boolean;
|
|
626
645
|
insertBlock: (doc: EngineDoc, dest: import("./index.js").Destination, spec: import("./index.js").BlockSpec) => boolean;
|
|
627
646
|
restoreBlocks: (doc: EngineDoc, specs: import("./index.js").BlockSpec[]) => void;
|
|
@@ -653,8 +672,8 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
653
672
|
at: number;
|
|
654
673
|
node: EngineNode;
|
|
655
674
|
} | null;
|
|
656
|
-
splitAt: (blocks: ReadonlyMap<import("./text/model.js").BlockId, import("./text/model.js").TextBlockRec>, own: import("./text/model.js").Ownership, b: import("./text/model.js").BlockId, offset: number, newId: import("./text/model.js").BlockId, n: number) =>
|
|
657
|
-
claimInto: (
|
|
675
|
+
splitAt: (doc: EngineDoc, blocks: ReadonlyMap<import("./text/model.js").BlockId, import("./text/model.js").TextBlockRec>, own: import("./text/model.js").Ownership, b: import("./text/model.js").BlockId, offset: number, newId: import("./text/model.js").BlockId, n: number) => void;
|
|
676
|
+
claimInto: (own: Pick<import("./text/model.js").Ownership, "streamOf">, from: import("./text/model.js").BlockId, into: import("./text/model.js").BlockId) => void;
|
|
658
677
|
ownText: (doc: EngineDoc, rec: import("./text/model.js").TextBlockRec) => {
|
|
659
678
|
from: unknown;
|
|
660
679
|
to: number;
|
|
@@ -671,7 +690,7 @@ export declare const bindDocModel: (Y: EngineApi) => {
|
|
|
671
690
|
export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
672
691
|
/** The schema manifest constants table. */
|
|
673
692
|
SCHEMA: {
|
|
674
|
-
readonly version:
|
|
693
|
+
readonly version: 11;
|
|
675
694
|
readonly name: "edytor-doc";
|
|
676
695
|
readonly roots: {
|
|
677
696
|
readonly registry: "blocks";
|
|
@@ -682,7 +701,7 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
682
701
|
readonly schema: "schema";
|
|
683
702
|
};
|
|
684
703
|
};
|
|
685
|
-
SCHEMA_VERSION:
|
|
704
|
+
SCHEMA_VERSION: 11;
|
|
686
705
|
SCHEMA_NAME: "edytor-doc";
|
|
687
706
|
META_KEY: "meta";
|
|
688
707
|
/** Doc-level API (no facade needed). */
|
|
@@ -700,84 +719,77 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
700
719
|
SchemaMismatchError: typeof SchemaMismatchError;
|
|
701
720
|
/** Attach the per-doc facade. */
|
|
702
721
|
create: (doc: EngineDoc, config?: EdytorDocConfig) => {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
removeInline: (id: BlockId, inlineId: string) => Prepared;
|
|
745
|
-
/** Delete a block selection — one plan; only the members leave (`deleteBlocks` above). */
|
|
746
|
-
deleteBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
747
|
-
};
|
|
748
|
-
/** Write a prepared plan exactly (refusals pass through). */
|
|
749
|
-
apply: (p: Prepared) => OpResult;
|
|
750
|
-
compose: (...parts: Prepared[]) => Prepared;
|
|
751
|
-
transact: <R>(fn: () => R, origin?: unknown) => R;
|
|
722
|
+
init: (opts?: Parameters<(doc: EngineDoc, opts?: {
|
|
723
|
+
content?: import("./index.js").BlockSpec[];
|
|
724
|
+
defaultType?: string;
|
|
725
|
+
}) => void>[1]) => void;
|
|
726
|
+
/** Apply the deterministic seed of `value` and the document's `data` — the document's seed decision. */
|
|
727
|
+
seed: (value: JSONBlock[], data?: JsonObj) => void;
|
|
728
|
+
isInitialized: () => boolean;
|
|
729
|
+
/** Replicated `meta.v` schema version (the module-level read, bound). */
|
|
730
|
+
schemaVersion: () => number | undefined;
|
|
731
|
+
/**
|
|
732
|
+
* The schema gate for this doc — throws {@link SchemaMismatchError}
|
|
733
|
+
* on unversioned-content or unsupported-version state. Consumers
|
|
734
|
+
* (`Edytor.sync()`, packed consumers) call it before trusting
|
|
735
|
+
* a synced doc.
|
|
736
|
+
*/
|
|
737
|
+
checkSchema: () => import("./edytor-doc.js").SchemaProblem | null;
|
|
738
|
+
assertSchema: () => void;
|
|
739
|
+
dispose: () => void;
|
|
740
|
+
createUndoManager: (options?: import("./doc/history.js").HistoryOptions) => import("./doc/history.js").UndoManager;
|
|
741
|
+
/** @internal What a part built over the document reads and writes (`doc/suggest.ts`). */
|
|
742
|
+
part: SuggestContext;
|
|
743
|
+
/** Visible children of `parent` with their ranks, in `(rank, id)` order. */
|
|
744
|
+
childSlots: (parent: BlockId | null) => import("./placement/model.js").ChildSlot[];
|
|
745
|
+
slotOf: (id: string) => {
|
|
746
|
+
parent: BlockId | null;
|
|
747
|
+
rank: string;
|
|
748
|
+
} | null;
|
|
749
|
+
crdtId: (id: string) => string | null;
|
|
750
|
+
resolveBlock: (id: string) => EngineNode | null;
|
|
751
|
+
followUndo: (anchor: DocAnchor) => DocAnchor;
|
|
752
|
+
/** Re-read the roles after `roleOf` answers differently (roles adopted later). */
|
|
753
|
+
rolesChanged: (place?: boolean) => void;
|
|
754
|
+
defaultChild: (id: string | null) => string;
|
|
755
|
+
contentJSON: (id: string) => ({
|
|
756
|
+
text: string;
|
|
757
|
+
marks?: Record<string, unknown>;
|
|
758
|
+
} | {
|
|
759
|
+
id?: string;
|
|
760
|
+
type: string;
|
|
761
|
+
data?: unknown;
|
|
762
|
+
})[];
|
|
752
763
|
model: {
|
|
753
764
|
REGISTRY_KEY: string;
|
|
754
765
|
registryOf: (doc: EngineDoc) => EngineNode;
|
|
755
766
|
blockNodeOf: (doc: EngineDoc, id: BlockId) => EngineNode | null;
|
|
756
767
|
liveNodeOf: (doc: EngineDoc, id: BlockId) => EngineNode | null;
|
|
757
768
|
isLive: (doc: EngineDoc, id: BlockId) => boolean;
|
|
758
|
-
candidatesOf: (node: EngineNode) => import("./placement/model.js").PlacementCand[];
|
|
759
769
|
view: (doc: EngineDoc) => ModelView;
|
|
760
|
-
resolvePlacements: (blocks: Map<BlockId, import("./placement/model.js").BlockRec>, ownerOf?: (b: BlockId) => import("./text/model.js").Owner) => Map<BlockId, import("./placement/model.js").ResolvedPlacement>;
|
|
761
770
|
childrenIndex: (placements: Map<BlockId, import("./placement/model.js").ResolvedPlacement>, own: import("./placement/model.js").DisplayOwnership) => Map<BlockId | null, import("./placement/model.js").ChildSlot[]>;
|
|
762
771
|
positionInView: (v: ModelView, id: BlockId) => import("./index.js").Destination | null;
|
|
763
772
|
buildInline: (atom: InlineSpec) => EngineNode;
|
|
764
773
|
isSelfOrDescendant: (placements: Map<BlockId, import("./placement/model.js").ResolvedPlacement>, own: import("./text/model.js").Ownership, id: BlockId, maybeAncestor: BlockId) => boolean;
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
writePlacement: (doc: EngineDoc, node: EngineNode, p: BlockId | null, r: string) => void;
|
|
774
|
+
placeBlocks: (doc: EngineDoc, v: ModelView, parent: BlockId | null, left: BlockId | null, right: BlockId | null, slots: readonly import("./placement/slots.js").BlockSlot[] | null, moved?: readonly number[] | null, side?: number, part?: number, at?: import("./placement/slots.js").Unit | null) => void;
|
|
775
|
+
moveBlocksTo: (doc: EngineDoc, v: ModelView, ids: readonly BlockId[], parent: BlockId | null, index: number, side?: number, part?: number, at?: BlockId | null) => void;
|
|
776
|
+
insertSpecsAt: (doc: EngineDoc, v: ModelView, parent: BlockId | null, index: number, specs: readonly import("./index.js").BlockSpec[], split?: import("./placement/slots.js").Unit | null) => void;
|
|
769
777
|
withdrawOnUndo: (doc: EngineDoc) => (item: import("./engine-api.js").EngineItemRef, stackItem: {
|
|
770
778
|
inserts: {
|
|
771
779
|
has(client: number, clock: number): boolean;
|
|
772
780
|
};
|
|
773
781
|
}) => boolean;
|
|
774
|
-
materializeSpec: (doc: EngineDoc, sp: import("./index.js").BlockSpec, parent: BlockId | null, rank: string) => void;
|
|
775
782
|
collides: (doc: EngineDoc, specs: readonly import("./index.js").BlockSpec[]) => boolean;
|
|
776
|
-
writeSplit: (doc: EngineDoc, id: BlockId, offset: number, newId: BlockId, tail: SplitTail,
|
|
783
|
+
writeSplit: (doc: EngineDoc, id: BlockId, offset: number, newId: BlockId, tail: SplitTail, parent: BlockId | null, index: number) => import("./placement/slots.js").Unit;
|
|
777
784
|
ownText: (doc: EngineDoc, id: BlockId) => {
|
|
778
785
|
from: unknown;
|
|
779
786
|
to: number;
|
|
780
787
|
};
|
|
788
|
+
recordsOf: (doc: EngineDoc, node: EngineNode, v?: ModelView) => {
|
|
789
|
+
item: import("./placement/slots.js").SeqItem;
|
|
790
|
+
stamp: import("./placement/slots.js").Stamp;
|
|
791
|
+
wins: boolean;
|
|
792
|
+
}[];
|
|
781
793
|
insertBlocks: (doc: EngineDoc, dest: import("./index.js").Destination, specs: import("./index.js").BlockSpec[]) => boolean;
|
|
782
794
|
insertBlock: (doc: EngineDoc, dest: import("./index.js").Destination, spec: import("./index.js").BlockSpec) => boolean;
|
|
783
795
|
restoreBlocks: (doc: EngineDoc, specs: import("./index.js").BlockSpec[]) => void;
|
|
@@ -809,81 +821,110 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
809
821
|
at: number;
|
|
810
822
|
node: EngineNode;
|
|
811
823
|
} | null;
|
|
812
|
-
splitAt: (blocks: ReadonlyMap<import("./text/model.js").BlockId, import("./text/model.js").TextBlockRec>, own: import("./text/model.js").Ownership, b: import("./text/model.js").BlockId, offset: number, newId: import("./text/model.js").BlockId, n: number) =>
|
|
813
|
-
claimInto: (
|
|
824
|
+
splitAt: (doc: EngineDoc, blocks: ReadonlyMap<import("./text/model.js").BlockId, import("./text/model.js").TextBlockRec>, own: import("./text/model.js").Ownership, b: import("./text/model.js").BlockId, offset: number, newId: import("./text/model.js").BlockId, n: number) => void;
|
|
825
|
+
claimInto: (own: Pick<import("./text/model.js").Ownership, "streamOf">, from: import("./text/model.js").BlockId, into: import("./text/model.js").BlockId) => void;
|
|
814
826
|
ownText: (doc: EngineDoc, rec: import("./text/model.js").TextBlockRec) => {
|
|
815
827
|
from: unknown;
|
|
816
828
|
to: number;
|
|
817
829
|
};
|
|
818
830
|
};
|
|
819
831
|
runsView: RunView;
|
|
832
|
+
/** The public members' names (`EdytorDocument` forwards them). */
|
|
833
|
+
api: object;
|
|
834
|
+
} & {
|
|
835
|
+
/** Every op prepared: pure, a plan of named steps + its effect, or `refused`. */
|
|
836
|
+
prepare: {
|
|
837
|
+
insertFlow: (target: import("./flow.js").FlowTarget, flow: import("./flow.js").Flow, view?: import("./flow.js").FlowView) => Prepared;
|
|
838
|
+
deleteRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView) => Prepared;
|
|
839
|
+
replaceRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView) => Prepared;
|
|
840
|
+
/**
|
|
841
|
+
* Move `id` to the last position under `parent` — under a container
|
|
842
|
+
* it is no item of, under its last item (`nestParent`: Tab after a list).
|
|
843
|
+
*/
|
|
844
|
+
nestBlock: (id: BlockId, parent: BlockId) => Prepared;
|
|
845
|
+
/** Delete a block selection — one plan; only the members leave (`deleteBlocks` above). */
|
|
846
|
+
deleteBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
847
|
+
insertText: (id: BlockId, offset: number, text: string, marks?: Record<string, unknown>) => Prepared;
|
|
848
|
+
deleteText: (id: BlockId, offset: number, length: number) => Prepared;
|
|
849
|
+
formatRange: (id: BlockId, offset: number, length: number, marks: Record<string, unknown>) => Prepared;
|
|
850
|
+
clearMarks: (id: BlockId, offset: number, length: number) => Prepared;
|
|
851
|
+
insertInline: (id: BlockId, offset: number, atom: import("./doc/content.js").NewInline) => Prepared;
|
|
852
|
+
removeInline: (id: BlockId, inlineId: string) => Prepared;
|
|
853
|
+
setBlockType: (id: BlockId, type: string) => Prepared;
|
|
854
|
+
patchData: (target: DataTarget, patches: readonly DataPatch[]) => Prepared;
|
|
855
|
+
setBlock: (id: BlockId, value: {
|
|
856
|
+
type?: string;
|
|
857
|
+
data?: Record<string, unknown>;
|
|
858
|
+
content?: (ContentItem | import("./index.js").JSONText | import("./index.js").JSONInlineBlock)[];
|
|
859
|
+
children?: (import("./index.js").BlockSpec | JSONBlock)[];
|
|
860
|
+
}) => Prepared;
|
|
861
|
+
deleteBlock: (id: BlockId, opts?: {
|
|
862
|
+
keepChildren?: boolean;
|
|
863
|
+
}) => Prepared;
|
|
864
|
+
splitBlock: (id: BlockId, offset: number, newId: BlockId, tail?: SplitTail) => Prepared;
|
|
865
|
+
mergeBlocks: (fromId: BlockId, intoId: BlockId) => Prepared;
|
|
866
|
+
mergeBackward: (id: BlockId) => Prepared;
|
|
867
|
+
mergeForward: (id: BlockId) => Prepared;
|
|
868
|
+
placeBeside: (ids: readonly BlockId[], target: BlockId, side: "left" | "right", kind?: string) => Prepared;
|
|
869
|
+
wrapInLayout: (ids: readonly BlockId[], kind?: string, columns?: number) => Prepared;
|
|
870
|
+
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (import("./index.js").BlockSpec | JSONBlock)[]) => Prepared;
|
|
871
|
+
moveBlocks: (ids: readonly BlockId[], dest: import("./index.js").Destination) => Prepared;
|
|
872
|
+
unNestBlocks: (ids: readonly BlockId[]) => Prepared;
|
|
873
|
+
unNestBlock: (id: BlockId) => Prepared;
|
|
874
|
+
liftOut: (id: BlockId, kind: string, { keep, after }?: {
|
|
875
|
+
keep?: boolean;
|
|
876
|
+
after?: readonly import("./index.js").BlockSpec[];
|
|
877
|
+
}) => Prepared;
|
|
878
|
+
duplicateBlock: (id: BlockId, freshId?: (oldId: string, kind: "block" | "inline") => string) => Prepared;
|
|
879
|
+
};
|
|
880
|
+
/** Write a prepared plan exactly (refusals pass through). */
|
|
881
|
+
apply: (p: Prepared, quiet?: boolean) => OpResult;
|
|
882
|
+
compose: (...parts: Prepared[]) => Prepared;
|
|
883
|
+
transact: <R>(fn: () => R, origin?: unknown) => R;
|
|
820
884
|
version: number;
|
|
821
885
|
insertFlow: (target: import("./flow.js").FlowTarget, flow: import("./flow.js").Flow, view?: import("./flow.js").FlowView | undefined) => OpResult;
|
|
822
886
|
deleteRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView | undefined) => OpResult;
|
|
823
887
|
replaceRange: (from: DocPosition, to: DocPosition, view?: import("./rangeDelete.js").RangeView | undefined) => OpResult;
|
|
824
|
-
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (import("./index.js").BlockSpec | JSONBlock)[]) => OpResult;
|
|
825
|
-
moveBlocks: (ids: readonly string[], dest: import("./index.js").Destination) => OpResult;
|
|
826
888
|
nestBlock: (id: string, parent: string) => OpResult;
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
mergeBlocks: (fromId: string, intoId: string) => OpResult;
|
|
837
|
-
mergeBackward: (id: string) => OpResult;
|
|
838
|
-
mergeForward: (id: string) => OpResult;
|
|
839
|
-
deleteBlock: (id: string, opts?: {
|
|
840
|
-
keepChildren?: boolean;
|
|
841
|
-
} | undefined) => OpResult;
|
|
889
|
+
deleteBlocks: (ids: readonly string[]) => OpResult;
|
|
890
|
+
insertText: (id: string, offset: number, text: string, marks?: Record<string, unknown> | undefined) => OpResult;
|
|
891
|
+
deleteText: (id: string, offset: number, length: number) => OpResult;
|
|
892
|
+
formatRange: (id: string, offset: number, length: number, marks: Record<string, unknown>) => OpResult;
|
|
893
|
+
clearMarks: (id: string, offset: number, length: number) => OpResult;
|
|
894
|
+
insertInline: (id: string, offset: number, atom: import("./doc/content.js").NewInline) => OpResult;
|
|
895
|
+
removeInline: (id: string, inlineId: string) => OpResult;
|
|
896
|
+
setBlockType: (id: string, type: string) => OpResult;
|
|
897
|
+
patchData: (target: DataTarget, patches: readonly DataPatch[]) => OpResult;
|
|
842
898
|
setBlock: (id: string, value: {
|
|
843
899
|
type?: string;
|
|
844
900
|
data?: Record<string, unknown>;
|
|
845
901
|
content?: (ContentItem | import("./index.js").JSONText | import("./index.js").JSONInlineBlock)[];
|
|
846
902
|
children?: (import("./index.js").BlockSpec | JSONBlock)[];
|
|
847
903
|
}) => OpResult;
|
|
848
|
-
|
|
849
|
-
|
|
904
|
+
deleteBlock: (id: string, opts?: {
|
|
905
|
+
keepChildren?: boolean;
|
|
906
|
+
} | undefined) => OpResult;
|
|
907
|
+
splitBlock: (id: string, offset: number, newId: string, tail?: SplitTail | undefined) => OpResult;
|
|
908
|
+
mergeBlocks: (fromId: string, intoId: string) => OpResult;
|
|
909
|
+
mergeBackward: (id: string) => OpResult;
|
|
910
|
+
mergeForward: (id: string) => OpResult;
|
|
911
|
+
placeBeside: (ids: readonly string[], target: string, side: "left" | "right", kind?: string | undefined) => OpResult;
|
|
912
|
+
wrapInLayout: (ids: readonly string[], kind?: string | undefined, columns?: number | undefined) => OpResult;
|
|
913
|
+
insertBlocks: (dest: import("./index.js").Destination, specs: readonly (JSONBlock | import("./index.js").BlockSpec)[]) => OpResult;
|
|
914
|
+
moveBlocks: (ids: readonly string[], dest: import("./index.js").Destination) => OpResult;
|
|
915
|
+
unNestBlocks: (ids: readonly string[]) => OpResult;
|
|
916
|
+
unNestBlock: (id: string) => OpResult;
|
|
917
|
+
liftOut: (id: string, kind: string, args_2?: {
|
|
918
|
+
keep?: boolean;
|
|
919
|
+
after?: readonly import("./index.js").BlockSpec[];
|
|
920
|
+
} | undefined) => OpResult;
|
|
850
921
|
duplicateBlock: (id: string, freshId?: ((oldId: string, kind: "block" | "inline") => string) | undefined) => OpResult;
|
|
851
|
-
insertText: (id: string, offset: number, text: string, marks?: Record<string, unknown> | undefined) => OpResult;
|
|
852
|
-
deleteText: (id: string, offset: number, length: number) => OpResult;
|
|
853
|
-
formatRange: (id: string, offset: number, length: number, marks: Record<string, unknown>) => OpResult;
|
|
854
|
-
clearMarks: (id: string, offset: number, length: number) => OpResult;
|
|
855
|
-
insertInline: (id: string, offset: number, atom: import("./doc/content.js").NewInline) => OpResult;
|
|
856
|
-
removeInline: (id: string, inlineId: string) => OpResult;
|
|
857
|
-
deleteBlocks: (ids: readonly string[]) => OpResult;
|
|
858
|
-
init: (opts?: Parameters<(doc: EngineDoc, opts?: {
|
|
859
|
-
content?: import("./index.js").BlockSpec[];
|
|
860
|
-
defaultType?: string;
|
|
861
|
-
}) => void>[1]) => void;
|
|
862
|
-
/** Apply the deterministic seed of `value` and the document's `data` — the document's seed decision. */
|
|
863
|
-
seed: (value: JSONBlock[], data?: JsonObj) => void;
|
|
864
|
-
isInitialized: () => boolean;
|
|
865
|
-
/** Replicated `meta.v` schema version (the module-level read, bound). */
|
|
866
|
-
schemaVersion: () => number | undefined;
|
|
867
|
-
/**
|
|
868
|
-
* The schema gate for this doc — throws {@link SchemaMismatchError}
|
|
869
|
-
* on unversioned-content or unsupported-version state. Consumers
|
|
870
|
-
* (`Edytor.sync()`, packed consumers) call it before trusting
|
|
871
|
-
* a synced doc.
|
|
872
|
-
*/
|
|
873
|
-
checkSchema: () => import("./edytor-doc.js").SchemaProblem | null;
|
|
874
|
-
assertSchema: () => void;
|
|
875
|
-
dispose: () => void;
|
|
876
|
-
createUndoManager: (options?: import("./doc/history.js").HistoryOptions) => import("./doc/history.js").UndoManager;
|
|
877
922
|
project: () => import("./index.js").ProjectedDoc;
|
|
878
|
-
toJSON: (
|
|
923
|
+
toJSON: (options?: {
|
|
924
|
+
suggestions?: boolean;
|
|
925
|
+
} | undefined) => JSONDoc;
|
|
879
926
|
blockJSON: (id: string) => JSONBlock;
|
|
880
927
|
childrenIds: (id: string | null) => string[];
|
|
881
|
-
/** Visible children of `parent` with their ranks, in `(rank, id)` order. */
|
|
882
|
-
childSlots: (parent: BlockId | null) => import("./placement/model.js").ChildSlot[];
|
|
883
|
-
slotOf: (id: string) => {
|
|
884
|
-
parent: BlockId | null;
|
|
885
|
-
rank: string;
|
|
886
|
-
} | null;
|
|
887
928
|
positionOf: (id: string) => import("./index.js").Destination | null;
|
|
888
929
|
pathOf: (id: string) => number[] | null;
|
|
889
930
|
parentOf: (id: string) => string | null;
|
|
@@ -906,8 +947,6 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
906
947
|
* O(1) per call; live-replicated (remote values read the same).
|
|
907
948
|
*/
|
|
908
949
|
blockAttribution: (id: string) => BlockAttribution | undefined;
|
|
909
|
-
crdtId: (id: string) => string | null;
|
|
910
|
-
resolveBlock: (id: string) => EngineNode | null;
|
|
911
950
|
displayLength: (id: string) => number;
|
|
912
951
|
contentItems: (id: string) => ContentItem[];
|
|
913
952
|
hasBlock: (id: string) => boolean;
|
|
@@ -921,9 +960,6 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
921
960
|
blockId: BlockId;
|
|
922
961
|
offset: number;
|
|
923
962
|
} | null;
|
|
924
|
-
followUndo: (anchor: DocAnchor) => DocAnchor;
|
|
925
|
-
/** Re-read the roles after `roleOf` answers differently (roles adopted later). */
|
|
926
|
-
rolesChanged: () => void;
|
|
927
963
|
isVoid: (id: string) => boolean;
|
|
928
964
|
isIsland: (id: string) => boolean;
|
|
929
965
|
isLines: (id: string) => boolean;
|
|
@@ -970,16 +1006,7 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
970
1006
|
parent: string | null;
|
|
971
1007
|
levels: string[];
|
|
972
1008
|
};
|
|
973
|
-
defaultChild: (id: string | null) => string;
|
|
974
1009
|
runs: (id: string) => readonly ContentRun[];
|
|
975
|
-
contentJSON: (id: string) => ({
|
|
976
|
-
text: string;
|
|
977
|
-
marks?: Record<string, unknown>;
|
|
978
|
-
} | {
|
|
979
|
-
id?: string;
|
|
980
|
-
type: string;
|
|
981
|
-
data?: unknown;
|
|
982
|
-
})[];
|
|
983
1010
|
onChange: (cb: (change: DocChange) => void) => (() => void);
|
|
984
1011
|
};
|
|
985
1012
|
/**
|
|
@@ -990,23 +1017,15 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
990
1017
|
* not have integrated anything yet.
|
|
991
1018
|
*/
|
|
992
1019
|
newDoc: (opts?: ConstructorParameters<EngineApi["Doc"]>[0]) => YDoc;
|
|
993
|
-
/**
|
|
994
|
-
* Keep, on `doc`, the text a replica may have to copy again: its
|
|
995
|
-
* `gcFilter` then spares a deleted copy's content, as every facade's
|
|
996
|
-
* history does. A doc that only relays updates (the room) calls it
|
|
997
|
-
* before applying anything, so what it collects and encodes matches
|
|
998
|
-
* what an editing replica keeps.
|
|
999
|
-
*/
|
|
1000
|
-
keepCopies: (doc: EngineDoc) => void;
|
|
1001
1020
|
/**
|
|
1002
1021
|
* Purge from `doc` what was deleted before `horizon` (`room.purge.what`): real deletes, inside the caller's transaction,
|
|
1003
1022
|
* and the horizon record every history reads (`hist.purge.horizon`).
|
|
1004
1023
|
* The room's purge task runs it; `facade` is a facade over `doc`.
|
|
1005
1024
|
*/
|
|
1006
|
-
purge: (doc: EngineDoc, facade: {
|
|
1025
|
+
purge: (doc: EngineDoc, facade: Partial<import("./doc/suggest.js").SuggestFacade> & {
|
|
1007
1026
|
model: import("./placement/model.js").PlacementModel;
|
|
1008
1027
|
text: import("./text/model.js").TextEngine;
|
|
1009
|
-
}, horizon: import("./purge.js").Horizon) => import("./purge.js").PurgeReport;
|
|
1028
|
+
}, horizon: import("./purge.js").Horizon | null) => import("./purge.js").PurgeReport;
|
|
1010
1029
|
/** The purge horizon `doc` holds, or `null`. */
|
|
1011
1030
|
horizonOf: (doc: EngineDoc) => import("./purge.js").Horizon | null;
|
|
1012
1031
|
/**
|
|
@@ -1020,29 +1039,30 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
1020
1039
|
blockNodeOf: (doc: EngineDoc, id: BlockId) => EngineNode | null;
|
|
1021
1040
|
liveNodeOf: (doc: EngineDoc, id: BlockId) => EngineNode | null;
|
|
1022
1041
|
isLive: (doc: EngineDoc, id: BlockId) => boolean;
|
|
1023
|
-
candidatesOf: (node: EngineNode) => import("./placement/model.js").PlacementCand[];
|
|
1024
1042
|
view: (doc: EngineDoc) => ModelView;
|
|
1025
|
-
resolvePlacements: (blocks: Map<BlockId, import("./placement/model.js").BlockRec>, ownerOf?: (b: BlockId) => import("./text/model.js").Owner) => Map<BlockId, import("./placement/model.js").ResolvedPlacement>;
|
|
1026
1043
|
childrenIndex: (placements: Map<BlockId, import("./placement/model.js").ResolvedPlacement>, own: import("./placement/model.js").DisplayOwnership) => Map<BlockId | null, import("./placement/model.js").ChildSlot[]>;
|
|
1027
1044
|
positionInView: (v: ModelView, id: BlockId) => import("./index.js").Destination | null;
|
|
1028
1045
|
buildInline: (atom: InlineSpec) => EngineNode;
|
|
1029
1046
|
isSelfOrDescendant: (placements: Map<BlockId, import("./placement/model.js").ResolvedPlacement>, own: import("./text/model.js").Ownership, id: BlockId, maybeAncestor: BlockId) => boolean;
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
writePlacement: (doc: EngineDoc, node: EngineNode, p: BlockId | null, r: string) => void;
|
|
1047
|
+
placeBlocks: (doc: EngineDoc, v: ModelView, parent: BlockId | null, left: BlockId | null, right: BlockId | null, slots: readonly import("./placement/slots.js").BlockSlot[] | null, moved?: readonly number[] | null, side?: number, part?: number, at?: import("./placement/slots.js").Unit | null) => void;
|
|
1048
|
+
moveBlocksTo: (doc: EngineDoc, v: ModelView, ids: readonly BlockId[], parent: BlockId | null, index: number, side?: number, part?: number, at?: BlockId | null) => void;
|
|
1049
|
+
insertSpecsAt: (doc: EngineDoc, v: ModelView, parent: BlockId | null, index: number, specs: readonly import("./index.js").BlockSpec[], split?: import("./placement/slots.js").Unit | null) => void;
|
|
1034
1050
|
withdrawOnUndo: (doc: EngineDoc) => (item: import("./engine-api.js").EngineItemRef, stackItem: {
|
|
1035
1051
|
inserts: {
|
|
1036
1052
|
has(client: number, clock: number): boolean;
|
|
1037
1053
|
};
|
|
1038
1054
|
}) => boolean;
|
|
1039
|
-
materializeSpec: (doc: EngineDoc, sp: import("./index.js").BlockSpec, parent: BlockId | null, rank: string) => void;
|
|
1040
1055
|
collides: (doc: EngineDoc, specs: readonly import("./index.js").BlockSpec[]) => boolean;
|
|
1041
|
-
writeSplit: (doc: EngineDoc, id: BlockId, offset: number, newId: BlockId, tail: SplitTail,
|
|
1056
|
+
writeSplit: (doc: EngineDoc, id: BlockId, offset: number, newId: BlockId, tail: SplitTail, parent: BlockId | null, index: number) => import("./placement/slots.js").Unit;
|
|
1042
1057
|
ownText: (doc: EngineDoc, id: BlockId) => {
|
|
1043
1058
|
from: unknown;
|
|
1044
1059
|
to: number;
|
|
1045
1060
|
};
|
|
1061
|
+
recordsOf: (doc: EngineDoc, node: EngineNode, v?: ModelView) => {
|
|
1062
|
+
item: import("./placement/slots.js").SeqItem;
|
|
1063
|
+
stamp: import("./placement/slots.js").Stamp;
|
|
1064
|
+
wins: boolean;
|
|
1065
|
+
}[];
|
|
1046
1066
|
insertBlocks: (doc: EngineDoc, dest: import("./index.js").Destination, specs: import("./index.js").BlockSpec[]) => boolean;
|
|
1047
1067
|
insertBlock: (doc: EngineDoc, dest: import("./index.js").Destination, spec: import("./index.js").BlockSpec) => boolean;
|
|
1048
1068
|
restoreBlocks: (doc: EngineDoc, specs: import("./index.js").BlockSpec[]) => void;
|
|
@@ -1074,8 +1094,8 @@ export declare const bindEdytorDoc: (Y: EngineApi) => {
|
|
|
1074
1094
|
at: number;
|
|
1075
1095
|
node: EngineNode;
|
|
1076
1096
|
} | null;
|
|
1077
|
-
splitAt: (blocks: ReadonlyMap<import("./text/model.js").BlockId, import("./text/model.js").TextBlockRec>, own: import("./text/model.js").Ownership, b: import("./text/model.js").BlockId, offset: number, newId: import("./text/model.js").BlockId, n: number) =>
|
|
1078
|
-
claimInto: (
|
|
1097
|
+
splitAt: (doc: EngineDoc, blocks: ReadonlyMap<import("./text/model.js").BlockId, import("./text/model.js").TextBlockRec>, own: import("./text/model.js").Ownership, b: import("./text/model.js").BlockId, offset: number, newId: import("./text/model.js").BlockId, n: number) => void;
|
|
1098
|
+
claimInto: (own: Pick<import("./text/model.js").Ownership, "streamOf">, from: import("./text/model.js").BlockId, into: import("./text/model.js").BlockId) => void;
|
|
1079
1099
|
ownText: (doc: EngineDoc, rec: import("./text/model.js").TextBlockRec) => {
|
|
1080
1100
|
from: unknown;
|
|
1081
1101
|
to: number;
|