@industry-theme/repository-composition-panels 0.2.13 → 0.2.14
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/panels/GitChangesPanel.d.ts +16 -0
- package/dist/panels/GitChangesPanel.d.ts.map +1 -1
- package/dist/panels/GitChangesPanel.stories.d.ts +1 -0
- package/dist/panels/GitChangesPanel.stories.d.ts.map +1 -1
- package/dist/panels.bundle.css +10 -0
- package/dist/panels.bundle.js +226 -28
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const onPackageLoad: () => Promise<void>;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const onPackageUnload: () => Promise<void>;
|
|
15
15
|
export { GitChangesPanel, GitChangesPanelContent, GitChangesPanelPreview } from './panels/GitChangesPanel';
|
|
16
|
-
export type { GitChangesPanelProps } from './panels/GitChangesPanel';
|
|
16
|
+
export type { GitChangesPanelProps, ContextMenuAction } from './panels/GitChangesPanel';
|
|
17
17
|
export { PackageCompositionPanel, PackageCompositionPanelContent, PackageCompositionPanelPreview } from './panels/PackageCompositionPanel';
|
|
18
18
|
export type { PackageCompositionPanelProps } from './panels/PackageCompositionPanel';
|
|
19
19
|
export { SearchPanel, SearchPanelContent, SearchPanelPreview } from './panels/SearchPanel';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,SAAS,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,eAAe,EA2FnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,qBAGzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,qBAG3B,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC3G,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,SAAS,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,eAAe,EA2FnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,qBAGzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,qBAG3B,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC3G,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC3I,YAAY,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,YAAY,EACV,SAAS,EACT,wBAAwB,EACxB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FileTree } from '@principal-ai/repository-abstraction';
|
|
3
3
|
import type { GitStatus, GitChangeSelectionStatus, PanelComponentProps } from '../types';
|
|
4
|
+
import './GitChangesPanel.css';
|
|
5
|
+
export type ContextMenuAction = {
|
|
6
|
+
type: 'copyFullPath';
|
|
7
|
+
path: string;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'copyRelativePath';
|
|
10
|
+
path: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'openFile';
|
|
13
|
+
path: string;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'openFolder';
|
|
16
|
+
path: string;
|
|
17
|
+
};
|
|
4
18
|
export interface GitChangesPanelProps {
|
|
5
19
|
/** Git status data with categorized file paths */
|
|
6
20
|
gitStatus: GitStatus;
|
|
@@ -12,6 +26,8 @@ export interface GitChangesPanelProps {
|
|
|
12
26
|
isLoading?: boolean;
|
|
13
27
|
/** Callback when a file is clicked */
|
|
14
28
|
onFileClick?: (filePath: string, status?: GitChangeSelectionStatus) => void;
|
|
29
|
+
/** Callback when a context menu action is triggered */
|
|
30
|
+
onContextMenuAction?: (action: ContextMenuAction) => void;
|
|
15
31
|
/** Message to display when there are no changes */
|
|
16
32
|
emptyMessage?: string;
|
|
17
33
|
/** Message to display while loading */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitChangesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GitChangesPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GitChangesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GitChangesPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAIjF,OAAO,EAAwB,KAAK,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAE3F,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACzF,OAAO,uBAAuB,CAAC;AAU/B,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,SAAS,EAAE,SAAS,CAAC;IACrB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC5E,uDAAuD;IACvD,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC1D,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8ZjE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAiD1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwDzD,CAAC"}
|
|
@@ -25,6 +25,7 @@ declare const meta: {
|
|
|
25
25
|
rootPath?: string | undefined;
|
|
26
26
|
isLoading?: boolean | undefined;
|
|
27
27
|
onFileClick?: ((filePath: string, status?: GitChangeSelectionStatus) => void) | undefined;
|
|
28
|
+
onContextMenuAction?: ((action: import("./GitChangesPanel").ContextMenuAction) => void) | undefined;
|
|
28
29
|
emptyMessage?: string | undefined;
|
|
29
30
|
loadingMessage?: string | undefined;
|
|
30
31
|
selectedFile?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitChangesPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/GitChangesPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpE;;;;;GAKG;AACH,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"GitChangesPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/GitChangesPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpE;;;;;GAKG;AACH,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;gDA8BqB,CAAC;;;;;;CARe,CAAC;AAEhD,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA6BnC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAcxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAe3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAazB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,sBAAsB,CAQ3D,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React2, { createContext, useContext, forwardRef, createElement, useRef, useEffect, memo, PureComponent, isValidElement, cloneElement, useLayoutEffect, useMemo, useState, useCallback, useImperativeHandle } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
3
4
|
var ThemeContext;
|
|
4
5
|
var getThemeContext = () => {
|
|
5
6
|
if (typeof window !== "undefined") {
|
|
@@ -128,18 +129,18 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
128
129
|
* This source code is licensed under the ISC license.
|
|
129
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
130
131
|
*/
|
|
131
|
-
const __iconNode$
|
|
132
|
+
const __iconNode$r = [
|
|
132
133
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
133
134
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
134
135
|
];
|
|
135
|
-
const ArrowRight = createLucideIcon("arrow-right", __iconNode$
|
|
136
|
+
const ArrowRight = createLucideIcon("arrow-right", __iconNode$r);
|
|
136
137
|
/**
|
|
137
138
|
* @license lucide-react v0.552.0 - ISC
|
|
138
139
|
*
|
|
139
140
|
* This source code is licensed under the ISC license.
|
|
140
141
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
142
|
*/
|
|
142
|
-
const __iconNode$
|
|
143
|
+
const __iconNode$q = [
|
|
143
144
|
[
|
|
144
145
|
"path",
|
|
145
146
|
{
|
|
@@ -150,93 +151,93 @@ const __iconNode$o = [
|
|
|
150
151
|
["path", { d: "m3.3 7 8.7 5 8.7-5", key: "g66t2b" }],
|
|
151
152
|
["path", { d: "M12 22V12", key: "d0xqtd" }]
|
|
152
153
|
];
|
|
153
|
-
const Box = createLucideIcon("box", __iconNode$
|
|
154
|
+
const Box = createLucideIcon("box", __iconNode$q);
|
|
154
155
|
/**
|
|
155
156
|
* @license lucide-react v0.552.0 - ISC
|
|
156
157
|
*
|
|
157
158
|
* This source code is licensed under the ISC license.
|
|
158
159
|
* See the LICENSE file in the root directory of this source tree.
|
|
159
160
|
*/
|
|
160
|
-
const __iconNode$
|
|
161
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
161
|
+
const __iconNode$p = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
162
|
+
const Check = createLucideIcon("check", __iconNode$p);
|
|
162
163
|
/**
|
|
163
164
|
* @license lucide-react v0.552.0 - ISC
|
|
164
165
|
*
|
|
165
166
|
* This source code is licensed under the ISC license.
|
|
166
167
|
* See the LICENSE file in the root directory of this source tree.
|
|
167
168
|
*/
|
|
168
|
-
const __iconNode$
|
|
169
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
169
|
+
const __iconNode$o = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
170
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$o);
|
|
170
171
|
/**
|
|
171
172
|
* @license lucide-react v0.552.0 - ISC
|
|
172
173
|
*
|
|
173
174
|
* This source code is licensed under the ISC license.
|
|
174
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
175
176
|
*/
|
|
176
|
-
const __iconNode$
|
|
177
|
-
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$
|
|
177
|
+
const __iconNode$n = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
178
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$n);
|
|
178
179
|
/**
|
|
179
180
|
* @license lucide-react v0.552.0 - ISC
|
|
180
181
|
*
|
|
181
182
|
* This source code is licensed under the ISC license.
|
|
182
183
|
* See the LICENSE file in the root directory of this source tree.
|
|
183
184
|
*/
|
|
184
|
-
const __iconNode$
|
|
185
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
185
|
+
const __iconNode$m = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
186
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$m);
|
|
186
187
|
/**
|
|
187
188
|
* @license lucide-react v0.552.0 - ISC
|
|
188
189
|
*
|
|
189
190
|
* This source code is licensed under the ISC license.
|
|
190
191
|
* See the LICENSE file in the root directory of this source tree.
|
|
191
192
|
*/
|
|
192
|
-
const __iconNode$
|
|
193
|
+
const __iconNode$l = [
|
|
193
194
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
194
195
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
195
196
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
196
197
|
];
|
|
197
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
198
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$l);
|
|
198
199
|
/**
|
|
199
200
|
* @license lucide-react v0.552.0 - ISC
|
|
200
201
|
*
|
|
201
202
|
* This source code is licensed under the ISC license.
|
|
202
203
|
* See the LICENSE file in the root directory of this source tree.
|
|
203
204
|
*/
|
|
204
|
-
const __iconNode$
|
|
205
|
+
const __iconNode$k = [
|
|
205
206
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
206
207
|
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
207
208
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
208
209
|
];
|
|
209
|
-
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$
|
|
210
|
+
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$k);
|
|
210
211
|
/**
|
|
211
212
|
* @license lucide-react v0.552.0 - ISC
|
|
212
213
|
*
|
|
213
214
|
* This source code is licensed under the ISC license.
|
|
214
215
|
* See the LICENSE file in the root directory of this source tree.
|
|
215
216
|
*/
|
|
216
|
-
const __iconNode$
|
|
217
|
+
const __iconNode$j = [
|
|
217
218
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
218
219
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
219
220
|
];
|
|
220
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
221
|
+
const Copy = createLucideIcon("copy", __iconNode$j);
|
|
221
222
|
/**
|
|
222
223
|
* @license lucide-react v0.552.0 - ISC
|
|
223
224
|
*
|
|
224
225
|
* This source code is licensed under the ISC license.
|
|
225
226
|
* See the LICENSE file in the root directory of this source tree.
|
|
226
227
|
*/
|
|
227
|
-
const __iconNode$
|
|
228
|
+
const __iconNode$i = [
|
|
228
229
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
229
230
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
230
231
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
231
232
|
];
|
|
232
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
233
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$i);
|
|
233
234
|
/**
|
|
234
235
|
* @license lucide-react v0.552.0 - ISC
|
|
235
236
|
*
|
|
236
237
|
* This source code is licensed under the ISC license.
|
|
237
238
|
* See the LICENSE file in the root directory of this source tree.
|
|
238
239
|
*/
|
|
239
|
-
const __iconNode$
|
|
240
|
+
const __iconNode$h = [
|
|
240
241
|
[
|
|
241
242
|
"path",
|
|
242
243
|
{
|
|
@@ -248,14 +249,14 @@ const __iconNode$f = [
|
|
|
248
249
|
["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
|
|
249
250
|
["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }]
|
|
250
251
|
];
|
|
251
|
-
const FileCode = createLucideIcon("file-code", __iconNode$
|
|
252
|
+
const FileCode = createLucideIcon("file-code", __iconNode$h);
|
|
252
253
|
/**
|
|
253
254
|
* @license lucide-react v0.552.0 - ISC
|
|
254
255
|
*
|
|
255
256
|
* This source code is licensed under the ISC license.
|
|
256
257
|
* See the LICENSE file in the root directory of this source tree.
|
|
257
258
|
*/
|
|
258
|
-
const __iconNode$
|
|
259
|
+
const __iconNode$g = [
|
|
259
260
|
[
|
|
260
261
|
"path",
|
|
261
262
|
{
|
|
@@ -266,14 +267,32 @@ const __iconNode$e = [
|
|
|
266
267
|
["path", { d: "M12 17h.01", key: "p32p05" }],
|
|
267
268
|
["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }]
|
|
268
269
|
];
|
|
269
|
-
const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$
|
|
270
|
+
const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$g);
|
|
270
271
|
/**
|
|
271
272
|
* @license lucide-react v0.552.0 - ISC
|
|
272
273
|
*
|
|
273
274
|
* This source code is licensed under the ISC license.
|
|
274
275
|
* See the LICENSE file in the root directory of this source tree.
|
|
275
276
|
*/
|
|
276
|
-
const __iconNode$
|
|
277
|
+
const __iconNode$f = [
|
|
278
|
+
[
|
|
279
|
+
"path",
|
|
280
|
+
{
|
|
281
|
+
d: "M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7",
|
|
282
|
+
key: "huwfnr"
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
|
|
286
|
+
["path", { d: "m10 18 3-3-3-3", key: "18f6ys" }]
|
|
287
|
+
];
|
|
288
|
+
const FileSymlink = createLucideIcon("file-symlink", __iconNode$f);
|
|
289
|
+
/**
|
|
290
|
+
* @license lucide-react v0.552.0 - ISC
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the ISC license.
|
|
293
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/
|
|
295
|
+
const __iconNode$e = [
|
|
277
296
|
[
|
|
278
297
|
"path",
|
|
279
298
|
{
|
|
@@ -286,7 +305,23 @@ const __iconNode$d = [
|
|
|
286
305
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
287
306
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
288
307
|
];
|
|
289
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
308
|
+
const FileText = createLucideIcon("file-text", __iconNode$e);
|
|
309
|
+
/**
|
|
310
|
+
* @license lucide-react v0.552.0 - ISC
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the ISC license.
|
|
313
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/
|
|
315
|
+
const __iconNode$d = [
|
|
316
|
+
[
|
|
317
|
+
"path",
|
|
318
|
+
{
|
|
319
|
+
d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",
|
|
320
|
+
key: "usdka0"
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
];
|
|
324
|
+
const FolderOpen = createLucideIcon("folder-open", __iconNode$d);
|
|
290
325
|
/**
|
|
291
326
|
* @license lucide-react v0.552.0 - ISC
|
|
292
327
|
*
|
|
@@ -8089,11 +8124,31 @@ const GitChangesPanelContent = ({
|
|
|
8089
8124
|
rootPath,
|
|
8090
8125
|
isLoading = false,
|
|
8091
8126
|
onFileClick,
|
|
8127
|
+
onContextMenuAction,
|
|
8092
8128
|
emptyMessage = "No git changes to display",
|
|
8093
8129
|
loadingMessage = "Loading git changes...",
|
|
8094
8130
|
selectedFile
|
|
8095
8131
|
}) => {
|
|
8096
8132
|
const { theme } = useTheme();
|
|
8133
|
+
const [contextMenu, setContextMenu] = useState({
|
|
8134
|
+
visible: false,
|
|
8135
|
+
x: 0,
|
|
8136
|
+
y: 0,
|
|
8137
|
+
nodePath: "",
|
|
8138
|
+
isFolder: false
|
|
8139
|
+
});
|
|
8140
|
+
const contextMenuRef = useRef(null);
|
|
8141
|
+
useEffect(() => {
|
|
8142
|
+
const handleClickOutside = (e) => {
|
|
8143
|
+
if (contextMenuRef.current && !contextMenuRef.current.contains(e.target)) {
|
|
8144
|
+
setContextMenu((prev) => ({ ...prev, visible: false }));
|
|
8145
|
+
}
|
|
8146
|
+
};
|
|
8147
|
+
if (contextMenu.visible) {
|
|
8148
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
8149
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
8150
|
+
}
|
|
8151
|
+
}, [contextMenu.visible]);
|
|
8097
8152
|
const hasChanges = gitStatus.staged.length > 0 || gitStatus.unstaged.length > 0 || gitStatus.untracked.length > 0 || gitStatus.deleted.length > 0;
|
|
8098
8153
|
const [showFullTree, setShowFullTree] = useState(false);
|
|
8099
8154
|
const userHasToggledView = useRef(false);
|
|
@@ -8130,6 +8185,52 @@ const GitChangesPanelContent = ({
|
|
|
8130
8185
|
},
|
|
8131
8186
|
[getFileStatus, onFileClick]
|
|
8132
8187
|
);
|
|
8188
|
+
const handleContextMenu = useCallback(
|
|
8189
|
+
(event, nodePath, isFolder) => {
|
|
8190
|
+
event.preventDefault();
|
|
8191
|
+
setContextMenu({
|
|
8192
|
+
visible: true,
|
|
8193
|
+
x: event.clientX,
|
|
8194
|
+
y: event.clientY,
|
|
8195
|
+
nodePath,
|
|
8196
|
+
isFolder
|
|
8197
|
+
});
|
|
8198
|
+
},
|
|
8199
|
+
[]
|
|
8200
|
+
);
|
|
8201
|
+
const closeContextMenu = useCallback(() => {
|
|
8202
|
+
setContextMenu((prev) => ({ ...prev, visible: false }));
|
|
8203
|
+
}, []);
|
|
8204
|
+
const getFullPath = useCallback(
|
|
8205
|
+
(nodePath) => {
|
|
8206
|
+
if (rootPath && !nodePath.startsWith(rootPath)) {
|
|
8207
|
+
return `${rootPath}/${nodePath}`;
|
|
8208
|
+
}
|
|
8209
|
+
return nodePath;
|
|
8210
|
+
},
|
|
8211
|
+
[rootPath]
|
|
8212
|
+
);
|
|
8213
|
+
const handleCopyFullPath = useCallback(() => {
|
|
8214
|
+
const fullPath = getFullPath(contextMenu.nodePath);
|
|
8215
|
+
navigator.clipboard.writeText(fullPath);
|
|
8216
|
+
onContextMenuAction == null ? void 0 : onContextMenuAction({ type: "copyFullPath", path: fullPath });
|
|
8217
|
+
closeContextMenu();
|
|
8218
|
+
}, [contextMenu.nodePath, getFullPath, onContextMenuAction, closeContextMenu]);
|
|
8219
|
+
const handleCopyRelativePath = useCallback(() => {
|
|
8220
|
+
navigator.clipboard.writeText(contextMenu.nodePath);
|
|
8221
|
+
onContextMenuAction == null ? void 0 : onContextMenuAction({ type: "copyRelativePath", path: contextMenu.nodePath });
|
|
8222
|
+
closeContextMenu();
|
|
8223
|
+
}, [contextMenu.nodePath, onContextMenuAction, closeContextMenu]);
|
|
8224
|
+
const handleOpenFile = useCallback(() => {
|
|
8225
|
+
const fullPath = getFullPath(contextMenu.nodePath);
|
|
8226
|
+
onContextMenuAction == null ? void 0 : onContextMenuAction({ type: "openFile", path: fullPath });
|
|
8227
|
+
closeContextMenu();
|
|
8228
|
+
}, [contextMenu.nodePath, getFullPath, onContextMenuAction, closeContextMenu]);
|
|
8229
|
+
const handleOpenFolder = useCallback(() => {
|
|
8230
|
+
const fullPath = getFullPath(contextMenu.nodePath);
|
|
8231
|
+
onContextMenuAction == null ? void 0 : onContextMenuAction({ type: "openFolder", path: fullPath });
|
|
8232
|
+
closeContextMenu();
|
|
8233
|
+
}, [contextMenu.nodePath, getFullPath, onContextMenuAction, closeContextMenu]);
|
|
8133
8234
|
const gitChangesData = useMemo(() => {
|
|
8134
8235
|
if (isLoading) {
|
|
8135
8236
|
return null;
|
|
@@ -8286,6 +8387,7 @@ const GitChangesPanelContent = ({
|
|
|
8286
8387
|
theme,
|
|
8287
8388
|
gitStatusData: gitChangesData.statusData,
|
|
8288
8389
|
onFileSelect: handleFileSelect,
|
|
8390
|
+
onContextMenu: handleContextMenu,
|
|
8289
8391
|
selectedFile,
|
|
8290
8392
|
transparentBackground: true,
|
|
8291
8393
|
horizontalNodePadding: "16px",
|
|
@@ -8294,9 +8396,93 @@ const GitChangesPanelContent = ({
|
|
|
8294
8396
|
showFullTree ? "full" : "changes"
|
|
8295
8397
|
);
|
|
8296
8398
|
};
|
|
8399
|
+
const contextMenuButtonStyle = {
|
|
8400
|
+
display: "flex",
|
|
8401
|
+
alignItems: "center",
|
|
8402
|
+
gap: "8px",
|
|
8403
|
+
width: "100%",
|
|
8404
|
+
padding: "8px 12px",
|
|
8405
|
+
border: "none",
|
|
8406
|
+
background: "none",
|
|
8407
|
+
cursor: "pointer",
|
|
8408
|
+
fontSize: theme.fontSizes[1],
|
|
8409
|
+
color: theme.colors.text,
|
|
8410
|
+
textAlign: "left"
|
|
8411
|
+
};
|
|
8297
8412
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
8298
8413
|
/* @__PURE__ */ jsx("div", { style: { height: 40, borderBottom: `1px solid ${theme.colors.border}` }, children: /* @__PURE__ */ jsx(ToggleButtons, {}) }),
|
|
8299
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(Content, {}) })
|
|
8414
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(Content, {}) }),
|
|
8415
|
+
contextMenu.visible && createPortal(
|
|
8416
|
+
/* @__PURE__ */ jsxs(
|
|
8417
|
+
"div",
|
|
8418
|
+
{
|
|
8419
|
+
ref: contextMenuRef,
|
|
8420
|
+
style: {
|
|
8421
|
+
position: "fixed",
|
|
8422
|
+
top: contextMenu.y,
|
|
8423
|
+
left: contextMenu.x,
|
|
8424
|
+
backgroundColor: theme.colors.background,
|
|
8425
|
+
border: `1px solid ${theme.colors.border}`,
|
|
8426
|
+
borderRadius: "6px",
|
|
8427
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
|
8428
|
+
zIndex: 1e3,
|
|
8429
|
+
minWidth: "180px",
|
|
8430
|
+
padding: "4px 0",
|
|
8431
|
+
fontFamily: theme.fonts.body,
|
|
8432
|
+
["--theme-bg-tertiary"]: theme.colors.backgroundTertiary
|
|
8433
|
+
},
|
|
8434
|
+
children: [
|
|
8435
|
+
/* @__PURE__ */ jsxs(
|
|
8436
|
+
"button",
|
|
8437
|
+
{
|
|
8438
|
+
onClick: contextMenu.isFolder ? handleOpenFolder : handleOpenFile,
|
|
8439
|
+
className: "context-menu-item",
|
|
8440
|
+
style: contextMenuButtonStyle,
|
|
8441
|
+
children: [
|
|
8442
|
+
contextMenu.isFolder ? /* @__PURE__ */ jsx(FolderOpen, { size: 14 }) : /* @__PURE__ */ jsx(ExternalLink, { size: 14 }),
|
|
8443
|
+
contextMenu.isFolder ? "Open Folder" : "Open File"
|
|
8444
|
+
]
|
|
8445
|
+
}
|
|
8446
|
+
),
|
|
8447
|
+
/* @__PURE__ */ jsx(
|
|
8448
|
+
"div",
|
|
8449
|
+
{
|
|
8450
|
+
style: {
|
|
8451
|
+
height: "1px",
|
|
8452
|
+
backgroundColor: theme.colors.border,
|
|
8453
|
+
margin: "4px 0"
|
|
8454
|
+
}
|
|
8455
|
+
}
|
|
8456
|
+
),
|
|
8457
|
+
/* @__PURE__ */ jsxs(
|
|
8458
|
+
"button",
|
|
8459
|
+
{
|
|
8460
|
+
onClick: handleCopyFullPath,
|
|
8461
|
+
className: "context-menu-item",
|
|
8462
|
+
style: contextMenuButtonStyle,
|
|
8463
|
+
children: [
|
|
8464
|
+
/* @__PURE__ */ jsx(Copy, { size: 14 }),
|
|
8465
|
+
"Copy Full Path"
|
|
8466
|
+
]
|
|
8467
|
+
}
|
|
8468
|
+
),
|
|
8469
|
+
/* @__PURE__ */ jsxs(
|
|
8470
|
+
"button",
|
|
8471
|
+
{
|
|
8472
|
+
onClick: handleCopyRelativePath,
|
|
8473
|
+
className: "context-menu-item",
|
|
8474
|
+
style: contextMenuButtonStyle,
|
|
8475
|
+
children: [
|
|
8476
|
+
/* @__PURE__ */ jsx(FileSymlink, { size: 14 }),
|
|
8477
|
+
"Copy Relative Path"
|
|
8478
|
+
]
|
|
8479
|
+
}
|
|
8480
|
+
)
|
|
8481
|
+
]
|
|
8482
|
+
}
|
|
8483
|
+
),
|
|
8484
|
+
document.body
|
|
8485
|
+
)
|
|
8300
8486
|
] });
|
|
8301
8487
|
};
|
|
8302
8488
|
const GitChangesPanelPreview = () => {
|
|
@@ -8386,6 +8572,17 @@ const GitChangesPanel = ({ context, events }) => {
|
|
|
8386
8572
|
},
|
|
8387
8573
|
[events]
|
|
8388
8574
|
);
|
|
8575
|
+
const handleContextMenuAction = useCallback(
|
|
8576
|
+
(action) => {
|
|
8577
|
+
events == null ? void 0 : events.emit({
|
|
8578
|
+
type: `contextMenu:${action.type}`,
|
|
8579
|
+
source: "git-changes-panel",
|
|
8580
|
+
timestamp: Date.now(),
|
|
8581
|
+
payload: { path: action.path }
|
|
8582
|
+
});
|
|
8583
|
+
},
|
|
8584
|
+
[events]
|
|
8585
|
+
);
|
|
8389
8586
|
return /* @__PURE__ */ jsx(
|
|
8390
8587
|
GitChangesPanelContent,
|
|
8391
8588
|
{
|
|
@@ -8393,7 +8590,8 @@ const GitChangesPanel = ({ context, events }) => {
|
|
|
8393
8590
|
fileTree,
|
|
8394
8591
|
rootPath,
|
|
8395
8592
|
isLoading,
|
|
8396
|
-
onFileClick: handleFileClick
|
|
8593
|
+
onFileClick: handleFileClick,
|
|
8594
|
+
onContextMenuAction: handleContextMenuAction
|
|
8397
8595
|
}
|
|
8398
8596
|
);
|
|
8399
8597
|
};
|