@ifc-lite/collab 0.2.4 → 0.2.5
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 +27 -10
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,11 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Real-time collaborative BIM via CRDT on IFCX. Built on [Yjs](https://github.com/yjs/yjs).
|
|
4
4
|
|
|
5
|
-
> **Status:
|
|
5
|
+
> **Status: early (0.x).** Single- and multi-peer Y.Doc editing, IFCX
|
|
6
6
|
> seed/snapshot round-trip, IndexedDB persistence, undo manager, websocket
|
|
7
|
-
> provider, awareness/presence
|
|
8
|
-
>
|
|
9
|
-
>
|
|
7
|
+
> provider, awareness/presence, conflict detection, per-user layer
|
|
8
|
+
> extraction, branching, federation, and end-to-end encryption helpers. See
|
|
9
|
+
> [collab-plan.md](https://github.com/LTplus-AG/ifc-lite/blob/main/docs/architecture/collab-plan.md)
|
|
10
|
+
> for the roadmap.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @ifc-lite/collab
|
|
16
|
+
```
|
|
10
17
|
|
|
11
18
|
## Why
|
|
12
19
|
|
|
@@ -26,7 +33,7 @@ const buffer = await fetch('/model.ifcx').then((r) => r.arrayBuffer());
|
|
|
26
33
|
const session = await createCollabSession({
|
|
27
34
|
roomId: 'project-abc/model.ifcx',
|
|
28
35
|
user: { id: 'louis', name: 'Louis Trümpler', color: '#5b8def' },
|
|
29
|
-
provider: 'indexeddb', // or 'websocket' for multi-peer
|
|
36
|
+
provider: 'indexeddb', // or 'websocket' for multi-peer (requires serverUrl)
|
|
30
37
|
});
|
|
31
38
|
seedFromIfcx(session.doc, buffer);
|
|
32
39
|
|
|
@@ -50,12 +57,16 @@ const ifcx = snapshotToIfcx(session.doc, { author: 'louis' });
|
|
|
50
57
|
|
|
51
58
|
```ts
|
|
52
59
|
createCollabSession(opts) → CollabSession
|
|
53
|
-
session.doc
|
|
54
|
-
session.presence
|
|
55
|
-
session.
|
|
56
|
-
session.
|
|
60
|
+
session.doc // Y.Doc
|
|
61
|
+
session.presence // Presence (awareness wrapper)
|
|
62
|
+
session.whenSynced // resolves once persistence / websocket sync completes
|
|
63
|
+
session.seed(input) // seed the Y.Doc from an .ifcx buffer or object
|
|
64
|
+
session.transact(fn) // wrapper around ydoc.transact with our origin
|
|
65
|
+
session.undo() // local-origin undo via Y.UndoManager
|
|
57
66
|
session.redo()
|
|
58
|
-
session.snapshot()
|
|
67
|
+
session.snapshot() // → IfcxFile
|
|
68
|
+
session.extractUserLayer(baseline) // per-peer IFCX overlay layer
|
|
69
|
+
session.onConflict(listener)
|
|
59
70
|
session.dispose()
|
|
60
71
|
```
|
|
61
72
|
|
|
@@ -87,6 +98,12 @@ See spec §9 for the full conflict policy. In short:
|
|
|
87
98
|
The `createConflictDetector` helper observes Y.Doc updates and emits
|
|
88
99
|
structured events that the viewer (or any UI) can render.
|
|
89
100
|
|
|
101
|
+
## Docs
|
|
102
|
+
|
|
103
|
+
See the [ifc-lite docs](https://ltplus-ag.github.io/ifc-lite/). Pair with
|
|
104
|
+
[`@ifc-lite/collab-server`](https://www.npmjs.com/package/@ifc-lite/collab-server)
|
|
105
|
+
for multi-peer websocket sync.
|
|
106
|
+
|
|
90
107
|
## License
|
|
91
108
|
|
|
92
109
|
MPL-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/collab",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Real-time collaborative BIM via CRDT on IFCX",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"y-protocols": "^1.0.6",
|
|
40
40
|
"y-websocket": "^3.0.0",
|
|
41
41
|
"yjs": "^13.6.31",
|
|
42
|
-
"@ifc-lite/data": "^2.
|
|
43
|
-
"@ifc-lite/ifcx": "^2.1
|
|
44
|
-
"@ifc-lite/mutations": "^1.
|
|
42
|
+
"@ifc-lite/data": "^2.5.1",
|
|
43
|
+
"@ifc-lite/ifcx": "^2.2.1",
|
|
44
|
+
"@ifc-lite/mutations": "^1.18.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"typescript": "^6.0.3",
|
|
48
|
-
"vitest": "^4.1.
|
|
48
|
+
"vitest": "^4.1.9"
|
|
49
49
|
},
|
|
50
50
|
"license": "MPL-2.0",
|
|
51
51
|
"author": "Louis True",
|