@septkit/ui 0.0.67 → 0.0.69
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/button/button.vue_vue_type_script_setup_true_lang.js +20 -17
- package/dist/code/code-block.js +1 -1
- package/dist/code/code-block.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/diagram-layout/diagram-node-card.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/diagram-layout/diagram-node-group.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/dialecte/create-document-store.js +4 -3
- package/dist/dialog/dialog-host.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/dialog/dialog.vue_vue_type_script_setup_true_lang.js +44 -35
- package/dist/dialog/use-dialog-host.js +12 -2
- package/dist/dropdown/combobox-options.js +17 -0
- package/dist/dropdown/combobox.vue_vue_type_script_setup_true_lang.js +155 -65
- package/dist/explorer/explorer.js +1 -1
- package/dist/explorer/explorer.vue_vue_type_script_setup_true_lang.js +52 -48
- package/dist/external/.pnpm/@dialecte_core@0.6.1/node_modules/@dialecte/core/dist/helpers.js +229 -0
- package/dist/external/.pnpm/@dialecte_core@0.6.1/node_modules/@dialecte/core/dist/index.js +3 -0
- package/dist/external/.pnpm/{@dialecte_core@0.5.2/node_modules/@dialecte/core/dist/project-Bd3fSPam.js → @dialecte_core@0.6.1/node_modules/@dialecte/core/dist/project-sK-5Xc-5.js} +1391 -1248
- package/dist/external/.pnpm/@dialecte_core@0.6.1/node_modules/@dialecte/core/dist/utils-CTBHUFs9.js +440 -0
- package/dist/external/.pnpm/@dialecte_core@0.6.1/node_modules/@dialecte/core/dist/utils.js +2 -0
- package/dist/external/.pnpm/@dialecte_scl@0.8.1/node_modules/@dialecte/scl/dist/hooks-C05NpRNi.js +44305 -0
- package/dist/external/.pnpm/@dialecte_scl@0.8.1/node_modules/@dialecte/scl/dist/v2019C1/index.js +22 -0
- package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +117 -59
- package/dist/external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js +60 -57
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxGroup.js +39 -3
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Combobox/ComboboxLabel.js +38 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogDescription.js +30 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Listbox/ListboxGroup.js +27 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperTrigger.js +97 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useArrowNavigation.js +31 -0
- package/dist/icons/element-badge.js +5 -0
- package/dist/icons/element-badge.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/icons/index.js +4 -0
- package/dist/index.d.ts +1880 -81
- package/dist/index.js +36 -33
- package/dist/merge/{merge-preflight.js → check-files/components/merge-preflight.js} +1 -1
- package/dist/merge/check-files/components/merge-preflight.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/merge/check-files/flags.js +17 -0
- package/dist/merge/check-files/identity-warning.js +18 -0
- package/dist/merge/{merge-summary.js → confirm/components/merge-summary.js} +1 -1
- package/dist/merge/confirm/components/merge-summary.vue_vue_type_script_setup_true_lang.js +207 -0
- package/dist/merge/confirm/landings.js +34 -0
- package/dist/merge/confirm/outcome.js +178 -0
- package/dist/merge/confirm/summary.js +57 -0
- package/dist/merge/done/applied-counts.js +16 -0
- package/dist/merge/done/applied-focus.js +15 -0
- package/dist/merge/help.js +76 -0
- package/dist/merge/index.js +8 -7
- package/dist/merge/match/components/merge-map.js +5 -0
- package/dist/merge/match/components/merge-map.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/merge/match/match.js +211 -0
- package/dist/merge/review/affix.js +14 -0
- package/dist/merge/review/change-badge.js +10 -0
- package/dist/merge/{decision-toggle.js → review/components/decision-toggle.js} +1 -1
- package/dist/merge/review/components/decision-toggle.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/merge/{element-detail.js → review/components/element-detail.js} +1 -1
- package/dist/merge/review/components/element-detail.vue_vue_type_script_setup_true_lang.js +210 -0
- package/dist/merge/{merge-tree.js → review/components/merge-tree.js} +1 -1
- package/dist/merge/review/components/merge-tree.vue_vue_type_script_setup_true_lang.js +192 -0
- package/dist/merge/{type-name-authority.js → review/components/type-name-authority.js} +1 -1
- package/dist/merge/{type-name-authority.vue_vue_type_script_setup_true_lang.js → review/components/type-name-authority.vue_vue_type_script_setup_true_lang.js} +7 -6
- package/dist/merge/review/decision.js +12 -0
- package/dist/merge/review/detail.js +63 -0
- package/dist/merge/{merge-highlight.js → review/highlight.js} +2 -2
- package/dist/merge/review/marks.js +17 -0
- package/dist/merge/review/navigation.js +82 -0
- package/dist/merge/review/title.js +7 -0
- package/dist/merge/review/tree.js +138 -0
- package/dist/merge/session/components/merge-help.js +7 -0
- package/dist/merge/session/components/merge-help.vue_vue_type_script_setup_true_lang.js +109 -0
- package/dist/merge/{merge-progress.js → session/components/merge-progress.js} +1 -1
- package/dist/merge/{merge-progress.vue_vue_type_script_setup_true_lang.js → session/components/merge-progress.vue_vue_type_script_setup_true_lang.js} +1 -1
- package/dist/merge/{merge-review.js → session/components/merge-review.js} +1 -1
- package/dist/merge/session/components/merge-review.vue_vue_type_script_setup_true_lang.js +894 -0
- package/dist/merge/session/merge.service.js +107 -0
- package/dist/merge/session/shortcuts.js +22 -0
- package/dist/merge/session/staged-writes.js +47 -0
- package/dist/merge/session/steps.js +21 -0
- package/dist/merge/{use-document-progress.js → session/use-document-progress.js} +1 -1
- package/dist/merge/session/use-merge-session.js +360 -0
- package/dist/merge/wording.js +124 -0
- package/dist/ui.css +1 -1
- package/package.json +3 -3
- package/dist/external/.pnpm/@dialecte_core@0.5.2/node_modules/@dialecte/core/dist/helpers.js +0 -142
- package/dist/external/.pnpm/@dialecte_core@0.5.2/node_modules/@dialecte/core/dist/index.js +0 -3
- package/dist/external/.pnpm/@dialecte_core@0.5.2/node_modules/@dialecte/core/dist/utils-ERge2irW.js +0 -254
- package/dist/external/.pnpm/@dialecte_scl@0.5.0/node_modules/@dialecte/scl/dist/hooks-2Y_WzKF4.js +0 -33971
- package/dist/external/.pnpm/@dialecte_scl@0.5.0/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -22
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/eye-off.js +0 -22
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/eye.js +0 -13
- package/dist/merge/affix.js +0 -14
- package/dist/merge/build-view-model.js +0 -215
- package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +0 -40
- package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +0 -185
- package/dist/merge/merge-decision.js +0 -6
- package/dist/merge/merge-preflight.vue_vue_type_script_setup_true_lang.js +0 -41
- package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +0 -409
- package/dist/merge/merge-summary.vue_vue_type_script_setup_true_lang.js +0 -98
- package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +0 -112
- package/dist/merge/merge.service.js +0 -80
- package/dist/merge/use-merge-session.js +0 -164
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { allGroups as e } from "../review/tree.js";
|
|
2
|
+
import { titleOf as t } from "../review/title.js";
|
|
3
|
+
//#region lib/merge/confirm/summary.ts
|
|
4
|
+
async function n(n, r, i, a, o) {
|
|
5
|
+
let s = {
|
|
6
|
+
added: o.added,
|
|
7
|
+
updated: o.updated,
|
|
8
|
+
skipped: [],
|
|
9
|
+
preserved: [],
|
|
10
|
+
removed: [],
|
|
11
|
+
renamed: o.renamed,
|
|
12
|
+
dropped: [],
|
|
13
|
+
landsIn: [],
|
|
14
|
+
shared: [],
|
|
15
|
+
instances: n.templateInstances.length
|
|
16
|
+
};
|
|
17
|
+
for (let o of e(n)) {
|
|
18
|
+
let e = await t(o.primary, a), n = o.primary.tagName;
|
|
19
|
+
if (o.primary.change === "target-only") {
|
|
20
|
+
r(o.id) === "skip" ? s.preserved.push({
|
|
21
|
+
title: e,
|
|
22
|
+
tag: n
|
|
23
|
+
}) : s.removed.push({
|
|
24
|
+
title: e,
|
|
25
|
+
tag: n
|
|
26
|
+
});
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (r(o.id) === "skip") {
|
|
30
|
+
s.skipped.push({
|
|
31
|
+
title: e,
|
|
32
|
+
tag: n
|
|
33
|
+
});
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (o.primary.change === "removed") {
|
|
37
|
+
let t = i(o.id, "name") ?? e;
|
|
38
|
+
s.dropped.push({
|
|
39
|
+
title: t,
|
|
40
|
+
tag: n
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return s;
|
|
45
|
+
}
|
|
46
|
+
function r(e) {
|
|
47
|
+
return e.added.length + e.updated.length + e.removed.length + e.dropped.length;
|
|
48
|
+
}
|
|
49
|
+
function i(e) {
|
|
50
|
+
return r(e) === 0;
|
|
51
|
+
}
|
|
52
|
+
function a(e) {
|
|
53
|
+
let t = r(e);
|
|
54
|
+
return t === 0 ? "Apply" : `Apply ${t} ${t === 1 ? "change" : "changes"}`;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { a as applyLabel, n as buildSummary, r as countChanges, i as writesNothing };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region lib/merge/done/applied-counts.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let { added: t, updated: n, removed: r, dropped: i, skipped: a } = e;
|
|
4
|
+
return [
|
|
5
|
+
[t.length, "added"],
|
|
6
|
+
[n.length, "updated"],
|
|
7
|
+
[r.length + i.length, "removed"],
|
|
8
|
+
[a.length, "left out"]
|
|
9
|
+
].filter(([e]) => e !== 0).map(([e, t]) => `${e} ${t}`).join(" · ");
|
|
10
|
+
}
|
|
11
|
+
function t(e) {
|
|
12
|
+
let { scenario: t, instances: n } = e;
|
|
13
|
+
return t === "instantiate" ? "The template is placed in the project." : n > 1 ? `The ${n} instances are updated.` : "The instance is updated.";
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as describeAppliedCounts, t as describeDone };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region lib/merge/done/applied-focus.ts
|
|
2
|
+
function e(e, n) {
|
|
3
|
+
let { instances: r } = e;
|
|
4
|
+
if (r.verb === "fsd") return r.functions[0];
|
|
5
|
+
if (!(r.verb === "asd" && !r.applications[0])) return r.verb === "ssd" ? t(e) : t(e) ?? n.anchor;
|
|
6
|
+
}
|
|
7
|
+
function t(e) {
|
|
8
|
+
let t = e.report.mappings.filter((e) => e.kind === "level" && e.appliedRef?.id).at(-1)?.appliedRef;
|
|
9
|
+
return t ? {
|
|
10
|
+
tagName: t.tagName,
|
|
11
|
+
id: t.id
|
|
12
|
+
} : void 0;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as findAppliedFocus };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//#region lib/merge/help.ts
|
|
2
|
+
var e = {
|
|
3
|
+
preflight: {
|
|
4
|
+
decide: ["Nothing here: this step says what the files hold before the merge reads them."],
|
|
5
|
+
effect: [],
|
|
6
|
+
rules: ["The merge recognises a template's elements by their identity (uuid, templateUuid). When an identity is broken, it can take one element for another.", "Every element a warning concerns stays marked in the review, and the warning chip in the header brings you back here."]
|
|
7
|
+
},
|
|
8
|
+
map: {
|
|
9
|
+
decide: [{
|
|
10
|
+
text: "Where each level of the template goes, when the project offers several.",
|
|
11
|
+
when: "levels"
|
|
12
|
+
}, {
|
|
13
|
+
text: "For each shared element (an allocation role, a function category): reuse one of the project, or create a new one, and its name.",
|
|
14
|
+
when: "shared"
|
|
15
|
+
}],
|
|
16
|
+
effect: [{
|
|
17
|
+
text: "Reused: the element of the project keeps its own name and attributes and only gains what the template brings.",
|
|
18
|
+
when: "shared"
|
|
19
|
+
}, {
|
|
20
|
+
text: "New: the element is created for the template, under the name you type or a free one.",
|
|
21
|
+
when: "shared"
|
|
22
|
+
}],
|
|
23
|
+
rules: [
|
|
24
|
+
{
|
|
25
|
+
text: "One element of that name where it lands: reused. Several: you choose. None: created.",
|
|
26
|
+
when: "shared"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
text: "A level follows from the one above it: changing a level gives up the choices made below it.",
|
|
30
|
+
when: "levels"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
text: "On an update, what an instance already uses stays as it is.",
|
|
34
|
+
when: "update"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
review: {
|
|
39
|
+
decide: [{
|
|
40
|
+
text: "What you added to an instance stays unless you remove it.",
|
|
41
|
+
when: "yours"
|
|
42
|
+
}, {
|
|
43
|
+
text: "The values the template lets you edit, such as a name.",
|
|
44
|
+
when: "editable"
|
|
45
|
+
}],
|
|
46
|
+
effect: [{
|
|
47
|
+
text: "Leaving out an element leaves out what depends on it, and the review says so.",
|
|
48
|
+
when: "leaveOut"
|
|
49
|
+
}, "The XML shows what Apply writes for the element selected."],
|
|
50
|
+
rules: [{
|
|
51
|
+
text: "A name already taken where an element lands is numbered by the merge (HMI_PC_1).",
|
|
52
|
+
when: "renamed"
|
|
53
|
+
}, {
|
|
54
|
+
text: "A value you type has the last word over the template's.",
|
|
55
|
+
when: "editable"
|
|
56
|
+
}]
|
|
57
|
+
},
|
|
58
|
+
confirm: {
|
|
59
|
+
decide: ["Nothing new: check what Apply writes, then apply, or go back to the review.", {
|
|
60
|
+
text: "Where it lands can still be changed: Change goes back to Match.",
|
|
61
|
+
when: "landings"
|
|
62
|
+
}],
|
|
63
|
+
effect: [],
|
|
64
|
+
rules: ["The list comes from a run of the merge with your decisions: it is what Apply writes."]
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function t(t, n) {
|
|
68
|
+
let r = (e) => e.flatMap((e) => typeof e == "string" ? [e] : !n || n[e.when] ? [e.text] : []), i = e[t];
|
|
69
|
+
return {
|
|
70
|
+
decide: r(i.decide),
|
|
71
|
+
effect: r(i.effect),
|
|
72
|
+
rules: r(i.rules)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { t as helpFor };
|
package/dist/merge/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import e from "./decision-toggle.js";
|
|
2
|
-
import t from "./element-detail.js";
|
|
3
|
-
import n from "./merge-
|
|
4
|
-
import r from "./
|
|
5
|
-
import
|
|
6
|
-
import a from "./merge-
|
|
7
|
-
|
|
1
|
+
import e from "./review/components/decision-toggle.js";
|
|
2
|
+
import t from "./review/components/element-detail.js";
|
|
3
|
+
import n from "./match/components/merge-map.js";
|
|
4
|
+
import r from "./review/components/merge-tree.js";
|
|
5
|
+
import i from "./review/components/type-name-authority.js";
|
|
6
|
+
import { useMergeSession as a } from "./session/use-merge-session.js";
|
|
7
|
+
import o from "./session/components/merge-review.js";
|
|
8
|
+
export { e as DecisionToggle, t as ElementDetail, n as MergeMap, o as MergeReview, r as MergeTree, i as TypeNameAuthority, a as useMergeSession };
|
|
@@ -0,0 +1,230 @@
|
|
|
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/arrow-right.js";
|
|
2
|
+
import t from "../../../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/info.js";
|
|
3
|
+
import n from "../../../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/map-pin.js";
|
|
4
|
+
import r 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";
|
|
5
|
+
import ee from "../../../dropdown/combobox.js";
|
|
6
|
+
import "../../../dropdown/index.js";
|
|
7
|
+
import i from "../../../icons/element-badge.js";
|
|
8
|
+
import "../../../icons/index.js";
|
|
9
|
+
import { arrangeTargets as a, describeTarget as o, needsChoice as s } from "../match.js";
|
|
10
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, normalizeClass as te, openBlock as _, renderList as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
|
|
11
|
+
//#region lib/merge/match/components/merge-map.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
+
var ne = { class: "flex h-full min-h-0 flex-col" }, re = { class: "min-h-0 flex-1 overflow-auto p-4" }, ie = { class: "mx-auto max-w-3xl space-y-5" }, ae = {
|
|
13
|
+
"data-testid": "map-intro",
|
|
14
|
+
class: "mt-0.5 max-w-prose text-sm text-base-content/80"
|
|
15
|
+
}, oe = {
|
|
16
|
+
key: 0,
|
|
17
|
+
"data-testid": "map-notice",
|
|
18
|
+
class: "flex items-start gap-2 rounded-box border border-info/40 bg-info/5 px-3 py-2 text-sm"
|
|
19
|
+
}, se = { class: "flex items-center gap-2 text-sm font-semibold" }, ce = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "inline-flex items-center justify-center rounded-full bg-base-300 p-1",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, le = {
|
|
24
|
+
"data-testid": "map-group-count",
|
|
25
|
+
class: "font-normal text-base-content/80"
|
|
26
|
+
}, S = { class: "divide-y divide-base-300 rounded-box border border-base-300" }, C = ["data-testid"], w = { class: "flex flex-wrap items-center gap-2" }, T = { class: "flex min-w-32 items-center gap-1.5 font-medium" }, E = {
|
|
27
|
+
key: 1,
|
|
28
|
+
"data-testid": "map-row-for",
|
|
29
|
+
class: "text-xs font-normal text-base-content/80"
|
|
30
|
+
}, D = {
|
|
31
|
+
key: 0,
|
|
32
|
+
"data-testid": "map-new-badge",
|
|
33
|
+
class: "badge badge-soft badge-success badge-sm shrink-0"
|
|
34
|
+
}, O = { class: "min-w-56 flex-1" }, k = { class: "flex min-w-0 flex-col gap-0.5" }, A = { class: "truncate font-medium" }, j = { class: "truncate opacity-90" }, M = {
|
|
35
|
+
key: 1,
|
|
36
|
+
"data-testid": "map-created-under",
|
|
37
|
+
class: "text-xs text-base-content/80"
|
|
38
|
+
}, N = ["onClick"], P = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "mt-1.5 flex items-center gap-1.5 text-xs text-base-content/80"
|
|
41
|
+
}, F = ["id"], I = {
|
|
42
|
+
key: 1,
|
|
43
|
+
"data-testid": "map-row-note",
|
|
44
|
+
class: "mt-1.5 flex items-center gap-1.5 text-xs text-base-content/80"
|
|
45
|
+
}, L = {
|
|
46
|
+
key: 2,
|
|
47
|
+
"data-testid": "map-taken-name",
|
|
48
|
+
class: "mt-1.5 flex flex-wrap items-center gap-2 text-xs"
|
|
49
|
+
}, R = ["id"], z = ["onClick"], B = {
|
|
50
|
+
key: 1,
|
|
51
|
+
"data-testid": "map-automatic",
|
|
52
|
+
class: "rounded-box border border-base-300"
|
|
53
|
+
}, ue = { class: "cursor-pointer px-3 py-2 text-sm font-medium" }, V = { class: "space-y-3 border-t border-base-300 px-3 py-2" }, H = { class: "text-xs font-semibold text-base-content/80" }, U = { class: "mt-1 space-y-1" }, de = ["data-testid"], fe = { class: "font-medium" }, pe = { class: "text-xs text-base-content/80" }, W = "__new__", me = 100, G = /*@__PURE__*/ g({
|
|
54
|
+
__name: "merge-map",
|
|
55
|
+
props: {
|
|
56
|
+
view: {},
|
|
57
|
+
notice: {}
|
|
58
|
+
},
|
|
59
|
+
emits: ["map"],
|
|
60
|
+
setup(g, { emit: G }) {
|
|
61
|
+
let K = g, q = G, he = [
|
|
62
|
+
"",
|
|
63
|
+
"pl-8",
|
|
64
|
+
"pl-14"
|
|
65
|
+
], ge = l(() => {
|
|
66
|
+
let e = [...K.view.changeable, ...K.view.automatic].map((e) => e.tag), t = [];
|
|
67
|
+
return e.includes("Placement") && t.push("Choose where each level of the template goes. A level follows from the one above it."), e.some((e) => e !== "Placement") && t.push("Roles and categories are shared across the project: reuse one the project already has, or create a new one."), t.join(" ");
|
|
68
|
+
}), J = l(() => K.view.automatic.reduce((e, t) => e + t.rows.length, 0));
|
|
69
|
+
function _e(e) {
|
|
70
|
+
return e.target.kind === "existing" ? {
|
|
71
|
+
id: e.target.id,
|
|
72
|
+
title: e.target.title,
|
|
73
|
+
path: e.target.path
|
|
74
|
+
} : e.target.kind === "create" ? {
|
|
75
|
+
id: W,
|
|
76
|
+
title: e.target.name,
|
|
77
|
+
path: e.target.parentPath ?? ""
|
|
78
|
+
} : null;
|
|
79
|
+
}
|
|
80
|
+
function Y(e) {
|
|
81
|
+
return e;
|
|
82
|
+
}
|
|
83
|
+
function ve(e) {
|
|
84
|
+
let t = Y(e);
|
|
85
|
+
return t.id === W ? t.title : t.path || t.title;
|
|
86
|
+
}
|
|
87
|
+
function ye(e) {
|
|
88
|
+
let t = Y(e);
|
|
89
|
+
return `${t.title} ${t.path}`;
|
|
90
|
+
}
|
|
91
|
+
function X(e, t) {
|
|
92
|
+
if (!(!t || t.includes("/"))) return e.candidates.some((e) => e.title === t) ? void 0 : t;
|
|
93
|
+
}
|
|
94
|
+
function Z(e) {
|
|
95
|
+
let t = e.target.kind === "create" && e.target.parentPath ? ` in ${e.target.parentPath}` : "";
|
|
96
|
+
return (n) => {
|
|
97
|
+
let r = X(e, n);
|
|
98
|
+
return `${r ? `Create “${r}”` : "Create new"}${t}`;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function Q(e) {
|
|
102
|
+
return e.target.kind === "undecided" && !e.ambiguous;
|
|
103
|
+
}
|
|
104
|
+
function be(e, t) {
|
|
105
|
+
let n = t ? Y(t) : void 0;
|
|
106
|
+
!n || n.id === W || q("map", e.id, { existing: {
|
|
107
|
+
tagName: e.tag,
|
|
108
|
+
id: n.id
|
|
109
|
+
} });
|
|
110
|
+
}
|
|
111
|
+
function xe(e, t) {
|
|
112
|
+
let n = X(e, t);
|
|
113
|
+
q("map", e.id, { create: n ? { name: n } : {} });
|
|
114
|
+
}
|
|
115
|
+
function $(e) {
|
|
116
|
+
return e.target.kind === "create" && !!e.written && e.written.name !== e.target.name;
|
|
117
|
+
}
|
|
118
|
+
function Se(e) {
|
|
119
|
+
let t = e.rows.filter(s).length;
|
|
120
|
+
return t ? `${e.rows.length} · ${t} to choose` : `${e.rows.length}`;
|
|
121
|
+
}
|
|
122
|
+
function Ce(e) {
|
|
123
|
+
e.existingNamedAlike && q("map", e.id, { existing: {
|
|
124
|
+
tagName: e.tag,
|
|
125
|
+
id: e.existingNamedAlike.id
|
|
126
|
+
} });
|
|
127
|
+
}
|
|
128
|
+
return (l, W) => (_(), f("div", ne, [p("div", re, [p("div", ie, [
|
|
129
|
+
p("div", null, [W[0] ||= p("h2", { class: "text-base font-semibold" }, "Match with your project", -1), p("p", ae, y(ge.value), 1)]),
|
|
130
|
+
g.notice ? (_(), f("p", oe, [h(b(t), { class: "mt-0.5 size-4 shrink-0 text-info" }), p("span", null, y(g.notice), 1)])) : d("", !0),
|
|
131
|
+
(_(!0), f(c, null, v(g.view.changeable, (o) => (_(), f("section", {
|
|
132
|
+
key: o.tag,
|
|
133
|
+
class: "space-y-2"
|
|
134
|
+
}, [p("h3", se, [
|
|
135
|
+
o.tag === b("Placement") ? (_(), f("span", ce, [h(b(n), { class: "size-3.5" })])) : (_(), u(b(i), {
|
|
136
|
+
key: 1,
|
|
137
|
+
"tag-name": o.tag,
|
|
138
|
+
size: "sm"
|
|
139
|
+
}, null, 8, ["tag-name"])),
|
|
140
|
+
m(" " + y(o.label) + " ", 1),
|
|
141
|
+
p("span", le, y(Se(o)), 1)
|
|
142
|
+
]), p("div", S, [(_(!0), f(c, null, v(o.rows, (n, c) => (_(), f("div", {
|
|
143
|
+
key: n.id,
|
|
144
|
+
"data-testid": `map-row-${n.id}`,
|
|
145
|
+
class: te(["p-3", [{ "bg-warning/5": n.ambiguous }, o.tag === b("Placement") ? he[c] : ""]])
|
|
146
|
+
}, [
|
|
147
|
+
p("div", w, [
|
|
148
|
+
p("span", T, [
|
|
149
|
+
o.tag === b("Placement") ? (_(), u(b(i), {
|
|
150
|
+
key: 0,
|
|
151
|
+
"tag-name": n.tag,
|
|
152
|
+
size: "sm"
|
|
153
|
+
}, null, 8, ["tag-name"])) : d("", !0),
|
|
154
|
+
m(" " + y(n.title) + " ", 1),
|
|
155
|
+
n.decidedFor ? (_(), f("span", E, " for " + y(n.decidedFor), 1)) : d("", !0)
|
|
156
|
+
]),
|
|
157
|
+
h(b(e), { class: "size-4 shrink-0 text-base-content/60" }),
|
|
158
|
+
n.target.kind === "create" ? (_(), f("span", D, " new ")) : d("", !0),
|
|
159
|
+
p("div", O, [h(b(ee), {
|
|
160
|
+
"model-value": _e(n),
|
|
161
|
+
options: b(a)(n).options,
|
|
162
|
+
"display-value": ve,
|
|
163
|
+
"get-key": (e) => Y(e).id,
|
|
164
|
+
"search-text": ye,
|
|
165
|
+
"group-of": (e) => b(a)(n).groupOf(Y(e)),
|
|
166
|
+
limit: me,
|
|
167
|
+
"action-label": Z(n),
|
|
168
|
+
placeholder: "Choose…",
|
|
169
|
+
"empty-text": void 0,
|
|
170
|
+
size: "sm",
|
|
171
|
+
color: b(s)(n) && !Q(n) ? "warning" : "neutral",
|
|
172
|
+
disabled: Q(n),
|
|
173
|
+
"aria-label": `Where ${n.title} lands`,
|
|
174
|
+
"aria-describedby": `map-hint-${n.id}`,
|
|
175
|
+
"onUpdate:modelValue": (e) => be(n, e),
|
|
176
|
+
onAction: (e) => xe(n, e)
|
|
177
|
+
}, {
|
|
178
|
+
default: x(({ item: e }) => [p("span", k, [p("span", A, y(Y(e).title), 1), p("span", j, y(Y(e).path), 1)])]),
|
|
179
|
+
_: 1
|
|
180
|
+
}, 8, [
|
|
181
|
+
"model-value",
|
|
182
|
+
"options",
|
|
183
|
+
"get-key",
|
|
184
|
+
"group-of",
|
|
185
|
+
"action-label",
|
|
186
|
+
"color",
|
|
187
|
+
"disabled",
|
|
188
|
+
"aria-label",
|
|
189
|
+
"aria-describedby",
|
|
190
|
+
"onUpdate:modelValue",
|
|
191
|
+
"onAction"
|
|
192
|
+
])]),
|
|
193
|
+
n.target.kind === "create" && n.target.parentPath ? (_(), f("span", M, " in " + y(n.target.parentPath), 1)) : d("", !0),
|
|
194
|
+
n.chosen ? (_(), f("button", {
|
|
195
|
+
key: 2,
|
|
196
|
+
"data-testid": "map-undo",
|
|
197
|
+
type: "button",
|
|
198
|
+
class: "btn btn-ghost btn-sm",
|
|
199
|
+
title: "Undo your choice: the merge decides where it lands again",
|
|
200
|
+
onClick: (e) => q("map", n.id, void 0)
|
|
201
|
+
}, " Undo choice ", 8, N)) : d("", !0)
|
|
202
|
+
]),
|
|
203
|
+
$(n) ? d("", !0) : (_(), f("p", P, [n.ambiguous ? (_(), u(b(r), {
|
|
204
|
+
key: 0,
|
|
205
|
+
class: "size-3.5 shrink-0 text-warning"
|
|
206
|
+
})) : d("", !0), p("span", { id: `map-hint-${n.id}` }, y(n.hint), 9, F)])),
|
|
207
|
+
n.note ? (_(), f("p", I, [h(b(t), { class: "size-3.5 shrink-0" }), m(y(n.note), 1)])) : d("", !0),
|
|
208
|
+
n.target.kind === "create" && n.written && $(n) ? (_(), f("p", L, [p("span", { id: `map-hint-${n.id}` }, " “" + y(n.target.name) + "” is already used here, so the new element is named “" + y(n.written.name) + "”. ", 9, R), n.existingNamedAlike ? (_(), f("button", {
|
|
209
|
+
key: 0,
|
|
210
|
+
"data-testid": "map-reuse-taken",
|
|
211
|
+
type: "button",
|
|
212
|
+
class: "btn btn-outline btn-sm",
|
|
213
|
+
onClick: (e) => Ce(n)
|
|
214
|
+
}, " Use " + y(n.existingNamedAlike.path || n.existingNamedAlike.title) + " instead ", 9, z)) : d("", !0)])) : d("", !0)
|
|
215
|
+
], 10, C))), 128))])]))), 128)),
|
|
216
|
+
J.value > 0 ? (_(), f("details", B, [p("summary", ue, y(J.value) + " kept automatically ", 1), p("div", V, [(_(!0), f(c, null, v(g.view.automatic, (t) => (_(), f("div", { key: t.tag }, [p("h3", H, y(t.label), 1), p("ul", U, [(_(!0), f(c, null, v(t.rows, (t) => (_(), f("li", {
|
|
217
|
+
key: t.id,
|
|
218
|
+
"data-testid": `map-row-${t.id}`,
|
|
219
|
+
class: "flex flex-wrap items-center gap-2 text-sm"
|
|
220
|
+
}, [
|
|
221
|
+
p("span", fe, y(t.title), 1),
|
|
222
|
+
h(b(e), { class: "size-3.5 shrink-0 text-base-content/60" }),
|
|
223
|
+
p("span", null, y(b(o)(t)), 1),
|
|
224
|
+
p("span", pe, y(t.hint), 1)
|
|
225
|
+
], 8, de))), 128))])]))), 128))])])) : d("", !0)
|
|
226
|
+
])])]));
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
//#endregion
|
|
230
|
+
export { G as default };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { toRef as e } from "../../external/.pnpm/@dialecte_core@0.6.1/node_modules/@dialecte/core/dist/helpers.js";
|
|
2
|
+
import "../../external/.pnpm/@dialecte_scl@0.8.1/node_modules/@dialecte/scl/dist/hooks-C05NpRNi.js";
|
|
3
|
+
import "../../external/.pnpm/@dialecte_scl@0.8.1/node_modules/@dialecte/scl/dist/v2019C1/index.js";
|
|
4
|
+
import { extractTitle as t } from "../session/merge.service.js";
|
|
5
|
+
//#region lib/merge/match/match.ts
|
|
6
|
+
async function n(e) {
|
|
7
|
+
let { mappings: t, sourceQuery: n, targetQuery: r } = e, i = [], a = [];
|
|
8
|
+
for (let e of t) e.selectable && !e.locked ? i.push(e) : a.push(e);
|
|
9
|
+
return {
|
|
10
|
+
changeable: await v({
|
|
11
|
+
mappings: i,
|
|
12
|
+
sourceQuery: n,
|
|
13
|
+
targetQuery: r
|
|
14
|
+
}),
|
|
15
|
+
automatic: await v({
|
|
16
|
+
mappings: a,
|
|
17
|
+
sourceQuery: n,
|
|
18
|
+
targetQuery: r
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function r(e) {
|
|
23
|
+
let t = /* @__PURE__ */ new Set();
|
|
24
|
+
for (let { mapping: n, projectOwned: r } of c(e)) r && n && "existing" in n && n.existing.id && t.add(n.existing.id);
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
function i(e) {
|
|
28
|
+
let { report: t, stagedId: n, sourceId: r, titleOf: i } = e, s = c(t), l = (e) => {
|
|
29
|
+
let t = i?.(e);
|
|
30
|
+
return t ? `the template's ${t}` : "an element of the template";
|
|
31
|
+
}, u = s.find((e) => e.mapping && "existing" in e.mapping && e.mapping.existing.id === n);
|
|
32
|
+
if (u?.projectOwned) return `${o(l(a(u)))} reuses this element of the project: it keeps its own name and attributes and only gains what the template brings.`;
|
|
33
|
+
if (u) return `Created for ${l(a(u))} by an earlier placement: it follows the template.`;
|
|
34
|
+
let d = s.find((e) => a(e) === r && e.mapping && "create" in e.mapping);
|
|
35
|
+
if (d) {
|
|
36
|
+
let e = d.parentPath ? ` in ${d.parentPath}` : "";
|
|
37
|
+
return `New, created for ${l(a(d))}${e}.`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function a(e) {
|
|
41
|
+
return e.sourceId ?? e.id;
|
|
42
|
+
}
|
|
43
|
+
function o(e) {
|
|
44
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
45
|
+
}
|
|
46
|
+
function s(e) {
|
|
47
|
+
if (e.target.kind === "undecided") return "to choose";
|
|
48
|
+
if (e.target.kind === "create") {
|
|
49
|
+
let { name: t, parentPath: n } = e.written ?? e.target;
|
|
50
|
+
return `new: ${t}${n ? ` in ${n}` : ""}`;
|
|
51
|
+
}
|
|
52
|
+
return e.target.path || e.target.title;
|
|
53
|
+
}
|
|
54
|
+
function c(e) {
|
|
55
|
+
return [...e.mappings, ...e.instances.flatMap((e) => e.mappings)];
|
|
56
|
+
}
|
|
57
|
+
function l(e) {
|
|
58
|
+
if (!e) return;
|
|
59
|
+
let t = u(e.templateLevel);
|
|
60
|
+
return `This template was made for ${t}; you started from ${u(e.startedFrom)}. Its content lands in ${t}, below where you started.`;
|
|
61
|
+
}
|
|
62
|
+
function u(e) {
|
|
63
|
+
return `a ${(m[e] ?? e).toLowerCase()}`;
|
|
64
|
+
}
|
|
65
|
+
function d(e) {
|
|
66
|
+
return e.changeable.length > 0;
|
|
67
|
+
}
|
|
68
|
+
function f(e) {
|
|
69
|
+
return e.changeable.some((e) => e.rows.some(p));
|
|
70
|
+
}
|
|
71
|
+
function p(e) {
|
|
72
|
+
return e.target.kind === "undecided";
|
|
73
|
+
}
|
|
74
|
+
var m = {
|
|
75
|
+
Substation: "Substation",
|
|
76
|
+
VoltageLevel: "Voltage level",
|
|
77
|
+
Bay: "Bay"
|
|
78
|
+
}, h = "Placement", g = {
|
|
79
|
+
Function: "Functions",
|
|
80
|
+
AllocationRole: "Allocation roles",
|
|
81
|
+
FunctionCategory: "Function categories",
|
|
82
|
+
Variable: "Variables",
|
|
83
|
+
BehaviorDescription: "Behaviour descriptions"
|
|
84
|
+
}, _ = Object.keys(g);
|
|
85
|
+
async function v(e) {
|
|
86
|
+
let { mappings: t, sourceQuery: n, targetQuery: r } = e, i = [], a = /* @__PURE__ */ new Map();
|
|
87
|
+
for (let e of t) {
|
|
88
|
+
let t = await b({
|
|
89
|
+
mapping: e,
|
|
90
|
+
sourceQuery: n,
|
|
91
|
+
targetQuery: r
|
|
92
|
+
});
|
|
93
|
+
e.kind === "level" ? i.push(t) : a.set(e.tagName, [...a.get(e.tagName) ?? [], t]);
|
|
94
|
+
}
|
|
95
|
+
let o = [...a.entries()].sort(([e], [t]) => y(e) - y(t)).map(([e, t]) => ({
|
|
96
|
+
tag: e,
|
|
97
|
+
label: g[e] ?? e,
|
|
98
|
+
rows: [...t.filter((e) => e.ambiguous), ...t.filter((e) => !e.ambiguous)]
|
|
99
|
+
}));
|
|
100
|
+
return i.length === 0 ? o : [{
|
|
101
|
+
tag: h,
|
|
102
|
+
label: h,
|
|
103
|
+
rows: i
|
|
104
|
+
}, ...o];
|
|
105
|
+
}
|
|
106
|
+
function y(e) {
|
|
107
|
+
let t = _.indexOf(e);
|
|
108
|
+
return t === -1 ? _.length : t;
|
|
109
|
+
}
|
|
110
|
+
async function b(n) {
|
|
111
|
+
let { mapping: r, sourceQuery: i, targetQuery: o } = n, s = {
|
|
112
|
+
tagName: r.tagName,
|
|
113
|
+
id: a(r)
|
|
114
|
+
}, c = r.placedFor && o ? await t(o, e(r.placedFor)) : void 0, l = r.candidates.map((e) => ({
|
|
115
|
+
id: e.ref.id ?? "",
|
|
116
|
+
title: e.title,
|
|
117
|
+
path: e.path
|
|
118
|
+
})), u = await t(i, s), d = r.kind === "level", f = d && u === "TEMPLATE", p = f ? m[r.tagName] : u;
|
|
119
|
+
return {
|
|
120
|
+
id: r.id,
|
|
121
|
+
tag: r.tagName,
|
|
122
|
+
title: p,
|
|
123
|
+
...c ? { decidedFor: c } : {},
|
|
124
|
+
target: S({
|
|
125
|
+
mapping: r,
|
|
126
|
+
candidates: l
|
|
127
|
+
}),
|
|
128
|
+
hint: d ? w({
|
|
129
|
+
mapping: r,
|
|
130
|
+
context: f
|
|
131
|
+
}) : C(r),
|
|
132
|
+
ambiguous: r.ambiguous,
|
|
133
|
+
chosen: r.reason === "decision",
|
|
134
|
+
candidates: l
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function x(e, t) {
|
|
138
|
+
let n = (e) => ({
|
|
139
|
+
...e,
|
|
140
|
+
rows: e.rows.map((e) => {
|
|
141
|
+
let { written: n, existingNamedAlike: r, ...i } = e, a = t.get(e.id);
|
|
142
|
+
if (e.target.kind !== "create" || !a) return i;
|
|
143
|
+
let o = e.target;
|
|
144
|
+
if (a.name === o.name && a.parentPath === o.parentPath) return i;
|
|
145
|
+
let s = a.name === o.name ? void 0 : e.candidates.find((e) => e.title === o.name);
|
|
146
|
+
return {
|
|
147
|
+
...i,
|
|
148
|
+
written: a,
|
|
149
|
+
...s ? { existingNamedAlike: s } : {}
|
|
150
|
+
};
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
return {
|
|
154
|
+
changeable: e.changeable.map(n),
|
|
155
|
+
automatic: e.automatic.map(n)
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function S(e) {
|
|
159
|
+
let { mapping: t, candidates: n } = e;
|
|
160
|
+
if (!t.mapping) return { kind: "undecided" };
|
|
161
|
+
if ("create" in t.mapping) return {
|
|
162
|
+
kind: "create",
|
|
163
|
+
name: t.mapping.create.name ?? "",
|
|
164
|
+
...t.parentPath ? { parentPath: t.parentPath } : {}
|
|
165
|
+
};
|
|
166
|
+
let r = t.mapping.existing.id ?? "", i = n.find((e) => e.id === r);
|
|
167
|
+
return {
|
|
168
|
+
kind: "existing",
|
|
169
|
+
id: r,
|
|
170
|
+
title: i?.title ?? "",
|
|
171
|
+
path: i?.path ?? ""
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function C(e) {
|
|
175
|
+
if (e.locked) return "Already used by this instance";
|
|
176
|
+
if (e.ambiguous && e.reason === "none") return "May be an element this instance already uses — pick it to keep it";
|
|
177
|
+
if (e.ambiguous) return "Several of that name in the project: choose one, or create a new one";
|
|
178
|
+
switch (e.reason) {
|
|
179
|
+
case "decision": return "Your choice";
|
|
180
|
+
case "lineage": return "Created by an earlier placement of this template";
|
|
181
|
+
case "name": return "Same name in the project";
|
|
182
|
+
case "none": return "Nothing of that name in the project";
|
|
183
|
+
case "anchor":
|
|
184
|
+
case "only": return w({
|
|
185
|
+
mapping: e,
|
|
186
|
+
context: !1
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function w(e) {
|
|
191
|
+
let { mapping: t, context: n } = e;
|
|
192
|
+
if (t.locked) return "Already used by this instance";
|
|
193
|
+
if (!t.mapping) return t.ambiguous ? "Several there — choose one, or have a new one created" : "Follows from the level above";
|
|
194
|
+
switch (t.reason) {
|
|
195
|
+
case "decision": return "Your choice";
|
|
196
|
+
case "anchor": return "Where you started";
|
|
197
|
+
case "only": return "The only one there";
|
|
198
|
+
case "lineage": return "Created by an earlier placement of this template";
|
|
199
|
+
case "name": return "Same name in the project";
|
|
200
|
+
case "none": return n ? "None there yet" : "Created from the template";
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function T(e) {
|
|
204
|
+
let t = /* @__PURE__ */ new Set([e.title, ...e.target.kind === "create" ? [e.target.name] : []]), n = (e) => t.has(e.title);
|
|
205
|
+
return {
|
|
206
|
+
options: [...e.candidates.filter(n), ...e.candidates.filter((e) => !n(e))],
|
|
207
|
+
groupOf: (e) => n(e) ? "Same name" : "Others in the project"
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
export { h as PLACEMENT_GROUP, T as arrangeTargets, n as buildMapView, r as collectMappedOntoIds, i as describeMappingOf, l as describeOffLevel, s as describeTarget, d as hasMapStep, f as hasUndecided, p as needsChoice, a as sourceIdOf, x as withWrittenTargets };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region lib/merge/review/affix.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = t?.prefix ?? "", r = t?.suffix ?? "", i = e, a = n, o = r;
|
|
4
|
+
return n && i.startsWith(n) ? i = i.slice(n.length) : n && i.includes(n) && (a = ""), r && i.endsWith(r) ? i = i.slice(0, i.length - r.length) : r && i.includes(r) && (o = ""), {
|
|
5
|
+
prefix: a,
|
|
6
|
+
core: i,
|
|
7
|
+
suffix: o
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function t(e, t) {
|
|
11
|
+
return `${t?.prefix ?? ""}${e}${t?.suffix ?? ""}`;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as composeAffix, e as splitAffix };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region lib/merge/review/change-badge.ts
|
|
2
|
+
var e = {
|
|
3
|
+
added: "badge-soft badge-success",
|
|
4
|
+
removed: "badge-soft badge-error",
|
|
5
|
+
modified: "badge-soft badge-warning",
|
|
6
|
+
unchanged: "badge-soft badge-neutral",
|
|
7
|
+
"target-only": "badge-soft badge-info"
|
|
8
|
+
}, t = "badge-dash badge-neutral";
|
|
9
|
+
//#endregion
|
|
10
|
+
export { e as CHANGE_BADGE, t as LEFT_OUT_BADGE };
|