@septkit/ui 0.0.57 → 0.0.59
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/_virtual/_rolldown/runtime.js +17 -11
- package/dist/diagram-layout/elk-layout-engine.js +71 -0
- package/dist/diagram-layout/index.js +2 -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/external/.pnpm/elkjs@0.10.2/node_modules/elkjs/lib/elk.bundled.js +46047 -0
- package/dist/index.d.ts +79 -2
- package/dist/index.js +3 -1
- 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/package.json +4 -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
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { Ref } from 'vue';
|
|
|
23
23
|
import { Scl } from '@dialecte/scl/v2019C1';
|
|
24
24
|
import { ShallowRef } from 'vue';
|
|
25
25
|
import { TemplateUuidWarning } from '@dialecte/scl/v2019C1';
|
|
26
|
+
import { TopologyStructuralTag } from '@dialecte/scl/v2019C1';
|
|
26
27
|
|
|
27
28
|
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
28
29
|
|
|
@@ -540,6 +541,11 @@ export declare function createDocumentStore<GenericBaseDocument, GenericAugmente
|
|
|
540
541
|
clear: () => void;
|
|
541
542
|
};
|
|
542
543
|
|
|
544
|
+
/** Create an ELK-backed `LayoutEngine`. Each instance owns its own ELK
|
|
545
|
+
* worker/instance so callers/tests stay isolated. `defaults` are applied to
|
|
546
|
+
* every `layout()` call and can be overridden per call via its `options`. */
|
|
547
|
+
export declare function createElkLayoutEngine(defaults?: LayoutOptions): LayoutEngine;
|
|
548
|
+
|
|
543
549
|
/** A user's binary choice on a decision group. */
|
|
544
550
|
export declare type DecisionAction = 'accept' | 'skip';
|
|
545
551
|
|
|
@@ -746,6 +752,77 @@ export declare function highlightCode(code: string, options?: {
|
|
|
746
752
|
lineStatuses?: readonly LineStatus[];
|
|
747
753
|
}): Promise<string>;
|
|
748
754
|
|
|
755
|
+
export declare type LayoutDirection = 'UP' | 'DOWN' | 'LEFT' | 'RIGHT';
|
|
756
|
+
|
|
757
|
+
/** A connection between nodes. Arrays mirror ELK's hyperedge model, so a
|
|
758
|
+
* single logical edge can bundle multiple sources/targets (for example
|
|
759
|
+
* ELK's `mergeEdges` bus-style routing). */
|
|
760
|
+
export declare type LayoutEdge = {
|
|
761
|
+
id: string;
|
|
762
|
+
sources: string[];
|
|
763
|
+
targets: string[];
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
/** A swappable diagram layout algorithm. */
|
|
767
|
+
export declare type LayoutEngine = {
|
|
768
|
+
layout(input: LayoutGraphInput, options?: LayoutOptions): Promise<LayoutGraphResult>;
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
export declare type LayoutGraphInput = {
|
|
772
|
+
nodes: LayoutNode[];
|
|
773
|
+
edges: LayoutEdge[];
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
export declare type LayoutGraphResult = {
|
|
777
|
+
/** Computed position per node id. */
|
|
778
|
+
positions: Record<string, LayoutPoint>;
|
|
779
|
+
/**
|
|
780
|
+
* Computed route points per edge id (start, optional bend points, end),
|
|
781
|
+
* when the engine produces routed edges. Absent/empty for engines that
|
|
782
|
+
* don't route edges explicitly.
|
|
783
|
+
*/
|
|
784
|
+
edgeRoutes: Record<string, LayoutPoint[]>;
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Normalized, engine-agnostic diagram layout contract. No Vue, Pinia, SCL,
|
|
789
|
+
* Dialecte, or VueFlow types may appear here — see ADR-0024 (shared
|
|
790
|
+
* swappable diagram layout engine).
|
|
791
|
+
*/
|
|
792
|
+
/** A single node to be positioned. */
|
|
793
|
+
export declare type LayoutNode = {
|
|
794
|
+
id: string;
|
|
795
|
+
width: number;
|
|
796
|
+
height: number;
|
|
797
|
+
/**
|
|
798
|
+
* Rank used to order siblings left-to-right during layout (for example
|
|
799
|
+
* to keep expansion order stable). Engines that don't support ordering
|
|
800
|
+
* hints may ignore this.
|
|
801
|
+
*/
|
|
802
|
+
orderHint?: number;
|
|
803
|
+
/** Nested child nodes, for engines/consumers that lay out containment. */
|
|
804
|
+
children?: LayoutNode[];
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
export declare type LayoutOptions = {
|
|
808
|
+
direction?: LayoutDirection;
|
|
809
|
+
/** Minimum spacing between sibling nodes. */
|
|
810
|
+
nodeSpacing?: number;
|
|
811
|
+
/** Minimum spacing between layers/ranks. */
|
|
812
|
+
layerSpacing?: number;
|
|
813
|
+
/**
|
|
814
|
+
* Engine-specific escape hatch. `ElkLayoutEngine` forwards these
|
|
815
|
+
* verbatim as ELK layout options; other engines may ignore it.
|
|
816
|
+
*/
|
|
817
|
+
elkOptions?: Record<string, string>;
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
/** An absolute point on an edge's route. */
|
|
821
|
+
export declare type LayoutPoint = {
|
|
822
|
+
x: number;
|
|
823
|
+
y: number;
|
|
824
|
+
};
|
|
825
|
+
|
|
749
826
|
export declare type LineStatus = 'added' | 'removed' | 'unchanged';
|
|
750
827
|
|
|
751
828
|
/**
|
|
@@ -803,8 +880,8 @@ export declare type MergeSessionParams = {
|
|
|
803
880
|
verb: LifecycleVerb;
|
|
804
881
|
/** Operation to perform: place a new instance, or reconcile the existing one. */
|
|
805
882
|
scenario: LifecycleScenario;
|
|
806
|
-
/** Source (template) element: a Function (fsd)
|
|
807
|
-
sourceRef: Scl.Ref<'Function'> | Scl.Ref<'Application'>;
|
|
883
|
+
/** Source (template) element: a Function (fsd), Application (asd) or topology scope (ssd). */
|
|
884
|
+
sourceRef: Scl.Ref<'Function'> | Scl.Ref<'Application'> | Scl.Ref<TopologyStructuralTag>;
|
|
808
885
|
/** Target parent the instance lives under / is placed into. */
|
|
809
886
|
anchor: Scl.Ref<Scl.ElementsOf>;
|
|
810
887
|
/** Optional consumer post-step run inside the merge tx (preview + commit). */
|
package/dist/index.js
CHANGED
|
@@ -37,4 +37,6 @@ import P from "./context-menu/context-menu.js";
|
|
|
37
37
|
import "./context-menu/index.js";
|
|
38
38
|
import F from "./split-layout/split-layout.js";
|
|
39
39
|
import "./split-layout/index.js";
|
|
40
|
-
|
|
40
|
+
import { createElkLayoutEngine as I } from "./diagram-layout/elk-layout-engine.js";
|
|
41
|
+
import "./diagram-layout/index.js";
|
|
42
|
+
export { s as Button, y as CATEGORY_ELEMENTS, T as CodeBlock, l as Combobox, P as ContextMenu, O as DecisionToggle, d as Dialog, _ as DialogHost, v as DocumentProgressBar, c as Dropdown, b as ELEMENT_TO_COLOR, x as ELEMENT_TO_ICON, k as ElementDetail, f as FeedbackDialog, N as MergeReview, A as MergeTree, u as MultiSelect, C as SclExplorer, F as SplitLayout, j as TypeNameAuthority, D as XmlDiff, S as collectExpandableNodeIds, p as createDialogHost, e as createDocumentStore, I as createElkLayoutEngine, m as dialogHostKey, E as diffLines, w as highlightCode, h as provideDialogHost, i as useActiveDocument, t as useDialecteChannel, g as useDialog, a as useDocumentProgress, o as useDocumentState, n as useLiveData, M as useMergeSession, r as useProjectLiveData };
|
|
@@ -4,42 +4,42 @@ function n(e) {
|
|
|
4
4
|
return e.instances.flatMap((e) => e.groups);
|
|
5
5
|
}
|
|
6
6
|
function r(e) {
|
|
7
|
-
let { report: t
|
|
8
|
-
for (let e of n(t))
|
|
7
|
+
let { report: t } = e, r = /* @__PURE__ */ new Map();
|
|
8
|
+
for (let e of n(t)) r.set(e.primary, {
|
|
9
9
|
role: "primary",
|
|
10
10
|
groupId: e.id
|
|
11
11
|
});
|
|
12
|
-
let
|
|
13
|
-
function
|
|
14
|
-
let t =
|
|
12
|
+
let i = /* @__PURE__ */ new Map();
|
|
13
|
+
function a(e) {
|
|
14
|
+
let t = e.appliedRef?.id;
|
|
15
15
|
if (!t) return;
|
|
16
|
-
let n =
|
|
17
|
-
|
|
16
|
+
let n = r.get(e);
|
|
17
|
+
i.set(t, {
|
|
18
18
|
change: e.change,
|
|
19
19
|
role: n?.role ?? "plain",
|
|
20
20
|
groupId: n?.groupId,
|
|
21
21
|
node: e
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
for (let t of e.children)
|
|
24
|
+
function o(e) {
|
|
25
|
+
a(e);
|
|
26
|
+
for (let t of e.children) o(t);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function s(e, t) {
|
|
29
29
|
if (e.change !== "unchanged") {
|
|
30
|
-
let n =
|
|
31
|
-
n &&
|
|
30
|
+
let n = e.appliedRef?.id;
|
|
31
|
+
n && i.set(n, {
|
|
32
32
|
change: e.change,
|
|
33
33
|
role: "companion",
|
|
34
34
|
groupId: t,
|
|
35
35
|
node: e
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
for (let n of e.children)
|
|
38
|
+
for (let n of e.children) s(n, t);
|
|
39
39
|
}
|
|
40
|
-
for (let e of t.instances)
|
|
41
|
-
for (let e of n(t)) for (let t of e.companions)
|
|
42
|
-
return
|
|
40
|
+
for (let e of t.instances) o(e.tree);
|
|
41
|
+
for (let e of n(t)) for (let t of e.companions) s(t, e.id);
|
|
42
|
+
return i;
|
|
43
43
|
}
|
|
44
44
|
async function i(t) {
|
|
45
45
|
let { tree: n, changeByStagedId: r, query: i } = t, a = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/triangle-alert.js";
|
|
2
|
-
import { TEMPLATE_UUID_WARNING_INFO as t } from "../external/.pnpm/@dialecte_scl@0.3.
|
|
2
|
+
import { TEMPLATE_UUID_WARNING_INFO as t } from "../external/.pnpm/@dialecte_scl@0.3.17/node_modules/@dialecte/scl/dist/v2019C1/index.js";
|
|
3
3
|
import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, openBlock as l, renderList as u, toDisplayString as d, unref as f } from "vue";
|
|
4
4
|
//#region lib/merge/merge-preflight.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var p = { class: "flex h-full min-h-0 flex-col" }, m = { class: "min-h-0 flex-1 overflow-auto p-4" }, h = { class: "mx-auto max-w-2xl space-y-4" }, g = { class: "flex items-start gap-3" }, _ = { class: "border-b border-warning/25 px-3 py-2" }, v = { class: "flex items-center gap-2" }, y = { class: "badge badge-soft badge-warning badge-sm font-medium" }, b = { class: "font-semibold" }, x = { class: "mt-1 text-sm text-base-content/80" }, S = { class: "mt-1 text-sm" }, C = { class: "text-base-content/80" }, w = { class: "divide-y divide-warning/15" }, T = { class: "font-mono break-all" }, E = { class: "text-base-content/70" }, D = {
|
|
@@ -1,28 +1,24 @@
|
|
|
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.17/node_modules/@dialecte/scl/dist/hooks-BBGXNK0x.js";
|
|
2
|
+
import "../external/.pnpm/@dialecte_scl@0.3.17/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
|
-
|
|
22
|
-
});
|
|
23
|
-
}),
|
|
24
|
-
applied: o
|
|
25
|
-
};
|
|
8
|
+
return { prepared: await 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
|
+
}) };
|
|
26
22
|
}
|
|
27
23
|
async function r({ doc: e, target: t, report: n, decisions: r, keepNameTypesFrom: i, afterApply: a }) {
|
|
28
24
|
await e.transaction(async (e) => {
|
|
@@ -1,63 +1,62 @@
|
|
|
1
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
2
|
import { allGroups as l, buildChangeIndex as u, buildStructuralTree as d } from "./build-view-model.js";
|
|
3
|
-
import {
|
|
4
|
-
import { reactive as p, shallowRef as m } from "vue";
|
|
3
|
+
import { reactive as f, shallowRef as p } from "vue";
|
|
5
4
|
//#region lib/merge/use-merge-session.ts
|
|
6
|
-
function
|
|
7
|
-
let
|
|
5
|
+
function m(m) {
|
|
6
|
+
let h = p(), g = f(/* @__PURE__ */ new Map()), _ = p("target"), v = p(), y = p({
|
|
8
7
|
items: [],
|
|
9
8
|
meta: {},
|
|
10
9
|
index: {},
|
|
11
10
|
expanded: []
|
|
12
|
-
}),
|
|
13
|
-
function
|
|
11
|
+
}), b = p(), x = p(), S = p(!1), C = p([]);
|
|
12
|
+
function w() {
|
|
14
13
|
return {
|
|
15
|
-
verb:
|
|
16
|
-
scenario:
|
|
17
|
-
sourceQuery:
|
|
18
|
-
ref:
|
|
19
|
-
anchor:
|
|
14
|
+
verb: m.verb,
|
|
15
|
+
scenario: m.scenario,
|
|
16
|
+
sourceQuery: m.sourceQuery,
|
|
17
|
+
ref: m.sourceRef,
|
|
18
|
+
anchor: m.anchor
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function T(e) {
|
|
23
22
|
return e === void 0 ? "accept" : typeof e == "string" ? e : e.action;
|
|
24
23
|
}
|
|
25
|
-
function
|
|
24
|
+
function E(e) {
|
|
26
25
|
return typeof e == "object" ? e.values : void 0;
|
|
27
26
|
}
|
|
28
|
-
async function
|
|
29
|
-
let t = await o(
|
|
30
|
-
|
|
31
|
-
for (let e of l(t)) e.suggestedAction && e.suggestedAction !== "accept" &&
|
|
32
|
-
await
|
|
27
|
+
async function D() {
|
|
28
|
+
let t = await o(m.targetDocument, w());
|
|
29
|
+
h.value = t, C.value = await e([m.sourceQuery, m.targetDocument.query]);
|
|
30
|
+
for (let e of l(t)) e.suggestedAction && e.suggestedAction !== "accept" && g.set(e.id, e.suggestedAction);
|
|
31
|
+
await R();
|
|
33
32
|
}
|
|
34
|
-
function
|
|
35
|
-
let n =
|
|
36
|
-
|
|
33
|
+
function O(e, t) {
|
|
34
|
+
let n = E(g.get(e));
|
|
35
|
+
g.set(e, n ? {
|
|
37
36
|
action: t,
|
|
38
37
|
values: n
|
|
39
|
-
} : t),
|
|
38
|
+
} : t), L();
|
|
40
39
|
}
|
|
41
|
-
function
|
|
42
|
-
let r =
|
|
43
|
-
...
|
|
40
|
+
function k(e, t, n) {
|
|
41
|
+
let r = g.get(e), i = {
|
|
42
|
+
...E(r),
|
|
44
43
|
[t]: n
|
|
45
44
|
};
|
|
46
|
-
|
|
47
|
-
action:
|
|
45
|
+
g.set(e, {
|
|
46
|
+
action: T(r),
|
|
48
47
|
values: i
|
|
49
|
-
}),
|
|
48
|
+
}), L();
|
|
50
49
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
50
|
+
function A(e) {
|
|
51
|
+
return T(g.get(e));
|
|
53
52
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
53
|
+
function j(e, t) {
|
|
54
|
+
return E(g.get(e))?.[t];
|
|
56
55
|
}
|
|
57
|
-
function
|
|
56
|
+
function M() {
|
|
58
57
|
let e = /* @__PURE__ */ new Map();
|
|
59
|
-
for (let [t, n] of
|
|
60
|
-
let r =
|
|
58
|
+
for (let [t, n] of g) {
|
|
59
|
+
let r = E(n);
|
|
61
60
|
r && e.set(t, {
|
|
62
61
|
action: "accept",
|
|
63
62
|
values: r
|
|
@@ -65,58 +64,39 @@ function h(h) {
|
|
|
65
64
|
}
|
|
66
65
|
return e;
|
|
67
66
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
let F, I
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
async function
|
|
76
|
-
if (!
|
|
77
|
-
let e = ++
|
|
78
|
-
|
|
79
|
-
let t =
|
|
80
|
-
doc:
|
|
81
|
-
target:
|
|
82
|
-
report:
|
|
67
|
+
function N(e) {
|
|
68
|
+
v.value = e, B();
|
|
69
|
+
}
|
|
70
|
+
let P, F, I = 0;
|
|
71
|
+
function L() {
|
|
72
|
+
F && clearTimeout(F), F = setTimeout(() => void R(), 150);
|
|
73
|
+
}
|
|
74
|
+
async function R() {
|
|
75
|
+
if (!h.value) return;
|
|
76
|
+
let e = ++I;
|
|
77
|
+
S.value = !0;
|
|
78
|
+
let t = M(), { prepared: r } = await a({
|
|
79
|
+
doc: m.targetDocument,
|
|
80
|
+
target: w(),
|
|
81
|
+
report: h.value,
|
|
83
82
|
decisions: t,
|
|
84
|
-
keepNameTypesFrom:
|
|
85
|
-
afterApply:
|
|
83
|
+
keepNameTypesFrom: _.value,
|
|
84
|
+
afterApply: m.afterApply
|
|
86
85
|
});
|
|
87
|
-
if (e !==
|
|
88
|
-
|
|
86
|
+
if (e !== I) {
|
|
87
|
+
r.discard();
|
|
89
88
|
return;
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
n && S.set(t, n.id);
|
|
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
|
|
111
|
-
});
|
|
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) {
|
|
90
|
+
P?.discard(), P = r;
|
|
91
|
+
let o = i(m.verb), c = await n(P.query, m.anchor, o.rootTag), l = await s(P.query, c), f = u({ report: h.value });
|
|
92
|
+
y.value = await d({
|
|
93
|
+
tree: l,
|
|
94
|
+
changeByStagedId: f,
|
|
95
|
+
query: P.query,
|
|
96
|
+
instances: h.value.instances
|
|
97
|
+
}), v.value &&= z(v.value, y.value), S.value = !1, await B();
|
|
98
|
+
}
|
|
99
|
+
function z(e, t) {
|
|
120
100
|
let n = Object.values(t.index);
|
|
121
101
|
if (e.node) {
|
|
122
102
|
let t = n.find((t) => t.node === e.node);
|
|
@@ -128,57 +108,57 @@ function h(h) {
|
|
|
128
108
|
}
|
|
129
109
|
return (e.previewRef.id ? t.index[e.previewRef.id] : void 0) ?? e;
|
|
130
110
|
}
|
|
131
|
-
async function
|
|
132
|
-
let e =
|
|
133
|
-
if (!e || !
|
|
134
|
-
|
|
111
|
+
async function B() {
|
|
112
|
+
let e = v.value;
|
|
113
|
+
if (!e || !P) {
|
|
114
|
+
b.value = void 0, x.value = void 0;
|
|
135
115
|
return;
|
|
136
116
|
}
|
|
137
|
-
let t = e.change === "target-only" && !!e.groupId &&
|
|
138
|
-
|
|
117
|
+
let t = e.change === "target-only" && !!e.groupId && T(g.get(e.groupId)) === "accept";
|
|
118
|
+
b.value = t ? "" : await c(P.query, e.previewRef), x.value = e.change === "added" ? "" : await H(e.previewRef);
|
|
139
119
|
}
|
|
140
|
-
async function
|
|
141
|
-
return
|
|
120
|
+
async function V(e) {
|
|
121
|
+
return P ? r(P.query, e) : {};
|
|
142
122
|
}
|
|
143
|
-
async function
|
|
123
|
+
async function H(e) {
|
|
144
124
|
try {
|
|
145
|
-
return await c(
|
|
125
|
+
return await c(m.targetDocument.query, e);
|
|
146
126
|
} catch {
|
|
147
127
|
return;
|
|
148
128
|
}
|
|
149
129
|
}
|
|
150
|
-
async function
|
|
151
|
-
|
|
152
|
-
doc:
|
|
153
|
-
target:
|
|
154
|
-
report:
|
|
155
|
-
decisions: new Map(
|
|
156
|
-
keepNameTypesFrom:
|
|
157
|
-
afterApply:
|
|
130
|
+
async function U() {
|
|
131
|
+
h.value && (P?.discard(), P = void 0, await t({
|
|
132
|
+
doc: m.targetDocument,
|
|
133
|
+
target: w(),
|
|
134
|
+
report: h.value,
|
|
135
|
+
decisions: new Map(g),
|
|
136
|
+
keepNameTypesFrom: _.value,
|
|
137
|
+
afterApply: m.afterApply
|
|
158
138
|
}));
|
|
159
139
|
}
|
|
160
|
-
function
|
|
161
|
-
|
|
140
|
+
function W(e) {
|
|
141
|
+
_.value = e, L();
|
|
162
142
|
}
|
|
163
143
|
return {
|
|
164
|
-
report:
|
|
165
|
-
decisions:
|
|
166
|
-
keepNameTypesFrom:
|
|
167
|
-
structuralTree:
|
|
168
|
-
previewXml:
|
|
169
|
-
previewBeforeXml:
|
|
170
|
-
previewLoading:
|
|
171
|
-
warnings:
|
|
172
|
-
load:
|
|
173
|
-
setDecision:
|
|
174
|
-
setValue:
|
|
175
|
-
decisionOf:
|
|
176
|
-
editedValue:
|
|
177
|
-
select:
|
|
178
|
-
stagedAttributes:
|
|
179
|
-
setKeepNameTypesFrom:
|
|
180
|
-
commit:
|
|
144
|
+
report: h,
|
|
145
|
+
decisions: g,
|
|
146
|
+
keepNameTypesFrom: _,
|
|
147
|
+
structuralTree: y,
|
|
148
|
+
previewXml: b,
|
|
149
|
+
previewBeforeXml: x,
|
|
150
|
+
previewLoading: S,
|
|
151
|
+
warnings: C,
|
|
152
|
+
load: D,
|
|
153
|
+
setDecision: O,
|
|
154
|
+
setValue: k,
|
|
155
|
+
decisionOf: A,
|
|
156
|
+
editedValue: j,
|
|
157
|
+
select: N,
|
|
158
|
+
stagedAttributes: V,
|
|
159
|
+
setKeepNameTypesFrom: W,
|
|
160
|
+
commit: U
|
|
181
161
|
};
|
|
182
162
|
}
|
|
183
163
|
//#endregion
|
|
184
|
-
export {
|
|
164
|
+
export { m as useMergeSession };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@septkit/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"source": "lib/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -16,12 +16,13 @@
|
|
|
16
16
|
"./uicss": "./dist/ui.css"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@dialecte/core": "0.4.
|
|
20
|
-
"@dialecte/scl": "0.3.
|
|
19
|
+
"@dialecte/core": "0.4.16",
|
|
20
|
+
"@dialecte/scl": "0.3.17",
|
|
21
21
|
"@lucide/vue": "^1.16.0",
|
|
22
22
|
"@tailwindcss/vite": "4.2.2",
|
|
23
23
|
"@vueuse/components": "^13.9.0",
|
|
24
24
|
"@vueuse/core": "^14.2.1",
|
|
25
|
+
"elkjs": "^0.10.2",
|
|
25
26
|
"pinia": "^3.0.4",
|
|
26
27
|
"reka-ui": "^2.9.6",
|
|
27
28
|
"shiki": "^3.0.0",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//#region lib/merge/merge-correlate.ts
|
|
2
|
-
function e(e) {
|
|
3
|
-
let { report: i, snapshot: a, appliedRoots: o, companionAnchors: s } = e, c = r(a), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set();
|
|
4
|
-
i.instances.forEach((e, n) => {
|
|
5
|
-
let r = e.rootRef?.id ?? o[n]?.id, i = r ? c.get(r) : void 0;
|
|
6
|
-
i && t(e.tree, i, l, u);
|
|
7
|
-
});
|
|
8
|
-
for (let e of i.instances) for (let r of e.groups) for (let e of r.companions) {
|
|
9
|
-
if (l.has(e)) continue;
|
|
10
|
-
let r = s?.get(e) ?? e.instanceRef?.id, i = r ? c.get(r) : n(a, e.tagName, u);
|
|
11
|
-
i && t(e, i, l, u);
|
|
12
|
-
}
|
|
13
|
-
return l;
|
|
14
|
-
}
|
|
15
|
-
function t(e, n, r, i) {
|
|
16
|
-
r.set(e, n.id), i.add(n.id);
|
|
17
|
-
let a = n.tree ?? [], o = /* @__PURE__ */ new Map();
|
|
18
|
-
for (let t of e.children) {
|
|
19
|
-
let e = t.instanceRef?.id;
|
|
20
|
-
if (!e) continue;
|
|
21
|
-
let n = a.find((t) => t.id === e && !i.has(t.id));
|
|
22
|
-
n && (o.set(t, n), i.add(n.id));
|
|
23
|
-
}
|
|
24
|
-
for (let t of e.children) {
|
|
25
|
-
if (o.has(t) || t.instanceRef || t.change === "removed") continue;
|
|
26
|
-
let e = a.find((e) => e.tagName === t.tagName && !i.has(e.id));
|
|
27
|
-
e && (o.set(t, e), i.add(e.id));
|
|
28
|
-
}
|
|
29
|
-
for (let [e, n] of o) t(e, n, r, i);
|
|
30
|
-
}
|
|
31
|
-
function n(e, t, r) {
|
|
32
|
-
if (e.tagName === t && !r.has(e.id)) return e;
|
|
33
|
-
for (let i of e.tree ?? []) {
|
|
34
|
-
let e = n(i, t, r);
|
|
35
|
-
if (e) return e;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function r(e) {
|
|
39
|
-
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
40
|
-
t.set(e.id, e);
|
|
41
|
-
for (let t of e.tree ?? []) n(t);
|
|
42
|
-
};
|
|
43
|
-
return n(e), t;
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
export { e as correlate };
|