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