@pstdio/ui 0.17.0 → 0.18.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/dist/{MermaidComponent-BCMQqPqu.js → MermaidComponent-BPiVFNYK.js} +2 -2
- package/dist/{MermaidComponent-BCMQqPqu.js.map → MermaidComponent-BPiVFNYK.js.map} +1 -1
- package/dist/chat-ui.js +2 -2
- package/dist/components/data-table/data-table-column-menu.d.ts +4 -1
- package/dist/components/data-table/data-table-header.d.ts +0 -8
- package/dist/components/data-table/editable-cells-story.d.ts +9 -0
- package/dist/components/diff-viewer/code-editor.d.ts +2 -0
- package/dist/components/diff-viewer/index.d.ts +1 -1
- package/dist/components/diff-viewer/monaco-browser.d.ts +1 -0
- package/dist/components/overlays/searchable-menu-input.d.ts +9 -0
- package/dist/components/param-editor/index.d.ts +5 -2
- package/dist/components/param-editor/inputs/action-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/boolean-input.d.ts +13 -0
- package/dist/components/param-editor/inputs/color-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/date-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/file-upload-input.d.ts +15 -0
- package/dist/components/param-editor/inputs/file-upload-value.d.ts +7 -0
- package/dist/components/param-editor/inputs/horizontal-text-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/markdown-input.d.ts +13 -0
- package/dist/components/param-editor/inputs/number-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/range-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/resource-input.d.ts +2 -0
- package/dist/components/param-editor/inputs/segmented-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/selection-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/selection-menu.d.ts +4 -0
- package/dist/components/param-editor/inputs/text-input.d.ts +1 -0
- package/dist/components/param-editor/param-editor-advanced-field.d.ts +14 -0
- package/dist/components/param-editor/param-editor-control-fixtures.d.ts +24 -0
- package/dist/components/param-editor/param-editor-field.d.ts +2 -0
- package/dist/components/param-editor/param-editor-horizontal.d.ts +2 -2
- package/dist/components/param-editor/param-editor-label.d.ts +1 -0
- package/dist/components/param-editor/param-editor-presentation.d.ts +3 -0
- package/dist/components/param-editor/param-editor.types.d.ts +25 -13
- package/dist/components/param-editor/resolve-param-value.d.ts +2 -0
- package/dist/components/primitives/chip.d.ts +4 -0
- package/dist/components/primitives/index.d.ts +2 -0
- package/dist/components/primitives/resource-badge.d.ts +12 -10
- package/dist/components/rich-text/index.d.ts +1 -0
- package/dist/components/rich-text/lazy-markdown-editor.d.ts +2 -0
- package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
- package/dist/data-table.js +960 -910
- package/dist/data-table.js.map +1 -1
- package/dist/diff.js +370 -366
- package/dist/diff.js.map +1 -1
- package/dist/font/css/prompt-studio-icons.css +690 -0
- package/dist/font/prompt-studio-icons.eot +0 -0
- package/dist/font/prompt-studio-icons.svg +1 -0
- package/dist/font/prompt-studio-icons.ttf +0 -0
- package/dist/font/prompt-studio-icons.woff +0 -0
- package/dist/font/prompt-studio-icons.woff2 +0 -0
- package/dist/index.js +895 -947
- package/dist/index.js.map +1 -1
- package/dist/{kanban-renderer-toolbar-B9ro-9z1.js → kanban-renderer-toolbar-Db1mIWWd.js} +3 -3
- package/dist/{kanban-renderer-toolbar-B9ro-9z1.js.map → kanban-renderer-toolbar-Db1mIWWd.js.map} +1 -1
- package/dist/kanban-renderer.js +831 -817
- package/dist/kanban-renderer.js.map +1 -1
- package/dist/lazy-markdown-editor-DwhqQ-NN.js +26 -0
- package/dist/lazy-markdown-editor-DwhqQ-NN.js.map +1 -0
- package/dist/{list-row-YRUxEcy3.js → list-row-BYWwcbGK.js} +286 -271
- package/dist/list-row-BYWwcbGK.js.map +1 -0
- package/dist/markdown-DDd2ESoH.js +743 -0
- package/dist/markdown-DDd2ESoH.js.map +1 -0
- package/dist/markdown-editor-CYVkzt8t.js +741 -0
- package/dist/markdown-editor-CYVkzt8t.js.map +1 -0
- package/dist/monaco-browser-CO0NxK_Z.js +19 -0
- package/dist/monaco-browser-CO0NxK_Z.js.map +1 -0
- package/dist/param-editor-BCZOw5Gt.js +140 -0
- package/dist/param-editor-BCZOw5Gt.js.map +1 -0
- package/dist/param-editor-field-ZzZwgjZ_.js +2094 -0
- package/dist/param-editor-field-ZzZwgjZ_.js.map +1 -0
- package/dist/resource-badge-CuItchgL.js +98 -0
- package/dist/resource-badge-CuItchgL.js.map +1 -0
- package/dist/rich-message--eRzjWYK.js +730 -0
- package/dist/rich-message--eRzjWYK.js.map +1 -0
- package/dist/rich-text.js +114 -827
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/primitives/fonts.d.ts +3 -0
- package/dist/theme/recipes/badge.d.ts +8 -0
- package/dist/theme/recipes/color-picker.d.ts +18 -1
- package/dist/theme/recipes/switch.d.ts +17 -0
- package/dist/{theme-CNhnbvcE.js → theme-poQlUgt0.js} +284 -156
- package/dist/theme-poQlUgt0.js.map +1 -0
- package/dist/theme.js +1 -1
- package/dist/{tree-list-CZHLAURU.js → tree-list-BAja2eXU.js} +2 -2
- package/dist/{tree-list-CZHLAURU.js.map → tree-list-BAja2eXU.js.map} +1 -1
- package/package.json +2 -1
- package/dist/components/param-editor/inputs/file-accept.d.ts +0 -22
- package/dist/components/param-editor/inputs/file-drop-input.d.ts +0 -14
- package/dist/list-row-YRUxEcy3.js.map +0 -1
- package/dist/param-editor-CYZJbmKu.js +0 -933
- package/dist/param-editor-CYZJbmKu.js.map +0 -1
- package/dist/param-editor-read-only-field-DgtLqcFa.js +0 -925
- package/dist/param-editor-read-only-field-DgtLqcFa.js.map +0 -1
- package/dist/prism-BXb57lxL.js +0 -125
- package/dist/prism-BXb57lxL.js.map +0 -1
- package/dist/resource-badge-qCWHP-wQ.js +0 -99
- package/dist/resource-badge-qCWHP-wQ.js.map +0 -1
- package/dist/rich-message-DBf_5YlW.js +0 -1450
- package/dist/rich-message-DBf_5YlW.js.map +0 -1
- package/dist/theme-CNhnbvcE.js.map +0 -1
package/dist/diff.js
CHANGED
|
@@ -4,15 +4,18 @@ import { Editor as Et, DiffEditor as It } from "@monaco-editor/react";
|
|
|
4
4
|
import { useRef as Z, useEffect as le, useState as X, useLayoutEffect as We } from "react";
|
|
5
5
|
import { u as Lt } from "./theme-preference-DOzHx64J.js";
|
|
6
6
|
import { D as _t, b as ot, a as lt } from "./diff-editor-BnfV8cYB.js";
|
|
7
|
-
import { Box as H, Grid as Ge, Button as it, Text as U, Image as Tt, Stack as ie, Skeleton as st, IconButton as Ke, Menu as J, Badge as rt, Icon as At, HStack as at, InputGroup as Ft, Input as zt, Flex as
|
|
8
|
-
import { useVirtualizer as
|
|
7
|
+
import { Box as H, Grid as Ge, Button as it, Text as U, Image as Tt, Stack as ie, Skeleton as st, IconButton as Ke, Menu as J, Badge as rt, Icon as At, HStack as at, InputGroup as Ft, Input as zt, Flex as Mt } from "@chakra-ui/react";
|
|
8
|
+
import { useVirtualizer as Rt, defaultRangeExtractor as kt } from "@tanstack/react-virtual";
|
|
9
9
|
import { T as Bt, S as Ue } from "./scroll-area-BMbg1WcD.js";
|
|
10
10
|
import { ChevronRight as Ye, ChevronDown as Nt, Check as dt, Copy as Ot, Settings2 as Ht, ListTree as $t, List as Vt, PanelLeftClose as jt, PanelLeftOpen as Wt, Rows2 as Gt, SquareSplitHorizontal as Kt, ChevronsUpDown as Qt, ChevronsDownUp as Ut, FileText as qt, Search as Yt } from "lucide-react";
|
|
11
11
|
import { E as Se } from "./empty-state-Bo4HVrgr.js";
|
|
12
|
-
import { L as Xt, H as ft } from "./list-row-
|
|
13
|
-
import { T as Jt, R as Zt } from "./tree-list-
|
|
12
|
+
import { L as Xt, H as ft } from "./list-row-BYWwcbGK.js";
|
|
13
|
+
import { T as Jt, R as Zt } from "./tree-list-BAja2eXU.js";
|
|
14
14
|
import { create as en } from "zustand";
|
|
15
|
-
const tn = {
|
|
15
|
+
const tn = (t) => {
|
|
16
|
+
let e;
|
|
17
|
+
return () => (e ??= t(), e);
|
|
18
|
+
}, Fo = tn(() => import("./monaco-browser-CO0NxK_Z.js").then((t) => t.initializeMonaco())), nn = {
|
|
16
19
|
base: "vs-dark",
|
|
17
20
|
inherit: !0,
|
|
18
21
|
rules: [],
|
|
@@ -25,46 +28,46 @@ const tn = {
|
|
|
25
28
|
"editorIndentGuide.background": "#404040",
|
|
26
29
|
"editorIndentGuide.activeBackground": "#707070"
|
|
27
30
|
}
|
|
28
|
-
},
|
|
29
|
-
const
|
|
31
|
+
}, on = (t) => typeof t == "object" && t !== null && "base" in t && "colors" in t, be = "ps-theme", ct = () => {
|
|
32
|
+
const t = F(5), {
|
|
30
33
|
themePreference: e,
|
|
31
|
-
themePreferences:
|
|
34
|
+
themePreferences: n
|
|
32
35
|
} = Lt();
|
|
33
36
|
let l;
|
|
34
|
-
if (
|
|
37
|
+
if (t[0] !== e || t[1] !== n) {
|
|
35
38
|
let o;
|
|
36
|
-
|
|
37
|
-
const s =
|
|
38
|
-
l =
|
|
39
|
+
t[3] !== e ? (o = (i) => i.id === e, t[3] = e, t[4] = o) : o = t[4];
|
|
40
|
+
const s = n.find(o);
|
|
41
|
+
l = on(s?.monacoTheme) ? s.monacoTheme : nn, t[0] = e, t[1] = n, t[2] = l;
|
|
39
42
|
} else
|
|
40
|
-
l =
|
|
43
|
+
l = t[2];
|
|
41
44
|
return l;
|
|
42
|
-
}, ut = (
|
|
43
|
-
const e = F(5),
|
|
45
|
+
}, ut = (t) => {
|
|
46
|
+
const e = F(5), n = Z(null);
|
|
44
47
|
let l, o;
|
|
45
|
-
e[0] !==
|
|
46
|
-
const i =
|
|
47
|
-
i && (i.editor.defineTheme(be,
|
|
48
|
-
}, o = [
|
|
48
|
+
e[0] !== t ? (l = () => {
|
|
49
|
+
const i = n.current;
|
|
50
|
+
i && (i.editor.defineTheme(be, t), i.editor.setTheme(be));
|
|
51
|
+
}, o = [t], e[0] = t, e[1] = l, e[2] = o) : (l = e[1], o = e[2]), le(l, o);
|
|
49
52
|
let s;
|
|
50
|
-
return e[3] !==
|
|
51
|
-
|
|
52
|
-
}, e[3] =
|
|
53
|
-
},
|
|
53
|
+
return e[3] !== t ? (s = (i) => {
|
|
54
|
+
n.current = i, i.editor.defineTheme(be, t), i.editor.setTheme(be);
|
|
55
|
+
}, e[3] = t, e[4] = s) : s = e[4], s;
|
|
56
|
+
}, zo = (t) => {
|
|
54
57
|
const e = F(20), {
|
|
55
|
-
defaultCode:
|
|
58
|
+
defaultCode: n,
|
|
56
59
|
code: l,
|
|
57
60
|
showLineNumbers: o,
|
|
58
61
|
isEditable: s,
|
|
59
62
|
language: i,
|
|
60
63
|
onChange: a,
|
|
61
64
|
disableScroll: f
|
|
62
|
-
} =
|
|
65
|
+
} = t, c = i === void 0 ? "javascript" : i, m = ct(), h = ut(m);
|
|
63
66
|
let d;
|
|
64
67
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = {
|
|
65
68
|
enabled: !1
|
|
66
69
|
}, e[0] = d) : d = e[0];
|
|
67
|
-
const g = !s,
|
|
70
|
+
const g = !s, C = o ? "on" : "off";
|
|
68
71
|
let b;
|
|
69
72
|
e[1] !== f ? (b = f ? {
|
|
70
73
|
scrollbar: {
|
|
@@ -78,21 +81,21 @@ const tn = {
|
|
|
78
81
|
overviewRulerLanes: 0
|
|
79
82
|
} : {}, e[1] = f, e[2] = b) : b = e[2];
|
|
80
83
|
let u;
|
|
81
|
-
e[3] !== g || e[4] !==
|
|
84
|
+
e[3] !== g || e[4] !== C || e[5] !== b ? (u = {
|
|
82
85
|
tabSize: 2,
|
|
83
86
|
minimap: d,
|
|
84
87
|
fontSize: 12,
|
|
85
88
|
readOnly: g,
|
|
86
|
-
lineNumbers:
|
|
89
|
+
lineNumbers: C,
|
|
87
90
|
...b
|
|
88
|
-
}, e[3] = g, e[4] =
|
|
91
|
+
}, e[3] = g, e[4] = C, e[5] = b, e[6] = u) : u = e[6];
|
|
89
92
|
const w = u;
|
|
90
93
|
let y;
|
|
91
94
|
e[7] !== a ? (y = (E) => {
|
|
92
95
|
a?.(E || "");
|
|
93
96
|
}, e[7] = a, e[8] = y) : y = e[8];
|
|
94
|
-
let
|
|
95
|
-
e[9] !== h ? (
|
|
97
|
+
let D, v;
|
|
98
|
+
e[9] !== h ? (D = (E) => {
|
|
96
99
|
h(E);
|
|
97
100
|
}, v = async (E, p) => {
|
|
98
101
|
h(p), p.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
@@ -100,17 +103,17 @@ const tn = {
|
|
|
100
103
|
}), E.addCommand(p.KeyMod.CtrlCmd | p.KeyCode.KeyS, async () => {
|
|
101
104
|
await E.getAction("editor.action.formatDocument")?.run();
|
|
102
105
|
}), await E.getAction("editor.action.formatDocument")?.run();
|
|
103
|
-
}, e[9] = h, e[10] =
|
|
106
|
+
}, e[9] = h, e[10] = D, e[11] = v) : (D = e[10], v = e[11]);
|
|
104
107
|
let x;
|
|
105
|
-
return e[12] !== l || e[13] !==
|
|
106
|
-
},
|
|
108
|
+
return e[12] !== l || e[13] !== n || e[14] !== c || e[15] !== w || e[16] !== y || e[17] !== D || e[18] !== v ? (x = /* @__PURE__ */ r(Et, { width: "100%", height: "100%", language: c, defaultValue: n, value: l, theme: be, options: w, onChange: y, beforeMount: D, onMount: v }), e[12] = l, e[13] = n, e[14] = c, e[15] = w, e[16] = y, e[17] = D, e[18] = v, e[19] = x) : x = e[19], x;
|
|
109
|
+
}, Mo = (t) => {
|
|
107
110
|
const e = F(16), {
|
|
108
|
-
original:
|
|
111
|
+
original: n,
|
|
109
112
|
modified: l,
|
|
110
113
|
showLineNumbers: o,
|
|
111
114
|
language: s,
|
|
112
115
|
disableScroll: i
|
|
113
|
-
} =
|
|
116
|
+
} = t, a = s === void 0 ? "javascript" : s, f = ct(), c = ut(f);
|
|
114
117
|
let m;
|
|
115
118
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = {
|
|
116
119
|
enabled: !1
|
|
@@ -140,17 +143,17 @@ const tn = {
|
|
|
140
143
|
lineNumbers: h,
|
|
141
144
|
...d
|
|
142
145
|
}, e[3] = h, e[4] = d, e[5] = g) : g = e[5];
|
|
143
|
-
const
|
|
146
|
+
const C = g;
|
|
144
147
|
let b, u;
|
|
145
148
|
e[6] !== c ? (b = (y) => {
|
|
146
149
|
c(y);
|
|
147
|
-
}, u = (y,
|
|
148
|
-
c(
|
|
149
|
-
jsx:
|
|
150
|
+
}, u = (y, D) => {
|
|
151
|
+
c(D), D.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
152
|
+
jsx: D.languages.typescript.JsxEmit.React
|
|
150
153
|
});
|
|
151
154
|
}, e[6] = c, e[7] = b, e[8] = u) : (b = e[7], u = e[8]);
|
|
152
155
|
let w;
|
|
153
|
-
return e[9] !== a || e[10] !== l || e[11] !==
|
|
156
|
+
return e[9] !== a || e[10] !== l || e[11] !== C || e[12] !== n || e[13] !== b || e[14] !== u ? (w = /* @__PURE__ */ r(It, { width: "100%", height: "100%", language: a, original: n, modified: l, theme: be, options: C, beforeMount: b, onMount: u }), e[9] = a, e[10] = l, e[11] = C, e[12] = n, e[13] = b, e[14] = u, e[15] = w) : w = e[15], w;
|
|
154
157
|
}, ht = {
|
|
155
158
|
avif: "image/avif",
|
|
156
159
|
bmp: "image/bmp",
|
|
@@ -163,22 +166,22 @@ const tn = {
|
|
|
163
166
|
tif: "image/tiff",
|
|
164
167
|
tiff: "image/tiff",
|
|
165
168
|
webp: "image/webp"
|
|
166
|
-
},
|
|
167
|
-
const
|
|
168
|
-
return
|
|
169
|
-
},
|
|
170
|
-
const e = pt(
|
|
169
|
+
}, ln = Object.keys(ht), pt = (t) => {
|
|
170
|
+
const n = (t.split(/[\\/]/).pop() ?? t).split(".").pop();
|
|
171
|
+
return n ? n.toLowerCase() : "";
|
|
172
|
+
}, sn = (t) => {
|
|
173
|
+
const e = pt(t);
|
|
171
174
|
return ht[e] ?? null;
|
|
172
|
-
},
|
|
173
|
-
const e =
|
|
174
|
-
return
|
|
175
|
-
}, qe = (
|
|
176
|
-
const e = pt(
|
|
177
|
-
return e.length > 0 &&
|
|
178
|
-
}, we =
|
|
175
|
+
}, rn = (t) => sn(t) !== null, an = 1e3, dn = /* @__PURE__ */ new Set(["bun.lock", "bun.lockb", "package-lock.json", "pnpm-lock.yaml", "yarn.lock"]), fn = /* @__PURE__ */ new Set([...ln, "pdf", "zip", "tar", "gz", "tgz", "rar", "7z", "exe", "dll", "so", "dylib", "wasm", "class", "jar", "mp3", "mp4", "mov", "ogg", "wav", "webm", "flac", "ttf", "otf", "woff", "woff2", "eot"]), mt = (t) => (t.additions ?? 0) + (t.deletions ?? 0), gt = (t) => mt(t) > an, cn = (t) => {
|
|
176
|
+
const e = t.split(/[\\/]/).pop() ?? t;
|
|
177
|
+
return dn.has(e) || e.endsWith(".min.js") || e.endsWith(".generated.ts");
|
|
178
|
+
}, qe = (t) => {
|
|
179
|
+
const e = pt(t);
|
|
180
|
+
return e.length > 0 && fn.has(e);
|
|
181
|
+
}, we = rn, un = (t) => {
|
|
179
182
|
const {
|
|
180
183
|
diff: e,
|
|
181
|
-
filePath:
|
|
184
|
+
filePath: n,
|
|
182
185
|
oldContent: l,
|
|
183
186
|
newContent: o,
|
|
184
187
|
isLargeDiff: s,
|
|
@@ -186,23 +189,23 @@ const tn = {
|
|
|
186
189
|
onShowFullDiff: a,
|
|
187
190
|
diffViewMode: f = "unified",
|
|
188
191
|
buildViewData: c
|
|
189
|
-
} =
|
|
190
|
-
if (qe(
|
|
192
|
+
} = t;
|
|
193
|
+
if (qe(n)) {
|
|
191
194
|
const h = Xe(l), d = Xe(o);
|
|
192
|
-
return we(
|
|
195
|
+
return we(n) && (h || d) ? {
|
|
193
196
|
kind: "image",
|
|
194
|
-
filePath:
|
|
197
|
+
filePath: n,
|
|
195
198
|
oldSrc: h,
|
|
196
199
|
newSrc: d
|
|
197
200
|
} : {
|
|
198
201
|
kind: "binary",
|
|
199
|
-
filePath:
|
|
200
|
-
isImage: we(
|
|
202
|
+
filePath: n,
|
|
203
|
+
isImage: we(n)
|
|
201
204
|
};
|
|
202
205
|
}
|
|
203
206
|
return s && !i ? {
|
|
204
207
|
kind: "placeholder",
|
|
205
|
-
filePath:
|
|
208
|
+
filePath: n,
|
|
206
209
|
renderedLineCount: mt(e),
|
|
207
210
|
onShowFullDiff: a
|
|
208
211
|
} : {
|
|
@@ -215,9 +218,9 @@ const tn = {
|
|
|
215
218
|
}),
|
|
216
219
|
sideBySide: f === "split"
|
|
217
220
|
};
|
|
218
|
-
}, Xe = (
|
|
221
|
+
}, Xe = (t) => t.startsWith("data:image/") ? t : "", Je = (t) => {
|
|
219
222
|
const e = F(22), {
|
|
220
|
-
diff:
|
|
223
|
+
diff: n,
|
|
221
224
|
filePath: l,
|
|
222
225
|
oldContent: o,
|
|
223
226
|
newContent: s,
|
|
@@ -225,10 +228,10 @@ const tn = {
|
|
|
225
228
|
hasOptedIntoLargeDiff: a,
|
|
226
229
|
onShowFullDiff: f,
|
|
227
230
|
diffViewMode: c
|
|
228
|
-
} =
|
|
231
|
+
} = t, m = c === void 0 ? "unified" : c;
|
|
229
232
|
let h;
|
|
230
|
-
e[0] !==
|
|
231
|
-
diff:
|
|
233
|
+
e[0] !== n || e[1] !== m || e[2] !== l || e[3] !== a || e[4] !== i || e[5] !== s || e[6] !== o || e[7] !== f ? (h = un({
|
|
234
|
+
diff: n,
|
|
232
235
|
filePath: l,
|
|
233
236
|
oldContent: o,
|
|
234
237
|
newContent: s,
|
|
@@ -236,22 +239,22 @@ const tn = {
|
|
|
236
239
|
hasOptedIntoLargeDiff: a,
|
|
237
240
|
onShowFullDiff: f,
|
|
238
241
|
diffViewMode: m
|
|
239
|
-
}), e[0] =
|
|
242
|
+
}), e[0] = n, e[1] = m, e[2] = l, e[3] = a, e[4] = i, e[5] = s, e[6] = o, e[7] = f, e[8] = h) : h = e[8];
|
|
240
243
|
const d = h;
|
|
241
244
|
let g;
|
|
242
|
-
return e[9] !==
|
|
243
|
-
},
|
|
245
|
+
return e[9] !== n || e[10] !== d.diffViewData || e[11] !== d.filePath || e[12] !== d.isImage || e[13] !== d.kind || e[14] !== d.newSrc || e[15] !== d.oldSrc || e[16] !== d.onShowFullDiff || e[17] !== d.renderedLineCount || e[18] !== d.sideBySide || e[19] !== s || e[20] !== o ? (g = /* @__PURE__ */ r(H, { bg: "bg", borderBottomRadius: "xs", overflow: "hidden", children: d.kind === "editor" ? /* @__PURE__ */ r(_t, { original: o, modified: s, oldPath: n.oldPath, newPath: n.newPath, sideBySide: d.sideBySide, data: d.diffViewData }) : d.kind === "image" ? /* @__PURE__ */ r(hn, { oldSrc: d.oldSrc, newSrc: d.newSrc }) : d.kind === "binary" ? /* @__PURE__ */ r(mn, { isImage: d.isImage }) : /* @__PURE__ */ r(pn, { filePath: d.filePath, renderedLineCount: d.renderedLineCount, onShowFullDiff: d.onShowFullDiff }) }), e[9] = n, e[10] = d.diffViewData, e[11] = d.filePath, e[12] = d.isImage, e[13] = d.kind, e[14] = d.newSrc, e[15] = d.oldSrc, e[16] = d.onShowFullDiff, e[17] = d.renderedLineCount, e[18] = d.sideBySide, e[19] = s, e[20] = o, e[21] = g) : g = e[21], g;
|
|
246
|
+
}, hn = (t) => {
|
|
244
247
|
const e = F(8), {
|
|
245
|
-
oldSrc:
|
|
248
|
+
oldSrc: n,
|
|
246
249
|
newSrc: l
|
|
247
|
-
} =
|
|
250
|
+
} = t;
|
|
248
251
|
let o;
|
|
249
252
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {
|
|
250
253
|
base: "1fr",
|
|
251
254
|
md: "1fr 1fr"
|
|
252
255
|
}, e[0] = o) : o = e[0];
|
|
253
256
|
let s;
|
|
254
|
-
e[1] !==
|
|
257
|
+
e[1] !== n ? (s = /* @__PURE__ */ r(Ze, { label: "Old", src: n, fallback: "No old image" }), e[1] = n, e[2] = s) : s = e[2];
|
|
255
258
|
let i;
|
|
256
259
|
e[3] !== l ? (i = /* @__PURE__ */ r(Ze, { label: "New", src: l, fallback: "No new image" }), e[3] = l, e[4] = i) : i = e[4];
|
|
257
260
|
let a;
|
|
@@ -259,70 +262,70 @@ const tn = {
|
|
|
259
262
|
s,
|
|
260
263
|
i
|
|
261
264
|
] }), e[5] = s, e[6] = i, e[7] = a) : a = e[7], a;
|
|
262
|
-
}, Ze = (
|
|
265
|
+
}, Ze = (t) => {
|
|
263
266
|
const e = F(9), {
|
|
264
|
-
label:
|
|
267
|
+
label: n,
|
|
265
268
|
src: l,
|
|
266
269
|
fallback: o
|
|
267
|
-
} =
|
|
270
|
+
} = t;
|
|
268
271
|
let s;
|
|
269
|
-
e[0] !==
|
|
272
|
+
e[0] !== n ? (s = /* @__PURE__ */ r(U, { px: "xs", py: "2xs", textStyle: "label/S/medium", color: "fg.muted", borderBottom: "1px solid", borderColor: "border.subtle", children: n }), e[0] = n, e[1] = s) : s = e[1];
|
|
270
273
|
let i;
|
|
271
|
-
e[2] !== o || e[3] !==
|
|
274
|
+
e[2] !== o || e[3] !== n || e[4] !== l ? (i = /* @__PURE__ */ r(H, { display: "grid", placeItems: "center", minH: "180px", p: "sm", children: l ? /* @__PURE__ */ r(Tt, { src: l, alt: `${n} image diff`, maxH: "260px", maxW: "100%", objectFit: "contain" }) : /* @__PURE__ */ r(U, { color: "fg.muted", textStyle: "body/S/regular", children: o }) }), e[2] = o, e[3] = n, e[4] = l, e[5] = i) : i = e[5];
|
|
272
275
|
let a;
|
|
273
276
|
return e[6] !== s || e[7] !== i ? (a = /* @__PURE__ */ W(H, { border: "1px solid", borderColor: "border.subtle", borderRadius: "xs", overflow: "hidden", bg: "bg.subtle", minW: "0", children: [
|
|
274
277
|
s,
|
|
275
278
|
i
|
|
276
279
|
] }), e[6] = s, e[7] = i, e[8] = a) : a = e[8], a;
|
|
277
|
-
},
|
|
280
|
+
}, pn = (t) => {
|
|
278
281
|
const e = F(5), {
|
|
279
|
-
filePath:
|
|
282
|
+
filePath: n,
|
|
280
283
|
onShowFullDiff: l
|
|
281
|
-
} =
|
|
284
|
+
} = t;
|
|
282
285
|
let o;
|
|
283
|
-
e[0] !==
|
|
286
|
+
e[0] !== n || e[1] !== l ? (o = l ? /* @__PURE__ */ r(it, { size: "xs", variant: "outline", "aria-label": `Render full diff for ${n}`, onClick: l, children: "Show full diff" }) : null, e[0] = n, e[1] = l, e[2] = o) : o = e[2];
|
|
284
287
|
let s;
|
|
285
288
|
return e[3] !== o ? (s = /* @__PURE__ */ r(H, { p: "md", borderTop: "1px solid", borderColor: "border.subtle", bg: "bg", children: /* @__PURE__ */ r(Se, { title: "Large diffs are hidden by default", paddingY: "sm", children: o }) }), e[3] = o, e[4] = s) : s = e[4], s;
|
|
286
|
-
},
|
|
289
|
+
}, mn = (t) => {
|
|
287
290
|
const e = F(2), {
|
|
288
|
-
isImage:
|
|
289
|
-
} =
|
|
291
|
+
isImage: n
|
|
292
|
+
} = t, l = n ? "Image diffs are not shown" : "Binary diffs are not shown";
|
|
290
293
|
let o;
|
|
291
294
|
return e[0] !== l ? (o = /* @__PURE__ */ r(H, { p: "md", borderTop: "1px solid", borderColor: "border.subtle", bg: "bg", children: /* @__PURE__ */ r(Se, { title: l, paddingY: "sm" }) }), e[0] = l, e[1] = o) : o = e[1], o;
|
|
292
|
-
},
|
|
295
|
+
}, gn = (t) => {
|
|
293
296
|
const e = F(7), {
|
|
294
|
-
title:
|
|
297
|
+
title: n,
|
|
295
298
|
actionLabel: l,
|
|
296
299
|
isLoadingDiff: o,
|
|
297
300
|
onAction: s
|
|
298
|
-
} =
|
|
301
|
+
} = t;
|
|
299
302
|
let i;
|
|
300
303
|
e[0] !== l || e[1] !== o || e[2] !== s ? (i = l ? /* @__PURE__ */ r(it, { size: "xs", variant: "outline", loading: o, onClick: s, children: l }) : null, e[0] = l, e[1] = o, e[2] = s, e[3] = i) : i = e[3];
|
|
301
304
|
let a;
|
|
302
|
-
return e[4] !== i || e[5] !==
|
|
303
|
-
},
|
|
304
|
-
const
|
|
305
|
+
return e[4] !== i || e[5] !== n ? (a = /* @__PURE__ */ r(H, { bg: "bg", p: "md", borderTop: "1px solid", borderColor: "border.subtle", children: /* @__PURE__ */ r(Se, { title: n, paddingY: "sm", children: i }) }), e[4] = i, e[5] = n, e[6] = a) : a = e[6], a;
|
|
306
|
+
}, bn = ["first", "second", "third"], Sn = () => {
|
|
307
|
+
const t = F(1);
|
|
305
308
|
let e;
|
|
306
|
-
return
|
|
309
|
+
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ r(ie, { h: "280px", bg: "bg", borderTop: "1px solid", borderColor: "border.subtle", p: "xs", gap: "2xs", role: "status", "aria-busy": "true", "aria-label": "Loading diff", children: bn.map(xn) }), t[0] = e) : e = t[0], e;
|
|
307
310
|
};
|
|
308
|
-
function
|
|
309
|
-
return /* @__PURE__ */ r(st, { h: "20px", w: "full", borderRadius: "xs" },
|
|
311
|
+
function xn(t) {
|
|
312
|
+
return /* @__PURE__ */ r(st, { h: "20px", w: "full", borderRadius: "xs" }, t);
|
|
310
313
|
}
|
|
311
|
-
const
|
|
314
|
+
const wn = (t) => {
|
|
312
315
|
const {
|
|
313
316
|
isLargeDiff: e,
|
|
314
|
-
isGeneratedDiff:
|
|
317
|
+
isGeneratedDiff: n,
|
|
315
318
|
loadError: l,
|
|
316
319
|
canLoadDiff: o,
|
|
317
320
|
onLoadDiff: s,
|
|
318
321
|
onShowFullDiff: i
|
|
319
|
-
} =
|
|
322
|
+
} = t;
|
|
320
323
|
let a = "Diff content is not loaded yet.", f = o ? "Load diff" : void 0, c = o ? () => {
|
|
321
324
|
s();
|
|
322
325
|
} : void 0;
|
|
323
326
|
return e && (a = "Large diffs are hidden by default", f = o ? "Show full diff" : void 0, c = () => {
|
|
324
327
|
i?.(), s();
|
|
325
|
-
}),
|
|
328
|
+
}), n && (a = "Generated diffs are hidden by default", f = o ? "Load diff" : void 0, c = o ? () => {
|
|
326
329
|
s();
|
|
327
330
|
} : void 0), l && (a = "Diff failed to load. Try again.", f = o ? "Load diff" : void 0, c = o ? () => {
|
|
328
331
|
s();
|
|
@@ -331,9 +334,9 @@ const xn = (n) => {
|
|
|
331
334
|
actionLabel: f,
|
|
332
335
|
onAction: c
|
|
333
336
|
};
|
|
334
|
-
},
|
|
337
|
+
}, Cn = (t) => {
|
|
335
338
|
const e = F(30), {
|
|
336
|
-
diff:
|
|
339
|
+
diff: n,
|
|
337
340
|
filePath: l,
|
|
338
341
|
oldContent: o,
|
|
339
342
|
newContent: s,
|
|
@@ -345,21 +348,21 @@ const xn = (n) => {
|
|
|
345
348
|
canLoadDiff: h,
|
|
346
349
|
shouldAutoLoadDiff: d,
|
|
347
350
|
loadError: g,
|
|
348
|
-
isLoadingDiff:
|
|
351
|
+
isLoadingDiff: C,
|
|
349
352
|
onLoadDiff: b,
|
|
350
353
|
hasOptedIntoLargeDiff: u,
|
|
351
354
|
onShowFullDiff: w,
|
|
352
355
|
diffViewMode: y
|
|
353
|
-
} =
|
|
356
|
+
} = t, D = y === void 0 ? "unified" : y;
|
|
354
357
|
if (!i)
|
|
355
358
|
return null;
|
|
356
359
|
if (c) {
|
|
357
360
|
let x;
|
|
358
|
-
return e[0] !==
|
|
361
|
+
return e[0] !== n || e[1] !== D || e[2] !== l || e[3] !== u || e[4] !== s || e[5] !== o || e[6] !== w ? (x = /* @__PURE__ */ r(Je, { diff: n, filePath: l, oldContent: o, newContent: s, isLargeDiff: !1, hasOptedIntoLargeDiff: u, onShowFullDiff: w, diffViewMode: D }), e[0] = n, e[1] = D, e[2] = l, e[3] = u, e[4] = s, e[5] = o, e[6] = w, e[7] = x) : x = e[7], x;
|
|
359
362
|
}
|
|
360
363
|
if (!m && !d) {
|
|
361
364
|
let x;
|
|
362
|
-
e[8] !== h || e[9] !== f || e[10] !== a || e[11] !== g || e[12] !== b || e[13] !== w ? (x =
|
|
365
|
+
e[8] !== h || e[9] !== f || e[10] !== a || e[11] !== g || e[12] !== b || e[13] !== w ? (x = wn({
|
|
363
366
|
isLargeDiff: a,
|
|
364
367
|
isGeneratedDiff: f,
|
|
365
368
|
loadError: g,
|
|
@@ -373,55 +376,55 @@ const xn = (n) => {
|
|
|
373
376
|
onAction: P
|
|
374
377
|
} = x;
|
|
375
378
|
let S;
|
|
376
|
-
return e[15] !== p || e[16] !==
|
|
379
|
+
return e[15] !== p || e[16] !== C || e[17] !== P || e[18] !== E ? (S = /* @__PURE__ */ r(gn, { title: E, actionLabel: p, isLoadingDiff: C, onAction: P }), e[15] = p, e[16] = C, e[17] = P, e[18] = E, e[19] = S) : S = e[19], S;
|
|
377
380
|
}
|
|
378
381
|
if (d) {
|
|
379
382
|
let x;
|
|
380
|
-
return e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ r(
|
|
383
|
+
return e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ r(Sn, {}), e[20] = x) : x = e[20], x;
|
|
381
384
|
}
|
|
382
385
|
let v;
|
|
383
|
-
return e[21] !==
|
|
384
|
-
}, Dn = (
|
|
386
|
+
return e[21] !== n || e[22] !== D || e[23] !== l || e[24] !== u || e[25] !== a || e[26] !== s || e[27] !== o || e[28] !== w ? (v = /* @__PURE__ */ r(Je, { diff: n, filePath: l, oldContent: o, newContent: s, isLargeDiff: a, hasOptedIntoLargeDiff: u, onShowFullDiff: w, diffViewMode: D }), e[21] = n, e[22] = D, e[23] = l, e[24] = u, e[25] = a, e[26] = s, e[27] = o, e[28] = w, e[29] = v) : v = e[29], v;
|
|
387
|
+
}, Dn = (t) => {
|
|
385
388
|
const {
|
|
386
389
|
isExpanded: e,
|
|
387
|
-
hasDiffContent:
|
|
390
|
+
hasDiffContent: n,
|
|
388
391
|
isLargeDiff: l,
|
|
389
392
|
isGeneratedDiff: o,
|
|
390
393
|
isBinaryDiff: s,
|
|
391
394
|
requestedPath: i,
|
|
392
395
|
filePath: a
|
|
393
|
-
} =
|
|
394
|
-
return e && !
|
|
395
|
-
},
|
|
396
|
+
} = t;
|
|
397
|
+
return e && !n && !l && !o && !s && i !== a;
|
|
398
|
+
}, yn = (t) => {
|
|
396
399
|
const {
|
|
397
400
|
requestedPath: e,
|
|
398
|
-
filePath:
|
|
401
|
+
filePath: n,
|
|
399
402
|
hasDiffContent: l
|
|
400
|
-
} =
|
|
401
|
-
return e ===
|
|
402
|
-
},
|
|
403
|
+
} = t;
|
|
404
|
+
return e === n && l ? null : e;
|
|
405
|
+
}, Pn = (t) => !we(t), bt = (t) => t.newPath || t.oldPath || "unknown", vn = (t) => {
|
|
403
406
|
const {
|
|
404
407
|
filePath: e,
|
|
405
|
-
isExpanded:
|
|
408
|
+
isExpanded: n,
|
|
406
409
|
isSelected: l,
|
|
407
410
|
hasDiffContent: o,
|
|
408
411
|
isLargeDiff: s,
|
|
409
412
|
isGeneratedDiff: i,
|
|
410
413
|
isBinaryDiff: a,
|
|
411
414
|
onLoadDiff: f
|
|
412
|
-
} =
|
|
415
|
+
} = t, [c, m] = X(!1), [h, d] = X(null), [g, C] = X(!1), b = async () => {
|
|
413
416
|
if (!(!f || c)) {
|
|
414
|
-
d(e),
|
|
417
|
+
d(e), C(!1), m(!0);
|
|
415
418
|
try {
|
|
416
419
|
await f(e);
|
|
417
420
|
} catch {
|
|
418
|
-
d(null),
|
|
421
|
+
d(null), C(!0);
|
|
419
422
|
} finally {
|
|
420
423
|
m(!1);
|
|
421
424
|
}
|
|
422
425
|
}
|
|
423
426
|
}, u = Dn({
|
|
424
|
-
isExpanded:
|
|
427
|
+
isExpanded: n,
|
|
425
428
|
hasDiffContent: o,
|
|
426
429
|
isLargeDiff: s,
|
|
427
430
|
isGeneratedDiff: i,
|
|
@@ -430,7 +433,7 @@ const xn = (n) => {
|
|
|
430
433
|
filePath: e
|
|
431
434
|
});
|
|
432
435
|
return le(() => {
|
|
433
|
-
d((w) =>
|
|
436
|
+
d((w) => yn({
|
|
434
437
|
requestedPath: w,
|
|
435
438
|
filePath: e,
|
|
436
439
|
hasDiffContent: o
|
|
@@ -443,9 +446,9 @@ const xn = (n) => {
|
|
|
443
446
|
shouldAutoLoadDiff: !!f && u && !g,
|
|
444
447
|
loadDiff: b
|
|
445
448
|
};
|
|
446
|
-
},
|
|
449
|
+
}, En = (t) => {
|
|
447
450
|
const e = F(44), {
|
|
448
|
-
diff:
|
|
451
|
+
diff: n,
|
|
449
452
|
isSelected: l,
|
|
450
453
|
isExpanded: o,
|
|
451
454
|
onToggleExpanded: s,
|
|
@@ -454,10 +457,10 @@ const xn = (n) => {
|
|
|
454
457
|
hasOptedIntoLargeDiff: f,
|
|
455
458
|
onShowFullDiff: c,
|
|
456
459
|
diffViewMode: m
|
|
457
|
-
} =
|
|
458
|
-
let b, u, w, y,
|
|
459
|
-
e[0] !==
|
|
460
|
-
const x = v, E =
|
|
460
|
+
} = t, h = l === void 0 ? !1 : l, d = o === void 0 ? !0 : o, g = f === void 0 ? !1 : f, C = m === void 0 ? "unified" : m;
|
|
461
|
+
let b, u, w, y, D, v;
|
|
462
|
+
e[0] !== n ? (b = bt(n), D = n.oldContent || "", y = n.newContent || "", w = gt(n), u = cn(b), v = qe(b) && !we(b), e[0] = n, e[1] = b, e[2] = u, e[3] = w, e[4] = y, e[5] = D, e[6] = v) : (b = e[1], u = e[2], w = e[3], y = e[4], D = e[5], v = e[6]);
|
|
463
|
+
const x = v, E = n.oldContent !== void 0 || n.newContent !== void 0, p = w && !g;
|
|
461
464
|
let P;
|
|
462
465
|
e[7] !== x || e[8] !== b || e[9] !== E || e[10] !== d || e[11] !== u || e[12] !== h || e[13] !== a || e[14] !== p ? (P = {
|
|
463
466
|
filePath: b,
|
|
@@ -474,34 +477,34 @@ const xn = (n) => {
|
|
|
474
477
|
loadError: I,
|
|
475
478
|
shouldAutoLoadDiff: L,
|
|
476
479
|
loadDiff: z
|
|
477
|
-
} =
|
|
480
|
+
} = vn(P), M = h ? "border.accent" : "border.subtle";
|
|
478
481
|
let T;
|
|
479
482
|
e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = {
|
|
480
483
|
borderColor: "border.accent"
|
|
481
484
|
}, e[16] = T) : T = e[16];
|
|
482
485
|
let _;
|
|
483
|
-
e[17] !==
|
|
486
|
+
e[17] !== n || e[18] !== d || e[19] !== s ? (_ = /* @__PURE__ */ r(In, { diff: n, isExpanded: d, onToggleExpanded: s }), e[17] = n, e[18] = d, e[19] = s, e[20] = _) : _ = e[20];
|
|
484
487
|
const A = !!a;
|
|
485
|
-
let
|
|
486
|
-
e[21] !== x || e[22] !==
|
|
488
|
+
let R;
|
|
489
|
+
e[21] !== x || e[22] !== n || e[23] !== C || e[24] !== b || e[25] !== E || e[26] !== g || e[27] !== d || e[28] !== u || e[29] !== w || e[30] !== S || e[31] !== z || e[32] !== I || e[33] !== y || e[34] !== D || e[35] !== c || e[36] !== L || e[37] !== A ? (R = /* @__PURE__ */ r(Cn, { diff: n, filePath: b, oldContent: D, newContent: y, isExpanded: d, isLargeDiff: w, isGeneratedDiff: u, isBinaryDiff: x, hasDiffContent: E, canLoadDiff: A, shouldAutoLoadDiff: L, loadError: I, isLoadingDiff: S, onLoadDiff: z, hasOptedIntoLargeDiff: g, onShowFullDiff: c, diffViewMode: C }), e[21] = x, e[22] = n, e[23] = C, e[24] = b, e[25] = E, e[26] = g, e[27] = d, e[28] = u, e[29] = w, e[30] = S, e[31] = z, e[32] = I, e[33] = y, e[34] = D, e[35] = c, e[36] = L, e[37] = A, e[38] = R) : R = e[38];
|
|
487
490
|
let k;
|
|
488
|
-
return e[39] !== i || e[40] !==
|
|
491
|
+
return e[39] !== i || e[40] !== R || e[41] !== M || e[42] !== _ ? (k = /* @__PURE__ */ W(H, { "data-testid": "diff-card", border: "1px solid", borderColor: M, borderRadius: "xs", overflow: "visible", bg: "bg", width: "100%", maxW: "100%", transition: "border-color 0.14s ease", _hover: T, onClick: i, children: [
|
|
489
492
|
_,
|
|
490
|
-
|
|
491
|
-
] }), e[39] = i, e[40] =
|
|
492
|
-
},
|
|
493
|
+
R
|
|
494
|
+
] }), e[39] = i, e[40] = R, e[41] = M, e[42] = _, e[43] = k) : k = e[43], k;
|
|
495
|
+
}, In = (t) => {
|
|
493
496
|
const e = F(58), {
|
|
494
|
-
diff:
|
|
497
|
+
diff: n,
|
|
495
498
|
isExpanded: l,
|
|
496
499
|
onToggleExpanded: o
|
|
497
|
-
} =
|
|
500
|
+
} = t, s = l === void 0 ? !0 : l;
|
|
498
501
|
let i, a, f, c;
|
|
499
|
-
e[0] !==
|
|
502
|
+
e[0] !== n ? (f = bt(n), i = n.additions ?? 0, a = n.deletions ?? 0, c = Pn(f), e[0] = n, e[1] = i, e[2] = a, e[3] = f, e[4] = c) : (i = e[1], a = e[2], f = e[3], c = e[4]);
|
|
500
503
|
const m = c, [h, d] = X(!1), g = Z(null);
|
|
501
|
-
let
|
|
502
|
-
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
504
|
+
let C, b;
|
|
505
|
+
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (C = () => () => {
|
|
503
506
|
g.current !== null && window.clearTimeout(g.current);
|
|
504
|
-
}, b = [], e[5] =
|
|
507
|
+
}, b = [], e[5] = C, e[6] = b) : (C = e[5], b = e[6]), le(C, b);
|
|
505
508
|
let u;
|
|
506
509
|
e[7] !== f ? (u = async () => {
|
|
507
510
|
try {
|
|
@@ -510,7 +513,7 @@ const xn = (n) => {
|
|
|
510
513
|
d(!1);
|
|
511
514
|
}
|
|
512
515
|
}, e[7] = f, e[8] = u) : u = e[8];
|
|
513
|
-
const w = u, y = s ? "1px solid" : "none",
|
|
516
|
+
const w = u, y = s ? "1px solid" : "none", D = s ? "0" : "xs";
|
|
514
517
|
let v;
|
|
515
518
|
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = {
|
|
516
519
|
bg: "bg"
|
|
@@ -527,14 +530,14 @@ const xn = (n) => {
|
|
|
527
530
|
let S;
|
|
528
531
|
e[16] !== p || e[17] !== P || e[18] !== E ? (S = /* @__PURE__ */ r(Ke, { "aria-label": E, variant: "ghost", size: "2xs", onClick: p, flexShrink: 0, children: P }), e[16] = p, e[17] = P, e[18] = E, e[19] = S) : S = e[19];
|
|
529
532
|
let I;
|
|
530
|
-
e[20] !==
|
|
531
|
-
/* @__PURE__ */ r(U, { as: "span", color: "fg.muted", textDecoration: "line-through", mr: "xs", children:
|
|
533
|
+
e[20] !== n.change || e[21] !== n.newPath || e[22] !== n.oldPath || e[23] !== f ? (I = n.change === "renamed" ? /* @__PURE__ */ W(U, { as: "span", textStyle: "sm", children: [
|
|
534
|
+
/* @__PURE__ */ r(U, { as: "span", color: "fg.muted", textDecoration: "line-through", mr: "xs", children: n.oldPath }),
|
|
532
535
|
/* @__PURE__ */ r(H, { as: "span", display: "inline-flex", alignItems: "center", verticalAlign: "middle", mr: "xs", children: /* @__PURE__ */ r(Ye, { size: 12 }) }),
|
|
533
|
-
|
|
534
|
-
] }) :
|
|
536
|
+
n.newPath
|
|
537
|
+
] }) : n.change === "deleted" ? /* @__PURE__ */ r(U, { as: "span", color: "fg.muted", textDecoration: "line-through", textStyle: "sm", children: f }) : /* @__PURE__ */ r(U, { as: "span", textStyle: "sm", children: f }), e[20] = n.change, e[21] = n.newPath, e[22] = n.oldPath, e[23] = f, e[24] = I) : I = e[24];
|
|
535
538
|
let L;
|
|
536
539
|
e[25] !== f || e[26] !== I ? (L = /* @__PURE__ */ r(H, { minW: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", title: f, children: I }), e[25] = f, e[26] = I, e[27] = L) : L = e[27];
|
|
537
|
-
const z = h ? "1" : "0",
|
|
540
|
+
const z = h ? "1" : "0", M = h ? "auto" : "none";
|
|
538
541
|
let T;
|
|
539
542
|
e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = {
|
|
540
543
|
"[data-testid='diff-card-header']:hover &, [data-testid='diff-card-header']:focus-within &": {
|
|
@@ -543,18 +546,18 @@ const xn = (n) => {
|
|
|
543
546
|
}
|
|
544
547
|
}, e[28] = T) : T = e[28];
|
|
545
548
|
const _ = h ? "Copied" : "Copy file path", A = h ? "Copied" : "Copy file path";
|
|
546
|
-
let
|
|
547
|
-
e[29] !== w ? (
|
|
549
|
+
let R;
|
|
550
|
+
e[29] !== w ? (R = (q) => {
|
|
548
551
|
q.stopPropagation(), w();
|
|
549
|
-
}, e[29] = w, e[30] =
|
|
552
|
+
}, e[29] = w, e[30] = R) : R = e[30];
|
|
550
553
|
let k;
|
|
551
554
|
e[31] !== h ? (k = h ? /* @__PURE__ */ r(dt, { size: 12 }) : /* @__PURE__ */ r(Ot, { size: 12 }), e[31] = h, e[32] = k) : k = e[32];
|
|
552
555
|
let $;
|
|
553
|
-
e[33] !== A || e[34] !==
|
|
556
|
+
e[33] !== A || e[34] !== R || e[35] !== k ? ($ = /* @__PURE__ */ r(Ke, { "aria-label": A, variant: "ghost", size: "2xs", onClick: R, flexShrink: 0, children: k }), e[33] = A, e[34] = R, e[35] = k, e[36] = $) : $ = e[36];
|
|
554
557
|
let N;
|
|
555
558
|
e[37] !== _ || e[38] !== $ ? (N = /* @__PURE__ */ r(Bt, { content: _, children: $ }), e[37] = _, e[38] = $, e[39] = N) : N = e[39];
|
|
556
559
|
let B;
|
|
557
|
-
e[40] !== z || e[41] !==
|
|
560
|
+
e[40] !== z || e[41] !== M || e[42] !== N ? (B = /* @__PURE__ */ r(H, { opacity: z, pointerEvents: M, transition: "opacity 120ms ease", css: T, children: N }), e[40] = z, e[41] = M, e[42] = N, e[43] = B) : B = e[43];
|
|
558
561
|
let V;
|
|
559
562
|
e[44] !== L || e[45] !== B ? (V = /* @__PURE__ */ W(Ge, { templateColumns: "minmax(0, max-content) auto", alignItems: "center", justifyContent: "start", gap: "2xs", minW: 0, children: [
|
|
560
563
|
L,
|
|
@@ -563,29 +566,29 @@ const xn = (n) => {
|
|
|
563
566
|
let j;
|
|
564
567
|
e[47] !== i || e[48] !== a || e[49] !== m ? (j = m ? /* @__PURE__ */ r(H, { flexShrink: 0, children: /* @__PURE__ */ r(lt, { variant: "ghost", additions: i, deletions: a }) }) : null, e[47] = i, e[48] = a, e[49] = m, e[50] = j) : j = e[50];
|
|
565
568
|
let G;
|
|
566
|
-
return e[51] !== S || e[52] !== V || e[53] !== j || e[54] !== y || e[55] !==
|
|
569
|
+
return e[51] !== S || e[52] !== V || e[53] !== j || e[54] !== y || e[55] !== D || e[56] !== x ? (G = /* @__PURE__ */ W(Ge, { "data-testid": "diff-card-header", templateColumns: "auto minmax(0, 1fr) auto", px: "xs", py: "2xs", alignItems: "center", justifyContent: "space-between", borderBottom: y, borderColor: "border.subtle", borderTopRadius: "xs", borderBottomRadius: D, position: "sticky", top: "0", zIndex: "1", bg: "bg", cursor: "pointer", transition: "background 0.14s ease", _hover: v, onClick: x, gap: "sm", children: [
|
|
567
570
|
S,
|
|
568
571
|
V,
|
|
569
572
|
j
|
|
570
|
-
] }), e[51] = S, e[52] = V, e[53] = j, e[54] = y, e[55] =
|
|
571
|
-
},
|
|
572
|
-
const
|
|
573
|
+
] }), e[51] = S, e[52] = V, e[53] = j, e[54] = y, e[55] = D, e[56] = x, e[57] = G) : G = e[57], G;
|
|
574
|
+
}, Ln = () => {
|
|
575
|
+
const t = F(1);
|
|
573
576
|
let e;
|
|
574
|
-
return
|
|
577
|
+
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ r(ie, { h: "full", minH: "0", gap: "0", bg: "bg", children: /* @__PURE__ */ r(Ue, { flex: "1", minH: "0", contentProps: {
|
|
575
578
|
p: "xs",
|
|
576
579
|
spaceY: "xs"
|
|
577
|
-
}, children: /* @__PURE__ */ r(Se, { title: "No changes detected", description: "Make some changes to see the diff here.", paddingY: "sm" }) }) }),
|
|
578
|
-
}, Qe = 34,
|
|
580
|
+
}, children: /* @__PURE__ */ r(Se, { title: "No changes detected", description: "Make some changes to see the diff here.", paddingY: "sm" }) }) }), t[0] = e) : e = t[0], e;
|
|
581
|
+
}, Qe = 34, _n = 18, Tn = 28, An = 34, Fn = 88, zn = 338, ze = 8, Fe = () => Qe + Fn + ze, Mn = (t) => {
|
|
579
582
|
const {
|
|
580
583
|
diff: e,
|
|
581
|
-
isCollapsed:
|
|
584
|
+
isCollapsed: n,
|
|
582
585
|
hasOptedIntoLargeDiff: l = !1,
|
|
583
586
|
diffViewMode: o = "unified"
|
|
584
|
-
} =
|
|
585
|
-
if (
|
|
587
|
+
} = t;
|
|
588
|
+
if (n) return An + ze;
|
|
586
589
|
const s = e.oldContent !== void 0 || e.newContent !== void 0, i = e.newPath ?? e.oldPath ?? "";
|
|
587
590
|
if (we(i) && (e.oldContent || e.newContent))
|
|
588
|
-
return Qe +
|
|
591
|
+
return Qe + zn + ze;
|
|
589
592
|
if (qe(i) || !s || gt(e) && !l) return Fe();
|
|
590
593
|
const {
|
|
591
594
|
unifiedContentRows: a,
|
|
@@ -598,17 +601,17 @@ const xn = (n) => {
|
|
|
598
601
|
newPath: e.newPath
|
|
599
602
|
}), m = o === "split" ? f : a;
|
|
600
603
|
if (m === 0 && c === 0) return Fe();
|
|
601
|
-
const h = m *
|
|
604
|
+
const h = m * _n + c * Tn;
|
|
602
605
|
return Qe + h + ze;
|
|
603
|
-
}, Rn = (
|
|
606
|
+
}, Rn = (t) => t.newPath ?? t.oldPath ?? "unknown", kn = 24, Bn = (t) => {
|
|
604
607
|
const {
|
|
605
608
|
diffs: e,
|
|
606
|
-
selectedDiffPath:
|
|
609
|
+
selectedDiffPath: n,
|
|
607
610
|
collapsedPaths: l,
|
|
608
611
|
expansionCommand: o,
|
|
609
612
|
completedScrollCommandId: s
|
|
610
|
-
} =
|
|
611
|
-
let i =
|
|
613
|
+
} = t;
|
|
614
|
+
let i = n, a = n ? `selected:${n}` : null;
|
|
612
615
|
const f = o?.action === "expand-selected" ? o.id : null, c = f !== null && s === f;
|
|
613
616
|
o?.action === "expand-selected" && o.path && (i = o.path, a = `command:${o.id}:${o.path}`);
|
|
614
617
|
let m = a;
|
|
@@ -625,48 +628,48 @@ const xn = (n) => {
|
|
|
625
628
|
shouldPinSelectedScrollIndex: d,
|
|
626
629
|
hasCompletedSelectedScroll: c
|
|
627
630
|
};
|
|
628
|
-
},
|
|
631
|
+
}, Nn = (t) => {
|
|
629
632
|
const {
|
|
630
633
|
indexes: e,
|
|
631
|
-
selectedScrollIndex:
|
|
634
|
+
selectedScrollIndex: n,
|
|
632
635
|
shouldPinSelectedScrollIndex: l
|
|
633
|
-
} =
|
|
634
|
-
if (!l || e.includes(
|
|
635
|
-
const o = Math.max(0,
|
|
636
|
-
length:
|
|
636
|
+
} = t;
|
|
637
|
+
if (!l || e.includes(n)) return e;
|
|
638
|
+
const o = Math.max(0, n - kn), s = Array.from({
|
|
639
|
+
length: n - o + 1
|
|
637
640
|
}, (i, a) => o + a);
|
|
638
641
|
return Array.from(/* @__PURE__ */ new Set([...e, ...s])).sort((i, a) => i - a);
|
|
639
|
-
},
|
|
642
|
+
}, On = 3, Hn = 12, $n = (t) => t.newPath ?? t.oldPath ?? "unknown", Vn = (t) => {
|
|
640
643
|
const e = F(20), {
|
|
641
|
-
diffs:
|
|
644
|
+
diffs: n,
|
|
642
645
|
selectedDiffPath: l,
|
|
643
646
|
collapsedPaths: o,
|
|
644
647
|
expansionCommand: s,
|
|
645
648
|
scrollRef: i,
|
|
646
649
|
virtualizerRef: a,
|
|
647
650
|
suppressScrollAdjustRef: f
|
|
648
|
-
} =
|
|
651
|
+
} = t, [c, m] = X(null);
|
|
649
652
|
let h;
|
|
650
|
-
e[0] !== o || e[1] !== c || e[2] !==
|
|
651
|
-
diffs:
|
|
653
|
+
e[0] !== o || e[1] !== c || e[2] !== n || e[3] !== s || e[4] !== l ? (h = Bn({
|
|
654
|
+
diffs: n,
|
|
652
655
|
selectedDiffPath: l,
|
|
653
656
|
collapsedPaths: o,
|
|
654
657
|
expansionCommand: s,
|
|
655
658
|
completedScrollCommandId: c
|
|
656
|
-
}), e[0] = o, e[1] = c, e[2] =
|
|
659
|
+
}), e[0] = o, e[1] = c, e[2] = n, e[3] = s, e[4] = l, e[5] = h) : h = e[5];
|
|
657
660
|
const {
|
|
658
661
|
selectedScrollPath: d,
|
|
659
662
|
selectedScrollKey: g,
|
|
660
|
-
selectedScrollCommandId:
|
|
663
|
+
selectedScrollCommandId: C,
|
|
661
664
|
selectedScrollIndex: b,
|
|
662
665
|
shouldPinSelectedScrollIndex: u,
|
|
663
666
|
hasCompletedSelectedScroll: w
|
|
664
667
|
} = h;
|
|
665
|
-
let y,
|
|
666
|
-
e[6] !== o || e[7] !==
|
|
668
|
+
let y, D;
|
|
669
|
+
e[6] !== o || e[7] !== n || e[8] !== w || e[9] !== i || e[10] !== C || e[11] !== g || e[12] !== d || e[13] !== f || e[14] !== a ? (y = () => {
|
|
667
670
|
if (!d || !g || w || o.has(d))
|
|
668
671
|
return;
|
|
669
|
-
const x =
|
|
672
|
+
const x = n.findIndex((T) => $n(T) === d);
|
|
670
673
|
if (x < 0)
|
|
671
674
|
return;
|
|
672
675
|
const E = a.current, p = i.current;
|
|
@@ -678,19 +681,19 @@ const xn = (n) => {
|
|
|
678
681
|
const I = () => {
|
|
679
682
|
f.current = !1;
|
|
680
683
|
}, L = () => {
|
|
681
|
-
S = !0, I(),
|
|
684
|
+
S = !0, I(), C !== null && m(C);
|
|
682
685
|
};
|
|
683
686
|
let z = 0;
|
|
684
|
-
const
|
|
687
|
+
const M = () => {
|
|
685
688
|
if (!S) {
|
|
686
689
|
if (E.scrollToIndex(x, {
|
|
687
690
|
align: "start"
|
|
688
|
-
}), z = z + 1, z >=
|
|
689
|
-
I(), m(
|
|
691
|
+
}), z = z + 1, z >= On && C !== null) {
|
|
692
|
+
I(), m(C);
|
|
690
693
|
return;
|
|
691
694
|
}
|
|
692
|
-
if (z <
|
|
693
|
-
P.push(requestAnimationFrame(
|
|
695
|
+
if (z < Hn) {
|
|
696
|
+
P.push(requestAnimationFrame(M));
|
|
694
697
|
return;
|
|
695
698
|
}
|
|
696
699
|
I();
|
|
@@ -700,60 +703,60 @@ const xn = (n) => {
|
|
|
700
703
|
passive: !0
|
|
701
704
|
}), p.addEventListener("touchmove", L, {
|
|
702
705
|
passive: !0
|
|
703
|
-
}),
|
|
706
|
+
}), M(), () => {
|
|
704
707
|
I(), p.removeEventListener("wheel", L), p.removeEventListener("touchmove", L);
|
|
705
708
|
for (const T of P)
|
|
706
709
|
cancelAnimationFrame(T);
|
|
707
710
|
};
|
|
708
|
-
},
|
|
711
|
+
}, D = [g, d, C, w, n, o, i, a, f], e[6] = o, e[7] = n, e[8] = w, e[9] = i, e[10] = C, e[11] = g, e[12] = d, e[13] = f, e[14] = a, e[15] = y, e[16] = D) : (y = e[15], D = e[16]), We(y, D);
|
|
709
712
|
let v;
|
|
710
713
|
return e[17] !== b || e[18] !== u ? (v = {
|
|
711
714
|
selectedScrollIndex: b,
|
|
712
715
|
shouldPinSelectedScrollIndex: u
|
|
713
716
|
}, e[17] = b, e[18] = u, e[19] = v) : v = e[19], v;
|
|
714
|
-
}, ee = (
|
|
717
|
+
}, ee = (t) => t.newPath ?? t.oldPath ?? "unknown", et = 10, jn = 100, Wn = (t) => t.length <= et ? /* @__PURE__ */ new Set() : new Set(t.filter((e, n) => {
|
|
715
718
|
const l = (e.additions ?? 0) + (e.deletions ?? 0);
|
|
716
|
-
return
|
|
717
|
-
}).map((e) => ee(e))),
|
|
718
|
-
const
|
|
719
|
-
return
|
|
720
|
-
}, St = (
|
|
721
|
-
if (!
|
|
719
|
+
return n >= et || l > jn;
|
|
720
|
+
}).map((e) => ee(e))), Gn = (t) => new Set(t.map((e) => ee(e))), Kn = (t, e) => {
|
|
721
|
+
const n = new Set(t);
|
|
722
|
+
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
723
|
+
}, St = (t, e, n) => {
|
|
724
|
+
if (!n || !e.has(n) || !t.some((o) => ee(o) === n)) return e;
|
|
722
725
|
const l = new Set(e);
|
|
723
|
-
return l.delete(
|
|
724
|
-
},
|
|
725
|
-
const o = St(
|
|
726
|
-
if (!l || l ===
|
|
726
|
+
return l.delete(n), l;
|
|
727
|
+
}, Qn = (t, e, n, l) => {
|
|
728
|
+
const o = St(t, e, n);
|
|
729
|
+
if (!l || l === n || o.has(l) || !t.some((i) => ee(i) === l))
|
|
727
730
|
return o;
|
|
728
731
|
const s = o === e ? new Set(e) : o;
|
|
729
732
|
return s.add(l), s;
|
|
730
733
|
};
|
|
731
|
-
function
|
|
734
|
+
function Un(t) {
|
|
732
735
|
const {
|
|
733
736
|
diffs: e,
|
|
734
|
-
selectedDiffPath:
|
|
737
|
+
selectedDiffPath: n = null,
|
|
735
738
|
onLoadDiff: l,
|
|
736
739
|
onSelectDiffPath: o,
|
|
737
740
|
onExpansionStateChange: s,
|
|
738
741
|
expansionCommand: i = null,
|
|
739
742
|
diffViewMode: a = "unified"
|
|
740
|
-
} =
|
|
743
|
+
} = t, f = Z(null), c = Z(null), m = Z(null), h = Z(!1), d = Z(null), [g, C] = X(() => Wn(e)), [b, u] = X(() => /* @__PURE__ */ new Set()), {
|
|
741
744
|
selectedScrollIndex: w,
|
|
742
745
|
shouldPinSelectedScrollIndex: y
|
|
743
|
-
} =
|
|
746
|
+
} = Vn({
|
|
744
747
|
diffs: e,
|
|
745
|
-
selectedDiffPath:
|
|
748
|
+
selectedDiffPath: n,
|
|
746
749
|
collapsedPaths: g,
|
|
747
750
|
expansionCommand: i,
|
|
748
751
|
scrollRef: f,
|
|
749
752
|
virtualizerRef: m,
|
|
750
753
|
suppressScrollAdjustRef: h
|
|
751
|
-
}),
|
|
754
|
+
}), D = Rt({
|
|
752
755
|
count: e.length,
|
|
753
756
|
getScrollElement: () => f.current,
|
|
754
757
|
estimateSize: (p) => {
|
|
755
758
|
const P = e[p], S = ee(P);
|
|
756
|
-
return
|
|
759
|
+
return Mn({
|
|
757
760
|
diff: P,
|
|
758
761
|
isCollapsed: g.has(S),
|
|
759
762
|
hasOptedIntoLargeDiff: b.has(S),
|
|
@@ -764,26 +767,26 @@ function Qn(n) {
|
|
|
764
767
|
overscan: 3,
|
|
765
768
|
rangeExtractor: (p) => {
|
|
766
769
|
const P = kt(p);
|
|
767
|
-
return
|
|
770
|
+
return Nn({
|
|
768
771
|
indexes: P,
|
|
769
772
|
selectedScrollIndex: w,
|
|
770
773
|
shouldPinSelectedScrollIndex: y
|
|
771
774
|
});
|
|
772
775
|
}
|
|
773
776
|
});
|
|
774
|
-
if (
|
|
775
|
-
|
|
776
|
-
}, [e,
|
|
777
|
+
if (D.shouldAdjustScrollPositionOnItemSizeChange = (p, P, S) => !S.isScrolling && !h.current, m.current = D, We(() => {
|
|
778
|
+
n && C((p) => St(e, p, n));
|
|
779
|
+
}, [e, n]), We(() => {
|
|
777
780
|
if (i) {
|
|
778
781
|
if (i.action === "expand-selected") {
|
|
779
782
|
const p = i.path;
|
|
780
783
|
if (p) {
|
|
781
784
|
const P = d.current;
|
|
782
|
-
d.current = p,
|
|
785
|
+
d.current = p, C((S) => Qn(e, S, p, P));
|
|
783
786
|
}
|
|
784
787
|
return;
|
|
785
788
|
}
|
|
786
|
-
d.current = null,
|
|
789
|
+
d.current = null, C(i.action === "collapse" ? Gn(e) : /* @__PURE__ */ new Set());
|
|
787
790
|
}
|
|
788
791
|
}, [e, i]), le(() => {
|
|
789
792
|
const p = {
|
|
@@ -791,15 +794,15 @@ function Qn(n) {
|
|
|
791
794
|
allCollapsed: e.length > 0 && e.every((S) => g.has(ee(S)))
|
|
792
795
|
}, P = c.current;
|
|
793
796
|
P?.allExpanded === p.allExpanded && P.allCollapsed === p.allCollapsed || (c.current = p, s?.(p));
|
|
794
|
-
}, [g, e, s]), e.length === 0) return /* @__PURE__ */ r(
|
|
797
|
+
}, [g, e, s]), e.length === 0) return /* @__PURE__ */ r(Ln, {});
|
|
795
798
|
const v = (p) => {
|
|
796
|
-
|
|
799
|
+
C((P) => Kn(P, p));
|
|
797
800
|
}, x = (p) => {
|
|
798
801
|
u((P) => {
|
|
799
802
|
const S = new Set(P);
|
|
800
803
|
return S.add(p), S;
|
|
801
804
|
});
|
|
802
|
-
}, E =
|
|
805
|
+
}, E = D.getVirtualItems();
|
|
803
806
|
return /* @__PURE__ */ r(ie, { h: "full", minH: "0", gap: "0", bg: "bg", children: /* @__PURE__ */ r(H, { position: "relative", flex: "1", minH: "0", bg: "bg", children: /* @__PURE__ */ r(Ue, { position: "absolute", inset: "0", viewportRef: f, viewportProps: {
|
|
804
807
|
style: {
|
|
805
808
|
overflowAnchor: "none"
|
|
@@ -807,33 +810,33 @@ function Qn(n) {
|
|
|
807
810
|
}, contentProps: {
|
|
808
811
|
p: "xs"
|
|
809
812
|
}, children: /* @__PURE__ */ r(H, { position: "relative", width: "100%", style: {
|
|
810
|
-
height:
|
|
813
|
+
height: D.getTotalSize()
|
|
811
814
|
}, children: E.map((p) => {
|
|
812
815
|
const P = e[p.index], S = ee(P);
|
|
813
|
-
return /* @__PURE__ */ r(H, { "data-index": p.index, ref:
|
|
816
|
+
return /* @__PURE__ */ r(H, { "data-index": p.index, ref: D.measureElement, position: "absolute", left: "0", width: "100%", pb: "xs", style: {
|
|
814
817
|
top: `${p.start}px`
|
|
815
|
-
}, children: /* @__PURE__ */ r(
|
|
818
|
+
}, children: /* @__PURE__ */ r(En, { diff: P, isSelected: n === S, isExpanded: !g.has(S), onToggleExpanded: () => v(S), onSelect: () => o?.(S), onLoadDiff: l, hasOptedIntoLargeDiff: b.has(S), onShowFullDiff: () => x(S), diffViewMode: a }, S) }, p.key);
|
|
816
819
|
}) }) }) }) });
|
|
817
820
|
}
|
|
818
|
-
const
|
|
821
|
+
const qn = (t) => t.split("/").map((e) => e.trim()).filter(Boolean).join("/"), xt = (t) => (t.sort((e, n) => e.type !== n.type ? e.type === "folder" ? -1 : 1 : e.name.localeCompare(n.name)), t.forEach((e) => {
|
|
819
822
|
e.children && xt(e.children);
|
|
820
|
-
}),
|
|
823
|
+
}), t), wt = (t) => Array.from(new Set(t.map(qn).filter(Boolean))), Yn = (t) => wt(t).map((e) => ({
|
|
821
824
|
id: `file:${e}`,
|
|
822
825
|
name: e,
|
|
823
826
|
type: "file"
|
|
824
|
-
})).sort((e,
|
|
825
|
-
if (e === "flat") return
|
|
826
|
-
const
|
|
827
|
-
return wt(
|
|
827
|
+
})).sort((e, n) => e.name.localeCompare(n.name)), Me = (t, e) => {
|
|
828
|
+
if (e === "flat") return Yn(t);
|
|
829
|
+
const n = /* @__PURE__ */ new Map(), l = [];
|
|
830
|
+
return wt(t).forEach((o) => {
|
|
828
831
|
const s = o.split("/");
|
|
829
832
|
let i = "", a = null;
|
|
830
833
|
s.forEach((f, c) => {
|
|
831
|
-
const m = i ? `${i}/${f}` : f, h = c === s.length - 1, d = `${h ? "file" : "folder"}:${m}`, g =
|
|
834
|
+
const m = i ? `${i}/${f}` : f, h = c === s.length - 1, d = `${h ? "file" : "folder"}:${m}`, g = n.get(d);
|
|
832
835
|
if (g) {
|
|
833
836
|
a = g, i = m;
|
|
834
837
|
return;
|
|
835
838
|
}
|
|
836
|
-
const
|
|
839
|
+
const C = {
|
|
837
840
|
id: d,
|
|
838
841
|
name: f,
|
|
839
842
|
type: h ? "file" : "folder",
|
|
@@ -841,91 +844,91 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
841
844
|
children: []
|
|
842
845
|
}
|
|
843
846
|
};
|
|
844
|
-
|
|
847
|
+
n.set(d, C), a ? a.children?.push(C) : l.push(C), a = C, i = m;
|
|
845
848
|
});
|
|
846
849
|
}), xt(l);
|
|
847
|
-
}, tt = (
|
|
848
|
-
const e = [],
|
|
850
|
+
}, tt = (t) => {
|
|
851
|
+
const e = [], n = (l) => {
|
|
849
852
|
l.forEach((o) => {
|
|
850
|
-
o.type === "folder" && (e.push(o.id),
|
|
853
|
+
o.type === "folder" && (e.push(o.id), n(o.children ?? []));
|
|
851
854
|
});
|
|
852
855
|
};
|
|
853
|
-
return t
|
|
854
|
-
},
|
|
855
|
-
const e = [],
|
|
856
|
+
return n(t), e;
|
|
857
|
+
}, Xn = (t) => {
|
|
858
|
+
const e = [], n = (l) => {
|
|
856
859
|
l.forEach((o) => {
|
|
857
860
|
if (o.type === "file") {
|
|
858
861
|
e.push(o.id.replace(/^file:/, ""));
|
|
859
862
|
return;
|
|
860
863
|
}
|
|
861
|
-
|
|
864
|
+
n(o.children ?? []);
|
|
862
865
|
});
|
|
863
866
|
};
|
|
864
|
-
return t
|
|
865
|
-
},
|
|
867
|
+
return n(t), e;
|
|
868
|
+
}, Jn = (t, e) => e === "flat" ? [...t].sort((n, l) => n.localeCompare(l)) : Xn(Me(t, "nested")), Zn = en((t) => ({
|
|
866
869
|
isTreePanelOpen: !0,
|
|
867
870
|
viewMode: "nested",
|
|
868
871
|
diffViewMode: "unified",
|
|
869
872
|
searchQuery: "",
|
|
870
873
|
selectedPath: null,
|
|
871
874
|
expandedFolderIds: /* @__PURE__ */ new Set(),
|
|
872
|
-
setTreePanelOpen: (e) =>
|
|
875
|
+
setTreePanelOpen: (e) => t({
|
|
873
876
|
isTreePanelOpen: e
|
|
874
877
|
}),
|
|
875
|
-
toggleTreePanel: () =>
|
|
878
|
+
toggleTreePanel: () => t((e) => ({
|
|
876
879
|
isTreePanelOpen: !e.isTreePanelOpen
|
|
877
880
|
})),
|
|
878
|
-
setViewMode: (e) =>
|
|
881
|
+
setViewMode: (e) => t({
|
|
879
882
|
viewMode: e
|
|
880
883
|
}),
|
|
881
|
-
setDiffViewMode: (e) =>
|
|
884
|
+
setDiffViewMode: (e) => t({
|
|
882
885
|
diffViewMode: e
|
|
883
886
|
}),
|
|
884
|
-
setSearchQuery: (e) =>
|
|
887
|
+
setSearchQuery: (e) => t({
|
|
885
888
|
searchQuery: e
|
|
886
889
|
}),
|
|
887
|
-
setSelectedPath: (e) =>
|
|
890
|
+
setSelectedPath: (e) => t({
|
|
888
891
|
selectedPath: e
|
|
889
892
|
}),
|
|
890
|
-
setExpandedFolderIds: (e) =>
|
|
893
|
+
setExpandedFolderIds: (e) => t({
|
|
891
894
|
expandedFolderIds: new Set(e)
|
|
892
895
|
}),
|
|
893
|
-
toggleFolder: (e) =>
|
|
894
|
-
const l = new Set(
|
|
896
|
+
toggleFolder: (e) => t((n) => {
|
|
897
|
+
const l = new Set(n.expandedFolderIds);
|
|
895
898
|
return l.has(e) ? l.delete(e) : l.add(e), {
|
|
896
899
|
expandedFolderIds: l
|
|
897
900
|
};
|
|
898
901
|
}),
|
|
899
|
-
expandAll: (e) =>
|
|
902
|
+
expandAll: (e) => t({
|
|
900
903
|
expandedFolderIds: new Set(e)
|
|
901
904
|
}),
|
|
902
|
-
collapseAll: () =>
|
|
905
|
+
collapseAll: () => t({
|
|
903
906
|
expandedFolderIds: /* @__PURE__ */ new Set()
|
|
904
907
|
})
|
|
905
|
-
})),
|
|
908
|
+
})), eo = (t) => {
|
|
906
909
|
const e = F(4);
|
|
907
|
-
let
|
|
908
|
-
e[0] !==
|
|
910
|
+
let n;
|
|
911
|
+
e[0] !== t.selected ? (n = t.selected ? /* @__PURE__ */ r(dt, { size: 14 }) : null, e[0] = t.selected, e[1] = n) : n = e[1];
|
|
909
912
|
let l;
|
|
910
|
-
return e[2] !==
|
|
911
|
-
}, ne = (
|
|
913
|
+
return e[2] !== n ? (l = /* @__PURE__ */ r(H, { w: "14px", flexShrink: 0, display: "flex", justifyContent: "center", children: n }), e[2] = n, e[3] = l) : l = e[3], l;
|
|
914
|
+
}, ne = (t) => {
|
|
912
915
|
const e = F(15), {
|
|
913
|
-
id:
|
|
916
|
+
id: n,
|
|
914
917
|
label: l,
|
|
915
918
|
icon: o,
|
|
916
919
|
selected: s,
|
|
917
920
|
disabled: i,
|
|
918
921
|
onActivate: a
|
|
919
|
-
} =
|
|
922
|
+
} = t, f = s === void 0 ? void 0 : "menuitemradio";
|
|
920
923
|
let c;
|
|
921
|
-
e[0] !== s ? (c = s === void 0 ? void 0 : /* @__PURE__ */ r(
|
|
924
|
+
e[0] !== s ? (c = s === void 0 ? void 0 : /* @__PURE__ */ r(eo, { selected: s }), e[0] = s, e[1] = c) : c = e[1];
|
|
922
925
|
let m;
|
|
923
|
-
e[2] !== i || e[3] !== o || e[4] !==
|
|
926
|
+
e[2] !== i || e[3] !== o || e[4] !== n || e[5] !== l || e[6] !== a || e[7] !== s || e[8] !== f || e[9] !== c ? (m = /* @__PURE__ */ r(Xt, { asChild: !0, role: f, "aria-checked": s, variant: "full-width", id: n, icon: o, label: l, disabled: i, isSelected: s, endContent: c, onActivate: a }), e[2] = i, e[3] = o, e[4] = n, e[5] = l, e[6] = a, e[7] = s, e[8] = f, e[9] = c, e[10] = m) : m = e[10];
|
|
924
927
|
let h;
|
|
925
|
-
return e[11] !== i || e[12] !==
|
|
926
|
-
},
|
|
928
|
+
return e[11] !== i || e[12] !== n || e[13] !== m ? (h = /* @__PURE__ */ r(J.Item, { value: n, disabled: i, asChild: !0, children: m }), e[11] = i, e[12] = n, e[13] = m, e[14] = h) : h = e[14], h;
|
|
929
|
+
}, to = (t) => {
|
|
927
930
|
const e = F(40), {
|
|
928
|
-
isTreePanelOpen:
|
|
931
|
+
isTreePanelOpen: n,
|
|
929
932
|
hasFilePaths: l,
|
|
930
933
|
viewMode: o,
|
|
931
934
|
diffViewMode: s,
|
|
@@ -936,14 +939,14 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
936
939
|
onDiffViewModeChange: m,
|
|
937
940
|
onExpandAll: h,
|
|
938
941
|
onCollapseAll: d
|
|
939
|
-
} =
|
|
942
|
+
} = t;
|
|
940
943
|
let g;
|
|
941
944
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ r(J.Trigger, { asChild: !0, children: /* @__PURE__ */ r(Ke, { "aria-label": "Diff view options", variant: "ghost", size: "sm", children: /* @__PURE__ */ r(Ht, { size: 14 }) }) }), e[0] = g) : g = e[0];
|
|
942
|
-
let
|
|
943
|
-
e[1] !==
|
|
944
|
-
const b =
|
|
945
|
+
let C;
|
|
946
|
+
e[1] !== n ? (C = n ? /* @__PURE__ */ r(jt, { size: 14 }) : /* @__PURE__ */ r(Wt, { size: 14 }), e[1] = n, e[2] = C) : C = e[2];
|
|
947
|
+
const b = n ? "Hide file tree" : "Show file tree";
|
|
945
948
|
let u;
|
|
946
|
-
e[3] !== f || e[4] !==
|
|
949
|
+
e[3] !== f || e[4] !== C || e[5] !== b ? (u = /* @__PURE__ */ r(ne, { id: "toggle-file-tree", icon: C, label: b, onActivate: f }), e[3] = f, e[4] = C, e[5] = b, e[6] = u) : u = e[6];
|
|
947
950
|
let w;
|
|
948
951
|
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ r(J.Separator, {}), e[7] = w) : w = e[7];
|
|
949
952
|
let y;
|
|
@@ -952,13 +955,13 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
952
955
|
/* @__PURE__ */ r(ne, { id: "flat", icon: /* @__PURE__ */ r(Vt, { size: 14 }), label: "Flat", selected: o === "flat", onActivate: () => c("flat") }),
|
|
953
956
|
/* @__PURE__ */ r(J.Separator, {})
|
|
954
957
|
] }) : null, e[8] = l, e[9] = c, e[10] = o, e[11] = y) : y = e[11];
|
|
955
|
-
let
|
|
956
|
-
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
958
|
+
let D;
|
|
959
|
+
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ r(Gt, { size: 14 }), e[12] = D) : D = e[12];
|
|
957
960
|
const v = s === "unified";
|
|
958
961
|
let x;
|
|
959
962
|
e[13] !== m ? (x = () => m("unified"), e[13] = m, e[14] = x) : x = e[14];
|
|
960
963
|
let E;
|
|
961
|
-
e[15] !== v || e[16] !== x ? (E = /* @__PURE__ */ r(ne, { id: "unified", icon:
|
|
964
|
+
e[15] !== v || e[16] !== x ? (E = /* @__PURE__ */ r(ne, { id: "unified", icon: D, label: "Unified", selected: v, onActivate: x }), e[15] = v, e[16] = x, e[17] = E) : E = e[17];
|
|
962
965
|
let p;
|
|
963
966
|
e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ r(Kt, { size: 14 }), e[18] = p) : p = e[18];
|
|
964
967
|
const P = s === "split";
|
|
@@ -970,14 +973,14 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
970
973
|
e[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ r(J.Separator, {}), e[24] = L) : L = e[24];
|
|
971
974
|
let z;
|
|
972
975
|
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ r(Qt, { size: 14 }), e[25] = z) : z = e[25];
|
|
973
|
-
let
|
|
974
|
-
e[26] !== i || e[27] !== h ? (
|
|
976
|
+
let M;
|
|
977
|
+
e[26] !== i || e[27] !== h ? (M = /* @__PURE__ */ r(ne, { id: "expand-all", icon: z, label: "Expand all", disabled: i, onActivate: h }), e[26] = i, e[27] = h, e[28] = M) : M = e[28];
|
|
975
978
|
let T;
|
|
976
979
|
e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ r(Ut, { size: 14 }), e[29] = T) : T = e[29];
|
|
977
980
|
let _;
|
|
978
981
|
e[30] !== a || e[31] !== d ? (_ = /* @__PURE__ */ r(ne, { id: "collapse-all", icon: T, label: "Collapse all", disabled: a, onActivate: d }), e[30] = a, e[31] = d, e[32] = _) : _ = e[32];
|
|
979
982
|
let A;
|
|
980
|
-
return e[33] !== I || e[34] !==
|
|
983
|
+
return e[33] !== I || e[34] !== M || e[35] !== _ || e[36] !== u || e[37] !== y || e[38] !== E ? (A = /* @__PURE__ */ W(J.Root, { children: [
|
|
981
984
|
g,
|
|
982
985
|
/* @__PURE__ */ r(J.Positioner, { children: /* @__PURE__ */ W(J.Content, { minW: "190px", bg: "bg", p: "0", gap: "0", children: [
|
|
983
986
|
u,
|
|
@@ -986,25 +989,25 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
986
989
|
E,
|
|
987
990
|
I,
|
|
988
991
|
L,
|
|
989
|
-
|
|
992
|
+
M,
|
|
990
993
|
_
|
|
991
994
|
] }) })
|
|
992
|
-
] }), e[33] = I, e[34] =
|
|
993
|
-
},
|
|
995
|
+
] }), e[33] = I, e[34] = M, e[35] = _, e[36] = u, e[37] = y, e[38] = E, e[39] = A) : A = e[39], A;
|
|
996
|
+
}, no = {
|
|
994
997
|
added: "A",
|
|
995
998
|
copied: "C",
|
|
996
999
|
deleted: "D",
|
|
997
1000
|
modified: "U",
|
|
998
1001
|
permissionChange: "M",
|
|
999
1002
|
renamed: "R"
|
|
1000
|
-
},
|
|
1003
|
+
}, oo = {
|
|
1001
1004
|
added: "green",
|
|
1002
1005
|
copied: "purple",
|
|
1003
1006
|
deleted: "red",
|
|
1004
1007
|
modified: "blue",
|
|
1005
1008
|
permissionChange: "yellow",
|
|
1006
1009
|
renamed: "orange"
|
|
1007
|
-
},
|
|
1010
|
+
}, lo = {
|
|
1008
1011
|
added: {
|
|
1009
1012
|
color: "fg.success",
|
|
1010
1013
|
backgroundColor: "bg.success"
|
|
@@ -1013,7 +1016,7 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1013
1016
|
color: "fg.error",
|
|
1014
1017
|
backgroundColor: "bg.error"
|
|
1015
1018
|
}
|
|
1016
|
-
},
|
|
1019
|
+
}, io = {
|
|
1017
1020
|
bg: "transparent",
|
|
1018
1021
|
border: "0",
|
|
1019
1022
|
borderColor: "transparent",
|
|
@@ -1035,42 +1038,42 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1035
1038
|
outline: "none",
|
|
1036
1039
|
boxShadow: "none"
|
|
1037
1040
|
}
|
|
1038
|
-
},
|
|
1039
|
-
const e =
|
|
1041
|
+
}, so = (t) => {
|
|
1042
|
+
const e = t.lastIndexOf("/");
|
|
1040
1043
|
return e < 0 ? {
|
|
1041
|
-
fileName:
|
|
1044
|
+
fileName: t,
|
|
1042
1045
|
dirPath: ""
|
|
1043
1046
|
} : {
|
|
1044
|
-
fileName:
|
|
1045
|
-
dirPath:
|
|
1047
|
+
fileName: t.slice(e + 1),
|
|
1048
|
+
dirPath: t.slice(0, e)
|
|
1046
1049
|
};
|
|
1047
|
-
},
|
|
1050
|
+
}, ro = (t, e, n) => {
|
|
1048
1051
|
const {
|
|
1049
1052
|
fileName: l,
|
|
1050
1053
|
dirPath: o
|
|
1051
|
-
} =
|
|
1052
|
-
return e !== "flat" || !o ?
|
|
1054
|
+
} = so(n);
|
|
1055
|
+
return e !== "flat" || !o ? t.name : /* @__PURE__ */ W(U, { textStyle: "label/S/regular", truncate: !0, children: [
|
|
1053
1056
|
/* @__PURE__ */ r(U, { as: "span", color: "fg.default", children: l }),
|
|
1054
1057
|
" ",
|
|
1055
1058
|
/* @__PURE__ */ r(U, { as: "span", color: "fg.muted", children: o })
|
|
1056
1059
|
] });
|
|
1057
|
-
},
|
|
1060
|
+
}, Ct = (t) => {
|
|
1058
1061
|
const {
|
|
1059
1062
|
nodes: e,
|
|
1060
|
-
viewMode:
|
|
1063
|
+
viewMode: n,
|
|
1061
1064
|
onSelectPath: l,
|
|
1062
1065
|
resolveFileIcon: o,
|
|
1063
1066
|
changeByPath: s
|
|
1064
|
-
} =
|
|
1067
|
+
} = t;
|
|
1065
1068
|
return e.map((i) => {
|
|
1066
1069
|
if (i.type === "folder")
|
|
1067
1070
|
return {
|
|
1068
1071
|
id: i.id,
|
|
1069
1072
|
label: i.name,
|
|
1070
1073
|
isContainer: !0,
|
|
1071
|
-
children:
|
|
1074
|
+
children: Ct({
|
|
1072
1075
|
nodes: i.children ?? [],
|
|
1073
|
-
viewMode:
|
|
1076
|
+
viewMode: n,
|
|
1074
1077
|
onSelectPath: l,
|
|
1075
1078
|
resolveFileIcon: o,
|
|
1076
1079
|
changeByPath: s
|
|
@@ -1079,21 +1082,21 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1079
1082
|
const a = i.id.replace(/^file:/, ""), f = o?.(a) ?? {
|
|
1080
1083
|
icon: /* @__PURE__ */ r(At, { as: qt, boxSize: "16px" }),
|
|
1081
1084
|
color: "fg.subtle"
|
|
1082
|
-
}, c = s?.get(a), m = c ?
|
|
1083
|
-
colorPalette:
|
|
1085
|
+
}, c = s?.get(a), m = c ? lo[c] ?? {
|
|
1086
|
+
colorPalette: oo[c] ?? "gray"
|
|
1084
1087
|
} : {};
|
|
1085
1088
|
return {
|
|
1086
1089
|
id: i.id,
|
|
1087
|
-
label:
|
|
1090
|
+
label: ro(i, n, a),
|
|
1088
1091
|
icon: f.icon,
|
|
1089
1092
|
iconColor: f.color,
|
|
1090
|
-
endContent: c ? /* @__PURE__ */ r(rt, { size: "xs", variant: "subtle", flexShrink: 0, ...m, children:
|
|
1093
|
+
endContent: c ? /* @__PURE__ */ r(rt, { size: "xs", variant: "subtle", flexShrink: 0, ...m, children: no[c] ?? c }) : void 0,
|
|
1091
1094
|
onActivate: () => l(a)
|
|
1092
1095
|
};
|
|
1093
1096
|
});
|
|
1094
|
-
},
|
|
1097
|
+
}, ao = (t) => {
|
|
1095
1098
|
const e = F(31), {
|
|
1096
|
-
title:
|
|
1099
|
+
title: n,
|
|
1097
1100
|
paths: l,
|
|
1098
1101
|
selectedPath: o,
|
|
1099
1102
|
viewMode: s,
|
|
@@ -1104,35 +1107,35 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1104
1107
|
onToggleFolder: m,
|
|
1105
1108
|
resolveFileIcon: h,
|
|
1106
1109
|
changeByPath: d
|
|
1107
|
-
} =
|
|
1108
|
-
let
|
|
1110
|
+
} = t, g = Z(null);
|
|
1111
|
+
let C;
|
|
1109
1112
|
if (e[0] !== d || e[1] !== f || e[2] !== l || e[3] !== h || e[4] !== s) {
|
|
1110
|
-
const I =
|
|
1111
|
-
|
|
1113
|
+
const I = Me(l, s);
|
|
1114
|
+
C = Ct({
|
|
1112
1115
|
nodes: I,
|
|
1113
1116
|
viewMode: s,
|
|
1114
1117
|
onSelectPath: f,
|
|
1115
1118
|
resolveFileIcon: h,
|
|
1116
1119
|
changeByPath: d
|
|
1117
|
-
}), e[0] = d, e[1] = f, e[2] = l, e[3] = h, e[4] = s, e[5] =
|
|
1120
|
+
}), e[0] = d, e[1] = f, e[2] = l, e[3] = h, e[4] = s, e[5] = C;
|
|
1118
1121
|
} else
|
|
1119
|
-
|
|
1120
|
-
const b =
|
|
1122
|
+
C = e[5];
|
|
1123
|
+
const b = C, u = i.trim() ? "No matching files" : "No changed files";
|
|
1121
1124
|
let w;
|
|
1122
|
-
e[6] !==
|
|
1125
|
+
e[6] !== n ? (w = /* @__PURE__ */ r(U, { textStyle: "label/S/medium", color: "foreground.secondary", truncate: !0, children: n }), e[6] = n, e[7] = w) : w = e[7];
|
|
1123
1126
|
let y;
|
|
1124
1127
|
e[8] !== l.length ? (y = /* @__PURE__ */ r(rt, { size: "sm", variant: "number", flexShrink: 0, colorPalette: "gray", children: l.length }), e[8] = l.length, e[9] = y) : y = e[9];
|
|
1125
|
-
let
|
|
1126
|
-
e[10] !== w || e[11] !== y ? (
|
|
1128
|
+
let D;
|
|
1129
|
+
e[10] !== w || e[11] !== y ? (D = /* @__PURE__ */ r(ft, { variant: "main", justifyContent: "space-between", borderBottomWidth: "1px", borderColor: "border.subtle", bg: "bg", children: /* @__PURE__ */ W(at, { gap: "2xs", minW: "0", children: [
|
|
1127
1130
|
w,
|
|
1128
1131
|
y
|
|
1129
|
-
] }) }), e[10] = w, e[11] = y, e[12] =
|
|
1132
|
+
] }) }), e[10] = w, e[11] = y, e[12] = D) : D = e[12];
|
|
1130
1133
|
let v;
|
|
1131
1134
|
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ r(Yt, { size: 14 }), e[13] = v) : v = e[13];
|
|
1132
1135
|
let x;
|
|
1133
1136
|
e[14] !== c ? (x = (I) => c(I.target.value), e[14] = c, e[15] = x) : x = e[15];
|
|
1134
1137
|
let E;
|
|
1135
|
-
e[16] !== i || e[17] !== x ? (E = /* @__PURE__ */ r(ie, { gap: "xs", borderBottomWidth: "1px", bg: "bg", children: /* @__PURE__ */ r(Ft, { startElement: v, children: /* @__PURE__ */ r(zt, { size: "sm", mx: "xs", placeholder: "Filter files", value: i, ...
|
|
1138
|
+
e[16] !== i || e[17] !== x ? (E = /* @__PURE__ */ r(ie, { gap: "xs", borderBottomWidth: "1px", bg: "bg", children: /* @__PURE__ */ r(Ft, { startElement: v, children: /* @__PURE__ */ r(zt, { size: "sm", mx: "xs", placeholder: "Filter files", value: i, ...io, onChange: x }) }) }), e[16] = i, e[17] = x, e[18] = E) : E = e[18];
|
|
1136
1139
|
let p;
|
|
1137
1140
|
e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = {
|
|
1138
1141
|
style: {
|
|
@@ -1145,51 +1148,51 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1145
1148
|
nodes: b
|
|
1146
1149
|
}], expandedNodeIds: [...a], activeNodeId: o ? `file:${o}` : null, rowVariant: "tree", onToggleNode: m, virtualize: !0, scrollRef: g }) : /* @__PURE__ */ r(H, { px: "xs", py: "xs", children: /* @__PURE__ */ r(Se, { title: u, size: "sm", textAlign: "left", alignItems: "flex-start" }) }) }), e[20] = u, e[21] = a, e[22] = m, e[23] = l.length, e[24] = o, e[25] = b, e[26] = P) : P = e[26];
|
|
1147
1150
|
let S;
|
|
1148
|
-
return e[27] !==
|
|
1149
|
-
|
|
1151
|
+
return e[27] !== D || e[28] !== E || e[29] !== P ? (S = /* @__PURE__ */ W(ie, { h: "full", minH: "0", minW: "0", w: "full", gap: "0", overflow: "hidden", bg: "bg", children: [
|
|
1152
|
+
D,
|
|
1150
1153
|
E,
|
|
1151
1154
|
P
|
|
1152
|
-
] }), e[27] =
|
|
1153
|
-
}, oe = (
|
|
1154
|
-
additions: e.additions + (
|
|
1155
|
-
deletions: e.deletions + (
|
|
1155
|
+
] }), e[27] = D, e[28] = E, e[29] = P, e[30] = S) : S = e[30], S;
|
|
1156
|
+
}, oe = (t) => t.newPath ?? t.oldPath ?? "unknown", fo = (t) => new Map(t.map((e) => [oe(e), e.change])), co = (t) => t.reduce((e, n) => ({
|
|
1157
|
+
additions: e.additions + (n.additions ?? 0),
|
|
1158
|
+
deletions: e.deletions + (n.deletions ?? 0)
|
|
1156
1159
|
}), {
|
|
1157
1160
|
additions: 0,
|
|
1158
1161
|
deletions: 0
|
|
1159
|
-
}),
|
|
1162
|
+
}), uo = (t) => {
|
|
1160
1163
|
const {
|
|
1161
1164
|
diffs: e,
|
|
1162
|
-
normalizedSearchQuery:
|
|
1165
|
+
normalizedSearchQuery: n,
|
|
1163
1166
|
viewMode: l
|
|
1164
|
-
} =
|
|
1167
|
+
} = t, o = n ? e.filter((a) => oe(a).toLowerCase().includes(n)) : e, s = Jn(o.map(oe), l), i = new Map(s.map((a, f) => [a, f]));
|
|
1165
1168
|
return [...o].sort((a, f) => {
|
|
1166
1169
|
const c = i.get(oe(a)) ?? Number.MAX_SAFE_INTEGER, m = i.get(oe(f)) ?? Number.MAX_SAFE_INTEGER;
|
|
1167
1170
|
return c - m;
|
|
1168
1171
|
});
|
|
1169
|
-
}, nt = (
|
|
1170
|
-
const
|
|
1172
|
+
}, nt = (t, e) => t[0] ?? e[0] ?? null, ho = ["first", "second", "third"], po = () => {
|
|
1173
|
+
const t = F(1);
|
|
1171
1174
|
let e;
|
|
1172
|
-
return
|
|
1173
|
-
},
|
|
1175
|
+
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ r(ie, { flex: "1", minH: "0", bg: "bg", p: "xs", gap: "xs", role: "status", "aria-busy": "true", "aria-label": "Loading diff panel", children: ho.map(mo) }), t[0] = e) : e = t[0], e;
|
|
1176
|
+
}, Ro = (t) => {
|
|
1174
1177
|
const e = F(109), {
|
|
1175
|
-
diffs:
|
|
1178
|
+
diffs: n,
|
|
1176
1179
|
changedFilePaths: l,
|
|
1177
1180
|
defaultSelectedPath: o,
|
|
1178
1181
|
loading: s,
|
|
1179
1182
|
onLoadDiff: i,
|
|
1180
1183
|
resolveFileIcon: a
|
|
1181
|
-
} =
|
|
1184
|
+
} = t, f = o === void 0 ? null : o, c = s === void 0 ? !1 : s, [m, h] = X(null);
|
|
1182
1185
|
let d;
|
|
1183
1186
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = {
|
|
1184
1187
|
allExpanded: !1,
|
|
1185
1188
|
allCollapsed: !1
|
|
1186
1189
|
}, e[0] = d) : d = e[0];
|
|
1187
|
-
const [g,
|
|
1190
|
+
const [g, C] = X(d), {
|
|
1188
1191
|
isTreePanelOpen: b,
|
|
1189
1192
|
viewMode: u,
|
|
1190
1193
|
diffViewMode: w,
|
|
1191
1194
|
searchQuery: y,
|
|
1192
|
-
selectedPath:
|
|
1195
|
+
selectedPath: D,
|
|
1193
1196
|
expandedFolderIds: v,
|
|
1194
1197
|
setTreePanelOpen: x,
|
|
1195
1198
|
setViewMode: E,
|
|
@@ -1199,34 +1202,34 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1199
1202
|
setExpandedFolderIds: I,
|
|
1200
1203
|
toggleFolder: L,
|
|
1201
1204
|
expandAll: z,
|
|
1202
|
-
collapseAll:
|
|
1203
|
-
} =
|
|
1204
|
-
let T, _, A,
|
|
1205
|
-
if (e[1] !== l || e[2] !== f || e[3] !==
|
|
1206
|
-
const K =
|
|
1207
|
-
|
|
1205
|
+
collapseAll: M
|
|
1206
|
+
} = Zn();
|
|
1207
|
+
let T, _, A, R, k, $, N, B, V, j, G, q, O, se, Ce, Y;
|
|
1208
|
+
if (e[1] !== l || e[2] !== f || e[3] !== n || e[4] !== v || e[5] !== c || e[6] !== y || e[7] !== D || e[8] !== u) {
|
|
1209
|
+
const K = n.map(oe);
|
|
1210
|
+
R = l ?? K;
|
|
1208
1211
|
const Q = y.trim().toLowerCase();
|
|
1209
|
-
V = Q ?
|
|
1210
|
-
diffs:
|
|
1212
|
+
V = Q ? R.filter((xe) => xe.toLowerCase().includes(Q)) : R, N = uo({
|
|
1213
|
+
diffs: n,
|
|
1211
1214
|
normalizedSearchQuery: Q,
|
|
1212
1215
|
viewMode: u
|
|
1213
1216
|
});
|
|
1214
1217
|
let te;
|
|
1215
|
-
e[25] !==
|
|
1216
|
-
const je =
|
|
1217
|
-
j = u === "nested" ? tt(je) : [], B = V.join("\0"), k = $.join("\0"), O =
|
|
1218
|
+
e[25] !== n ? (te = fo(n), e[25] = n, e[26] = te) : te = e[26], _ = te, $ = N.map(oe);
|
|
1219
|
+
const je = Me(V, u);
|
|
1220
|
+
j = u === "nested" ? tt(je) : [], B = V.join("\0"), k = $.join("\0"), O = D ?? f ?? nt($, V), G = N.length > 0, A = Q ? "No matching diffs" : "No changes", se = !c && !G, Y = co(N), q = j.length > 0 || N.length > 0;
|
|
1218
1221
|
let ge;
|
|
1219
1222
|
e[27] !== v ? (ge = (xe) => v.has(xe), e[27] = v, e[28] = ge) : ge = e[28], T = j.every(ge);
|
|
1220
1223
|
let Ae;
|
|
1221
|
-
e[29] !== v ? (Ae = (xe) => !v.has(xe), e[29] = v, e[30] = Ae) : Ae = e[30],
|
|
1224
|
+
e[29] !== v ? (Ae = (xe) => !v.has(xe), e[29] = v, e[30] = Ae) : Ae = e[30], Ce = j.every(Ae), e[1] = l, e[2] = f, e[3] = n, e[4] = v, e[5] = c, e[6] = y, e[7] = D, e[8] = u, e[9] = T, e[10] = _, e[11] = A, e[12] = R, e[13] = k, e[14] = $, e[15] = N, e[16] = B, e[17] = V, e[18] = j, e[19] = G, e[20] = q, e[21] = O, e[22] = se, e[23] = Ce, e[24] = Y;
|
|
1222
1225
|
} else
|
|
1223
|
-
T = e[9], _ = e[10], A = e[11],
|
|
1224
|
-
const
|
|
1225
|
-
let
|
|
1226
|
-
e[31] !== B || e[32] !== I || e[33] !== u ? (
|
|
1227
|
-
const K = B ? B.split("\0") : [], Q =
|
|
1226
|
+
T = e[9], _ = e[10], A = e[11], R = e[12], k = e[13], $ = e[14], N = e[15], B = e[16], V = e[17], j = e[18], G = e[19], q = e[20], O = e[21], se = e[22], Ce = e[23], Y = e[24];
|
|
1227
|
+
const Dt = Ce, yt = N.length === 0 || g.allExpanded, Pt = N.length === 0 || g.allCollapsed, Re = !q || T && yt, ke = !q || Dt && Pt;
|
|
1228
|
+
let De, ye;
|
|
1229
|
+
e[31] !== B || e[32] !== I || e[33] !== u ? (De = () => {
|
|
1230
|
+
const K = B ? B.split("\0") : [], Q = Me(K, u);
|
|
1228
1231
|
I(u === "nested" ? tt(Q) : []);
|
|
1229
|
-
}, ye = [B, I, u], e[31] = B, e[32] = I, e[33] = u, e[34] =
|
|
1232
|
+
}, ye = [B, I, u], e[31] = B, e[32] = I, e[33] = u, e[34] = De, e[35] = ye) : (De = e[34], ye = e[35]), le(De, ye);
|
|
1230
1233
|
let Pe, ve;
|
|
1231
1234
|
e[36] !== k || e[37] !== B || e[38] !== O || e[39] !== S ? (Pe = () => {
|
|
1232
1235
|
const K = k ? k.split("\0") : [], Q = B ? B.split("\0") : [];
|
|
@@ -1234,13 +1237,13 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1234
1237
|
}, ve = [k, B, O, S], e[36] = k, e[37] = B, e[38] = O, e[39] = S, e[40] = Pe, e[41] = ve) : (Pe = e[40], ve = e[41]), le(Pe, ve);
|
|
1235
1238
|
let Ee;
|
|
1236
1239
|
e[42] !== z || e[43] !== j ? (Ee = () => {
|
|
1237
|
-
z(j), h(
|
|
1240
|
+
z(j), h(go);
|
|
1238
1241
|
}, e[42] = z, e[43] = j, e[44] = Ee) : Ee = e[44];
|
|
1239
1242
|
const Be = Ee;
|
|
1240
1243
|
let Ie;
|
|
1241
|
-
e[45] !==
|
|
1242
|
-
|
|
1243
|
-
}, e[45] =
|
|
1244
|
+
e[45] !== M ? (Ie = () => {
|
|
1245
|
+
M(), h(bo);
|
|
1246
|
+
}, e[45] = M, e[46] = Ie) : Ie = e[46];
|
|
1244
1247
|
const Ne = Ie;
|
|
1245
1248
|
let Le;
|
|
1246
1249
|
e[47] !== $ || e[48] !== O || e[49] !== S ? (Le = (K) => {
|
|
@@ -1252,11 +1255,11 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1252
1255
|
path: K
|
|
1253
1256
|
}));
|
|
1254
1257
|
}, e[47] = $, e[48] = O, e[49] = S, e[50] = Le) : Le = e[50];
|
|
1255
|
-
const Oe = Le, He =
|
|
1258
|
+
const Oe = Le, He = R.length > 0;
|
|
1256
1259
|
let re;
|
|
1257
1260
|
e[51] !== b || e[52] !== x ? (re = () => x(!b), e[51] = b, e[52] = x, e[53] = re) : re = e[53];
|
|
1258
1261
|
let ae;
|
|
1259
|
-
e[54] !== Ne || e[55] !== w || e[56] !== Be || e[57] !== ke || e[58] !==
|
|
1262
|
+
e[54] !== Ne || e[55] !== w || e[56] !== Be || e[57] !== ke || e[58] !== Re || e[59] !== b || e[60] !== p || e[61] !== E || e[62] !== He || e[63] !== re || e[64] !== u ? (ae = /* @__PURE__ */ r(to, { isTreePanelOpen: b, hasFilePaths: He, viewMode: u, diffViewMode: w, isExpandAllDisabled: Re, isCollapseAllDisabled: ke, onToggleTreePanel: re, onViewModeChange: E, onDiffViewModeChange: p, onExpandAll: Be, onCollapseAll: Ne }), e[54] = Ne, e[55] = w, e[56] = Be, e[57] = ke, e[58] = Re, e[59] = b, e[60] = p, e[61] = E, e[62] = He, e[63] = re, e[64] = u, e[65] = ae) : ae = e[65];
|
|
1260
1263
|
let de;
|
|
1261
1264
|
e[66] !== A || e[67] !== se ? (de = se ? /* @__PURE__ */ r(U, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: A }) : null, e[66] = A, e[67] = se, e[68] = de) : de = e[68];
|
|
1262
1265
|
let fe;
|
|
@@ -1272,7 +1275,7 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1272
1275
|
ce
|
|
1273
1276
|
] }), e[75] = fe, e[76] = ce, e[77] = ue) : ue = e[77];
|
|
1274
1277
|
let he;
|
|
1275
|
-
e[78] !== m || e[79] !== w || e[80] !== A || e[81] !== N || e[82] !== G || e[83] !== c || e[84] !== i || e[85] !== O || e[86] !== S ? (he = c ? /* @__PURE__ */ r(
|
|
1278
|
+
e[78] !== m || e[79] !== w || e[80] !== A || e[81] !== N || e[82] !== G || e[83] !== c || e[84] !== i || e[85] !== O || e[86] !== S ? (he = c ? /* @__PURE__ */ r(po, {}) : G ? /* @__PURE__ */ r(H, { flex: "1", minH: "0", children: /* @__PURE__ */ r(Un, { diffs: N, selectedDiffPath: O, onLoadDiff: i, onSelectDiffPath: S, onExpansionStateChange: C, expansionCommand: m, diffViewMode: w }) }) : /* @__PURE__ */ r(H, { flex: "1", minH: "0", px: "md", py: "lg", display: "flex", alignItems: "center", justifyContent: "center", bg: "bg", children: /* @__PURE__ */ r(Se, { title: A }) }), e[78] = m, e[79] = w, e[80] = A, e[81] = N, e[82] = G, e[83] = c, e[84] = i, e[85] = O, e[86] = S, e[87] = he) : he = e[87];
|
|
1276
1279
|
let _e;
|
|
1277
1280
|
e[88] !== ue || e[89] !== he ? (_e = /* @__PURE__ */ W(ie, { h: "full", minH: "0", minW: "0", flex: "1", bg: "bg", gap: "0", children: [
|
|
1278
1281
|
ue,
|
|
@@ -1280,34 +1283,35 @@ const Un = (n) => n.split("/").map((e) => e.trim()).filter(Boolean).join("/"), x
|
|
|
1280
1283
|
] }), e[88] = ue, e[89] = he, e[90] = _e) : _e = e[90];
|
|
1281
1284
|
const $e = _e;
|
|
1282
1285
|
let pe;
|
|
1283
|
-
e[91] !== _ || e[92] !== v || e[93] !== V || e[94] !== a || e[95] !== O || e[96] !== y || e[97] !== Oe || e[98] !== P || e[99] !== L || e[100] !== u ? (pe = /* @__PURE__ */ r(
|
|
1286
|
+
e[91] !== _ || e[92] !== v || e[93] !== V || e[94] !== a || e[95] !== O || e[96] !== y || e[97] !== Oe || e[98] !== P || e[99] !== L || e[100] !== u ? (pe = /* @__PURE__ */ r(ao, { title: "Changed files", paths: V, selectedPath: O, viewMode: u, searchQuery: y, expandedFolderIds: v, onSelectPath: Oe, onSearchQueryChange: P, onToggleFolder: L, resolveFileIcon: a, changeByPath: _ }), e[91] = _, e[92] = v, e[93] = V, e[94] = a, e[95] = O, e[96] = y, e[97] = Oe, e[98] = P, e[99] = L, e[100] = u, e[101] = pe) : pe = e[101];
|
|
1284
1287
|
const Ve = !b;
|
|
1285
1288
|
let me;
|
|
1286
1289
|
e[102] !== x ? (me = (K) => x(!K), e[102] = x, e[103] = me) : me = e[103];
|
|
1287
1290
|
let Te;
|
|
1288
|
-
return e[104] !== $e || e[105] !== pe || e[106] !== Ve || e[107] !== me ? (Te = /* @__PURE__ */ r(
|
|
1291
|
+
return e[104] !== $e || e[105] !== pe || e[106] !== Ve || e[107] !== me ? (Te = /* @__PURE__ */ r(Mt, { flex: "1", minH: "0", minW: "0", bg: "bg", gap: "0", "data-testid": "diff-viewer", children: /* @__PURE__ */ r(Zt, { flex: "1", minH: "0", minW: "0", resizablePanel: pe, contentPanel: $e, collapsed: Ve, defaultSizePx: 288, minSizePx: 224, contentMinSizePx: 320, resizeLabel: "Resize file list panel", onCollapsedChange: me }) }), e[104] = $e, e[105] = pe, e[106] = Ve, e[107] = me, e[108] = Te) : Te = e[108], Te;
|
|
1289
1292
|
};
|
|
1290
|
-
function
|
|
1291
|
-
return /* @__PURE__ */ r(st, { h: "72px", w: "full", flexShrink: "0", borderRadius: "xs" },
|
|
1293
|
+
function mo(t) {
|
|
1294
|
+
return /* @__PURE__ */ r(st, { h: "72px", w: "full", flexShrink: "0", borderRadius: "xs" }, t);
|
|
1292
1295
|
}
|
|
1293
|
-
function
|
|
1296
|
+
function go(t) {
|
|
1294
1297
|
return {
|
|
1295
1298
|
action: "expand",
|
|
1296
|
-
id: (
|
|
1299
|
+
id: (t?.id ?? 0) + 1
|
|
1297
1300
|
};
|
|
1298
1301
|
}
|
|
1299
|
-
function
|
|
1302
|
+
function bo(t) {
|
|
1300
1303
|
return {
|
|
1301
1304
|
action: "collapse",
|
|
1302
|
-
id: (
|
|
1305
|
+
id: (t?.id ?? 0) + 1
|
|
1303
1306
|
};
|
|
1304
1307
|
}
|
|
1305
1308
|
export {
|
|
1306
|
-
|
|
1307
|
-
|
|
1309
|
+
Mo as CodeDiffEditor,
|
|
1310
|
+
zo as CodeEditor,
|
|
1308
1311
|
lt as DiffBubble,
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
+
Un as DiffDrawer,
|
|
1313
|
+
Ro as DiffViewer,
|
|
1314
|
+
Fo as preloadCodeEditor,
|
|
1315
|
+
Zn as useDiffViewerStore
|
|
1312
1316
|
};
|
|
1313
1317
|
//# sourceMappingURL=diff.js.map
|