@jxsuite/collab 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +5 -5
- package/src/awareness-types.ts +5 -3
- package/src/index.ts +12 -2
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ one `error{read-only}`.
|
|
|
69
69
|
|
|
70
70
|
One project-level `Awareness` per connection. State shape:
|
|
71
71
|
`{ user: {login, name?, avatarUrl?, color}, focusedPath, mode?, structuralSelection?, selection? }` —
|
|
72
|
-
file-tree presence (the plain `selection` field is
|
|
72
|
+
file-tree presence (the plain `selection` field is the code view's in-buffer cursor)
|
|
73
73
|
and per-document cursor overlays both filter the same states. Identity comes from the server
|
|
74
74
|
`hello`; colors are deterministic (`colorForKey`).
|
|
75
75
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/collab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Realtime co-editing for Jx Studio — Y.Doc schema, op bridge, structural differ, wire envelope, and provider contracts shared by every collab backend",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"test:coverage": "bun test --isolate --coverage"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@jxsuite/schema": "^1.
|
|
37
|
-
"lib0": "^0.2.
|
|
38
|
-
"y-protocols": "^1.0.
|
|
39
|
-
"yjs": "13.6.
|
|
36
|
+
"@jxsuite/schema": "^1.8.0",
|
|
37
|
+
"lib0": "^0.2.117",
|
|
38
|
+
"y-protocols": "^1.0.7",
|
|
39
|
+
"yjs": "13.6.32"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/src/awareness-types.ts
CHANGED
|
@@ -30,9 +30,11 @@ export interface CollabAwarenessState {
|
|
|
30
30
|
*/
|
|
31
31
|
structuralSelection?: JxPath[] | null;
|
|
32
32
|
/**
|
|
33
|
-
* RESERVED for
|
|
34
|
-
*
|
|
35
|
-
* bound
|
|
33
|
+
* RESERVED for the code view: the in-buffer text cursor as {anchor, head} Y.RelativePosition
|
|
34
|
+
* JSON. `studio/src/collab/monaco-binding.ts`'s bindMonacoToYText owns this field via
|
|
35
|
+
* setLocalStateField("selection", …) while a code view is bound, and sets it back to null when it
|
|
36
|
+
* unbinds; nothing else may write it. The shape is y-monaco's, deliberately — a peer on an older
|
|
37
|
+
* Studio publishes and reads exactly this.
|
|
36
38
|
*/
|
|
37
39
|
selection?: { anchor: unknown; head: unknown } | null;
|
|
38
40
|
/**
|
package/src/index.ts
CHANGED
|
@@ -18,8 +18,18 @@ export {
|
|
|
18
18
|
yDocToJson,
|
|
19
19
|
yValueToJson,
|
|
20
20
|
} from "./schema.ts";
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/* Re-exported so consumers keep a single yjs import point (avoids dual-instance hazards).
|
|
22
|
+
|
|
23
|
+
The two position helpers are here for exactly that reason. `studio/src/collab/monaco-binding.ts`
|
|
24
|
+
mints a RelativePosition for every saved caret and resolves peers' back to offsets, and a
|
|
25
|
+
RelativePosition minted by a SECOND yjs instance resolves to null against this doc — the failure
|
|
26
|
+
is a cursor that silently stops moving, not an error. One import point, one instance. */
|
|
27
|
+
export {
|
|
28
|
+
createAbsolutePositionFromRelativePosition,
|
|
29
|
+
createRelativePositionFromTypeIndex,
|
|
30
|
+
Doc as YDoc,
|
|
31
|
+
UndoManager,
|
|
32
|
+
} from "yjs";
|
|
23
33
|
export {
|
|
24
34
|
applyDocOpsToY,
|
|
25
35
|
CollabPathError,
|