@pstdio/ui 0.41.0 → 0.42.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-BCiI63_G.js → MermaidComponent-D7vhkpka.js} +2 -2
- package/dist/{MermaidComponent-BCiI63_G.js.map → MermaidComponent-D7vhkpka.js.map} +1 -1
- package/dist/alert-MQ47wy7f.js +388 -0
- package/dist/alert-MQ47wy7f.js.map +1 -0
- package/dist/chat-ui.d.ts +36 -5
- package/dist/chat-ui.js +1777 -1422
- package/dist/chat-ui.js.map +1 -1
- package/dist/collection-view-fields-D3cysHNT.d.ts +232 -0
- package/dist/collection-view-grouping-D4nZk8-3.js +90 -0
- package/dist/collection-view-grouping-D4nZk8-3.js.map +1 -0
- package/dist/collection-view-search-CpjJy76w.js +1973 -0
- package/dist/collection-view-search-CpjJy76w.js.map +1 -0
- package/dist/collection-view.d.ts +4 -0
- package/dist/collection-view.js +2 -0
- package/dist/{data-table-stats-row-EiTEONdY.js → data-table-stats-row-64magT2g.js} +2 -2
- package/dist/{data-table-stats-row-EiTEONdY.js.map → data-table-stats-row-64magT2g.js.map} +1 -1
- package/dist/data-table.d.ts +3 -1
- package/dist/data-table.js +279 -277
- package/dist/data-table.js.map +1 -1
- package/dist/{diff-drawer-BwZBOObe.js → diff-drawer-IYpQ-QQK.js} +192 -191
- package/dist/diff-drawer-IYpQ-QQK.js.map +1 -0
- package/dist/{diff-viewer-kOOd7C7h.js → diff-viewer-C-0VAt9P.js} +4 -4
- package/dist/{diff-viewer-kOOd7C7h.js.map → diff-viewer-C-0VAt9P.js.map} +1 -1
- package/dist/diff.js +2 -2
- package/dist/{display-sort-control-DPxc0e5z.js → display-sort-control-f3rbILsV.js} +87 -86
- package/dist/{display-sort-control-DPxc0e5z.js.map → display-sort-control-f3rbILsV.js.map} +1 -1
- package/dist/drop-indicator-HjlBSIeV.js +27 -0
- package/dist/drop-indicator-HjlBSIeV.js.map +1 -0
- package/dist/edit-mode-data-table-DnMB2jiy.js +1449 -0
- package/dist/edit-mode-data-table-DnMB2jiy.js.map +1 -0
- package/dist/host-storage-BIo5azql.js +31 -0
- package/dist/host-storage-BIo5azql.js.map +1 -0
- package/dist/host-storage-J0089Hyk.d.ts +17 -0
- package/dist/icon-options-Tt6Wzhtv.js +308 -0
- package/dist/icon-options-Tt6Wzhtv.js.map +1 -0
- package/dist/{index-C9mywhyX.d.ts → index-B79hwNcB.d.ts} +17 -1
- package/dist/index-CKsd23jv.d.ts +80 -0
- package/dist/{index-D3UJyWWh.d.ts → index-ICoad2I_.d.ts} +4 -223
- package/dist/index.d.ts +22 -6
- package/dist/index.js +1174 -1112
- package/dist/index.js.map +1 -1
- package/dist/kanban-renderer.d.ts +2 -1
- package/dist/kanban-renderer.js +531 -528
- package/dist/kanban-renderer.js.map +1 -1
- package/dist/list-row-Z4SHkseA.js +1195 -0
- package/dist/list-row-Z4SHkseA.js.map +1 -0
- package/dist/markdown-editor-Dd4mor7l.js +3236 -0
- package/dist/markdown-editor-Dd4mor7l.js.map +1 -0
- package/dist/number-input-7K66wnSC.js +63 -0
- package/dist/number-input-7K66wnSC.js.map +1 -0
- package/dist/param-editor-Dnix-fJo.js +225 -0
- package/dist/param-editor-Dnix-fJo.js.map +1 -0
- package/dist/param-editor-field-B3vLST-B.js +2394 -0
- package/dist/param-editor-field-B3vLST-B.js.map +1 -0
- package/dist/param-editor.js +4 -2
- package/dist/prism-OG4H7Hu4.js +334 -0
- package/dist/prism-OG4H7Hu4.js.map +1 -0
- package/dist/queued-follow-up-Bj_vtMgd.js +208 -0
- package/dist/queued-follow-up-Bj_vtMgd.js.map +1 -0
- package/dist/rich-text-BgEnAHr2.js +1160 -0
- package/dist/rich-text-BgEnAHr2.js.map +1 -0
- package/dist/rich-text.d.ts +1 -1
- package/dist/rich-text.js +4 -2
- package/dist/terminal.js +1 -1
- package/dist/{theme-at0rtSnX.js → theme-CMJdH59Z.js} +224 -90
- package/dist/theme-CMJdH59Z.js.map +1 -0
- package/dist/theme.js +1 -1
- package/dist/tree-list-jarhD31R.js +1652 -0
- package/dist/tree-list-jarhD31R.js.map +1 -0
- package/dist/use-virtualizer-uj43XjBp.js +10 -0
- package/dist/use-virtualizer-uj43XjBp.js.map +1 -0
- package/dist/{host-storage-DP0RLj4i.d.ts → workspace-badge-BKtB805G.d.ts} +6 -16
- package/package.json +6 -2
- package/dist/chat-question-bubble-w2vMbFsS.js +0 -68
- package/dist/chat-question-bubble-w2vMbFsS.js.map +0 -1
- package/dist/diff-drawer-BwZBOObe.js.map +0 -1
- package/dist/list-row-DM0DiIrN.js +0 -1167
- package/dist/list-row-DM0DiIrN.js.map +0 -1
- package/dist/prism-JVIsQMoJ.js +0 -1029
- package/dist/prism-JVIsQMoJ.js.map +0 -1
- package/dist/rich-text-DM24VNQZ.js +0 -10447
- package/dist/rich-text-DM24VNQZ.js.map +0 -1
- package/dist/theme-at0rtSnX.js.map +0 -1
- package/dist/tree-list-Cqgl8mnN.js +0 -1621
- package/dist/tree-list-Cqgl8mnN.js.map +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { n as e, t } from "./scroll-area-Cr1lNXAr.js";
|
|
2
|
-
import { t as n } from "./
|
|
3
|
-
import { t as r } from "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { t as n } from "./use-virtualizer-uj43XjBp.js";
|
|
3
|
+
import { t as r } from "./empty-state-3mVV_pV-.js";
|
|
4
|
+
import { t as i } from "./diff-bubble-DewUd_2w.js";
|
|
5
|
+
import { a, i as o, n as s, o as c, r as l } from "./diff-size-Dydn_Uw5.js";
|
|
6
|
+
import { r as u, t as d } from "./diff-editor-CGpeyoCE.js";
|
|
7
|
+
import { Box as f, Button as p, Grid as m, IconButton as h, Image as g, Skeleton as _, Stack as v, Text as y } from "@chakra-ui/react";
|
|
8
|
+
import { c as b } from "react/compiler-runtime";
|
|
9
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
10
|
+
import { useEffect as C, useLayoutEffect as w, useRef as T, useState as E } from "react";
|
|
11
|
+
import { Check as D, ChevronDown as O, ChevronRight as k, Copy as A } from "lucide-react";
|
|
12
|
+
import { defaultRangeExtractor as j } from "@tanstack/react-virtual";
|
|
12
13
|
//#region src/components/diff-viewer/diff-card-body.tsx
|
|
13
14
|
var M = (e) => {
|
|
14
|
-
let { diff: t, filePath: n, oldContent: r, newContent:
|
|
15
|
-
if (
|
|
16
|
-
let e = N(r), t = N(
|
|
17
|
-
return
|
|
15
|
+
let { diff: t, filePath: n, oldContent: r, newContent: i, isLargeDiff: o, hasOptedIntoLargeDiff: c, onShowFullDiff: d, diffViewMode: f = "unified", buildViewData: p } = e;
|
|
16
|
+
if (l(n)) {
|
|
17
|
+
let e = N(r), t = N(i);
|
|
18
|
+
return a(n) && (e || t) ? {
|
|
18
19
|
kind: "image",
|
|
19
20
|
filePath: n,
|
|
20
21
|
oldSrc: e,
|
|
@@ -22,27 +23,27 @@ var M = (e) => {
|
|
|
22
23
|
} : {
|
|
23
24
|
kind: "binary",
|
|
24
25
|
filePath: n,
|
|
25
|
-
isImage:
|
|
26
|
+
isImage: a(n)
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
|
-
return
|
|
29
|
+
return o && !c ? {
|
|
29
30
|
kind: "placeholder",
|
|
30
31
|
filePath: n,
|
|
31
|
-
renderedLineCount:
|
|
32
|
+
renderedLineCount: s(t),
|
|
32
33
|
onShowFullDiff: d
|
|
33
34
|
} : {
|
|
34
35
|
kind: "editor",
|
|
35
|
-
diffViewData: (p ??
|
|
36
|
+
diffViewData: (p ?? u)({
|
|
36
37
|
original: r,
|
|
37
|
-
modified:
|
|
38
|
+
modified: i,
|
|
38
39
|
oldPath: t.oldPath,
|
|
39
40
|
newPath: t.newPath
|
|
40
41
|
}),
|
|
41
42
|
sideBySide: f === "split"
|
|
42
43
|
};
|
|
43
44
|
}, N = (e) => e.startsWith("data:image/") ? e : "", P = (e) => {
|
|
44
|
-
let t =
|
|
45
|
-
t[0] !== n || t[1] !==
|
|
45
|
+
let t = b(33), { diff: n, filePath: r, oldContent: i, newContent: a, isLargeDiff: o, hasOptedIntoLargeDiff: s, onShowFullDiff: c, diffViewMode: l } = e, u = l === void 0 ? "unified" : l, p;
|
|
46
|
+
t[0] !== n || t[1] !== u || t[2] !== r || t[3] !== s || t[4] !== o || t[5] !== a || t[6] !== i || t[7] !== c ? (p = M({
|
|
46
47
|
diff: n,
|
|
47
48
|
filePath: r,
|
|
48
49
|
oldContent: i,
|
|
@@ -50,10 +51,10 @@ var M = (e) => {
|
|
|
50
51
|
isLargeDiff: o,
|
|
51
52
|
hasOptedIntoLargeDiff: s,
|
|
52
53
|
onShowFullDiff: c,
|
|
53
|
-
diffViewMode:
|
|
54
|
-
}), t[0] = n, t[1] =
|
|
54
|
+
diffViewMode: u
|
|
55
|
+
}), t[0] = n, t[1] = u, t[2] = r, t[3] = s, t[4] = o, t[5] = a, t[6] = i, t[7] = c, t[8] = p) : p = t[8];
|
|
55
56
|
let m = p, h;
|
|
56
|
-
t[9] !== n || t[10] !== m.diffViewData || t[11] !== m.kind || t[12] !== m.sideBySide || t[13] !== a || t[14] !== i ? (h = m.kind === "editor" && /* @__PURE__ */
|
|
57
|
+
t[9] !== n || t[10] !== m.diffViewData || t[11] !== m.kind || t[12] !== m.sideBySide || t[13] !== a || t[14] !== i ? (h = m.kind === "editor" && /* @__PURE__ */ x(d, {
|
|
57
58
|
original: i,
|
|
58
59
|
modified: a,
|
|
59
60
|
oldPath: n.oldPath,
|
|
@@ -62,20 +63,20 @@ var M = (e) => {
|
|
|
62
63
|
data: m.diffViewData
|
|
63
64
|
}), t[9] = n, t[10] = m.diffViewData, t[11] = m.kind, t[12] = m.sideBySide, t[13] = a, t[14] = i, t[15] = h) : h = t[15];
|
|
64
65
|
let g;
|
|
65
|
-
t[16] !== m.kind || t[17] !== m.newSrc || t[18] !== m.oldSrc ? (g = m.kind === "image" && /* @__PURE__ */
|
|
66
|
+
t[16] !== m.kind || t[17] !== m.newSrc || t[18] !== m.oldSrc ? (g = m.kind === "image" && /* @__PURE__ */ x(F, {
|
|
66
67
|
oldSrc: m.oldSrc,
|
|
67
68
|
newSrc: m.newSrc
|
|
68
69
|
}), t[16] = m.kind, t[17] = m.newSrc, t[18] = m.oldSrc, t[19] = g) : g = t[19];
|
|
69
70
|
let _;
|
|
70
|
-
t[20] !== m.isImage || t[21] !== m.kind ? (_ = m.kind === "binary" && /* @__PURE__ */
|
|
71
|
+
t[20] !== m.isImage || t[21] !== m.kind ? (_ = m.kind === "binary" && /* @__PURE__ */ x(R, { isImage: m.isImage }), t[20] = m.isImage, t[21] = m.kind, t[22] = _) : _ = t[22];
|
|
71
72
|
let v;
|
|
72
|
-
t[23] !== m.filePath || t[24] !== m.kind || t[25] !== m.onShowFullDiff || t[26] !== m.renderedLineCount ? (v = m.kind === "placeholder" && /* @__PURE__ */
|
|
73
|
+
t[23] !== m.filePath || t[24] !== m.kind || t[25] !== m.onShowFullDiff || t[26] !== m.renderedLineCount ? (v = m.kind === "placeholder" && /* @__PURE__ */ x(L, {
|
|
73
74
|
filePath: m.filePath,
|
|
74
75
|
renderedLineCount: m.renderedLineCount,
|
|
75
76
|
onShowFullDiff: m.onShowFullDiff
|
|
76
77
|
}), t[23] = m.filePath, t[24] = m.kind, t[25] = m.onShowFullDiff, t[26] = m.renderedLineCount, t[27] = v) : v = t[27];
|
|
77
|
-
let
|
|
78
|
-
return t[28] !== h || t[29] !== g || t[30] !== _ || t[31] !== v ? (
|
|
78
|
+
let y;
|
|
79
|
+
return t[28] !== h || t[29] !== g || t[30] !== _ || t[31] !== v ? (y = /* @__PURE__ */ S(f, {
|
|
79
80
|
bg: "bg",
|
|
80
81
|
borderBottomRadius: "xs",
|
|
81
82
|
overflow: "hidden",
|
|
@@ -85,27 +86,27 @@ var M = (e) => {
|
|
|
85
86
|
_,
|
|
86
87
|
v
|
|
87
88
|
]
|
|
88
|
-
}), t[28] = h, t[29] = g, t[30] = _, t[31] = v, t[32] =
|
|
89
|
+
}), t[28] = h, t[29] = g, t[30] = _, t[31] = v, t[32] = y) : y = t[32], y;
|
|
89
90
|
}, F = (e) => {
|
|
90
|
-
let t =
|
|
91
|
+
let t = b(8), { oldSrc: n, newSrc: r } = e, i;
|
|
91
92
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = {
|
|
92
93
|
base: "1fr",
|
|
93
94
|
md: "1fr 1fr"
|
|
94
95
|
}, t[0] = i) : i = t[0];
|
|
95
96
|
let a;
|
|
96
|
-
t[1] === n ? a = t[2] : (a = /* @__PURE__ */
|
|
97
|
+
t[1] === n ? a = t[2] : (a = /* @__PURE__ */ x(I, {
|
|
97
98
|
label: "Old",
|
|
98
99
|
src: n,
|
|
99
100
|
fallback: "No old image"
|
|
100
101
|
}), t[1] = n, t[2] = a);
|
|
101
102
|
let o;
|
|
102
|
-
t[3] === r ? o = t[4] : (o = /* @__PURE__ */
|
|
103
|
+
t[3] === r ? o = t[4] : (o = /* @__PURE__ */ x(I, {
|
|
103
104
|
label: "New",
|
|
104
105
|
src: r,
|
|
105
106
|
fallback: "No new image"
|
|
106
107
|
}), t[3] = r, t[4] = o);
|
|
107
108
|
let s;
|
|
108
|
-
return t[5] !== a || t[6] !== o ? (s = /* @__PURE__ */
|
|
109
|
+
return t[5] !== a || t[6] !== o ? (s = /* @__PURE__ */ S(m, {
|
|
109
110
|
templateColumns: i,
|
|
110
111
|
gap: "sm",
|
|
111
112
|
p: "sm",
|
|
@@ -115,8 +116,8 @@ var M = (e) => {
|
|
|
115
116
|
children: [a, o]
|
|
116
117
|
}), t[5] = a, t[6] = o, t[7] = s) : s = t[7], s;
|
|
117
118
|
}, I = (e) => {
|
|
118
|
-
let t =
|
|
119
|
-
t[0] === n ? a = t[1] : (a = /* @__PURE__ */
|
|
119
|
+
let t = b(9), { label: n, src: r, fallback: i } = e, a;
|
|
120
|
+
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ x(y, {
|
|
120
121
|
px: "xs",
|
|
121
122
|
py: "2xs",
|
|
122
123
|
textStyle: "label/S/medium",
|
|
@@ -126,25 +127,25 @@ var M = (e) => {
|
|
|
126
127
|
children: n
|
|
127
128
|
}), t[0] = n, t[1] = a);
|
|
128
129
|
let o;
|
|
129
|
-
t[2] !== i || t[3] !== n || t[4] !== r ? (o = /* @__PURE__ */
|
|
130
|
+
t[2] !== i || t[3] !== n || t[4] !== r ? (o = /* @__PURE__ */ x(f, {
|
|
130
131
|
display: "grid",
|
|
131
132
|
placeItems: "center",
|
|
132
133
|
minH: "180px",
|
|
133
134
|
p: "sm",
|
|
134
|
-
children: r ? /* @__PURE__ */
|
|
135
|
+
children: r ? /* @__PURE__ */ x(g, {
|
|
135
136
|
src: r,
|
|
136
137
|
alt: `${n} image diff`,
|
|
137
138
|
maxH: "260px",
|
|
138
139
|
maxW: "100%",
|
|
139
140
|
objectFit: "contain"
|
|
140
|
-
}) : /* @__PURE__ */
|
|
141
|
+
}) : /* @__PURE__ */ x(y, {
|
|
141
142
|
color: "fg.muted",
|
|
142
143
|
textStyle: "body/S/regular",
|
|
143
144
|
children: i
|
|
144
145
|
})
|
|
145
146
|
}), t[2] = i, t[3] = n, t[4] = r, t[5] = o) : o = t[5];
|
|
146
147
|
let s;
|
|
147
|
-
return t[6] !== a || t[7] !== o ? (s = /* @__PURE__ */
|
|
148
|
+
return t[6] !== a || t[7] !== o ? (s = /* @__PURE__ */ S(f, {
|
|
148
149
|
border: "1px solid",
|
|
149
150
|
borderColor: "border.subtle",
|
|
150
151
|
borderRadius: "xs",
|
|
@@ -154,41 +155,41 @@ var M = (e) => {
|
|
|
154
155
|
children: [a, o]
|
|
155
156
|
}), t[6] = a, t[7] = o, t[8] = s) : s = t[8], s;
|
|
156
157
|
}, L = (e) => {
|
|
157
|
-
let t =
|
|
158
|
-
t[0] !==
|
|
158
|
+
let t = b(5), { filePath: n, onShowFullDiff: i } = e, a;
|
|
159
|
+
t[0] !== n || t[1] !== i ? (a = i ? /* @__PURE__ */ x(p, {
|
|
159
160
|
size: "xs",
|
|
160
161
|
variant: "outline",
|
|
161
|
-
"aria-label": `Render full diff for ${
|
|
162
|
+
"aria-label": `Render full diff for ${n}`,
|
|
162
163
|
onClick: i,
|
|
163
164
|
children: "Show full diff"
|
|
164
|
-
}) : null, t[0] =
|
|
165
|
+
}) : null, t[0] = n, t[1] = i, t[2] = a) : a = t[2];
|
|
165
166
|
let o;
|
|
166
|
-
return t[3] === a ? o = t[4] : (o = /* @__PURE__ */
|
|
167
|
+
return t[3] === a ? o = t[4] : (o = /* @__PURE__ */ x(f, {
|
|
167
168
|
p: "md",
|
|
168
169
|
borderTop: "1px solid",
|
|
169
170
|
borderColor: "border.subtle",
|
|
170
171
|
bg: "bg",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ x(r, {
|
|
172
173
|
title: "Large diffs are hidden by default",
|
|
173
174
|
paddingY: "sm",
|
|
174
175
|
children: a
|
|
175
176
|
})
|
|
176
177
|
}), t[3] = a, t[4] = o), o;
|
|
177
178
|
}, R = (e) => {
|
|
178
|
-
let t =
|
|
179
|
-
return t[0] === i ? a = t[1] : (a = /* @__PURE__ */
|
|
179
|
+
let t = b(2), { isImage: n } = e, i = n ? "Image diffs are not shown" : "Binary diffs are not shown", a;
|
|
180
|
+
return t[0] === i ? a = t[1] : (a = /* @__PURE__ */ x(f, {
|
|
180
181
|
p: "md",
|
|
181
182
|
borderTop: "1px solid",
|
|
182
183
|
borderColor: "border.subtle",
|
|
183
184
|
bg: "bg",
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ x(r, {
|
|
185
186
|
title: i,
|
|
186
187
|
paddingY: "sm"
|
|
187
188
|
})
|
|
188
189
|
}), t[0] = i, t[1] = a), a;
|
|
189
190
|
}, z = (e) => {
|
|
190
|
-
let t =
|
|
191
|
-
t[0] !== i || t[1] !== a || t[2] !== o ? (s = i ? /* @__PURE__ */
|
|
191
|
+
let t = b(7), { title: n, actionLabel: i, isLoadingDiff: a, onAction: o } = e, s;
|
|
192
|
+
t[0] !== i || t[1] !== a || t[2] !== o ? (s = i ? /* @__PURE__ */ x(p, {
|
|
192
193
|
size: "xs",
|
|
193
194
|
variant: "outline",
|
|
194
195
|
loading: a,
|
|
@@ -196,24 +197,24 @@ var M = (e) => {
|
|
|
196
197
|
children: i
|
|
197
198
|
}) : null, t[0] = i, t[1] = a, t[2] = o, t[3] = s) : s = t[3];
|
|
198
199
|
let c;
|
|
199
|
-
return t[4] !== s || t[5] !==
|
|
200
|
+
return t[4] !== s || t[5] !== n ? (c = /* @__PURE__ */ x(f, {
|
|
200
201
|
bg: "bg",
|
|
201
202
|
p: "md",
|
|
202
203
|
borderTop: "1px solid",
|
|
203
204
|
borderColor: "border.subtle",
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
-
title:
|
|
205
|
+
children: /* @__PURE__ */ x(r, {
|
|
206
|
+
title: n,
|
|
206
207
|
paddingY: "sm",
|
|
207
208
|
children: s
|
|
208
209
|
})
|
|
209
|
-
}), t[4] = s, t[5] =
|
|
210
|
+
}), t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
210
211
|
}, B = [
|
|
211
212
|
"first",
|
|
212
213
|
"second",
|
|
213
214
|
"third"
|
|
214
215
|
], V = () => {
|
|
215
|
-
let e =
|
|
216
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */
|
|
216
|
+
let e = b(1), t;
|
|
217
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ x(v, {
|
|
217
218
|
h: "280px",
|
|
218
219
|
bg: "bg",
|
|
219
220
|
borderTop: "1px solid",
|
|
@@ -227,7 +228,7 @@ var M = (e) => {
|
|
|
227
228
|
}), e[0] = t) : t = e[0], t;
|
|
228
229
|
};
|
|
229
230
|
function H(e) {
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ x(_, {
|
|
231
232
|
h: "20px",
|
|
232
233
|
w: "full",
|
|
233
234
|
borderRadius: "xs"
|
|
@@ -245,11 +246,11 @@ var U = (e) => {
|
|
|
245
246
|
onAction: l
|
|
246
247
|
};
|
|
247
248
|
}, W = (e) => {
|
|
248
|
-
let t =
|
|
249
|
+
let t = b(30), { diff: n, filePath: r, oldContent: i, newContent: a, isExpanded: o, isLargeDiff: s, isGeneratedDiff: c, isBinaryDiff: l, hasDiffContent: u, canLoadDiff: d, shouldAutoLoadDiff: f, loadError: p, isLoadingDiff: m, onLoadDiff: h, hasOptedIntoLargeDiff: g, onShowFullDiff: _, diffViewMode: v } = e, y = v === void 0 ? "unified" : v;
|
|
249
250
|
if (!o) return null;
|
|
250
251
|
if (l) {
|
|
251
252
|
let e;
|
|
252
|
-
return t[0] !== n || t[1] !==
|
|
253
|
+
return t[0] !== n || t[1] !== y || t[2] !== r || t[3] !== g || t[4] !== a || t[5] !== i || t[6] !== _ ? (e = /* @__PURE__ */ x(P, {
|
|
253
254
|
diff: n,
|
|
254
255
|
filePath: r,
|
|
255
256
|
oldContent: i,
|
|
@@ -257,8 +258,8 @@ var U = (e) => {
|
|
|
257
258
|
isLargeDiff: !1,
|
|
258
259
|
hasOptedIntoLargeDiff: g,
|
|
259
260
|
onShowFullDiff: _,
|
|
260
|
-
diffViewMode:
|
|
261
|
-
}), t[0] = n, t[1] =
|
|
261
|
+
diffViewMode: y
|
|
262
|
+
}), t[0] = n, t[1] = y, t[2] = r, t[3] = g, t[4] = a, t[5] = i, t[6] = _, t[7] = e) : e = t[7], e;
|
|
262
263
|
}
|
|
263
264
|
if (!u && !f) {
|
|
264
265
|
let e;
|
|
@@ -271,7 +272,7 @@ var U = (e) => {
|
|
|
271
272
|
onShowFullDiff: _
|
|
272
273
|
}), t[8] = d, t[9] = c, t[10] = s, t[11] = p, t[12] = h, t[13] = _, t[14] = e) : e = t[14];
|
|
273
274
|
let { title: n, actionLabel: r, onAction: i } = e, a;
|
|
274
|
-
return t[15] !== r || t[16] !== m || t[17] !== i || t[18] !== n ? (a = /* @__PURE__ */
|
|
275
|
+
return t[15] !== r || t[16] !== m || t[17] !== i || t[18] !== n ? (a = /* @__PURE__ */ x(z, {
|
|
275
276
|
title: n,
|
|
276
277
|
actionLabel: r,
|
|
277
278
|
isLoadingDiff: m,
|
|
@@ -280,10 +281,10 @@ var U = (e) => {
|
|
|
280
281
|
}
|
|
281
282
|
if (f) {
|
|
282
283
|
let e;
|
|
283
|
-
return t[20] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */
|
|
284
|
+
return t[20] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ x(V, {}), t[20] = e) : e = t[20], e;
|
|
284
285
|
}
|
|
285
286
|
let S;
|
|
286
|
-
return t[21] !== n || t[22] !==
|
|
287
|
+
return t[21] !== n || t[22] !== y || t[23] !== r || t[24] !== g || t[25] !== s || t[26] !== a || t[27] !== i || t[28] !== _ ? (S = /* @__PURE__ */ x(P, {
|
|
287
288
|
diff: n,
|
|
288
289
|
filePath: r,
|
|
289
290
|
oldContent: i,
|
|
@@ -291,16 +292,16 @@ var U = (e) => {
|
|
|
291
292
|
isLargeDiff: s,
|
|
292
293
|
hasOptedIntoLargeDiff: g,
|
|
293
294
|
onShowFullDiff: _,
|
|
294
|
-
diffViewMode:
|
|
295
|
-
}), t[21] = n, t[22] =
|
|
295
|
+
diffViewMode: y
|
|
296
|
+
}), t[21] = n, t[22] = y, t[23] = r, t[24] = g, t[25] = s, t[26] = a, t[27] = i, t[28] = _, t[29] = S) : S = t[29], S;
|
|
296
297
|
}, G = (e) => {
|
|
297
298
|
let { isExpanded: t, isSelected: n, hasDiffContent: r, isLargeDiff: i, isGeneratedDiff: a, isBinaryDiff: o, requestedPath: s, filePath: c } = e;
|
|
298
299
|
return t && n && !r && !i && !a && !o && s !== c;
|
|
299
300
|
}, ee = (e) => {
|
|
300
301
|
let { requestedPath: t, filePath: n, hasDiffContent: r } = e;
|
|
301
302
|
return t === n && r ? null : t;
|
|
302
|
-
}, te = (e) => !
|
|
303
|
-
let { filePath: t, isExpanded: n, isSelected: r, hasDiffContent: i, isLargeDiff: a, isGeneratedDiff: o, isBinaryDiff: s, onLoadDiff: c } = e, [l, u] =
|
|
303
|
+
}, te = (e) => !a(e), ne = (e) => e.newPath || e.oldPath || "unknown", re = (e) => {
|
|
304
|
+
let { filePath: t, isExpanded: n, isSelected: r, hasDiffContent: i, isLargeDiff: a, isGeneratedDiff: o, isBinaryDiff: s, onLoadDiff: c } = e, [l, u] = E(!1), [d, f] = E(null), [p, m] = E(!1), h = async () => {
|
|
304
305
|
if (c && !l) {
|
|
305
306
|
f(t), m(!1), u(!0);
|
|
306
307
|
try {
|
|
@@ -321,13 +322,13 @@ var U = (e) => {
|
|
|
321
322
|
requestedPath: d,
|
|
322
323
|
filePath: t
|
|
323
324
|
});
|
|
324
|
-
return
|
|
325
|
+
return C(() => {
|
|
325
326
|
f((e) => ee({
|
|
326
327
|
requestedPath: e,
|
|
327
328
|
filePath: t,
|
|
328
329
|
hasDiffContent: i
|
|
329
330
|
}));
|
|
330
|
-
}, [t, i]),
|
|
331
|
+
}, [t, i]), C(() => {
|
|
331
332
|
c && g && !p && h();
|
|
332
333
|
}), {
|
|
333
334
|
isLoadingDiff: l,
|
|
@@ -336,10 +337,10 @@ var U = (e) => {
|
|
|
336
337
|
loadDiff: h
|
|
337
338
|
};
|
|
338
339
|
}, ie = (e) => {
|
|
339
|
-
let t =
|
|
340
|
-
t[0] === n ? (C = t[1], w = t[2], T = t[3], E = t[4], D = t[5], O = t[6]) : (C = ne(n), D = n.oldContent || "", E = n.newContent || "", T =
|
|
340
|
+
let t = b(44), { diff: n, isSelected: r, isExpanded: i, onToggleExpanded: s, onSelect: u, onLoadDiff: d, hasOptedIntoLargeDiff: p, onShowFullDiff: m, diffViewMode: h } = e, g = r !== void 0 && r, _ = i === void 0 || i, v = p !== void 0 && p, y = h === void 0 ? "unified" : h, C, w, T, E, D, O;
|
|
341
|
+
t[0] === n ? (C = t[1], w = t[2], T = t[3], E = t[4], D = t[5], O = t[6]) : (C = ne(n), D = n.oldContent || "", E = n.newContent || "", T = c(n), w = o(C), O = l(C) && !a(C), t[0] = n, t[1] = C, t[2] = w, t[3] = T, t[4] = E, t[5] = D, t[6] = O);
|
|
341
342
|
let k = O, A = n.oldContent !== void 0 || n.newContent !== void 0, j = T && !v, M;
|
|
342
|
-
t[7] !== k || t[8] !== C || t[9] !== A || t[10] !== _ || t[11] !== w || t[12] !== g || t[13] !==
|
|
343
|
+
t[7] !== k || t[8] !== C || t[9] !== A || t[10] !== _ || t[11] !== w || t[12] !== g || t[13] !== d || t[14] !== j ? (M = {
|
|
343
344
|
filePath: C,
|
|
344
345
|
isExpanded: _,
|
|
345
346
|
isSelected: g,
|
|
@@ -347,18 +348,18 @@ var U = (e) => {
|
|
|
347
348
|
isLargeDiff: j,
|
|
348
349
|
isGeneratedDiff: w,
|
|
349
350
|
isBinaryDiff: k,
|
|
350
|
-
onLoadDiff:
|
|
351
|
-
}, t[7] = k, t[8] = C, t[9] = A, t[10] = _, t[11] = w, t[12] = g, t[13] =
|
|
351
|
+
onLoadDiff: d
|
|
352
|
+
}, t[7] = k, t[8] = C, t[9] = A, t[10] = _, t[11] = w, t[12] = g, t[13] = d, t[14] = j, t[15] = M) : M = t[15];
|
|
352
353
|
let { isLoadingDiff: N, loadError: P, shouldAutoLoadDiff: F, loadDiff: I } = re(M), L = g ? "border.accent" : "border.subtle", R;
|
|
353
354
|
t[16] === Symbol.for("react.memo_cache_sentinel") ? (R = { borderColor: "border.accent" }, t[16] = R) : R = t[16];
|
|
354
355
|
let z;
|
|
355
|
-
t[17] !== n || t[18] !== _ || t[19] !==
|
|
356
|
+
t[17] !== n || t[18] !== _ || t[19] !== s ? (z = /* @__PURE__ */ x(ae, {
|
|
356
357
|
diff: n,
|
|
357
358
|
isExpanded: _,
|
|
358
|
-
onToggleExpanded:
|
|
359
|
-
}), t[17] = n, t[18] = _, t[19] =
|
|
360
|
-
let B = !!
|
|
361
|
-
t[21] !== k || t[22] !== n || t[23] !==
|
|
359
|
+
onToggleExpanded: s
|
|
360
|
+
}), t[17] = n, t[18] = _, t[19] = s, t[20] = z) : z = t[20];
|
|
361
|
+
let B = !!d, V;
|
|
362
|
+
t[21] !== k || t[22] !== n || t[23] !== y || t[24] !== C || t[25] !== A || t[26] !== v || t[27] !== _ || t[28] !== w || t[29] !== T || t[30] !== N || t[31] !== I || t[32] !== P || t[33] !== E || t[34] !== D || t[35] !== m || t[36] !== F || t[37] !== B ? (V = /* @__PURE__ */ x(W, {
|
|
362
363
|
diff: n,
|
|
363
364
|
filePath: C,
|
|
364
365
|
oldContent: D,
|
|
@@ -375,10 +376,10 @@ var U = (e) => {
|
|
|
375
376
|
onLoadDiff: I,
|
|
376
377
|
hasOptedIntoLargeDiff: v,
|
|
377
378
|
onShowFullDiff: m,
|
|
378
|
-
diffViewMode:
|
|
379
|
-
}), t[21] = k, t[22] = n, t[23] =
|
|
379
|
+
diffViewMode: y
|
|
380
|
+
}), t[21] = k, t[22] = n, t[23] = y, t[24] = C, t[25] = A, t[26] = v, t[27] = _, t[28] = w, t[29] = T, t[30] = N, t[31] = I, t[32] = P, t[33] = E, t[34] = D, t[35] = m, t[36] = F, t[37] = B, t[38] = V) : V = t[38];
|
|
380
381
|
let H;
|
|
381
|
-
return t[39] !== u || t[40] !== V || t[41] !== L || t[42] !== z ? (H = /* @__PURE__ */
|
|
382
|
+
return t[39] !== u || t[40] !== V || t[41] !== L || t[42] !== z ? (H = /* @__PURE__ */ S(f, {
|
|
382
383
|
"data-testid": "diff-card",
|
|
383
384
|
border: "1px solid",
|
|
384
385
|
borderColor: L,
|
|
@@ -393,16 +394,16 @@ var U = (e) => {
|
|
|
393
394
|
children: [z, V]
|
|
394
395
|
}), t[39] = u, t[40] = V, t[41] = L, t[42] = z, t[43] = H) : H = t[43], H;
|
|
395
396
|
}, ae = (t) => {
|
|
396
|
-
let n =
|
|
397
|
-
n[0] ===
|
|
398
|
-
let
|
|
399
|
-
n[5] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
400
|
-
|
|
401
|
-
}, j = [], n[5] =
|
|
397
|
+
let n = b(65), { diff: r, isExpanded: a, onToggleExpanded: o } = t, s = a === void 0 || a, c, l, u, d;
|
|
398
|
+
n[0] === r ? (c = n[1], l = n[2], u = n[3], d = n[4]) : (u = ne(r), c = r.additions ?? 0, l = r.deletions ?? 0, d = te(u), n[0] = r, n[1] = c, n[2] = l, n[3] = u, n[4] = d);
|
|
399
|
+
let p = d, [g, _] = E(!1), v = T(null), w, j;
|
|
400
|
+
n[5] === Symbol.for("react.memo_cache_sentinel") ? (w = () => () => {
|
|
401
|
+
v.current !== null && window.clearTimeout(v.current);
|
|
402
|
+
}, j = [], n[5] = w, n[6] = j) : (w = n[5], j = n[6]), C(w, j);
|
|
402
403
|
let M;
|
|
403
404
|
n[7] === u ? M = n[8] : (M = async () => {
|
|
404
405
|
try {
|
|
405
|
-
await navigator.clipboard.writeText(u), _(!0),
|
|
406
|
+
await navigator.clipboard.writeText(u), _(!0), v.current !== null && window.clearTimeout(v.current), v.current = window.setTimeout(() => _(!1), 1200);
|
|
406
407
|
} catch {
|
|
407
408
|
_(!1);
|
|
408
409
|
}
|
|
@@ -416,9 +417,9 @@ var U = (e) => {
|
|
|
416
417
|
e.stopPropagation(), o?.();
|
|
417
418
|
}, n[12] = o, n[13] = z);
|
|
418
419
|
let B;
|
|
419
|
-
n[14] === s ? B = n[15] : (B =
|
|
420
|
+
n[14] === s ? B = n[15] : (B = x(s ? O : k, { size: 16 }), n[14] = s, n[15] = B);
|
|
420
421
|
let V;
|
|
421
|
-
n[16] !== z || n[17] !== B || n[18] !== R ? (V = /* @__PURE__ */
|
|
422
|
+
n[16] !== z || n[17] !== B || n[18] !== R ? (V = /* @__PURE__ */ x(h, {
|
|
422
423
|
"aria-label": R,
|
|
423
424
|
variant: "ghost",
|
|
424
425
|
size: "2xs",
|
|
@@ -427,44 +428,44 @@ var U = (e) => {
|
|
|
427
428
|
children: B
|
|
428
429
|
}), n[16] = z, n[17] = B, n[18] = R, n[19] = V) : V = n[19];
|
|
429
430
|
let H;
|
|
430
|
-
n[20] !==
|
|
431
|
+
n[20] !== r.change || n[21] !== r.newPath || n[22] !== r.oldPath ? (H = r.change === "renamed" && /* @__PURE__ */ S(y, {
|
|
431
432
|
as: "span",
|
|
432
433
|
textStyle: "sm",
|
|
433
434
|
children: [
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ x(y, {
|
|
435
436
|
as: "span",
|
|
436
437
|
color: "fg.muted",
|
|
437
438
|
textDecoration: "line-through",
|
|
438
439
|
mr: "xs",
|
|
439
|
-
children:
|
|
440
|
+
children: r.oldPath
|
|
440
441
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ x(f, {
|
|
442
443
|
as: "span",
|
|
443
444
|
display: "inline-flex",
|
|
444
445
|
alignItems: "center",
|
|
445
446
|
verticalAlign: "middle",
|
|
446
447
|
mr: "xs",
|
|
447
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ x(k, { size: 12 })
|
|
448
449
|
}),
|
|
449
|
-
|
|
450
|
+
r.newPath
|
|
450
451
|
]
|
|
451
|
-
}), n[20] =
|
|
452
|
+
}), n[20] = r.change, n[21] = r.newPath, n[22] = r.oldPath, n[23] = H) : H = n[23];
|
|
452
453
|
let U;
|
|
453
|
-
n[24] !==
|
|
454
|
+
n[24] !== r.change || n[25] !== u ? (U = r.change === "deleted" && /* @__PURE__ */ x(y, {
|
|
454
455
|
as: "span",
|
|
455
456
|
color: "fg.muted",
|
|
456
457
|
textDecoration: "line-through",
|
|
457
458
|
textStyle: "sm",
|
|
458
459
|
children: u
|
|
459
|
-
}), n[24] =
|
|
460
|
+
}), n[24] = r.change, n[25] = u, n[26] = U) : U = n[26];
|
|
460
461
|
let W;
|
|
461
|
-
n[27] !==
|
|
462
|
+
n[27] !== r.change || n[28] !== u ? (W = r.change !== "renamed" && r.change !== "deleted" && /* @__PURE__ */ x(y, {
|
|
462
463
|
as: "span",
|
|
463
464
|
textStyle: "sm",
|
|
464
465
|
children: u
|
|
465
|
-
}), n[27] =
|
|
466
|
+
}), n[27] = r.change, n[28] = u, n[29] = W) : W = n[29];
|
|
466
467
|
let G;
|
|
467
|
-
n[30] !== u || n[31] !== H || n[32] !== U || n[33] !== W ? (G = /* @__PURE__ */
|
|
468
|
+
n[30] !== u || n[31] !== H || n[32] !== U || n[33] !== W ? (G = /* @__PURE__ */ S(f, {
|
|
468
469
|
minW: 0,
|
|
469
470
|
overflow: "hidden",
|
|
470
471
|
textOverflow: "ellipsis",
|
|
@@ -486,9 +487,9 @@ var U = (e) => {
|
|
|
486
487
|
e.stopPropagation(), N();
|
|
487
488
|
}, n[36] = N, n[37] = K);
|
|
488
489
|
let q;
|
|
489
|
-
n[38] === g ? q = n[39] : (q =
|
|
490
|
+
n[38] === g ? q = n[39] : (q = x(g ? D : A, { size: 12 }), n[38] = g, n[39] = q);
|
|
490
491
|
let J;
|
|
491
|
-
n[40] !== oe || n[41] !== K || n[42] !== q ? (J = /* @__PURE__ */
|
|
492
|
+
n[40] !== oe || n[41] !== K || n[42] !== q ? (J = /* @__PURE__ */ x(h, {
|
|
492
493
|
"aria-label": oe,
|
|
493
494
|
variant: "ghost",
|
|
494
495
|
size: "2xs",
|
|
@@ -497,12 +498,12 @@ var U = (e) => {
|
|
|
497
498
|
children: q
|
|
498
499
|
}), n[40] = oe, n[41] = K, n[42] = q, n[43] = J) : J = n[43];
|
|
499
500
|
let Y;
|
|
500
|
-
n[44] !== ae || n[45] !== J ? (Y = /* @__PURE__ */
|
|
501
|
+
n[44] !== ae || n[45] !== J ? (Y = /* @__PURE__ */ x(e, {
|
|
501
502
|
content: ae,
|
|
502
503
|
children: J
|
|
503
504
|
}), n[44] = ae, n[45] = J, n[46] = Y) : Y = n[46];
|
|
504
505
|
let X;
|
|
505
|
-
n[47] !== ee || n[48] !== re || n[49] !== Y ? (X = /* @__PURE__ */
|
|
506
|
+
n[47] !== ee || n[48] !== re || n[49] !== Y ? (X = /* @__PURE__ */ x(f, {
|
|
506
507
|
opacity: ee,
|
|
507
508
|
pointerEvents: re,
|
|
508
509
|
transition: "opacity 120ms ease",
|
|
@@ -510,7 +511,7 @@ var U = (e) => {
|
|
|
510
511
|
children: Y
|
|
511
512
|
}), n[47] = ee, n[48] = re, n[49] = Y, n[50] = X) : X = n[50];
|
|
512
513
|
let Z;
|
|
513
|
-
n[51] !== G || n[52] !== X ? (Z = /* @__PURE__ */
|
|
514
|
+
n[51] !== G || n[52] !== X ? (Z = /* @__PURE__ */ S(m, {
|
|
514
515
|
templateColumns: "minmax(0, max-content) auto",
|
|
515
516
|
alignItems: "center",
|
|
516
517
|
justifyContent: "start",
|
|
@@ -519,16 +520,16 @@ var U = (e) => {
|
|
|
519
520
|
children: [G, X]
|
|
520
521
|
}), n[51] = G, n[52] = X, n[53] = Z) : Z = n[53];
|
|
521
522
|
let Q;
|
|
522
|
-
n[54] !== c || n[55] !== l || n[56] !==
|
|
523
|
+
n[54] !== c || n[55] !== l || n[56] !== p ? (Q = p ? /* @__PURE__ */ x(f, {
|
|
523
524
|
flexShrink: 0,
|
|
524
|
-
children: /* @__PURE__ */
|
|
525
|
+
children: /* @__PURE__ */ x(i, {
|
|
525
526
|
variant: "ghost",
|
|
526
527
|
additions: c,
|
|
527
528
|
deletions: l
|
|
528
529
|
})
|
|
529
|
-
}) : null, n[54] = c, n[55] = l, n[56] =
|
|
530
|
+
}) : null, n[54] = c, n[55] = l, n[56] = p, n[57] = Q) : Q = n[57];
|
|
530
531
|
let se;
|
|
531
|
-
return n[58] !== V || n[59] !== Z || n[60] !== Q || n[61] !== P || n[62] !== F || n[63] !== L ? (se = /* @__PURE__ */
|
|
532
|
+
return n[58] !== V || n[59] !== Z || n[60] !== Q || n[61] !== P || n[62] !== F || n[63] !== L ? (se = /* @__PURE__ */ S(m, {
|
|
532
533
|
"data-testid": "diff-card-header",
|
|
533
534
|
templateColumns: "auto minmax(0, 1fr) auto",
|
|
534
535
|
px: "xs",
|
|
@@ -555,38 +556,38 @@ var U = (e) => {
|
|
|
555
556
|
]
|
|
556
557
|
}), n[58] = V, n[59] = Z, n[60] = Q, n[61] = P, n[62] = F, n[63] = L, n[64] = se) : se = n[64], se;
|
|
557
558
|
}, oe = () => {
|
|
558
|
-
let e =
|
|
559
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
559
|
+
let e = b(1), n;
|
|
560
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ x(v, {
|
|
560
561
|
h: "full",
|
|
561
562
|
minH: "0",
|
|
562
563
|
gap: "0",
|
|
563
564
|
bg: "bg",
|
|
564
|
-
children: /* @__PURE__ */
|
|
565
|
+
children: /* @__PURE__ */ x(t, {
|
|
565
566
|
flex: "1",
|
|
566
567
|
minH: "0",
|
|
567
568
|
contentProps: {
|
|
568
569
|
p: "xs",
|
|
569
570
|
spaceY: "xs"
|
|
570
571
|
},
|
|
571
|
-
children: /* @__PURE__ */
|
|
572
|
+
children: /* @__PURE__ */ x(r, {
|
|
572
573
|
title: "No changes detected",
|
|
573
574
|
description: "Make some changes to see the diff here.",
|
|
574
575
|
paddingY: "sm"
|
|
575
576
|
})
|
|
576
577
|
})
|
|
577
|
-
}), e[0] =
|
|
578
|
+
}), e[0] = n) : n = e[0], n;
|
|
578
579
|
}, K = 34, q = 18, J = 28, Y = 8, X = () => 130, Z = (e) => {
|
|
579
|
-
let { diff: t, isCollapsed: n, hasOptedIntoLargeDiff: r = !1, diffViewMode:
|
|
580
|
+
let { diff: t, isCollapsed: n, hasOptedIntoLargeDiff: r = !1, diffViewMode: i = "unified" } = e;
|
|
580
581
|
if (n) return 42;
|
|
581
|
-
let o = t.oldContent !== void 0 || t.newContent !== void 0,
|
|
582
|
-
if (
|
|
583
|
-
if (
|
|
584
|
-
let { unifiedContentRows: d, splitContentRows: f, hunkRows: p } =
|
|
582
|
+
let o = t.oldContent !== void 0 || t.newContent !== void 0, s = t.newPath ?? t.oldPath ?? "";
|
|
583
|
+
if (a(s) && (t.oldContent || t.newContent)) return 380;
|
|
584
|
+
if (l(s) || !o || c(t) && !r) return X();
|
|
585
|
+
let { unifiedContentRows: d, splitContentRows: f, hunkRows: p } = u({
|
|
585
586
|
original: t.oldContent ?? "",
|
|
586
587
|
modified: t.newContent ?? "",
|
|
587
588
|
oldPath: t.oldPath,
|
|
588
589
|
newPath: t.newPath
|
|
589
|
-
}), m =
|
|
590
|
+
}), m = i === "split" ? f : d;
|
|
590
591
|
return m === 0 && p === 0 ? X() : K + (m * q + p * J) + Y;
|
|
591
592
|
}, Q = (e) => e.newPath ?? e.oldPath ?? "unknown", se = 24, ce = (e) => {
|
|
592
593
|
let { diffs: t, selectedDiffPath: n, collapsedPaths: r, expansionCommand: i, completedScrollCommandId: a } = e, o = n, s = n ? `selected:${n}` : null, c = i?.action === "expand-selected" ? i.id : null, l = c !== null && a === c;
|
|
@@ -611,7 +612,7 @@ var U = (e) => {
|
|
|
611
612
|
let i = Math.max(0, n - se), a = Array.from({ length: n - i + 1 }, (e, t) => i + t);
|
|
612
613
|
return Array.from(/* @__PURE__ */ new Set([...t, ...a])).sort((e, t) => e - t);
|
|
613
614
|
}, ue = 3, de = 12, fe = (e) => e.newPath ?? e.oldPath ?? "unknown", pe = (e) => {
|
|
614
|
-
let t =
|
|
615
|
+
let t = b(20), { diffs: n, selectedDiffPath: r, collapsedPaths: i, expansionCommand: a, scrollRef: o, virtualizerRef: s, suppressScrollAdjustRef: c } = e, [l, u] = E(null), d;
|
|
615
616
|
t[0] !== i || t[1] !== l || t[2] !== n || t[3] !== a || t[4] !== r ? (d = ce({
|
|
616
617
|
diffs: n,
|
|
617
618
|
selectedDiffPath: r,
|
|
@@ -619,7 +620,7 @@ var U = (e) => {
|
|
|
619
620
|
expansionCommand: a,
|
|
620
621
|
completedScrollCommandId: l
|
|
621
622
|
}), t[0] = i, t[1] = l, t[2] = n, t[3] = a, t[4] = r, t[5] = d) : d = t[5];
|
|
622
|
-
let { selectedScrollPath: f, selectedScrollKey: p, selectedScrollCommandId: m, selectedScrollIndex: h, shouldPinSelectedScrollIndex: g, hasCompletedSelectedScroll: _ } = d, v,
|
|
623
|
+
let { selectedScrollPath: f, selectedScrollKey: p, selectedScrollCommandId: m, selectedScrollIndex: h, shouldPinSelectedScrollIndex: g, hasCompletedSelectedScroll: _ } = d, v, y;
|
|
623
624
|
t[6] !== i || t[7] !== n || t[8] !== _ || t[9] !== o || t[10] !== m || t[11] !== p || t[12] !== f || t[13] !== c || t[14] !== s ? (v = () => {
|
|
624
625
|
if (!f || !p || _ || i.has(f)) return;
|
|
625
626
|
let e = n.findIndex((e) => fe(e) === f);
|
|
@@ -649,7 +650,7 @@ var U = (e) => {
|
|
|
649
650
|
d(), r.removeEventListener("wheel", h), r.removeEventListener("touchmove", h);
|
|
650
651
|
for (let e of a) cancelAnimationFrame(e);
|
|
651
652
|
};
|
|
652
|
-
},
|
|
653
|
+
}, y = [
|
|
653
654
|
p,
|
|
654
655
|
f,
|
|
655
656
|
m,
|
|
@@ -659,7 +660,7 @@ var U = (e) => {
|
|
|
659
660
|
o,
|
|
660
661
|
s,
|
|
661
662
|
c
|
|
662
|
-
], t[6] = i, t[7] = n, t[8] = _, t[9] = o, t[10] = m, t[11] = p, t[12] = f, t[13] = c, t[14] = s, t[15] = v, t[16] =
|
|
663
|
+
], t[6] = i, t[7] = n, t[8] = _, t[9] = o, t[10] = m, t[11] = p, t[12] = f, t[13] = c, t[14] = s, t[15] = v, t[16] = y) : (v = t[15], y = t[16]), w(v, y);
|
|
663
664
|
let x;
|
|
664
665
|
return t[17] !== h || t[18] !== g ? (x = {
|
|
665
666
|
selectedScrollIndex: h,
|
|
@@ -682,108 +683,108 @@ var U = (e) => {
|
|
|
682
683
|
return a.add(r), a;
|
|
683
684
|
};
|
|
684
685
|
function xe(e) {
|
|
685
|
-
let { diffs:
|
|
686
|
-
diffs:
|
|
687
|
-
selectedDiffPath:
|
|
688
|
-
collapsedPaths:
|
|
689
|
-
expansionCommand:
|
|
690
|
-
scrollRef:
|
|
691
|
-
virtualizerRef:
|
|
692
|
-
suppressScrollAdjustRef:
|
|
693
|
-
}),
|
|
694
|
-
count:
|
|
695
|
-
getScrollElement: () =>
|
|
686
|
+
let { diffs: r, selectedDiffPath: i = null, onLoadDiff: a, onSelectDiffPath: o, onExpansionStateChange: s, expansionCommand: c = null, diffViewMode: l = "unified" } = e, u = T(null), d = T(null), p = T(null), m = T(!1), h = T(null), [g, _] = E(() => ge(r)), [y, b] = E(() => /* @__PURE__ */ new Set()), { selectedScrollIndex: S, shouldPinSelectedScrollIndex: D } = pe({
|
|
687
|
+
diffs: r,
|
|
688
|
+
selectedDiffPath: i,
|
|
689
|
+
collapsedPaths: g,
|
|
690
|
+
expansionCommand: c,
|
|
691
|
+
scrollRef: u,
|
|
692
|
+
virtualizerRef: p,
|
|
693
|
+
suppressScrollAdjustRef: m
|
|
694
|
+
}), O = n({
|
|
695
|
+
count: r.length,
|
|
696
|
+
getScrollElement: () => u.current,
|
|
696
697
|
estimateSize: (e) => {
|
|
697
|
-
let t =
|
|
698
|
+
let t = r[e], n = $(t);
|
|
698
699
|
return Z({
|
|
699
700
|
diff: t,
|
|
700
|
-
isCollapsed:
|
|
701
|
-
hasOptedIntoLargeDiff:
|
|
702
|
-
diffViewMode:
|
|
701
|
+
isCollapsed: g.has(n),
|
|
702
|
+
hasOptedIntoLargeDiff: y.has(n),
|
|
703
|
+
diffViewMode: l
|
|
703
704
|
});
|
|
704
705
|
},
|
|
705
|
-
getItemKey: (e) => $(
|
|
706
|
+
getItemKey: (e) => $(r[e]),
|
|
706
707
|
overscan: 3,
|
|
707
708
|
rangeExtractor: (e) => le({
|
|
708
|
-
indexes:
|
|
709
|
-
selectedScrollIndex:
|
|
710
|
-
shouldPinSelectedScrollIndex:
|
|
709
|
+
indexes: j(e),
|
|
710
|
+
selectedScrollIndex: S,
|
|
711
|
+
shouldPinSelectedScrollIndex: D
|
|
711
712
|
})
|
|
712
713
|
});
|
|
713
|
-
if (
|
|
714
|
-
|
|
715
|
-
}, [
|
|
716
|
-
if (
|
|
717
|
-
if (
|
|
718
|
-
let e =
|
|
714
|
+
if (O.shouldAdjustScrollPositionOnItemSizeChange = (e, t, n) => !n.isScrolling && !m.current, p.current = O, w(() => {
|
|
715
|
+
i && _((e) => ye(r, e, i));
|
|
716
|
+
}, [r, i]), w(() => {
|
|
717
|
+
if (c) {
|
|
718
|
+
if (c.action === "expand-selected") {
|
|
719
|
+
let e = c.path;
|
|
719
720
|
if (e) {
|
|
720
|
-
let t =
|
|
721
|
-
|
|
721
|
+
let t = h.current;
|
|
722
|
+
h.current = e, _((n) => be(r, n, e, t));
|
|
722
723
|
}
|
|
723
724
|
return;
|
|
724
725
|
}
|
|
725
|
-
|
|
726
|
+
h.current = null, _(c.action === "collapse" ? _e(r) : /* @__PURE__ */ new Set());
|
|
726
727
|
}
|
|
727
|
-
}, [
|
|
728
|
+
}, [r, c]), C(() => {
|
|
728
729
|
let e = {
|
|
729
|
-
allExpanded:
|
|
730
|
-
allCollapsed:
|
|
731
|
-
}, t =
|
|
732
|
-
(t?.allExpanded !== e.allExpanded || t.allCollapsed !== e.allCollapsed) && (
|
|
730
|
+
allExpanded: g.size === 0,
|
|
731
|
+
allCollapsed: r.length > 0 && r.every((e) => g.has($(e)))
|
|
732
|
+
}, t = d.current;
|
|
733
|
+
(t?.allExpanded !== e.allExpanded || t.allCollapsed !== e.allCollapsed) && (d.current = e, s?.(e));
|
|
733
734
|
}, [
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
]),
|
|
738
|
-
let
|
|
739
|
-
|
|
740
|
-
},
|
|
741
|
-
|
|
735
|
+
g,
|
|
736
|
+
r,
|
|
737
|
+
s
|
|
738
|
+
]), r.length === 0) return /* @__PURE__ */ x(oe, {});
|
|
739
|
+
let k = (e) => {
|
|
740
|
+
_((t) => ve(t, e));
|
|
741
|
+
}, A = (e) => {
|
|
742
|
+
b((t) => {
|
|
742
743
|
let n = new Set(t);
|
|
743
744
|
return n.add(e), n;
|
|
744
745
|
});
|
|
745
|
-
}, M =
|
|
746
|
-
return /* @__PURE__ */
|
|
746
|
+
}, M = O.getVirtualItems();
|
|
747
|
+
return /* @__PURE__ */ x(v, {
|
|
747
748
|
h: "full",
|
|
748
749
|
minH: "0",
|
|
749
750
|
gap: "0",
|
|
750
751
|
bg: "bg",
|
|
751
|
-
children: /* @__PURE__ */
|
|
752
|
+
children: /* @__PURE__ */ x(f, {
|
|
752
753
|
position: "relative",
|
|
753
754
|
flex: "1",
|
|
754
755
|
minH: "0",
|
|
755
756
|
bg: "bg",
|
|
756
|
-
children: /* @__PURE__ */
|
|
757
|
+
children: /* @__PURE__ */ x(t, {
|
|
757
758
|
position: "absolute",
|
|
758
759
|
inset: "0",
|
|
759
|
-
viewportRef:
|
|
760
|
+
viewportRef: u,
|
|
760
761
|
viewportProps: { style: { overflowAnchor: "none" } },
|
|
761
762
|
contentProps: { p: "xs" },
|
|
762
|
-
children: /* @__PURE__ */
|
|
763
|
+
children: /* @__PURE__ */ x(f, {
|
|
763
764
|
position: "relative",
|
|
764
765
|
width: "100%",
|
|
765
|
-
style: { height:
|
|
766
|
+
style: { height: O.getTotalSize() },
|
|
766
767
|
children: M.map((e) => {
|
|
767
|
-
let t =
|
|
768
|
-
return /* @__PURE__ */
|
|
768
|
+
let t = r[e.index], n = $(t);
|
|
769
|
+
return /* @__PURE__ */ x(f, {
|
|
769
770
|
"data-index": e.index,
|
|
770
|
-
ref:
|
|
771
|
+
ref: O.measureElement,
|
|
771
772
|
position: "absolute",
|
|
772
773
|
left: "0",
|
|
773
774
|
width: "100%",
|
|
774
775
|
pb: "xs",
|
|
775
776
|
style: { top: `${e.start}px` },
|
|
776
|
-
children: /* @__PURE__ */
|
|
777
|
+
children: /* @__PURE__ */ x(ie, {
|
|
777
778
|
diff: t,
|
|
778
|
-
isSelected:
|
|
779
|
-
isExpanded: !
|
|
780
|
-
onToggleExpanded: () =>
|
|
781
|
-
onSelect: () =>
|
|
782
|
-
onLoadDiff:
|
|
783
|
-
hasOptedIntoLargeDiff:
|
|
784
|
-
onShowFullDiff: () =>
|
|
785
|
-
diffViewMode:
|
|
786
|
-
},
|
|
779
|
+
isSelected: i === n,
|
|
780
|
+
isExpanded: !g.has(n),
|
|
781
|
+
onToggleExpanded: () => k(n),
|
|
782
|
+
onSelect: () => o?.(n),
|
|
783
|
+
onLoadDiff: a,
|
|
784
|
+
hasOptedIntoLargeDiff: y.has(n),
|
|
785
|
+
onShowFullDiff: () => A(n),
|
|
786
|
+
diffViewMode: l
|
|
787
|
+
}, n)
|
|
787
788
|
}, e.key);
|
|
788
789
|
})
|
|
789
790
|
})
|
|
@@ -794,4 +795,4 @@ function xe(e) {
|
|
|
794
795
|
//#endregion
|
|
795
796
|
export { xe as DiffDrawer };
|
|
796
797
|
|
|
797
|
-
//# sourceMappingURL=diff-drawer-
|
|
798
|
+
//# sourceMappingURL=diff-drawer-IYpQ-QQK.js.map
|