@septkit/ui 0.0.50 → 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.
- package/dist/dialecte/composables/use-active-document.js +26 -23
- package/dist/dialecte/composables/use-live-data.js +13 -13
- 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
- package/dist/external/.pnpm/@dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/v2019C1/index.js +22 -0
- package/dist/index.d.ts +41 -9
- package/dist/merge/build-view-model.js +71 -60
- package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +139 -67
- package/dist/merge/merge-correlate.js +46 -0
- package/dist/merge/merge-decision.js +6 -0
- package/dist/merge/merge-highlight.js +44 -0
- package/dist/merge/merge-preflight.js +5 -0
- package/dist/merge/merge-preflight.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/merge/merge-progress.vue_vue_type_script_setup_true_lang.js +12 -20
- package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +233 -189
- package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +74 -65
- package/dist/merge/merge.service.js +36 -23
- package/dist/merge/use-document-progress.js +8 -9
- package/dist/merge/use-merge-session.js +122 -111
- package/dist/ui.css +1 -1
- package/package.json +2 -2
- package/dist/external/.pnpm/@dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -3
- 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 {
|
|
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
|
|
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(
|
|
17
|
-
let
|
|
18
|
-
|
|
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
|
-
|
|
22
|
-
let t = new Set(
|
|
33
|
+
b(() => D.expandedItems, (e) => {
|
|
34
|
+
let t = new Set(A.value.scoped);
|
|
23
35
|
for (let n of e ?? []) t.add(n);
|
|
24
|
-
|
|
36
|
+
A.value = {
|
|
25
37
|
scoped: [...t],
|
|
26
38
|
all: !1
|
|
27
39
|
};
|
|
28
40
|
});
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
48
|
-
return
|
|
48
|
+
function N(e) {
|
|
49
|
+
return D.meta[e.id];
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
let t =
|
|
51
|
+
function P(e) {
|
|
52
|
+
let t = j.value;
|
|
52
53
|
return t ? !t.has(e.id) : !1;
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
-
let t =
|
|
55
|
+
function F(e) {
|
|
56
|
+
let t = j.value;
|
|
56
57
|
return t ? t.has(e.id) : !1;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
let t =
|
|
60
|
-
return !!t?.groupId &&
|
|
59
|
+
function I(e) {
|
|
60
|
+
let t = N(e);
|
|
61
|
+
return !!t?.groupId && D.decisions[t.groupId] === "skip";
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
let t =
|
|
64
|
-
return
|
|
65
|
-
o,
|
|
66
|
-
|
|
67
|
-
!
|
|
68
|
-
!
|
|
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
|
|
72
|
-
|
|
72
|
+
function R(e) {
|
|
73
|
+
k.value = a(D.items, D.meta, e.id), O("select", e);
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
75
|
+
function z(e, t) {
|
|
76
|
+
O("update:decision", e, t);
|
|
76
77
|
}
|
|
77
|
-
return (r,
|
|
78
|
-
items:
|
|
79
|
-
expanded:
|
|
78
|
+
return (r, i) => (g(), c(y(t), {
|
|
79
|
+
items: m.items,
|
|
80
|
+
expanded: A.value,
|
|
80
81
|
"aria-label": "Merge changes",
|
|
81
|
-
onSelect:
|
|
82
|
-
"onUpdate:expanded":
|
|
82
|
+
onSelect: R,
|
|
83
|
+
"onUpdate:expanded": i[0] ||= (e) => A.value = e
|
|
83
84
|
}, {
|
|
84
|
-
"node-label":
|
|
85
|
-
"node-suffix":
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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 {
|
|
112
|
+
export { E as default };
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { i as e } from "../external/.pnpm/@dialecte_scl@0.3.
|
|
2
|
-
import "../external/.pnpm/@dialecte_scl@0.3.
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
77
|
+
async function l(e, t) {
|
|
65
78
|
return await e.getAttributes(t, { defaults: "none" });
|
|
66
79
|
}
|
|
67
|
-
async function
|
|
80
|
+
async function u(e, t) {
|
|
68
81
|
return e.presentation.extractElementTitle(t);
|
|
69
82
|
}
|
|
70
83
|
//#endregion
|
|
71
|
-
export { r as commitMerge,
|
|
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
|
|
5
|
-
function
|
|
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
|
|
7
|
+
r.value = e.loading, i.value = e.progress ? { ...e.progress } : null;
|
|
8
8
|
}
|
|
9
|
-
async function
|
|
10
|
-
|
|
9
|
+
async function s(e) {
|
|
10
|
+
o(), a = setInterval(o, 80);
|
|
11
11
|
try {
|
|
12
12
|
return await e;
|
|
13
13
|
} finally {
|
|
14
|
-
|
|
14
|
+
a && clearInterval(a), a = void 0, o();
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
return e(() => {
|
|
18
|
-
|
|
18
|
+
a && clearInterval(a);
|
|
19
19
|
}), {
|
|
20
20
|
loading: r,
|
|
21
21
|
progress: i,
|
|
22
|
-
|
|
23
|
-
track: c
|
|
22
|
+
track: s
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
//#endregion
|
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildChangeIndex as
|
|
3
|
-
import {
|
|
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
|
|
6
|
-
let
|
|
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
|
-
}),
|
|
12
|
-
function
|
|
12
|
+
}), x = m(), S = m(), C = m(!1), w = m([]);
|
|
13
|
+
function T() {
|
|
13
14
|
return {
|
|
14
|
-
verb:
|
|
15
|
-
scenario:
|
|
16
|
-
sourceQuery:
|
|
17
|
-
ref:
|
|
18
|
-
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
|
|
22
|
+
function E(e) {
|
|
22
23
|
return e === void 0 ? "accept" : typeof e == "string" ? e : e.action;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function D(e) {
|
|
25
26
|
return typeof e == "object" ? e.values : void 0;
|
|
26
27
|
}
|
|
27
|
-
async function
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
for (let
|
|
31
|
-
await
|
|
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
|
|
34
|
-
let n =
|
|
35
|
-
|
|
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),
|
|
39
|
+
} : t), R();
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
let r =
|
|
42
|
-
...
|
|
41
|
+
function A(e, t, n) {
|
|
42
|
+
let r = _.get(e), i = {
|
|
43
|
+
...D(r),
|
|
43
44
|
[t]: n
|
|
44
45
|
};
|
|
45
|
-
|
|
46
|
-
action:
|
|
46
|
+
_.set(e, {
|
|
47
|
+
action: E(r),
|
|
47
48
|
values: i
|
|
48
|
-
}),
|
|
49
|
+
}), R();
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
51
|
+
function j(e) {
|
|
52
|
+
return E(_.get(e));
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
54
|
+
function M(e, t) {
|
|
55
|
+
return D(_.get(e))?.[t];
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function N() {
|
|
57
58
|
let e = /* @__PURE__ */ new Map();
|
|
58
|
-
for (let [t, n] of
|
|
59
|
-
let r =
|
|
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
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
let
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
async function
|
|
75
|
-
if (!
|
|
76
|
-
let e = ++
|
|
77
|
-
|
|
78
|
-
let
|
|
79
|
-
doc:
|
|
80
|
-
target:
|
|
81
|
-
report:
|
|
82
|
-
decisions:
|
|
83
|
-
keepNameTypesFrom:
|
|
84
|
-
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 !==
|
|
87
|
-
|
|
87
|
+
if (e !== L) {
|
|
88
|
+
o.discard();
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
|
100
|
-
report:
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
105
|
-
tree:
|
|
106
|
-
changeByStagedId:
|
|
107
|
-
query:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
|
123
|
-
let e =
|
|
124
|
-
if (!e || !
|
|
125
|
-
|
|
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
|
-
|
|
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
|
|
131
|
-
return
|
|
140
|
+
async function H(e) {
|
|
141
|
+
return F ? r(F.query, e) : {};
|
|
132
142
|
}
|
|
133
|
-
async function
|
|
143
|
+
async function U(e) {
|
|
134
144
|
try {
|
|
135
|
-
return await
|
|
145
|
+
return await c(h.targetDocument.query, e);
|
|
136
146
|
} catch {
|
|
137
147
|
return;
|
|
138
148
|
}
|
|
139
149
|
}
|
|
140
|
-
async function
|
|
141
|
-
|
|
142
|
-
doc:
|
|
143
|
-
target:
|
|
144
|
-
report:
|
|
145
|
-
decisions: new Map(
|
|
146
|
-
keepNameTypesFrom:
|
|
147
|
-
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
|
|
151
|
-
|
|
160
|
+
function G(e) {
|
|
161
|
+
v.value = e, R();
|
|
152
162
|
}
|
|
153
163
|
return {
|
|
154
|
-
report:
|
|
155
|
-
decisions:
|
|
156
|
-
keepNameTypesFrom:
|
|
157
|
-
structuralTree:
|
|
158
|
-
previewXml:
|
|
159
|
-
previewBeforeXml:
|
|
160
|
-
previewLoading:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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 {
|
|
184
|
+
export { h as useMergeSession };
|