@ifc-lite/collab 0.5.0 → 0.6.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 +2 -0
- package/dist/branch/branch.d.ts.map +1 -1
- package/dist/branch/branch.js +16 -7
- package/dist/branch/branch.js.map +1 -1
- package/dist/doc/entity.d.ts +12 -6
- package/dist/doc/entity.d.ts.map +1 -1
- package/dist/doc/entity.js +23 -2
- package/dist/doc/entity.js.map +1 -1
- package/dist/doc/geometry.d.ts +33 -0
- package/dist/doc/geometry.d.ts.map +1 -1
- package/dist/doc/geometry.js +59 -1
- package/dist/doc/geometry.js.map +1 -1
- package/dist/geometry/blob-store.d.ts.map +1 -1
- package/dist/geometry/blob-store.js +10 -4
- package/dist/geometry/blob-store.js.map +1 -1
- package/dist/geometry/gc.d.ts +15 -1
- package/dist/geometry/gc.d.ts.map +1 -1
- package/dist/geometry/gc.js +15 -5
- package/dist/geometry/gc.js.map +1 -1
- package/dist/snapshot/from-ifcx.d.ts +32 -0
- package/dist/snapshot/from-ifcx.d.ts.map +1 -1
- package/dist/snapshot/from-ifcx.js +232 -71
- package/dist/snapshot/from-ifcx.js.map +1 -1
- package/dist/snapshot/from-step.d.ts.map +1 -1
- package/dist/snapshot/from-step.js +7 -2
- package/dist/snapshot/from-step.js.map +1 -1
- package/dist/snapshot/index.d.ts +1 -1
- package/dist/snapshot/index.d.ts.map +1 -1
- package/dist/snapshot/index.js +1 -1
- package/dist/snapshot/index.js.map +1 -1
- package/dist/snapshot/overlay-entity-attrs.d.ts +12 -0
- package/dist/snapshot/overlay-entity-attrs.d.ts.map +1 -0
- package/dist/snapshot/overlay-entity-attrs.js +34 -0
- package/dist/snapshot/overlay-entity-attrs.js.map +1 -0
- package/dist/snapshot/overlay-tombstones.d.ts +33 -0
- package/dist/snapshot/overlay-tombstones.d.ts.map +1 -0
- package/dist/snapshot/overlay-tombstones.js +36 -0
- package/dist/snapshot/overlay-tombstones.js.map +1 -0
- package/dist/snapshot/structured-attrs.d.ts +18 -0
- package/dist/snapshot/structured-attrs.d.ts.map +1 -1
- package/dist/snapshot/structured-attrs.js +49 -0
- package/dist/snapshot/structured-attrs.js.map +1 -1
- package/dist/snapshot/to-ifcx.d.ts.map +1 -1
- package/dist/snapshot/to-ifcx.js +14 -1
- package/dist/snapshot/to-ifcx.js.map +1 -1
- package/package.json +5 -5
package/dist/geometry/gc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gc.js","sourceRoot":"","sources":["../../src/geometry/gc.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA4B/D,OAAO,EACL,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;;GAQG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAU;IACpD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAY,CAAC;IACvC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAE9B,mEAAmE;IACnE,IAAI,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QAC1B,MAAM,MAAM,GAAG,UAA4B,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAA+B,CAAC;QACjF,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,yEAAyE;QACzE,sDAAsD;QACtD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACrC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YACnC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;YAC1D,CAAC,CAAC,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAA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AC;IACD,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO;QACL,IAAI;QACJ,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,kEAAkE;QAClE,mEAAmE;QACnE,wCAAwC;KACzC,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAgB,EAAE,QAAuB;IACxE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QACjC,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,EAAE;YAAE,KAAK,IAAI,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -21,4 +21,36 @@ export declare function parseIfcxInput(input: IfcxInput): IfcxFile;
|
|
|
21
21
|
* for callers that want to inspect headers / schemas.
|
|
22
22
|
*/
|
|
23
23
|
export declare function seedFromIfcx(doc: Y.Doc, input: IfcxInput, opts?: SeedOptions): IfcxFile;
|
|
24
|
+
export interface OverlayOptions {
|
|
25
|
+
/** Origin tag for the overlay transaction. Defaults to SEED_ORIGIN. */
|
|
26
|
+
origin?: unknown;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Apply an IFCX file to `doc` as a *layer of opinions* rather than as a
|
|
30
|
+
* seed.
|
|
31
|
+
*
|
|
32
|
+
* `seedFromIfcx` routes every node through `createEntity`, a deliberate
|
|
33
|
+
* no-op on a path the doc already has — right for seeding from a
|
|
34
|
+
* snapshot, wrong for merging a layer whose purpose is to modify entities
|
|
35
|
+
* that already exist. This applier creates missing entities exactly as
|
|
36
|
+
* the seeder does, and writes existing entities' opinions on top: values
|
|
37
|
+
* overwrite, anything unmentioned is left alone. `null` removes a FLAT
|
|
38
|
+
* attribute, child or inherit ONLY: a nulled pset/quantity property
|
|
39
|
+
* survives, silently (pinned in `test/apply-ifcx-overlay.test.ts`).
|
|
40
|
+
*
|
|
41
|
+
* Deliberately NOT part of `seedFromIfcx`'s option surface: the seeder is
|
|
42
|
+
* additive-and-idempotent (`apps/viewer`, `snapshot/worker.ts` seed a
|
|
43
|
+
* live session doc with it), and this is a different operation.
|
|
44
|
+
*
|
|
45
|
+
* Deletion opinions are honoured where the layer states them: an
|
|
46
|
+
* `ifclite::deleted: true` node removes the entity, matching composition,
|
|
47
|
+
* `bakeLayers` and the MCP layer store. A full IFCX snapshot emits only
|
|
48
|
+
* what an entity has though, so a key or entity deleted in the source doc
|
|
49
|
+
* is simply absent rather than nulled or tombstoned, and an overlay
|
|
50
|
+
* cannot tell that apart from "no opinion" — deletions propagate only
|
|
51
|
+
* from layers that state them explicitly. Across separate calls, a path
|
|
52
|
+
* this function itself deleted stays deleted regardless: see
|
|
53
|
+
* `overlay-tombstones.ts`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function applyIfcxOverlay(doc: Y.Doc, input: IfcxInput, opts?: OverlayOptions): IfcxFile;
|
|
24
56
|
//# sourceMappingURL=from-ifcx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-ifcx.d.ts","sourceRoot":"","sources":["../../src/snapshot/from-ifcx.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"from-ifcx.d.ts","sourceRoot":"","sources":["../../src/snapshot/from-ifcx.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,gBAAgB,CAAC;AAEzD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA2BzB,MAAM,WAAW,WAAW;IAC1B,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErE,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,CAazD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,GAAE,WAAgB,GAAG,QAAQ,CAiC3F;AA2ID,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,CAAC,CAAC,GAAG,EACV,KAAK,EAAE,SAAS,EAChB,IAAI,GAAE,cAAmB,GACxB,QAAQ,CAsCV"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { IFCLITE_ATTR } from '@ifc-lite/ifcx';
|
|
5
|
+
import { createEntity, deleteAttribute, deleteEntity, getEntity, hasEntity, removeChild, removeInherit, setAttribute, setChild, setGeometryRef, setInherit, setPropertyValue, setQuantityValue, } from '../doc/entity.js';
|
|
6
|
+
import { createGeometry, upsertGeometry } from '../doc/geometry.js';
|
|
7
|
+
import { ENTITY_KEY, SEED_ORIGIN, assertSchemaInvariants, metaMap, } from '../doc/schema.js';
|
|
7
8
|
import { inflateStructuredAttributes } from './structured-attrs.js';
|
|
9
|
+
import { clearOverlayTombstones, readOverlayTombstones, resolveTombstoneOpinion, resurrectionBlocked, writeOverlayTombstones } from './overlay-tombstones.js';
|
|
10
|
+
import { setClassifications, setMaterials, readIfcClass } from './overlay-entity-attrs.js';
|
|
8
11
|
/** Decode whatever the caller hands us into a parsed IfcxFile. */
|
|
9
12
|
export function parseIfcxInput(input) {
|
|
10
13
|
if (typeof input === 'string') {
|
|
@@ -28,6 +31,7 @@ export function seedFromIfcx(doc, input, opts = {}) {
|
|
|
28
31
|
const file = parseIfcxInput(input);
|
|
29
32
|
assertSchemaInvariants(doc);
|
|
30
33
|
doc.transact(() => {
|
|
34
|
+
const meta = metaMap(doc);
|
|
31
35
|
if (opts.reset) {
|
|
32
36
|
const ents = doc.getMap('entities');
|
|
33
37
|
const rels = doc.getMap('relationships');
|
|
@@ -35,8 +39,167 @@ export function seedFromIfcx(doc, input, opts = {}) {
|
|
|
35
39
|
ents.clear();
|
|
36
40
|
rels.clear();
|
|
37
41
|
geom.clear();
|
|
42
|
+
// Overlay tombstones describe deletions in the discarded entity
|
|
43
|
+
// universe; retaining them would block a same-path entity in this
|
|
44
|
+
// freshly seeded snapshot.
|
|
45
|
+
clearOverlayTombstones(meta);
|
|
38
46
|
}
|
|
39
47
|
// Stash file-level metadata so we can re-emit it during snapshotting.
|
|
48
|
+
if (file.header)
|
|
49
|
+
meta.set('header', file.header);
|
|
50
|
+
if (file.imports)
|
|
51
|
+
meta.set('imports', file.imports);
|
|
52
|
+
if (file.schemas)
|
|
53
|
+
meta.set('schemas', file.schemas);
|
|
54
|
+
for (const node of file.data ?? []) {
|
|
55
|
+
const decoded = decodeNode(node, false);
|
|
56
|
+
if (!decoded)
|
|
57
|
+
continue;
|
|
58
|
+
restoreGeometryCarriers(doc, decoded, createGeometry);
|
|
59
|
+
createNodeEntity(doc, decoded);
|
|
60
|
+
}
|
|
61
|
+
}, opts.origin ?? SEED_ORIGIN);
|
|
62
|
+
return file;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* `stripTombstone` splits the two readers apart. The overlay applier
|
|
66
|
+
* acts on `ifclite::deleted` and must not leave the marker behind as an
|
|
67
|
+
* ordinary attribute (the same reason `bakeLayers` strips it from
|
|
68
|
+
* survivors). `seedFromIfcx` has never interpreted it and must keep
|
|
69
|
+
* storing it verbatim: it seeds live session docs in `apps/viewer` and
|
|
70
|
+
* `snapshot/worker.ts`, and quietly dropping an attribute there would be
|
|
71
|
+
* a behaviour change on a far more common path than this fix touches.
|
|
72
|
+
*/
|
|
73
|
+
function decodeNode(node, stripTombstone) {
|
|
74
|
+
const rawNode = node;
|
|
75
|
+
const path = rawNode.path;
|
|
76
|
+
if (!path)
|
|
77
|
+
return undefined;
|
|
78
|
+
// Null attribute values are removal opinions (minimal layers); with
|
|
79
|
+
// nothing beneath them to remove, they mean "absent" — never store
|
|
80
|
+
// them as values.
|
|
81
|
+
const rawAttributes = {};
|
|
82
|
+
const removedAttributes = [];
|
|
83
|
+
let tombstone;
|
|
84
|
+
for (const [key, value] of Object.entries(rawNode.attributes ?? {})) {
|
|
85
|
+
if (key === IFCLITE_ATTR.DELETED) {
|
|
86
|
+
if (typeof value === 'boolean')
|
|
87
|
+
tombstone = value;
|
|
88
|
+
if (stripTombstone)
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (value === null)
|
|
92
|
+
removedAttributes.push(key);
|
|
93
|
+
else
|
|
94
|
+
rawAttributes[key] = value;
|
|
95
|
+
}
|
|
96
|
+
// Re-inflate structured branches the snapshot writer folded into
|
|
97
|
+
// namespaced attributes (#1031); the shape-gated remainder stays
|
|
98
|
+
// in the flat attributes branch.
|
|
99
|
+
const inflated = inflateStructuredAttributes(rawAttributes);
|
|
100
|
+
const children = {};
|
|
101
|
+
const removedChildren = [];
|
|
102
|
+
for (const [role, target] of Object.entries(rawNode.children ?? {})) {
|
|
103
|
+
if (typeof target === 'string')
|
|
104
|
+
children[role] = target;
|
|
105
|
+
else if (target === null)
|
|
106
|
+
removedChildren.push(role);
|
|
107
|
+
}
|
|
108
|
+
const inherits = {};
|
|
109
|
+
const removedInherits = [];
|
|
110
|
+
for (const [role, target] of Object.entries(rawNode.inherits ?? {})) {
|
|
111
|
+
if (typeof target === 'string')
|
|
112
|
+
inherits[role] = target;
|
|
113
|
+
else if (target === null)
|
|
114
|
+
removedInherits.push(role);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
path,
|
|
118
|
+
ifcClass: readIfcClass(rawNode.attributes),
|
|
119
|
+
inflated,
|
|
120
|
+
children,
|
|
121
|
+
inherits,
|
|
122
|
+
tombstone,
|
|
123
|
+
removedAttributes,
|
|
124
|
+
removedChildren,
|
|
125
|
+
removedInherits,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A carrier with the embedded geometry record recreates the geometry map
|
|
130
|
+
* entry, so the restored ref is never dangling. Bare-id carriers keep
|
|
131
|
+
* pointing at out-of-band hydrated geometry.
|
|
132
|
+
*/
|
|
133
|
+
function restoreGeometryCarriers(doc, decoded, write) {
|
|
134
|
+
for (const carrier of decoded.inflated.geometryCarriers) {
|
|
135
|
+
if (typeof carrier.type !== 'string' || typeof carrier.source !== 'string')
|
|
136
|
+
continue;
|
|
137
|
+
write(doc, carrier.geomId, {
|
|
138
|
+
type: carrier.type,
|
|
139
|
+
source: carrier.source,
|
|
140
|
+
blobHash: carrier.blobHash,
|
|
141
|
+
params: carrier.params,
|
|
142
|
+
bbox: carrier.bbox,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function createNodeEntity(doc, decoded) {
|
|
147
|
+
const { ifcClass, inflated } = decoded;
|
|
148
|
+
createEntity(doc, decoded.path, {
|
|
149
|
+
ifcClass,
|
|
150
|
+
attributes: inflated.attributes,
|
|
151
|
+
children: decoded.children,
|
|
152
|
+
inherits: decoded.inherits,
|
|
153
|
+
psets: inflated.psets,
|
|
154
|
+
quantities: inflated.quantities,
|
|
155
|
+
classifications: inflated.classifications,
|
|
156
|
+
materials: inflated.materials,
|
|
157
|
+
geometryRef: inflated.geometryRefRecord,
|
|
158
|
+
// Provenance comes from the node's own `ifclite::meta` carrier and
|
|
159
|
+
// from nowhere else (#3092). The file header describes the FILE, and a
|
|
160
|
+
// snapshot of a collab doc puts the snapshotter's own name and write
|
|
161
|
+
// clock there; copying that onto every node fabricated a `createdBy`/
|
|
162
|
+
// `createdAt` indistinguishable from real attribution. Absent reads as
|
|
163
|
+
// "unknown"; invented gets trusted.
|
|
164
|
+
stampCreatedAt: false,
|
|
165
|
+
meta: {
|
|
166
|
+
ifcClass,
|
|
167
|
+
schemaVersion: 'ifc5',
|
|
168
|
+
...inflated.meta,
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Apply an IFCX file to `doc` as a *layer of opinions* rather than as a
|
|
174
|
+
* seed.
|
|
175
|
+
*
|
|
176
|
+
* `seedFromIfcx` routes every node through `createEntity`, a deliberate
|
|
177
|
+
* no-op on a path the doc already has — right for seeding from a
|
|
178
|
+
* snapshot, wrong for merging a layer whose purpose is to modify entities
|
|
179
|
+
* that already exist. This applier creates missing entities exactly as
|
|
180
|
+
* the seeder does, and writes existing entities' opinions on top: values
|
|
181
|
+
* overwrite, anything unmentioned is left alone. `null` removes a FLAT
|
|
182
|
+
* attribute, child or inherit ONLY: a nulled pset/quantity property
|
|
183
|
+
* survives, silently (pinned in `test/apply-ifcx-overlay.test.ts`).
|
|
184
|
+
*
|
|
185
|
+
* Deliberately NOT part of `seedFromIfcx`'s option surface: the seeder is
|
|
186
|
+
* additive-and-idempotent (`apps/viewer`, `snapshot/worker.ts` seed a
|
|
187
|
+
* live session doc with it), and this is a different operation.
|
|
188
|
+
*
|
|
189
|
+
* Deletion opinions are honoured where the layer states them: an
|
|
190
|
+
* `ifclite::deleted: true` node removes the entity, matching composition,
|
|
191
|
+
* `bakeLayers` and the MCP layer store. A full IFCX snapshot emits only
|
|
192
|
+
* what an entity has though, so a key or entity deleted in the source doc
|
|
193
|
+
* is simply absent rather than nulled or tombstoned, and an overlay
|
|
194
|
+
* cannot tell that apart from "no opinion" — deletions propagate only
|
|
195
|
+
* from layers that state them explicitly. Across separate calls, a path
|
|
196
|
+
* this function itself deleted stays deleted regardless: see
|
|
197
|
+
* `overlay-tombstones.ts`.
|
|
198
|
+
*/
|
|
199
|
+
export function applyIfcxOverlay(doc, input, opts = {}) {
|
|
200
|
+
const file = parseIfcxInput(input);
|
|
201
|
+
assertSchemaInvariants(doc);
|
|
202
|
+
doc.transact(() => {
|
|
40
203
|
const meta = metaMap(doc);
|
|
41
204
|
if (file.header)
|
|
42
205
|
meta.set('header', file.header);
|
|
@@ -44,82 +207,80 @@ export function seedFromIfcx(doc, input, opts = {}) {
|
|
|
44
207
|
meta.set('imports', file.imports);
|
|
45
208
|
if (file.schemas)
|
|
46
209
|
meta.set('schemas', file.schemas);
|
|
210
|
+
const tombstonesFromEarlierCalls = readOverlayTombstones(meta);
|
|
211
|
+
// Composition resolves `ifclite::deleted` after every node in the
|
|
212
|
+
// layer has been applied — the strongest (last) opinion wins — so a
|
|
213
|
+
// base → delete → resurrect sequence within one file must seed the
|
|
214
|
+
// entity's state first and only then act on the final verdict.
|
|
215
|
+
const tombstoned = new Map();
|
|
47
216
|
for (const node of file.data ?? []) {
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
217
|
+
const decoded = decodeNode(node, true);
|
|
218
|
+
if (!decoded)
|
|
50
219
|
continue;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
rawAttributes[key] = value;
|
|
58
|
-
}
|
|
59
|
-
// Re-inflate structured branches the snapshot writer folded into
|
|
60
|
-
// namespaced attributes (#1031); the shape-gated remainder stays
|
|
61
|
-
// in the flat attributes branch.
|
|
62
|
-
const inflated = inflateStructuredAttributes(rawAttributes);
|
|
63
|
-
const children = {};
|
|
64
|
-
if (node.children) {
|
|
65
|
-
for (const [role, target] of Object.entries(node.children)) {
|
|
66
|
-
if (typeof target === 'string')
|
|
67
|
-
children[role] = target;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
const inherits = {};
|
|
71
|
-
if (node.inherits) {
|
|
72
|
-
for (const [role, target] of Object.entries(node.inherits)) {
|
|
73
|
-
if (typeof target === 'string')
|
|
74
|
-
inherits[role] = target;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const ifcClass = readIfcClass(node.attributes);
|
|
78
|
-
// A carrier with the embedded geometry record recreates the
|
|
79
|
-
// geometry map entry, so the restored ref is never dangling.
|
|
80
|
-
// Bare-id carriers keep pointing at out-of-band hydrated geometry.
|
|
81
|
-
for (const carrier of inflated.geometryCarriers) {
|
|
82
|
-
if (typeof carrier.type !== 'string' || typeof carrier.source !== 'string')
|
|
220
|
+
const opinion = decoded.tombstone;
|
|
221
|
+
if (opinion !== undefined)
|
|
222
|
+
tombstoned.set(decoded.path, opinion);
|
|
223
|
+
restoreGeometryCarriers(doc, decoded, upsertGeometry);
|
|
224
|
+
if (!hasEntity(doc, decoded.path)) {
|
|
225
|
+
if (resurrectionBlocked(tombstonesFromEarlierCalls, decoded.path, opinion))
|
|
83
226
|
continue;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
source: carrier.source,
|
|
87
|
-
blobHash: carrier.blobHash,
|
|
88
|
-
params: carrier.params,
|
|
89
|
-
bbox: carrier.bbox,
|
|
90
|
-
});
|
|
227
|
+
createNodeEntity(doc, decoded);
|
|
228
|
+
continue;
|
|
91
229
|
}
|
|
92
|
-
|
|
93
|
-
ifcClass,
|
|
94
|
-
attributes: inflated.attributes,
|
|
95
|
-
children,
|
|
96
|
-
inherits,
|
|
97
|
-
psets: inflated.psets,
|
|
98
|
-
quantities: inflated.quantities,
|
|
99
|
-
classifications: inflated.classifications,
|
|
100
|
-
materials: inflated.materials,
|
|
101
|
-
geometryRef: inflated.geometryRefRecord,
|
|
102
|
-
meta: {
|
|
103
|
-
ifcClass,
|
|
104
|
-
schemaVersion: 'ifc5',
|
|
105
|
-
createdAt: file.header?.timestamp ?? new Date().toISOString(),
|
|
106
|
-
createdBy: file.header?.author,
|
|
107
|
-
},
|
|
108
|
-
});
|
|
230
|
+
overlayEntity(doc, decoded);
|
|
109
231
|
}
|
|
232
|
+
for (const [path, deleted] of tombstoned) {
|
|
233
|
+
if (deleted)
|
|
234
|
+
deleteEntity(doc, path);
|
|
235
|
+
resolveTombstoneOpinion(tombstonesFromEarlierCalls, path, deleted);
|
|
236
|
+
}
|
|
237
|
+
writeOverlayTombstones(meta, tombstonesFromEarlierCalls);
|
|
110
238
|
}, opts.origin ?? SEED_ORIGIN);
|
|
111
239
|
return file;
|
|
112
240
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
241
|
+
function overlayEntity(doc, decoded) {
|
|
242
|
+
const { path, inflated } = decoded;
|
|
243
|
+
for (const [key, value] of Object.entries(inflated.attributes)) {
|
|
244
|
+
setAttribute(doc, path, key, value);
|
|
245
|
+
}
|
|
246
|
+
for (const key of decoded.removedAttributes)
|
|
247
|
+
deleteAttribute(doc, path, key);
|
|
248
|
+
for (const [role, target] of Object.entries(decoded.children)) {
|
|
249
|
+
setChild(doc, path, role, target);
|
|
250
|
+
}
|
|
251
|
+
for (const role of decoded.removedChildren)
|
|
252
|
+
removeChild(doc, path, role);
|
|
253
|
+
for (const [role, target] of Object.entries(decoded.inherits)) {
|
|
254
|
+
setInherit(doc, path, role, target);
|
|
255
|
+
}
|
|
256
|
+
for (const role of decoded.removedInherits)
|
|
257
|
+
removeInherit(doc, path, role);
|
|
258
|
+
for (const [psetName, props] of Object.entries(inflated.psets)) {
|
|
259
|
+
for (const [propName, value] of Object.entries(props)) {
|
|
260
|
+
setPropertyValue(doc, path, psetName, propName, value);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
for (const [qsetName, qtys] of Object.entries(inflated.quantities)) {
|
|
264
|
+
for (const [qtyName, value] of Object.entries(qtys)) {
|
|
265
|
+
setQuantityValue(doc, path, qsetName, qtyName, value);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// Lists are single-valued opinions: a node that carries one replaces
|
|
269
|
+
// the doc's list wholesale, a node that carries none says nothing and
|
|
270
|
+
// must leave the doc's list untouched.
|
|
271
|
+
if (inflated.classifications.length > 0) {
|
|
272
|
+
setClassifications(doc, path, inflated.classifications);
|
|
273
|
+
}
|
|
274
|
+
if (inflated.materials.length > 0) {
|
|
275
|
+
setMaterials(doc, path, inflated.materials);
|
|
276
|
+
}
|
|
277
|
+
if (inflated.geometryRefRecord && inflated.geometryRefRecord.geomIds.length > 0) {
|
|
278
|
+
setGeometryRef(doc, path, inflated.geometryRefRecord);
|
|
279
|
+
}
|
|
280
|
+
// `meta.ifcClass` mirrors the class attribute; keep the two in step.
|
|
281
|
+
if (decoded.ifcClass) {
|
|
282
|
+
const entityMeta = getEntity(doc, path)?.get(ENTITY_KEY.META);
|
|
283
|
+
entityMeta?.set('ifcClass', decoded.ifcClass);
|
|
122
284
|
}
|
|
123
|
-
return undefined;
|
|
124
285
|
}
|
|
125
286
|
//# sourceMappingURL=from-ifcx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-ifcx.js","sourceRoot":"","sources":["../../src/snapshot/from-ifcx.ts"],"names":[],"mappings":"AAAA;;+DAE+D;
|
|
1
|
+
{"version":3,"file":"from-ifcx.js","sourceRoot":"","sources":["../../src/snapshot/from-ifcx.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAW/D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,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CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,mBAAmB,CAAC;CACxE;AAED,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,CAAC,CAAC,GAAG,EACV,MAAM,EAAE,cAAc,EACtB,IAAI,GAAE,mBAAwB,GAC7B,kBAAkB,CAgDpB"}
|
|
@@ -48,11 +48,16 @@ export function seedFromStep(doc, source, opts = {}) {
|
|
|
48
48
|
attributes: ent.attributes ?? {},
|
|
49
49
|
children: ent.children,
|
|
50
50
|
schemaVersion,
|
|
51
|
+
// Same rule as `from-ifcx.ts`: the STEP header names whoever
|
|
52
|
+
// wrote the file, not whoever authored each entity, and its
|
|
53
|
+
// timestamp is the file's, not the entity's. Stamping either
|
|
54
|
+
// onto every node manufactures per-entity provenance that reads
|
|
55
|
+
// as genuine. The header itself stays available under
|
|
56
|
+
// `meta.stepHeader`.
|
|
57
|
+
stampCreatedAt: false,
|
|
51
58
|
meta: {
|
|
52
59
|
ifcClass: ent.ifcClass,
|
|
53
60
|
schemaVersion,
|
|
54
|
-
createdAt: source.header?.timestamp ?? new Date().toISOString(),
|
|
55
|
-
createdBy: source.header?.author,
|
|
56
61
|
},
|
|
57
62
|
});
|
|
58
63
|
if (ent.psets) {
|
|
@@ -1 +1 @@
|
|
|
1
|
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ACH,CAAC;YACD,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC,EAAE,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC;IAE/B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
package/dist/snapshot/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { seedFromIfcx, parseIfcxInput, type SeedOptions, type IfcxInput, } from './from-ifcx.js';
|
|
1
|
+
export { seedFromIfcx, applyIfcxOverlay, parseIfcxInput, type SeedOptions, type OverlayOptions, type IfcxInput, } from './from-ifcx.js';
|
|
2
2
|
export { seedFromStep, guidToPath, type StepSeedEntity, type StepSeedSource, type SeedFromStepOptions, type SeedFromStepResult, type CollabSchemaVersion, } from './from-step.js';
|
|
3
3
|
export { snapshotToIfcx, serializeIfcx, type SnapshotOptions } from './to-ifcx.js';
|
|
4
4
|
export { captureBaseline, extractUserLayer, filterUpdateByClient, } from './layers.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snapshot/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snapshot/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,SAAS,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC"}
|
package/dist/snapshot/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
-
export { seedFromIfcx, parseIfcxInput, } from './from-ifcx.js';
|
|
4
|
+
export { seedFromIfcx, applyIfcxOverlay, parseIfcxInput, } from './from-ifcx.js';
|
|
5
5
|
export { seedFromStep, guidToPath, } from './from-step.js';
|
|
6
6
|
export { snapshotToIfcx, serializeIfcx } from './to-ifcx.js';
|
|
7
7
|
export { captureBaseline, extractUserLayer, filterUpdateByClient, } from './layers.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EACL,YAAY,EACZ,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,GAIf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,UAAU,GAMX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAwB,MAAM,cAAc,CAAC;AACnF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,GAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,GAGb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,GAKrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,GAIlB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classification/material array replacement and IfcClass extraction, split
|
|
3
|
+
* out of `from-ifcx.ts` (module-size ratchet). Used by `overlayEntity` and
|
|
4
|
+
* `createNodeEntity` when applying an IFCX layer's opinions onto an entity.
|
|
5
|
+
*/
|
|
6
|
+
import * as Y from 'yjs';
|
|
7
|
+
import { type ClassificationRef, type MaterialAssignment } from '../doc/schema.js';
|
|
8
|
+
export declare function setClassifications(doc: Y.Doc, path: string, refs: readonly ClassificationRef[]): void;
|
|
9
|
+
export declare function setMaterials(doc: Y.Doc, path: string, assignments: readonly MaterialAssignment[]): void;
|
|
10
|
+
/** Read the IfcClass code out of the well-known `bsi::ifc::class` attribute. */
|
|
11
|
+
export declare function readIfcClass(attributes: Record<string, unknown> | undefined): string | undefined;
|
|
12
|
+
//# sourceMappingURL=overlay-entity-attrs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-entity-attrs.d.ts","sourceRoot":"","sources":["../../src/snapshot/overlay-entity-attrs.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAc,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/F,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,CAAC,CAAC,GAAG,EACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,iBAAiB,EAAE,GACjC,IAAI,CAON;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,CAAC,CAAC,GAAG,EACV,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,SAAS,kBAAkB,EAAE,GACzC,IAAI,CAON;AAED,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAQhG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import { getEntity } from '../doc/entity.js';
|
|
5
|
+
import { ENTITY_KEY } from '../doc/schema.js';
|
|
6
|
+
export function setClassifications(doc, path, refs) {
|
|
7
|
+
const arr = getEntity(doc, path)?.get(ENTITY_KEY.CLASSIFICATIONS);
|
|
8
|
+
if (!arr)
|
|
9
|
+
return;
|
|
10
|
+
if (arr.length > 0)
|
|
11
|
+
arr.delete(0, arr.length);
|
|
12
|
+
arr.push([...refs]);
|
|
13
|
+
}
|
|
14
|
+
export function setMaterials(doc, path, assignments) {
|
|
15
|
+
const arr = getEntity(doc, path)?.get(ENTITY_KEY.MATERIALS);
|
|
16
|
+
if (!arr)
|
|
17
|
+
return;
|
|
18
|
+
if (arr.length > 0)
|
|
19
|
+
arr.delete(0, arr.length);
|
|
20
|
+
arr.push([...assignments]);
|
|
21
|
+
}
|
|
22
|
+
/** Read the IfcClass code out of the well-known `bsi::ifc::class` attribute. */
|
|
23
|
+
export function readIfcClass(attributes) {
|
|
24
|
+
if (!attributes)
|
|
25
|
+
return undefined;
|
|
26
|
+
const cls = attributes['bsi::ifc::class'];
|
|
27
|
+
if (cls && typeof cls === 'object' && 'code' in cls) {
|
|
28
|
+
const code = cls.code;
|
|
29
|
+
if (typeof code === 'string')
|
|
30
|
+
return code;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=overlay-entity-attrs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overl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AAC;QACpD,MAAM,IAAI,GAAI,GAA0B,CAAC,IAAI,CAAC;QAC9C,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;IAC5C,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-call tombstone bookkeeping for `applyIfcxOverlay` (`from-ifcx.ts`).
|
|
3
|
+
*
|
|
4
|
+
* `deleteEntity` purges a path from `entitiesMap` entirely, so once one
|
|
5
|
+
* `applyIfcxOverlay` call's transaction ends there is nothing left on the
|
|
6
|
+
* doc distinguishing "deleted, no opinion stated since" from "never
|
|
7
|
+
* existed". Without this, a later, separate call touching the same path
|
|
8
|
+
* with no deletion opinion of its own reads `hasEntity() === false` as
|
|
9
|
+
* "brand new" and silently resurrects the entity — losing the deletion.
|
|
10
|
+
* This mirrors the "false is the revert opinion, omission is not"
|
|
11
|
+
* contract `applyIfcxOverlay` already enforces *within* one file, across
|
|
12
|
+
* calls instead: a path stays deleted until a later layer explicitly
|
|
13
|
+
* revives it. See `test/apply-ifcx-overlay.test.ts`.
|
|
14
|
+
*/
|
|
15
|
+
import type * as Y from 'yjs';
|
|
16
|
+
/** Read the set of paths a previous `applyIfcxOverlay` call left deleted. */
|
|
17
|
+
export declare function readOverlayTombstones(meta: Y.Map<unknown>): Set<string>;
|
|
18
|
+
/** Persist the updated tombstone set back onto the doc's meta map. */
|
|
19
|
+
export declare function writeOverlayTombstones(meta: Y.Map<unknown>, tombstones: Set<string>): void;
|
|
20
|
+
/** A snapshot reset starts a new entity universe, so prior overlay deletions
|
|
21
|
+
* must not suppress a legitimate path in the freshly seeded snapshot. */
|
|
22
|
+
export declare function clearOverlayTombstones(meta: Y.Map<unknown>): void;
|
|
23
|
+
/**
|
|
24
|
+
* True when a node touching `path` with no opinion on deletion (`opinion
|
|
25
|
+
* === undefined`) must NOT resurrect it, because an earlier call left it
|
|
26
|
+
* tombstoned. An explicit opinion (revive with `false`, or a no-op
|
|
27
|
+
* re-delete with `true`) always acts, so this only ever gates the
|
|
28
|
+
* no-opinion case.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resurrectionBlocked(tombstones: Set<string>, path: string, opinion: boolean | undefined): boolean;
|
|
31
|
+
/** Apply this file's final tombstone verdict for `path` to the running set. */
|
|
32
|
+
export declare function resolveTombstoneOpinion(tombstones: Set<string>, path: string, deleted: boolean): void;
|
|
33
|
+
//# sourceMappingURL=overlay-tombstones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-tombstones.d.ts","sourceRoot":"","sources":["../../src/snapshot/overlay-tombstones.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAC;AAI9B,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAGvE;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAE1F;AAED;yEACyE;AACzE,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,CAET;AAED,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAGrG"}
|