yamlite 0.36.0 → 0.38.0
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/README.md +19 -1
- package/dist/browser/sqlite.d.mts +1 -1
- package/dist/browser/sqlite.mjs +7 -3
- package/dist/cli.mjs +2 -2
- package/dist/core.d.mts +13 -1
- package/dist/core.mjs +3 -3
- package/dist/guide.md +2 -0
- package/dist/{index-BBHZ8yok.d.mts → index-OSyELQEX.d.mts} +6 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-O1FTGCot.mjs → src-DdRmp-vT.mjs} +489 -206
- package/dist/ui/assets/{ErdView-BFNQ9J0L.js → ErdView-Cv4lBB9J.js} +1 -1
- package/dist/ui/assets/{MarkdownField-DctsImcK.js → MarkdownField-UKgTcG0X.js} +1 -1
- package/dist/ui/assets/{PageView-ApxooX20.js → PageView-SFpedZG6.js} +1 -1
- package/dist/ui/assets/index-BnlDexUD.js +125 -0
- package/dist/ui/assets/index-BwkTtzmh.css +2 -0
- package/dist/ui/assets/{load-C74BIjnc.js → load-S46Mj3YT.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/ui-embed/{PageView-Cpq5JtTW.js → PageView-BzCYlXPg.js} +1 -1
- package/dist/ui-embed/embed.js +5491 -5347
- package/dist/ui-embed/{pageFrame-Dm62WvvT.js → pageFrame-CFoU6UjD.js} +850 -817
- package/dist/ui-embed/style.css +1 -1
- package/dist/{workspace-1vCIMAfl.mjs → workspace-B4WnIeHR.mjs} +24 -10
- package/package.json +1 -1
- package/dist/ui/assets/index-BIkG4xcY.css +0 -2
- package/dist/ui/assets/index-ryUZiqoX.js +0 -125
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { A as e, C as t, S as n, T as r, a as i, c as a, d as o, f as s, g as c, l, p as u, s as d, u as f, v as p, y as m } from "./theme-BwJfOY1V.js";
|
|
2
|
-
import { A as h, C as g, D as ee, G as _, K as v, L as te, Lt as y, M as b, O as x, P as S, Pt as C, R as w, S as T, _ as ne, _t as
|
|
3
|
-
import { F as
|
|
2
|
+
import { A as h, C as g, D as ee, G as _, K as v, L as te, Lt as y, M as b, O as x, P as S, Pt as C, R as w, S as T, _ as ne, _t as re, at as ie, bt as E, c as D, dt as ae, ft as O, g as oe, gt as se, h as ce, it as le, k as ue, l as k, lt as A, m as j, mt as de, n as fe, nt as pe, ot as M, pt as me, r as N, rt as he, s as ge, st as _e, tt as ve, v as ye, vt as be, x as xe, y as Se, yt as Ce } from "./HintPopover-D5P2UuTa.js";
|
|
3
|
+
import { F as we, a as Te, h as Ee, i as P, l as De, n as F, r as Oe, t as ke, u as Ae } from "./tabs-CLBiDAgo.js";
|
|
4
4
|
//#region node_modules/.pnpm/@tanstack+react-store@0.11.2_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@tanstack/react-store/dist/useSelector.js
|
|
5
|
-
var
|
|
6
|
-
function
|
|
5
|
+
var I = /* @__PURE__ */ e(t(), 1), je = /* @__PURE__ */ e(re(), 1);
|
|
6
|
+
function Me(e, t) {
|
|
7
7
|
return e === t;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
let r = n?.compare ??
|
|
9
|
+
function Ne(e, t = (e) => e, n) {
|
|
10
|
+
let r = n?.compare ?? Me, i = (0, I.useCallback)((t) => {
|
|
11
11
|
let { unsubscribe: n } = e.subscribe(t);
|
|
12
12
|
return n;
|
|
13
|
-
}, [e]), a = (0,
|
|
14
|
-
return (0,
|
|
13
|
+
}, [e]), a = (0, I.useCallback)(() => e.get(), [e]);
|
|
14
|
+
return (0, je.useSyncExternalStoreWithSelector)(i, a, a, t, r);
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region node_modules/.pnpm/@tanstack+react-router@1.170.44_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@tanstack/react-router/dist/esm/useMatch.js
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
let n =
|
|
18
|
+
var Pe = {};
|
|
19
|
+
function Fe(e, t) {
|
|
20
|
+
let n = I.useRef();
|
|
21
21
|
return (r) => {
|
|
22
22
|
let i = e?.select ? e.select(r) : r;
|
|
23
23
|
return e?.structuralSharing ?? t.options.defaultStructuralSharing ? n.current = y(n.current, i) : i;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
let t =
|
|
28
|
-
if (o !==
|
|
26
|
+
function Ie(e) {
|
|
27
|
+
let t = E(), n = I.useContext(e.from ? be : Ce), r = e.from ?? n, i = t.stores.getMatchStore(r), a = Fe(e, t), o = Ne(i, (e) => e ? a(e) : Pe);
|
|
28
|
+
if (o !== Pe) return o;
|
|
29
29
|
(e.shouldThrow ?? !0) && C();
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region node_modules/.pnpm/@tanstack+react-router@1.170.44_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@tanstack/react-router/dist/esm/useRouteContext.js
|
|
33
|
-
function
|
|
34
|
-
return
|
|
33
|
+
function Le(e) {
|
|
34
|
+
return Ie({
|
|
35
35
|
...e,
|
|
36
36
|
select: (t) => e.select ? e.select(t.context) : t.context
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region node_modules/.pnpm/@tanstack+query-core@5.104.3/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js
|
|
41
|
-
var
|
|
41
|
+
var Re = class extends pe {
|
|
42
42
|
constructor(e, t) {
|
|
43
43
|
super(e, t);
|
|
44
44
|
}
|
|
@@ -70,7 +70,7 @@ var Le = class extends N {
|
|
|
70
70
|
fetchNextPage: this.fetchNextPage,
|
|
71
71
|
fetchPreviousPage: this.fetchPreviousPage,
|
|
72
72
|
hasNextPage: he(t, n.data),
|
|
73
|
-
hasPreviousPage:
|
|
73
|
+
hasPreviousPage: le(t, n.data),
|
|
74
74
|
isFetchNextPageError: l,
|
|
75
75
|
isFetchingNextPage: u,
|
|
76
76
|
isFetchPreviousPageError: d,
|
|
@@ -79,7 +79,7 @@ var Le = class extends N {
|
|
|
79
79
|
isRefetching: a && !u && !f
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
},
|
|
82
|
+
}, ze = class extends M {
|
|
83
83
|
#e;
|
|
84
84
|
#t = void 0;
|
|
85
85
|
#n;
|
|
@@ -92,11 +92,11 @@ var Le = class extends N {
|
|
|
92
92
|
}
|
|
93
93
|
setOptions(e) {
|
|
94
94
|
let t = this.options;
|
|
95
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
95
|
+
this.options = this.#e.defaultMutationOptions(e), ae(this.options, t) || this.#e.getMutationCache().notify({
|
|
96
96
|
type: "observerOptionsUpdated",
|
|
97
97
|
mutation: this.#n,
|
|
98
98
|
observer: this
|
|
99
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
99
|
+
}), t?.mutationKey && this.options.mutationKey && _e(t.mutationKey) !== _e(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
100
100
|
}
|
|
101
101
|
onSubscribe() {
|
|
102
102
|
this.listeners.size === 1 && this.#n && (this.#n.addObserver(this), this.#i());
|
|
@@ -117,7 +117,7 @@ var Le = class extends N {
|
|
|
117
117
|
return this.#r = t, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(e);
|
|
118
118
|
}
|
|
119
119
|
#i() {
|
|
120
|
-
let e = this.#n?.state ??
|
|
120
|
+
let e = this.#n?.state ?? ve();
|
|
121
121
|
this.#t = {
|
|
122
122
|
...e,
|
|
123
123
|
isPending: e.status === "pending",
|
|
@@ -129,7 +129,7 @@ var Le = class extends N {
|
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
#a(e) {
|
|
132
|
-
|
|
132
|
+
ie.batch(() => {
|
|
133
133
|
let t = this.#r;
|
|
134
134
|
if (t && this.hasListeners()) {
|
|
135
135
|
let n = this.#t.variables, r = this.#t.context, i = {
|
|
@@ -169,15 +169,15 @@ var Le = class extends N {
|
|
|
169
169
|
};
|
|
170
170
|
//#endregion
|
|
171
171
|
//#region node_modules/.pnpm/@tanstack+react-query@5.104.3_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
172
|
-
function
|
|
173
|
-
let n =
|
|
174
|
-
|
|
172
|
+
function Be(e, t) {
|
|
173
|
+
let n = me(t), [r] = I.useState(() => new ze(n, e));
|
|
174
|
+
I.useEffect(() => {
|
|
175
175
|
r.setOptions(e);
|
|
176
176
|
}, [r, e]);
|
|
177
|
-
let i =
|
|
178
|
-
r.mutate(e[0], e[1]).catch(
|
|
177
|
+
let i = I.useSyncExternalStore(I.useCallback((e) => r.subscribe(ie.batchCalls(e)), [r]), () => r.getCurrentResult(), () => r.getCurrentResult()), a = I.useCallback((...e) => {
|
|
178
|
+
r.mutate(e[0], e[1]).catch(A);
|
|
179
179
|
}, [r]);
|
|
180
|
-
if (i.error &&
|
|
180
|
+
if (i.error && O(r.options.throwOnError, [i.error])) throw i.error;
|
|
181
181
|
return {
|
|
182
182
|
...i,
|
|
183
183
|
mutate: a,
|
|
@@ -186,31 +186,31 @@ function ze(e, t) {
|
|
|
186
186
|
}
|
|
187
187
|
//#endregion
|
|
188
188
|
//#region node_modules/.pnpm/@tanstack+react-query@5.104.3_react@19.3.1/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js
|
|
189
|
-
function
|
|
190
|
-
return v(e,
|
|
189
|
+
function Ve(e, t) {
|
|
190
|
+
return v(e, Re, t);
|
|
191
191
|
}
|
|
192
192
|
//#endregion
|
|
193
193
|
//#region ui/src/paraglide/messages/common_cancel.js
|
|
194
|
-
var
|
|
194
|
+
var He = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "キャンセル" : "Cancel"), L = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "閉じる" : "Close"), Ue = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "削除" : "Delete"), We = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "切断中" : "disconnected"), Ge = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "読み込み中…" : "Loading…"), Ke = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "保存" : "Save"), qe = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "追加" : "Add"), Je = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "+ 追加" : "+ add"), Ye = (e) => `add to ${e?.field}`, Xe = (e) => `${e?.field} に追加`, Ze = ((e, t = {}) => (t.locale ?? r()) === "ja" ? Xe(e) : Ye(e)), Qe = (e) => `${e?.field} as ${e?.kind}`, $e = (e) => `${e?.field} を ${e?.kind} で編集`, et = ((e, t = {}) => (t.locale ?? r()) === "ja" ? $e(e) : Qe(e)), tt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "種類を変える" : "Change type"), nt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "この項目を空にして、種類を選び直しますか?" : "Clear this field and choose another type?"), rt = (e) => `Change type of ${e?.field}`, it = (e) => `${e?.field} の種類を変える`, at = ((e, t = {}) => (t.locale ?? r()) === "ja" ? it(e) : rt(e)), ot = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "+ キー" : "+ key"), st = (e) => `new key in ${e?.field}`, ct = (e) => `${e?.field} の新しいキー`, lt = ((e, t = {}) => (t.locale ?? r()) === "ja" ? ct(e) : st(e)), ut = (e) => `remove ${e?.item}`, dt = (e) => `${e?.item} を削除`, ft = ((e, t = {}) => (t.locale ?? r()) === "ja" ? dt(e) : ut(e)), pt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "— (未設定)" : "— (unset)"), mt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "作成" : "Created"), ht = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "削除" : "Deleted"), gt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "フィールド" : "Fields"), _t = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "たった今" : "just now"), vt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "さらに古い履歴を読み込む" : "Load older history"), yt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "まだコミットされていません" : "Not committed yet"), bt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "コミットすると、ここに変更が並びます。" : "Once you commit, changes show up here."), xt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "git の履歴はありません" : "No git history"), St = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "このフォルダは git リポジトリの外にあります。" : "This folder is outside a git repository."), Ct = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "値の変更はありません" : "No value changes"), wt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "(なし)" : "(none)"), Tt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "この版に戻す" : "Restore this version"), Et = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "この時点の値をフォームに入れます(保存はしません)" : "Puts this version's values into the form (does not save)"), Dt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "今の値と同じです" : "Same as the current values"), Ot = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "未コミット" : "Uncommitted"), kt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "読めない版です" : "This version can't be read"), At = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "未コミットの変更" : "Uncommitted changes"), jt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "YAML の差分" : "YAML diff"), Mt = (e) => {
|
|
195
195
|
let t = b("en", e?.count, {}, !0);
|
|
196
196
|
return t === "one" ? `⋯ ${e?.count} unchanged line` : t === "other" ? `⋯ ${e?.count} unchanged lines` : "proposal_unchanged_lines";
|
|
197
|
-
},
|
|
197
|
+
}, Nt = (e) => `⋯ 変更のない ${e?.count} 行`, Pt = ((e, t = {}) => (t.locale ?? r()) === "ja" ? Nt(e) : Mt(e)), Ft = (e) => {
|
|
198
198
|
let t = b("en", e?.count, {}, !0);
|
|
199
199
|
return t === "one" ? `${e?.count} change · saving writes it to the file` : t === "other" ? `${e?.count} changes · saving writes them to the file` : "record_changes";
|
|
200
|
-
},
|
|
200
|
+
}, It = (e) => `変更 ${e?.count} 件 · 保存するとファイルに反映`, Lt = ((e, t = {}) => (t.locale ?? r()) === "ja" ? It(e) : Ft(e)), Rt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "レコードを削除" : "delete record"), zt = (e) => `It is also removed from ${e?.file}.`, Bt = (e) => `${e?.file} からも削除されます。`, Vt = ((e, t = {}) => (t.locale ?? r()) === "ja" ? Bt(e) : zt(e)), Ht = (e) => `Delete ${e?.key}?`, Ut = (e) => `${e?.key} を削除しますか?`, Wt = ((e, t = {}) => (t.locale ?? r()) === "ja" ? Ut(e) : Ht(e)), Gt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "破棄" : "Discard"), Kt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "接続が切れています" : "Connection lost"), qt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "レコードのファイル" : "record file"), Jt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "レコードの JSON" : "record JSON"), Yt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "レコードは JSON オブジェクトにしてください" : "a record must be a JSON object"), Xt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "レコード" : "record"), Zt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "新規" : "new"), Qt = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "上書き" : "Overwrite"), $t = (e) => `⚠ Not reflected: ${e?.reason}`, en = (e) => `⚠ 反映されませんでした: ${e?.reason}`, tn = ((e, t = {}) => (t.locale ?? r()) === "ja" ? en(e) : $t(e)), nn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "反映待ち" : "Waiting to reflect"), rn = (e) => `Reflected to ${e?.file}`, an = (e) => `${e?.file} に反映済み`, on = ((e, t = {}) => (t.locale ?? r()) === "ja" ? an(e) : rn(e)), sn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "反映中…" : "Reflecting…"), cn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "最新を読み込む" : "Load latest"), ln = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "必須" : "required"), R = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "レコードパネルの幅を変更" : "Resize record panel"), un = (e) => {
|
|
201
201
|
let t = b("en", e?.count, {}, !0);
|
|
202
202
|
return t === "one" ? `Restored the values from ${e?.from} · ${e?.count} field unsaved` : t === "other" ? `Restored the values from ${e?.from} · ${e?.count} fields unsaved` : "record_restored";
|
|
203
|
-
},
|
|
203
|
+
}, dn = (e) => `${e?.from} の値に戻しました · ${e?.count} 項目が未保存`, fn = ((e, t = {}) => (t.locale ?? r()) === "ja" ? dn(e) : un(e)), pn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "保存 ⌘S" : "Save ⌘S"), mn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "読み込んだあとに、ファイルか DB で次のフィールドが変わりました。" : "After you loaded it, these fields changed in the file or the DB."), hn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "あなたの編集" : "Your edit"), gn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "いまの値" : "Current value"), _n = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "他で変更されました" : "Changed elsewhere"), vn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "ファイル" : "File"), yn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "フォーム" : "Form"), bn = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "履歴" : "History"), z = n(), xn = Object.defineProperty, B = (e, t) => xn(e, "name", {
|
|
204
204
|
value: t,
|
|
205
205
|
configurable: !0
|
|
206
|
-
}),
|
|
207
|
-
let { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: o = !0 } = e, s =
|
|
206
|
+
}), Sn = "Dialog", [Cn, wn] = s(Sn), [Tn, V] = Cn(Sn), En = /* @__PURE__ */ B((e) => {
|
|
207
|
+
let { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: o = !0 } = e, s = I.useRef(null), c = I.useRef(null), { nodes: u, registry: f } = xe(), [p, m] = l({
|
|
208
208
|
prop: r,
|
|
209
209
|
defaultProp: i ?? !1,
|
|
210
210
|
onChange: a,
|
|
211
|
-
caller:
|
|
212
|
-
}), [h, g] =
|
|
213
|
-
return /* @__PURE__ */ (0,
|
|
211
|
+
caller: Sn
|
|
212
|
+
}), [h, g] = I.useState(0), [ee, _] = I.useState(0);
|
|
213
|
+
return /* @__PURE__ */ (0, z.jsx)(Tn, {
|
|
214
214
|
scope: t,
|
|
215
215
|
triggerRef: s,
|
|
216
216
|
contentRef: c,
|
|
@@ -223,43 +223,43 @@ var Ve = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "キャンセル" : "
|
|
|
223
223
|
setDescriptionCount: _,
|
|
224
224
|
open: p,
|
|
225
225
|
onOpenChange: m,
|
|
226
|
-
onOpenToggle:
|
|
226
|
+
onOpenToggle: I.useCallback(() => m((e) => !e), [m]),
|
|
227
227
|
modal: o,
|
|
228
228
|
branchNodes: u,
|
|
229
229
|
branchRegistry: f,
|
|
230
230
|
children: n
|
|
231
231
|
});
|
|
232
|
-
}, "Dialog"),
|
|
233
|
-
let { __scopeDialog: t, forceMount: n, children: r, container: i } = e, o =
|
|
234
|
-
return /* @__PURE__ */ (0,
|
|
232
|
+
}, "Dialog"), Dn = "DialogPortal", [On, kn] = Cn(Dn, { forceMount: void 0 }), An = /* @__PURE__ */ B((e) => {
|
|
233
|
+
let { __scopeDialog: t, forceMount: n, children: r, container: i } = e, o = V(Dn, t);
|
|
234
|
+
return /* @__PURE__ */ (0, z.jsx)(On, {
|
|
235
235
|
scope: t,
|
|
236
236
|
forceMount: n,
|
|
237
|
-
children:
|
|
237
|
+
children: I.Children.map(r, (e) => /* @__PURE__ */ (0, z.jsx)(a, {
|
|
238
238
|
present: n || o.open,
|
|
239
|
-
children: /* @__PURE__ */ (0,
|
|
239
|
+
children: /* @__PURE__ */ (0, z.jsx)(ne, {
|
|
240
240
|
asChild: !0,
|
|
241
241
|
container: i,
|
|
242
242
|
children: e
|
|
243
243
|
})
|
|
244
244
|
}))
|
|
245
245
|
});
|
|
246
|
-
}, "DialogPortal"),
|
|
247
|
-
let n = jn
|
|
248
|
-
return o.modal ? /* @__PURE__ */ (0,
|
|
246
|
+
}, "DialogPortal"), jn = "DialogOverlay", Mn = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
247
|
+
let n = kn(jn, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, o = V(jn, e.__scopeDialog);
|
|
248
|
+
return o.modal ? /* @__PURE__ */ (0, z.jsx)(a, {
|
|
249
249
|
present: r || o.open,
|
|
250
|
-
children: /* @__PURE__ */ (0,
|
|
250
|
+
children: /* @__PURE__ */ (0, z.jsx)(Pn, {
|
|
251
251
|
...i,
|
|
252
252
|
ref: t
|
|
253
253
|
})
|
|
254
254
|
}) : null;
|
|
255
|
-
}, "DialogOverlay")),
|
|
256
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
257
|
-
return /* @__PURE__ */ (0,
|
|
258
|
-
as:
|
|
255
|
+
}, "DialogOverlay")), Nn = c("DialogOverlay.RemoveScroll"), Pn = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
256
|
+
let { __scopeDialog: n, ...r } = e, i = V(jn, n), a = g(), o = p(t, a);
|
|
257
|
+
return /* @__PURE__ */ (0, z.jsx)(ce, {
|
|
258
|
+
as: Nn,
|
|
259
259
|
allowPinchZoom: !0,
|
|
260
|
-
shards:
|
|
261
|
-
children: /* @__PURE__ */ (0,
|
|
262
|
-
"data-state":
|
|
260
|
+
shards: I.useMemo(() => [i.contentRef, ...i.branchNodes.map((e) => ({ current: e }))], [i.contentRef, i.branchNodes]),
|
|
261
|
+
children: /* @__PURE__ */ (0, z.jsx)(u.div, {
|
|
262
|
+
"data-state": Wn(i.open),
|
|
263
263
|
...r,
|
|
264
264
|
ref: o,
|
|
265
265
|
style: {
|
|
@@ -268,24 +268,24 @@ var Ve = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "キャンセル" : "
|
|
|
268
268
|
}
|
|
269
269
|
})
|
|
270
270
|
});
|
|
271
|
-
}, "DialogOverlayImpl")),
|
|
272
|
-
let n =
|
|
273
|
-
return /* @__PURE__ */ (0,
|
|
271
|
+
}, "DialogOverlayImpl")), H = "DialogContent", Fn = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
272
|
+
let n = kn(H, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, o = V(H, e.__scopeDialog);
|
|
273
|
+
return /* @__PURE__ */ (0, z.jsx)(a, {
|
|
274
274
|
present: r || o.open,
|
|
275
|
-
children: o.modal ? /* @__PURE__ */ (0,
|
|
275
|
+
children: o.modal ? /* @__PURE__ */ (0, z.jsx)(In, {
|
|
276
276
|
...i,
|
|
277
277
|
ref: t
|
|
278
|
-
}) : /* @__PURE__ */ (0,
|
|
278
|
+
}) : /* @__PURE__ */ (0, z.jsx)(Ln, {
|
|
279
279
|
...i,
|
|
280
280
|
ref: t
|
|
281
281
|
})
|
|
282
282
|
});
|
|
283
|
-
}, "DialogContent")),
|
|
284
|
-
let n =
|
|
285
|
-
return
|
|
283
|
+
}, "DialogContent")), In = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
284
|
+
let n = V(H, e.__scopeDialog), r = I.useRef(null), i = p(t, n.contentRef, r);
|
|
285
|
+
return I.useEffect(() => {
|
|
286
286
|
let e = r.current;
|
|
287
|
-
if (e) return
|
|
288
|
-
}, []), /* @__PURE__ */ (0,
|
|
287
|
+
if (e) return j(e);
|
|
288
|
+
}, []), /* @__PURE__ */ (0, z.jsx)(Rn, {
|
|
289
289
|
...e,
|
|
290
290
|
ref: i,
|
|
291
291
|
trapFocus: n.open,
|
|
@@ -299,9 +299,9 @@ var Ve = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "キャンセル" : "
|
|
|
299
299
|
}),
|
|
300
300
|
onFocusOutside: f(e.onFocusOutside, (e) => e.preventDefault())
|
|
301
301
|
});
|
|
302
|
-
}, "DialogContentModal")),
|
|
303
|
-
let n =
|
|
304
|
-
return /* @__PURE__ */ (0,
|
|
302
|
+
}, "DialogContentModal")), Ln = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
303
|
+
let n = V(H, e.__scopeDialog), r = I.useRef(!1), i = I.useRef(!1);
|
|
304
|
+
return /* @__PURE__ */ (0, z.jsx)(Rn, {
|
|
305
305
|
...e,
|
|
306
306
|
ref: t,
|
|
307
307
|
trapFocus: !1,
|
|
@@ -315,23 +315,23 @@ var Ve = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "キャンセル" : "
|
|
|
315
315
|
n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
|
|
316
316
|
}
|
|
317
317
|
});
|
|
318
|
-
}, "DialogContentNonModal")),
|
|
319
|
-
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, "aria-describedby": o, children: s, ...c } = e, l =
|
|
320
|
-
return
|
|
318
|
+
}, "DialogContentNonModal")), Rn = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
319
|
+
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, "aria-describedby": o, children: s, ...c } = e, l = V(H, n);
|
|
320
|
+
return oe(), /* @__PURE__ */ (0, z.jsx)(Se, {
|
|
321
321
|
registry: l.branchRegistry,
|
|
322
|
-
children: /* @__PURE__ */ (0,
|
|
322
|
+
children: /* @__PURE__ */ (0, z.jsx)(ye, {
|
|
323
323
|
asChild: !0,
|
|
324
324
|
loop: !0,
|
|
325
325
|
trapped: r,
|
|
326
326
|
branches: l.branchNodes,
|
|
327
327
|
onMountAutoFocus: i,
|
|
328
328
|
onUnmountAutoFocus: a,
|
|
329
|
-
children: /* @__PURE__ */ (0,
|
|
329
|
+
children: /* @__PURE__ */ (0, z.jsx)(T, {
|
|
330
330
|
role: "dialog",
|
|
331
331
|
id: l.contentId,
|
|
332
332
|
"aria-labelledby": l.titlePresent ? l.titleId : void 0,
|
|
333
|
-
"aria-describedby": l.descriptionPresent ?
|
|
334
|
-
"data-state":
|
|
333
|
+
"aria-describedby": l.descriptionPresent ? Un(o, l.descriptionId) : o,
|
|
334
|
+
"data-state": Wn(l.open),
|
|
335
335
|
...c,
|
|
336
336
|
ref: t,
|
|
337
337
|
deferPointerDownOutside: !0,
|
|
@@ -340,42 +340,42 @@ var Ve = ((e = {}, t = {}) => (t.locale ?? r()) === "ja" ? "キャンセル" : "
|
|
|
340
340
|
})
|
|
341
341
|
})
|
|
342
342
|
});
|
|
343
|
-
}, "DialogContentImpl")),
|
|
344
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
345
|
-
return o(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ (0,
|
|
343
|
+
}, "DialogContentImpl")), zn = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
344
|
+
let { __scopeDialog: n, ...r } = e, i = V("DialogTitle", n), { setTitleCount: a } = i;
|
|
345
|
+
return o(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ (0, z.jsx)(u.h2, {
|
|
346
346
|
id: i.titleId,
|
|
347
347
|
...r,
|
|
348
348
|
ref: t
|
|
349
349
|
});
|
|
350
|
-
}, "DialogTitle")),
|
|
351
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
352
|
-
return o(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ (0,
|
|
350
|
+
}, "DialogTitle")), Bn = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
351
|
+
let { __scopeDialog: n, ...r } = e, i = V("DialogDescription", n), { setDescriptionCount: a } = i;
|
|
352
|
+
return o(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ (0, z.jsx)(u.p, {
|
|
353
353
|
id: i.descriptionId,
|
|
354
354
|
...r,
|
|
355
355
|
ref: t
|
|
356
356
|
});
|
|
357
|
-
}, "DialogDescription")),
|
|
358
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
359
|
-
return /* @__PURE__ */ (0,
|
|
357
|
+
}, "DialogDescription")), Vn = "DialogClose", Hn = /* @__PURE__ */ I.forwardRef(/* @__PURE__ */ B(function(e, t) {
|
|
358
|
+
let { __scopeDialog: n, ...r } = e, i = V(Vn, n);
|
|
359
|
+
return /* @__PURE__ */ (0, z.jsx)(u.button, {
|
|
360
360
|
type: "button",
|
|
361
361
|
...r,
|
|
362
362
|
ref: t,
|
|
363
363
|
onClick: f(e.onClick, () => i.onOpenChange(!1))
|
|
364
364
|
});
|
|
365
365
|
}, "DialogClose"));
|
|
366
|
-
function
|
|
366
|
+
function Un(...e) {
|
|
367
367
|
let t = /* @__PURE__ */ new Set();
|
|
368
368
|
for (let n of e) if (typeof n == "string") for (let e of String(n).trim().split(/\s+/)) e && t.add(e);
|
|
369
369
|
return t.size > 0 ? Array.from(t).join(" ") : void 0;
|
|
370
370
|
}
|
|
371
|
-
|
|
372
|
-
function
|
|
371
|
+
B(Un, "concatAriaDescribedby");
|
|
372
|
+
function Wn(e) {
|
|
373
373
|
return e ? "open" : "closed";
|
|
374
374
|
}
|
|
375
|
-
|
|
375
|
+
B(Wn, "getState");
|
|
376
376
|
//#endregion
|
|
377
377
|
//#region node_modules/.pnpm/lucide-react@1.58.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/arrow-left.mjs
|
|
378
|
-
var
|
|
378
|
+
var Gn = {
|
|
379
379
|
name: "arrow-left",
|
|
380
380
|
size: 24,
|
|
381
381
|
node: [["path", {
|
|
@@ -386,8 +386,8 @@ var qn = {
|
|
|
386
386
|
key: "x3x0zl"
|
|
387
387
|
}]]
|
|
388
388
|
};
|
|
389
|
-
|
|
390
|
-
var
|
|
389
|
+
Gn.node;
|
|
390
|
+
var Kn = D(Gn), qn = {
|
|
391
391
|
name: "arrow-up-right",
|
|
392
392
|
size: 24,
|
|
393
393
|
node: [["path", {
|
|
@@ -398,8 +398,8 @@ var Jn = k(qn), Yn = {
|
|
|
398
398
|
key: "1vkiza"
|
|
399
399
|
}]]
|
|
400
400
|
};
|
|
401
|
-
|
|
402
|
-
var
|
|
401
|
+
qn.node;
|
|
402
|
+
var Jn = D(qn), Yn = {
|
|
403
403
|
name: "calendar",
|
|
404
404
|
size: 24,
|
|
405
405
|
node: [
|
|
@@ -425,8 +425,8 @@ var Xn = k(Yn), Zn = {
|
|
|
425
425
|
}]
|
|
426
426
|
]
|
|
427
427
|
};
|
|
428
|
-
|
|
429
|
-
var
|
|
428
|
+
Yn.node;
|
|
429
|
+
var Xn = D(Yn), Zn = {
|
|
430
430
|
name: "clock",
|
|
431
431
|
size: 24,
|
|
432
432
|
node: [["circle", {
|
|
@@ -439,8 +439,8 @@ var Qn = k(Zn), $n = {
|
|
|
439
439
|
key: "mmk7yg"
|
|
440
440
|
}]]
|
|
441
441
|
};
|
|
442
|
-
|
|
443
|
-
var
|
|
442
|
+
Zn.node;
|
|
443
|
+
var Qn = D(Zn), $n = {
|
|
444
444
|
name: "trash",
|
|
445
445
|
size: 24,
|
|
446
446
|
node: [
|
|
@@ -467,8 +467,8 @@ var er = k($n), tr = {
|
|
|
467
467
|
],
|
|
468
468
|
aliases: ["trash-2"]
|
|
469
469
|
};
|
|
470
|
-
|
|
471
|
-
var
|
|
470
|
+
$n.node;
|
|
471
|
+
var er = D($n), tr = {
|
|
472
472
|
name: "type",
|
|
473
473
|
size: 24,
|
|
474
474
|
node: [
|
|
@@ -486,8 +486,8 @@ var nr = k(tr), rr = {
|
|
|
486
486
|
}]
|
|
487
487
|
]
|
|
488
488
|
};
|
|
489
|
-
|
|
490
|
-
var
|
|
489
|
+
tr.node;
|
|
490
|
+
var nr = D(tr), rr = {
|
|
491
491
|
name: "x",
|
|
492
492
|
size: 24,
|
|
493
493
|
node: [["path", {
|
|
@@ -498,12 +498,12 @@ var ir = k(rr), ar = {
|
|
|
498
498
|
key: "d8bk6v"
|
|
499
499
|
}]]
|
|
500
500
|
};
|
|
501
|
-
|
|
502
|
-
var
|
|
501
|
+
rr.node;
|
|
502
|
+
var U = D(rr);
|
|
503
503
|
//#endregion
|
|
504
504
|
//#region ui/src/components/ui/input.tsx
|
|
505
|
-
function
|
|
506
|
-
return /* @__PURE__ */ (0,
|
|
505
|
+
function W({ className: e, type: t, ...n }) {
|
|
506
|
+
return /* @__PURE__ */ (0, z.jsx)("input", {
|
|
507
507
|
type: t,
|
|
508
508
|
"data-slot": "input",
|
|
509
509
|
className: m("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", e),
|
|
@@ -512,81 +512,81 @@ function U({ className: e, type: t, ...n }) {
|
|
|
512
512
|
}
|
|
513
513
|
//#endregion
|
|
514
514
|
//#region ui/src/components/ui/dialog.tsx
|
|
515
|
-
function
|
|
516
|
-
return /* @__PURE__ */ (0,
|
|
515
|
+
function ir({ ...e }) {
|
|
516
|
+
return /* @__PURE__ */ (0, z.jsx)(En, {
|
|
517
517
|
"data-slot": "dialog",
|
|
518
518
|
...e
|
|
519
519
|
});
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
return /* @__PURE__ */ (0,
|
|
521
|
+
function ar({ ...e }) {
|
|
522
|
+
return /* @__PURE__ */ (0, z.jsx)(An, {
|
|
523
523
|
"data-slot": "dialog-portal",
|
|
524
524
|
...e
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
return /* @__PURE__ */ (0,
|
|
527
|
+
function or({ className: e, ...t }) {
|
|
528
|
+
return /* @__PURE__ */ (0, z.jsx)(Mn, {
|
|
529
529
|
"data-slot": "dialog-overlay",
|
|
530
530
|
className: m("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", e),
|
|
531
531
|
...t
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
-
var
|
|
535
|
-
function
|
|
536
|
-
return /* @__PURE__ */ (0,
|
|
534
|
+
var sr = "flex flex-col gap-0 overflow-hidden p-0 max-md:overflow-hidden md:max-h-[85vh]", cr = "shrink-0 border-t bg-background px-6 py-3 max-md:pb-[calc(0.75rem+env(safe-area-inset-bottom))]";
|
|
535
|
+
function lr({ className: e, children: t, showCloseButton: n = !0, pinned: r = !1, ...i }) {
|
|
536
|
+
return /* @__PURE__ */ (0, z.jsxs)(ar, {
|
|
537
537
|
"data-slot": "dialog-portal",
|
|
538
|
-
children: [/* @__PURE__ */ (0,
|
|
538
|
+
children: [/* @__PURE__ */ (0, z.jsx)(or, {}), /* @__PURE__ */ (0, z.jsxs)(Fn, {
|
|
539
539
|
"data-slot": "dialog-content",
|
|
540
|
-
className: m("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg", "max-md:inset-0 max-md:top-0 max-md:left-0 max-md:h-dvh max-md:max-w-none max-md:translate-x-0 max-md:translate-y-0 max-md:flex max-md:flex-col max-md:overflow-auto max-md:rounded-none max-md:border-0 max-md:pt-[calc(1.5rem+env(safe-area-inset-top))]", r &&
|
|
540
|
+
className: m("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg", "max-md:inset-0 max-md:top-0 max-md:left-0 max-md:h-dvh max-md:max-w-none max-md:translate-x-0 max-md:translate-y-0 max-md:flex max-md:flex-col max-md:overflow-auto max-md:rounded-none max-md:border-0 max-md:pt-[calc(1.5rem+env(safe-area-inset-top))]", r && sr, e),
|
|
541
541
|
...i,
|
|
542
|
-
children: [t, n && /* @__PURE__ */ (0,
|
|
542
|
+
children: [t, n && /* @__PURE__ */ (0, z.jsxs)(Hn, {
|
|
543
543
|
"data-slot": "dialog-close",
|
|
544
544
|
className: "absolute top-4 right-4 rounded-xs max-md:top-[calc(0.75rem+env(safe-area-inset-top))] max-md:right-2 max-md:grid max-md:size-10 max-md:place-items-center opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
545
|
-
children: [/* @__PURE__ */ (0,
|
|
545
|
+
children: [/* @__PURE__ */ (0, z.jsx)(U, {}), /* @__PURE__ */ (0, z.jsx)("span", {
|
|
546
546
|
className: "sr-only",
|
|
547
|
-
children:
|
|
547
|
+
children: L()
|
|
548
548
|
})]
|
|
549
549
|
})]
|
|
550
550
|
})]
|
|
551
551
|
});
|
|
552
552
|
}
|
|
553
|
-
function
|
|
554
|
-
return /* @__PURE__ */ (0,
|
|
553
|
+
function ur({ className: e, pinned: t = !1, ...n }) {
|
|
554
|
+
return /* @__PURE__ */ (0, z.jsx)("div", {
|
|
555
555
|
"data-slot": "dialog-header",
|
|
556
556
|
className: m("flex flex-col gap-2 text-center sm:text-left", t && "shrink-0 border-b px-6 pt-6 pr-12 pb-4 max-md:pt-0", e),
|
|
557
557
|
...n
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
return /* @__PURE__ */ (0,
|
|
560
|
+
function dr({ className: e, ...t }) {
|
|
561
|
+
return /* @__PURE__ */ (0, z.jsx)("div", {
|
|
562
562
|
"data-slot": "dialog-body",
|
|
563
563
|
className: m("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 py-4", e),
|
|
564
564
|
...t
|
|
565
565
|
});
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
return /* @__PURE__ */ (0,
|
|
567
|
+
function fr({ className: e, showCloseButton: t = !1, pinned: n = !1, children: r, ...i }) {
|
|
568
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
569
569
|
"data-slot": "dialog-footer",
|
|
570
|
-
className: m("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", n ?
|
|
570
|
+
className: m("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", n ? cr : "max-md:sticky max-md:bottom-0 max-md:-mx-6 max-md:-mb-6 max-md:mt-auto max-md:border-t max-md:bg-background max-md:px-6 max-md:pt-3 max-md:pb-[calc(0.75rem+env(safe-area-inset-bottom))]", e),
|
|
571
571
|
...i,
|
|
572
|
-
children: [r, t && /* @__PURE__ */ (0,
|
|
572
|
+
children: [r, t && /* @__PURE__ */ (0, z.jsx)(Hn, {
|
|
573
573
|
asChild: !0,
|
|
574
|
-
children: /* @__PURE__ */ (0,
|
|
574
|
+
children: /* @__PURE__ */ (0, z.jsx)(k, {
|
|
575
575
|
variant: "outline",
|
|
576
|
-
children:
|
|
576
|
+
children: L()
|
|
577
577
|
})
|
|
578
578
|
})]
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
return /* @__PURE__ */ (0,
|
|
581
|
+
function pr({ className: e, ...t }) {
|
|
582
|
+
return /* @__PURE__ */ (0, z.jsx)(zn, {
|
|
583
583
|
"data-slot": "dialog-title",
|
|
584
584
|
className: m("text-lg leading-none font-semibold", e),
|
|
585
585
|
...t
|
|
586
586
|
});
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
return /* @__PURE__ */ (0,
|
|
588
|
+
function mr({ className: e, ...t }) {
|
|
589
|
+
return /* @__PURE__ */ (0, z.jsx)(Bn, {
|
|
590
590
|
"data-slot": "dialog-description",
|
|
591
591
|
className: m("text-sm text-muted-foreground", e),
|
|
592
592
|
...t
|
|
@@ -594,7 +594,7 @@ function gr({ className: e, ...t }) {
|
|
|
594
594
|
}
|
|
595
595
|
//#endregion
|
|
596
596
|
//#region ui/src/components/ui/field.ts
|
|
597
|
-
var
|
|
597
|
+
var hr = "text-[12px] font-semibold tracking-wider text-muted-foreground uppercase max-md:text-[13px]", gr = "text-[12px] font-semibold text-muted-foreground max-md:text-[13px]", _r = "h-9 rounded-md border bg-background px-2 text-base md:text-sm", vr = "w-56 max-md:w-full", yr = "inline-flex items-center rounded-full bg-chip py-0.5 pr-1 pl-2.5 text-[13px] text-chip-foreground", br = /^(\d{4})-(\d{2})-(\d{2})$/, xr = /^(\d{4}-\d{2}-\d{2})([T ])(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-](\d{2}):(\d{2}))?$/, Sr = [
|
|
598
598
|
31,
|
|
599
599
|
28,
|
|
600
600
|
31,
|
|
@@ -607,24 +607,24 @@ var _r = "text-[12px] font-semibold tracking-wider text-muted-foreground upperca
|
|
|
607
607
|
31,
|
|
608
608
|
30,
|
|
609
609
|
31
|
|
610
|
-
],
|
|
611
|
-
function
|
|
610
|
+
], Cr = (e) => e % 4 == 0 && e % 100 != 0 || e % 400 == 0;
|
|
611
|
+
function wr(e) {
|
|
612
612
|
if (typeof e != "string") return !1;
|
|
613
|
-
let t =
|
|
613
|
+
let t = br.exec(e);
|
|
614
614
|
if (!t) return !1;
|
|
615
615
|
let [n, r, i] = [
|
|
616
616
|
Number(t[1]),
|
|
617
617
|
Number(t[2]),
|
|
618
618
|
Number(t[3])
|
|
619
619
|
];
|
|
620
|
-
return r < 1 || r > 12 || i < 1 ? !1 : i <= (r === 2 &&
|
|
620
|
+
return r < 1 || r > 12 || i < 1 ? !1 : i <= (r === 2 && Cr(n) ? 29 : Sr[r - 1]);
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function G(e) {
|
|
623
623
|
if (typeof e != "string") return null;
|
|
624
|
-
let t =
|
|
624
|
+
let t = xr.exec(e);
|
|
625
625
|
if (!t) return null;
|
|
626
626
|
let [, n, r, i, a, o, s, c, l, u] = t;
|
|
627
|
-
return !
|
|
627
|
+
return !wr(n) || Number(i) > 23 || Number(a) > 59 || o !== void 0 && Number(o) > 59 || l !== void 0 && (Number(l) > 23 || Number(u) > 59) ? null : {
|
|
628
628
|
date: n,
|
|
629
629
|
sep: r,
|
|
630
630
|
hour: i,
|
|
@@ -634,22 +634,22 @@ function W(e) {
|
|
|
634
634
|
offset: c ?? null
|
|
635
635
|
};
|
|
636
636
|
}
|
|
637
|
-
var
|
|
638
|
-
function
|
|
637
|
+
var Tr = (e) => G(e) !== null;
|
|
638
|
+
function Er(e) {
|
|
639
639
|
let t = e.second === null ? "" : `:${e.second}${e.fraction === null ? "" : `.${e.fraction}`}`;
|
|
640
640
|
return `${e.date}${e.sep}${e.hour}:${e.minute}${t}${e.offset ?? ""}`;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
643
|
-
if (
|
|
644
|
-
let t =
|
|
642
|
+
function Dr(e) {
|
|
643
|
+
if (wr(e)) return Date.parse(`${e}T00:00:00Z`);
|
|
644
|
+
let t = G(e);
|
|
645
645
|
if (!t) return null;
|
|
646
646
|
let n = (t.fraction ?? "").padEnd(3, "0").slice(0, 3);
|
|
647
647
|
return Date.parse(`${t.date}T${t.hour}:${t.minute}:${t.second ?? "00"}.${n}${t.offset ?? "Z"}`);
|
|
648
648
|
}
|
|
649
649
|
//#endregion
|
|
650
650
|
//#region ui/src/components/ui/textarea.tsx
|
|
651
|
-
function
|
|
652
|
-
return /* @__PURE__ */ (0,
|
|
651
|
+
function Or({ className: e, ...t }) {
|
|
652
|
+
return /* @__PURE__ */ (0, z.jsx)("textarea", {
|
|
653
653
|
"data-slot": "textarea",
|
|
654
654
|
className: m("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40", e),
|
|
655
655
|
...t
|
|
@@ -657,9 +657,9 @@ function Ar({ className: e, ...t }) {
|
|
|
657
657
|
}
|
|
658
658
|
//#endregion
|
|
659
659
|
//#region ui/src/lib/datetime.ts
|
|
660
|
-
var
|
|
661
|
-
function
|
|
662
|
-
let t =
|
|
660
|
+
var kr = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/, Ar = (e) => String(e).padStart(2, "0");
|
|
661
|
+
function jr(e) {
|
|
662
|
+
let t = G(e);
|
|
663
663
|
if (!t || t.fraction !== null && t.fraction.length > 3) return null;
|
|
664
664
|
let n = t.second === null ? "" : `:${t.second}${t.fraction === null ? "" : `.${t.fraction}`}`, r = t.fraction === null ? t.second === null ? 60 : 1 : .001;
|
|
665
665
|
return {
|
|
@@ -667,15 +667,15 @@ function Nr(e) {
|
|
|
667
667
|
step: r
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function Mr(e, t, n) {
|
|
671
671
|
let [r, i, a] = e.split("-").map(Number), o = -new Date(r, i - 1, a, Number(t), Number(n)).getTimezoneOffset(), s = Math.abs(o);
|
|
672
|
-
return `${o < 0 ? "-" : "+"}${
|
|
672
|
+
return `${o < 0 ? "-" : "+"}${Ar(Math.floor(s / 60))}:${Ar(s % 60)}`;
|
|
673
673
|
}
|
|
674
|
-
function
|
|
675
|
-
let r =
|
|
674
|
+
function Nr(e, t, n = Mr) {
|
|
675
|
+
let r = kr.exec(e);
|
|
676
676
|
if (!r) return null;
|
|
677
|
-
let [, i, a, o, s, c] = r, l = t === null ? null :
|
|
678
|
-
if (!l) return
|
|
677
|
+
let [, i, a, o, s, c] = r, l = t === null ? null : G(t);
|
|
678
|
+
if (!l) return Er({
|
|
679
679
|
date: i,
|
|
680
680
|
sep: "T",
|
|
681
681
|
hour: a,
|
|
@@ -685,7 +685,7 @@ function Fr(e, t, n = Pr) {
|
|
|
685
685
|
offset: n(i, a, o)
|
|
686
686
|
});
|
|
687
687
|
let u = l.fraction?.length ?? 0, d = (c ?? "").replace(/0+$/, "").length;
|
|
688
|
-
return
|
|
688
|
+
return Er({
|
|
689
689
|
date: i,
|
|
690
690
|
sep: l.sep,
|
|
691
691
|
hour: a,
|
|
@@ -695,40 +695,40 @@ function Fr(e, t, n = Pr) {
|
|
|
695
695
|
offset: l.offset
|
|
696
696
|
});
|
|
697
697
|
}
|
|
698
|
-
var
|
|
698
|
+
var Pr = (e) => {
|
|
699
699
|
let t = /^([+-])(\d{2}):(\d{2})$/.exec(e ?? "");
|
|
700
700
|
return t ? (t[1] === "-" ? -1 : 1) * (Number(t[2]) * 60 + Number(t[3])) : 0;
|
|
701
701
|
};
|
|
702
|
-
function
|
|
702
|
+
function Fr(e, t) {
|
|
703
703
|
if (typeof e != "string") return;
|
|
704
|
-
let n =
|
|
704
|
+
let n = Dr(e);
|
|
705
705
|
if (n === null) return;
|
|
706
|
-
let r = new Date(n +
|
|
706
|
+
let r = new Date(n + Pr(t) * 6e4).toISOString(), i = G(e), a = i?.second == null ? "" : i.fraction === null ? r.slice(16, 19) : r.slice(16, 23);
|
|
707
707
|
return `${r.slice(0, 16)}${a}`;
|
|
708
708
|
}
|
|
709
709
|
//#endregion
|
|
710
710
|
//#region src/rules.ts
|
|
711
|
-
function
|
|
712
|
-
return t === "date" ?
|
|
711
|
+
function Ir(e, t) {
|
|
712
|
+
return t === "date" ? wr(e) ? null : "not a date" : t === "datetime" ? Tr(e) ? null : "not a datetime" : t === "list" ? Array.isArray(e) ? null : "not a list" : t === "map" ? typeof e == "object" && e && !Array.isArray(e) ? null : "not a map" : null;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
return t === "date" || t === "datetime" ?
|
|
714
|
+
function Lr(e, t) {
|
|
715
|
+
return t === "date" || t === "datetime" ? Ir(e, t) === null ? Dr(e) : null : typeof e == "number" ? e : typeof e == "bigint" ? Number(e) : null;
|
|
716
716
|
}
|
|
717
|
-
var
|
|
718
|
-
function
|
|
719
|
-
let i =
|
|
720
|
-
return i === null ? null : n !== void 0 && i <
|
|
717
|
+
var Rr = (e) => typeof e == "number" ? e : Dr(e);
|
|
718
|
+
function zr(e, t, n, r) {
|
|
719
|
+
let i = Lr(e, t);
|
|
720
|
+
return i === null ? null : n !== void 0 && i < Rr(n) ? `below min ${n}` : r !== void 0 && i > Rr(r) ? `above max ${r}` : null;
|
|
721
721
|
}
|
|
722
722
|
//#endregion
|
|
723
723
|
//#region ui/src/lib/form.ts
|
|
724
|
-
var
|
|
725
|
-
function
|
|
726
|
-
return
|
|
724
|
+
var Br = (e) => typeof e == "object" && !!e && !Array.isArray(e), Vr = (e) => Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
725
|
+
function Hr(e) {
|
|
726
|
+
return De(e) ? !0 : Array.isArray(e) ? Vr(e) : Br(e) && Object.values(e).every(Hr);
|
|
727
727
|
}
|
|
728
|
-
function
|
|
729
|
-
return n ? "ref" : r === "date" && (e == null ||
|
|
728
|
+
function Ur(e, t, n, r) {
|
|
729
|
+
return n ? "ref" : r === "date" && (e == null || wr(e)) ? "date" : r === "datetime" && (e == null || typeof e == "string" && jr(e) !== null) ? "datetime" : e == null ? r === "map" ? "map" : "unset" : typeof e == "boolean" ? "switch" : typeof e == "number" ? "number" : typeof e == "string" ? t === "INTEGER" && /^-?\d+$/.test(e) ? "bigint" : r === "markdown" ? "markdown" : e.includes("\n") || e.length > 80 ? "textarea" : "text" : Vr(e) ? "chips" : Br(e) && Hr(e) ? "map" : "json";
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Wr(e) {
|
|
732
732
|
switch (e) {
|
|
733
733
|
case "BOOLEAN": return !1;
|
|
734
734
|
case "INTEGER":
|
|
@@ -737,57 +737,57 @@ function Kr(e) {
|
|
|
737
737
|
case "TEXT": return "";
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
return JSON.stringify(e ?? null, (e, t) =>
|
|
740
|
+
function Gr(e) {
|
|
741
|
+
return JSON.stringify(e ?? null, (e, t) => Br(t) ? Object.fromEntries(Object.keys(t).sort().map((e) => [e, t[e]])) : t);
|
|
742
742
|
}
|
|
743
|
-
function
|
|
744
|
-
return [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) =>
|
|
743
|
+
function K(e, t) {
|
|
744
|
+
return [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => Gr(e[n]) !== Gr(t[n]));
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
let n =
|
|
746
|
+
function Kr(e, t) {
|
|
747
|
+
let n = K(e, t);
|
|
748
748
|
return {
|
|
749
749
|
values: Object.fromEntries(n.map((e) => [e, t[e] ?? null])),
|
|
750
750
|
base: Object.fromEntries(n.map((t) => [t, e[t] ?? null]))
|
|
751
751
|
};
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function qr(e, t, n) {
|
|
754
754
|
if (t.length === 0) return n;
|
|
755
755
|
let [r, ...i] = t;
|
|
756
756
|
if (Array.isArray(e)) {
|
|
757
757
|
let t = [...e];
|
|
758
|
-
return t[r] =
|
|
758
|
+
return t[r] = qr(t[r], i, n), t;
|
|
759
759
|
}
|
|
760
|
-
let a =
|
|
760
|
+
let a = Br(e) ? e : {};
|
|
761
761
|
return {
|
|
762
762
|
...a,
|
|
763
|
-
[r]:
|
|
763
|
+
[r]: qr(a[r], i, n)
|
|
764
764
|
};
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
return e == null ? null :
|
|
766
|
+
function Jr(e, t, n, r) {
|
|
767
|
+
return e == null ? null : Ir(e, t) ?? zr(e, t, n, r);
|
|
768
768
|
}
|
|
769
769
|
//#endregion
|
|
770
770
|
//#region ui/src/components/ChipsInput.tsx
|
|
771
|
-
function
|
|
772
|
-
let [c, l] = (0,
|
|
771
|
+
function Yr({ label: e, value: t, onChange: n, placeholder: r = Je(), removeLabel: i = (e) => ft({ item: e }), accept: a = () => !0, unique: o = !1, invalid: s = !1 }) {
|
|
772
|
+
let [c, l] = (0, I.useState)(""), u = () => {
|
|
773
773
|
let e = c.trim();
|
|
774
774
|
if (e === "") return l("");
|
|
775
775
|
a(e) && (o && t.includes(e) || n([...t, e]), l(""));
|
|
776
776
|
};
|
|
777
|
-
return /* @__PURE__ */ (0,
|
|
777
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
778
778
|
className: `flex min-h-9 flex-wrap items-center gap-1 rounded-md border ${s ? "border-warn" : ""} bg-background px-1.5 py-1 transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50`,
|
|
779
779
|
children: [
|
|
780
|
-
t.map((e, r) => /* @__PURE__ */ (0,
|
|
781
|
-
className:
|
|
782
|
-
children: [e, /* @__PURE__ */ (0,
|
|
780
|
+
t.map((e, r) => /* @__PURE__ */ (0, z.jsxs)("span", {
|
|
781
|
+
className: yr,
|
|
782
|
+
children: [e, /* @__PURE__ */ (0, z.jsx)("button", {
|
|
783
783
|
type: "button",
|
|
784
784
|
"aria-label": i(e),
|
|
785
785
|
className: "ml-1 opacity-60 hover:opacity-100 max-md:grid max-md:size-7 max-md:place-items-center",
|
|
786
786
|
onClick: () => n(t.filter((e, t) => t !== r)),
|
|
787
|
-
children: /* @__PURE__ */ (0,
|
|
787
|
+
children: /* @__PURE__ */ (0, z.jsx)(U, { className: "size-3" })
|
|
788
788
|
})]
|
|
789
789
|
}, `${r}-${e}`)),
|
|
790
|
-
/* @__PURE__ */ (0,
|
|
790
|
+
/* @__PURE__ */ (0, z.jsx)("input", {
|
|
791
791
|
"aria-label": e,
|
|
792
792
|
className: "min-w-32 flex-1 bg-transparent px-1 text-base outline-none placeholder:text-muted-foreground md:text-sm",
|
|
793
793
|
placeholder: r,
|
|
@@ -798,20 +798,20 @@ function Zr({ label: e, value: t, onChange: n, placeholder: r = Ye(), removeLabe
|
|
|
798
798
|
},
|
|
799
799
|
onBlur: u
|
|
800
800
|
}),
|
|
801
|
-
c.trim() !== "" && /* @__PURE__ */ (0,
|
|
801
|
+
c.trim() !== "" && /* @__PURE__ */ (0, z.jsx)("button", {
|
|
802
802
|
type: "button",
|
|
803
|
-
"aria-label":
|
|
803
|
+
"aria-label": Ze({ field: e }),
|
|
804
804
|
className: "rounded-md px-2 text-[13px] text-muted-foreground md:hidden",
|
|
805
805
|
onMouseDown: (e) => e.preventDefault(),
|
|
806
806
|
onClick: u,
|
|
807
|
-
children:
|
|
807
|
+
children: qe()
|
|
808
808
|
})
|
|
809
809
|
]
|
|
810
810
|
});
|
|
811
811
|
}
|
|
812
812
|
//#endregion
|
|
813
813
|
//#region ui/src/lib/references.ts
|
|
814
|
-
function
|
|
814
|
+
function Xr(e, t, n) {
|
|
815
815
|
let r = t?.find((t) => t.name === e.table)?.key;
|
|
816
816
|
return e.target === void 0 || e.target === r ? { key: n } : { filter: [{
|
|
817
817
|
col: e.target,
|
|
@@ -821,12 +821,12 @@ function Qr(e, t, n) {
|
|
|
821
821
|
}
|
|
822
822
|
//#endregion
|
|
823
823
|
//#region ui/src/components/RefLink.tsx
|
|
824
|
-
function
|
|
824
|
+
function Zr({ reference: e, value: t, className: n, children: r }) {
|
|
825
825
|
let { data: i } = x();
|
|
826
|
-
return /* @__PURE__ */ (0,
|
|
826
|
+
return /* @__PURE__ */ (0, z.jsx)(de, {
|
|
827
827
|
to: "/t/$table",
|
|
828
828
|
params: { table: e.table },
|
|
829
|
-
search:
|
|
829
|
+
search: Xr(e, i?.tables, t),
|
|
830
830
|
"aria-label": `open ${e.table} ${t}`,
|
|
831
831
|
className: n ?? "text-tomato underline-offset-2 hover:underline",
|
|
832
832
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -835,37 +835,37 @@ function $r({ reference: e, value: t, className: n, children: r }) {
|
|
|
835
835
|
}
|
|
836
836
|
//#endregion
|
|
837
837
|
//#region ui/src/lib/appMode.ts
|
|
838
|
-
var
|
|
838
|
+
var Qr = () => Le({
|
|
839
839
|
from: "__root__",
|
|
840
840
|
select: (e) => e.app !== void 0
|
|
841
|
-
}),
|
|
841
|
+
}), $r = (0, I.createContext)(!1), ei = () => (0, I.useContext)($r), ti, ni = (e) => {
|
|
842
|
+
ti = e;
|
|
843
|
+
}, ri, ii = (e) => {
|
|
842
844
|
ri = e;
|
|
843
|
-
}, ai
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
function ci(e, t = document.baseURI) {
|
|
847
|
-
return ri === null ? null : ri ? ri(e) : new URL(`-/apps/${encodeURIComponent(e)}/`, t).toString();
|
|
845
|
+
}, ai = () => ri;
|
|
846
|
+
function oi(e, t = document.baseURI) {
|
|
847
|
+
return ti === null ? null : ti ? ti(e) : new URL(`-/apps/${encodeURIComponent(e)}/`, t).toString();
|
|
848
848
|
}
|
|
849
849
|
//#endregion
|
|
850
850
|
//#region ui/src/components/FormField.tsx
|
|
851
|
-
var
|
|
852
|
-
function
|
|
853
|
-
let [s, c] = (0,
|
|
851
|
+
var q = (e) => e.join("."), si = (0, I.lazy)(() => import("./MarkdownField-DTAEh2oz.js"));
|
|
852
|
+
function ci({ path: e, value: t, problem: n, onChange: r, onValidity: a, readOnly: o }) {
|
|
853
|
+
let [s, c] = (0, I.useState)(() => JSON.stringify(t, null, 2)), [l, u] = (0, I.useState)(null), d = i(), f = (0, I.useRef)(JSON.stringify(t)), p = (0, I.useRef)(a);
|
|
854
854
|
p.current = a;
|
|
855
|
-
let m =
|
|
856
|
-
return (0,
|
|
855
|
+
let m = q(e);
|
|
856
|
+
return (0, I.useEffect)(() => {
|
|
857
857
|
JSON.stringify(t) !== f.current && (f.current = JSON.stringify(t), c(JSON.stringify(t, null, 2)), u(null), p.current?.(m, !0));
|
|
858
|
-
}, [t, m]), (0,
|
|
858
|
+
}, [t, m]), (0, I.useEffect)(() => () => p.current?.(m, !0), [m]), /* @__PURE__ */ (0, z.jsxs)("div", { children: [/* @__PURE__ */ (0, z.jsx)(Ae, {
|
|
859
859
|
"aria-label": m,
|
|
860
860
|
value: s,
|
|
861
|
-
extensions: [
|
|
861
|
+
extensions: [Ee(), we.lineWrapping],
|
|
862
862
|
theme: d,
|
|
863
863
|
editable: !o,
|
|
864
864
|
basicSetup: {
|
|
865
865
|
lineNumbers: !1,
|
|
866
866
|
foldGutter: !1
|
|
867
867
|
},
|
|
868
|
-
className: `overflow-hidden rounded-md border text-[12px] ${
|
|
868
|
+
className: `overflow-hidden rounded-md border text-[12px] ${Y(n)}`,
|
|
869
869
|
onChange: (e) => {
|
|
870
870
|
c(e);
|
|
871
871
|
try {
|
|
@@ -875,44 +875,44 @@ function ui({ path: e, value: t, problem: n, onChange: r, onValidity: a, readOnl
|
|
|
875
875
|
u(e instanceof Error ? e.message : String(e)), a?.(m, !1);
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
|
-
}), l && /* @__PURE__ */ (0,
|
|
878
|
+
}), l && /* @__PURE__ */ (0, z.jsx)("p", {
|
|
879
879
|
className: "mt-1 text-[11px] text-err",
|
|
880
880
|
children: l
|
|
881
881
|
})] });
|
|
882
882
|
}
|
|
883
|
-
var
|
|
884
|
-
function
|
|
885
|
-
let a =
|
|
886
|
-
return /* @__PURE__ */ (0,
|
|
887
|
-
"aria-label":
|
|
883
|
+
var J = (e) => e === !0 ? "1" : e === !1 ? "0" : e == null ? "" : String(e);
|
|
884
|
+
function li({ path: e, value: t, allowed: n, onChange: r, readOnly: i }) {
|
|
885
|
+
let a = J(t), o = a !== "" && !n.some((e) => J(e) === a);
|
|
886
|
+
return /* @__PURE__ */ (0, z.jsxs)("select", {
|
|
887
|
+
"aria-label": q(e),
|
|
888
888
|
"aria-invalid": o || void 0,
|
|
889
889
|
disabled: i,
|
|
890
|
-
className: `${
|
|
890
|
+
className: `${_r} w-full ${o ? "border-warn text-warn" : ""}`,
|
|
891
891
|
value: a,
|
|
892
892
|
onChange: (e) => {
|
|
893
893
|
let t = e.target.value;
|
|
894
894
|
if (t === "") return r(null);
|
|
895
|
-
let i = n.find((e) =>
|
|
895
|
+
let i = n.find((e) => J(e) === t);
|
|
896
896
|
i !== void 0 && r(i);
|
|
897
897
|
},
|
|
898
898
|
children: [
|
|
899
|
-
/* @__PURE__ */ (0,
|
|
899
|
+
/* @__PURE__ */ (0, z.jsx)("option", {
|
|
900
900
|
value: "",
|
|
901
901
|
children: "—"
|
|
902
902
|
}),
|
|
903
|
-
o && /* @__PURE__ */ (0,
|
|
903
|
+
o && /* @__PURE__ */ (0, z.jsx)("option", {
|
|
904
904
|
value: a,
|
|
905
905
|
children: `${a} (not in values)`
|
|
906
906
|
}),
|
|
907
|
-
n.map((e, t) => /* @__PURE__ */ (0,
|
|
908
|
-
value:
|
|
907
|
+
n.map((e, t) => /* @__PURE__ */ (0, z.jsx)("option", {
|
|
908
|
+
value: J(e),
|
|
909
909
|
children: String(e)
|
|
910
|
-
}, `${t}:${
|
|
910
|
+
}, `${t}:${J(e)}`))
|
|
911
911
|
]
|
|
912
912
|
});
|
|
913
913
|
}
|
|
914
|
-
function
|
|
915
|
-
let a =
|
|
914
|
+
function ui({ path: e, value: t, type: n, reference: r, onChange: i }) {
|
|
915
|
+
let a = ei(), o = r?.table ?? "", s = r?.key, { data: c } = _({
|
|
916
916
|
queryKey: ["refKeys", o],
|
|
917
917
|
queryFn: () => w.rows(o, {
|
|
918
918
|
limit: 500,
|
|
@@ -920,42 +920,42 @@ function fi({ path: e, value: t, type: n, reference: r, onChange: i }) {
|
|
|
920
920
|
filters: []
|
|
921
921
|
}),
|
|
922
922
|
enabled: o !== ""
|
|
923
|
-
}), l = `ref-${
|
|
924
|
-
return /* @__PURE__ */ (0,
|
|
923
|
+
}), l = `ref-${q(e)}`, u = t == null ? "" : String(t);
|
|
924
|
+
return /* @__PURE__ */ (0, z.jsxs)(z.Fragment, { children: [/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
925
925
|
className: "flex items-center gap-1.5",
|
|
926
|
-
children: [/* @__PURE__ */ (0,
|
|
927
|
-
"aria-label":
|
|
926
|
+
children: [/* @__PURE__ */ (0, z.jsx)(W, {
|
|
927
|
+
"aria-label": q(e),
|
|
928
928
|
list: l,
|
|
929
929
|
value: u,
|
|
930
930
|
onChange: (e) => {
|
|
931
931
|
let t = e.target.value;
|
|
932
932
|
if (t === "") return i(null);
|
|
933
933
|
let r = Number(t);
|
|
934
|
-
i(n === "INTEGER" &&
|
|
934
|
+
i(n === "INTEGER" && mi.test(t) && Number.isSafeInteger(r) ? r : t);
|
|
935
935
|
}
|
|
936
|
-
}), r && u !== "" && !a && /* @__PURE__ */ (0,
|
|
936
|
+
}), r && u !== "" && !a && /* @__PURE__ */ (0, z.jsx)(Zr, {
|
|
937
937
|
reference: r,
|
|
938
938
|
value: u,
|
|
939
939
|
className: "shrink-0 text-muted-foreground hover:text-foreground max-md:grid max-md:size-9 max-md:place-items-center max-md:text-foreground",
|
|
940
|
-
children: /* @__PURE__ */ (0,
|
|
940
|
+
children: /* @__PURE__ */ (0, z.jsx)(Jn, { className: "size-4" })
|
|
941
941
|
})]
|
|
942
|
-
}), /* @__PURE__ */ (0,
|
|
942
|
+
}), /* @__PURE__ */ (0, z.jsx)("datalist", {
|
|
943
943
|
id: l,
|
|
944
|
-
children: s !== void 0 && [...new Set(c?.rows.flatMap((e) => e[s] == null ? [] : [String(e[s])]))].map((e) => /* @__PURE__ */ (0,
|
|
944
|
+
children: s !== void 0 && [...new Set(c?.rows.flatMap((e) => e[s] == null ? [] : [String(e[s])]))].map((e) => /* @__PURE__ */ (0, z.jsx)("option", { value: e }, e))
|
|
945
945
|
})] });
|
|
946
946
|
}
|
|
947
|
-
function
|
|
948
|
-
let { path: t, value: n, problem: r, onChange: i } = e, a = Object.entries(n ?? {}), [o, s] = (0,
|
|
949
|
-
return /* @__PURE__ */ (0,
|
|
950
|
-
className: `rounded-lg border bg-panel px-2.5 pt-2.5 pb-1 ${
|
|
951
|
-
children: [a.map(([r, a]) => /* @__PURE__ */ (0,
|
|
947
|
+
function di(e) {
|
|
948
|
+
let { path: t, value: n, problem: r, onChange: i } = e, a = Object.entries(n ?? {}), [o, s] = (0, I.useState)(null);
|
|
949
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
950
|
+
className: `rounded-lg border bg-panel px-2.5 pt-2.5 pb-1 ${Y(r)}`,
|
|
951
|
+
children: [a.map(([r, a]) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
952
952
|
className: "mb-2.5 grid grid-cols-[minmax(34px,auto)_1fr_auto] items-start gap-1.5",
|
|
953
953
|
children: [
|
|
954
|
-
/* @__PURE__ */ (0,
|
|
954
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
955
955
|
className: "pt-1.5 font-mono text-[11px] text-syn-key max-md:text-[12.5px]",
|
|
956
956
|
children: r
|
|
957
957
|
}),
|
|
958
|
-
/* @__PURE__ */ (0,
|
|
958
|
+
/* @__PURE__ */ (0, z.jsx)(vi, {
|
|
959
959
|
...e,
|
|
960
960
|
path: [...t, r],
|
|
961
961
|
value: a,
|
|
@@ -970,25 +970,25 @@ function pi(e) {
|
|
|
970
970
|
[r]: e
|
|
971
971
|
})
|
|
972
972
|
}),
|
|
973
|
-
/* @__PURE__ */ (0,
|
|
973
|
+
/* @__PURE__ */ (0, z.jsx)("button", {
|
|
974
974
|
type: "button",
|
|
975
|
-
"aria-label":
|
|
975
|
+
"aria-label": ft({ item: q([...t, r]) }),
|
|
976
976
|
className: "pt-1.5 text-muted-foreground max-md:grid max-md:size-8 max-md:place-items-center max-md:pt-0",
|
|
977
977
|
onClick: () => {
|
|
978
978
|
let { [r]: e, ...t } = n;
|
|
979
979
|
i(t);
|
|
980
980
|
},
|
|
981
|
-
children: /* @__PURE__ */ (0,
|
|
981
|
+
children: /* @__PURE__ */ (0, z.jsx)(U, { className: "size-3.5" })
|
|
982
982
|
})
|
|
983
983
|
]
|
|
984
|
-
}, r)), o === null ? /* @__PURE__ */ (0,
|
|
984
|
+
}, r)), o === null ? /* @__PURE__ */ (0, z.jsx)("button", {
|
|
985
985
|
type: "button",
|
|
986
986
|
className: "pb-2 text-[11.5px] text-muted-foreground max-md:py-2 max-md:text-[13px]",
|
|
987
987
|
onClick: () => s(""),
|
|
988
|
-
children:
|
|
989
|
-
}) : /* @__PURE__ */ (0,
|
|
988
|
+
children: ot()
|
|
989
|
+
}) : /* @__PURE__ */ (0, z.jsx)(W, {
|
|
990
990
|
autoFocus: !0,
|
|
991
|
-
"aria-label":
|
|
991
|
+
"aria-label": lt({ field: q(t) }),
|
|
992
992
|
className: "mb-2 h-7",
|
|
993
993
|
value: o,
|
|
994
994
|
onChange: (e) => s(e.target.value),
|
|
@@ -1001,126 +1001,126 @@ function pi(e) {
|
|
|
1001
1001
|
})]
|
|
1002
1002
|
});
|
|
1003
1003
|
}
|
|
1004
|
-
var
|
|
1005
|
-
function
|
|
1006
|
-
return /* @__PURE__ */ (0,
|
|
1004
|
+
var Y = (e) => e ? "border-warn" : "";
|
|
1005
|
+
function fi({ path: e, value: t, min: n, max: r, problem: i, onChange: a }) {
|
|
1006
|
+
return /* @__PURE__ */ (0, z.jsx)(W, {
|
|
1007
1007
|
type: "date",
|
|
1008
|
-
"aria-label":
|
|
1009
|
-
className: `${
|
|
1008
|
+
"aria-label": q(e),
|
|
1009
|
+
className: `${vr} font-mono ${Y(i)}`,
|
|
1010
1010
|
value: typeof t == "string" ? t : "",
|
|
1011
1011
|
min: typeof n == "string" ? n : void 0,
|
|
1012
1012
|
max: typeof r == "string" ? r : void 0,
|
|
1013
1013
|
onChange: (e) => a(e.target.value === "" ? null : e.target.value)
|
|
1014
1014
|
});
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
let o = typeof t == "string" ? t : "", s = o === "" ? null :
|
|
1018
|
-
return o !== "" && (u.current = o), /* @__PURE__ */ (0,
|
|
1016
|
+
function pi({ path: e, value: t, min: n, max: r, problem: i, onChange: a }) {
|
|
1017
|
+
let o = typeof t == "string" ? t : "", s = o === "" ? null : jr(o), c = G(o)?.offset ?? null, l = o === "" ? Mr((/* @__PURE__ */ new Date()).toISOString().slice(0, 10), "12", "00") : c, u = (0, I.useRef)(o);
|
|
1018
|
+
return o !== "" && (u.current = o), /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1019
1019
|
className: "flex items-center gap-1.5 max-md:flex-wrap",
|
|
1020
|
-
children: [/* @__PURE__ */ (0,
|
|
1020
|
+
children: [/* @__PURE__ */ (0, z.jsx)(W, {
|
|
1021
1021
|
type: "datetime-local",
|
|
1022
|
-
"aria-label":
|
|
1023
|
-
className: `w-60 font-mono max-md:w-full ${
|
|
1022
|
+
"aria-label": q(e),
|
|
1023
|
+
className: `w-60 font-mono max-md:w-full ${Y(i)}`,
|
|
1024
1024
|
step: s?.step ?? 60,
|
|
1025
1025
|
value: s?.value ?? "",
|
|
1026
|
-
min:
|
|
1027
|
-
max:
|
|
1026
|
+
min: Fr(n, l),
|
|
1027
|
+
max: Fr(r, l),
|
|
1028
1028
|
onChange: (e) => {
|
|
1029
1029
|
if (e.target.value === "") return a(null);
|
|
1030
|
-
let t =
|
|
1030
|
+
let t = Nr(e.target.value, u.current === "" ? null : u.current);
|
|
1031
1031
|
t !== null && a(t);
|
|
1032
1032
|
}
|
|
1033
|
-
}), c && /* @__PURE__ */ (0,
|
|
1033
|
+
}), c && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1034
1034
|
className: "font-mono text-[12px] text-muted-foreground",
|
|
1035
1035
|
children: c
|
|
1036
1036
|
})]
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
|
-
var
|
|
1040
|
-
function
|
|
1041
|
-
let { path: t, value: n, type: r, format: i, reference: a, problem: o, onChange: s } = e, c = i === "date" || i === "datetime", [l, u] = (0,
|
|
1042
|
-
l === "unset" && (u(t ??
|
|
1043
|
-
}, h = (e) => /* @__PURE__ */ (0,
|
|
1039
|
+
var mi = /^-?\d+$/, hi = /^-?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i;
|
|
1040
|
+
function gi(e) {
|
|
1041
|
+
let { path: t, value: n, type: r, format: i, reference: a, problem: o, onChange: s } = e, c = i === "date" || i === "datetime", [l, u] = (0, I.useState)(() => Ur(n, r, a !== void 0, i)), [d, f] = (0, I.useState)(n == null ? "" : String(n)), p = n == null ? "" : String(n), m = (e, t) => {
|
|
1042
|
+
l === "unset" && (u(t ?? Ur(e, r, !1, i)), f(e == null ? "" : String(e))), s(e);
|
|
1043
|
+
}, h = (e) => /* @__PURE__ */ (0, z.jsx)("button", {
|
|
1044
1044
|
type: "button",
|
|
1045
|
-
"aria-label":
|
|
1046
|
-
field:
|
|
1045
|
+
"aria-label": et({
|
|
1046
|
+
field: q(t),
|
|
1047
1047
|
kind: e
|
|
1048
1048
|
}),
|
|
1049
1049
|
className: "shrink-0 rounded border px-1.5 py-0.5 font-mono text-[11.5px] text-muted-foreground hover:text-foreground max-md:grid max-md:min-h-8 max-md:min-w-8 max-md:place-items-center",
|
|
1050
|
-
onClick: () => u(e === "text" ? "text" :
|
|
1051
|
-
children: e === "text" ? /* @__PURE__ */ (0,
|
|
1050
|
+
onClick: () => u(e === "text" ? "text" : Ur(n, r, !1, i)),
|
|
1051
|
+
children: e === "text" ? /* @__PURE__ */ (0, z.jsx)(nr, { className: "size-3.5" }) : i === "date" ? /* @__PURE__ */ (0, z.jsx)(Xn, { className: "size-3.5" }) : /* @__PURE__ */ (0, z.jsx)(Qn, { className: "size-3.5" })
|
|
1052
1052
|
});
|
|
1053
|
-
if (e.allowed && r !== "JSON") return /* @__PURE__ */ (0,
|
|
1053
|
+
if (e.allowed && r !== "JSON") return /* @__PURE__ */ (0, z.jsx)(li, {
|
|
1054
1054
|
...e,
|
|
1055
1055
|
allowed: e.allowed
|
|
1056
1056
|
});
|
|
1057
1057
|
switch (l) {
|
|
1058
|
-
case "switch": return /* @__PURE__ */ (0,
|
|
1059
|
-
"aria-label":
|
|
1058
|
+
case "switch": return /* @__PURE__ */ (0, z.jsx)(N, {
|
|
1059
|
+
"aria-label": q(t),
|
|
1060
1060
|
checked: n === !0,
|
|
1061
1061
|
onCheckedChange: m
|
|
1062
1062
|
});
|
|
1063
1063
|
case "number":
|
|
1064
|
-
case "bigint": return /* @__PURE__ */ (0,
|
|
1065
|
-
"aria-label":
|
|
1064
|
+
case "bigint": return /* @__PURE__ */ (0, z.jsx)(W, {
|
|
1065
|
+
"aria-label": q(t),
|
|
1066
1066
|
inputMode: r === "REAL" ? "decimal" : "numeric",
|
|
1067
|
-
className: `${
|
|
1067
|
+
className: `${vr} font-mono ${Y(o)}`,
|
|
1068
1068
|
value: d,
|
|
1069
1069
|
onChange: (e) => {
|
|
1070
1070
|
let t = e.target.value;
|
|
1071
1071
|
f(t);
|
|
1072
1072
|
let n = t.trim();
|
|
1073
1073
|
if (r === "INTEGER") {
|
|
1074
|
-
if (!
|
|
1074
|
+
if (!mi.test(n)) return;
|
|
1075
1075
|
let e = Number(n);
|
|
1076
1076
|
s(Number.isSafeInteger(e) ? e : n);
|
|
1077
|
-
} else
|
|
1077
|
+
} else hi.test(n) && Number.isFinite(Number(n)) && s(Number(n));
|
|
1078
1078
|
}
|
|
1079
1079
|
});
|
|
1080
1080
|
case "date":
|
|
1081
|
-
case "datetime": return /* @__PURE__ */ (0,
|
|
1081
|
+
case "datetime": return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1082
1082
|
className: "flex items-center gap-1.5",
|
|
1083
|
-
children: [l === "date" ? /* @__PURE__ */ (0,
|
|
1083
|
+
children: [l === "date" ? /* @__PURE__ */ (0, z.jsx)(fi, { ...e }) : /* @__PURE__ */ (0, z.jsx)(pi, { ...e }), h("text")]
|
|
1084
1084
|
});
|
|
1085
1085
|
case "text": {
|
|
1086
|
-
let e = /* @__PURE__ */ (0,
|
|
1087
|
-
"aria-label":
|
|
1088
|
-
className:
|
|
1086
|
+
let e = /* @__PURE__ */ (0, z.jsx)(W, {
|
|
1087
|
+
"aria-label": q(t),
|
|
1088
|
+
className: Y(o),
|
|
1089
1089
|
value: p,
|
|
1090
1090
|
onChange: (e) => m(c && e.target.value === "" ? null : e.target.value)
|
|
1091
1091
|
});
|
|
1092
1092
|
if (!c) return e;
|
|
1093
|
-
let a =
|
|
1094
|
-
return /* @__PURE__ */ (0,
|
|
1093
|
+
let a = Ur(n, r, !1, i) === i;
|
|
1094
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1095
1095
|
className: "flex items-center gap-1.5",
|
|
1096
1096
|
children: [e, a && h("picker")]
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
|
-
case "textarea": return /* @__PURE__ */ (0,
|
|
1100
|
-
"aria-label":
|
|
1101
|
-
className:
|
|
1099
|
+
case "textarea": return /* @__PURE__ */ (0, z.jsx)(Or, {
|
|
1100
|
+
"aria-label": q(t),
|
|
1101
|
+
className: Y(o),
|
|
1102
1102
|
rows: 4,
|
|
1103
1103
|
value: p,
|
|
1104
1104
|
onChange: (e) => m(e.target.value)
|
|
1105
1105
|
});
|
|
1106
|
-
case "markdown": return /* @__PURE__ */ (0,
|
|
1107
|
-
fallback: /* @__PURE__ */ (0,
|
|
1108
|
-
"aria-label":
|
|
1106
|
+
case "markdown": return /* @__PURE__ */ (0, z.jsx)(I.Suspense, {
|
|
1107
|
+
fallback: /* @__PURE__ */ (0, z.jsx)(Or, {
|
|
1108
|
+
"aria-label": q(t),
|
|
1109
1109
|
rows: 4,
|
|
1110
1110
|
value: p,
|
|
1111
1111
|
readOnly: !0
|
|
1112
1112
|
}),
|
|
1113
|
-
children: /* @__PURE__ */ (0,
|
|
1113
|
+
children: /* @__PURE__ */ (0, z.jsx)(si, { ...e })
|
|
1114
1114
|
});
|
|
1115
|
-
case "ref": return /* @__PURE__ */ (0,
|
|
1116
|
-
case "chips": return /* @__PURE__ */ (0,
|
|
1117
|
-
label:
|
|
1115
|
+
case "ref": return /* @__PURE__ */ (0, z.jsx)(ui, { ...e });
|
|
1116
|
+
case "chips": return /* @__PURE__ */ (0, z.jsx)(Yr, {
|
|
1117
|
+
label: q(t),
|
|
1118
1118
|
value: n ?? [],
|
|
1119
1119
|
onChange: s,
|
|
1120
1120
|
invalid: o
|
|
1121
1121
|
});
|
|
1122
|
-
case "map": return /* @__PURE__ */ (0,
|
|
1123
|
-
case "json": return /* @__PURE__ */ (0,
|
|
1122
|
+
case "map": return /* @__PURE__ */ (0, z.jsx)(di, { ...e });
|
|
1123
|
+
case "json": return /* @__PURE__ */ (0, z.jsx)(ci, { ...e });
|
|
1124
1124
|
case "unset":
|
|
1125
1125
|
if (r === "JSON") {
|
|
1126
1126
|
let e = [
|
|
@@ -1143,12 +1143,12 @@ function vi(e) {
|
|
|
1143
1143
|
chosen: "json"
|
|
1144
1144
|
}
|
|
1145
1145
|
], n = i === "list" ? e.filter((e) => e.name !== "map") : e;
|
|
1146
|
-
return /* @__PURE__ */ (0,
|
|
1146
|
+
return /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1147
1147
|
className: "flex gap-1.5",
|
|
1148
|
-
children: n.map((e) => /* @__PURE__ */ (0,
|
|
1148
|
+
children: n.map((e) => /* @__PURE__ */ (0, z.jsx)("button", {
|
|
1149
1149
|
type: "button",
|
|
1150
|
-
"aria-label":
|
|
1151
|
-
field:
|
|
1150
|
+
"aria-label": et({
|
|
1151
|
+
field: q(t),
|
|
1152
1152
|
kind: e.name
|
|
1153
1153
|
}),
|
|
1154
1154
|
className: "rounded border px-1.5 py-0.5 font-mono text-[11.5px] text-muted-foreground hover:text-foreground",
|
|
@@ -1157,38 +1157,38 @@ function vi(e) {
|
|
|
1157
1157
|
}, e.name))
|
|
1158
1158
|
});
|
|
1159
1159
|
}
|
|
1160
|
-
return /* @__PURE__ */ (0,
|
|
1160
|
+
return /* @__PURE__ */ (0, z.jsx)("button", {
|
|
1161
1161
|
type: "button",
|
|
1162
|
-
"aria-label":
|
|
1162
|
+
"aria-label": q(t),
|
|
1163
1163
|
className: "text-[12px] text-muted-foreground hover:text-foreground",
|
|
1164
|
-
onClick: () => m(
|
|
1165
|
-
children:
|
|
1164
|
+
onClick: () => m(Wr(r ?? "TEXT")),
|
|
1165
|
+
children: pt()
|
|
1166
1166
|
});
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
|
-
var
|
|
1170
|
-
function
|
|
1171
|
-
let { label: t, value: n, type: r, readOnly: i, onChange: a } = e, o =
|
|
1172
|
-
return /* @__PURE__ */ (0,
|
|
1169
|
+
var _i = (e) => e == null || (Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0);
|
|
1170
|
+
function vi(e) {
|
|
1171
|
+
let { label: t, value: n, type: r, readOnly: i, onChange: a } = e, o = Jr(n, e.format, e.min, e.max), [s] = (0, I.useState)(() => r === "JSON" && n == null && e.format !== "map"), [c, l] = (0, I.useState)(0);
|
|
1172
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1173
1173
|
"data-problem": o ?? void 0,
|
|
1174
1174
|
children: [
|
|
1175
|
-
t !== void 0 && /* @__PURE__ */ (0,
|
|
1175
|
+
t !== void 0 && /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1176
1176
|
className: "mb-1 flex items-center gap-2",
|
|
1177
|
-
children: [t, s && !i && n != null && /* @__PURE__ */ (0,
|
|
1177
|
+
children: [t, s && !i && n != null && /* @__PURE__ */ (0, z.jsxs)("button", {
|
|
1178
1178
|
type: "button",
|
|
1179
|
-
"aria-label":
|
|
1179
|
+
"aria-label": at({ field: q(e.path) }),
|
|
1180
1180
|
className: "inline-flex shrink-0 items-center gap-1 rounded px-1 text-[12px] font-semibold text-muted-foreground max-md:text-[13px] font-medium hover:text-foreground",
|
|
1181
1181
|
onClick: () => {
|
|
1182
|
-
(
|
|
1182
|
+
(_i(n) || window.confirm(nt())) && (a(null), l((e) => e + 1));
|
|
1183
1183
|
},
|
|
1184
|
-
children: [/* @__PURE__ */ (0,
|
|
1184
|
+
children: [/* @__PURE__ */ (0, z.jsx)(ge, { className: "size-3" }), tt()]
|
|
1185
1185
|
})]
|
|
1186
1186
|
}),
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1187
|
+
/* @__PURE__ */ (0, z.jsx)(gi, {
|
|
1188
1188
|
...e,
|
|
1189
1189
|
problem: o !== null
|
|
1190
1190
|
}, c),
|
|
1191
|
-
o && /* @__PURE__ */ (0,
|
|
1191
|
+
o && /* @__PURE__ */ (0, z.jsx)("p", {
|
|
1192
1192
|
className: "mt-1 text-[11px] text-warn",
|
|
1193
1193
|
children: o
|
|
1194
1194
|
})
|
|
@@ -1196,86 +1196,10 @@ function bi(e) {
|
|
|
1196
1196
|
});
|
|
1197
1197
|
}
|
|
1198
1198
|
//#endregion
|
|
1199
|
-
//#region ui/src/lib/panelWidth.ts
|
|
1200
|
-
var xi = {
|
|
1201
|
-
min: 320,
|
|
1202
|
-
max: () => Math.max(320, Math.floor(window.innerWidth * .7))
|
|
1203
|
-
}, Si = {
|
|
1204
|
-
min: 180,
|
|
1205
|
-
max: () => Math.max(180, Math.min(480, Math.floor(window.innerWidth * .4)))
|
|
1206
|
-
}, Ci = (e, t) => Math.min(t.max(), Math.max(t.min, Math.round(e)));
|
|
1207
|
-
function wi(e, t, n) {
|
|
1208
|
-
try {
|
|
1209
|
-
let r = localStorage.getItem(e);
|
|
1210
|
-
return r !== null && Number.isFinite(Number(r)) ? Ci(Number(r), n) : t;
|
|
1211
|
-
} catch {
|
|
1212
|
-
return t;
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
function Ti(e, t, n = xi) {
|
|
1216
|
-
let [r, i] = (0, L.useState)(() => wi(e, t, n));
|
|
1217
|
-
return [r, (r) => {
|
|
1218
|
-
let a = r === null ? t : Ci(r, n);
|
|
1219
|
-
i(a);
|
|
1220
|
-
try {
|
|
1221
|
-
r === null ? localStorage.removeItem(e) : localStorage.setItem(e, String(a));
|
|
1222
|
-
} catch {}
|
|
1223
|
-
}];
|
|
1224
|
-
}
|
|
1225
|
-
//#endregion
|
|
1226
|
-
//#region ui/src/components/PanelResizeHandle.tsx
|
|
1227
|
-
var Ei = 16;
|
|
1228
|
-
function Di({ width: e, label: t, onResize: n, edge: r = "left", bounds: i = xi }) {
|
|
1229
|
-
let a = r === "left" ? -1 : 1;
|
|
1230
|
-
return /* @__PURE__ */ (0, R.jsx)("div", {
|
|
1231
|
-
role: "separator",
|
|
1232
|
-
"aria-label": t,
|
|
1233
|
-
"aria-orientation": "vertical",
|
|
1234
|
-
"aria-valuenow": e,
|
|
1235
|
-
"aria-valuemin": i.min,
|
|
1236
|
-
"aria-valuemax": i.max(),
|
|
1237
|
-
tabIndex: 0,
|
|
1238
|
-
onPointerDown: (t) => {
|
|
1239
|
-
if (t.button !== 0) return;
|
|
1240
|
-
t.preventDefault();
|
|
1241
|
-
let r = t.currentTarget;
|
|
1242
|
-
r.setPointerCapture?.(t.pointerId), document.body.setAttribute("data-resizing", "");
|
|
1243
|
-
let i = t.clientX, o = (t) => n(e + a * (t.clientX - i)), s = !1, c = () => {
|
|
1244
|
-
if (s) return;
|
|
1245
|
-
s = !0, document.removeEventListener("pointermove", o), document.removeEventListener("pointerup", c), document.removeEventListener("pointercancel", c), r.removeEventListener("lostpointercapture", c), document.body.removeAttribute("data-resizing");
|
|
1246
|
-
let e = (e) => e.stopPropagation();
|
|
1247
|
-
window.addEventListener("click", e, {
|
|
1248
|
-
capture: !0,
|
|
1249
|
-
once: !0
|
|
1250
|
-
}), setTimeout(() => window.removeEventListener("click", e, { capture: !0 }), 0);
|
|
1251
|
-
};
|
|
1252
|
-
document.addEventListener("pointermove", o), document.addEventListener("pointerup", c), document.addEventListener("pointercancel", c), r.addEventListener("lostpointercapture", c);
|
|
1253
|
-
},
|
|
1254
|
-
onDoubleClick: () => n(null),
|
|
1255
|
-
onKeyDown: (t) => {
|
|
1256
|
-
let r = t.key === "ArrowLeft" ? -a * Ei : t.key === "ArrowRight" ? a * Ei : 0;
|
|
1257
|
-
r !== 0 && (t.preventDefault(), n(e + r));
|
|
1258
|
-
},
|
|
1259
|
-
className: m("absolute inset-y-0 z-10 w-1 cursor-col-resize outline-none hover:bg-primary/40 focus-visible:bg-primary/40", r === "left" ? "-left-0.5" : "-right-0.5")
|
|
1260
|
-
});
|
|
1261
|
-
}
|
|
1262
|
-
//#endregion
|
|
1263
|
-
//#region ui/src/lib/viewportHeight.ts
|
|
1264
|
-
var Oi = (e) => {
|
|
1265
|
-
let t = window.visualViewport;
|
|
1266
|
-
return t?.addEventListener("resize", e), t?.addEventListener("scroll", e), () => {
|
|
1267
|
-
t?.removeEventListener("resize", e), t?.removeEventListener("scroll", e);
|
|
1268
|
-
};
|
|
1269
|
-
};
|
|
1270
|
-
function ki(e) {
|
|
1271
|
-
let t = (0, L.useSyncExternalStore)(Oi, () => window.visualViewport?.height);
|
|
1272
|
-
return e ? t : void 0;
|
|
1273
|
-
}
|
|
1274
|
-
//#endregion
|
|
1275
1199
|
//#region ui/src/lib/recordHistory.ts
|
|
1276
|
-
function
|
|
1200
|
+
function yi(e, t) {
|
|
1277
1201
|
let n = Math.max(0, Math.round((t - Date.parse(e)) / 1e3));
|
|
1278
|
-
if (n < 60) return
|
|
1202
|
+
if (n < 60) return _t();
|
|
1279
1203
|
let i = new Intl.RelativeTimeFormat(r(), { numeric: "always" }), a = Math.round(n / 60);
|
|
1280
1204
|
if (a < 60) return i.format(-a, "minute");
|
|
1281
1205
|
let o = Math.round(a / 60);
|
|
@@ -1283,26 +1207,26 @@ function Ai(e, t) {
|
|
|
1283
1207
|
let s = Math.round(o / 24);
|
|
1284
1208
|
return s < 30 ? i.format(-s, "day") : e.slice(0, 10);
|
|
1285
1209
|
}
|
|
1286
|
-
var
|
|
1210
|
+
var bi = (e) => e == null ? wt() : typeof e == "string" ? e : JSON.stringify(e), xi = (e, t, n) => Object.defineProperty(e, t, {
|
|
1287
1211
|
value: n,
|
|
1288
1212
|
enumerable: !0,
|
|
1289
1213
|
writable: !0,
|
|
1290
1214
|
configurable: !0
|
|
1291
1215
|
});
|
|
1292
|
-
function
|
|
1216
|
+
function Si(e, t, n) {
|
|
1293
1217
|
let r = {};
|
|
1294
|
-
for (let t of Object.keys(e))
|
|
1295
|
-
for (let [e, n] of Object.entries(t))
|
|
1296
|
-
return
|
|
1218
|
+
for (let t of Object.keys(e)) xi(r, t, null);
|
|
1219
|
+
for (let [e, n] of Object.entries(t)) xi(r, e, n);
|
|
1220
|
+
return xi(r, n, e[n]), r;
|
|
1297
1221
|
}
|
|
1298
|
-
function
|
|
1222
|
+
function Ci(e) {
|
|
1299
1223
|
let t = e?.at(-1);
|
|
1300
1224
|
if (!e || !t || t.state !== "ok") return null;
|
|
1301
1225
|
let n = e.reduce((e, t) => e + (t.state === "ok" ? t.entries.filter((e) => e.kind === "commit").length : 0), 0);
|
|
1302
1226
|
return t.next === null ? String(n) : `${n}+`;
|
|
1303
1227
|
}
|
|
1304
|
-
function
|
|
1305
|
-
return
|
|
1228
|
+
function wi(e, t, n) {
|
|
1229
|
+
return Ve({
|
|
1306
1230
|
queryKey: [
|
|
1307
1231
|
"history",
|
|
1308
1232
|
e,
|
|
@@ -1316,23 +1240,23 @@ function Fi(e, t, n) {
|
|
|
1316
1240
|
}
|
|
1317
1241
|
//#endregion
|
|
1318
1242
|
//#region ui/src/components/RecordHistory.tsx
|
|
1319
|
-
var
|
|
1320
|
-
function
|
|
1321
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
+
var Ti = (e) => e.slice(0, 7), Ei = (e) => e.sha ?? "wip";
|
|
1244
|
+
function Di({ title: e, children: t }) {
|
|
1245
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1322
1246
|
className: "px-2 py-10 text-center text-[13px] text-muted-foreground",
|
|
1323
|
-
children: [/* @__PURE__ */ (0,
|
|
1247
|
+
children: [/* @__PURE__ */ (0, z.jsx)("p", {
|
|
1324
1248
|
className: "mb-1.5 text-[15px] font-semibold text-foreground",
|
|
1325
1249
|
children: e
|
|
1326
1250
|
}), t]
|
|
1327
1251
|
});
|
|
1328
1252
|
}
|
|
1329
|
-
function
|
|
1330
|
-
return /* @__PURE__ */ (0,
|
|
1253
|
+
function Oi({ children: e }) {
|
|
1254
|
+
return /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1331
1255
|
className: "rounded border px-1.5 font-mono text-[11px] text-muted-foreground",
|
|
1332
1256
|
children: e
|
|
1333
1257
|
});
|
|
1334
1258
|
}
|
|
1335
|
-
function
|
|
1259
|
+
function ki({ table: e, recordKey: t, rev: n }) {
|
|
1336
1260
|
let { data: r, error: i } = _({
|
|
1337
1261
|
queryKey: [
|
|
1338
1262
|
"history",
|
|
@@ -1343,179 +1267,303 @@ function Bi({ table: e, recordKey: t, rev: n }) {
|
|
|
1343
1267
|
],
|
|
1344
1268
|
queryFn: () => w.historyDiff(e, t, n)
|
|
1345
1269
|
});
|
|
1346
|
-
return i ? /* @__PURE__ */ (0,
|
|
1270
|
+
return i ? /* @__PURE__ */ (0, z.jsx)("p", {
|
|
1347
1271
|
className: "text-[12px] text-err",
|
|
1348
1272
|
children: i.message
|
|
1349
|
-
}) : r ? /* @__PURE__ */ (0,
|
|
1273
|
+
}) : r ? /* @__PURE__ */ (0, z.jsx)("pre", {
|
|
1350
1274
|
className: "overflow-x-auto rounded-md bg-panel py-2 font-mono text-[12px] leading-relaxed",
|
|
1351
|
-
children: r.text.split("\n").map((e, t) => /* @__PURE__ */ (0,
|
|
1275
|
+
children: r.text.split("\n").map((e, t) => /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1352
1276
|
className: m("block px-3 whitespace-pre", e.startsWith("+") && !e.startsWith("+++") && "bg-ok/15 text-ok", e.startsWith("-") && !e.startsWith("---") && "bg-err-soft text-err"),
|
|
1353
1277
|
children: e
|
|
1354
1278
|
}, t))
|
|
1355
|
-
}) : /* @__PURE__ */ (0,
|
|
1279
|
+
}) : /* @__PURE__ */ (0, z.jsx)("p", {
|
|
1356
1280
|
className: "text-[12px] text-muted-foreground",
|
|
1357
|
-
children:
|
|
1281
|
+
children: Ge()
|
|
1358
1282
|
});
|
|
1359
1283
|
}
|
|
1360
|
-
function
|
|
1361
|
-
let [n, r] = (0,
|
|
1362
|
-
return /* @__PURE__ */ (0,
|
|
1284
|
+
function Ai({ entry: e, ...t }) {
|
|
1285
|
+
let [n, r] = (0, I.useState)("fields"), i = e.record, a = i !== null && K(t.current, Si(t.current, i, t.keyColumn)).length > 0, o = n === "yaml" || e.changes.length === 0;
|
|
1286
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1363
1287
|
className: "rounded-b-lg border border-t-0 p-3",
|
|
1364
|
-
children: [/* @__PURE__ */ (0,
|
|
1288
|
+
children: [/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1365
1289
|
className: "mb-2.5 flex items-center gap-2",
|
|
1366
|
-
children: [e.changes.length > 0 ? /* @__PURE__ */ (0,
|
|
1290
|
+
children: [e.changes.length > 0 ? /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1367
1291
|
className: "inline-flex overflow-hidden rounded-md border text-[12px]",
|
|
1368
|
-
children: ["fields", "yaml"].map((e) => /* @__PURE__ */ (0,
|
|
1292
|
+
children: ["fields", "yaml"].map((e) => /* @__PURE__ */ (0, z.jsx)("button", {
|
|
1369
1293
|
type: "button",
|
|
1370
1294
|
"aria-pressed": n === e,
|
|
1371
1295
|
onClick: () => r(e),
|
|
1372
1296
|
className: m("px-2.5 py-0.5", n === e && "bg-foreground text-background"),
|
|
1373
|
-
children: e === "fields" ?
|
|
1297
|
+
children: e === "fields" ? gt() : jt()
|
|
1374
1298
|
}, e))
|
|
1375
|
-
}) : /* @__PURE__ */ (0,
|
|
1299
|
+
}) : /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1376
1300
|
className: "text-[12px] text-muted-foreground",
|
|
1377
|
-
children: e.unreadable ?
|
|
1378
|
-
}), e.kind === "commit" && e.sha && i !== null && t.canRestore && /* @__PURE__ */ (0,
|
|
1301
|
+
children: e.unreadable ? kt() : Ct()
|
|
1302
|
+
}), e.kind === "commit" && e.sha && i !== null && t.canRestore && /* @__PURE__ */ (0, z.jsx)(k, {
|
|
1379
1303
|
variant: "outline",
|
|
1380
1304
|
size: "sm",
|
|
1381
1305
|
className: "ml-auto",
|
|
1382
1306
|
disabled: !a,
|
|
1383
|
-
title: a ?
|
|
1307
|
+
title: a ? Et() : Dt(),
|
|
1384
1308
|
onClick: () => t.onRestore(i, e.sha),
|
|
1385
|
-
children:
|
|
1309
|
+
children: Tt()
|
|
1386
1310
|
})]
|
|
1387
|
-
}), o ? /* @__PURE__ */ (0,
|
|
1311
|
+
}), o ? /* @__PURE__ */ (0, z.jsx)(ki, {
|
|
1388
1312
|
table: t.table,
|
|
1389
1313
|
recordKey: t.recordKey,
|
|
1390
|
-
rev:
|
|
1391
|
-
}) : e.changes.map((e) => /* @__PURE__ */ (0,
|
|
1314
|
+
rev: Ei(e)
|
|
1315
|
+
}) : e.changes.map((e) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1392
1316
|
className: "grid grid-cols-[7rem_1fr] gap-2 border-b border-dashed py-2 last:border-b-0",
|
|
1393
|
-
children: [/* @__PURE__ */ (0,
|
|
1317
|
+
children: [/* @__PURE__ */ (0, z.jsx)("span", {
|
|
1394
1318
|
className: "font-mono text-[12px] break-all text-muted-foreground",
|
|
1395
1319
|
children: e.path
|
|
1396
|
-
}), /* @__PURE__ */ (0,
|
|
1320
|
+
}), /* @__PURE__ */ (0, z.jsxs)("span", {
|
|
1397
1321
|
className: "flex min-w-0 flex-col gap-1 font-mono text-[12px]",
|
|
1398
|
-
children: [e.from !== null && /* @__PURE__ */ (0,
|
|
1322
|
+
children: [e.from !== null && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1399
1323
|
className: "rounded bg-err-soft px-2 py-0.5 break-all text-err line-through",
|
|
1400
|
-
children:
|
|
1401
|
-
}), /* @__PURE__ */ (0,
|
|
1324
|
+
children: bi(e.from)
|
|
1325
|
+
}), /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1402
1326
|
className: "rounded bg-ok/15 px-2 py-0.5 break-all text-ok",
|
|
1403
|
-
children:
|
|
1327
|
+
children: bi(e.to)
|
|
1404
1328
|
})]
|
|
1405
1329
|
})]
|
|
1406
1330
|
}, e.path))]
|
|
1407
1331
|
});
|
|
1408
1332
|
}
|
|
1409
|
-
function
|
|
1410
|
-
let { query: t } = e, [n, r] = (0,
|
|
1411
|
-
if (t.error) return /* @__PURE__ */ (0,
|
|
1333
|
+
function ji(e) {
|
|
1334
|
+
let { query: t } = e, [n, r] = (0, I.useState)(null);
|
|
1335
|
+
if (t.error) return /* @__PURE__ */ (0, z.jsx)("p", {
|
|
1412
1336
|
className: "text-[13px] text-err",
|
|
1413
1337
|
children: t.error.message
|
|
1414
1338
|
});
|
|
1415
1339
|
let i = t.data?.pages[0];
|
|
1416
|
-
if (!t.data || !i) return /* @__PURE__ */ (0,
|
|
1340
|
+
if (!t.data || !i) return /* @__PURE__ */ (0, z.jsx)("p", {
|
|
1417
1341
|
className: "text-[13px] text-muted-foreground",
|
|
1418
|
-
children:
|
|
1342
|
+
children: Ge()
|
|
1419
1343
|
});
|
|
1420
|
-
if (i.state === "nogit") return /* @__PURE__ */ (0,
|
|
1421
|
-
title:
|
|
1422
|
-
children:
|
|
1344
|
+
if (i.state === "nogit") return /* @__PURE__ */ (0, z.jsx)(Di, {
|
|
1345
|
+
title: xt(),
|
|
1346
|
+
children: St()
|
|
1423
1347
|
});
|
|
1424
|
-
if (i.state === "untracked") return /* @__PURE__ */ (0,
|
|
1425
|
-
title:
|
|
1426
|
-
children:
|
|
1348
|
+
if (i.state === "untracked") return /* @__PURE__ */ (0, z.jsx)(Di, {
|
|
1349
|
+
title: yt(),
|
|
1350
|
+
children: bt()
|
|
1427
1351
|
});
|
|
1428
|
-
if (i.state === "error") return /* @__PURE__ */ (0,
|
|
1352
|
+
if (i.state === "error") return /* @__PURE__ */ (0, z.jsx)("p", {
|
|
1429
1353
|
className: "text-[13px] text-err",
|
|
1430
1354
|
children: i.message
|
|
1431
1355
|
});
|
|
1432
1356
|
let a = t.data.pages.flatMap((e) => e.state === "ok" ? e.entries : []), o = Date.now();
|
|
1433
|
-
return /* @__PURE__ */ (0,
|
|
1357
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", { children: [/* @__PURE__ */ (0, z.jsx)("ol", {
|
|
1434
1358
|
className: "relative m-0 list-none p-0 before:absolute before:top-3.5 before:bottom-3.5 before:left-[11px] before:w-0.5 before:bg-border",
|
|
1435
1359
|
children: a.map((t) => {
|
|
1436
|
-
let i =
|
|
1437
|
-
return /* @__PURE__ */ (0,
|
|
1360
|
+
let i = Ei(t), a = n === i;
|
|
1361
|
+
return /* @__PURE__ */ (0, z.jsxs)("li", {
|
|
1438
1362
|
className: "relative mb-1.5 pl-8",
|
|
1439
1363
|
children: [
|
|
1440
|
-
/* @__PURE__ */ (0,
|
|
1441
|
-
/* @__PURE__ */ (0,
|
|
1364
|
+
/* @__PURE__ */ (0, z.jsx)("span", { className: m("absolute top-3.5 left-1 size-4 rounded-full border-2 border-muted-foreground bg-background", t.kind === "wip" && "border-dashed border-warn", t.head && "border-tomato", a && "border-primary bg-primary") }),
|
|
1365
|
+
/* @__PURE__ */ (0, z.jsxs)("button", {
|
|
1442
1366
|
type: "button",
|
|
1443
1367
|
"aria-expanded": a,
|
|
1444
1368
|
onClick: () => r(a ? null : i),
|
|
1445
1369
|
className: m("block w-full rounded-lg border border-transparent px-3 py-2 text-left hover:bg-panel", a && "rounded-b-none border-border bg-panel"),
|
|
1446
1370
|
children: [
|
|
1447
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
/* @__PURE__ */ (0, z.jsxs)("span", {
|
|
1448
1372
|
className: "flex items-baseline gap-2 text-[14px] font-semibold",
|
|
1449
1373
|
children: [
|
|
1450
|
-
t.kind === "wip" ?
|
|
1451
|
-
t.kind === "wip" && /* @__PURE__ */ (0,
|
|
1374
|
+
t.kind === "wip" ? At() : t.subject,
|
|
1375
|
+
t.kind === "wip" && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1452
1376
|
className: "rounded bg-warn-soft px-1.5 text-[11px] text-warn",
|
|
1453
|
-
children:
|
|
1377
|
+
children: Ot()
|
|
1454
1378
|
}),
|
|
1455
|
-
t.head && /* @__PURE__ */ (0,
|
|
1379
|
+
t.head && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1456
1380
|
className: "rounded bg-chip px-1.5 text-[11px] text-chip-foreground",
|
|
1457
1381
|
children: "HEAD"
|
|
1458
1382
|
})
|
|
1459
1383
|
]
|
|
1460
1384
|
}),
|
|
1461
|
-
/* @__PURE__ */ (0,
|
|
1385
|
+
/* @__PURE__ */ (0, z.jsxs)("span", {
|
|
1462
1386
|
className: "mt-0.5 flex flex-wrap items-center gap-1.5 text-[12px] text-muted-foreground",
|
|
1463
1387
|
children: [
|
|
1464
|
-
t.sha && /* @__PURE__ */ (0,
|
|
1388
|
+
t.sha && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1465
1389
|
className: "font-mono text-foreground",
|
|
1466
|
-
children:
|
|
1390
|
+
children: Ti(t.sha)
|
|
1467
1391
|
}),
|
|
1468
|
-
t.author && /* @__PURE__ */ (0,
|
|
1469
|
-
/* @__PURE__ */ (0,
|
|
1392
|
+
t.author && /* @__PURE__ */ (0, z.jsx)("span", { children: t.author }),
|
|
1393
|
+
/* @__PURE__ */ (0, z.jsx)("span", { children: yi(t.date, o) })
|
|
1470
1394
|
]
|
|
1471
1395
|
}),
|
|
1472
|
-
t.renamedFrom ? /* @__PURE__ */ (0,
|
|
1396
|
+
t.renamedFrom ? /* @__PURE__ */ (0, z.jsxs)("span", {
|
|
1473
1397
|
className: "mt-1 block font-mono text-[12px] text-muted-foreground",
|
|
1474
1398
|
children: [
|
|
1475
1399
|
t.renamedFrom,
|
|
1476
1400
|
" → ",
|
|
1477
1401
|
t.path
|
|
1478
1402
|
]
|
|
1479
|
-
}) : /* @__PURE__ */ (0,
|
|
1403
|
+
}) : /* @__PURE__ */ (0, z.jsxs)("span", {
|
|
1480
1404
|
className: "mt-1.5 flex flex-wrap gap-1",
|
|
1481
1405
|
children: [
|
|
1482
|
-
t.event === "created" && /* @__PURE__ */ (0,
|
|
1483
|
-
t.event === "deleted" && /* @__PURE__ */ (0,
|
|
1484
|
-
t.changes.map((e) => /* @__PURE__ */ (0,
|
|
1406
|
+
t.event === "created" && /* @__PURE__ */ (0, z.jsx)(Oi, { children: mt() }),
|
|
1407
|
+
t.event === "deleted" && /* @__PURE__ */ (0, z.jsx)(Oi, { children: ht() }),
|
|
1408
|
+
t.changes.map((e) => /* @__PURE__ */ (0, z.jsx)(Oi, { children: e.path }, e.path))
|
|
1485
1409
|
]
|
|
1486
1410
|
})
|
|
1487
1411
|
]
|
|
1488
1412
|
}),
|
|
1489
|
-
a && /* @__PURE__ */ (0,
|
|
1413
|
+
a && /* @__PURE__ */ (0, z.jsx)(Ai, {
|
|
1490
1414
|
...e,
|
|
1491
1415
|
entry: t
|
|
1492
1416
|
})
|
|
1493
1417
|
]
|
|
1494
1418
|
}, i);
|
|
1495
1419
|
})
|
|
1496
|
-
}), t.hasNextPage && /* @__PURE__ */ (0,
|
|
1420
|
+
}), t.hasNextPage && /* @__PURE__ */ (0, z.jsx)("button", {
|
|
1497
1421
|
type: "button",
|
|
1498
1422
|
disabled: t.isFetchingNextPage,
|
|
1499
1423
|
onClick: () => void t.fetchNextPage(),
|
|
1500
1424
|
className: "mt-2 ml-8 text-[12px] text-muted-foreground",
|
|
1501
|
-
children:
|
|
1425
|
+
children: vt()
|
|
1502
1426
|
})] });
|
|
1503
1427
|
}
|
|
1504
1428
|
//#endregion
|
|
1505
1429
|
//#region ui/src/components/ReflectBadge.tsx
|
|
1506
|
-
function
|
|
1507
|
-
let n =
|
|
1430
|
+
function Mi({ table: e, recordKey: t }) {
|
|
1431
|
+
let n = ue(e, t);
|
|
1508
1432
|
if (!n) return null;
|
|
1509
|
-
let r = n.state === "pending" ?
|
|
1510
|
-
return /* @__PURE__ */ (0,
|
|
1433
|
+
let r = n.state === "pending" ? sn() : n.state === "applied" ? on({ file: n.file }) : n.state === "failed" ? tn({ reason: n.reason }) : nn(), i = n.state === "applied" ? "text-ok" : n.state === "failed" ? "text-err" : "text-muted-foreground";
|
|
1434
|
+
return /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1511
1435
|
role: "status",
|
|
1512
1436
|
className: `text-[11px] ${i}`,
|
|
1513
1437
|
children: r
|
|
1514
1438
|
});
|
|
1515
1439
|
}
|
|
1516
1440
|
//#endregion
|
|
1441
|
+
//#region ui/src/lib/panelWidth.ts
|
|
1442
|
+
var Ni = {
|
|
1443
|
+
min: 320,
|
|
1444
|
+
max: () => Math.max(320, Math.floor(window.innerWidth * .7))
|
|
1445
|
+
}, Pi = {
|
|
1446
|
+
min: 180,
|
|
1447
|
+
max: () => Math.max(180, Math.min(480, Math.floor(window.innerWidth * .4)))
|
|
1448
|
+
}, Fi = (e, t) => Math.min(t.max(), Math.max(t.min, Math.round(e)));
|
|
1449
|
+
function Ii(e, t, n) {
|
|
1450
|
+
try {
|
|
1451
|
+
let r = localStorage.getItem(e);
|
|
1452
|
+
return r !== null && Number.isFinite(Number(r)) ? Fi(Number(r), n) : t;
|
|
1453
|
+
} catch {
|
|
1454
|
+
return t;
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
function Li(e, t, n = Ni) {
|
|
1458
|
+
let [r, i] = (0, I.useState)(() => Ii(e, t, n));
|
|
1459
|
+
return [r, (r) => {
|
|
1460
|
+
let a = r === null ? t : Fi(r, n);
|
|
1461
|
+
i(a);
|
|
1462
|
+
try {
|
|
1463
|
+
r === null ? localStorage.removeItem(e) : localStorage.setItem(e, String(a));
|
|
1464
|
+
} catch {}
|
|
1465
|
+
}];
|
|
1466
|
+
}
|
|
1467
|
+
//#endregion
|
|
1468
|
+
//#region ui/src/lib/viewportHeight.ts
|
|
1469
|
+
var Ri = (e) => {
|
|
1470
|
+
let t = window.visualViewport;
|
|
1471
|
+
return t?.addEventListener("resize", e), t?.addEventListener("scroll", e), () => {
|
|
1472
|
+
t?.removeEventListener("resize", e), t?.removeEventListener("scroll", e);
|
|
1473
|
+
};
|
|
1474
|
+
};
|
|
1475
|
+
function zi(e) {
|
|
1476
|
+
let t = (0, I.useSyncExternalStore)(Ri, () => window.visualViewport?.height);
|
|
1477
|
+
return e ? t : void 0;
|
|
1478
|
+
}
|
|
1479
|
+
//#endregion
|
|
1480
|
+
//#region ui/src/components/PanelResizeHandle.tsx
|
|
1481
|
+
var Bi = 16;
|
|
1482
|
+
function Vi({ width: e, label: t, onResize: n, edge: r = "left", bounds: i = Ni }) {
|
|
1483
|
+
let a = r === "left" ? -1 : 1;
|
|
1484
|
+
return /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1485
|
+
role: "separator",
|
|
1486
|
+
"aria-label": t,
|
|
1487
|
+
"aria-orientation": "vertical",
|
|
1488
|
+
"aria-valuenow": e,
|
|
1489
|
+
"aria-valuemin": i.min,
|
|
1490
|
+
"aria-valuemax": i.max(),
|
|
1491
|
+
tabIndex: 0,
|
|
1492
|
+
onPointerDown: (t) => {
|
|
1493
|
+
if (t.button !== 0) return;
|
|
1494
|
+
t.preventDefault();
|
|
1495
|
+
let r = t.currentTarget;
|
|
1496
|
+
r.setPointerCapture?.(t.pointerId), document.body.setAttribute("data-resizing", "");
|
|
1497
|
+
let i = t.clientX, o = (t) => n(e + a * (t.clientX - i)), s = !1, c = () => {
|
|
1498
|
+
if (s) return;
|
|
1499
|
+
s = !0, document.removeEventListener("pointermove", o), document.removeEventListener("pointerup", c), document.removeEventListener("pointercancel", c), r.removeEventListener("lostpointercapture", c), document.body.removeAttribute("data-resizing");
|
|
1500
|
+
let e = (e) => e.stopPropagation();
|
|
1501
|
+
window.addEventListener("click", e, {
|
|
1502
|
+
capture: !0,
|
|
1503
|
+
once: !0
|
|
1504
|
+
}), setTimeout(() => window.removeEventListener("click", e, { capture: !0 }), 0);
|
|
1505
|
+
};
|
|
1506
|
+
document.addEventListener("pointermove", o), document.addEventListener("pointerup", c), document.addEventListener("pointercancel", c), r.addEventListener("lostpointercapture", c);
|
|
1507
|
+
},
|
|
1508
|
+
onDoubleClick: () => n(null),
|
|
1509
|
+
onKeyDown: (t) => {
|
|
1510
|
+
let r = t.key === "ArrowLeft" ? -a * Bi : t.key === "ArrowRight" ? a * Bi : 0;
|
|
1511
|
+
r !== 0 && (t.preventDefault(), n(e + r));
|
|
1512
|
+
},
|
|
1513
|
+
className: m("absolute inset-y-0 z-10 w-1 cursor-col-resize outline-none hover:bg-primary/40 focus-visible:bg-primary/40", r === "left" ? "-left-0.5" : "-right-0.5")
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
//#endregion
|
|
1517
|
+
//#region ui/src/components/SidePanel.tsx
|
|
1518
|
+
var Hi = {
|
|
1519
|
+
overlay: "absolute inset-y-0 right-0 z-20 shadow-xl",
|
|
1520
|
+
docked: "relative"
|
|
1521
|
+
};
|
|
1522
|
+
function Ui({ layout: e, widthKey: t, defaultWidth: n, resizeLabel: r, className: i, children: a, ...o }) {
|
|
1523
|
+
let s = fe(), [c, l] = Li(t, n), u = zi(s), d = s ? u ? { height: u } : void 0 : { width: c };
|
|
1524
|
+
return /* @__PURE__ */ (0, z.jsxs)("aside", {
|
|
1525
|
+
...o,
|
|
1526
|
+
className: m("flex min-h-0 flex-col border-l bg-background", Hi[e], "max-md:fixed max-md:inset-0 max-md:z-40 max-md:h-dvh max-md:border-l-0 max-md:shadow-none max-md:animate-[y-slide-up_160ms_ease-out]", i),
|
|
1527
|
+
style: d,
|
|
1528
|
+
children: [!s && /* @__PURE__ */ (0, z.jsx)(Vi, {
|
|
1529
|
+
width: c,
|
|
1530
|
+
label: r,
|
|
1531
|
+
onResize: l
|
|
1532
|
+
}), a]
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
function Wi({ onClose: e, className: t, children: n }) {
|
|
1536
|
+
let r = fe();
|
|
1537
|
+
return /* @__PURE__ */ (0, z.jsxs)("header", {
|
|
1538
|
+
className: m("flex items-center gap-2 border-b px-3.5 py-2.5 max-md:gap-1 max-md:px-2 max-md:pt-[calc(0.625rem+env(safe-area-inset-top))]", t),
|
|
1539
|
+
children: [
|
|
1540
|
+
r && /* @__PURE__ */ (0, z.jsx)(k, {
|
|
1541
|
+
variant: "ghost",
|
|
1542
|
+
size: "icon-lg",
|
|
1543
|
+
"aria-label": L(),
|
|
1544
|
+
onClick: e,
|
|
1545
|
+
children: /* @__PURE__ */ (0, z.jsx)(Kn, { className: "size-5" })
|
|
1546
|
+
}),
|
|
1547
|
+
n,
|
|
1548
|
+
!r && /* @__PURE__ */ (0, z.jsx)(k, {
|
|
1549
|
+
variant: "ghost",
|
|
1550
|
+
size: "icon",
|
|
1551
|
+
"aria-label": L(),
|
|
1552
|
+
onClick: e,
|
|
1553
|
+
children: /* @__PURE__ */ (0, z.jsx)(U, { className: "size-5" })
|
|
1554
|
+
})
|
|
1555
|
+
]
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
function Gi({ className: e, ...t }) {
|
|
1559
|
+
return /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1560
|
+
...t,
|
|
1561
|
+
className: m("flex items-center gap-2 border-t px-3.5 py-2.5 max-md:pb-[calc(0.625rem+env(safe-area-inset-bottom))]", e)
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
//#endregion
|
|
1517
1565
|
//#region node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/diff/base.js
|
|
1518
|
-
var
|
|
1566
|
+
var X = class {
|
|
1519
1567
|
diff(e, t, n = {}) {
|
|
1520
1568
|
let r;
|
|
1521
1569
|
typeof n == "function" ? (r = n, n = {}) : "callback" in n && (r = n.callback);
|
|
@@ -1644,39 +1692,39 @@ var Y = class {
|
|
|
1644
1692
|
return r;
|
|
1645
1693
|
}
|
|
1646
1694
|
};
|
|
1647
|
-
new class extends
|
|
1695
|
+
new class extends X {}();
|
|
1648
1696
|
//#endregion
|
|
1649
1697
|
//#region node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/util/string.js
|
|
1650
|
-
function
|
|
1698
|
+
function Ki(e, t) {
|
|
1651
1699
|
let n = 0;
|
|
1652
1700
|
for (; n < e.length && n < t.length; n++) if (e[n] != t[n]) return e.slice(0, n);
|
|
1653
1701
|
return e.slice(0, n);
|
|
1654
1702
|
}
|
|
1655
|
-
function
|
|
1703
|
+
function qi(e, t) {
|
|
1656
1704
|
let n;
|
|
1657
1705
|
if (!e || !t || e[e.length - 1] != t[t.length - 1]) return "";
|
|
1658
1706
|
for (n = 0; n < e.length && n < t.length; n++) if (e[e.length - (n + 1)] != t[t.length - (n + 1)]) return e.slice(-n);
|
|
1659
1707
|
return e.slice(-n);
|
|
1660
1708
|
}
|
|
1661
|
-
function
|
|
1709
|
+
function Ji(e, t, n) {
|
|
1662
1710
|
if (e.slice(0, t.length) != t) throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);
|
|
1663
1711
|
return n + e.slice(t.length);
|
|
1664
1712
|
}
|
|
1665
|
-
function
|
|
1713
|
+
function Yi(e, t, n) {
|
|
1666
1714
|
if (!t) return e + n;
|
|
1667
1715
|
if (e.slice(-t.length) != t) throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);
|
|
1668
1716
|
return e.slice(0, -t.length) + n;
|
|
1669
1717
|
}
|
|
1670
|
-
function X(e, t) {
|
|
1671
|
-
return Ki(e, t, "");
|
|
1672
|
-
}
|
|
1673
1718
|
function Z(e, t) {
|
|
1674
|
-
return
|
|
1719
|
+
return Ji(e, t, "");
|
|
1720
|
+
}
|
|
1721
|
+
function Xi(e, t) {
|
|
1722
|
+
return Yi(e, t, "");
|
|
1675
1723
|
}
|
|
1676
|
-
function
|
|
1677
|
-
return t.slice(0,
|
|
1724
|
+
function Zi(e, t) {
|
|
1725
|
+
return t.slice(0, Qi(e, t));
|
|
1678
1726
|
}
|
|
1679
|
-
function
|
|
1727
|
+
function Qi(e, t) {
|
|
1680
1728
|
let n = 0;
|
|
1681
1729
|
e.length > t.length && (n = e.length - t.length);
|
|
1682
1730
|
let r = t.length;
|
|
@@ -1694,7 +1742,7 @@ function Yi(e, t) {
|
|
|
1694
1742
|
}
|
|
1695
1743
|
return a;
|
|
1696
1744
|
}
|
|
1697
|
-
function
|
|
1745
|
+
function $i(e, t) {
|
|
1698
1746
|
let n = [];
|
|
1699
1747
|
for (let r of Array.from(t.segment(e))) {
|
|
1700
1748
|
let e = r.segment;
|
|
@@ -1702,7 +1750,7 @@ function Xi(e, t) {
|
|
|
1702
1750
|
}
|
|
1703
1751
|
return n;
|
|
1704
1752
|
}
|
|
1705
|
-
function
|
|
1753
|
+
function ea(e, t) {
|
|
1706
1754
|
if (t) return $(e, t)[1];
|
|
1707
1755
|
let n;
|
|
1708
1756
|
for (n = e.length - 1; n >= 0 && e[n].match(/\s/); n--);
|
|
@@ -1714,14 +1762,14 @@ function Q(e, t) {
|
|
|
1714
1762
|
return n ? n[0] : "";
|
|
1715
1763
|
}
|
|
1716
1764
|
function $(e, t) {
|
|
1717
|
-
if (!t) return [Q(e),
|
|
1765
|
+
if (!t) return [Q(e), ea(e)];
|
|
1718
1766
|
if (t.resolvedOptions().granularity != "word") throw Error("The segmenter passed must have a granularity of \"word\"");
|
|
1719
|
-
let n =
|
|
1767
|
+
let n = $i(e, t), r = n[0], i = n[n.length - 1];
|
|
1720
1768
|
return [/\s/.test(r) ? r : "", /\s/.test(i) ? i : ""];
|
|
1721
1769
|
}
|
|
1722
1770
|
//#endregion
|
|
1723
1771
|
//#region node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/diff/word.js
|
|
1724
|
-
var
|
|
1772
|
+
var ta = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", na = RegExp(`[${ta}]+|\\s+|[^${ta}]`, "ug"), ra = new class extends X {
|
|
1725
1773
|
equals(e, t, n) {
|
|
1726
1774
|
return n.ignoreCase && (e = e.toLowerCase(), t = t.toLowerCase()), e.trim() === t.trim();
|
|
1727
1775
|
}
|
|
@@ -1730,8 +1778,8 @@ var Qi = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8
|
|
|
1730
1778
|
if (t.intlSegmenter) {
|
|
1731
1779
|
let r = t.intlSegmenter;
|
|
1732
1780
|
if (r.resolvedOptions().granularity != "word") throw Error("The segmenter passed must have a granularity of \"word\"");
|
|
1733
|
-
n =
|
|
1734
|
-
} else n = e.match(
|
|
1781
|
+
n = $i(e, r);
|
|
1782
|
+
} else n = e.match(na) || [];
|
|
1735
1783
|
let r = [], i = null;
|
|
1736
1784
|
return n.forEach((e) => {
|
|
1737
1785
|
/\s/.test(e) ? i == null ? r.push(e) : r.push(r.pop() + e) : i != null && /\s/.test(i) ? r[r.length - 1] == i ? r.push(r.pop() + e) : r.push(i + e) : r.push(e), i = e;
|
|
@@ -1744,23 +1792,23 @@ var Qi = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8
|
|
|
1744
1792
|
if (!e || t.oneChangePerToken) return e;
|
|
1745
1793
|
let n = null, r = null, i = null;
|
|
1746
1794
|
return e.forEach((e) => {
|
|
1747
|
-
e.added ? r = e : e.removed ? i = e : ((r || i) &&
|
|
1748
|
-
}), (r || i) &&
|
|
1795
|
+
e.added ? r = e : e.removed ? i = e : ((r || i) && aa(n, i, r, e, t.intlSegmenter), n = e, r = null, i = null);
|
|
1796
|
+
}), (r || i) && aa(n, i, r, null, t.intlSegmenter), e;
|
|
1749
1797
|
}
|
|
1750
1798
|
}();
|
|
1751
|
-
function
|
|
1752
|
-
return n?.ignoreWhitespace != null && !n.ignoreWhitespace ?
|
|
1799
|
+
function ia(e, t, n) {
|
|
1800
|
+
return n?.ignoreWhitespace != null && !n.ignoreWhitespace ? sa(e, t, n) : ra.diff(e, t, n);
|
|
1753
1801
|
}
|
|
1754
|
-
function
|
|
1802
|
+
function aa(e, t, n, r, i) {
|
|
1755
1803
|
if (t && n) {
|
|
1756
1804
|
let [a, o] = $(t.value, i), [s, c] = $(n.value, i);
|
|
1757
1805
|
if (e) {
|
|
1758
|
-
let r =
|
|
1759
|
-
e.value =
|
|
1806
|
+
let r = Ki(a, s);
|
|
1807
|
+
e.value = Yi(e.value, s, r), t.value = Z(t.value, r), n.value = Z(n.value, r);
|
|
1760
1808
|
}
|
|
1761
1809
|
if (r) {
|
|
1762
|
-
let e =
|
|
1763
|
-
r.value =
|
|
1810
|
+
let e = qi(o, c);
|
|
1811
|
+
r.value = Ji(r.value, c, e), t.value = Xi(t.value, e), n.value = Xi(n.value, e);
|
|
1764
1812
|
}
|
|
1765
1813
|
} else if (n) {
|
|
1766
1814
|
if (e) {
|
|
@@ -1772,39 +1820,39 @@ function na(e, t, n, r, i) {
|
|
|
1772
1820
|
r.value = r.value.substring(e.length);
|
|
1773
1821
|
}
|
|
1774
1822
|
} else if (e && r) {
|
|
1775
|
-
let n = Q(r.value, i), [a, o] = $(t.value, i), s =
|
|
1776
|
-
t.value =
|
|
1777
|
-
let c =
|
|
1778
|
-
t.value =
|
|
1823
|
+
let n = Q(r.value, i), [a, o] = $(t.value, i), s = Ki(n, a);
|
|
1824
|
+
t.value = Z(t.value, s);
|
|
1825
|
+
let c = qi(Z(n, s), o);
|
|
1826
|
+
t.value = Xi(t.value, c), r.value = Ji(r.value, n, c), e.value = Yi(e.value, n, n.slice(0, n.length - c.length));
|
|
1779
1827
|
} else if (r) {
|
|
1780
|
-
let e = Q(r.value, i), n =
|
|
1781
|
-
t.value =
|
|
1828
|
+
let e = Q(r.value, i), n = Zi(ea(t.value, i), e);
|
|
1829
|
+
t.value = Xi(t.value, n);
|
|
1782
1830
|
} else if (e) {
|
|
1783
|
-
let n =
|
|
1784
|
-
t.value =
|
|
1831
|
+
let n = Zi(ea(e.value, i), Q(t.value, i));
|
|
1832
|
+
t.value = Z(t.value, n);
|
|
1785
1833
|
}
|
|
1786
1834
|
}
|
|
1787
|
-
var
|
|
1835
|
+
var oa = new class extends X {
|
|
1788
1836
|
tokenize(e) {
|
|
1789
|
-
let t = RegExp(`(\\r?\\n)|[${
|
|
1837
|
+
let t = RegExp(`(\\r?\\n)|[${ta}]+|[^\\S\\n\\r]+|[^${ta}]`, "ug");
|
|
1790
1838
|
return e.match(t) || [];
|
|
1791
1839
|
}
|
|
1792
1840
|
}();
|
|
1793
|
-
function
|
|
1794
|
-
return
|
|
1841
|
+
function sa(e, t, n) {
|
|
1842
|
+
return oa.diff(e, t, n);
|
|
1795
1843
|
}
|
|
1796
|
-
var
|
|
1844
|
+
var ca = new class extends X {
|
|
1797
1845
|
constructor() {
|
|
1798
|
-
super(...arguments), this.tokenize =
|
|
1846
|
+
super(...arguments), this.tokenize = ua;
|
|
1799
1847
|
}
|
|
1800
1848
|
equals(e, t, n) {
|
|
1801
1849
|
return n.ignoreWhitespace ? ((!n.newlineIsToken || !e.includes("\n")) && (e = e.trim()), (!n.newlineIsToken || !t.includes("\n")) && (t = t.trim())) : n.ignoreNewlineAtEof && !n.newlineIsToken && (e.endsWith("\n") && (e = e.slice(0, -1)), t.endsWith("\n") && (t = t.slice(0, -1))), super.equals(e, t, n);
|
|
1802
1850
|
}
|
|
1803
1851
|
}();
|
|
1804
|
-
function
|
|
1805
|
-
return
|
|
1852
|
+
function la(e, t, n) {
|
|
1853
|
+
return ca.diff(e, t, n);
|
|
1806
1854
|
}
|
|
1807
|
-
function
|
|
1855
|
+
function ua(e, t) {
|
|
1808
1856
|
t.stripTrailingCr && (e = e.replace(/\r\n/g, "\n"));
|
|
1809
1857
|
let n = [], r = e.split(/(\n|\r\n)/);
|
|
1810
1858
|
r[r.length - 1] || r.pop();
|
|
@@ -1816,10 +1864,10 @@ function sa(e, t) {
|
|
|
1816
1864
|
}
|
|
1817
1865
|
//#endregion
|
|
1818
1866
|
//#region node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/diff/sentence.js
|
|
1819
|
-
function
|
|
1867
|
+
function da(e) {
|
|
1820
1868
|
return e == "." || e == "!" || e == "?";
|
|
1821
1869
|
}
|
|
1822
|
-
new class extends
|
|
1870
|
+
new class extends X {
|
|
1823
1871
|
tokenize(e) {
|
|
1824
1872
|
let t = [], n = 0;
|
|
1825
1873
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -1827,39 +1875,39 @@ new class extends Y {
|
|
|
1827
1875
|
t.push(e.slice(n));
|
|
1828
1876
|
break;
|
|
1829
1877
|
}
|
|
1830
|
-
if (
|
|
1878
|
+
if (da(e[r]) && e[r + 1].match(/\s/)) {
|
|
1831
1879
|
for (t.push(e.slice(n, r + 1)), r = n = r + 1; e[r + 1]?.match(/\s/);) r++;
|
|
1832
1880
|
t.push(e.slice(n, r + 1)), n = r + 1;
|
|
1833
1881
|
}
|
|
1834
1882
|
}
|
|
1835
1883
|
return t;
|
|
1836
1884
|
}
|
|
1837
|
-
}(), new class extends
|
|
1885
|
+
}(), new class extends X {
|
|
1838
1886
|
tokenize(e) {
|
|
1839
1887
|
return e.split(/([{}:;,]|\s+)/);
|
|
1840
1888
|
}
|
|
1841
|
-
}(), new class extends
|
|
1889
|
+
}(), new class extends X {
|
|
1842
1890
|
constructor() {
|
|
1843
|
-
super(...arguments), this.tokenize =
|
|
1891
|
+
super(...arguments), this.tokenize = ua;
|
|
1844
1892
|
}
|
|
1845
1893
|
get useLongestToken() {
|
|
1846
1894
|
return !0;
|
|
1847
1895
|
}
|
|
1848
1896
|
castInput(e, t) {
|
|
1849
1897
|
let { undefinedReplacement: n, stringifyReplacer: r = (e, t) => t === void 0 ? n : t } = t;
|
|
1850
|
-
return typeof e == "string" ? e : JSON.stringify(
|
|
1898
|
+
return typeof e == "string" ? e : JSON.stringify(fa(e, null, null, r), null, " ");
|
|
1851
1899
|
}
|
|
1852
1900
|
equals(e, t, n) {
|
|
1853
1901
|
return super.equals(e.replace(/,([\r\n])/g, "$1"), t.replace(/,([\r\n])/g, "$1"), n);
|
|
1854
1902
|
}
|
|
1855
1903
|
}();
|
|
1856
|
-
function
|
|
1904
|
+
function fa(e, t, n, r, i) {
|
|
1857
1905
|
t ||= [], n ||= [], r && (e = r(i === void 0 ? "" : i, e));
|
|
1858
1906
|
let a = 0;
|
|
1859
1907
|
for (; a < t.length; a += 1) if (t[a] === e) return n[a];
|
|
1860
1908
|
let o;
|
|
1861
1909
|
if (Object.prototype.toString.call(e) === "[object Array]") {
|
|
1862
|
-
for (t.push(e), o = Array(e.length), n.push(o), a = 0; a < e.length; a += 1) o[a] =
|
|
1910
|
+
for (t.push(e), o = Array(e.length), n.push(o), a = 0; a < e.length; a += 1) o[a] = fa(e[a], t, n, r, String(a));
|
|
1863
1911
|
return t.pop(), n.pop(), o;
|
|
1864
1912
|
}
|
|
1865
1913
|
if (e && e.toJSON && (e = e.toJSON()), typeof e == "object" && e) {
|
|
@@ -1868,12 +1916,12 @@ function la(e, t, n, r, i) {
|
|
|
1868
1916
|
for (s in e)
|
|
1869
1917
|
/* istanbul ignore else */
|
|
1870
1918
|
Object.prototype.hasOwnProperty.call(e, s) && i.push(s);
|
|
1871
|
-
for (i.sort(), a = 0; a < i.length; a += 1) s = i[a], o[s] =
|
|
1919
|
+
for (i.sort(), a = 0; a < i.length; a += 1) s = i[a], o[s] = fa(e[s], t, n, r, s);
|
|
1872
1920
|
t.pop(), n.pop();
|
|
1873
1921
|
} else o = e;
|
|
1874
1922
|
return o;
|
|
1875
1923
|
}
|
|
1876
|
-
new class extends
|
|
1924
|
+
new class extends X {
|
|
1877
1925
|
tokenize(e) {
|
|
1878
1926
|
return e.slice();
|
|
1879
1927
|
}
|
|
@@ -1886,15 +1934,15 @@ new class extends Y {
|
|
|
1886
1934
|
}();
|
|
1887
1935
|
//#endregion
|
|
1888
1936
|
//#region ui/src/lib/textdiff.ts
|
|
1889
|
-
var
|
|
1937
|
+
var pa = 2, ma = new Intl.Segmenter(void 0, { granularity: "word" }), ha = (e) => typeof e == "string" && (e.includes("\n") || e.length > 120), ga = (e) => e.replace(/\n$/, "").split("\n"), _a = (e, t) => ({
|
|
1890
1938
|
kind: e,
|
|
1891
1939
|
segments: [{
|
|
1892
1940
|
text: t,
|
|
1893
1941
|
mark: !1
|
|
1894
1942
|
}]
|
|
1895
1943
|
});
|
|
1896
|
-
function
|
|
1897
|
-
let n =
|
|
1944
|
+
function va(e, t) {
|
|
1945
|
+
let n = ia(e, t, { intlSegmenter: ma });
|
|
1898
1946
|
return [{
|
|
1899
1947
|
kind: "del",
|
|
1900
1948
|
segments: n.filter((e) => !e.added).map((e) => ({
|
|
@@ -1909,21 +1957,21 @@ function ha(e, t) {
|
|
|
1909
1957
|
}))
|
|
1910
1958
|
}];
|
|
1911
1959
|
}
|
|
1912
|
-
function
|
|
1913
|
-
let n =
|
|
1960
|
+
function ya(e, t) {
|
|
1961
|
+
let n = la(e, t), r = [];
|
|
1914
1962
|
for (let e = 0; e < n.length; e++) {
|
|
1915
|
-
let t = n[e], i =
|
|
1963
|
+
let t = n[e], i = ga(t.value), a = n[e + 1];
|
|
1916
1964
|
if (t.removed && a?.added) {
|
|
1917
|
-
let t =
|
|
1918
|
-
r.push(...o.map(([e]) => e), ...i.slice(n).map((e) =>
|
|
1919
|
-
} else r.push(...i.map((e) =>
|
|
1965
|
+
let t = ga(a.value), n = Math.min(i.length, t.length), o = Array.from({ length: n }, (e, n) => va(i[n], t[n]));
|
|
1966
|
+
r.push(...o.map(([e]) => e), ...i.slice(n).map((e) => _a("del", e))), r.push(...o.map(([, e]) => e), ...t.slice(n).map((e) => _a("add", e))), e++;
|
|
1967
|
+
} else r.push(...i.map((e) => _a(t.added ? "add" : t.removed ? "del" : "same", e)));
|
|
1920
1968
|
}
|
|
1921
1969
|
return r;
|
|
1922
1970
|
}
|
|
1923
|
-
function
|
|
1971
|
+
function ba(e) {
|
|
1924
1972
|
let t = e.map(() => !1);
|
|
1925
1973
|
e.forEach((n, r) => {
|
|
1926
|
-
if (n.kind !== "same") for (let n = Math.max(0, r -
|
|
1974
|
+
if (n.kind !== "same") for (let n = Math.max(0, r - pa); n <= Math.min(e.length - 1, r + pa); n++) t[n] = !0;
|
|
1927
1975
|
});
|
|
1928
1976
|
let n = [];
|
|
1929
1977
|
return e.forEach((e, r) => {
|
|
@@ -1936,156 +1984,156 @@ function _a(e) {
|
|
|
1936
1984
|
}
|
|
1937
1985
|
//#endregion
|
|
1938
1986
|
//#region ui/src/components/TextDiff.tsx
|
|
1939
|
-
var
|
|
1987
|
+
var xa = {
|
|
1940
1988
|
same: " ",
|
|
1941
1989
|
add: "+",
|
|
1942
1990
|
del: "-"
|
|
1943
1991
|
};
|
|
1944
|
-
function
|
|
1945
|
-
return e.segments.map((t, n) => t.mark ? /* @__PURE__ */ (0,
|
|
1992
|
+
function Sa({ line: e }) {
|
|
1993
|
+
return e.segments.map((t, n) => t.mark ? /* @__PURE__ */ (0, z.jsx)("mark", {
|
|
1946
1994
|
className: m("rounded-sm text-inherit", e.kind === "add" ? "bg-ok/30" : "bg-err/25"),
|
|
1947
1995
|
children: t.text
|
|
1948
1996
|
}, n) : t.text);
|
|
1949
1997
|
}
|
|
1950
|
-
function
|
|
1951
|
-
return /* @__PURE__ */ (0,
|
|
1998
|
+
function Ca({ line: e }) {
|
|
1999
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1952
2000
|
className: m("flex gap-2 px-2.5", e.kind === "add" && "bg-ok/15", e.kind === "del" && "bg-err-soft", e.kind === "same" && "text-muted-foreground"),
|
|
1953
|
-
children: [/* @__PURE__ */ (0,
|
|
2001
|
+
children: [/* @__PURE__ */ (0, z.jsx)("span", {
|
|
1954
2002
|
"aria-hidden": !0,
|
|
1955
2003
|
className: m("shrink-0 select-none", e.kind === "add" ? "text-ok" : e.kind === "del" && "text-err"),
|
|
1956
|
-
children:
|
|
1957
|
-
}), /* @__PURE__ */ (0,
|
|
2004
|
+
children: xa[e.kind]
|
|
2005
|
+
}), /* @__PURE__ */ (0, z.jsxs)("span", {
|
|
1958
2006
|
className: "min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]",
|
|
1959
|
-
children: [/* @__PURE__ */ (0,
|
|
2007
|
+
children: [/* @__PURE__ */ (0, z.jsx)(Sa, { line: e }), e.segments.every((e) => e.text === "") && "\xA0"]
|
|
1960
2008
|
})]
|
|
1961
2009
|
});
|
|
1962
2010
|
}
|
|
1963
|
-
function
|
|
1964
|
-
let [t, n] = (0,
|
|
1965
|
-
return t ? e.lines.map((e, t) => /* @__PURE__ */ (0,
|
|
2011
|
+
function wa({ hunk: e }) {
|
|
2012
|
+
let [t, n] = (0, I.useState)(!1);
|
|
2013
|
+
return t ? e.lines.map((e, t) => /* @__PURE__ */ (0, z.jsx)(Ca, { line: e }, t)) : /* @__PURE__ */ (0, z.jsx)("button", {
|
|
1966
2014
|
type: "button",
|
|
1967
2015
|
onClick: () => n(!0),
|
|
1968
2016
|
className: "block w-full bg-panel px-2.5 py-0.5 text-left font-sans text-[13px] text-muted-foreground hover:text-foreground",
|
|
1969
|
-
children:
|
|
2017
|
+
children: Pt({ count: e.lines.length })
|
|
1970
2018
|
});
|
|
1971
2019
|
}
|
|
1972
|
-
function
|
|
1973
|
-
let i = (0,
|
|
1974
|
-
return /* @__PURE__ */ (0,
|
|
2020
|
+
function Ta({ field: e, before: t, after: n, legend: r }) {
|
|
2021
|
+
let i = (0, I.useMemo)(() => ba(ya(t, n)), [t, n]);
|
|
2022
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1975
2023
|
role: "group",
|
|
1976
2024
|
"aria-label": e,
|
|
1977
2025
|
className: "flex min-w-0 flex-col gap-1",
|
|
1978
|
-
children: [/* @__PURE__ */ (0,
|
|
2026
|
+
children: [/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1979
2027
|
className: "flex flex-wrap items-baseline gap-x-3 text-[13px]",
|
|
1980
2028
|
children: [
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
2029
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
1982
2030
|
className: "font-mono text-syn-key",
|
|
1983
2031
|
children: e
|
|
1984
2032
|
}),
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
2033
|
+
/* @__PURE__ */ (0, z.jsxs)("span", {
|
|
1986
2034
|
className: "text-muted-foreground",
|
|
1987
2035
|
children: [
|
|
1988
|
-
/* @__PURE__ */ (0,
|
|
2036
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
1989
2037
|
className: "font-mono text-err",
|
|
1990
|
-
children:
|
|
2038
|
+
children: xa.del
|
|
1991
2039
|
}),
|
|
1992
2040
|
" ",
|
|
1993
|
-
/* @__PURE__ */ (0,
|
|
2041
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
1994
2042
|
className: "[&>*]:text-inherit",
|
|
1995
2043
|
children: r[0]
|
|
1996
2044
|
})
|
|
1997
2045
|
]
|
|
1998
2046
|
}),
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2047
|
+
/* @__PURE__ */ (0, z.jsxs)("span", {
|
|
2000
2048
|
className: "text-muted-foreground",
|
|
2001
2049
|
children: [
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2050
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2003
2051
|
className: "font-mono text-ok",
|
|
2004
|
-
children:
|
|
2052
|
+
children: xa.add
|
|
2005
2053
|
}),
|
|
2006
2054
|
" ",
|
|
2007
|
-
/* @__PURE__ */ (0,
|
|
2055
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2008
2056
|
className: "[&>*]:text-inherit",
|
|
2009
2057
|
children: r[1]
|
|
2010
2058
|
})
|
|
2011
2059
|
]
|
|
2012
2060
|
})
|
|
2013
2061
|
]
|
|
2014
|
-
}), /* @__PURE__ */ (0,
|
|
2062
|
+
}), /* @__PURE__ */ (0, z.jsx)("div", {
|
|
2015
2063
|
className: "overflow-hidden rounded-md border font-mono text-[13px] leading-relaxed",
|
|
2016
|
-
children: i.map((e, t) => e.kind === "skip" ? /* @__PURE__ */ (0,
|
|
2064
|
+
children: i.map((e, t) => e.kind === "skip" ? /* @__PURE__ */ (0, z.jsx)(wa, { hunk: e }, t) : e.lines.map((e, n) => /* @__PURE__ */ (0, z.jsx)(Ca, { line: e }, `${t}:${n}`)))
|
|
2017
2065
|
})]
|
|
2018
2066
|
});
|
|
2019
2067
|
}
|
|
2020
2068
|
//#endregion
|
|
2021
2069
|
//#region ui/src/components/FieldDiff.tsx
|
|
2022
|
-
var
|
|
2023
|
-
function
|
|
2070
|
+
var Ea = (e) => typeof e == "string" ? e : e == null ? "" : JSON.stringify(e), Da = (e) => !e.dim && e.a !== e.b && (ha(e.a) || ha(e.b));
|
|
2071
|
+
function Oa(e, t) {
|
|
2024
2072
|
let n = t(e.a), r = t(e.b);
|
|
2025
2073
|
if (e.dim || typeof e.a != "string" || typeof e.b != "string" || e.a === e.b) return {
|
|
2026
2074
|
a: n,
|
|
2027
2075
|
b: r
|
|
2028
2076
|
};
|
|
2029
|
-
let [i, a] =
|
|
2077
|
+
let [i, a] = va(n, r);
|
|
2030
2078
|
return {
|
|
2031
|
-
a: /* @__PURE__ */ (0,
|
|
2032
|
-
b: /* @__PURE__ */ (0,
|
|
2079
|
+
a: /* @__PURE__ */ (0, z.jsx)(Sa, { line: i }),
|
|
2080
|
+
b: /* @__PURE__ */ (0, z.jsx)(Sa, { line: a })
|
|
2033
2081
|
};
|
|
2034
2082
|
}
|
|
2035
|
-
function
|
|
2036
|
-
return
|
|
2083
|
+
function ka({ labels: e, rows: t, note: n, className: r }) {
|
|
2084
|
+
return fe() ? /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
2037
2085
|
"data-testid": "field-diff",
|
|
2038
2086
|
className: m("flex flex-col gap-2 font-mono text-[13px]", r),
|
|
2039
|
-
children: [n && /* @__PURE__ */ (0,
|
|
2087
|
+
children: [n && /* @__PURE__ */ (0, z.jsx)("p", {
|
|
2040
2088
|
className: "font-sans text-muted-foreground",
|
|
2041
2089
|
children: n
|
|
2042
|
-
}), t.map((t) => /* @__PURE__ */ (0,
|
|
2090
|
+
}), t.map((t) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
2043
2091
|
role: "group",
|
|
2044
2092
|
"aria-label": t.field,
|
|
2045
2093
|
className: m("overflow-hidden rounded-md border", t.dim && "opacity-50"),
|
|
2046
|
-
children: [/* @__PURE__ */ (0,
|
|
2094
|
+
children: [/* @__PURE__ */ (0, z.jsx)("div", {
|
|
2047
2095
|
className: "bg-panel px-2.5 py-1.5 font-semibold text-syn-key",
|
|
2048
2096
|
children: t.field
|
|
2049
|
-
}), [[e[0], t.a], [e[1], t.b]].map(([e, n], r) => /* @__PURE__ */ (0,
|
|
2097
|
+
}), [[e[0], t.a], [e[1], t.b]].map(([e, n], r) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
2050
2098
|
className: "flex gap-2 border-t px-2.5 py-1.5 break-all",
|
|
2051
|
-
children: [/* @__PURE__ */ (0,
|
|
2099
|
+
children: [/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2052
2100
|
className: "w-24 shrink-0 font-sans text-[12px] text-muted-foreground",
|
|
2053
2101
|
children: e
|
|
2054
|
-
}), /* @__PURE__ */ (0,
|
|
2102
|
+
}), /* @__PURE__ */ (0, z.jsx)("span", {
|
|
2055
2103
|
className: m(t.dim && "line-clamp-2"),
|
|
2056
2104
|
children: n
|
|
2057
2105
|
})]
|
|
2058
2106
|
}, r))]
|
|
2059
2107
|
}, t.field))]
|
|
2060
|
-
}) : /* @__PURE__ */ (0,
|
|
2108
|
+
}) : /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
2061
2109
|
"data-testid": "field-diff",
|
|
2062
2110
|
className: m("grid grid-cols-[auto_1fr_1fr] gap-x-3 gap-y-1 font-mono text-[12px]", r),
|
|
2063
2111
|
children: [
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2065
|
-
/* @__PURE__ */ (0,
|
|
2112
|
+
/* @__PURE__ */ (0, z.jsx)("span", {}),
|
|
2113
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2066
2114
|
className: "font-sans text-muted-foreground",
|
|
2067
2115
|
children: e[0]
|
|
2068
2116
|
}),
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2117
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2070
2118
|
className: "font-sans text-muted-foreground",
|
|
2071
2119
|
children: e[1]
|
|
2072
2120
|
}),
|
|
2073
|
-
n && /* @__PURE__ */ (0,
|
|
2121
|
+
n && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
2074
2122
|
className: "col-span-3 text-muted-foreground",
|
|
2075
2123
|
children: n
|
|
2076
2124
|
}),
|
|
2077
|
-
t.map((e) => /* @__PURE__ */ (0,
|
|
2125
|
+
t.map((e) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
2078
2126
|
className: m("contents", e.dim && "opacity-50"),
|
|
2079
2127
|
children: [
|
|
2080
|
-
/* @__PURE__ */ (0,
|
|
2128
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2081
2129
|
className: "text-syn-key",
|
|
2082
2130
|
children: e.field
|
|
2083
2131
|
}),
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2132
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2085
2133
|
className: m("[overflow-wrap:anywhere]", e.dim && "line-clamp-2"),
|
|
2086
2134
|
children: e.a
|
|
2087
2135
|
}),
|
|
2088
|
-
/* @__PURE__ */ (0,
|
|
2136
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2089
2137
|
className: m("[overflow-wrap:anywhere]", e.dim && "line-clamp-2"),
|
|
2090
2138
|
children: e.b
|
|
2091
2139
|
})
|
|
@@ -2094,42 +2142,42 @@ function Ea({ labels: e, rows: t, note: n, className: r }) {
|
|
|
2094
2142
|
]
|
|
2095
2143
|
});
|
|
2096
2144
|
}
|
|
2097
|
-
function
|
|
2098
|
-
let a = t.filter((e) => !
|
|
2099
|
-
return /* @__PURE__ */ (0,
|
|
2145
|
+
function Aa({ labels: e, rows: t, format: n, note: r, className: i }) {
|
|
2146
|
+
let a = t.filter((e) => !Da(e)), o = t.filter(Da);
|
|
2147
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
2100
2148
|
className: "flex min-w-0 flex-col gap-3",
|
|
2101
|
-
children: [(a.length > 0 || r) && /* @__PURE__ */ (0,
|
|
2149
|
+
children: [(a.length > 0 || r) && /* @__PURE__ */ (0, z.jsx)(ka, {
|
|
2102
2150
|
labels: e,
|
|
2103
2151
|
note: r,
|
|
2104
2152
|
className: i,
|
|
2105
2153
|
rows: a.map((e) => ({
|
|
2106
2154
|
field: e.field,
|
|
2107
|
-
...
|
|
2155
|
+
...Oa(e, n),
|
|
2108
2156
|
dim: e.dim
|
|
2109
2157
|
}))
|
|
2110
|
-
}), o.map((t) => /* @__PURE__ */ (0,
|
|
2158
|
+
}), o.map((t) => /* @__PURE__ */ (0, z.jsx)(Ta, {
|
|
2111
2159
|
field: t.field,
|
|
2112
2160
|
legend: e,
|
|
2113
|
-
before:
|
|
2114
|
-
after:
|
|
2161
|
+
before: Ea(t.a),
|
|
2162
|
+
after: Ea(t.b)
|
|
2115
2163
|
}, t.field))]
|
|
2116
2164
|
});
|
|
2117
2165
|
}
|
|
2118
2166
|
//#endregion
|
|
2119
2167
|
//#region ui/src/components/StaleDialog.tsx
|
|
2120
|
-
function
|
|
2121
|
-
let o = (0,
|
|
2122
|
-
return /* @__PURE__ */ (0,
|
|
2168
|
+
function ja({ stale: e, current: t, draft: n, onReload: r, onOverwrite: i, onClose: a }) {
|
|
2169
|
+
let o = (0, I.useRef)(null);
|
|
2170
|
+
return /* @__PURE__ */ (0, z.jsx)(ir, {
|
|
2123
2171
|
open: !0,
|
|
2124
2172
|
onOpenChange: (e) => !e && a(),
|
|
2125
|
-
children: /* @__PURE__ */ (0,
|
|
2173
|
+
children: /* @__PURE__ */ (0, z.jsxs)(lr, {
|
|
2126
2174
|
onOpenAutoFocus: (e) => {
|
|
2127
2175
|
e.preventDefault(), o.current?.focus();
|
|
2128
2176
|
},
|
|
2129
2177
|
children: [
|
|
2130
|
-
/* @__PURE__ */ (0,
|
|
2131
|
-
/* @__PURE__ */ (0,
|
|
2132
|
-
labels: [
|
|
2178
|
+
/* @__PURE__ */ (0, z.jsxs)(ur, { children: [/* @__PURE__ */ (0, z.jsx)(pr, { children: _n() }), /* @__PURE__ */ (0, z.jsx)(mr, { children: mn() })] }),
|
|
2179
|
+
/* @__PURE__ */ (0, z.jsx)(Aa, {
|
|
2180
|
+
labels: [gn(), hn()],
|
|
2133
2181
|
format: (e) => JSON.stringify(e ?? null),
|
|
2134
2182
|
rows: e.map((e) => ({
|
|
2135
2183
|
field: e,
|
|
@@ -2137,14 +2185,14 @@ function Oa({ stale: e, current: t, draft: n, onReload: r, onOverwrite: i, onClo
|
|
|
2137
2185
|
b: n[e]
|
|
2138
2186
|
}))
|
|
2139
2187
|
}),
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2188
|
+
/* @__PURE__ */ (0, z.jsxs)(fr, { children: [/* @__PURE__ */ (0, z.jsx)(k, {
|
|
2141
2189
|
ref: o,
|
|
2142
2190
|
variant: "outline",
|
|
2143
2191
|
onClick: r,
|
|
2144
|
-
children:
|
|
2145
|
-
}), /* @__PURE__ */ (0,
|
|
2192
|
+
children: cn()
|
|
2193
|
+
}), /* @__PURE__ */ (0, z.jsx)(k, {
|
|
2146
2194
|
onClick: i,
|
|
2147
|
-
children:
|
|
2195
|
+
children: Qt()
|
|
2148
2196
|
})] })
|
|
2149
2197
|
]
|
|
2150
2198
|
})
|
|
@@ -2152,12 +2200,17 @@ function Oa({ stale: e, current: t, draft: n, onReload: r, onOverwrite: i, onClo
|
|
|
2152
2200
|
}
|
|
2153
2201
|
//#endregion
|
|
2154
2202
|
//#region ui/src/components/RecordDrawer.tsx
|
|
2155
|
-
var
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2203
|
+
var Ma = (e, t) => Object.hasOwn(e.columns, t) ? e.columns[t] : void 0, Na = (e, t) => Object.hasOwn(e.formats, t) ? e.formats[t] : void 0, Pa = (e) => e.files?.endsWith(".mdx") ?? !1, Fa = (e, t) => Object.hasOwn(e.values, t) ? e.values[t] : void 0, Ia = (e, t) => Object.hasOwn(e, t) ? e[t] : void 0, La = {
|
|
2204
|
+
layout: "overlay",
|
|
2205
|
+
widthKey: "yamlite-drawer-width",
|
|
2206
|
+
defaultWidth: 360,
|
|
2207
|
+
"data-record-drawer": ""
|
|
2208
|
+
}, Ra = "flex-1 text-[14px]";
|
|
2209
|
+
function za(e, t = !0) {
|
|
2210
|
+
let n = (0, I.useRef)(void 0);
|
|
2211
|
+
(0, I.useEffect)(() => {
|
|
2159
2212
|
t && (n.current = window.event);
|
|
2160
|
-
}, [t]), (0,
|
|
2213
|
+
}, [t]), (0, I.useEffect)(() => {
|
|
2161
2214
|
if (!t) return;
|
|
2162
2215
|
let r = (t) => {
|
|
2163
2216
|
if (t === n.current) return;
|
|
@@ -2171,25 +2224,25 @@ function Ia(e, t = !0) {
|
|
|
2171
2224
|
};
|
|
2172
2225
|
});
|
|
2173
2226
|
}
|
|
2174
|
-
function
|
|
2175
|
-
let a = i(), o =
|
|
2227
|
+
function Ba({ table: e, recordKey: t, headerActions: n, onClose: r }) {
|
|
2228
|
+
let a = i(), o = me(), s = se(), c = h(), { connected: l } = ee(), u = l && !S(), { data: d, error: f } = _({
|
|
2176
2229
|
queryKey: [
|
|
2177
2230
|
"record",
|
|
2178
2231
|
e.name,
|
|
2179
2232
|
t
|
|
2180
2233
|
],
|
|
2181
2234
|
queryFn: () => w.record(e.name, t)
|
|
2182
|
-
}), [p, g] = (0,
|
|
2183
|
-
(0,
|
|
2184
|
-
d && !
|
|
2185
|
-
}, [d,
|
|
2186
|
-
function
|
|
2187
|
-
g(e), y(e), x(/* @__PURE__ */ new Set()),
|
|
2235
|
+
}), [p, g] = (0, I.useState)(null), [v, y] = (0, I.useState)(null), [b, x] = (0, I.useState)(/* @__PURE__ */ new Set()), [C, T] = (0, I.useState)(null), [ne, re] = (0, I.useState)(!1), [ie, E] = (0, I.useState)(null), [D, ae] = (0, I.useState)("form"), [O, oe] = (0, I.useState)(null), ce = wi(e.name, t, D === "history" && !S()), [le, ue] = (0, I.useState)(0), A = p !== null && v !== null && K(p, v).length > 0, j = fe();
|
|
2236
|
+
(0, I.useEffect)(() => {
|
|
2237
|
+
d && !A && (v && K(v, d.row).length === 0 ? g(d.row) : de(d.row));
|
|
2238
|
+
}, [d, A]);
|
|
2239
|
+
function de(e) {
|
|
2240
|
+
g(e), y(e), x(/* @__PURE__ */ new Set()), E(null), ue((e) => e + 1), oe(null);
|
|
2188
2241
|
}
|
|
2189
|
-
function
|
|
2190
|
-
p && (y(
|
|
2242
|
+
function pe(t, n) {
|
|
2243
|
+
p && (y(Si(p, t, e.key)), x(/* @__PURE__ */ new Set()), ue((e) => e + 1), oe(n.slice(0, 7)), ae("form"));
|
|
2191
2244
|
}
|
|
2192
|
-
let
|
|
2245
|
+
let M = Be({
|
|
2193
2246
|
mutationFn: ({ values: n, base: r }) => w.update(e.name, t, n, r),
|
|
2194
2247
|
onMutate: () => c({
|
|
2195
2248
|
type: "saved",
|
|
@@ -2202,7 +2255,7 @@ function La({ table: e, recordKey: t, headerActions: n, onClose: r }) {
|
|
|
2202
2255
|
...p,
|
|
2203
2256
|
...r.values
|
|
2204
2257
|
};
|
|
2205
|
-
g(i), y(i),
|
|
2258
|
+
g(i), y(i), oe(null), o.setQueryData([
|
|
2206
2259
|
"record",
|
|
2207
2260
|
e.name,
|
|
2208
2261
|
t
|
|
@@ -2225,7 +2278,7 @@ function La({ table: e, recordKey: t, headerActions: n, onClose: r }) {
|
|
|
2225
2278
|
current: n.body.current
|
|
2226
2279
|
});
|
|
2227
2280
|
}
|
|
2228
|
-
}),
|
|
2281
|
+
}), N = Be({
|
|
2229
2282
|
mutationFn: () => w.remove(e.name, t),
|
|
2230
2283
|
onMutate: () => c({
|
|
2231
2284
|
type: "saved",
|
|
@@ -2245,9 +2298,9 @@ function La({ table: e, recordKey: t, headerActions: n, onClose: r }) {
|
|
|
2245
2298
|
search: {}
|
|
2246
2299
|
});
|
|
2247
2300
|
}
|
|
2248
|
-
}),
|
|
2249
|
-
!p || !v || !
|
|
2250
|
-
},
|
|
2301
|
+
}), he = () => {
|
|
2302
|
+
!p || !v || !A || b.size > 0 || !l || M.isPending || M.mutate(Kr(p, v));
|
|
2303
|
+
}, ge = () => r ? r() : void s({
|
|
2251
2304
|
to: "/t/$table",
|
|
2252
2305
|
params: { table: e.name },
|
|
2253
2306
|
search: (e) => ({
|
|
@@ -2255,133 +2308,113 @@ function La({ table: e, recordKey: t, headerActions: n, onClose: r }) {
|
|
|
2255
2308
|
key: void 0
|
|
2256
2309
|
})
|
|
2257
2310
|
});
|
|
2258
|
-
if (
|
|
2311
|
+
if (za(ge, !A), (0, I.useEffect)(() => {
|
|
2259
2312
|
let e = (e) => {
|
|
2260
|
-
e.key === "s" && (e.metaKey || e.ctrlKey) && !S() && (e.preventDefault(),
|
|
2313
|
+
e.key === "s" && (e.metaKey || e.ctrlKey) && !S() && (e.preventDefault(), he());
|
|
2261
2314
|
};
|
|
2262
2315
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
2263
|
-
}), f) return /* @__PURE__ */ (0,
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2316
|
+
}), f) return /* @__PURE__ */ (0, z.jsx)(Ui, {
|
|
2317
|
+
...La,
|
|
2318
|
+
resizeLabel: R(),
|
|
2319
|
+
"aria-label": Xt(),
|
|
2320
|
+
className: "p-4 text-err",
|
|
2268
2321
|
children: f.message
|
|
2269
2322
|
});
|
|
2270
|
-
if (!v || !p || !d) return /* @__PURE__ */ (0,
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
style: me
|
|
2323
|
+
if (!v || !p || !d) return /* @__PURE__ */ (0, z.jsx)(Ui, {
|
|
2324
|
+
...La,
|
|
2325
|
+
resizeLabel: R(),
|
|
2326
|
+
"aria-label": Xt()
|
|
2275
2327
|
});
|
|
2276
|
-
let
|
|
2277
|
-
return /* @__PURE__ */ (0,
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
style: me,
|
|
2328
|
+
let _e = Object.keys(e.columns).filter((t) => t !== e.key), ve = Object.keys(v).filter((t) => t !== e.key && !_e.includes(t)), ye = new Set(K(p, v)), be = ye.size, xe = Ci(ce.data?.pages);
|
|
2329
|
+
return /* @__PURE__ */ (0, z.jsxs)(Ui, {
|
|
2330
|
+
...La,
|
|
2331
|
+
resizeLabel: R(),
|
|
2332
|
+
"aria-label": Xt(),
|
|
2282
2333
|
children: [
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
label: dn(),
|
|
2286
|
-
onResize: ue
|
|
2287
|
-
}),
|
|
2288
|
-
/* @__PURE__ */ (0, R.jsxs)(Oe, {
|
|
2289
|
-
value: k,
|
|
2334
|
+
/* @__PURE__ */ (0, z.jsxs)(ke, {
|
|
2335
|
+
value: D,
|
|
2290
2336
|
onValueChange: (e) => {
|
|
2291
|
-
|
|
2337
|
+
ae(e), x((e) => new Set([...e].filter((e) => e !== "$json"))), E(null);
|
|
2292
2338
|
},
|
|
2293
2339
|
className: "flex min-h-0 flex-1 flex-col",
|
|
2294
2340
|
children: [
|
|
2295
|
-
/* @__PURE__ */ (0,
|
|
2296
|
-
|
|
2297
|
-
children: [
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
children: Ae
|
|
2334
|
-
})]
|
|
2335
|
-
})
|
|
2336
|
-
]
|
|
2337
|
-
}),
|
|
2338
|
-
!N && /* @__PURE__ */ (0, R.jsx)("button", {
|
|
2339
|
-
type: "button",
|
|
2340
|
-
"aria-label": Ue(),
|
|
2341
|
-
onClick: ve,
|
|
2342
|
-
className: "text-muted-foreground",
|
|
2343
|
-
children: /* @__PURE__ */ (0, R.jsx)(H, { className: "size-4" })
|
|
2344
|
-
})
|
|
2345
|
-
]
|
|
2341
|
+
/* @__PURE__ */ (0, z.jsxs)(Wi, {
|
|
2342
|
+
onClose: ge,
|
|
2343
|
+
children: [/* @__PURE__ */ (0, z.jsx)("span", {
|
|
2344
|
+
className: "min-w-0 flex-1 truncate font-mono font-bold",
|
|
2345
|
+
title: t,
|
|
2346
|
+
children: t
|
|
2347
|
+
}), n]
|
|
2348
|
+
}),
|
|
2349
|
+
/* @__PURE__ */ (0, z.jsx)("div", {
|
|
2350
|
+
className: "border-b px-3.5 py-2",
|
|
2351
|
+
children: /* @__PURE__ */ (0, z.jsxs)(Oe, {
|
|
2352
|
+
className: "h-9 w-full",
|
|
2353
|
+
children: [
|
|
2354
|
+
/* @__PURE__ */ (0, z.jsx)(P, {
|
|
2355
|
+
value: "form",
|
|
2356
|
+
className: Ra,
|
|
2357
|
+
children: yn()
|
|
2358
|
+
}),
|
|
2359
|
+
/* @__PURE__ */ (0, z.jsx)(P, {
|
|
2360
|
+
value: "json",
|
|
2361
|
+
className: Ra,
|
|
2362
|
+
children: "JSON"
|
|
2363
|
+
}),
|
|
2364
|
+
/* @__PURE__ */ (0, z.jsx)(P, {
|
|
2365
|
+
value: "yaml",
|
|
2366
|
+
className: Ra,
|
|
2367
|
+
children: vn()
|
|
2368
|
+
}),
|
|
2369
|
+
!S() && /* @__PURE__ */ (0, z.jsxs)(P, {
|
|
2370
|
+
value: "history",
|
|
2371
|
+
className: Ra,
|
|
2372
|
+
children: [bn(), xe !== null && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
2373
|
+
className: "ml-1 font-mono text-[12px] text-muted-foreground",
|
|
2374
|
+
children: xe
|
|
2375
|
+
})]
|
|
2376
|
+
})
|
|
2377
|
+
]
|
|
2378
|
+
})
|
|
2346
2379
|
}),
|
|
2347
|
-
/* @__PURE__ */ (0,
|
|
2348
|
-
className: "truncate px-4 pt-3 font-mono text-[
|
|
2380
|
+
/* @__PURE__ */ (0, z.jsx)("div", {
|
|
2381
|
+
className: "truncate px-4 pt-3 font-mono text-[13px] text-muted-foreground",
|
|
2349
2382
|
children: d.file
|
|
2350
2383
|
}),
|
|
2351
|
-
/* @__PURE__ */ (0,
|
|
2384
|
+
/* @__PURE__ */ (0, z.jsxs)(F, {
|
|
2352
2385
|
value: "form",
|
|
2353
2386
|
className: "min-h-0 flex-1 overflow-auto px-4 py-3",
|
|
2354
|
-
onFocus: (e) =>
|
|
2355
|
-
children: [!l && /* @__PURE__ */ (0,
|
|
2356
|
-
className: "mb-2 text-[
|
|
2357
|
-
children:
|
|
2358
|
-
}), /* @__PURE__ */ (0,
|
|
2387
|
+
onFocus: (e) => j && e.target.matches("input, textarea, [contenteditable]") && e.target.scrollIntoView?.({ block: "center" }),
|
|
2388
|
+
children: [!l && /* @__PURE__ */ (0, z.jsx)("p", {
|
|
2389
|
+
className: "mb-2 text-[13px] text-err",
|
|
2390
|
+
children: Kt()
|
|
2391
|
+
}), /* @__PURE__ */ (0, z.jsx)("fieldset", {
|
|
2359
2392
|
disabled: !u,
|
|
2360
2393
|
className: "m-0 min-w-0 border-0 p-0",
|
|
2361
|
-
children: [...
|
|
2362
|
-
let n = e.references.find((e) => e.column === t), r = (e.captures ?? []).some((e) => e.column === t), i = /* @__PURE__ */ (0,
|
|
2394
|
+
children: [..._e, ...ve].map((t) => {
|
|
2395
|
+
let n = e.references.find((e) => e.column === t), r = (e.captures ?? []).some((e) => e.column === t), i = /* @__PURE__ */ (0, z.jsx)(vi, {
|
|
2363
2396
|
readOnly: !u || r,
|
|
2364
2397
|
path: [t],
|
|
2365
|
-
label: /* @__PURE__ */ (0,
|
|
2366
|
-
className: `flex flex-1 justify-between ${
|
|
2367
|
-
children: [/* @__PURE__ */ (0,
|
|
2398
|
+
label: /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
2399
|
+
className: `flex flex-1 justify-between ${gr}`,
|
|
2400
|
+
children: [/* @__PURE__ */ (0, z.jsxs)("span", {
|
|
2368
2401
|
className: e.required.includes(t) && v[t] == null ? "text-warn" : void 0,
|
|
2369
|
-
children: [t, e.required.includes(t) && /* @__PURE__ */ (0,
|
|
2370
|
-
"aria-label":
|
|
2402
|
+
children: [t, e.required.includes(t) && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
2403
|
+
"aria-label": ln(),
|
|
2371
2404
|
children: " *"
|
|
2372
2405
|
})]
|
|
2373
|
-
}), /* @__PURE__ */ (0,
|
|
2406
|
+
}), /* @__PURE__ */ (0, z.jsx)("span", {
|
|
2374
2407
|
className: "font-mono text-[10px] font-medium max-md:text-[11.5px]",
|
|
2375
|
-
children: n ? `→ ${n.table}` :
|
|
2408
|
+
children: n ? `→ ${n.table}` : Na(e, t) ?? Ma(e, t) ?? Zt()
|
|
2376
2409
|
})]
|
|
2377
2410
|
}),
|
|
2378
2411
|
value: v[t],
|
|
2379
|
-
type:
|
|
2380
|
-
format:
|
|
2381
|
-
mdx:
|
|
2382
|
-
allowed:
|
|
2383
|
-
min:
|
|
2384
|
-
max:
|
|
2412
|
+
type: Ma(e, t),
|
|
2413
|
+
format: Na(e, t),
|
|
2414
|
+
mdx: Pa(e),
|
|
2415
|
+
allowed: Fa(e, t),
|
|
2416
|
+
min: Ia(e.min, t),
|
|
2417
|
+
max: Ia(e.max, t),
|
|
2385
2418
|
reference: n,
|
|
2386
2419
|
onChange: (e) => y({
|
|
2387
2420
|
...v,
|
|
@@ -2391,10 +2424,10 @@ function La({ table: e, recordKey: t, headerActions: n, onClose: r }) {
|
|
|
2391
2424
|
let r = new Set(n);
|
|
2392
2425
|
return t ? r.delete(e) : r.add(e), r;
|
|
2393
2426
|
})
|
|
2394
|
-
}, `${t}:${
|
|
2395
|
-
return /* @__PURE__ */ (0,
|
|
2396
|
-
className: m("mb-3.5",
|
|
2397
|
-
children: r ? /* @__PURE__ */ (0,
|
|
2427
|
+
}, `${t}:${le}`);
|
|
2428
|
+
return /* @__PURE__ */ (0, z.jsx)("div", {
|
|
2429
|
+
className: m("mb-3.5", O && ye.has(t) && "-mx-2 rounded-md bg-warn-soft px-2 py-1"),
|
|
2430
|
+
children: r ? /* @__PURE__ */ (0, z.jsx)("fieldset", {
|
|
2398
2431
|
disabled: !0,
|
|
2399
2432
|
className: "m-0 min-w-0 border-0 p-0",
|
|
2400
2433
|
children: i
|
|
@@ -2403,142 +2436,142 @@ function La({ table: e, recordKey: t, headerActions: n, onClose: r }) {
|
|
|
2403
2436
|
})
|
|
2404
2437
|
})]
|
|
2405
2438
|
}),
|
|
2406
|
-
/* @__PURE__ */ (0,
|
|
2439
|
+
/* @__PURE__ */ (0, z.jsxs)(F, {
|
|
2407
2440
|
value: "json",
|
|
2408
2441
|
className: "min-h-0 flex-1 overflow-auto px-4 py-3",
|
|
2409
|
-
children: [/* @__PURE__ */ (0,
|
|
2410
|
-
"aria-label":
|
|
2442
|
+
children: [/* @__PURE__ */ (0, z.jsx)(Ae, {
|
|
2443
|
+
"aria-label": Jt(),
|
|
2411
2444
|
value: JSON.stringify(v, null, 2),
|
|
2412
|
-
extensions: [
|
|
2445
|
+
extensions: [Ee(), we.lineWrapping],
|
|
2413
2446
|
theme: a,
|
|
2414
2447
|
editable: u,
|
|
2415
2448
|
onChange: (t) => {
|
|
2416
2449
|
try {
|
|
2417
2450
|
let n = JSON.parse(t);
|
|
2418
|
-
if (typeof n != "object" || !n || Array.isArray(n)) throw Error(
|
|
2451
|
+
if (typeof n != "object" || !n || Array.isArray(n)) throw Error(Yt());
|
|
2419
2452
|
y({
|
|
2420
2453
|
...n,
|
|
2421
2454
|
[e.key]: v[e.key]
|
|
2422
|
-
}), x((e) => new Set([...e].filter((e) => e !== "$json"))),
|
|
2455
|
+
}), x((e) => new Set([...e].filter((e) => e !== "$json"))), E(null);
|
|
2423
2456
|
} catch (e) {
|
|
2424
|
-
x((e) => /* @__PURE__ */ new Set([...e, "$json"])),
|
|
2457
|
+
x((e) => /* @__PURE__ */ new Set([...e, "$json"])), E(e instanceof Error ? e.message : String(e));
|
|
2425
2458
|
}
|
|
2426
2459
|
}
|
|
2427
|
-
}),
|
|
2428
|
-
className: "mt-1 text-[
|
|
2429
|
-
children:
|
|
2460
|
+
}), ie && /* @__PURE__ */ (0, z.jsx)("p", {
|
|
2461
|
+
className: "mt-1 text-[13px] text-err",
|
|
2462
|
+
children: ie
|
|
2430
2463
|
})]
|
|
2431
2464
|
}),
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2465
|
+
/* @__PURE__ */ (0, z.jsxs)(F, {
|
|
2433
2466
|
value: "yaml",
|
|
2434
2467
|
className: "min-h-0 flex-1 overflow-auto px-4 py-3",
|
|
2435
|
-
children: [d.yamlError && /* @__PURE__ */ (0,
|
|
2436
|
-
className: "mb-2 text-[
|
|
2468
|
+
children: [d.yamlError && /* @__PURE__ */ (0, z.jsx)("p", {
|
|
2469
|
+
className: "mb-2 text-[13px] text-err",
|
|
2437
2470
|
children: d.yamlError
|
|
2438
|
-
}), /* @__PURE__ */ (0,
|
|
2439
|
-
"aria-label":
|
|
2471
|
+
}), /* @__PURE__ */ (0, z.jsx)(Ae, {
|
|
2472
|
+
"aria-label": qt(),
|
|
2440
2473
|
value: d.yaml ?? "# not written to a file yet",
|
|
2441
|
-
extensions: [
|
|
2474
|
+
extensions: [Te(), we.lineWrapping],
|
|
2442
2475
|
editable: !1,
|
|
2443
2476
|
theme: a
|
|
2444
2477
|
})]
|
|
2445
2478
|
}),
|
|
2446
|
-
!S() && /* @__PURE__ */ (0,
|
|
2479
|
+
!S() && /* @__PURE__ */ (0, z.jsx)(F, {
|
|
2447
2480
|
value: "history",
|
|
2448
2481
|
className: "min-h-0 flex-1 overflow-auto px-4 py-3",
|
|
2449
|
-
children: /* @__PURE__ */ (0,
|
|
2482
|
+
children: /* @__PURE__ */ (0, z.jsx)(ji, {
|
|
2450
2483
|
table: e.name,
|
|
2451
2484
|
recordKey: t,
|
|
2452
|
-
query:
|
|
2485
|
+
query: ce,
|
|
2453
2486
|
current: p,
|
|
2454
2487
|
keyColumn: e.key,
|
|
2455
2488
|
canRestore: u,
|
|
2456
|
-
onRestore:
|
|
2489
|
+
onRestore: pe
|
|
2457
2490
|
})
|
|
2458
2491
|
})
|
|
2459
2492
|
]
|
|
2460
2493
|
}),
|
|
2461
|
-
!S() && /* @__PURE__ */ (0,
|
|
2462
|
-
className: "
|
|
2494
|
+
!S() && /* @__PURE__ */ (0, z.jsxs)(Gi, {
|
|
2495
|
+
className: "max-md:flex-wrap",
|
|
2463
2496
|
children: [
|
|
2464
|
-
/* @__PURE__ */ (0,
|
|
2465
|
-
className: "mr-auto flex min-w-0 flex-col text-[
|
|
2466
|
-
children: [
|
|
2467
|
-
from:
|
|
2468
|
-
count:
|
|
2469
|
-
}) :
|
|
2497
|
+
/* @__PURE__ */ (0, z.jsxs)("span", {
|
|
2498
|
+
className: "mr-auto flex min-w-0 flex-col text-[13px] text-muted-foreground max-md:basis-full",
|
|
2499
|
+
children: [be > 0 ? O ? fn({
|
|
2500
|
+
from: O,
|
|
2501
|
+
count: be
|
|
2502
|
+
}) : Lt({ count: be }) : /* @__PURE__ */ (0, z.jsx)(Mi, {
|
|
2470
2503
|
table: e.name,
|
|
2471
2504
|
recordKey: t
|
|
2472
|
-
}),
|
|
2505
|
+
}), M.isError && !(M.error instanceof te && M.error.status === 409) && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
2473
2506
|
className: "text-err",
|
|
2474
|
-
children:
|
|
2507
|
+
children: M.error.message
|
|
2475
2508
|
})]
|
|
2476
2509
|
}),
|
|
2477
|
-
/* @__PURE__ */ (0,
|
|
2510
|
+
/* @__PURE__ */ (0, z.jsx)(k, {
|
|
2478
2511
|
variant: "ghost",
|
|
2479
2512
|
size: "icon",
|
|
2480
|
-
"aria-label":
|
|
2513
|
+
"aria-label": Rt(),
|
|
2481
2514
|
disabled: !l,
|
|
2482
|
-
onClick: () =>
|
|
2483
|
-
children: /* @__PURE__ */ (0,
|
|
2515
|
+
onClick: () => re(!0),
|
|
2516
|
+
children: /* @__PURE__ */ (0, z.jsx)(er, { className: "size-4" })
|
|
2484
2517
|
}),
|
|
2485
|
-
/* @__PURE__ */ (0,
|
|
2518
|
+
/* @__PURE__ */ (0, z.jsx)(k, {
|
|
2486
2519
|
variant: "outline",
|
|
2487
|
-
size:
|
|
2488
|
-
disabled: !
|
|
2489
|
-
onClick: () =>
|
|
2490
|
-
children:
|
|
2520
|
+
size: j ? "lg" : "sm",
|
|
2521
|
+
disabled: !A,
|
|
2522
|
+
onClick: () => de(p),
|
|
2523
|
+
children: Gt()
|
|
2491
2524
|
}),
|
|
2492
|
-
/* @__PURE__ */ (0,
|
|
2493
|
-
size:
|
|
2525
|
+
/* @__PURE__ */ (0, z.jsx)(k, {
|
|
2526
|
+
size: j ? "lg" : "sm",
|
|
2494
2527
|
className: "max-md:flex-1",
|
|
2495
|
-
disabled: !
|
|
2496
|
-
title: l ? void 0 :
|
|
2497
|
-
onClick:
|
|
2498
|
-
children:
|
|
2528
|
+
disabled: !A || b.size > 0 || M.isPending || !l,
|
|
2529
|
+
title: l ? void 0 : We(),
|
|
2530
|
+
onClick: he,
|
|
2531
|
+
children: j ? Ke() : pn()
|
|
2499
2532
|
})
|
|
2500
2533
|
]
|
|
2501
2534
|
}),
|
|
2502
|
-
C && /* @__PURE__ */ (0,
|
|
2535
|
+
C && /* @__PURE__ */ (0, z.jsx)(ja, {
|
|
2503
2536
|
stale: C.fields,
|
|
2504
2537
|
current: C.current,
|
|
2505
2538
|
draft: v,
|
|
2506
2539
|
onClose: () => T(null),
|
|
2507
2540
|
onReload: () => {
|
|
2508
|
-
|
|
2541
|
+
de(C.current), T(null);
|
|
2509
2542
|
},
|
|
2510
2543
|
onOverwrite: () => {
|
|
2511
|
-
let e =
|
|
2544
|
+
let e = Kr(p, v);
|
|
2512
2545
|
for (let t of C.fields) e.base[t] = C.current[t] ?? null;
|
|
2513
|
-
T(null),
|
|
2546
|
+
T(null), M.mutate(e);
|
|
2514
2547
|
}
|
|
2515
2548
|
}),
|
|
2516
|
-
ne && /* @__PURE__ */ (0,
|
|
2549
|
+
ne && /* @__PURE__ */ (0, z.jsx)(ir, {
|
|
2517
2550
|
open: !0,
|
|
2518
2551
|
onOpenChange: (e) => {
|
|
2519
|
-
e || (
|
|
2552
|
+
e || (re(!1), N.reset());
|
|
2520
2553
|
},
|
|
2521
|
-
children: /* @__PURE__ */ (0,
|
|
2522
|
-
/* @__PURE__ */ (0,
|
|
2523
|
-
/* @__PURE__ */ (0,
|
|
2554
|
+
children: /* @__PURE__ */ (0, z.jsxs)(lr, { children: [
|
|
2555
|
+
/* @__PURE__ */ (0, z.jsx)(ur, { children: /* @__PURE__ */ (0, z.jsx)(pr, { children: Wt({ key: t }) }) }),
|
|
2556
|
+
/* @__PURE__ */ (0, z.jsx)("p", {
|
|
2524
2557
|
className: "text-[12px] text-muted-foreground",
|
|
2525
|
-
children:
|
|
2558
|
+
children: Vt({ file: d.file })
|
|
2526
2559
|
}),
|
|
2527
|
-
|
|
2560
|
+
N.error && /* @__PURE__ */ (0, z.jsx)("p", {
|
|
2528
2561
|
className: "text-[12px] text-err",
|
|
2529
|
-
children:
|
|
2562
|
+
children: N.error.message
|
|
2530
2563
|
}),
|
|
2531
|
-
/* @__PURE__ */ (0,
|
|
2564
|
+
/* @__PURE__ */ (0, z.jsxs)(fr, { children: [/* @__PURE__ */ (0, z.jsx)(k, {
|
|
2532
2565
|
variant: "outline",
|
|
2533
2566
|
onClick: () => {
|
|
2534
|
-
|
|
2567
|
+
re(!1), N.reset();
|
|
2535
2568
|
},
|
|
2536
|
-
children:
|
|
2537
|
-
}), /* @__PURE__ */ (0,
|
|
2569
|
+
children: He()
|
|
2570
|
+
}), /* @__PURE__ */ (0, z.jsx)(k, {
|
|
2538
2571
|
variant: "destructive",
|
|
2539
|
-
disabled:
|
|
2540
|
-
onClick: () =>
|
|
2541
|
-
children:
|
|
2572
|
+
disabled: N.isPending,
|
|
2573
|
+
onClick: () => N.mutate(),
|
|
2574
|
+
children: Ue()
|
|
2542
2575
|
})] })
|
|
2543
2576
|
] })
|
|
2544
2577
|
})
|
|
@@ -2547,10 +2580,10 @@ function La({ table: e, recordKey: t, headerActions: n, onClose: r }) {
|
|
|
2547
2580
|
}
|
|
2548
2581
|
//#endregion
|
|
2549
2582
|
//#region ui/src/lib/pageFrame.ts
|
|
2550
|
-
var
|
|
2551
|
-
function
|
|
2552
|
-
|
|
2583
|
+
var Va;
|
|
2584
|
+
function Ha(e) {
|
|
2585
|
+
Va = e;
|
|
2553
2586
|
}
|
|
2554
|
-
var
|
|
2587
|
+
var Ua = () => Va;
|
|
2555
2588
|
//#endregion
|
|
2556
|
-
export {
|
|
2589
|
+
export { Gt as $, hr as A, W as B, Yr as C, yr as D, Or as E, mr as F, Fn as G, er as H, fr as I, zn as J, Mn as K, ur as L, ir as M, dr as N, gr as O, lr as P, Kt as Q, pr as R, Zr as S, qr as T, Jn as U, U as V, En as W, R as X, pn as Y, ln as Z, oi as _, za as a, He as at, ei as b, Gi as c, Le as ct, Pi as d, Ne as dt, Lt as et, Li as f, ai as g, $r as h, La as i, L as it, _r as j, vr as k, Wi as l, Ie as lt, vi as m, Ha as n, Ge as nt, Aa as o, Ve as ot, Mi as p, An as q, Ba as r, We as rt, Ui as s, Be as st, Ua as t, Ke as tt, Vi as u, Fe as ut, ii as v, K as w, Qr as x, ni as y, cr as z };
|