@septkit/ui 0.0.58 → 0.0.60
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/dist/diagram-layout/group-stack.js +13 -0
- package/dist/diagram-layout/grouping.js +33 -0
- package/dist/diagram-layout/index.js +6 -2
- package/dist/diagram-layout/use-diagram-layout.js +319 -0
- package/dist/diagram-layout/visibility-model.js +56 -0
- package/dist/dialecte/create-document-store.js +3 -3
- package/dist/external/.pnpm/{@dialecte_core@0.4.12 → @dialecte_core@0.4.16}/node_modules/@dialecte/core/dist/helpers.js +41 -41
- package/dist/external/.pnpm/@dialecte_core@0.4.16/node_modules/@dialecte/core/dist/index.js +3 -0
- package/dist/external/.pnpm/{@dialecte_core@0.4.12/node_modules/@dialecte/core/dist/project-DkMkDgld.js → @dialecte_core@0.4.16/node_modules/@dialecte/core/dist/project-nvZv2ie8.js} +797 -745
- package/dist/external/.pnpm/{@dialecte_core@0.4.12/node_modules/@dialecte/core/dist/utils-C5_11hqg.js → @dialecte_core@0.4.16/node_modules/@dialecte/core/dist/utils-BiEx1x59.js} +2 -2
- package/dist/external/.pnpm/{@dialecte_scl@0.3.15/node_modules/@dialecte/scl/dist/hooks-CLIa7kxj.js → @dialecte_scl@0.3.17/node_modules/@dialecte/scl/dist/hooks-BBGXNK0x.js} +31 -19
- package/dist/external/.pnpm/{@dialecte_scl@0.3.15 → @dialecte_scl@0.3.17}/node_modules/@dialecte/scl/dist/v2019C1/index.js +3 -3
- package/dist/index.d.ts +200 -2
- package/dist/index.js +6 -2
- package/dist/merge/build-view-model.js +17 -17
- package/dist/merge/merge-preflight.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/merge/merge.service.js +16 -20
- package/dist/merge/use-merge-session.js +101 -121
- package/dist/ui.css +1 -1
- package/package.json +3 -3
- package/dist/external/.pnpm/@dialecte_core@0.4.12/node_modules/@dialecte/core/dist/index.js +0 -3
- package/dist/merge/merge-correlate.js +0 -46
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region lib/diagram-layout/group-stack.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let { memberHeights: n, gap: r, collapsedHeight: i } = e, a = n.reduce((e, t) => e + t, 0) + Math.max(0, n.length - 1) * r, o = Math.min(a, i), s = a > i;
|
|
4
|
+
return {
|
|
5
|
+
contentHeight: a,
|
|
6
|
+
collapsedShownHeight: o,
|
|
7
|
+
expandable: s,
|
|
8
|
+
scrolls: !t && s,
|
|
9
|
+
shownHeight: t ? a : o
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as groupStackMetrics };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region lib/diagram-layout/grouping.ts
|
|
2
|
+
var e = "__group__";
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
return `${e}${t}_${n}`;
|
|
5
|
+
}
|
|
6
|
+
function n(t) {
|
|
7
|
+
return t.startsWith(e);
|
|
8
|
+
}
|
|
9
|
+
function r(e, n) {
|
|
10
|
+
let r = new Set(e), i = [];
|
|
11
|
+
for (let a of e) {
|
|
12
|
+
let e = n[a];
|
|
13
|
+
if (!e) continue;
|
|
14
|
+
let o = e.childrenCache.map((e) => e.record.id).filter((e) => r.has(e)), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
15
|
+
for (let e of o) {
|
|
16
|
+
let t = n[e];
|
|
17
|
+
if (!t) continue;
|
|
18
|
+
let r = t.record.tagName;
|
|
19
|
+
if (c.set(r, (c.get(r) ?? 0) + 1), t.visibleChildIds.size > 0) continue;
|
|
20
|
+
let i = s.get(r);
|
|
21
|
+
i ? i.push(e) : s.set(r, [e]);
|
|
22
|
+
}
|
|
23
|
+
for (let [e, n] of s) (c.get(e) ?? 0) >= 2 && n.length >= 1 && i.push({
|
|
24
|
+
id: t(a, e),
|
|
25
|
+
parentId: a,
|
|
26
|
+
tagName: e,
|
|
27
|
+
memberIds: n
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return i;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { r as computeGroups, n as isGroupId, t as makeGroupId };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { applyInitialVisibility as e, buildRecordCache as t, collectVisibleIds as n, hideDescendants as r } from "./visibility-model.js";
|
|
2
|
+
import { groupStackMetrics as i } from "./group-stack.js";
|
|
3
|
+
import { computeGroups as a, isGroupId as o, makeGroupId as s } from "./grouping.js";
|
|
4
|
+
import { createElkLayoutEngine as c } from "./elk-layout-engine.js";
|
|
5
|
+
import { useDiagramLayout as l } from "./use-diagram-layout.js";
|
|
6
|
+
export { e as applyInitialVisibility, t as buildRecordCache, n as collectVisibleIds, a as computeGroups, c as createElkLayoutEngine, i as groupStackMetrics, r as hideDescendants, o as isGroupId, s as makeGroupId, l as useDiagramLayout };
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { applyInitialVisibility as e, buildRecordCache as t, collectVisibleIds as n, hideDescendants as r } from "./visibility-model.js";
|
|
2
|
+
import { computeGroups as i, isGroupId as a } from "./grouping.js";
|
|
3
|
+
import { createElkLayoutEngine as o } from "./elk-layout-engine.js";
|
|
4
|
+
import { shallowRef as s, triggerRef as c } from "vue";
|
|
5
|
+
//#region lib/diagram-layout/use-diagram-layout.ts
|
|
6
|
+
var l = "__virtual_root__", u = 100;
|
|
7
|
+
function d(d) {
|
|
8
|
+
let f = d.engine ?? o(), p = d.measuredHeightFeedback ?? !0, m = [], h = {}, g = [], _ = [], v = 0, y = null, b = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), S = s(/* @__PURE__ */ new Set()), C = s([]), w = s([]), T = s([]), E = s(/* @__PURE__ */ new Map()), D = s([]);
|
|
9
|
+
function O(e) {
|
|
10
|
+
m = e;
|
|
11
|
+
}
|
|
12
|
+
function k() {
|
|
13
|
+
S.value = /* @__PURE__ */ new Set(), x.clear(), b.clear(), v = 0, y = null, D.value = [];
|
|
14
|
+
}
|
|
15
|
+
function A(e) {
|
|
16
|
+
_ = e;
|
|
17
|
+
}
|
|
18
|
+
async function j(n) {
|
|
19
|
+
let r = t(m, d.isRoot);
|
|
20
|
+
h = r.recordMap, g = r.rootIds, D.value = r.orphanIds, e(h, g, n), await U();
|
|
21
|
+
}
|
|
22
|
+
async function M() {
|
|
23
|
+
await U();
|
|
24
|
+
}
|
|
25
|
+
async function N(e) {
|
|
26
|
+
if (!p) return !1;
|
|
27
|
+
let t = !1;
|
|
28
|
+
for (let n in e) {
|
|
29
|
+
let r = e[n];
|
|
30
|
+
r > 0 && b.get(n) !== r && (b.set(n, r), t = !0);
|
|
31
|
+
}
|
|
32
|
+
return t && m.length > 0 ? (await M(), !0) : !1;
|
|
33
|
+
}
|
|
34
|
+
async function P(e) {
|
|
35
|
+
let t = h[e];
|
|
36
|
+
if (t) {
|
|
37
|
+
x.set(e, ++v);
|
|
38
|
+
for (let e of t.childrenCache) t.visibleChildIds.add(e.record.id);
|
|
39
|
+
await M();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function F(e) {
|
|
43
|
+
let t = h[e];
|
|
44
|
+
t && (r(t), await M());
|
|
45
|
+
}
|
|
46
|
+
async function I(e) {
|
|
47
|
+
let t = h[e];
|
|
48
|
+
t && (t.visibleChildIds.size > 0 ? await F(e) : await P(e));
|
|
49
|
+
}
|
|
50
|
+
async function L(e) {
|
|
51
|
+
let t = q(e, E.value.get(e) ?? []);
|
|
52
|
+
t && K(t, S.value.has(e)).expandable && (S.value.has(e) ? S.value.delete(e) : S.value.add(e), c(S), await M());
|
|
53
|
+
}
|
|
54
|
+
function R(e) {
|
|
55
|
+
return !!h[e]?.childrenCache.length;
|
|
56
|
+
}
|
|
57
|
+
function z(e, t) {
|
|
58
|
+
let n = h[e];
|
|
59
|
+
if (n) {
|
|
60
|
+
m.push(...t);
|
|
61
|
+
for (let e of t) {
|
|
62
|
+
let t = {
|
|
63
|
+
record: e,
|
|
64
|
+
childrenCache: [],
|
|
65
|
+
visibleChildIds: /* @__PURE__ */ new Set()
|
|
66
|
+
};
|
|
67
|
+
h[e.id] = t, n.childrenCache.push(t), n.visibleChildIds.add(e.id);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function B(e) {
|
|
72
|
+
return h[e];
|
|
73
|
+
}
|
|
74
|
+
function V(e, t) {
|
|
75
|
+
let n = h[e];
|
|
76
|
+
if (!n) return;
|
|
77
|
+
let r = {
|
|
78
|
+
...n.record,
|
|
79
|
+
...t
|
|
80
|
+
};
|
|
81
|
+
n.record = r, m = m.map((t) => t.id === e ? r : t), H();
|
|
82
|
+
}
|
|
83
|
+
function H() {
|
|
84
|
+
if (!y) return;
|
|
85
|
+
let { emitSequence: e, positions: t, groupLayouts: n } = y, r = [], i = [];
|
|
86
|
+
for (let a of e) {
|
|
87
|
+
let e = t[a.kind === "group" ? a.group.id : a.id] ?? {
|
|
88
|
+
x: 0,
|
|
89
|
+
y: 0
|
|
90
|
+
};
|
|
91
|
+
if (a.kind === "node") {
|
|
92
|
+
r.push(d.toNode({
|
|
93
|
+
entry: h[a.id],
|
|
94
|
+
position: e
|
|
95
|
+
}));
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
let o = n.get(a.group.id);
|
|
99
|
+
i.push(d.toGroupNode({
|
|
100
|
+
group: a.group,
|
|
101
|
+
members: G(a.group.memberIds),
|
|
102
|
+
position: e,
|
|
103
|
+
size: o,
|
|
104
|
+
expanded: S.value.has(a.group.id),
|
|
105
|
+
expandable: o.expandable
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
C.value = [...r, ...i];
|
|
109
|
+
}
|
|
110
|
+
async function U() {
|
|
111
|
+
let e = n(g, h), t = new Set(e), r = i(e, h), a = new Set(r.flatMap((e) => e.memberIds)), o = new Map(r.map((e) => [`${e.parentId}::${e.tagName}`, e])), s = J(e), c = (e) => (s.get(e) ?? 0) >= 2, p = Y(e, a, c), m = Z(e, o, p, c), _ = Q(m, t, a, o, p, c), v = Math.max(0, ...e.map((e) => W(e).width)) + u, b = /* @__PURE__ */ new Map(), x = [{
|
|
112
|
+
id: l,
|
|
113
|
+
width: 0,
|
|
114
|
+
height: 0,
|
|
115
|
+
orderHint: -v
|
|
116
|
+
}, ...m.map((e) => {
|
|
117
|
+
if (e.kind === "group") {
|
|
118
|
+
let t = K(e.group, S.value.has(e.group.id));
|
|
119
|
+
return b.set(e.group.id, t), {
|
|
120
|
+
id: e.group.id,
|
|
121
|
+
width: t.width,
|
|
122
|
+
height: t.height,
|
|
123
|
+
orderHint: (_.get(e.group.id) ?? 0) * v
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
let t = W(e.id);
|
|
127
|
+
return {
|
|
128
|
+
id: e.id,
|
|
129
|
+
width: t.width,
|
|
130
|
+
height: t.height,
|
|
131
|
+
orderHint: (_.get(e.id) ?? 0) * v
|
|
132
|
+
};
|
|
133
|
+
})], C = X(m, t, a), D = {
|
|
134
|
+
nodes: x,
|
|
135
|
+
edges: C
|
|
136
|
+
}, O = await f.layout(D, d.layoutOptions);
|
|
137
|
+
y = {
|
|
138
|
+
emitSequence: m,
|
|
139
|
+
positions: O.positions,
|
|
140
|
+
groupLayouts: b
|
|
141
|
+
}, H();
|
|
142
|
+
let k = new Set(m.map((e) => e.kind === "group" ? e.group.id : e.id));
|
|
143
|
+
T.value = m.map((e) => {
|
|
144
|
+
let t = e.kind === "group" ? e.group.id : e.id, n = e.kind === "group" ? e.group.parentId : h[e.id]?.record.parent?.id, r = O.positions[t] ?? {
|
|
145
|
+
x: 0,
|
|
146
|
+
y: 0
|
|
147
|
+
};
|
|
148
|
+
return {
|
|
149
|
+
id: t,
|
|
150
|
+
x: r.x,
|
|
151
|
+
y: r.y,
|
|
152
|
+
parentId: n && k.has(n) ? n : null
|
|
153
|
+
};
|
|
154
|
+
}), E.value = new Map(r.map((e) => [e.id, e.memberIds]));
|
|
155
|
+
let A = C.filter((e) => e.sources[0] !== l).filter((e) => !a.has(e.targets[0])), j = /* @__PURE__ */ new Map();
|
|
156
|
+
for (let e of A) {
|
|
157
|
+
let t = e.sources[0];
|
|
158
|
+
j.set(t, (j.get(t) ?? 0) + 1);
|
|
159
|
+
}
|
|
160
|
+
w.value = A.map((e) => {
|
|
161
|
+
let t = j.get(e.sources[0]) === 1;
|
|
162
|
+
return d.toEdge({
|
|
163
|
+
edge: e,
|
|
164
|
+
route: t ? [] : O.edgeRoutes[e.id] ?? [],
|
|
165
|
+
singleChild: t
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function W(e) {
|
|
170
|
+
let t = h[e];
|
|
171
|
+
return d.nodeSize(t.record, b.get(e));
|
|
172
|
+
}
|
|
173
|
+
function G(e) {
|
|
174
|
+
return e.map((e) => h[e]).filter(Boolean);
|
|
175
|
+
}
|
|
176
|
+
function K(e, t) {
|
|
177
|
+
return d.groupLayout(e, G(e.memberIds), t);
|
|
178
|
+
}
|
|
179
|
+
function q(e, t) {
|
|
180
|
+
if (!a(e) || t.length === 0) return;
|
|
181
|
+
let n = h[t[0]]?.record;
|
|
182
|
+
if (n?.parent?.id) return {
|
|
183
|
+
id: e,
|
|
184
|
+
parentId: n.parent.id,
|
|
185
|
+
tagName: n.tagName,
|
|
186
|
+
memberIds: t
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function J(e) {
|
|
190
|
+
let t = /* @__PURE__ */ new Map();
|
|
191
|
+
for (let n of e) {
|
|
192
|
+
let e = h[n]?.record;
|
|
193
|
+
if (!e?.parent?.id) continue;
|
|
194
|
+
let r = `${e.parent.id}::${e.tagName}`;
|
|
195
|
+
t.set(r, (t.get(r) ?? 0) + 1);
|
|
196
|
+
}
|
|
197
|
+
return t;
|
|
198
|
+
}
|
|
199
|
+
function Y(e, t, n) {
|
|
200
|
+
let r = /* @__PURE__ */ new Map();
|
|
201
|
+
for (let i of e) {
|
|
202
|
+
if (t.has(i)) continue;
|
|
203
|
+
let e = h[i]?.record;
|
|
204
|
+
if (!e?.parent?.id) continue;
|
|
205
|
+
let a = `${e.parent.id}::${e.tagName}`;
|
|
206
|
+
if (!n(a)) continue;
|
|
207
|
+
let o = r.get(a);
|
|
208
|
+
o ? o.push(i) : r.set(a, [i]);
|
|
209
|
+
}
|
|
210
|
+
for (let e of r.values()) e.sort((e, t) => (x.get(e) ?? 0) - (x.get(t) ?? 0));
|
|
211
|
+
return r;
|
|
212
|
+
}
|
|
213
|
+
function X(e, t, n) {
|
|
214
|
+
let r = [];
|
|
215
|
+
for (let i of e) {
|
|
216
|
+
let e = i.kind === "group" ? i.group.id : i.id, a = i.kind === "group" ? i.group.parentId : h[i.id]?.record.parent?.id, o = a && t.has(a) && !n.has(a) ? a : l;
|
|
217
|
+
r.push({
|
|
218
|
+
id: `${o}->${e}`,
|
|
219
|
+
sources: [o],
|
|
220
|
+
targets: [e]
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
for (let e of _) t.has(e.source) && t.has(e.target) && r.push({
|
|
224
|
+
id: e.id,
|
|
225
|
+
sources: [e.source],
|
|
226
|
+
targets: [e.target]
|
|
227
|
+
});
|
|
228
|
+
return r;
|
|
229
|
+
}
|
|
230
|
+
function Z(e, t, n, r) {
|
|
231
|
+
let i = [], a = /* @__PURE__ */ new Set();
|
|
232
|
+
for (let o of e) {
|
|
233
|
+
let e = h[o]?.record, s = e?.parent?.id ? `${e.parent.id}::${e.tagName}` : void 0;
|
|
234
|
+
if (s && r(s)) {
|
|
235
|
+
if (!a.has(s)) {
|
|
236
|
+
a.add(s);
|
|
237
|
+
for (let e of n.get(s) ?? []) i.push({
|
|
238
|
+
kind: "node",
|
|
239
|
+
id: e
|
|
240
|
+
});
|
|
241
|
+
let e = t.get(s);
|
|
242
|
+
e && i.push({
|
|
243
|
+
kind: "group",
|
|
244
|
+
group: e
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
i.push({
|
|
250
|
+
kind: "node",
|
|
251
|
+
id: o
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
return i;
|
|
255
|
+
}
|
|
256
|
+
function Q(e, t, n, r, i, a) {
|
|
257
|
+
let o = /* @__PURE__ */ new Map(), s = 0, c = (e) => {
|
|
258
|
+
let n = h[e];
|
|
259
|
+
if (!n) return [];
|
|
260
|
+
let o = [], s = /* @__PURE__ */ new Set();
|
|
261
|
+
for (let c of n.childrenCache) {
|
|
262
|
+
let n = c.record.id;
|
|
263
|
+
if (!t.has(n)) continue;
|
|
264
|
+
let l = `${e}::${c.record.tagName}`;
|
|
265
|
+
if (a(l)) {
|
|
266
|
+
if (!s.has(l)) {
|
|
267
|
+
s.add(l);
|
|
268
|
+
for (let e of i.get(l) ?? []) o.push({
|
|
269
|
+
kind: "node",
|
|
270
|
+
id: e
|
|
271
|
+
});
|
|
272
|
+
let e = r.get(l);
|
|
273
|
+
e && o.push({
|
|
274
|
+
kind: "group",
|
|
275
|
+
group: e
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
o.push({
|
|
281
|
+
kind: "node",
|
|
282
|
+
id: n
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
return o;
|
|
286
|
+
}, l = (e) => {
|
|
287
|
+
for (let t of e) t.kind === "group" ? o.set(t.group.id, s++) : (o.set(t.id, s++), l(c(t.id)));
|
|
288
|
+
};
|
|
289
|
+
return l(e.filter((e) => {
|
|
290
|
+
if (e.kind === "group") return !(t.has(e.group.parentId) && !n.has(e.group.parentId));
|
|
291
|
+
let r = h[e.id]?.record.parent?.id;
|
|
292
|
+
return !(r && t.has(r) && !n.has(r));
|
|
293
|
+
})), o;
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
flowNodes: C,
|
|
297
|
+
flowEdges: w,
|
|
298
|
+
navNodes: T,
|
|
299
|
+
groupMembersById: E,
|
|
300
|
+
expandedGroupIds: S,
|
|
301
|
+
orphanIds: D,
|
|
302
|
+
setRecords: O,
|
|
303
|
+
setConnections: A,
|
|
304
|
+
reset: k,
|
|
305
|
+
calcLayout: j,
|
|
306
|
+
reCalcLayout: M,
|
|
307
|
+
applyMeasuredHeights: N,
|
|
308
|
+
expandNode: P,
|
|
309
|
+
collapseNode: F,
|
|
310
|
+
toggleNode: I,
|
|
311
|
+
toggleGroup: L,
|
|
312
|
+
hasNodeLoadedChildren: R,
|
|
313
|
+
addChildren: z,
|
|
314
|
+
getRecordEntry: B,
|
|
315
|
+
updateRecord: V
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
//#endregion
|
|
319
|
+
export { d as useDiagramLayout };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region lib/diagram-layout/visibility-model.ts
|
|
2
|
+
function e(e, t = (e) => !e.parent?.id) {
|
|
3
|
+
let n = {}, r = [], i = [];
|
|
4
|
+
for (let t of e) n[t.id] = {
|
|
5
|
+
record: t,
|
|
6
|
+
childrenCache: [],
|
|
7
|
+
visibleChildIds: /* @__PURE__ */ new Set()
|
|
8
|
+
};
|
|
9
|
+
for (let e of Object.values(n)) {
|
|
10
|
+
if (t(e.record)) {
|
|
11
|
+
r.push(e.record.id);
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
let a = e.record.parent?.id, o = a ? n[a] : void 0;
|
|
15
|
+
if (!o) {
|
|
16
|
+
i.push(e.record.id), r.push(e.record.id);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
o.childrenCache.push(e);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
recordMap: n,
|
|
23
|
+
rootIds: r,
|
|
24
|
+
orphanIds: i
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function t(e, t, n) {
|
|
28
|
+
let { expandedNodeIds: r, collapsedNodeIds: i, defaultOpenDepth: a } = n, o = t.map((e) => ({
|
|
29
|
+
id: e,
|
|
30
|
+
depth: 0
|
|
31
|
+
}));
|
|
32
|
+
for (; o.length;) {
|
|
33
|
+
let t = o.shift(), n = e[t.id];
|
|
34
|
+
if (!n) continue;
|
|
35
|
+
let s = r.has(t.id), c = i.has(t.id), l = t.depth < a;
|
|
36
|
+
if (!c && (s || l)) for (let e of n.childrenCache) n.visibleChildIds.add(e.record.id), o.push({
|
|
37
|
+
id: e.record.id,
|
|
38
|
+
depth: t.depth + 1
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function n(e, t) {
|
|
43
|
+
let n = [], r = [...e];
|
|
44
|
+
for (; r.length;) {
|
|
45
|
+
let e = r.shift();
|
|
46
|
+
n.push(e);
|
|
47
|
+
let i = t[e];
|
|
48
|
+
if (i) for (let e of i.visibleChildIds) r.push(e);
|
|
49
|
+
}
|
|
50
|
+
return n;
|
|
51
|
+
}
|
|
52
|
+
function r(e) {
|
|
53
|
+
for (let t of e.childrenCache) e.visibleChildIds.delete(t.record.id), r(t);
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { t as applyInitialVisibility, e as buildRecordCache, n as collectVisibleIds, r as hideDescendants };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as e } from "../external/.pnpm/@dialecte_core@0.4.
|
|
2
|
-
import {
|
|
3
|
-
import "../external/.pnpm/@dialecte_core@0.4.
|
|
1
|
+
import { r as e } from "../external/.pnpm/@dialecte_core@0.4.16/node_modules/@dialecte/core/dist/utils-BiEx1x59.js";
|
|
2
|
+
import { mt as t } from "../external/.pnpm/@dialecte_core@0.4.16/node_modules/@dialecte/core/dist/project-nvZv2ie8.js";
|
|
3
|
+
import "../external/.pnpm/@dialecte_core@0.4.16/node_modules/@dialecte/core/dist/index.js";
|
|
4
4
|
import { computed as n, shallowRef as r } from "vue";
|
|
5
5
|
//#region lib/dialecte/create-document-store.ts
|
|
6
6
|
function i(i) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region node_modules/.pnpm/@dialecte+core@0.4.
|
|
1
|
+
import { c as e, d as t, f as n, h as r, r as i, s as a, u as o } from "./utils-BiEx1x59.js";
|
|
2
|
+
//#region node_modules/.pnpm/@dialecte+core@0.4.16/node_modules/@dialecte/core/dist/helpers.js
|
|
3
3
|
var s = "db-id", c = {
|
|
4
4
|
uri: "http://dialecte.dev/XML/DEV",
|
|
5
5
|
prefix: "dev"
|
|
@@ -53,85 +53,85 @@ function m(e) {
|
|
|
53
53
|
tagName: n
|
|
54
54
|
}));
|
|
55
55
|
}
|
|
56
|
-
function h(
|
|
57
|
-
let { attribute:
|
|
58
|
-
typeof
|
|
59
|
-
detail: `Unknown namespace '${
|
|
56
|
+
function h(e) {
|
|
57
|
+
let { attribute: i, dialecteConfig: o, tagName: s } = e, c;
|
|
58
|
+
typeof i.namespace == "string" ? (c = n(o, i.namespace), c || r("UNKNOWN_NAMESPACE_PREFIX", {
|
|
59
|
+
detail: `Unknown namespace '${i.namespace}' on attribute '${i.name}' — use a registered namespace key or pass a full { name, namespace: { prefix, uri } }.`,
|
|
60
60
|
ref: { tagName: s }
|
|
61
|
-
})) : c =
|
|
62
|
-
let l =
|
|
61
|
+
})) : c = i.namespace;
|
|
62
|
+
let l = i.name.indexOf(":");
|
|
63
63
|
if (!c && l !== -1) {
|
|
64
|
-
let e =
|
|
65
|
-
e !== "xmlns" && (c =
|
|
66
|
-
detail: `Unknown namespace prefix '${e}' on attribute '${
|
|
64
|
+
let e = i.name.slice(0, l);
|
|
65
|
+
e !== "xmlns" && (c = t(o, e), c || r("UNKNOWN_NAMESPACE_PREFIX", {
|
|
66
|
+
detail: `Unknown namespace prefix '${e}' on attribute '${i.name}' — pass it explicitly as { name, namespace: { prefix, uri } }.`,
|
|
67
67
|
ref: { tagName: s }
|
|
68
68
|
}));
|
|
69
69
|
}
|
|
70
70
|
return c && c.prefix && c.prefix !== "xmlns" ? {
|
|
71
|
-
...
|
|
72
|
-
name: `${c.prefix}:${
|
|
71
|
+
...i,
|
|
72
|
+
name: `${c.prefix}:${a(i.name)}`,
|
|
73
73
|
namespace: c
|
|
74
|
-
} : (
|
|
75
|
-
...
|
|
74
|
+
} : (i.namespace, {
|
|
75
|
+
...i,
|
|
76
76
|
namespace: c
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
function g(e) {
|
|
80
|
-
return
|
|
80
|
+
return i(e, { detail: "The record or ref is undefined" }), {
|
|
81
81
|
id: e.id,
|
|
82
82
|
tagName: e.tagName
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
function _(e) {
|
|
86
|
-
let { dialecteConfig:
|
|
87
|
-
tagName:
|
|
86
|
+
let { dialecteConfig: t, hooks: n, record: r } = e, { id: i, tagName: a, attributes: s, namespace: c, value: l } = r, u = i ?? crypto.randomUUID(), d = s ? m({
|
|
87
|
+
tagName: a,
|
|
88
88
|
attributes: s,
|
|
89
|
-
dialecteConfig:
|
|
89
|
+
dialecteConfig: t
|
|
90
90
|
}) : [], f = {
|
|
91
91
|
id: u,
|
|
92
|
-
tagName:
|
|
92
|
+
tagName: a,
|
|
93
93
|
attributes: d,
|
|
94
94
|
namespace: c ?? {
|
|
95
95
|
prefix: "prefixNeededForNotSupportedNamespace",
|
|
96
96
|
uri: "uriNeededForNotSupportedNamespace"
|
|
97
97
|
},
|
|
98
98
|
value: l ?? "",
|
|
99
|
-
parent:
|
|
100
|
-
children:
|
|
101
|
-
}, p = Object.values(
|
|
102
|
-
if (!(
|
|
103
|
-
let g =
|
|
99
|
+
parent: r.parent ?? null,
|
|
100
|
+
children: r.children ?? []
|
|
101
|
+
}, p = Object.values(t.namespaces).map(({ uri: e }) => e), h = c?.uri != null && !p.includes(c.uri);
|
|
102
|
+
if (!(t.elements.includes(a) && !h)) return f;
|
|
103
|
+
let g = t.definition[a].attributes.sequence, _ = d.filter((e) => {
|
|
104
104
|
let t = g.includes(e.name), n = "namespace" in e && e.namespace != null;
|
|
105
105
|
if (!t && !n) return !1;
|
|
106
106
|
let r = e.value === void 0 || e.value === null || e.value === "";
|
|
107
107
|
return !(t && r);
|
|
108
|
-
}), v =
|
|
108
|
+
}), v = t.namespaces.default.uri, y = _.map((e) => {
|
|
109
109
|
if ("namespace" in e && e.namespace?.uri === v) {
|
|
110
110
|
let { namespace: t, ...n } = e;
|
|
111
111
|
return n;
|
|
112
112
|
}
|
|
113
113
|
return e;
|
|
114
|
-
}), b =
|
|
114
|
+
}), b = r.parent?.tagName, x = b ? t.definition[b]?.children?.details?.[a]?.namespace : void 0, S = {
|
|
115
115
|
...f,
|
|
116
|
-
namespace: x ??
|
|
117
|
-
attributes:
|
|
116
|
+
namespace: x ?? t.definition[a].namespace,
|
|
117
|
+
attributes: o(y, g)
|
|
118
118
|
};
|
|
119
|
-
return
|
|
119
|
+
return n?.afterStandardizedRecord && (S = n.afterStandardizedRecord({ record: S }), S = {
|
|
120
120
|
...S,
|
|
121
|
-
attributes:
|
|
121
|
+
attributes: o(S.attributes, g)
|
|
122
122
|
}), S;
|
|
123
123
|
}
|
|
124
|
-
function v(
|
|
125
|
-
let { dialecteConfig:
|
|
126
|
-
for (let
|
|
127
|
-
let a =
|
|
128
|
-
dialecteConfig:
|
|
129
|
-
tagName:
|
|
130
|
-
attributeName:
|
|
124
|
+
function v(t) {
|
|
125
|
+
let { dialecteConfig: n, tagName: i, attributes: a } = t;
|
|
126
|
+
for (let t of a) {
|
|
127
|
+
let a = e({
|
|
128
|
+
dialecteConfig: n,
|
|
129
|
+
tagName: i,
|
|
130
|
+
attributeName: t.name
|
|
131
131
|
});
|
|
132
|
-
a.fixed !== void 0 &&
|
|
133
|
-
detail: `Attribute '${
|
|
134
|
-
ref: { tagName:
|
|
132
|
+
a.fixed !== void 0 && t.value !== a.fixed && r("FIXED_VALUE_VIOLATION", {
|
|
133
|
+
detail: `Attribute '${t.name}' on '${i}' is fixed to '${a.fixed}' but was set to '${String(t.value)}'.`,
|
|
134
|
+
ref: { tagName: i }
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
}
|