@septkit/ui 0.0.44 → 0.0.46
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/dialog/dialog-host.vue_vue_type_script_setup_true_lang.js +45 -16
- package/dist/dialog/feedback-dialog.js +5 -0
- package/dist/dialog/feedback-dialog.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/dialog/index.js +4 -3
- package/dist/dialog/use-dialog-host.js +31 -8
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/circle-alert.js +26 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/list-tree.js +26 -0
- package/dist/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 +18 -0
- package/dist/index.d.ts +83 -27
- package/dist/index.js +17 -16
- package/dist/merge/build-view-model.js +14 -0
- package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +184 -145
- package/dist/ui.css +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,53 @@
|
|
|
1
1
|
import e from "./dialog.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import t from "./feedback-dialog.js";
|
|
3
|
+
import { useDialog as n } from "./use-dialog-host.js";
|
|
4
|
+
import { computed as r, createBlock as i, createCommentVNode as a, defineComponent as o, mergeProps as s, normalizeProps as c, openBlock as l, resolveDynamicComponent as u, unref as d, withCtx as f } from "vue";
|
|
4
5
|
//#region lib/dialog/dialog-host.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var p = /*@__PURE__*/ o({
|
|
6
7
|
__name: "dialog-host",
|
|
7
8
|
props: { host: {} },
|
|
8
|
-
setup(
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
setup(o) {
|
|
10
|
+
let p = o.host ?? n(), m = {
|
|
11
|
+
error: "Error",
|
|
12
|
+
success: "Success",
|
|
13
|
+
warning: "Warning"
|
|
14
|
+
}, h = r(() => p.feedback.value ? "sm" : p.active.value?.options.size), g = r(() => {
|
|
15
|
+
let e = p.feedback.value;
|
|
16
|
+
return e ? e.title ?? m[e.variant] : p.active.value?.options.title;
|
|
17
|
+
}), _ = r(() => p.feedback.value ? !0 : p.active.value?.options.closable ?? !0), v = r(() => p.feedback.value ? void 0 : p.active.value?.options.scoped);
|
|
18
|
+
function y(e) {
|
|
19
|
+
e || p.close();
|
|
12
20
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
function b() {
|
|
22
|
+
let e = p.feedback.value?.onRetry;
|
|
23
|
+
p.dismissFeedback(), e?.();
|
|
24
|
+
}
|
|
25
|
+
return (n, r) => (l(), i(e, {
|
|
26
|
+
open: d(p).open.value,
|
|
27
|
+
size: h.value,
|
|
28
|
+
title: g.value,
|
|
29
|
+
closable: _.value,
|
|
30
|
+
scoped: v.value,
|
|
31
|
+
"onUpdate:open": y
|
|
20
32
|
}, {
|
|
21
|
-
default:
|
|
33
|
+
default: f(() => [d(p).feedback.value ? (l(), i(t, {
|
|
34
|
+
key: 0,
|
|
35
|
+
variant: d(p).feedback.value.variant,
|
|
36
|
+
message: d(p).feedback.value.message,
|
|
37
|
+
detail: d(p).feedback.value.detail,
|
|
38
|
+
"show-retry": !!d(p).feedback.value.onRetry,
|
|
39
|
+
"retry-label": d(p).feedback.value.retryLabel,
|
|
40
|
+
"auto-close-ms": d(p).feedback.value.autoCloseMs,
|
|
41
|
+
onDismiss: r[0] ||= (e) => d(p).dismissFeedback(),
|
|
42
|
+
onRetry: b
|
|
43
|
+
}, null, 8, [
|
|
44
|
+
"variant",
|
|
45
|
+
"message",
|
|
46
|
+
"detail",
|
|
47
|
+
"show-retry",
|
|
48
|
+
"retry-label",
|
|
49
|
+
"auto-close-ms"
|
|
50
|
+
])) : d(p).active.value ? (l(), i(u(d(p).active.value.component), c(s({ key: 1 }, d(p).active.value.props)), null, 16)) : a("", !0)]),
|
|
22
51
|
_: 1
|
|
23
52
|
}, 8, [
|
|
24
53
|
"open",
|
|
@@ -30,4 +59,4 @@ var d = /*@__PURE__*/ i({
|
|
|
30
59
|
}
|
|
31
60
|
});
|
|
32
61
|
//#endregion
|
|
33
|
-
export {
|
|
62
|
+
export { p as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import e from "../button/button.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/circle-alert.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/circle-check.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 { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, onBeforeUnmount as p, onMounted as m, openBlock as h, resolveDynamicComponent as g, toDisplayString as _, withCtx as v } from "vue";
|
|
6
|
+
//#region lib/dialog/feedback-dialog.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var y = { class: "flex flex-col gap-4 p-2" }, b = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "max-h-60 overflow-auto rounded-box bg-base-200 p-3 text-xs whitespace-pre-wrap"
|
|
10
|
+
}, x = { class: "flex justify-end gap-2" }, S = /*@__PURE__*/ d({
|
|
11
|
+
__name: "feedback-dialog",
|
|
12
|
+
props: {
|
|
13
|
+
variant: {},
|
|
14
|
+
message: {},
|
|
15
|
+
detail: {},
|
|
16
|
+
showRetry: { type: Boolean },
|
|
17
|
+
retryLabel: {},
|
|
18
|
+
autoCloseMs: {}
|
|
19
|
+
},
|
|
20
|
+
emits: ["dismiss", "retry"],
|
|
21
|
+
setup(d, { emit: S }) {
|
|
22
|
+
let C = d, w = S, T = i(() => ({
|
|
23
|
+
error: t,
|
|
24
|
+
success: n,
|
|
25
|
+
warning: r
|
|
26
|
+
})[C.variant]), E = i(() => ({
|
|
27
|
+
error: "alert-error",
|
|
28
|
+
success: "alert-success",
|
|
29
|
+
warning: "alert-warning"
|
|
30
|
+
})[C.variant]), D;
|
|
31
|
+
return m(() => {
|
|
32
|
+
C.autoCloseMs && (D = setTimeout(() => w("dismiss"), C.autoCloseMs));
|
|
33
|
+
}), p(() => {
|
|
34
|
+
D && clearTimeout(D);
|
|
35
|
+
}), (t, n) => (h(), s("div", y, [
|
|
36
|
+
c("div", {
|
|
37
|
+
class: f(["alert", E.value]),
|
|
38
|
+
role: "alert"
|
|
39
|
+
}, [(h(), a(g(T.value), { class: "h-5 w-5 shrink-0" })), c("span", null, _(d.message), 1)], 2),
|
|
40
|
+
d.detail ? (h(), s("pre", b, _(d.detail), 1)) : o("", !0),
|
|
41
|
+
c("div", x, [u(e, {
|
|
42
|
+
size: "sm",
|
|
43
|
+
variant: d.showRetry ? "outline" : void 0,
|
|
44
|
+
onClick: n[0] ||= (e) => w("dismiss")
|
|
45
|
+
}, {
|
|
46
|
+
default: v(() => [l(_(d.showRetry ? "Cancel" : "OK"), 1)]),
|
|
47
|
+
_: 1
|
|
48
|
+
}, 8, ["variant"]), d.showRetry ? (h(), a(e, {
|
|
49
|
+
key: 0,
|
|
50
|
+
size: "sm",
|
|
51
|
+
onClick: n[1] ||= (e) => w("retry")
|
|
52
|
+
}, {
|
|
53
|
+
default: v(() => [l(_(d.retryLabel ?? "Retry"), 1)]),
|
|
54
|
+
_: 1
|
|
55
|
+
})) : o("", !0)])
|
|
56
|
+
]));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { S as default };
|
package/dist/dialog/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import e from "./dialog.js";
|
|
2
|
-
import
|
|
3
|
-
import a from "./dialog-host.js";
|
|
4
|
-
|
|
2
|
+
import t from "./feedback-dialog.js";
|
|
3
|
+
import { createDialogHost as n, dialogHostKey as r, provideDialogHost as i, useDialog as a } from "./use-dialog-host.js";
|
|
4
|
+
import o from "./dialog-host.js";
|
|
5
|
+
export { e as Dialog, o as DialogHost, t as FeedbackDialog, n as createDialogHost, r as dialogHostKey, i as provideDialogHost, a as useDialog };
|
|
@@ -1,22 +1,45 @@
|
|
|
1
1
|
import { inject as e, markRaw as t, provide as n, ref as r, shallowRef as i } from "vue";
|
|
2
2
|
//#region lib/dialog/use-dialog-host.ts
|
|
3
3
|
function a() {
|
|
4
|
-
let e = r(!1), n = i();
|
|
5
|
-
function
|
|
6
|
-
n.value = {
|
|
4
|
+
let e = r(!1), n = i(), a = i();
|
|
5
|
+
function o(r, i, o = {}) {
|
|
6
|
+
a.value = void 0, n.value = {
|
|
7
7
|
component: t(r),
|
|
8
8
|
props: i,
|
|
9
|
-
options:
|
|
9
|
+
options: o
|
|
10
10
|
}, e.value = !0;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
function s(t, n) {
|
|
13
|
+
a.value = {
|
|
14
|
+
variant: t,
|
|
15
|
+
...n
|
|
16
|
+
}, e.value = !0;
|
|
17
|
+
}
|
|
18
|
+
function c(e) {
|
|
19
|
+
s("error", e);
|
|
20
|
+
}
|
|
21
|
+
function l(e) {
|
|
22
|
+
s("success", e);
|
|
23
|
+
}
|
|
24
|
+
function u(e) {
|
|
25
|
+
s("warning", e);
|
|
26
|
+
}
|
|
27
|
+
function d() {
|
|
28
|
+
a.value = void 0, n.value || (e.value = !1);
|
|
29
|
+
}
|
|
30
|
+
function f() {
|
|
31
|
+
e.value = !1, n.value = void 0, a.value = void 0;
|
|
14
32
|
}
|
|
15
33
|
return {
|
|
16
34
|
open: e,
|
|
17
35
|
active: n,
|
|
18
|
-
|
|
19
|
-
|
|
36
|
+
feedback: a,
|
|
37
|
+
openDialog: o,
|
|
38
|
+
showError: c,
|
|
39
|
+
showSuccess: l,
|
|
40
|
+
showWarning: u,
|
|
41
|
+
dismissFeedback: d,
|
|
42
|
+
close: f
|
|
20
43
|
};
|
|
21
44
|
}
|
|
22
45
|
var o = Symbol("septkit-dialog-host");
|
|
@@ -0,0 +1,26 @@
|
|
|
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/circle-alert.mjs
|
|
3
|
+
var t = [
|
|
4
|
+
["circle", {
|
|
5
|
+
cx: "12",
|
|
6
|
+
cy: "12",
|
|
7
|
+
r: "10",
|
|
8
|
+
key: "1mglay"
|
|
9
|
+
}],
|
|
10
|
+
["line", {
|
|
11
|
+
x1: "12",
|
|
12
|
+
x2: "12",
|
|
13
|
+
y1: "8",
|
|
14
|
+
y2: "12",
|
|
15
|
+
key: "1pkeuh"
|
|
16
|
+
}],
|
|
17
|
+
["line", {
|
|
18
|
+
x1: "12",
|
|
19
|
+
x2: "12.01",
|
|
20
|
+
y1: "16",
|
|
21
|
+
y2: "16",
|
|
22
|
+
key: "4dfq90"
|
|
23
|
+
}]
|
|
24
|
+
], n = e("circle-alert", t);
|
|
25
|
+
//#endregion
|
|
26
|
+
export { t as __iconNode, n as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
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/list-tree.mjs
|
|
3
|
+
var t = [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M8 5h13",
|
|
6
|
+
key: "1pao27"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M13 12h8",
|
|
10
|
+
key: "h98zly"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M13 19h8",
|
|
14
|
+
key: "c3s6r1"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M3 10a2 2 0 0 0 2 2h3",
|
|
18
|
+
key: "1npucw"
|
|
19
|
+
}],
|
|
20
|
+
["path", {
|
|
21
|
+
d: "M3 5v12a2 2 0 0 0 2 2h3",
|
|
22
|
+
key: "x1gjn2"
|
|
23
|
+
}]
|
|
24
|
+
], n = e("list-tree", t);
|
|
25
|
+
//#endregion
|
|
26
|
+
export { t as __iconNode, n as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
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/triangle-alert.mjs
|
|
3
|
+
var t = [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
6
|
+
key: "wmoenq"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M12 9v4",
|
|
10
|
+
key: "juzpu7"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M12 17h.01",
|
|
14
|
+
key: "p32p05"
|
|
15
|
+
}]
|
|
16
|
+
], n = e("triangle-alert", t);
|
|
17
|
+
//#endregion
|
|
18
|
+
export { t as __iconNode, n as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -62,14 +62,14 @@ size: DialogSize;
|
|
|
62
62
|
closable: boolean;
|
|
63
63
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
64
64
|
|
|
65
|
-
declare const __VLS_component_5: DefineComponent<
|
|
65
|
+
declare const __VLS_component_5: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
66
66
|
select: (node: ExplorerNode) => any;
|
|
67
67
|
contextmenu: (payload: {
|
|
68
68
|
node: ExplorerNode;
|
|
69
69
|
event: MouseEvent;
|
|
70
70
|
}) => any;
|
|
71
71
|
"update:expanded": (state: ExplorerExpandedState) => any;
|
|
72
|
-
}, string, PublicProps, Readonly<
|
|
72
|
+
}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{
|
|
73
73
|
onSelect?: ((node: ExplorerNode) => any) | undefined;
|
|
74
74
|
onContextmenu?: ((payload: {
|
|
75
75
|
node: ExplorerNode;
|
|
@@ -91,15 +91,20 @@ declare type __VLS_Props = {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
declare type __VLS_Props_10 = {
|
|
94
|
+
size?: 'xs' | 'sm' | 'md';
|
|
95
|
+
disabled?: boolean;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
declare type __VLS_Props_11 = {
|
|
94
99
|
detail: ElementDetailVM | undefined;
|
|
95
100
|
};
|
|
96
101
|
|
|
97
|
-
declare type
|
|
102
|
+
declare type __VLS_Props_12 = MergeSessionParams & {
|
|
98
103
|
source?: FileMeta;
|
|
99
104
|
target?: FileMeta;
|
|
100
105
|
};
|
|
101
106
|
|
|
102
|
-
declare type
|
|
107
|
+
declare type __VLS_Props_13 = {
|
|
103
108
|
items: ExplorerNode[];
|
|
104
109
|
/** Per-node metadata keyed by node id (change, role, groupId, path). */
|
|
105
110
|
meta: Record<string, MergeNodeMeta>;
|
|
@@ -157,12 +162,24 @@ declare type __VLS_Props_5 = {
|
|
|
157
162
|
};
|
|
158
163
|
|
|
159
164
|
declare type __VLS_Props_6 = {
|
|
165
|
+
variant: FeedbackVariant;
|
|
166
|
+
message: string;
|
|
167
|
+
detail?: string;
|
|
168
|
+
/** When set, a Retry button is shown alongside the (now `Cancel`) dismiss button. */
|
|
169
|
+
showRetry?: boolean;
|
|
170
|
+
/** Label for the retry button (default `Retry`). */
|
|
171
|
+
retryLabel?: string;
|
|
172
|
+
/** Auto-emit `dismiss` after N ms (transient success). */
|
|
173
|
+
autoCloseMs?: number;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
declare type __VLS_Props_7 = {
|
|
160
177
|
items: ExplorerNode[];
|
|
161
178
|
expanded?: ExplorerExpandedState;
|
|
162
179
|
ariaLabel?: string;
|
|
163
180
|
};
|
|
164
181
|
|
|
165
|
-
declare type
|
|
182
|
+
declare type __VLS_Props_8 = {
|
|
166
183
|
/** Code to render. */
|
|
167
184
|
code?: string;
|
|
168
185
|
/** Shiki language id. Defaults to `xml`. */
|
|
@@ -174,7 +191,7 @@ declare type __VLS_Props_7 = {
|
|
|
174
191
|
wrap?: boolean;
|
|
175
192
|
};
|
|
176
193
|
|
|
177
|
-
declare type
|
|
194
|
+
declare type __VLS_Props_9 = {
|
|
178
195
|
/** Baseline XML. Omit (or empty) for a purely-added element. */
|
|
179
196
|
before?: string;
|
|
180
197
|
/** Resulting XML. */
|
|
@@ -182,18 +199,13 @@ declare type __VLS_Props_8 = {
|
|
|
182
199
|
loading?: boolean;
|
|
183
200
|
};
|
|
184
201
|
|
|
185
|
-
declare type __VLS_Props_9 = {
|
|
186
|
-
size?: 'xs' | 'sm' | 'md';
|
|
187
|
-
disabled?: boolean;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
202
|
declare type __VLS_PublicProps = {
|
|
191
203
|
modelValue?: AcceptableValue;
|
|
192
204
|
} & __VLS_Props_3;
|
|
193
205
|
|
|
194
206
|
declare type __VLS_PublicProps_2 = {
|
|
195
207
|
modelValue: DecisionAction;
|
|
196
|
-
} &
|
|
208
|
+
} & __VLS_Props_10;
|
|
197
209
|
|
|
198
210
|
declare function __VLS_template(): {
|
|
199
211
|
attrs: Partial<{}>;
|
|
@@ -305,7 +317,7 @@ declare type __VLS_WithTemplateSlots_5<T, S> = T & {
|
|
|
305
317
|
};
|
|
306
318
|
};
|
|
307
319
|
|
|
308
|
-
/** The component + props + options currently mounted in the host. */
|
|
320
|
+
/** The component + props + options currently mounted in the host (the "root"). */
|
|
309
321
|
export declare type ActiveDialog = {
|
|
310
322
|
component: Component;
|
|
311
323
|
props?: Record<string, unknown>;
|
|
@@ -335,6 +347,11 @@ export declare type ActiveDocumentProject<GenericDocument> = {
|
|
|
335
347
|
openDocument: (documentId: string) => GenericDocument;
|
|
336
348
|
};
|
|
337
349
|
|
|
350
|
+
/** The feedback template currently overlaid on the host, or `undefined` when none. */
|
|
351
|
+
export declare type ActiveFeedback = {
|
|
352
|
+
variant: FeedbackVariant;
|
|
353
|
+
} & FeedbackPayload;
|
|
354
|
+
|
|
338
355
|
/**
|
|
339
356
|
* Consumer hook run INSIDE the merge transaction, right after `tx.lifecycle.apply`.
|
|
340
357
|
* Receives the `ApplyResult` (the instance roots the write produced) so a caller can
|
|
@@ -360,7 +377,7 @@ export declare type ChangeStatus = 'added' | 'removed' | 'modified' | 'unchanged
|
|
|
360
377
|
|
|
361
378
|
declare function closeDropdown(): void;
|
|
362
379
|
|
|
363
|
-
export declare const CodeBlock: DefineComponent<
|
|
380
|
+
export declare const CodeBlock: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
364
381
|
|
|
365
382
|
/**
|
|
366
383
|
* Collects the ids of every node that has children, for binding to
|
|
@@ -385,8 +402,7 @@ export declare function createDialogHost(): DialogController;
|
|
|
385
402
|
*
|
|
386
403
|
* // With local extensions (typed augmentation):
|
|
387
404
|
* import { behaviorDescription } from './dialecte/behavior-description'
|
|
388
|
-
* type LocalDoc = ExtendedDocument<
|
|
389
|
-
* { behaviorDescription: typeof behaviorDescription }>
|
|
405
|
+
* type LocalDoc = Scl.ExtendedDocument<{ behaviorDescription: typeof behaviorDescription }>
|
|
390
406
|
* export const { document, isHydrated, hydrate, clear } =
|
|
391
407
|
* createDocumentStore<Scl.Document, LocalDoc>({
|
|
392
408
|
* extensions: { behaviorDescription },
|
|
@@ -434,13 +450,23 @@ export declare type DialecteChannelMessage = ProjectChannelMessage;
|
|
|
434
450
|
export declare const Dialog: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
435
451
|
|
|
436
452
|
export declare type DialogController = {
|
|
437
|
-
/** Whether the host dialog is open. */
|
|
453
|
+
/** Whether the host dialog is open (a root component or a feedback overlay is showing). */
|
|
438
454
|
readonly open: Ref<boolean>;
|
|
439
|
-
/** The
|
|
455
|
+
/** The mounted root component, or `undefined` when none. Preserved while feedback overlays it. */
|
|
440
456
|
readonly active: ShallowRef<ActiveDialog | undefined>;
|
|
441
|
-
/**
|
|
457
|
+
/** The feedback overlay, or `undefined` when the host shows the root / is closed. */
|
|
458
|
+
readonly feedback: ShallowRef<ActiveFeedback | undefined>;
|
|
459
|
+
/** Open `component` as the root in the host dialog with (type-checked) `props` and `options`. */
|
|
442
460
|
openDialog: <C extends Component>(component: C, props?: PropsOf<C>, options?: DialogOptions) => void;
|
|
443
|
-
/**
|
|
461
|
+
/** Overlay the built-in error template on the current root (or on its own). */
|
|
462
|
+
showError: (payload: FeedbackPayload) => void;
|
|
463
|
+
/** Overlay the built-in success template. */
|
|
464
|
+
showSuccess: (payload: FeedbackPayload) => void;
|
|
465
|
+
/** Overlay the built-in warning template. */
|
|
466
|
+
showWarning: (payload: FeedbackPayload) => void;
|
|
467
|
+
/** Dismiss the feedback overlay: reveals the root component, or closes if there is none. */
|
|
468
|
+
dismissFeedback: () => void;
|
|
469
|
+
/** Close the host dialog entirely (clears both the root and any feedback). */
|
|
444
470
|
close: () => void;
|
|
445
471
|
};
|
|
446
472
|
|
|
@@ -485,9 +511,9 @@ export declare interface ElementColor {
|
|
|
485
511
|
background: string;
|
|
486
512
|
}
|
|
487
513
|
|
|
488
|
-
export declare const ElementDetail: DefineComponent<
|
|
514
|
+
export declare const ElementDetail: DefineComponent<__VLS_Props_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
489
515
|
edit: (attr: string, value: string) => any;
|
|
490
|
-
}, string, PublicProps, Readonly<
|
|
516
|
+
}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{
|
|
491
517
|
onEdit?: ((attr: string, value: string) => any) | undefined;
|
|
492
518
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
493
519
|
|
|
@@ -520,6 +546,36 @@ export declare type ExplorerNode = {
|
|
|
520
546
|
/** Map of named extension modules. */
|
|
521
547
|
export declare type ExtensionsConfig = Record<string, ExtensionModule>;
|
|
522
548
|
|
|
549
|
+
export declare const FeedbackDialog: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
550
|
+
dismiss: () => any;
|
|
551
|
+
retry: () => any;
|
|
552
|
+
}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{
|
|
553
|
+
onDismiss?: (() => any) | undefined;
|
|
554
|
+
onRetry?: (() => any) | undefined;
|
|
555
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
556
|
+
|
|
557
|
+
/** Customization for a feedback template — the message and optional actions shown to the user. */
|
|
558
|
+
export declare type FeedbackPayload = {
|
|
559
|
+
/** The primary, human-readable line. */
|
|
560
|
+
message: string;
|
|
561
|
+
/** Optional secondary block (e.g. an error stack), rendered verbatim. */
|
|
562
|
+
detail?: string;
|
|
563
|
+
/** Optional dialog heading; defaults to the variant's own title. */
|
|
564
|
+
title?: string;
|
|
565
|
+
/**
|
|
566
|
+
* Optional retry action. When set the feedback shows a Retry button that dismisses the
|
|
567
|
+
* overlay (returning to the root component if one is mounted) and runs this callback.
|
|
568
|
+
*/
|
|
569
|
+
onRetry?: () => void;
|
|
570
|
+
/** Label for the retry button (default `Retry`). */
|
|
571
|
+
retryLabel?: string;
|
|
572
|
+
/** Auto-dismiss the feedback after N ms — accessibility affordance for transient success. */
|
|
573
|
+
autoCloseMs?: number;
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
/** The built-in feedback flavours the host renders (error/success/warning templates). */
|
|
577
|
+
export declare type FeedbackVariant = 'error' | 'success' | 'warning';
|
|
578
|
+
|
|
523
579
|
/** Display metadata for a merged file (source or target), shown in the review header. */
|
|
524
580
|
export declare type FileMeta = {
|
|
525
581
|
/** Display name (filename, typically without extension). */
|
|
@@ -572,10 +628,10 @@ export declare type MergeNodeMeta = {
|
|
|
572
628
|
path?: string;
|
|
573
629
|
};
|
|
574
630
|
|
|
575
|
-
export declare const MergeReview: DefineComponent<
|
|
631
|
+
export declare const MergeReview: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
576
632
|
close: () => any;
|
|
577
633
|
applied: () => any;
|
|
578
|
-
}, string, PublicProps, Readonly<
|
|
634
|
+
}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{
|
|
579
635
|
onClose?: (() => any) | undefined;
|
|
580
636
|
onApplied?: (() => any) | undefined;
|
|
581
637
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -594,10 +650,10 @@ export declare type MergeSessionParams = {
|
|
|
594
650
|
afterApply?: AfterApply;
|
|
595
651
|
};
|
|
596
652
|
|
|
597
|
-
export declare const MergeTree: DefineComponent<
|
|
653
|
+
export declare const MergeTree: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
598
654
|
select: (node: ExplorerNode) => any;
|
|
599
655
|
"update:decision": (groupId: string, action: DecisionAction) => any;
|
|
600
|
-
}, string, PublicProps, Readonly<
|
|
656
|
+
}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{
|
|
601
657
|
onSelect?: ((node: ExplorerNode) => any) | undefined;
|
|
602
658
|
"onUpdate:decision"?: ((groupId: string, action: DecisionAction) => any) | undefined;
|
|
603
659
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
@@ -747,6 +803,6 @@ export declare function useProjectLiveData<T>(params: {
|
|
|
747
803
|
refresh: (delay?: number) => Promise<T | undefined>;
|
|
748
804
|
};
|
|
749
805
|
|
|
750
|
-
export declare const XmlDiff: DefineComponent<
|
|
806
|
+
export declare const XmlDiff: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
751
807
|
|
|
752
808
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -8,23 +8,24 @@ import o from "./dropdown/dropdown.js";
|
|
|
8
8
|
import s from "./dropdown/combobox.js";
|
|
9
9
|
import "./dropdown/index.js";
|
|
10
10
|
import c from "./dialog/dialog.js";
|
|
11
|
-
import
|
|
12
|
-
import p from "./dialog/dialog-host.js";
|
|
11
|
+
import l from "./dialog/feedback-dialog.js";
|
|
12
|
+
import { createDialogHost as u, dialogHostKey as d, provideDialogHost as f, useDialog as p } from "./dialog/use-dialog-host.js";
|
|
13
|
+
import m from "./dialog/dialog-host.js";
|
|
13
14
|
import "./dialog/index.js";
|
|
14
|
-
import { CATEGORY_ELEMENTS as
|
|
15
|
-
import { ELEMENT_TO_ICON as
|
|
16
|
-
import { collectExpandableNodeIds as
|
|
17
|
-
import
|
|
15
|
+
import { CATEGORY_ELEMENTS as h, ELEMENT_TO_COLOR as g } from "./icons/element-color-map.generated.js";
|
|
16
|
+
import { ELEMENT_TO_ICON as _ } from "./icons/element-icon-mapper.js";
|
|
17
|
+
import { collectExpandableNodeIds as v } from "./explorer/collect-expandable-node-ids.js";
|
|
18
|
+
import y from "./explorer/explorer.js";
|
|
18
19
|
import "./explorer/index.js";
|
|
19
|
-
import { highlightCode as
|
|
20
|
-
import
|
|
21
|
-
import { diffLines as
|
|
22
|
-
import
|
|
20
|
+
import { highlightCode as b } from "./code/highlight.js";
|
|
21
|
+
import x from "./code/code-block.js";
|
|
22
|
+
import { diffLines as S } from "./code/diff.js";
|
|
23
|
+
import C from "./code/xml-diff.js";
|
|
23
24
|
import "./code/index.js";
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { useMergeSession as
|
|
28
|
-
import
|
|
25
|
+
import w from "./merge/decision-toggle.js";
|
|
26
|
+
import T from "./merge/element-detail.js";
|
|
27
|
+
import E from "./merge/merge-tree.js";
|
|
28
|
+
import { useMergeSession as D } from "./merge/use-merge-session.js";
|
|
29
|
+
import O from "./merge/merge-review.js";
|
|
29
30
|
import "./merge/index.js";
|
|
30
|
-
export { a as Button,
|
|
31
|
+
export { a as Button, h as CATEGORY_ELEMENTS, x as CodeBlock, s as Combobox, w as DecisionToggle, c as Dialog, m as DialogHost, o as Dropdown, g as ELEMENT_TO_COLOR, _ as ELEMENT_TO_ICON, T as ElementDetail, l as FeedbackDialog, O as MergeReview, E as MergeTree, y as SclExplorer, C as XmlDiff, v as collectExpandableNodeIds, u as createDialogHost, e as createDocumentStore, d as dialogHostKey, S as diffLines, b as highlightCode, f as provideDialogHost, i as useActiveDocument, t as useDialecteChannel, p as useDialog, n as useLiveData, D as useMergeSession, r as useProjectLiveData };
|
|
@@ -92,6 +92,13 @@ async function i(e, n, r) {
|
|
|
92
92
|
conflict: n?.conflict
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
+
for (let [e, t] of i) a.some((t) => t.name === e) || a.push({
|
|
96
|
+
name: e,
|
|
97
|
+
status: "added",
|
|
98
|
+
after: t.conflict ? t.suggestedValue ?? "" : "",
|
|
99
|
+
editable: t.mode,
|
|
100
|
+
conflict: t.conflict
|
|
101
|
+
});
|
|
95
102
|
} else if (e.change === "removed" && e.instanceRef) {
|
|
96
103
|
let n = await t(r.targetQuery, e.instanceRef);
|
|
97
104
|
for (let [e, t] of Object.entries(n)) t != null && a.push({
|
|
@@ -114,6 +121,13 @@ async function i(e, n, r) {
|
|
|
114
121
|
after: t.after,
|
|
115
122
|
editable: i.get(t.name)?.mode
|
|
116
123
|
});
|
|
124
|
+
for (let [e, t] of i) c.has(e) || c.set(e, {
|
|
125
|
+
name: e,
|
|
126
|
+
status: "unchanged",
|
|
127
|
+
after: t.conflict ? t.suggestedValue ?? "" : "",
|
|
128
|
+
editable: t.mode,
|
|
129
|
+
conflict: t.conflict
|
|
130
|
+
});
|
|
117
131
|
a.push(...c.values());
|
|
118
132
|
}
|
|
119
133
|
return {
|
|
@@ -10,31 +10,31 @@ var u = {
|
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "badge badge-warning badge-xs shrink-0",
|
|
12
12
|
title: "Auto-resolved to avoid a naming collision — edit to override"
|
|
13
|
-
}, v = {
|
|
13
|
+
}, v = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "text-xs opacity-60"
|
|
16
|
-
},
|
|
16
|
+
}, y = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "grid h-full place-items-center p-4 text-sm opacity-60"
|
|
19
|
-
},
|
|
19
|
+
}, b = /*@__PURE__*/ a({
|
|
20
20
|
__name: "element-detail",
|
|
21
21
|
props: { detail: {} },
|
|
22
22
|
emits: ["edit"],
|
|
23
|
-
setup(a, { emit:
|
|
24
|
-
let
|
|
23
|
+
setup(a, { emit: b }) {
|
|
24
|
+
let x = a, S = b, C = t(() => ({
|
|
25
25
|
added: "badge-success",
|
|
26
26
|
removed: "badge-error",
|
|
27
27
|
modified: "badge-warning",
|
|
28
28
|
unchanged: "badge-ghost"
|
|
29
|
-
})[
|
|
30
|
-
function
|
|
31
|
-
|
|
29
|
+
})[x.detail?.change ?? "unchanged"]), w = t(() => x.detail?.attributes.filter((e) => e.editable));
|
|
30
|
+
function T(e, t) {
|
|
31
|
+
S("edit", e.name, t.target.value);
|
|
32
32
|
}
|
|
33
|
-
return (t,
|
|
33
|
+
return (t, b) => a.detail ? (s(), r("div", u, [i("header", d, [
|
|
34
34
|
i("span", f, l(a.detail.title), 1),
|
|
35
35
|
i("span", p, l(a.detail.tag), 1),
|
|
36
|
-
i("span", { class: o(["badge badge-sm",
|
|
37
|
-
]),
|
|
36
|
+
i("span", { class: o(["badge badge-sm", C.value]) }, l(a.detail.change), 3)
|
|
37
|
+
]), w.value?.length ? (s(), r("div", m, [(s(!0), r(e, null, c(w.value, (e) => (s(), r("label", {
|
|
38
38
|
key: e.name,
|
|
39
39
|
class: "flex items-center gap-2"
|
|
40
40
|
}, [
|
|
@@ -42,12 +42,11 @@ var u = {
|
|
|
42
42
|
i("input", {
|
|
43
43
|
class: o(["input input-xs input-bordered w-full font-mono", { "input-warning": e.conflict }]),
|
|
44
44
|
value: e.after ?? "",
|
|
45
|
-
onInput: (t) =>
|
|
45
|
+
onInput: (t) => T(e, t)
|
|
46
46
|
}, null, 42, g),
|
|
47
|
-
e.conflict ? (s(), r("span", _, " conflict ")) : n("", !0)
|
|
48
|
-
|
|
49
|
-
]))), 128))])) : (s(), r("div", y, "No editable fields. See the diff below."))])) : (s(), r("div", b, " Select an element to see its changes. "));
|
|
47
|
+
e.conflict ? (s(), r("span", _, " conflict ")) : n("", !0)
|
|
48
|
+
]))), 128))])) : (s(), r("div", v, "No editable fields. See the diff below."))])) : (s(), r("div", y, " Select an element to see its changes. "));
|
|
50
49
|
}
|
|
51
50
|
});
|
|
52
51
|
//#endregion
|
|
53
|
-
export {
|
|
52
|
+
export { b as default };
|