edytor 6.0.0 → 7.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 +3 -3
- package/dist/cloudflare/DocumentRoom.d.ts +77 -2
- package/dist/cloudflare/DocumentRoom.js +37 -1
- package/dist/cloudflare/index.d.ts +1 -1
- package/dist/cloudflare/index.js +1 -1
- package/dist/cloudflare/room/access.d.ts +6 -1
- package/dist/cloudflare/room/access.js +30 -4
- package/dist/cloudflare/room/admission.d.ts +11 -0
- package/dist/cloudflare/room/admission.js +43 -10
- package/dist/cloudflare/room/context.d.ts +11 -2
- package/dist/cloudflare/room/context.js +17 -6
- package/dist/cloudflare/room/forged.d.ts +1 -1
- package/dist/cloudflare/room/forged.js +11 -9
- package/dist/cloudflare/room/frames.d.ts +2 -0
- package/dist/cloudflare/room/frames.js +2 -0
- package/dist/cloudflare/room/presence.js +1 -4
- package/dist/cloudflare/room/reseed.d.ts +93 -0
- package/dist/cloudflare/room/reseed.js +500 -0
- package/dist/cloudflare/room/scheduler.d.ts +1 -1
- package/dist/cloudflare/room/scheduler.js +9 -1
- package/dist/cloudflare/room/shared.d.ts +10 -0
- package/dist/cloudflare/room/shared.js +10 -0
- package/dist/cloudflare/room/storage.d.ts +7 -0
- package/dist/cloudflare/room/storage.js +33 -1
- package/dist/components/Edytor.svelte +18 -3
- package/dist/components/Edytor.svelte.d.ts +10 -1
- package/dist/components/EdytorRoot.svelte +17 -0
- package/dist/components/EdytorRoot.svelte.d.ts +4 -0
- package/dist/components/Suggestion.svelte +1 -1
- package/dist/crdt/attribution/block.d.ts +3 -0
- package/dist/crdt/attribution/block.js +3 -2
- package/dist/crdt/doc/suggest.d.ts +6 -2
- package/dist/crdt/doc/suggest.js +6 -5
- package/dist/crdt/edytor-doc.d.ts +1 -1
- package/dist/crdt/edytor-doc.js +1 -1
- package/dist/crdt/engine-room.d.ts +4 -0
- package/dist/crdt/engine-room.js +6 -0
- package/dist/crdt/index.d.ts +2 -1
- package/dist/crdt/protocol.d.ts +2 -2
- package/dist/crdt/protocol.js +2 -2
- package/dist/crdt/protocols/auth.d.ts +8 -1
- package/dist/crdt/protocols/auth.js +14 -1
- package/dist/crdt/providers/index.d.ts +1 -0
- package/dist/crdt/providers/index.js +22 -3
- package/dist/crdt/providers/room.d.ts +15 -0
- package/dist/crdt/providers/room.js +15 -0
- package/dist/crdt/providers/websocket.d.ts +4 -2
- package/dist/crdt/providers/websocket.js +36 -9
- package/dist/crdt/reseed.d.ts +127 -0
- package/dist/crdt/reseed.js +533 -0
- package/dist/crdt/restore.d.ts +13 -1
- package/dist/crdt/restore.js +8 -3
- package/dist/crdt/schema.d.ts +6 -0
- package/dist/crdt/schema.js +6 -0
- package/dist/crdt/structs.d.ts +8 -11
- package/dist/crdt/structs.js +25 -44
- package/dist/crdt/text/index/build.d.ts +3 -9
- package/dist/crdt/text/index/build.js +87 -181
- package/dist/crdt/vendor/yjs/UPSTREAM.md +101 -5
- package/dist/crdt/vendor/yjs/dts/index.d.ts +1 -1
- package/dist/crdt/vendor/yjs/dts/utils/Transaction.d.ts +10 -10
- package/dist/crdt/vendor/yjs/dts/utils/encoding.d.ts +1 -0
- package/dist/crdt/vendor/yjs/src/index.js +1 -1
- package/dist/crdt/vendor/yjs/src/structs/Item.js +24 -13
- package/dist/crdt/vendor/yjs/src/utils/Transaction.js +12 -10
- package/dist/crdt/vendor/yjs/src/utils/encoding.js +42 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/selection/selection.svelte.d.ts +1 -1
- package/dist/selection/selection.svelte.js +87 -106
- package/dist/session/commands.js +49 -51
- package/dist/surface/attributes.d.ts +3 -3
- package/dist/surface/attributes.js +2 -2
- package/dist/surface/observer.svelte.d.ts +7 -7
- package/dist/surface/observer.svelte.js +213 -309
- package/package.json +1 -1
|
@@ -20,8 +20,8 @@ export const blockDir = (text) => {
|
|
|
20
20
|
const strong = STRONG.exec(text)?.[0];
|
|
21
21
|
return strong === undefined ? null : RTL.test(strong) ? 'rtl' : 'ltr';
|
|
22
22
|
};
|
|
23
|
-
/** The text a cell's runs show
|
|
24
|
-
export const ownText = (runs) => runs.map((run) => (run.kind === 'text' ? run.text :
|
|
23
|
+
/** The text a cell's runs show, each atom as `atom` (left out: what `blockDir` reads). */
|
|
24
|
+
export const ownText = (runs, atom = '') => runs.map((run) => (run.kind === 'text' ? run.text : atom)).join('');
|
|
25
25
|
/** A text inside a void block is its own editing host (the core sets it at attach). */
|
|
26
26
|
export const insideVoid = (edytor, block) => {
|
|
27
27
|
for (let id = block; id; id = edytor.facade.parentOf(id))
|
|
@@ -31,12 +31,12 @@ export declare class SurfaceObserver {
|
|
|
31
31
|
* editing host inside a void).
|
|
32
32
|
*/
|
|
33
33
|
register: (node: Element, kind: Kind, block: string, name?: string, owned?: () => Owned, handle?: Text | InlineBlock) => () => void;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
/**
|
|
35
|
+
* A view-only element the core renders in the host, never compared: the
|
|
36
|
+
* render anchor (`Edytor.svelte`, a registered child of the strict root),
|
|
37
|
+
* or with its suggestion's `id`, a preview group (`components/Suggestion`).
|
|
38
|
+
*/
|
|
39
|
+
own: (node: HTMLElement, id?: string) => {
|
|
40
40
|
destroy: () => void;
|
|
41
41
|
};
|
|
42
42
|
/** Extension view state rendered into the host, or a re-display request: an epoch bump. */
|
|
@@ -71,4 +71,4 @@ export declare class SurfaceObserver {
|
|
|
71
71
|
* The caret lands where the browser put it (`domCaret`), else, for an
|
|
72
72
|
* attempt, where the change ends — unless a gesture came since.
|
|
73
73
|
*/
|
|
74
|
-
export declare const adopt: (edytor: Edytor, text: Text, dom: string, domCaret?: number, prefer?: number) => Promise<
|
|
74
|
+
export declare const adopt: (edytor: Edytor, text: Text, dom: string, domCaret?: number, prefer?: number) => Promise<void>;
|