@septkit/ui 0.0.49 → 0.0.50

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 (20) hide show
  1. package/dist/dialecte/composables/use-active-document.js +18 -11
  2. package/dist/dialecte/create-document-store.js +3 -3
  3. package/dist/external/.pnpm/{@dialecte_core@0.4.7 → @dialecte_core@0.4.9}/node_modules/@dialecte/core/dist/helpers.js +16 -19
  4. package/dist/external/.pnpm/{@dialecte_core@0.4.7 → @dialecte_core@0.4.9}/node_modules/@dialecte/core/dist/index.js +1 -1
  5. package/dist/external/.pnpm/{@dialecte_core@0.4.7/node_modules/@dialecte/core/dist/project-DxIu-3AU.js → @dialecte_core@0.4.9/node_modules/@dialecte/core/dist/project-D-KS3OPN.js} +1 -1
  6. package/dist/external/.pnpm/{@dialecte_core@0.4.7 → @dialecte_core@0.4.9}/node_modules/@dialecte/core/dist/utils-C5_11hqg.js +1 -1
  7. package/dist/external/.pnpm/{@dialecte_scl@0.3.8/node_modules/@dialecte/scl/dist/hooks-DJJN-WU2.js → @dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/hooks-DO4gUiix.js} +48 -5277
  8. package/dist/external/.pnpm/@dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/v2019C1/index.js +3 -0
  9. 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 +11 -0
  10. package/dist/index.d.ts +7 -1
  11. package/dist/merge/build-view-model.js +37 -21
  12. package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +80 -43
  13. package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +156 -151
  14. package/dist/merge/merge-summary.vue_vue_type_script_setup_true_lang.js +47 -25
  15. package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +11 -9
  16. package/dist/merge/merge.service.js +2 -2
  17. package/dist/merge/use-merge-session.js +4 -1
  18. package/dist/ui.css +1 -1
  19. package/package.json +3 -3
  20. package/dist/external/.pnpm/@dialecte_scl@0.3.8/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -3
@@ -0,0 +1,3 @@
1
+ import "../../../../../../@dialecte_core@0.4.9/node_modules/@dialecte/core/dist/index.js";
2
+ import { i as e } from "../hooks-DO4gUiix.js";
3
+ export { e as presentationScope };
@@ -0,0 +1,11 @@
1
+ import e from "../createLucideIcon.js";
2
+ //#region node_modules/.pnpm/@lucide+vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/rotate-ccw.mjs
3
+ var t = [["path", {
4
+ d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
5
+ key: "1357e3"
6
+ }], ["path", {
7
+ d: "M3 3v5h5",
8
+ key: "1xhq8a"
9
+ }]], n = e("rotate-ccw", t);
10
+ //#endregion
11
+ export { t as __iconNode, n as default };
package/dist/index.d.ts CHANGED
@@ -405,7 +405,7 @@ export declare const Button: __VLS_WithTemplateSlots<typeof __VLS_component, __V
405
405
  export declare const CATEGORY_ELEMENTS: Record<string, string[]>;
406
406
 
407
407
  /** How an element or attribute changed between the template and the instance. */
408
- export declare type ChangeStatus = 'added' | 'removed' | 'modified' | 'unchanged';
408
+ export declare type ChangeStatus = 'added' | 'removed' | 'modified' | 'unchanged' | 'target-only';
409
409
 
410
410
  declare function closeDropdown(): void;
411
411
 
@@ -656,6 +656,12 @@ export declare type MergeNodeMeta = {
656
656
  role: 'primary' | 'companion' | 'plain';
657
657
  /** The decision group this node belongs to (primary + companions share it). */
658
658
  groupId?: string;
659
+ /**
660
+ * The topmost changed node of a change region (no changed same-group ancestor above it).
661
+ * Only region heads carry a status marker, so one badge shows per change instead of
662
+ * scattering across correlated companions but not their uuid-less siblings.
663
+ */
664
+ regionHead?: boolean;
659
665
  /** For a satellite companion that lives elsewhere: its real document path (shown as subtitle). */
660
666
  path?: string;
661
667
  };
@@ -47,41 +47,45 @@ async function r(t) {
47
47
  index: {},
48
48
  expanded: []
49
49
  };
50
- async function o(t, n) {
51
- let s = r.get(t.id), c = s?.change ?? (n.added ? "added" : "unchanged"), l = s?.groupId ?? (c === "unchanged" ? void 0 : n.groupId), u = s?.role ?? "plain", d = {
50
+ async function o(t, n, s) {
51
+ let c = r.get(t.id), l = c?.change ?? (n.added ? "added" : "unchanged"), u = c?.groupId ?? (l === "unchanged" ? void 0 : n.groupId), d = c?.role ?? "plain", f = {
52
52
  tagName: t.tagName,
53
53
  id: t.id
54
- }, f = {
55
- added: s ? s.change === "added" : n.added,
56
- groupId: l ?? n.groupId
57
- }, p = [];
58
- for (let e of t.tree ?? []) p.push(await o(e, f));
59
- let m = c !== "unchanged" || p.some((e) => e.changed);
54
+ }, p = l !== "unchanged" && (!s || s.change === "unchanged" || s.groupId !== u), m = {
55
+ added: c ? c.change === "added" : n.added,
56
+ groupId: u ?? n.groupId
57
+ }, h = [];
58
+ for (let e of t.tree ?? []) h.push(await o(e, m, {
59
+ change: l,
60
+ groupId: u
61
+ }));
62
+ let g = l !== "unchanged" || h.some((e) => e.changed);
60
63
  return a.meta[t.id] = {
61
- change: c,
62
- role: u,
63
- groupId: l
64
+ change: l,
65
+ role: d,
66
+ groupId: u,
67
+ regionHead: p
64
68
  }, a.index[t.id] = {
65
- previewRef: d,
66
- change: c,
67
- role: u,
68
- groupId: l,
69
- node: s?.node
70
- }, m && a.expanded.push(t.id), {
69
+ previewRef: f,
70
+ change: l,
71
+ role: d,
72
+ groupId: u,
73
+ node: c?.node
74
+ }, g && a.expanded.push(t.id), {
71
75
  node: {
72
76
  tag: t.tagName,
73
77
  id: t.id,
74
- name: await e(i, d),
78
+ name: await e(i, f),
75
79
  selectable: !0,
76
- children: p.length ? p.map((e) => e.node) : void 0
80
+ children: h.length ? h.map((e) => e.node) : void 0
77
81
  },
78
- changed: m
82
+ changed: g
79
83
  };
80
84
  }
81
85
  return a.items.push((await o(n, {
82
86
  added: !1,
83
87
  groupId: void 0
84
- })).node), a;
88
+ }, void 0)).node), a;
85
89
  }
86
90
  async function i(e, n, r) {
87
91
  let i = new Map((n?.editableAttributes ?? []).map((e) => [e.attr, e])), a = [];
@@ -148,10 +152,22 @@ async function a(e, t, n, r) {
148
152
  added: [],
149
153
  updated: [],
150
154
  skipped: [],
155
+ preserved: [],
156
+ removed: [],
151
157
  renamed: []
152
158
  };
153
159
  for (let a of e.groups) {
154
160
  let e = await o(a.primary, r), s = a.primary.tagName, c = a.companions.length;
161
+ if (a.primary.change === "target-only") {
162
+ t(a.id) === "skip" ? i.preserved.push({
163
+ title: e,
164
+ tag: s
165
+ }) : i.removed.push({
166
+ title: e,
167
+ tag: s
168
+ });
169
+ continue;
170
+ }
155
171
  if (t(a.id) === "skip") {
156
172
  i.skipped.push({
157
173
  title: e,
@@ -1,76 +1,113 @@
1
- import { composeAffix as e, splitAffix as t } from "./affix.js";
2
- import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, renderList as u, toDisplayString as d } from "vue";
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/rotate-ccw.js";
2
+ import { composeAffix as t, splitAffix as n } from "./affix.js";
3
+ import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, renderList as f, toDisplayString as p, unref as m } from "vue";
3
4
  //#region lib/merge/element-detail.vue?vue&type=script&setup=true&lang.ts
4
- var f = {
5
+ var h = {
5
6
  key: 0,
6
7
  class: "flex h-full flex-col gap-3 overflow-auto p-3 text-sm"
7
- }, p = { class: "flex items-center gap-2" }, m = { class: "font-medium" }, h = { class: "badge badge-sm opacity-70" }, g = {
8
+ }, g = { class: "flex items-center gap-2" }, _ = { class: "font-medium" }, v = { class: "badge badge-sm opacity-70" }, y = {
8
9
  key: 0,
9
- class: "flex flex-col gap-2 font-mono text-xs"
10
- }, _ = { class: "whitespace-nowrap shrink-0 opacity-70" }, v = { class: "flex w-full items-center" }, y = {
10
+ class: "flex flex-col gap-2 text-xs"
11
+ }, b = { class: "flex items-center gap-2" }, x = ["title"], S = { class: "flex w-full items-center font-mono" }, C = {
11
12
  key: 0,
12
13
  class: "shrink-0 select-none opacity-60"
13
- }, b = ["value", "onInput"], x = {
14
+ }, w = ["value", "onInput"], T = {
14
15
  key: 1,
15
16
  class: "shrink-0 select-none opacity-60"
16
- }, S = {
17
- key: 0,
17
+ }, E = [
18
+ "title",
19
+ "aria-pressed",
20
+ "onClick"
21
+ ], D = {
22
+ key: 1,
18
23
  class: "badge badge-warning badge-xs shrink-0",
19
24
  title: "Auto-resolved to avoid a naming collision — edit to override"
20
- }, C = {
25
+ }, O = {
26
+ key: 0,
27
+ class: "mt-1 flex items-center gap-1 pl-24 font-mono opacity-70"
28
+ }, k = { class: "line-through decoration-error/60" }, A = { class: "text-warning" }, j = {
29
+ key: 1,
30
+ class: "badge badge-info badge-xs"
31
+ }, M = {
21
32
  key: 1,
22
33
  class: "text-xs opacity-60"
23
- }, w = {
34
+ }, N = {
24
35
  key: 1,
25
36
  class: "grid h-full place-items-center p-4 text-sm opacity-60"
26
- }, T = /*@__PURE__*/ s({
37
+ }, P = /*@__PURE__*/ l({
27
38
  __name: "element-detail",
28
39
  props: {
29
40
  detail: {},
30
41
  affixMask: { type: Function }
31
42
  },
32
43
  emits: ["edit"],
33
- setup(s, { emit: T }) {
34
- let E = s, D = T, O = r(() => ({
44
+ setup(l, { emit: P }) {
45
+ let F = l, I = P, L = i(() => ({
35
46
  added: "badge-success",
36
47
  removed: "badge-error",
37
48
  modified: "badge-warning",
38
- unchanged: "badge-ghost"
39
- })[E.detail?.change ?? "unchanged"]), k = r(() => E.detail?.attributes.filter((e) => e.editable));
40
- function A(e) {
41
- if (!(!E.detail || !E.affixMask)) return E.affixMask({
42
- tag: E.detail.tag,
49
+ unchanged: "badge-ghost",
50
+ "target-only": "badge-info"
51
+ })[F.detail?.change ?? "unchanged"]), R = i(() => [...F.detail?.attributes ?? []].filter((e) => e.editable).sort((e, t) => Number(V(t)) - Number(V(e))));
52
+ function z(e) {
53
+ if (!(!F.detail || !F.affixMask)) return F.affixMask({
54
+ tag: F.detail.tag,
43
55
  attr: e.name
44
56
  });
45
57
  }
46
- function j(e) {
47
- return t(e.after ?? "", A(e));
58
+ function B(e) {
59
+ return n(e.after ?? "", z(e));
48
60
  }
49
- function M(t, n) {
61
+ function V(e) {
62
+ return e.status === "modified";
63
+ }
64
+ function H(e) {
65
+ return V(e) && (e.after ?? "") === (e.before ?? "");
66
+ }
67
+ function U(e, n) {
50
68
  let r = n.target.value;
51
- D("edit", t.name, e(r, A(t)));
69
+ I("edit", e.name, t(r, z(e)));
70
+ }
71
+ function W(e) {
72
+ I("edit", e.name, e.before ?? "");
52
73
  }
53
- return (e, t) => s.detail ? (l(), a("div", f, [o("header", p, [
54
- o("span", m, d(s.detail.title), 1),
55
- o("span", h, d(s.detail.tag), 1),
56
- o("span", { class: c(["badge badge-sm", O.value]) }, d(s.detail.change), 3)
57
- ]), k.value?.length ? (l(), a("div", g, [(l(!0), a(n, null, u(k.value, (e) => (l(), a("label", {
58
- key: e.name,
59
- class: "flex items-center gap-2"
60
- }, [
61
- o("span", _, d(e.name) + ":", 1),
62
- o("span", v, [
63
- j(e).prefix ? (l(), a("span", y, d(j(e).prefix), 1)) : i("", !0),
64
- o("input", {
65
- class: c(["input input-xs input-bordered w-full font-mono", { "input-warning": e.conflict }]),
66
- value: j(e).core,
67
- onInput: (t) => M(e, t)
68
- }, null, 42, b),
69
- j(e).suffix ? (l(), a("span", x, d(j(e).suffix), 1)) : i("", !0)
74
+ return (t, n) => l.detail ? (d(), o("div", h, [s("header", g, [
75
+ s("span", _, p(l.detail.title), 1),
76
+ s("span", v, p(l.detail.tag), 1),
77
+ s("span", { class: u(["badge badge-sm", L.value]) }, p(l.detail.change), 3)
78
+ ]), R.value.length ? (d(), o("div", y, [(d(!0), o(r, null, f(R.value, (t) => (d(), o("div", {
79
+ key: t.name,
80
+ class: u(["rounded-md border px-2 py-1.5", V(t) ? "border-warning/40 bg-warning/5" : "border-base-200"])
81
+ }, [s("div", b, [
82
+ s("span", {
83
+ class: "w-24 shrink-0 truncate opacity-70",
84
+ title: t.name
85
+ }, p(t.name), 9, x),
86
+ s("span", S, [
87
+ B(t).prefix ? (d(), o("span", C, p(B(t).prefix), 1)) : a("", !0),
88
+ s("input", {
89
+ class: u(["input input-xs input-bordered w-full font-mono", { "input-warning": t.conflict }]),
90
+ value: B(t).core,
91
+ onInput: (e) => U(t, e)
92
+ }, null, 42, w),
93
+ B(t).suffix ? (d(), o("span", T, p(B(t).suffix), 1)) : a("", !0)
70
94
  ]),
71
- e.conflict ? (l(), a("span", S, " conflict ")) : i("", !0)
72
- ]))), 128))])) : (l(), a("div", C, "No editable fields. See the diff below."))])) : (l(), a("div", w, " Select an element to see its changes. "));
95
+ V(t) ? (d(), o("button", {
96
+ key: 0,
97
+ type: "button",
98
+ class: u(["btn btn-ghost btn-xs btn-square shrink-0", H(t) ? "text-info" : "opacity-60 hover:opacity-100"]),
99
+ title: H(t) ? "Keeping the current value — click again is a no-op" : `Keep current value: ${t.before || "(empty)"}`,
100
+ "aria-pressed": H(t),
101
+ "aria-label": "Keep current value",
102
+ onClick: (e) => W(t)
103
+ }, [c(m(e), { class: "size-3.5" })], 10, E)) : a("", !0),
104
+ t.conflict ? (d(), o("span", D, " conflict ")) : a("", !0)
105
+ ]), V(t) ? (d(), o("p", O, [
106
+ n[1] ||= s("span", { class: "opacity-60" }, "current", -1),
107
+ s("span", k, p(t.before || "∅"), 1),
108
+ H(t) ? (d(), o("span", j, "kept")) : (d(), o(r, { key: 0 }, [n[0] ||= s("span", { class: "opacity-50" }, "→", -1), s("span", A, p(t.after || "∅"), 1)], 64))
109
+ ])) : a("", !0)], 2))), 128))])) : (d(), o("div", M, "No editable fields. See the diff below."))])) : (d(), o("div", N, " Select an element to see its changes. "));
73
110
  }
74
111
  });
75
112
  //#endregion
76
- export { T as default };
113
+ export { P as default };