@septkit/ui 0.0.49 → 0.0.51

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.
Files changed (28) hide show
  1. package/dist/dialecte/composables/use-active-document.js +27 -17
  2. package/dist/dialecte/composables/use-live-data.js +13 -13
  3. package/dist/dialecte/create-document-store.js +3 -3
  4. package/dist/external/.pnpm/{@dialecte_core@0.4.7 → @dialecte_core@0.4.9}/node_modules/@dialecte/core/dist/helpers.js +16 -19
  5. package/dist/external/.pnpm/{@dialecte_core@0.4.7 → @dialecte_core@0.4.9}/node_modules/@dialecte/core/dist/index.js +1 -1
  6. package/dist/external/.pnpm/{@dialecte_core@0.4.7/node_modules/@dialecte/core/dist/project-DxIu-3AU.js → @dialecte_core@0.4.9/node_modules/@dialecte/core/dist/project-D-KS3OPN.js} +1 -1
  7. package/dist/external/.pnpm/{@dialecte_core@0.4.7 → @dialecte_core@0.4.9}/node_modules/@dialecte/core/dist/utils-C5_11hqg.js +1 -1
  8. package/dist/external/.pnpm/{@dialecte_scl@0.3.8/node_modules/@dialecte/scl/dist/hooks-DJJN-WU2.js → @dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/hooks-Cm_UYBBt.js} +48 -5277
  9. package/dist/external/.pnpm/@dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/v2019C1/index.js +22 -0
  10. package/dist/index.d.ts +48 -10
  11. package/dist/merge/build-view-model.js +101 -74
  12. package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +2 -2
  13. package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +154 -45
  14. package/dist/merge/merge-correlate.js +46 -0
  15. package/dist/merge/merge-decision.js +6 -0
  16. package/dist/merge/merge-highlight.js +44 -0
  17. package/dist/merge/merge-preflight.js +5 -0
  18. package/dist/merge/merge-preflight.vue_vue_type_script_setup_true_lang.js +41 -0
  19. package/dist/merge/merge-progress.vue_vue_type_script_setup_true_lang.js +12 -20
  20. package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +230 -181
  21. package/dist/merge/merge-summary.vue_vue_type_script_setup_true_lang.js +47 -25
  22. package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +73 -62
  23. package/dist/merge/merge.service.js +36 -23
  24. package/dist/merge/use-document-progress.js +8 -9
  25. package/dist/merge/use-merge-session.js +122 -108
  26. package/dist/ui.css +1 -1
  27. package/package.json +3 -3
  28. package/dist/external/.pnpm/@dialecte_scl@0.3.8/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -3
@@ -1,59 +1,63 @@
1
- import { commitMerge as e, findScopeRoot as t, getAttributes as n, getPresentationScope as r, previewApply as i, reportLifecycle as a, snapshotTree as o, snapshotXml as s } from "./merge.service.js";
2
- import { buildChangeIndex as c, buildStructuralTree as l } from "./build-view-model.js";
3
- import { reactive as u, shallowRef as d } from "vue";
1
+ import { collectTemplateUuidWarnings as e, commitMerge as t, findScopeRoot as n, getAttributes as r, getPresentationScope as i, previewApply as a, reportLifecycle as o, snapshotTree as s, snapshotXml as c } from "./merge.service.js";
2
+ import { allGroups as l, buildChangeIndex as u, buildStructuralTree as d } from "./build-view-model.js";
3
+ import { correlate as f } from "./merge-correlate.js";
4
+ import { reactive as p, shallowRef as m } from "vue";
4
5
  //#region lib/merge/use-merge-session.ts
5
- function f(f) {
6
- let p = d(), m = u(/* @__PURE__ */ new Map()), h = d("target"), g = d(), _ = d({
6
+ function h(h) {
7
+ let g = m(), _ = p(/* @__PURE__ */ new Map()), v = m("target"), y = m(), b = m({
7
8
  items: [],
8
9
  meta: {},
9
10
  index: {},
10
11
  expanded: []
11
- }), v = d(), y = d(), b = d(!1);
12
- function x() {
12
+ }), x = m(), S = m(), C = m(!1), w = m([]);
13
+ function T() {
13
14
  return {
14
- verb: f.verb,
15
- scenario: f.scenario,
16
- sourceQuery: f.sourceQuery,
17
- ref: f.sourceRef,
18
- anchor: f.anchor
15
+ verb: h.verb,
16
+ scenario: h.scenario,
17
+ sourceQuery: h.sourceQuery,
18
+ ref: h.sourceRef,
19
+ anchor: h.anchor
19
20
  };
20
21
  }
21
- function S(e) {
22
+ function E(e) {
22
23
  return e === void 0 ? "accept" : typeof e == "string" ? e : e.action;
23
24
  }
24
- function C(e) {
25
+ function D(e) {
25
26
  return typeof e == "object" ? e.values : void 0;
26
27
  }
27
- async function w() {
28
- p.value = await a(f.targetDocument, x()), await I();
28
+ async function O() {
29
+ let t = await o(h.targetDocument, T());
30
+ g.value = t, w.value = await e([h.sourceQuery, h.targetDocument.query]);
31
+ for (let e of l(t)) e.suggestedAction && e.suggestedAction !== "accept" && _.set(e.id, e.suggestedAction);
32
+ await z();
29
33
  }
30
- function T(e, t) {
31
- let n = C(m.get(e));
32
- m.set(e, n ? {
34
+ function k(e, t) {
35
+ let n = D(_.get(e));
36
+ _.set(e, n ? {
33
37
  action: t,
34
38
  values: n
35
- } : t), F();
39
+ } : t), R();
36
40
  }
37
- function E(e, t, n) {
38
- let r = m.get(e), i = {
39
- ...C(r),
41
+ function A(e, t, n) {
42
+ let r = _.get(e), i = {
43
+ ...D(r),
40
44
  [t]: n
41
45
  };
42
- m.set(e, {
43
- action: S(r),
46
+ _.set(e, {
47
+ action: E(r),
44
48
  values: i
45
- }), F();
49
+ }), R();
46
50
  }
47
- function D(e) {
48
- return S(m.get(e));
51
+ function j(e) {
52
+ return E(_.get(e));
49
53
  }
50
- function O(e, t) {
51
- return C(m.get(e))?.[t];
54
+ function M(e, t) {
55
+ return D(_.get(e))?.[t];
52
56
  }
53
- function k() {
57
+ function N() {
54
58
  let e = /* @__PURE__ */ new Map();
55
- for (let [t, n] of m) {
56
- let r = C(n);
59
+ for (let [t, n] of _) {
60
+ let r = D(n);
57
61
  r && e.set(t, {
58
62
  action: "accept",
59
63
  values: r
@@ -61,50 +65,58 @@ function f(f) {
61
65
  }
62
66
  return e;
63
67
  }
64
- function A(e) {
65
- g.value = e, R();
66
- }
67
- let j, M = /* @__PURE__ */ new Map(), N, P = 0;
68
- function F() {
69
- N && clearTimeout(N), N = setTimeout(() => void I(), 150);
70
- }
71
- async function I() {
72
- if (!p.value) return;
73
- let e = ++P;
74
- b.value = !0;
75
- let a = k(), s = await i({
76
- doc: f.targetDocument,
77
- target: x(),
78
- report: p.value,
79
- decisions: a,
80
- keepNameTypesFrom: h.value,
81
- afterApply: f.afterApply
68
+ function P(e) {
69
+ y.value = e, V();
70
+ }
71
+ let F, I, L = 0;
72
+ function R() {
73
+ I && clearTimeout(I), I = setTimeout(() => void z(), 150);
74
+ }
75
+ async function z() {
76
+ if (!g.value) return;
77
+ let e = ++L;
78
+ C.value = !0;
79
+ let t = N(), { prepared: o, applied: c } = await a({
80
+ doc: h.targetDocument,
81
+ target: T(),
82
+ report: g.value,
83
+ decisions: t,
84
+ keepNameTypesFrom: v.value,
85
+ afterApply: h.afterApply
82
86
  });
83
- if (e !== P) {
84
- s.discard();
87
+ if (e !== L) {
88
+ o.discard();
85
89
  return;
86
90
  }
87
- j?.discard(), j = s, M = /* @__PURE__ */ new Map();
88
- for (let e of j.operations) {
89
- if (e.status !== "created") continue;
90
- let t = {
91
- tagName: e.newRecord.tagName,
92
- id: e.newRecord.id
93
- }, { templateUuid: r } = await n(j.query, t);
94
- r && M.set(r, t);
91
+ F?.discard(), F = o;
92
+ let p = i(h.verb), m = await n(F.query, h.anchor, p.rootTag), _ = await s(F.query, m), x = c.verb === "fsd" ? c.functions : [...c.applications, ...c.functions], S = /* @__PURE__ */ new Map();
93
+ for (let e of l(g.value)) for (let t of e.companions) {
94
+ if (t.instanceRef?.id || !t.sourceRef) continue;
95
+ let { name: e } = await r(h.sourceQuery, t.sourceRef);
96
+ if (!e) continue;
97
+ let [n] = await F.query.any.findByAttributes({
98
+ tagName: t.tagName,
99
+ attributes: { name: e }
100
+ });
101
+ n && S.set(t, n.id);
95
102
  }
96
- let u = r(f.verb), d = await t(j.query, f.anchor, u.rootTag), m = await o(j.query, d), v = await c({
97
- report: p.value,
98
- createdBySourceUuid: M,
99
- sourceQuery: f.sourceQuery
103
+ let w = f({
104
+ report: g.value,
105
+ snapshot: _,
106
+ appliedRoots: x,
107
+ companionAnchors: S
108
+ }), E = u({
109
+ report: g.value,
110
+ correlation: w
100
111
  });
101
- _.value = await l({
102
- tree: m,
103
- changeByStagedId: v,
104
- query: j.query
105
- }), g.value &&= L(g.value, _.value), b.value = !1, await R();
106
- }
107
- function L(e, t) {
112
+ b.value = await d({
113
+ tree: _,
114
+ changeByStagedId: E,
115
+ query: F.query,
116
+ instances: g.value.instances
117
+ }), y.value &&= B(y.value, b.value), C.value = !1, await V();
118
+ }
119
+ function B(e, t) {
108
120
  let n = Object.values(t.index);
109
121
  if (e.node) {
110
122
  let t = n.find((t) => t.node === e.node);
@@ -116,55 +128,57 @@ function f(f) {
116
128
  }
117
129
  return (e.previewRef.id ? t.index[e.previewRef.id] : void 0) ?? e;
118
130
  }
119
- async function R() {
120
- let e = g.value;
121
- if (!e || !j) {
122
- v.value = void 0, y.value = void 0;
131
+ async function V() {
132
+ let e = y.value;
133
+ if (!e || !F) {
134
+ x.value = void 0, S.value = void 0;
123
135
  return;
124
136
  }
125
- v.value = await s(j.query, e.previewRef), y.value = e.change === "added" ? "" : await B(e.previewRef);
137
+ let t = e.change === "target-only" && !!e.groupId && E(_.get(e.groupId)) === "accept";
138
+ x.value = t ? "" : await c(F.query, e.previewRef), S.value = e.change === "added" ? "" : await U(e.previewRef);
126
139
  }
127
- async function z(e) {
128
- return j ? n(j.query, e) : {};
140
+ async function H(e) {
141
+ return F ? r(F.query, e) : {};
129
142
  }
130
- async function B(e) {
143
+ async function U(e) {
131
144
  try {
132
- return await s(f.targetDocument.query, e);
145
+ return await c(h.targetDocument.query, e);
133
146
  } catch {
134
147
  return;
135
148
  }
136
149
  }
137
- async function V() {
138
- p.value && (j?.discard(), j = void 0, await e({
139
- doc: f.targetDocument,
140
- target: x(),
141
- report: p.value,
142
- decisions: new Map(m),
143
- keepNameTypesFrom: h.value,
144
- afterApply: f.afterApply
150
+ async function W() {
151
+ g.value && (F?.discard(), F = void 0, await t({
152
+ doc: h.targetDocument,
153
+ target: T(),
154
+ report: g.value,
155
+ decisions: new Map(_),
156
+ keepNameTypesFrom: v.value,
157
+ afterApply: h.afterApply
145
158
  }));
146
159
  }
147
- function H(e) {
148
- h.value = e, F();
160
+ function G(e) {
161
+ v.value = e, R();
149
162
  }
150
163
  return {
151
- report: p,
152
- decisions: m,
153
- keepNameTypesFrom: h,
154
- structuralTree: _,
155
- previewXml: v,
156
- previewBeforeXml: y,
157
- previewLoading: b,
158
- load: w,
159
- setDecision: T,
160
- setValue: E,
161
- decisionOf: D,
162
- editedValue: O,
163
- select: A,
164
- stagedAttributes: z,
165
- setKeepNameTypesFrom: H,
166
- commit: V
164
+ report: g,
165
+ decisions: _,
166
+ keepNameTypesFrom: v,
167
+ structuralTree: b,
168
+ previewXml: x,
169
+ previewBeforeXml: S,
170
+ previewLoading: C,
171
+ warnings: w,
172
+ load: O,
173
+ setDecision: k,
174
+ setValue: A,
175
+ decisionOf: j,
176
+ editedValue: M,
177
+ select: P,
178
+ stagedAttributes: H,
179
+ setKeepNameTypesFrom: G,
180
+ commit: W
167
181
  };
168
182
  }
169
183
  //#endregion
170
- export { f as useMergeSession };
184
+ export { h as useMergeSession };