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
|
@@ -25,7 +25,7 @@ export class ItemTextListPosition {
|
|
|
25
25
|
advance(transaction: Transaction, length: number): void;
|
|
26
26
|
}
|
|
27
27
|
export function insertAtGapEndHelper(transaction: Transaction, parent: YNode, index: number, content: import("./structs/Item.js").AbstractContent): void;
|
|
28
|
-
export function deleteText(transaction: Transaction, currPos: ItemTextListPosition, length: number): ItemTextListPosition;
|
|
28
|
+
export function deleteText(transaction: Transaction, currPos: ItemTextListPosition, length: number, held?: Array<number> | null, fresh?: import("./utils/ids.js").IdSet | null, sort?: ((client: number, clock: number) => number) | null, proposed?: Array<number> | null, hidden?: Array<number> | null): ItemTextListPosition;
|
|
29
29
|
export class ArraySearchMarker {
|
|
30
30
|
/**
|
|
31
31
|
* @param {Item} p
|
|
@@ -188,11 +188,52 @@ export class YNode {
|
|
|
188
188
|
mark(index: number, length: number, mark: string, value: any, startSide: number, endSide: number): void;
|
|
189
189
|
/**
|
|
190
190
|
* Deletes elements starting from an index. A deleted node is left as it is.
|
|
191
|
+
* YP20: with `into` (the document's records list), the live units are not
|
|
192
|
+
* removed but held by one record appended to `into` (their writer's delete,
|
|
193
|
+
* which an undo of the record takes back), except those `fresh` names (the
|
|
194
|
+
* open undo step's inserts: removed, so that step's undo changes nothing).
|
|
195
|
+
*
|
|
196
|
+
* YP32: with `propose` (a suggestion's delete) each unit is sorted: held
|
|
197
|
+
* by the record in `into` (`1`: its author's own), proposed (`2`: an id
|
|
198
|
+
* list appended to `propose.into`, a suggestion's record, holding nothing)
|
|
199
|
+
* or stepped over (`3`: already proposed); proposed and stepped-over units
|
|
200
|
+
* read gone until `unhide`, so the rest of the plan reads the offsets it
|
|
201
|
+
* was prepared with.
|
|
191
202
|
*
|
|
192
203
|
* @param {number} index Index at which to start deleting elements
|
|
193
204
|
* @param {number} length The number of elements to remove. Defaults to 1.
|
|
205
|
+
* @param {YNode|null} [into]
|
|
206
|
+
* @param {import('./utils/ids.js').IdSet|null} [fresh]
|
|
207
|
+
* @param {{ into: YNode, sort: (client: number, clock: number) => number }|null} [propose]
|
|
208
|
+
*/
|
|
209
|
+
delete(index: number, length?: number, into?: YNode | null, fresh?: import("./utils/ids.js").IdSet | null, propose?: {
|
|
210
|
+
into: YNode;
|
|
211
|
+
sort: (client: number, clock: number) => number;
|
|
212
|
+
} | null): void;
|
|
213
|
+
/**
|
|
214
|
+
* YP20: append to this node (the document's records list) one hold record of
|
|
215
|
+
* the items `ids` names (`client, clock, len` triples): they read as deleted
|
|
216
|
+
* while the record is live.
|
|
217
|
+
*
|
|
218
|
+
* @param {Array<number>} ids
|
|
219
|
+
*/
|
|
220
|
+
hold(ids: Array<number>): void;
|
|
221
|
+
/**
|
|
222
|
+
* YP22: move the units `ids` (`client, clock, len` ranges, in the order
|
|
223
|
+
* they will show) to live index `index` of this sequence: one move record
|
|
224
|
+
* there (`ContentMove`); `side` is its class among the items of its origin
|
|
225
|
+
* (`0` after, `1` before), `at` the chain it stands at for the sort of two
|
|
226
|
+
* records at one origin — the units from the root sequence down to the
|
|
227
|
+
* unit it stands at, outermost first (`null`: the first unit it names) —
|
|
228
|
+
* and `part` the writer's order among the records standing at that unit.
|
|
229
|
+
*
|
|
230
|
+
* @param {number} index
|
|
231
|
+
* @param {Array<number>} ids
|
|
232
|
+
* @param {number} [side]
|
|
233
|
+
* @param {number} [part]
|
|
234
|
+
* @param {Array<ID>|null} [at]
|
|
194
235
|
*/
|
|
195
|
-
|
|
236
|
+
move(index: number, ids: Array<number>, side?: number, part?: number, at?: Array<ID> | null): void;
|
|
196
237
|
/**
|
|
197
238
|
* Executes a provided function on once on every key-value pair.
|
|
198
239
|
*
|
|
@@ -216,19 +257,23 @@ export function nodeMapDelete(transaction: Transaction, parent: YNode, key: stri
|
|
|
216
257
|
export function nodeMapSet(transaction: Transaction, parent: YNode, key: string, value: YValue): void;
|
|
217
258
|
export function readContentType(decoder: UpdateDecoder): ContentType;
|
|
218
259
|
export function readContentString(decoder: UpdateDecoder): ContentString;
|
|
219
|
-
export function readContentFormat(decoder: UpdateDecoder): ContentFormat;
|
|
260
|
+
export function readContentFormat(decoder: UpdateDecoder, id: import("./utils/ID.js").ID): ContentFormat;
|
|
220
261
|
export function readContentAny(decoder: UpdateDecoder): ContentAny;
|
|
221
262
|
export function readContentBinary(decoder: UpdateDecoder): ContentBinary;
|
|
222
263
|
export function readContentDeleted(decoder: UpdateDecoder): ContentDeleted;
|
|
264
|
+
export function readContentHold(decoder: UpdateDecoder): ContentHold;
|
|
265
|
+
export function readContentMove(decoder: UpdateDecoder): ContentMove;
|
|
266
|
+
export function readContentClass(decoder: UpdateDecoder): ContentDeleted;
|
|
223
267
|
/**
|
|
224
268
|
* A lookup map for reading Item content. YP19: JSON (2), embed (5) and
|
|
225
269
|
* subdocument (9) contents are refused like GC (0) and Skip (10): edytor
|
|
226
|
-
* writes none, so an update holding one is malformed.
|
|
270
|
+
* writes none, so an update holding one is malformed. YP20: 11 is a hold
|
|
271
|
+
* record. YP22: 12 is a move record.
|
|
227
272
|
*
|
|
228
|
-
* @type {Array<function(UpdateDecoder):AbstractContent>}
|
|
273
|
+
* @type {Array<function(UpdateDecoder, import('./utils/ID.js').ID):AbstractContent>}
|
|
229
274
|
*/
|
|
230
|
-
export const contentRefs: Array<(arg0: UpdateDecoder) => AbstractContent>;
|
|
231
|
-
export function readItemContent(decoder: UpdateDecoder, info: number): import("./structs/Item.js").AbstractContent;
|
|
275
|
+
export const contentRefs: Array<(arg0: UpdateDecoder, arg1: import("./utils/ID.js").ID) => AbstractContent>;
|
|
276
|
+
export function readItemContent(decoder: UpdateDecoder, info: number, id: import("./utils/ID.js").ID): import("./structs/Item.js").AbstractContent;
|
|
232
277
|
export function readYNode(decoder: UpdateDecoder): YNode;
|
|
233
278
|
export type YValue = {
|
|
234
279
|
[x: string]: any;
|
|
@@ -253,3 +298,5 @@ import { ContentFormat } from './structs/Item.js';
|
|
|
253
298
|
import { ContentAny } from './structs/Item.js';
|
|
254
299
|
import { ContentBinary } from './structs/Item.js';
|
|
255
300
|
import { ContentDeleted } from './structs/Item.js';
|
|
301
|
+
import { ContentHold } from './structs/Item.js';
|
|
302
|
+
import { ContentMove } from './structs/Item.js';
|
|
@@ -25,6 +25,8 @@ declare type ContentAny = import('./src/structs/Item.js').ContentAny
|
|
|
25
25
|
declare type ContentFormat = import('./src/structs/Item.js').ContentFormat
|
|
26
26
|
declare type ContentDeleted = import('./src/structs/Item.js').ContentDeleted
|
|
27
27
|
declare type ContentString = import('./src/structs/Item.js').ContentString
|
|
28
|
+
declare type ContentHold = import('./src/structs/Item.js').ContentHold
|
|
29
|
+
declare type ContentMove = import('./src/structs/Item.js').ContentMove
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
// @todo the below should have a separate Y/[mod] export
|
|
@@ -19,7 +19,7 @@ export { RangeCursor } from './utils/RangeCursor.js'
|
|
|
19
19
|
export { YNode as Node } from './ynode.js'
|
|
20
20
|
export { AbstractStruct } from './structs/AbstractStruct.js'
|
|
21
21
|
export { GC } from './structs/GC.js'
|
|
22
|
-
export { Item, followRedone, ContentBinary, ContentDeleted, ContentFormat, ContentAny, ContentString, ContentType } from './structs/Item.js'
|
|
22
|
+
export { Item, followRedone, ContentBinary, ContentDeleted, ContentFormat, ContentAny, ContentString, ContentType, ContentMove, unhide } from './structs/Item.js' // YP22: ContentMove; YP32: unhide
|
|
23
23
|
export { Skip } from './structs/Skip.js'
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -17,6 +17,16 @@ export class AbstractStruct {
|
|
|
17
17
|
throw error.methodUnimplemented()
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Whether the engine deleted this struct (YP20: an item can be hidden without
|
|
22
|
+
* being removed; a GC struct is removed, a Skip is not).
|
|
23
|
+
*
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
*/
|
|
26
|
+
get removed () {
|
|
27
|
+
return this.deleted
|
|
28
|
+
}
|
|
29
|
+
|
|
20
30
|
/**
|
|
21
31
|
* Merge this struct with the item to the right.
|
|
22
32
|
* This method is already assuming that `this.id.clock + this.length === this.id.clock`.
|