@septkit/ui 0.0.50 → 0.0.52

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 (27) hide show
  1. package/dist/dialecte/composables/use-active-document.js +26 -23
  2. package/dist/dialecte/composables/use-live-data.js +13 -13
  3. package/dist/dropdown/index.js +2 -1
  4. package/dist/dropdown/multi-select.js +5 -0
  5. package/dist/dropdown/multi-select.vue_vue_type_script_setup_true_lang.js +126 -0
  6. package/dist/external/.pnpm/{@dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/hooks-DO4gUiix.js → @dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/hooks-Cm_UYBBt.js} +1 -1
  7. package/dist/external/.pnpm/@dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/v2019C1/index.js +22 -0
  8. package/dist/index.d.ts +108 -47
  9. package/dist/index.js +20 -19
  10. package/dist/merge/build-view-model.js +71 -60
  11. package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +2 -2
  12. package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +139 -67
  13. package/dist/merge/merge-correlate.js +46 -0
  14. package/dist/merge/merge-decision.js +6 -0
  15. package/dist/merge/merge-highlight.js +44 -0
  16. package/dist/merge/merge-preflight.js +5 -0
  17. package/dist/merge/merge-preflight.vue_vue_type_script_setup_true_lang.js +41 -0
  18. package/dist/merge/merge-progress.vue_vue_type_script_setup_true_lang.js +12 -20
  19. package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +233 -189
  20. package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +74 -65
  21. package/dist/merge/merge.service.js +36 -23
  22. package/dist/merge/use-document-progress.js +8 -9
  23. package/dist/merge/use-merge-session.js +122 -111
  24. package/dist/ui.css +1 -1
  25. package/package.json +2 -2
  26. package/dist/external/.pnpm/@dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -3
  27. package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/rotate-ccw.js +0 -11
@@ -2,9 +2,11 @@ import e from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_
2
2
  import t from "../explorer/explorer.js";
3
3
  import "../explorer/index.js";
4
4
  import n from "./decision-toggle.js";
5
- import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, ref as f, toDisplayString as p, unref as m, watch as h, withCtx as g } from "vue";
5
+ import { willBeGone as r } from "./merge-decision.js";
6
+ import { coupledNodeIds as i, focusForNode as a, primaryIdOf as o } from "./merge-highlight.js";
7
+ import { computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, openBlock as g, ref as _, toDisplayString as v, unref as y, watch as b, withCtx as x } from "vue";
6
8
  //#region lib/merge/merge-tree.vue?vue&type=script&setup=true&lang.ts
7
- var _ = ["title"], v = { class: "max-w-40 truncate" }, y = /*@__PURE__*/ l({
9
+ var S = ["title"], C = ["title"], w = { class: "max-w-40 truncate" }, T = "badge-sm h-[21px]", E = /*@__PURE__*/ m({
8
10
  __name: "merge-tree",
9
11
  props: {
10
12
  items: {},
@@ -13,91 +15,98 @@ var _ = ["title"], v = { class: "max-w-40 truncate" }, y = /*@__PURE__*/ l({
13
15
  expandedItems: {}
14
16
  },
15
17
  emits: ["select", "update:decision"],
16
- setup(l, { emit: y }) {
17
- let b = l, x = y, S = f(), C = f({
18
- scoped: [...b.expandedItems ?? []],
18
+ setup(m, { emit: E }) {
19
+ let D = m, O = E, k = _();
20
+ b(() => D.meta, () => {
21
+ let e = k.value;
22
+ if (!e) return;
23
+ let t = o(D.meta, e.groupId);
24
+ k.value = t ? {
25
+ groupId: e.groupId,
26
+ rootId: t
27
+ } : void 0;
28
+ });
29
+ let A = _({
30
+ scoped: [...D.expandedItems ?? []],
19
31
  all: !1
20
32
  });
21
- h(() => b.expandedItems, (e) => {
22
- let t = new Set(C.value.scoped);
33
+ b(() => D.expandedItems, (e) => {
34
+ let t = new Set(A.value.scoped);
23
35
  for (let n of e ?? []) t.add(n);
24
- C.value = {
36
+ A.value = {
25
37
  scoped: [...t],
26
38
  all: !1
27
39
  };
28
40
  });
29
- let w = r(() => {
30
- if (!S.value) return;
31
- let e = /* @__PURE__ */ new Set();
32
- for (let [t, n] of Object.entries(b.meta)) n.groupId === S.value && e.add(t);
33
- return e;
34
- }), T = {
35
- added: "text-success",
36
- removed: "text-error",
37
- modified: "text-warning",
38
- unchanged: "text-base-content/60",
39
- "target-only": "text-info"
40
- }, E = {
41
- added: "badge-success badge-outline",
42
- removed: "badge-error badge-outline",
43
- modified: "badge-warning badge-outline",
44
- unchanged: "badge-ghost",
45
- "target-only": "badge-info badge-outline"
41
+ let j = s(() => k.value ? i(D.items, D.meta, k.value) : void 0), M = {
42
+ added: "badge-soft badge-success",
43
+ removed: "badge-soft badge-error",
44
+ modified: "badge-soft badge-warning",
45
+ unchanged: "badge-soft badge-neutral",
46
+ "target-only": "badge-soft badge-info"
46
47
  };
47
- function D(e) {
48
- return b.meta[e.id];
48
+ function N(e) {
49
+ return D.meta[e.id];
49
50
  }
50
- function O(e) {
51
- let t = w.value;
51
+ function P(e) {
52
+ let t = j.value;
52
53
  return t ? !t.has(e.id) : !1;
53
54
  }
54
- function k(e) {
55
- let t = w.value;
55
+ function F(e) {
56
+ let t = j.value;
56
57
  return t ? t.has(e.id) : !1;
57
58
  }
58
- function A(e) {
59
- let t = D(e);
60
- return !!t?.groupId && b.decisions[t.groupId] === "skip";
59
+ function I(e) {
60
+ let t = N(e);
61
+ return !!t?.groupId && D.decisions[t.groupId] === "skip";
61
62
  }
62
- function j(e) {
63
- let t = D(e), n = t?.change ?? "unchanged", r = O(e), i = k(e), a = t?.groupId ? b.decisions[t.groupId] : void 0, o, s;
64
- return n === "target-only" ? (s = a === "accept", o = s ? "text-error line-through" : "text-info") : (s = !!t?.groupId && a === "skip", o = s ? "text-base-content/40 line-through" : T[n]), [
65
- o,
66
- r && "opacity-30",
67
- !r && i && "font-semibold",
68
- !r && i && !s && "bg-primary/10"
63
+ function L(e) {
64
+ let t = N(e), n = t?.change ?? "unchanged", i = P(e), a = F(e), o = r(n, t?.groupId ? D.decisions[t.groupId] : void 0);
65
+ return [
66
+ o ? "text-base-content/40" : n === "unchanged" ? "text-base-content/60" : "text-base-content",
67
+ i && "opacity-30",
68
+ !i && a && "font-semibold",
69
+ !i && a && !o && "bg-base-content/10"
69
70
  ];
70
71
  }
71
- function M(e) {
72
- S.value = D(e)?.groupId, x("select", e);
72
+ function R(e) {
73
+ k.value = a(D.items, D.meta, e.id), O("select", e);
73
74
  }
74
- function N(e, t) {
75
- x("update:decision", e, t);
75
+ function z(e, t) {
76
+ O("update:decision", e, t);
76
77
  }
77
- return (r, f) => (d(), i(m(t), {
78
- items: l.items,
79
- expanded: C.value,
78
+ return (r, i) => (g(), c(y(t), {
79
+ items: m.items,
80
+ expanded: A.value,
80
81
  "aria-label": "Merge changes",
81
- onSelect: M,
82
- "onUpdate:expanded": f[0] ||= (e) => C.value = e
82
+ onSelect: R,
83
+ "onUpdate:expanded": i[0] ||= (e) => A.value = e
83
84
  }, {
84
- "node-label": g(({ node: e }) => [s("span", { class: u(["truncate rounded px-2 transition-all", j(e)]) }, p(e.name), 3)]),
85
- "node-suffix": g(({ node: t }) => [s("div", { class: u(["flex items-center gap-2 transition-opacity", { "opacity-30": O(t) }]) }, [D(t)?.role === "companion" && D(t)?.path ? (d(), o("span", {
86
- key: 0,
87
- class: "flex items-center gap-1 text-xs opacity-60",
88
- title: D(t)?.path
89
- }, [c(m(e), { class: "size-3" }), s("span", v, p(D(t)?.path), 1)], 8, _)) : a("", !0), D(t)?.role === "primary" && D(t)?.groupId ? (d(), i(n, {
90
- key: 1,
91
- size: "xs",
92
- "model-value": l.decisions[D(t).groupId] ?? "accept",
93
- "onUpdate:modelValue": (e) => N(D(t).groupId, e)
94
- }, null, 8, ["model-value", "onUpdate:modelValue"])) : D(t)?.role !== "primary" && D(t)?.regionHead ? (d(), o("span", {
95
- key: 2,
96
- class: u(["badge badge-xs", A(t) ? "badge-ghost line-through opacity-60" : E[D(t)?.change ?? "unchanged"]])
97
- }, p(D(t)?.change), 3)) : a("", !0)], 2)]),
85
+ "node-label": x(({ node: e }) => [d("span", { class: h(["ml-1 truncate rounded px-2 py-0.5 transition-all", L(e)]) }, v(e.name), 3)]),
86
+ "node-suffix": x(({ node: t }) => [d("div", { class: h(["flex items-center gap-2 transition-opacity", { "opacity-30": P(t) }]) }, [
87
+ N(t)?.instance?.linked ? (g(), u("span", {
88
+ key: 0,
89
+ class: h(["badge gap-1 font-medium", [T, N(t)?.instance?.upToDate ? "badge-soft badge-success" : "badge-soft badge-warning"]]),
90
+ title: N(t)?.instance?.upToDate ? "Linked to the loaded template — up to date" : "Linked to the loaded template — has pending updates"
91
+ }, [p(y(e), { class: "size-3" }), f(" " + v(N(t)?.instance?.upToDate ? "up to date" : "outdated"), 1)], 10, S)) : l("", !0),
92
+ N(t)?.role === "companion" && N(t)?.path ? (g(), u("span", {
93
+ key: 1,
94
+ class: "flex items-center gap-1 text-xs opacity-60",
95
+ title: N(t)?.path
96
+ }, [p(y(e), { class: "size-3" }), d("span", w, v(N(t)?.path), 1)], 8, C)) : l("", !0),
97
+ N(t)?.role === "primary" && N(t)?.groupId ? (g(), c(n, {
98
+ key: 2,
99
+ size: "xs",
100
+ "model-value": m.decisions[N(t).groupId] ?? "accept",
101
+ "onUpdate:modelValue": (e) => z(N(t).groupId, e)
102
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : N(t)?.role !== "primary" && N(t)?.regionHead ? (g(), u("span", {
103
+ key: 3,
104
+ class: h(["badge font-medium", [T, I(t) ? "badge-soft badge-neutral line-through opacity-70" : M[N(t)?.change ?? "unchanged"]]])
105
+ }, v(N(t)?.change), 3)) : l("", !0)
106
+ ], 2)]),
98
107
  _: 1
99
108
  }, 8, ["items", "expanded"]));
100
109
  }
101
110
  });
102
111
  //#endregion
103
- export { y as default };
112
+ export { E as default };
@@ -1,24 +1,28 @@
1
- import { i as e } from "../external/.pnpm/@dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/hooks-DO4gUiix.js";
2
- import "../external/.pnpm/@dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/v2019C1/index.js";
1
+ import { i as e } from "../external/.pnpm/@dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/hooks-Cm_UYBBt.js";
2
+ import "../external/.pnpm/@dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/v2019C1/index.js";
3
3
  //#region lib/merge/merge.service.ts
4
4
  async function t(e, t) {
5
5
  return e.query.lifecycle.report(t);
6
6
  }
7
7
  async function n({ doc: e, target: t, report: n, decisions: r, keepNameTypesFrom: i, afterApply: a }) {
8
- return e.prepare(async (e) => {
9
- let o = await e.lifecycle.apply({
10
- ...t,
11
- report: n,
12
- decisions: r,
13
- keepNameTypesFrom: i
14
- });
15
- await a?.(e, {
16
- target: t,
17
- report: n,
18
- decisions: r,
19
- result: o
20
- });
21
- });
8
+ let o;
9
+ return {
10
+ prepared: await e.prepare(async (e) => {
11
+ let s = await e.lifecycle.apply({
12
+ ...t,
13
+ report: n,
14
+ decisions: r,
15
+ keepNameTypesFrom: i
16
+ });
17
+ o = s.instances, await a?.(e, {
18
+ target: t,
19
+ report: n,
20
+ decisions: r,
21
+ result: s
22
+ });
23
+ }),
24
+ applied: o
25
+ };
22
26
  }
23
27
  async function r({ doc: e, target: t, report: n, decisions: r, keepNameTypesFrom: i, afterApply: a }) {
24
28
  await e.transaction(async (e) => {
@@ -39,7 +43,15 @@ async function r({ doc: e, target: t, report: n, decisions: r, keepNameTypesFrom
39
43
  function i(t) {
40
44
  return e({ verb: t });
41
45
  }
42
- async function a(e, t, n) {
46
+ async function a(e) {
47
+ let t = (await Promise.all(e.map((e) => e.lifecycle.checkTemplateUuids()))).flat(), n = /* @__PURE__ */ new Set(), r = [];
48
+ for (let e of t) {
49
+ let t = `${e.code}:${e.value}`;
50
+ n.has(t) || (n.add(t), r.push(e));
51
+ }
52
+ return r;
53
+ }
54
+ async function o(e, t, n) {
43
55
  if (t.tagName === n) return t;
44
56
  let r = (await e.findAncestors(t)).find((e) => e.tagName === n);
45
57
  return r ? {
@@ -47,25 +59,26 @@ async function a(e, t, n) {
47
59
  id: r.id
48
60
  } : t;
49
61
  }
50
- async function o(e, t) {
62
+ async function s(e, t) {
51
63
  return await e.getSnapshot({
52
64
  ref: t,
53
65
  as: "tree"
54
66
  });
55
67
  }
56
- async function s(e, t) {
68
+ async function c(e, t) {
57
69
  return e.getSnapshot({
58
70
  ref: t,
59
71
  as: "xml",
60
72
  unwrap: ["Private"],
61
- declareNamespaces: !1
73
+ declareNamespaces: !1,
74
+ includeXmlDeclaration: !1
62
75
  });
63
76
  }
64
- async function c(e, t) {
77
+ async function l(e, t) {
65
78
  return await e.getAttributes(t, { defaults: "none" });
66
79
  }
67
- async function l(e, t) {
80
+ async function u(e, t) {
68
81
  return e.presentation.extractElementTitle(t);
69
82
  }
70
83
  //#endregion
71
- export { r as commitMerge, l as extractTitle, a as findScopeRoot, c as getAttributes, i as getPresentationScope, n as previewApply, t as reportLifecycle, o as snapshotTree, s as snapshotXml };
84
+ export { a as collectTemplateUuidWarnings, r as commitMerge, u as extractTitle, o as findScopeRoot, l as getAttributes, i as getPresentationScope, n as previewApply, t as reportLifecycle, s as snapshotTree, c as snapshotXml };
@@ -1,26 +1,25 @@
1
1
  import { onScopeDispose as e, ref as t } from "vue";
2
2
  //#region lib/merge/use-document-progress.ts
3
3
  function n(n) {
4
- let r = t(!1), i = t(null), a = t([]), o;
5
- function s() {
4
+ let r = t(!1), i = t(null), a;
5
+ function o() {
6
6
  let e = n();
7
- r.value = e.loading, i.value = e.progress ? { ...e.progress } : null, a.value = e.history.slice(-6);
7
+ r.value = e.loading, i.value = e.progress ? { ...e.progress } : null;
8
8
  }
9
- async function c(e) {
10
- s(), o = setInterval(s, 80);
9
+ async function s(e) {
10
+ o(), a = setInterval(o, 80);
11
11
  try {
12
12
  return await e;
13
13
  } finally {
14
- o && clearInterval(o), o = void 0, s();
14
+ a && clearInterval(a), a = void 0, o();
15
15
  }
16
16
  }
17
17
  return e(() => {
18
- o && clearInterval(o);
18
+ a && clearInterval(a);
19
19
  }), {
20
20
  loading: r,
21
21
  progress: i,
22
- history: a,
23
- track: c
22
+ track: s
24
23
  };
25
24
  }
26
25
  //#endregion
@@ -1,62 +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
- let e = await a(f.targetDocument, x());
29
- p.value = e;
30
- for (let t of e.groups) t.suggestedAction && t.suggestedAction !== "accept" && m.set(t.id, t.suggestedAction);
31
- 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();
32
33
  }
33
- function T(e, t) {
34
- let n = C(m.get(e));
35
- m.set(e, n ? {
34
+ function k(e, t) {
35
+ let n = D(_.get(e));
36
+ _.set(e, n ? {
36
37
  action: t,
37
38
  values: n
38
- } : t), F();
39
+ } : t), R();
39
40
  }
40
- function E(e, t, n) {
41
- let r = m.get(e), i = {
42
- ...C(r),
41
+ function A(e, t, n) {
42
+ let r = _.get(e), i = {
43
+ ...D(r),
43
44
  [t]: n
44
45
  };
45
- m.set(e, {
46
- action: S(r),
46
+ _.set(e, {
47
+ action: E(r),
47
48
  values: i
48
- }), F();
49
+ }), R();
49
50
  }
50
- function D(e) {
51
- return S(m.get(e));
51
+ function j(e) {
52
+ return E(_.get(e));
52
53
  }
53
- function O(e, t) {
54
- return C(m.get(e))?.[t];
54
+ function M(e, t) {
55
+ return D(_.get(e))?.[t];
55
56
  }
56
- function k() {
57
+ function N() {
57
58
  let e = /* @__PURE__ */ new Map();
58
- for (let [t, n] of m) {
59
- let r = C(n);
59
+ for (let [t, n] of _) {
60
+ let r = D(n);
60
61
  r && e.set(t, {
61
62
  action: "accept",
62
63
  values: r
@@ -64,50 +65,58 @@ function f(f) {
64
65
  }
65
66
  return e;
66
67
  }
67
- function A(e) {
68
- g.value = e, R();
69
- }
70
- let j, M = /* @__PURE__ */ new Map(), N, P = 0;
71
- function F() {
72
- N && clearTimeout(N), N = setTimeout(() => void I(), 150);
73
- }
74
- async function I() {
75
- if (!p.value) return;
76
- let e = ++P;
77
- b.value = !0;
78
- let a = k(), s = await i({
79
- doc: f.targetDocument,
80
- target: x(),
81
- report: p.value,
82
- decisions: a,
83
- keepNameTypesFrom: h.value,
84
- 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
85
86
  });
86
- if (e !== P) {
87
- s.discard();
87
+ if (e !== L) {
88
+ o.discard();
88
89
  return;
89
90
  }
90
- j?.discard(), j = s, M = /* @__PURE__ */ new Map();
91
- for (let e of j.operations) {
92
- if (e.status !== "created") continue;
93
- let t = {
94
- tagName: e.newRecord.tagName,
95
- id: e.newRecord.id
96
- }, { templateUuid: r } = await n(j.query, t);
97
- 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);
98
102
  }
99
- let u = r(f.verb), d = await t(j.query, f.anchor, u.rootTag), m = await o(j.query, d), v = await c({
100
- report: p.value,
101
- createdBySourceUuid: M,
102
- 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
103
111
  });
104
- _.value = await l({
105
- tree: m,
106
- changeByStagedId: v,
107
- query: j.query
108
- }), g.value &&= L(g.value, _.value), b.value = !1, await R();
109
- }
110
- 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) {
111
120
  let n = Object.values(t.index);
112
121
  if (e.node) {
113
122
  let t = n.find((t) => t.node === e.node);
@@ -119,55 +128,57 @@ function f(f) {
119
128
  }
120
129
  return (e.previewRef.id ? t.index[e.previewRef.id] : void 0) ?? e;
121
130
  }
122
- async function R() {
123
- let e = g.value;
124
- if (!e || !j) {
125
- 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;
126
135
  return;
127
136
  }
128
- 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);
129
139
  }
130
- async function z(e) {
131
- return j ? n(j.query, e) : {};
140
+ async function H(e) {
141
+ return F ? r(F.query, e) : {};
132
142
  }
133
- async function B(e) {
143
+ async function U(e) {
134
144
  try {
135
- return await s(f.targetDocument.query, e);
145
+ return await c(h.targetDocument.query, e);
136
146
  } catch {
137
147
  return;
138
148
  }
139
149
  }
140
- async function V() {
141
- p.value && (j?.discard(), j = void 0, await e({
142
- doc: f.targetDocument,
143
- target: x(),
144
- report: p.value,
145
- decisions: new Map(m),
146
- keepNameTypesFrom: h.value,
147
- 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
148
158
  }));
149
159
  }
150
- function H(e) {
151
- h.value = e, F();
160
+ function G(e) {
161
+ v.value = e, R();
152
162
  }
153
163
  return {
154
- report: p,
155
- decisions: m,
156
- keepNameTypesFrom: h,
157
- structuralTree: _,
158
- previewXml: v,
159
- previewBeforeXml: y,
160
- previewLoading: b,
161
- load: w,
162
- setDecision: T,
163
- setValue: E,
164
- decisionOf: D,
165
- editedValue: O,
166
- select: A,
167
- stagedAttributes: z,
168
- setKeepNameTypesFrom: H,
169
- 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
170
181
  };
171
182
  }
172
183
  //#endregion
173
- export { f as useMergeSession };
184
+ export { h as useMergeSession };