@ifc-lite/collab 0.2.3 → 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 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: v0.1 Foundation.** Single- and multi-peer Y.Doc editing, IFCX
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 types, conflict detection. See
8
- > [`docs/architecture/collab-plan.md`](../../docs/architecture/collab-plan.md)
9
- > for the full v0.1 → v1.0 roadmap.
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 // Y.Doc
54
- session.presence // Presence (awareness wrapper)
55
- session.transact(fn) // wrapper around ydoc.transact with our origin
56
- session.undo() // local-origin undo via Y.UndoManager
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() // → IfcxFile
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",
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,15 +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.0.2",
43
- "@ifc-lite/ifcx": "^2.1.4",
44
- "@ifc-lite/mutations": "^1.15.3"
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
- "@types/ws": "^8.5.13",
48
47
  "typescript": "^6.0.3",
49
- "vitest": "^4.1.0",
50
- "ws": "^8.21.0"
48
+ "vitest": "^4.1.9"
51
49
  },
52
50
  "license": "MPL-2.0",
53
51
  "author": "Louis True",
@@ -1,8 +0,0 @@
1
- export * from './schema.js';
2
- export * from './schema-version.js';
3
- export * from './migration-ifc4-to-ifc4x3.js';
4
- export * from './entity.js';
5
- export * from './relationship.js';
6
- export * from './geometry.js';
7
- export * from './units.js';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/doc/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
package/dist/doc/index.js DELETED
@@ -1,11 +0,0 @@
1
- /* This Source Code Form is subject to the terms of the Mozilla Public
2
- * License, v. 2.0. If a copy of the MPL was not distributed with this
3
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
- export * from './schema.js';
5
- export * from './schema-version.js';
6
- export * from './migration-ifc4-to-ifc4x3.js';
7
- export * from './entity.js';
8
- export * from './relationship.js';
9
- export * from './geometry.js';
10
- export * from './units.js';
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/doc/index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}